What is the best workflow to import multiple FBX Assets into Godot
Asked Answered
H

13

0

Hi,
I've been scratching my head trying to find the best workflow to import Synty Assets and other assets packs I've purchased recently. All the tutorials online I've seen are either outdated, or refer to single models.

Mike from Gamefromscratch always mentions importing Synty Assets into Godot, but he always imports a whole 3D scene, not individual modular models - Obviously I want to create my own levels with the assets in Godot.

I need the textures to be applied and I also need simple collision shapes, Tri-Mesh is too detailed and expesive.

Most assets packs have hundreds of models.

I use Blender and also Unreal, so if Godot can't do it all I have them at my disposal.

What is the best or correct workflow?

Thanks.

Hughmanick answered 1/11, 2023 at 17:12 Comment(0)
S
0

Hughmanick Mike from Gamefromscratch always mentions importing Synty Assets into Godot, but he always imports a whole 3D scene, not individual modular models

There's no big difference. Modules are even easier to import than a large scene. Godot understands FBX very well (there were small problems with textures).

I also need simple collision shapes

Most assets packs have hundreds of models.

But there may be problems with collision shapes on hundreds of models… routine.

Personally, I try to run all models through Blender — sort of a "stnadartization stage". But it turns out that not all FBX features are preserved. So sometimes I have to import directly, correcting textures in the engine.

Seaport answered 1/11, 2023 at 19:17 Comment(0)
H
0

Seaport Thanks, but I wanted more detail, that's why I was asking about 'workflow'.

Let's take an example, I have the Synty Battle Royalle assets, they come in different formats, Unity, Unreal, OBJ and FBX. The Unity and Unreal versions have simple collision shapes.

From what I understand if I import the 323 assets/Meshes/Models from the Battle Royalle into Godot 4+ (with the installed FBX converter plugin) all the models will have to be converted to Physics objects to allow me to add collision shapes. I can't batch convert them, I have to do this one by one, is this correct?

Within the model veiwer when I've changed the model over to a Physics type model I then have access to a drop-down of various collison shape types: Decompose Convex, Simple Convex, Trimesh, Box, Sphere, Cylinder, Sphere. Typically I'd choose the least expensive, such as Box for most models.

But this is a terrible workflow for 323 models obviously - there's no batch method to do any of this within Godot that I can see - maybe I'm missing something?

I could of course use Blender and import the 323 models in, add collision shapes and save as GLTF, but for each model I would have to re-add the textures as Blender won't pick them up. That is terrible time consuming obviously too.

However if I use Unity or Unreal I can just import the 323 models in and I don't have to do anything else.

I'm sure there must be a correct method of a workflow in Godot, but I can't find any info on this - surely the devs have this figured out.

Can you provide steps for the workflow for multiple assets, or is it not possible currently with Godot?

Hughmanick answered 1/11, 2023 at 21:17 Comment(0)
S
0

Hughmanick Let's take an example, I have the Synty Battle Royalle assets

Unfortunately, I have no idea about the specifics of Synty Battle Royale.

I can't batch convert them, I have to do this one by one, is this correct?

But this is a terrible workflow for 323 models obviously - there's no batch method to do any of this within Godot that I can see - maybe I'm missing something?

Godot has the option to use scripts when importing assets. But I haven't used this feature yet - so far I haven't needed to import hundreds of objects at a time.

I could of course use Blender and import the 323 models in, add collision shapes and save as GLTF, but for each model I would have to re-add the textures as Blender won't pick them up.

Blender doesn't pick up textures? Perhaps this is a rather specific case and needs a special workflow.

Seaport answered 1/11, 2023 at 21:45 Comment(0)
M
0

If you add suffixes to your mesh name, Godot will automatically add a staticbody3d node and a collision shape to it.
There are different suffixes for different colliders. You could batch rename your meshes I guess.

https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_scenes.html#create-collisions-col-convcol-colonly-convcolonly

Markswoman answered 2/11, 2023 at 5:34 Comment(0)
H
0

Markswoman If my workflow was to first import the 323 meshes into Blender, I would then have to add the textures manualy, then manually add collision shapes with the suffix as you described, then export as GLTF, then import into Godot. This is a terrible workflow. It's ok if you have a few models, but useless for hundreds.

I don't know how to write a Godot batch script plugin to add box collision shapes to all the meshes.

I have read on Godot's Github there is a request for the feature to automatically add collision shapes when importing with the option for an overide where you may wish to have a more detailed shape for some meshes:

Global option to automatically "Generate Collision" of all meshes of a scene when importing a 3D scene #5955
https://github.com/godotengine/godot-proposals/issues/5955

Also...
New setting Generate Colliders into the Advanced Import Settings dialog #70256
https://github.com/godotengine/godot/pull/70256

At the bottom of the discusion there is a milestone (AThousandShips ) for it to be added, mentions it last week (at the end of October 2023) for 4.2 - 4.3.

Sadly though after looking through the current 4.2 beta it's nowhere to be seen, least I can't find it. If it's going to be included in 4.3, that's a long while away as 4.2 doesn't come out until mid November 2023 from what I understand and 4.3 will be much later on into next year I'd imagine.

Then after that issue there is no thumbnail asset browser in Godot, In my scenario you would have to scroll through 323 mesh names to find the model you wish to add to the scene. I'm aware there is a paid-for plugin for this (Asset Placer - https://cookiebadger.itch.io/assetplacer), but it really should be built into Godot.

I love using Godot, but for 3D it's missing some really obvious core features just now - not sure whether I should stick to Unreal for 3D projects and maybe leave Godot for 2D, I really wish I could use it for both.

Hughmanick answered 2/11, 2023 at 11:42 Comment(0)
M
0

