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. Dismiss Notice

Question Load 3D Model from Cloud and use it as AR model.

Discussion in 'AR' started by AbayErol, Nov 12, 2020.

  1. AbayErol

    AbayErol

    Joined:
    Sep 14, 2020
    Posts:
    3
    My Problem:
    in my Applikation I have a dynamic list of models based on the available Prefabs which should be updated from an existing cloud storage. I want to add new 3D models in this online storage without having to create a new version of my Unity App.
    Simplified:
    What i have to do now:
    Add 3D Model to Assets/Models -> generate a Prefab of the Model -> rebuild my Applikation -> use new Model in App

    What i want to do:
    upload 3D Model to Cloudstorage -> use new Model in App

    Is this possible?
     
  2. ibrahimpenekli

    ibrahimpenekli

    Joined:
    Mar 10, 2015
    Posts:
    29
    Hi @AbayErol,

    Of course, it's possible. Use GLTF format for 3D models.
    Then, you can import them using this plugin at runtime.

    Good luck!
     
  3. AbayErol

    AbayErol

    Joined:
    Sep 14, 2020
    Posts:
    3
    Thank you i will try it as soon as possible!
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,992
    adding few other alternatives:
    - could use asset bundles (but bundles need to be created in unity editor though) https://docs.unity3d.com/Manual/AssetBundlesIntro.html
    - there's also many other runtime import formats, obj, fbx and more (can find free ones in github and paid solutions in asset store)
     
  5. AbayErol

    AbayErol

    Joined:
    Sep 14, 2020
    Posts:
    3
    Hi and sry for late response i had some troubles :)
    Ok i tried
    https://github.com/Siccity/GLTFUtility
    https://github.com/atteneder/glTFast

    With those librarys i could sucessfully instantiate from the Cloudstorage
    but some Models couldn´t be imported/converted.

    My Applikation should run on IOS and Android.

    The GLTFUtility library works fine in the editor but on my Phone the crash due to memory Problem. It seems the app want to allocate to much memory in the Heap but i am not sure.

    The GLTFast Library had the same Problem but the app didn´t crash.

    Do you have experience using gltf importer for mobile devices?

    Currently I take a closer look at the File itself maybe the gltf exporter did a bad job :/

    The Problem with asset Bundles is that i need to run a server that converts incomming uploads to usable asset Bundles but maybe this is the only solution I don´t know.
     
  6. afurioso

    afurioso

    Joined:
    Jan 12, 2022
    Posts:
    88

    Hi, did you solve it? I have the same problem. I want to download the file and use it in AR as an object.
     
  7. tomicz

    tomicz

    Joined:
    Mar 16, 2015
    Posts:
    152
    It's very easy to do this using asset bundles.

    I have an old example where I did exactly that, you can see how I did it. https://github.com/tomicz/project-bundle-download-ar

    Also I am craeting a framework that helps AR developers to do multiple things, you can watch/star/follow my project https://github.com/tomicz/unity-tomicz-ar-framework It's still in early development (not recommended for production), so you will have to wait, but I will add it ASAP.
     
    Last edited: Aug 29, 2022
  8. afurioso

    afurioso

    Joined:
    Jan 12, 2022
    Posts:
    88
    Yes, but I mean that I want to download objects from the cloud without touching unity. Eg. if I add a gameobject in the cloud I want that unity read it automatically.
     
  9. tomicz

    tomicz

    Joined:
    Mar 16, 2015
    Posts:
    152
    Then do what @ibrahimpenekli told you above. I never did it myself but I know developers who used that format to accomplish exactly what you are looking for.