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
1
Question by christophfranke123 · Nov 05, 2014 at 03:47 PM · importscalefbx

Unity5 File Scale

I am trying to write a script, that corrects the scaling when exporting 3D-Meshes from Blender to Unity via FBX. This worked fine until now, when with unity5 the file scale option was introduced in the unity importer. The file scale cannot be set, instead it is determined automatically.

And here is the problem: The file scale for some objects is 0.01 and for others it is 1. After some playing around, I found different file scales for identical copies of the same fbx file!

Does anybody have an idea how to predict the file scale?

Comment
Add comment · Show 2
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 christophfranke123 · Nov 05, 2014 at 04:06 PM 0
Share

Turns out, it is a read only proprter of the $$anonymous$$odelImporter.

avatar image OllyNicholson ♦♦ · Nov 11, 2014 at 04:07 PM 1
Share

There has always been a scale option for imported models, but yes FBX files can come in as read only, does this mean it's no longer an issue for your script? Generally the number set depends on the units set in your 3D package - for example if you units are set to metres in 3DS $$anonymous$$ax then the objects come in at scale = 1 - if you use cm in $$anonymous$$aya they come in at 0.01 - I presume the same is the case with Blender so check the scale units used in preferences and the individual files. If this is still inconsistent you can file a bug.

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Ghisallo · Mar 27, 2015 at 05:15 PM

This is too late to help, I'm sure, but you might try something like this editor script:

 using UnityEditor;
  
 public class ImportSettings : AssetPostprocessor
 {
     public void OnPreprocessModel()
     {
         ModelImporter modelImporter = (ModelImporter) assetImporter;        
         modelImporter.globalScale = 1f/modelImporter.fileScale; // ensures the scale in the scene is equal to 1
         
     }
 }
 

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 christophfranke123 · Mar 27, 2015 at 05:26 PM 0
Share

Thanks for your help! The problem is not yet solved, since the project is currently frozen. This method has the downside though, that it is no longer possible for the level designer to manually set the scale of an object. Our current solution is to rescale all vertices on load to compensate for this, however this is also not perfect, because importing nested objects messes up their relative positions.

avatar image
1

Answer by Brozef · Aug 03, 2015 at 07:15 PM

This editor script was absolutely useless for me it didn't affect any imported file. Instead follow this link and change each files meta data using Notepad, this trick worked perfectly for me.

https://www.youtube.com/watch?v=MtSiKxDO2x0

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
avatar image
1

Answer by torbenmedt1231242354 · Dec 02, 2015 at 11:58 AM

If you export from Maya you can fix it using a couple of MEL commands.

These 2 did the trick for me.

FBXExportConvertUnitString m; FBXExportScaleFactor 100;

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

30 People are following this question.

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

Related Questions

FBX Scale Wobble/Shake problem 0 Answers

Child prefab Scale on inspector becoming( 1,1,1) while playing 2 Answers

Objects from Blender (FBX Exported) are scaled wrong. 4 Answers

FBX import scale factor issue 1 Answer

Maya fbx to unity scale problem 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