mathius777

I have attached a picture of my problem. I created a bounding box attachment in Spine, then ran the skeleton utility on the game object in unity(Generated using Spine->Instantiate(SkeletonAnimation), but the bone with the bounding box attached to it never gets added to the game object under SkeletonUtility-Root.

If I highlight the Skeleton Data,I can see the bone along with the bounding box attachment under the "Slots" dropdown. However, looking under the "Slots" dropdown on the INSTANTIATED object shows the bone name but not collider under it(this might not be a problem).

Any ideas? Thanks.

-- 09 Sep 2015, 16:07 --

I have also noticed that when I add ANY collider box to an animation and highlight the skeleton animation data in unity. I ALWAYS get the following exception: The position varies of course depending on what animation the collider is on.

ArgumentException: Getting control 28's position in a group with only 28 controls when doing Repaint
Aborting

UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GUILayoutUtilityBindings.gen.cs:511)
UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GUILayoutUtilityBindings.gen.cs:306)
UnityEngine.GUILayoutUtility.GetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GUILayoutUtilityBindings.gen.cs:297)
UnityEditor.EditorGUILayout.GetControlRect (Boolean hasLabel, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6831)
UnityEditor.EditorGUILayout.GetControlRect (Boolean hasLabel, Single height, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6826)
UnityEditor.EditorGUILayout.LabelField (UnityEngine.GUIContent label, UnityEngine.GUIContent label2, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5202)
UnityEditor.EditorGUILayout.LabelField (UnityEngine.GUIContent label, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:5169)
SkeletonDataAssetInspector.DrawSlotList () (at Assets/spine-unity/Editor/SkeletonDataAssetInspector.cs:365)
SkeletonDataAssetInspector.OnInspectorGUI () (at Assets/spine-unity/Editor/SkeletonDataAssetInspector.cs:118)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1162)
UnityEditor.DockArea:OnGUI()

-- 09 Sep 2015, 16:31 --

So I found that when I add a collider to the SPINEBOY head slot, after I INSTANTIATE it using the skeleton utility, it shows the collider under the head slot in the inspector, and then will properly show the bounding box after I click "Spawn Hierarchy". When I do the SAME THING with the goblin, nothing shows up under the INSTANTIATED head slot, and so therefor when I click "Spawn Hierarchy", it doesn't show anything under the bounding boxes section. I have on idea how they are different.

However, when viewing their animation data in the unity project folder, both of their head slots show the bounding box. It is only the instantiated GOBLIN that has issues.

I tested the Dragon animation and it works fine, so it is just the goblin that has issues and I would really like to figure out why in case this issue occurs with my own animations in the future.

The exception occurs on both so that doesn't seem to matter.
Attachments
HelpSpine.png
mathius777
Posts: 17

Mitch

I think there might've been an issue with dealing with bones that have more than 1 slot with populating the Bounding Box list.... Skeleton Utility is due for a overhaul for Spine 3 :/ All this stuff is going to get addressed eventually. Also, the BoundingBoxFollower script is newer and more consistent than anything inside SkeletonUtility and can be used in conjunction with SkeletonUtility as well - it better tracks the current state of a bounding box attachment (ie: which one is currently visible) where as the Utility method just spawns a collider into your scene.
User avatar
Mitch

Mitch
Posts: 966

mathius777

WOW! I had NO idea about BoundingBoxFollower. I asked a question about 7 months ago about how to enable/disable colliders during animation and you said to use animation events. It is amazing how fast progress is made:)

The only issue I have is my entire mob rotates like crazy for some reason and flies off the screen when I have a bone follower. It works fine if I use skeleton utility to spawn a heirarchy and then use BoundingBoxFollower on that bone. Though it would be nice if it worked using this on the base game object and eliminated the need to spawn a hierarchy.
mathius777
Posts: 17

Mitch

HIerarchy is necessary because of the way Unity physics update. I could simply make all the utility bones hidden :P
User avatar
Mitch

Mitch
Posts: 966

Turtlepig

I'm now having this same issue where my bounding boxes do not show up under the spawned hierarchy of the skeleton utility as of Oct 9, 2017. Same symptoms, the slots show up when I'm looking at just the skeleton data asset by itself after importing from spine. I then create a Skeleton Animation in my scene, and add the skeleton data asset to it; Add Skeleton Utility; Spawn Hierarchy; Select the bones that have the bounding boxes but they are non listed under that bone. I was not having this issue until my spine got updated to 3.6.43 Professional today. I use spine on a weekly basis and always click update when one is available. I thought maybe it broke something with the unity runtimes since I haven't updated those for about a month and a half. So I updated those to the latest that are available at the moment (released on September 30th, 2017). But still the same results, no matter what I try, re-importing, exporting again, etc... they just won't show up under the hierarchy anymore.

Update
Ok so I found why the bounding boxes are not showing up for me, and it appears to be a bug. I have a root with 2 separate child bones. My root has a bounding box, one of the children has a bounding box, and the other child has a skin placeholder (which is the only actual graphic in my skeleton). In Unity, if I have a skin selected for the skeleton animation, even though the skin placeholder is on the child bone with NO bounding boxes, neither of the bounding boxes attachments will show up under the skeleton hierarchy. I have to select "default" as my skin, which has no skin assigned to it because my skin names are just the numbers 0 to 3. I can select default skin and add the colliders then change the skin and the colliders are there (even though the bounding boxes disappear again at that point), but this is also appears to be causing issues with my keys not working for turning the bounding boxes on and during animations.
Turtlepig
Posts: 3


Return to Unity