mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
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:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user