@@ -162,7 +162,7 @@ def add_render_pass(
162
162
elif image_format == ImageFileFormatEnum .jpeg :
163
163
cls .set_slot_to_jpg (file_slot )
164
164
165
- # link node of render layer to file output (mask and depth need to be processed)
165
+ # link node of render layer to file output (mask/ depth/flow need to be processed)
166
166
node_out = render_layer_node .outputs [render_layer ]
167
167
if render_layer == RenderLayerEnum .mask :
168
168
if not image_format == ImageFileFormatEnum .exr :
@@ -185,4 +185,13 @@ def add_render_pass(
185
185
math_node .inputs [1 ].default_value = 1000.0 / 65535.0
186
186
links .new (node_out , math_node .inputs [0 ])
187
187
node_out = math_node .outputs [0 ]
188
+ if render_layer == RenderLayerEnum .flow :
189
+ separate_rgba = tree .nodes .new ('CompositorNodeSepRGBA' )
190
+ combine_flow = tree .nodes .new ('CompositorNodeCombRGBA' )
191
+ links .new (node_out , separate_rgba .inputs [0 ])
192
+ links .new (separate_rgba .outputs ['R' ], combine_flow .inputs ['R' ])
193
+ links .new (separate_rgba .outputs ['G' ], combine_flow .inputs ['G' ])
194
+ links .new (separate_rgba .outputs ['B' ], combine_flow .inputs ['B' ])
195
+ links .new (separate_rgba .outputs ['A' ], combine_flow .inputs ['A' ])
196
+ node_out = combine_flow .outputs [0 ]
188
197
links .new (node_out , file_output_node .inputs [slot_name ])
0 commit comments