What would be the proper way to set stage level metadata?

   2117   3   1
User Avatar
Member
27 posts
Joined: Sept. 2016
Offline
Hey Solaris folks,

I'm wondering is there a way to edit stage level metadata? The below snippet doesn't work and the node.stage() either.

node = hou.pwd()
stage = node.editableStage()

from pxr import UsdGeom
UsdGeom.SetStageMetersPerUnit(stage, 1)

Here is the exception message which is actually reasonable…

'Cannot set layer metadata 'metersPerUnit' in current edit target "anon:0000000090963380", as it is not the root layer or session layer of stage "anon:000000009049C900:root.usd".'

Since LOPs work with their own layers, the root operations are not supposed to work like this. However, the magic to do this is relatively important to us. Since the other hosts require these global variables to set up the scene.
User Avatar
Member
7770 posts
Joined: Sept. 2011
Offline
you can set those on the usd rop, no?
User Avatar
Member
8554 posts
Joined: July 2007
Offline
also not sure if it's the same, but you can use ConfigureLayer LOP to set MetersPerUnit metadata
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
27 posts
Joined: Sept. 2016
Offline
Thanks, Tomas. ConfigureLayer LOP is definitely what I'm looking for…
  • Quick Links