r3vsl

r3vsl

Class

real/code/r3vsl.h

Library

r3code

Description:

VSL material Class

See Also

real/code/r3matbas.h

Super Class

r3Materialbase

R3CLID_MATERIALBASE

JavaScript

r3Vsl

Class Identifier

R3CLID_VSL - 53

Methods

ALLOCPROP, REMOVEPROP, ENUMPROPS, INITIALIZEROOTSHADER, CHECKPROP, INSERTPROP, SETATTRSHOWSTATE, GETATTRIBUTESHOWSTATE, SHADERCHANGED, SETATTRNAME, GETATTRIBUTENAME, ADDCHANNEL, UNLINKPROP, GETPHASELEVEL, ISOFPHASELEVEL, SETATTRSHOWSTATEBYOBJ, SETATTRNAMEBYOBJ, MAKENAME, FINDBYNAME, MATCHNAME, SETATTRTOOLTIP, GETATTRIBUTETOOLTIP, CHANNELENUMCB, CHANNELRENAMECB, GETATTRPOS,

Attributes

RootShader, ShowAdvanced, CurrentLevel, VirtualRoot, SelectedShader, AlsoChangesObj, AlsoChangesMth, PrepareChangesMth,

Registration

int R3RegisterVSLClass(R3APP *app);

R3VSLM_ALLOCPROP

Method

ALLOCPROP

Identifier

R3VSLM_ALLOCPROP

Return

R3OBJ*, address of the shader object or NULL if failed

Param 1:

R3INT, output identifier, Must be 0.

Param 2:

R3INT, class id of the return value channel (R3CLID_COLORCHANNEL etc.).

Param 3:

R3TAG*, R3VSLA_MatpropClass, R3VSLA_MatpropParent, R3VSLA_MatpropType, R3VSLA_MatpropChannelName

JavaScript

rc = obj.ALLOCPROP(p1, p2, p3);

Description

Create new shader for the material

R3VSLM_REMOVEPROP

Method

REMOVEPROP

Identifier

R3VSLM_REMOVEPROP

Param 3:

R3OBJ*, object to be removed

JavaScript

obj.REMOVEPROP(p3);

Description

Remove the given property object.

R3VSLM_ENUMPROPS

Method

ENUMPROPS

Identifier

R3VSLM_ENUMPROPS

Param 1:

R3OBJ*, object to be called

Param 2:

R3INT, method for the callback object

Param 3:

void*, user data

JavaScript

obj.ENUMPROPS(p1, p2, p3);

Description

Enumerate shaders in the material. The callback object is called as R3SendMsg(p1, p2, R3RA_SenderObject, shader, R3TAG_END);

R3VSLM_INITIALIZEROOTSHADER

Method

INITIALIZEROOTSHADER

Identifier

R3VSLM_INITIALIZEROOTSHADER

Return

void*, TRUE if successful

JavaScript

rc = obj.INITIALIZEROOTSHADER();

Description

for internal use. Initilizes root shader.

R3VSLM_CHECKPROP

Method

CHECKPROP

Identifier

R3VSLM_CHECKPROP

Return

void*, TRUE if successful

Param 3:

R3OBJ*, shader to be checked

JavaScript

rc = obj.CHECKPROP(p3);

Description

check inputs and outputs of a shader and modifies them if necessary.

R3VSLM_INSERTPROP

Method

INSERTPROP

Identifier

R3VSLM_INSERTPROP

Return

R3OBJ*, address of the shader object or NULL if failed

Param 1:

R3OBJ*, parent

Param 2:

R3OBJ*, previous

Param 3:

R3OBJ*, new shader

JavaScript

rc = obj.INSERTPROP(p1, p2, p3);

Description

Insert a shader under parent

R3VSLM_SETATTRSHOWSTATE

Method

SETATTRSHOWSTATE

Identifier

R3VSLM_SETATTRSHOWSTATE

Return

void*, TRUE if successful

Param 1:

R3INT, attribute tag

Param 3:

R3INT, show state (TRUE == show, FALSE == hide)

JavaScript

rc = obj.SETATTRSHOWSTATE(p1, p3);

Description

Sets the show state of a material attribute. These are the attributes * that the material reports in response to the R3RM_MAKETAGLIST method. (Includes * attributes of shaders that are contained in the material).

R3VSLM_GETATTRIBUTESHOWSTATE

Method

GETATTRIBUTESHOWSTATE

Identifier

R3VSLM_GETATTRIBUTESHOWSTATE

Return

void*, TRUE if shown, FALSE if hidden.

Param 3:

R3INT, attribute tag

JavaScript

rc = obj.GETATTRIBUTESHOWSTATE(p3);

Description

Gets the show state of a material attribute.

R3VSLM_SHADERCHANGED

Method

SHADERCHANGED

Identifier

R3VSLM_SHADERCHANGED

Return

void*, TRUE

JavaScript

rc = obj.SHADERCHANGED();

Description

