Skip to content

Remove unused BatchManager#clone method - #9106

Merged
mvaligursky merged 1 commit into
mainfrom
mv-remove-batch-clone
Jul 23, 2026
Merged

Remove unused BatchManager#clone method#9106
mvaligursky merged 1 commit into
mainfrom
mv-remove-batch-clone

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Removes the unused BatchManager#clone method, replacing its body with a Debug.removed() notice (matching the existing Batch#model removal pattern).

Changes:

  • BatchManager#clone(batch, clonedMeshInstances) has never been called anywhere in the engine's history — it was introduced as speculative API (originally cloneBatch) and never wired into any code path.
  • It also had no supported use case: it only did anything for dynamic batches, required the caller to supply a structurally identical set of source mesh instances (an unvalidated, positional bone-index contract), and copied only a subset of the batched mesh instance's properties.

API Changes:

  • Removed BatchManager#clone. The method now logs a "removed" message via Debug.removed() and returns nothing. There is no replacement — batches are (re)generated through batch groups / BatchManager.generate(), and hardware instancing covers cheap duplication of shared geometry.

@github-actions

Copy link
Copy Markdown

Public API report

This PR changes the public API surface (+0 / −1), per the docs' rules (@ignore / @Private / undocumented are excluded).

Show API diff
-BatchManager.clone(batch: Batch, clonedMeshInstances: MeshInstance[]): Batch

Informational only — this never fails the build.

@github-actions

Copy link
Copy Markdown

Build size report

This PR changes the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2321.6 KB (−0.5 KB, −0.02%) 597.2 KB (−0.1 KB, −0.02%) 464.6 KB (−0.2 KB, −0.03%)
playcanvas.min.mjs 2319.0 KB (−0.5 KB, −0.02%) 596.1 KB (−0.1 KB, −0.02%) 463.8 KB (−0.3 KB, −0.05%)

@mvaligursky mvaligursky added the area: graphics Graphics related issue label Jul 23, 2026
BatchManager#clone was never called anywhere in the engine's history
(introduced as speculative API and never wired up) and had no supported
use case. Replace the implementation with a Debug.removed() notice,
matching the existing Batch#model removal pattern.
@mvaligursky
mvaligursky force-pushed the mv-remove-batch-clone branch from 686430f to a6b5724 Compare July 23, 2026 13:21
@mvaligursky
mvaligursky merged commit 12f81a1 into main Jul 23, 2026
10 checks passed
@mvaligursky
mvaligursky deleted the mv-remove-batch-clone branch July 23, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant