PDA

View Full Version : Rigging multiple switchable pivot points?


DaddyMack
01-19-2006, 12:10 PM
Hi guys, I've racked my little brain over this one and am yet to find a truly practical solution... I have this sweet little rigging system that I'm developing for cartoony animation of inanmate objects (in this case a mobile phone) and I've got the nuts and bolts 90% down...

The problem is I need 8 pivot points for the rotation of the object (each side and corner) as pictured
http://www.brainchilddigital.com/misc/pivotq.jpg

Simple yeah?... but ... I need the pivots which aren't in use to follow the active pivot, as if they were parented to it, so that when I rotate around or translate an active pivot, then switch to the next pivot, it's in its proper place in relation to the rest of the rig...

I've tried a heirarchy based approach but that of course only fully functions for the top node, and I've tried various constraint combos... I even dug up the old (1999) animating a rolling cube tut from alias wavefront but that only works on world space, I think I need a local space solution... but I'm stumped, I know I'm close but I'm still missing something...

Any of you big brained folks out there got an inkling that might lead to a solution for this?:shrug:

Cheers:beer:

Rob

ashishdantu
01-19-2006, 12:20 PM
hi DaddyMack,

i'm also on the same thing.. wud like to know how to do such thing, both in local and world space.. for an object..

but i had a luk at : Stephen Greenberg > crazy cat rig (cartton ) & his blog (%20Stephen%20Greenberg%20%20%3E%20crazy%20cat%20rig%20%28cartton%20%29)
where he seems to have got his own solution, which doesnt pop !

one more thing i saw was MacroniKazoo 's script, which wud give us the power of multiple dynamic parents.. check this : ( i didnt have much time to study it indepth, but might be of help to you) : zooChangeSpace MEL - part of his zooCST (http://www.macaronikazoo.com/mel/download/000114.html)

now i 've seen GENERICK rig, making extensive use of this, n i hope it works with out pops !

-rgds,

DaddyMack
01-19-2006, 12:46 PM
Hey thanks ashishdantu, I'll look into the zoo script cheers;)

The proper link for Stephs blog is here http://car2ns3d.blogspot.com/

after a little searching I found it... I remember seeing his switchy pivots when he was plugged for the cat rig... mental!... I tried but couldn't fish a solution from his site but it's late here and it's been a loong day... I'll try again in the morn

Any O' you other big brains wanna take a shot at it? :wavey:

M.E.L.
01-19-2006, 01:47 PM
I've attached a quick scene file... i'm just using nulls which I've snapped the pivots to various positions and parented under one another in a hierarchial approach. I use this a lot with mechanical rigging to garner multiple pivots off an object (also use it in characters a lot as to split up X Y and Z rotations for gimbal lock issues).

The pivots maintain their relation to the object in local space as well.

-s

Winner
01-19-2006, 09:08 PM
mike comet posted a great solution to an animatable pivot a few forums ago...

create a locator, with another locator parented under that. Parent the phone to the second locator. use an expression to tell the phone to move the negative value of whatever the first locator moves.... animatable pivot !... you move the first locator around as your pivot mover, then you use the second locator to animate your rotations.

works an absolute treat ( if i said it right hehe )

DaddyMack
01-19-2006, 10:26 PM
M.E.L... Hey thanks man! I'm still pluggin away on 6.5 tho and I rewrote the header and all but couldn't get it to open... I think winner is on a winner tho...

Winner.. Dude that's precisely the kind of simplicity that drives the rest of this rig so...:buttrock: to you mate and props to Mike Comet...

I'll test it out asap

DaddyMack
01-19-2006, 11:25 PM
Winner.. Thanks a bundle mate! You just saved me scratching a hole in my head... Brilliantly simple solution! :bowdown:

Works even better than what I was aiming for;)

ashishdantu
01-20-2006, 02:19 PM
hi winner,

cud u pls pass me the link of that thread ? (searched for it but cant seem to recollect the location ) and can u pls explain ur steps a bit more ?

" create a locator, with another locator parented under that. Parent the phone to the second locator. " -- what is the PHONE here ? pls bare with me, if i'm asking u tiny meny / stupid doubts ..

" use an expression to tell the phone to move the negative value of whatever the first locator moves.... animatable pivot !... you move the first locator around as your pivot mover, then you use the second locator to animate your rotations. " -- could u give an example of the exp..... and use the sec loc to animate ur rots -- means whose rots ? sory i'm sounding tooo noobie here..

rgds & thanx ...

Winner
01-20-2006, 02:36 PM
first off guys im not taking any credit for this solution... it was Mike Comet that came up with the idea over on another thread... ( which i cant find again .. LOL )

hey ashishdantu, no problem man, you dont sound noob.

the `phone`is the telephone from the image in the first post of this thread - but it could be any object that you want to animate ( a cube, a joint - whatever )

the `rot` just means `rotation` ....

its really just a simple heirarchy:

