Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

FBX Import - make default scaling to 0.01 an option

Discussion in 'Wish List' started by ChezDoodles, Oct 17, 2010.

  1. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    When importing FBX files, the scaling is set to 0.01 by default. When importing FBX files, we have to go over everything to reset scale to 1.0. Please make default scaling when importing FBX files a Unity Preference choice.
     
    andreasng_playdead likes this.
  2. jeffro11

    jeffro11

    Joined:
    Jan 7, 2010
    Posts:
    185
    Just adjust your scaling inside your 3d modelling application. If you match the scale, the default import settings work perfectly fine.
     
  3. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Last edited: Oct 17, 2010
  4. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    @jeffro and Jessy

    Thanks for your replies - but my point is that it is stupid that a 3d importer function should *by default* rescale an object when importing!

    What if the importer by default moved it 100 units along z ... that could also be fixed with a script or by moving the object 100 units in the opposite direction in the 3D software before exporting it ... but why... and why make it the default behavior? At least make this behavior optional...

    It is just a minor thing ... but it in an otherwise super-smooth pipeline, why not remove the few bumps that is still present. At some point in every project I do, I have to go through this procedure many hundred times - so why not just remove the bump instead of everybody building ramps to cross the bumps!
     
  5. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    It's not a Unity issue. Like I said, I've never had this problem (I use Blender, but didn't see it when I used Maya or modo). It's the fault of your 3D software's creators, or your own fault for not learning about the FBX export settings.
     
  6. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    @Jesse

    I guess the reason for why it is like this, is that the Maya FBX exporter scale objects by 100.0 when exporting. So when importing FBX files exported by Maya, Unity scales the objects back to normal size by adding this scale operation.

    HOWEVER ... this is NOT part of the FBX spec ... it is just a convenience when using the Maya => Unity pipeline to fix something that could be described a bug in the Maya FBX exporter. So ... when you use another 3D modeller - like 3D Studio Max - which is capable to export FBX files without scaling them by 100.0x - this "smart fix" gets very annoying.

    So ... in fact ... this is a Unity fix for people who DO NOT LEARN the FBX exporter settings (yes, it is possible to change default behavior in the Maya FBX exporter)

    :)

    Btw ... everybody should really check out the PolyTrans and NuGraf3D tools from Okino. These tools remove all the headaches with FBX. (Except that Unity don't count on people using good FBX exporters).
     
    Nanako likes this.
  7. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    No thanks! :)
     

    Attached Files:

  8. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    @Jesse:

    $395 - that's just the base package ... you also need the $245 add-on for Maya/3dsMax :)

    But if you do games for a living ... and you already pay $2000-$3000 for a modeling package like Maya or 3dsMax ... those $640 is a bargain because all sorts of import/export just magically works between all kinds of tools and packages ... :)
     
  9. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    The price wasn't my issue. ;)
     
  10. jeffro11

    jeffro11

    Joined:
    Jan 7, 2010
    Posts:
    185
    Yes it still seems the game development world revolves around PC's... It will probably continue to do so for quite some time.
     
  11. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    At least until 2008, anyway. I can't wait! :D
     
  12. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    it will always revolve around pcs because hell will freeze before you program 20M++ budget titles right on your xbox, ps3, iphone or wii :p (especially on nintendos console as nintendo proofs with the 3DS to have totally lost the view on reality with a laughable 4MB VRAM, the 3DS will be their last generation if they don't wake up, cause apple and sony with their minis will crush them otherwise)
     
  13. jeffro11

    jeffro11

    Joined:
    Jan 7, 2010
    Posts:
    185
    Maybe I should have noted AAA games ;)

    And yes.. Nintendo seems to really have lost it.
     
  14. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,262
    I disagree with this - having a 0.01 default scale was always an oddity in Unity and should be in the preferences.
    If Unity is based on metres (which it kind of is) and your 3d artwork is using metres, then it should sync up.

    Edit: though I did not know about that maya oddity!
     
    Last edited: Oct 18, 2010
  15. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    There is no "disagree" here. I know many people have had problems with this, but I'm not one of them. I could make you a video of me importing assets, but I don't think that's necessary. I don't explicitly set the scale for any Model Importer, and yet, each one uses the identity scale.
     
  16. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,262
    ok so you have not had any issues and it may be possible to set any 3D software up to export at the right scale - I guess you are saying.
    In that instance the 0.01 is less an issue, though 1.0 would be a more conventional default!
     
  17. Ntero

    Ntero

    Joined:
    Apr 29, 2010
    Posts:
    1,436
    In the mean time, you can place a script like this in the Editor folder and it will automatically assign any scale or import preferences you want.

    It should still be fixed for people entering into Unity and to solve problems before they have to search for the solution.

    Any settings in any of the asset importers can be defaulted to specific settings, and you can even use special characters in the filename to catch for certain import settings.

    Code (csharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3. using System;
    4.  
    5. //Sets our settings for all new Models and Textures upon first import
    6. public class CustomImportSettings : AssetPostprocessor
    7. {
    8.     public const float importScale= 1.0f;
    9.    
    10.     void OnPreprocessModel()
    11.     {
    12.         ModelImporter importer = assetImporter as ModelImporter;
    13.  
    14.         importer.globalScale  = importScale;
    15.         importer.generateMaterials = ModelImporterGenerateMaterials.None;
    16.  
    17.     }
    18. }
    19.  
     
    Nanako likes this.
  18. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Good idea, NTero! So good, in fact, that I will now go back in time and offer this solution 15 posts ago! :D
     
  19. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    The solution is working perfectly for me - great help - thanks!
    ... and this got me started on doing more automated processing ... Unity is awesome ... and so are you guys :)

    However, I still think this should be "fixed" in a future update - with an option to scale or not by default - because the workaround (downscaling by 0.01) is really a hack to make the default operation of FBX export in Maya work smoothly...
     
  20. Ntero

    Ntero

    Joined:
    Apr 29, 2010
    Posts:
    1,436
    Psh, who clicks on all those pesky links nowadays? :S

    As far as a suggestion on how it should work, I think that each AssetImporter should have a panel that specifies it's default settings, that looks identical to the current asset panel in the Inspector.

    Something like Project settings with a handful of tabs (like Project has for platforms) with different import options.
     
  21. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    Last edited: Nov 24, 2010
  22. chai

    chai

    Joined:
    Jun 3, 2009
    Posts:
    84
    any news on this ?? I need a script that sets fbx scale back to 1.0 (instead of 0.01) as well, cheers
     
  23. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    Check Jesse's 1st post in this thread, it links to the relevant asset postprocessor script.
     
  24. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    not really.

    See, there's something called physics, which require physically accurate dimensions. In 3dsmax we can work with real dimensions, specify 1.0 meters = 1 unit, and then import into unity, and at 1:1 ratio you're good to go. 0.01 is obviously unity scaling it differently for the sake of sanity, its not a thing thats helpful to pro modellers.
     
  25. nikko

    nikko

    Joined:
    Mar 20, 2009
    Posts:
    436
    Do not deal with Okino ever. I purchased their product with plugins in 2009. I lost the files (they deliver the plugins one by one individually) and they asked me to buy again! AWFULL experience to say the last. The owner is incredible arrogant and would not give me anything without asking me paying the product a second time. I gave up and was screwed.

     
  26. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    Sorry to hear that nikko.

    My experience is the opposite... I was using the Okino products in the mid-90's. When I bought a new license for a new company some 12-13 years later, Robert Lansdale (the owner) had recognized my name, pulled out my old records and sent me a long personal email thanking me for still using his products. He even (sort-of) custom built an exporter on my request, and sends me updates every 6 months per email without me having to bug him about it. I know no other companies that has given such personal and friendly service.
    ...so I am sorry to hear about your encounter. I am sure it must be some sort of misunderstanding :(
    All I can say is that the Okino exporters are far better than anything else available for 3ds max.

    Regards,
    Sven


     
  27. lansd

    lansd

    Joined:
    Jun 21, 2009
    Posts:
    5
    As my response below will clearly outline, even though I would consider Nikko an equally excellent Okino user, he has chosen to post a slanderous series of comments that are totally unwarranted. The bottom line of my response is: Nikko never purchased the software I told him to buy on June 18 2009 - he simply does not own our DCC/Pack license that has been the standard animation license since 1997 - that license pays for a small portion of my animation developer salaries. This is not something new to Nikko and it ONLY applies to him, and no single Okino user to date.

    The following is my defacto method to dealing with every new and existing Okino customer, from the early 90's to today, and how it applied to Nikko's 2009 purchase:

    - A customer approaches Okino and chats with me about what they wish to do. Nikko and I had a very good series of email chats on and about June 18th 2009. We got to know each other, from which I came to respect his 3D experience + his need for proper conversion software. As I do for anyone and everyone, I did a test conversion for Nikko from DirectX to FBX since he was very suspicious of me, my initial comments to him and whether I was ligit (please refer to his postings elsewhere from 2009).

    - He made a purchase on June 18 2009. However, he decided to only purchase the base package, not PolyTrans + DCC/Pack, through my sales lady. It is not out of the ordinary for new customers to buy more modules, or fewer modules, even though I recommend I certain configuration. Okino customers of 2009 will know that they are given a pro-forma invoice stating what software is being purchased, and are told to check it over before signing and sending back (Nikko was super critical of my sales method, but it was to his benefit). I came up with that system to preclude any misunderstandings with what is being purchased and at what cost.

    - On Aug 23 2009 he was reminded by me that he didn't own the DCC/Pack module to enable FBX, and hence why it was grayed out.

    - During 2009, 2010 and 2011, I have treated Nikko with respect and equality, as I do openly with all Okino customers, and provided him with the newest Rhino modules and SketchUp modules which we've been working on. I provided him with the newest SketchUp modules, as well as all Okino SketchUp-registered users, last Friday.

    - Last week he asked the same question as he did on Aug 23 2009, why FBX wasn't enabled. I reminded him that he never purchased the DCC/Pack module.

    - Nikko's comment above states that he needs to purchase a product again. This is quite disconcerting to read because it doesn't relate to anything I told him. No Okino customer ever has to "purchase a product again" because he never purchased it in the first place. Nikko continues to believe he purchased the DCC/Pack on June 18th, which he did not. Nothing could be simpler to understand in this long winded response.

    So, without any prejudice to Nikko, no Okino customer can use software which they never purchased. Prior to purchase, on June 18 2009 I did explicitly state to Nikko that he needed to purchase PolyTrans + DCC/pack, as I always explain to any and all Okino customers who I chat with prior to a sale. I am not stepping outside any boundary of my normal and strict Okino sales policies, which are to the benefit of our new customers to purchase the correct software. I explicitly go out of my way to pre-screen new customers, even if they place a blind order on the Okino WEB site for just the base package.

    This had all been explained to Nikko last week, but he refused to believe or listen to any of my comments, and still wished to believe he owned the DCC/Pack module. Rather, he returned to the Unity forum to shoot down my product and company, which is unwarranted. I will not have anyone put down the clean and ethical company I have run for the last 25 years. I have a lot of Okino/Unity users and they are excellent people to deal with. I consider Nikko an excellent user as well, but I do wish him to accept that he never purchased the product I told him to purchase from the get-go.

    --------------

    And to maintain the integrity of my name, saying that I am "incredible arrogant" is like equating Mother Teresa to being the devil. As something that I'd love to end up on every search forum, I am a 30-year professional electrical engineer who abides by strict engineering code of ethics. I am one of the most open, helpful, genuinely friendly and overall main experts in the world of 3D graphics - and I state that only for the benefit of all the people who approach me each day for help with their problems, even if it is not related to our conversion software - you would have to search far and wide to find another person who openly helps and educates the 3D community out of personal interest. I am very fortunate to have a top-notch user base, and wish Nikko would come around to accepting that he didn't purchase the DCC/Pack so that I don't have to single him out as my one and only worst-nightmare user. Nikko has been very critical of me and Okino since his first posting on the Unity forum, but I've taken that all in my stride, and have responded to his each of his comments professionally and properly.
     
    Caio-Branco likes this.
  28. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
  29. trthing

    trthing

    Joined:
    Apr 27, 2009
    Posts:
    18
    Assuming this is Robert Lansdale, I can confirm as an old customer that not only his company's software products are rock solid and very much worth the price tag but, above all, his attitude toward his user base is - to me - unparalleled in this industry (and I've been around for 15 years).

    I've lost count of the times his mind-boggling sleep cycle saved my skin by personally responding to after hours requests in record times, with his ever-present affability.

    It deeply saddens me that his company, his product and his name have been framed in such bad terms.

    I am not affiliated to Okino, but I'm proud that my personal testimony and my company's name are listed on Okino's website: they really deserve all the praise they get.
     
  30. ehaase

    ehaase

    Joined:
    Nov 6, 2010
    Posts:
    1
    I second the opinion that the "convenience" 0.01 import scaling is a bug rather than a feature.
    Professionals know how to configure Maya's FBX output settings; and Unity is not supposed to favour one 3d modelling package over another anyway IMHO.
    Yes, fine, let it be the (weird) default behaviour for the people who got used to it -- but PLEASE give us the preference to choose the default import scaling.
     
  31. vortex69

    vortex69

    Joined:
    Feb 4, 2010
    Posts:
    92
    True, I have yet to come across any problem with object scale that could be blamed on the 3D package (on the user, lots, on the 3D package, none), when the Unity importer scale is set to 1 everything is fine, a 1x1x1 cube in the 3D modelling package is a 1x1x1 cube in Unity.



    BTW, thanks for the auto scale script to whoever first posted it (Jessy I guess?), I "love" every time I forget the importer defaults to 0.01, drag an imported model into the Unity scene and then wonder why the FBX exporter on Blender suddenly stopped working because I can't see the model.
     
  32. tapiocaflash

    tapiocaflash

    Joined:
    Jun 19, 2012
    Posts:
    9

    Yes. Another problem I've come across because of this 'feature' is when doing Beast lightmapping, everything was super quick and and the seemingly complex scene could all be baked in one or 2 lightmap, but only resulted in really low resolution final result - increasing the texel per world unit didn't seem to help until I found out the culprit was actually the mesh scale itself. And when I change the scale back to 1, the baking time significantly increases and multiple lightmaps need to be used.

    So really I hope Unity could fix this.
     
  33. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Very useful script!