Extracting Wrapped Objects
You can get MAX objects out of MAXScript wrapper values in several ways.
- Using one of the
Value
coercion virtual functions :Value::to_node()
Value::to_mtl()
Value::to_texmap()
Value::to_modifier()
Value::to_controller()
- Using the following member function:
ReferenceTarget
* MAXWrapper::get_max_object() - This function will retrieve the base object in a node inside aMAXNode
wrapper value, rather than theINode
itself.
- Using the
ReferenceMaker::GetReference()
function. AllMAXWrapper
objects store their MAX-side object reference as reference 0. For example:
ReferenceTarget* Get3dsMaxObject(MaxWrapper* wrapper) {
return maxwrapper->GetReference(0);
}