option to disable move baking in gp clipboard copy operator

4.1.1

- added: option in copy stroke world space to not bake move
This commit is contained in:
pullusb 2025-05-06 10:49:22 +02:00
parent aecef47d2f
commit 34f8193c7b
3 changed files with 14 additions and 6 deletions

View File

@ -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

View File

@ -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:

View File

@ -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": "",