Skip to content

Commit af79966

Browse files
committed
fix: compositor groups now behave correctly
1 parent 16b8b92 commit af79966

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

NodeToPython/compositor/operator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ class NTPCompositorOperator(NTP_Operator):
2222
bl_options = {'REGISTER', 'UNDO'}
2323

2424
compositor_name: bpy.props.StringProperty(name="Node Group")
25-
is_scene : bpy.props.BoolProperty(name="Is Scene", description="Blender stores compositing node trees differently for scenes and in groups")
25+
is_scene : bpy.props.BoolProperty(
26+
name="Is Scene",
27+
description="Blender stores compositing node trees differently for scenes and in groups")
2628

2729
def __init__(self):
2830
super().__init__()
@@ -59,7 +61,7 @@ def _initialize_compositor_node_tree(self, ntp_nt, nt_name):
5961
self._write(f"#initialize {nt_name} node group", self._outer_indent_level)
6062
self._write(f"def {ntp_nt.var}_node_group():", self._outer_indent_level)
6163

62-
if ntp_nt.node_tree == self._base_node_tree:
64+
if ntp_nt.node_tree == self._base_node_tree and self.is_scene:
6365
self._write(f"{ntp_nt.var} = {SCENE}.node_tree")
6466
self._write(f"#start with a clean node tree")
6567
self._write(f"for {NODE} in {ntp_nt.var}.nodes:")

0 commit comments

Comments
 (0)