Properties

Functions for accessing node Properties.

Functions


int VRGetEnumValue(HNode node,
const char * symbol
)

Gets the value of an enum symbol in the context of the specified node type.


int VRGetEnumValueEx(const char * metanode,
const char * symbol
)

Gets the value of an enum symbol in the context of the specified node type.


uint32_t VRGetProperty(HNode node,
const char * propName
)

Gets a reusable property handle. Even though this uses a node handle to get a property index, the property index can still be used to interact with the property on any instance of the metanode. (not just this single instance of node)

See Also

VRGetProperty(nodePropName)

Parameters
node

handle to node to use for its metanode

propName

name of the property on this node

Returns

property index or PROPERTY_INVALID_INDEX


size_t VRGetPropertyArrayDouble(HNode node,
const char * propName,
double * buffer,
size_t bufferSize
)

Gets a DOUBLE array element from a node property.

Parameters
buffer

the buffer to store the data in

bufferSize

the size of the buffer to store the data in

Returns

the size of the data buffer

See Also

VRGetPropertyValue()


size_t VRGetPropertyArrayDoubleEx(HNode node,
uint32_t prop,
double * buffer,
size_t bufferSize
)

Gets the DOUBLE array from the property a node.

Parameters
buffer

the buffer to store the data in

bufferSize

size of the buffer

Returns

size of the buffer

See Also

VRGetPropertyValueEx()


size_t VRGetPropertyArrayFloat(HNode node,
const char * propName,
float * buffer,
size_t bufferSize
)

Gets a FLOAT array from a node property.

Parameters
buffer

the buffer to store the data in

bufferSize

size of the buffer

Returns

size of the buffer

See Also

VRGetPropertyValue()


size_t VRGetPropertyArrayFloatEx(HNode node,
uint32_t prop,
float * buffer,
size_t bufferSize
)

Gets the FLOAT array from the property a node.

Parameters
buffer

the buffer to store the data in

bufferSize

size of the buffer

Returns

size of the buffer

See Also

VRGetPropertyValueEx()


size_t VRGetPropertyArrayWorldFloat(HNode node,
const char * propName,
void * buffer,
size_t bufferSize
)

Gets a WORLD_FLOAT array element from a node property.

Parameters
buffer

the buffer to store the data in

bufferSize

the size of the buffer to store the data in

Returns

the size of the data buffer

See Also

VRGetPropertyValue()


size_t VRGetPropertyArrayWorldFloatEx(HNode node,
uint32_t prop,
void * buffer,
size_t bufferSize
)

Gets the WORLD_FLOAT array from the property a node.

Parameters
buffer

the buffer to store the data in

bufferSize

size of the buffer

Returns

size of the buffer

See Also

VRGetPropertyValueEx()


char VRGetPropertyChar(HNode node,
const char * propName
)

Gets a CHAR or BOOL property from a node.

Returns

the value

See Also

VRGetPropertyValue()


char VRGetPropertyCharElement(HNode node,
const char * propName,
size_t index
)

Gets a CHAR or BOOL array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValue()


char VRGetPropertyCharElementEx(HNode node,
uint32_t prop,
size_t index
)

Gets a CHAR or BOOL array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValueEx()


char VRGetPropertyCharEx(HNode node,
uint32_t prop
)

Gets a CHAR or BOOL property from a node.

Returns

the value

See Also

VRGetPropertyValueEx()


double VRGetPropertyDouble(HNode node,
const char * propName
)

Gets a DOUBLE property from a node.

Returns

the value

See Also

VRGetPropertyValue()


double VRGetPropertyDoubleElement(HNode node,
const char * propName,
size_t index
)

Gets a DOUBLE array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValue()


double VRGetPropertyDoubleElementEx(HNode node,
uint32_t prop,
size_t index
)

Gets a DOUBLE array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValueEx()


double VRGetPropertyDoubleEx(HNode node,
uint32_t prop
)

