fix: Fill with copies assigns sequential names in grid path#10840
Open
BenJule wants to merge 3 commits into
Open
fix: Fill with copies assigns sequential names in grid path#10840BenJule wants to merge 3 commits into
BenJule wants to merge 3 commits into
Conversation
2 tasks
d6985f3 to
e5fb417
Compare
The upstream build_all.yml only listed 'main' as a push trigger. BenJule/BambuStudio uses 'master' as its default branch, so CI never fired on fork-local pushes. Adding 'master' alongside 'main' makes the full multi-platform build run when master is updated.
In the grid placement path (used when grid_cap > 50), itemid was never updated from its initial value of -1, causing all copies to be named "<object> -1". Assign itemid sequentially from 0 to match the arrange path behavior. Fixes bambulab#10492
e5fb417 to
437b594
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.
Problem
When using Fill with copies on small objects (where the grid placement path is used instead of the arrange path), all copies receive the name
<object> -1instead of sequential names like<object> 0,<object> 1, etc.Root cause: In
FillBedJob::process(), the grid path (used whengrid_cap > FILL_BED_GRID_PATH_MIN_CAPACITY, i.e. > 50) never updateditemidafter placing each copy. The field stays at its initial value of-1(set inFillBedJob::prepare()), so the setter at line 172:newObj->name = mo->name + " " + std::to_string(p.itemid);produces
"Cube -1"for every single copy.The arrange path (used for large objects) correctly assigns sequential IDs via
firstfit.hpp→it->get().itemId(item_id++).Fix
Assign
itemidsequentially in the grid path loop, matching the 0-based sequential IDs produced by the arrange path:Added inside the
if (cell_idx < empty_cells.size())block, before++placed.Related
Closes #10492