Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

import and export fbx at the runtime

Discussion in 'Scripting' started by none3d, Mar 12, 2021.

  1. none3d

    none3d

    Joined:
    Mar 4, 2021
    Posts:
    156
    Hi
    i want to import and export fbx at the runtime
    please help me
    thanks
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    There's no built-in support for runtime loading of FBX files. You'd have to write your own loader or depend on asset bundles.
     
    TheDevloper likes this.
  3. none3d

    none3d

    Joined:
    Mar 4, 2021
    Posts:
    156
    ok if there is no package for import fbx at the runtime , what is your suggested way to load the "terrain and lots of objects from hard disk" at runtime?
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,996
    there's many free fbx importer/exports (and asset store has some paid ones too i guess).

    have some list of importer/exporters here https://github.com/UnityCommunity/CADImportExport/issues/1

    asset bundles would be probably best bet (since they contain unity components, materials, colliders etc)..
    but the problem is that they need to be authored inside unity. (to generate asset bundles)

    for terrain can load heightmap as a texture, and other texture maps for splatmaps, treemaps etc.
     
    Mashimaro7 likes this.
  5. none3d

    none3d

    Joined:
    Mar 4, 2021
    Posts:
    156
    Are the fbx
    thanks for your reply
    1-are importers you mentioned working at the runtime?!
    2-how can load heightmap to form of terrain with texture?
    3-for other objects how can load them with textures at the runtime? if i load them to form of OBJ then texture of them is problem ...
     
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,996
    1) probably not all of those, haven't tested (and some are quite old, that list only contains those found in github, asset store has more)
    2) if its unity terrain, then something like this https://answers.unity.com/questions/1241166/raw-file-heightmap-switch-at-runtime.html *note that is quite old post, things might have changed.. but search for runtime terrain heightmap
    if its custom mesh terrain, then not really applicable to that
    3) basic textures do work from obj, fbx (with asset bundles you'd probably have more control of advanced textures and shaders, with obj/fbx you'd need to assign special shaders / their properties after importing)
     
  7. none3d

    none3d

    Joined:
    Mar 4, 2021
    Posts:
    156
    yes my terrain is custom mesh (Made by 3D-Max)
     
  8. none3d

    none3d

    Joined:
    Mar 4, 2021
    Posts:
    156
    i read all of your weblog , thanks , that is good
    i searched about import fbx at the runtime... but not found any solution
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,996
  10. jasoncatalyst

    jasoncatalyst

    Joined:
    Aug 15, 2018
    Posts:
    2
    This is the stupidest thing I've ever seen in my life. How can you call yourself a 3D engine and not even be able to load an FBX file? Why would they make you jump through hoops to load something every game on the planet needs to load? Maybe I'm ignorant, but that's like not having a simple way to load a text file in a word processing program. WHAT?!
     
  11. mh181221

    mh181221

    Joined:
    Feb 2, 2022
    Posts:
    1
    If you add the fbx to your Unity project then you can load it without problems in the runtime. This is only a problem when you want to load fbx file that are not already in your Unity project.
     
  12. zwcloud

    zwcloud

    Joined:
    Mar 15, 2016
    Posts:
    377
  13. TamKC

    TamKC

    Joined:
    Sep 11, 2015
    Posts:
    1
    Thank you for sharing the amazing asset! Runtime FBX loading is what I am looking for my project!

    And #10 I know your reply is about a year ago, but what you're doing is: saying somebody is stupid when you couldn't understand the problem is not simple at all.
     
    zwcloud likes this.