Class ILayer

3DS Max Plug-In SDK

Class ILayer

See Also: Class ReferenceTarget, Class ILayerManager, Class LayerProperty, Class INode.

class ILayer : public ReferenceTarget

Description:

This class is available in release 3.0 and later only.

This class is an interface to the Layers functionality provided by 3D Studio VIZ. Basically, Layers govern (override) some properties of the nodes which are on the layer. For example, a Layer could be used to freeze all the nodes on it without having to set this property of each node individually.

Some of the methods below are not functional in 3ds max. Such cases are noted in the remarks for the method.

Data Members:

public:

static const SClass_ID kLayerSuperClassID;

The super class ID of the layer interface class.

Methods:

public:

Prototype:

virtual bool AddToLayer(INode *rtarg)=0;

Remarks:

Adds the specified node to this layer.

Parameters:

INode *rtarg

The node to add.

Prototype:

virtual bool DeleteFromLayer(INode *rtarg)=0;

Remarks:

Deletes the specified node from this layer. Note: This method does nothing in 3ds max.

Parameters:

INode *rtarg

The node to delete from this layer.

Prototype:

virtual void SetName(const TSTR &name)=0;

Remarks:

Sets the name of this layer.

Parameters:

const TSTR &name

The name for this layer.

Prototype:

virtual TSTR GetName() const=0;

Remarks:

Returns the name of this layer. Note: The user of this method must delete the returned string.

Prototype:

virtual void SetWireColor(DWORD newcol)=0;

Remarks:

Sets the wire frame color.

Parameters:

DWORD newcol

See COLORREF.

Prototype:

virtual DWORD GetWireColor() const=0;

Remarks:

Returns the wire frame color. See COLORREF.

Prototype:

virtual void Hide(bool onOff)=0;

Remarks:

Sets the hidden state.

Parameters:

bool onOff

Use true for hidden; false for not hidden.

Prototype:

virtual bool IsHidden() const=0;

Remarks:

Returns true if hidden; false if not hidden.

Prototype:

virtual void Freeze(bool onOff)=0;

Remarks:

Sets the frozen state.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool IsFrozen() const=0;

Remarks:

Returns true if frozen; false if not.

Prototype:

virtual void SetRenderable(bool onOff)=0;

Remarks:

Sets the renderable state.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool Renderable() const=0;

Remarks:

Returns true if renderable; false if not.

Prototype:

virtual void SetPrimaryVisibility(bool onOff) = 0;

Remarks:

This method allows you to set or unset the primary visibility flag for the layer.

Parameters:

bool onOff

TRUE to set; FALSE to unset.

Prototype:

virtual bool GetPrimaryVisibility() const = 0;

Remarks:

This method returns TRUE if the primary visibility flag for the layer is set.

Prototype:

virtual void SetSecondaryVisibility(bool onOff) = 0;

Remarks:

This method allows you to set the secondary visibility flag for the layer.

Parameters:

bool onOff

TRUE to set; FALSE to unset.

Prototype:

virtual bool GetSecondaryVisibility() const = 0;

Remarks:

This method returns TRUE if the secondary visibility flag for the layer is set.

Prototype:

virtual void XRayMtl(bool onOff)=0;

Remarks:

Sets the X-Ray material property.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool HasXRayMtl() const=0;

Remarks:

Returns true if X-Ray material is set; false if not.

Prototype:

virtual void IgnoreExtents(bool onOff)=0;

Remarks:

Sets the ignore extents property.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool GetIgnoreExtents() const=0;

Remarks:

Returns true if ignore extents is on; false if off.

Prototype:

virtual void BoxMode(bool onOff)=0;

Remarks:

Sets the box mode state.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool GetBoxMode() const=0;

Remarks:

Returns true if box mode is on; false if off.

Prototype:

virtual void AllEdges(bool onOff)=0;

Remarks:

Sets the all edges setting.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool GetAllEdges() const=0;

Remarks:

Returns true if all edges is on; false if off.

Prototype:

virtual void VertTicks(bool onOff)=0;

Remarks:

Sets the vertex ticks state.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool GetVertTicks() const=0;

Remarks:

Returns true if vertex ticks is on; false if off.

Prototype:

virtual void BackCull(bool onOff)=0;

Remarks:

Sets the backface culling state.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool GetBackCull() const=0;

Remarks:

Returns true if backface culling is on; false if not.

Prototype:

virtual void SetCVertMode(bool onOff)=0;

Remarks:

Sets the color per vertex display mode.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool GetCVertMode() const=0;

Remarks:

Returns true if the color vertex display mode is on; otherwise false.

Prototype:

virtual void SetShadeCVerts(bool onOff)=0;

Remarks:

Sets the shaded color vertex display mode.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool GetShadeCVerts() const=0;

Remarks:

Returns true if the shaded color vertex mode is on; false if off.

Prototype:

virtual void SetCastShadows(bool onOff)=0;

Remarks:

Sets the cast shadow state.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool CastShadows() const=0;

Remarks:

Returns true if cast shadow is on; false if off.

Prototype:

virtual void SetRcvShadows(bool onOff)=0;

Remarks:

Sets the receives shadow state.

Parameters:

bool onOff

Use true for on; false for off.

