- Uređeno
spine-unity ignore tk2d pixel per meter setting
when using sprite collection, pixel per meter setting(sprite collection) is ignored.
so tk2d sprite is rendering very huge scale.
is there something i missed?
I'm using spine-runtime on viewtopic.php?f=7&t=4214
i reviewed the spine code because this problem is blocking my job.
and i found strange code below.
// on SkeletonDataAsset.cs
107: if (spriteCollection != null) {
108: json = new SkeletonJson(new SpriteCollectionAttachmentLoader(spriteCollection));
109: json.Scale = (1.0f / (spriteCollection.invOrthoSize * spriteCollection.halfTargetHeight) * scale) * 100f;
why do "* 100f" on tail of 109 line?
it's not exist on spine-tk2d.
is it necessary?
The Unity runtime for tk2d is pretty recent (merged to be a single runtime instead of two separate ones) so there might be some rough edges. Maybe Mitch can explain ?
I'm having the exact same issue. If I set the "Scale" on my SkeletonData to around 0.003 it seems to be about right.
With the previous Spine Runtime, the one that had special tk2d support as a separate folder of code, it worked properly with my SkeletonData scale at 1. Is there a fix for this coming? As it is right now, it's unusable.
Also, as a small aside, there's a bug on line 110 of SkeletonDataAsset.cs, there's a semicolon missing at the end of the line. This is in the code that comes with the current unitypackage for the Spine Unity Runtime, I just downloaded it tonight. It's only an issue if you enable tk2d support, as that code is in an "#if SPINE_TK2D" section.
As an aside: thanks for a great piece of software - my animator is really enjoying Spine, and the workflow with tk2d is really slick, it works great!
Update: making the change noted by bang2ni (removing the "* 100") fixes everything. If it's not needed, can that be updated in the official release so that it doesn't cause issues for anyone else?
Was planning on exposing it as a property in the preferences menu. Will take care of it today. Thanks guys. I don't know enough about tk2d to do it all myself heh
Mitch wroteWas planning on exposing it as a property in the preferences menu. Will take care of it today. Thanks guys. I don't know enough about tk2d to do it all myself heh
Awesome, thanks Mitch!
I will try my best to help out with all things tk2d related - I've spent the last eight months working on two different projects that use tk2d quite extensively so I've learned a lot about it, how it works, and its quirks.
Sweet Welcome aboard. I'm glad we finally got the Spine-Unity and Spine-TK2D branches merged - you can even use a mix of the two of them now