Tf.Notice.Register on Usd.Notice.ObjectsChanged events not firing when USD property changes are made to a live session.
here is how I setup the live session
async def initialize_async(stage_url):
stage = Usd.Stage.Open(stage_url)
live_session = LiveEditSession(stage_url)
live_layer = await live_session.ensure_exists()
session_layer = stage.GetSessionLayer()
session_layer.subLayerPaths.append(live_layer.identifier)
stage.SetEditTarget(live_layer)
iot_root = live_layer.GetPrimAtPath("/iot")
iot_spec = live_layer.GetPrimAtPath(f"/iot/data")
if not iot_spec:
iot_spec = Sdf.PrimSpec(iot_root, "data", Sdf.SpecifierDef, "IoTData")
omni.client.live_process()
return stage, live_layer, iot_spec
and here is how I register the listener
async def run(stage):
async def on_objects_changed(notice, stage):
print("USD Listener triggered!!")
changed_attributes = notice.GetChangedAttributes()
for path in changed_attributes:
attr = stage.GetAttributeAtPath(path)
if attr:
print(f"Attribute changed: {attr.GetName()}, New value: {attr.Get()}")
Tf.Notice.Register(Usd.Notice.ObjectsChanged, on_objects_changed, stage)
print("USD Listener registered!!")
adding or modifying an attribute like /iot/data.testAttribute does not fire an event.
app.py.txt (2.5 KB)