Skip to content

Commit

Permalink
WarnOnce in debug mode if material parameter is being set to undefined (
Browse files Browse the repository at this point in the history
#7305)

Co-authored-by: Martin Valigursky <[email protected]>
  • Loading branch information
mvaligursky and Martin Valigursky authored Jan 22, 2025
1 parent 7a26a64 commit 2d34c85
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/scene/materials/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,13 @@ class Material {
}

_setParameterSimple(name, data) {

Debug.call(() => {
if (data === undefined) {
Debug.warnOnce(`Material#setParameter: Attempting to set undefined data for parameter "${name}", this is likely not expected.`);
}
});

const param = this.parameters[name];
if (param) {
param.data = data;
Expand Down

0 comments on commit 2d34c85

Please sign in to comment.