Houdini publish USD Asset from look department fails

We’re trying to publish a usdLayer from the look department but we get this error:

DEBUG: Response <RestApiResponse [200]>
Traceback (most recent call last):
  File "C:\Users\Markus\AppData\Local\Ynput\AYON\dependency_packages\ayon_2502101448_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Users\Markus\AppData\Local\Ynput\AYON\addons\core_1.1.0\ayon_core\plugins\publish\extract_usd_layer_contributions.py", line 643, in process
    default_prim = sdf_layer.defaultPrim
                   ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'defaultPrim'

Ther are already several versions from the model department. This would be the first publish from look department.

There is already a Master_xxx.usd file which references a Master_model_xxx.usd file which references a Master_usdMain_xxx.usd file.
This asset works and is used in Shotfile.

What could cause this issue? And how can I investigate the issue?

What ayon-houdini version are you using?

In some cases the LOP nodes were unable to previously get the LopNode.stage() and it would return None instead and it couldn’t be detected. SideFX added some new methods in recent Houdini releases (so you may also need a recent Hou 20.5 build) which would avoid that issue completely.

Additionally, there have been some other fixes in this area so it’d be good to know whether this issue still persists on recent releases.

I noticed you’re using ayon-core 1.1.0 which is also a bit old. So likely the ayon-houdini addon you’re using may also be outdated?

Sorry for the late reply. I was on vacation.

ayon-houdini version was: 0.4.2 and now is 0.5.0
ayon-core version was: 1.1.0 and now is 1.2.0
Running on Ayon 1.8.2+202504291155

The issue persists after updating.

I tried to break the issue down. I just load the asset from the modeling stage, add a layer break, and publish it in the Surface (or Look) stage. The original file would have a materiallibrary LOP and a materiallinker LOP after the layerbreak.

EDIT:
I now started a new houdini file for the task, created an empty primitive, and get the same error.

AttributeError: 'NoneType' object has no attribute 'defaultPrim'

I wonder, why does it complain about defult prim?
Also, why don’t these validators fail?


On my side, I need to set default prim (to the same name of my AYON folder where I’m publishing). I do this when publishing models and it’s propagated to the look when loading model.

and when publishing from another folder that doesn’t have the same name of my default prim then I need to use graft node.

I have had this error, but only inconsistently and never reproducable unfortunately. The issue happens when requesting the USD stage is returned as None by Houdini from a LOP node… Without any error.

I believe the issue is also fixed in the most recent production builds of Houdini 20.5 because we are using a new way to apply context options as we request the stage that SideFX was kind enough to implement on our feature request.

What’s your Houdini version?

Houdini 20.5.550 (because of redshift dependency)
What version includes the new feature?

That version should be including the fix already. Do you have a very simple scene that can consistently reproduce the issue/error? If so, can you share the scene?

Having a reproducable would be perfect.

Do note, I am at FMX this week so likely won’t be checking any of the files until next week.

I’m afraind I can’t share the file. And I was unable to reproduce in a simple file.

However, i was able to fix the issue.
I found that there was a stray publish in the DB for the look layer (v001) which shouldn’t be there.
get_last_publish() returned a path to an asset that doesn’t exist on disk yet. Which resulted in the 'NoneType' object has no attribute 'defaultPrim'

Removing the product via API resolved the issue.