PDA

View Full Version : How to connect this kind of attributes


JasonJune2009
05-19-2010, 03:56 AM
when I change attribute1,attribute2 changed,
when I change attribute2,attribute1 changed.

attribute1 is always equal to attribute2. and they all are keyable.

animatedfox
05-19-2010, 01:15 PM
You are describing two different kinds of connections in your post;
the first; attribute 1 = attribute 2 AND attribute 2 = attribute 1
This is a kind of loop that maya doesn't like and even if you could set it up, I wouldn't recommend it. Something similar would be to create a third attribute that is equal to attribute 1 + attribute 2 using a plus/minus node. This would let you control one attribute with multiple keyable attributes.

the second attribute you mentioned was a simple direct connection;
attribute 1 = attribute 2 (but only attribute 2 would be keyable as attribute 1 would always be equal)

If I missing what you mean with the exact type of attribute you are looking for, please follow up.
Hopefully we will be able to help.
~Ben

Darksuit
05-19-2010, 02:41 PM
I am going to second this, You really don't want to be setting up cyclical loops like this if it can be avoided.

This really brings the core question of what is the end result that you are actually attempting to achieve.

ie. are you using the attributes to drive something else.
or are you attempting to just get to object to match each other as they move around.

for the second you could set up an expression that checks on every frame to see which object moved then update the object that didn't move. This is a case where the expression is the better way to do something becuase you are looking at something that is outside of an order of operation.

JasonJune2009
05-19-2010, 03:12 PM
just one issue,no second.
maybe I didn't discribe it. now.....
there is ikHandCtrl and fkHandCtrl in the scene , and they all have a attribute "ikfk".
I want ikHandCtrl.ikfk always equal to fkHandCtrl.ikfk. not connect or expression them.
because I want all of them be keyable....
just like the character set...

animatedfox
05-19-2010, 03:31 PM
One common practice for FK/IK switching is to have the switch attribute on a control that isn't one of the hand controls. Here at work, they are on the main shoulder control...the leg switch is on the hip control. This avoids the need for doing some sort of complicated attribute controls. Just a nice straight connection.

I would recommend this rather that trying to problem solve some sort of shared attribute on both the FK and the IK controls.

Hopefully this helps.
~Ben

mlefevre
05-19-2010, 03:55 PM
Add an ikfk attribute to a shape node. Parent shape node to both controls (parent -add -shape). Turn visibility of shape off.

JasonJune2009
05-19-2010, 04:42 PM
One common practice for FK/IK switching is to have the switch attribute on a control that isn't one of the hand controls. Here at work, they are on the main shoulder control...the leg switch is on the hip control. This avoids the need for doing some sort of complicated attribute controls. Just a nice straight connection.

I would recommend this rather that trying to problem solve some sort of shared attribute on both the FK and the IK controls.

Hopefully this helps.
~Ben

;) hha~ nayway , ikfkSwitch is not a frequently-used (http://forums.cgsociety.org/app:ds:frequently-used) attribute. so nothing really matters,

but if it's a frequently-used attribute. everytime I want to change the attribute , I must change selection from handCtrl to ikfkSwitchCtrl , it's boresome.

thank you for your reply.....:)

Darksuit
05-19-2010, 04:50 PM
and if you are looking to do FK IK match, there are some scripts out there for that. ; )



Setting up an FKIK switch attribute is rather trival. I usually set it up for my animators on a control attached to a Wrist joint. You can certain do all sorts of visual things to make the switching look or feel easier. from Shapes that move (and have those control the switch) or do a simple attribute attached to control object. It really is all just a matter of what you want the end result to look or feel like.

JasonJune2009
05-19-2010, 05:15 PM
and if you are looking to do FK IK match, there are some scripts out there for that. ; )



Setting up an FKIK switch attribute is rather trival. I usually set it up for my animators on a control attached to a Wrist joint. You can certain do all sorts of visual things to make the switching look or feel easier. from Shapes that move (and have those control the switch) or do a simple attribute attached to control object. It really is all just a matter of what you want the end result to look or feel like.

yee..Now I am writting a auto rig script....make the curve controls look or feel easier is very important..

gonzalimator
05-20-2010, 01:24 AM
I'm with mlefevre, using a shape node is my preferred method because it always available regardless of which controller you have selected or which mode you are in.