locator1 ( the top parent )
locator2 ( a child of locator1)
your object that you want to animate ( lets call it animObject ) ( a child of locator2 )

you lock the translation of locator2 so it cannot move, only rotate. By moving locator1, that gives you an animatable fake pivot position.

the expression is like this:

animObject.tx = locator1.tx * -1;
animObject.ty = locator1.ty * -1;
animObject.tz = locator1.tz * -1;

or i think you can even do :

animObject.tx = -locator1.tx;
animObject.ty = -locator1.ty;
animObject.tz = -locator1.tz; ( but it makes no difference )

hope this helps.

M.E.L.
01-20-2006, 03:22 PM
sorry for the late response here, was out at a Softimage event all day yesterday so didn't get a chance to check back here til today.

here's a 6.0 version of the file (i saved out a mb by accident instead of a .ma so I've just rewritten the header of the .ma file to work with 6.0). Quick side note too, I'm using nulls in this scene (click in your viewport, press ctrl+g, voila.. empty group null) instead of locators for the simple fact I hate cluttering my scene and locators involve inherent shape transforms etc. Nulls are just strictly pivots so you get a direct flow through the entire hierarchy.

Check out the scene and you kinda get the idea.


-s

ashishdantu
01-20-2006, 03:23 PM
hi winnner,

he he .. . i was stupid ! i checked the "load images" option off in my browser (which i forgot) and for a reason unknown, cud'nt recollect the "phone" posted on top (came straight to the last post, since i read the thread some time back... ) and missed it..

and thanx for ur time n kindness man.. u explained like u wud to a kindergarton child ! he he .. love it !

thanx, and i tried it , got it .. cheers to winner and Comet ..

-rgds,

