c4d.modules.sculpting.SculptLayerData¶
-
class
c4d.modules.sculpting.
SculptLayerData
¶ A
SculptLayerData
node contains all the offset data and mask data for that layer at its subdivision level.New in version R15.037.
Methods Signatures
Get the level that this layer contains data for. |
|
Get the number of points on the polygon object that this layer has. |
|
Get the offset for the given point index on the layer. |
|
Set the offset for the given point index. |
|
Add to the existing offset value at the given point index. |
|
Get the value (between 0 and 1) of the mask at the given point index. |
|
Set the mask at the given point. The value will be clamped between 0 and 1. |
|
Adds the mask at the given point. The value will be clamped between 0 and 1. |
|
Check if this Layer has a mask applied to it. |
|
Clear all the mask data for this layer. |
|
Clear all the offsets for this layer. |
|
Make sure all the data has been allocated to store all the point data. |
|
Make sure all the data has been allocated to store all the mask data. |
|
Mark the point so that any modifications to it can be undone. |
|
Marks the masked point so that any modifications to the mask can be undone. |
Inheritance
Parent Class:
Methods Documentation
-
SculptLayerData.
GetSubdivisionLevel
(self)¶ Get the level that this layer contains data for.
- Return type
int
- Returns
The subdivision level.
-
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.
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 theSculptObject
display.- 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()
.
-
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 theSculptObject
display.- 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.
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
float
- Returns
The mask value for the given point, or None if there was no mask value at that point.
-
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()
.
-
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.
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.
ClearMask
(self)¶ Clear all the mask data for this layer.
-
SculptLayerData.
ClearLayer
(self)¶ Clear all the offsets for this layer.
-
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.
-
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.
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()
.
-
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()
.