THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/07/2008 at 08:19, xxxxxxxx wrote:
Cinema 4D Version: 10.5
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ; C++ ;
I've been trying to track down a workaround for rig resizing and I've finally got the problem figured out, but I want to automate the fix.
Essentially, when you scale a rig down small enough the move tool's motion gets multiplied by the scale of the rig's enclosing null, making it impossible to move rig controllers (although rotations still work). Now, I've discovered that if you go through from top to bottom and re-scale the nulls that wrap joint chains to 1.0 (using the Object Axis tool!), everything goes back to normal. However, when setting a parent null to 1.0 the child nulls of that parent all get set to the parent's original scale.
I was wondering: how can I use the object matrices to recursively set all nulls under a parent null to a scale of 1.0 without actually scaling the objects they contain? IE, I start at the top and, using the Object Axis tool, set them all to 1.0, but programmatically. I figure there must be some way to do this using Get/SetMg or through local matricies but I'm at a loss for how to go about it.
Thanks in advance!
On 18/07/2008 at 09:24, xxxxxxxx wrote:
Cinema 4D automatically propagates scaling from parent to children but indirectly. So if a parent scale is 2.0 and the children are 1.0, they are scaled 2.0 with the parent (2.0*1.0 = 2.0). In order break the propagation, you need to use the formula: child-scale/parent-scale. So, the child's scale would need to be 1.0/2.0 = 0.5 in order to retain its scale independent of the parent.
Simply use obj->GetScale() and obj->SetScale() for local scale settings. The global scale (Get/SetMg()) is that with respect to the world system (not the parent's!).
On 18/07/2008 at 23:36, xxxxxxxx wrote:
Ahh cool. Thanks a lot for that, Robert. I guess, then, I can try doing multiplications from the last child backwards to achieve the effect I'm hoping for.