Notifies the material, that an attribute of its shader has changed.

R3VSLM_SETATTRNAME

Method

SETATTRNAME

Identifier

R3VSLM_SETATTRNAME

Return

void*, TRUE if successful

Param 1:

R3INT, attribute tag

Param 3:

char*, attribute name

JavaScript

rc = obj.SETATTRNAME(p1, p3);

Description

Sets the name of a material attribute. These are the attributes * that the material reports in response to the R3RM_MAKETAGLIST method. (Includes * attributes of shaders that are contained in the material).

R3VSLM_GETATTRIBUTENAME

Method

GETATTRIBUTENAME

Identifier

R3VSLM_GETATTRIBUTENAME

Return

void*, TRUE if the attribute is found, FALSE otherwise

Param 3:

R3INT, attribute tag

JavaScript

rc = obj.GETATTRIBUTENAME(p3);

Description

Gets the name of a material attribute.

R3VSLM_ADDCHANNEL

Method

ADDCHANNEL

Identifier

R3VSLM_ADDCHANNEL

JavaScript

obj.ADDCHANNEL();

Description

used internally

R3VSLM_UNLINKPROP

Method

UNLINKPROP

Identifier

R3VSLM_UNLINKPROP

JavaScript

obj.UNLINKPROP();

Description

removes the shader from the material but does not delete the shader.

R3VSLM_GETPHASELEVEL

Method

GETPHASELEVEL

Identifier

R3VSLM_GETPHASELEVEL

Return

R3OBJ*, address of the phase level

Param 3:

R3CLID, class id of the phase

JavaScript

rc = obj.GETPHASELEVEL(p3);

Description

Returns the address of the given phase level. If not found, creates one.

R3VSLM_ISOFPHASELEVEL

Method

ISOFPHASELEVEL

Identifier

R3VSLM_ISOFPHASELEVEL

JavaScript

obj.ISOFPHASELEVEL();

Description

private

R3VSLM_SETATTRSHOWSTATEBYOBJ

Method

SETATTRSHOWSTATEBYOBJ

Identifier

R3VSLM_SETATTRSHOWSTATEBYOBJ

Return

void*, TRUE if successful, FALSE if op is not a child of material or the attr tag is unknown.

Param 2:

R3INT, attribute tag

Param 3:

R3INT, show state (TRUE == show, FALSE == hide)

JavaScript

rc = obj.SETATTRSHOWSTATEBYOBJ(0, p2, p3);

Description

Sets the show state of a material attribute by a sub operator address and attribute tag.

R3VSLM_SETATTRNAMEBYOBJ

Method

SETATTRNAMEBYOBJ

Identifier

R3VSLM_SETATTRNAMEBYOBJ

Return

void*, TRUE if successful, FALSE if op is not a child of material or the attr tag is unknown.

Param 1:

R3OBJ*, address of shader

Param 2:

R3INT, attribute tag

Param 3:

char*, new name

JavaScript

rc = obj.SETATTRNAMEBYOBJ(p1, p2, p3);

Description

Sets the name of a material attribute by a sub operator address and attribute tag.

R3VSLM_MAKENAME

Method

MAKENAME

Identifier

R3VSLM_MAKENAME

Param 1:

R3INT, max size of the buffer

Param 2:

R3OBJ*, root

Param 3:

char*, buffer for the name

JavaScript

obj.MAKENAME(p1, p2, p3);

Description

Make full name for given shader object. The name is * of form: 'root/../..

R3VSLM_FINDBYNAME

Method

FINDBYNAME

Identifier

R3VSLM_FINDBYNAME

Return

R3OBJ*, shader if found

Param 1:

R3OBJ*, shader from which search starts, if not given search starts from the root shader

Param 3:

char*, full name

JavaScript

rc = obj.FINDBYNAME(p1, p3);

Description

Find shader by name

R3VSLM_MATCHNAME

Method

MATCHNAME

Identifier

R3VSLM_MATCHNAME

Return

R3BOOL, true if match

Param 3:

char*, regular expression (/Root/Phase Level/Constant etc.)

JavaScript

rc = obj.MATCHNAME(p3);

Description

Check if the name of the given shader match the given regular expression.

R3VSLM_SETATTRTOOLTIP

Method

SETATTRTOOLTIP

Identifier

R3VSLM_SETATTRTOOLTIP

Return

void*, TRUE if successful

Param 1:

R3INT, attribute tag

Param 3:

char*, attribute tooltip

JavaScript

rc = obj.SETATTRTOOLTIP(p1, p3);

Description

Sets the tooltip of a material attribute. These are the attributes * that the material reports in response to the R3RM_MAKETAGLIST method. (Includes * attributes of shaders that are contained in the material).

R3VSLM_GETATTRIBUTETOOLTIP

Method

GETATTRIBUTETOOLTIP

Identifier

R3VSLM_GETATTRIBUTETOOLTIP

Return

void*, TRUE if the attribute is found, FALSE otherwise

