[Maya] Complex visibility switch

Hello!

I need Visibility Switch Attribute to dictate which set of controllers is visible.

I’m working on one big rig with the option of referring models. Something like: one character with several variations in appearance. This makes the rig look like a Christmas tree, because it has a multitude of controllers and each new variation requires creating additional ones.

The problem is that I don’t have a function that would turn controllers visibility off and on at any given time. A basic variation doesn’t need as many controllers as an expanded variation No. 02. What’s worse, many controllers are needed constantly, and some are needed only for one skin.

I searched the Internet and unfortunately did not find a solution to my problem. The closest thing to a solution was these diagrams:

and
https://imgur.com/a/H9YnP

However, they are too undeveloped to be used in my case. I was thinking of adding an extra compound attribute and creating some kind of connection with the controller and if the arguments are correct then it is visible.

Do you have any ideas how to construct such a thing?

Do I understand correctly that you want an attribute on a controller to dictate which set of models is visible?

No. I’m sorry if I didn’t explain myself clearly.

I need Visibility Switch Attribute to dictate which set of controllers is visible.

hmmm. Maybe look into scriptjob or expression?

I’m sorry for this terrible drawing. I’m at a computer with no decent graphics program!

You could do something like this. I hope it isn’t too convoluted:

  1. Create a main switch node, with an integer value for each visibility Variation.
  2. For each Variation, create a transform with a list of booleans for each piece of geometry. That list of booleans would describe the state of visibilities for that Variation. That would make it easy to manage from one node, later after all this is hooked up. 10 Variations = 10 transforms. 30 pieces of geo = 30 boolean attributes on each transform.
  3. For each geometry, make a plusMinusAverage node. Set it to addition. For each visibility Variation, connect your booleans to the plusMinusAverage inputX. 10 Variations = 10 inputs into each plusMinusAverage. 30 pieces of geo = 30 plusMinusAverage nodes. Variation 0 would connect to inputX[0]. Variation 4 would connect to inputX[4] and so on.
  4. For each visibility Variation, add a condition node that turns OFF that input in the plusMinusAverage. So For Variation 0, if the main switch is 0, then for each plusMinusAverage.inputX[0] would be True and on. For Variation 8, each plusMinusAverage.inputX[8] would be turned on. Otherwise, the condition would be false, and you’d cancel out the input.

  • When the main switch is set to 4, for example, then every other column will be switched off. And you’ll only add the values from the 4th column. 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 = 1.
  • If you’re in a Variation where the boolean says the geometry is hidden, they will all be zero, and then the column that is one will also be zero. 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 0.
  • After this is all hooked up, you can edit the visibility values by just changing the booleans on the transform that has the list of booleans. It’s like a Variation definition.
  • Each row is a single plusMinusAverage node, with an index for each piece of geometry.

image

2 Likes

Another thing you could consider is storing visibility swaps as a pose library, using a tool like Studio Library.

I spent good couple days trying to create such a setup. I got stuck in building it. In general, visibility of geo will be sorted by referencing models. The most important issue is with visibility of CTRLS. I tried to adjust your solution to what I need but I’m not as skillful to make robust changes to your method. However, I’ll look for solution in Studio Library. I presume it is going to keyframe visiblity switches for me in a pose.

Have you tried using a set driven key ?
You can have multiple combinations of visible objects based on 1 switch attribute, you could also get into a more complex solutions using nested curveNodes (one piping into the next and so on).
Given that you are using curve nodes you could create infinite combination of 0-1 on the curve per control visibility then decide how you want to trigger those “frames”.

My animators are using animschool picker and I think, I just add hardcoded buttons for visibility switch.commands