Talk About Network

Google





Graphics > Alias software > maya API - how ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 862 of 912
Post > Topic >>

maya API - how to get surface shader name?

by Maahes <maahes@[EMAIL PROTECTED] > Mar 28, 2007 at 12:14 PM

Heya. I've just started writing a Maya ex****ter this week (so I'm a 
total noob to Maya API and don't know any Mel script other than 
loadPlugin and unloadPlugin) and I'm having trouble with something that 
seems like it should be really simple.

I have a shaderEngine object and I'm trying to get the name of the 
surface material object that is applied to it.  (ie. the name that comes 
up in the HyperShade window for each shader).

I've tried grabbing the surface Shader attribute but its name is 
"surfaceShader"... so that was a dead end for me.

My code to this point looks like:


meshFn.getConnectedShaders(0, shaders, shaderPolygons);
for (u32 obj=0; obj<shaders.length(); obj++)
{
   MObject shader = shaders[obj];
   MFnSet shaderFn( shader, &status );
   if (status == MS::kSuccess)
   {
     // so shaderFn is a shader engine node. (tested this earlier)
     // how do I get the name of the material surface it is using?
     // ???
   }
}


Can anyone help, or point me to some resources that can help me.
I can't find anything in the Maya help that tells me where to go from
here.
 




 2 Posts in Topic:
maya API - how to get surface shader name?
Maahes <maahes@[EMAIL   2007-03-28 12:14:26 
Re: maya API - how to get surface shader name?
Maahes <maahes@[EMAIL   2007-03-28 13:41:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 19:12:53 PST 2009.