Class INode

3DS Max Plug-In SDK

Class INode

See Also: Class ReferenceTarget, Class FPMixinInterface, Class Interface, Class INodeTransformed, Class Material, Class Matrix3, Class Quat, Class AngAxis, Class Control, Class Object, Class INodeTab.

class INode : public ReferenceTarget, public FPMixinInterface

Description:

The INode class is the interface to nodes in the scene. It provides methods to access various parts of a node such as its name, transformation matrices, parents and children, display status, etc. All methods of this class are implemented by the system.

Method Groups:

These hyperlinks take you to the start of groups of related methods within the class.

Pipeline Evaluation

Node Naming

Parent-Child/Hierarchy / Groups

Target / Node Selection

Object Reference

Display Attributes

Rendering Attribues

Vertex Color Attributes

Access to Node Transformation Matrices

Object Offset Adjustment

Access to Controllers

Access to Visibility Properties

Access to Render Data

Materials

Put Nodes in Foreground Plane

Active Grid Node

Temporary Storage of Data with Nodes

User Properties

Geometry/Graphics (G) Buffer Access

INodeTransformed methods

IK Related Methods

Deleting the Node

WSMDerivedObject Access

XRef Access

Bone Methods

Methods:

Prototype:

virtual const ObjectState& EvalWorldState(TimeValue time,BOOL evalHidden=TRUE)=0;

Remarks:

This method should be called when a developer needs to work with an object that is the result of the node's pipeline. This is the object that the appears in the scene.

This may not be an object that anyone has a reference to - it may just be an object that has flowed down the pipeline. For example, if there is a Sphere in the scene that has a Bend and Taper applied, EvalWorldState() would return an ObjectState containing a TriObject. This is the result of the sphere turning into a TriObject and being bent and tapered (just as it appeared in the scene).

If a developer needs to access the object that the node in the scene references, then the method INode::GetObjectRef() should be used instead. See Object Reference Methods

Parameters:

TimeValue time

Specifies the time to retrieve the object state.

BOOL evalHidden=TRUE

If FALSE and the node is hidden, the pipeline will not actually be evaluated (however the TM will).

Return Value:

The ObjectState that is the result of the pipeline. See Class ObjectState.

Sample Code:

// Get the object from the node

ObjectState os = node->EvalWorldState(ip->GetTime());

if (os.obj->SuperClassID()==GEOMOBJECT_CLASS_ID) {

 obj = (GeomObject*)os.obj;

 ...

}

The following code shows how a TriObject can be retrieved from a node. Note on the code that if you call ConvertToType() on an object and it returns a pointer other than itself, you are responsible for deleting that object.

// Retrieve the TriObject from the node

int deleteIt;

TriObject *triObject = GetTriObjectFromNode(ip->GetSelNode(0),

deleteIt);

// Use the TriObject if available

if (!triObject) return;

// ...

// Delete it when done...

if (deleteIt) triObject->DeleteMe();

 

// Return a pointer to a TriObject given an INode or return NULL

// if the node cannot be converted to a TriObject

TriObject *Utility::GetTriObjectFromNode(INode *node, int &deleteIt) {

 deleteIt = FALSE;

 Object *obj = node->EvalWorldState(ip->GetTime()).obj;

 if (obj->CanConvertToType(Class_ID(TRIOBJ_CLASS_ID, 0))) {

  TriObject *tri = (TriObject *) obj->ConvertToType(ip->GetTime(),

   Class_ID(TRIOBJ_CLASS_ID, 0));

  // Note that the TriObject should only be deleted

  // if the pointer to it is not equal to the object

  // pointer that called ConvertToType()

  if (obj != tri) deleteIt = TRUE;

  return tri;

 }

 else {

  return NULL;

 }

}

Node Naming

Prototype:

virtual TCHAR* GetName()=0;

Remarks:

Returns the name of the node.

Prototype:

virtual void SetName(TCHAR *s)=0;

Remarks:

Sets the name of the node.

Parameters:

TCHAR *s

The name of the node.

Prototype:

virtual ULONG GetHandle();

Remarks:

This method returns the unique node handle. Each node is assigned a unique node handle.

Return Value:

{ return 0; }

Transformation Matrices.

For additional information regarding transformation matrices, see the Advanced Topics section on Node and Object Offset Transformations.

Prototype:

virtual Matrix3 GetNodeTM(TimeValue t, Interval* valid=NULL)=0;

Remarks:

This method returns the world space transformation matrix of the node at the specified time. This matrix contains its parents transformation. This matrix does not include the object-offset transformation, or any world space modifier (Space Warp) affects.

If you select a single node and change the reference coordinate system to 'Local', you'll see the node's axes tripod displayed. This tripod graphically depicts the nodes transformation matrix.

The Node TM may be considered the world space transformation as far as kinematics is concerned. This is almost the complete world space transformation as far as the geometry of the object is concerned, except it does not include the object-offset transformation. See the method INode::GetObjectTM() for the complete world space transformation of the geometry of the object.

The Node TM is inherited. When a node asks to retrieve its parents TM, it gets its parents Node TM. It does not get its parents Object TM. The object-offset transformation is not inherited.

Parameters:

TimeValue t

Specifies the time to retrieve the TM.

Interval* valid=NULL

Points to storage for the validity interval of the transformation matrix. The interval, if passed, is intersected with the validity interval of the NodeTM.

Return Value:

The node's world space transform matrix.

Prototype:

virtual void SetNodeTM(TimeValue t, Matrix3& tm)=0;

Remarks:

This methods sets the node's world space transformation matrix (without the object-offset transformation or world space modifier affect). This method will perform the appropriate operation to the node's transform controller. For example, if the node has a parent, this method will take the parent's transformation into consideration when it calls SetValue() on the controller.

This method can be used to set the world space position of the node.

Parameters:

TimeValue t

Specifies the time to set the transformation matrix.

Matrix3& tm

The node's world space transformation matrix.

Prototype:

