Skip to content

Error when creating asset bundles from .fbx models, .obj file fails to be created #689

@Chris-Mietzsch

Description

@Chris-Mietzsch

Hi,

I am trying to use the first script for the asset bundle creator:

from pathlib import Path
from tdw.asset_bundle_creator.model_creator import ModelCreator
from tdw.backend.paths import EXAMPLE_CONTROLLER_OUTPUT_PATH

output_directory = EXAMPLE_CONTROLLER_OUTPUT_PATH.joinpath("local_object")
print(f"Asset bundles will be saved to: {output_directory}")
ModelCreator().source_file_to_asset_bundles(name="paper_towels",
                                            source_file=Path("paper_towels.fbx").resolve(),
                                            output_directory=output_directory)

and get the following error:

(.venv) christiane@christianes-air TDW % /Users/christiane/Prog/TDW/.venv/bin/python /Users/christiane/Prog/TDW/fbx-to-prefab.py
Your version of the Asset Bundle Creator Unity project is up to date: 2.0.7
Started log at: 02/20/24 13:04:55
Creating a prefab.
Trying to get or create a visual mesh file.
Loaded GameObject at: Assets/source_files/pan/pan.fbx
Setting import options for: pan
Import mode: LegacyImport
Material location: External
Mesh readability: False
Mesh scale: 1
Trying to get or create a collider mesh file.
Source file is a: .fbx... Converting now to a .obj...
Launched: /Users/christiane/asset_bundle_creator/executables/Darwin/assimp/assimp export "/Users/christiane/Prog/TDW/pan.fbx" "/Users/christiane/asset_bundle_creator/Assets/source_files/pan/pan.obj"
Done!
Error! Failed to create: /Users/christiane/asset_bundle_creator/Assets/source_files/pan/pan.obj
UnityEngine.Debug:LogError (object)
MeshConverter:FileExists (string) (at Assets/Scripts/Editor/MeshConverter.cs:329)
MeshConverter:Assimp (SourceFile,string,string&) (at Assets/Scripts/Editor/MeshConverter.cs:220)
MeshConverter:CreateHullCollidersMesh (SourceFile,int,single,string[]&) (at Assets/Scripts/Editor/MeshConverter.cs:121)
ModelCreator:CreatePrefab () (at Assets/Scripts/Editor/AssetBundleCreator/ModelCreator.cs:178)
AssetBundleCreator`2<ModelCreator, ModelRecord>:SourceFileToPrefab () (at Assets/Scripts/Editor/AssetBundleCreator/AssetBundleCreator.cs:200)


Started log at: 02/20/24 13:26:29
Creating a prefab.
Trying to get or create a visual mesh file.
Loaded GameObject at: Assets/source_files/pan/pan.fbx
Setting import options for: pan
Import mode: LegacyImport
Material location: External
Mesh readability: False
Mesh scale: 1
Trying to get or create a collider mesh file.
Source file is a: .fbx... Converting now to a .obj...
Launched: /Users/christiane/asset_bundle_creator/executables/Darwin/assimp/assimp export "/Users/christiane/Prog/TDW/pan.fbx" "/Users/christiane/asset_bundle_creator/Assets/source_files/pan/pan.obj"
Done!
Error! Failed to create: /Users/christiane/asset_bundle_creator/Assets/source_files/pan/pan.obj
UnityEngine.Debug:LogError (object)
MeshConverter:FileExists (string) (at Assets/Scripts/Editor/MeshConverter.cs:329)
MeshConverter:Assimp (SourceFile,string,string&) (at Assets/Scripts/Editor/MeshConverter.cs:220)
MeshConverter:CreateHullCollidersMesh (SourceFile,int,single,string[]&) (at Assets/Scripts/Editor/MeshConverter.cs:121)
ModelCreator:CreatePrefab () (at Assets/Scripts/Editor/AssetBundleCreator/ModelCreator.cs:178)
AssetBundleCreator`2<ModelCreator, ModelRecord>:SourceFileToPrefab () (at Assets/Scripts/Editor/AssetBundleCreator/AssetBundleCreator.cs:200)

When I export my model directly as a .obj file from blender, it works, but it seems that the conversion from .fbx to .obj fails. Am I doing something wrong? (I installed assimp and it still fails, but that shouldn't be necessary?) I am on an M1 macbook air. I would rather not reexport every file to obj ;). Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions