Some materials cannot copy from other material types
See original GitHub issueThe copy
function on a number of materials assume that they are copying from the same material type and don’t check if a field exists before trying to copy it, resulting in an error.
In this case, the Phong material tries to copy the specular
color from the Lambert material, which does not exist.
(new THREE.MeshPhongMaterial()).copy(new THREE.MeshLambertMaterial());
// Throws error on
// https://github.com/mrdoob/three.js/blob/dev/src/materials/MeshPhongMaterial.js#L122
One possible fix would just be to check if a field exists before trying to call copy on it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Materials not copying to a copied classroom - Google Help
I have created a classroom for a Year 9 class I have and set out topics and added (lots of) materials. There are...
Read more >How do you copy, paste, save and load materials in Lumion ...
1. There are five ways to transfer materials Copying and pasting a material. Saving and loading a material from a file. Saving a......
Read more >Copy-Paste Values Additional Material Properties - YouTube
Copy -paste any of the additional material properties. ... try restarting your device. Your browser can't play this video.
Read more >Blender 2.8 Tutorial: Copy Material - YouTube
I quick and easy method for copying materials to another object.#Blender # Material #Tutorial.
Read more >Copy Material Master Record -- All Answers will be rewarded
Hello All, I need to copy the set of materials from one plant to another plant. Say I need to copy Materials from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think that has been suggested. Even if NodeMaterial were merged into
src/
immediately, we’d still want to keep a backward-compatible interface for existing materials, and functional.copy()
methods should be part of that.Closing, see https://github.com/mrdoob/three.js/issues/17565#issuecomment-627009414.