Maya double3 choice node?

I was just wondering if such a node exists. I’m looking for a node that allows any number of double3 inputs with a selector to choose which input to pass through to the output. The ‘choice’ node does not take double3’s as an input (it does, but scrambles the output; I’m guessing it expects a different type of data as an input).

I am trying to switch between stored offsets for point and orient constraints. The constraint tool I am writing will only allow one driver at a time. Maya stores only one offset value for these constraint types and I am trying to give the animators the ability to switch between multiple drivers and dynamically switch the offset value depending on which constraint target is active.

My idea was to store the offsets on custom attributes on some node and directly plug those into some ‘switcher’ type node that can choose which input to pass through depending on which constraint target weight index is active. I would have an int or enum attr added to the passenger/driven object to select which driver is active which could be keyed by the animator and would be directly connected to the selector of the ‘switcher’ node.

Any thoughts? Am I in custom node territory? Better ideas?
Thanks.

What about the condition node? is that what you mean by the choice node?

Only two inputs on the condition node. The behaviour I’m looking for is like the choice node (‘choice’ is the name of the Maya node); you can add as many inputs as you like. They’ll show up as input[0], input[1], input[2], etc. The selector chooses which input to pass through. I was looking for this behaviour but with the inputs as double3’s.

Just tried it with double 3’s and didn’t have a problem. The trick was connecting it to the double 3 input of the desired output. So innode.translate -> choice.input / choice.output -> outnode.translate. You can’t split it up from there unless you do something else.

Wow, I tried this at work on Friday and it was borked (on CentOS 7.3, Maya 2017U3). You’re right.

I don’t know why the values were all scrambled, but they were. I had the plugs setup as you described. I will have to check again on Monday. Thanks for checking into it.

Solved.

When I plugged the output of the choice node into the .offset plug of an orientConstraint, the values appeared scrambled. This was because the source values were not doubleAngles (they were values coming from a plusMinusAverage node), and Maya did not automatically generate an unitConversion node to convert the values to radians. The offset attribute was displaying/using the radian equivalent of the values I sent it, essentially multiplying them by 57.29578. I manually added a unitConversion with a factor of 0.01745329 to convert my output to radians and now the offset value is correct.

I will be sure to keep my attribute types consistent in the future. This is what dev is all about, right? Engage learning…

1 Like