habitat_sim.attributes_managers.AOAttributesManager class

Manages ArticulatedObjectAttributes which define Habitat-specific metadata for articulated objects (i.e. render asset or semantic ID), in addition to data held in defining URDF file, pre-instantiation. Can import .ao_config.json files.

Methods

def create_new_template(self, handle: str, register_template: bool = False) -> attributes.ArticulatedObjectAttributes
Creates a ArticulatedObjectAttributes template built with default values, and registers it in the library if register_template is True.
def create_template(self, handle: str, register_template: bool = True) -> attributes.ArticulatedObjectAttributes
Creates a ArticulatedObjectAttributes template based on passed handle, and registers it in the library if register_template is True.
def filter_filepaths(self, attributes: attributes.ArticulatedObjectAttributes) -> None
This attempts to filter any filenames in the passed ArticulatedObjectAttributes template so that the fields that would be saved to file would only contain relative paths.
def get_first_matching_template_by_handle(self, handle_substr: str) -> attributes.ArticulatedObjectAttributes
This returns a copy of the first ArticulatedObjectAttributes template containing the passed handle substring if any exist, and NULL if none could be found.
def get_library_has_handle(self, handle: str) -> bool
Returns whether the passed handle describes an existing ArticulatedObjectAttributes template in the library.
def get_library_has_id(self, template_id: int) -> bool
Returns whether the passed template ID describes an existing ArticulatedObjectAttributes template in the library.
def get_num_templates(self, /) -> int
Returns the number of existing ArticulatedObjectAttributes templates being managed.
def get_random_template_handle(self, /) -> str
Returns the handle for a random ArticulatedObjectAttributes template chosen from the existing ArticulatedObjectAttributes templates being managed.
def get_template_by_handle(self, handle: str) -> attributes.ArticulatedObjectAttributes
This returns a copy of the ArticulatedObjectAttributes template specified by the passed handle if it exists, and NULL if it does not.
def get_template_by_id(self, template_id: int) -> attributes.ArticulatedObjectAttributes
This returns a copy of the ArticulatedObjectAttributes template specified by the passed ID if it exists, and NULL if it does not.
def get_template_handle_by_id(self, template_id: int) -> str
Returns string handle for the ArticulatedObjectAttributes template corresponding to passed ID.
def get_template_handles(self, search_str: str = '', contains: bool = True, sorted: bool = True) -> typing.List[str]
Returns a potentially sorted list of ArticulatedObjectAttributes template handles that either contain or explicitly do not contain the passed search_str, based on the value of boolean contains.
def get_template_id_by_handle(self, handle: str) -> int
Returns integer ID for the ArticulatedObjectAttributes template with the passed handle.
def get_templates_CSV_info(self, search_str: str = '', contains: bool = True) -> str
Returns a comma-separated string describing each ArticulatedObjectAttributes template whose handles either contain or explicitly do not contain the passed search_str, based on the value of boolean contains. Each template’s info is separated by a newline.
def get_templates_by_handle_substring(self, search_str: str = '', contains: bool = True) -> typing.Dict[str, attributes.ArticulatedObjectAttributes]
Returns a dictionary of ArticulatedObjectAttributes templates, keyed by their handles, for all handles that either contain or explicitly do not contain the passed search_str, based on the value of boolean contains.
def get_templates_info(self, search_str: str = '', contains: bool = True) -> typing.List[str]
Returns a list of CSV strings describing each ArticulatedObjectAttributes template whose handles either contain or explicitly do not contain the passed search_str, based on the value of boolean contains.
def get_undeletable_handles(self, /) -> typing.List[str]
Returns a list of ArticulatedObjectAttributes template handles for ArticulatedObjectAttributes templates that have been marked undeletable by the system. These ArticulatedObjectAttributes templates can still be edited.
def get_user_locked_handles(self, /) -> typing.List[str]
Returns a list of ArticulatedObjectAttributes template handles for ArticulatedObjectAttributes templates that have been marked locked by the user. These will be undeletable until unlocked by the user. These ArticulatedObjectAttributes templates can still be edited.
def is_valid_filename(self, handle: str) -> bool
Returns whether the passed handle is a valid, existing file.
def load_configs(self, path: str, save_as_defaults: bool = False) -> typing.List[int]
Build ArticulatedObjectAttributes templates for all JSON files with appropriate extension that exist in the provided file or directory path. If save_as_defaults is true, then these ArticulatedObjectAttributes templates will be unable to be deleted
def register_template(self, template: attributes.ArticulatedObjectAttributes, specified_handle: str = '', force_registration: bool = False) -> int
This registers a copy of the passed ArticulatedObjectAttributes template in the library, and returns the template’s integer ID.
def remove_all_templates(self, /) -> typing.List[attributes.ArticulatedObjectAttributes]
This removes, and returns, a list of all the ArticulatedObjectAttributes templates referenced in the library that have not been marked undeletable by the system or read-only by the user.
def remove_template_by_handle(self, handle: str) -> attributes.ArticulatedObjectAttributes
This removes, and returns the ArticulatedObjectAttributes template referenced by the passed handle from the library.
def remove_template_by_id(self, template_id: int) -> attributes.ArticulatedObjectAttributes
This removes, and returns the ArticulatedObjectAttributes template referenced by the passed ID from the library.
def remove_templates_by_str(self, search_str: str = '', contains: bool = True) -> typing.List[attributes.ArticulatedObjectAttributes]
This removes, and returns, a list of all the ArticulatedObjectAttributes templates referenced in the library that have not been marked undeletable by the system or read-only by the user and whose handles either contain or explicitly do not contain the passed search_str.
def save_template_by_handle(self, handle: str, overwrite: bool) -> bool
Saves the ArticulatedObjectAttributes template referenced by the passed handle to its source location if overwrite is true, will create a new incremented filename if overwrite is false. Returns whether was successful or not.
def save_template_by_handle_to_filepath(self, handle: str, filepath: str) -> bool
Saves the ArticulatedObjectAttributes template referenced by the passed handle to the passed path, creating subdirectories if they do not exist. Returns whether was successful or not.
def save_template_to_filepath(self, handle: attributes.ArticulatedObjectAttributes, filepath: str, create_subdir: bool) -> bool
Saves the passed ArticulatedObjectAttributes template to the passed filepath. If only a filename is passed, it will save this template in its original source directory, otherwise if path + filename is passed it will save the template to the specified filepath, creating any necessary subdirectories only if create_subdir is true. If create_subdir is false, it will fail with a message if any subdirectories in the requested filepath do not exist.
def save_template_to_filepath(self, handle: attributes.ArticulatedObjectAttributes, filepath: str, filename: str, create_subdir: bool) -> bool
Saves the passed ArticulatedObjectAttributes template to the passed filepath + filename, creating any necessary subdirectories only if create_subdir is true. If create_subdir is false, it will fail with a message if any subdirectories in the requested filepath subdirectories do not exist.
def set_lock_by_substring(self, lock: bool, search_str: str = '', contains: bool = True) -> typing.List[str]
This sets the lock state for all ArticulatedObjectAttributes templates whose handles either contain or explicitly do not contain the passed search_str. Returns a list of handles for ArticulatedObjectAttributes templates locked by this function call. Lock == True makes the ArticulatedObjectAttributes template unable to be deleted. Note : Locked ArticulatedObjectAttributes templates can still be edited.
def set_template_list_lock(self, handles: typing.List[str], lock: bool) -> typing.List[str]
This sets the lock state for all ArticulatedObjectAttributes templates whose handles are passed in list. Returns a list of handles for templates locked by this function call. Lock == True makes the ArticulatedObjectAttributes template unable to be deleted. Note : Locked ArticulatedObjectAttributes templates can still be edited.
def set_template_lock(self, handle: str, lock: bool) -> bool
This sets the lock state for the ArticulatedObjectAttributes template that has the passed name. Lock == True makes the ArticulatedObjectAttributes template unable to be deleted. Note : Locked ArticulatedObjectAttributes templates can still be edited.