You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.setLevel(settings["app"]["loglevel"])
classProxyLinker:
def__init__(self, jobs, linkable_types: list= ["Offline", "None"]):
self.jobs=jobsself.linkable_types=linkable_typesself.link_success= []
self.mismatch_fail= []
defproject_is_same(self):
""" Check that the project open in Resolve is the same one that was queued. """try:
resolve=ResolveObjects()
exceptexceptions.ResolveAPIConnectionError:
logger.error(
"Can't communicate with Resolve. Maybe it's closed?\n""Run `proxima queue` when you're ready to link your proxies later.",
exc_info=True,
)
returnFalsetry:
current_project=resolve.project.GetName()
exceptexceptions.ResolveNoCurrentProjectError:
logger.error(
"Can't get current Resolve project. Looks like Resolve may be closed.\n""Run `proxima queue` when you're ready to link your proxies later.",
exc_info=True,
)
returnFalseifcurrent_project!=self.jobs[0]["project"]:
logger.error(
f"Looks like you've changed projects. ('[red]{current_project}[/]' -> '[green{self.jobs[0]['project']}[/]')\n""Proxies can't be linked to a closed project.\n""Run `proxima queue` when you're ready to link your proxies later."
)
returnFalsereturnTruedefremove_unlinkable_jobs(self):
""" Remove jobs from the link queue that aren't in `linkable_types` This prevents relinking footage that is already linked according to Resolve. """self.jobs= [xforxinself.jobsifx["proxy_status"] inself.linkable_types]
ifnotself.jobs:
raiseexceptions.NoneLinkableError()
def__link_proxy_media(self, job):
""" Wrapper around Resolve's `LinkProxyMedia` API method. Args: job (): A Proxima Job Raises: exceptions.ResolveLinkMismatchError: Occurs when the method returns False. Unfortunately the method returns no error context beyond that. """ifnotjob["media_pool_item"].LinkProxyMedia(job["proxy_media_path"]):
raiseexceptions.ResolveLinkMismatchError(
proxy_file=job["proxy_media_path"]
)
deflink(self):
""" Iterate through media list and link each finished proxy with its media pool item. Args: jobs (list of dicts): queuable jobs with project, timeline and setting metadata linkable_types (list, optional): List of job `proxy_status` values to attempt link on. Defaults to ["Offline", "None"]. prompt_reiterate(bool, optional): If any links fail, prompt the user to fetch media pool items again by reiterating timelines. If prompt_rerender is enabled, prompt_reiterate runs first. prompt_rerender (bool, optional): If any links fail, prompt the user to re-queue them. Defaults to False. Returns: remaining_jobs (list of cits): the remaining queuable jobs that haven't been linked """logger.info(f"[cyan]Linking {len(self.jobs)} proxies[/]")
ifnotself.project_is_same():
core.app_exit(1, -1)
self.remove_unlinkable_jobs()
# Iterate through all available proxiesforjobinself.jobs:
logger.debug(f"[magenta]Attempting to link job:[/]\n{job}")
logger.info(f"[cyan]:link: '{job['file_name']}'")
try:
self.__link_proxy_media(job)
exceptexceptions.ResolveLinkMismatchError:
logger.error(
f"[red bold]:x: Failed to link '{job['file_name']}'[/]\n"f"[red]",
# exc_info=True,
)
self.mismatch_fail.append(job)
else:
logger.info(f"[green bold]:heavy_check_mark: Linked\n")
self.link_success.append(job)
ifself.link_success:
logger.debug(f"[magenta]Total link success:[/] {len(self.link_success)}")
ifself.mismatch_fail:
logger.error(f"[red]{len(self.mismatch_fail)} proxies failed to link!")
iflen(self.mismatch_fail) ==len(self.jobs):
logger.critical(
"[red bold]Oh dear. All the proxies failed to link.[/]\n""[red]Resolve might not like your encoding settings or something else is wrong.[/]\n"# TODO: Add troubleshooting wiki link here# Like so: `"[cyan]See [troubleshooting](link)"`# labels: enhancement
)
core.app_exit(1, -1)
1473221787aec22dafaf6ad78b8d4616837727c5
The text was updated successfully, but these errors were encountered:
Add troubleshooting wiki link here
Like so:
"[cyan]See [troubleshooting](link)"
proxima/proxima/queuer/link.py
Line 151 in 44c3d17
1473221787aec22dafaf6ad78b8d4616837727c5
The text was updated successfully, but these errors were encountered: