c4d.modules.sculpting.SculptLayer¶
-
class
c4d.modules.sculpting.
SculptLayer
¶ A
SculptLayer
can contain one or moreSculptLayerData
children.New in version R15.037.
Methods Signatures
Get the first layer data for this layer.
|
|
Get the currently used layer data. |
|
Get the number of points this layer has. |
|
Get the offset value for the point index on the layer. This method will get the correct |
|
Set the offset vector for the given point on the layer. |
|
Add an offset vector to the existing offset for the given point on the layer. |
|
Get the mask value for the point (between 0 and 1). |
|
Set the mask value for the point (between 0 and 1). |
|
Add to the existing mask value at this point (between 0 and 1). |
|
Check if this layer has a mask at the current subdivision level. |
|
Clear the mask data for the layer. |
|
Clear all the offset data 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. |
|
Mark the masked point so that any modifications to the mask can be undone. |
|
Check if this layer is the Base Object layer in which case it will have more than one |
|
Check if the mask is enabled for this layer at the current subdivision level. |
|
Set the mask enabled state for the current layer data at this current subdivision level. |
Inheritance
Parent Class:
Methods Documentation
-
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.
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.
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
PolygonObject
for the subdivision level that this layer is at.- Return type
int
- Returns
The number of points.
-
SculptLayer.
GetOffset
(self, index)¶ Get the offset value for the point index on the layer. This method will get the correct
SculptLayerData
for 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.
SetOffset
(self, index, offset)¶ Set the offset vector for the given point on the layer.
Note
This method will get the correct
SculptLayerData
for 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 theSculptObject
display.- 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.
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
SculptLayerData
for 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 theSculptObject
display.- 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.
GetMask
(self, index)¶ Get the mask value for the point (between 0 and 1).
Note
This method will get the correct
SculptLayerData
for 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.
SetMask
(self, index, mask)¶ Set the mask value for the point (between 0 and 1).
Note
This method will get the correct
SculptLayerData
for 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.
AddToMask
(self, index, mask)¶ Add to the existing mask value at this point (between 0 and 1).
Note
This method will get the correct
SculptLayerData
for 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.
HasMask
(self)¶ Check if this layer has a mask at the current subdivision level.
Note
This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.- Return type
bool
- Returns
True if there is a mask, otherwise False.
-
SculptLayer.
ClearMask
(self)¶ Clear the mask data for the layer.
Note
This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
-
SculptLayer.
ClearLayer
(self)¶ Clear all the offset data for this layer.
Note
This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
-
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.
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.
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()
.
-
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()
.
-
SculptLayer.
IsBaseLayer
(self)¶ Check if this layer is the Base Object layer in which case it will have more than one
SculptLayerData
children.- Return type
bool
- Returns
True if this layer is the Base Object layer, False if it is a regular layer.
-
SculptLayer.
IsMaskEnabled
(self)¶ Check if the mask is enabled for this layer at the current subdivision level.
Note
This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.- Return type
bool
- Returns
True* if mask is enabled, otherwise False.
-
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
SculptLayerData
for this layer and call the corresponding method for it.- Parameters
state (bool) – The state of the mask.