c4d.modules.sculpting.SculptLayer¶
-
class
c4d.modules.sculpting.SculptLayer¶ A
SculptLayercan contain one or moreSculptLayerDatachildren.New in version R15.037.
Parent Class:
Overview¶
Layer Lifecycle |
|
Clear all the offset data for this layer. |
|
Get the currently used layer data. |
|
Get the first layer data for this layer. |
|
Check if this layer is the Base Object layer in which case it will have more than one |
|
Mask Controls |
|
Add to the existing mask value at this point (between 0 and 1). |
|
Clear the mask data for the layer. |
|
Get the mask value for the point (between 0 and 1). |
|
Check if this layer has a mask at the current subdivision level. |
|
Make sure all the data has been allocated to store all the mask data. |
|
Check if the mask is enabled for this layer at the current subdivision level. |
|
Set the mask value for the point (between 0 and 1). |
|
Set the mask enabled state for the current layer data at this current subdivision level. |
|
Mark the masked point so that any modifications to the mask can be undone. |
|
Point Offsets |
|
Add an offset vector to the existing offset for the given point on the layer. |
|
Get the offset value for the point index on the layer. |
|
Get the number of points this layer has. |
|
Make sure all the data has been allocated to store all the point data. |
|
Set the offset vector for the given point on the layer. |
|
Mark the point so that any modifications to it can be undone. |
|
Members¶
Layer Lifecycle¶
-
SculptLayer.ClearLayer(self)¶ Clear all the offset data for this layer.
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.
-
SculptLayer.GetCurrentSculptLayer(self)¶ Get the currently used layer data.
Note
In the case of the Base Object layer it will get the data for the current subdivision level.For all other layers it will return the same asGetFirstSculptLayer().- Return type
- Returns
The current sculpt layer data.
-
SculptLayer.GetFirstSculptLayer(self)¶ - Get the first layer data for this layer.The Base Object layer will have more than one, other layers only have 1.
- Return type
- Returns
The first sculpt layer data.
-
SculptLayer.IsBaseLayer(self)¶ Check if this layer is the Base Object layer in which case it will have more than one
SculptLayerDatachildren.- Return type
bool
- Returns
True if this layer is the Base Object layer, False if it is a regular layer.
Mask Controls¶
-
SculptLayer.AddToMask(self, index, mask)¶ Add to the existing mask value at this point (between 0 and 1).
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.- Parameters
index (int) – The index of the point on the layer.
mask (float) – The value to add to the mask.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
-
SculptLayer.ClearMask(self)¶ Clear the mask data for the layer.
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.
-
SculptLayer.GetMask(self, index)¶ Get the mask value for the point (between 0 and 1).
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.- Parameters
index (int) – The index of the point on the layer.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().- Return type
float
- Returns
The mask value for the given point.
-
SculptLayer.HasMask(self)¶ Check if this layer has a mask at the current subdivision level.
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.- Return type
bool
- Returns
True if there is a mask, otherwise False.
-
SculptLayer.InitializeAllMaskData(self)¶ Make sure all the data has been allocated to store all the mask data.
Note
If you are going to call
SetMask()orAddToMask()from multiple threads then the data needs to be initialized before these calls are made.Note
If you are not using multiple threads the calls to
SetMask()andAddToMask()will only allocate data if required.
-
SculptLayer.IsMaskEnabled(self)¶ Check if the mask is enabled for this layer at the current subdivision level.
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.- Return type
bool
- Returns
True* if mask is enabled, otherwise False.
-
SculptLayer.SetMask(self, index, mask)¶ Set the mask value for the point (between 0 and 1).
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.- Parameters
index (int) – The index of the point on the layer.
mask (float) – The mask value for the given point.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
-
SculptLayer.SetMaskEnabled(self, state)¶ Set the mask enabled state for the current layer data at this current subdivision level.
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.- Parameters
state (bool) – The state of the mask.
-
SculptLayer.TouchMaskForUndo(self, index)¶ Mark the masked point so that any modifications to the mask can be undone.
Note
Must be called after
SculptObject.StartUndo().Warning
This method cannot be called from multiple threads.
- Parameters
index (int) – The index of the point on the layer.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
Point Offsets¶
-
SculptLayer.AddOffset(self, index, offset)¶ Add an offset vector to the existing offset for the given point on the layer.
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.Warning
Be sure to callSculptObject.Update()after all changes to the offets have been made.This will update theSculptObjectdisplay.- Parameters
index (int) – The index of the point on the layer.
offset (c4d.Vector) – The offset to add.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
-
SculptLayer.GetOffset(self, index)¶ Get the offset value for the point index on the layer. This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.- Parameters
index (int) – The index of the point on the layer.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().- Return type
- Returns
The offset of the point.
-
SculptLayer.GetPointCount(self)¶ Get the number of points this layer has.
Note
The point count will be the same as the number of points on the
PolygonObjectfor the subdivision level that this layer is at.- Return type
int
- Returns
The number of points.
-
SculptLayer.InitializeAllPointData(self)¶ Make sure all the data has been allocated to store all the point data.
Note
If you are going to call
SetOffset()orAddOffset()from multiple threads then the data needs to be initialized before these calls are made.Note
If you are not using multiple threads the calls to
SetOffset()andAddOffset()will only allocate data if required.
-
SculptLayer.SetOffset(self, index, offset)¶ Set the offset vector for the given point on the layer.
Note
This method will get the correct
SculptLayerDatafor this layer and call the corresponding method for it.Warning
Be sure to callSculptObject.Update()after all changes to the offets have been made.This will update theSculptObjectdisplay.- Parameters
index (int) – The index of the point on the layer.
offset (c4d.Vector) – The full offset to set.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
-
SculptLayer.TouchPointForUndo(self, index)¶ Mark the point so that any modifications to it can be undone.
Note
Must be called after
SculptObject.StartUndo().Warning
This method cannot be called from multiple threads.
- Parameters
index (int) – The index of the point on the layer.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().