Search Unity

SimpleOBJ - Runtime importer for OBJ models

Discussion in 'Assets and Asset Store' started by Orbcreation, Nov 25, 2014.

  1. the_greenlig

    the_greenlig

    Joined:
    Feb 5, 2013
    Posts:
    29
    Have a look through the loading functions, there's one with "Async". That should load it without the stutter.
     
  2. Gaurav_Setia

    Gaurav_Setia

    Joined:
    Apr 9, 2017
    Posts:
    4
    I cannot find any download method in the plugin using async. Can you please help me out of this.
    In unity there is a method Resources.loadAsync which is for loading the asset from project resources. but here we are importing the obj model on runtime
     
  3. the_greenlig

    the_greenlig

    Joined:
    Feb 5, 2013
    Posts:
    29
    Apologies, it wasn't async. In ObjImporter.cs, look for
    public static IEnumerator ImportInBackground(...)
    . It's a coroutine. Hope that helps!
     
  4. nwxp

    nwxp

    Joined:
    Apr 4, 2017
    Posts:
    19
    Hello, asset doesn't seems to be working with Unity 2018.3.8f1

    I open demo scene, click "Download and import" and there's nothing showing up.

    It was working with previous version I think.
     
  5. Kaimen001

    Kaimen001

    Joined:
    Aug 25, 2014
    Posts:
    14
    Hello, Simple OBJ has worked very well in my projects so far. For a new project with Unity 2018.3.6.f1 I have been forced to use .NET4x. I use add-ons where it's necessary. The problem is that Simple OBJ does not work well. I have scale errors, the texture mapping does not work well, etc. The SimpleObjDemo does not work, it gives multiple errors and does not import the apple object.
    Thanks
     
  6. cfloutier

    cfloutier

    Joined:
    Jul 30, 2009
    Posts:
    35
    I've got the same error. the apple just does not work. !!!! I've tried many versions of Unity (from 2017.3 to 2019) without success.
    What a shame
     
  7. cfloutier

    cfloutier

    Joined:
    Jul 30, 2009
    Posts:
    35
    It works with 3.5 version of .net. But the current version of .net used in unity is not that. ! I can not use it in my projects
     
  8. fxmediamark

    fxmediamark

    Joined:
    Oct 19, 2013
    Posts:
    5
    Is this asset work with Hololens and unity 2019.1? And how is the performance? I'll need to load object around 100 - 200 MB at runtime on Hololens
     
  9. Icelab

    Icelab

    Joined:
    Nov 28, 2018
    Posts:
    1
    Is there any way to identify each Imported Gameobject
     
  10. unity_v9OoQTR429Ri3Q

    unity_v9OoQTR429Ri3Q

    Joined:
    Apr 24, 2020
    Posts:
    1
    Hello
    I am using "Simple .obj" to import Obj into a project in HoloLens.
    Don't know how to give HoloLens the file path?

    The following is my code, but it does not work properly. :(

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class ioobj : MonoBehaviour
    7. {
    8.     public static string HoloUrl;
    9.     public string url;
    10.     public bool press = true;
    11.     public GameObject importedObject;
    12.  
    13.     // Start is called before the first frame update
    14.     void Start()
    15.     {
    16.         HoloUrl = Application.persistentDataPath + "/" + "TonyFace.txt";
    17.         url =HoloUrl;
    18.  
    19.         StartCoroutine(DownloadAndImport());
    20.         press = false;
    21.     }
    22.     private IEnumerator DownloadAndImport()
    23.     {
    24.         WWW www = new WWW(url);
    25.         yield return www;
    26.         importedObject = ObjImporter.Import(www.text);
    27.     }
    28.         // Update is called once per frame
    29.  
    30.         void Update()
    31.     {
    32.        
    33.     }
    34.  
    35. }
    36.  
     
  11. programming146flo

    programming146flo

    Joined:
    Aug 24, 2020
    Posts:
    2
    As mentioned in the documentation https://docs.unity3d.com/ScriptReference/WWW.html
    you have to specify the file protocol
    HoloUrl = "file:///" + Application.persistentDataPath + "/TonyFace.txt";

    I used
    Code (CSharp):
    1. HoloUrl = Application.persistentDataPath + "/TonyFace.txt";
    2. ObjImporter.Import(File.ReadAllText(HoloUrl);
     
    Last edited: Sep 17, 2020
  12. programming146flo

    programming146flo

    Joined:
    Aug 24, 2020
    Posts:
    2
    The imported GameObject is a billion times too big. The apple in the demo app is also too big.
    Scaling down in unity with 1e-09 has issues with rendering the material. The form of the object is correct but it's black. With a scale of 1e-03 the material is correct but as mentioned it's way too big. Caused by the same problems with the demo I think it's a bug in the importer. Please fix that.

    Is it possible to resize the object without the material issues?
     
  13. Lordmin

    Lordmin

    Joined:
    Mar 9, 2017
    Posts:
    62
    Hello, I have a question.

    1. The GameObject was merged into parts 0~10. Can't it be loaded as it is?

    The original is divided into hundreds of GameObjects.

    This is a situation where you should not change both the structure and the name.