Implement Set Asset Resolution

This commit is contained in:
Roy Nieterau 2022-09-19 18:03:06 +02:00
parent c965b35549
commit 4154f76830
2 changed files with 19 additions and 2 deletions

View file

@ -77,6 +77,21 @@ def set_framerange():
handle_end=handle_end)
def set_resolution():
"""Set Comp's defaults"""
asset_doc = get_current_project_asset()
width = asset_doc["data"]["resolutionWidth"]
height = asset_doc["data"]["resolutionHeight"]
comp = get_current_comp()
print("Setting comp frame format resolution to {}x{}".format(width,
height))
comp.SetPrefs({
"Comp.FrameFormat.Width": width,
"Comp.FrameFormat.Height": height,
})
def get_additional_data(container):
"""Get Fusion related data for the container

View file

@ -9,8 +9,9 @@ from openpype.hosts.fusion.scripts import (
set_rendermode,
duplicate_with_inputs
)
from openpype.hosts.fusion.api import (
set_framerange
from openpype.hosts.fusion.api.lib import (
set_framerange,
set_resolution
)
from openpype.pipeline import legacy_io
@ -185,6 +186,7 @@ class OpenPypeMenu(QtWidgets.QWidget):
def on_set_resolution_clicked(self):
print("Clicked Reset Resolution")
set_resolution()
def on_set_framerange_clicked(self):
print("Clicked Reset Framerange")