Gets a DOUBLE property from a node.

Returns

the value

See Also

VRGetPropertyValueEx()


uint32_t VRGetPropertyEx(const char * metaName,
const char * propName
)

Gets a reusable property handle from a metanode name.

Parameters
metaName

name of the metanode

propName

name of the property on the metaname

Returns

property index or PROPERTY_INVALID_INDEX


float VRGetPropertyFloat(HNode node,
const char * propName
)

Gets a FLOAT property from a node.

Returns

the value

See Also

VRGetPropertyValue()


float VRGetPropertyFloatElement(HNode node,
const char * propName,
size_t index
)

Gets a FLOAT array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValue()


float VRGetPropertyFloatElementEx(HNode node,
uint32_t prop,
size_t index
)

Gets a FLOAT array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValueEx()


float VRGetPropertyFloatEx(HNode node,
uint32_t prop
)

Gets a FLOAT property from a node.

Returns

the value

See Also

VRGetPropertyValueEx()


int VRGetPropertyInt(HNode node,
const char * propName
)

Gets an INT property from a node.

Returns

the value

See Also

VRGetPropertyValue()


int VRGetPropertyIntElement(HNode node,
const char * propName,
size_t index
)

Gets an INT array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValue()


int VRGetPropertyIntElementEx(HNode node,
uint32_t prop,
size_t index
)

Gets an INT array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValueEx()


int VRGetPropertyIntEx(HNode node,
uint32_t prop
)

Gets an INT property from a node.

Returns

the value

See Also

VRGetPropertyValueEx()


HNode VRGetPropertyLink(HNode node,
const char * propName
)

Gets a LINK property from a node.

Returns

handle to the link target node

See Also

VRGetPropertyValue()


HNode VRGetPropertyLinkEx(HNode node,
uint32_t prop
)

Gets a LINK property from a node.

Returns

handle to the link target node

See Also

VRGetPropertyValueEx()


size_t VRGetPropertyString(HNode node,
const char * propName,
char * buffer,
size_t bufferSize
)

Gets a STRING property from a node.

Parameters
buffer

buffer to receive the string data

bufferSize

size of the buffer

Returns

the number of bytes written to the buffer

Note

if buffer is null, function returns the required size of the buffer

See Also

VRGetPropertyValue()


const char * VRGetPropertyStringElement(HNode node,
const char * propName,
size_t index
)

Gets a STRING array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValue()


const char * VRGetPropertyStringElementEx(HNode node,
uint32_t prop,
size_t index
)

Gets a STRING array element from a node property.

Parameters
index

index of array to read

Returns

the value

See Also

VRGetPropertyValueEx()


size_t VRGetPropertyStringEx(HNode node,
uint32_t prop,
char * buffer,
size_t bufferSize
)

Gets a STRING property from a node.

Parameters
buffer

buffer to receive the string data

bufferSize

size of the buffer

Returns

the number of bytes written to the buffer

Note

if buffer is null, function returns the required size of the buffer

See Also

VRGetPropertyValueEx()


size_t VRGetPropertyValue(HNode node,
const char * propName,
void * valueBuffer,
size_t bufferSize
)

Gets a property from a node.

Parameters
node

node to read property from

propName

name of the property to read

valueBuffer

buffer to receive the data

bufferSize

size of the buffer

Returns

number of bytes written to buffer on success


size_t VRGetPropertyValueEx(HNode node,
uint32_t prop,
void * valueBuffer,
size_t bufferSize
)

Gets a property from a node.

Parameters
node

node to read property from

prop

the property to read

valueBuffer

buffer to receive the data

bufferSize

size of the buffer

Returns

number of bytes written to buffer on success


size_t VRGetPropertyValueSize(HNode node,
const char * propName
)

Gets the required size of a buffer to pass to VRGetPropertyValue. In the case of string properties, returns the length of the string including null terminator.

Parameters
node

node to read from

propName

