Brunex92

GridMaterial old reference

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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.

 

 

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.