qmasingarbe / pymiere

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

Illegal Parameter type error with setValue #38

Closed seo-rii closed 1 year ago

seo-rii commented 2 years ago

Thank you for developing this module! I'd like to let you know because there's an issue. This issue occurs in the motion graphic template code in the example. The problem does not occur until mgt_component is obtained from the mgt clip, but if the value is of the dict type when the set value is called, the execution is stopped with an Illlegal Parameter type error. I am currently running Premier Pro 2021 and using Python 3.8 version. Below is an error message:

Position
{'pymiere_id': 'VCRAgJl6DO'}
Traceback (most recent call last):
  File "C:/Coding/premiere/main.py", line 70, in <module>
    prop.setValue(value, True)
  File "C:\Coding\venv\lib\site-packages\pymiere\objects\premiere_objects.py", line 4924, in setValue
    return self._eval_on_this_object("setValue({}, {})".format(_format_object_to_es(value), _format_object_to_es(updateUI)))
  File "C:\Coding\venv\lib\site-packages\pymiere\core.py", line 176, in _eval_on_this_object
    result = _eval_script_returning_object(line)
  File "C:\Coding\venv\lib\site-packages\pymiere\core.py", line 469, in _eval_script_returning_object
    result = eval_script(script, decode_json=True)
  File "C:\Coding\venv\lib\site-packages\pymiere\core.py", line 114, in eval_script
    raise ExtendScriptError(response_decoded)
pymiere.core.ExtendScriptError: 
Error at line 2 : Illegal Parameter type
 1  try{
 2  var tmp = $._pymiere['xa9jqbfCgf'].setValue({"""pymiere_id""": """VCRAgJl6DO"""}, true);
 3  if(typeof tmp === 'object' && tmp !== null){

I'd appreciate it if you could solve it!

qmasingarbe commented 2 years ago

Hi @Seo-Rii, sorry for the long wait... Unfortunately setting a dict type on a properties is not supported, this part of the API is a bit new. Although in the error message {'pymiere_id': 'VCRAgJl6DO'} looks like one of pymiere's representation of an object which should not happen. Could you please share the Motion Graphic Template file you are using for testing purposes (you can send it to q.masingarbe@gmail.com if you don't wish to share it publicly). In the mean time I'm installing Premiere 2021 so I can test it in your condition.

seo-rii commented 2 years ago

test.zip Here you are.

seo-rii commented 2 years ago

Is there any update about this?

qmasingarbe commented 2 years ago

Hi @Seo-Rii

There was indeed a bug where two dimmensional properties, like the Position, weren't properly considered as Array objects. I fixed it and can now manage to move the mogrt around. by editing this property

Two things to note about editing properties:

Let me now if you manage to make everything work this time!