PDA

View Full Version : Set absolute scale?


dandruff
05-02-2009, 10:00 AM
I would like to set the scale on an object, but absolute in centimeters. Much like Ctrl-Click the Universal Manipulator numbers. But I Can't find the way to do it.. could somebody help me?

dandruff
05-02-2009, 03:58 PM
OK, I've solved it in a pritty easy way... This is the (python) code, for you who would like it:


import maya.cmds as cmds

objectBBX = cmds.getAttr('object.boundingBoxSizeX')
objectBBY = cmds.getAttr('object.boundingBoxSizeY')
objectBBZ = cmds.getAttr('object.boundingBoxSizeZ')
cmds.select('object')
cmds.scale((wantedWidth / objectBBX), (wantedHeight / objectBBY), (wantedDepth / objectBBZ), r = True)

CGTalk Moderation
05-02-2009, 03:58 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.