edit : MEL, u use XSI also right ? u use it for games ? do u think XSI might also become a major production s/w market soon ? does XSI have in-built option or an easy way out for the multiple pivots thing ? do u think , this method of using locators (comet's tip) be used for dynamic parenting in a rig ? i havent tested it ,,, myself,,, but asking ur expert feedback..

M.E.L.
01-20-2006, 03:55 PM
*snip*

edit : MEL, u use XSI also right ? u use it for games ? do u think XSI might also become a major production s/w market soon ? does XSI have in-built option or an easy way out for the multiple pivots thing ? do u think , this method of using locators (comet's tip) be used for dynamic parenting in a rig ? i havent tested it ,,, myself,,, but asking ur expert feedback..

yes, I use XSI as well as Maya for a number of different things. XSI's already a major production market tool :) XSI has the same equivalent to multiple pivots as I showed though it's much more flexible being able to factor in constraint compensation amongst a gammut of other data etc.

I assume Michael's tip could be used in a rig but generally with dynamic parenting you're using condition nodes and switches (kinda like what Stephen was doing in his reel) where you're simply storing position data into an attribute via 'xform' and then applying it when the switch is needed.

I think the whole 'dynamic parenting' phase really kinda burst to be honest... I mean, it has its uses in a lot of scenarios as far as toon rigs etc but most animators would rather you hand them something that doesn't require a ton of bells and whistles with dynamic parenting and switching etc. Throw them a rig with multiple pivots, parent the shape node of your control so it's the master node and then use intelligent parenting so the animator can simply pickwalk across pivots using the up, down, left and right arrows.

imo, once you crack open XSI to the core and realize the functionality behind it... you'll be blown away ;)

-s

Winner
01-20-2006, 03:59 PM
Ive never had the chance to use XSI - I`m a maya man through and through but ive worked with many people who praise XSI - expecially for its animation functionality. I would certainly reccomend giving it a try if you`re interested ashishdantu

ashishdantu
01-20-2006, 04:43 PM
oooooooo MEL / winner,

yes, yes, i have been hearing XSI stuff / praises alot... from my frnd who has worked in softimage 3 .... ! he told me, all the graph editor, animation tool / concepts in maya were borrowed from softimage !

actually i've been wanting to atleast *touch* XSI since a long time... but the thing is, at work, no one has seen even the splash screen of XSI.. so using it shud be only out of my interest.. n once i do that, i might even not touch maya ! ( every one has his own advts/ dis advts ..but still )

coming to the topic of dynamic parenting, i agree with u shawn. one smaaaaaaall doubt (as usual ..)

"Throw them a rig with multiple pivots, parent the shape node of your control so it's the master node " -- r u saying ..parent the shape node (parent -r -s ?) of my CTRL to each of the 'pivot' grp (each of my grp is only a transform node) ? but using 'parent -r -s' shifts the shadeNode 's parent too right ? or is it that u can share a shadeNode between more than one transform node.. i read it somewhere, but cant recollect.. but is this the one ? >> "parent -add -s;"

"and then use intelligent parenting so the animator can simply pickwalk..." -- can u pls explain this further ? intelligent parenting - how to do this.. ?

rgds,

enbee
01-20-2006, 07:25 PM
first off guys im not taking any credit for this solution... it was Mike Comet that came up with the idea over on another thread... ( which i cant find again .. LOL )

hey ashishdantu, no problem man, you dont sound noob.

the `phone`is the telephone from the image in the first post of this thread - but it could be any object that you want to animate ( a cube, a joint - whatever )

the `rot` just means `rotation` ....

its really just a simple heirarchy:

locator1 ( the top parent )
locator2 ( a child of locator1)
your object that you want to animate ( lets call it animObject ) ( a child of locator2 )

you lock the translation of locator2 so it cannot move, only rotate. By moving locator1, that gives you an animatable fake pivot position.

the expression is like this:

animObject.tx = locator1.tx * -1;
animObject.ty = locator1.ty * -1;
animObject.tz = locator1.tz * -1;

or i think you can even do :

animObject.tx = -locator1.tx;
animObject.ty = -locator1.ty;
animObject.tz = -locator1.tz; ( but it makes no difference )

hope this helps.

I have also been trying to figure out a way to do this. I have tried out this solution and it still does not work correctly, maybe I am missing something? The problem is that you can't rotate then translate. So if you translate the pivot, then rotate it, you can't translate it again because the object will move.

DaddyMack
01-20-2006, 07:29 PM
Firt thanks again for coming to the rescue of my flailing brain on this guys :bowdown:

ashishdantu.. The thread winner mentioned is here (http://forums.cgsociety.org/showthread.php?t=297343&page=2&pp=15&highlight=pivots)

Winner.. Not until you do the truffle shuffle;) Cheers again... I noticed tho that the top locator functions in worldspace and because the phone is beneath it it acts in a local space manner still... Meaning basically that the concept works sweet but only if the rotations are zeroed... Once it's rotated and I move the trans loc I get my phone sliding along the locator and doing other kinky stuff.. Is this just my noobnes???

If not is there a little something that I can do to tie them both down onto the same space so that the translatioins correspond regardless of rotation?..

M.E.L... Hey thanks again mate;) I'll give this a lookin today, cheers for the brain borrow:bowdown:

BTW guys I'm actually writing a pretty cluey little tut for nonlinear rigging for cartoony animation of everyday inanimate objects... This has been the only major hurdle so cheers for jumping in to save me... I already contacted Mike Comet to see if he wanted a shout out/ plug on the page for the pivot system... You guys want some recognition for your cleverness too?

Winner
01-20-2006, 07:29 PM
im not sure of your specific example, but nothing should move. The negative input to the objects translation should assure that. All youre really dealing here with is rotations. As of yet im still to actually do an animtion using this setup - all ive really done is rigged up a cube this way and screwed around with it .. so sure it may act weird - but so far it seems fine for me.

enbee
01-20-2006, 07:41 PM
so if you translate - rotate - translate yours performs properly? Mine doesn't, because its translating then rotating the object. Which mathmatically it needs to be the other way around.

here is a scene file. so you can see. go to wireframe mode, the the locator inside the sphere is the pivot control.


edit: i had switched some words up there.

Winner
01-20-2006, 07:50 PM
hey enbee (http://forums.cgsociety.org/member.php?u=132775) .. im really not sure to be honest... I will need to test this tonight.:shrug:

the way i would initially handle translating the top node is with stepped keys, this may help curb any weird interpolation... but like i say i will look at this tonight

DaddyMack
01-20-2006, 08:08 PM
M.E.L... Cheers for the backward compatability mate;) This solution is similar to one of my earlier attempts, it's a great, simple approach but only works down the heirarchy (meaning that any pivots above the one being rotated don't follow the motion) hence my search for a better approach... Thanks again mate:bowdown:




Here's a pic of the current dilemma with the Comet concept

http://www.brainchilddigital.com/misc/phoney.gif

Any help indeed from you big brains?.. Mine's turning to moosh on this...

Attached is a base of my scene file if anyone wants to play... Good luck:shrug::wavey:

M.E.L.
01-20-2006, 08:12 PM
*snip*

coming to the topic of dynamic parenting, i agree with u shawn. one smaaaaaaall doubt (as usual ..)

"Throw them a rig with multiple pivots, parent the shape node of your control so it's the master node " -- r u saying ..parent the shape node (parent -r -s ?) of my CTRL to each of the 'pivot' grp (each of my grp is only a transform node) ? but using 'parent -r -s' shifts the shadeNode 's parent too right ? or is it that u can share a shadeNode between more than one transform node.. i read it somewhere, but cant recollect.. but is this the one ? >> "parent -add -s;"


Yeah, essentially what you have is your 'usual parent -r -s;' function to tie the shape in as the "master" node of the hierarchy. So what you are doing is telling Maya that when THIS shape is selected, it will recognize the hierarchy below (instead of grabbing the shape and having your usual transform node above it). You can't actually physically share a shapeNode between multiple objects unless you want to instantiate of course, dynamic parenting.



