Control X and Y position of a bone separately (ideas)

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
Genete
Posts: 3483
Joined: Tue Oct 17, 2006 3:27 pm
Location: España / Spain

Control X and Y position of a bone separately (ideas)

Post by Genete »

I have been reading the Scripting Documentation and I have found and interesting way of control X and Y coordinates of a bone separately.

The M_Bone class have a member variable called:

Code: Select all

fPosControlScale (LM_Vector2)
It is supoused to be the value that we fill up in the constraints window for the position control bone.
Then, imagine that we have the following bones in the bone skeleton

mybonename.slave
master
master.x
master.y

Then mybonename.slave bone constraints for position control are set to:
Position control bone: master
x: 1.5
y: 0.6
(two arbitrary values)

Then the embedded script should do this:
1) Search for a bone that have .slave final name (or what ever that is agreed previously).
2) Look for its Position control bone name (using fPosControlParent (int) member variable and fName for that bone).
3) Search for master.x and master.y in the skeleton.
4) Composite a LM_Vector2 with : 1.5*master.x (x value) and 0.6*master.y (y value)
5) For each keyframe of master.x or master.y set a keyframe for mybonename.slave bone with the proper position traslation.

In this way you can have multiple bones constrained to master but really controlled by master.x and master.y in a different way. Of course it is not limited to a master one. You can have master2 and master2.x master 2.y bones for other propouses.

I don't know if it will be permitted by Moho kernel because master still with no keyframe and I supuouse that it continuosly check if master have a keyframe and moves the slave accordingly.

It is only an idea. I hope some of the experts can confirm if this could be done or not.

Best
Genete
Post Reply