- Modifié
tint:black, how to use it ?
Hello
I'm a bit confused with the usage of tint black , in spine I set a tint:black and I get the expcted result on my model :
However in unity it doesn't seem to do anything, I tried to change the shader from skeleton to skeleton tint:back but then it just erase all the color for all the animations.
I'm not sure if I did use it properly, tips are welcome
Hello!
https://github.com/pharan/spine-unity-docs/blob/master/Tint-Black.md
I just created a document for it. I hope this helps. Let us know if something is unclear, incorrect or missing!
Thanks, it helped me sorting it out
Hi Pharan
about the "incorrect setup" part:
I tried entering and exiting play mode, and i still get rainbow colored mesh instead of the actual colors. reimporting also didnt work.
could you please elaborate on that part?
many thanks! :p
You only need to follow the steps for your skeleton. https://github.com/pharan/spine-unity-docs/blob/master/Tint-Black.md#spine-animated-per-slot-black-tinting
- Check "Tint Black" under Advanced.
- Use the Spine/Skeleton Tint Black shader.
I followed the steps but i still get that rainbow pallete instead of the original colors :S
That should be correct.
Can you send us your Spine export files to check what's wrong?
You can send to unity@esotericsoftware.com
sent! thanks!!!
Nothing seems to be wrong.
I did this:
- Add the Spine exports to the Unity project. (Spine-Unity will generate the SkeletonData and Atlas assets)
- Instantiate the skeleton into the scene.
- Open
Advanced...
and check Tint Black. - Change the Shader to
Spine/Skeleton Tint Black
- Enter play mode. Play any of the animations.
No rainbow in the scene.
Note that the Material preview will look wrong as in your screenshot because the preview meshes it uses (cube, sphere, quad, cylinder) does not have its black tint channels (uv1, uv2) filled.
I tried it in a completely new scene and it worked O_O
We will solve the issue we have in our scene and let you know what it was all about.
Maybe it will help other people that encounter the same issue
Thanks a lot!
Shachar
How can you change the second color through code in Unity?
curiousdustin Set these properties on Slot
:
EsotericSoftware/spine-runtimesblob/4.2/spine-csharp/src/Slot.cs#L116-L126
Be careful if animations key the color you set, applying the animation after your change will overwrite your change. In some cases it makes sense to make changes every frame, after applying animations.
Thank you. That worked. For others sake, here is an example of what I did:
Color color = Color.red;
Color outlineColor = Color.blue;
slot.SetColor(color);
if (slot.HasSecondColor)
{
slot.R2 = outlineColor.r;
slot.G2 = outlineColor.g;
slot.B2 = outlineColor.b;
}
Can you explain why there isn't simply something like Slot.SetColor(color, darkColor)
?
Also, this is off topic, but where is the Unity API documentation? For instance, I can't seem to find a page documenting specifically the spine-unity Slot
class or Slot.SetColor()
method.
curiousdustin API references for all Spine runtimes, not just the spine-unity runtime, can be found here: https://esotericsoftware.com/spine-api-reference
The spine-unity runtime documentation omits the information presented in the general Spine Runtimes Guide, so please refer to both if you need to learn about the runtime.
So, https://esotericsoftware.com/spine-api-reference, is really all we get for spine-unity API documentation?
There's really nothing better?
For instance:
- The portion for the Slot (class?) makes no mention of the
Slot.SetColor()
method. Where in this API reference should I find that. For that matter, other than this forum, Stack Overflow, or code hinting, how am I supposed to discover theSlot.SetColor()
method? - The same for the properties mentioned by @Nate,
R2
,G2
, andB2
. How is anyone supposed to guess that those are related to theTint black
feature? - Instead
color
anddarkColor
properties are listed. (Exactly the properties I want to change, I think, BUT those are NOT available in theSlot
class provided in spine-unity.
curiousdustin Ah, sorry for the oversight about the Slot.SetColor() method not being in the general API reference. It's just that this page is the only documentation that exists independently as an API reference. Runtime-specific methods often require checking the actual source code. Since it is difficult for a small team like ours to keep API documentation summarized by version and updated constantly, the source code descriptions are the most reliable. (The API reference I linked to in my previous reply is also based on the latest version of the Spine Runtimes, and some names may differ from older versions.)
Documentation for every runtime would of course be better, but so far we have preferred to allocate resources elsewhere, mainly to give you new features. The runtimes are ported faithfully and the API reference covers the majority, at the very least it helps you zero in on where to look in the source code (eg the Slot
class). Typically the differences between runtimes are just a few details about lists or how properties are accessed.