lucid Posted April 30, 2013 Report Share Posted April 30, 2013 if the problem is that the scml has no 'name' property in the 's, then Spriter will automatically name them object_XXX incrementally, then naming the 's after the exported layers would solve that problem and would also greatly reduce load times for larger projects, because verifying each 'object_XXX' name isn't taken takes time. Quote Link to comment Share on other sites More sharing options...
isaacburns Posted May 1, 2013 Report Share Posted May 1, 2013 I've checked in a change that adds unique names for each object. Quote Link to comment Share on other sites More sharing options...
tam Posted May 7, 2013 Report Share Posted May 7, 2013 Thanks, I'll check it out :) Quote Link to comment Share on other sites More sharing options...
blazah99 Posted May 18, 2013 Report Share Posted May 18, 2013 Is their a tutorial out there how to use this? Quote Link to comment Share on other sites More sharing options...
tam Posted May 19, 2013 Report Share Posted May 19, 2013 Can confirm object names now go across from layer name in photoshop to object name in spriter :) blazah99: There's a rough tutorial on page 2 of this thread, or, here's how I've been doing it: Download the tool from here: http://www.github.com/flyover/psd2scml Then get the json stuff from here: http://www.github.com/douglascrockford/JSON-js (You can download zips of each near the top of those pages) Put the json stuff in the json folder of the psd2scml folder. Then in photoshop break your character into layers and name each layer accordingly. (layer groups will result in folders when output) In photoshop go file > scripts > browse and then open psd2scml. Give the tool a few seconds to work. Now look in the folder where your photoshop document is saved and in there will be all your individual images along with a spriter file. Open the spriter file and your character should be all set up the way it was in photoshop. There is also a test.psd in the psd2scml download which you can look at for clarification on layers and bones etc. Quote Link to comment Share on other sites More sharing options...
tombmonkey Posted June 12, 2013 Report Share Posted June 12, 2013 Berry gud work. Quote Link to comment Share on other sites More sharing options...
jack_loverde Posted July 23, 2013 Report Share Posted July 23, 2013 Im using Photoshop CS6, and i have this error: Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop. - The command “Make†is not currently available. Line: 28 -> executeAction( charIDToTypeID('Mk '), desc143, DialogModes.NO ); Quote Link to comment Share on other sites More sharing options...
leissler Posted August 18, 2013 Report Share Posted August 18, 2013 Hey, just tried in in Photoshop CC and it works perfectly! Great work, thanks. A question: Any chance that the resulting bones are not all horizontally aligned but point to the next bone in the hierarchy, so we get a real skeleton? I guess in the script it would mean a 2-pass approach going through the whole tree prior to the generation and building up the hierarchy in memory. Then an arbitrary bone could check if it had children and set its direction to the anchor of the child. This would make it even more killer... All the best Martin Quote Link to comment Share on other sites More sharing options...
leissler Posted August 19, 2013 Report Share Posted August 19, 2013 Thanks for the script, miletbaker. So useful that I went ahead and added a few more features.github.com/flyover/psd2scml This version will not only export each visible layer as a trimmed PNG file, it will export a SCML file with the positions of each object set to the correct position. It will also look for a layer group called "root" and use it to define a bone hierarchy. Objects will automatically be connected to the corresponding bone in the root group with the same name. Or, you can override this by naming the layer "object-name bone(bone-name)". The export will still use the "object-name" for the PNG file name. The circles in each layer of the bone groups defines the center of the bone. I've also included an example Photoshop document in the project. Note that the "item" object is mapped to the "hand_r" bone. Enjoy! Awesome work, dude! I've posted an Issue to Github at https://github.com/flyover/psd2scml/issues/1 Making the angles and lengths of the bones correct would make this even more awesome. Quote Link to comment Share on other sites More sharing options...
isaacburns Posted August 19, 2013 Report Share Posted August 19, 2013 I've added bone rotation. If a bone has one child, it will rotate the bone towards that child. Otherwise, if the bone has a parent, it will rotate the bone away from the parent. This handles all cases except when the root bone has more that one child. In this case, the bone rotation is 0. The bone lengths are tricky; to adjust the length, they need to be scaled. This scale is applied down the hierarchy. Also, the scaling is applied to the objects before rotation. The bone would be scaled to the distance of the child and the objects would be scaled by the inverse. This introduces a lot of math (even more than that of the bone rotations) that could eventually lead to round-off error when tweening. As an alternative to this, I suggest changing the widgets in Spriter, such that the bone (joint) modifier would be a simple pos/rot/scale widget at the origin of the bone. To render the skeleton, you would simple draw a line (or the polygon bone thing) from each bone to it's parent. Perhaps Edgar has some thoughts on this? Quote Link to comment Share on other sites More sharing options...
isaacburns Posted August 19, 2013 Report Share Posted August 19, 2013 I went ahead and added bone length scaling. Quote Link to comment Share on other sites More sharing options...
leissler Posted August 19, 2013 Report Share Posted August 19, 2013 Whoa! You gotta be kidding me O__o You are f.... fast with this kind of stuff ("frickin" that is ;) Who in the world are you? This seemed to have taken you 1-2 hours at the max. Ok, I am impressed :) This version does produce a complete and correct skeleton in the .scml file. However, it does not generate the object folder with the images any more (which worked before today's changes). The test folder contains a test.scml and a test-skeleton.json file. No objects folder and no spine file. I guess its some simple thing you forgot somewhere in the code. I work with Photoshop CC on Mac OSX Mountain Lion. The committed files in the test folder indicate that on your test it did seem to have worked. Quote Link to comment Share on other sites More sharing options...
isaacburns Posted August 20, 2013 Report Share Posted August 20, 2013 My mistake. I had commented out the PNG export for debugging. Fixed with latest. Quote Link to comment Share on other sites More sharing options...
leissler Posted August 20, 2013 Report Share Posted August 20, 2013 Thanks! It works perfectly now. The force flows strong within you, master. Are you a pro game developer? I saw that yesterday it created a spine file, which would load in Spine. As I use Spriter its no issue for me, but maybe for Spine-users it could be interesting to re-activate it? Quote Link to comment Share on other sites More sharing options...
leissler Posted August 20, 2013 Report Share Posted August 20, 2013 Holy Cow! Are you this Isaac Burns: http://en.wikipedia.org/wiki/Budcat_Creations It would sure explain ... :) Quote Link to comment Share on other sites More sharing options...
isaacburns Posted August 29, 2013 Report Share Posted August 29, 2013 Ha! Yeah, that's me. I've added support for attaching a group of layers to a bone. This is the order it looks for a bone. look for "bone_name" from layer name of the format "base_name bone(bone_name)" look for layer name look for "bone_name" from group name of the format "base_name bone(bone_name)" look for group name I've added an example to the project to demonstrate. Alealokato 1 Quote Link to comment Share on other sites More sharing options...
dpyellow Posted July 1, 2014 Report Share Posted July 1, 2014 Any chance this works with Photoshop Elements? I've got Elements 10 (Too cheap for the real thing). Quote Link to comment Share on other sites More sharing options...
fishdavis Posted August 25, 2014 Report Share Posted August 25, 2014 thanks to miletbaker and Isaac Burns for these scripts, they convinced me to buy two licenses of Spriter. Quote Link to comment Share on other sites More sharing options...
conzeit Posted September 10, 2014 Report Share Posted September 10, 2014 ok so as you guys might guess I'm just starting to use spriter and I ran into this awesome sounding script. I have one problem though, photoshop wont run it =( the error is error60: Not well formed (invalid token) Line 461 -> class"p">{ Also, I'm only really using photoshop because it's the best way I know to export layers from illustrator =/ if anyone knows an equivalent of this script for illustrator or can point me to an easier way to export from illustrator I'd be very thankful Quote Link to comment Share on other sites More sharing options...
conzeit Posted September 10, 2014 Report Share Posted September 10, 2014 EDIT: this post used to be about how I couldnt get the script to work, found out it was because my JSON folder was empty. Maybe it'd be useful if it was somewhere clarified that you NEED to do this, maybe in that readme file ? Now, I want to ask two things. 1-my scml is coming out really weird, parts are exploded all over the place...is it because of incorrect positioning of the "bone" image? I have a few overlapping joints unlike the sample image so that could be a factor. 2-does anybody know a way to export vectors straight from illustrator? this would be very helpful for me. thank you guys for such an awesome script Quote Link to comment Share on other sites More sharing options...
isaacburns Posted November 18, 2014 Report Share Posted November 18, 2014 Thanks for the feedback, conzeit. To answer 1; yes, there was a bug where the script that adjusts the direction and length of the bones did not account for concentric bones. I have checked in a fix for this. As for 2; I'm not sure of there is a script to go directly from Illustrator to Spriter; however, there may be something that can rasterize from Illustrator to Photoshop, then you could use this plugin to go from Photoshop to Spriter. Thanks for pointing out the JSON-js dependency. I have been using a Git interface that also grabs the submodules. I have added a note to the readme for those downloading the project as a ZIP file. Quote Link to comment Share on other sites More sharing options...
Guest Dkiearth Posted November 18, 2014 Report Share Posted November 18, 2014 thanks for the script, it's an awesome time saver :D Quote Link to comment Share on other sites More sharing options...
PDM Posted December 3, 2014 Report Share Posted December 3, 2014 Hey everybody, thanks Isaac for this awesome script! I would love to use it but I am not sure if I'm doing something wrong here.. The scml file contains no width and height of the exported images and then in Spriter I don't see anything of course. I ran the script with the PSD sample file without any changes. Here is the content (parts only): <spriter_data scml_version="1.0" generator="psd2scml.jsx" generator_version="pre1.0"> <folder id="0" name="objects"> <file id="0" name="objects/arm_upper_r.png" width="NaN" height="NaN"/> <file id="1" name="objects/hand_r.png" width="NaN" height="NaN"/> <file id="2" name="objects/item.png" width="NaN" height="NaN"/>... <timeline id="1" name="object-arm_lower_l"> <key id="0" spin="0"> <object folder="0" file="15" x="0" y="0" pivot_x="NaN" pivot_y="NaN" angle="0.00" scale_x="1.00" scale_y="1.00"/> </key> </timeline> <timeline id="2" name="object-hand_l"> <key id="0" spin="0"> <object folder="0" file="14" x="0" y="0" pivot_x="NaN" pivot_y="NaN" angle="0.00" scale_x="1.00" scale_y="1.00"/> </key> </timeline> Thanks for any tip to solve this! I am using PC Win7 - Photoshop CS6 64bit with latest updates and I downloaded the newest JSON and script files from GitHub. Quote Link to comment Share on other sites More sharing options...
isaacburns Posted December 4, 2014 Report Share Posted December 4, 2014 I thought this may be caused by an empty layer, but no. An empty layer will report 0 for the file width and height and Infinity for the object pivot_x and pivot_y (a separate bug). I am able to export both examples from a clean clone from github without issue. Perhaps try this or send me an archive of your files so I can step through the script in the debugger. Quote Link to comment Share on other sites More sharing options...
SQA Posted June 27, 2015 Report Share Posted June 27, 2015 Do we have Illustrator Plugin yet. This plugin work well with spine so can we make the spine's illustrator plugin work with Spriter? :) 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.