BufferGeometryUtils: Validate morph attributes in mergeGeometries() - #34532
Merged
Conversation
Signed-off-by: cuishuang <imcusg@gmail.com>
Mugen87
reviewed
Sep 10, 2026
|
|
||
| // ensure geometries have the same number of morph attributes | ||
|
|
||
| if ( morphAttributesCount !== morphAttributesUsed.size ) { |
Collaborator
There was a problem hiding this comment.
I agree it makes sense to apply the same type of attribute checks to morph target attributes.
This check maps to attributesCount !== attributesUsed.size further above and the per-name morph target-count makes sense as well 👍 .
Mugen87
approved these changes
Sep 10, 2026
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.
Related issue: None.
Description
mergeGeometries()checks for unexpected morph attributes but does not reject missing ones or inconsistent target counts.A missing morph attribute produces merged morph data with fewer vertices than the base geometry. Inconsistent target counts either throw when a later geometry has fewer targets or silently discard targets when it has more.
This PR validates that all geometries have the same morph attribute names and the same target count for each corresponding attribute. Incompatible inputs log an error and return
null, following the existing validation behavior.