Results 1 to 2 of 2
  1. #1

    Anybody got a script to export multiple video files from timeline marker ranges?

    vse_slices.jpg

    I have "sliced up" my timeline with markers.

    I would like to render these slices as multiple video files.

    I have named the markers and I would like each video filename appended with the starting marker name of the current slice.

    Thankyou.



  2. #2
    Ok I found a script on stackexchange and modified a little bit.
    There is still one problem it seems to render clips as far as I have added markers, even beyond the frame range.
    Also check the scene.render.filepath part, I have entered my prefered format which is .mp4 so I could uncheck the fileextension part in render settings so I don't get the framerange in the filename.

    Code:
     # frames to use before and afterFRAMES_PAD = 0
    # real render 3d scene or GL preview?
    USE_OPENGL = False
    # handle marker switching cameras
    USE_MARKER_CAMERAS = False
    
    
    import bpy
    from bpy import context
    
    
    wm = context.window_manager
    scene = context.scene
    # store original output
    filepath_orig = scene.render.filepath
    frame_range = scene.frame_start, scene.frame_end
    
    
    markers = sorted(scene.timeline_markers, key=lambda m: m.frame)
    
    
    # progress in cursor (countdown)
    wm.progress_begin(0, len(markers) - 1)
    scene.frame_start = 1
    
    
    if USE_MARKER_CAMERAS:
        markers_camera = [m.camera for m in markers]
    
    
        def markers_cameras_restore():
            for m, c in zip(markers, markers_camera):
                m.camera = c
    
    
    
    
        def markers_cameras_disable():
            for m in markers:
                m.camera = None
    
    
    
    
    for i in range(1, len(markers)):
        m_start = markers[i - 1]
        m_end = markers[i]
    
    
        # just in case
        if m_start.frame == m_end.frame:
            continue
    
    
        scene.frame_end = m_end.frame + FRAMES_PAD - 1
        scene.frame_start = m_start.frame - FRAMES_PAD
        scene.render.filepath = filepath_orig + m_start.name + ".mp4"
    
    
        if USE_MARKER_CAMERAS:
            markers_cameras_restore()
            scene.frame_set(scene.frame_start)
            if m_start.camera:
                scene.camera = m_start.camera
            markers_cameras_disable()
    
    
        wm.progress_update(len(markers) - (i + 1))
    
    
        if USE_OPENGL:
            bpy.ops.render.opengl(animation=True)
        else:
            bpy.ops.render.render(animation=True)
    
    
    
    
    # restore original values
    scene.render.filepath = filepath_orig
    scene.frame_start, scene.frame_end = frame_range
    
    
    if USE_MARKER_CAMERAS:
        markers_cameras_restore()
    
    
    wm.progress_end()
    Can someone simplify this?
    Last edited by Dileep; 16-May-17 at 23:53.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •