Skip to content

Line, Points: Copy morph targets in copy(). - #35147

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Enesuygurs:fix/line-points-copy-morph-targets
Oct 22, 2026
Merged

Mugen87 merged 1 commit into
mrdoob:devfrom
Enesuygurs:fix/line-points-copy-morph-targets

Conversation

@Enesuygurs

Copy link
Copy Markdown
Contributor

Related issue: -

Description

Line and Points initialize morphTargetInfluences and morphTargetDictionary from their geometry, but unlike Mesh.copy(), their copy() methods don't transfer them. A cloned Line or Points with morph attributes ends up with both properties undefined, and WebGLRenderer then throws TypeError: Cannot read properties of undefined (reading 'length') in WebGLMorphtargets.update().

This PR copies both properties the same way Mesh.copy() does, and adds a copy/morphTargets unit test for each class.

Tested with npm test, and by rendering a cloned Line and Points with morph attributes using WebGLRenderer in Chrome (throws before the change, renders after it).

@github-actions

Copy link
Copy Markdown

📦 Bundle size

Full ESM build including core, minified and gzipped.

Before After Diff
Core 393.41
103.04
393.93
103.11
+524 B
+71 B
WebGL 779.86
194.59
780.38
194.66
+524 B
+75 B
WebGPU 1110.22
298.70
1110.75
298.76
+524 B
+67 B
WebGPU Nodes 1108.17
298.34
1108.70
298.40
+524 B
+66 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 518.98
124.66
518.98
124.66
+0 B
+0 B
WebGPU 786.70
210.58
786.70
210.58
+0 B
+0 B
WebGPU Nodes 732.80
197.06
732.80
197.06
+0 B
+0 B

@github-actions

Copy link
Copy Markdown

🖼️ E2E screenshot tests

❌ 1 example(s) failed (full artifacts).

Example Expected Actual Diff
webgpu_camera_array

@Mugen87 Mugen87 added this to the r187 milestone Oct 22, 2026
@Mugen87
Mugen87 merged commit 0a8b48f into mrdoob:dev Oct 22, 2026
9 of 10 checks passed
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