From 34f8193c7b2b15b7596b672fa115718eb3cde360 Mon Sep 17 00:00:00 2001 From: pullusb Date: Tue, 6 May 2025 10:49:22 +0200 Subject: [PATCH] option to disable move baking in gp clipboard copy operator 4.1.1 - added: option in copy stroke world space to not bake move --- CHANGELOG.md | 7 ++++++- OP_copy_paste.py | 11 +++++++---- __init__.py | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b06f44e..a157077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ # Changelog + +4.1.1 + +- added: option in copy stroke world space to not bake move + 4.1.0 -added: operator `list collection visibility conflicts` (not exposed, called from search menu with dev extras enabled in prefs) +- added: operator `list collection visibility conflicts` (not exposed, called from search menu with dev extras enabled in prefs) 4.0.3 diff --git a/OP_copy_paste.py b/OP_copy_paste.py index d069567..ec350cf 100644 --- a/OP_copy_paste.py +++ b/OP_copy_paste.py @@ -1,6 +1,6 @@ ## GP clipboard : Copy/Cut/Paste Grease Pencil strokes to/from OS clipboard across layers and blends ## View3D > Toolbar > Gpencil > GP clipboard -## in 4.2- existed in standalone scripts: https://github.com/Pullusb/GP_clipboard +## in 4.2, existed in standalone scripts: https://github.com/Pullusb/GP_clipboard import bpy import mathutils @@ -478,6 +478,9 @@ class GPCLIP_OT_copy_multi_strokes(bpy.types.Operator): def poll(cls, context): return context.object and context.object.type == 'GREASEPENCIL' + bake_moves : bpy.props.BoolProperty(name='Bake Move', default=True, + description='Copy every frame where object has moved, else copy only existing frames') + radius : bpy.props.BoolProperty(name='radius', default=True, description='Dump point radius attribute (already skipped if at default value)') opacity : bpy.props.BoolProperty(name='opacity', default=True, @@ -502,6 +505,7 @@ class GPCLIP_OT_copy_multi_strokes(bpy.types.Operator): layout=self.layout layout.use_property_split = True col = layout.column() + col.prop(self, 'bake_moves') col.label(text='Keep following point attributes:') col.prop(self, 'radius') col.prop(self, 'opacity') @@ -512,7 +516,6 @@ class GPCLIP_OT_copy_multi_strokes(bpy.types.Operator): return def execute(self, context): - bake_moves = True skip_empty_frame = False org_frame = context.scene.frame_current @@ -527,10 +530,10 @@ class GPCLIP_OT_copy_multi_strokes(bpy.types.Operator): self.report({'ERROR'}, 'No layers selected in GP dopesheet (needs to be visible and selected to be copied)\nHint: Changing active layer reset selection to active only') return {"CANCELLED"} - if not bake_moves: # copy only drawed frames as is. + if not self.bake_moves: # copy only drawed frames as is. for l in layerpool: if not l.frames: - continue# skip empty layers + continue # skip empty layers frame_dic = {} for f in l.frames: diff --git a/__init__.py b/__init__.py index 0a88f5f..b0b9ad1 100755 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,7 @@ bl_info = { "name": "GP toolbox", "description": "Tool set for Grease Pencil in animation production", "author": "Samuel Bernou, Christophe Seux", -"version": (4, 1, 0), +"version": (4, 1, 1), "blender": (4, 3, 0), "location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties", "warning": "",