animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.83k stars 315 forks source link

Pose bug when IK Kinematics choosed, and its commit. #222

Closed TetoTheSquirrelFox closed 4 years ago

TetoTheSquirrelFox commented 4 years ago

Describe the bug When user wants to use IK kinematics, the poses don't work properly after character creation. The case is expected but doesn't work properly, user should not be able to choose a pose, and he can actually. With MB-Lab-dev version at least.

Where is the problem + Screenshot The guilty is function is_"ik_armature(armature=None)" in utils.py. image We can see that if armature != None, function always return false...

Commit by a screenshot image

Commit in code def is_ik_armature(armature=None): if not armature: armature = get_active_armature() if armature and armature.type == 'ARMATURE': for b in armature.data.bones: if 'IK' in b.name: return True elif armature and armature.type != 'ARMATURE': logger.warning("Cannot get the bones because the obj is not an armature") return False return False

See ya' ^^ (by the way, if someone can explain to me how to format correctly a code to allow it to be copy/pasted directly... On to pull requests maybe? I really don't know how to do that)

ldo commented 4 years ago

Unfortunately, your posted code is corrupted by the loss of indentation. Try posting a patch as an attachment, or using Markdown formatting.

TetoTheSquirrelFox commented 4 years ago

Let's try... edit : much better... thanks for the help !


def is_ik_armature(armature=None):
    if not armature:
        armature = get_active_armature()
    if armature and armature.type == 'ARMATURE':
        for b in armature.data.bones:
            if 'IK' in b.name:
                return True
    elif armature and armature.type != 'ARMATURE':
        logger.warning("Cannot get the bones because the obj is not an armature")
        return False
    return False
animate1978 commented 4 years ago

Wow. So simple it hurts lol.

I just changed this on my local system, will be committing this change to the repo soon.