Hello, I’m working on a script that replicates ImagePlane position values to a PolyPlane.
by selecting the imagePlane1 object
self.objectSelected = cmds.ls(selection = True)
Then, by pressing the convert button, a PolyPlane with the correct X,Y,Z position and scale is created.
def select(self,*args):
self.select1 = cmds.ls(selection = True)
for item in select1:
self.x_value = cmds.getAttr("%s.translateX" % item)
self.y_value = cmds.getAttr("%s.translateY" % item)
self.z_value = cmds.getAttr("%s.translateZ" % item)
self.sx_value = cmds.getAttr("%s.scaleTranslationX" % item)
self.sy_value = cmds.getAttr("%s.scaleTranslationY" % item)
self.sz_value = cmds.getAttr("%s.scaleTranslationZ" % item)
cmds.polyPlane (name = 'polyPlane1' ,tx = x_value, ty = y_value, tz = z_value, sx = sx_value, sy = sy_value, sz = sz_value )
Unfortunately, it triggers errors, so I won’t be able to work it out on my own… Any ideas?