Skip to content

Material: Fix copy method to include allowOverride property#32269

Merged
Mugen87 merged 2 commits into
mrdoob:devfrom
crazylogic03:fix-material-allowoverride
Nov 15, 2025
Merged

Material: Fix copy method to include allowOverride property#32269
Mugen87 merged 2 commits into
mrdoob:devfrom
crazylogic03:fix-material-allowoverride

Conversation

@crazylogic03

Copy link
Copy Markdown

The copy method in Material was missing the allowOverride property that is defined in the constructor. When cloning a Material instance, this property was not copied to the new material, causing incorrect behavior when allowOverride was set to false.

Fixed by ensuring allowOverride is properly copied in the copy method.

Related issue: N/A

Description

The copy method in Material was missing the allowOverride property that is defined in the constructor. When cloning a Material instance, this property was not copied to the new material, causing incorrect behavior when allowOverride was set to false.

@github-actions

github-actions Bot commented Nov 14, 2025

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 356.24
86.48
356.24
86.48
+0 B
+0 B
WebGPU 615.49
172.75
615.49
172.75
+0 B
+0 B
WebGPU Nodes 614.1
172.5
614.1
172.5
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 488.12
121.26
488.12
121.26
+0 B
+0 B
WebGPU 685.04
188.04
685.04
188.04
+0 B
+0 B
WebGPU Nodes 626.76
171.25
626.76
171.25
+0 B
+0 B

Comment thread src/materials/Material.js Outdated
crazylogic03 and others added 2 commits November 15, 2025 14:39
The copy method in Material was missing the allowOverride property that is defined in the constructor. When cloning a Material instance, this property was not copied to the new material, causing incorrect behavior when allowOverride was set to false.

Fixed by ensuring allowOverride is properly copied in the copy method.
Honor `allowOverride` in `toJSON()`
@Mugen87 Mugen87 merged commit a5d8232 into mrdoob:dev Nov 15, 2025
8 of 9 checks passed
@Mugen87 Mugen87 added this to the r182 milestone Nov 15, 2025
@Mugen87

Mugen87 commented Nov 15, 2025

Copy link
Copy Markdown
Collaborator

I have added ba1655c to make sure deserialization works as well.

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