Bone rotation off by 180 when sliding male/female, custom sk

Tech support and suggestions forum. If you only have a basic question on how to get started, please use the "newbies" forum in the community section.

Moderator: joepal

Bone rotation off by 180 when sliding male/female, custom sk

Postby nomorecookies » Wed Apr 21, 2021 3:41 am

Hello. I am using a custom skeleton, with custom weights. When I export a generic, meaning no sliders changed except male/female, three of the spine bones are rolled 180 degrees. I mean, when i export a female, the spine bone roll is -90. when i export male it is +90. I know this is somehow related to my custom skeleton becuase it does not seem to happen when using the default skeleton. Any insight is appreciated as i am now blurry eyed and about to throw my computer out the window. This affects three of the spine bones.

Thank you
nomorecookies
 
Posts: 82
Joined: Thu Jul 30, 2020 1:34 pm

Re: Bone rotation off by 180 when sliding male/female, custo

Postby punkduck » Wed Apr 21, 2021 8:39 pm

Hi

Honestly I am not 100% sure but I have an idea: It depends how you created the custom skeleton.

Mostly a rotation plane determines the bone roll.

Example for clavicle:

Code: Select all
 "clavicle.L": {
            "head": "clavicle.L____head",
            "parent": "spine01",
            "reference": null,
            "rotation_plane": "clavicle.L____plane",
            "tail": "clavicle.L____tail"
        },

the plane is defined by 3 values which should form a well-defined triangle.
Do not put them on a line, maybe this is already the reason because you talk about sliders.
Does your triangle flip the direction when you move the slider? So code for a triangle is like this.

Code: Select all
       "clavicle.L____plane": [
            "lowerarm01.L____tail",
            "lowerarm01.L____head",
            "upperarm02.L____head"
        ],


These are three coordinates in 3d. It must be at least one vertex number. If you have more the median is caculated (so here the 8 values of the cube)

Code: Select all
      "lowerarm01.L____head": [
            14038,  14039, 14040,  14041,
            14042,  14043, 14044,  14045
        ],


When you define the 3 values of the plane in a different order the direction of the bone or bone roll might be inverted.
Just an idea ... hard to figure out without additional knowledge.

If you made a spine without the root bone we use or you use a root bone on the ground, you can also use a single vertex on the skin for the triangle. It must not be necessarily be defined by a head or tail of a bone ... afaik.
User avatar
punkduck
 
Posts: 1216
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Bone rotation off by 180 when sliding male/female, custo

Postby nomorecookies » Thu Apr 22, 2021 2:34 am

Due to the fact i had never really had problems, and the export script does not automatically enter the extended plane information, i had always just ripped that section out. :/
I will go ahead and manually enter the plane information.

Thank you for the detailed and informative answer! I'll report how it goes. This is going to take a while :)
nomorecookies
 
Posts: 82
Joined: Thu Jul 30, 2020 1:34 pm

Re: Bone rotation off by 180 when sliding male/female, custo

Postby nomorecookies » Fri Apr 23, 2021 10:43 pm

here is where i am at this point.

Basically, i am renaming the bones that match to UE4 naming so i have an easier time when dealing with Advanced Locomotion System. This all worked fine and is pretty neat. Oh, I also removed all facial bones except jaw, tongue bones, and head. Again, all things working fine. So, due to the spine twist, i followed your suggestion and basically just copied the default plane information, but changed the references to the new names i am using.
Such as
Code: Select all
        "clavicle_l____plane": [
            "lowerarm_l____tail",
            "lowerarm_l____head",
            "upperarm_twist_01_l____head"


This seems to me that it should have worked fine, but I am getting things like the following:

Code: Select all
No plane with name middle_03_r____plane defined for skeleton.
No normal found for bone index_01_l: no reference bones and could not map implicitly by name
Cannot find position for joint joint-pinky_1_l____head


I have quadruple checked everything I know to check, and really think everything should be working, but in the end, i still have the original problem.
When i slide to female, the bone rolls of 3 of the spine bones is 90, while when sliding to male, the same bones are -90.

Thank you
nomorecookies
 
Posts: 82
Joined: Thu Jul 30, 2020 1:34 pm

Re: Bone rotation off by 180 when sliding male/female, custo

Postby nomorecookies » Sat Apr 24, 2021 4:12 am

Ok. The problem seems to be in the way the software relies on the original skeletons naming structure. For example, i could make a new skeleton by Referencing the original and propogating to a 'new' skeleton. But, trying to use the Exporter, even on the default skeleton, just changing the names of the bones causes some references to be lost that somewhere in the software. I have already edited the 'shared_mh_rigging.py' to add the names i changed, but that is only part of the problem. Somewhere within the scripts, it requires the original bone names for full function. I have looked through the various scripts to try to identify where, but I am neither a programmer nor at this point a patient person with this issue. So, i will just use .. I think it was technique 27 :| i came up with to work around it. basically, just rename the bones of my custom skeleton with a script at a later point in my process of getting it into UE4. This means i will have to do this for every character i make instead of it being just a click and go scenario, but atleast it will work.

Thank you

P.S. As this is a just a work around, I continue to appreciate any insights :)
nomorecookies
 
