[MISC] Improve readability of entity and morph repr.#2956
Merged
duburcqa merged 2 commits intoJun 16, 2026
Conversation
81b0d44 to
822d424
Compare
822d424 to
000f749
Compare
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two related fixes to the artist
repr:repr_basebrief no longer probes attributes (hasattr/getattr). Entities and indexed sub-objects own their_repr_brief. Heterogeneous entities now report their variant count (e.g.morph: 2 morph variants) instead of reading the ambiguous.morphproperty.file;FileMorph/USD.__repr_name__previously printed it verbatim in both the header and the field listing. They now show a bounded identifier, e.g.file='<inline probe>'for<mujoco model="probe">, so the morph keeps its identity without dumping the document. The identifier comes from a single polymorphicMorph._identifier()that_get_morph_identifier(entity naming) also delegates to, replacing the per-typeisinstancechain.get_robot_namenow accepts inline URDF content (matchingget_model_name). Also fixesUSDrepr renderingfiletwice.Related Issue
Follow-up surfaced while reviewing #2798 (heterogeneous-morph
.morphaccess).Motivation and Context
reprof a heterogeneous entity silently collapsed to its first morph, andreprof an in-memory MJCF/URDF morph dumped the entire XML into the terminal.How Has This Been / Can This Be Tested?
pytest tests/test_misc.py::test_repr_does_not_crash- one scene packs a plane, primitive, file-based MJCF, inline MJCF, heterogeneous rigid, and kinematic entity plus a camera, then renders everyrepr/_repr_briefpath and sanity-checks that a file morph shows its path while an inline one shows its parsed model name rather than the document. Entity-naming tests (test_urdf_mjcf_names_from_file,test_auto_and_user_names) confirm the_identifierconsolidation preserves names.Checklist:
Submitting Code Changessection of CONTRIBUTING document.