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 marco.siino · Dec 09, 2014 at 04:51 PM · blenderfbxexportexportingcollada

Exporting from Blender all the objects into multiple files for Unity

Hi, i've modeled all my objects into a Blender scene, now i want to export them (preferably fbx format) all in batch but i want each one to be a single file (fbx file for example, with the name of the object as filename).

If i use the blender fbx exporter, all the objects are exported into a single fbx and are imported into blender as an object which contains multiple subobjects. And i don't like this.

Is there a way, or an already made script (where?) that i can use to do that ? If not possible with fbx format also other formats supported by Unity are ok.

Also i've another question: i'm wonder which is the best way to export all the objects inside a blender scene, with each one having 0,0,0 location. What i mean is that if i've them in blender positioned at different location for each object, this location is kept, stored and exported in the fbx file (then imported into blender). Instead i want all objects to be positioned by default at 0,0,0. I know i can do "Reset location" in blender, but it's a time wasting to do that on each object before exporting it, and the restoring back to the original position after exporting it.

What is the best workflow to export all the objects into separate files, and each one having 0,0,0 location ?

Thanks!

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by pjezek · Sep 07, 2015 at 03:46 AM

I wish I had found this question earlier. Just wrote a plugin for blender which does batch export among other things.

https://github.com/pjezek/blender/blob/master/unity_tools/__init__.py

You can choose the destination folder where to store the exported fbx files.

Have fun

Comment
Add comment · Show 1 · 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 Trollypolly · Sep 22, 2016 at 11:38 PM 0
Share

I am 100% new to Blender and I cannot figure out how to get your plugin to work. If you had to talk to someone who is using Blender for the first time where do I put this plugin of yours to get it to work? Also is there anything in that code I need to edit myself or it works as is?

avatar image
0

Answer by tanoshimi · Dec 09, 2014 at 05:04 PM

This really sounds like a Blender question rather than a Unity question.

I'm not a Blender expert, but I do know that it's relatively trivial to script Blender via its Python API interface.

Untested and probably wrong, but what you want is something like this:

 import bpy
 
 # access the scene
 scene = bpy.context.scene
 
 # start with empty selection
 bpy.ops.object.select_all(action='DESELECT')    
 
 # loop through all objects in the scene
 for ob in scene.objects:
 
     # select this object
     scene.objects.active = ob
     ob.select = True
 
     # if this object is a mesh
     if ob.type == 'MESH':
 
         # export to FBX
         bpy.ops.export_scene.fbx(filepath=ob.name + '.fbx'), use_selection=True)
 
     # deselect this object again
     ob.select = False


Comment
Add comment · 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

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

one side of the house doesn't appear 1 Answer

poser or daz3d to unity 1 Answer

Importing from Blender to Unity - Model looks different? 1 Answer

Blender: Exporting not only the linked animation clips 1 Answer

Blender 2.78 Bendy bones Animation 1 Answer


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