Do you want to be able to get the imagePlane that is connected to a given camera?
camShape = cmds.listRelatives('camera1', type='camera', fullPath=True)[0]
ip = cmds.listConnections(camShape, type="imagePlane")[0]
cmds.getAttr(ip + ".imageName")
If not, what are you passing as "dagNode"?
On Fri, Oct 19, 2012 at 10:38 AM, San Luthra
<sky...@gmail.com> wrote:
I am trying to get the imageplane shape node so that its attribute "imageName" can be read
so far I have this
def connectedImgPlanes(self,dagNode):
print "dagNode ",dagNode ,type(dagNode)
lc=""
try:
lc=cmds.listRelatives(cmds.listRelatives(dagNode)[0])[0]
except TypeError:
return ""
print lc
atribVal=cmds.getAttr(lc+".imageName")
return atribVal
the above code works fine if their is only one camera connected to imageplane , but I have more than one camera's imageplane set i get error saying " More than one object matches name: imagePlane1"
I guess this is not the right way to traverse and get the ip shape node please help me out....
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe