Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / How to store a pointer value in MPxNode?
  RSS 2.0 ATOM  

How to store a pointer value in MPxNode?
Rate this thread
 
56259
 
Permlink of this thread  
avatar
  • Total Posts: 97
  • Joined: 20 November 2006 05:11 PM

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" );
addAttributeval );

I’m reading value in compute with

MDataHandle val_handler data.inputValueval, &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 plugthisMObject(), val2);
plug.setIntint_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?



Replies: 0