But when I run that in 5.1.0, I get a dome light with an intensity of 1.0.
I tried setting the intensity immediately after creating the light, but that did not work, either. I tried printing the value of self.light.node.get_attributes(), and there was an attribute named “intensity”, but when I tried to get/set the attribute, I would get an error stating that the attribute did not exist.
Eventually I gave up and started creating the dome light and setting its intensity using the USD functions like this
stage = omni.usd.get_context().get_stage()
light = UsdLux.DomeLight.Define(stage, “/Replicator/DomeLight_Xform/DomeLight”)
light.GetIntensityAttr().Set(1750)
light.GetTextureFileAttr().Set(path_to_texture)
This works for me, but leaves me wondering:
Is there a way to accomplish this with replicator?
Has the method changed between 4.5 and 5.1?
Are there consequences to doing this with USD methods instead of replicator?
If so, what should I look out for?
import omni.replicator.core as rep
from pxr import Sdf
dome_light = rep.functional.create.dome_light(intensity=100, name=“DomeLight”)
# Method A: Use rep.functional.modify.attribute
rep.functional.modify.attribute(dome_light, “inputs:intensity”, 200.5)
# Method B: Use USD directly on the returned prim
if dome_light.GetAttribute(“inputs:intensity”):
dome_light.GetAttribute(“inputs:intensity”).Set(300.5)
else:
dome_light.CreateAttribute(“inputs:intensity”, Sdf.ValueTypeNames.Float).Set(300.5)
I tried the rep.functional approach above and I still got the same behavior (intensity is stuck at 1.0).
I also tried updating the intensity within isaac sim’s gui while replicator was running, and isaac sim popped up a message stating that my change was overridden by another layer. This reminded me of something I have been wondering for a while:
Is it possible that something somewhere else is overriding the intensity? For instance, what if my setting the intensity is actually working, but something else sets it back to 1.0 before my change can be seen? How would I check whether this is happening and if so, find the culprit?
Another idea: is it possible that my attempts to set the intensity via replicator are being ignored? I can change the texture after creating a dome light and see it take effect, but whenever I try to set the intensity, I do not see it take effect. It does not seem to matter what method I use to change the intensity. Every replicator method I have tried so far has failed. I have even tried to create a dome light without randomizing it, and every setting other than intensity seems to work just fine.
I tried not setting the intensity and it was still 1.0 even though the documentation for replicator’s create.light says the default intensity is 1000.0.
Thank you for the detailed report and follow-up. We’ve identified the root cause of this issue in Isaac Sim 5.1.0 that occurs when using rep.new_layer().
Workaround: Avoid using rep.new_layer() when creating dome lights.
The issue does not happen anymore in newer replicator version in Isaac Sim 6.0.