• Runtimes
  • Skin 2 slot item visibility and order

Hello.

Goblin.json file has following config

...
"skins": {
	"default": {
		"left hand item": {
			"dagger": { "x": -35.5, "y": 3.85, "rotation": 10.47, "width": 156, "height": 238 },
			"spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 }
		},
...

There is no slot left hand item for boths kins (goblin and goblinGirl).
So the question are

  1. How will i know, do i need to show this sprites or no (the same question for not default skin)
  2. What is a order if i need to show both sprites.

Another question is

  1. If i have a slot left hand item in goblin skin and default skin am I correct that I need to show just sprites from goblin skin.

  2. Which sprites do i need to show for default pose (is it controlled by first animation step of first animation ?)

  3. I saw drawOrder section on JSON Export Format page, but it looks different than what i see in spinboy.json file

    ...
    "animations": {
    	"drawOrder": {
    		"bones": {
    			"head": {
    				"rotate": [
    					{ "time": 0, "angle": 0 },
    				        ......
    					{ "time": 3.9, "angle": 359.99 }
    				],
    				"translate": [
    ....
    

    it's very different with what you provided on your page

    "draworder": [
    	{
    		"time": 0.2,
    		"offsets": [
    			{ "slot": "slotName", "offset": 1 },
    			{ "slot": "slotName", "offset": -2 },
    			...
    		]
    	},
    	...
    }
    

    And one more question, what's mean time here, and which Animation this draworder belongs.

Thanks in advance,
I very appreciate your quick support.

Related Discussions
...
  • Bearbeitet
nicloay schrieb

Hello.
There is no slot left hand item for boths kins (goblin and goblinGirl).

Here is the list of all slots:
http://esotericsoftware.com/spine-json-format/#slots
A skin is a map where the key is the slot + name and the value is an attachment. A skin does not need to have an attachment for every slot.

So the question are

  1. How will i know, do i need to show this sprites or no (the same question for not default skin)
  2. What is a order if i need to show both sprites.
  3. Which sprites do i need to show for default pose (is it controlled by first animation step of first animation ?)

1,2,4) Are you writing your own runtime? You show a region attachment if the slot has one. The attachment for each slot in the setup pose is defined here:
http://esotericsoftware.com/spine-json-format/#slots

  1. If i have a slot left hand item in goblin skin and default skin am I correct that I need to show just sprites from goblin skin.

Skins don't have anything to do with rendering attachments. Skins allow looking up an attachment by slot + name. A skin doesn't define what attachments a skeleton has, it only facilitates looking them up in this way.

  1. I saw drawOrder section on JSON Export Format page, but it looks different than what i see in spinboy.json file

That is an animation named "drawOrder", it is not a draw order timeline. This "drawOrder" animation is a simple test for draw order, where spineboy's head flies around his body.

And one more question, what's mean time here, and which Animation this draworder belongs.

Time is in seconds.

[upd1: deleted bulk of my stupid question written before =) twice!.]

Now i reviewed one more time your documentation and now, probably, I've get your point =)

...
"slots": [
     { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" },
...
  • ["name": "left shoulder"] - this property means that each skin will have this slot (or can be zerro (in skin), which means that no sprite for this slot for specific skin

  • ["attachment": "left shoulder"] - this can not be link to the sprite, and can be linked only to the slot attachment from the skin.

  • Any json data file will have at least one skin with name "default" (or any another one if setted up in spine editor) which will contains links to all sprite used by animation.

  • And from json documentation. "if attachment not found in named skin, it must be in default skin"

summarize: There is no any links to sprite or image file in json file except of skin slot attachment.
right?

Nate schrieb

That is an animation named "drawOrder", it is not a draw order timeline. This "drawOrder" animation is a simple test for draw order, where spineboy's head flies around his body.

Found it. Sorry, I missed this first time.

Nate schrieb

Are you writing your own runtime?

Yes, I'm doing unity exporter for native animation system, as i see you don't like this idea =). But i want to create native assets whithout any 3d party script (it's possible for one skin spine objects).
I've already done dirty prototype with all main features like import linear, stepped curves, shift sprites.. and mandatory thing (build sceleton and so on)


and now I'm doing refactoring to make code more clear flexible.
it's available here https://github.com/nicloay/spine-runtim ... ity/Assets .

nicloay schrieb

["name": "left shoulder"] - this property means that each skin will have this slot (or can be zerro (in skin), which means that no sprite for this slot for specific skin

Pretty much, though it's better to say that bones have slots. Skins don't have slots, they are just a mapping.

summarize: There is no any links to sprite or image file in json file except of skin slot attachment.
right?

Correct. The skins are an indirection so that the actual attachment used can vary based on what skin is chosen.

Yes, I'm doing unity exporter for native animation system, as i see you don't like this idea =). But i want to create native assets whithout any 3d party script (it's possible for one skin spine objects).
I've already done dirty prototype with all main features like import linear, stepped curves, shift sprites.. and mandatory thing (build sceleton and so on)


and now I'm doing refactoring to make code more clear flexible.
it's available here https://github.com/nicloay/spine-runtim ... ity/Assets .

Cool! Haha, I like the idea fine, I just personally need to focus to get done what is planned. Can't take on too many projects else I'd not be able to maintain everything properly. 🙂 BTW, you probably want to update the Spine license to the latest:
https://github.com/EsotericSoftware/spi ... er/LICENSE
The old license was broken, it said for anyone to be able to use the runtimes, they have to buy Spine (this means anyone, even people you might sell your app too). The new license says anyone can use the Spine runtimes, but to be able to create new apps using the Spine runtimes you need permission from Esoteric Software, which you get from a Spine license. Makes more sense!

9 Tage später
Nate schrieb

Cool! Haha, I like the idea fine, I just personally need to focus to get done what is planned. Can't take on too many projects else I'd not be able to maintain everything properly. 🙂 BTW, you probably want to update the Spine license to the latest:
https://github.com/EsotericSoftware/spi ... er/LICENSE
The old license was broken, it said for anyone to be able to use the runtimes, they have to buy Spine (this means anyone, even people you might sell your app too). The new license says anyone can use the Spine runtimes, but to be able to create new apps using the Spine runtimes you need permission from Esoteric Software, which you get from a Spine license. Makes more sense!

Hi Nate, probably my previous reply in this tread has been lost.
Yes, i do understand, you make a big job, and it's awesome.
Thanks for license clarification. new license is much-much better. I'm not sure where i need to use your license or not, maybe I need to make new, separated, project? I don't use any part of your code, so it's not the issue for me.
Also, I've released first beta (viewtopic.php?f=3&t=2012). Unfortunately it's not easy to transfer all spine feature directly in to the unity objects. so there is no right now folllowing thing:

  • regionsequence

  • color animation

  • mesh animation

  • smooth animation (unity bezier points is very different with your viewtopic.php?f=7&t=1996)

  • events (not an issue)

  • draworder (not an issue)

  • Export several json files with shared atlas (spine project with several sceleton

Your project looks neat! If you don't use any of the official Spine rutimes code and none of your code is based off of it (eg you didn't copy any of it) then you don't need to apply the Spine Runtimes license to your code.