Copy link to clipboard
Copied
I decided to upgrade my extension with real time asset exporting, with the help of generator-core.
I have installed, configured everyting and dowloaded the:
The generator-getting-started-master is crashing when I try to CTRL+T (transfrom) a layer with the following message: Error trace: TypeError: Cannot read property 'id' of null at Generator.handleToolChanged... If I comment the Tool handling out it is working fine.
But I have one Question: Why the "imageChanged" event is firing only once when I nudge a layer with the Move tool? It dispatching only at the first cursor key press.
Or two:
Is there a dedicated forum about generator?
Thanks a lot!
I recommend to start with printing all event data to console and see what you're getting in different scenarios. For example imageChanged can have a multitude of different shapes from file save to reordering to content changes. On element move it should fire on "every nudge" (I checked my code), you might have some other issue.
There is also a Google Groups forum which I've used mainly for bug reporting.
Copy link to clipboard
Copied
I recommend to start with printing all event data to console and see what you're getting in different scenarios. For example imageChanged can have a multitude of different shapes from file save to reordering to content changes. On element move it should fire on "every nudge" (I checked my code), you might have some other issue.
There is also a Google Groups forum which I've used mainly for bug reporting.
Copy link to clipboard
Copied
Hi Matias,
Thanks for the Google group address!
Do you have any idea what can be an other issue? I have no clue. I am trying to fix this behaviour since hours without success. As I remember the imageChanged event worked fine at first. I was able to print out the strigified document with changing bounds at every cursor keypress.
I have tried to install the whole stuff on an other machine. Reinstall the latest nodeJS, redownload the latest generator-core. No success, the event only coming at the first time. I have no clue....
I will ask my friend to check out this problem, because I think its a mysterious virus in my gigabit switch
Copy link to clipboard
Copied
Does it happen also if you drag with a mouse or do individual nudges (i.e. not holding down the arrow key)? Holding the key down is potentially one of those things you have to consider a bit: how do you handle it if events stack up or come late. I.e. one issue could be (if you process & write files) that you're not ready with previous event when the next arrives and something wonky happens. I've resulted in building an action queue, i.e. I process events and queue the actions (checking if I have same kind of action already stacked up so I don't do same thing several times) and let that process a bit late.
Copy link to clipboard
Copied
OMG i got it! The event coming through multiple times only if the moved layer have a .png,.jpg or .gif extension in it's name. It took approximately 4 hours for me to accidentally realize this. My fault, next time i'll study the whole generator-core source first, before asking something.
Copy link to clipboard
Copied
That sounds really weird... So "generator" is actually several things:
What you describe sounds like the Assets-plugin, it's feature is that you can name a layer like "foo.png" to get it automatically exported. And your plugin should have nothing to do with it (except maybe the example you started with starts from that?).
Copy link to clipboard
Copied
What I use is the getting started tutorial:
without the Image Asset Generation Plug-in for Generator:
https://github.com/adobe-photoshop/generator-assets
This asset generator isn't running. Just the vanilla generator-core-master with only one plugin which is the generator-getting-started.
In this scenario, if I move a layer without a "valid" extension in it's name, the imageChanged event dispatching only the first time. Until I select another layer, or do something else. While the movements of layers with an asset extension in their names, dispatching the imageChanged event multiple times.
I would like to export an .html beside the image assets ( on the fly ), which requires the non-asset layers position.