Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ludokun · Sep 24, 2014 at 02:33 AM · sceneimportassets3d model

Script: import a 3d model to the scene from an outside folder

Hello everyone,

I'm still a beginner to unity3d and I have a question about how to import a 3d model from outside the assets folder.

For the need of my client, I have to read a xml file (stored outside the assets folder at a fixed path) in order to retrieve several information for each 3d model (position, rotation, scale and so on).

My client wants to store all fbx models outside the assets folder in order to change 3d models anytime he wants after exporting the project (plateform will be Windows).

As a result my project (scene, script, everything in the assets folder) will be pretty empty except some script in order to manage the xml file.

I've already succeeded to load a texture stored outside the assets foilder and set it to a model which was added to the scene manually.

My question is: knowing the fbx file path (eg: c:/models/target.fbx), can I import the fbx model and put it to my scene by script?

Every data will be stored oustide the assets folder, and so far when searching to the internet I find nothing for importing a 3d model to the scene by script. So far I only know how to add a prefabs into my scene when having a GameObject set (Instanciate(myGameObject);)

Could you please tell me if my client request is possible? (I'm willing to use C# script)

I really thank you in advance

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yaneisyvb · May 03, 2016 at 02:21 PM 0
Share

hello. $$anonymous$$e too i need import a 3d model (.fbx or obj) to the scene from an outside folder. So do you have any workaround ?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Louis Watson · Sep 24, 2014 at 03:21 AM

Look Here: Importing Mesh from script

Note a model is a collection of objects rather than being one item. you could render a whole scene in one .fbx if you wished. you could hook up each item to their corresponding renderers i.e. for meshes and materials.

For Unity Documentation this maybe of interest.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ludokun · Sep 24, 2014 at 03:43 AM 0
Share

Thank you very much for your reply.

I've looked at your url and I don't really understand how to proceed with the $$anonymous$$esh. Does the $$anonymous$$esh type contain my whole fbx model with its animation and so on? In your link, they don't put a fbx(or whatever model file type) file path to the Resources.Load() function.

Furthermore, look like the Resources type can only parse file in the Assets folder and I want to load a fbx from a folder outside the Assets folder.

I've made more research on the unity forum and find another post which is the same thing I want to achieve : http://forum.unity3d.com/threads/loading-fbx-model-from-a-webserver.128344/

As I don't understand a thing about model file format, I can't create a model parser (and find nothing on the autodesk website neither).

avatar image Louis Watson · Sep 24, 2014 at 08:38 AM 0
Share

look here

avatar image ludokun · Sep 25, 2014 at 01:29 AM 0
Share

thank you but the Strea$$anonymous$$gAssets is pointing the to Assets folder of my project and my fbx have to be everywhere but to the Assets folder. The fbx path will be set into a xml file which is also stored outside the Assets folder (xml file path is hard coded in the project).

avatar image sam_xia_vr ludokun · Apr 13, 2016 at 03:32 PM 0
Share

i meet the same question, so do you have any workaround ?

avatar image ludokun sam_xia_vr · Apr 14, 2016 at 12:23 AM 0
Share

the only workaround I found is to use assetbundle file (*.unity3d) ins$$anonymous$$d of fbx file. From Unity5, even with a free license we now can create assetbundle so the workaround consist to first convert the fbx into an asset bundle (create an empty sceen with only your fbx model in it) then export it as assetbundle. Once you have your assetbundle file, you can load your file from any path.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Switching scenes saves assets? 1 Answer

How can i make my imported 3d model collidable? 1 Answer

Is there a way to script the scene to pause itself or debug. 1 Answer

How do you import a character from Asset Store into your scene? 0 Answers

Cannot assign assets to variables via inspector: NullReferenceException 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges