Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Transitions using Pymiere - example included #77

Open
seanmcnally98 opened this issue Jan 28, 2024 · 1 comment
Open

Adding Transitions using Pymiere - example included #77

seanmcnally98 opened this issue Jan 28, 2024 · 1 comment

Comments

@seanmcnally98
Copy link

Hey there, this isn't an issue, but a request to add this example to the documentation. It took me a long time to figure out how to add transitions between clips using pymiere, but I finally figured it out. This code will add a 25 frame cross dissolve at the third clip on V1. You can edit the duration, which transtion is used (by name) and which clip on which track will be targeted.

This is working code!

import pymiere

qe_project = pymiere.objects.qe.project

track = qe_project.getActiveSequence().getVideoTrackAt(0) # Example: target V1 (since indexing starts at 0)

# Specify the target clip index (0-based)
target_clip_index = 2  # Example: target the third clip (since indexing starts at 0)

clip = track.getItemAt(target_clip_index)
clip.addTransition(qe_project.getVideoTransitionByName("Cross Dissolve"), False, '00;00;00;25')

print(f"Transition added to clip at index {target_clip_index}")
print("Done")

Disclaimer, in my addTransition function, I have no idea what the "False" boolean does. In fact, the source I got this from has no idea what it does either. But, it works!

@APISeeker
Copy link

Hel @seanmcnally98 Its so weird that these codes are no longer existing anywher (only onthose youtube videos) and that youhad to watch the whole video to find that code..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants