{"action":"created","issue":{"url":"https://api.github.com/repos/BoatsAreRockable/animator/issues/94","labels_url":"https://api.github.com/repos/BoatsAreRockable/animator/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/BoatsAreRockable/animator/issues/94/comments","events_url":"https://api.github.com/repos/BoatsAreRockable/animator/issues/94/events","html_url":"https://github.com/BoatsAreRockable/animator/pull/94","id":121869469,"number":94,"title":"Automatically create the output folder if needed","user":{"login":"BoatsAreRockable","id":8095888,"avatar_url":"https://avatars.githubusercontent.com/u/8095888?v=3","gravatar_id":"","url":"https://api.github.com/users/BoatsAreRockable","html_url":"https://github.com/BoatsAreRockable","followers_url":"https://api.github.com/users/BoatsAreRockable/followers","following_url":"https://api.github.com/users/BoatsAreRockable/following{/other_user}","gists_url":"https://api.github.com/users/BoatsAreRockable/gists{/gist_id}","starred_url":"https://api.github.com/users/BoatsAreRockable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoatsAreRockable/subscriptions","organizations_url":"https://api.github.com/users/BoatsAreRockable/orgs","repos_url":"https://api.github.com/users/BoatsAreRockable/repos","events_url":"https://api.github.com/users/BoatsAreRockable/events{/privacy}","received_events_url":"https://api.github.com/users/BoatsAreRockable/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-12T18:02:50Z","updated_at":"2015-12-13T16:13:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/BoatsAreRockable/animator/pulls/94","html_url":"https://github.com/BoatsAreRockable/animator/pull/94","diff_url":"https://github.com/BoatsAreRockable/animator/pull/94.diff","patch_url":"https://github.com/BoatsAreRockable/animator/pull/94.patch"},"body":"This fixes #27. If the selected export directory is deleted it will be recreated.\r\n\r\n### Notes\r\n* Currently only works if a single level is removed. ie if the output directory was at `C:/folder/subfolder` and `folder` was removed, `folder/subfolder` would not be recreated. Implementing a fix for this behaviour appears to be rather difficult in Node.js. Advice welcomed!\r\n* The ability to add arguments to the callback has not been added."},"comment":{"url":"https://api.github.com/repos/BoatsAreRockable/animator/issues/comments/164271439","html_url":"https://github.com/BoatsAreRockable/animator/pull/94#issuecomment-164271439","issue_url":"https://api.github.com/repos/BoatsAreRockable/animator/issues/94","id":164271439,"user":{"login":"BoatsAreRockable","id":8095888,"avatar_url":"https://avatars.githubusercontent.com/u/8095888?v=3","gravatar_id":"","url":"https://api.github.com/users/BoatsAreRockable","html_url":"https://github.com/BoatsAreRockable","followers_url":"https://api.github.com/users/BoatsAreRockable/followers","following_url":"https://api.github.com/users/BoatsAreRockable/following{/other_user}","gists_url":"https://api.github.com/users/BoatsAreRockable/gists{/gist_id}","starred_url":"https://api.github.com/users/BoatsAreRockable/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BoatsAreRockable/subscriptions","organizations_url":"https://api.github.com/users/BoatsAreRockable/orgs","repos_url":"https://api.github.com/users/BoatsAreRockable/repos","events_url":"https://api.github.com/users/BoatsAreRockable/events{/privacy}","received_events_url":"https://api.github.com/users/BoatsAreRockable/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T16:13:59Z","updated_at":"2015-12-13T16:13:59Z","body":"I'm working out where to call the function. I'm guessing using it in `takePicture()` every single time a frame is captured quite inefficient. `startup()` is probably the best place to call it at the moment however I see 2 issues with this:\r\n* If the user has intentionally removed / renamed the default frame directory while BA has been closed it would be tedious for them to have to delete it again since it would be recreated upon opening the animator before they had a chance to change it.\r\n* If the output directory is moved mid way through capture an error won't be detected and the remainder of the frames captured won't be exported.\r\n\r\nHowever, I envisage the frame export settings eventually being in a separate preferences window that appears when creating a new project and can be accessed again later via the menu bar. This would mean that the user could change the export directory before the `startup()` function runs, therefore remedying the first the issue I've mentioned.\r\n\r\nIn order to fix the second issue the function should be called again when the program is going to be closed. If an error is detected as well as recreating the directory the captured frames should be exported again. "}}