Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Asset import anomaly (with workaround) upgrading project from 5.5.x

Discussion in '5.6 Beta' started by syscrusher, Mar 27, 2017.

  1. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I had tried the 5.6 beta a couple of months ago (with a copy of my project) but had to drop it when I found that some of my critical purchased tools weren't yet 5.6-ready. Yesterday I revisited 5.6, and my project now imports and runs nicely thanks to updates from asset providers. :)

    During the import of my project (again, a copy for testing!) from 5.5.2f1, I found an interesting anomaly. I will not call it a "bug", but just something that perhaps should be documented. I also have an easy workaround.

    Many of my mesh assets were imported from Blender, and to aid that process I have a custom C# script that takes care of the axis reorientation (Blender thinks Z is up, and unity thinks Y is up). My script handles the situation of nested parent/child objects from Blender better than Blender's own FBX export does.

    When I imported, there were no console errors, but all my Blender imports were disoriented because the axes reverted during Unity 5.6 import.

    Remembering my custom script, I initially theorized that perhaps the AssetPostprocessor.OnPostprocessModel() API had been renamed or deprecated, and my script was no longer being invoked. But I checked, and this was not the situation.

    Next, I decided to try manually reimporting one of my Blender models from the Project view, to see if there was a useful error in the console. When I did this, the asset reimported with correct orientation, demonstrating that my script still works fine. Rinse and repeat for my other FBX models, and all is well.

    Hypothesis: I think that during the upgrade, Unity may have imported my FBX assets before it compiled my C# post processing script. This would explain why the problem is corrected by reimporting.

    I really don't think this is a Unity bug, but I wanted to post the behavior in case someone else encounters this situation. If the Unity team thinks my hypothesis for why it happened is reasonable, perhaps you could add a comment in the upgrade instructions to warn developers that they may need to manually reimport some assets if custom post-processing scripts were in use.
     
    LeonhardP likes this.
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,127
    Hi syscrusher,
    It's hard to tell what exactly is going on from your description alone. Could you please file a bug report with a minimal reproduction case and reply in here with the case #?