Rook Posted September 15, 2017 Share Posted September 15, 2017 I have a very basic setup, and it works in a Playground, but throws this error when I am running it in an Electron app (still very basic). I have [email protected] saved as an npm dependency. I have a Module that contains a class. Quote var BABYLON = require('babylonjs') class Star { constructor (scene, starData) { this.id = starData.id this.name = starData.name this.spectralColor = new BABYLON.Color3(1.0, 0.0, 0.0) this.absmag = starData.absmag // Create the mesh var mesh = new BABYLON.MeshBuilder.CreateSphere(starData.name, { 'diameter': 1.0 }, scene) // Load star texture files var material = new BABYLON.StandardMaterial('mat', scene) material.diffuseColor = new BABYLON.Color3(1, 0, 0) // material.emissiveColor = new BABYLON.Color3(1.0, 0.0, 0.0) // material.specularColor = new BABYLON.Color3(1.0, 0.0, 0.0) // material.ambientColor = new BABYLON.Color3(1.0, 0.0, 0.0) mesh.material = material . . . When the last line is commented out, this runs just fine, no errors. When material assignment is un-commented, it throws the following error in the console of Chrome: Quote home/rook/Documents/Projects/testing/node_modules/babylonjs/dist/prev…:25221 Uncaught TypeError: engine.getColorWrite is not a function at Function.MaterialHelper.PrepareDefinesForFrameBoundValues (/home/rook/Documents/Projects/testing/node_modules/babylonjs/dist/prev…:25221) at StandardMaterial.isReadyForSubMesh (/home/rook/Documents/Projects/testing/node_modules/babylonjs/dist/prev…:31138) at Mesh.render (/home/rook/Documents/Projects/testing/node_modules/babylonjs/dist/prev…:22375) at SubMesh.render (/home/rook/Documents/Projects/testing/node_modules/babylonjs/dist/prev…:24285) at t.renderUnsorted (babylon.js:9) at t.render (babylon.js:9) at t.render (babylon.js:9) at r._renderForCamera (babylon.js:10) at r._processSubCameras (babylon.js:10) at r.render (babylon.js:10) I think that this is very basic and simple code, and cannot figure out why this is throwing a Uncaught TypeError. Quote Link to comment Share on other sites More sharing options...
Rook Posted September 15, 2017 Author Share Posted September 15, 2017 Rolled back from version 3.1.0-alpha2 to 3.0.7 and the problem goes away. This seems to be a bug in the latest version. Quote Link to comment Share on other sites More sharing options...
Rook Posted September 15, 2017 Author Share Posted September 15, 2017 Logged bug. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 15, 2017 Share Posted September 15, 2017 Can you repro in the PG? Quote Link to comment Share on other sites More sharing options...
Rook Posted September 15, 2017 Author Share Posted September 15, 2017 I cannot choose a version number in the Playground, only 'Stable' vs 'Latest'. For me, when I 'npm remove babylonjs' and then 'npm install --save [email protected]' and then the code worked, it seems like a version bug in the Alpha. I could be wrong? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2017 Share Posted September 18, 2017 The latest NPM version is the same as the playground in latest mode. Perhaps you can share a web page that highlights the issue? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.