@mlefevre: When I did this, I instance duplicated the shape for as many controls I wished to add the attributes to. Now I know a better way! Thanks! (I'm more animator than rigger)

JasonJune2009
05-20-2010, 02:24 AM
I'm with mlefevre, using a shape node is my preferred method because it always available regardless of which controller you have selected or which mode you are in.

@mlefevre: When I did this, I instance duplicated the shape for as many controls I wished to add the attributes to. Now I know a better way! Thanks! (I'm more animator than rigger)

but using a shape node,when you select the handCtrl, you must expand the shape node, it is collapsing by default. and the animator may don't know there's an attribute in it....

gonzalimator
05-20-2010, 11:49 PM
The way I've done it is to make sure that the last thing you do is add the shape with the attributes to the controller. The last shape is always expanded by default.

JasonJune2009
05-21-2010, 09:44 AM
The way I've done it is to make sure that the last thing you do is add the shape with the attributes to the controller. The last shape is always expanded by default.

I still can't make it be expanded by default...help me..

gonzalimator
05-21-2010, 09:56 PM
Could you post an example and screen shot?

JasonJune2009
05-22-2010, 05:10 AM
Could you post an example and screen shot?

I have worked it out, if a transform node has two shape nodes, the first shape can be expanded...

but can make any shape be expanded by default if you want...

theflash
05-23-2010, 07:26 PM
IKFK is not really something you will switch very often. I personally feel the best way is to have a separate control for that. Not even a shape node, it is not that unlikely to collapse the last shape node. And based on the size of the channel editor it may be not be visible because of scrollbar.

JasonJune2009
05-24-2010, 03:56 AM
IKFK is not really something you will switch very often. I personally feel the best way is to have a separate control for that. Not even a shape node, it is not that unlikely to collapse the last shape node. And based on the size of the channel editor it may be not be visible because of scrollbar.
I think this is not the main issus whether to have a separate conctrol for ikfk switch or not .
in maya2011 ,it collapses the last shape node, not the first node like in maya2009, so I think something must can control it,I don't know.

musi
05-28-2010, 03:13 PM
I think this is not the main issus whether to have a separate conctrol for ikfk switch or not .
in maya2011 ,it collapses the last shape node, not the first node like in maya2009, so I think something must can control it,I don't know.

I would very much like to know that too. I am using an extra shape node to house the ik-fk switch attr, and would like to be able to control which shape is expended. In 2011 - no problem since it's the last one (lowest in the channel box), but in previous versions animators complain about it. And since it is an instanced shape, no matter in which order you have added it the next time you open the scene (or ref it) instanced shapes will be lowest in the channel box - I did use quite a bit of time trying to figure it out...

gonzalimator
05-28-2010, 11:34 PM
in maya2011 ,it collapses the last shape node, not the first node like in maya2009
I'm not getting this behaviour. I was using Maya 8.5 and then jumped to 2011 and I've only experienced the last shape node being expanded behavior. I can't comment on whether the last shape node gets collapsed in 2008, 2009 or 2010.

@musi: Thanks for spending the time to figure that out. I didn't know that instanced shapes drop down to the bottom when referenced or re-opened.

I am an animator by profession and only a rigger by hobby and I never had issues working with rigs using a shape node FKIK switch. The switch was always visible and accessible. Even when there are a few shape nodes above it, like three circle shapes used to make a sphere-like control, it was still visible and available. Now if there are text shapes involved they can get quite numerous and place the instanced node very low in the list causing a problem, but otherwise I don't see any problems with this technique. Maybe someone can explain a more detailed example of when it is a problem.

If there is a way to control which shapes are collapsed I too would like to know, but for now I'm catering to Maya's behaviour of expanding the last shape node in the list.

musi
05-31-2010, 08:29 AM
Maybe someone can explain a more detailed example of when it is a problem.


These are the things my animators complain about:
- shape node is not expended by default
- Dope Sheet doesn't move keys on shape node when transform node keys are moved.
- "s" keyboard key doesn't work on shapes
I found a way to get it working, but I couldn't find a way to reverse to default behavior:
nameCommand -ann "Set key with shape" -c "setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 1" setKeyIncludeShape;
hotkey -keyShortcut "s" -name "setKeyIncludeShape";
hotkey -autoSave true;

gonzalimator
05-31-2010, 11:55 PM
These are the things my animators complain about:
- shape node is not expended by default (I can't reproduce this behaviour, it's always there!)
- Dope Sheet doesn't move keys on shape node when transform node keys are moved.
Got it. It all comes down to convenience and/or workflow. It's convenient to access the FKIK switch regardless of which control you have selected, but it requires a different workflow than what your animators prefer.

In our workflow we used selection buttons on our shelves to do our initial blocking and the shape node for the FKIK switch was part of the selection and was successfully keyed with 's'. It was as simple as adding the name of the shape node to the list of objects in the button's mel. If the shape is explicitly selected then it will be selected and moved correctly within the Dope Sheet. I had a similar problem with a constrained control with multiple constraint weights. When I was editing the timing (in the Dope Sheet) I selected the summary at the top to move a keyframe and I ended up leaving the constraint weights behind, messing up when they were supposed to switch. I added the constraint node to my selection and the weights moved with the summary correctly.

This is what the "Left Arm" selection button code looked like (created by pose2shelf and then modified to select the shape too):
select -cl;
catch (`select -add "Lf_upArm_ctrl"`);
catch (`select -add "Lf_loArm_ctrl"`);
catch (`select -add "Lf_arm_sharedAttrs.FK_IK"`); // the shape node with attribute

If you use the button to select the arm before setting a key or editing in the Dope Sheet it works without issue. If you manually select controls, you have to expand it/them in the outliner portion of the Dope Sheet to edit the shapes' attributes (FKIK attribute). I usually pose a character by selecting (manually) controls and posing, then when I have a pose I like, I press a relevant selection button and press 's'. That's just the workflow that works for me. If your animators don't want to use buttons or don't wish to expand the control to see the shape node, or the shape node never expands automatically in the channel box, then you may be stuck using a separate control to hold your FKIK switch. And the winner of the "Stating the Obvious Award" goes to...... me! I feel like I may be telling you stuff you already know... sorry about that.

musi
06-01-2010, 07:26 AM
Hehe, it's true, it is a matter of convenience :) Often convenience is a very important thing, and animators expect things just to work "as they always worked", missing the whole point of the innovation. Our rigs provide easy accessible and logically organized selection sets, containing all controls of the character. But then again, it requires that working in outliner is a part of animators workflow, same as working with shelf buttons.

CGTalk Moderation
06-01-2010, 07:26 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.