3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
349 stars 30 forks source link

copy used textures to render output directory #125

Closed claudeha closed 4 years ago

claudeha commented 4 years ago

Is your feature request related to a problem? Please describe. Sometimes I misplaced the textures I used to render a frag and have trouble recreating the image(s).

Describe the solution you'd like Textures could be copied with the fragment source perhaps.

Describe alternatives you've considered Be more organized and copy textures by hand.

Additional context All required .frag sources are copied, why not required textures too?

3Dickulus commented 4 years ago

yup, that's another one that's been on the back burner for a while (years?) should be really simple, in the part that makes a list of files to copy just add the texture files too.

Just to be pedantic...

Current Status: edit: searches ./(where the frag lives) + Examples/ + Examples/Include/ a. uses full path to file or checks local then global when no path is specified. b. all required textures for the distributed frag collection are in Examples/Include folder. c. texture files are not saved with fragment sources

When textures are in the Examples/Include folder they are added to a pull-down menu for selection in samplerWidgets so they are globally available to all frags and samplerWidgets.

Propose: Default = current behaviour, do not copy Prefs Options a. never copy b. always copy c. ? copy only if local ? d. or ???

3Dickulus commented 4 years ago

hmmm... just looking at this... how to handle textures with full path names? copying texture files to frag folder will break the frag unless all references in the samplerUniform decls and settings are altered to reflect the new location in frag folder, altering the references to be filename only would suffice. This would remove the "burden"??? to stay organized and would generate copies of the same files all over the place every time "autosave fragments" is used.

This might present better as a "prepare frag for redistribution" feature so that when you want to explicitly share a fragment all of the resources are localized to the frag folder.

3Dickulus commented 4 years ago

option "Save texture files" added to output dialog applied in commit 4832e7d5d8452eb19be9df3db4bcb5fddf96e4f9

when this option is enabled the final fragment source is scanned for texture filenames and they are converted to local refs (filename only no path) before the fragment is saved and the texture files are copied to the fragment folder.

simple to add "always save textures" option if needed but this option has the potential to create many needless copies of the same file, so, it's always off when the render dialog opens, this is fine during development of a frag when you have all of the files locally and is intended to facilitate easier distribution when a user wants to release their creation.