Hello Guest

Author Topic: Constantly "Rebuilding Index" - Probably VC related  (Read 22018 times)

Moran

  • Newbie
  • *
  • Posts: 9
    • View Profile
Constantly "Rebuilding Index" - Probably VC related
« on: March 24, 2013, 12:47:51 pm »
Hi!

I SVN "Checked out" a project which had a prefab with sprites in it.
Initially it worked well, but then I changed the prefab and undid the change, if I remember right (didn't pay attention).

The result being that for some objects in the prefab, whenever they are clicked or scrolled to, "Rebuilding Index" always appears several times, even if I click away and immediately back to the same object.

I tried Updating again but erasing the -tk2d file as instructed in some post, not helping.

Help?

EDIT: It also results in this error message, after almost every "rebuild": MissingReferenceException: The object of type 'tk2dIndex' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
tk2dEditorUtility.CreateIndex () (at Assets/TK2DROOT/tk2d/Editor/tk2dEditorUtility.cs:215)
« Last Edit: March 24, 2013, 12:53:13 pm by Moran »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #1 on: March 24, 2013, 08:30:34 pm »
Did you update to Unity 4.1 at around the same time?
If you did, you will at least need to be on version 1.91 + patch1. This fixes the "tk2dIndex" issue.

You do have .meta files turned on for svn, right?

Moran

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #2 on: March 25, 2013, 07:18:04 am »
I did update Unity. Since I bought td2k under another account, my package don't auto-update. I'll update and report, although I already rebuilt the entire object and that also worked.

We've been using SVN for a while, "meta files" is selected and we're using "force text".

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #3 on: March 25, 2013, 01:09:53 pm »
OK. Let me know how it goes and we'll take it from there.

netlander

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #4 on: April 16, 2013, 07:43:30 am »
Hi,
I am having the same problem as above. When I check out from svn (standard setup) I get index out of range and all animations are gone haywire. Is there a simple way of avoiding this?

Unity 4.0 ~ tk2d 1.9
Thanks
« Last Edit: April 16, 2013, 09:09:35 am by netlander »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #5 on: April 16, 2013, 11:41:49 am »
Meta files are on, right?

Also, what happens if immediately after you get latest from svn, you restart Unity, and then rebuild index?

netlander

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #6 on: April 16, 2013, 04:18:54 pm »
After posting this I tried checking out again and since by chance I had added the -tk2d file, I checked it out with the rest of the source and the whole thing worked.

Didn't build indexes, just ran the project and things were in better shape.

Not sure if this is pure luck or the fact that I had the original -tk2d file with the project in svn helped mitigate the problem.

What are your recommendations regarding using version control with the toolkit, should we add the -tk2d file or any others?

And yes .meta and force text on.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #7 on: April 16, 2013, 05:03:18 pm »
The -tk2d file shouldn't be checked in, it could cause issues when merging changes, but shouldn't be an issue if you're using text serialization. The best practice should be to rebuild index manually after updating from VC.

netlander

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #8 on: April 16, 2013, 05:25:55 pm »
Rebuilding indexes and -tk2d file was the cause of my loosing the animations, the alternative was to go and rebuild all anims manually and relink them to the animated sprites in my levels (hours of work potentially).

In the case where you recommend index rebuild after checkout, why do you think the animation settings are getting corrupted? worth noting that not all animations are affected.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #9 on: April 16, 2013, 05:38:34 pm »
I'm not sure to be honest - It is probably best to look at the contents of the .prefab in a text editor to debug that. There are references to sprite collection data objects in there, and if they are somehow different when checked out then that is one reason it could possibly corrupt the animation. The other option is to look at the broken animation immediately in debug inspector mode to see if all references are correct?

If you do find out what it is, please let me know so I can address it properly.

Moran

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #10 on: April 17, 2013, 07:28:19 am »
Forgot to update but the patch for 1.90 and the following version solved the issue for me.

Now, after a merge, whether -tk2d is versioned or not, clicking on "new" sprites causes the index to be rebuilt just once and that's it.

Thanks and good luck netlander.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #11 on: April 17, 2013, 09:35:06 am »
@Moran - that was an issue specific to Unity 4.1 & tk2d 1.90/91 without the patch. Unity decided to change how something worked without any warning and that broke index generation :( Is this the case in yours @netlander?

netlander

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #12 on: April 17, 2013, 11:05:31 am »
Nop, I'm still on 1.9.0/Unity 4.0 but I think it's a quirk in these versions, I've gone through the process of checking out and rebuilding, this time I didn't encounter the problem.

My solution was to proceed as follows:

Check out the project.
Import tk2d.
Run (so the index is rebuilt).

This seemed to have avoided me having corrupt animations but I can't say for certain what's exactly happening.

Thanks for your help guys.

aegzorz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #13 on: April 17, 2013, 02:38:00 pm »
I think I'm having the same issue, Unity keeps running "Rebuilding Index" and collections that are loaded through tk2dSystem.LoadResourceByName stops working. I wouldn't mind it so much if rebuilding the index was reasonably fast but it takes approximately 5 minutes to rebuild the index in our project :/

Is there a log somewhere that I can check to see what is actually breaking the collections?

Edit: I'm using tk2d 1.92 + patch and Unity 4.1
« Last Edit: April 17, 2013, 02:39:32 pm by aegzorz »

aegzorz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Constantly "Rebuilding Index" - Probably VC related
« Reply #14 on: April 17, 2013, 03:19:52 pm »
Ok, I've narrowed down the problem to the following scenario:

- Run the game
- Select a gameobject with a runtime loaded sprite collection in the Hierarchy view
- Unity starts rebuilding the index over and over

This is making it impossible to inspect the objects we're using.