alters-mit / asset_bundle_creator

Asset Bundle Creator combines several open-source tools to make it easy to convert source files such as .fbx files into Unity prefabs and asset bundles.
Other
1 stars 0 forks source link

Error on converting .fbx to assetBundles #2

Open teunes1 opened 1 year ago

teunes1 commented 1 year ago

I try to use the docker with unityci/editor:ubuntu-webgl container and i try to automate converting .fbx to assetbundles however i'm currently receiving this error:

Created asset bundle: /home/output/VIRM/WebGL/VIRM KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0) AssetBundleCreator2[T,U].GetAssetBundlePath (UnityEditor.BuildTarget target) (at Assets/Scripts/Editor/AssetBundleCreator/AssetBundleCreator.cs:308) AssetBundleCreator2[T,U].GetURI (UnityEditor.BuildTarget target) (at Assets/Scripts/Editor/AssetBundleCreator/AssetBundleCreator.cs:362) AssetBundleCreator2[T,U].GetURLs () (at Assets/Scripts/Editor/AssetBundleCreator/AssetBundleCreator.cs:286) ModelCreator.GetRecord () (at Assets/Scripts/Editor/AssetBundleCreator/ModelCreator.cs:234) AssetBundleCreator2[T,U].CreateRecord (System.String libraryPath, System.String libraryDescription) (at Assets/Scripts/Editor/AssetBundleCreator/AssetBundleCreator.cs:117) SourceDirectoryCreator2[T,U].SourceDirectoryToAssetBundles () (at Assets/Scripts/Editor/AssetBundleCreator/SourceDirectoryCreator.cs:113)

executeMethod method ModelCreator.SourceDirectoryToAssetBundles threw exception.

The assetBundle file is there however i cannot load in unity.

alters-mit commented 1 year ago

I think I know what the problem is.

Did you include a build target flag, for example -windows ?

teunes1 commented 1 year ago

@alters-mit Thanks for your advise, i do use flag -webgl and the weird part is the folder is being created and inside of the folder are the following files model model.meta webgl webgl.meta

teunes1 commented 1 year ago

Yes i did use the flag -webgl

folder is being filled with 4 files: model model.meta webgl webgl.meta

alters-mit commented 1 year ago

Try checking out to branch urls_for_build_targets and rerunning your code. If you get an error, please post it on this thread.

teunes1 commented 1 year ago

Nice i do not receive errors now but the prefab if i try to load it is empty. I'm not fully experienced with unity but the step from .fbx to .obj is needed to make assetbundle?

Also in the folder i receive 4 files in my case my .fbx is called "auto"

"auto" "auto.manifest" "webgl" "webgl.manifest" all inside of the webgl folder, i just expect 1 assetbundle and 1 meta data

alters-mit commented 1 year ago

Nice i do not receive errors now but the prefab if i try to load it is empty.

That shouldn't happen... Can you send a zip of the fbx files?

I'm not fully experienced with unity but the step from .fbx to .obj is needed to make assetbundle?

The obj file is used to generate the mesh colliders. They can't be generated from an fbx file.

Also in the folder i receive 4 files in my case my .fbx is called "auto"

"auto" is the asset bundle. The other files are created by Unity and can be ignored.