Search - User list
Full Version: Accessing layer metadata from Python script
Root » Solaris and Karma » Accessing layer metadata from Python script
ben toogood
Hi - any suggestions on how to go about querying the startTimeCode and endTimeCode stored on the root prim within Solaris using Python?

After setting frame ranges using a ConfigureLayerLOP I can see the values in the metadata report for the root prim, and if I use a Karma or USDRender ROP with the range set to "Render Frame Range From Stage" these values are respected. However, I'd like to get at that info for custom farm submission scripts.

Nothing jumped out looking through the docs - possibly something related to getting an editableStage().GetMetadata() from the target LOP node, but I don't seem to be able to do that outside of a PythonLOP. I'd be running this as part of a scripted gui.

Any pointers?

cheers

Ben
ben toogood
Nevermind - a bit more digging got there (with help from this https://www.sidefx.com/forum/topic/77650/)

For the future record, this does the job:

import hou
node = hou.node('/stage/karma1')
stage = node.stage()
start = stage.GetMetadata('startTimeCode')
end = stage.GetMetadata('endTimeCode')
antc
There's also dedicated functions
stage.GetStartTimeCode()
stage.GetEndTimeCode()
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB