qmasingarbe / pymiere

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

How can I get this to work on a Mac? #11

Closed b-a0 closed 3 years ago

b-a0 commented 3 years ago

From the function in exe_utils.py I understand this library is written for Windows.

Does anybody know if (and how) I can change this so it works on a Mac?

qmasingarbe commented 3 years ago

Pymiere is currently only supported on Windows, most of the exe_utils.py code is indeed windows specific and other part of the code may not be compatible. As I don't own a Mac, I can't help you with this issue... You could try to reimplement the exe_utils code yourself and I will gladly merge it into the project.

BigRoy commented 3 years ago

@qmasingarbe would you happen to know whether the .zxp files (specifically the Adobe add-on) itself would be cross-OS compatible? If that's the case, I can set up a branch for you @b-a0 where you'd just have to point to the Premiere executable with an environment variable, e.g. PYMIERE_PREMIERE_EXECUTABLE so that it skips all the exe_utils where it tries to retrieve it automagically.

The only other thing would be to cross-OS check whether Premiere is currently running and swapping it out here. Which could be doing either pgrep or using something like psutil.

Unfortunately I don't have Mac either to test it out, so developing it would be hard to "debug and try". What's your programming level @b-a0? I'd be happy to see if some hints could point you in the right direction.

b-a0 commented 3 years ago

@BigRoy Thanks for thinking with me and offering your help. My programming level is hard to gauge, I can comfortably create scripts with high level libraries like pandas and plotly and can do some batch work with bash and powershell, but have little experience with proper (object oriented) programming. I think I could manage setting environment variables and checking if Premiere is running though, so let me know if we can forward with this.

In the meantime I've downloaded VSCode to use ExtendScript directly, but I think it would still be nice to make pymiere compatible with OS X.

fixinPost commented 3 years ago

Hi I'm a big fan of PymiereI feel like pymiere can fundamentally change Premiere Pro workflows, so if there's anything I can do to help with porting it to OS X, I offer my help. I have some python experience and a macbook with Catalina I could help test on or do research.

qmasingarbe commented 3 years ago

I @fixinPost , thanks for offering your help! Can you start by installing the Premiere Pro extension for pymiere (multiple installation method can be found in the readme ) Then download the pymiere python lib from the tests branch of this repo where I bypassed some code for non Windows system. Try running some basic code like

import pymiere
print(pymiere.objects.app.isDocumentOpen())

Let me know if thoses steps worked well. We will then try to go further.

qmasingarbe commented 3 years ago

Hi @fixinPost @b-a0 @BigRoy , It works! I've been busy for the last few days figuring out how to make pymierework on macOS and finally managed to sort everything out!

I installed a VM running macOS Catalina and did a bunch of testing and development. The lib and all the demos are now working on mac and I updated the readme with installation instructions.

The new version is available via pip. Please open an issue or send me an email if any bugs or weird behavior appear on mac and we will figure them out.

Many thanks

b-a0 commented 3 years ago

Fantastic, I've tested demo.py and everything works!

SergiHernandez commented 3 years ago

So the exe_utils functions are developed and tested to be compatible for both Windows and macOS. But (as an inexperienced guy in operative systems and libraries) my question is: should the other functions work fine regardless of the operative system? I mean the functions related to actual premiere workflows once it is running (importing media, exporting media, placing media in the timeline...). Thanks in advance.

qmasingarbe commented 3 years ago

Hi @SergiHernandez everything should work on both platform including the Premiere Pro part. I tested all the example code on Mac as well as on Windows. The only difference is the path syntax on Windows that must use backslashes rather than simple slashes on Mac for python to work with.

SergiHernandez commented 3 years ago

@qmasingarbe Perfect!! Thanks for the clarification.