Incorrect Knee position when Height goes to negative

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

Incorrect Knee position when Height goes to negative

Postby nomorecookies » Mon Apr 05, 2021 11:22 pm

When moving the Height slider to shorten the character, the knee position does not properly adjust. The knee of the Skeleton is substantially different than the Models Kneecap. This ofcourse carries over to any other application you try to use, in my case UE4, making the knee bend at a severly incorrect place. Essentially, accurate posing/use when the slider for height is below middle is not really possible.

ScreenShot33.jpg
Slider Centered

ScreenShot34.jpg
Slider at far left

I will attempt to fix this with a shape key that moves the Joint Cube, but i assume this was just missed and that the team will want to fix this within MakeHuman core itself.

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

Re: Incorrect Knee position when Height goes to negative

Postby nomorecookies » Tue Apr 06, 2021 12:32 am

in the mean time, here is a shape key that will adjust the knee position. You can click back and forth between model and pose/skeleton mode to see where it is while adjusting. Either copy and paste the code provided into a .target file and place it in the Custom folder, or unzip the attached into the Custom folder.

Code: Select all
# This is a target file for MakeHuman , shape key: KneeFixForShortHeight.target. 
# It was written by MakeShapes2, which is a part of the MakeHuman Community addons for Blender.
#
# basemesh hm08
13838 0.3373893737792969 -1.8119056701660157 -0.0
13839 0.3373893737792969 -1.8119056701660157 -0.0
13840 0.3373892784118653 -1.8119056701660157 -0.0
13841 0.3373893737792969 -1.8119056701660157 -0.0
13842 0.3373893737792969 -1.8119056701660157 -0.0
13843 0.3373891830444336 -1.8119056701660157 -0.0
13844 0.3373891830444336 -1.8119056701660157 -0.0
13845 0.3373892784118653 -1.8119056701660157 -0.0
14278 -0.3373893737792969 -1.8119056701660157 -0.0
14279 -0.3373893737792969 -1.8119056701660157 -0.0
14280 -0.3373892784118653 -1.8119056701660157 -0.0
14281 -0.3373893737792969 -1.8119056701660157 -0.0
14282 -0.3373893737792969 -1.8119056701660157 -0.0
14283 -0.3373891830444336 -1.8119056701660157 -0.0
14284 -0.3373891830444336 -1.8119056701660157 -0.0
14285 -0.3373892784118653 -1.8119056701660157 -0.0


KneeFixForShortHeight.zip
(459 Bytes) Downloaded 198 times
nomorecookies
 
Posts: 87
Joined: Thu Jul 30, 2020 1:34 pm

Re: Incorrect Knee position when Height goes to negative

Postby punkduck » Sun Apr 18, 2021 1:40 pm

Hi there,

Okay it is an open issue now: https://github.com/makehumancommunity/makehuman/issues/159

We really need to fix that. Unfortunately it does not only happen in one direction. When loading the targets into maketarget2 with standard base mesh (including helpers) I found out that the cubes for the vertices of the knees are moving completely different/independent compared to the loops of vertices of the skin mesh around .

Unfortunately these are a huge number of wrong targets now and I don't know if they had been generated somewhen. In source mode they are from here:

data/targets/macrodetails/height

and all 144 targets are changing it.

I found out that a lot of files are identical, so I can copy them. But it will take a while ... :roll:
User avatar
punkduck
 
Posts: 1218
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Incorrect Knee position when Height goes to negative

Postby joepal » Sun Apr 18, 2021 3:23 pm

Maybe it'd be possible to script this? I mean, we know the indices of the vertices of the circumference of the knee. Within all reason, the joint cube should move an equal amount up or down as the mean of these vertices.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4474
Joined: Wed Jun 04, 2008 11:20 am

Re: Incorrect Knee position when Height goes to negative

Postby punkduck » Sun Apr 18, 2021 7:27 pm

Well yes. The idea could work.

I should only calculate the new position from 2 or 3 other vertices of one side by "simply" calculating the new position depending to these ones. Other side will be mirrored. Pretty similar to make clothes and using reference vertices on the knee which should differ in x, y and z direction. Maybe I have to do that with barycentric coordinates, but I guess in this case a normal calculation with 2 vertices and ratios in all 3 dimensions could solve the problem as well. :D

Hmm, not this evening but I will try this week.
User avatar
punkduck
 
Posts: 1218
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Incorrect Knee position when Height goes to negative

Postby punkduck » Mon Apr 19, 2021 8:30 pm

Fix is done ...

if we merge the branch new_weighting, then this fix is also included. Do not wonder, most of the files changed, since maketarget uses the shortest possible form to generate values.

And yes I worked with a script but inside make-target.

I used two vectors of the left knee (vertex 11225 and 11261) and calculated the destination position by simply calculating the ratio in x/y/z dimension. Do not wonder Blender Vector does not allow multiplication or division like python native does, so I did the steps for the components. The 8 vertices of the cube are recalculated and in the end the left side was simply mirrored.

Here is the code-snippet:

Code: Select all
def execute(self, context):


        obj = context.active_object
        sks = obj.data.shape_keys
        primtarget = obj.MhPrimaryTargetName
        bt = sks.key_blocks["Basis"]
        pt = sks.key_blocks[primtarget]

        B1 = bt.data[11225].co;
        B2 = bt.data[11261].co;

        P1 = pt.data[11225].co;
        P2 = pt.data[11261].co;

        BD = B2 - B1
        PD = P2 - P1

        Q = Vector ((PD[0] / BD[0], PD[1] / BD[1], PD[2] / BD[2]))
        print (Q)

        for v_num in [13838, 13839, 13840, 13841, 13842, 13843, 13844, 13845]:

            B = bt.data[v_num].co - B1
            E = Vector ((Q[0] * B[0], Q[1] * B[1], Q[2] * B[2]))
            P = E  + P1
            pt.data[v_num].co = P

        (b, name) =  MirrorByTable(obj, pt, "l")
        self.report({'INFO'}, "changed" )
        return {'FINISHED'}
User avatar
punkduck
 
Posts: 1218
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Incorrect Knee position when Height goes to negative

Postby nomorecookies » Tue Apr 20, 2021 8:43 am

You rock! Thank you :D
nomorecookies
 
Posts: 87
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