virtual void Move(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;

Remarks:

This method may be called to move the node about the specified axis system. Either the pivot point, or the geometry of the object, or both the pivot and the object may be transformed. Optionally, any children of the node can be counter transformed so they don't move.

Parameters:

TimeValue t

The time to transform the node.

const Matrix3& tmAxis

The axis system about which the node is transformed.

const Point3& val

The amount of the transformation relative to the axis system.

BOOL localOrigin=FALSE

If TRUE the transformation takes place about the nodes local origin; otherwise about the world origin.

BOOL affectKids=TRUE

If TRUE any child nodes are transformed along with the parent node. If FALSE any children of the node are counter transformed so they don't move.

int pivMode=PIV_NONE

One of the following values:

PIV_NONE

Move both the pivot point and the geometry of the object.

PIV_PIVOT_ONLY

Move the pivot point only.

PIV_OBJECT_ONLY

Move the geometry of the object only.

BOOL ignoreLocks=FALSE

If TRUE any transform locks associated with the node are ignored; otherwise the locks govern the application of the transformation.

Prototype:

virtual void Rotate(TimeValue t, const Matrix3& tmAxis, const AngAxis& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;

Remarks:

This method may be called to rotate the node about the specified axis system. Either the pivot point, or the geometry of the object, or both the pivot and the object may be transformed. Optionally, any children of the node can be counter transformed so they don't rotate.

Parameters:

TimeValue t

The time to transform the node.

const Matrix3& tmAxis

The axis system about which the node is transformed.

const AngAxis& val

The amount of the transformation.

BOOL localOrigin=FALSE

If TRUE the transformation takes place about the nodes local origin; otherwise about the world origin.

BOOL affectKids=TRUE

If TRUE any child nodes are transformed along with the parent node. If FALSE any children of the node are counter transformed so they don't rotate.

int pivMode=PIV_NONE

One of the following values:

PIV_NONE

Move both the pivot point and the geometry of the object.

PIV_PIVOT_ONLY

Move the pivot point only.

PIV_OBJECT_ONLY

Move the geometry of the object only.

BOOL ignoreLocks=FALSE

If TRUE any transform locks associated with the node are ignored; otherwise the locks govern the application of the transformation.

Prototype:

virtual void Rotate(TimeValue t, const Matrix3& tmAxis, const Quat& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;

Remarks:

This method may be called to rotate the node about the specified axis system. Either the pivot point, or the geometry of the object, or both the pivot and the object may be transformed. Optionally, any children of the node can be counter transformed so they don't rotate.

Parameters:

TimeValue t

The time to transform the node.

const Matrix3& tmAxis

The axis system about which the node is transformed.

const Quat& val

The amount of the transformation.

BOOL localOrigin=FALSE

If TRUE the transformation takes place about the nodes local origin; otherwise about the world origin.

BOOL affectKids=TRUE

If TRUE any child nodes are transformed along with the parent node. If FALSE any children of the node are counter transformed so they don't rotate.

int pivMode=PIV_NONE

One of the following values:

PIV_NONE

Move both the pivot point and the geometry of the object.

PIV_PIVOT_ONLY

Move the pivot point only.

PIV_OBJECT_ONLY

Move the geometry of the object only.

BOOL ignoreLocks=FALSE

If TRUE any transform locks associated with the node are ignored; otherwise the locks govern the application of the transformation.

Prototype:

virtual void Scale(TimeValue t, const Matrix3& tmAxis, const Point3& val, BOOL localOrigin=FALSE, BOOL affectKids=TRUE, int pivMode=PIV_NONE, BOOL ignoreLocks=FALSE)=0;

Remarks:

This method may be called to scale the node about the specified axis system. Either the pivot point, or the geometry of the object, or both the pivot and the object may be transformed. Optionally, any children of the node can be counter transformed so they don't scale.

Parameters:

TimeValue t

The time to transform the node.

const Matrix3& tmAxis

The axis system about which the node is transformed.

const Point3& val

The amount of the transformation.

BOOL localOrigin=FALSE

If TRUE the transformation takes place about the nodes local origin; otherwise about the world origin.

BOOL affectKids=TRUE

If TRUE any child nodes are transformed along with the parent node. If FALSE any children of the node are counter transformed so they don't scale.

int pivMode=PIV_NONE

One of the following values:

PIV_NONE

Move both the pivot point and the geometry of the object.

PIV_PIVOT_ONLY

Move the pivot point only.

PIV_OBJECT_ONLY

Move the geometry of the object only.

BOOL ignoreLocks=FALSE

If TRUE any transform locks associated with the node are ignored; otherwise the locks govern the application of the transformation.

Prototype:

virtual Matrix3 GetObjectTM(TimeValue time, Interval* valid=NULL)=0;

Remarks:

This method returns the transformation matrix the object needs to be multiplied by to transform it into world space.

At times, this matrix may be the identity. For example, a deformable object that has a Space Warp applied to it would already have been translated into world space by the space warp. Since the object is already in world space the matrix needed to get it there is the identity.

This matrix would not be the identity for a deformable object with only object space modifiers applied. This object would indeed need to be transformed. In this case the TM returned would include the NodeTM plus the object-offset transformation. So, GetObjectTM() is dependent on the context when it is called -- it will either be equal to GetObjectTMAfterWSM() or GetObjectTMBeforeWSM().

Developers should use GetObjectTMBeforeWSM() if what is wanted is the object TM and not the identity matrix.

For non-deformable objects this matrix may include the NodeTM, the object-offset transformation and the world space modifier affect.

This matrix could be used, for example, if you have a TriObject and wanted to get the world space coordinate of one of its vertices. You could do this by taking the vertex coordinate in object space and multiplying it by the matrix returned from this method.

This matrix is also often used inside an object's Display() and HitTest() methods. When an object goes to draw itself (in its BaseObject::Display() method) it is given a node pointer. What the object normally does is use the node pointer and calls GetObjectTM(). It then takes the matrix returned and sets it into the graphics window (using GraphicsWindow::setTransform()). In this way, when the object starts drawing points in object space, they will be transformed with this matrix. This will transform the points into world space when they are drawn.

The Object TM is not inherited.

Parameters:

TimeValue time

Specifies the time to retrieve the object's transform matrix.

Interval* valid=NULL

Points to storage for the validity interval of the transformation matrix.

Return Value:

The object's transformation matrix.

Prototype:

virtual Matrix3 GetObjTMBeforeWSM(TimeValue time, Interval* valid=NULL)=0;

Remarks:

This method explicitly retrieves the pipeline ObjectState TM before any world space modifiers have been applied. This includes the node's TM and the object-offset transformation (but not any world space modifier affect). See the section on the Geometry Pipeline for additional details on this method.

Parameters:

TimeValue time

Specifies the time to retrieve the transform matrix.

Interval* valid=NULL

Points to storage for the validity interval of the transformation matrix.

Prototype:

virtual Matrix3 GetObjTMAfterWSM(TimeValue time, Interval* valid=NULL)=0;

Remarks:

This method explicitly retrieves the pipeline ObjectState TM after any world space modifiers have been applied. This includes the Node TM, the object-offset transformation, and any world space modifier affects. In some cases a world space modifier can actually deform the TM itself if it cannot deform the object. Examples of this are cameras and lights. These objects do not have any 'object' to deform, so the space warp deforms the TM instead. See the section on the Geometry Pipeline for additional details on this method.

Note: Beware of calling this method from inside a function that performs a mesh traversal as doing so can invalidate the mesh.

Parameters:

TimeValue time

Specifies the time to retrieve the object's transform matrix.

Interval* valid=NULL

Points to storage for the validity interval of the transformation matrix.

Prototype:

virtual Matrix3 GetParentTM(TimeValue t)=0;

Remarks:

Retrieves the parent node's transformation matrix. This is simply for convenience. It is the equivalent to the following code:

node->GetParentNode()->GetNodeTM();

Parameters:

TimeValue t

Specifies the time to retrieve the transformation matrix.

Return Value:

The parent node's transformation matrix.

Prototype:

virtual int GetTargetTM(TimeValue t, Matrix3& m)=0;

Remarks:

Retrieves the target node's transformation matrix. This is simply for convenience. It is the equivalent to the following code:

node->GetTarget()->GetNodeTM();

Parameters:

TimeValue t

Specifies the time to retrieve the transformation matrix.

Matrix3& m

The result is stored here.

Return Value:

Nonzero if the target matrix was retrieved (the node had a target); otherwise 0.

Prototype:

virtual int IsTarget()=0;

Remarks:

Determines if the node is a target node of a lookat controller.

Return Value:

Nonzero if the node is a target; otherwise 0.

Prototype:

virtual void SetIsTarget(BOOL b)=0;

Remarks:

This method is available in release 3.0 and later only.

This method controls the property of the node indicating if it's a target or not. Calling this is necessary when hooking up targets as the target node must have its IsTarget() property set.

Parameters:

BOOL b

TRUE for set; FALSE for off.

Prototype:

virtual INode* GetTarget()=0;

Remarks:

Retrieves this node's target node if any. Returns NULL if this node has no target.

Prototype:

virtual INode* GetLookatNode()=0;

Remarks:

If this node is a target of a lookat controller, this method finds the node that looks at it.

Return Value:

The node that looks at this node or NULL if the node is not a target.

Prototype:

virtual BOOL GetTransformLock(int type, int axis)=0;

Remarks:

Retrieves the specified transform lock state of the node. When the user is doing interactive Moving / Rotating / Scaling these locks simply remove one of the components.

Parameters:

int type

See Transform Lock Types.

int axis

See Transform Lock Axis.

Return Value:

TRUE if the lock is set; otherwise FALSE.

Prototype:

virtual void SetTransformLock(int type, int axis, BOOL onOff)=0;

Remarks:

Sets the specified transform lock state of the node. When the user is doing interactive Moving / Rotating / Scaling these locks simply remove one of the components.

Parameters:

int type

See Transform Lock Types.

int axis

See Transform Lock Axis.

BOOL onOff

TRUE sets the lock on; FALSE sets the lock off.

The following methods invalidate the node's caches

Prototype:

virtual void InvalidateTreeTM()=0;

Remarks:

This method will notify the node's subtree that the transformation matrix has changed. NotifyDependents() is called with the message REFMSG_CHANGE.

Prototype:

virtual void InvalidateTM()=0;

Remarks:

This method will invalidate the node's transformation matrix cache.

Prototype:

virtual void InvalidateWS()=0;

Remarks:

This method will invalidate the node's world space cache.

Parent-Child Hierarchy manipulation / Groups

Prototype:

virtual INode* GetParentNode()=0;

Remarks:

Retrieves the parent node of this node. If the node is not linked, its parent is the root node. This may be checked using INode::IsRootNode().

Prototype:

virtual int IsRootNode()=0;

Remarks:

Determines if this node is the root node (does not have a parent node).

Return Value:

Nonzero if the node is the root node; otherwise 0.

Prototype:

virtual void AttachChild(INode* node, int keepPos=1)=0;

Remarks:

Makes the specified node a child of this node.

Parameters:

INode* node

Specifies the node to attach.

int keepPos=1

If nonzero, the position of the child node is retained (not moved); otherwise it may be moved.

Prototype:

virtual void Detach(TimeValue t, int keepPos=1)=0;

Remarks:

Detaches this node from its parent.

Parameters:

TimeValue t

Specifies the time at which to detach the node.

int keepPos=1

If nonzero, the position of the detached node is retained (not moved); otherwise it may be moved.

Prototype:

virtual int NumberOfChildren()=0;

Remarks:

Returns the number of children of this node.

Prototype:

virtual INode* GetChildNode(int i)=0;

Remarks:

Retrieves the 'i-th' child node of this node.

Parameters:

int i

Specifies the child node to retrieve.

Prototype:

virtual BOOL IsGroupMember()=0;

Remarks:

Returns TRUE if this node is a member of a group; otherwise FALSE.

Prototype:

virtual BOOL IsGroupHead()=0;

Remarks:

Returns TRUE if this node is the head of a group; otherwise FALSE.

Prototype:

virtual BOOL IsOpenGroupMember();

Remarks:

This method is available in release 2.0 and later only.

Returns TRUE if this node is a member of an open group; otherwise FALSE.

Default Implementation:

{return 0; }

Prototype:

virtual BOOL IsOpenGroupHead();

Remarks:

This method is available in release 2.0 and later only.

Returns TRUE if this node is the head of a group and that group is open; otherwise FALSE.

Default Implementation:

{return 0; }

Prototype:

virtual void SetGroupMember(BOOL b);

Remarks:

This method is available in release 2.0 and later only.

A node is marked as a group member or not. This method sets this state.

Parameters:

BOOL b

TRUE to mark the node as a group member; FALSE to indicate it's not in a group.

Prototype:

virtual void SetGroupHead(BOOL b);

Remarks:

This method is available in release 2.0 and later only.

A node is marked as the group head or not. This method sets this state.

Parameters:

BOOL b

TRUE to mark the node as a group head; FALSE to indicate it's not a group head.

Prototype:

virtual void SetGroupMemberOpen(BOOL b);

Remarks:

This method is available in release 2.0 and later only.

A node is marked as an open group member or not. This method sets this state.

Parameters:

BOOL b

TRUE to mark the node as a open; FALSE to indicate it's not open.

Prototype:

virtual void SetGroupHeadOpen(BOOL b);

Remarks:

This method is available in release 2.0 and later only.

A node is marked as being the head of a group and being open or not. This method sets this state.

Parameters:

BOOL b

TRUE to mark the node as an open group head; FALSE to indicate it's not an open group head.

Target / Node Selection

Prototype:

virtual void SetTargetNodePair(int onOff);

Remarks:

This method is available in release 2.0 and later only.

This method is used for hit-testing and selecting node and target as a single unit.

In 3ds max 2.0 and later you can click on the line connecting, say, a camera to its target and drag that around in the viewports. Doing so moves both the camera and its target as a locked pair.

To accomplish this, the camera, light, and tape measure objects (those with two nodes linked by a Look At controller) check for a hit on the object-target line. If they get there (but not at the object or target itself), then they call this method passing TRUE. Then, when a hit is registered, 3ds max checks the value of this variable (by calling GetTargetNodePair()), and, if it is TRUE, selects both the target and the node. If it's FALSE, then either the target or the node, but not both, gets selected, as with 3ds max 1.x.

For sample code see \MAXSDK\SAMPLES\OBJECTS\LIGHT.CPP or TAPEHELP.CPP.

Parameters:

int onOff

TRUE for on; FALSE for off.

Default Implementation:

{}

Prototype:

virtual int GetTargetNodePair();

Remarks:

This method is available in release 2.0 and later only.

Returns the target/node pair setting stored by 3ds max. See SetTargetNodePair() above for details.

Default Implementation:

{ return 0; }

Display attributes

Prototype:

virtual void Hide(BOOL onOff)=0;

Remarks:

Controls the hidden state of the node in the scene.

Parameters:

BOOL onOff

Pass TRUE to hide the node in the scene; pass FALSE to make the node visible.

Prototype:

virtual int IsHidden(DWORD hFlags=0)=0;

Remarks:

Determines if the node is hidden in the scene.

Parameters:

DWORD hFlags=0

If you pass 0, you will get the hidden state of the node. If you pass one or more of the flags shown below, the method checks the Class_ID of the node to see if it's hidden by the specified category. You may specify one or more of the following values:

HIDE_OBJECTS

HIDE_SHAPES

HIDE_LIGHTS

HIDE_CAMERAS

HIDE_HELPERS

HIDE_WSMS

HIDE_SYSTEMS

HIDE_PARTICLES

HIDE_ALL

HIDE_NONE

See the method Interface::GetHideByCategoryFlags() for how you can retrieve the currently set values to use as the flags for this method.

Return Value:

Nonzero if the node is hidden; otherwise 0.

Prototype:

virtual int IsNodeHidden()=0;

Remarks:

Returns nonzero if the node is hidden in any way; otherwise returns zero.

Prototype:

virtual int IsFrozen()=0;

Remarks:

Determines if the node is frozen in the scene.

Return Value:

Nonzero if the node is frozen; otherwise 0.

Prototype:

virtual void Freeze(BOOL onOff)= 0;

Remarks:

Controls the frozen state of the node in the scene. A frozen node is visible but cannot be picked.

Parameters:

BOOL onOff

TRUE if the node should be frozen; FALSE if the node should not be frozen.

Prototype:

virtual void SetShowFrozenWithMtl(BOOL onOff)=0;

Remarks:

This method is available in release 4.0 and later only.

This method allows you to set the NODE_SHOW_FRZN_WITH_MTL flag in the node so that the node will be displayed in a frozen state with materials applied.

Parameters:

BOOL onOff

TRUE to set the flag; FALSE to disable.

Prototype:

virtual int ShowFrozenWithMtl()=0;

Remarks:

This method is available in release 4.0 and later only.

This method returns the state of the NODE_SHOW_FRZN_WITH_MTL flag in the node and whether it is enabled or disabled.

Prototype:

virtual void XRayMtl(BOOL onOff)=0;

Remarks:

This method is available in release 3.0 and later only.

There is a new X-Ray Material display property which allows you to quickly make objects transparent. This method toggles it on or off for this node.

Parameters:

BOOL onOff

TRUE to use; FALSE to not use.

Prototype:

virtual int HasXRayMtl()=0;

Remarks:

This method is available in release 3.0 and later only.

Returns nonzero if the X-Ray Material display property is on for the node; otherwise zero.

Prototype:

virtual int GetBoxMode()=0;

Remarks:

Determines if the node is displayed in box mode in the scene.

Return Value:

Nonzero if the node is displayed in box mode; otherwise 0.

Prototype:

virtual void BoxMode(BOOL onOff)=0;

Remarks:

Controls if the node is displayed with a bounding box representation in the scene.

Parameters:

BOOL onOff

TRUE to display the node as its bounding box; FALSE for normal display.

Prototype:

virtual void VertTicks(int onOff)=0;

Remarks:

This method is available in release 4.0 and later only.

This method allows you to enable or disable the display of vertex ticks on the node.

Parameters:

int onOff

TRUE to enable; FALSE to disable.

Prototype:

virtual int GetVertTicks()=0;

Remarks:

This method is available in release 4.0 and later only.

This method returns the state of the vertex ticks display. TRUE if enabled; FALSE if disabled.

Prototype:

virtual int GetAllEdges()=0;

Remarks:

Determines if all the edges of the node are displayed.

Return Value:

Nonzero if all the edges (including "hidden" ones) are displayed; otherwise 0.

Prototype:

virtual void AllEdges(BOOL onOff)=0;

Remarks:

Controls the display of all the edges of the node (including "hidden" ones).

Parameters:

BOOL onOff

TRUE to display all the node's edges; FALSE to not display "hidden" edges.

Prototype:

virtual int GetBackCull()=0;

Remarks:

Determines if back-face culling is being used to draw the node.

Return Value:

Nonzero if back-face culling is used; otherwise 0.

Prototype:

virtual void BackCull(BOOL onOff)=0;

Remarks:

Controls if the node is displayed using back-face culling (faces whose surface normals are pointing away from the observer are not drawn).

Parameters:

BOOL onOff

TRUE if the node should be drawn using back-face culling; FALSE if all faces should be drawn.

Prototype:

virtual int GetTrajectoryON();

Remarks:

This method is available in release 2.0 and later only.

Returns nonzero if the trajectory display is on; zero if the trajectory display is off.

Prototype:

virtual void SetTrajectoryON(BOOL onOff);

Remarks:

This method is available in release 2.0 and later only.

This method may be used to turn on or off the trajectory display for the node.

Parameters:

BOOL onOff

TRUE for on; FALSE for off.

Prototype:

virtual void ShowBone(int boneVis)=0;

Remarks:

Controls the display of Bones in the scene. A bone is just the link (or line) connecting the node to its parent. These are the same options as available in the 3ds max user interface in the Display branch, under Link Display, i.e. Display Links and Link Replaces Object.

Parameters:

int boneVis

Specifies the display state:

0: Bones are not drawn.

1: Bones are drawn.

2: Only bones are shown.

Prototype:

virtual BOOL IsBoneOnly();

Remarks:

This method is available in release 2.0 and later only.

Returns TRUE if the bone is showing but the object is hidden; FALSE if both the bone and the node is hidden.

Prototype:

virtual void BoneAsLine(int onOff)=0;

Remarks:

Controls the display of Bones as simple lines in the scene.

Parameters:

int onOff

Nonzero if bones should be shown as lines only; 0 for normal display.

Prototype:

virtual BOOL IsBoneShowing()=0;

Remarks:

Returns TRUE if the node's bone is turned on; otherwise FALSE.

Prototype:

virtual DWORD GetWireColor()=0;

Remarks:

Retrieves the node's wire-frame color. See COLORREF-DWORD format.

Prototype:

virtual void SetWireColor(DWORD newcol)=0;

Remarks:

Sets the node's wire-frame color. This can be any of the 16 million possible colors in 24 bit. See COLORREF-DWORD format.

Parameters:

DWORD newcol

Specifies the new wire-frame color for the node. It may be specified using the RGB macro, for example: RGB(0,0,255);

Prototype:

virtual int Selected()=0;

Remarks:

Determines if the node is selected.

Return Value:

Nonzero if the node is selected; otherwise 0.

Prototype:

virtual int Dependent()=0;

Remarks:

Returns nonzero if the node has its dependent flag set; otherwise 0. This is dependent in the sense of 3ds max's Views/Show Dependencies mode. When in the Modify branch, Show Dependencies will show all the nodes that are dependent on the current modifier or object being editing by highlighting them in green. It also set a flag in the node. This method allows a developer to check this flag.

Rendering Attributes

Prototype:

virtual int CastShadows()=0;

Remarks:

Retrieves the shadow casting attribute of the node.

Return Value:

Nonzero indicates the node casts shadows; zero if the node does not cast shadows.

Prototype:

virtual void SetCastShadows(BOOL onOff)=0;

Remarks:

Sets the shadow casting attribute of the node to on or off.

Parameters:

BOOL onOff

TRUE to turn shadow casting on; FALSE to turn it off.

Prototype:

virtual int RcvShadows()=0;

Remarks:

Retrieves the shadow receiving attribute of the node.

Return Value:

Nonzero indicates the node receives shadows; zero if the node does not receive shadows.

Prototype:

virtual void SetRcvShadows(BOOL onOff)=0;

Remarks:

Sets the shadow receiving attribute of the node to on or off.

Parameters:

BOOL onOff

TRUE to turn shadow receiving on; FALSE to turn it off.

Prototype:

virtual int MotBlur()=0;

Remarks:

Retrieves the type of motion blur used by the node.

Return Value:

One of the following values:

0: None.

1: Object Motion Blur.

2: Image Motion Blur.

Prototype:

virtual void SetMotBlur(int kind)=0;

Remarks:

This method is available in release 2.0 and later only.

Sets the type of motion blur used by the node.

Parameters:

int kind

The kind of motion blur. One of the following values:

0: None.

1: Object Motion Blur.

2: Image Motion Blur.

Prototype:

virtual float GetImageBlurMultiplier(TimeValue t);

Remarks:

This method is available in release 2.0 and later only.

Returns the image motion blur multiplier value at the specified time.

Parameters:

TimeValue t

The time to retrieve the value.

Prototype:

virtual void SetImageBlurMultiplier(TimeValue t, float m);

Remarks:

This method is available in release 2.0 and later only.

Sets the image blur multiplier value for the node. This is used to increase or decrease the length of the blur 'streak'.

Parameters:

TimeValue t

The time to set the value.

float m

The value to set.

Prototype:

virtual Control *GetImageBlurMultController();

Remarks:

This method is available in release 2.0 and later only.

Returns a pointer to the controller for the image blur multiplier value.

Prototype:

virtual void SetImageBlurMultController(Control *cont);

Remarks:

This method is available in release 2.0 and later only.

Sets the controller used for the image blur multiplier value.

Parameters:

Control *cont

Points for the controller to use.

 

Prototype:

virtual BOOL GetMotBlurOnOff(TimeValue t);

Remarks:

This method is available in release 3.0 and later only.

Returns TRUE if the object motion blur controller is 'on' at the specified time; otherwise FALSE.

Parameters:

TimeValue t

The time to check.

Default Implementation:

{ return 1; }

Prototype:

virtual void SetMotBlurOnOff(TimeValue t, BOOL m);

Remarks:

This method is available in release 3.0 and later only.

Sets the state of the object motion blur controller to on or off at the specified time.

Parameters:

TimeValue t

The time to set the value.

BOOL m

TRUE for on; FALSE for off.

Default Implementation:

{}

Prototype:

virtual Control *GetMotBlurOnOffController();

Remarks:

This method is available in release 3.0 and later only.

Returns a pointer to the controller handling the object motion blur on / off setting.

Default Implementation:

{ return NULL;}

Prototype:

virtual void SetMotBlurOnOffController(Control *cont);

Remarks:

This method is available in release 3.0 and later only.

Sets the controller used for handling the object motion blur on / off setting.

Parameters:

Control *cont

Points to the controller to set.

Default Implementation:

{}

Prototype:

virtual int Renderable()=0;

Remarks:

This method is available in release 2.0 and later only.

Returns nonzero if the renderable flag is on; zero if off.

Prototype:

virtual void SetRenderable(BOOL onOff)=0;

Remarks:

This method is available in release 2.0 and later only.

Sets the state of the node's renderable flag. If this flag is on the node will appear in rendered images; if off it won't.

Parameters:

BOOL onOff

TRUE for on; FALSE for off.

Prototype:

virtual void SetRenderOccluded(BOOL onOff)=0;

Remarks:

This method is available in release 3.0 and later only.

Sets the state of the node's 'Render Occluded Object' flag.

Parameters:

BOOL onOff

TRUE for on; FALSE for off.

Prototype:

virtual BOOL GetRenderOccluded()=0;

Remarks:

This method is available in release 3.0 and later only.

Returns TRUE if the node's 'Render Occluded Object' flag is set; otherwise FALSE.

Prototype:

virtual void SetApplyAtmospherics(BOOL onOff)=0;

Remarks:

This method is available in release 4.0 and later only.

This method allows you to set the "apply atmospherics" flag for the node.

Parameters:

BOOL onOff

TRUE to enable the flag, FALSE to disable.

Prototype:

virtual int ApplyAtmospherics()=0;

Remarks:

This method is available in release 4.0 and later only.

This method returns the on/off state of the "apply atmospherics" flag.

Prototype:

virtual void SetPrimaryVisibility(BOOL onOff) = 0;

Remarks:

This method is available in release 4.0 and later only.

This method allows you to set the primary visibility flag and define whether or not the node is visible to the camera.

Parameters:

BOOL onOff

TRUE to enable the flag, FALSE to disable.

Prototype:

virtual int GetPrimaryVisibility() = 0;

Remarks:

This method is available in release 4.0 and later only.

This method returns the on/off state of the primary visibility to determine whether or not the node is visible to the camera.

Prototype:

virtual void SetSecondaryVisibility(BOOL onOff) = 0;

Remarks:

This method is available in release 4.0 and later only.

This method allows you to set the secondary visibility flag and define whether or not the node is visible to reflections and refractions..

Parameters:

BOOL onOff

TRUE to enable the flag, FALSE to disable.

Prototype:

virtual int GetSecondaryVisibility() = 0;

Remarks:

This method is available in release 4.0 and later only.

This method returns the on/off state of the secondary visibility to determine whether or not the node is visible to reflections and refractions.

Vertex Color Attributes

Prototype:

virtual int GetCVertMode();

Remarks:

This method is available in release 2.0 and later only.

Returns nonzero if the vertex color flag if on; otherwise zero.

Prototype:

virtual void SetCVertMode(int onOff);

Remarks:

This method is available in release 2.0 and later only.

Sets the vertex color flag to on or off. This controls the display of assigned vertex colors. Vertex colors are assigned in the editable mesh in vertex or face sub-object level. Vertex colors only appear in viewports using Smooth or Smooth + Highlight display modes, regardless of the state of this flag.

Parameters:

int onOff

Nonzero for on; zero for off.

Prototype:

virtual int GetShadeCVerts();

Remarks:

This method is available in release 2.0 and later only.

Returns nonzero if the vertex color shaded flag is on; zero if off.

Prototype:

virtual void SetShadeCVerts(int onOff);

Remarks:

This method is available in release 2.0 and later only.

Sets the vertex color shaded flag. This determines whether the vertex colors appears shaded in the viewport. When this is off, the colors are unshaded, and appear in their pure RGB values, looking a little like self-illuminated materials. When on, the colors appear like any other assigned color in the viewports

Parameters:

int onOff

Nonzero of on; zero of off.

Prototype:

void CopyProperties(INode *from);

Remarks:

This method is available in release 4.0 and later only.

Calling this method copies the various display, rendering, bone and other general parameters from the "from" object. This is used in Edit(able) Spline and Edit(able) Patch to copy node settings into new nodes created by the "Detach" operations.

Parameters:

INode *frame

A pointer to the INode to copy the properties from.

Object Reference

Prototype:

virtual Object* GetObjectRef()=0;

Remarks:

Returns the object that this node references unless the node has been bound to a Space Warp. In that case this method will not return the WSM derived object even though the node's object reference points at it. Instead it will return the item that the WSM derived object references. Thus, this method will always return essentially the object space portion of the pipeline. In contrast, see GetObjOrWSMRef() below.

See the Geometry Pipeline section for additional details.

Prototype:

virtual void SetObjectRef(Object *o)=0;

Remarks:

Sets the object that this node references. See the Geometry Pipeline section for additional details.

Parameters:

Object *o

The object this node will reference.

Prototype:

virtual Object *GetObjOrWSMRef()=0;

Remarks:

This method is available in release 2.0 and later only.

This method returns the actual object reference of the node directly. So if this node is bound to a Space Warp this method will return a WSM derived object. If you want the object space portion of the pipeline see GetObjectRef() above.

Controller Access

Prototype:

virtual Control* GetTMController()=0;

Remarks:

Retrieves the node's transform controller. The standard 3ds max transform controllers each have sub -controllers for position, rotation and scale.

To access the data of the node's transform controller you may use Class IKeyControl. The following code fragment shows an example of how this may be done for a PRS controller.

 Control *c;

 c = node->GetTMController()->GetPositionController();

 IKeyControl *ikeys = GetKeyControlInterface(c);

With this controller interface you can use its methods to get information about the keys, for example:

 int num = ikeys->GetNumKeys();

Prototype:

virtual void SetTMController(Control *m3cont)=0;

Remarks:

Sets the node's transform controller.

Parameters:

Control *m3cont

The Matrix3 transform controller to use.

Prototype:

virtual Control *GetVisController()=0;

Remarks:

Returns the visibility controller for this node.

Prototype:

virtual void SetVisController(Control *cont)=0;

Remarks:

Sets the visibility controller for this node.

Parameters:

Control *cont

The controller to use for visibility control.

Visibility Related Methods

Prototype:

virtual float GetVisibility(TimeValue t,Interval *valid=NULL)=0;

Remarks:

Retrieves the visibility of the node at the time passed and updates the validity interval passed. Values < 0 indicate off while values > 0 indicate on. The node is fully visible (opaque) when 1.0 and fully invisible (transparent) when 0.0.

Parameters:

TimeValue t

The time to get the visibility value.

Interval *valid=NULL

The validity interval to update based on the validity of the visibility.

Prototype:

virtual void SetVisibility(TimeValue t,float vis)=0;

Remarks:

Sets the visibility of the node to the value passed at the time passed.

Parameters:

TimeValue t

The time to set the visibility value.

float vis

The visibility of the node to set. This is treated like a boolean value where < 0 means off and > 0 means on.

Prototype:

virtual float GetLocalVisibility(TimeValue t,Interval *valid=NULL)=0;

Remarks:

This method is available in release 2.0 and later only.

Returns the local visibility of the node. The value returned from this method is treated like a boolean value where < 0 means off and > 0 means on.

If a node returns TRUE from GetInheritVisibility() then its visibility is determined by this method. If GetInheritVisibility() method returns FALSE then the visibility of the node is determined by GetVisibility().

Parameters:

TimeValue t

The time to get the local visibility value.

Interval *valid=NULL

The validity interval to update based on the validity of the local visibility controller.

Prototype:

virtual BOOL GetInheritVisibility()=0;

Remarks:

This method is available in release 2.0 and later only.

Returns TRUE if the node's visibility is determined by the visibility of the parent of the node; otherwise returns FALSE.

Prototype:

virtual void SetInheritVisibility(BOOL onOff)=0;

Remarks:

This method is available in release 2.0 and later only.

This method is called to set the state of the node's inherit visibility flag.

Parameters:

BOOL onOff

Pass TRUE to have the node inherit its visibility from its parent; otherwise pass FALSE and the node's visibility will be determine by the node itself (not its parent).

Renderer Materials

Prototype:

virtual Mtl* GetMtl()=0;

Remarks:

Returns a pointer to the renderer material for the node. If the value returned is NULL the user has not assigned a material yet. See Class Mtl, Working with Materials and Textures.

Prototype:

virtual void SetMtl(Mtl* matl)=0;

Remarks:

Sets the renderer material used by the node. If the value set is NULL it indicates a material has not been assigned. In this case, the renderer uses the wireframe color of the node for rendering. See Class Mtl, Working with Materials and Textures.

Parameters:

Mtl* matl

The materials used to render the node.

GraphicsWindow Materials

Prototype:

virtual Material* Mtls()=0;

Remarks:

Returns a pointer to the GraphicsWindow materials. See NumMtls() below for the number of entries in this array.

Prototype:

virtual int NumMtls()=0;

Remarks:

Returns the number of entries in the array of Materials returned by Mtls() above.

Object-Offset methods

Prototype:

virtual void SetObjOffsetPos(Point3 p)=0;

Remarks:

Sets the position portion of the object offset from the node. See the Advanced Topics section on Node and Object Offset Transformations for an overview of the object offset transformation.

Parameters:

Point3 p

Specifies the position portion of the object-offset.

Prototype:

virtual Point3 GetObjOffsetPos()=0;

Remarks:

Returns the position portion of the object-offset from the node as a Point3. See the Advanced Topics section on Node and Object Offset Transformations for an overview of the object offset transformation.

Prototype:

virtual void SetObjOffsetRot(Quat q)=0;

Remarks:

Sets the rotation portion of the object-offset from the node. See the Advanced Topics section on Node and Object Offset Transformations for an overview of the object offset transformation.

Parameters:

Quat q

The rotation offset.

Prototype:

virtual Quat GetObjOffsetRot()=0;

Remarks:

Returns the rotation portion of the object-offset from the node. See the Advanced Topics section on Node and Object Offset Transformations for an overview of the object offset transformation.

Prototype:

virtual void SetObjOffsetScale(ScaleValue sv)=0;

Remarks:

Sets the scale portion of the object-offset matrix. See the Advanced Topics section on Node and Object Offset Transformations for an overview of the object offset transformation.

Parameters:

ScaleValue sv

The scale portion of the offset. See Class ScaleValue.

Prototype:

virtual ScaleValue GetObjOffsetScale()=0;

Remarks:

Returns the scale portion of the object-offset from the node. See Class ScaleValue. See the Advanced Topics section on Node and Object Offset Transformations for an overview of the object offset transformation.

Put Nodes into the Foreground Plane

Prototype:

virtual void FlagForeground(TimeValue t,BOOL notify=TRUE)=0;

Remarks:

Flags the node to put it in the foreground. For additional information see Foreground / Background Planes.

Parameters:

TimeValue t

The time to put the node in the foreground.

BOOL notify=TRUE

If TRUE, the reference message REFMSG_FLAGDEPENDENTS with PART_PUT_IN_FG is sent.

Active Grid Object

Prototype:

virtual int IsActiveGrid()=0;

Remarks:

Determines if this node is the active grid object.

Return Value:

Nonzero indicates the node is the active grid object; zero indicates it is not.

 

Temporary Storage of Data with Nodes

Prototype:

virtual void SetNodeLong(LONG l)=0;

Remarks:

This method provides temporary storage of data with the node. Data stored with the node is only valid before you return control.

Parameters:

LONG l

The data to store with the node.

Prototype:

virtual LONG GetNodeLong()=0;

Remarks:

Retrieve the data stored with the node (using SetNodeLong()).

Return Value:

The data stored with the node.

Access to Render Data

Prototype:

virtual RenderData *GetRenderData()=0;

Remarks:

Returns the render data for the node. See Class RenderData.

Prototype:

virtual void SetRenderData(RenderData *rd)=0;

Remarks:

Sets the render data for the node.

Parameters:

RenderData *rd

The render data to set.

Access user defined property text.

For additional overview information on these methods see the Advanced Topics section Custom Node Properties.

Prototype:

virtual void GetUserPropBuffer(TSTR &buf)=0;

Remarks:

This method allows access to the entire user defined property text buffer.

Parameters:

TSTR &buf

The buffer to hold the user defined property text.

Prototype:

virtual void SetUserPropBuffer(const TSTR &buf)=0;

Remarks:

This method allows a developer to set to the entire user defined property text buffer.

Parameters:

const TSTR &buf

The buffer containing the user defined property text.

Prototype:

virtual BOOL GetUserPropString(const TSTR &key,TSTR &string)=0;

Remarks:

This method retrieves a string based on the key passed.

Parameters:

const TSTR &key

The key (or name) of the user defined property text.

TSTR &string

Storage for the string to retrieve.

Return Value:

TRUE if the key was found; otherwise FALSE.

Prototype:

virtual BOOL GetUserPropInt(const TSTR &key,int &val)=0;

Remarks:

Retrieves an integer value from the node based on the key passed.

Parameters:

const TSTR &key

The key (or name) of the data to retrieve.

int &val

Storage for the integer value.

Return Value:

TRUE if the key was found; otherwise FALSE.

Prototype:

virtual BOOL GetUserPropFloat(const TSTR &key,float &val)=0;

Remarks:

Retrieves a floating point value from the node based on the key passed.

Parameters:

const TSTR &key

The key (or name) of the data to retrieve.

float &val

Storage for the float value.

Return Value:

TRUE if the key was found; otherwise FALSE.

Prototype:

virtual BOOL GetUserPropBool(const TSTR &key,BOOL &b)=0;

Remarks:

Retrieves a boolean value from the node based on the key passed.

Parameters:

const TSTR &key

The key (or name) of the data to retrieve.

BOOL &b

Storage for the boolean value.

Return Value:

TRUE if the key was found; otherwise FALSE.

Prototype:

virtual void SetUserPropString(const TSTR &key,const TSTR &string)=0;

Remarks:

Stores a string in the node using the key passed. If the key name already exists it is overwritten; otherwise it is created.

Parameters:

const TSTR &key

The key (or name) of the data to store.

const TSTR &string

The string to store.

Prototype:

virtual void SetUserPropInt(const TSTR &key,int val)=0;

Remarks:

Stores an integer value in the node using the key passed. If the key name already exists it is overwritten; otherwise it is created.

Parameters:

const TSTR &key

The key (or name) of the data to store.

int val

The value to store.

Prototype:

virtual void SetUserPropFloat(const TSTR &key,float val)=0;

Remarks:

Stores a floating point value in the node using the key passed. If the key name already exists it is overwritten; otherwise it is created.

Parameters:

const TSTR &key

The key (or name) of the data to store.

float val

The value to store.

Prototype:

virtual void SetUserPropBool(const TSTR &key,BOOL b)=0;

Remarks:

Stores a boolean value in the node using the key passed. If the key name already exists it is overwritten; otherwise it is created.

Parameters:

const TSTR &key

The key (or name) of the data to store.

BOOL b

The value to store.

Prototype:

virtual BOOL UserPropExists(const TSTR &key)=0;

Remarks:

This method simply checks to see if a key exists.

Parameters:

const TSTR &key

The key string to search for.

Return Value:

TRUE if the key was found; otherwise FALSE.

Geometry/Graphics (G) Buffer ID Access

Prototype:

virtual ULONG GetGBufID()=0;

Remarks:

Returns the G-Buffer ID of this node. This is the ID available in the BMM_CHAN_NODE_ID channel. See Working with Bitmaps (G-Buffer) for additional details.

Prototype:

virtual void SetGBufID(ULONG id)=0;

Remarks:

Sets the G-Buffer ID of this node. This is the ID available in the BMM_CHAN_NODE_ID channel. See Working with Bitmaps (G-Buffer) for additional details.

Parameters:

ULONG id

The G-Buffer ID.

Prototype:

virtual UWORD GetRenderID();

Remarks:

This method is available in release 2.0 and later only.

Returns the G-Buffer render ID of the node. This is set by the renderer during a video post render when the BMM_CHAN_NODE_RENDER_ID is requested.

Prototype:

virtual void SetRenderID(UWORD id);

Remarks:

This method is available in release 2.0 and later only.

Sets the G-Buffer render ID of the node. This is set by the renderer during a video post render when the BMM_CHAN_NODE_RENDER_ID is requested.

IK Related Methods

The following methods deal with IK parameters associated with a node.

Prototype:

virtual float GetPosTaskWeight();

Remarks:

This method is available in release 2.0 and later only.

This method returns the position weight for the node.

Prototype:

virtual float GetRotTaskWeight();

Remarks:

This method is available in release 2.0 and later only.

This method returns the rotation weight for the node.

Prototype:

virtual void SetPosTaskWeight(float w);

Remarks:

This method is available in release 2.0 and later only.

This method sets the position weight for the node.

Parameters:

float w

The position weight for the node. This value is >= 0.0.

Prototype:

virtual void SetRotTaskWeight(float w);

Remarks:

This method is available in release 2.0 and later only.

This method sets the rotation weight for the node.

Parameters:

float w

The rotation weight for the node. This value is >= 0.0.

Prototype:

virtual BOOL GetTaskAxisState(int which,int axis);

Remarks:

This method is available in release 2.0 and later only.

Returns TRUE of FALSE to indicate if the specified axis is set for position or rotation.

Parameters:

int which

Indicates if the method returns the position state or the rotation state: 0 specifies position; 1 specifies rotation.

int axis

The axis to check. 0 specifies X, 1 specifies Y, 2 specifies Z.

Prototype:

virtual void SetTaskAxisState(int which,int axis,BOOL onOff);

Remarks:

This method is available in release 2.0 and later only.

Sets the specified axis state for position or rotation.

Parameters:

int which

Indicates if the method returns the position state or the rotation state: 0 specifies position; 1 specifies rotation.

int axis

The axis to check. 0 specifies X, 1 specifies Y, 2 specifies Z.

BOOL onOff

TRUE for on; FALSE for off.

Prototype:

virtual DWORD GetTaskAxisStateBits();

Remarks:

This method is available in release 2.0 and later only.

This method returns the same information as GetTaskAxisState() above.

Return Value:

The first three bits indicate position X, Y and Z. Then the next three bits indicate rotation X, Y, Z.

WSMDerivedObject Access

Prototype:

virtual void CreateWSMDerivedObject();

Remarks:

This method is available in release 2.0 and later only.

Calling this method will create a WSM derived object for this node if one doesn't already exist.

Default Implementation:

{}

Prototype:

virtual IDerivedObject *GetWSMDerivedObject();

Remarks:

This method is available in release 2.0 and later only.

This method pointer to the WSM Derived object for this node. Note that there is at most one WSM derived object per node.

Default Implementation:

{return NULL;}

Deleting The Node

Prototype:

virtual void Delete(TimeValue t, int keepChildPosition);

Remarks:

This method is available in release 2.0 and later only.

This method will delete the node, handle removing it from the hierarchy, and handle undo.  

Parameters:

TimeValue t

The time for the deletion.

int keepChildPosition

If TRUE the position of any children of this node are kept the same; otherwise linked children may move due to the deletion.

INodeTransformed methods

Prototype:

virtual void DisposeTemporary();

Remarks:

If this was a temporary INode (like an INodeTransformed) then this method will delete it. Also see the method Interface::GetModContexts().

Prototype:

virtual INode *GetActualINode();

Remarks:

In the case of INodeTransformed, this method retrieves a pointer to the real node.

Return Value:

A pointer to the node.

XRef Access

Scene XRef related methods. These methods are only implemented by root nodes. Note that Scene XRefs are stored as complete scenes with root nodes where the XRef scene root node is a child of the current scene's root node. See Also: Class IXRefObject.

Prototype:

virtual int GetXRefFileCount();

Remarks:

This method is available in release 3.0 and later only.

Returns the number of scene xrefs.

Default Implementation:

{return 0;}

Prototype:

virtual TSTR GetXRefFileName(int i);

Remarks:

This method is available in release 3.0 and later only.

Returns the name of the scene xref whose index is passed.

Parameters:

int i

The zero based index of the scene xref (0 to GetXRefFileCount()-1).

Default Implementation:

{return TSTR();}

Prototype:

virtual void SetXRefFileName(int i,TCHAR *fname,BOOL reload);

Remarks:

This method is available in release 3.0 and later only.

Sets the name of the scene xref whose index is passed.

Parameters:

int i

The zero based index of the scene xref (0 to GetXRefFileCount()-1).

TCHAR *fname

The name to set.

BOOL reload

TRUE to reload; FALSE to not reload.

Default Implementation:

{}

Prototype:

virtual BOOL AddNewXRefFile(TSTR &name, BOOL loadNow=TRUE);

Remarks:

This method is available in release 3.0 and later only.

Adds the specified file to the scene and optionally updates the scene now.

Parameters:

TSTR &name

The file name to load.

BOOL loadNow=TRUE

If TRUE the file is loaded immediately and the scene updated; if FALSE the scene is now updated until the user requests it.

Return Value:

TRUE if the XRef was loaded; otherwise FALSE.

Default Implementation:

{return FALSE;}

Prototype:

virtual BOOL DeleteXRefFile(int i);

Remarks:

This method is available in release 3.0 and later only.

This method removes the 'i-th' Scene XRef.

Parameters:

int i

The zero based index of the Scene XRef to load.

Return Value:

TRUE if the file was deleted from the scene; otherwise FALSE.

Default Implementation:

{return FALSE;}

Prototype:

virtual BOOL BindXRefFile(int i);

Remarks:

This method is available in release 3.0 and later only.

This methods binds the specified XRef. This deletes the XRef after merging it into the scene.

Parameters:

int i

The zero based index of the XRef to bind.

Return Value:

TRUE if the file was deleted; otherwise FALSE.

Default Implementation:

{return FALSE;}

Prototype:

virtual void DeleteAllXRefs();

Remarks:

This method is available in release 3.0 and later only.

This method deletes all the XRefs from the scene. This is called when loading a new file, reseting or clearing the scene.

Default Implementation:

{}

Prototype:

virtual BOOL ReloadXRef(int i);

Remarks:

This method is available in release 3.0 and later only.

This method will reload (updates from disk) the specified XRef.

Parameters:

int i

The zero based index of the XRef to reload.

Return Value:

TRUE if the XRef was reloaded; otherwise FALSE.

Default Implementation:

{return FALSE;}

Prototype:

virtual void FlagXrefChanged(int i);

Remarks:

This method is available in release 3.0 and later only.

This method indicates that the specified XRef has been changed and should be updated.

Parameters:

int i

The zero based index of the XRef to flag.

Default Implementation:

{}

Prototype:

virtual BOOL UpdateChangedXRefs(BOOL redraw=TRUE);

Remarks:

This method is available in release 3.0 and later only.

This method updates all XRefs which have their changed flag set.

Parameters:

BOOL redraw=TRUE

TRUE to redraw the scene; otherwise FALSE.

Return Value:

TRUE if the XRefs were loaded okay; otherwise FALSE.

Default Implementation:

{return FALSE;}

Prototype:

virtual INode *GetXRefTree(int i);

Remarks:

This method is available in release 3.0 and later only.

Returns the root node of the tree for the specified XRef. This method, when called on a root node, will access the various XRef scenes. Note that these can be nested so calling this on the root node of the scene will return the root node of one of the scene XRefs. Calling it on the root node of the scene XRef will get the root node of a nested XRef and so on. Note that this is not the parent of the XRef (see GetXRefParent() below).

Parameters:

int i

The zero based index of the XRef.

Default Implementation:

{return NULL;}

Prototype:

virtual INode *GetXRefParent(int i);

Remarks:

This method is available in release 3.0 and later only.

Returns the parent node of the specified XRef. This is the node in the scene (if any) which the scene XRef is linked to through the special bind function in the scene XRef dialog.

Parameters:

int i

The zero based index of the XRef.

Default Implementation:

{return NULL;}

Prototype:

virtual void SetXRefParent(int i, INode *par);

Remarks:

This method is available in release 3.0 and later only.

Sets the parent of the specified XRef to the node passed.

Parameters:

int i

The zero based index of the XRef.

INode *par

The parent node to set.

Default Implementation:

{}

Prototype:

virtual BOOL FindUnresolvedXRefs(Tab<TSTR*> &fnames);

Remarks:

This method is available in release 3.0 and later only.

Generates a table of names for the unresolved XRefs in the scene.

Parameters:

Tab<TSTR*> &fnames

The table of names. See Template Class Tab.

Return Value:

Returns TRUE if there are still unresolved XRefs; otherwise FALSE.

Default Implementation:

{return FALSE;}

Prototype:

virtual void AttemptToResolveUnresolvedXRefs();

Remarks:

This method is available in release 3.0 and later only.

This method tries to load any XRefs that are currently unresolved.

Default Implementation:

{}

Prototype:

virtual DWORD GetXRefFlags(int i);

Remarks:

This method is available in release 3.0 and later only.

Returns the state of flags for the specified XRef.

Parameters:

int i

The zero based index of the XRef whose flags are returned.

Return Value:

See List of XRef Flag Bits.

Default Implementation:

{return 0;}

Prototype:

virtual void SetXRefFlags(int i,DWORD flag,BOOL onOff);

Remarks:

This method is available in release 3.0 and later only.

Sets the state of the specified flags in the specified XRef to on or off.

Parameters:

int i

The zero based index of the XRef whose flags are set.

DWORD flag

See List of XRef Flag Bits.

BOOL onOff

TRUE for on; FALSE for off.

Default Implementation:

{}

Bone Methods

 

Prototype:

virtual void SetBoneNodeOnOff(BOOL onOff, TimeValue t);

Remarks:

This method is available in release 4.0 and later only.

Sets the bone on/off property of the node.

Parameters:

BOOL onOff

Pass TRUE for on; FALSE for off.

TimeValue t

The time at which to set the property.

Default Implementation:

{}

Prototype:

virtual void SetBoneAutoAlign(BOOL onOff);

Remarks:

This method is available in release 4.0 and later only.

Sets the bone auto-align property of the node.

Parameters:

BOOL onOff

Pass TRUE for on; FALSE for off.

Default Implementation:

{}

Prototype:

virtual void SetBoneFreezeLen(BOOL onOff);

Remarks:

This method is available in release 4.0 and later only.

Sets the bone freeze length property of the node.

Parameters:

BOOL onOff

Pass TRUE for on; FALSE for off.

Default Implementation:

{}

Prototype:

virtual void SetBoneScaleType(int which);

Remarks:

This method is available in release 4.0 and later only.

Sets the bone scale (stretch) type to the specified value.

Parameters:

int which

One of the following values:

BONE_SCALETYPE_SCALE

BONE_SCALETYPE_SQUASH

BONE_SCALETYPE_NONE

Default Implementation:

{}

Prototype:

virtual void SetBoneAxis(int which);

Remarks:

This method is available in release 4.0 and later only.

Sets the bone axis of the node to the specified value.

Parameters:

int which

One of the following values:

BONE_AXIS_X

BONE_AXIS_Y

BONE_AXIS_Z

Default Implementation:

{}

Prototype:

virtual void SetBoneAxisFlip(BOOL onOff);

Remarks:

This method is available in release 4.0 and later only.

Sets the state of the bone axis flip toggle.

Parameters:

BOOL onOff

Pass TRUE for on; FALSE for off.

Default Implementation:

{}

Prototype:

virtual BOOL GetBoneNodeOnOff();

Remarks:

This method is available in release 4.0 and later only.

Returns TRUE if the bone property if on; FALSE if off.

Default Implementation:

{return FALSE;}

Prototype:

virtual BOOL GetBoneAutoAlign();

Remarks:

This method is available in release 4.0 and later only.

Returns TRUE if the bone auto-align property is on; FALSE if off.

Default Implementation:

{return FALSE;}

Prototype:

virtual BOOL GetBoneFreezeLen();

Remarks:

This method is available in release 4.0 and later only.

Returns TRUE if the freeze length property is on; FALSE if off.

Default Implementation:

{return FALSE;}

Prototype:

virtual int GetBoneScaleType();

Remarks:

This method is available in release 4.0 and later only.

Returns a value which indicates the bone scale type.

Return Value:

One of the following values:

BONE_SCALETYPE_SCALE

BONE_SCALETYPE_SQUASH

BONE_SCALETYPE_NONE

Default Implementation:

{return 0;}

Prototype:

virtual int GetBoneAxis();

Remarks:

This method is available in release 4.0 and later only.

Returns a value which indicates the bone axis.

Return Value:

One of the following values:

BONE_AXIS_X

BONE_AXIS_Y

BONE_AXIS_Z

Default Implementation:

{return 0;}

Prototype:

virtual BOOL GetBoneAxisFlip();

Remarks:

This method is available in release 4.0 and later only.

Returns TRUE if the axis flip toggle is on; FALSE if off.

Default Implementation:

{return FALSE;}

Prototype:

virtual void RealignBoneToChild(TimeValue t);

Remarks:

This method is available in release 4.0 and later only.

Calling this method is the equivalent of pressing the Realign button in the UI.

Parameters:

TimeValue t

The time at which to reset the initial child position.

Default Implementation:

{}

Prototype:

virtual void ResetBoneStretch(TimeValue t) {};

Remarks:

This method is available in release 4.0 and later only.

Calling this method is the equivalent of pressing the Reset Stretch button in the UI. This will cause the X-axis of the bone to realign to point at the child bone (or average pivot of multiple children).

Parameters:

TimeValue t

The time at which to reset the bone stretch.

Default Implementation:

{}

Prototype:

virtual Matrix3 GetStretchTM(TimeValue t, Interval *valid=NULL);

Remarks:

This method is available in release 4.0 and later only.

This method returns the strechTM without the object offset included.

Normally matrix concatenation occurs in the following maner:

objectTM = objectOffsetTM * stretchTM * nodeTM

A plug-in that uses the objectTM will transparently inherit the effects of the stretchTM. However if a plug-in (such as skin) wants the stretchTM included but not the object offset, this method will return the stretchTM alone. If the node is not a bone or has no stretching, this method will return the identity.

Parameters:

TimeValue t

The time at which to obtain the strechtTM.

Interval *valid = NULL

The interval.

Default Implementation:

{return Matrix3(1);}