(self)
return filename + self.extension
Returns the name of the asset file as registered in MuJoCo's VFS.
Returns the name of the asset file as registered in MuJoCo's VFS.
Returns the name of the asset file as registered in MuJoCo s VFS .
def get_vfs_filename(self):
    """Returns the name of the asset file as registered in MuJoCo's VFS."""
    # Hash the contents of the asset to get a unique identifier.
    hash_string = hashlib.sha1(util.to_binary_string(self.contents)).hexdigest()
    # Prepend the prefix, if one exists.
    if self.prefix:
      prefix = self.prefix
      raw_length = len(prefix) + len(hash_string) + len(self.extension) + 1
      if raw_length > constants.MAX_VFS_FILENAME_LENGTH:
        trim_amount = raw_length - constants.MAX_VFS_FILENAME_LENGTH
        prefix = prefix[:-trim_amount]
      filename = '-'.join([prefix, hash_string])
    else:
      filename = hash_string

    # An extension is needed because MuJoCo's compiler looks at this when
    # deciding how to load meshes and heightfields.
    return filename + self.extension
def get_vfs_filename ( self ) : # Hash the contents of the asset to get a unique identifier. hash_string = hashlib . sha1 ( util . to_binary_string ( self . contents ) ) . hexdigest ( ) # Prepend the prefix, if one exists. if self . prefix : prefix = self . prefix raw_length = len ( prefix ) + len ( hash_string ) + len ( self . extension ) + 1 if raw_length > constants . MAX_VFS_FILENAME_LENGTH : trim_amount = raw_length - constants . MAX_VFS_FILENAME_LENGTH prefix = prefix [ : - trim_amount ] filename = '-' . join ( [ prefix , hash_string ] ) else : filename = hash_string # An extension is needed because MuJoCo's compiler looks at this when # deciding how to load meshes and heightfields. return filename + self . extension