3
$\begingroup$

How can we use python to add images as a sequence into the compositor.

I am trying to add a transparent graph onto every frame of the render

I have successfully done this on the blender itself, but my objective is to do this using scripting

Here is the code I'm using so far for the nodes

#Compositor settings
s=bpy.data.scenes["Scene"]
s.use_nodes=True
composite=s.node_tree.nodes.new("CompositorNodeComposite")
RL = s.node_tree.nodes.new("CompositorNodeRLayers")

ao = s.node_tree.nodes.new("CompositorNodeAlphaOver")
ao.premul = 1
a0..inputs[0].default_value=2

trans = s.node_tree.nodes.new("CompositorNodeTransform")
trans.filter_type = 'BICUBIC'
trans.inputs[2].default_value = 0
trans.inputs[2].default_value = -273
trans.inputs[4].default_value = 0.6

images = [{'name':'%d.png'%i,"name":"%d.png"%i} for i in range(start_frame,end_frame+1)]

##plots = s.node_tree.nodes.new("CompositorNodeImage")
#s.node_tree.nodes.nw_add_sequence(filepath=os.path.join(os.getcwd(),"plots/1.png"), directory=os.path.join(os.getcwd(),"plots/"), filename="1.png", files=[images])

plots = s.node_tree.nodes.new("CompositorNodeMovieClip")
#bpy.context.area.ui_type = 'CompositorNodeTree'

Screenshot of the node tree

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.