Posts: 82
Joined: Thu Jul 30, 2020 1:34 pm

Re: Bone rotation off by 180 when sliding male/female, custo

Postby punkduck » Sat Apr 24, 2021 9:35 am

The bento skeleton I tried for OpenSim 2 years ago was a try in this direction. Meanwhile I am able to use wings or other stuff by appending parts to the make human base mesh. So a lot is possible.

At least for debugging or testing you can always check how I tried to solve it, because the bento has a lot of bones which cannot end in cubes etc.

My tools on github are designed to support the weights later.

Here is the skeleton:
http://www.makehumancommunity.org/content/bento_alpha_1.html

For rotation planes or head or tail positions: The references must be resolved internally, yes. Rotation planes can be re-used, so it is not an 1:1 mapping. As you can see from my bento version I renamed everything but also used an own syntax like _t instead of __tail ... because the names are a bit longer anyway for the bento ... wonderful ones like "mHandThumb1Left" ;)

I did a lot with the help of scripts. You can still see that on my github page

https://github.com/black-punkduck/MakeHuman-Helpers

E.g. extract_weights was used to extract the weights of the fingers from the .mhw file and renamed it using the transpose file in the data folder. That was all ASCII based to keep some values ... because I did not want to do all weighting again.

but another question:

UE4 is running on my box as well. On my box it works with the normal skeleton but that means to do the animations all from scratch. Since I only tested my characters to figure out if it looks natural, I have more problems when e.g. the character sits (no butt at all :mrgreen: ) or when arms are over or behind the head. This is, because UE uses the same standard technique like Blender in standard mode. So "keep volume" is not available. I use that in blender in combination like mindfront did, so most poses I can do in blender but in UE they look "funny".

Therefore I already thought of a skeleton with extra bones to keep the volume. I also think of double knee joints to get rid of the problem of e.g. weird kneeling positions. On the other side: the more bones, the slower the engine. And extra bones are dependent (they use constraints) so I would need to do the animations the same way. For me it is part of the process, I use the retargeter and correct the animations, I also have a tool which is able to put the motion in place (rotation and translation). So in my case the pipeline would always be MakeHuman => Blender => UE, because blender then will create the constraints by script. I learnt UE can use IK ... so may be sth like that could be implemented as well. Maybe the IK bones could already be generated in MakeHuman, but the logic has to be done in Blender then.

But most people use the mannequin-like skeleton (which can be adjusted I learnt a few weeks ago to get rid of the weird arms because of bone length etc.) because they can easily download hundreds of animations for all purposes. Since this skeleton is not as far away from the game skeleton we have, it should be easier to be solved than my idea of more anatomical correctness.
User avatar
punkduck
 
Posts: 1216
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Bone rotation off by 180 when sliding male/female, custo

Postby nomorecookies » Mon Apr 26, 2021 5:22 am

Just to make sure you know about it, there is a community modified version of UE4 that supports dual quaternion skinning like blenders 'preserve volume'
I have not tried it myself, but others seem to say it works.
https://github.com/AlienRenders/UnrealEngine/tree/4.26-mod

sorry for the short response, only here for a minute today :)
nomorecookies
 
Posts: 82
Joined: Thu Jul 30, 2020 1:34 pm

Re: Bone rotation off by 180 when sliding male/female, custo

Postby punkduck » Mon Apr 26, 2021 9:32 pm

Wow I did not know that tbh. But the problem is that only sometimes this mode makes sense. like for twisting of the arms in ulna region, sometimes not, like in shoulder region. With only "keep volume" my girls mutate into body-builders when they put their arms over the head. So blender uses the skeleton twice in this case depending on a vertex group. Mindfront did a rather good article here in MakeHuman considering this topic:

http://www.makehumancommunity.org/forum/viewtopic.php?f=2&t=15545&start=102

But I will at least look what they do in UE for it. Thanx. In my case I guess I will try a different approach. When a character bends down a "belly" bone can avoid that the stomach disappears. And with a the wiggle plugin in Blender I can add natural behaviour for the beer bellies of the guys (not to reference boobs or butts this time) :mrgreen:
User avatar
punkduck
 
Posts: 1216
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Bone rotation off by 180 when sliding male/female, custo

Postby Ricardo2020 » Tue Apr 27, 2021 1:41 am

Belly and other fat targets for MakeHuman would be nice, along with the "hanger" morphs, which would make BBW and SSBBW models look more realistic when posed.
Paddle faster. I hear charango music!
User avatar
Ricardo2020
 
Posts: 131
Joined: Sat Apr 18, 2020 4:17 pm
Location: Tennessee

Re: Bone rotation off by 180 when sliding male/female, custo

Postby nomorecookies » Fri Apr 30, 2021 10:48 am

I agree about the extra bones. although you could use bone rotation triggered morph targets, i think in the end the morphs would use more resources, and be more complex.

I know what you mean about the preserve volume in Blender, my fairy/elf type character suddenly became a lumberjack :lol:

So many issues, so many projects, so little time :roll:

I will take a look at MindFronts article, thanks!

Back to work i go. Be well
nomorecookies
 
Posts: 82
Joined: Thu Jul 30, 2020 1:34 pm


Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 1 guest