"and then use intelligent parenting so the animator can simply pickwalk..." -- can u pls explain this further ? intelligent parenting - how to do this.. ?



Think of it like arranging your parenting properly in a hierarchy much like you would with a hand. Animator picks the hand joint, pickwalks down and you have your first thumb joint. Now he doesn't want the thumb, he wants the Index so he simply presses the right arrow and voila, he's at the index... or he presses Right Arrow again and he's now at the middle finger. The way you actually parent objects has a HUGE factor on the animators, this is why I prefer to constrain my controls to the hierarchy instead of parenting them. You save the animators a huge load of headaches if they want to pickwalk a hierarchy not having to stumbled over all sorts of other junk to get what they need.


M.E.L... Hey thanks again mate;) I'll give this a lookin today, cheers for the brain borrow:bowdown:

BTW guys I'm actually writing a pretty cluey little tut for nonlinear rigging for cartoony animation of everyday inanimate objects... This has been the only major hurdle so cheers for jumping in to save me... I already contacted Mike Comet to see if he wanted a shout out/ plug on the page for the pivot system... You guys want some recognition for your cleverness too?



No problem mate, that's what I am here for... I also do weddings and the occasional childrens birthday party on the weekends.

Up to you about the shout-outs, most people just point at me and say "hey you!" or call me "that guy with that creepy avatar" ;)

-s

M.E.L.
01-20-2006, 08:29 PM
M.E.L... Cheers for the backward compatability mate;) This solution is similar to one of my earlier attempts, it's a great, simple approach but only works down the heirarchy (meaning that any pivots above the one being rotated don't follow the motion) hence my search for a better approach... Thanks again mate:bowdown:

Here's a pic of the current dilemma

http://www.brainchilddigital.com/misc/phoney.gif

Any help indeed from you big brains?.. Mine's turning to moosh on this...

Attached is a base of my scene file if anyone wants to play... Good luck:shrug::wavey:

Yeah, I just realized and remembered that as I looked into the scene. Whoops.

