Fix #2553 : Right click documentation is now only available for Blender 3.3+

Also fix an error in the console when right clicking a button
This commit is contained in:
Gorgious
2022-10-31 08:52:11 +01:00
parent 31600033bf
commit cc056d5d53
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -159,7 +159,8 @@ def register():
bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.PointLight.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
bpy.types.SCENE_PT_unit.append(ui.ifc_units)
bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
if hasattr(bpy.types, "UI_MT_button_context_menu"):
bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
for mod in modules.values():
mod.register()
+6
View File
@@ -386,6 +386,12 @@ class BIM_PT_misc_object(Panel):
def draw_custom_context_menu(self, context):
# https://blender.stackexchange.com/a/275555/86891
if (
not hasattr(context, "button_pointer")
or not hasattr(context, "button_prop")
or not hasattr(context.button_prop, "identifier")
):
return
prop = context.button_pointer
prop_name = context.button_prop.identifier
prop_value = getattr(prop, prop_name, None)