Skip to main content
Harvey Withington
Participating Frequently
February 7, 2023
Open for Voting

Recursive Swap Sets

  • February 7, 2023
  • 2 replies
  • 176 views
At present, Character Animator (v3.4) supports Swap Sets that enable users to select a single layer to be visible within a layer group.

For example, say you want to create multiple pre-drawn facial expressions for your puppet, "Normal" and "Sad". In each expression, you want to be able to change the eyebrows, eyelids and entire mouth swap set.

How would a user achieve this with a simple puppet structure like the following?

+Head
+Eyebrow Left
+Eyebrow Right
Eye Left
Eyelids Left
+Pupil Left
Eyeball Left
Eye Right
Eyelids Right
+Pupil Right
Eyeball Right
Nose
Mouth
Neutral
Smile
Surprised
M
... etc
Face

A user would need to create individual Swap Sets for each facial element that needs to change, as follows:

+Head
+Eyebrow Left
Eyebrow Left Normal
Eyebrow Left Sad
+Eyebrow Right
Eyebrow Right Normal
Eyebrow Right Sad
Eye Left
Eyelids Left
Eyelids Left Normal
Eyelids Left Sad
+Pupil Left
Eyeball Left
Eye Right
Eyelids Right
Eyelids Right Normal
Eyelids Right Sad
+Pupil Right
Eyeball Right
Nose
Mouth
Mouth Swap Set Normal
Neutral Normal
Smile Normal
Surprised Normal
M Normal
... etc
Mouth Swap Set Sad
Neutral Sad
Smile Sad
Surprised Sad
M Sad
... etc
Face

This example shows only 2 facial expressions, but imagine if you wanted a large range of emotional expression. Then add in support for head turns -- the puppet would get overly complex very quickly.

I am currently using this method on a production. For more detailed explanation, you can view my video tutorial here: https://www.youtube.com/watch?v=hEVwz4vpz6o

A better way to do this would be to support the concept of "Recursive" Swap Sets.

These would switch layers throughout an entire layer group tree, not just directly below a single layer group.

This could be used to simplify the above scenario. The user could create a structure as follows:

+Head
Expression Normal
+Eyebrow Left
+Eyebrow Right
Eye Left
Eyelids Left
+Pupil Left
Eyeball Left
Eye Right
Eyelids Right
+Pupil Right
Eyeball Right
Nose
Mouth
Neutral
Smile
Surpised
M
... etc
Face
Expression Sad
+Eyebrow Left
+Eyebrow Right
Eye Left
Eyelids Left
Eye Right
Eyelids Right
Mouth
Neutral
Smile
Surprised
M
... etc

Note that the "Expression Sad" layer group contains several layer group names that exactly match the structure in the "Expression Normal" layer group, but contains only the layers that will alter to create the "Sad" facial expression.

The "+Head" layer group would then be set as a "Recursive Swap Set" and "Expression Normal" set as Default.

When "Expression Sad" is triggered, Character Animator would recursively search through the entire "Expression Sad" layer group tree to replace layers or groups that have matching names with the target layer or group.

After the operation, the end state of the puppet, conceptually, would be:

+Head
Expression Current
+Eyebrow Left Sad
+Eyebrow Right Sad
Eye Left
Eyelids Left Sad
+Pupil Left
Eyeball Left
Eye Right
Eyelids Right Sad
+Pupil Right
Eyeball Right
Nose
Mouth
Neutral Sad
Smile Sad
Surpised Sad
M Sad
... etc
Face

Once the Trigger ends, the puppet would conceptually return to its Default state, which is "Expression Normal".

This would give users a much more convenient way to swap groups of layers for a variety of complex effects.

2 replies

Harvey Withington
Participating Frequently
February 7, 2023
Hey David, thanks for the answer, and for patiently trying to decipher my explanation 🙂

Yes, that's how I'm doing it now, and it works fine. But with a recursive swap set, it would greatly simplify the structure of my puppet.

I didn't realize you could merge swap sets, so I have been dragging individual layer groups into the trigger from the Puppet Panel. Merging might save me some time!

The feature suggestion is more to simplify the organization of the puppet and the reduce the number of rigging steps.

Rather than having multiple layers sets scattered throughout the puppet and repetitively linking them all to one "global" trigger, I could have my alternate layer groups defined at the top level 1-to-1 with the trigger.

So Normal and Angry faces could be defined as a "Face Normal" & "Face Angry", with all the changing elements ("Eyebrow", "Eyelid", "Pupil", etc) contained within. In the current alternative, I need to define "Eyebrow Normal", "Eyebrow Angry", "Eyelid Normal", "Eyelid Angry", "Pupil Normal", "Pupil Angry", "Mouth Group Normal", "Mouth Group Angry" within one "Face" layer group.

When switching from "Normal" face to "Angry" face, only layer groups with matching names would be swapped, with the layer groups that don't match remaining unchanged.

Top down vs bottom up organization. The rigging would be simplified, as would the process of setting up the puppet.
CoSA_DaveS
Adobe Employee
Adobe Employee
February 7, 2023
If I'm understanding your request correctly, you can already do something very similar because each trigger can trigger as many layers as you want, anywhere in the tree. Just drag & drop them on top of the corresponding trigger.

If you already have separate parallel swap sets and you want to "merge" them, you can drag one swap set on top of another. Any triggers with matching names will be automatically merged (i.e. union of all the layers they refer to will all be combined under that trigger).

So one Angry trigger can trigger angry layers throughout the puppet tree. Presumably you'd have a similar set of layers triggered by Happy, etc.. Note that any layer is allowed to be triggered by more than one trigger in a swap set, which is useful if you don't have a custom drawing for, say, an Angry nose, but you do have a Happy nose and want to assign it to Angry too.

Does that solve your problem?