Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

material.onbeforerender is not a function #28947

Closed
MiguelG97 opened this issue Jul 23, 2024 · 1 comment
Closed

material.onbeforerender is not a function #28947

MiguelG97 opened this issue Jul 23, 2024 · 1 comment
Milestone

Comments

@MiguelG97
Copy link

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

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

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 23, 2024

The callback has been removed in #28702.

It was never meant to be public and just for internal use for the former node material system.

@Mugen87 Mugen87 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2024
@Mugen87 Mugen87 added this to the r168 milestone Aug 1, 2024
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

No branches or pull requests

2 participants