c4d.modules.sculpting.SculptLayer

class c4d.modules.sculpting.SculptLayer

A SculptLayer can contain one or more SculptLayerData children.

New in version R15.037.

Parent Class:

Overview

Layer Lifecycle

SculptLayer.ClearLayer()

Clear all the offset data for this layer.

SculptLayer.GetCurrentSculptLayer()

Get the currently used layer data.

SculptLayer.GetFirstSculptLayer()

Get the first layer data for this layer.

SculptLayer.IsBaseLayer()

Check if this layer is the Base Object layer in which case it will have more than one SculptLayerData children.

Mask Controls

SculptLayer.AddToMask()

Add to the existing mask value at this point (between 0 and 1).

SculptLayer.ClearMask()

Clear the mask data for the layer.

SculptLayer.GetMask()

Get the mask value for the point (between 0 and 1).

SculptLayer.HasMask()

Check if this layer has a mask at the current subdivision level.

SculptLayer.InitializeAllMaskData()

Make sure all the data has been allocated to store all the mask data.

SculptLayer.IsMaskEnabled()

Check if the mask is enabled for this layer at the current subdivision level.

SculptLayer.SetMask()

Set the mask value for the point (between 0 and 1).

SculptLayer.SetMaskEnabled()

Set the mask enabled state for the current layer data at this current subdivision level.

SculptLayer.TouchMaskForUndo()

Mark the masked point so that any modifications to the mask can be undone.

Point Offsets

SculptLayer.AddOffset()

Add an offset vector to the existing offset for the given point on the layer.

SculptLayer.GetOffset()

Get the offset value for the point index on the layer.

SculptLayer.GetPointCount()

Get the number of points this layer has.

SculptLayer.InitializeAllPointData()

Make sure all the data has been allocated to store all the point data.

SculptLayer.SetOffset()

Set the offset vector for the given point on the layer.

SculptLayer.TouchPointForUndo()

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 SculptLayerData for 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 as GetFirstSculptLayer().
Return type

c4d.modules.sculpting.SculptLayerData

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

c4d.modules.sculpting.SculptLayerData

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 SculptLayerData children.

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 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.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.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.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.InitializeAllMaskData(self)

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.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.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.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.

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 SculptLayerData for this layer and call the corresponding method for it.

Warning

Be sure to call SculptObject.Update() after all changes to the offets have been made.
This will update the SculptObject 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.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

c4d.Vector

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 PolygonObject for 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() 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.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 call SculptObject.Update() after all changes to the offets have been made.
This will update the SculptObject 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.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().