Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filesystem Access #447

Open
cale-bradbury opened this issue Sep 28, 2024 · 4 comments
Open

Filesystem Access #447

cale-bradbury opened this issue Sep 28, 2024 · 4 comments

Comments

@cale-bradbury
Copy link
Contributor

While I think it's good that the new Hedron will force web safety, it could be nice to have some filesystem access, even if it's an optional object that is only available when on desktop.

Use case I am thinking of is writing back out files that the sketch uses. For instance a splat map/point cloud sketch that can crop the map visually in the scene, but then also save the file back out in it's cropped form via a shot. The shot would just return early when fs (or a custom object) is undefined, or maybe use the event system if (hedron.eventEnabled('write')) hedron.sendEvent('write', filename, this.getCroped())

@funwithtriangles
Copy link
Member

If it's just about saving files, maybe we can just do this with the web File System API? The user clicks and it prompts them to save it somewhere.

https://developer.mozilla.org/en-US/docs/Web/API/File_System_API

@cale-bradbury
Copy link
Contributor Author

Could do, although the ease of being able to save in-place might be nice, there might also be other use-cases for other system calls, though I don't personally have any in mind atm

@cale-bradbury
Copy link
Contributor Author

Immedeatly after writing this I remembered that I have a wip sketch on old hedron that reads the history file that virtualdj generates to add the track id to the screen/detect track changes, that would require being able to target a specific file on disk, and poll it in the background

@funwithtriangles
Copy link
Member

Man I gotta hear more about all the crazy things you're doing with Hedron! 😅

Ok well then it sounds like we need to use the main thread and expose some kind of api to sketches to tell it to read/write, as you've suggested. My initial thought was passing down some api object to the contructor, but maybe some event system is better. Haven't really thought about it too much yet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants