- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# LayerMeshData Class Reference

This reference page is linked to from the following overview topics: Scene Graph, Layers and Viewport Filters, Sculpt Layers.

Search for all occurrences

## Detailed Description

This class represents a Sculpt Layer.

A sculpt layer stores offsets (deltas) to the vertex positions of a mesh. When the layer is visible, the offsets are added to the mesh (scaled according to the transparency factor). Sculpt layers also support Masking, where each vertex in the sculpt layer also has a mask value, which it is multiplied by. This allows the content of the layer to be attenuated locally (using the mask) or globally (using the transparency value) with no loss of data.

Sculpt layers only keep offset information for those vertices that have actually changed. For that reason, the index of a vertex within a sculpt layer is not the same as the index of a vertex within the model.

See also SubdivisionLevel::AddLayer().

Definition at line 121 of file layer.h.

`#include <layer.h>`

Inheritance diagram for LayerMeshData:
[legend]

List of all members.

## Public Member Functions
virtual void | SetName (const QString &sName)
| Set the name of the layer.
virtual QString | Name (void) const
| Gets the name of the layer.
virtual bool | Visible () const
| Gets the visibility of the layer.
virtual void | SetVisible (bool bVisible)
| Sets the visibility of the layer.
virtual mudbox::Mesh * | Mesh () const
| Returns the mesh that this layer affects.
virtual void | SetTransparency (float fTransparency)
| Sets the transparency of the layer.
virtual float | Transparency (void) const
| Returns the current transparency of the layer. 0 is fully transparent, 1 is opaque.
virtual unsigned int | LayerVertexIndex (unsigned int iVertexIndex, bool bCreate=true)
| Returns the index of a vertex in a sculpt layer.
virtual void | SetVertexCount (unsigned int iVertexCount)
| Set the number of vertices in the layer.
virtual unsigned int | VertexCount () const
| Returns the number of vertex deltas in this layer.
virtual unsigned int | MeshVertexIndex (unsigned int iLayerVertexIndex) const
| Returns the mesh's vertex index for the corresponding layer vertex index.
virtual void | SetVertexData (unsigned int iVertexLayerIndex, unsigned int iGlobalVertexIndex, float fMask)
| Set the mask value belonging to a vertex in the layer.
virtual Vector | SetVertexDelta (unsigned int iVertexLayerIndex, unsigned int iGlobalVertexIndex, const Vector &vDelta, bool bUpdate=true)
| Set the delta position stored for a vertex in the layer.
virtual void | SetVertexMask (unsigned int iVertexLayerIndex, float fMask)
| Sets the mask of a vertex in the layer.
virtual float | VertexMask (unsigned int iVertexLayerIndex)
| Returns the mask of a vertex in the layer.
virtual Vector | VertexDelta (unsigned int iVertexLayerIndex)
| Returns the current delta value associated to a vertex.
virtual bool | FinishChanges ()
| After creating new vertex deltas (by calling LayerVertexIndex with bCreate set to true) call this method to commit the changes into the layer.
virtual void | Transform (const Matrix &mMatrix)

## Member Function Documentation

virtual void SetName | ( | const QString & | sName | ) | `[virtual]`

Search for all occurrences

Set the name of the layer.

Parameters:

  [in] | sName | the new layer name

Reimplemented from TreeNode.

virtual QString Name | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Gets the name of the layer.

virtual bool Visible | ( |  | ) | const `[virtual]`

Search for all occurrences

Gets the visibility of the layer.

Reimplemented from TreeNode.

virtual void SetVisible | ( | bool | bVisible | ) | `[virtual]`

Search for all occurrences

Sets the visibility of the layer.

Reimplemented from TreeNode.

virtual mudbox::Mesh* Mesh | ( |  | ) | const `[virtual]`

Search for all occurrences

Returns the mesh that this layer affects.

virtual void SetTransparency | ( | float | fTransparency | ) | `[virtual]`

Search for all occurrences

Sets the transparency of the layer.

Parameters:

  [in] | fTransparency | Transparency value, between 0 and 1. 0 is fully transparent, 1 is opaque.

virtual float Transparency | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the current transparency of the layer. 0 is fully transparent, 1 is opaque.