property to get the size of

Returns

number of bytes required to hold the property data


size_t VRGetPropertyValueSizeEx(HNode node,
uint32_t prop
)

Gets the required size of a buffer to pass to VRGetPropertyValue In the case of string properties, returns the length of the string including null terminator.

Parameters
node

node to read from

prop

property to get the size of

Returns

number of bytes required to hold the property data


uint32_t VRGetWorldFloatSize(void)

(deprecated) Gets the size of a world float value.

In 32bit versions of VRTree, this is 4 bytes. On 64bit, it is 8 bytes.

Interaction with world float properties should be done using the native float or double APIs based on the size reported by this function (e.g. if size == 8, use VRSetPropertyDouble to set a world float property value, otherwise use VRSetPropertyFloat)

API functions that take data buffers perform widening or narrowing accordingly, if given the wrong data type. This may result in precision loss if giving doubles to a property expecting floats.

Note

32bit support is being phased out, so this function will become unnecessary.


int VRGetWorldTransform(HNode node,
const char * propName,
void * valueBuffer,
size_t bufferSize
)

Gets the world transform of the specified node from the transform hierarchy. Internally calls TransformHierarchy::getWorldTransformSafe unless a propName is specified.

Parameters
node

the node to get the world transform of

propName

optional name of the property containing the transform, for node types not managed by the transform hierarchy. In most cases can be NULL

valueBuffer

buffer to populate with the world transform matrix

bufferSize

size of the buffer

Returns

0 on failure, number of bytes written to valueBuffer on success


int VRIsPropertyEnumValue(HNode node,
const char * propName,
const char * symbol
)

Gets the int value of symbol and checks if the specified INT property is currently set to that value.


int VRIsPropertyEnumValueEx(HNode node,
uint32_t prop,
const char * symbol
)

Gets the int value of symbol and checks if the specified INT property is currently set to that value.


int VRSetPropertyArrayDouble(HNode node,
const char * propName,
double * valueData,
size_t arraySize
)

Sets an array of doubles property on a node (useful to set matrices)

Parameters
valueData

double precision data to set

arraySize

the size of the data buffer

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyArrayDoubleEx(HNode node,
uint32_t prop,
double * valueData,
size_t arraySize,
uint32_t flags,
int userChange
)

Sets an element in a double array property on a node.

Parameters
valueData

data to set

arraySize

size of the data buffer

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyArrayFloat(HNode node,
const char * propName,
float * valueData,
size_t arraySize
)

Sets an array of floats property on a node (useful to set matrices)

Parameters
valueData

single precision data to set

arraySize

the size of the data buffer

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyArrayFloatEx(HNode node,
uint32_t prop,
float * valueData,
size_t arraySize,
uint32_t flags,
int userChange
)

Sets an element in a float array property on a node.

Parameters
valueData

data to set

arraySize

size of the data buffer

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyArrayWorldFloat(HNode node,
const char * propName,
void * valueData,
size_t arraySize
)

Sets an array of world float property on a node (useful to set matrices)

Parameters
valueData

data to set

arraySize

the size of the data buffer

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyArrayWorldFloatEx(HNode node,
uint32_t prop,
void * valueData,
size_t arraySize,
uint32_t flags,
int userChange
)

Sets an element in a world float array property on a node.

Parameters
valueData

data to set

arraySize

size of the data buffer

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyChar(HNode node,
const char * propName,
char value
)

Sets a CHAR or BOOL property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyCharElement(HNode node,
const char * propName,
size_t index,
char value
)

Sets an element in a CHAR or BOOL array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyCharElementEx(HNode node,
uint32_t prop,
size_t index,
char value,
uint32_t flags,
int userChange
)

Sets an element in a CHAR or BOOL array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyCharEx(HNode node,
uint32_t prop,
char value,
uint32_t flags,
int userChange
)

Sets a CHAR or BOOL property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyDouble(HNode node,
const char * propName,
double value
)

