Search Unity

Question Copy "Rig 1" to other character

Discussion in 'Animation Rigging' started by PeteSmalls, Feb 4, 2023.

  1. PeteSmalls

    PeteSmalls

    Joined:
    Apr 29, 2020
    Posts:
    11
    TL DR;
    * Can you copy the Animation Rigging "Rig 1" (and all of its functionality) from one character to another character with exactly the same bone naming?
    and/or
    * Is there some "Basic Rig 1" IK humanoid setup that does not require so much manual (and one off) and instantly works when you import a humanoid character?

    ==============
    Hello,

    I have several characters all from the same original creation app (DAZ) so their RIG (Skeleton) was created the same way and all have the same naming to the same bones.

    I import these into Unity and set them up as a Humanoid and an AVATAR is created.
    Now the character has a RIG and an AVATAR
    I test the muscles and bones in the tab - it moves as expected.
    I add a humanoid animation and all is good... it works.

    Now I want to move my character and find I need to create a SECOND RIG for Unity.
    It seems the actual RIG is not what unity considers a rig and the AVATAR is (well) nothing - so I add Animation Rigging and go through the manual process of adding a UNITY RIG by doing the following:
    - Add "Rig 1" to the character with "Rig Setup" in the animation rigging menu item
    - Add an "empty child object" to that rig called "LeftHand"
    - Add the "Two Bone IK Constraint" to the child object
    - Link the actual RIG bone of the Left Hand (l_hand) to the "Tip"
    - Select "Auto Setup from Tip Transformation" from the constraint component.
    And now the left hand allows me to adjust it in runtime
    HOORAY!

    OH.... but that is just ONE bone.
    Now I have to do that manual process for all the parts I want to control (which is at the least: both feet, both knees, both hands, both elbows, both shoulders, hip, chest, neck, head = 14 empty child objects mapped)
    Very manual for something that was basically already done with the actual RIG... but fine.
    I now have this "UNITY RIG" (Rig 1) connected to the actual RIG (From DAZ) for the parts that are needed for the character.
    HOORAY!

    OH... but that is just ONE character.
    I need to do this for many more characters and perhaps import others in the future.

    So here I am... This can't possibly be the way......

    THE QUESTIONS
    - Is there a way to copy "Rig 1" to another character when the naming of the bone relationship within the character is exactly the same?
    When I quickly test this - it appears the component gets "hard-wired" to the character I created it with and not to the character the "Rig 1" object is a child of.
    Meaning... My "Rig 1" "Left hand" in character 2 is still controlling the left hand of character 1 even though it is a child of character 2. Non-sensical.

    - More importantly... Is this really the way we need to do this?
    Seems like I'm missing something so basic and I'm just being stupid (please someone tell me this is the case.)
    I mean - 90% of all humanoid characters will need the same basic rig controls to work with a character.
    Is there an IK rig already set up someplace that gets added to every humanoid character automatically and I just don't see it?
    I mean... before adding the "animation rig" "Rig 1" --> Unity already knew how to control that character.
    It knew the bone alignments.
    It was all testable by selecting the character, going to "select" in the inspector, clicking "Rig" then "Configure" then "Muscles & Settings" and moving the sliders to see the character working in the bone rig constraints it was imported with. If it already knows that, why did I have to go through this other manual "one-off" process?
    What am I missing?

    - Overall
    RIG (bones from an imported character already weighted) Great! Why ignored?
    AVATAR (random humanoid information) for what? All the info is there, why is this ignored?
    UNITY RIG (Rig 1) WHY?! (See "RIG")


    Thanks for any and all insight!
    P.
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    We're gonna assume you're talking about humanoids.

    The "avatar" is a mapping of bone names to an internal standard convention that a third-party Mixamo invented. So animations can drive bones based on their anatomical purpose, instead of their specific bone names. Thus you can transfer animations with wildly different bone names or even their axis conventions. One designer might name their bones in Spanish and come from a tool using +X as the bone axis, another designer might name their bones in Latin and use -Z as the bone axis. The avatar empowers the translations so the same animation works for both.

    Most tools like Blender or Maya will have a set of bones for the deformations, and also a completely different set of bones for the IK and other constraints, which are the "rigging." Think of it like the rigging of a crane or a marionette. The cables overhead are pulling on the bones, but are not part of the puppet below. These rigging bones are stripped and ignored once you have animated the deformation bones. They serve almost no purpose in stock Unity. Unity wants the positions of the actual deformation bones, not the rigging that is Blender-specific or Maya-specific. I know from Blender experience that you can't just transfer a rig armature from one character to another, because all of the lengths and orientations of bones are ridiculously important to match perfectly. However, the Blender tool called Rigify makes it quite easy to develop a new rig armature from scratch with just a few clicks, so it's not that burdensome.

    There ARE third-party tools that let you do a ton of different IK things inside Unity, without relying on any Blender or Maya rigging at all. Some are for procedural IK solutions like Root Motion's FinalIK. Some are for editing or fine-tuning animations using IK constraints, basically adding rigging inside Unity, like Soxware's UMotion Pro. There are smaller and simpler solutions as well, if you just need to manage a subset of those features like wagging a tail or body fat physics, or interacting with handheld objects or uneven terrain with simplified IK.
     
    PeteSmalls likes this.
  3. PeteSmalls

    PeteSmalls

    Joined:
    Apr 29, 2020
    Posts:
    11
    @halley Thank you SO much for the insight and the amazingly timely response!
    Yep - this is all about humanoids.
    From your great explanation - I can totally ignore Avatars for my use case.
    That is a shame because the functionality is there as evidenced by the tab that let’s you test the avatar - I guess you can’t add effectors to avatars to move the parts and I guess IK is not understood by avatars (just movement ranges.)

    So rigs…
    It does seem like there is redundancy in Unity that tools like Blender and DAZ don’t have / need. In your perfect example (I almost used Rigify instead of DAZ in mine as well) - rigs are “one click”, those rigs are added to the character (and imported into Unity). IK in those tools work perfectly with that one rig but it appears the rigify rig in Unity is essentially ignored until you manually add an “animation rigging” rig on top of the rigify rig.
    That is my confusion.

    Seeing FinalIK - It looks like I can get a “one click” rig added on top of the other rig - which is better than manually adding a ton of empty child objects - but I don’t need all that other functionality.

    The basic Animation Rigging functionality would be fine - if it were not so manual to setup and possible to add the structure to other humanoids.

    Ideally unity would understand the bones imported with the humanoid as a rig and act accordingly. I understand the variable in naming issues but it would be possible to create templates to handle the naming structures of a few big players (Rigify, DAZ, Maya, AccuRig) that should get us 70% of the way there and save a TON of repetitive tasks for creators.
    But even without that…
    If I could create one Animation Rigging “Rig 1” template and add it to any character with the same original rig creator - that would be Huge. E.g. from my example above…The “Left Hand” child object of “Rig 1” would attach to “l_hand” of any hierarchy “Rig 1” is a child of. That would be a great time saver since every one of the characters I’m working with has the exact bone “l_hand” and the every one of them have the same connections.

    Is that possible?
     
  4. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,433
    The thing is, the inside-Unity rigging options I discussed do not create additional bones, do not need you to create additional bones, and do not want all those non-deform bones from your other rigs that you may have created in other tools. They work with JUST the deform bone hierarchy that you give it, and any rigging data they have is transient and not part of the Unity skeleton. In UMotion, for example, I can see there are two copies of the skeleton, the original one for the character deformation and a new phantom one for the IK, but I did not need to create the IK stuff and the IK stuff isn't even saved with my scene or game, it's just an artificial transient copy while I am using the UMotion tool.

    And again, the whole point of the Unity / Mixamo stuff is to allow you to share animations. If you have two characters Alice and Bob, they can both use the "person-bends-over-and-picks-up-something.anim" animation asset. Even if you modeled that animation in another tool for Alice specifically, you can use it on Bob with no changes to Alice or Bob assets. You don't have to duplicate the work for Alice, and then Bob. So perhaps your worry about saving time with similar characters is misplaced.
     
  5. PeteSmalls

    PeteSmalls

    Joined:
    Apr 29, 2020
    Posts:
    11
    Yep. I totally get it.
    This is very helpful!

    The bone weighting stuff unique to skeleton rigs of the imported characters make sense to me.
    Great to know.

    Reusing animations and the Avatar stuff now all makes sense.

    The thing is-> I am not interested in animation or Mixamo at all.
    We can forget all of that.

    I am interested only in IK positioning at runtime.

    The bone and marionette example you provided above is perfect and I understand it.
    It seems like setting up "Animation Rigging" is the way to go.
    In fact when I set this up (manually) it is giving me the experience I want, So it works.
    But it is VERY manual per character.

    I want to create a set of standard strings (Rig 1) and duplicate it to other characters without having to go through the manual process of setting up Rig 1 and linking empty child objects for each character.

    From what I see "Rig 1" just needs to know that child object "Left Hand" connects to bone "l_hand" for whatever character it is a child of (in the example - tie the left hand string to the left hand) but this does not seem to be the case.
    When I duplicate a "Rig 1" to another character - it does not retie the strings to the new character... the string stays connected to the old character meaning every string needs to be manually retied for every character.

    Is there a way to create a set of marionette strings "Rig 1" that can be quickly applied to any characters I want to control that way?