Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object3D: Shallow copy the animations array in copy() #26416

Merged
merged 1 commit into from
Jul 13, 2023
Merged

Object3D: Shallow copy the animations array in copy() #26416

merged 1 commit into from
Jul 13, 2023

Conversation

GoJermangoGo
Copy link
Contributor

Currently, when an Object3D is copied or cloned, the copy's animations array will be the same array object as the original. This is problematic because modifying the array in one object will also modify the other object. This PR makes a shallow copy of the animations array to allow safely modifying it.

@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
643.9 kB (159.7 kB) 643.9 kB (159.7 kB) +8 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
437 kB (105.8 kB) 437 kB (105.8 kB) +8 B

@Mugen87 Mugen87 added this to the r155 milestone Jul 12, 2023
@Mugen87 Mugen87 merged commit c6273ad into mrdoob:dev Jul 13, 2023
@GoJermangoGo GoJermangoGo deleted the patch-2 branch November 16, 2023 02:01
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.

2 participants