ynput / ayon-core

Apache License 2.0
28 stars 34 forks source link

Houdini: Workfile path validator crashes when alembic is loaded as Alembic Archive #522

Closed antirotor closed 3 months ago

antirotor commented 5 months ago

Is there an existing issue for this?

Current Behavior:

Whenever scene contains nodes with file path parameter that has an expression on it, validate_workfile_paths crashes when trying to get unexpanded string. This can be replicated by loading alembic as Alembic Archive (where sub-nodes have file path constrainted by expression to common root node).

Expected Behavior:

Validator should be able to handle this case, probably by skipping parameter when there are keyframes or expression on it.

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Load something as Alembic Archive into Houdini
  2. Publish something with workfile instance enabled and validate file paths on

Are there any labels you wish to add?

Relevant log output:

Traceback (most recent call last):
  File "C:\Users\foo\AppData\Local\Ynput\AYON\dependency_packages\ayon_2403071252_windows.zip\dependencies\pyblish\plugin.py", line 527, in __explicit_process
    runner(*args)
  File "C:\Users\foo\AppData\Local\Ynput\AYON\addons\openpype_3.18.7\openpype\hosts\houdini\plugins\publish\validate_workfile_paths.py", line 28, in process
    invalid = self.get_invalid()
  File "C:\Users\foo\AppData\Local\Ynput\AYON\addons\openpype_3.18.7\openpype\hosts\houdini\plugins\publish\validate_workfile_paths.py", line 72, in get_invalid
    if any(
  File "C:\Users\foo\AppData\Local\Ynput\AYON\addons\openpype_3.18.7\openpype\hosts\houdini\plugins\publish\validate_workfile_paths.py", line 74, in <genexpr>
    if v in param.unexpandedString()):
  File "C:\PROGRA~1/SIDEEF~1/HOUDIN~1.625/houdini/python3.10libs\hou.py", line 70354, in unexpandedString
    return _hou.Parm_unexpandedString(self)
hou.OperationFailed: The attempted operation failed.
Cannot get unexpanded string for parms with keyframes

Additional context:

Note that there is OpenPype addon used in the traceback, but it applies even to latest avalon-core 0.3.x

[cuID:AY-5399]

BigRoy commented 5 months ago

Ah, I just fixed this today in another test - by skipping any parm that returns any keyframes, e.g. if parm.keyframes(): continue

This was my added code:

            if param.keyframes():
                # Calling `.unexpandedString()` below fails if param has
                # keyframes - so for now we will skip those params. These are
                # e.g. present in `filecache` nodes.
                continue

I can set up a PR later today if needed.

I actually hit this issue if there was a filecache node anywhere in the scene. Which I think is due to sopoutput parm on that node being driven by other parms.