View Full Version : Animating the Switching between Parents
sekops 12-21-2006, 02:00 AM This should be a simple process and i believe that a lot of animators come across this problem. Wat if i want to swtich between Parents in the scene? This has to be animated of course.
My reason is this, if the rig is parented to two parents... World and local. When object is parented to the world, i can move the local to another location, and then switch over to the local as parent, and voila, new pivot point. Ive given and example of a situation below:
Example, Hypothteically speaking... (i) if mycharacter is jumping from a box on to (ii) swiveling platform, walks on it, and then (iii) jumps hangs off a bar swinging around then (iv) jumping on to another character and (v) lands on his feet.
So what happens is.....
(i) Character is parented to the world (global)
(ii) then character is parented on to platform.
(iii) parented above his neckline on to the bar
(iv) parented on character
(v) parented back on to world (global).
Currently ive experimented, and have used 2 parents constraints, and was hoping to switch between the two when i moved the second one. Problem is , it snaps. when the weight is switched to the second one. The offset distance between the constrain and constrainer is stored, and doesnt change causes the snapping...
Or is there another way?
heres a thread i found that is in the same area
http://forums.cgsociety.org/showthread.php?t=441010
|
|
NolanSW
12-22-2006, 12:28 AM
I just posted a script up on highend for helping with this issue.
http://highend3d.com/maya/downloads/mel_scripts/animation/snWorldSpaceTool-4438.htm (http://highend3d.com/maya/downloads/mel_scripts/animation/snWorldSpaceTool-4438.html)l
Pretty simple. So, in your case, just before you want to switch you go back a frame before the switch and use the copy button and key your translate/rotate and the attribute that makes the switch. Go to the current frame and make the switch. The control will pop. No problem. Use the paste button to add the world info back into the control and key it all again. No you've switched between spaces without popping.
Hope that helps out.
Cheers,
-Sean
sekops
12-22-2006, 01:14 AM
Thanks, thats pretty useful... :)
but...
I was thinking however that this could be used without the copy and paste, i think u had posted a similar thread in the other forum. I did have a look at your script too. Its pretty close though. I might have a shot in using ur methods n a simlar fashion.
I was actaully thinking that maybe the object could be controlled by two parents. But only at one time by one parent. The object would have an additional attribute, an int condition. When the object switches parent, the world space is copied and pasted automatcially. So we wouldnt see the pop, and is controlled by one attribute.
Whatd u think?
NolanSW
12-22-2006, 03:52 AM
I think we are both on the same page. Let me see if I got you right..
Lets say we have a control. It has a group above it that has the parent constraints. That group has two constraints, one to say to the world and another to some local postion. So you want to switch between the two without popping but automagically from changing an attribute? Well the method I stated is a more manual way. There are two other ways that can be done.
One way can be done with scriptJobs where if an attribute changes it runs a script. I'm not a big fan of scriptJobs and use only as a last resort. But is a quick and dirty way of doing the job.
Second is my fav which is having commands built into an object. You still need an attribute for switching on the object. This takes a bit to setup but is really worth it. So basically you would have a script when you right click on the control that and it will run a script when you select the command. If you check out these zooScripts (http://www.macaronikazoo.com/download/zooToolBox.rar) there are some scripts in there to set this up. I use some of Hamish's scripts to set this up for my own stuff and is great.
These are really the only ways that I know that will give you close to an automatic way of doing what you want.
-Sean
talama76
12-22-2006, 10:16 PM
If i understand this correctly, what NolanSW is talking abount can be seen "in action" in Generick rig by Ian Jones (http://shrtcww.com/downloads), where if you select a control and switch between parent using the channel box it will pop, while if you use the RMB menu it will not pop.
Anyway i'm a bit unsecure about the main reason to use zooTriggered to add command to the RMB instead of the "edit cmd...", "new cmd.." we have in maya (hope this is not a stupid question :)).
Ciao
talama76
12-23-2006, 04:01 PM
Ok, it was really a stupid question, there is nothing like a "new cmd", "edit cmd" in maya.
Sorry for my mistake :)
Ciao
sekops
12-24-2006, 09:36 AM
I saw that guys rig Tamala... thats excellent, his taxi rig is pretty cool. THanks.
Nolan,yeah we are talking among the same lines. Im thinking of getting a script done for that purpose, it would take me a while though, I just started learning MEL. Im thinking that an expression should paste its values auomatically to the objects world space. Ive gotta do it in a way which it doesnt affect the local space coords.
hibigibees
12-26-2006, 09:11 AM
hi ...
Although there are so many solutions already available for this parenting thing either through mel script/script job or plugin....etc, the best solution for this in the future is autodesk can rewrite the parent child relation in the next version of maya which might really make animators decide what parent they what to choose at which frame for a given transform node... lemme explain,
using existing maya...
If I parent A transform to B transform, when A moves - B "need not/does not" move and when B moves - A "need to/does move" along with B. So the animators have to use constrain and use additional transforms to make a blend/switch between 2 or more parents either t/r/s or trs based, which is cool when one clearly understands the terminologies such as "world position", "local position", "rotate pivot" etc. and understands why does it pop when i switch between constrains and how to eliminate it. I feel that to make a the job of switching easier, something has to be added to the existing system which should be done at developer level where the switching works on 99.9% of the cases properly.
If the following new feature is already available in maya which includes a couple of attributes for every transform node viz.
"GBL" of type int.. i.e. Go By Level ... the attr values are either -1 or 1 or 2 or -4 etc based on the its position between the hirarchy...
1. when a transform node is not parented to anything, and GBL is 0 and has no effect when its changed from 1 or anyother value
2. when a transform node has a parent named "pSphere1", GBL can be either set to 1 or 0. Setting GBL to 1 might have a reverse effect on the parent child relation although the hirarchy remains the same. i.e when the transform node is moved the pSphere1 starts moving while the vice versa might not happen... note that when GBL is set to -1 nothing might happen...
3. when a transform node by name "A" is parented to "B" and "A" has a child "C", "A" might have an effect when the GBL attr is either changed to 1 or -1. when its changed to 1, "A" is the acting parent of "B" and "C" while when its set to -1 "A" becomes acting the child of "C". By "acting" i mean that the hirarchy remains the same B--->A--->C but the transform relation ship does the difference when A or B or C is moved...
so when i parent some transform to some other transform, the end user can select and use GBL attr to decide his parent on a given frame.
The most important thing might be to make sure that there is no pop/jump of transforms when the attribute is changed.
There are possibilities of an error message when either one of the attributes/transform nodes are locked. This is a good topic for RND and i guess there are many people out there already with a solution to fix this issue with some other idea alot better than what I have explained... I understand that there are lot many things which needs to be considered, but this is just a personal idea to give the animators more control over the transforms.
If such a thing is available in maya... To make sure that the animators don't change the hirarchy of the existing rigs using GBL, select the topmost trs node where parent selection is not necessary and type "select -hi" can be used to select all children and then the GBL attr can be locked and hidden for those nodes... so the animators might have the attribute only available on rig controls which require a acting parent or child...
There cannot be a cycle error when we change the GBL attr cause its available from maya's transform nodes and its not our regular constrain or mel script ...
I know that I am going wrong somewhere, but guys kindly help me in finding out where I might end up in a mess if such a system is available in all trs nodes...!
Regards... sriram
sekops
12-26-2006, 11:11 AM
hibigibees, I think u might be right there when u mean that the developers should do something about this issue. Its not a major one though, and there are many workarounds. BUT it would be handy! :)
I know with xsi, u can animate the pivot point in the properties menu, so its inherit within their package. No offense to u maya, but xsi is intuitive in this respect.
Maybe Maya should have this in their parent constraints in the future version. I was hoping there would be one when you change the node state from 'normal' to 'No Effect' and back to 'Normal', but it stores the world space coords, so it pops when u switch back to normal again. Ah well... MEL scripting to the rescue.
you fellaz are lucky in this respect, there seems to be very little in 3dsmax to aid us on this very problem.
CGTalk Moderation
03-29-2007, 05:44 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.