PDA

View Full Version : Circular Dependency


rafoarc
11-10-2010, 05:56 PM
Hello all... I have a question, that might be stupid, but it kind of drives me crazy...
I am trying to assign a veeery simple expression that will control the z rotation of an object depending on the distance that it has to a point. I assign a float expression and I create two vector variables, one for the poistion of my object, one for the position of the point. Lets say that the expression is as simple as 'length(objPos - Point1Pos)'. Now, when I use 'assign to controller' to assign the position of my object to the objPos variable I get a circular dependency error! Same thing if I try to use a float script instead. The annoying part is that i've done this several times before without any problem, and with much more complex expressions and float scripts. I even open older files where i have the position of an object as part of an expression that controls an other property of the same object and everything works fine. But I just can not create a new vector variable referencing the position of the same object.....
I am using max 2010 x64.... any ideas????
Thanks...

lo
11-10-2010, 07:25 PM
How do you imagine this working at all, logically? Think about it... you want to control the position of an object, based on its position. That sounds like a logical impossibility to me, therefore a dependency loop.

rafoarc
11-10-2010, 07:38 PM
hi lo, thanks for the answer.
No, actually I do not want to control the position of an object based on its position. I want to control the rotation of an object (around the z....) based on its position. I might be missing something obvious, but it sounds totally logical to me: the position is unaffected, but the object rotates around that stable position. Rotation and position are two different properties, aren't they?

JHN
11-10-2010, 08:26 PM
Use a script controller and "assign to controller", that should work,

-Johan

lo
11-10-2010, 08:29 PM
I apologize, I read your first post too fast.

rafoarc
11-10-2010, 09:20 PM
no worries...
Johan, script controller doesn't give circular dependency. however, if i try distance pointPos boxPos I get "no 'distance' function for Controller:Position_XYZ. I guess $Box01.pos.controller is not a point3. How do I get the position out of the controller? Using the Assign Node worked better, since I am able to use distance boxPos.pos pointPos.pos . Assign Target gives a circular dependency error too.
Now, with expressions the only way I managed to get around it was to make the box a character and then use the characters' position to define the rotation of the box. I am not sure I understand why thought...
I guess that I should go with assign node option...

thanks guys.
dim

lo
11-11-2010, 06:28 AM
$Box01.pos.controller is not a point3, however $Box01.pos.controller.value is, maybe you should try that.

JHN
11-11-2010, 08:20 AM
What Lo said! Every controller has a .value property, that should be used for further processing,

-johan

CGTalk Moderation
11-11-2010, 08:20 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.