diff --git a/maxdiff/patch_printer.py b/maxdiff/patch_printer.py index 61c7271..ba2eb78 100644 --- a/maxdiff/patch_printer.py +++ b/maxdiff/patch_printer.py @@ -233,7 +233,10 @@ def get_object_names_from_ids_recursive( for box in boxes: if "id" in box: if id_to_check == box["id"]: - name = f"[{get_box_text(box)}]" + name = get_box_text(box) + if "embed" in box and box["embed"] == 1: + name += " " + name = f"[{name}]" if isinstance(id_hierarchy, list) and len(id_hierarchy) > 1: id_hierarchy.pop(0) diff --git a/maxdiff/tests/test_baselines/Test.amxd.txt b/maxdiff/tests/test_baselines/Test.amxd.txt index fdb1f05..4fa0d95 100644 --- a/maxdiff/tests/test_baselines/Test.amxd.txt +++ b/maxdiff/tests/test_baselines/Test.amxd.txt @@ -7,6 +7,7 @@ parameters: [AbstractionWithParameter]/[obj-1]: ['MyParameter[1]', 'MyParameter', 0] > override > ['MyParameter[1]', '-', '-'] [bpatcher ParamAbstraction.maxpat]/[obj-1]: ['OverruledParamLongName', 'OverruledParamShortName', 0] > override > ['OverruledParamLongName', 'OverruledParamShortName', '-'] [live.tab]: ['Time Mode', 'Time Mode', 0] + [bpatcher ThisWasAnAbstractionBeforeEmbeddingIt.maxpat ]/[live.numbox]: ['EmbeddedParam', 'Embedded', 0] [live.dial]: ['live.dial', 'live.dial', 0] [live.dial]: ['live.dial[1]', 'live.dial', 0] inherited_shortname: 1 @@ -28,8 +29,14 @@ project: collContent.txt ----------- patcher ----------- -rect: [65, 399, 927, 289] | openrect: [0, 0, 0, 169] | default_fontsize: 10.0 | default_fontname: Arial Bold | gridsize: [8, 8] | boxanimatetime: 500 | latency: 0 | is_mpe: 0 | platform_compatibility: 0 | autosave: 0 +appversion: 8.6.2-x64-1 | rect: [65, 399, 927, 289] | openrect: [0, 0, 0, 169] | default_fontsize: 10.0 | default_fontname: Arial Bold | gridsize: [8, 8] | boxanimatetime: 500 | latency: 0 | is_mpe: 0 | platform_compatibility: 0 | autosave: 0 ----------- objects ----------- +[bpatcher ThisWasAnAbstractionBeforeEmbeddingIt.maxpat] embed: 1 + ----------- patcher ----------- + appversion: 8.6.2-x64-1 | rect: [927, 431, 640, 480] + ----------- objects ----------- + [live.comment Embedded] + [live.numbox] parameter: [message 😋] fontsize: 20.0 [AbstractionWithParameter] [AbstractionWithParameter] @@ -40,7 +47,7 @@ rect: [65, 399, 927, 289] | openrect: [0, 0, 0, 169] | default_fontsize: 10.0 | [button] [gen @t exponent] ----------- patcher ----------- - classnamespace: dsp.gen | rect: [84, 144, 653, 641] + appversion: 8.6.2-x64-1 | classnamespace: dsp.gen | rect: [84, 144, 653, 641] ----------- objects ----------- [codebox] //============================================================ @@ -83,20 +90,20 @@ rect: [65, 399, 927, 289] | openrect: [0, 0, 0, 169] | default_fontsize: 10.0 | [coll @embed 1] coll_data: {'count': 2, 'data': [{'key': 0, 'value': ['test']}, {'key': 1, 'value': ['another', 'test']}]} | embed: 1 | precision: 6 [p MySubpatcher] ----------- patcher ----------- - rect: [805, 282, 271, 250] + appversion: 8.6.2-x64-1 | rect: [805, 282, 271, 250] ----------- objects ----------- - [live.dial] parameter: + [live.dial] parameter: [t b b] [loadbang] [message read collContent.txt] [coll] [fpic] pic: fpic.png -[live.tab] annotation: Toggles between Beat Sync and Free running (Hz). | annotation_name: Time Mode | fontsize: 9.0 | livemode: 1 | num_lines_patching: 2 | num_lines_presentation: 2 | pictures: [hz-icon.svg, beat-icon.svg] | remapsvgcolors: 1 | parameter: | usepicture: 1 | usesvgviewbox: 1 | varname: Time Mode +[live.tab] annotation: Toggles between Beat Sync and Free running (Hz). | annotation_name: Time Mode | fontsize: 9.0 | livemode: 1 | num_lines_patching: 2 | num_lines_presentation: 2 | pictures: [hz-icon.svg, beat-icon.svg] | remapsvgcolors: 1 | parameter: | usepicture: 1 | usesvgviewbox: 1 | varname: Time Mode [live.banks] [bpatcher ParamAbstraction.maxpat] offset: [-73, -62] [bpatcher ParamAbstraction.maxpat] offset: [-73, -62] -[live.dial] activefgdialcolor: live_display_handle_two | parameter: | varname: live.dial[1] -[live.dial] +[live.dial] activefgdialcolor: live_display_handle_two | parameter: | varname: live.dial[1] +[live.dial] parameter: [button] presentation: 1 | presentation_rect: [265, 26, 24, 24] [bpatcher MyAbstraction.maxpat] offset: [-4, -12] [comment A comment] diff --git a/maxdiff/tests/test_files/Test.amxd b/maxdiff/tests/test_files/Test.amxd index 6cff5c8..cf5f281 100644 Binary files a/maxdiff/tests/test_files/Test.amxd and b/maxdiff/tests/test_files/Test.amxd differ