PDA

View Full Version : Friendly space switching


mhdmhd
06-11-2011, 02:30 PM
I am not a rigger in fact it is my first time but I have learned a lot in both scripting and rigging,
I am trying to make a space switch for my rig but I am having a bad time making it friendly to the user.
The problem is editing the keys after animating that if it is right at all, here is the code:

Two objects "A" and "B"

--first time to setup the controller
GoalPos=$a.position.controller=position_list()
BlndFlt=GoalPos.available.controller=position_script()
BlndFlt.addobject "target" $b
BlndFlt.addobject "contr" $a.pos.controller[1]
matrix=$a.transform *( inverse $b.transform)
BlndFlt.script="target.position - contr.value + " + (matrix.position as string)
------------------------------
------------------------------lock

matrix=$a.transform *( inverse $b.transform)
$a.position.controller[2].script="target.position - contr.value + " + (matrix.position as string)
$a.pos.controller.weight[2]=100

------------------------------free

matrix=$a.transform *( inverse $b.transform)
$a.pos.controller.weight[2]=0
$a.transform=matrix*$b.transform

note: I do the stepped key manually for this test

eek
06-11-2011, 05:03 PM
I am not a rigger in fact it is my first time but I have learned a lot in both scripting and rigging,
I am trying to make a space switch for my rig but I am having a bad time making it friendly to the user.
The problem is editing the keys after animating that if it is right at all, here is the code:

Two objects "A" and "B"

--first time to setup the controller
GoalPos=$a.position.controller=position_list()
BlndFlt=GoalPos.available.controller=position_script()
BlndFlt.addobject "target" $b
BlndFlt.addobject "contr" $a.pos.controller[1]
matrix=$a.transform *( inverse $b.transform)
BlndFlt.script="target.position - contr.value + " + (matrix.position as string)
------------------------------
------------------------------lock

matrix=$a.transform *( inverse $b.transform)
$a.position.controller[2].script="target.position - contr.value + " + (matrix.position as string)
$a.pos.controller.weight[2]=100

------------------------------free

matrix=$a.transform *( inverse $b.transform)
$a.pos.controller.weight[2]=0
$a.transform=matrix*$b.transform

note: I do the stepped key manually for this test




There's pretty much 3 parts to space switching, the keying, the cleaning, and the ui - the last parts take the longest as it needs to feel VERY natural to the user.

With keying you basically multiplying a transform by an offset, the offset allows for switching between spaces without a pop. And it depends on the objects parent space if it has one.

The offset is keyed with some sort of weight i.e the local weight 0.0 parent weight 1.0. So when you edit keys after the fact you actually moving an offset and a weight. Crucially the offset is tied the current value of the object at that time - so changing the keys will inevitably cause popping.

This is where 'cleaning' comes in - the offset needs to be reset using the current time its at. The pop can come about from a variety of ways - moving, rotating, deleting the offset/weight and source objects keys.

The UI needs to be very easy to understand, and most importantly the keys for the space/offset/weight need to be understandable. Either put them on another object so you can just see those keys in the timeline - or build a fancy ui that displays them. Most importantly you don't want the user getting the sources transform keys mixed up with the space switching keys! - pain will ensue.

cheers,

mhdmhd
06-12-2011, 09:09 PM
Thank you for your reply
It is very informative
My problem is that I learned most of rigging stuff from other rigs and from here but no available rig with a space switch is available or an informative topic to study.
I was going to use link constraint but it is very bad.
Here is a scene example, I do not know if it is right or practical what i have done but I tried.

MatanH
06-13-2011, 08:03 AM
I was going to use link constraint but it is very bad.

I also didn't like link constraint because of friendliness issues and so I wrote this tool:
http://cargocollective.com/matan#642881/LinkConstraint-UI
You can give it a try and see if it helps you :D

Cheers,
Matan.

denisT
06-13-2011, 11:23 AM
I also didn't like link constraint because of friendliness issues ...
.

i love link constraints. it's only way to be able correctly do animation compression for both parent and child for example.

LoneRobot
06-13-2011, 11:23 AM
Hi matan,

good work, that's a nice tool, I have a similar approach but add a link interface to a point helper as an attribute. I also store the point location's initial transform in case it flies off when initially creating the first link!

CGTalk Moderation
06-13-2011, 11:23 AM
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.