Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2021-05-14 18:59:16 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-05-14 19:02:04 +0300
commitf6cb9433d45a5504ffba17d0971e9b23b3632a54 (patch)
tree40ed676a6af83adbe4d547bf0c3b9014f5507bca /release/scripts/startup/bl_ui/space_view3d.py
parent8c80267352f171269a2d1c12c780db86ab27a023 (diff)
GPencil: Refactor Append operators
Now the operators work like other areas of Blender using the list of selected objects. Also, the name has been changed to: ```Layers: - Copy Layer to Selected - Copy All Layers to Selected Materials: - Copy Material to Selected - Copy All Materials to Selected``` Reviewed By: mendio, pablovazquez, pepeland Differential Revision: https://developer.blender.org/D11216
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py73
1 files changed, 0 insertions, 73 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 4b06a2df3a0..df004b21077 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4956,75 +4956,6 @@ class VIEW3D_MT_assign_material(Menu):
icon='LAYER_ACTIVE' if mat == mat_active else 'BLANK1').material = mat.name
-def gpencil_layer_append_menu_items(context, layout, only_active):
- done = False
- view_layer = context.view_layer
- obact = context.active_object
- gpl = context.active_gpencil_layer
-
- done = False
- if gpl is not None:
- for ob in view_layer.objects:
- if ob.type == 'GPENCIL' and ob != obact:
- op = layout.operator("gpencil.layer_duplicate_object", text=ob.name)
- op.object = ob.name
- op.only_active = only_active
- done = True
-
- if done is False:
- layout.label(text="No destination object", icon='ERROR')
- else:
- layout.label(text="No layer to copy", icon='ERROR')
-
-
-class VIEW3D_MT_gpencil_append_active_layer(Menu):
- bl_label = "Append Active Layer to Object"
-
- def draw(self, context):
- layout = self.layout
- gpencil_layer_append_menu_items(context, layout, True)
-
-
-class VIEW3D_MT_gpencil_append_all_layers(Menu):
- bl_label = "Append All Layers to Object"
-
- def draw(self, context):
- layout = self.layout
- gpencil_layer_append_menu_items(context, layout, False)
-
-
-def gpencil_material_menu_items(context, layout, only_selected):
- done = False
- view_layer = context.view_layer
- obact = context.active_object
-
- for ob in view_layer.objects:
- if ob.type == 'GPENCIL' and ob != obact:
- op = layout.operator("gpencil.materials_append_to_object", text=ob.name)
- op.object = ob.name
- op.only_selected = only_selected
- done = True
-
- if done is False:
- layout.label(text="No destination object", icon='ERROR')
-
-
-class VIEW3D_MT_gpencil_append_active_material(Menu):
- bl_label = "Append Active Material to Object"
-
- def draw(self, context):
- layout = self.layout
- gpencil_material_menu_items(context, layout, True)
-
-
-class VIEW3D_MT_gpencil_append_all_materials(Menu):
- bl_label = "Append All Materials to Object"
-
- def draw(self, context):
- layout = self.layout
- gpencil_material_menu_items(context, layout, False)
-
-
class VIEW3D_MT_edit_gpencil(Menu):
bl_label = "Grease Pencil"
@@ -7689,10 +7620,6 @@ classes = (
VIEW3D_MT_weight_gpencil,
VIEW3D_MT_gpencil_animation,
VIEW3D_MT_gpencil_simplify,
- VIEW3D_MT_gpencil_append_active_layer,
- VIEW3D_MT_gpencil_append_all_layers,
- VIEW3D_MT_gpencil_append_active_material,
- VIEW3D_MT_gpencil_append_all_materials,
VIEW3D_MT_gpencil_autoweights,
VIEW3D_MT_gpencil_edit_context_menu,
VIEW3D_MT_edit_curve,