Skip to content

Commit

Permalink
Cube color in the editor renderer is now supported
Browse files Browse the repository at this point in the history
  • Loading branch information
NeylMahfouf2608 committed Feb 3, 2025
1 parent 9af6a42 commit 3f3a4c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Extensions/3D/JsExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -2406,14 +2406,15 @@ module.exports = {
}

updateColor(object) {
let colors: number[] = [];
let colors = [];

let color;
if (object.content.color) {
color = gdjs.hexNumberToRGBArray(object.content.color);
color = object.content.color.split(';').map(Number);
} else {
color = '128;128;128';
color = [128, 128, 128];
}

for (
let i = 0;
i < this._threeObject.geometry.attributes.position.count;
Expand Down Expand Up @@ -2559,7 +2560,7 @@ module.exports = {

if (materialsDirty) this._updateThreeObjectMaterials();
if (uvMappingDirty) this._updateTextureUvMapping();
this.updateColor(object.content);
this.updateColor(object);
}

/**
Expand Down

0 comments on commit 3f3a4c3

Please sign in to comment.