Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You make_annotation break all addpresetbase custom preset operators #57

Open
schroef opened this issue Oct 8, 2024 · 2 comments
Open

Comments

@schroef
Copy link

schroef commented Oct 8, 2024

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
Copy link
Owner

pKrime commented Oct 8, 2024

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
Copy link
Author

schroef commented Oct 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants