0
$\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$
  • $\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 '15 at 11:30
  • $\begingroup$ In future, please add any extra info into your question and not the comments. $\endgroup$ – Ray Mairlot Mar 19 '15 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 '15 at 6:38
1
$\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$
  • $\begingroup$ ah.. thanks for pointing out. That fixed it. $\endgroup$ – sreenivas Mar 23 '15 at 8:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.