How to use the blueprint of GLTF Exporter

Hi everyone!

I am trying to use the GLTF exporter through the blueprint, but I don’t see any result at the moment. I am not sure what should I put into the inputs and I don’t find any documentation

Any idea of what should I use ?
That I want is to export a single object from Datasmith, that I have selected, to a GLTF file with its Metadata

Thank you

If you want to import an actor from the scene you are doing good but you still need to pass the level to the “object” input.

I think you could try to get it by taking your “part selected” > get level > get outer object.

1 Like

Thank you @UE_FlavienP,
With the changes you told me, I am able to export the whole level in a gltf file.

But, instead of that, that I need is to export a single file with the selected part.

The scene is composed of a building that I imported using Datasmith, so I have a building with its hierarchy of parts.
In my blueprints I have some functionality to walk around the building and select and highlight parts doing Raycast. That’s the way I get the unique part of the building that I want to export.

What we need at the final is to have a gltf with the same hierarchy that we can see in Unreal after importing it using Datasmith. And if this is not possible to do using a single export from the root of the model, (we tried to export in edit time, using the export from the menu, and it didn’t export any hierarchy)
the other approach that we are looking for is exporting all elements individually.

Thanks again. I appreciate your help

I just noticed that the “SelectedActors” input is to filter and export only the wanted parts. So I think I get it now.

So my main doubt right now is if this exporter can put all the metadata of the object into the gltf file… Or I need to do something manually or some modification in C++

First you need to make sure that on runtime import the hierarchy option is to keep full hierarchy and prevent datastmith to bundle all in one actor ( I think you are already doing that).

Second, correct my method will export full level if you pass an empty Set of selected actors. If you pass only the actors you want in the selected actors Set. Only those should be exported in your glTF file.

By default the glTF export should preserve the hierarchy of elements you are exporting. You should be able to check that if you open the glTF in a DCC such as blender.

You can also create a variable of glTFExportOption and edit its options to your needs and pass it to the “Export to glTF” function.

Hi Flavien. This is good, thank you for your help. I tried to create the export options variable via blueprints but I don’t see any block with that Make function. Is it possible to do with blueprint? or should I use C++ for that?

You could try something like that:

then you can set variables on the gltfExportOptions variable before using it in the export to gltf function.

1 Like

I’m using UE5. The gltfExportOptions just wants to reference something from the content browser, there are no options to set in the variable. But I can’t figure out how to create that type of asset in the content browser.
Does anyone have a sample of this BP working for any kind of mesh?

Here’s an export setup using UE4.27.2 with custom selection:

  1. Create BP_ExportManager Blueprint with Export Custom Event
  2. Mark ExportSelectedActors var to be editable
  3. Drag the manager into the level and populate ExportSelectedActors
  4. Setup a trigger event: Export through a Widget UI or keystroke

1 Like

Can you, Razivoid, please share with us how you set up the GltfExportOptions ? I can make it as a variable but it will reference a content browser item from where it doesn’t seem to be possible to create such an asset.

  1. Drag the Options pin and “promote to variable”

  2. You will still need to do the Construct GltfExportOptions on “begin play”/“Event Construct” to initialize the variable. Select “construct object from class” function + Select “gltf export options” in the class variable of your function.

  3. Fill it the way you want. All variables can be found in the options instance

2 Likes