virtual unsigned int LayerVertexIndex | ( | unsigned int | iVertexIndex,
|  | bool | bCreate = `true`
| ) |  | `[virtual]`

Search for all occurrences

Returns the index of a vertex in a sculpt layer.

Vertices in a sculpt layer do not have the same index as vertices in a mesh. This method takes a mesh vertex index and finds the corresponding sculpt layer vertex index.

Note: This is a slow function, so return values should be cached if the index will be used multiple times to modify/get vertex data.

Parameters:

  [in] | iVertexIndex | Index of the vertex inside the mesh.
  [in] | bCreate | Create the index if it doesn't exist

virtual void SetVertexCount | ( | unsigned int | iVertexCount | ) | `[virtual]`

Search for all occurrences

Set the number of vertices in the layer.

The number of vertices in a sculpt layer may be smaller than the number of vertices in a model level, because the sculpt layer only keeps information on vertices that have changed.

Parameters:

  [in] | iVertexCount | The desired number of vertices for the layer

virtual unsigned int VertexCount | ( |  | ) | const `[virtual]`

Search for all occurrences

Returns the number of vertex deltas in this layer.

See SetVertexCount()

virtual unsigned int MeshVertexIndex | ( | unsigned int | iLayerVertexIndex | ) | const `[virtual]`

Search for all occurrences

Returns the mesh's vertex index for the corresponding layer vertex index.

See SetVertexCount()

Parameters:

  [in] | iLayerVertexIndex | The index inside the layer. Valid range is 0 to VertexCount() - 1

virtual void SetVertexData | ( | unsigned int | iVertexLayerIndex,
|  | unsigned int | iGlobalVertexIndex,
|  | float | fMask
| ) |  | `[virtual]`

Search for all occurrences

Set the mask value belonging to a vertex in the layer.

Parameters:

  [in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex().
  [in] | iGlobalVertexIndex | Index of the vertex inside the mesh.
  [in] | fMask | New mask value for the vertex, which must be between 0 and 1. 0 means no mask; 1 is completely masked.

virtual Vector SetVertexDelta | ( | unsigned int | iVertexLayerIndex,
|  | unsigned int | iGlobalVertexIndex,
|  | const Vector & | vDelta,
|  | bool | bUpdate = `true`
| ) |  | `[virtual]`

Search for all occurrences

Set the delta position stored for a vertex in the layer.

Parameters:

  [in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex().
  [in] | iGlobalVertexIndex | Index of the vertex inside the mesh.
  [in] | vDelta | New delta vector for the vertex. This vector will be added to the world space position of the vertex when the layer becomes visible.
  [in] | bUpdate | True to automatically update the mesh's corresponding vertex positions, false to only update the sculpt layer's delta.

virtual void SetVertexMask | ( | unsigned int | iVertexLayerIndex,
|  | float | fMask
| ) |  | `[virtual]`

Search for all occurrences

Sets the mask of a vertex in the layer.

Parameters:

  [in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex().
  [in] | fMask | New mask value for the vertex, which must be between 0 and 1. 0 means no mask; 1 is completely masked.

virtual float VertexMask | ( | unsigned int | iVertexLayerIndex | ) | `[virtual]`

Search for all occurrences

Returns the mask of a vertex in the layer.

Parameters:

  [in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex().

virtual Vector VertexDelta | ( | unsigned int | iVertexLayerIndex | ) | `[virtual]`

Search for all occurrences

Returns the current delta value associated to a vertex.

Parameters:

  [in] | iVertexLayerIndex | Index of the vertex inside the layer. See LayerVertexIndex().

virtual bool FinishChanges | ( |  | ) | `[virtual]`

Search for all occurrences

After creating new vertex deltas (by calling LayerVertexIndex with bCreate set to true) call this method to commit the changes into the layer.

This method can be called once, after all vertex data has been set for the operation. Returns true on success, false otherwise.

virtual void Transform | ( | const Matrix & | mMatrix | ) | `[virtual]`

Search for all occurrences

The documentation for this class was generated from the following file:

- Mudbox/layer.h

LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData
LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData LayerMeshData