Layer (lx-layer.hpp)
Contents
- 1 Layers
- 1.1 Layer System Service
- 1.2 Layer Scan Interface
- 1.2.1 (21) SDK: LXu_LAYERSCAN, etc. defines
- 1.2.2 (22) SDK: LXf_LAYERSCAN_ACTIVE, etc. defines
- 1.2.3 (23) SDK: LayerScan::Apply
- 1.2.4 (24) SDK: LayerScan::Count
- 1.2.5 (25) SDK: LayerScan::GetState
- 1.2.6 (26) SDK: LayerScan::MeshItem, etc.
- 1.2.7 (27) SDK: LayerScan::MeshBase, etc.
- 1.2.8 (28) SDK: CLxUser_LayerScan::NumLayers method
- 1.2.9 (29) SDK: LayerScan::SetMeshChange
- 1.3 Nexus 10
- 1.4 Transform Scan Interface
- 1.4.1 (33) SDK: TransformScan::Enumerate, etc.
- 1.4.2 (34) SDK: LXfXFRMSCAN_WEIGHT, etc. defines
- 1.4.3 (35) SDK: TransformScan::Position, etc.
- 1.4.4 (36) SDK: TransformScan::Weight, etc.
- 1.4.5 (37) SDK: CLxUser_TransformScan::Enum method
- 1.4.6 (38) PY: empty TransformScan user class
- 1.4.7 (39) SDK: LXu_TRANSFORMSCAN define
- 1.4.8 (40) SDK: LayerService::XfrmAllocate
- 1.4.9 (41) SDK: CLxUser_LayerService::BeginXfrm method
- 1.4.10 (42) PY: empty Service.Layer user class
- 1.4.11 (43) SDK: LayerService::ScanAllocateItem
- 1.4.12 (44) SDK: LayerService::IsProcedural
- 1.4.13 (45) SDK: LayerService::SetMark
- 1.4.14 (46) SDK: LayerService::ClearMark
- 1.4.15 (47) SDK: LayerService::TestMark
Layers
The Layers API allows the mesh items in a scene to be treated as modeling layers.
Layer System Service
A portion of the Layer API is wrapped as a Global Service object.
(1) SDK: LXu_LAYERSERVICE, etc. defines
#define LXu_LAYERSERVICE "F12B06AA-BF92-4585-800E-45AB99D47A20" #define LXa_LAYERSERVICE "layerservice"
Layer List Access
As with all globals, the first method gets the ILxScriptQueryID interface for the system.
(2) SDK: LayerService::ScriptQuery
LXxMETHOD( LxResult, ScriptQuery) ( LXtObjectID self, void **ppvObj);
The layer service functions operate with to a certain scene. This scene should be specified by the client BEFORE any other methods are used, as an initialization step. The scene can also be reset at any time, either to a new scene, or to force a refresh of the layer data.
(3) SDK: LayerService::SetScene, etc.
LXxMETHOD( LxResult, SetScene) ( LXtObjectID self, LXtObjectID scene); LXxMETHOD( LxResult, Scene) ( LXtObjectID self, void **ppvObj);
SetScene() | This function must be called to initialize the Layer Service Object and set the scene. The argument 'scene' should be an ILxScene1 object, or NULL to use the currently selected scene. |
Scene() | This function returns the ILxScene1 currently set. It should be released by the client. |
Layer elements (items) can be accessed in lists based on their selection and foreground state, as specified by the following modes:
(4) SDK: LXi_LAYER_PRIMARY, etc. defines
#define LXi_LAYER_PRIMARY 0 #define LXi_LAYER_FOREGROUND 1 #define LXi_LAYER_BACKGROUND 2 #define LXi_LAYER_ALL 3
The following functions operate on these lists, with indices based, naturally, on the position within the given list.
(5) SDK: LayerService::Count, etc.
LXxMETHOD( LxResult, Count) ( LXtObjectID self, unsigned int *count); LXxMETHOD( LxResult, Name) ( LXtObjectID self, unsigned int index, const char **name); LXxMETHOD( LxResult, Slot) ( LXtObjectID self, unsigned int index, int *slot); LXxMETHOD( LxResult, Item) ( LXtObjectID self, unsigned int index, void **ppvObj); LXxMETHOD( LxResult, Mesh) ( LXtObjectID self, unsigned int index, void **ppvObj); LXxMETHOD( LxResult, Flags) ( LXtObjectID self, unsigned int index, int *flags);
Count() | This function returns the number of layers in the list. |
Name() | Return the name of the layer in the list at the given index. |
Slot() | Return the UI slot number of the layer in the list at the given index. |
Item() | Return the item in the list at the given index. It is the client's responsibility to release this object. |
Mesh() | Return the ILxMesh in the list at the given index. It is the client's responsibility to release this object. |
Flags | Returns the layer flags, used to determine whether a layer is in foreground, background, is main, or none of those. |
(6) SDK: LXf_LAYER_FOREGROUND, etc. defines
#define LXf_LAYER_FOREGROUND 1 #define LXf_LAYER_BACKGROUND 2 #define LXf_LAYER_MAIN 4
Layer Properties
(7) SDK: LayerService::Pivot, etc.
LXxMETHOD( LxResult, Pivot) ( LXtObjectID self, unsigned int index, double *pivot); LXxMETHOD( LxResult, PatchSubdivision) ( LXtObjectID self, unsigned int index, int *level); LXxMETHOD( LxResult, Bounds) ( LXtObjectID self, unsigned int index, LXtVector min, LXtVector max); LXxMETHOD( LxResult, CurveSmoothAngle) ( LXtObjectID self, unsigned int index, double *angle); LXxMETHOD( LxResult, SplinePatchSubdivision) ( LXtObjectID self, unsigned int index, int *level);
Pivot() | Return the pivot position vector in pivot[3]. |
PatchSubdivision() | Return the subdivion surface polygon subdivision level. |
Bounds() | Return the bounding box of geometry in layer(s) min[3] and max[3]. |
CurveSmoothAngle() | Return the curve refinement maximum "smooth" angle. |
SplinePatchSubdivision() | Return the spline patch polygon subdivision level. |
Layer List Lookup
These methods find an item's position in one of the lists based on the item itself, or on its name. They will return an error AND set the index to -1 if the item is not found in the specified list. To use this index in layer commands, use LXi_LAYER_ALL mode.
(8) SDK: LayerService::ItemLookup, etc.
LXxMETHOD( LxResult, ItemLookup) ( LXtObjectID self, int mode, LXtObjectID item, int *index); LXxMETHOD( LxResult, NameLookup) ( LXtObjectID self, int mode, const char *name, int *index);
ItemLookup() | Return the index of the ILxItem in the specified list, or -1 on failure. |
NameLookup() | Return the index of the layer whose name matches 'name' in the specified list, or -1. |
Layer List Hierarchy
These methods access the parent-child relationships among layers. They return an index into the LXi_LAYER_ALL list, or -1.
(9) SDK: LayerService::LayerParent
LXxMETHOD( LxResult, LayerParent) ( LXtObjectID self, int index, int *parentIndex);
(10) SDK: LayerService::LayerChildCount, etc.
LXxMETHOD( LxResult, LayerChildCount) ( LXtObjectID self, int index, int *num); LXxMETHOD( LxResult, LayerChild) ( LXtObjectID self, int index, int childNumber, int *childIndex);
LayerParent() | Return (by reference) the index of the specified layer's parent layer, or -1 if there is no parent. |
LayerChildCount() | Return the number of child layers for the given layer. |
LayerChild() | Return the layer index of the child specified by 'childNumber', the index of the child in the parent's list of children. |
Layer List Associates
The meshes in the layer list have a number of associated entities like vertex maps, image clips, and textures. APIs are provided to access these entities, presumable as the appropriate COM objects.
The list of vert. maps present in the active and background layers can be accessed using these methods. Multiple VMaps with the same name and type are represented as a single entry.
(11) SDK: LayerService::LayerVMapCount, etc.
LXxMETHOD( LxResult, LayerVMapCount) ( LXtObjectID self, int *num); LXxMETHOD( LxResult, LayerVMap) ( LXtObjectID self, unsigned int index, void **ppvObj);
LayerVMapCount() | Return the number of vertex maps. If type is non-NULL, only maps of that type will be included. |
LayerVMap() | Return the vertex maps at 'index'. If type is non-NULL, only maps of that type will be considered. |
Similar methods provide access to the Clips and Textures used by
(12) SDK: LayerService::LayerClipCount, etc.
LXxMETHOD( LxResult, LayerClipCount) ( LXtObjectID self, int *num); LXxMETHOD( LxResult, LayerClip) ( LXtObjectID self, unsigned int index, void **ppvObj); LXxMETHOD( LxResult, LayerMaterialCount) ( LXtObjectID self, int *num); LXxMETHOD( LxResult, LayerMaterial) ( LXtObjectID self, unsigned int index, void **ppvObj);
LayerMaterialCount() | Returns the number of materials in the active layers. |
LayerMaterial() | Returns the material item (ILxItem) at the given index in the list of materials in the active layers. |
LayerClipCount() | Returns the number of clips used by materials in the active layers. |
LayerClip() | Returns the clip item at the given index. |
(13) SDK: LayerService::LayerPartCount, etc.
LXxMETHOD( LxResult, LayerPartCount) ( LXtObjectID self, int *num); LXxMETHOD( LxResult, LayerPart) ( LXtObjectID self, unsigned int index, const char **part);
LayerPartCount() | Returns the number of parts in the active layers. |
LayerPart() | Returns the part name at the given index. |
Access the selection sets for items, polys, or vert/edge using types ID_ITEM, ID_POLY, or ID_VERX/ID_EDGE respectively
(14) SDK: LayerService::LayerSelSetCount, etc.
LXxMETHOD( LxResult, LayerSelSetCount) ( LXtObjectID self, unsigned int type, int *num); LXxMETHOD( LxResult, LayerSelSet) ( LXtObjectID self, unsigned int type, unsigned int index, const char **selSet);
LayerSelSetCount() | Returns the number of selection sets in the active layers. |
LayerSelSet() | Returns the selection set name at the given index. |
Texture Layers
The set of texture items applied to an item, or a part thereof are accessed with these functions.
(15) SDK: LayerService::LayerTextureCount, etc.
LXxMETHOD( LxResult, LayerTextureCount) ( LXtObjectID self, int layer, int *num); LXxMETHOD( LxResult, LayerTexture) ( LXtObjectID self, int layer, unsigned int index, void **ppvObj);
LayerTextureCount() | Return the number of textures applied to the given mesh layer. |
LayerTexture() | Returns the texture item at the given index in the list of textures applied to the specified mesh layer. |
The set of textures applied based on a given (PART or MATR) polygon tag may also be accessed.
(16) SDK: LayerService::LayerTagTextureCount, etc.
LXxMETHOD( LxResult, LayerTagTextureCount) ( LXtObjectID self, int layer, unsigned int type, const char *tag, int *num); LXxMETHOD( LxResult, LayerTagTexture) ( LXtObjectID self, int layer, unsigned int type, const char *tag, unsigned int index, void **ppvObj);
LayerTagTextureCount() | Return the number of textures applied to the given mesh layer masked by a polygon tag of the specified type and value. |
LayerTagTexture() | Returns the texture item at the given index in the list textures applied to the given mesh layer masked by a polygon tag of the specified type and value. |
Layer List Ptags
Ptags are different from associated entities because they provide a part type and a string.
Layer List Mesh API
Mesh elements (vertices, polygons, edges) can also retrieved, hopefully based on the layer list mode as well as a marking system yet to be described...
(17) SDK: LayerService::LayerVertexCount, etc.
LXxMETHOD( LxResult, LayerVertexCount) ( LXtObjectID self, int mode, int *num); LXxMETHOD( LxResult, LayerVertex) ( LXtObjectID self, int mode, unsigned int index, void **ppvObj); LXxMETHOD( LxResult, LayerPolyCount) ( LXtObjectID self, int mode, int *num); LXxMETHOD( LxResult, LayerPoly) ( LXtObjectID self, int mode, unsigned int index, void **ppvObj); LXxMETHOD( LxResult, LayerEdgeCount) ( LXtObjectID self, int mode, int *num); LXxMETHOD( LxResult, LayerEdge) ( LXtObjectID self, int mode, unsigned int index, void **ppvObj);
LayerVertexCount() | |
LayerVertex() | |
LayerPolyCount() | |
LayerPoly() | |
LayerEdgeCount() | |
LayerEdge() |
(18) SDK: LayerService::ScanAllocate
LXxMETHOD( LxResult, ScanAllocate) ( LXtObjectID self, unsigned flags, void **ppvObj);
ScanAllocate() | Initialize and return a layer scan object. |
(19) SDK: CLxUser_LayerService::BeginScan method
bool BeginScan ( unsigned int flags, CLxLoc_LayerScan &scan) { LXtObjectID obj; if (LXx_FAIL (ScanAllocate (flags, &obj))) return false; return scan.take (obj); }
(20) SDK: LayerService::CurrentMap
LXxMETHOD( LxResult, CurrentMap) ( LXtObjectID self, LXtID4 type, const char **name);
CurrentMap | This function returns the name of the user's current vertex map or the given type. The map itself can be found, given a mesh and the name and type using the ILxMeshMap interface. |
Layer Script Query
layers | Query to list all the available layers in a form that can be used as a selector (i.e. an index). If name-selectors were supported, this could be a list of names. |
layer_groups | List the selector keys for layer groupings: all, fg, bg, primary |
layer_element | List the selector keys for layer list elements: first, next, last, prev also includes raw indices (in range!) |
layer_lists | Query to list all the layer-associated lists: kids, materials, vmaps, etc. |
layer | Find list of layer.* attributes |
layer.N [ layer_groups ] | Query number of layers requested by the 'layer_groups' selector. |
layer.name [ layer_groups ] | Query for names of requested layers. |
layer.index [ layer_groups ] | Query for indices of requested layers. |
layer.subdivLevel [ layer_groups ] | Query for subdiv. surface level of requested layers. |
layer.curveAngle [ layer_groups ] | Query for curve refinment angle of requested layers. |
layer.parent [ layer_groups ] | Query for parent indices of requested layers. |
layer.childCount [ layer_groups ] | Query for indices of requested layers. |
layer.children [ layer_groups ] | Query for indices of requested layer's children layers. |
layer.pivot [ layer_groups ] | Query pivot points (3 floats) of requested layer. |
layer.bounds [ layer_groups ] | Query bounding box (6 floats: min, max) of requested layer. |
layer.visible [ layer_groups ] | Query visibility mode ('foreground','backrgound','main', or 'none') of requested layers. |
The following queries use a single 'current' layer selection, possibly in place from a previous query, which is why a selector is not always necessary. The pattern is reused liberally: <element> - enumerates a list the <element>.* attributes available, including... <element>_groups - lists selectors available for this type of element, either a layer set selection ('foreground', e.g.) or a mesh element selection ('unselected', e.g.) <element>s - enumerates a list elements for the current selection, returning a list of per-element selectors (often just indices). <element>.N - the number of elements in the list <element>.index - The main selector for the queried element(s) in the list. This will match the selector returned by the <element>s query, and will often be an index.
A number of other sub-attributes, like ".name" will also be re-used as appropriate. The descriptions from the first set apply to other elements, unless otherwise noted.
a brief digression on terminology: in keeping with the "s" as a terminating substring to list the elements, it was necessary to abandon 'child' as it does not yet pluralize with an s in English. 'childs' was intolerable. Thus we have 'kids'.
kid | list of kid.* attributes |
kid_groups | list of kid-list selectors (layer set selectors like foreground, background, all) |
kids [ layer_groups ] | list of elements (child layers in this case) indices of current/requested layer |
kid.N [ layer_groups ] | number of elements in list |
kid.name [ layer_element ] | name of child selected by 'layer_element' selector (first, etc. or numeric index) |
kid.index [ layer_element ] | index of child selected by 'layer_element' which could include the index itself. |
part | |
part_groups | |
parts [ part_groups ] | |
part.N [ part_groups ] | |
part.name [ layer_element ] | |
part.index [ layer_element ] |
Selection sets for polys, verts/edges, and items are wueried so:
pset | |
pset_groups | |
psets [ pset_groups ] | |
pset.N [ pset_groups ] | |
pset.name [ layer_element ] | |
pset.index [ layer_element ] | |
vset | |
vset_groups | |
vsets [ vset_groups ] | |
vset.N [ vset_groups ] | |
vset.name [ layer_element ] | |
vset.index [ layer_element ] | |
iset | |
iset_groups | |
isets [ iset_groups ] | |
iset.N [ iset_groups ] | |
iset.name [ layer_element ] | |
iset.index [ layer_element ] |
The material query will be used to query lists of mask items used by a layer (item) using a meshbin enumeration.
material | |
material_groups | |
materials [ material_groups ] | |
material.N [ material_groups ] | |
material.name [ layer_element ] | |
material.index [ layer_element ] | |
material.id [ layer_element ] | |
material.textures [ layer_element ] | |
texture | |
texture_groups | |
textures [ texture_groups ] | |
texture.N [ texture_groups ] | |
texture.name [ layer_element ] | |
texture.index [ layer_element ] | |
texture.id [ layer_element ] | |
texture.types [ texture_category ] | |
texture.effect [ layer_element ] | |
texture.clip [ layer_element ] | |
texture.locator [ layer_element ] | |
clip | |
clip_groups | |
clips [ clip_groups ] | |
clip.N [ clip_groups ] | |
clip.name [ layer_element ] | |
clip.index [ layer_element ] | |
clip.id [ layer_element ] | |
clip.file [ layer_element ] | |
clip.info [ layer_element ] | |
vmap | |
vmap_groups | |
vmaps [ vmap_groups ] | |
vmap.N [ vmap_groups ] | |
vmap.name [ layer_element ] | |
vmap.index [ layer_element ] | |
vmap.type [ layer_element ] | |
vmap.dim [ layer_element ] |
These attributes are selected by 'mesh_selection' selector (selected, unsel., all), and a layer list element selector.
vert | |
vert_groups | list of selectors, in this case mesh element groups ('selected', etc.) |
verts [ vert_groups ] | |
vert.N [ vert_groups ] | |
vert.name [ layer_element ] | returns (<layer index>,<elem. index>) |
vert.index [ layer_element ] | element index |
vert.pos [ layer_element ] | position (3 floats) |
vert.normal [ layer_element ] | avg. normal over polys using vert (3 floats) |
vert.numPolys [ layer_element ] | number of polygons sharing vertex |
vert.polyList [ layer_element ] | list of indices of polygons sharing vertex |
vert.numVerts [ layer_element ] | number of vertices connected to vertex |
vert.vertList [ layer_element ] | list of indices of connected vertices |
vert.vmapValue [ layer_element ] | a list of floats with the value of the most recently selected vmap at vertex. This query will fail if no vmap has been 'selected' recently by a query. |
vert.selected [ layer_element ] | element selection state (0 of 1) |
vert.hidden [ layer_element ] | element hide state (0 of 1) |
vert.wpos [ layer_element ] | world-space position (3 floats) |
poly | |
poly_groups | |
polys [ poly_groups ] | |
poly.N [ poly_groups ] | |
poly.name [ layer_element ] | returns (<layer index>,<elem. index>) |
poly.index [ layer_element ] | element index |
poly.normal [ layer_element ] | normal (3 floats) |
poly.numVerts [ layer_element ] | number of vertices in polygon |
poly.vertList [ layer_element ] | list of indices of vert.s in polygon |
poly.type [ layer_element ] | polygon type name |
poly.vmapValue [ layer_element ] | a list of lists of floats with the values of the most recently selected vmap at the polygon vertices. This query will fail if no vmap has been 'selected' recently by a query. |
poly.discos [ layer_element ] | a list of vertex indices for those verts whose entry in the recently selected vmap are discontinuous. This query will fail if no vmap has been 'selected' recently by a query. |
poly.pos [ layer_element ] | a position vector for the poly centroid (point avg.) |
poly.selected [ layer_element ] | element selection state (0 of 1) |
poly.hidden [ layer_element ] | element hide state (0 of 1) |
poly.tags | Return a list of tags on the polygon |
poly.tagTypes | Return a list of the types of the tags from the poly.tags query |
edge | |
edge_groups | |
edges [ edge_groups ] | returns edge selectors, which are pairs of vertex indices as "(1,68)" |
edge.N [ edge_groups ] | |
edge.name [ layer_element ] | returns (<layer index>,<vert. index>,<vert. index>) |
edge.index [ layer_element ] | element selector |
edge.vertList [ layer_element ] | the indices of the 2 verts that form this edge |
edge.numPolys [ layer_element ] | number of polygons sharing vertex |
edge.polyList [ layer_element ] | list of indices of polygons sharing vertex |
edge.length [ layer_element ] | length of edge |
edge.creaseWeight [ layer_element ] | subdivision vmap weight for edge |
edge.vector [ layer_element ] | vector between edge verts |
edge.selected [ layer_element ] | element selection state (0 of 1) |
edge.hidden [ layer_element ] | element hide state (0 of 1) |
Layer Scan Interface
The LayerScan interface is the main way to do mesh edits. It can also be used in a non-edit mode to confirm what will happen when editing.
(21) SDK: LXu_LAYERSCAN, etc. defines
#define LXu_LAYERSCAN "097DB669-91C3-11D9-8EA2-000A956C2E10" #define LXa_LAYERSCAN "layerscan"
Flags select the layers to be processed: ACTIVE is all current meshes; BACKGROUND is all visible but inactive meshes; PRIMARY is the one main selected mesh. The marking flags will mark the various element types as selected. So if MARKVERTS is set, for example, all selected vertices will have the "select" mark mode set. As always if no vertices are selected all will be marked.
Set WRITEMESH to enable layer edits.
(22) SDK: LXf_LAYERSCAN_ACTIVE, etc. defines
#define LXf_LAYERSCAN_ACTIVE 0x001 #define LXf_LAYERSCAN_BACKGROUND 0x002 #define LXf_LAYERSCAN_PRIMARY 0x004 #define LXf_LAYERSCAN_ALL (LXf_LAYERSCAN_ACTIVE | LXf_LAYERSCAN_BACKGROUND) #define LXf_LAYERSCAN_MARKVERTS 0x010 #define LXf_LAYERSCAN_MARKEDGES 0x020 #define LXf_LAYERSCAN_MARKPOLYS 0x040 #define LXf_LAYERSCAN_MARKDVRTS 0x080 #define LXf_LAYERSCAN_MARKALL (LXf_LAYERSCAN_MARKVERTS | LXf_LAYERSCAN_MARKEDGES | LXf_LAYERSCAN_MARKPOLYS | LXf_LAYERSCAN_MARKDVRTS) #define LXf_LAYERSCAN_WRITEMESH 0x100 #define LXf_LAYERSCAN_EDIT (LXf_LAYERSCAN_ACTIVE | LXf_LAYERSCAN_WRITEMESH | LXf_LAYERSCAN_MARKALL) #define LXf_LAYERSCAN_EDIT_POLYS (LXf_LAYERSCAN_ACTIVE | LXf_LAYERSCAN_WRITEMESH | LXf_LAYERSCAN_MARKPOLYS) #define LXf_LAYERSCAN_EDIT_VERTS (LXf_LAYERSCAN_ACTIVE | LXf_LAYERSCAN_WRITEMESH | LXf_LAYERSCAN_MARKVERTS) #define LXf_LAYERSCAN_EDIT_EDGES (LXf_LAYERSCAN_ACTIVE | LXf_LAYERSCAN_WRITEMESH | LXf_LAYERSCAN_MARKEDGES) #define LXf_LAYERSCAN_EDIT_DVRTS (LXf_LAYERSCAN_ACTIVE | LXf_LAYERSCAN_WRITEMESH | LXf_LAYERSCAN_MARKDVRTS) #define LXf_LAYERSCAN_EDIT_POLVRT (LXf_LAYERSCAN_ACTIVE | LXf_LAYERSCAN_WRITEMESH | LXf_LAYERSCAN_MARKPOLYS | LXf_LAYERSCAN_MARKVERTS)
Called at the end of an edit operation, Apply() performs all the mesh edits and terminates the scan. If this is not called for an edit scan any edits will be abandonded.
(23) SDK: LayerScan::Apply
LXxMETHOD( LxResult, Apply) ( LXtObjectID self);
Get the number of layers in the scan.
(24) SDK: LayerScan::Count
LXxMETHOD( LxResult, Count) ( LXtObjectID self, unsigned *count);
Query the state of a given layer. The state is a combination of the ACTIVE, BACKGROUND or PRIMARY layer scan flags.
(25) SDK: LayerScan::GetState
LXxMETHOD( LxResult, GetState) ( LXtObjectID self, unsigned index, unsigned *state);
Each layer is associated with a mesh item. The client can also get the action for the item to read channel values.
(26) SDK: LayerScan::MeshItem, etc.
LXxMETHOD( LxResult, MeshItem) ( LXtObjectID self, unsigned index, void **ppvObj); LXxMETHOD( LxResult, MeshAction) ( LXtObjectID self, unsigned index, void **ppvObj);
Clients can access the mesh in one of three forms. The "base" mesh is the mesh as stored in the scene. The "instance" mesh is the same mesh but deformed by the currently selected modeling morph. The "edit" mesh is the same mesh again, but allowing modifications. This version is only available if the WRITEMESH flag was set.
(27) SDK: LayerScan::MeshBase, etc.
LXxMETHOD( LxResult, MeshBase) ( LXtObjectID self, unsigned index, void **ppvObj); LXxMETHOD( LxResult, MeshInstance) ( LXtObjectID self, unsigned index, void **ppvObj); LXxMETHOD( LxResult, MeshEdit) ( LXtObjectID self, unsigned index, void **ppvObj);
User class methods just make nicer wrappers for the raw COM methods.
(28) SDK: CLxUser_LayerScan::NumLayers method
unsigned NumLayers () { unsigned n; if (LXx_OK (Count (&n))) return n; return 0; } bool ItemByIndex ( unsigned int index, CLxLoc_Item &item) { LXtObjectID obj; if (LXx_FAIL (MeshItem (index, &obj))) return false; return item.take (obj); } bool BaseMeshByIndex ( unsigned int index, CLxLoc_Mesh &mesh) { LXtObjectID obj; if (LXx_FAIL (MeshBase (index, &obj))) return false; return mesh.take (obj); } bool EditMeshByIndex ( unsigned int index, CLxLoc_Mesh &mesh) { LXtObjectID obj; if (LXx_FAIL (MeshEdit (index, &obj))) return false; return mesh.take (obj); }
The layer scan client is responsible for indicating what types of changes they are making to a mesh. The mesh change bit mask should be set for all edited meshes before changes are applied.
(29) SDK: LayerScan::SetMeshChange
LXxMETHOD( LxResult, SetMeshChange) ( LXtObjectID self, unsigned index, unsigned int edits);
Nexus 10
Called at intermediate points of an edit operation, Update() performs the mesh edits, but does not terminate the scan.
(30) SDK: LayerScan::Update
LXxMETHOD( LxResult, Update) ( LXtObjectID self);
Clients can access the mesh item transforms using this function. It returns a Matrix4 representing the world transform of the mesh item.
(31) SDK: LayerScan::MeshTransform
LXxMETHOD ( LxResult, MeshTransform) ( LXtObjectID self, unsigned index, LXtMatrix4 matrix);
Empty LayerScan Python user class.
(32) PY: empty LayerScan user class
pass
Transform Scan Interface
The transform scan interface is also for editing, but is specifically for use in tools which perform transformations. The encapsulates all the different element types -- meshes, items, pivots, etc. -- as well as some tricky elements of the tool pipe like per-element centers and axes.
The client passes a visitor to enumerate over all the elements to transform, and will be called back for each one in sequence. The flags method can read out the properties of the current element.
(33) SDK: TransformScan::Enumerate, etc.
LXxMETHOD( LxResult, Enumerate) ( LXtObjectID self, LXtObjectID visitor); LXxMETHOD( unsigned int, Flags) ( LXtObjectID self);
The flag bits determine which properties apply to the current element. If the weight is not set it can be assumed to be unity.
(34) SDK: LXfXFRMSCAN_WEIGHT, etc. defines
#define LXfXFRMSCAN_WEIGHT 0x01 #define LXfXFRMSCAN_ALTCENTER 0x02 #define LXfXFRMSCAN_ALTAXIS 0x04
The main function of the transform is to read the current position and write a new one.
(35) SDK: TransformScan::Position, etc.
LXxMETHOD( const float *, Position) ( LXtObjectID self); LXxMETHOD( LxResult, SetPosition) ( LXtObjectID self, LXtFVector pos);
The methods allow values to be read for per-element properties indicated by the flags.
(36) SDK: TransformScan::Weight, etc.
LXxMETHOD( double, Weight) ( LXtObjectID self); LXxMETHOD( LxResult, AlternateCenter) ( LXtObjectID self, LXtFVector center); LXxMETHOD( LxResult, AlternateAxis) ( LXtObjectID self, LXtMatrix matrix, LXtMatrix inverse);
The user class method allows easier access to the enumeration method.
(37) SDK: CLxUser_TransformScan::Enum method
LxResult Enum ( CLxImpl_AbstractVisitor *visitor) { CLxInst_OneVisitor<CLxGenericVisitor> gv; gv.loc.vis = visitor; return Enumerate (gv); }
Empty TransformScan Python user class.
(38) PY: empty TransformScan user class
pass
(39) SDK: LXu_TRANSFORMSCAN define
#define LXu_TRANSFORMSCAN "6DD4BC9B-BEDC-46B9-B5AC-850A06AD5EEB"
A transform scan object is allocated using the layer service. The client must also pass the tool vector object which contains info about weights and axes.
(40) SDK: LayerService::XfrmAllocate
LXxMETHOD( LxResult, XfrmAllocate) ( LXtObjectID self, LXtObjectID toolVec, void **ppvObj);
(41) SDK: CLxUser_LayerService::BeginXfrm method
bool BeginXfrm ( ILxUnknownID toolVec, CLxLoc_TransformScan &xfrm) { LXtObjectID obj; if (LXx_FAIL (XfrmAllocate (toolVec, &obj))) return false; return xfrm.take (obj); }
Empty layer service Python user class.
(42) PY: empty Service.Layer user class
pass
You can also allocate a layer scan object for one mesh layer.
(43) SDK: LayerService::ScanAllocateItem
LXxMETHOD( LxResult, ScanAllocateItem) ( LXtObjectID self, LXtObjectID item, unsigned flags, void **ppvObj);
The IsProcedural function determines if a layer is procedural or not. However, this function also takes the UI state into account, so if ghosting is enabled in the mesh operation stack and the base mesh is selected, the function will return false, even if the mesh is procedural. This is useful for setting the enable and disable state of tools or commands that operate on procedural layers.
(44) SDK: LayerService::IsProcedural
LXxMETHOD( LxResult, IsProcedural) ( LXtObjectID self, unsigned int index);
These functions set, clear and test for the mark used .
(45) SDK: LayerService::SetMark
LXxMETHOD( LxResult, SetMark) ( LXtObjectID self, LXtObjectID item);
(46) SDK: LayerService::ClearMark
LXxMETHOD( LxResult, ClearMark) ( LXtObjectID self, LXtObjectID item);
(47) SDK: LayerService::TestMark
LXxMETHOD( int, TestMark) ( LXtObjectID self, LXtObjectID item);