Jump to content

Spriter for Unity 5.0


Dengar

Recommended Posts

Just started messing with this today and ran into an interesting bug while importing the "PlatformerPack" from the Essentials art packs that comes with the steam purchase. Towards the very end the importer seems to be getting into some sort of infinite loop and refuses to finish. Seems to be going between the hands and effects folders.

Link to comment
Share on other sites

Yup it's with DX. Haven't run into any similar issues with my own animations though so not a big deal at this point.

 

I am however having an issue with the z order of sprites that appear in different animations. Are there any known issues/workarounds related to this?

 

Seems like as long as long as the animation with the additional sprite is the first animation in the element it orders correctly. I guess a good practice would be to have a dummy animation with all sprites used in all animations ordered correctly

Edited by TheValar
Link to comment
Share on other sites

Then there must be something about your .scml file that's different from the ones I used to test.

 

Regarding that, and some of the issues mentioned previously in the topic. I still haven't booted up Unity in weeks. I've been very busy with other stuff and tbh haven't quite felt like coding. I might take a crack at it this weekend but again, no guarantees.

Link to comment
Share on other sites

I think this can be officially called a "known issue" now. Once again, I don't know why it happens. But I also haven't investigated it yet. That said, the project is open source so other coders can take a shot at it. I'll be happy to answer any questions people have when trying to figure out how the script works. I've spent a lot of effort on making sure the code is understandable by third parties. I just don't have the time or energy to work on it myself right now.

Link to comment
Share on other sites

My two guesses are you're either setting different pivot points from the default pivot point in your first key frame or maybe you're using flipped images for one half of the crabs limbs and it's confusing Spriter2Unity? (maybe both)

 

I suggest you only use the default pivot point option, where you set the default pivot point before ever dragging the image onto the canvas to construct your character... just double click the image in the file palette, and set it's pivot point there, and never change it in the canvas.

 

Please let us know if this helps.

 

Cheers.

 

-Mike at BrashMonkey

Link to comment
Share on other sites

Just started messing with this today and ran into an interesting bug while importing the "PlatformerPack" from the Essentials art packs that comes with the steam purchase. Towards the very end the importer seems to be getting into some sort of infinite loop and refuses to finish. Seems to be going between the hands and effects folders.

Go through all your images and make sure they are set to Sprite2d. We had this problems with images being still set to Texture or Advanced. Even though Advance does 2d, we found that problems such as infinite loop occurs.

 

Yup it's with DX. Haven't run into any similar issues with my own animations though so not a big deal at this point.

 

I am however having an issue with the z order of sprites that appear in different animations. Are there any known issues/workarounds related to this?

 

Seems like as long as long as the animation with the additional sprite is the first animation in the element it orders correctly. I guess a good practice would be to have a dummy animation with all sprites used in all animations ordered correctly

Had this problem too. This is because your objects z position is moving. So when an object moves in world space I found this mucks up the sorting that DX uses. For some reason once your object moves on Z the z changes in world space. if the Z value becomes too small then it just mucks up. However by using local scale. then the sorting will work again. Honestly I find relying on    position.z * -1000 to raise a value of 0.010 to 10 to personal feels a little reliable. Would seem that relying on a position z of integer values would be better. so instead of position.z = 0.010, should be position.z = 10. Anyways, that's just me. hope this helps any one who is having the same troubles.

 

1. Go to 

SortingOrderUpdater.cs script

 

2. Go to Update() method

 

3. Change

float newZ = trans.position.z;

to

float newZ = trans.localPosition.z;

 

and then you should be good with sorting layer issue

Link to comment
Share on other sites

I think this can be officially called a "known issue" now. Once again, I don't know why it happens. But I also haven't investigated it yet. That said, the project is open source so other coders can take a shot at it. I'll be happy to answer any questions people have when trying to figure out how the script works. I've spent a lot of effort on making sure the code is understandable by third parties. I just don't have the time or energy to work on it myself right now.

 

What's strange about this, at least with my example, is that the keyframe's are all perfect, everything looks absolutely correct within Unity, so the script doesn't appear to have any errors with how it's creating keyframes and placing objects. But there's just this crazy easing going, between the keys, and I can't pinpoint the source of it.

