Skip to content

Add BatchManager method getGroupById #8388

Description

@AlexAPPi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions