MHX up-date fimction still remain some error

Issue #1105 duplicate
engetudouiti created an issue

I now try to up-date MHX rig scenes, then found new error.. (this scene made last month I suppose)

Traceback (most recent call last):
File "C:\Users\TAKE\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\MHXrts\utils.py", line 195, in execute
self.run(context)
File "C:\Users\TAKE\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\MHXrts\props.py", line 140, in run
setattr(rig, key, value)
TypeError: bpy_struct: item.attr = val: Object.MhaFingerIk_L expected True/False or 0/1, not float

then it do not open mhx panel anymore…

Comments (4)

  1. engetudouiti reporter

    I correct gradually (though I do not know why float value not treat as Bool) anyway, correct like this

    got same error about MhaTongueIk, so I changed it too.

    props.py line 125 class MHX_OT_UpdateMhx(MhxOperator):

    it seems work though hope you confirm.

    class MHX_OT_UpdateMhx(MhxOperator):
        bl_idname = "mhx.update_mhx"
        bl_label = "Update MHX"
        bl_options = {'UNDO'}
    
        def run(self, context):
            rig = context.object
            for key in list(rig.data.keys()):
                if key[0:3] == "Mha" and hasattr(rig, key):
                    value = rig.data[key]
                    if key.startswith("MhaElbowParent") and isinstance(value, int):
                        value = {0: 'HAND', 1: 'SHOULDER', 2: 'MASTER'}[value]
                    elif key.startswith("MhaKneeParent") and isinstance(value, int):
                        value = {0: 'FOOT', 1: 'HIP', 2: 'MASTER'}[value]
                    elif key.startswith("MhaFingerIk") and isinstance(value, float):
                        value = bool(value)
                    elif key.startswith("MhaTongueIk") and isinstance(value, float):
                        value = bool(value)
                    print("FIX", key, value)
                    setattr(rig, key, value)
                    del rig.data[key]
    

  2. engetudouiti reporter

    And as I said, actually there seems quite a few scene, which actually need to change edit_bone Connected as False.

    For my purpose I simply make script, but I feel you may better to add it in your up-date Function.

    above error scene actually needed to un-connected (hand, hand.fk foot, foot.fk) from parent bone.

    Then it seems work, but when I try to snap FK<>IK keep stretch effect, it actually snap, but sometimes remain un-necessary off-set, and it make difficult to remove it .

    Though I understand when this problem may happen, but stretch option need to use carefully, or if there remain problem which not up-date correctly, I do not know.

  3. engetudouiti reporter

    I merge this issue to 1110 MHX stretch up-date issue, because it is about same functions. /generate MHX or update MHX

  4. Log in to comment