CptDefault Posted July 11, 2013 Report Share Posted July 11, 2013 Spriter Unity API - NGUI and B3 compatible Overview After a fair bit of work I've got a version of the API that works with the latest Spriter file format and NGUI (specifically, the free version). This isn't quite final; there's still one or two minor things that aren't quite right, but I'd much appreciate any help that can be offered to sort them out. I've also separated out most of the Library independent code. If you'd like to extend this to ex2D (for which I don't have a license) you should hopefully only have to implement the reduced amount of code in SpriterDataNGUI. This mostly deals with Atlas creation. The plugin passes all of Timpart's Spriter Test Suite version 0.2. Demo NGUI/Spriter Demo This demo shows the "Monster" example, with varying pivot points between animations and bone animation used. To Download: NGUI. The free/evaluation version also works great. https://github.com/CptDefault/spriterdapi-unity/ https://github.com/CptDefault/spriterdapi-unity-ngui Download both of the above repositories and place them into the Assets folder in your Unity project. NGUI Free vs NGUI Full To use the full version of NGUI, open "Spriter-NGUI\Editor\SpriterDataNGUI" and comment out line 34. Make it look like the following: //To use the full version of NGUI, comment out the following line.//#define NGUI_FREE To Use: Make sure the Spriter project you're importing is inside the Assets folder. Whilst there's nothing stopping you selecting another directory it's likely to break the plugin. Unity should now have a "Spriter" menu option, to the left of "Window" and "Help". In here you will find "[NGUI]Create New Character". This will create the character using Unity's legacy animation system. From here there is no reliance on any of the scripts in this project beyond the colour helper. Future Goals: [*:17vpbp7y]Automating the import process when the .scml file is updated.[*:17vpbp7y]Extending the project to work with 2DToolkit and/or ex2D.[*:17vpbp7y]Adding a (non-recommended) mode of operation with no toolkits Known issues: [*:17vpbp7y]Sprites are sometimes a few pixels off from where they should be. I'm investigating this but haven't found the cause.[*:17vpbp7y]Opening the example scene might cause sprites to flicker when they change. Re-importing solves this.[*:17vpbp7y]Half the commit messages were written with "R3" compatibility. I meant "B3". Whoops. I'll likely have to take a week off from this to catch up on my other projects; but rest assured I will be continuing support for this. I'm looking to use Spriter for a major games project this semester. If you run into any trouble at all, post it here and I'll do what I can to help find a solution. Lastly, I'd like to thank Thinksquirrel for the great work getting this project started. Cheers, CptDefault Quote Link to comment Share on other sites More sharing options...
lucid Posted July 11, 2013 Report Share Posted July 11, 2013 Excellent excellent! Thank you CptnDefault, ThinkSquirrel and everyone else who's been working on the Unity plugin Developer docs coming soon, and as always feel free to contact me at lucid@brashmonkey.com for any issues while developing implementations Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 12, 2013 Report Share Posted July 12, 2013 This video shows the workflow of using Spriter with Unity3d through NGUI and is an AWESOME addition for Unity. http://vimeo.com/70291907 Here is a demo webplayer from the How-To video above. http://www.kodagames.com/spritertest/SpriterSetup.html Quote Link to comment Share on other sites More sharing options...
Ravenshadow Posted July 12, 2013 Report Share Posted July 12, 2013 I followed the instructions and it worked fine. I'm using Unity 4.1.5 though, can you use a more current Unity? Quote Link to comment Share on other sites More sharing options...
CptDefault Posted July 12, 2013 Report Share Posted July 12, 2013 Apologies, I neglected to test the plugin with 3.5. You've taken the correct steps in deleting the Example/Imported folder. You'll most likely want to delete the Example/Scene folder as well. The last step you'll want to take is to make sure the Spriter project you're importing is inside the Assets folder. Whilst there's nothing stopping you selecting another directory it's likely to break the plugin. I'm running Unity 3.5.7 (for this test, usually I use 4.x) and Win7 so I shouldn't imagine there'd be too much difference between our setups. Have you got an up to date version of NGUI? The latest version seems to be found at http://www.tasharen.com/?page_id=140 under the heading "Evaluation Version". In regards to using this without other plugins; it should be possible. Don't expect the full ease of use or efficiency of those other plugins, but it's definitely doable. I might look into doing so once I've got some other projects back on track. Expect such a thing in two or three weeks. Spriter works on PC, Mac and (I believe) Linux. This plugin should work on all platforms supported by Unity, but I haven't tested on any other than Windows standalone and the Web Player. Thanks, CptDefault Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 13, 2013 Report Share Posted July 13, 2013 Solved and Updated :) Quote Link to comment Share on other sites More sharing options...
CptDefault Posted July 13, 2013 Report Share Posted July 13, 2013 Seems odd. Perhaps the free version of NGUI is different in some slightly odd manner compared to the full version. Could you load up those script files and try replacing all references to UIBaseAtlas with UIAtlas? It's possible that might help. The two errors regarding SpriterNGUIColorHelper are due to slightly flawed design on my part (I'll fix it in the next update) and as you've noticed are fixed by importing the second module. Let me know how that goes. Thanks, CptDefault Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 13, 2013 Report Share Posted July 13, 2013 Solved and Updated :) Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 13, 2013 Report Share Posted July 13, 2013 Solved and Updated :) Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 13, 2013 Report Share Posted July 13, 2013 Solved and Updated :) Quote Link to comment Share on other sites More sharing options...
CptDefault Posted July 14, 2013 Report Share Posted July 14, 2013 Hi Michael, Unfortunately the examples folder simply doesn't work with 3.5. Next time I get a chance to do a revision I'll build it from 3.5 instead. It's odd to hear that there's issues with the full version of NGUI. I'll see if I can get hold of an updated version myself and sort it out, but I'm not sure how soon I'll be able to do that. I'm vaguely aware of a bug where things aren't quite where they should be but the animation I've been testing with is much less pronounced than that. Is there any chance you could send me a copy of that animation purely for testing this? My email is my username at gmail dot com. Sorry to hear that you had trouble finding the import option. I'm hoping to streamline that in the future. Thanks, CptDefault Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 14, 2013 Report Share Posted July 14, 2013 Solved and Updated :) Quote Link to comment Share on other sites More sharing options...
CptDefault Posted July 14, 2013 Report Share Posted July 14, 2013 Thanks for the file, that's helped find the issue. The git has been updated and should now be fully compatible with Unity 3.5. Regarding full NGUI compatibility; would you be able to send me a screenshot or log of all the errors you encountered? If we're lucky it might be a simple enough fix once I know what's going on. Let me know if you have any more trouble. Thanks, CptDefault Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 14, 2013 Report Share Posted July 14, 2013 Solved and Updated :) Quote Link to comment Share on other sites More sharing options...
CptDefault Posted July 14, 2013 Report Share Posted July 14, 2013 Thanks for finding that! I've fixed up the version on the repository. To use the full version of NGUI just comment out line 34 in SpriterDataNGUI, which looks like #define NGUI_FREE Hopefully things work from here. As always, let me know if you run into trouble. Thanks, CptDefault Quote Link to comment Share on other sites More sharing options...
kodagames Posted July 14, 2013 Report Share Posted July 14, 2013 Greatly Appreciated CptDefault! Man your fast, good stuff :) Here is a demo using spriter & Ngui, works AWESOME! http://www.kodagames.com/spritertest/SpriterSetup.html Also a quick Video of how to use it with Unity http://vimeo.com/70291907 Quote Link to comment Share on other sites More sharing options...
Thinksquirrel Posted July 16, 2013 Author Report Share Posted July 16, 2013 @CptDefault: Just wanted to say, awesome job for continuing this! I've been pretty busy and hadn't been able to get back into Spriter...glad to see someone be able to take the project and run with it. I've updated the links on the main page to your fork for now - I'll take a look and update the main repository as well. Glad to see the main library cleaned up a bit also. I'm thinking we could reach out to some developers that may be interested in getting Spriter to work with their tools. 2D Toolkit comes to mind - they have a robust editor API that can be taken advantage of. Quote Link to comment Share on other sites More sharing options...
Pfaeff Posted August 30, 2013 Report Share Posted August 30, 2013 Is the 2DToolkit support currently being worked on? What things need to be implemented to make the data API work with tk2d? Quote Link to comment Share on other sites More sharing options...
CptDefault Posted August 30, 2013 Report Share Posted August 30, 2013 2D Toolkit is being worked on. It's by far my favourite toolkit to work with, and I should be able to have a basic version up pretty soon if there's demand for it. Currently I'm working to add auto importing when you update a .scml file, but that's leading to a bit of instability so I'd rather not release that. I'll see if I can get a basic version of 2D Toolkit support (same level as NGUI) up this weekend. Thanks, CptDefault Quote Link to comment Share on other sites More sharing options...
Pfaeff Posted August 30, 2013 Report Share Posted August 30, 2013 That sounds really great. The game I am currently working on (using 2DToolkit) is planned to make heavy use of spriters animation system, so I am very excited to see how that will turn out. Quote Link to comment Share on other sites More sharing options...
Thinksquirrel Posted August 30, 2013 Author Report Share Posted August 30, 2013 2D Toolkit support sounds great :D I'm currently at Unite - Once I get back, I'm interested in implementing support for Unity's new native 2D system in 4.3. Spriter looks like such a good fit for that system, and the other 2D system developers will be working with it as well. Quote Link to comment Share on other sites More sharing options...
Dids Posted September 8, 2013 Report Share Posted September 8, 2013 As a Unity and 2D Toolkit user, I would also be very interested in 2D Toolkit support! Quote Link to comment Share on other sites More sharing options...
Fry_hunter Posted September 8, 2013 Report Share Posted September 8, 2013 Hi! Me and a couple of friends of mine are starting a plattform game in 2D. We are gonna use Unity 3D with Orthello framework. I read in the first page of this topic that someone has imported the animations of Spriter into Unity and works with Orthello. My question is if it's feasible and relatively easy to import this animations into Othello. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
CptDefault Posted September 12, 2013 Report Share Posted September 12, 2013 I don't believe the current version works with Orthello. That said, depending on how good the editor integration for Orthello is, you might be able to get it up and running without too much work. Look at the current implementations for an example of how to integrate it. I'm still hoping to have a 2dTK version up soon-ish. Unfortunately I've got rather a lot of work at the moment, so I haven't had a chance to polish out the bugs. Quote Link to comment Share on other sites More sharing options...
bsowers Posted November 7, 2013 Report Share Posted November 7, 2013 This plugin is coming along really well. It was super simple to test out. I'm noticing definite problems with the art packs just released. For the 'player' in the Basic Platformer Pack, one of the arms seems malformed, and the animations I tested (walk and idle) both do funny things with the other arm. Those are the most major issues I've noticed - hopefully minor fixes, though they're problematic enough to prevent using this plug-in right now. Some other notes: * It's non-ideal to create a bunch of animations and dump them in the root Assets directory regardless of where the Spriter project was placed. It's an organizational headache. Would be much nicer if the animations were placed in a subfolder with the same root as the Spriter project. * A non-NGUI version would be nice. I'm not sold on my UI solution, and the NGUI free version plasters a big watermark over my game, so obviously it can't live side-by-side with whatever I do land on. A version which just uses textured quads would be sufficient. I can probably roll my own variant on that at some point, though. Good job so far! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.