View Full Version : Match Goal Orientation's invisible magic

01-20-2005, 06:13 PM
Match Goal Orientation (MGO) has no visible effect at the user level--rotational channels remain silent whereas the item happily rotates around (suppose world-space orientation from the goal item is just copied over the world-space orientation of the item). While this usually is not a problem, it turns into one when using something like JointMorph/Plus which depends on rotational channels reflecting rotation (well, the way it should be).

Anyone here with a viable solution for setting up joint deformation maps in spite of MGO being used? I tried various solutions, but everything wound up not working because of those silent rotation channels. Maybe someone has a clearer view or more technical ingenuity.

A solution that WOULD be okay is having a channel modifier that measures the angle between the two bones forming a joint and compares it to the angle when both are in their rest position (that's what JointMorph actually should be doing). What this sums up to is:

a: parent bone base position
b: child bone base position
c: child bone tip position
d: parent bone vector (a to b)
e: child bone vector (b to c)

d = b - a
e = c - b

Now calculate the angle between d and e, extract the component (h,p, or b) you're interested in and there you are.

This is all very simple vector math and should be quick to implement but because of LScript it is not. Calculating bone tip positions cannot be straightforwardly done (helper items can be used to work around this) and there seems to be a bug in LScript that makes it impossible to query item position/rotation/pivot information with absolute time values. I started writing the modifier as a native plug-in but since I'm currently experimenting with a pure bone setup (holders+muscles), I'm not sure if and when it's going to be finished.