Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

load object from onedrive

how do i load/import 3d objects from onedrive into my own app? just like holostudio. any sample or tutorial that i can refer to? thx

Answers

  • Options

    One of these may help:
    https://forums.hololens.com/discussion/6851/how-to-load-fbx-from-one-drive

    https://forums.hololens.com/discussion/7111/problem-with-import-from-one-drive

    What file type are you using? Fbx or OBJ or? There are many assets in the asset store to help load files into a unity project.

    Taqtile

  • Options

    @mark_grossnickle
    i'm currently importing obj using https://www.assetstore.unity3d.com/en/#!/content/49547
    able to import obj successfully in editor but not in hl. always crashes when i 'select' the obj file in onedrive window. i've checked that the filepath is the correct one.

    private void SetLoadFile(StorageFile theFile) 
    {
            if (theFile != null)
            {
                OBJLoader.LoadOBJFile(theFile.Path);
            }
    }
    

    any suggestions?

  • Options

    @felsiska I do not know off hand but if you run while connected to visual studio what errors do you get in the log files?

    Taqtile

  • Options

    @mark_grossnickle found out that it's due to the missing material shader. managed to import in without material now. any suggestions on how to use the TextureLoader script so that i can import materials too? or do i have to use fbx importers instead?
    thx

  • Options

    @felsiska I don't think so. I think we import OBJ files with the materials baked in.

    @pnolen Can you confirm? Or do have to load textures manually along with the OBJs?

    Taqtile

  • Options

    @mark_grossnickle seems like it can't get the correct texture mapping. it created a new material accordingly but only missing the albedo texture. but works fine in editor

  • Options

    Sorry, you are right. I am looking at @pnolen's code. He is loading the texture externally.

    Here is a snippet:

    `Texture2D texture = null;

                if (!string.IsNullOrEmpty(modelTextureName))
                {
                    WWW textureWWW = new WWW("file://" + Application.persistentDataPath + "/" + modelTextureName);
    
                    yield return textureWWW;
    
                    if (string.IsNullOrEmpty(textureWWW.error))
                    {
    
                        texture = textureWWW.texture;
    
                        if (texture) LoadedTextures.Add(texture);
                    }
                    else
                        Debug.LogWarning("Failed to load texture " + modelTextureName);
                }`
    

    You can then set the texture on your material using
    mat.SetTexture("_MainTex", texture);

    Assuming your material/shader has a MainTex property.

    Taqtile

  • Options

    @mark_grossnickle I'm loading the texture from another function too for now. thx lots

  • Options

    Hey @felsiska would you mind giving me some tips or share your code?

Sign In or Register to comment.