glTF Export
glTF/GLB Export for WebGL, Facebook, Microsoft Paint 3D, and many more. The latest standard in 3D formats.
glTF Export

This exporter will create a glTF 2.0 model of your currently open SketchUp model.

Choose either an embedded glTF (.gltf) file, or a binary glTF (.glb) file.

To run the export, from the 'Extensions' menu item, select 'Khronos glTF', and then select either 'Export Embedded glTF 2.0 (.gltf)', or 'Export Binary glTF 2.0 (.glb)'.

The first option is the text only gltf file. This is a pure JSON payload with the binary data embedded with Base64 encoding.

The second option is a single binary file and is supported by facebook and Microsoft Paint 3D.

To see the resulting model, drag it here:

https://gltf-viewer.donmccurdy.com

Or if you exported it to a .glb, open it in Paint 3D.

 

Note: glTF formats support JPG and PNG textures. So if you have imported another import format such as BMP as a texture into sketchup, you will need to convert the texture to PNG or JPG and import into Sketchup again, before exporting to glTF.

 

New in version 1.2.4 - Improved color conversion, metallicity defaults to 0.1 and roughness to 0.9 to better match Sketchup Materials.

1.2.5 Added a texture sampler to correct some issues with texture mapping.

1.2.6 Fixed issue with inverted faces when a transform was applied that had a negative matrix determinant.

 

Reviews

Could this extension export the properties of dynamic component? Such as "ItemInfo".

Pierre M.'s picture

Really great plugin ! Bravo

One question : is it (how to) possible to render also the measurment ?

Awesome!!

Hi Centaur,

