Race changing height and proportions

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

Race changing height and proportions

Postby wezu » Sat Jun 20, 2015 9:05 am

I'm trying to export some characters from MH so that I can use them later in a game engine. I want to use the same skeleton rig for all characters so it is important that things like hands, feet, head and eyes are always in the same spot (imagine what happens when you rotate eyes but center of rotation is not the center of the eyeball).

Unfortunately some of the morphs that I'd like to use (the race sliders) change the height of the character (or it's scale and the length of limbs- can't say for sure). I think the situation still could be saved if I could scale the character to it's previous size with the height slider, alas the slider just doesn't provide enough precision - it's about 170(?) pixels and you can adjust the height about 1(?) meter, that's 0.6(?) cm per pixel of the slide moved (if you can move the slider 1 pixel - I can't). 100% caucasian male is 167.60cm, a 100% african is 174.19cm - the way I see it, no matter how skilled you are with the sliders you just can't make the height match.

I see two solutions:
1. Entry fields - you type in a number, not use a slider to set a value.
2. A "lock size" tick box that would disable the height and proportions sliders and conform the mesh (applying height and proportion morphs) so that the bone structure won't move (much).
wezu
 
Posts: 12
Joined: Sat Jun 20, 2015 8:24 am

Re: Race changing height and proportions

Postby duststorm » Sat Jun 20, 2015 9:47 am

The second option would be harder to do.

If you need precise input you could also use the scripting tool. By using human.setHeight(x) and setting x to whatever value you'd like to use.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Race changing height and proportions

Postby wezu » Sat Jun 20, 2015 1:36 pm

Thanks for the tip.

I'm trying to hack the 7_example.py script to do that, but it ain't working.

gui3d.app.selectedHuman.getHeight() returns a value from 0.0 to 1.0, I suppose it's the height slider value.
I found gui3d.app.selectedHuman.getHeightCm() that returns the value I need, but there is no setHeightCm() function.

I tired this:
1. Save the HeightCm (for example 167.60 )
2. Change the race slider by hand so the new HeightCm is 174.19
3. dividing the old HeightCm by the new value should give me a ratio (167.60/174.19 = 0.9621677479)
4 if I multiply this ratio with the current height (should be still 0.5) I'd get a new height (0.5*0.9621677479=0.481083874)

Check the math - if the height in cm of the model was 174.19 at scale 0.5, then at scale 1.0 it should be 348.38.
348.38 *0.481083874=167.60000002

Of course it's not how things work. The model at 1.0 scale is 246.47 and if I apply my new scale I should get 118.57274242, but the model is actually 172.80cm

I need some tips how to make a setHeightCm() function.


EDIT:

Ok, I've managed to solve this with a Monte-Carlo method (try this way and that until it fits):
Code: Select all
        self.aButton = box.addWidget(gui.Button('Save size'))
        self.bButton = box.addWidget(gui.Button('Load size'))
       
       
        self.stepSize=0.001
        self.height=None
        self.aButtonLabel = box.addWidget(gui.TextView('Save size first!'))

        @self.aButton.mhEvent
        def onClicked(event):
            human = gui3d.app.selectedHuman
            self.height=human.getHeightCm()                             
            self.aButtonLabel.setTextFormat('Saved size %f', self.height)
               
        @self.bButton.mhEvent
        def onClicked(event):
            if self.height:
                human = gui3d.app.selectedHuman
                while human.getHeightCm()>self.height:
                    human.setHeight(human.getHeight()-self.stepSize) 
                while human.getHeightCm()<self.height:
                    human.setHeight(human.getHeight()+self.stepSize)   

It's slow and the result is not 100% ideal. I think it won't work for me, unless there's a way to apply the racial morphs only to the face.
wezu
 
Posts: 12
Joined: Sat Jun 20, 2015 8:24 am

Re: Race changing height and proportions

Postby landiaokafei » Mon Jan 21, 2019 7:10 am

duststorm wrote:The second option would be harder to do.

If you need precise input you could also use the scripting tool. By using human.setHeight(x) and setting x to whatever value you'd like to use.


I had set human.setHeight(x) to be a random number from 0 to 1, but It did not work. is there a sure relationship 0-1 to the cm height?
landiaokafei
 
Posts: 1
Joined: Mon Jan 21, 2019 4:53 am

Re: Race changing height and proportions

Postby Aranuvir » Mon Jan 21, 2019 6:35 pm

I had set human.setHeight(x) to be a random number from 0 to 1, but It did not work.

Perhaps you can be a bit more verbose on your problem.
is there a sure relationship 0-1 to the cm height?

The problem is, that the effective height is at least influenced by the height, the age and the gender slider ...
Aranuvir
 
Posts: 1314
Joined: Sun Oct 12, 2014 2:12 pm

Re: Race changing height and proportions

Postby Cortu » Wed Jan 23, 2019 8:29 pm

I'v done this before. Its kind of involved, but the results are fantastic. Well worth the effort. Id give you the targets I made but unfortunately I reinstalled my os a few days ago. I literally woke up in the middle of the night realizing I had forgotten to backup my Make Human files. I will have to remake them for my own needs, eventually. This thread is pretty old tho, is there still someone who wants this?
Cortu
 
Posts: 14
Joined: Wed Jan 23, 2019 4:21 am

Re: Race changing height and proportions

Postby Cortu » Sun Mar 24, 2019 9:09 pm

I have posted race and gender targets that don't significantly effect the shape of the rig. There may be a some minor problems with clipping the lip, eg food, potions. There all titled Boneless and can be found by searching my asset profile.
http://www.makehumancommunity.org/assets-by-author.html?uid=Cortu
Cortu
 
Posts: 14
Joined: Wed Jan 23, 2019 4:21 am

Re: Race changing height and proportions

Postby jujube » Fri Mar 29, 2019 9:00 pm

Oh!! I have wanted to do this for a long time. Now I can use them to mix and match facial features from the different macros!

edit: In addition to affecting the head and body separately, I love that it keeps the head/jaw/neck the same size, only affecting the features. This is great!
jujube
 
Posts: 404
Joined: Fri Aug 14, 2015 10:46 pm

Re: Race changing height and proportions

Postby Cortu » Mon Apr 01, 2019 8:37 pm

jujube wrote:I love that it keeps the head/jaw/neck the same size, only affecting the features.

Its designed for module video games. You can use the same boots, gloves and hair irrespective of race and gender. Pants and shirts can be the same for all races, but will need a male and female version. Masks can be a bit of a problem as the Africans jaw sticks out quite a bit more then then Asians. The lips can be at sightly different heights, so there may be some minor clipping issues with eating animations.

There were some clipping problems with a Neverwinter Nights "Unlocks hair for all genders" mod that I'v used, so I was particular about making sure the head shape remained unchanged. :)
Cortu
 
Posts: 14
Joined: Wed Jan 23, 2019 4:21 am


Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 1 guest