Te, I don't see any difference in the results from these two, nor
should there be. For reference:
import maya.cmds as mc
class MyClass(object):
def rotation(self, src, des=''):
self.rVal=[]
sRO = mc.xform(src, q=True, roo=True)
self.rVal = mc.xform(src, q=True, ws=True, ro=True)
if (des != ''):
dRO = mc.xform(des, q=True, roo=True)
mc.xform(des, roo=sRO, p=True)
mc.rotate(self.rVal[0],self.rVal[1],self.rVal[2], des, ws=True)
mc.xform(src, roo=dRO, p=True)
return self.rVal
def rotation(src, des=''):
rVal=[]
sRO = mc.xform(src, q=True, roo=True)
rVal = mc.xform(src, q=True, ws=True, ro=True)
if (des != ''):
dRO = mc.xform(des, q=True, roo=True)
mc.xform(des, roo=sRO, p=True)
mc.rotate(rVal[0],rVal[1],rVal[2], des, ws=True)
mc.xform(src, roo=dRO, p=True)
return rVal
print MyClass().rotation('camera1')
print rotation('camera1')
- Paul
On Thu, Jun 17, 2010 at 12:09 PM, Te Wilson <[email protected]> wrote:
> Hello, not sure what I am doing wrong but I am getting precision issue with
> a module in a class object compared to the same module as a stand alone. Has
> anyone ran into issues with Maya's precision and class objects? I know this
> is kinda of a silly question and that python has more precision then i will
> ever need but...
>
> any way here is the snippet of code integrated in the Object and stand alone
>
> def rotation(self, src, des=''):
> self.rVal=[]
> sRO = mc.xform(src, q=True, roo=True)
> self.rVal = mc.xform(src, q=True, ws=True, ro=True)
> if (des != ''):
> dRO = mc.xform(des, q=True, roo=True)
> mc.xform(des, roo=sRO, p=True)
> mc.rotate(self.rVal[0],self.rVal[1],self.rVal[2], des, ws=True)
> mc.xform(src, roo=dRO, p=True)
> return self.rVal
>
> stand alone:
>
> def rotation(src, des=''):
> rVal=[]
> sRO = mc.xform(src, q=True, roo=True)
> rVal = mc.xform(src, q=True, ws=True, ro=True)
> if (des != ''):
> dRO = mc.xform(des, q=True, roo=True)
> mc.xform(des, roo=sRO, p=True)
> mc.rotate(rVal[0],rVal[1],rVal[2], des, ws=True)
> mc.xform(src, roo=dRO, p=True)
>
> return rVal
>
>
> --
> http://groups.google.com/group/python_inside_maya
--
http://groups.google.com/group/python_inside_maya