Off the top of my head I would probably script it to be honest... query each location in worldSpace or localSpace for whatever vertexes or pivot points you need, then have a simple button that would snap the pivots to their proper respective locations. So basically you could rotate the object going down the hierarchy etc, run the tool (we'll call it "Snappy") and snap your points



//Snappy tool

global proc SnappyUI()
{
window -title "Snappy" -w 200 -h 200 snappyWindow;
button -l "Get Pivots" -c "getPivots;" -bgc 0.3 0.3 0.3;
button -l "-=-DO IT-=-" -c "Snappy;" -bgc 0 1 0;
showWindow;
}

global proc getPivots()
{
string $sel[] = `ls -sl`;

for ($each in $sel)
{
string $worldSpace = `xform -q -ws`;
string $stringArray[] = "{" + $worldSpace +"}";
{
}

global proc Snappy()
{
string $sel[] = `ls -sl`;

for($each in $sel)
{
//set the attribute of the rotatePivot to match that of the respective pivot stored
in the above proc
}
}



That's pretty hacked and not nearly tested... just running off the top of my head here but you kinda get the gist of it... it's like using an IK snapping tool to match the IK to your FK animation etc.

-s

DaddyMack
01-20-2006, 08:57 PM
I'll ask you big brains to excuse my ignorance but my journey into programming is about a week old:blush: So I barely understand a word you said M.E.L.(in your script) I'll keep rereading it tho after some intensive surf today (sun is shining... weather is sweet) Thanks again mate;)


Basically my original goal was simply to have 8 pivot points which follow the rotation of the object regardless of which pivot is being rotated... The rig I'm currently working on has massive potential for aerial manouvers and I need to nail down its contact points... so that by selecting and keying the appropriate points on the rig I could easily have the rig act similarly from any of the 8 points illustrated on page 1...

Beach time for me today tho:wavey:

enbee
01-20-2006, 09:28 PM
So I have been trying to figure out the animatable pivot problem using matrix math and since there seems to be a few tech gurus in here I have a few questions. Sorry if this is a little off the topic of the thread, but it is related.

So I am trying to use a similar set up that was talked about earlier, with the 2 parents above the object and taking the negative of the top parent and puting that into the object so when you move the top parent (simulated pivot) the object does not move. Instead of just negating the translate value I want to take the inverse of its matrix and use that. The problem is that I don't know how to get the inverse matrix of a tranform node. Is this possible? I can get the matrix with xform but getting the inverse is a different story. I could write an expression but that would be really long and complicated and probably wouldn't run to fast.

In the connection editor every transform node has all kinds of matrix outputs (inverse, world, parent, etc). But I can't figure out how to actually get these values.

Any help is appreciated.

M.E.L.
01-20-2006, 10:17 PM
So after a can of Redbull and some thought... it actually hit me... we can't physically do this in Maya.

Reason: The DAG. Direct Acyclic Graph

Why: Simply put, Maya needs to have a "direction" to flow in. If you're animating downstream then it's cool but to animate back upstream breaks the Maya architecture because you have now created a cycle. I mean, we can sit and do Matrix math til our heads hurt, invert values, query rotations and everything under the sun but we can't actually do this. We're essentially breaking the primary rule that a child cannot be the control object of a parent whilst it is a child (it must become the parent, else we create a cycle).

At the very core of things we're just creating this constant cycle that will ultimately break things. I honestly can't think of a package that would let you do such an 'upstream' type nature without completely sending it into a furious rage of cycles to be honest.

The nearest that I can figure we can accomplish this is by using a snap script like I mentioned where we specify our points in space by locators or implicits of some sort, use the script to first query the positions and then 'snap' our pivots directly to them. The unfortunate result here is that your keyframe count is now skyrocketing because you need to keep the positions of the pivots so they don't snap back.

Any child->parent correlation is just going to go AWOL for the simple fact that we're creating too many dependancies. I could be wrong but even looking at the options provided via constraints, expressions, nodes and the like it ends up in cycle heaven :)


-s

enbee
01-20-2006, 10:23 PM
well, a lot of that is true. But this guy did it somehow......

http://forums.cgsociety.org/showthread.php?t=290011

M.E.L.
01-20-2006, 10:43 PM
I assume you're talking about where he moves the main_rot control and then pivots the character off it?

I watched that twice now and I don't see an animatable pivot anywhere in that entire reel...

Got a time range?

-s

enbee
01-20-2006, 10:51 PM
yeah the main_rot_ctrl, its at 1:05. also the scaling controls at 1:11. How do you think he did that?

M.E.L.
01-21-2006, 02:16 AM
His main rot control's actual translate pivot isn't wired into anything. All he has done is created a direct connection using the connection editor to a topNode in the hierarchy (above what he needs to control) and simply slides the control over, rotates it to pivot the character (connecting his rotation of the control to rotation of say bodyRoot_1) and voila.

Same deal for global scale, just attach the objects scale attribute to your globalScale node via the connection editor and voila.

it'd kinda be like...


|_topNode (master node of hierarchy)
|_globalTransA (these are your 'world' translates)
|_globalTransB
|_globalTransC
|_globalScale (this is your 'world' scale)
|_bodyTransA (this is your local translates)
|_bodyTransB
|_bodyTransC
|_skeletonNode (skeleton rig)
|_controlsNode (skeleton controls)
|_ikNode (ikHandles)
|_extrasNode (anything extra)


refer to the Hyper-Real Body Setup by Paul Thuriot and the Custom Character Toolkit by Paul Thuriot and Erick Miller for more info on this hierarchial based approach.


-s

ashishdantu
01-21-2006, 05:15 AM
Heelloo MEL //all ppl of this thread,

DaddyMack, thanx alot for the link..

MEL, thanx a lot for the details.. are you saying that, grouping method is what is being used in his demo reel ? will have to dig thru all this .. n c..

rgds,

enbee
01-21-2006, 01:42 PM
Thanks for the help M.E.L. I still don't fully understand how you could reposition the "world" scale or translate pivot points without moving everything underneath. I will have to test some things out later.

M.E.L.
01-21-2006, 05:42 PM
Well, all you're doing is wiring the controls rotation up to the rotation of a node that resides higher up in the hierarchy. If you don't connect the translate, it won't shift everything else in the hierarchy.

If you connect the rotation of a locator to the rotation of a cube, when you rotate the locator it will rotate the cube. If you translate the locator, nothing will happen to the cube because you're not invoking rotations.


-s

enbee
01-21-2006, 06:39 PM
yeah but the cube would still only rotate around its own pivot point, not the locators.

DaddyMack
01-21-2006, 08:10 PM
enbee.. I think what M.E.L. means is in the connection editor you can connect just the rotation of the target to the rotation of the controller as opposed to hooking up tanslation as well... I think...

Trying to sleep last night I had this bizarre graphical vision of a two way flowing switchable constraint system whereby 4 double nodes were hooked up *in and out* to each other and each time one was switched on as active, the power went out on the others and they blindly followed their master... until such time another was told to be master and so on... I love my little brain sometimes... I'll give this a try but I have only a tiny amount of belief in the concept... Anyone got an opinion on it?

Thanks for the reality check M.E.L. (and for the loan of your big ol' brain again), it was a goal from the start to keep this rig functionally simple so I plan to keep the 'mounted' pivots that I originally started with, in a heirarchy system as you affirmed, and I'll pop in one floating pivot as well for good measure using one of the methods described by you other big brained folk... This rig and tut was s'posed to be done within a week and with my usual overambition I've blown out a little so... I'm cutting back to simple functionality for less clutter or confusion;) so I can get to animatating it...

Props to you all for the sharing your synapses:bowdown::buttrock:

M.E.L.
01-21-2006, 08:41 PM
Ok, so to clarify I stated the wrong thing heh.

I said rotation, what you actually do is connect the rotatePivot to the other object. This forces the rotation channels to still control the other object and also forces it to pivot off of the connected controller. Sorry for the mis-type.

Your system would work btw, all you need is an 'intelligent' switch whereby when you trigger your upstream, you break your downstream connections and connect upstream and viceVersa...

somethin like:



if(blah == 1)
{
connectAttr foo.rotateX bar.rotateX;
}
if(blah == 0)
{
connectAttr bar.rotateX foo.rotateX;
}



Basically your switch attribute would control all of that, if you REALLY wanted to get fancy you could add in an attribute from say 0-10 that would cross-blend constraints (i.e. you create a multitude of parent, orient or point constraints and simply switch up their weighted values between attributes on the fly).

No problem on the reality check... TD's are good at those ;) As far as the brain borrow... well, this brain's just about fried these days so I'm gonna go with a Nuclear Fusion Core transplant next week :P If for some reason you're in Seattle and notice a bright green glow emitting from an office, well.. that's where I work so come say hi :head:


-s

enbee
01-21-2006, 10:02 PM
Well, I still can't get it to work, I will try again tomorrow. Anyway thanks for all the help, I appreciate you taking the time to try and explain it.

DaddyMack: Sorry for highjacking your thread. I'm glad you found a solution to you problem. :beer:

I really want to solve this pivot problem with matricies, but I guess maya just isn't built for that. Anyway I look at it, M.E.L. is right, there will be cycle issues. Since a transform node is basically just a matrix I am wondering if I can do it that way, but again I don't know how to efficiently get the inverse of a matrix. But I really got to get back to other projects for the rest of today, hopefully I'll have time tomorrow...

:bowdown:

ashishdantu
01-22-2006, 06:23 AM
hi daddymack ,,..

sory if i'm spilling more fuel into this..but hey, this camp fire is gud ! i'm Lovi'n it :>)

ok, the point of having two directional parenting stuff, has been bugging me also.. but like MEL said, we can get it to work.....with constraints (setup constraints, switch between them-- psuedo dynamic parenting ?) ........

but wanted to ask if any one used this > plugin Bidirectional Constrain 0.1 (http://www.highend3d.com/maya/downloads/plugins/animation/2791.html)
but the plugin is built for maya 5 i guess.. but in the description he says .. he overcomes the maya 's DAG one-way structure with his *tricks* ... any idea how it works ? any one used it ? but he says its a switch .. no blending and his site also is down..

rgds,

DaddyMack
01-22-2006, 07:12 PM
Well... I tried out my 2 way concept last night and it is flawed as I suspected... I used constraints and there was cycling error issues... Basically I parented a locator to a null * 4 and named the nodes N S E W for compass points, Parent constrained the nulls to each of the locators with a switching system, so that when I turned on the N locator as active, all of the others shut off and followed blindly... That worked just fine...

The problems arose when it came time for the old switcheroonie... It was pAin-full to watch with the flIppi-inng and the jUmpi-inng and the spIInnii-ing bwooheyy...*ahem* ... sorry...

Anyways that was my last attempt at overcoming this Q? for this rig. I'll stay on the problem tho because it is worth researching I think. I'll stay tuned here as well as make any contributions I come up with... Good luck and thanks again you nutters:bowdown::wavey:

ashishdantu
01-23-2006, 09:18 AM
well..daddymack..

have u tried this ? select all ur constraints and in their interpolation, change it to shortest from average... solved some flipping for me.. some time ago.

MEL / anyone,..
one small question - i have an object A and it is orient constrained to another object B. i tried disconnecting the orient constraint's output going to the obj A 's rots and connect it to a blender's input1R and connect back the blender's outR to the obj's rots....... it does so, but theres no values, flowing thru the blender to the obj's rots, when the blender is set to 1.. any ideas why ? ( i have the other connections from the obj A to its orientation constraint node like : parentMatrix and .rotate -> targetRotate and rotateOrder -> targetRotateOrder , all intact.. )

another small question - how do i get the world rotations of an object , to be used to pipe them into my utility nodes ? like say i want a child obj's rotations to be controlled between two parent obj's rots.. thru a blender for example ...generally when i plug their rots, i 'm connecting their local rots right ? so how do i get the world space rots to be piped into the blender's inputs ?

lots more ques, later...
rgds,

jdj
01-23-2006, 03:40 PM
Hi,

My $0.02 about pivots if it helps ayone:

The pivot point is really just an extra translation that is negated after the rotation. If you check the transform node documentation you can see something like this:

matrix = .... RP-1 * R * RP ...

Basically what this says is:
- move (translate) the object away from the local center
- rotate around the local axes
- then move the object backwards the same amount that it was translated before

Rotation in its pure mathematical form can only be done around the local coordinate axes, that's why you do like this to give the appearance that the rotation is done "off-axis".

That you are using multiple nodes (locators, nulls, groups whatever) instead of playing around with the components of a single transform does not change this basic fact. However it might be easier to see what you are doing when using multiple nodes.

The problem is really that what you want is an stepwise change of the pivot locations - i.e it should during frame 0-10 be at position A, 11-20 at B, 21-30 at C etc.

This can only be solved with a stepwise function. Regular connections (like the "comet" setup described) updates continuously and proportionally, a far cry from the stepwise increments desired. In comes then scripts as you have described in the previous posts.

Scripts that are called from time to time to update information however can be "stepwise functions" and the effect of these can then be stored as stepped animation curves.

There is actually an extra attribute in the transform node called RT that can be used for this:

matrix = .... RP-1 * R * RP * RT ...

If, during the desired change of pivot points, both the RP and RT are manipulated, you can make the object remain stationary.

However, unfortunately it is not so simple as to move the RT and RP in opposite directions...
Let's say that you have an object at <<0, 0, 0>> with the RP at <<2, 0, 0>>, rotate it -90 degrees around Z and it will end up at <<2, 2, 0>>. If you now want the RP at the world space position <<2, 1, 0>> for the next rotation, the RP needs to be changed to <<1, 0, 0>> and the RT to <<1, 1, 0>> to maintain the total transform.

Scriptwise, you could use the good ol' xform to query and set the RP & RT based upon the position of another object (like an locator).

However it just appeared to me: what if you make the RP & RT keyable? Then set a key at frame 0 and them move the pivot with the usual means - it ought to set keyframes if autokey is on. I will check this sometime - or perhaps you guys will beat me to it...

Finally a bit of nitpicking:
So after a can of Redbull and some thought... it actually hit me... we can't physically do this in Maya.

Reason: The DAG. Direct Acyclic Graph

Why: Simply put, Maya needs to have a "direction" to flow in. If you're animating downstream then it's cool but to animate back upstream breaks the Maya architecture because you have now created a cycle.

You need more redbull... ;) not entirely correct; you can have cycles in Maya. The hierarchy of a scene cannot be cyclic, thereby the DAG. But then how the data flows between the nodes is governed by the DG = Dependency Graph. The DG is technically a "Directed Graph" - note the missing "Acyclic". However in my experience cycles are often difficult to control to any exact degree so they are often useless.

---

...anyway. Don't know if this helped you at all. I am kind of tired today but I think you get the picture; there is no way with regular connections to make jumping pivots happen but with scripts it is no problem. The biggest problem is to make it user friendly.

Cheers!
/ Daniel

Psst: ashishdantu: My tired brain tells me that there is/was a node/plugin called decomposeMatrix. Haven't used it recently (i.e. I'm talking versions here) but it used to be there but not described in the node documentation. Check if you can load from the plugin UI and connect it to the node's world space matrix. Generally however Euler rotations are not very friendly to interpolations like you describe. Quaternions are your friends here. How to do this is however another question...

Winner
01-23-2006, 07:41 PM
sorry for my absence guys...

yeah wow youre totally right !

The animatable pivot thing doesnt seem to work correctly at all. As far as I can tell - its because the position of the object that has the negative value assigned to it is always in local space .... that will teach me to blab about a technique until ive actually tried it properly ;)

damn ! i thought we had this figured !! oh crap.

so whats the result so far ? anyone figured another simple way of doing this ? im not a mathematician -- but would this same principe work if you could somehow pipe negative world translation data into the animatable object ( but jeez that seems complex ) ...

edit: lol just read jdj's post...

ashishdantu
01-24-2006, 06:46 AM
hi jdj,

WOW !! u r a mathematician or atleast some one unlike me ! he he.. i'm not a math guy .. yet....... thanx for the explanation.... now thats what all happens at the maya 's core.. uumm.. lots to understand...

ur ideas on the pivot, and cycles in maya 's structure, taught me a bit more.. will try n check the DecomposeMatrix thing..too..

anyone , with ideas on my current -last -but-one post ? regarding : piping world rots of objs in/out : utility nodes? n orientconstraints stuff ?

winner, i need to sit on it..havnet been able to test and make my time for this.. yet..

thanx JDJ again, n s, it did help me.
-rgds,

jdj
01-24-2006, 08:03 AM
Hi,

Well, I tried my animated rotatePivot & rotatePivotTranslate approach yesterday, worked like a charm (see attachment - tiny divX encoded playblast). It is a quite simple solution but perhaps not the highest in user-friedliness.

In short: Make the attributes keyable in the channel control and set a keyframe at frame 0. Then with autoKey On do your regular stuff of rotating and moving pivot points to wherever you want them using the [Insert] key. Swap to the graph editor and make all tangents to "stepped" for all the rotatePivot & rotatePivotTranslate attributes. Play it back and enjoy your spinning objects.

It is not a one-button approach though. To do that, I would basicly do the same as I describe above, but use a locator or similar as a "position marking" object and then read and set attributes via xform. Then I would need to fix the keyframe tangents, wrap it up and shove it into a button.

Winner:
"could somehow pipe negative world translation data into the animatable object ( but jeez that seems complex )"

You can get the world space transform matrix from a DAG node - just check the node documentation of the dagNode and you will find all kinds of interesting transform matrixes that you can read (local / world / inverse world / parent / inverse parent). The translation part of that one is quite easy to extract (it is actually the only simple part to extract from a TM), and the inverse of the transform part only is just to swap the sign. However I do not think it will help you - but I think you figured it out already. :)

