Assign materials ahead of importing them to stage

   2115   6   2
User Avatar
Member
120 posts
Joined: Jan. 2012
Offline
Hi,

Problem:

I use Assign Material to do what it is supposed to do, but if graph is time dependent, it does it on every frame. I want to assign them just once, because it can take quite some time on large scene during exporting USD file.

Attempted solution:

1. Layout my graph so that my non time dependent operations are first. But that is very restrictive and not intuitive.

2. Move Assign Material directly after Import SOP, but at that point materials do not exist in graph, so I get error. Is it possible to assign it ahead of material creation? Kinda a promise of where mat will be once graph is evaluated for rendering?


Is there a better way to force one time evaluation?

Thanks!

Edited by tas3d - April 25, 2021 22:08:31

Attachments:
Screenshot 2021-04-25 215828.jpg (484.0 KB)

Michal Tas Maciejewski @ www.vfxtricks.com
User Avatar
Staff
4438 posts
Joined: July 2005
Offline
I'd try feeding the time-dependent data into a timeshift LOP with the "Frame" set to 1. This eliminates the time dependency. You probably also want to turn off the "Evaluate Attributes at Specified Tim" toggle because that will just do some processing on the data which you don't care about. Then into a layer break, so that upstream data is not going to get baked in with your material assignments. Then the material assignment. Then bring this branch's data back into the main chain with a sublayer like you've done above. Because of the layer break, only the material assignments will be brought in as a sublayer. But the Material Assignment LOP will have access to the full stage in order to make its assignments (avoiding the errors from your image).

I hope that makes sense?
User Avatar
Member
120 posts
Joined: Jan. 2012
Offline
Thanks for reply and suggestions.
Would you mind explaining it on the provided example hip? You talk about USD concepts that I am not familiar with.

Attachments:
matAssignTime.hipnc (177.8 KB)

Michal Tas Maciejewski @ www.vfxtricks.com
User Avatar
Member
120 posts
Joined: Jan. 2012
Offline
Actually I gave it another try and it does make sense. Still need to double check it in production.
Take a look at screen, is this what you were talking about?

Attachments:
Screenshot 2021-04-26 093957.jpg (48.0 KB)

Michal Tas Maciejewski @ www.vfxtricks.com
User Avatar
Staff
4438 posts
Joined: July 2005
Offline
Yep, that's exactly what I meant.
User Avatar
Member
240 posts
Joined: Oct. 2014
Offline
This is interesting. I've been trying to do something similar and this helps clarify it. Questions:

Michal, in your example, what is the ConfigureLayer LOP changing? And are you targeting specific Scenegraph Prims with the TimeShift?
- Tim Crowson
Technical/CG Supervisor
User Avatar
Member
120 posts
Joined: Jan. 2012
Offline
Hi Tim,

Once I turn off Eval Attrib at Spec Time, I don't need to target any primitives.
ConfigureLayer LOP is just setting save path, so SubLayer doesnt complain about save location.
Michal Tas Maciejewski @ www.vfxtricks.com
  • Quick Links