I have this code I’ve been trying to write all day
it seems I could usually move sequencer clip with a below code when I first bring it into the scene
But after I cut the clip it seems like no matter how I write this this function
I cant change the start frame of the clip while maintaining the length
If somebody could show me how to do that I would appreciate
it I’m using a slider to change the frame start value
that’s listed as as one of the two variables in the sets_frame_start function
thanks in advance for any help on this…
def set_frame_start(self, frame_start):
selected = bpy.context.selected_objects
if selected != None:
active_object = bpy.context.active_object
if active_object != None:
mat = active_object.active_material
if hasattr(mat, "node_tree"):
myMaterial = bpy.data.materials.get(mat.name)
myMaterial.use_nodes = True
node_tree = myMaterial.node_tree
node = node_tree.nodes.get("Image Texture")
# Get the selected clip
sequence_name = active_object.get("my_custom_property")
sequence = bpy.context.scene.sequence_editor.sequences.get(sequence_name)
# Move the clip and adjust its start and end frames
sequence.frame_start = frame_start
sequence.frame_final_end = sequence.frame_start + sequence.frame_duration
# Print variables
p(frame_start)
if node != None:
node.image_user.frame_start = frame_start + 1
return None