Hello Guest

Author Topic: 2DToolkit Animations Update issue  (Read 5897 times)

VGT

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 17
    • View Profile
2DToolkit Animations Update issue
« on: May 16, 2012, 07:48:58 pm »
I am running Unity version 3.5.1 and I updated 2D Toolkit from version 1.6 to 1.7 Patch 2.

Upon updating, I reimported all my assets and rebuilt the Index.  If I click on any of my animation prefabs I get an error saying 'Object reference not set to an instance of an object'  I cannot create anymore new animations because all of my sprite collections are invalid.  Before I removed my sprite collection prefabs along with the image sequences to save about 3 gigs of memory from our files.

I also noticed that all of my objects are now missing their script references.  I imagine reimporting everything broke my animations because of the lack of sprite collections, but I read that I need to remove those if I want to remove my image sequences.  These dependancies might cause me to be more cautous with updating 2D Toolkit in the future unless I took the wrong steps to updating.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2DToolkit Animations Update issue
« Reply #1 on: May 16, 2012, 08:01:53 pm »
Updating should just work, I do test that with at least the 2 - 3 prior versions before releasing, so you shouldn't have any problems like that, unless...

Missing script references = most likely one or more of the scripts have been moved outside Unity prior to updating and the metadata (asset GUIDs) are wrong. If you've got .meta files enabled, you should be able to quite quickly identify the offending ones. If you've got it in source control then it should be a matter of finding .meta files which are different. You will need to fix this before attempting anything else, as if the script references to the SpriteCollectionData object has gone wrong, then the animations will all be broken, etc. Let me know once you've identified the cause of this. One thing to check is to click on the sprite collection data object in the browser

I think the "Object ref not set..." error is because the script reference to the sprite collection data object is missing. If thats the case then it won't be able to reconnect all data objects, and you won't be able to create new animations or even sprites in the scene view.

The animation editor 1.7 Patch 2 works even when the source files and SpriteCollection objects have been deleted. I've verified this on multiple different projects.

VGT

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: 2DToolkit Animations Update issue
« Reply #2 on: May 16, 2012, 08:05:58 pm »
Yes. Shortly after posting I noticed that the scripts for 2D toolkit were moved outside of TK2DROOT.  I had to delete the old one and import the new.  I will see to it that the folder will never be moved again, haha.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2DToolkit Animations Update issue
« Reply #3 on: May 16, 2012, 08:11:26 pm »
That isn't the problem, you may move it wherever you want, but it MUST be moved from within the Unity Editor. Otherwise Unity will assign new GUIDs to these objects and they will be treat as new objects.

In any case, if you want to fix this, you can actually do it - its not that complicated. Basically you turn on "Debug mode in the Inspector", then select your sprite collection data objects. The "Script" reference should be null there. Drag the tk2dSpriteCollectionData script into the slot to reconnect everything. Make sure all the sprite collection data / etc objects are all set up correctly, and then make sure other script references for animations, etc are correct (based on the error you were getting, I think they will be fine).

Ideally keep the GUIDs to match the original ones in 2D toolkit, so there wont be any problems when updating in the future.