Link to comment
Share on other sites

1. Go to 

SortingOrderUpdater.cs script

 

2. Go to Update() method

 

3. Change

float newZ = trans.position.z;

to

float newZ = trans.localPosition.z;

 

and then you should be good with sorting layer issue

 

 

Really, REALLY? Dang. If I had known this sooner I would have fixed it long ago. Thanks for the heads up though. Next time you find out something like this, let me know, or create a pull request. I'll add it to the next update regardless.

 

I still can't believe I made a basic mistake like that and had it go unnoticed for weeks.

 

 

Go through all your images and make sure they are set to Sprite2d. We had this problems with images being still set to Texture or Advanced. Even though Advance does 2d, we found that problems such as infinite loop occurs.

 

How long have you known this? Because I would like to have known about it as well. Can't really fix things if I don't know they need fixing.

Link to comment
Share on other sites

I think I'm doing something terribly wrong here, but this new DX importer is not importing on my side. I still have to use the old Unity 4.3 importer to make the animations and then copy/paste the directory to my Unity 5 project. This way it does work but it's not the best way I'd imagine :D

Link to comment
Share on other sites

Hey Dengar,

 

any thoughts on how to implement sound fx into your importer. First challenge is importing the file since your file dictionaries assume any files will be a sprite and the .scml standard doesn't seem to differenciate between sounds and images other than by file extension.

Link to comment
Share on other sites

My two guesses are you're either setting different pivot points from the default pivot point in your first key frame or maybe you're using flipped images for one half of the crabs limbs and it's confusing Spriter2Unity? (maybe both)

 

I suggest you only use the default pivot point option, where you set the default pivot point before ever dragging the image onto the canvas to construct your character... just double click the image in the file palette, and set it's pivot point there, and never change it in the canvas.

 

Please let us know if this helps.

 

Cheers.

 

-Mike at BrashMonkey

 

Did you guys ever get Dengar a pro license for his work on this?

 

I'll be moving from Air to Unity for my newer projects, and it would be awesome if you guys are doing your part to encourage this development. IF he had a donation link, I'd throw a bit of spare change his way. Spriter rocks, but it's tools like this that really make it shine.

Link to comment
Share on other sites

I have pro. That said, I have not worked on any pro features. Or on the tool at all in the last few weeks.

 

When I work on it again (and I don't know when that is), my priority is to get the issues that were mentioned over the past few pages out of the way, and making sure all vanilla features work as intended.

 

After that, the order will likely be CharacterMaps > Subentities (whatever those are) > Sounds > Boxes > Triggers > Any feature I don't know about yet. To me this seems like a most-to-least important order.

Inbetween those, there's also some quality of life features on the Unity side I'd like to add. Like maybe a Settings menu where the user can customize certain details about the import. And the ability to generate OverrideControllers.

 

But again, no ETAs on any of those. It's strictly on a whenever-I-have-time-and-feel-like-working-on-it basis.

 

 

But again, open source.

Link to comment
Share on other sites

Hi Dengar (and everyone else),

 

I plan to make a nice, clean, step-by-step video for total Unity noobs, like myself, to show how to use Spriter2Unity, but want to make sure I get everything right, so I don't, in my "noobishness", send people down an errant path.

 

Can you please check out this temp. video and let me know if I'm doing anything improperly, or if there are any specific points I should make?

 

The final video will have voice.. I just couldn't speak while recording this because my youngest daughter was taking a nap at the time. ;)

 

Cheers.

 

-Mike at BrashMonkey

Link to comment
Share on other sites

Uhhhh yeah, while importing the entire .zip technically DOES work, it also imports a bunch of unnecessary files. Said files are handy for developers looking to edit the project itself, but not for the end user. Unity even protests against importing them in that manner.

 

-Instead of clicking the "GitHub link", you should click the "Package Link" instead(https://github.com/Dharengo/Spriter2UnityDX/raw/master/Packages/Spriter2UnityDX.unitypackage)
-This will download a .unitypackage file

-Just drag and drop the .unitypackage file in your project's project view

-Done

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...