parameters: (cls, file_path, scene_path=None, texture_path=None, time=None)
docstring: r"""Read USD material and return a Material object.
          The shader used must have a corresponding registered reader function.
  
          Args:
              file_path (str): Path to usd file (\*.usd, \*.usda).
              scene_path (str): Required only for reading USD files. Absolute path of UsdShade.Material prim
                  within the USD file scene. Must be a valid ``Sdf.Path``.
              texture_path (str, optional): Path to textures directory. By default, the textures will be assumed to be
                  under the same directory as the file specified by `file_path`.
              time (convertible to float, optional): Optional for reading USD files. Positive integer indicating the tim
                  at which to retrieve parameters.
  
          Returns:
              (Material): Material object determined by the corresponding reader function.
docstring_summary: r"""Read USD material and return a Material object.
          The shader used must have a corresponding registered reader function.
docstring_tokens: r Read USD material and return a Material object . The shader used must have a corresponding registered reader function .
function: def read_from_file(cls, file_path, scene_path=None, texture_path=None, time=None):
          r"""Read USD material and return a Material object.
          The shader used must have a corresponding registered reader function.
  
          Args:
              file_path (str): Path to usd file (\*.usd, \*.usda).
              scene_path (str): Required only for reading USD files. Absolute path of UsdShade.Material prim
                  within the USD file scene. Must be a valid ``Sdf.Path``.
              texture_path (str, optional): Path to textures directory. By default, the textures will be assumed to be
                  under the same directory as the file specified by `file_path`.
              time (convertible to float, optional): Optional for reading USD files. Positive integer indicating the tim
                  at which to retrieve parameters.
  
          Returns:
              (Material): Material object determined by the corresponding reader function.
          """
          if os.path.splitext(file_path)[1] in ['.usd', '.usda', '.usdc']:
              if scene_path is None or not Sdf.Path(scene_path):
                  raise MaterialLoadError(f'The scene_path `{scene_path}`` provided is invalid.')
  
              if texture_path is None:
                  texture_file_path = os.path.dirname(file_path)
              elif not os.path.isabs(texture_path):
                  usd_dir = os.path.dirname(file_path)
                  texture_file_path = posixpath.join(usd_dir, texture_path)
              else:
                  texture_file_path = texture_path
  
              stage = Usd.Stage.Open(file_path)
              material = UsdShade.Material(stage.GetPrimAtPath(scene_path))
  
              return cls.read_usd_material(material, texture_path=texture_file_path, time=time)
  
          elif os.path.splitext(file_path)[1] == '.obj':
              if cls._obj_reader is not None:
                  return cls._obj_reader(file_path)
              else:
                  raise MaterialNotSupportedError('No registered .obj material reader found.')
function_tokens: def read_from_file ( cls , file_path , scene_path = None , texture_path = None , time = None ) : if os . path . splitext ( file_path ) [ 1 ] in [ '.usd' , '.usda' , '.usdc' ] : if scene_path is None or not Sdf . Path ( scene_path ) : raise MaterialLoadError ( f'The scene_path `{scene_path}`` provided is invalid.' ) if texture_path is None : texture_file_path = os . path . dirname ( file_path ) elif not os . path . isabs ( texture_path ) : usd_dir = os . path . dirname ( file_path ) texture_file_path = posixpath . join ( usd_dir , texture_path ) else : texture_file_path = texture_path stage = Usd . Stage . Open ( file_path ) material = UsdShade . Material ( stage . GetPrimAtPath ( scene_path ) ) return cls . read_usd_material ( material , texture_path = texture_file_path , time = time ) elif os . path . splitext ( file_path ) [ 1 ] == '.obj' : if cls . _obj_reader is not None : return cls . _obj_reader ( file_path ) else : raise MaterialNotSupportedError ( 'No registered .obj material reader found.' )