PDA

View Full Version : node trigger?


Andrei2k
11-01-2011, 06:35 AM
I am trying to do two things in a utility node network and I have run into a wall.

The first issue is I am trying to trigger an attribute when a value on another is hit. For example an attr goes oscillated from 0 to 1. When 0 is hit another attribute becomes -1 and when 1 is hit that same attribute goes to 1 until 0 is hit and it switches again...

The second is to create a counter for oscillations. It seems like I have to detect when the change is direction (positive or negative) happens and then do something as a result but Im at a loss on how to detect direction change.

Any ideas?

mlefevre
11-01-2011, 08:24 PM
The first issue is I am trying to trigger an attribute when a value on another is hit. For example an attr goes oscillated from 0 to 1. When 0 is hit another attribute becomes -1 and when 1 is hit that same attribute goes to 1 until 0 is hit and it switches again...

The choice node seems a good way to go, since you're describing a change in integer value.

EDIT***
Nevermind, only works one way. Only half of what you want.

pseudo code:

create a locator
add two attributes, attrA and attrB
connect attrA to conditionNode.firstTerm
set conditionNode.secondTerm to 0
set colourIfTrueR to -1
create choice node
connect choiceNode.selector to attrB
connect conditionNode.outColorR to choiceNode.selector

Andrei2k
11-02-2011, 05:43 PM
Thank you, yes it "hold on to the value" and therefor would not work in this case. I don't think maya has such a trigger or counter to get invoked free of connections. It seems very simple but since my hands seem tied very frusterating.

Buexe
11-02-2011, 09:04 PM
hey Andrei, whaddup? Shouldnt an expression be able to do the job?

Andrei2k
11-16-2011, 08:43 PM
Hi Jan I just saw this sorry about the late reply, yes I did end up using a runtime espression for this. It is still dirty but did the trick. I guess if I really want a trigger node I should write it and hand it to Autodesk...

CGTalk Moderation
11-16-2011, 08:43 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.