Skip to content

Commit

Permalink
Show “<embedded>” for bpatcher parameter summaries
Browse files Browse the repository at this point in the history
To make it more clear where to find this parameter in the patch
  • Loading branch information
Mattijs Kneppers committed Jul 12, 2024
1 parent 5c11592 commit 96a3741
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion maxdiff/patch_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 += " <embedded>"
name = f"[{name}]"

if isinstance(id_hierarchy, list) and len(id_hierarchy) > 1:
id_hierarchy.pop(0)
Expand Down
8 changes: 8 additions & 0 deletions maxdiff/tests/test_baselines/Test.amxd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 <embedded>]/[live.numbox]: ['EmbeddedParam', 'Embedded', 0]
[live.dial]: ['live.dial', 'live.dial', 0]
[live.dial]: ['live.dial[1]', 'live.dial', 0]
inherited_shortname: 1
Expand All @@ -17,6 +18,7 @@ dependency_cache:
{'name': 'MyAbstraction.maxpat', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'JSON', 'implicit': 1}
{'name': 'ParamAbstraction.maxpat', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'JSON', 'implicit': 1}
{'name': 'beat-icon.svg', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'svg', 'implicit': 1}
{'name': 'collContent.txt', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'TEXT', 'implicit': 1}
{'name': 'fpic.png', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'PNG', 'implicit': 1}
{'name': 'hz-icon.svg', 'bootpath': '~/maxdevtools/maxdiff/tests/test_files', 'type': 'svg', 'implicit': 1}

Expand All @@ -29,6 +31,12 @@ project:
----------- patcher -----------
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: <longname: EmbeddedParam | modmode: 3 | shortname: Embedded | type: 0 | unitstyle: 0>
[message 😋] fontsize: 20.0
[AbstractionWithParameter]
[AbstractionWithParameter]
Expand Down
Binary file modified maxdiff/tests/test_files/Test.amxd
Binary file not shown.

0 comments on commit 96a3741

Please sign in to comment.