Why is Read() not reading the frame range in CLI mode?

Viewed 1093

This is my script:

# confirming the project dimension resolution
projset = nuke.Root()
projset["format"].setValue("HD_1080")

# load video
foot = nuke.nodes.Read(file="C:/Users/Santosh/Desktop/MVI_8411.MOV", name="Nuke_Class1")

# select read node and attach write node to it
nuke.toNode("Nuke_Class1").setSelected(True)
wr = nuke.createNode("Write")

# specify the sequence path
wr["file"].setValue("C:/Users/Santosh/Desktop/nukke/nuke_API_###.jpg")

# connect to the first viewer, if many
nukescripts.connect_selected_to_viewer(0)

# perform the render, 50th to 140th frame
nuke.render(wr, 50, 140, 1)

I'm basically reading a video and writing out an image sequence.

The problem is, this script renders 1 frame 91 times, it was expected to render 91 different frames.

When I tried to investigate, I found out, the problem is with Read node. I found that frame range was set to 1-1. Do I have to set the frame range manually? Because when I Read the same video file, on GUI, frame ranges are set correctly. This indicates GUI is depending on metadata, whereas my script is not, maybe?

How do I get rid of setting frame range manually?

1 Answers
Related