如何在 Unity 运行时加载 FBX 文件? [英] How can I load FBX file in Unity runtime?

查看:28
本文介绍了如何在 Unity 运行时加载 FBX 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在参与一个 hololens 项目.我老板说,在运行时加载fbx文件(我们使用unity).我们的 fbx 文件在运行时会发生变化,因此我们必须重新加载它(fbx 是从 3dMAx 更改而来的).

I am on a hololens project. My boss says, load the fbx file at runtime (we use unity). Our fbx file changes at runtime, so we must reload it (fbx is change from 3dMAx).

我尝试了 AssetBundle,但是如果没有 unity 或 unity 编辑器模式,我无法创建 Assetbundle 文件.据我所知,只有资源(在项目选项卡中)可以将资产插入资产包.如果我可以在没有unity项目的情况下通过fbx文件构建Assetbundle文件,我就可以做到.

I tried the AssetBundle, but I can't create Assetbundle files without unity or unity editor mode. As far as I know, only resource (in Project tab) can insert assets to assetbundle. If I can build Assetbundle file by fbx file without unity project, I can do all.

总而言之:我需要如何在没有统一资源的情况下在运行时加载 fbx 的方法.如果我在运行时将 fbx 资产设置为 assetbundle(fbx 不属于项目选项卡),那就没问题了.

To sum it up: I need way how to load fbx in runtime without unity resource. If I make fbx asset to assetbundle in runtime (fbx is not belong in project tab), it's ok.

编辑)

使用 trilib 资源是最好的方法.我尝试制作自己的 FBX 加载器,这太难了,而且工作量很大.我认为 trilib 并不完美,但它是最好的.

Using trilib asset is the best way. I try make own FBX loader, it's too difficult and a big job. I think trilib is not perfect, but it is the best.

推荐答案

您可以阅读以下内容:

is-there-an-easy-way-to-import-fbx-files-runtime:

简而言之:没有

Unity 不支持导入/加载任何模型格式运行.唯一的例外是 AssetBundles.您的选择是基本上:

Unity doesn't support importing / loading of any model format at runtime. The only exception are AssetBundles. Your options are basically:

  • 使用 AssetBundles

  • Use AssetBundles

为您所需的 Unity 格式查找导入器

Find an importer for your desired format for Unity

自己编写这样的导入器

寻找功能请求/自己编写一个请求 UT 是否添加运行时模型加载例程.

Look for a feature request / write one yourself to ask UT if they add runtime model loading routines.

how-to-convert-3ds-fbx-model-into-asset-bundle-at-run-time:

是否有将 3D 模型转换为资产包的工具?或者是可以在运行时转换它们吗?

Is there a tool which converts 3D models to asset bundles ? or is it possible to convert them at run time ?

你不能在运行时因为每个用于创建 Assetbundle 的 Unity API 仅在仅用于编辑器插件的编辑器.

You can't during the run-time because every Unity API to create Assetbundle is only available on the Editor for Editor plugins only.

我在很多网站上搜索了这个问题.最后,我建议你可以使用这个资产.它不是免费的,但值得.它可以为你节省很多时间.

I search many website for this question. Finally, I recommand that you could use this asset.It's is not free,but worth.It could save much time for you.

trilib-unity-model-loader

希望能帮到你.

这篇关于如何在 Unity 运行时加载 FBX 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