New in version R15.037.
Get the number of subdivisions that this sculpt object currently has; i.e. how many times it has been subdivided by the user.
Return type: | int |
---|---|
Returns: | The number of subdivision levels. |
Get a copy of the sculpt object at a specific subdivision level.
Return type: | PolygonObject |
---|---|
Returns: | The PolygonObject for the subdivision level. |
Get the original PolygonObject that the SculptTag is applied to.
Return type: | PolygonObject |
---|---|
Returns: | The original PolygonObject. |
Get the number of polygons at the current subdivision level.
Return type: | int |
---|---|
Returns: | The number of polygons. |
Get the number of points at the current subdivision level.
Return type: | int |
---|---|
Returns: | The number of points. |
Gets the current subdivision level that the sculpt object is currently at.
Return type: | int |
---|---|
Returns: | The current subdivision level. |
Get the amount of memory currently used for this sculpt object. This does not include any memory used by OpenGL.
Return type: | int |
---|---|
Returns: | The memory used in bytes. |
Get the currently layer, or folder, selected for this sculpt object.
Return type: | SculptLayerBase |
---|---|
Returns: | The current sculpt layer or folder. |
Create a new layer on the sculpt object at the current subdivision level.
Return type: | SculptLayer |
---|---|
Returns: | The sculpt layer added. |
Create a new folder for the sculpt object.
Return type: | SculptFolder |
---|---|
Returns: | The sculpt folder added. |
Deletes the currently selected layer (or folder) on the sculpt object (as specified in the Sculpting Layer Manager UI).
Note
If the currently selected layer is a folder then it will only delete the folder if all the layers that are contained in that folder are at the same subdivision level as the current subdivion level.
Return type: | bool |
---|---|
Returns: | True if the layer was deleted, otherwise False. |
Recomposites all the layers and updates the sculpt object.
Get the vertex normal for the polygon object at index and at the current subdivision level.
Parameters: | index (int) – The index of the vertex. |
---|---|
Raises IndexError: | |
If the vertex index is out of range : 0<=index<GetPointCount(). | |
Return type: | Vector |
Returns: | The vertex normal. |
Get read-only access to the point at index that will be used for the polygon object at the current subdivision level.
Parameters: | index (int) – The index of the point. |
---|---|
Raises IndexError: | |
If the point index is out of range : 0<=index<GetPointCount(). | |
Return type: | Vector |
Returns: | The point. |
Subdivide the sculpt object to the next level.
Note
This method will only work if the sculpt object is already at the top most level and the memory limit (as specified in the preferences) has not been exceeded and also only if there is enough memory on the user’s computer to successfully do the subdivision.
Return type: | bool |
---|---|
Returns: | True if the object was successfully subdivided, otherwise False. |
Increase the subdivision level to the next highest level. If it is already at the top subdivision level then it will do nothing.
Return type: | bool |
---|---|
Returns: | True if it was able go up a level, otherwise False. |
Decrease the subdivision level to the down one level. If it is already at level 0 then it will do nothing.
Return type: | bool |
---|---|
Returns: | True if it was able go down a level, otherwise False. |
Get the first layer. This is usually the Base Object layer.
Return type: | SculptLayerBase |
---|---|
Returns: | The first layer. |
Get the Base Object layer, which is the special layer that has multiple SculptLayerData children, one for each subdivison level, that allows the user to sculpt on while at any subdivision level.
Return type: | SculptLayerBase |
---|---|
Returns: | The Base Object layer. |
Check if the sculpt object is frozen. This is also able to be set on the SculptTag in CINEMA 4D’s UI.
Return type: | bool |
---|---|
Returns: | True if the object is frozen, otherwise False. |
Sets the frozen state of the sculpt object. In CINEMA 4D UI this is shown in the SculptTag. When the object is frozen no changes to the sculpt object or any of its layers are allowed.
Note
If the polygon object has a Phong tag it will also become active when the sculpt object is frozen. When not Frozen then the sculpt object uses its own internal vertex normals and disables the Phong tag on the polygonobject.
Parameters: | frozen (bool) – The frozen state. |
---|
Check if the object allows to be deformed by any deformers. This is also able to be set on the SculptTag in CINEMA 4D’s UI.
Note
This option only works if the object is also frozen. When both these options are enabled, any deformers that are children of the polygon object that the sculpt tag is applied to, will be able to deform the object in the viewport.
Return type: | bool |
---|---|
Returns: | True if the sculpt object allows deformations, otherwise False. |
Set the Allow Deformations checkbox thereby allowing any deformers to have an effect on the display of the sculpt object, as long as it is also frozen. This option can also be found in the SculptTag‘s UI.
Parameters: | frozen (state) – True to allow deformations. |
---|
Updates any collision data after any changes to the sculpt layer offsets have been made. This is required before you call the HitScreen()/HitObject() methods.
Tells the sculpt object that it requires a collision update before the user tries to use any of the sculpt tools. Then next time a user tries to use a tool it will first call UpdateCollision() to ensure that the HitScreen()/HitObject() calls will be correct.
Parameters: | fullUpdate (bool) – Set to True to update the full mesh. This is not always required. |
---|
From a viewport cast a ray, in screen space, onto the sculpt object and return any data if the ray hits the object. This will return the closest hit point if multiple intersections are found.
Note
To use the Hit functions the mesh must be unfrozen and both NeedCollisionUpdate(True) and UpdateCollision() should be called to initialize the collision data.
Parameters: | |
---|---|
Return type: | dict{distance: float, normal: Vector, point: Vector, polygon: int} |
Returns: | The intersection data will be returned if the object was hit: distance: The distance from the ray point. normal: The normal of the hitpoint on the surface of the object in its local coordinate system. point: Location of the hit point on the surface of the object in its local coordinate system. polygon: The polygon that was hit. |
Given a ray in object space do a hit intersection against the sculpt object and return any data if the ray hits the object. This will return the closest hit point if multiple intersections are found.
Note
To use the Hit functions the mesh must be unfrozen and both NeedCollisionUpdate(True) and UpdateCollision() should be called to initialize the collision data.
Parameters: | |
---|---|
Return type: | dict{distance: float, normal: Vector, point: Vector, polygon: int} |
Returns: | The intersection data will be returned if the object was hit: distance: The distance from the ray point. normal: The normal of the hitpoint on the surface of the object in its local coordinate system. point: Location of the hit point on the surface of the object in its local coordinate system. polygon: The polygon that was hit. |
Call before any calls to AddOffset(), SetOffset(), AddToMask() or SetMask() if you wish it to be undone. This will only work if you are only making changes to a single layer. Changes to multiple layers or layers at different levels is not allowed.
Note
The method EndUndo() must be called after all calls to the above functions have been done.
Must be called after StartUndo() once all the points and masks have been changed on the layers.
Smooth the sculpt object and apply the offsets to the currently selected layer.
Parameters: |
|
---|
New in version R16.021.
Gets the mask value from the mask cache.
Parameters: | id (int) – The index of the point. |
---|---|
Raises IndexError: | |
If the point index is out of range : 0<=index<GetPointCount(). | |
Return type: | float |
Returns: | The mask cache value. |
New in version R16.021.
Updates the mask on the sculpt object.
Parameters: | full (bool) – Pass True to force a full update of the mask. |
---|
New in version R16.021.
Initializes the sculpt object for the given viewport for OpenGL use. Private.
Parameters: | bd (BaseDraw) – The viewport that is being updated. If None then the currently active view will be used. |
---|
New in version R16.021.
Note
This method only works when the selected object being sculpted on is by a tool and is a Polygon Object without a SculptTag.
Parameters: | index (int) – The index of the point. |
---|---|
Raises IndexError: | |
If the point index is out of range : 0<=index<GetPointCount(). | |
Return type: | bool |
Returns: | True if the point was selected, False if not. |
New in version R16.021.
Note
This method only works when the selected object being sculpted on is by a tool and is a Polygon Object without a SculptTag.
Parameters: | index (int) – The index of the polygon. |
---|---|
Raises IndexError: | |
If the polygon index is out of range : 0<=index<GetPolygonCount(). | |
Return type: | bool |
Returns: | True if the polygon was selected, False if not. |
New in version R16.021.
Gets the Polygon at the given index.
Parameters: | index (int) – The index of the polygon. |
---|---|
Raises IndexError: | |
If the polygon index is out of range : 0<=index<GetPolygonCount(). | |
Return type: | CPolygon |
Returns: | The Polygon if it was found, otherwise None. |
New in version R16.021.
Note
In SculptBrushToolData.FloodSelectedLayer() calls it returns the same as GetOriginalObject() when sculpting on a Polygon Object that have no SculptTag.
Return type: | PolygonObject |
---|---|
Returns: | The Polygon Object displayed in the viewport. |