c4d.modules.sculpting.SculptLayerData¶
-
class
c4d.modules.sculpting.SculptLayerData¶ A
SculptLayerDatanode contains all the offset data and mask data for that layer at its subdivision level.New in version R15.037.
Parent Class:
Overview¶
Layer Data |
|
Clear all the offsets for this layer. |
|
Get the number of points on the polygon object that this layer has. |
|
Get the level that this layer contains data for. |
|
Make sure all the data has been allocated to store all the mask data. |
|
Make sure all the data has been allocated to store all the point data. |
|
Mask Data |
|
Adds the mask at the given point. |
|
Clear all the mask data for this layer. |
|
Get the value (between 0 and 1) of the mask at the given point index. |
|
Check if this Layer has a mask applied to it. |
|
Set the mask at the given point. |
|
Offset Editing |
|
Add to the existing offset value at the given point index. |
|
Get the offset for the given point index on the layer. |
|
Set the offset for the given point index. |
|
Undo Tracking |
|
Marks the masked point so that any modifications to the mask can be undone. |
|
Mark the point so that any modifications to it can be undone. |
|
Members¶
Layer Data¶
-
SculptLayerData.ClearLayer(self)¶ Clear all the offsets for this layer.
-
SculptLayerData.GetPointCount(self)¶ Get the number of points on the polygon object that this layer has.
- Return type
int
- Returns
Number of points on the polygon object.
-
SculptLayerData.GetSubdivisionLevel(self)¶ Get the level that this layer contains data for.
- Return type
int
- Returns
The subdivision level.
-
SculptLayerData.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.
-
SculptLayerData.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.
Mask Data¶
-
SculptLayerData.AddToMask(self, index, mask)¶ Adds the mask at the given point. The value will be clamped between 0 and 1.
- Parameters
index (int) – Index of the point on the polygon object.
mask (float) – The amount to add to the existing mask.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
-
SculptLayerData.ClearMask(self)¶ Clear all the mask data for this layer.
-
SculptLayerData.GetMask(self, index)¶ Get the value (between 0 and 1) of the mask at the given point index.
- Parameters
index (int) – Index of the point on the polygon object.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().- Return type
Optional[float]
- Returns
The mask value for the given point, or None if there was no mask value at that point.
-
SculptLayerData.HasMask(self)¶ Check if this Layer has a mask applied to it.
- Return type
bool
- Returns
True if if there is mask data, otherwise False.
-
SculptLayerData.SetMask(self, index, mask)¶ Set the mask at the given point. The value will be clamped between 0 and 1.
- Parameters
index (int) – Index of the point on the polygon object.
mask (float) – The mask value to set.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
Offset Editing¶
-
SculptLayerData.AddOffset(self, index, offset)¶ Add to the existing offset value at the given point index.
Note
Be sure to callSculptObject.Update()after all changes to the offsets have been made.This will update theSculptObjectdisplay.- Parameters
index (int) – Index of the point on the polygon object.
offset (c4d.Vector) – The offset to add.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
-
SculptLayerData.GetOffset(self, index)¶ Get the offset for the given point index on the layer.
- Parameters
index (int) – Index of the point on the polygon object.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().- Return type
- Returns
The offset of the point.
-
SculptLayerData.SetOffset(self, index, offset)¶ Set the offset for the given point index.
Note
Be sure to callSculptObject.Update()after all changes to the offets have been made.This will update theSculptObjectdisplay.- Parameters
index (int) – Index of the point on the polygon object.
offset (c4d.Vector) – The full offset to set.
- Raises
IndexError – If the point index is out of range : 0<=index<
GetPointCount().
Undo Tracking¶
-
SculptLayerData.TouchMaskForUndo(self, index)¶ Marks 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().
-
SculptLayerData.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().