We are encountering a problem with flipped objects. In a some cases, if we duplicate an object and flip it (by right-clicking and selecting Flip Along -> Group's Red for instance), the flipped object has inverted normals when exported to GLTF. The same happens when scaling with -1. The problem does not occur when exporting to other formats. Do you know how we can fix this, or is it a bug in the exporter?

A simple example with a cube and its flipped counterpart can be found here:
https://mega.nz/#!m2oiBBYT!dovwk7kwLwkBDldLRm2jVP33kZETCgSUtxFGAQmoVrY
Just export to .gltf and you can see that one cube has inverted normals. You can reproduce the bug by copy and pasting the cube closest to the origin, right-clicking while having the copy selected, and selecting Flip Along -> Group's Red.

If it is a bug, I would be willing to try and find it myself if you are willing to share the code.

Regards,

Joey

is there any tutorial video on youtube
explain how to upload o facebook and how to edit the model

Dragos B's picture

Great plugin!
How can I add reflection to the objects?

Centaur's picture

By reflection I assume you mean make the materials more reflective? To do that increase the metallicFactor (1.0 is the maximum value), and decrease the roughnessFactor (0.0 is the minimum value). You can do this by editing the materials in the .gltf file, or you might try this plugin for Sketchup.

https://github.com/SamuelTS/SketchUp-PBR-Plugin

Dragos B's picture

Thanks for the answer.

I tried editing the glb file with a text editor. I easily found the material and modified it`s values. But when i try the file in https://gltf-viewer.donmccurdy.com i get "Invalid typed array length: 538970060" error.

I also used PBR extension for SketchUp, but even though i set the Metallic value to 0.1 and the roughness to 1, the material is exported as if the Metallic si set to 1.

Please advise.

Centaur's picture

Hi Dragos,

The .glb file can't be edited as it contains binary data, only the .gltf file can be edited.

As for materials exporting with a 1 value, check the name of the material - my exporter sets metallic on a number of conditions, including 'aluminium', 'metal', 'steel', and 'gold' as all or part of the material name (case-insensitive). Also '0046_Gold' and '0131_Silver' is set to metallic.

So if that is the case in your model, you will need to rename the material.

Tyson G's picture

What's the best way to edit the materials in the GTFL - is there a recommended program for doing this? I'm glad that a plugin like this exists - is this the ideal way to go about editing materials for gtfl files made in SketchUp, or would you recommend using a separate platform entirely? Do you know how one might request a "highlight selected material" feature or something for the plugin? I haven't quite figured out how to label my materials, so i don't actually know which materials the plugin is referring to in the dropdown list.

Since PBR plugin v1.2.1:
When user selects a material in Materials Tray before open PBR Material Editor: this material is highlighted in PBR Material Editor.

“Do you know how one might request a "highlight selected material" feature or something for the plugin?”
Request a feature for PBR plugin here: https://github.com/SamuelTS/SketchUp-PBR-Plugin/issues
Click on "New issue" button then explain in detail what you want ;)

Regards

Centaur's picture

Label a material in sketchup by giving it a name when you create a new material. If you use an existing sketchup material it will have an existing name such as '0020_Red', or 'Concrete Tile'. Regardless, these names are exported into the .gltf (even though they are not used), so you can search for that name and then edit the metallicFactor and roughnessFactor associated with that material.
An undocumented feature of my export is that if it sees 'metal' in the name of the material it will give it a metallicFactor of 1.0.
To make life easier I'd recommend the extension in my reply to Dragos above.

Tyson G's picture

For some reason all my materials get labeled as "material 1", "material 2", etc. I usually end up having like 20-30 numbered material types within a file to navigate through. (See screenshot here: https://drive.google.com/file/d/1FiqppgNt2AVVk44F7q3uXs1fF6Nso_jC/view?usp=sharing)

I usually find a paint color through the color wheel and just apply it to a face and try to stick w the same colors via the recently used/saved grid at the bottom. When I try to edit a material name, it lets me type a new one in, but it never saves one. I must be doing something wrong.

Tyson G's picture

Hi! I'm really looking forward to using this plugin, but every-time I try to export I get the report posted below. At the recommendation of someone in the SketchUp community, I have exploded all of the groups, but the problem persists. I have uploaded the model into the 3D warehouse

What can I do to fix this?

"#

/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/mesh_geometry_collect.rbe:64:in `material_has_texture'
/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/mesh_geometry_collect.rbe:164:in `block (2 levels) in collate_geometry'
/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/mesh_geometry_collect.rbe:157:in `each'
/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/mesh_geometry_collect.rbe:157:in `block in collate_geometry'
/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/mesh_geometry_collect.rbe:140:in `each_key'
/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/mesh_geometry_collect.rbe:140:in `collate_geometry'
/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/gltf_export.rbe:107:in `export'
/users/tysongersh/library/application support/sketchup 2018/sketchup/plugins/centaur_gltf_export/gltf_export.rbe:28:in `block in '
SketchUp:1:in `call'"

Centaur's picture

Hi Tyson,

Don't explode the groups!
I've seen this error when I have un-grouped geometry with nil material.
I will see what I can do to fix this, but meanwhile select everything and place within a group.

Tyson G's picture

Thank you for letting me know and thank you for fixing the problem - it works perfectly now!! Great Plugin!

Ciao, ho usato l'estensione per esportare in GBL e creare un post 3D su FB, ma non mi riconosce le texture. Il modello su FB di vede bene solamente da desktop, mentre da mobile (APP) si vede nero. Secondo voi è un problema di FB?

Grazie

Centaur's picture

Hi Fabio,

If the model is black then it could indicate that the textures were painted on the reverse side, so try reversing each face orientation in the model, reapply the textures to the front faces, and exporting again if you see this is the problem. It might be that the Facebook App is not fully compliant with some aspect of the specification. Failing that, can you share your model on the warehouse and send a link?

THe Model [3dpaint] model loaded directly into the latest powerpoint without a problem too.

I can rotate and scale the 3d model in edit mode, but in slideshow mode it is a static view of the model

kim C.'s picture

Sorry all brother and sister, Could you please tell how to install plugin glTF ?

Centaur's picture

from the menu item: Window -> Extension Manager
then click 'Install Extension' button.

Warrenn L's picture

Works really well, i tried it with some old google earth models, texture and geometry seems to be fine, the only thing is the conversion bring everything including hidden layers, not big issue, only need to erase before make the change.
Also i used it in facebook and i didn´t find any problem
Thank you

ThomThom's picture

Just tried this out - to test Facebook's new 3D post feature. .glb worked great for that. But I noticed that it exported hidden entities. Can I suggest that it's more of an expected behaviour to export only visible entities?

Tyson G's picture

I feel the same way! It creates a situation where we have to prepare a special model (that lacks all of the stuff we've hidden, but still need to use as we continue to work on the model) specifically for exporting, as opposed to being able to continually test models iteration by iteration. It would be super great if all export functions offered automatically exported only visible, or gave you the option between only visible and visible + hidden

ThomThom's picture

Additionally I'm seeing some materials missing in Windows 3d viewer. Let me know if you want me to provide an example file.

Centaur's picture

Hi ThomThom,

Are these materials 'painted' at the group or component level? In other words, the actual material is nil?
That is a known issue, and I'm not really sure how to resolve it. If it is something else, then yes, an example file would be useful.

Can you clarify what is Windows 3D viewer - Do you mean Paint3D, 'Mixed Reality Viewer', View3D (which is part of Microsoft's insider program), or something else?

Microsoft has done a fairly poor job at following the specification for glTF 2.0, even though they were part of the team developing the spec. For example, Paint3D requires a material name even though it is optional in the spec. For any Microsoft product, it would be best if the export option for Microsoft Paint 3D be used.

Adding check for hidden entities. :)

ThomThom's picture

They were in fact applied to the instances and not the faces directly. After transferring to the faces it worked right.

The way you handle instance materials for exports to other formats is that you need to keep track of the instance materials as you dig your way down the model hierarchy. When you start at the root, set a variable "default_mat" that defaults to nil (Default Material), as you recurse down the instances, pass that along and apply to any face with nil as material. (Not actually applying to the SU face, but to the generated output.) Maybe we can start a forum thread about this? Or is this extension open source with a github repository? (I could possibly contribute with a pull request.)

Question: the Windows viewer and FB viewer both opened the file with the camera appearing to come from the positive Y axis in SU looking back to the origin. Is that a camera set by the exporter? Or some defaults in the viewers?

Another request, a prompt for where to save the exported files would be nice.

Centaur's picture

That's weird, I already uploaded version 1.2.0 which added the file save dialog box in response to user feedback, but looking at the version listed on the website it only has version 1.1.2. That was done about a week after the extension first got published. I never got a notification that it passed/failed validation, I placed too much trust in a website that was known to mess with everyone.

OK, so I was tracking the parent material in my code, but looking at my old comments in the code, the issue was with textures, specifically I can't extract the image from a face that doesn't have a material applied. Does that make sense?

ThomThom's picture

Looking at the review log the latest submissing was set back in draft by "noone" - meaning the server did it. Probably due to a server glitch.
There's been reports that emails from Extension Warehouse can end up in Spam filters. You might want to check that and white-list the address.

As for the material, it's doable. But it's easier to talk about this in the forums. (Do you mind starting a thread? Mention my nickname @thomthom so I get a notification.) Alternativly, if you have a GitHub repo for this extension we can use the issue tracker.

i use gltf-export tools, the component's material lose. how to solve the problem?

Centaur's picture

Edit the component and Paint the component with a material at the individual face level - otherwise the material of the faces if going to remain nil, and be exported as the default material.

good job! I have successfully exported my skp models in gltf or glb, and this model can be viewer in paint3d within win10;

Hello,
have done a test but it is not working with paint 3d or view 3d in windows 10. In your online viewer it is possible to view it.
Can you please help.
Thank you very much.

Centaur's picture

Hi Grewe,
You did the export with the GLB (Microsoft Paint 3D) option, right?

One thing I find with Paint3D is that sometimes the first attempt fails, but it will open on the second attempt.
Also, Paint3D re-textures the entire model and does down-sampling to get the model within a 2048x2048 image - so it often looks awful.

Are you able to send me the exported GLB, or the Sketchup file that you used?
And let me know the version of Paint3D that you have, in case it is different from mine.

2531 users
Size:
52.14 KB
Version:
glTF Export (1.2.6); May 24, 2018
Number of Views: 
61
Category: 
SketchUp Compatibility: 
OS Compatibility: 
Extensions: 2
I'm a hexapod
More by Centaur