Brunex92 Posted May 16, 2017 Share Posted May 16, 2017 Hi, I've been doing this project for a while, but I've finished it 2 months ago. Then this weekend I opened again to test it, but I got this error: TypeError: BABYLON.GridMaterial is not a constructor Then I looked onto the PG source code, and saw that the GridMaterial reference has changed its path, I was using this one: <script src="https://cdnjs.cloudflare.com/ajax/libs/babylonjs/2.4.0/babylon.js"></script> <script src="http://babylonjs-playground.com/babylon.gridMaterial.min.js"></script> /*...*/ this.groundMaterial = new BABYLON.GridMaterial("plane", scene); The I updated to the new one, but again, it did not work, showing me the same error Did the GridMaterial changed something? If it did, how can I get its old reference? I have no intention of updating the code, since the project is finalized Quote Link to comment Share on other sites More sharing options...
Sebavan Posted May 16, 2017 Share Posted May 16, 2017 You can try this url: https://preview.babylonjs.com/materialsLibrary/babylon.gridMaterial.min.js Quote Link to comment Share on other sites More sharing options...
Brunex92 Posted May 16, 2017 Author Share Posted May 16, 2017 5 minutes ago, Sebavan said: You can try this url: https://preview.babylonjs.com/materialsLibrary/babylon.gridMaterial.min.js So, I've tried this one, but it also shows the same error Quote Link to comment Share on other sites More sharing options...
Sebavan Posted May 16, 2017 Share Posted May 16, 2017 This is strange cause it is the one in use in th playground and works: http://www.babylonjs-playground.com/#2ZIKV5 Quote Link to comment Share on other sites More sharing options...
Brunex92 Posted May 17, 2017 Author Share Posted May 17, 2017 I believe this has something related with the PG version, if you change it to Babylon 2.5 it won't work. It will even show the same error Quote Link to comment Share on other sites More sharing options...
Sebavan Posted May 17, 2017 Share Posted May 17, 2017 yep in 2.5 the reference is not present, but could you try the version I linked to you with 2.5 ? (at least the error could not be file not found if you reference this one) Quote Link to comment Share on other sites More sharing options...
JohnK Posted May 17, 2017 Share Posted May 17, 2017 The PG http://www.babylonjs-playground.com/index2_5.html#2ZIKV5 does give the same error when set to 2.5. The materials library references a change 6 months ago and a legacy grid https://github.com/BabylonJS/Babylon.js/tree/master/materialsLibrary/src/grid but there is no documentation on how to reference this as far as I can find. Quote Link to comment Share on other sites More sharing options...
Brunex92 Posted May 17, 2017 Author Share Posted May 17, 2017 8 hours ago, JohnK said: The PG http://www.babylonjs-playground.com/index2_5.html#2ZIKV5 does give the same error when set to 2.5. The materials library references a change 6 months ago and a legacy grid https://github.com/BabylonJS/Babylon.js/tree/master/materialsLibrary/src/grid but there is no documentation on how to reference this as far as I can find. Exactly! That's exactly my problem, I'm using an older version of Babylon, not this preview one, and I just need gridMaterial's reference Quote Link to comment Share on other sites More sharing options...
Sebavan Posted May 17, 2017 Share Posted May 17, 2017 Yep there are still available here : https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/dist/materialsLibrary/babylon.gridMaterial.js as you can see here: http://www.babylonjs-playground.com/index2_5.html#2ZIKV5#14 But not on a CDN. You were relying on the PlayGround as a cdn but everything is subject to change there. This will be all available with the next release. Quote Link to comment Share on other sites More sharing options...
Brunex92 Posted May 17, 2017 Author Share Posted May 17, 2017 Thanks, I kinda wanted to be on a CDN, but since that it don't exist and JS won't run the raw file from GitHub, I can run it directly from a script with no problems It's working now 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.