Hughmanick Oh I see. Unfortunately I don't have any asset packs to test this. Maybe Kenney has some. I'm interested in this topic too as I find the 3D workflow somewhat confusing.

Markswoman answered 2/11, 2023 at 12:6 Comment(0)
H
0

Markswoman If you wish to test some Sythy Assets, there are some free ones on the Unity Asset Store, for example:

POLYGON Starter Pack - Low Poly 3D Art by Synty
https://assetstore.unity.com/packages/3d/props/polygon-starter-pack-low-poly-3d-art-by-synty-156819

Obviously you'd have to export them out from Unity and into Godot 😉

Hughmanick answered 2/11, 2023 at 12:23 Comment(0)
M
0

Legist So far I wasn't able to reproduce your blender problem. I used Kenney fbx models, but their materials still had textures on them.
And I don't have any Synty Packs to test.

EDIT: Ah thanks for the link! Will try. 🙂

Markswoman answered 2/11, 2023 at 12:23 Comment(0)
S
0

Hughmanick If you wish to test some Sythy Assets, there are some free ones on the Unity Asset Store, for example:

POLYGON Starter Pack - Low Poly 3D Art by Synty
https://assetstore.unity.com/packages/3d/props/polygon-starter-pack-low-poly-3d-art-by-synty-156819

I guess you have to register to download them?

Here is the beginning of the import automation discussion, maybe there is something useful there.

Undemonstrative You can try setting it up using the code set_surface_override_material(). Place the code in _ready() script somewhere above your imported node and it will do it for you automatically upon loading.

Seaport answered 2/11, 2023 at 12:31 Comment(0)
M
0

Seaport Yes you have to register and to download them you have use the Unity editor and import them.

Legist I tested it and get pink textures on all models. The only solution I found was (for those models that share the same material and texture):
Select one model, on its materials texture slot import the missing texture. Then selected all other models, make sure the previous selected is the active one and then press ctrl+L and chose link materials. This can be done in 2min, but it's annoying that you have to do that. I'm not sure why those textures aren't imported in the first place.

Markswoman answered 2/11, 2023 at 12:41 Comment(0)
H
0

Seaport I have seen a script that is meant to add collision shapes, but it was for Trimesh, which is too heavy, essentailly it's as heavy as the model itself. For most 3D collisions meshes/colliders a simple box would be sufficient.

Additonally, I also seem to have issue importing the standard Synty assets with textures, if I import the whole 3D model/level scene and drop the textures into that folder (same way Mike from gamefromscratch does), all import ok, but when you use the Synty single FBX assets, textures aren't applied.

I did see a video from a while ago where the assets were first opened in Unity, then exported from there, the textures worked when imported into Godot (maybe they were embedded?). I might try the same with Unreal to see how that goes, although at the same time I feel I'm wasting my time to some degree as it's very inconvenient just to import some assets correctly - these things in Godot really need addressing soon.

Hughmanick answered 2/11, 2023 at 12:48 Comment(0)
K
0

I recently bought the prototyping bundle from synty studios. I also struggled with the fbx files, which caused me to try and find a way to automate converting roundabout 480 files to glb (trying to go to gltf, but still figuring it out), and saving them as blender files. I realized I have to do this in blender. Here's how to do it.
Make sure you have blender 3.6.4 installed. Then it and go to the scripting panel, create a new script and paste this code in.

containing_dir is the directory containing all the .fbx files you want to convert.
save_dir is the directory where you want to save all the files in, as .blend files.
export_dir is the main directory where you want to export all the files to, as .glb files.
new_dir is just a directory to seperate the files into different folders. ex. you can point containing_dir to a folder named characters, give that same name to new_dir, then the blender and gltf folder will both have a characters folder.

import bpy
import os


containing_dir = "D:/my_files/assets/3d/synty_studios/prototype/_SourceFiles/fbx"
save_dir = "D:/my_files/assets/3d/synty_studios/blender"
export_dir = "D:/my_files/assets/3d/synty_studios/gltf"

dir = os.listdir(containing_dir)


def checkpath(path):
    if not os.path.isdir(path):
        os.mkdir(path)

new_dir="props"


checkpath(save_dir)
save_dir = save_dir+"/"+new_dir
checkpath(save_dir)
checkpath(export_dir)
export_dir = export_dir+"/"+new_dir
checkpath(export_dir)



for file in dir:
    if file.endswith(".fbx"):
        # Creating fbx import path
        file_import_path = containing_dir+"/"+file
        
        # Deleting all objects
        bpy.ops.object.select_all(action="SELECT")
        bpy.ops.object.delete(use_global=False, confirm=False)
        
        # Importing new fbx model
        bpy.ops.import_scene.fbx(filepath=file_import_path)
        
        # Preparing file names and save paths
        file_name = file.removesuffix(".fbx")
        save_name = file_name+".blend"
        gltf_name = file_name+".glb"
        
        # Apply transforms
        bpy.ops.object.select_all(action="SELECT")
        bpy.ops.object.transform_apply(location=False, rotation=False, scale=True)
        
        # Saving file as .blend
        bpy.ops.wm.save_as_mainfile(filepath=save_dir+"/"+save_name)
        
        # Saving file as .glb
        bpy.ops.export_scene.gltf(filepath=export_dir+"/"+gltf_name)

Hope this helps!

Konrad answered 9/11, 2023 at 8:18 Comment(0)
M
0

Konrad

I was able to use your script to convert to gltf.
These are the changes I made to make it work.

gltf_name = file_name+".gltf"
...
#Saving file as .glb
bpy.ops.export_scene.gltf(filepath=export_dir+"/"+gltf_name, export_format='GLTF_SEPARATE')

Mercurialism answered 9/2, 2024 at 21:41 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.