mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Implement Set Asset Resolution
This commit is contained in:
parent
c965b35549
commit
4154f76830
2 changed files with 19 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue