You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.in a separate class create MeshBasicMaterials and store them in class variables. It's crucial to import MeshBasicMaterials directly from three library without using import * as THREE from "three"
2. Then use then in a scene by referencing them
3. The console enters in a loop showing the following error:
material.onbeforerender is not a function
Code
import { MeshBasicMaterial } from "three";
public boundaryLine_Mat: LineMaterial | undefined;
public outlineMesh_Mat: MeshBasicMaterial | undefined;
public annotationMesh_Mat: MeshBasicMaterial | undefined;
public planeFaceMesh_Mat: MeshBasicMaterial | undefined;
Live example
The issue it's solved by instead doing the following import:
import * as THREE from "three";
and using them as THREE.MeshBasicMaterial.
which is not desirable because I'm importing all the classes from three package in a material class that is only suppose to use materials.
Screenshots
No response
Version
^0.163.0
Device
Desktop
Browser
Chrome
OS
Windows
The text was updated successfully, but these errors were encountered:
Description
material.onbeforerender is not a function issue
Reproduction steps
1.in a separate class create MeshBasicMaterials and store them in class variables. It's crucial to import MeshBasicMaterials directly from three library without using import * as THREE from "three"
2. Then use then in a scene by referencing them
3. The console enters in a loop showing the following error:
material.onbeforerender is not a function
Code
Live example
The issue it's solved by instead doing the following import:
import * as THREE from "three";
and using them as THREE.MeshBasicMaterial.
which is not desirable because I'm importing all the classes from three package in a material class that is only suppose to use materials.
Screenshots
No response
Version
^0.163.0
Device
Desktop
Browser
Chrome
OS
Windows
The text was updated successfully, but these errors were encountered: