qmasingarbe / pymiere

Python for Premiere pro
GNU General Public License v3.0
353 stars 46 forks source link

Following Motion Graphics Example For Adding Text Results in Error #43

Closed shaibruhis closed 2 years ago

shaibruhis commented 2 years ago

Following the Motion Graphics Example for adding text I get the following error:

>>> mgt_clip.getMGTComponent()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/pymiere/objects/premiere_objects.py", line 5773, in getMGTComponent
    return Component(**self._eval_on_this_object("getMGTComponent()"))
TypeError: type object argument after ** must be a mapping, not NoneType
shaibruhis commented 2 years ago

The problem (also described here) is the .mogrt file I was importing was a ppro .mogrt file and not an ae .mogurt file. I wasn't aware this would cause a problem and am not sure how to tell the difference (other than dir/file naming) but mgt_clip.getMGTComponent() only works for ae .mogrt files

qmasingarbe commented 2 years ago

Hi @shaibruhis , I fixed the crash for mgt_clip.getMGTComponent(). It should now properly return None to match the behavior of the Premiere API (ccfa2d74c678f066bae154752a0b62c9e9296536). I seems indeed that there are two types of Motion Graphics templates, you can difference them in the editing interface where some are simple an assembly of Premiere Pro effects and other are more complicated options exposed from After Effects. see screenshot The first type will return None for the getMGTComponent because you can directly access the effects parameters via the Clip.components attribute. Note that both of them will return True to Clip.isMGT() I will update my documentation to explain this!