Hello Guest

Author Topic: Sprite Collection commit error  (Read 5338 times)

beQr

  • Newbie
  • *
  • Posts: 3
    • View Profile
Sprite Collection commit error
« on: August 28, 2013, 03:39:35 pm »
Hi there,

I m "hourly" new to 2DToolkit, but I ve been working on unity now for more than 2 years (  >:( me hate 2D, me dont do 2D games I said ... ) and I figured out once that I really had to ! so here I am.
Lets do it short now after this meaningless introduction : I ve followed the starter guide, picked up my assets, went to the sprite collection, picked up my assets, press commit, few moments of computing and then this nice error :

Quote
ArgumentException: Getting control 8's position in a group with only 8 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:511)
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:274)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:257)
UnityEngine.GUILayout.DoToggle (Boolean value, UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/GUILayout.cs:109)
UnityEngine.GUILayout.Toggle (Boolean value, UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/Editor/GUILayout.cs:105)
UnityEditor.EditorGUILayout.BeginToggleGroup (UnityEngine.GUIContent label, Boolean toggle) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/MonoGenerated/Editor/EditorGUI.cs:4781)
UnityEditor.TextureImporterInspector.BeginToggleGroup (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/Mono/ImportSettings/TextureImporterInspector.cs:1425)
UnityEditor.TextureImporterInspector.AdvancedGUI () (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/Mono/ImportSettings/TextureImporterInspector.cs:1507)
UnityEditor.TextureImporterInspector.OnInspectorGUI () (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/Mono/ImportSettings/TextureImporterInspector.cs:1144)
UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/cac08d8a5e25d4cb/Editor/Mono/Inspector/InspectorWindow.cs:888)
UnityEditor.DockArea:OnGUI()

FYI : I can see the generated atlas, but I dont want to go further more before understanding this problem, avoiding it for the next time and work properly.

Thanks for your time.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Collection commit error
« Reply #1 on: August 28, 2013, 04:07:13 pm »
The good news is the error is more or less harmless - its caused by changing GUI layout stuff at the wrong point in time. In this case, it looks like its totally unrelated to tk2d - it looks like its from one of the textures you've got selected when you commit. Tk2d changes the format of the texture when you press commit, so presumably since you had it selected in project view resulted in Unity complaining about it.

If it is what I think it is, it looks very much like a bug in Unity - but seeing that its pretty much harmless, don't worry about it too much :)

beQr

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Sprite Collection commit error
« Reply #2 on: August 28, 2013, 04:14:06 pm »
This sounds like good news ! I hope  :P . Can I please have any kind of details about assets import config before building them up to atlases ? any best practice hints for use with 2DToolkit ? (plateform targeted are iOS and android) or any kind of restriction on the images to include in the atlases ?
Thanks for the previous reply and thanks for the next one in advance  :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Collection commit error
« Reply #3 on: August 28, 2013, 05:43:31 pm »
It doesn't matter what format it is in, the sprite collection builder configures it properly as needed.
About restrictions - if you're targetting iOS and Android, a max atlas size of 2048x2048 is recommended.

beQr

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Sprite Collection commit error
« Reply #4 on: August 28, 2013, 06:05:03 pm »
Thanks for the reply ! this important detail will save a lot of time of work for me.

Got another question, out of topic since I m already advancing :p, I m working on moving sprites (mouvement logic implemented before swaping the project to 2D assets) where the mouvement is based on transform.forward "orientation", since this vector is the "Z" :p and the sprites are built over x & y axis, the forward turns out useless ! any chance to swap the way sprites are built up ? or do I have to change all the mouvement logic already existing ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite Collection commit error
« Reply #5 on: August 28, 2013, 06:18:11 pm »
You can't change the sprite orientation - you'll just have to use transform.up / transform.right instead of "forward". Or, parent the sprite to something else and rotate it to face the orientation you want...