Object Funcs

class lwsdk.LWObjectFuncs(self)

Bases: object

Proxy of C++ PCore::LWObjectFuncs class

 filename(int obj) → char

Returns the filename for the object. Objects in the database are indexed by integers ranging from 0 to LWObjectFuncs::numObjects() - 1. Except during rendering, the index associated with a given object can change at any time as objects are added to or removed from the object database by the user.

 layerExists(int obj, int lnum) → int

True if the layer exists.

 layerMesh(int obj, int lnum) → LWMeshInfo

Returns an instance of the LWMeshInfo class for the object layer. These are described on the Mesh Info page. For object layers with subpatches, the mesh returned by this function does not include geometry that would be created by subdivision unless the subpatches have been frozen.

 layerName(int obj, int lnum) → char

Returns the name assigned to the layer, or None if the layer is unnamed.

 layerVis(int obj, int lnum) → int

Returns a boolean indicating whether the layer is marked as visible (1) or not (0).

 maxLayers(int obj) → int

Returns a value one greater than the highest indexed, existing layer for the object. This is just the layer count if all layers with indexes between 0 and LWObjectFuncs::maxLayers() - 1 exist.

 maxPointsPerPoly → int

The maximum number of points that can be used to construct a polygon in the current application.

 numObjects() → int

Returns a count of the number of objects in the object database. This is the number of unique object files that have been loaded, which in general will be different from the number of animateable object items (clones and null objects, for example, aren't counted).

 numVMaps(LWID type) → int

Returns a count of the number of vertex maps of a given type, or the total of all types in the scene if vmtype is 0. Vmap type codes are an extensible set of four-character identifiers. The lwmeshes.h header defines some of the common vmap IDs.

lwsdk.LWVMAP_PICK - selection set
lwsdk.LWVMAP_WGHT - weight map
lwsdk.LWVMAP_MNVW - SubPatch weight map
lwsdk.LWVMAP_TXUV - texture UV coordinates
lwsdk.LWVMAP_MORF - relative vertex displacement
lwsdk.LWVMAP_SPOT - absolute vertex displacement
lwsdk.LWVMAP_NORM - vertex normals

 pivotPoint(int obj, int lnum) → double[3]

Get the pivot point for the object layer. Returns a Python sequence with 3 elements that represent the (X, Y, Z) position of the pivot point.

 refName(int obj) → char

Returns an internal reference name for this object. The reference name is guaranteed to be unique and unchanging for the lifetime of the object. This is useful in Modeler as an argument to commands requiring a filename, since some objects in Modeler may not have been saved yet and therefore have no filename.

 userName(int obj) → char

Returns the name of the object as seen by the user. This is typically the base filename without the path or extension, or "Unnamed N" for unsaved objects. These are not guaranteed to be unique.

 vmapDim(LWID type, int in_index) → int

Returns the number of dimensions, or values per vertex, of a vmap. Vmaps are typically 2D or 3D (two or three coordinate values per vertex), but they can have any number of dimensions, including 0.

 vmapName(LWID type, int in_index) → char

Returns the name of a vmap. The index ranges from 0 to LWObjectFuncs::numVMaps() - 1.

 vmapType(int in_index) → LWID, int

Returns the LWID for the vmap. Call LWObjectFuncs::numVMaps() with a vmtype of 0 to find the upper bound on vmindex.

Previous topic

Light Evaluation Funcs

Next topic

State Query Funcs

This Page