fix auto-merge by prefix in autobuild

1.8.10

- fixed: node not deleted after a merge using (compo scene not referenced correctly to point node_trees)
main
pullusb 2024-11-14 12:38:53 +01:00
parent bd7b022af8
commit 772af8cb3f
4 changed files with 19 additions and 7 deletions

View File

@ -14,6 +14,10 @@ Activate / deactivate layer opacity according to prefix
Activate / deactivate all masks using MA layers
-->
1.8.10
- fixed: node not deleted after a merge using (compo scene not referenced correctly to point node_trees)
1.8.9
- fixed: error when setting object active at the end of autobuild

View File

@ -194,6 +194,11 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
if not node_scene:
node_scene = render_scn
## Propagate render scene and compo scene target properties on all scenes
for scn in bpy.data.scenes:
scn.gp_render_settings.node_scene = node_scene.name
scn.gp_render_settings.render_scene = render_scn.name
all_gp_objects = [o for o in context.scene.objects if o.type == 'GPENCIL']
## Clean name and visibility
@ -276,17 +281,17 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
self.report({'ERROR'}, 'No render scene found')
return {'CANCELLED'}
if self.set_active_scene == 'RENDER':
context.window.scene = render_scn
elif self.set_active_scene == 'NODES':
context.window.scene = node_scene
## Group all adjacent layer type
if self.group_all_adjacent_layer_type:
print('Group all adjacent layer type')
for ob in ob_list:
fn.group_adjacent_layer_prefix_rlayer(ob, excluded_prefix=self.excluded_prefix, first_name=True)
if self.set_active_scene == 'RENDER':
context.window.scene = render_scn
elif self.set_active_scene == 'NODES':
context.window.scene = node_scene
# bpy.ops.gp_export.render_scene_setup() # next render scene setup at once
## attempt to refresh scene
# render_scn.node_tree.nodes.update()

View File

@ -2,7 +2,7 @@ bl_info = {
"name": "GP Render",
"description": "Organise export of gp layers through compositor output",
"author": "Samuel Bernou",
"version": (1, 8, 9),
"version": (1, 8, 10),
"blender": (3, 0, 0),
"location": "View3D",
"warning": "",

5
fn.py
View File

@ -301,6 +301,8 @@ def get_compo_scene(scene_name=None, create=True):
scn.node_tree.nodes.clear()
set_settings(scn)
scn.gp_render_settings['use_aa'] = True
# Set compo scene target in it's own property as well
scn.gp_render_settings.node_scene = scene_name
return scn
def get_render_scene(scene_name=None, create=True):
@ -311,6 +313,7 @@ def get_render_scene(scene_name=None, create=True):
render_scn = bpy.data.scenes.get(scene_name)
if render_scn:
return render_scn
if not create:
return
@ -330,7 +333,7 @@ def get_render_scene(scene_name=None, create=True):
for ob in current.objects:
if ob.type in ('CAMERA', 'LIGHT'):
render_scn.collection.objects.link(ob)
## Copy markers
for marker in current.timeline_markers:
new_marker = render_scn.timeline_markers.new(marker.name, frame=marker.frame)