SculptLayer
¶
New in version R15.037.
A
SculptLayer
can contain one or more
SculptLayerData
children.
c4d.modules.sculpting.
SculptLayer
¶
c4d.modules.sculpting.SculptLayerBase
SculptLayer.
GetFirstSculptLayer
(
)
¶
Get the first layer data for this layer. The Base Object layer will have more than one, other layers only have 1.
Return type: | c4d.modules.sculpting.SculptLayerData |
---|---|
Returns: | The first sculpt layer data. |
SculptLayer.
GetCurrentSculptLayer
(
)
¶
Get the currently used layer data. 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 as
GetFirstSculptLayer()
.
Return type: | c4d.modules.sculpting.SculptLayerData |
---|---|
Returns: | The current sculpt layer data. |
SculptLayer.
GetPointCount
(
)
¶
Get the number of points this layer has. 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
(
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: | c4d.Vector |
Returns: | The offset of the point. |
SculptLayer.
SetOffset
(
index
,
offset
)
¶
Set the offset vector for the given point on the layer. This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
Note
Be sure to call
SculptObject.Update()
after all changes to the offets have been made. This will update the
SculptObject
display.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
|
SculptLayer.
AddOffset
(
index
,
offset
)
¶
Add an offset vector to the existing offset for the given point on the layer. This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
Note
Be sure to call
SculptObject.Update()
after all changes to the offets have been made. This will update the
SculptObject
display.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
|
SculptLayer.
GetMask
(
index
)
¶
Get the mask value for the point (between 0 and 1). 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
(
index
,
mask
)
¶
Set the mask value for the point (between 0 and 1). This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
|
SculptLayer.
AddToMask
(
index
,
mask
)
¶
Add to the existing mask value at this point (between 0 and 1). This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
Parameters: |
|
---|---|
Raises: |
IndexError
– If the point
index
is out of range :
0<=index<
|
SculptLayer.
HasMask
(
)
¶
Check if this layer has a mask at the current subdivision level. 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
(
)
¶
Clear the mask data for the layer. This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
SculptLayer.
ClearLayer
(
)
¶
Clear all the offset data for this layer. This method will get the correct
SculptLayerData
for this layer and call the corresponding method for it.
SculptLayer.
InitializeAllPointData
(
)
¶
Make sure all the data has been allocated to store all the point data.
Note
If you are going to call
SetOffset()
or
AddOffset()
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()
and
AddOffset()
will only allocate data if required.
SculptLayer.
InitializeAllMaskData
(
)
¶
Make sure all the data has been allocated to store all the mask data.
Note
If you are going to call
SetMask()
or
AddToMask()
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()
and
AddToMask()
will only allocate data if required.
SculptLayer.
TouchPointForUndo
(
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
(
)
¶
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
(
)
¶
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
(
)
¶
Check if the mask is enabled for this layer at the current subdivision level. 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
(
state
)
¶
Set the mask enabled
state
for the current layer data at this current subdivision level. 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. |
---|