Prototype:

virtual bool RcvShadows() const=0;

Remarks:

Returns true if receives shadow is on; false if off.

Prototype:

virtual void SetMotBlur(int kind)=0;

Remarks:

Sets the type of motion blur used by the layer.

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 int MotBlur() const=0;

Remarks:

Returns the type of motion blur used by the layer. One of the following values:

0: None.

1: Object Motion Blur.

2: Image Motion Blur.

Prototype:

virtual int GetRenderFlags() const=0;

Remarks:

This method is for internal use.

Prototype:

virtual void SetRenderFlags(int flags)=0;

Remarks:

This method is for internal use.

Prototype:

virtual int GetDisplayFlags() const=0;

Remarks:

This method is for internal use.

Prototype:

virtual int AddProperty(LayerProperty &lprop)=0;

Remarks:

This method is currently unused and reserved for future use.

Prototype:

virtual int SetProperty(LayerProperty &lprop)=0;

Remarks:

This method is currently unused and reserved for future use.

Prototype:

virtual int GetProperty(LayerProperty &lprop) const=0;

Remarks:

This method is currently unused and reserved for future use.

Prototype:

virtual bool Used() const=0;

Remarks:

Returns true if the layer is used (nodes have been added); otherwise false.

Prototype:

virtual bool GetFlag(int mask) const=0;

Remarks:

This method is for internal use.

Prototype:

virtual bool GetFlag2(int mask) const=0;

Remarks:

This method is for internal use.

Prototype:

virtual void UpdateSelectionSet()=0;

Remarks:

This method is for internal use in VIZ. Note: This method does nothing in 3ds max.

Prototype:

virtual int GetRenderFlags(int oldlimits) const = 0;

Remarks:

This method returns the render flags associated with the layer.

Parameters:

int oldlimits

The old limits flag.

Prototype:

virtual void SetInheritVisibility(bool onOff) = 0;

Remarks:

This method allows you to set the inherit visibility flag for the layer.

Parameters:

bool onOff

TRUE to set; FALSE to unset.

Prototype:

virtual bool GetInheritVisibility() const = 0;

Remarks:

This method returns TRUE if the inherit visibility flag for the layer is set.

Prototype:

virtual void Trajectory(bool onOff, bool temp = false) = 0;

Remarks:

This method allows you to set the display trajectory flag for the layer.

Parameters:

bool onOff

TRUE to set; FALSE to unset.

bool temp = false

This is used internally.

Prototype:

virtual bool GetTrajectory() const = 0;

Remarks:

This method returns TRUE if the display trajectory flag for the layer is set.

Prototype:

virtual void SetDisplayByLayer(BOOL onOff, INode *) = 0;

Remarks:

This method allows you to set the display by layer flag on a per-node basis.

Parameters:

bool onOff

TRUE to set; FALSE to unset.

Node *

The pointer to the node.

Prototype:

virtual void SetRenderByLayer(BOOL onOff, INode *) = 0;

Remarks:

This method allows you to set the render by layer flag on a per-node basis.

Parameters:

bool onOff

TRUE to set; FALSE to unset.

Node *

The pointer to the node.

Prototype:

virtual void SetMotionByLayer(BOOL onOff, INode *) = 0;

Remarks:

This method allows you to set the motion by layer flag on a per-node basis.

Parameters:

bool onOff

TRUE to set; FALSE to unset.

Node *

The pointer to the node.

Prototype:

virtual BOOL GetDisplayByLayer(INode *) = 0;

Remarks:

This method returns the state of the display by layer flag for the specified node.

Parameters:

Node *

The pointer to the node.

Return Value:

TRUE if set; FALSE if not set.

Prototype:

virtual BOOL GetRenderByLayer(INode *) = 0;

Remarks:

This method returns the state of the render by layer flag for the specified node.

Parameters:

Node *

The pointer to the node.

Return Value:

TRUE if set; FALSE if not set.

Prototype:

virtual BOOL GetMotionByLayer(INode *) = 0;

Remarks:

This method returns the state of the motion by layer flag for the specified node.

Parameters:

Node *

The pointer to the node.

Return Value:

TRUE if set; FALSE if not set.

Prototype:

virtual void SelectObjects(void) = 0;

Remarks:

This method will select the objects of the layer.

Prototype:

virtual float GetImageBlurMultiplier(TimeValue t) = 0;

Remarks:

This method allows you to set the image blur multiplier for the layer.

Parameters:

TimeValue t

The timevalue to get the image blur multiplier for.

Prototype:

virtual void SetImageBlurMultiplier(TimeValue t, float m) = 0;

Remarks:

This method allows you to set the image blur multiplier.

Parameters:

TimeValue t

The timevalue to set the image blur multiplier for.

float m

The multiplier to set.

Prototype:

virtual bool GetMotBlurOnOff(TimeValue t) = 0;

Remarks:

This method returns the state of the motion blur flag at the specified time.

Parameters:

TimeValue t

The time at which to get the flag.

Prototype:

virtual void SetMotBlurOnOff(TimeValue t, bool m) = 0;

Remarks:

This method allows you to set the state of the motion blur flag at the specified time.

Parameters:

TimeValue t

The time at which to set the flag.

bool m

TRUE to turn on; FALSE to turn off.