Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

anyone know how to use MUserData properly?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
a3dcreator
427 Views, 2 Replies

anyone know how to use MUserData properly?

so i understand if your developing a plugin for maya2018 using mpxDrawOverride class. That it is not good to run calculations in the addIUDrawables fn of the class. instead you should use preparefordraw() call and MUserData class.

 

question is. If im already calculating stuff in the compute of the mpxlocatorNode how can i pass this to the MuserData so that prepare for draw can use it?

 

can i communicate with MUserData from the compute of the MPxLocatorNode?

 

thanks!

2 REPLIES 2
Message 2 of 3
cheng_xi_li
in reply to: a3dcreator

Hi,

 

Since you are using MPxDrawOverride, the override is initialized with the object of your MPxLocatorNode. You could get a pointer to your node with MFnDependencyNode::userNode.  You could access to the data in your node directly through this pointer and prepare the userData in the prepareDraw.

 

Yours,

Li

Message 3 of 3
a3dcreator
in reply to: cheng_xi_li

Thank you Cheng it worked!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report