mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
feat(resolve): launching with pre imported resolve python console
This commit is contained in:
parent
46c831e585
commit
0b4c4d017b
3 changed files with 63 additions and 0 deletions
26
pype/resolve/pre_python_console_script.py
Normal file
26
pype/resolve/pre_python_console_script.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env python
|
||||
import time
|
||||
from python_get_resolve import GetResolve
|
||||
|
||||
wait_delay = 2.5
|
||||
wait = 0.00
|
||||
ready = None
|
||||
while True:
|
||||
try:
|
||||
# Create project and set parameters:
|
||||
resolve = GetResolve()
|
||||
PM = resolve.GetProjectManager()
|
||||
P = PM.GetCurrentProject()
|
||||
if P.GetName() == "Untitled Project":
|
||||
ready = None
|
||||
else:
|
||||
ready = True
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
if ready is None:
|
||||
time.sleep(wait_delay)
|
||||
print(f"Waiting {wait}s for Resolve to be open inproject")
|
||||
wait += wait_delay
|
||||
else:
|
||||
break
|
||||
Loading…
Add table
Add a link
Reference in a new issue