mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Jakub comments
This commit is contained in:
parent
7a3aaa5408
commit
9d2fc2fca4
2 changed files with 4 additions and 14 deletions
|
|
@ -651,16 +651,6 @@ def get_color_management_preferences():
|
|||
}
|
||||
|
||||
|
||||
def get_current_asset_doc():
|
||||
"""Get asset document of the current asset. """
|
||||
|
||||
project_name = get_current_project_name()
|
||||
asset_name = get_current_asset_name()
|
||||
asset_doc = get_asset_by_name(project_name, asset_name)
|
||||
|
||||
return asset_doc
|
||||
|
||||
|
||||
def get_resolution_from_doc(doc):
|
||||
"""Get resolution from the given asset document. """
|
||||
|
||||
|
|
@ -683,7 +673,7 @@ def set_camera_resolution(camera, asset_doc=None):
|
|||
"""Apply resolution to camera from asset document of the publish"""
|
||||
|
||||
if not asset_doc:
|
||||
asset_doc = get_current_asset_doc()
|
||||
asset_doc = get_current_project_asset()
|
||||
|
||||
resolution = get_resolution_from_doc(asset_doc)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from openpype.hosts.houdini.api.lib import (
|
|||
get_camera_from_container,
|
||||
set_camera_resolution
|
||||
)
|
||||
|
||||
from openpype.pipeline.context_tools import get_current_project_asset
|
||||
|
||||
class SetCameraResolution(InventoryAction):
|
||||
|
||||
|
|
@ -13,13 +13,13 @@ class SetCameraResolution(InventoryAction):
|
|||
|
||||
@staticmethod
|
||||
def is_compatible(container):
|
||||
print(container)
|
||||
return (
|
||||
container.get("loader") == "CameraLoader"
|
||||
)
|
||||
|
||||
def process(self, containers):
|
||||
asset_doc = get_current_project_asset()
|
||||
for container in containers:
|
||||
node = container["node"]
|
||||
camera = get_camera_from_container(node)
|
||||
set_camera_resolution(camera)
|
||||
set_camera_resolution(camera, asset_doc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue