diff --git a/omnigibson/prims/material_prim.py b/omnigibson/prims/material_prim.py index d92135a1b..20690ca82 100644 --- a/omnigibson/prims/material_prim.py +++ b/omnigibson/prims/material_prim.py @@ -70,6 +70,7 @@ def __init__( ): # Other values that will be filled in at runtime self._shader = None + self._shader_node = None # Users of this material: should be a set of BaseObject and BaseSystem self._users = set() @@ -148,6 +149,7 @@ def _post_load(self): # Generate shader reference self._shader = lazy.omni.usd.get_shader_from_material(self._prim) + self._shader_node = lazy.usd.mdl.RegistryUtils.GetShaderNodeForPrim(self._shader.GetPrim()) def bind(self, target_prim_path): """ @@ -216,7 +218,11 @@ def get_input(self, inp): Returns: any: value of the requested @inp """ - return self._shader.GetInput(inp).Get() + non_default_inp = self._shader.GetInput(inp).Get() + if non_default_inp is not None: + return non_default_inp + + return self._shader_node.GetInput(inp).GetDefaultValue() def set_input(self, inp, val): """ diff --git a/omnigibson/systems/micro_particle_system.py b/omnigibson/systems/micro_particle_system.py index a9322638a..0f08befb2 100644 --- a/omnigibson/systems/micro_particle_system.py +++ b/omnigibson/systems/micro_particle_system.py @@ -494,9 +494,6 @@ def initialize(self, scene): self.system_prim = self._create_particle_system() # Get material material = self._get_particle_material_template() - # Load the material if it's newly created and has never been loaded before - if not material.loaded: - material.load() material.add_user(self) self._material = material # Bind the material to the particle system (for isosurface) and the prototypes (for non-isosurface)