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
RL = s.node_tree.nodes.new("CompositorNodeRLayers")

ao = s.node_tree.nodes.new("CompositorNodeAlphaOver")
ao.premul = 1

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


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.