Skip to content

[BUGFIX] Ensure unique names when labeling objects #14431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mjonuschat
Copy link
Contributor

When using firmware specific object labeling the object names generated are not unique. To reproduce add multiple shapes to the build plate and export the g-code.
This will result in exclude object definitions like this:

EXCLUDE_OBJECT_DEFINE NAME='Shape_Box' ...
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box' ...
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box' ...
...

With this patch the naming scheme has been changed:

  • The object ID is only increased when a new object is being processed
  • The object ID is always appended to the base name of the object
  • The instance ID is appended to objects with multiple instances.

This results in the following names:

EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_1'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_2'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_3'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_4'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_1)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_2)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_3)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_4)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_6'

This has been reported in #13308

When using firmware specific object labeling the object names generated are not unique. To reproduce add multiple shapes to the build plate and export the g-code.
This will result in exclude object definitions like this:

```
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box' ...
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box' ...
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box' ...
...
```

With this patch the naming scheme has been changed:
- The object ID is only increased when a new object is being processed
- The object ID is always appended to the base name of the object
- The instance ID is appended to objects with multiple instances.

This results in the following names:
```
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_1'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_2'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_3'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_4'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_1)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_2)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_3)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_5_(Instance_4)'
EXCLUDE_OBJECT_DEFINE NAME='Shape_Box_6'
```

This has been reported in prusa3d#13308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant