0

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

I am able to convert them using this Loading 3d object from external server in Unity3D . But My application allows end users to upload their own 3D models and view them in application by downloading at run time .

p.s : I am very new to unity .

Programmer
  • 121,791
  • 22
  • 236
  • 328
Faiyaz Md Abdul
  • 546
  • 5
  • 14
  • 29

1 Answers1

2

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

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

But My application allows end users to upload their own 3D models and view them in application by downloading at run time .

If what you are trying to do is allow people to import and view fbx model into Unity then you don't need Assetbundle to do this.

You have two otipns:

1.Use the TriLib (Not free) plugin if you want to support 40+ other 3D file formats too.

2.If you can't afford a paid working plugin, make your own. This requires you build a plugin with Autodesk FBX SDK in C++ and use C# to communicate with this. Since you are a beginner, I will suggest you go with #1.

Programmer
  • 121,791
  • 22
  • 236
  • 328
  • I tried the test plugin . for some 3D models it doesn't seem to properly import all textures . – Faiyaz Md Abdul May 18 '18 at 11:44
  • Don't worry about textures. You can do that easily from script. The only thing to care about is loading the mesh which the plugin can do. For the texture, simply instantiate the loaded mesh, attach material to it with a shader then load the texture yourself and assign it to the object. – Programmer May 18 '18 at 11:49
  • what in case of 100's of child objects with different textures ? – Faiyaz Md Abdul May 18 '18 at 11:53
  • You want end users to upload their own 3D models? They provide you with the model and texture for each one then you load the model with the plugin and apply the texture to it....Nothing complicated here. – Programmer May 18 '18 at 11:57
  • Dont i need specify which texture to be applied to each and every child object ? – Faiyaz Md Abdul May 18 '18 at 12:00
  • @FaiyazMdAbdul In Unity each model has textures like albedo, normal and occlusion map. If there is a model and a child object with another model, each has different textures unless it is basically the-same model duplicated then they can share the-same texture. I think this is what programmer is trying to say – PassetCronUs May 18 '18 at 14:00
  • my bad . I meant materials actually . I tested the demo and materials seemed to be missing – Faiyaz Md Abdul May 18 '18 at 14:16
  • I mentioned this in my first comment. You are responsible for creating material with the textures that usually comes with the model. Again, you create a material, attach it to the loaded mesh and then apply the texture to the material and that's it. – Programmer May 18 '18 at 15:01