hound cleanup 🐶🧽🧺 I.

This commit is contained in:
Ondrej Samohel 2021-07-16 12:58:16 +02:00 committed by Ondřej Samohel
parent c47e8808c8
commit c85bd30e1b
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
6 changed files with 27 additions and 37 deletions

View file

@ -6,16 +6,13 @@ import contextlib
import hou
from pyblish import api as pyblish
from avalon import api as avalon
from avalon.houdini import pipeline as houdini
import openpype.hosts.houdini
from openpype.hosts.houdini.api import lib
from openpype.lib import (
any_outdated,
update_task_from_path
any_outdated
)
from .lib import get_asset_fps
@ -29,6 +26,7 @@ LOAD_PATH = os.path.join(PLUGINS_DIR, "load")
CREATE_PATH = os.path.join(PLUGINS_DIR, "create")
INVENTORY_PATH = os.path.join(PLUGINS_DIR, "inventory")
def install():
pyblish.register_plugin_path(PUBLISH_PATH)
@ -36,7 +34,7 @@ def install():
avalon.register_plugin_path(avalon.Creator, CREATE_PATH)
log.info("Installing callbacks ... ")
avalon.on("init", on_init)
# avalon.on("init", on_init)
avalon.before("save", before_save)
avalon.on("save", on_save)
avalon.on("open", on_open)
@ -50,11 +48,10 @@ def install():
"review"
]
# Expose Houdini husdoutputprocessors
hou_setup_pythonpath = os.path.join(os.path.dirname(PACKAGE_DIR),
"setup", "houdini", "pythonpath")
print("Adding PYTHONPATH: %s" % hou_setup_pythonpath)
sys.path.append(hou_setup_pythonpath)
# add houdini vendor packages
hou_pythonpath = os.path.join(os.path.dirname(HOST_DIR), "vendor")
sys.path.append(hou_pythonpath)
# Set asset FPS for the empty scene directly after launch of Houdini
# so it initializes into the correct scene FPS
@ -69,8 +66,6 @@ def on_save(*args):
avalon.logger.info("Running callback on save..")
update_task_from_path(hou.hipFile.path())
nodes = lib.get_id_required_nodes()
for node, new_id in lib.generate_ids(nodes):
lib.set_id(node, new_id, overwrite=False)
@ -84,14 +79,12 @@ def on_open(*args):
avalon.logger.info("Running callback on open..")
update_task_from_path(hou.hipFile.path())
# Validate FPS after update_task_from_path to
# ensure it is using correct FPS for the asset
lib.validate_fps()
if any_outdated():
from ..widgets import popup
from openpype.widgets import popup
log.warning("Scene has outdated content.")

View file

@ -2,9 +2,8 @@
import contextlib
from avalon import io
import logging
from avalon.vendor.Qt import QtCore, QtGui
from Qt import QtCore, QtGui
from avalon.tools.widgets import AssetWidget
from avalon import style

View file

@ -19,7 +19,7 @@ class CreateRedshiftROP(houdini.Creator):
subset_no_prefix = subset[len(self.family):]
subset_no_prefix = subset_no_prefix[0].lower() + subset_no_prefix[1:]
self.data["subset"] = subset_no_prefix
# Add chunk size attribute
self.data["chunkSize"] = 10

View file

@ -1,7 +1,6 @@
import re
from avalon import api
from avalon.houdini import lib
import hou

View file

@ -1,5 +1,4 @@
from avalon import api
from avalon.houdini import lib
import hou

View file

@ -23,40 +23,40 @@ def transfer_non_default_values(src, dest, ignore=None):
"""
import hou
src.updateParmStates()
src.updateParmStates()
for parm in src.allParms():
if ignore and parm.name() in ignore:
continue
# If destination parm does not exist, ignore..
dest_parm = dest.parm(parm.name())
if not dest_parm:
continue
# Ignore values that are currently at default
if parm.isAtDefault() and dest_parm.isAtDefault():
continue
if not parm.isVisible():
# Ignore hidden parameters, assume they
# are implementation details
continue
expression = None
try:
expression = parm.expression()
except hou.OperationFailed:
# No expression present
pass
if expression is not None and ARCHIVE_EXPRESSION in expression:
# Assume it's part of the automated connections that the Alembic Archive
# makes on loading of the camera and thus we do not want to transfer
# the expression
# Assume it's part of the automated connections that the
# Alembic Archive makes on loading of the camera and thus we do
# not want to transfer the expression
continue
# Ignore folders, separators, etc.
ignore_types = {
hou.parmTemplateType.Toggle,
@ -68,7 +68,7 @@ def transfer_non_default_values(src, dest, ignore=None):
}
if parm.parmTemplate().type() in ignore_types:
continue
print("Preserving attribute: %s" % parm.name())
dest_parm.setFromParm(parm)
@ -155,13 +155,13 @@ class CameraLoader(api.Loader):
# Apply values to the new camera
new_camera = self._get_camera(node)
transfer_non_default_values(temp_camera,
transfer_non_default_values(temp_camera,
new_camera,
# The hidden uniform scale attribute
# gets a default connection to "icon_scale"
# just skip that completely
# The hidden uniform scale attribute
# gets a default connection to
# "icon_scale" just skip that completely
ignore={"scale"})
temp_camera.destroy()
def remove(self, container):