|
Hello,
I’m just starting with Maya SDK. I’d like to store a pointer value (void *) on per node basis. I have registered a numeric attribute in initialize() with
MFnNumericAttribute numeric_attribute; val = numeric_attribute.createAddr( "long_name", "sn" ); addAttribute( val );
I’m reading value in compute with
MDataHandle val_handler = data.inputValue( val, &status );
Class* class = static_cast<Class*>(val_handler.asAddr());
It works fine, when attribute is initialized with some address in initialize (which makes it static). I’m setting some private data per node in postConstructor with
MPlug plug( thisMObject(), val2); plug.setInt( int_value );
However, there isn’t any method to set to address. Am I missing something?
In a nutshell, I want to get to an object stored on per node basis (a memory address), which might be modified. Any ideas?
|