Maya API - Read texture attribute in deform() method?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  03 March 2013
Maya API - Read texture attribute in deform() method?

Hey guys, so I have a simple deformer node created and basically all it does at the moment is moves the vertices of a mesh up 10 units. I have created a Color attribute and set it to .setUsedAsColor(true); so I can plug a texture map into it.

All is working and good, except now inside the deform() method, how would I go about reading this information form the MDataBlock? I'm not sure what variable type(s) I need in order to get the data out and read it correctly. Could someone point me in the right direction? I've tried searching everywhere and through the examples, but it seems a lot of people use the compute() method instead of the deform() method.

Any information would be much appreciated, THANK YOU!
  03 March 2013
It doesn't matter whether it's the deform() or compute(), the procedure is the same:
1. get the node, connected to your color plug ( MPlug(thisMObject(), attrMObject)::connectedTo() )
2. call MRenderUtil::sampleShadingNetwork with the proper parameter list.
..aut inveniam viam aut faciam..
::Copy SOP 4 Maya::
  03 March 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 12:59 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.