How do I edit the draco compressed glb in the editor?

How do I edit the draco compressed glb in the editor? Such as change the materials.
We are making the products configurator, so we need to config several materials used onto an entity and switch them at the runtime.

Thanks,

Hi @goinix_project,

You can’t import and edit GLB models in editor right now, but support for them is coming soon!

Check this related post: How to Import model fully textured? - #2 by Leonidas

Good shout on the whether Draco will be supported in the first release of GLB import next year.

I let @slimbuck know about this :slight_smile:

1 Like

Unlikely to be in the first version of the feature unfortunately but will definitely look into it for future releases :slight_smile:

But to focus on this bit, you can load Draco GLBs at runtime via the scripts here https://developer.playcanvas.com/en/tutorials/loading-draco-compressed-glbs/

Once loaded, the hierarchy is added to the scene and you can change the materials/textures/etc at runtime like you normally would with Entities.

Thank you, it’s a good new from the twitter. :smile:

Thanks steven,

Where did you capture this picture? Is it the editor interface?
Why is it different with mine? I don’t know how to get the above menus in my editor.

That is part of my dev tools that I use to debug runtime issues: yaustar.github.io/playcanvas-devtools at master · yaustar/yaustar.github.io · GitHub

1、Should we use your dev tools to do?
2、I have found the following project, it used the js to load the model and use js to contral the exchaging of the material. The only difference is the model in it is json file no glb. Please have a look if the function of the js is similar?
https://playcanvas.com/project/1020966/overview/carconfiguratorbmw1

Completely optional. I use them because it makes my life easier when dealing with runtime issues.

It depends because some parts would be similar and some parts would be different. Without you being more specific, I can’t answer.

I recommend starting from the project I linked and just trying to change the material of the heart at runtime.

Yes, I’m study that project these days, and I found your uber tools and have a problem posted here:

BTW, I’m not programmer, just do first round reserch, and pass the job to our coder :smile:

One more question,if we import a draco glb with fully textured models with material settings, how could we to compress(basis) the textures in the glb? Does them need to be compress basis?

Assuming you would be using the project I linked to above, you would have to compress the textures in the GLB before importing them into PlayCanvas.

You would also have to import the Basis library into the PlayCanvas project.

You mean we could compress(basis) the textures outside the playcanvas? How can we do this? any tool?

I don’t know any tools offhand but you would be looking for something that would do KTX2 texture compression

gltf transform can be used from command line and can apply mesh / texture compressions

2 Likes

Thanks, We will try it.

Thank you Steven,
Please read the question at the post:

To visulize the imported glb in the editor is very important to us :smile:

It was already answered this (UK) morning :slight_smile:

Many thanks, I got it! Just missed it :sweat_smile: