hi,
we have a python script that calulates the datawindowNDC based on attributes on the geometry.
It works as a prerender script but does not as a preframe script. Was curious to why that is.
prim = stage.GetPrimAtPath("/Render/rendersettings")
attr = prim.GetAttribute("dataWindowNDC")
attr.Set((0.1,0.7,0.6,0.8))
Using this as a test script. Is there a limitation in accessing rendersettings in preframe or is there something i could change to make it work?
thanks.
prerender vs preframe scripts
2272 4 3- frostfx
- Member
- 44 posts
- Joined: 5月 2017
- Offline
- goldleaf
- スタッフ
- 4200 posts
- Joined: 9月 2007
- Online
- frostfx
- Member
- 44 posts
- Joined: 5月 2017
- Offline
- robp_sidefx
- スタッフ
- 503 posts
- Joined: 6月 2020
- Offline
In husk, the prerender script is executed before the Hydra delegate is created and data from the rendersettings is extracted, so any (or at least most - there might be limits) manipulation at this point should work.
After that, there's a general assumption that the render settings won't change. We do assorted optimisations to group/partition the render products based on shared/differing characteristics (for example, if three products have the same resolution, they can be rendered together and then the AOVs split up appropriately). Allowing for the potential to change this from frame-to-frame would be detrimental to performance.
It's perhaps worth noting that in USD you can't author dataWindowNDC in a time-sampled way either. The schema enforces that this is a uniform value.
If you want this value to be animated, you'll need to render frame-by-frame and use a prerender script.
After that, there's a general assumption that the render settings won't change. We do assorted optimisations to group/partition the render products based on shared/differing characteristics (for example, if three products have the same resolution, they can be rendered together and then the AOVs split up appropriately). Allowing for the potential to change this from frame-to-frame would be detrimental to performance.
It's perhaps worth noting that in USD you can't author dataWindowNDC in a time-sampled way either. The schema enforces that this is a uniform value.
If you want this value to be animated, you'll need to render frame-by-frame and use a prerender script.
- frostfx
- Member
- 44 posts
- Joined: 5月 2017
- Offline
-
- Quick Links