How can i fetch USD file changes automatically without seeing prompt message(Programmatically)?

Hey there,

Every time i run below code its prompting “Base usd file have been changed, please fetch changes.”

Sample Code:

    def _save_es_codes(self, usd_file: str, mid_point: UtmPoint):
        context = omni.usd.get_context()
        context.open_stage(usd_file)
        stage = context.get_stage()
        scenario = stage.GetPrimAtPath('/Scenario')
        if scenario is not None and scenario.IsValid():
            epsg_code_prim = scenario.CreateAttribute("sim:EPSGCode", Sdf.ValueTypeNames.Int)
            epsg_code_prim.Set(mid_point.epsg_code)
            midpoint_x_prim = scenario.CreateAttribute("sim:midpoint_x", Sdf.ValueTypeNames.Double)
            midpoint_x_prim.Set(mid_point.x)
            midpoint_y_prim = scenario.CreateAttribute("sim:midpoint_y", Sdf.ValueTypeNames.Double)
            midpoint_y_prim.Set(mid_point.y)
            stage.Save()
            stage.GetRootLayer().Export(usd_file)

Is there way to fetch USD files automatically in the background without prompting message??

Thanks,

Thanks for the post. Let me ask the dev team how to achieve this.

1 Like

I have asked the dev team, and honestly, no one has asked to turn this off. It is important to keep on for security. However, you can try to disable these settings and see if that works. If not, we do not know another way. This is built directly into the core of kit for many reasons.

There a 3 settings;

  • /persistent/ext/omni.kit.usd.layers/auto_reload_sublayers
  • /persistent/ext/omni.kit.widget.stage/auto_reload_non_sublayers
  • /persistent/ext/omni.kit.user.layers/ignore_outdate_notification

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.