- Posts: 236
- Joined: Sun Jan 22, 2017 1:45 pm
- Real Name: Julian Böhme
I'm trying to set clip properties of MediaPoolItems, but it seems like I can set barely any of the clip attributes.
So far, only "Clip Color" has worked.
Here's what I tried:
I know that some properties are read-only, but COME ON!
Comment? Shot? Keyword? That can't be!
Can anybody tell me what I'm doing wrong?
And there's also the questions of how do attributes with multiple values work?
For example Flags and Keywords.
Single string values don't make much sense there.
I tried passing lists, that didn't work either:
Example code to run:
Here are the possible attributes:
So far, only "Clip Color" has worked.
Here's what I tried:
- Code: Select all
clip.SetClipProperty('File Path', file_path)
clip.SetClipProperty('Comments', 'MY COMMENT')
clip.SetClipProperty('Shot', 'Shot 1')
clip.SetClipProperty('Flags', 'Blue')
clip.SetClipProperty('Clip Color', 'Orange')
clip.SetClipProperty('Keywords', 'Hello')
I know that some properties are read-only, but COME ON!
Comment? Shot? Keyword? That can't be!
Can anybody tell me what I'm doing wrong?
And there's also the questions of how do attributes with multiple values work?
For example Flags and Keywords.
Single string values don't make much sense there.
I tried passing lists, that didn't work either:
- Code: Select all
clip.SetClipProperty('Flags', ['Blue'])
Example code to run:
- Code: Select all
import os
import sys
import traceback
import pprint
file_path = 'D:\file.mp4'
def main():
resolve = app.GetResolve()
proj_manager = resolve.GetProjectManager()
proj = proj_manager.GetCurrentProject()
media_pool = proj.GetMediaPool()
folder = media_pool.GetCurrentFolder()
clips = folder.GetClipList()
for clip in clips:
print(clip.SetClipProperty('File Path', file_path))
print(clip.SetClipProperty('Comments', 'MY COMMENT'))
print(clip.SetClipProperty('Shot', 'Shot 1'))
print(clip.SetClipProperty('Flags', ['Blue']))
print(clip.SetClipProperty('Clip Color', 'Orange'))
print(clip.SetClipProperty('Keywords', 'Hello'))
if __name__ == '__main__':
try:
main()
except:
print(traceback.format_exc())
Here are the possible attributes:
- Code: Select all
{'Alpha mode': 'None'
'Angle': ''
'Audio Bit Depth': '16'
'Audio Ch': '2'
'Audio Codec': 'AAC'
'Audio Offset': ''
'Bit Depth': '8'
'Camera #': ''
'Clip Color': ''
'Clip Name': 'AES Encryption 1_ Intro and Outline (1080p_15fps_H264-128kbit_AAC) 2.mp4'
'Comments': ''
'Data Level': 'Auto'
'Date Added': 'Thu May 14 2020 20:51:54'
'Date Created': 'Mon Dec 16 22:30:30 2019'
'Date Modified': 'Mon Dec 16 22:30:30 2019'
'Description': ''
'Drop frame': '0'
'Duration': '00:16:22:14'
'Enable Deinterlacing': '0'
'End': '14743'
'End TC': '00:16:22:14'
'FPS': '15.000'
'Field Dominance': 'Auto'
'File Name': 'AES Encryption 1_ Intro and Outline (1080p_15fps_H264-128kbit_AAC) 2.mp4'
'File Path': 'D:\\Downloads\\AES Encryption\\Neuer Ordner\\AES Encryption 1_ Intro and Outline (1080p_15fps_H264-128kbit_AAC) 2.mp4'
'Flags': ''
'Format': 'QuickTime'
'Frame/Field': ''
'Frames': '14744'
'Good Take': ''
'H-FLIP': 'Off'
'IDT': 'Project'
'In': '00:03:01:05'
'Input Color Space': 'Rec.709 (Scene)'
'Input LUT': ''
'Input Sizing Preset': 'None'
'Keyword': ''
'Noise Reduction': ''
'Offline Reference': ''
'Optimized Media': 'None'
'Out': '00:03:57:05'
'PAR': 'Square'
'Reel Name': ''
'Resolution': '1920x1080'
'Roll/Card': ''
'S3D Sync': ''
'Sample Rate': '44100'
'Scene': ''
'Sharpness': ''
'Shot': ''
'Slate TC': '00:00:00:00'
'Start': '0'
'Start KeyKode': ''
'Start TC': '00:00:00:00'
'Synced Audio': ''
'Take': ''
'Type': 'Video + Audio'
'Usage': '0'
'V-FLIP': 'Off'
'Video Codec': 'H.264'
'Super Scale': 1.0}