Python access to PointCloud & Mesh

Discussions concerning programming of SOFTIMAGE©
User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 14:00

Python access to PointCloud & Mesh

Post by TwinSnakes007 » 15 Jul 2012, 17:55

Any example code on how to access the Transform and other properties from each Point in a PointCloud via Python?

Also, some code to access Mesh data via Python?

Thanks

-TS-

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 13:31
Skype: csaezmargotta
Location: Sydney, Australia

Re: Python access to PointCloud & Mesh

Post by csaez » 15 Jul 2012, 20:26

TwinSnakes007 wrote:Any example code on how to access the Transform and other properties from each Point in a PointCloud via Python?

Code: Select all

from siutils import si, log

oPCloud = si.Selection(0)
oGeo = oPCloud.ActivePrimitive.Geometry
lData = oGeo.ICEAttributes("PointPosition").DataArray
for i, oVector in enumerate(lData):
	log("ID: %d" % i)
	log("PointPosition: %s" % str(oVector.Get2()))
	log("---")
Also, some code to access Mesh data via Python?

Code: Select all

from siutils import si, log

oCube = si.Selection(0)
oGeo = oCube.ActivePrimitive.Geometry
lPoints = oGeo.Points
for i, oPoint in enumerate(lPoints):
   log("ID: %d" % i)
   log("PointPosition: %s" % str(oPoint.Position.Get2()))
   log("---")
http://download.autodesk.com/global/doc ... metry.html ;)

* Added url tags around link - Eric T.

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 14:00

Re: Python access to PointCloud & Mesh

Post by TwinSnakes007 » 16 Jul 2012, 00:27

Thank you very much.

:D