ashishdantu:
Not to discourage you - please go ahead and try - but I think you are on a wild goose chase here. As I said, euler is not what you want. The reason for this is that two very similar orientations in space can have very different euler angles. To then lineraly interpolate between them (i.e. blending / weighting / etc.) will cause rotation madness in the transition keyframes. Of course if you do sudden changes (steps) then you will have no transition frames and you will be up and running.

Cheers
/ Daniel

seema
01-28-2006, 10:32 PM
hey m new to this thread. Found it very interesting!

I tried workin on it n looks like i have found a simple way to do it but I am sure if its rite.

I have a cube(obj) n a circle (PivotObj). an expression for connecting the ws translate (using Xform) of the pivotObj to the rotatepivot of the cube . orient constraint(with offset) the cube to the circle. So when I move the circle n rotate it the cube rotates aorund it. Now comes the problm rite. when I translate the circle after rotating, the cube moves, which is not supposed to happen.

So i tried this n it works but dunno if its clean. I deleted the orientconsraint at that point n froze the rotations on that circle. N reconstrained the cube to the circle with maintain offset. N now evrythign goes back to normal. when I translate the circle the cube does not move!! :-)

If this is a good approach, I m thinkin of may b using script jobs to freeze rots n reorient it automatically whn the circle is rotated..

