Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Chris-Mietzsch opened this issue Feb 20, 2024 · 0 comments

Comments

@Chris-Mietzsch
Copy link

Chris-Mietzsch commented Feb 20, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant