wrgood

Whenever i create a SkeletonAnimation at runtime, and then assign it a SkeletonDataAsset, the MeshRenderer does not update its materials, and thus i cant see anything on screen.
To try to simplify the problem, i have created a New SkeletonAnimation in the main scene.
Play the scene.
Set the Skeleton Data Asset.

Nothing.
If i skip the "Play scene" step, everything works dandy.

Is this just a limitation of the runtime? Maybe something else is incorrect with my Data or something? Should i just create my Animation as a prefab?

Any help is appreciated at this point.
wrgood
  • Mesajlar: 8

wrgood

After trying over and over again with changing options, i just went and rebuild everything, and it works fine. Went back to the broken example, and couldn't tell what was different, so i guess I'll just have to say this was just one of those mysteries of the universe.
wrgood
  • Mesajlar: 8

Nate

Unity seems to freak out sometimes. :( Try restarting it (or wait for it to crash :x ;) ).
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12208

wrgood

So, aparently i spoke to soon.
I was so exctatic at getting ti working, that i decided to just write my post, and call it a night! Loaded up the next day, and it wasn't working again. tested it on my other computer as well, and cant seem to get it working (with new files, and with old).

Perhaps anyone can confirm that I am doing this correctly.

directory filled with art assets
spine file
exported spine file (renamed to txt).

create new collection, add all the art files

create new skeleton data, link up the json.txt and the collection

use skeleton data to create new SkeletonAnimations.

I know this is sort of one of those mystery things, but any insight would be much appreciated. tried the ol' unity restart, spin around 3 times, restart computer. and no such luck.
wrgood
  • Mesajlar: 8

Nate

Those steps sound right. Is there anything in the Console?
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12208

wrgood

After another late night of delving deep into the code, i figured out a workaround (maybe this is the expected solution).

Perhaps i should have posted this code sample right away:
skeletonAnimation = this.gameObject.AddComponent<SkeletonAnimation>();

skeletonAnimation.skeletonDataAsset = GameManager.MainSkeletonData();
skeletonAnimation.Initialize();

skeletonAnimation.skeleton.SetSkin("orange_f");
This was not working.

I got it working by either setting the initial skin to "orange_f" OR by calling SetSlotsToSetupPose() after setting the skin.

I think this is just my own fault for asuming that my code was correct, but i thought i saw similar code elsewhere, ha!

In addition, perhaps my skeletonJson is set up in a way that the default animation just doesn't want to show up (the default is very much like the goblins setup).

If you want any of my files, just let me know, but i think i got this one all wrapped up now!

Now that i see moving pictures, the fun can begin, lol!
wrgood
  • Mesajlar: 8

Nate

Ah, sorry, didn't think you were getting far enough for that to be the problem. It's a tricky bit that gets people at first, but changing skins doesn't change attachments, since you might not want it to. See here:
http://esotericsoftware.com/spine-using ... in-changes
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12208


Dön Runtimes