1
$\begingroup$

I've been looking for some addon or something to render only the marked frames on timeline, i found this answer here on the stackexchange Render Videos From Marker Ranges?

The thing is this script only works with multiple cameras, i have only one camera that goes all aorund the scene but i only want to render the frames that i've marked on timeline.

Is there someone who can help me modify this script? Or find a better solution?

$\endgroup$

1 Answer 1

3
$\begingroup$

Sort of compilation from various answers (only tested in 2.79):

import bpy

scene = bpy.context.scene

# get existing output path
fp = scene.render.filepath

# set output format to .png
scene.render.image_settings.file_format = 'PNG'

marker_frames = [m.frame for m in scene.timeline_markers]
#print(marker_frames)

for m_f in marker_frames:

    # set marker as current frame
    scene.frame_set(m_f)

    # set output path so render won't get overwritten
    scene.render.filepath = fp + str(m_f)
    bpy.ops.render.render(write_still=True) # render still

# restore the filepath
scene.render.filepath = fp
$\endgroup$
1
  • $\begingroup$ Amazing, it works perfectly on 2.81, also i used freesyle to render and it worked too! Thanks! $\endgroup$ Commented Nov 18, 2019 at 19:31

You must log in to answer this question.

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