Description
Currently, BatchManager exposes methods like getGroupByName, but there is no public API to get a BatchGroup instance by its numeric id. This makes it inconvenient to work with batch groups when only the batchGroupId is available on components.
For example, components such as render, model or element store only batchGroupId, and there is no straightforward way to retrieve the corresponding BatchGroup object from the manager.
Proposal
Add a new method to BatchManager:
/**
* Returns the BatchGroup with the specified id, or null if not found.
* @param {number} id - The batch group id.
* @returns {pc.BatchGroup|null}
*/
getGroupById(id) { ... }
This would mirror the existing getGroupByName API and provide a symmetric way to access batch groups either by name or by id.
Description
Currently,
BatchManagerexposes methods likegetGroupByName, but there is no public API to get aBatchGroupinstance by its numericid. This makes it inconvenient to work with batch groups when only thebatchGroupIdis available on components.For example, components such as
render,modelorelementstore onlybatchGroupId, and there is no straightforward way to retrieve the correspondingBatchGroupobject from the manager.Proposal
Add a new method to
BatchManager:This would mirror the existing
getGroupByNameAPI and provide a symmetric way to access batch groups either by name or by id.