parameters: (self, file)
docstring: Fetch metadata from a json file in given file name and sets metadata
docstring_summary: Fetch metadata from a json file in given file name and sets metadata
docstring_tokens: Fetch metadata from a json file in given file name and sets metadata
function: def fetch_metadata(self, file):
          """
          Fetch metadata from a json file in given file name and sets metadata
          """
          meta_access = [METADATA_DIR + file + ".json", METADATA_DIR + file, file]
  
          # sanitizing file path
          for filename in meta_access:
              if os.path.exists(filename):
                  file = filename
                  break
  
          with open(file, "r") as f:
              data = json.load(f)
  
          # set data to what was fetched
          self.user_metadata = self.metadata_parser(data, to_file=False)
          logger.info(f"Fetched: {file}")
  
          self.last_metadata_file = file
  
          # updating user_metadata to reflect characters position
          if self.rotation_offset and self.translation_offset:
              data = self.user_metadata
              self.rotation_offset = data["rotation"]
              self.translation_offset = data["translation"]
  
          self.hide_model()
          self.load_motion()
function_tokens: def fetch_metadata ( self , file ) : meta_access = [ METADATA_DIR + file + ".json" , METADATA_DIR + file , file ] # sanitizing file path for filename in meta_access : if os . path . exists ( filename ) : file = filename break with open ( file , "r" ) as f : data = json . load ( f ) # set data to what was fetched self . user_metadata = self . metadata_parser ( data , to_file = False ) logger . info ( f"Fetched: {file}" ) self . last_metadata_file = file # updating user_metadata to reflect characters position if self . rotation_offset and self . translation_offset : data = self . user_metadata self . rotation_offset = data [ "rotation" ] self . translation_offset = data [ "translation" ] self . hide_model ( ) self . load_motion ( )