c4d.utils.PolygonReduction¶
-
class
c4d.utils.
PolygonReduction
¶ Performs polygon reduction for a polygon object.
New in version R19.
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 pre-processing calculation is needed (e.g. during rendering)._settings:
c4d.BaseContainer
: The reduction constraints settings. See opolyreduxgen.h.
Methods Signatures
Creates a polygon reduction object. |
Starts the background or synchronous preprocessing that sets up the polygon reduction cache. |
|
Checks whether the background preprocessing thread is still running. |
|
Aborts preprocessing if it is running in the background. Resets the interactive settings values. |
|
Aborts preprocessing if it is running in the background and frees all temporary data. |
|
|
Sets the reduction strength level if the desired level is different than the current one. |
Reduces or restores the mesh to the desired number of triangles. |
|
Reduces or restores the mesh to the desired number of vertices. |
|
Reduces or restores the mesh to the desired number of edges remaining to collapse. |
|
Queries the current reduction strength level. |
|
Queries the current triangle count. |
|
Queries the current vertex count. |
|
Queries the current remaining number of edges available to collapse. |
|
Queries the maximum reduction strength percentage. |
|
Queries the triangle count when no reduction has been performed. |
|
Queries the vertex count when no reduction has been performed. |
|
Queries the total number of possible edge collapses. |
|
Queries the triangle count when complete reduction has been performed. |
|
Queries the vertex count when complete reduction has been performed. |
|
Retrieves the associated data for the polygon reduction. |
|
Checks if a valid object and a valid document are associated with the |
Methods Documentation
-
PolygonReduction.
__init__
(self)¶ Creates a polygon reduction object.
- Return type
- Returns
A new polygon reduction object.
-
PolygonReduction.
PreProcess
(self, 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
(self)¶ Checks whether the background preprocessing thread is still running.
- Return type
bool
- Returns
True if preprocessing is ongoing, otherwise False.
-
PolygonReduction.
StopPreprocessing
(self)¶ Aborts preprocessing if it is running in the background. Resets the interactive settings values.
-
PolygonReduction.
Reset
(self)¶ Aborts preprocessing if it is running in the background and frees all temporary data.
-
PolygonReduction.
SetReductionStrengthLevel
(self, 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
(self, 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
(self, 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
(self, 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
(self)¶ 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
(self)¶ Queries the current triangle count.
- Return type
int
- Returns
The triangle count.
-
PolygonReduction.
GetVertexLevel
(self)¶ Queries the current vertex count.
- Return type
int
- Returns
The vertex count.
-
PolygonReduction.
GetRemainingEdgesLevel
(self)¶ Queries the current remaining number of edges available to collapse.
- Return type
int
- Returns
The remaining edges level.
-
PolygonReduction.
GetMaxReductionStrengthLevel
(self)¶ Queries the maximum reduction strength percentage.
- Return type
float
- Returns
The maximum reduction strength percentage. Always 1.0.
-
PolygonReduction.
GetMaxTriangleLevel
(self)¶ Queries the triangle count when no reduction has been performed.
- Return type
int
- Returns
The maximum triangle count.
-
PolygonReduction.
GetMaxVertexLevel
(self)¶ Queries the vertex count when no reduction has been performed.
- Return type
int
- Returns
The maximum vertex count.
-
PolygonReduction.
GetMaxRemainingEdgesLevel
(self)¶ Queries the total number of possible edge collapses.
- Return type
int
- Returns
The maximum collapse count.
-
PolygonReduction.
GetMinTriangleLevel
(self)¶ Queries the triangle count when complete reduction has been performed.
- Return type
int
- Returns
The minimum triangle count. May be non-zero if border constraints are enabled.
-
PolygonReduction.
GetMinVertexLevel
(self)¶ Queries the vertex count when complete reduction has been performed.
- Return type
int
- Returns
The minimum vertex count. May be non-zero if border constraints are enabled.
-
PolygonReduction.
GetData
(self)¶ Retrieves the associated data for the polygon reduction.
- Return type
dict
- Returns
The associated data. See PolygonReductionData Dictionary.
-
PolygonReduction.
IsValid
(self)¶ 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.