USD - lookdev and geo composed.

252 views
Skip to first unread message

Victor Barbosa

unread,
Aug 11, 2023, 12:31:18 AM8/11/23
to gaffer-dev
Hello good people,

I am trying to understand the USD lookdev workflow in Gaffer. 

Q: What I am trying to do:
R: Load a USD file that references both geometry and lookdev USD files in Gaffer.

- This is how I did it:
I created a Torus geo and exported as a USD binary file, then loaded the Torus back in Gaffer using a "SceneReader" node. Then in Gaffer I assigned a Cycles Shader to the Torus geo and used a "USDLayerWriter" node to write out a separate USD file for the  lookdev I just created. Finally using USD Python API I created a third USD file to compose the geo and the lookdev USD files together and then load it in Gaffer.

Once I loaded the USD file referencing both geo and lookdev files in Gaffer, I can see the Torus geo but there is no shader assigned to the geo. 
This is what I'm get in the terminal:
Warning (secondary thread): in _ReportErrors at line 2885 of /dependencies-7.0.0-source/USD/working/OpenUSD-23.05/pxr/usd/usd/stage.cpp -- In </Torus>: Unresolved reference prim path @./torus-look.usda@<defaultPrim> introduced by @./torus-asset.usd@</Torus> (instantiating stage on stage @./torus-asset.usd@ <0x7fa23c629100>)

I am probably missing something or maybe totally mistaken about the USD workflow, I am hoping for some help :D

I attached the files in case someone wants to check the content of the files.


Thank you so much.
Victor B.


torus-asset.usd
torus-look.usda
torus-geo.usd

John Haddon

unread,
Aug 11, 2023, 5:34:12 AM8/11/23
to gaffe...@googlegroups.com
On Fri, Aug 11, 2023 at 5:31 AM Victor Barbosa <vic...@animism.studio> wrote:
I am probably missing something or maybe totally mistaken about the USD workflow, I am hoping for some help :D

Hi Victor,
I think you've understood the workflow pretty well - there's just one small detail that's preventing your example from working. The `torus-look.usda` file doesn't have the `defaultPrim` metadata set, so the reference to it from `torus-asset.usd` needs to specify the prim path as well as the filename. I've attached an updated `torus-asset.usd` that includes the prim path and successfully loads the lookdev into Gaffer.
Hope that helps...
Cheers...
John

torus-asset.usd

Victor Barbosa

unread,
Aug 11, 2023, 1:06:36 PM8/11/23
to gaffer-dev
You're genius John, as always!

Thank you sooo much!

Victor Barbosa

unread,
Aug 11, 2023, 9:11:13 PM8/11/23
to gaffer-dev
It is me again :D


Alright, I did some tests and sadly I am not getting the results I am expecting, it is likely again I am missing something.

Just for context, I have a usd file for the geo, another for the lookdev and finally another file to compose the first 2 together.

This time I updated the lookdev in Gaffer with a procedural checker texture connected to the baseColor input of a Cycles BSDF shader and then I updated the lookdev usd file (torus-look.usda) with a "UsdLayerWrite" node. Please see image attached.

Next I used a "SceneReader" node to load the usd file that compose both geo and lookdev together (torus.usd) to check if the update I made to the lookdev would load, for some reason it is not working, the checked texture is not rendering, it only 
renders the geo with some base color.

I attached the updated files in case you need it.


Thank you again!
Screenshot from 2023-08-11 18-01-11.png
torus-look.usda
torus-geo.usdc
torus.usd

John Haddon

unread,
Aug 14, 2023, 6:08:59 AM8/14/23
to gaffe...@googlegroups.com
Hi Victor,
I don't know if I've misunderstood something, but `torus.usd` seems to render fine with a checker texture here :

image.png
Cheers...
John

--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/7be51694-a017-4c69-a5a2-dec4916616adn%40googlegroups.com.

Victor Barbosa

unread,
Aug 14, 2023, 5:35:22 PM8/14/23
to gaffer-dev
John,

I'm really sorry, it is works now with the latest Gaffer version (1.3.1.0). For some reason when I was using version Gaffer v1.3.0.0 would not load the usd with the checker texture, that's why I was confused. 
So it is working like your screen image.

Once more, many thanks for such a fantastic application. You and your team are wizards ;)

Message has been deleted

John Haddon

unread,
Sep 28, 2023, 4:57:59 AM9/28/23
to gaffe...@googlegroups.com
I'll start with the obvious question : do you have `torus-geo.usd` and `torus-look.usd` files in the same folder as `torus-asset.usd`?

On Wed, Sep 27, 2023 at 7:02 PM 'mario naumovski' via gaffer-dev <gaffe...@googlegroups.com> wrote:
Hey John, I was doing some tests and downloaded the asset you've provided.
The torus doesn't load at all and this is the message I get in the terminal window: Warning (secondary thread): in _ReportErrors at line 2885 of C:\BuildAgent\work\42df042e3b1ea167\USD\working\OpenUSD-23.05\pxr\usd\usd\stage.cpp -- In </torus_asset>: Could not open asset @c:/Users/Mario/Downloads/torus-look.usda@ for reference introduced by @c:/Users/Mario/Downloads/torus-asset.usd@</torus_asset>. (instantiating stage on stage @c:/Users/Mario/Downloads/torus-asset.usd@ <000001D71ED7F8A0>)
Warning (secondary thread): in _ReportErrors at line 2885 of C:\BuildAgent\work\42df042e3b1ea167\USD\working\OpenUSD-23.05\pxr\usd\usd\stage.cpp -- In </torus_asset>: Could not open asset @c:/Users/Mario/Downloads/torus-geo.usd@ for reference introduced by @c:/Users/Mario/Downloads/torus-asset.usd@</torus_asset>. (instantiating stage on stage @c:/Users/Mario/Downloads/torus-asset.usd@ <000001D71ED7F8A0>)

Could you provide some help with this?
Thanks

mario naumovski

unread,
Sep 28, 2023, 5:08:52 AM9/28/23
to gaffer-dev
Yes John they were all in the same folder when I did the test.

mario naumovski

unread,
Sep 28, 2023, 5:16:17 AM9/28/23
to gaffer-dev
I had one more question, what would the typical USD workflow be for updating the asset.usda file automatically?. By this I mean what would be the best approach to update the latest or published version of the model, look etc. inside the asset.usda file as a reference? I'd appreciate any sample code for creating a Composition through Python, as I didn't find too many resources on this. 

Thanks!

John Haddon

unread,
Sep 28, 2023, 5:45:21 AM9/28/23
to gaffe...@googlegroups.com
I thought maybe the problem could be Windows related, but I've just booted into Windows, downloaded the USD files and the latest Gaffer and it works OK for me.

image.png
image.png

The error itself is coming from USD rather than Gaffer, so if the files truly are all there, I don't really know what could be causing it.

I had one more question, what would the typical USD workflow be for updating the asset.usda file automatically?

The ones I'm aware of are to write a custom resolver that can resolve to a different version of the model or lookdev on the fly. Or to rewrite the asset file every time you want it to refer to something else. These are generic USD questions though, and there are much better resources than gaffer-dev for that.
Cheers...
John
Reply all
Reply to author
Forward
0 new messages