New** PSD to LUA +PNG exporter (using Director.lua)

If you applied that fix to both functions then could you try to remove the close line using // in both and try that. I will need to install cs5 on mac tonight. I appreciate the tests. I did say early days :slight_smile: [import]uid: 33265 topic_id: 8337 reply_id: 30032[/import]

Okay installing CS5 on a Macbook now and will see if I can spot the issue. Wish me luckā€¦

UPDATE : So CS5 hates close AND back the way I did itā€¦ the hunt continues [import]uid: 33265 topic_id: 8337 reply_id: 30041[/import]

Fixed,

I have had to change the way the script works right now. Its a 90% fix 10% workaround.

https://github.com/KevCJones/Photoshop-to-Corona-Exporter

Before the process to export a merged folder was to :

  1. merge
  2. select all + copy
  3. new doc
  4. paste
  5. save png
  6. close (CS5 hates)
    7 undo merge (CS5 hates)

BUT CS5 didnā€™t like close OR undo. Removing them, means your PSD remains beaten and there is a ton of untitled windows in PS. SO I have added a clean up function at the end which closes ALL open docs. Not perfect but managable if you know its going to happen.

Later I will add some tests to close all NEW documents which weā€™re created since the export. For now though, could you test your end and tell me if it works. I did the export and ran in the simulator and it works well. I fear now, I need to test on windows again and CS4 and CS3. Although this method is a little simpler and more brutish so in Photoshop coding sense its probably safer :stuck_out_tongue:

Test List open for anyone to assist:

CS5 Mac - PASSED EXPORT - PASSED SIMULATOR - ??? HARDWARE
CS4 Mac - ??
CS3 Mac - ??

CS5 Win -??
CS4 Win - ??
CS3 Win - ??
[import]uid: 33265 topic_id: 8337 reply_id: 30065[/import]

Thanks Franciso, being newer to Corona i hadnā€™t grasped the difference between the newImage and newImageRect. i changed the exported to use the latter now so Retina display support is feasible.

I actually was thinking if there is a way I could build in an auto saving of the @x2 pngs as a feature of the the Exporter.

Thats me for the night now until the next bug (watch it be windows now), appreciation to the testers for today. [import]uid: 33265 topic_id: 8337 reply_id: 30073[/import]

Iā€™ll retry again in the morning :slight_smile: nearly midnight and need some sleep :slight_smile: [import]uid: 33866 topic_id: 8337 reply_id: 30075[/import]

Just trawlin through forums and saw http://developer.anscamobile.com/forum/2011/03/12/crashes-entering-game-menu-htc-desire-hd-works-perfect-android-simulator . If this occurs for now replace images folder string in script with empty ā€œā€ to export local images to LUA. [import]uid: 33265 topic_id: 8337 reply_id: 30114[/import]

SO testing updates showed me my changes to the script broke the windows export SO now iā€™m going to create two scripts for the moment Win and Mac and maintain them until I find an elegent way to split operations inside like if(WIN)//do win solution etcā€¦ will upload the two scripts now hopefullyā€¦ if GIT lets meā€¦ (the git)

New Scripts : https://github.com/KevCJones/Photoshop-to-Corona-Exporter/tree/master/src

Just test for you platformā€¦

Exported Using | PASS or FAIL

Win CS5 | PASS
Win CS4 | PASS
Mac CS5 | PASS

That being said, I have concerns that long directory names and also system ability to keep up with the large number of operations might be causing crashes so I might do a staged exporting with more alerts to let Photoshop catch its breath. [import]uid: 33265 topic_id: 8337 reply_id: 30178[/import]

Merged back into one scriptā€¦sorry if anyone downloaded the intermediate scriptsā€¦ donā€™t suppose anyone here has tested either the MAC script or this one on there machines? [import]uid: 33265 topic_id: 8337 reply_id: 30210[/import]

Just tried the script on Mac CS5, it crashes Photoshop, I can send you a copy of the error display, plus it launches the script editor when it runs. [import]uid: 7664 topic_id: 8337 reply_id: 30228[/import]

him at kevincjones dot co dot uk - the weird part is iā€™ve ran it on my MAC OSX with CS5 so its a spot the difference.

Spot the difference time.

I wonder if its directory length (too long maybe PS doesnā€™t like) for a controlled test could you try to run the PSD in a shallow folder called test on the desktop.

Another thought is that it perhaps the Mac OS version? Iā€™m running Snow Leopard on a mac book mini? You?

Not sure what it is that makes it run the script editor but thats not a bad thing. When you run the script it outputs trace messages in the console. I will need to put some more error logging in me thinksā€¦

[import]uid: 33265 topic_id: 8337 reply_id: 30229[/import]

First let me say, I am so glad you are making this tool. I have tried running it from the root folder, the user folder, and the desktop. I am running a 27inch iMac, Snow Leopard, I have another machine I will try it on to make sure there is not an Adobe configuration issue with this machine. I am using the test.psd file from the latest github package

