coa_tools icon indicating copy to clipboard operation
coa_tools copied to clipboard

Error importing json spritesheet

Open Hammers69 opened this issue 6 years ago • 4 comments

I'm on Mac, 2.79, latest Ps and Blender plugins.

I seem to be unable to load json sprites. I can create new Sprite Object, but then when I click re/Import sprites, I select my .json and get the below error. I can manually import images, but not with correct placement sizing etc.

screen shot 2018-04-30 at 10 59 17 pm

Hammers69 avatar Apr 30 '18 13:04 Hammers69

I tried the example file and had a look to see what was different. My Ps exported is creating html files with the images in a subfolder. If I move the images up to the parent 'sprites' folder, it seems to work. Strange? I have the latest exporter and plugin from here.

Hammers69 avatar May 04 '18 05:05 Hammers69

Hi, hmm.. this is strange. Is it possible for you to share a psd file and the sprites with json file that got exported so I can take a closer look?

Which OS do you use? Usually the exported sprites should be always located in the sprites directory.

ndee85 avatar May 04 '18 06:05 ndee85

Hi Andreas, I'm using CS6 on Mac OS 10.12.6 I guess it's something going on with Photoshop. It's definitely exporting html as well and nesting the images below that. Very odd. I'm attaching my .psd and the files I got on export. Like I say, as long as I move the images up, all seems OK (except spritesheets, which I couldn't exactly get working, but happy to use slots). Thanks for looking, and the amazing tool! AndreasTest.zip

Hammers69 avatar May 04 '18 10:05 Hammers69

Ok I may have found the problem, and I think it is an old bug in Photoshop (though it may still exist in CC, don't know).

It seems to relate to 'save for web'. I have used that in the past, and had it set to save html and images. It seems that somehow your script is picking up that setting I guess. I went in and did a SFW save, switching to 'images only'. Then did another Blender export and it behaved as expected with the images directly in the 'sprites' folder.

Not sure if this is something that's even fixable in the script, or whether it's just a Ps oddity. Either way, at least we've found a workaround if it crops up.

Hammers69 avatar May 04 '18 10:05 Hammers69