Is the uber_surface a plugin node? Does it have a unique nodeType? If so
you can look up nodes of that nodeType.
You wouldn't want to use .diffuse in that ls lookup since it's a common
attribute shared by multiple materials. You can add your own attribute to a
shader though, like .myUberSurface, and use that to identify the shader.
Then this will return just that shader:
cmds.ls("*.myUberSurface", o=True, mat=True)
On Tuesday, October 23, 2012 8:41:07 PM UTC-7, Berg Jones wrote:
>
> Templated nodes was a flag i enabled as an example that produced the nodes
> I'm looking for.
>
> I have an uber surface shader with a lot of inputs on it. The system is
> set up so that there is only one surface shader allowed in the scene. Its
> not a maya shader but a 3delight attribute shader....uber_surface 1/2/3/4
> and corresponding geoAttrib 1/2/3/4.... This shader is created through a
> pyqt gui and linked to controls on that gui. With the callback method I can
> correctly link the names with the shader.
>
> However, if I close the gui or close maya I lose the correct names of
> uber_surface and geoAttrib unless I write out a file. This could be
> problematic. Im looking to avoid doing that and "find" the right shader.
>
> I tried your example and it wouldnt return what I wanted. For example,
> looking for the uber_surface.diffuse (diffuse intensity) I did and got back
> only maya lambert1.
>
> import maya.cmds as cmds
>
> nodes = cmds.ls("*.diffuse", o=1) ######or []
>
> for i in nodes:
>
> print i
>
>
>
> On Tuesday, October 23, 2012 10:31:20 PM UTC-4, JP wrote:
>>
>> Why are you using tm=1? You just wanted templated nodes? I don't
>> understand what you're trying to accomplish.
>>
>> Are you trying to add an attribute to a node so you can quickly retrieve
>> it later?
>>
>> nodes = MC.ls("*.myAttribute", o=1) or []
>>
>> This is a pretty common strategy for retrieving nodes you've 'tagged' for
>> some purpose.
>>
>>
>>
>>
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe