Fix: Python error when no active object and hitting F3
Since a3627fe88e Object menu in 3D viewport checks for active_object.type, but if there is no context.active_object it results in annoying python error. This PR checks for active_object before checking type to avoid the error. This won't be necessary once check for legacy GPENCIL is removed. Pull Request: https://projects.blender.org/blender/blender/pulls/121370
This commit is contained in:
parent
570b76f600
commit
38fcaf9ab9
@ -3372,10 +3372,11 @@ class VIEW3D_MT_object_modifiers(Menu):
|
||||
|
||||
layout = self.layout
|
||||
|
||||
if active_object.type in supported_types:
|
||||
layout.menu("OBJECT_MT_modifier_add", text="Add Modifier")
|
||||
elif active_object.type == 'GPENCIL':
|
||||
layout.operator("object.gpencil_modifier_add", text="Add Modifier")
|
||||
if active_object:
|
||||
if active_object.type in supported_types:
|
||||
layout.menu("OBJECT_MT_modifier_add", text="Add Modifier")
|
||||
elif active_object.type == 'GPENCIL':
|
||||
layout.operator("object.gpencil_modifier_add", text="Add Modifier")
|
||||
|
||||
layout.operator("object.modifiers_copy_to_selected", text="Copy Modifiers to Selected Objects")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user