Connect attr value with two output for different states


#1

Hi everyone. As a junior rigger / animator I am currently working on a facial rig and faced a probably basic issue but cannot find the answer on the internet so here I am.

I am working on the eyelids and used a script to earn time and have a nice blink for the eyes, the blink was input in an attr “blink”, but then I’ve been working on the inverse opening of the eyelids, that a first input in a second attr “open eyelids”.

Then I found it was stupid to have them on separated attr, so I’m basically trying to simply have only one attr “eyelids” based on 3 values (0 - 1 - 2) where 1 would be the basic eyelid position, 0 the blink and 2 the opening of the eyelid.

I succeeded doing so with the Condition node, but realized that it was a boolean switch, what I need is the right utility node to progressively open or close my eyelids, if anyone have the answer.

Here is a picture of my actual node editor.


#2

Still struggling … Anyone ?

I tried to play with the setRange and remapValue utilities but I couldn’t find much information on the internet as they seem to be mostly use for other purpose.

I’m still experimenting, but I wish I could quickly get rid of this basic problem and move on to the next steps of my work.

As a reminder, I simply want my eyelids to float to a neutral position on a 0 / 1 value, very open position on a 1 / 2 value, and blink position on a -1 / 0 value. ( 0 / 1 / 2) range or ( -1 / 0 / 1 ) range.

I guess it could be compared with having 3 different blendshapes and switch from one to another using my attribute value, but I couldn’t find much answer on the internet about it either.

Could there be a float condition node ?

Thank you in advance


#3

Well, I finally found the long version solution ! So in case someone would have the same issue, here is my final node editor set up to control blink and opening of the up and low eyelids with a 0 / 1 / 2 range.

As you can see I left the 4 attributes I first made and connected my main attributes to them through several math manipulations. Then I hid them in the channel box to control them with the main attributes only (Eyelid Up and Eyelid Low).

I just wish there was a float condition utility to reduce the number of nodes for this pretty basic trick and even though I found out there actually was a float condition node in Maya 2020, I couldn’t find any informations about how it work while it didn’t have the same parameters as the original condition node, I guess it doesn’t have the same function.

Here is how it looks like if anyone wants to add information about it.