Message 1 of 1
Maya Python... using Python's decimal module to scale?

Not applicable
03-12-2015
10:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
import maya.cmds as mc import decimal as dec dec.getcontext().prec = 100 # arbitrary precision for floats selObj = mc.ls(sl = True)
# Maya wont do the scale function because it thinks the number is an object
mc.scale(dec.Decimal(0.8350416828797451152249998091083031914110029028218788396278498951672670710359496514354576508414349294), 0.8350416828797451152249998091083031914110029028218788396278498951672670710359496514354576508414349294, 0.8350416828797451152249998091083031914110029028218788396278498951672670710359496514354576508414349294, selObj)
# Maya scales without a problem mc.scale(0.8350416828797451152249998091083031914110029028218788396278498951672670710359496514354576508414349294, 0.8350416828797451152249998091083031914110029028218788396278498951672670710359496514354576508414349294, 0.8350416828797451152249998091083031914110029028218788396278498951672670710359496514354576508414349294, selObj)
maya scale command seems to deal fine with huge numbers, but once it goes through decimal.Decimal() maya wont have it..
is there a work around? i need scale to work with numbers that go through decimal.Decimal().