Sets a DOUBLE property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyDoubleElement(HNode node,
const char * propName,
size_t index,
double value
)

Sets an element in a DOUBLE array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyDoubleElementEx(HNode node,
uint32_t prop,
size_t index,
double value,
uint32_t flags,
int userChange
)

Sets an element in a DOUBLE array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyDoubleEx(HNode node,
uint32_t prop,
double value,
uint32_t flags,
int userChange
)

Sets a DOUBLE property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyEnum(HNode node,
const char * propName,
const char * symbol
)

Sets an INT property on a node using the value of a symbol.

Parameters
symbol

name of the symbol to read the value from

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyEnumEx(HNode node,
uint32_t prop,
const char * symbol,
uint32_t flags,
int userChange
)

Sets an INT property on a node using the value of a symbol.

Parameters
symbol

name of the symbol to read the value from

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyFloat(HNode node,
const char * propName,
float value
)

Sets a FLOAT property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyFloatElement(HNode node,
const char * propName,
size_t index,
float value
)

Sets an element in a FLOAT array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyFloatElementEx(HNode node,
uint32_t prop,
size_t index,
float value,
uint32_t flags,
int userChange
)

Sets an element in a FLOAT array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyFloatEx(HNode node,
uint32_t prop,
float value,
uint32_t flags,
int userChange
)

Sets a FLOAT property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyInt(HNode node,
const char * propName,
int value
)

Sets an INT property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyIntElement(HNode node,
const char * propName,
size_t index,
int value
)

Sets an element in a INT array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyIntElementEx(HNode node,
uint32_t prop,
size_t index,
int value,
uint32_t flags,
int userChange
)

Sets an element in a INT array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyIntEx(HNode node,
uint32_t prop,
int value,
uint32_t flags,
int userChange
)

Sets an INT property on a node.

Parameters
value

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyLink(HNode node,
const char * propName,
HNode linkTarget
)

Sets a LINK property on a node.

Parameters
linkTarget

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyLinkEx(HNode node,
uint32_t prop,
HNode linkTarget,
uint32_t flags,
int userChange
)

Sets a LINK property on a node.

Parameters
linkTarget

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyString(HNode node,
const char * propName,
const char * stringData
)

Sets a STRING property on a node.

Parameters
stringData

value to set

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyStringElement(HNode node,
const char * propName,
size_t index,
const char * value,
size_t valueSize
)

Sets an element in a STRING array property on a node.

Parameters
index

element to set (0-based array index)

value

value to set

valueSize

the size of the size

Returns

0 on success

See Also

VRSetPropertyValue()


int VRSetPropertyStringElementEx(HNode node,
uint32_t prop,
size_t index,
const char * values,
size_t arraySize,
uint32_t flags,
int userChange
)

Sets an element in a STRING array property on a node.

Parameters
index

element to set (0-based array index)

values

values to set

arraySize

the size of the values array

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyStringEx(HNode node,
uint32_t prop,
const char * stringData,
uint32_t flags,
int userChange
)

Sets a STRING property on a node.

Parameters
stringData

value to set

Returns

0 on success

See Also

VRSetPropertyValueEx()


int VRSetPropertyValue(HNode node,
const char * propName,
const void * valueData,
size_t valueSize
)

Sets a property value on a node.

Parameters
node

handle to the node to set value on

propName

the name of the property to set

buffer

of data to set as the property value

size

of the buffer

Returns

0 if property was set successfully


int VRSetPropertyValueEx(HNode node,
uint32_t prop,
const void * valueData,
size_t valueSize,
uint32_t flags,
int userChange
)

Sets a property value on a node.

Parameters
node

handle to the node to set value on

prop

the index of the property to set

buffer

of data to set as the property value

size

of the buffer

flags

flags to use during property setting

userChange

whether the property change is the result of user action

Returns

0 on success

No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtreevrtree_cppvtCoreCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesSettingsTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API