Skip to content

fix: Fill with copies assigns sequential names in grid path#10840

Open
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10492-fill-copies-naming
Open

fix: Fill with copies assigns sequential names in grid path#10840
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10492-fill-copies-naming

Conversation

@BenJule
Copy link
Copy Markdown

@BenJule BenJule commented May 20, 2026

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> -1 instead of sequential names like <object> 0, <object> 1, etc.

Root cause: In FillBedJob::process(), the grid path (used when grid_cap > FILL_BED_GRID_PATH_MIN_CAPACITY, i.e. > 50) never updated itemid after placing each copy. The field stays at its initial value of -1 (set in FillBedJob::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.hppit->get().itemId(item_id++).

Fix

Assign itemid sequentially in the grid path loop, matching the 0-based sequential IDs produced by the arrange path:

m_selected[i].itemid = static_cast<int>(placed);

Added inside the if (cell_idx < empty_cells.size()) block, before ++placed.

Related

Closes #10492

@BenJule BenJule changed the title FIX: Fill with copies assigns sequential names in grid path fix: Fill with copies assigns sequential names in grid path May 20, 2026
@BenJule BenJule force-pushed the fix/10492-fill-copies-naming branch from d6985f3 to e5fb417 Compare May 21, 2026 08:31
BenJule added 3 commits May 21, 2026 10:52
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
@BenJule BenJule force-pushed the fix/10492-fill-copies-naming branch from e5fb417 to 437b594 Compare May 21, 2026 08:55
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.

Fill with copies: Incremental numbering overflows after 99

1 participant