Get Polygons
-
On 05/11/2015 at 11:30, xxxxxxxx wrote:
Is there a way to get Polygons from BaseObjects() ?
-
On 05/11/2015 at 12:34, xxxxxxxx wrote:
Only if the BaseObject is a PolygonObject.
So, you need to check the type of the object (GetType), cast to PolygonObject, and use GetPolygonR (or W) to access the polys.
-
On 05/11/2015 at 13:21, xxxxxxxx wrote:
ok - and otherwise there is no way to gain access to the position of a point in a parametric object?
-
On 05/11/2015 at 14:56, xxxxxxxx wrote:
For parametric and deformed objects, you should check out the documentation for GetCache(), GetDeformCache(), and perhaps HierarchyHelp. The internal caches can be complete hierarchies that need to be traversed but should ultimately resolve to PolygonObjects.
-
On 06/11/2015 at 03:50, xxxxxxxx wrote:
GetCache().GetClone() returns only the non deformed geometry of an parametric object.
this works for me:
surface = gen[c4d.MG_OBJECT_LINK] surface2list = [surface] doc.SetActiveObject(None) settings = c4d.BaseContainer() settings.SetBool(c4d.MDATA_CURRENTSTATETOOBJECT_INHERITANCE, True) polysurface = c4d.utils.SendModelingCommand(c4d.MCOMMAND_CURRENTSTATETOOBJECT, surface2list, bc=settings, doc=doc) polys = polysurface[0].GetAllPolygons() points = polysurface[0].GetAllPoints()
-
On 06/11/2015 at 05:11, xxxxxxxx wrote:
Cairyn was actually right. He didn't only mention GetCache(), but also GetDeformCache(). If you look at the code example given for GetCache(), you see that both are used in conjunction to get the caches for more complex hierarchies.