PDA

View Full Version : Connecting 2 attr. without locking 1....


Ivars
11-17-2004, 04:33 PM
Hi.

I have 2 attributes with a value from 0-1 that I want to connect. But if I use the connection editor, that will lock one of my attributes. Making one attribute the controller of the other. I want them to be connected to each other, so that they will always have the same value, but I want to be able to change any wich one of them, and get the other to follow..... I am having a bit of a problem explaining this.....

Is there a way to do that?

All help is much welcome!

failure
11-17-2004, 04:53 PM
What's the point of controlling one value from two places?

GennadiyKorol
11-17-2004, 06:56 PM
You can try connecting those outputs to some math node like PlusMinusAverage or Multiply, and output of that node to the input attribute. Or use some switch nodes with animation curves, depending on how you want the control attributes to affect connected one.

LuWeeWu
11-17-2004, 06:57 PM
Do the 2 attributes alawys have the same value? I they do than I would just set driven key one to the other and use the one to control the value of both, but if at eny point the values need to be different than I would just key them seperatly and not worry about trying to link them. You have run across one of the many scenarios where maya can't do what you have in mind. Its kinda like objectA pulls objectB and objectB pushes objectA. Now in order for either to move you must keyframe one of them. If I move objectA forward 1 than its going to pull objectB forward1 also, but because objectB has ben pulled forward 1 than it will also push objectA forward another 1 making objectsA move 2 rather than the 1 you keyframed it, So now it pulls objectB 2 wich pushes objectA 2 plus the 1 keyframe making it 3 and so on and so forth... The same can be said for numerical values. A value cant control the value that is controling it. It a paradox. The work around is IK and FK but im not shure what the equivalent would be for attribue values like your talkin about.

My advice would be keep it simple.

lostpencil
11-17-2004, 07:22 PM
Yep, I don't think you can do that, although you can do this with a slider, for example. You can attach the slider to an attribute and if you modify one or the other then they both change.

_vine_
11-17-2004, 09:28 PM
I agree with what Lostpencil says.

I think you'll need a third attribute or control of some sort that will drive the two together.

The other ways I can think of directly linking the two will cause you to get double transformations.

MikeRhone
11-18-2004, 12:07 AM
This is something you unfortunately can't do in Maya. Maya calculates the DG in one direction only, so you can't have a 2-way street connection like you are looking for.

steveblake
11-18-2004, 01:28 AM
hmm... wonder if Do Hyun Lee's 'Bidirectional contraint' (http://www.oorido.com/maya.html#Bidirectonal)* could be rigged to help you here?

check out his movie (http://www.oorido.com/maya/demo_biConstrain.avi) (6mb) explaing the process..

QUOTE:
"Maya's structure doesn't allow mutual constraints and it is one of Maya's most critical defects. I solved this problem by using some tricks( I would say it's a half-constrain.) without violating the original structure.
This can be used in many ways such as simulations, character rigging and pose based animations."

:)

*I've been meaning to use this one, be interested to hear if anyone finds it useful...

Ivars
11-18-2004, 07:44 AM
Yes I know about the limitations in constraining/connecting, so I was looking for another way to solve it. Bit I guess I´ll just have to go back and create the whole thing in a different way :)

I was thinking maybe it can be done with a scriptjob, where the value is transfered between the two attributes on attribute change... (what do you think? Could it be done?) I´ll try it anyway :)

steveblake: That looks really intresting, maybe not for what I´m trying to achive here, but for so many other things! Thank you. (edit: is that a free plug-in? If it is, where can I get it? Couldn´t find any download link on the site....)

Ivars
11-18-2004, 08:35 AM
Wohoo, it didn´t work. What a surprise :p I got a infinite loop...
any ideas?

global proc swtch2fk()
{
float $fk = `getAttr ik_hand1.Switch_to_FK`;
setAttr fk_hand1.Switch_to_IK $fk;
}
global proc swtch2ik()
{
float $ik = `getAttr fk_hand1.Switch_to_IK`;
setAttr ik_hand1.Switch_to_FK $ik;
}
scriptJob -cu 1 -attributeChange ik_hand1.Switch_to_FK "swtch2fk();" -kws;
scriptJob -cu 1 -attributeChange fk_hand1.Switch_to_IK "swtch2ik();" -kws;

I know there must be a so much better way of doing what I´m trying to do... So I´m just gonna leave it now, I thinl :)

steveblake
11-18-2004, 08:50 AM
uh.. sorry, thought it must be available on his site somehere.
Still, I've found it on highend (http://www.highend3d.com/maya/plugins/?group=mayaplugins&section=animation) and yup...It *is* free (I think)

- not tried it yet, it does look interesting tho doesn't it?

good luck!

;)

[EDIT: doh ! - just read here (http://www.deathfall.com/article.php?sid=3475) that these plugins don't load properly...:shrug: )

galactor
11-18-2004, 09:38 AM
Wel Maya is able to do so. Take a look at the following camera attributes:
Field Of View
Focal Length

Offcourse a big change this is API stuff. But maybe it is not.
I don't have time took take a closer look, so check it out.

:: Galactor ::

CGTalk Moderation
01-19-2006, 09:00 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.