PDA

View Full Version : Accessing coordinates of verticies using Python?


Array
05-09-2008, 05:08 PM
Hey guys,

I've been learning Python within the context of some 3d apps, specifically Houdini Apprentice and XSI Essentials...anywho, I was wondering if anyone know how to access the coordinates of the verticies of a polygon mesh in XSI using Python?

CiaranM
05-09-2008, 06:18 PM
Hi,
sorry not much help with the particulars of Python, but as far as the SDK goes, good start for you would be the positionArray property of a pointCollection object.
http://softimage.wiki.avid.com/sdkdocs/PointCollection_PositionArray.htm

ThE_JacO
05-09-2008, 06:39 PM
oSel = Application.Selection(0) #to get the first object in the selection
tupPP = oSel.ActivePrimitive.Geometry.Points.PositionArray #get the postion array as a 3xN tuple

Array
05-09-2008, 07:06 PM
Thanks guys!

Array
05-09-2008, 08:26 PM
Hmmmm, am I correct in understanding that oSel.ActivePrimitive.Geometry.Points.PositionArray
returns points in local coordinates? Is there a way to get them as globals?

ThE_JacO
05-09-2008, 09:51 PM
get the kine of the same object and push them through the kine.global matrix.
in python you can map a lambda function making it pretty much instantaneous even with a big mesh.

CGTalk Moderation
05-09-2008, 09:51 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.