pKrime / Expy-Kit

Blending different Character Rigs together
352 stars 32 forks source link

You make_annotation break all addpresetbase custom preset operators #57

Open schroef opened 1 week ago

schroef commented 1 week ago

Had issues suddenly after installing this addon. I took me a while to find the cause. Its this annotation "@make_annotations"

class ExecutePresetArmatureRetarget(ExecutePreset):
    """Apply a Bone Retarget Preset"""
    bl_idname = "object.expy_kit_armature_preset_apply"
    bl_label = "Apply Bone Retarget Preset"
    preset_menu = "VIEW3D_MT_retarget_presets"
    bl_options = {'REGISTER', 'UNDO', 'INTERNAL'}

    filepath = StringProperty(
        subtype='FILE_PATH',
        options={'SKIP_SAVE', 'HIDDEN'},
    )
    menu_idname = StringProperty(
        name="Menu ID Name",
        description="ID name of the menu this was called from",
        options={'SKIP_SAVE', 'HIDDEN'},
    )

    def execute(self, context):
        # passing filepath via the menu, also super uses menu_idname vs preset_menu
        self.menu_idname = self.preset_menu
        preset_class = getattr(bpy.types, self.menu_idname)
        preset_class.filepath = self.filepath
        # in 2.7x there is no callbacks, so we call them manually
        preset_class.reset_cb_va(context)
        _ = super().execute(context)
        preset_class.post_cb_va(context)
        return _

Disabling this addon make them work again When the addon is enabled and i use any addon with custom preset operator, i get this error

WARN (bpy.rna): C:\Users\blender\git\blender-v430\blender.git\source\blender\python\intern\bpy_rna.cc:8733 bpy_class_call: unable to get Python class for RNA struct 'SCRIPT_OT_execute_preset'

Note, this error now shows 4.3 but it actually happened in bl 4.1.1 i tested 4.3 because a developer asked me to test that version; see here; https://projects.blender.org/blender/blender/issues/128721#issuecomment-1313578

pKrime commented 1 week ago

Hi,

that code was changed in commit #d96e0e1 to fix that issue. Both make_annotation and my quickfix are a bit hackish and need to go, but at least Expy Kit should not interfere with the preset system anymore, can you please update and confirm?

regards, p.

schroef commented 1 week ago

I need to check, because I did download 2 versions last week. I think it was a release but also the repo itself.

Edit I see the last relaas is v0.5.2 fro. 2022 where as the repo is at v0.6.1 if 8nrecal correct