TypeError when copying MeshStandardMaterial to MeshPhysicalMaterial
See original GitHub issueDescription of the problem
When passing a MeshStandardMaterial to MeshPhysicalMaterial.copy(), the following error occurs
TypeError
at Vector2.copy
at MeshPhysicalMaterial.copy
source.clearcoatNormalScale
is undefined on MeshStandardMaterial, which leads to the error.
Please also include a live example if possible. You can start from these templates:
- jsfiddle (latest release branch)
Three.js version
- Dev
- [x ] r108
- …
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Hardware Requirements (graphics card, VR Device, …)
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Error in three.js :- Materials[json.type] is not a constructor
It was an old object file from R72, and the type it was returning was "MeshFaceMaterial". But that type no longer exists in...
Read more >MeshPhysicalMaterial – three.js docs
Any property of the material (including any property inherited from Material and MeshStandardMaterial) can be passed in here. The exception is the property ......
Read more >three.js - Apple Open Source
fromArray( this.elements ); }, copy: function ( m ) { var te ... function MeshPhysicalMaterial( parameters ) { MeshStandardMaterial.call( this ); ...
Read more >Module Specifiers Versus Relative Import References
Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".
Read more >ThreeJS Test - Github-Gist
Share Copy sharable link for this gist. ... else{var K=E.camera;p.copy(E.mapSize);p.min(n) ... isArray(a))throw new TypeError("THREE.
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
Actually, there is a problem still. After using the constructor version, the MeshPhysicalMaterial has .defines as STANDARD and not PHYSICAL. The .type property is also clobbered and is now MeshStanadardMaterial.
Nice! Using the constructor seems to do the trick at first blush. Will keep monitoring.