here is the info from the console, where it stops
Starting the export using version 0.0.38
SCENE - scene1
MERGEDGROUP :scene1->backgroundimg.png
Saving Merged Layer
ArtLayer
[import]uid: 7664 topic_id: 8337 reply_id: 30232[/import]

Thanks for the supportā€¦ Photoshop is a weird pedantic child that spits its dummy out a lot it seems :slight_smile: but we will get there in the end.

Iā€™m going to upload a new script in 5 minutes with a few additions.
try catch block on the main script to see if we can catch it before a full on meltdown.

and a variable or two to turn on/off stages of the process to pinpoint the line it hates.

Your system seems far more specā€™d than mine. So not too slow, too fast? :stuck_out_tongue: 5 mins. [import]uid: 33265 topic_id: 8337 reply_id: 30235[/import]

New script it upā€¦ now i hope the try catch error will stop it from crashing but since I canā€™t recreate the error at the moment I canā€™t tell.

The output console should offer up a version and OS as the first line. Iā€™d like to know what yours says, my OS split might be broke if e.g. yours says Windowsā€¦ =/

If it fails try again but with

var renderImages = false; // turns off image rendering  

If this gets you a code run through then I think its time for me to rewrite these auto outputs from the ActionListener Adobe push outā€¦

If you get one run through without images it will at least be one step towards it. [import]uid: 33265 topic_id: 8337 reply_id: 30237[/import]

I have recreated on windows :o with this new try catch its giving me better readoutsā€¦ I am going to create a branched version to test withā€¦ when I have a new simpler export version working I will go and try it on the mac too. If CS5 mac and CS3 Windows work I will shareā€¦

PS Im also looking at creating a UI panel for this too in the future. Add cool export goodness with progress bars (gasp)ā€¦ [import]uid: 33265 topic_id: 8337 reply_id: 30238[/import]

https://github.com/KevCJones/Photoshop-to-Corona-Exporter/tree/master/src

Please try the CoronaDirectorExporter_newMerge.jsx

Iā€™ve tried two things.

  1. I saw that the export selected layer by name BUT if we had another layer of the same name it would skip to it, this would then fry it in the event that it was a group not a layerā€¦ fixed by creating a temp name per layer while exporting and returning it to normal afterwards.

  2. I now merge via a different JSX call and call the same save function. Less code and works just the same.

Iā€™m not going to say @.@ its fixed - againā€¦ but it did work on my WIN CS3 and MAC CS5 now.

I will jump for joy if someone manages to get an export. Nothing yet though makes me understand why my machine loves it and others still get hate from itā€¦ if this works I will merge remove the old one and rename this temp testing version. [import]uid: 33265 topic_id: 8337 reply_id: 30248[/import]

Hello!
I just tried on an iMac with Snow Leopard with CS5 and it crashes. This are the messages at the consola:
Starting the export using version 0.0.39
Windows
Create foldersā€¦
SCENE - scene1
MERGEDGROUP :scene1->backgroundimg.png
temp layer name is 1301588153272
Saving Merged Layer

But runs fine on windows 7 with CS5

Thanks a lot for your job! [import]uid: 44013 topic_id: 8337 reply_id: 30314[/import]

Woohoo at least Windows worksā€¦ did I mention Iā€™m not actually a lover of macs :wink: despite the name.

Spot the difference again, from logs its still something in png save so will add more traces to each step.

Mines an Intel Mac donā€™t suppose thats the difference ? Or that I think I use.extended PS versions on all?

If I have time tonight another build attempt to fixā€¦ Iā€™m busy from then till Sunday. If your Windows users, take this version and test it on Android devices for me. :wink: [import]uid: 33265 topic_id: 8337 reply_id: 30325[/import]

So not much of an update for Mac users iā€™m afraid. I have added more traces in an effort to spot your own offending code.

https://github.com/KevCJones/Photoshop-to-Corona-Exporter/blob/master/src/CoronaDirectorExporter_newMerge.jsx

It still works on this machine which is running Photoshop v12.0 Extended running on
Model Name : MacBook
Model Identifier: MacBook4,1
Processor Name: Intel Core 2 Duo
Processor Speed: 2.4 GHz

Mac OSX 10.6.6 Build 10J567

I did have one crash randomly and I ran the script again by mistake straight away and it worked from there on outā€¦ donā€™t know why. Will run on a couple of Macā€™s at work and see if any others have varying resultsā€¦ with luck one willā€¦ [import]uid: 33265 topic_id: 8337 reply_id: 30348[/import]

Updated again - last try until Sundayā€¦

https://github.com/KevCJones/Photoshop-to-Corona-Exporter/blob/master/src/CoronaDirectorExporter_newMerge.jsx

Iā€™ve removed a lot of code from the auto generator (scriptListener) for PS. Now only use about 3 bits from it.

I will test still tomorrow at work and see if I did itā€¦ [import]uid: 33265 topic_id: 8337 reply_id: 30371[/import]

Did anyone get a chance to test this on their Mac OSX CS? Still getting successful exports fo myself but would like to try and fix it for anyone whose having trouble.

Cheers [import]uid: 33265 topic_id: 8337 reply_id: 30658[/import]