iluvcapra / py-ptsl

Native Python PTSL (Pro Tools Scripting Library) RPC interface
BSD 3-Clause "New" or "Revised" License
27 stars 6 forks source link

Error importing session data with import_data #39

Open ronronks opened 1 month ago

ronronks commented 1 month ago

Error importing session data with import_data

from ptsl import open_engine

with open_engine(company_name="Name", application_name="Default") as eng:
    data = eng.import_data(
            session_path='session.ptx'
        )    
    data.import_data()
Traceback (most recent call last):
  File "/Users/ron/dev/ptsl.py", line 7, in <module>
    data.import_data()
  File "/Users/ron/dev/.intel_env/lib/python3.11/site-packages/ptsl/builders/import_builder.py", line 133, in import_data
    self._engine.client.run(op)
  File "/Users/ron/dev/.intel_env/lib/python3.11/site-packages/ptsl/client.py", line 161, in run
    raise CommandError(command_errors.errors)
ptsl.errors.CommandError: ErrType 126: PT_InvalidParameter (Unable to complete the command due to an unknown error.)

Platform:

StephenMachete commented 2 weeks ago

Hi, the error is caused because you're calling it wrong.

This code should "work":

from ptsl import open_engine

with open_engine(company_name="Name", application_name="Default") as eng:
    eng.import_data(session_path='session.ptx')

You basically just send the command to import session.ptx.

Now you shouldn't get an error, but then for me it does nothing. I think the session import builder in the background maybe isn't functioning properly after Avid updates. Unfortunately i'm not really into this part, so i don't know whats the problem right now.

Peace Steve