1
$\begingroup$

How to create a "CompositorNodeMovieClip" node and load a video using the python api in the node editor.

My progress so far...

bpy.context.scene.use_nodes = True 
nodes = bpy.data.scenes['Scene'].node_tree.nodes 
links = bpy.data.scenes['Scene'].node_tree.links # create the movieclip node 
movieClipNode = nodes.new("CompositorNodeMovieClip") # get the video clip 
videoClip = bpy.data.movieclips.get( videoPath ); 

but videoClip is returned as null..

$\endgroup$
3
  • $\begingroup$ My progress so far...bpy.context.scene.use_nodes = True nodes = bpy.data.scenes['Scene'].node_tree.nodes links = bpy.data.scenes['Scene'].node_tree.links # create the movieclip node movieClipNode = nodes.new("CompositorNodeMovieClip") # get the video clip videoClip = bpy.data.movieclips.get( videoPath ); but videoClip is returned as null.. $\endgroup$
    – sreenivas
    Mar 19, 2015 at 11:30
  • $\begingroup$ In future, please add any extra info into your question and not the comments. $\endgroup$ Mar 19, 2015 at 13:06
  • $\begingroup$ Thought of keeping the question succinct. Will keep that in mind for the later questions. Thanks for modifying. $\endgroup$
    – sreenivas
    Mar 23, 2015 at 6:38

1 Answer 1

2
$\begingroup$

you are using incorrect key , the key is the name of the movie clip

#load new movie clip
bpy.data.movieclips.load(clip_path)
#get the new movie clip
movie_clip = bpy.data.movieclips.get(clip_name)
#assign movie clip to the node
bpy.context.scene.node_tree.nodes['Movie Clip'].clip = movie_clip
$\endgroup$
1
  • $\begingroup$ ah.. thanks for pointing out. That fixed it. $\endgroup$
    – sreenivas
    Mar 23, 2015 at 8:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .