From 2f8efed73b11e01925efbf84eadafb2cb187b46a Mon Sep 17 00:00:00 2001 From: "christophe.seux" Date: Mon, 9 Sep 2024 11:06:02 +0200 Subject: [PATCH] restore state on selected gp --- OP_setup_layers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OP_setup_layers.py b/OP_setup_layers.py index ff40820..364f8d0 100644 --- a/OP_setup_layers.py +++ b/OP_setup_layers.py @@ -176,7 +176,7 @@ class GPEXP_OT_restore_layers_state(bpy.types.Operator): layers_info = json.loads(layers_info_path.read_text(encoding='utf-8')) - pool = [o for o in context.scene.objects if o.type == 'GPENCIL' and fn.is_valid_name(o.name)] + pool = [o for o in context.selected_objects if o.type == 'GPENCIL'] for gp in pool: for layer_name, info in layers_info.items(): if gp.name == info['object']: