Skip to content

Proposed RFC Suggestion: Moving editor_entity_utils to the EditorPythonBindings gem #67

@cgalvan

Description

@cgalvan

Summary:

I am proposing moving the editor_entity_utils python module out of the EditorPythonTestTools package, so that it can be used outside of its current project (AutomatedTesting). The proposed new location is the EditorPythonBindings gem.

What is the motivation for this suggestion?

This is important because currently, the editor_entity_utils module can only be used in the AutomatedTesting project. This is preventing users from leveraging this module in their own projects that are generally useful beyond the scope of just automated tests (e.g. helper methods for creating entities, managing components on those entities, modifying properties on components, etc...).

This is actually a continuation of a previous change made (o3de/sig-content#61) where we moved the pyside_utils module from the AutomatedTesting project to the QtForPython gem for the same motivation of using the module in any user project. There are other modules in EditorPythonTestTools that would be generally useful to move as well, but it will be easier to move specific modules at a time.

Making these modules more generally accessible has been raised several times in the past, most recently as a result of the following PR for the URDF Exporter Gem (o3de/o3de-technicalart#5). In this case, the POC had to replicate a lot of the functionality that is provided by the editor_entity_utils because it couldn't be used outside of the AutomatedTesting project.

Suggestion design description:

  • Move the editor_entity_utils.py file from EditorPythonTestTools to <O3DE>\Gems\EditorPythonBindings\Editor\Scripts
  • Update any automated testing scripts to import from the new location (should just require changing editor_python_test_tools.editor_entity_utils to editor_entity_utils)

What are the advantages of the suggestion?

  • Now the editor_entity_utils would be usable from any project, not limited to only the AutomatedTesting project
  • Lower the barrier to entry for users wanting to create custom tools that interact with entities/components/properties by providing convenient helper classes/methods
  • The EditorPythonBindings gem is a good landing spot since it provides the azlmbr python modules that these helpers are built upon

What are the disadvantages of the suggestion?

  • If there are any users working out of the AutomatedTesting project and using editor_entity_utils helper methods their imports would stop working. This should be a very small number of people since most users create their own projects, but nevertheless we should probably announce this as an impactful change.

Future considerations

As mentioned earlier, there are additional modules in EditorPythonTestTools that would be strong candidates to be moved outside of the AutomatedTesting project as well so that they could be used in any project. It might be beneficial to identify those as part of this work, even if we choose to only move the editor_entity_utils module right now.

Also, once the editor_entity_utils module has been moved, we should work with @shawstar to update the URDF Exporter gem (o3de/o3de-technicalart#5) as an initial customer/use-case to replace its current helper methods for entity/component/property actions with corresponding editor_entity_utils APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfc-suggestionRequest for Comments for a Suggestiontriage/acceptedIssue that has been accepted and is ready for work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions