Author Topic: HELP: Orphaned UIDrawCalls (and premature baldness)  (Read 10585 times)

Wahooney

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
HELP: Orphaned UIDrawCalls (and premature baldness)
« on: June 05, 2012, 07:24:53 AM »
Since updating to 2.07, I'm having a problem where I am getting randomly orphaned UIDrawCalls in the Editor. Thus far the easiest method of dealing with them is restarting Unity, which is an absolute pain in the ass, as there are occasions when the li'l bastards just reappear on restart.

I know that you can select the object in the scene and do the whole Selection -> Force Delete but that is even more of a PITA since selecting the poor little orphans is like fist-bumping a ghost in a haystack (you can see the ghost (after enough digging)... you can even reach him... but alas, no bump... unless you use a ghost trap (how far CAN you stretch a metaphor before it breaks :P), ie. box select and deselect everything else you can actually click on).

HELP!

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #1 on: June 05, 2012, 01:42:50 PM »
Considering that draw calls are invisible, I'm curious how you see them to begin with. Second, I don't see a reason why they would stick around. What are you doing that's out of ordinary?

kersk

  • Guest
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #2 on: June 05, 2012, 03:42:55 PM »
I've just started using the library and I ran into this same problem within 15 minutes. I came here to see if there was any more info about it. :)

I'll try to brew it down to repro steps if I run into it again. For right now I'll do the workaround of the selection->force delete since I just needed to fix my scene ASAP. All I can say right now is that I was probably abusing the atlas and font tools while trying to learn the proper work flow of adding sprites/fonts to an existing atlas. My guess is it is a combination of using HideFlags.HideAndDontSave and some null exceptions that I was running into with the editor tools. The null exceptions might have prevented the normal cleanup process of these invisible game objects from finishing while exiting play mode, leaving them orphaned... and since they are invisible in the scene hierarchy, there is no easy way to clean this up.

My initial impressions of NGUI are very positive, but there are a few rough edges so far like this issue, and some initial quirks in the code that I've run into, such as non-intuitive inheritance hierarchies like UIButton inheriting from UIButtonColor, the usage of HideFlags which I strongly feel should be avoided, and some minor pollution of the editor workspace (the inventory system and NGUI/Scripts/UI/UITooltip.cs -> should be relocated into NGUI sub-menus, etc).

Alright, back to work -- I'll try to give some useful feedback in the next few months. :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #3 on: June 05, 2012, 11:23:14 PM »
The inventory system is one of the examples, and you can delete it (and you generally shouldn't import examples into a work project anyhow).

Null exceptions in the editor may indeed cause orphaned draw call objects, but how did you run into them? If I can reproduce how they happened, I can fix them.

Generally I've only seen issues if you run the game, pause it, then modify some code file and tab back to Unity. It doesn't like that -- but that's a problem with Unity.

kersk

  • Guest
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #4 on: June 06, 2012, 12:23:49 AM »
Ok, good to know that the inventory system, etc can be cleanly yanked out for right now!

As for running into this, I was just learning the atlas/font maker tools and trying to get up to speed on the proper work flow. I was blindly doing a bunch of odd actions like trying to duplicate an atlas and its resources to make a quick backup of it, then manually fixing up the references to the duplicate resources, trying to merge an existing atlas and sprites into a new larger atlas with existing sprites, pulling in generated font data, etc. There was probably a few automatic unity code reloads from external code modifications while the game was running, too. You're right, that's probably what triggered the exceptions since that always seems to cause issues in any project. I'll definitely post repro steps if I can nail it down to an exact process.

Thanks!

Wahooney

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #5 on: June 07, 2012, 02:08:32 AM »
Hi,

I've made a minor change to UILabel that will allow you to set the distance of the shadow and outline, otherwise the code is vanilla. AFAIK I'm not doing anything funky, the object that holds the panel is actually deactivated when it suddenly pops up and at this point in the execution the panel has never been made visible. So it's a complete mystery.

I've only experienced this problem since updating to 2.07c, and unfortunately I can't send you any examples or even screenshots as we're under a tight NDA with our client.

Can you think of any eventuality for these UIDrawCalls to show up?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #6 on: June 07, 2012, 11:56:46 AM »
Off the top of my head, nothing. Errors in the editor may cause it, but even so I don't see why it would ever become visible without you explicitly changing the panel's Debug Info to Geometry.

Wahooney

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #7 on: June 08, 2012, 01:20:14 AM »
Aaah, progress! And red faced-ness  :-[

I tested a piece of code that I forgot to remove in NGUITools::DestroyImmediate(), I kept getting errors about NGUI using GameObject::DestroyImmediate at the wrong time, so I changed the conditional to: if (Application.isEditor && !Application.isPlaying), which seemed to be a bit too broad :P

Your mentioning the Geometry Debug Info got me scouring the code (since I never set Debug Info to Geometry) and I found that little nugget ;)

Sorry for the confusion and thanks for the help!

EDIT: Hmmm, it appears that the above just made the issue occur more often... Exploring!
« Last Edit: June 08, 2012, 01:54:52 AM by Wahooney »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #8 on: June 08, 2012, 02:21:14 AM »
When in doubt, revert to what NGUI has. :)

pcutile

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 81
    • View Profile
Re: HELP: Orphaned UIDrawCalls (and premature baldness)
« Reply #9 on: August 11, 2013, 09:15:11 PM »
 For right now I'll do the workaround of the selection->force delete since  ?????????????????????????????????
what means??? how i can made it on my
Orphaned UIDrawCall detected!

The name of orphaned is _UIDrawCall [Scifi Atlas]; but active is disabled.

I nedd a solution i nedd isntruction to make the famous...Use [Selection -> Force Delete] to get rid of it.

i can't find this i can select it but nothing delete. delete don't work!!!