before I work on automation wanned to kno if this is workable. It seems like a really simple solution but I am not sure if its right! i am hoping to hear some comments on it .

jdj
01-29-2006, 12:37 PM
hey m new to this thread. Found it very interesting!

I tried workin on it n looks like i have found a simple way to do it but I am sure if its rite.

I have a cube(obj) n a circle (PivotObj). an expression for connecting the ws translate (using Xform) of the pivotObj to the rotatepivot of the cube . orient constraint(with offset) the cube to the circle. So when I move the circle n rotate it the cube rotates aorund it. Now comes the problm rite. when I translate the circle after rotating, the cube moves, which is not supposed to happen.

So i tried this n it works but dunno if its clean. I deleted the orientconsraint at that point n froze the rotations on that circle. N reconstrained the cube to the circle with maintain offset. N now evrythign goes back to normal. when I translate the circle the cube does not move!! :-)

If this is a good approach, I m thinkin of may b using script jobs to freeze rots n reorient it automatically whn the circle is rotated..

before I work on automation wanned to kno if this is workable. It seems like a really simple solution but I am not sure if its right! i am hoping to hear some comments on it .

Hi,

Well, without knowing the specifics I still think you might run into a problem here. The basic goal for what you want to do when changing your rotate pivot is that it should be repeatable when you play back your animation.

