Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by brazmogu · Nov 04, 2017 at 12:45 PM · editorcrashscriptableobjectcustomeditor

Crash when reimporting custom assets

So, I'm getting this problem when trying to refresh my custom assets in order to update their preview images(supposedly, I have managed to make them use a sprite as a thumbnail, instead of just that bland Unity icon). But then I get this:

 Updating Assets/Data/Zodiac/Aries.asset - GUID: 459b678aa6ed74dd295a351c1c9b3c6d...
  done. [Time: 95,047000 ms] 
 Assertion failed on expression: 'm_InstanceID != InstanceID_None'
  
 (Filename: /home/builduser/buildslave/unity/build/Runtime/BaseClasses/BaseObject.h Line: 391)
 
 Assertion failed on expression: 'Object::ms_IDToPointer->find(object->GetInstanceID()) != Object::ms_IDToPointer->end()'
  
 (Filename: /home/builduser/buildslave/unity/build/Runtime/BaseClasses/BaseObject.cpp Line: 376)
 
 Assertion failed on expression: 'm_InstanceID != InstanceID_None'
  
 (Filename: /home/builduser/buildslave/unity/build/Runtime/BaseClasses/BaseObject.h Line: 391)
 
 Assertion failed on expression: 'm_InstanceID != InstanceID_None'
  
 (Filename: /home/builduser/buildslave/unity/build/Runtime/BaseClasses/BaseObject.h Line: 391)
 
 Receiving unhandled NULL exception
 #0  0x007fffef0545c0 in funlockfile
 #1  0x007fffef054b78 in remove_free_block
 #2  0x007fffef054b80 in block_remove
 #3  0x007fffef054ba8 in block_merge_next
 #4  0x007fffef054bc0 in tlsf_free
 #5  0x007fffef054be0 in DynamicHeapAllocator<LowLevelAllocator>::TryDeallocate(void*)
 #6  0x007fffef054c20 in DualThreadAllocator<DynamicHeapAllocator<LowLevelAllocator> >::TryDeallocate(void*)
 #7  0x007fffef054c40 in MemoryManager::Deallocate(void*, MemLabelId const&)
 #8  0x007fffef054cd0 in dynamic_array<TextRenderingPrivate::FontImpl::CharacterInfo, 4ul>::deallocate()
 #9  0x007fffef054cf0 in dynamic_array<TextRenderingPrivate::FontImpl::CharacterInfo, 4ul>::clear()
 #10 0x007fffef054d00 in TextRenderingPrivate::FontImpl::ResetCachedTexture()
 #11 0x007fffef054e00 in TextRenderingPrivate::FontImpl::AwakeFromLoadImpl(AwakeFromLoadMode)
 #12 0x007fffef054ea0 in AssetInterface::StopAssetEditing(CancelBehaviour, AssetDatabase::UpdateAssetOptions)
 #13 0x007fffef055010 in AssetInterface::ImportAssets(std::set<UnityGUID, std::less<UnityGUID>, std::allocator<UnityGUID> > const&, AssetDatabase::UpdateAssetOptions)
 #14 0x007fffef055080 in AssetsMenu::Execute(MenuItem const&)
 #15 0x007fffef055250 in MenuController::ExecuteMenuItem(MenuItem&, MenuController::ExecutionCause)
 #16 0x007fffef0552e0 in OnActivated(MenuItem*)
 #17 0x007fffef055340 in g_closure_invoke
 #18 0x007fffef0553b0 in g_signal_handler_disconnect
 #19 0x007fffef055500 in g_signal_emit_valist
 #20 0x007fffef0556b0 in g_signal_emit
 #21 0x007fffef055790 in gtk_widget_activate
 #22 0x007fffef0557b0 in gtk_menu_shell_activate_item
 #23 0x007fffef0557e0 in gtk_menu_shell_activate_item
 #24 0x007fffef055860 in gtk_marshal_VOID__UINT_STRING
 #25 0x007fffef055890 in g_closure_invoke
 #26 0x007fffef055900 in g_signal_handler_disconnect
 #27 0x007fffef055a50 in g_signal_emit_valist
 #28 0x007fffef055c10 in g_signal_emit
 #29 0x007fffef055cf0 in gtk_widget_translate_coordinates
 #30 0x007fffef055d30 in gtk_propagate_event
 #31 0x007fffef055d60 in gtk_main_do_event
 #32 0x007fffef055db0 in gdk_event_get_graphics_expose
 #33 0x007fffef055dc0 in g_main_context_dispatch
 #34 0x007fffef055e50 in g_main_context_dispatch
 #35 0x007fffef055eb0 in g_main_loop_run
 #36 0x007fffef055ee0 in gtk_main
 #37 0x007fffef055f60 in main
 #38 0x007fffef056390 in __libc_start_main
 #39 0x007fffef056450 in _start
 Launching bug reporter
 /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UsbDevices.cpp:UsbDevicesQuery
 /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
 /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
 /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
 /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent
 /home/builduser/buildslave/unity/build/Editor/Platform/Linux/UndoPlatformDependent.cpp:SetUndoMenuNamePlatformDependent

I'm lost, trying to add some null checks here and there to see if I can catch this null pointer exception... so far, to no avail. Any clue?


UPDATE: I got somewhere, but still lost. But, at least, Unity isn't crashing now.

This is the code I'm using to set custom thumbnails on my assets. Basically I'm picking a Sprite member of this asset and using it as the image:

 [CustomEditor(typeof(ZodiacFaction))]
 [CanEditMultipleObjects]
 public class ZodiacFactionEditor: Editor {
     public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height) {
         ZodiacFaction zTarget = (ZodiacFaction) target;
         Sprite zodiacSprite = zTarget.GetEmblem();
         return zodiacSprite.texture;
     }
 }

But, when debugging, I see that, for some reason the texture member of the sprite is coming up null. Not the sprite itself, the texture. So this is what's causing the Assertion failure, apparently. I'm still on the dark as to why these sprites are turning out null, but... it's more clear now, at least.

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

0 Replies

· Add your reply
  • Sort: 

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

149 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 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 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 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 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

Unity Editor crashes when pressing play (2017.2.0f3 64bit) 2 Answers

Editor crashes when opening project (fresh install) 1 Answer

Editor Script Causes Crash. 0 Answers

Why does UnityAds crash my game after I close the ad? 0 Answers

Making Node editor but having problem with passing through non static data to static method 0 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