This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.PolygonObject – a polygon object class

This is a class for polygon objects.

../../../../../../../../_images/main1.jpg
class c4d.PolygonObject

SuperClass

PointObject

Methods

static PolygonObject.__init__(pcnt, vcnt)
Parameters:
  • pcnt (int) – Point count.
  • vcnt (int) – Polygon count.
Return type:

PolygonObject

Returns:

The object.

PolygonObject.GetPolygonS()

Return the selected polygons.

Return type:BaseSelect
Returns:A reference to the selected polygon structure.
PolygonObject.GetPolygonH()

Return the hidden polygons.

Return type:BaseSelect
Returns:A reference to the hidden polygon structure.
PolygonObject.GetEdgeS()

Return the selected edges.

Return type:BaseSelect
Returns:A reference to the selected edge structure.
PolygonObject.GetEdgeH()

Return the edge polygons.

Return type:BaseSelect
Returns:A reference to the edge polygon structure.
PolygonObject.SetPolygon(id, polygon)

Set a polygon.

Note

Call obj.Message(c4d.MSG_UPDATE) after you set all your points to update the object.

Parameters:
  • id (int) – The index.
  • polygon (CPolygon) – The polygon.
Raises IndexError:
 

The index is out of range.

PolygonObject.ResizeObject(pcnt[, vcnt=-1])

Change the number of points and polygons in the object. If vcnt is -1 or not set, the method of PointObject.resize_object is used.

Parameters:
  • pcnt (int) – The new number of points.
  • vcnt (int) – The new number of polygons.
Return type:

bool

Returns:

Success of changing the number of points and segments.

PolygonObject.GetPhongBreak()

Get the phong break edges. The edges are indexed by 4 * polygon + edge where polygon is the polygon index and edge is the edge index between 0 and 3.

Warning

If you change this selection you must make sure that its still valid, so that shared edges have a well-defined phong break status.

Return type:BaseSelect
Returns:The phong break.
PolygonObject.GetPolygonTranslationMap()

Gets a translation map from polygon indices to N-gon indices.

Return type:list of ints
Returns:A list of index map or None.
PolygonObject.GetAllPolygons()

Returns all polygons.

Return type:list of CPolygon
Returns:A list of copied polygons.
PolygonObject.CreatePhongNormals()

Returns a list with the stored phong normals of the object.

Return type:list of Vectors or None
Returns:Returns the list or None if the object has no Phong Tag.
PolygonObject.GetPolygonCount()

Returns the count of polygons. Is the fastest way to get the count of polygons.

Return type:int
Returns:The count.
PolygonObject.GetNgonCount()

Returns the count of ngons.

Return type:int
Returns:The count.

Table Of Contents

This Page