3ds Max C++ API Reference
NodeProperties Class Reference

The NodeProperties class is a container for properties that OSL is interested in. More...

#include <MaxOSLNodeProperties.h>

Public Member Functions

const INodePropertyValue *const GetValue (const char *name, bool is_ustring=false) const
 Returns a INodePropertyValue pointer for a given property name, or NULL if that property does not exist. More...
 
Tab< const char * > GetNames () const
 Returns the list of properties attached to this INode. More...
 

Friends

class NodePropertyManager
 

Detailed Description

The NodeProperties class is a container for properties that OSL is interested in.

This class is returned by the INodePropertyManager::GetProperties() for a particular INode, and allows querying which properties are available, and what values they have.

This contains both the 'standard' properties like 'nodeHandle' and 'wireColor' but also any user-properties the user has added in the Object Property dialog. The latter has names prepended by the string "usr_".

Note
The lifetime of any INodePropertyValue's returned are only guaranteed while the NodeProperties object itself is referenced. When it goes out of scope, the INodePropertyValue pointers may become invalid.

For more information and sample code, see INodePropertyManager

See also
Class INodePropertyManager, Class INodePropertyValue

Member Function Documentation

◆ GetValue()

const INodePropertyValue* const GetValue ( const char *  name,
bool  is_ustring = false 
) const

Returns a INodePropertyValue pointer for a given property name, or NULL if that property does not exist.

If you know the name is already matching a UString pointer (which you can obtain from IOSLGlobalInterface::GetUString()) you can pass is_ustring = true. This removes a string hashing step, and is a good performance optimization if you choose to do these lookups at render time.

◆ GetNames()

Tab<const char *> GetNames ( ) const

Returns the list of properties attached to this INode.

These can be iterated through a GetValue() called for each. These pointers are ustrings, so is_ustring can be true in the GetValue() call, and they can be compared against previously stored ustring values.

Friends And Related Function Documentation

◆ NodePropertyManager

friend class NodePropertyManager
friend