When you do like you suggest, you will modify the scene setup at a specific point in time. Unless you create some scripts that can trigger upon some pre-defined event in your scene, you will not get what you expect when you re-play animation. Instead Maya will use the new scene structure through the entire animation playback.

For example; let's say that you want a character to pivot of the heel of the foot in frame 0-10 and then the ball of the foot at frame 11-20. If you do like you suggest, you will during animating, re-define the rotate pivot to the ball off the foot at frame 11. Maya have no way of realizing that this was inteneded to be a chage at frame 11 only if you create and delete nodes then. When you later replay yout animation, the character will have the rotate pivot at the ball of the foot throughout the animation.

You need to either store your changes as animation curves or havint triggered scripts in order to make changes repeatable. Animation curves voids any changes of the scene graph. Triggered scripts can be a bit tricky to get right since good animations should be able to played backwards and jump in time - animators do that while working and however you arrive to a certain frame, you should heve the character in the same pose.

The best way of doing this IMHO is to simply make the rotatePivort and the rotateTranslate keyable and then use a script calling 'xform' with the '-preserve' option to set the positions. To add some panache to your script you can then use 'keyTangent' on the resulting keyframes to set the tangents as stepped.

Cheers
/ Daniel

seema
01-30-2006, 01:22 AM
Thanks for ur input, But i m confused.
I am gonna key the circle that cntrls the rotatepivot of the obj..so Maya will store the values rite? I tried animating n it seems to work. The circle has to be keyed. If i didnt mention that before ..m sorry about that.

dangerweenie
02-03-2006, 11:21 PM
I had the same problem with translating it after rotating....

CGTalk Moderation
02-03-2006, 11:21 PM
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.