Jump to content

Spriter for Unity 5.0


Dengar

Recommended Posts

I believe i'm always the first to test your updates :P ok here is the thing(serious bug affecting the importing process, I don't advice to upgrade to 1.0.1 immediately). when I try to import SCMLs using this package I get the error 

"Null Reference Exception : Object.refrence not set to instance of an object "

 

at line 162

foreach (var key in keys) { //If it is present, enable the GameObject if it isn't already enabledvar mref = ArrayUtility.Find (key.objectRefs, x => x.timeline == timeLine.id);if (defaultZ == inf) {defaultZ = mref.z_index; //line 162positionChanged = true;} 

4 of my SCML Projects suffers from the same Issue ,all of them had z values changing on them,  I had to change back to version 1.0 to get them back working again

Link to comment
Share on other sites

Curiously, I tried it with your Green Monster and Dragon Bat, and I was able to import them just fine. That said, I fixed your issue anyway. I have a feeling what configuration would cause it to crash. Not upping the version number just for a hotfix to the new feature though.

Link to comment
Share on other sites

Green monster and dragon bat working fine on the new one :) just some projects refuses to be imported due to the mentioned error.
I am the momment trying to re-assemble them in new SCML files and re-do the animations from scratch to see if that will solve this issue

Link to comment
Share on other sites

Nonono

 

I just said, I fixed the issue. Errors shouldn't happen anymore. :P I already uploaded the fix.

 

Basically, what happened, I assume, is this:

 

Suppose you have an "effect" sprite, like one of those tornado things. That sprite isn't present in every animation.

Now, suppose that while it's not present in EVERY animation, the Z value is different per animation.

 

The importer would attempt to detect that the Z value changes, and attempt to access the sprite's Z value on the first frame of the first animation (to use as a control)....

EXCEPT that sprite isn't present on the first frame of the first animation.

 

So I just changed it so it accesses the sprite's actual first Z value. Not specifically the first frame of the first animation.

Link to comment
Share on other sites

Damn, only a few months after I decide to implement 2DToolkit to Spriter2Unity, you decide to release your own implementation Dengar. xD

 

For Sprite Swapping with 2DToolkit, I had gone for a similar approach to that of the SortingOrderUpdate script.

 

I'll try and have a look at your implementation, see if I can make it work with 2DTK.

 

 

PS: Keep up the good work, you're indeed a very kind community member.

Link to comment
Share on other sites

Hi,

 

so I downloaded today newest version. First removed old one then imported new one. Deleted sprites and scml and prefabs and imported in correct order

and now I have this:

wtf1.jpg

 

 

 

 

Where it should be this: wtf2.jpg (this is from Spriter)

 

 

What is happening? I am going out but when I get back I will check if with old version I happen to have same thing.

 

Thanks for help.

Link to comment
Share on other sites

That's peculiar. I can't really tell what the problem is though. Maybe if you send me a sample I can check it out for myself and see what's up? Several different .scml files have been successfully converted to Unity, so there's probably something different about your .scml but I can't tell what without examining it.

 

@Wledig: That's pretty cool, I tried my very best to make the code as easy to work with as I could. If it can be combined with 2DTK that would be pretty awesome. I don't know much about 2DTK myself but I heard some really good things about it.

Link to comment
Share on other sites

v1.0.2:

Fixes:

-Fixed an issue where sprites appeared distorted when resizing bones.

-Exceptions are wrapped up nicely and no longer abort the whole process

Features:

-Now adds AnimationClips to existing AnimatorStates if they exist

-Autosaves no longer trigger the importer

 

 

Note that there is still some anomalous behaviour here and there. But the weird distortions should see about a 95% decrease. Special thanks to dagondev for helping me identify the issue, and Mike and Edgar for teaching me some things about Spriter to help me fix the issue.

 

It's a bit of a shame that the tool is getting slightly slower with every update, but it's still within reason. I was able to import a project that has over 60 different AnimationClips in less than 20 seconds.

 

I also have to add that most animation transitions work best if they are instant (IE no blend). Although it's really a case by case basis. But generally if the poses between two animations are radically different from one another, you want the transition to happen instantly.

Link to comment
Share on other sites

Thanks so much for help! Now my ugly project works in unity! I still had problem with head being next to legs, but I just needed to set pivot point on the sprite itself (via double clicking sprite in files section - on the right) and that did the trick.

Link to comment
Share on other sites

v1.0.3:

Fixes:

-Fixed an issue where flipped (negative-scaled) bones caused child sprites to appear out of place and in odd angles

Features:

-Added a toggle to the Entity Renderer that allows you to apply the .scml file's Z-index to the order-in-layer property of the Sprite Renderers

-Removed Spriter2UnityDX components from the Add Component menu, since they are automatically added or removed

 

About the toggle: The "Apply Spriter Z Order" toggle that now appears on the Entity Renderer adds a whole bunch of calculations to the mix, so for performance reasons it's better to leave it off. Not that it's a performance heavy operation. Just that every little bit makes a difference.

Applying the Z order to the "order in layer" properties of the child sprites also introduces some overlap issues when multiple spriter entities overlap. These issues can be resolved by placing different entities on different layers, but that requires you to create more layers.

However, it has come to my attention that sometimes, when a lot of stuff is happening on screen all at once, the sprite won't always render properly using just the position_z. In these cases, turning on Spriter Z Order on the Entity Renderer will likely fix the issue.

Link to comment
Share on other sites

Hi Dengar,

 

A lot of people don't know about this feature, but Spriter actually supports the use of sprite-sheets (texture atlases) created from TexturePacker.

 

I've created this example project in case there's a possibility that Unity could be made to support this Spriter feature:https://dl.dropboxusercontent.com/u/61721248/GreyGuyAtlas.zip

Here is the example file.  The animation uses the texture atlas (sprite sheet) and individual images.

 

cheers,
Mike at BrashMonkey

Link to comment
Share on other sites

Hi again Dengar,

 

I changed the example file and replaced the link to fix the typo and update the file.

 

If you already downloaded the original version, please redownload from the link above and replace what I originally had linked.

 

Thanks,
Mike

 

(The previous example file caused bugs because it was using the texture atlas and original image files with the same names etc)

Link to comment
Share on other sites

If I switch to this version of Spirter2Unity, will it overwrite the prefab I had made from the old one? I want to try your solution since it's newer but I'm close to finishing my game and I don't want to break anything.

 

Either way this seems really nice, and I'll try it with my next project either way.

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...