Param 3:

R3INT, attribute tag

JavaScript

rc = obj.GETATTRIBUTETOOLTIP(p3);

Description

Gets the tooltip of a material attribute.

R3VSLM_CHANNELENUMCB

Method

CHANNELENUMCB

Identifier

R3VSLM_CHANNELENUMCB

JavaScript

obj.CHANNELENUMCB();

Description

R3VSLM_CHANNELRENAMECB

Method

CHANNELRENAMECB

Identifier

R3VSLM_CHANNELRENAMECB

JavaScript

obj.CHANNELRENAMECB();

Description

R3VSLM_GETATTRPOS

Method

GETATTRPOS

Identifier

R3VSLM_GETATTRPOS

Return

R3INT, 1 if the first, 2 if the last, 0 if in the middle, -1 if not found.

Param 1:

R3INT, attr

Param 3:

R3INT, index

JavaScript

rc = obj.GETATTRPOS(p1, p3);

Description

See if the attribute is the first or the last in the easy-to-use list.

RootShader

Attribute

RootShader

Identifier

R3VSLA_RootShader

JavaScript type

Object

C type

R3OBJ*

Description

root matprop

Syntax


value = jsobj.GetRootShader();


R3OBJ* value;
R3GetAttrs(r3obj, R3VSLA_RootShader, &value, R3TAG_END);

ShowAdvanced

Attribute

ShowAdvanced

Identifier

R3VSLA_ShowAdvanced

JavaScript type

Boolean

C type

R3BOOL

Description

enable advanced mode

Syntax


jsobj.SetShowAdvanced(value);
value = jsobj.GetShowAdvanced();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3VSLA_ShowAdvanced, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3VSLA_ShowAdvanced, &value, R3TAG_END);

CurrentLevel

Attribute

CurrentLevel

Identifier

R3VSLA_CurrentLevel

JavaScript type

Object

C type

R3OBJ*

Description

R3OBJ, current shader

Syntax


jsobj.SetCurrentLevel(value);
value = jsobj.GetCurrentLevel();


R3OBJ* value = ...;
R3SetAttrs(r3obj, R3VSLA_CurrentLevel, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3VSLA_CurrentLevel, &value, R3TAG_END);

VirtualRoot

Attribute

VirtualRoot

Identifier

R3VSLA_VirtualRoot

JavaScript type

Object

C type

R3OBJ*

Description

R3OBJ, virtual root shader

Syntax


jsobj.SetVirtualRoot(value);
value = jsobj.GetVirtualRoot();


R3OBJ* value = ...;
R3SetAttrs(r3obj, R3VSLA_VirtualRoot, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3VSLA_VirtualRoot, &value, R3TAG_END);

SelectedShader

Attribute

SelectedShader

Identifier

R3VSLA_SelectedShader

JavaScript type

Object

C type

R3OBJ*

Description

R3OBJ, selected shader

Syntax


jsobj.SetSelectedShader(value);
value = jsobj.GetSelectedShader();


R3OBJ* value = ...;
R3SetAttrs(r3obj, R3VSLA_SelectedShader, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3VSLA_SelectedShader, &value, R3TAG_END);

AlsoChangesObj

Attribute

AlsoChangesObj

Identifier

R3VSLA_AlsoChangesObj

JavaScript type

Object

C type

R3OBJ*

Description

callback object: R3DoA2(aco, mth, obj, tag);

Syntax


jsobj.SetAlsoChangesObj(value);
value = jsobj.GetAlsoChangesObj();


R3OBJ* value = ...;
R3SetAttrs(r3obj, R3VSLA_AlsoChangesObj, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3VSLA_AlsoChangesObj, &value, R3TAG_END);

AlsoChangesMth

Attribute

AlsoChangesMth

Identifier

R3VSLA_AlsoChangesMth

JavaScript type

Integer

C type

R3INT

Description

callback method: called after an attributes has changed

Syntax


jsobj.SetAlsoChangesMth(value);
value = jsobj.GetAlsoChangesMth();


R3INT value = ...;
R3SetAttrs(r3obj, R3VSLA_AlsoChangesMth, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3VSLA_AlsoChangesMth, &value, R3TAG_END);

PrepareChangesMth

Attribute

PrepareChangesMth

Identifier

R3VSLA_PrepareChangesMth

JavaScript type

Integer

C type

R3INT

Description

called when an attribute is about to change

Syntax


jsobj.SetPrepareChangesMth(value);
value = jsobj.GetPrepareChangesMth();


R3INT value = ...;
R3SetAttrs(r3obj, R3VSLA_PrepareChangesMth, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3VSLA_PrepareChangesMth, &value, R3TAG_END);


r3appobj *

Tags

Tags

R3VSLA_MatpropName
R3VSLA_MatpropPhase
R3VSLA_MatpropClass
R3VSLA_MatpropParent
R3VSLA_MatpropType
R3VSLA_MatpropChannelName