diff options
author | Diptangshu Dey <Tha_Hobbist> | 2021-11-16 12:45:23 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-11-16 12:45:23 +0300 |
commit | da14a482f281e8d330ef5210ef22335a43eb726c (patch) | |
tree | cf13d60ef5ebb9fec81c02f54a427194c03e23b7 /release/scripts/templates_py/operator_mesh_uv.py | |
parent | 7d985d6b69703d7eb515c776dd5911443cde59d3 (diff) |
Fix T90866: Python operator templates are not accessible from menus
Python Operator templates made accessible from respective menus
(required to also use F3 search for quick access)
Also fixed Modal Draw Operator id_name (had duplicate name from other template)
Maniphest Tasks: T90866
Differential Revision: https://developer.blender.org/D13182
Diffstat (limited to 'release/scripts/templates_py/operator_mesh_uv.py')
-rw-r--r-- | release/scripts/templates_py/operator_mesh_uv.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/templates_py/operator_mesh_uv.py b/release/scripts/templates_py/operator_mesh_uv.py index bf893480f2f..2d4f5b17ba8 100644 --- a/release/scripts/templates_py/operator_mesh_uv.py +++ b/release/scripts/templates_py/operator_mesh_uv.py @@ -33,13 +33,18 @@ class UvOperator(bpy.types.Operator): main(context) return {'FINISHED'} +def menu_func(self, context): + self.layout.operator(UvOperator.bl_idname, text = "Simple UV Operator") +# Register and add to the "UV" menu (required to also use F3 search "Simple UV Operator" for quick access) def register(): bpy.utils.register_class(UvOperator) + bpy.types.IMAGE_MT_uvs.append(menu_func) def unregister(): bpy.utils.unregister_class(UvOperator) + bpy.types.IMAGE_MT_uvs.remove(menu_func) if __name__ == "__main__": |