Answered

I am trying to add the guitar in the prefab so it moves with the upper part of body.

Anonymous 4 years ago updated by Peter - Soxware Developer 4 years ago 9

I am trying to add the guitar in the prefab so it moves with the upper part of body. I am not really sure where to put it, and I got the message that there are no mesh assigned, so not allowed to use the prefab.Whai is the right way to do it ?

Youtube video
UMotion Version:
Unity Version:

Answer

Answer
Answered

Hi,

thank you very much for your support request.


A UMotion project always remembers the hierarchy of your game objects. In order to change the hierarchy either create a new UMotion project (that's the simple way) or if you want to keep using the current UMotion project do the following:

  1. Click on "Clear" in the Pose Editor so that the object is not assigned to it anymore.
  2. Drag and drop the guitar to the new position in the hierarchy. If you want that it moves with the upper body, make the guitar a child of one of the spine bones for example. In case your game object is a prefab, you need to do this change inside the prefab (editor).
  3. The following applies only to your current situation: From the warnings you get in the video, there is at least one GameObject named "Guitar" that has no mesh assigned to the skinned mesh renderer component. Remove that one from the hierarchy. There should be only one "Guitar" in it. You can use the search bar of Unity's hierarchy window to easily find it.
  4. Re-assign the character to the pose editor. Confirm the appearing dialog.
  5. Switch into config mode and click on the "Cleanup" button. This removes the old entries of the Guitar (where it was still on the old position in the hierarchy).

If you have any further questions, please let me know.

Best regards,
Peter

Answer
Answered

Hi,

thank you very much for your support request.


A UMotion project always remembers the hierarchy of your game objects. In order to change the hierarchy either create a new UMotion project (that's the simple way) or if you want to keep using the current UMotion project do the following:

  1. Click on "Clear" in the Pose Editor so that the object is not assigned to it anymore.
  2. Drag and drop the guitar to the new position in the hierarchy. If you want that it moves with the upper body, make the guitar a child of one of the spine bones for example. In case your game object is a prefab, you need to do this change inside the prefab (editor).
  3. The following applies only to your current situation: From the warnings you get in the video, there is at least one GameObject named "Guitar" that has no mesh assigned to the skinned mesh renderer component. Remove that one from the hierarchy. There should be only one "Guitar" in it. You can use the search bar of Unity's hierarchy window to easily find it.
  4. Re-assign the character to the pose editor. Confirm the appearing dialog.
  5. Switch into config mode and click on the "Cleanup" button. This removes the old entries of the Guitar (where it was still on the old position in the hierarchy).

If you have any further questions, please let me know.

Best regards,
Peter

Now it works ok. But now I have another problem. Is there a way to pin IK to prefabs ? When I move the body and guitar, the hands are at the IK pins in world space. Maybe I shold have unpin the IK hands ? 

Yes this is possible using the child-of constraint in its "regular" mode (instead of the IK pinning mode) in which you can define any arbitrary parent (in your case, the guitar). Here is how to set this up:


  1. Switch into config mode
  2. Select the IK handel(s)
  3. Open the constraints tab and scroll to the child-of constraint
  4. Remove the checkmark from the "IK Pinning Mode"
  5. Switch back to pose mode
  6. Select the IK handle(s)
  7. In the channels view, select the guitar for the parent channel

More information about the child-of constraint and the IK pinning mode can be found in the related video tutorials.


Let me know in case you have any follow-up questions.

Best regards,
Peter

Worked ok on left hand, but when I do it on the right hand something ended wrong. Video soon ready: 

Parenting means that all position/rotation values are now saved in local space of the guitar (i.e. the position/rotation is relative to the guitar). So if there would not be any other existing key frames for your hand, your hand would just move with the guitar keeping the fixed offset that the hand had at the first frame (where you parented it).


When you have existing (world space) keys for your hand and you change the parenting on the first frame, UMotion is going to ask you if it should convert the existing keys into local space (relative to the guitar). When it does this conversion, it goes through every key that your hand has and calculates its offset to the current (i.e. the first in your case) frame's guitar position/rotation.

If you think about the math, that won't mean that the hand waving motion will automatically target the strings. UMotion can't figure that out on its own. You are going to have to manually adjust your hand (e.g. by adding small corrections via an additive animation layer) to keep the hand approximately at the right spot.

Best regards,
Peter

What am i doing wrong when I get this message after I do what you write ? 

You changed something in your current pose, but haven't created key frames for it. As soon as you then want to move the frame cursor, UMotion asks you if you want to keep those changes for the new frame or if you want to reset the changes. Use "Key Selected" to save your changes to the animation or set "Auto Key" to "Generate" to automatically save any changes you make as keys to your animation clip.

Best regards,
Peter

What am I doing wrong when the pose change ? 

Config mode always samples the "reference pose". The reference pose is the pose your character had when you assigned it to your UMotion project for the first time. Usually it's a good idea to have a T-stance as reference pose (but it's not a requirement). The "reference pose" is independent of your current pose in the animation clip you are currently working on (in pose mode).

This is an in-depth video tutorial about config mode (it also covers the reference pose at around 03:00):

Best regards,
Peter