Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / Manipulators, Scale
  RSS 2.0 ATOM  

Manipulators, Scale
Rate this thread
 
37433
 
Permlink of this thread  
avatar
  • Misst
  • Posted: 04 December 2009 04:20 AM
  • Total Posts: 6
  • Joined: 23 January 2007 03:01 PM

Hello!
Tell me please is there any method to get access to manipulators (translation, rotation, scale), because sometimes i want to scale models like manipulator does ..
The main problem that when using ‘GetDefinitionScaleVector’ for the actor, it scales symmetrical both hands, and there is now ‘symmetry edit OFF’ method in python.. So i need to scale the hands somehow separately and that can be done in some ways - ‘GeometryScaling’, which is not what i want, ‘SetVector’, which very strangely do absolutely nothing in this case (actor, active = False). And the manipulator ‘Scale’ does all what i need, but i can’t get a point how i can use it by python.
Any ideas?



Replies: 0
avatar
  • Monkey
  • Posted: 17 December 2009 12:44 AM

Monkey

I’ve not looked into your problem, but here is a suggested starting point.

Create a scene in MotionBuilder with an actor with the hands scaled how you ideally want them then save it out in .ascii format. If you then open up the .ascii scene in a text editor you should be able to see the names of the exact properties required to achieve your effect.

This is a useful ‘trick’ when trying to replicate anything you can see in MotionBuilder but cannot find property names etc.



Replies: 0
avatar
  • Misst
  • Posted: 19 December 2009 12:16 AM

Hi!
thanl you for your reply, that’s interesting trick but for my ask i don’t know how to use this data..
i can’t scale or rotate actorbones separately, (like with symmetry-edit-button off). When i look ASCII file i see that some nodes or skeletonstates are different, indeed:
(I scaled one bone by manipulator)

....
 
NODESCALE1,1,1
 NODESCALE
1,1,1
 NODESCALE
1.82418444497641,1,1
 NODESCALE
1,1,1
 NODESCALE
1,1,1
....
.....
 
SKELETONSTATE:  {
            SKELETONNODESTATE
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1
            SKELETONNODESTATE
1,0,0,0,0,1,0,0,0,0,1,0,0,97.2,-7.3,1
            SKELETONNODESTATE
1,0,0,0,0,1,0,0,0,0,1,0,9.6,93.6,0,1
.....

and so on.. and no idea how to achieve this result by python..



Replies: 0
avatar
  • Monkey
  • Posted: 21 December 2009 10:56 PM

Yeah, I think you might be stuck. Someone else might be able to come up with an answer for you but I tried quite a few ways of acheiving what you want and failed I’m afraid. Even getting the matrix for the object, altering the scaling values and setting it back on the object doesn’t do anything:(



Replies: 0
avatar
  • Monkey
  • Posted: 22 December 2009 09:08 PM

doh - I should have read your first post:) This isn’t going to be much use to you I think.

-------

ok - figured it out to some extent, you need to look at the actor not the actual geometry object. I’ve not worked out how to turn off the symmetrical operation - in this example both wrists will update but it’s a start.

Look up the FBSkeletonNodeId class for more info on different body parts.

Try this:-

from pyfbsdk import *

# create actor
actor FBActor("Actor")

# get scale value of right wrist and print out
scale_value FBVector3d()
actor
.GetDefinitionScaleVector(FBSkeletonNodeId.kFBSkeletonRightWristIndexscale_value)
print scale_value

# set scale value to be (1, 2, 3) on right wrist
scale_value FBVector3d(1.02.03.0)
actor
.SetDefinitionScaleVector(FBSkeletonNodeId.kFBSkeletonRightWristIndexscale_value)


Replies: 0
avatar
  • Misst
  • Posted: 22 December 2009 10:10 PM

thank you, Monkey - yes, the main problem is that there i no symmetry-off function or smth like this. i’m trying to transfrom actor to markers, all the scales are ok, but when i’m trying for example to rotate hands they do it symmetrically so i don’t have any idea how to solve this problem..



Replies: 0