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

   3190   3   1
User Avatar
Member
27 posts
Joined: 9月 2016
オフライン
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
8173 posts
Joined: 9月 2011
オフライン
you can set those on the usd rop, no?
User Avatar
Member
9264 posts
Joined: 7月 2007
オンライン
also not sure if it's the same, but you can use ConfigureLayer LOP to set MetersPerUnit metadata
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
27 posts
Joined: 9月 2016
オフライン
Thanks, Tomas. ConfigureLayer LOP is definitely what I'm looking for…
  • Quick Links