c4d.utils.PolygonReduction
¶
New in version R19.
Performs polygon reduction for a polygon object.
See also
Definition¶

class
c4d.utils.
PolygonReduction
¶
PolygonReduction.PreProcess()
PolygonReduction.IsPreprocessing()
PolygonReduction.StopPreprocessing()
PolygonReduction.Reset()
PolygonReduction.SetReductionStrengthLevel()
PolygonReduction.SetTriangleLevel()
PolygonReduction.SetVertexLevel()
PolygonReduction.SetRemainingEdgesLevel()
PolygonReduction.GetReductionStrengthLevel()
PolygonReduction.GetTriangleLevel()
PolygonReduction.GetVertexLevel()
PolygonReduction.GetRemainingEdgesLevel()
PolygonReduction.GetMaxReductionStrengthLevel()
PolygonReduction.GetMaxTriangleLevel()
PolygonReduction.GetMaxVertexLevel()
PolygonReduction.GetMaxRemainingEdgesLevel()
PolygonReduction.GetMinTriangleLevel()
PolygonReduction.GetMinVertexLevel()
Members¶

PolygonReduction.
__init__
()¶ Creates a polygon reduction object.
Return type: c4d.utils.PolygonReduction Returns: A new polygon reduction object.

PolygonReduction.
PreProcess
(data)¶ Starts the background or synchronous preprocessing that sets up the polygon reduction cache.
Parameters: data (dict) – The data for the reduction. See PolygonReductionData Dictionary. Return type: bool Returns: True if successful, otherwise False.

PolygonReduction.
IsPreprocessing
()¶ Checks whether the background preprocessing thread is still running.
Return type: bool Returns: True if preprocessing is ongoing, otherwise False.

PolygonReduction.
StopPreprocessing
()¶ Aborts preprocessing if it is running in the background. Resets the interactive settings values.

PolygonReduction.
Reset
()¶ Aborts preprocessing if it is running in the background and frees all temporary data.

PolygonReduction.
SetReductionStrengthLevel
(strengthLevel)¶ Sets the reduction strength level if the desired level is different than the current one.
Parameters: strengthLevel (float) – The desired reduction strength level. Return type: bool Returns: True if successful, otherwise False.

PolygonReduction.
SetTriangleLevel
(desiredLevel)¶ Reduces or restores the mesh to the desired number of triangles.
Note
If the desired level is different than the current level, at least one edge collapse or restore will be performed.The actual resulting number of triangles may be slightly different.Parameters: desiredLevel (int) – The desired number of triangles on call. Return type: bool Returns: True if successful, otherwise False.

PolygonReduction.
SetVertexLevel
(desiredLevel)¶ Reduces or restores the mesh to the desired number of vertices.
Note
If the desired level is different than the current level, at least one edge collapse or restore will be performed.The actual resulting number of vertices may be slightly different.Parameters: desiredLevel (int) – The desired number of vertices on call. Return type: bool Returns: True if successful, otherwise False.

PolygonReduction.
SetRemainingEdgesLevel
(desiredLevel)¶ Reduces or restores the mesh to the desired number of edges remaining to collapse.
Note
If the desired level is different than the current level, at least one edge collapse or restore will be performed.The actual resulting number of edges may be slightly different.Parameters: desiredLevel (int) – The desired number of collapse stack. Return type: bool Returns: True if successful, otherwise False.

PolygonReduction.
GetReductionStrengthLevel
()¶ Queries the current reduction strength level.
Return type: int Returns: The reduction strength percentage: 0 means no reduction performed, 1 means maximum reduction performed.

PolygonReduction.
GetTriangleLevel
()¶ Queries the current triangle count.
Return type: int Returns: The triangle count.

PolygonReduction.
GetVertexLevel
()¶ Queries the current vertex count.
Return type: int Returns: The vertex count.

PolygonReduction.
GetRemainingEdgesLevel
()¶ Queries the current remaining number of edges available to collapse.
Return type: int Returns: The remaining edges level.

PolygonReduction.
GetMaxReductionStrengthLevel
()¶ Queries the maximum reduction strength percentage.
Return type: float Returns: The maximum reduction strength percentage. Always 1.0.

PolygonReduction.
GetMaxTriangleLevel
()¶ Queries the triangle count when no reduction has been performed.
Return type: int Returns: The maximum triangle count.

PolygonReduction.
GetMaxVertexLevel
()¶ Queries the vertex count when no reduction has been performed.
Return type: int Returns: The maximum vertex count.

PolygonReduction.
GetMaxRemainingEdgesLevel
()¶ Queries the total number of possible edge collapses.
Return type: int Returns: The maximum collapse count.

PolygonReduction.
GetMinTriangleLevel
()¶ Queries the triangle count when complete reduction has been performed.
Return type: int Returns: The minimum triangle count. May be nonzero if border constraints are enabled.

PolygonReduction.
GetMinVertexLevel
()¶ Queries the vertex count when complete reduction has been performed.
Return type: int Returns: The minimum vertex count. May be nonzero if border constraints are enabled.

PolygonReduction.
GetData
()¶ Retrieves the associated data for the polygon reduction.
Return type: dict Returns: The associated data. See PolygonReductionData Dictionary.

PolygonReduction.
IsValid
()¶ Checks if a valid object and a valid document are associated with the
PolygonReduction
instance.Return type: bool Returns: True if the PolygonReduction
instance is valid, otherwise False.
PolygonReductionData Dictionary¶
The dictionary stores information required for polygon reduction:
 _doc:
BaseDocument
: The document.  _op:
c4d.PolygonObject
: The polygon object to be reduced.  _thread:
c4d.threading.BaseThread
: The caller thread. Set to None if synchronous preprocessing calculation is needed (e.g. during rendering).  _settings:
c4d.BaseContainer
: The reduction constraints settings. See opolyreduxgen.h