/
premiere_objects.py
5254 lines (4451 loc) · 224 KB
/
premiere_objects.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from pymiere.core import PymiereBaseObject, PymiereBaseCollection, Array, _format_object_to_py, _format_object_to_es, ExtendScriptError
class Application(PymiereBaseObject):
def __init__(self, pymiere_id=None):
super(Application, self).__init__(pymiere_id)
# ----- PROPERTIES -----
@property
def version(self):
return self._eval_on_this_object('version')
@version.setter
def version(self, version):
raise AttributeError("Attribute 'version' is read-only")
@property
def build(self):
return self._eval_on_this_object('build')
@build.setter
def build(self, build):
raise AttributeError("Attribute 'build' is read-only")
@property
def csxs(self):
return _format_object_to_py(self._eval_on_this_object('csxs'))
@csxs.setter
def csxs(self, csxs):
raise AttributeError("Attribute 'csxs' is read-only")
@property
def getPProPrefPath(self):
return self._eval_on_this_object('getPProPrefPath')
@getPProPrefPath.setter
def getPProPrefPath(self, getPProPrefPath):
raise AttributeError("Attribute 'getPProPrefPath' is read-only")
@property
def getPProSystemPrefPath(self):
return self._eval_on_this_object('getPProSystemPrefPath')
@getPProSystemPrefPath.setter
def getPProSystemPrefPath(self, getPProSystemPrefPath):
raise AttributeError("Attribute 'getPProSystemPrefPath' is read-only")
""" This is the current active project. """
@property
def project(self):
kwargs = self._eval_on_this_object('project')
return Project(**kwargs) if kwargs else None
@project.setter
def project(self, project):
self._check_type(project, Project, 'Application.project')
self._eval_on_this_object("project = {}".format(_format_object_to_es(project)))
@property
def projects(self):
kwargs = self._eval_on_this_object('projects')
return ProjectCollection(**kwargs) if kwargs else None
@projects.setter
def projects(self, projects):
raise AttributeError("Attribute 'projects' is read-only")
@property
def anywhere(self):
kwargs = self._eval_on_this_object('anywhere')
return Anywhere(**kwargs) if kwargs else None
@anywhere.setter
def anywhere(self, anywhere):
raise AttributeError("Attribute 'anywhere' is read-only")
@property
def encoder(self):
kwargs = self._eval_on_this_object('encoder')
return Encoder(**kwargs) if kwargs else None
@encoder.setter
def encoder(self, encoder):
raise AttributeError("Attribute 'encoder' is read-only")
@property
def properties(self):
kwargs = self._eval_on_this_object('properties')
return Properties(**kwargs) if kwargs else None
@properties.setter
def properties(self, properties):
raise AttributeError("Attribute 'properties' is read-only")
@property
def sourceMonitor(self):
kwargs = self._eval_on_this_object('sourceMonitor')
return SourceMonitor(**kwargs) if kwargs else None
@sourceMonitor.setter
def sourceMonitor(self, sourceMonitor):
raise AttributeError("Attribute 'sourceMonitor' is read-only")
@property
def projectManager(self):
kwargs = self._eval_on_this_object('projectManager')
return ProjectManager(**kwargs) if kwargs else None
@projectManager.setter
def projectManager(self, projectManager):
raise AttributeError("Attribute 'projectManager' is read-only")
@property
def userGuid(self):
return self._eval_on_this_object('userGuid')
@userGuid.setter
def userGuid(self, userGuid):
raise AttributeError("Attribute 'userGuid' is read-only")
@property
def path(self):
return self._eval_on_this_object('path')
@path.setter
def path(self, path):
raise AttributeError("Attribute 'path' is read-only")
@property
def getAppPrefPath(self):
return self._eval_on_this_object('getAppPrefPath')
@getAppPrefPath.setter
def getAppPrefPath(self, getAppPrefPath):
raise AttributeError("Attribute 'getAppPrefPath' is read-only")
@property
def getAppSystemPrefPath(self):
return self._eval_on_this_object('getAppSystemPrefPath')
@getAppSystemPrefPath.setter
def getAppSystemPrefPath(self, getAppSystemPrefPath):
raise AttributeError("Attribute 'getAppSystemPrefPath' is read-only")
@property
def metadata(self):
kwargs = self._eval_on_this_object('metadata')
return Metadata(**kwargs) if kwargs else None
@metadata.setter
def metadata(self, metadata):
raise AttributeError("Attribute 'metadata' is read-only")
# ----- FUNCTIONS -----
def bind(self, eventName, function):
"""
:type eventName: str
:type function: any
"""
self._check_type(eventName, str, 'arg "eventName" of function "Application.bind"')
self._check_type(function, any, 'arg "function" of function "Application.bind"')
self._eval_on_this_object("bind({}, {})".format(_format_object_to_es(eventName), _format_object_to_es(function)))
def unbind(self, eventName):
"""
:type eventName: str
"""
self._check_type(eventName, str, 'arg "eventName" of function "Application.unbind"')
self._eval_on_this_object("unbind({})".format(_format_object_to_es(eventName)))
def setTimeout(self, eventName, function, milliseconds):
"""
:type eventName: str
:type function: any
:type milliseconds: float
"""
self._check_type(eventName, str, 'arg "eventName" of function "Application.setTimeout"')
self._check_type(function, any, 'arg "function" of function "Application.setTimeout"')
self._check_type(milliseconds, float, 'arg "milliseconds" of function "Application.setTimeout"')
self._eval_on_this_object("setTimeout({}, {}, {})".format(_format_object_to_es(eventName), _format_object_to_es(function), _format_object_to_es(milliseconds)))
def isDocumentOpen(self):
return self._eval_on_this_object("isDocumentOpen()")
def getWorkspaces(self):
return Array(**self._eval_on_this_object("getWorkspaces()"))
def getCurrentProjectViewSelection(self):
"""
Returns an array of projectItems selected, in the current active project view
:return: (list of ProjectItem)
"""
self._check_version("15.4", "Application.getCurrentProjectViewSelection")
result = self._eval_on_this_object("getCurrentProjectViewSelection()")
if result is None:
return Array.from_python_list(list())
return Array(**result)
def setWorkspace(self, workspace):
"""
:type workspace: str
"""
self._check_type(workspace, str, 'arg "workspace" of function "Application.setWorkspace"')
return self._eval_on_this_object("setWorkspace({})".format(_format_object_to_es(workspace)))
def isDocument(self, filePath):
"""
Checks whether file specified is a doc
:param filePath: This is the path to be checked
:type filePath: str
"""
self._check_type(filePath, str, 'arg "filePath" of function "Application.isDocument"')
return self._eval_on_this_object("isDocument({})".format(_format_object_to_es(filePath)))
def openDocument(self, filePath, suppressConversionDialog=False, bypassLocateFileDialog=False, bypassWarningDialog=False, doNotAddToMRUList=False):
"""
:type filePath: str
:type suppressConversionDialog: bool
:type bypassLocateFileDialog: bool
:type bypassWarningDialog: bool
:type doNotAddToMRUList: bool
"""
self._check_type(filePath, str, 'arg "filePath" of function "Application.openDocument"')
self._check_type(suppressConversionDialog, bool, 'arg "suppressConversionDialog" of function "Application.openDocument"')
self._check_type(bypassLocateFileDialog, bool, 'arg "bypassLocateFileDialog" of function "Application.openDocument"')
self._check_type(bypassWarningDialog, bool, 'arg "bypassWarningDialog" of function "Application.openDocument"')
self._check_type(doNotAddToMRUList, bool, 'arg "doNotAddToMRUList" of function "Application.openDocument"')
return self._eval_on_this_object("openDocument({}, {}, {}, {}, {})".format(_format_object_to_es(filePath), _format_object_to_es(suppressConversionDialog), _format_object_to_es(bypassLocateFileDialog), _format_object_to_es(bypassWarningDialog), _format_object_to_es(doNotAddToMRUList)))
def quit(self):
self._eval_on_this_object("quit()")
def trace(self, message):
"""
:type message: str
"""
self._check_type(message, str, 'arg "message" of function "Application.trace"')
self._eval_on_this_object("trace({})".format(_format_object_to_es(message)))
def write(self, arg1):
"""
:type arg1: any
"""
self._check_type(arg1, any, 'arg "arg1" of function "Application.write"')
self._eval_on_this_object("write({})".format(_format_object_to_es(arg1)))
def openFCPXML(self, filePath, projectPath):
"""
Create and open Premiere project from FinalCut xml file
:param filePath: .xml file path
:type filePath: str
:param projectPath: folder path where the new prproj file will be saved
:type projectPath: str
:return: success (bool)
"""
self._check_type(filePath, str, 'arg "filePath" of function "Application.openFCPXML"')
self._check_type(projectPath, str, 'arg "projectPath" of function "Application.openFCPXML"')
return self._eval_on_this_object("openFCPXML({}, {})".format(_format_object_to_es(filePath), _format_object_to_es(projectPath)))
def setSDKEventMessage(self, value, eventType):
"""
:type value: str
:type eventType: str
"""
self._check_type(value, str, 'arg "value" of function "Application.setSDKEventMessage"')
self._check_type(eventType, str, 'arg "eventType" of function "Application.setSDKEventMessage"')
return self._eval_on_this_object("setSDKEventMessage({}, {})".format(_format_object_to_es(value), _format_object_to_es(eventType)))
def setScratchDiskPath(self, value, type):
"""
:type value: str
:type type: str
"""
self._check_type(value, str, 'arg "value" of function "Application.setScratchDiskPath"')
self._check_type(type, str, 'arg "type" of function "Application.setScratchDiskPath"')
self._eval_on_this_object("setScratchDiskPath({}, {})".format(_format_object_to_es(value), _format_object_to_es(type)))
def broadcastPrefsChanged(self, preferencesThatChanged):
"""
:type preferencesThatChanged: str
"""
self._check_type(preferencesThatChanged, str, 'arg "preferencesThatChanged" of function "Application.broadcastPrefsChanged"')
return self._eval_on_this_object("broadcastPrefsChanged({})".format(_format_object_to_es(preferencesThatChanged)))
def setExtensionPersistent(self, extensionID, state):
"""
:type extensionID: str
:type state: float
"""
self._check_type(extensionID, str, 'arg "extensionID" of function "Application.setExtensionPersistent"')
self._check_type(state, float, 'arg "state" of function "Application.setExtensionPersistent"')
self._eval_on_this_object("setExtensionPersistent({}, {})".format(_format_object_to_es(extensionID), _format_object_to_es(state)))
def getEnableProxies(self):
return self._eval_on_this_object("getEnableProxies()")
def setEnableProxies(self, enable):
"""
:type enable: float
"""
self._check_type(enable, float, 'arg "enable" of function "Application.setEnableProxies"')
return self._eval_on_this_object("setEnableProxies({})".format(_format_object_to_es(enable)))
def showCursor(self, enable):
"""
:type enable: bool
"""
self._check_type(enable, bool, 'arg "enable" of function "Application.showCursor"')
self._eval_on_this_object("showCursor({})".format(_format_object_to_es(enable)))
def getProjectViewIDs(self):
self._eval_on_this_object("getProjectViewIDs()")
def getProjectFromViewID(self, viewID):
"""
:type viewID: str
"""
self._check_type(viewID, str, 'arg "viewID" of function "Application.getProjectFromViewID"')
return Project(**self._eval_on_this_object("getProjectFromViewID({})".format(_format_object_to_es(viewID))))
def getProjectViewSelection(self, viewID):
"""
:type viewID: str
"""
self._check_type(viewID, str, 'arg "viewID" of function "Application.getProjectViewSelection"')
self._eval_on_this_object("getProjectViewSelection({})".format(_format_object_to_es(viewID)))
def setProjectViewSelection(self, viewID):
"""
:type viewID: str
"""
self._check_type(viewID, str, 'arg "viewID" of function "Application.setProjectViewSelection"')
self._eval_on_this_object("setProjectViewSelection({})".format(_format_object_to_es(viewID)))
def getConstant(self, name):
"""
:type name: str
"""
self._check_type(name, str, 'arg "name" of function "Application.getConstant"')
return self._eval_on_this_object("getConstant({})".format(_format_object_to_es(name)))
def refresh(self):
self._eval_on_this_object("refresh()")
def setEnableTranscodeOnIngest(self, inEnable):
"""
:type inEnable: bool
"""
self._check_type(inEnable, bool, 'arg "inEnable" of function "Application.setEnableTranscodeOnIngest"')
self._eval_on_this_object("setEnableTranscodeOnIngest({})".format(_format_object_to_es(inEnable)))
def getCCXUserJSONData(self):
return self._eval_on_this_object("getCCXUserJSONData()")
def newProject(self, newFilePath):
"""
Create a new empty project/document saved at the newFilePath location
:param newFilePath: where to save the new project (filepath to .prproj)
:type newFilePath: str
:return: success
"""
# only available from Premiere Pro 14.0 (2020)
self._check_version("14.0", "Application.newProject", alternative_msg="Use pymiere.objects.qe.newProject(newFilePath) for older versions")
self._check_type(newFilePath, str, 'arg "newProject" of function "Application.newProject"')
return bool(self._eval_on_this_object("newProject({})".format(_format_object_to_es(newFilePath))))
def enableQE(self):
return self._eval_on_this_object("enableQE()")
class Project(PymiereBaseObject):
def __init__(self, pymiere_id=None):
super(Project, self).__init__(pymiere_id)
# ----- PROPERTIES -----
@property
def documentID(self):
return self._eval_on_this_object('documentID')
@documentID.setter
def documentID(self, documentID):
raise AttributeError("Attribute 'documentID' is read-only")
@property
def name(self):
return self._eval_on_this_object('name')
@name.setter
def name(self, name):
raise AttributeError("Attribute 'name' is read-only")
@property
def path(self):
return self._eval_on_this_object('path')
@path.setter
def path(self, path):
raise AttributeError("Attribute 'path' is read-only")
@property
def rootItem(self):
kwargs = self._eval_on_this_object('rootItem')
return ProjectItem(**kwargs) if kwargs else None
@rootItem.setter
def rootItem(self, rootItem):
raise AttributeError("Attribute 'rootItem' is read-only")
@property
def sequences(self):
kwargs = self._eval_on_this_object('sequences')
return SequenceCollection(**kwargs) if kwargs else None
@sequences.setter
def sequences(self, sequences):
raise AttributeError("Attribute 'sequences' is read-only")
""" f """
@property
def activeSequence(self):
kwargs = self._eval_on_this_object('activeSequence')
return Sequence(**kwargs) if kwargs else None
@activeSequence.setter
def activeSequence(self, activeSequence):
self._check_type(activeSequence, Sequence, 'Project.activeSequence')
self._eval_on_this_object("activeSequence = {}".format(_format_object_to_es(activeSequence)))
@property
def isCloudProject(self):
return self._eval_on_this_object('isCloudProject')
@isCloudProject.setter
def isCloudProject(self, isCloudProject):
raise AttributeError("Attribute 'isCloudProject' is read-only")
@property
def cloudProjectLocalID(self):
return self._eval_on_this_object('cloudProjectLocalID')
@cloudProjectLocalID.setter
def cloudProjectLocalID(self, cloudProjectLocalID):
raise AttributeError("Attribute 'cloudProjectLocalID' is read-only")
# ----- FUNCTIONS -----
def bind(self, eventName, function):
"""
:type eventName: str
:type function: any
"""
self._check_type(eventName, str, 'arg "eventName" of function "Project.bind"')
self._check_type(function, any, 'arg "function" of function "Project.bind"')
self._eval_on_this_object("bind({}, {})".format(_format_object_to_es(eventName), _format_object_to_es(function)))
def unbind(self, eventName):
"""
:type eventName: str
"""
self._check_type(eventName, str, 'arg "eventName" of function "Project.unbind"')
self._eval_on_this_object("unbind({})".format(_format_object_to_es(eventName)))
def setTimeout(self, eventName, function, milliseconds):
"""
:type eventName: str
:type function: any
:type milliseconds: float
"""
self._check_type(eventName, str, 'arg "eventName" of function "Project.setTimeout"')
self._check_type(function, any, 'arg "function" of function "Project.setTimeout"')
self._check_type(milliseconds, float, 'arg "milliseconds" of function "Project.setTimeout"')
self._eval_on_this_object("setTimeout({}, {}, {})".format(_format_object_to_es(eventName), _format_object_to_es(function), _format_object_to_es(milliseconds)))
def openSequence(self, sequenceID):
"""
:type sequenceID: str
"""
self._check_type(sequenceID, str, 'arg "sequenceID" of function "Project.openSequence"')
return self._eval_on_this_object("openSequence({})".format(_format_object_to_es(sequenceID)))
def importFiles(self, arrayOfFilePathsToImport, suppressUI, targetBin, importAsNumberedStills):
"""
Imports files into the project.
:param arrayOfFilePathsToImport: An array of paths to files to import
:param suppressUI: optional; if true, suppress any warnings, translation reports, or errors.
:param projectBin: optional; if present, the bin into which to import the new media.
:param importAsNumberedStill: optional if present, interprets the file paths as a series of numbered stills.
"""
self._check_type(arrayOfFilePathsToImport, list, 'arg "arrayOfFilePathsToImport" of function "Project.importFiles"')
self._check_type(suppressUI, bool, 'arg "suppressUI" of function "Project.importFiles"')
self._check_type(targetBin, ProjectItem, 'arg "targetBin" of function "Project.importFiles"')
self._check_type(importAsNumberedStills, bool, 'arg "importAsNumberedStills" of function "Project.importFiles"')
return self._eval_on_this_object("importFiles({}, {}, {}, {})".format(_format_object_to_es(arrayOfFilePathsToImport), _format_object_to_es(suppressUI), _format_object_to_es(targetBin), _format_object_to_es(importAsNumberedStills)))
def importSequences(self, projectPath, sequences):
"""
Imports sequences from a project.
:param projectPath: Path on disk to the project from which to import sequences.
:type projectPath: str
:param sequences: An array of sequence IDs to import, from the project.
:type sequences: list of string
"""
self._check_type(projectPath, str, 'arg "projectPath" of function "Project.importSequences"')
self._check_type(sequences, list, 'arg "sequences" of function "Project.importSequences"')
# sequence_array = Array.from_python_list(sequences)
result = self._eval_on_this_object("importSequences({}, {})".format(_format_object_to_es(projectPath), _format_object_to_es(sequences)))
return result
def importAllAEComps(self, pathOfContainingProject, optionalTargetBin):
"""
:type pathOfContainingProject: str
:type optionalTargetBin: ProjectItem
"""
self._check_type(pathOfContainingProject, str, 'arg "pathOfContainingProject" of function "Project.importAEComps"')
self._check_type(optionalTargetBin, ProjectItem, 'arg "optionalTargetBin" of function "Project.importAEComps"')
return self._eval_on_this_object("importAEComps({},{})".format(_format_object_to_es(pathOfContainingProject), _format_object_to_es(optionalTargetBin)))
def importAEComps(self, pathOfContainingProject, arrayOfCompNames, optionalTargetBin):
"""
:type pathOfContainingProject: str
:type arrayOfCompNames: list
:type optionalTargetBin: ProjectItem
"""
self._check_type(pathOfContainingProject, str, 'arg "pathOfContainingProject" of function "Project.importAEComps"')
self._check_type(arrayOfCompNames, list, 'arg "arrayOfCompNames" of function "Project.importAEComps"')
self._check_type(optionalTargetBin, ProjectItem, 'arg "optionalTargetBin" of function "Project.importAEComps"')
return self._eval_on_this_object("importAEComps({},{},{})".format(_format_object_to_es(pathOfContainingProject), _format_object_to_es(arrayOfCompNames), _format_object_to_es(optionalTargetBin)))
def createNewSequence(self, sequenceName, placeholderID):
"""
:type sequenceName: str
:type placeholderID: str
"""
self._check_type(sequenceName, str, 'arg "sequenceName" of function "Project.createNewSequence"')
self._check_type(placeholderID, str, 'arg "placeholderID" of function "Project.createNewSequence"')
self._eval_on_this_object("createNewSequence({}, {})".format(_format_object_to_es(sequenceName), _format_object_to_es(placeholderID)))
def createNewSequenceFromClips(self, sequenceName, arrayOfProjectItems, destinationBin=None):
"""
Creates a new Sequence object with the given name, in the specified destination bin,
and sequentially inserts project items into it.
:type sequenceName: str
:type arrayOfProjectItems: list of ProjectItem
:type destinationBin: ProjectItem
:return: Sequence object
"""
return Sequence(**self._eval_on_this_object("createNewSequenceFromClips({}, {}, {})".format(_format_object_to_es(sequenceName), _format_object_to_es(arrayOfProjectItems), _format_object_to_es(destinationBin))))
def deleteSequence(self, sequence):
"""
:type sequence: Sequence
"""
self._check_type(sequence, Sequence, 'arg "sequence" of function "Project.deleteSequence"')
return self._eval_on_this_object("deleteSequence({})".format(_format_object_to_es(sequence)))
def exportFinalCutProXML(self, exportPath, suppressUI):
"""
:type exportPath: str
:type suppressUI: float
"""
self._check_type(exportPath, str, 'arg "exportPath" of function "Project.exportFinalCutProXML"')
self._check_type(suppressUI, float, 'arg "suppressUI" of function "Project.exportFinalCutProXML"')
return self._eval_on_this_object("exportFinalCutProXML({}, {})".format(_format_object_to_es(exportPath), _format_object_to_es(suppressUI)))
def exportTimeline(self, exportControllerName):
"""
:type exportControllerName: str
"""
self._check_type(exportControllerName, str, 'arg "exportControllerName" of function "Project.exportTimeline"')
return self._eval_on_this_object("exportTimeline({})".format(_format_object_to_es(exportControllerName)))
def exportOMF(self, sequence, filePath, OMFTitle, sampleRate, bitsPerSample, audioEncapsulated, audioFileFormat, trimAudioFiles, handleFrames, includePan):
"""
:type sequence: Sequence
:type filePath: str
:type OMFTitle: str
:type sampleRate: float
:type bitsPerSample: float
:type audioEncapsulated: float
:type audioFileFormat: float
:type trimAudioFiles: float
:type handleFrames: float
:type includePan: float
"""
self._check_type(sequence, Sequence, 'arg "sequence" of function "Project.exportOMF"')
self._check_type(filePath, str, 'arg "filePath" of function "Project.exportOMF"')
self._check_type(OMFTitle, str, 'arg "OMFTitle" of function "Project.exportOMF"')
self._check_type(sampleRate, float, 'arg "sampleRate" of function "Project.exportOMF"')
self._check_type(bitsPerSample, float, 'arg "bitsPerSample" of function "Project.exportOMF"')
self._check_type(audioEncapsulated, float, 'arg "audioEncapsulated" of function "Project.exportOMF"')
self._check_type(audioFileFormat, float, 'arg "audioFileFormat" of function "Project.exportOMF"')
self._check_type(trimAudioFiles, float, 'arg "trimAudioFiles" of function "Project.exportOMF"')
self._check_type(handleFrames, float, 'arg "handleFrames" of function "Project.exportOMF"')
self._check_type(includePan, float, 'arg "includePan" of function "Project.exportOMF"')
return self._eval_on_this_object("exportOMF({}, {}, {}, {}, {}, {}, {}, {}, {}, {})".format(_format_object_to_es(sequence), _format_object_to_es(filePath), _format_object_to_es(OMFTitle), _format_object_to_es(sampleRate), _format_object_to_es(bitsPerSample), _format_object_to_es(audioEncapsulated), _format_object_to_es(audioFileFormat), _format_object_to_es(trimAudioFiles), _format_object_to_es(handleFrames), _format_object_to_es(includePan)))
def exportAAF(self, sequence, filePath, mixDownVideo, explodeToMono, sampleRate, bitsPerSample, embedAudio, audioFileFormat, trimSources, handleFrames):
"""
:type sequence: Sequence
:type filePath: str
:type mixDownVideo: float
:type explodeToMono: float
:type sampleRate: float
:type bitsPerSample: float
:type embedAudio: float
:type audioFileFormat: float
:type trimSources: float
:type handleFrames: float
"""
self._check_type(sequence, Sequence, 'arg "sequence" of function "Project.exportAAF"')
self._check_type(filePath, str, 'arg "filePath" of function "Project.exportAAF"')
self._check_type(mixDownVideo, float, 'arg "mixDownVideo" of function "Project.exportAAF"')
self._check_type(explodeToMono, float, 'arg "explodeToMono" of function "Project.exportAAF"')
self._check_type(sampleRate, float, 'arg "sampleRate" of function "Project.exportAAF"')
self._check_type(bitsPerSample, float, 'arg "bitsPerSample" of function "Project.exportAAF"')
self._check_type(embedAudio, float, 'arg "embedAudio" of function "Project.exportAAF"')
self._check_type(audioFileFormat, float, 'arg "audioFileFormat" of function "Project.exportAAF"')
self._check_type(trimSources, float, 'arg "trimSources" of function "Project.exportAAF"')
self._check_type(handleFrames, float, 'arg "handleFrames" of function "Project.exportAAF"')
return self._eval_on_this_object("exportAAF({}, {}, {}, {}, {}, {}, {}, {}, {}, {})".format(_format_object_to_es(sequence), _format_object_to_es(filePath), _format_object_to_es(mixDownVideo), _format_object_to_es(explodeToMono), _format_object_to_es(sampleRate), _format_object_to_es(bitsPerSample), _format_object_to_es(embedAudio), _format_object_to_es(audioFileFormat), _format_object_to_es(trimSources), _format_object_to_es(handleFrames)))
def saveAs(self, saveAsPath):
"""
:type saveAsPath: str
"""
self._check_type(saveAsPath, str, 'arg "saveAsPath" of function "Project.saveAs"')
return self._eval_on_this_object("saveAs({})".format(_format_object_to_es(saveAsPath)))
def save(self):
self._eval_on_this_object("save()")
def pauseGrowing(self, pausedOrNot):
"""
:type pausedOrNot: float
"""
self._check_type(pausedOrNot, float, 'arg "pausedOrNot" of function "Project.pauseGrowing"')
return self._eval_on_this_object("pauseGrowing({})".format(_format_object_to_es(pausedOrNot)))
def closeDocument(self, save=True):
"""
:param save: save the document before closing it
:type save: bool
"""
self._check_type(save, bool, 'arg "save" of function "Project.save"')
return self._eval_on_this_object("closeDocument({})".format(_format_object_to_es(save)))
def placeAsset(self, arg1):
"""
:type arg1: any
"""
self._check_type(arg1, any, 'arg "arg1" of function "Project.placeAsset"')
return self._eval_on_this_object("placeAsset({})".format(_format_object_to_es(arg1)))
def addPropertyToProjectMetadataSchema(self, name, label, type):
"""
:type name: str
:type label: str
:type type: float
"""
self._check_type(name, str, 'arg "name" of function "Project.addPropertyToProjectMetadataSchema"')
self._check_type(label, str, 'arg "label" of function "Project.addPropertyToProjectMetadataSchema"')
self._check_type(type, float, 'arg "type" of function "Project.addPropertyToProjectMetadataSchema"')
return self._eval_on_this_object("addPropertyToProjectMetadataSchema({}, {}, {})".format(_format_object_to_es(name), _format_object_to_es(label), _format_object_to_es(type)))
def getInsertionBin(self):
return ProjectItem(**self._eval_on_this_object("getInsertionBin()"))
def getProjectPanelMetadata(self):
self._eval_on_this_object("getProjectPanelMetadata()")
def setProjectPanelMetadata(self):
self._eval_on_this_object("setProjectPanelMetadata()")
def setScratchDiskPath(self, value, type):
"""
:type value: str
:type type: str
"""
self._check_type(value, str, 'arg "value" of function "Project.setScratchDiskPath"')
self._check_type(type, str, 'arg "type" of function "Project.setScratchDiskPath"')
self._eval_on_this_object("setScratchDiskPath({}, {})".format(_format_object_to_es(value), _format_object_to_es(type)))
def consolidateDuplicates(self):
self._eval_on_this_object("consolidateDuplicates()")
def setEnableTranscodeOnIngest(self, inEnable):
"""
:type inEnable: bool
"""
self._check_type(inEnable, bool, 'arg "inEnable" of function "Project.setEnableTranscodeOnIngest"')
return self._eval_on_this_object("setEnableTranscodeOnIngest({})".format(_format_object_to_es(inEnable)))
class ProjectItem(PymiereBaseObject):
def __init__(self, pymiere_id=None):
super(ProjectItem, self).__init__(pymiere_id)
# ----- PROPERTIES -----
@property
def children(self):
kwargs = self._eval_on_this_object('children')
return ProjectItemCollection(**kwargs) if kwargs else None
@children.setter
def children(self, children):
raise AttributeError("Attribute 'children' is read-only")
@property
def name(self):
return self._eval_on_this_object('name')
@name.setter
def name(self, name):
self._eval_on_this_object("name = {}".format(_format_object_to_es(name)))
@property
def treePath(self):
return self._eval_on_this_object('treePath')
@treePath.setter
def treePath(self, treePath):
raise AttributeError("Attribute 'treePath' is read-only")
@property
def type(self):
return self._eval_on_this_object('type')
@type.setter
def type(self, type):
raise AttributeError("Attribute 'type' is read-only")
@property
def nodeId(self):
return self._eval_on_this_object('nodeId')
@nodeId.setter
def nodeId(self, nodeId):
raise AttributeError("Attribute 'nodeId' is read-only")
# ----- FUNCTIONS -----
def bind(self, eventName, function):
"""
:type eventName: str
:type function: any
"""
self._check_type(eventName, str, 'arg "eventName" of function "ProjectItem.bind"')
self._check_type(function, any, 'arg "function" of function "ProjectItem.bind"')
self._eval_on_this_object("bind({}, {})".format(_format_object_to_es(eventName), _format_object_to_es(function)))
def unbind(self, eventName):
"""
:type eventName: str
"""
self._check_type(eventName, str, 'arg "eventName" of function "ProjectItem.unbind"')
self._eval_on_this_object("unbind({})".format(_format_object_to_es(eventName)))
def setTimeout(self, eventName, function, milliseconds):
"""
:type eventName: str
:type function: any
:type milliseconds: float
"""
self._check_type(eventName, str, 'arg "eventName" of function "ProjectItem.setTimeout"')
self._check_type(function, any, 'arg "function" of function "ProjectItem.setTimeout"')
self._check_type(milliseconds, float, 'arg "milliseconds" of function "ProjectItem.setTimeout"')
self._eval_on_this_object("setTimeout({}, {}, {})".format(_format_object_to_es(eventName), _format_object_to_es(function), _format_object_to_es(milliseconds)))
def getFootageInterpretation(self):
return FootageInterpretation(**self._eval_on_this_object("getFootageInterpretation()"))
def setFootageInterpretation(self, interpretFootage):
"""
:type interpretFootage: FootageInterpretation
"""
self._check_type(interpretFootage, FootageInterpretation, 'arg "interpretFootage" of function "ProjectItem.setFootageInterpretation"')
return self._eval_on_this_object("setFootageInterpretation({})".format(_format_object_to_es(interpretFootage)))
def createSmartBin(self, name, query):
"""
:type name: str
:type query: str
"""
self._check_type(name, str, 'arg "name" of function "ProjectItem.createSmartBin"')
self._check_type(query, str, 'arg "query" of function "ProjectItem.createSmartBin"')
self._eval_on_this_object("createSmartBin({}, {})".format(_format_object_to_es(name), _format_object_to_es(query)))
def createBin(self, name):
"""
:type name: str
"""
self._check_type(name, str, 'arg "name" of function "ProjectItem.createBin"')
return ProjectItem(**self._eval_on_this_object("createBin({})".format(_format_object_to_es(name))))
def renameBin(self, name):
"""
:type name: str
"""
self._check_type(name, str, 'arg "name" of function "ProjectItem.renameBin"')
return self._eval_on_this_object("renameBin({})".format(_format_object_to_es(name)))
def deleteBin(self):
self._eval_on_this_object("deleteBin()")
def moveBin(self, destination):
"""
:type destination: ProjectItem
"""
self._check_type(destination, ProjectItem, 'arg "destination" of function "ProjectItem.moveBin"')
self._eval_on_this_object("moveBin({})".format(_format_object_to_es(destination)))
def getXMPMetadata(self):
return self._eval_on_this_object("getXMPMetadata()")
def setXMPMetadata(self, buffer):
"""
:type buffer: str
"""
self._check_type(buffer, str, 'arg "buffer" of function "ProjectItem.setXMPMetadata"')
return self._eval_on_this_object("setXMPMetadata({})".format(_format_object_to_es(buffer)))
def getProjectMetadata(self):
return self._eval_on_this_object("getProjectMetadata()")
def setProjectMetadata(self, newMetadata, updatedFields):
"""
:type newMetadata: str
:type updatedFields: list
"""
self._check_type(newMetadata, str, 'arg "newMetadata" of function "ProjectItem.setProjectMetadata"')
self._check_type(updatedFields, list, 'arg "updatedFields" of function "ProjectItem.setProjectMetadata"')
self._eval_on_this_object("setProjectMetadata({}, {})".format(_format_object_to_es(newMetadata), _format_object_to_es(updatedFields)))
def getProjectColumnsMetadata(self):
return self._eval_on_this_object("getProjectColumnsMetadata()")
def getMarkers(self):
return MarkerCollection(**self._eval_on_this_object("getMarkers()"))
def refreshMedia(self):
return self._eval_on_this_object("refreshMedia()")
def getMediaPath(self):
return self._eval_on_this_object("getMediaPath()")
def canChangeMediaPath(self):
return self._eval_on_this_object("canChangeMediaPath()")
def changeMediaPath(self, mediaPath, overrideChecks):
"""
:type mediaPath: str
:type overrideChecks: bool
"""
self._check_type(mediaPath, str, 'arg "mediaPath" of function "ProjectItem.changeMediaPath"')
self._check_type(overrideChecks, bool, 'arg "overrideChecks" of function "ProjectItem.changeMediaPath"')
return self._eval_on_this_object("changeMediaPath({}, {})".format(_format_object_to_es(mediaPath), _format_object_to_es(overrideChecks)))
def select(self):
self._eval_on_this_object("select()")
def setOverridePixelAspectRatio(self, numerator, denominator):
"""
:type numerator: float
:type denominator: float
"""
self._check_type(numerator, float, 'arg "numerator" of function "ProjectItem.setOverridePixelAspectRatio"')
self._check_type(denominator, float, 'arg "denominator" of function "ProjectItem.setOverridePixelAspectRatio"')
return self._eval_on_this_object("setOverridePixelAspectRatio({}, {})".format(_format_object_to_es(numerator), _format_object_to_es(denominator)))
def setOverrideFrameRate(self, frameRate):
"""
:type frameRate: float
"""
self._check_type(frameRate, float, 'arg "frameRate" of function "ProjectItem.setOverrideFrameRate"')
return self._eval_on_this_object("setOverrideFrameRate({})".format(_format_object_to_es(frameRate)))
def setScaleToFrameSize(self):
self._eval_on_this_object("setScaleToFrameSize()")
def createSubClip(self, name, startTime, endTime, hasHardBoundaries, takeVideo, takeAudio):
"""
:type name: str
:type startTime: Object
:type endTime: Object
:type hasHardBoundaries: float
:type takeVideo: float
:type takeAudio: float
"""
self._check_type(name, str, 'arg "name" of function "ProjectItem.createSubClip"')
self._check_type(hasHardBoundaries, float, 'arg "hasHardBoundaries" of function "ProjectItem.createSubClip"')
self._check_type(takeVideo, float, 'arg "takeVideo" of function "ProjectItem.createSubClip"')
self._check_type(takeAudio, float, 'arg "takeAudio" of function "ProjectItem.createSubClip"')
return ProjectItem(**self._eval_on_this_object("createSubClip({}, {}, {}, {}, {}, {})".format(_format_object_to_es(name), _format_object_to_es(startTime), _format_object_to_es(endTime), _format_object_to_es(hasHardBoundaries), _format_object_to_es(takeVideo), _format_object_to_es(takeAudio))))
def findItemsMatchingMediaPath(self, matchString, ignoreSubclips):
"""
:type matchString: str
:type ignoreSubclips: float
"""
self._check_type(matchString, str, 'arg "matchString" of function "ProjectItem.findItemsMatchingMediaPath"')
self._check_type(ignoreSubclips, float, 'arg "ignoreSubclips" of function "ProjectItem.findItemsMatchingMediaPath"')
return Array(**self._eval_on_this_object("findItemsMatchingMediaPath({}, {})".format(_format_object_to_es(matchString), _format_object_to_es(ignoreSubclips))))
def attachProxy(self, mediaPath, isHiRes):
"""
:type mediaPath: str
:type isHiRes: float
"""
self._check_type(mediaPath, str, 'arg "mediaPath" of function "ProjectItem.attachProxy"')
self._check_type(isHiRes, float, 'arg "isHiRes" of function "ProjectItem.attachProxy"')
return self._eval_on_this_object("attachProxy({}, {})".format(_format_object_to_es(mediaPath), _format_object_to_es(isHiRes)))
def hasProxy(self):
return self._eval_on_this_object("hasProxy()")
def getProxyPath(self):
return self._eval_on_this_object("getProxyPath()")
def canProxy(self):
return self._eval_on_this_object("canProxy()")
def isSequence(self):
"""
Returns whether the projectItem represents a sequence.@returns true, if projectItem is a sequence.
"""
return self._eval_on_this_object("isSequence()")
def startTime(self):
return Time(**self._eval_on_this_object("startTime()"))
def videoComponents(self):
""" Return Master effects on project item """
return ComponentCollection(**self._eval_on_this_object("videoComponents()"))
def setStartTime(self, arg1):
"""
:type arg1: Object
"""
self._eval_on_this_object("setStartTime({})".format(_format_object_to_es(arg1)))
def clearInPoint(self, mediaType):
"""
:type mediaType: float
"""
self._check_type(mediaType, float, 'arg "mediaType" of function "ProjectItem.clearInPoint"')
self._eval_on_this_object("clearInPoint({})".format(_format_object_to_es(mediaType)))
def setInPoint(self, arg1, mediaType):
"""
:type arg1: Object
:type mediaType: float
"""
self._check_type(mediaType, float, 'arg "mediaType" of function "ProjectItem.setInPoint"')
self._eval_on_this_object("setInPoint({}, {})".format(_format_object_to_es(arg1), _format_object_to_es(mediaType)))
def getInPoint(self, mediaType):
"""
:type mediaType: float
"""
self._check_type(mediaType, float, 'arg "mediaType" of function "ProjectItem.getInPoint"')
return Time(**self._eval_on_this_object("getInPoint({})".format(_format_object_to_es(mediaType))))
def clearOutPoint(self, mediaType):
"""
:type mediaType: float
"""
self._check_type(mediaType, float, 'arg "mediaType" of function "ProjectItem.clearOutPoint"')
self._eval_on_this_object("clearOutPoint({})".format(_format_object_to_es(mediaType)))
def setOutPoint(self, arg1, mediaType):
"""
:type arg1: Object
:type mediaType: float
"""
self._check_type(mediaType, float, 'arg "mediaType" of function "ProjectItem.setOutPoint"')
self._eval_on_this_object("setOutPoint({}, {})".format(_format_object_to_es(arg1), _format_object_to_es(mediaType)))
def getOutPoint(self, mediaType):
"""
:type mediaType: float
"""
self._check_type(mediaType, float, 'arg "mediaType" of function "ProjectItem.getOutPoint"')
return Time(**self._eval_on_this_object("getOutPoint({})".format(_format_object_to_es(mediaType))))
def setColorLabel(self, color):
"""
:param color: color id
:type color: int
"""
self._eval_on_this_object("setColorLabel({})".format(_format_object_to_es(color)))
def getColorLabel(self):
return self._eval_on_this_object("getColorLabel()")
def isOffline(self):
return self._eval_on_this_object("isOffline()")
def setOffline(self):
return self._eval_on_this_object("setOffline()")
def saveProjectSnapshot(self):
return self._eval_on_this_object("saveProjectSnapshot()")
def isAdjustmentLayer(self):
return self._eval_on_this_object("isAdjustmentLayer()")
def isReference(self):
return self._eval_on_this_object("isReference()")
class ProjectItemCollection(PymiereBaseCollection):
def __init__(self, pymiere_id):
super(ProjectItemCollection, self).__init__(pymiere_id, "numItems")
def __getitem__(self, index):
return ProjectItem(**super(ProjectItemCollection, self).__getitem__(index))
def __iter__(self):
return iter([self.__getitem__(i) for i in range(len(self))])
class SequenceCollection(PymiereBaseCollection):
def __init__(self, pymiere_id):
super(SequenceCollection, self).__init__(pymiere_id, "numSequences")