tahoma2d / tahoma2d

2D and Stop Motion Animation Software
https://tahoma2d.org
Other
340 stars 59 forks source link

Append Sequence or Timestamp To Render Output Filename #827

Open TomDoingArt opened 2 years ago

TomDoingArt commented 2 years ago

Issue

When I output a render I want to be able to create a new versioned file not overwrite the prior file. To do this currently I have to keep manually updating the filename.

I want the ability to automatically append a sequence number or timestamp to the filename.

Proposed Solution

There are two places I can see this feature appearing in the menu.

Output Settings > Options > File Settings popup

AppendToFilename_OptionsPopup

File Settings is specific to file type, so the option can be ticked/unticked per file type (I assume).

Output Settings

AppendToFilename_OutputSettings

Since Output Settings is not specific to file type, the option selected will apply for all file types.

The two types of information which can be appended to the filename, Timestamp and (render) Sequence:

Timestamp Append the UTC timecode to the filename, separated by a '.'. ISO 8601 timecode wikipedia

Example: filename.20211022T093410Z.gif filename.20211022T095021Z.gif

On a file type that renders as a sequence, a single timecode value at the render level and sequence numbers at the frame level: filename.20211022T093410Z.0001.png filename.20211022T093410Z.0002.png a later render... filename.20211022T095021Z.0001.png filename.20211022T095021Z.0002.png

(Render) Sequence Append the next value in a four digit sequence. The sequence number is separated from the filename by a '.'.

Example: filename.0001.gif filename.0002.gif

On a file type that renders as a sequence, a sequence value at the render level, and sequence numbers at the frame level: Example, the first render: filename.0001.0001.png filename.0001.0002.png the next run of render... filename.0002.0001.png filename.0002.0002.png

The options are mutually exclusive. Checking one will uncheck the other. I did not see any radio buttons being used in Tahoma2D...so I used checkboxes in these screen mockups.

RodneyBaker commented 2 years ago

I really like this idea on a number of levels. Perhaps mostly because when I'm sketching the sketches are not strictly speaking sequential images but rather individual images that just happen to be sequence-able via sorting by filename alphabetically etc. I often locate recent files just by opening Windows Explorer and sorting on Last Modified.

At any rate, a date/time stamp option in the filename itself would be very useful for sketching sessions.

Added: This would be especially useful if where the option would allow that filename that will get the timestamp to populate the Save All filename field as then the user would only need to press Enter to acknowledge the automatically generated filename.

TomDoingArt commented 2 years ago

The first time File > Save All is requested in a new project, there is a prompt for the file name to save the scene file. Is this the scenario you are thinking of? You create a new scene, and started sketching something. This will auto-create a Level, called A, and expose it in a column called Col1. You press Ctrl-S or click the menu File > Save All. A Save Scene dialog pops up prompting for a file name for the scene file. Is it the filename for the scene that you are hoping to see prefill with a timestamp value?

My goal on this feature request is only to add this auto-versioning feature to the Render/Output process flow. Output files have no connection to other files, unlike the Tahoma2D proprietary files (scenes, levels, etc.) which have links to them which must be updated.

If your sketching workflow is to sketch, and then Render each sketch, this feature request will support what you need. On your first render for this new scene, the filename field will be populated with the scene name as the default filename. You will tick the sequence or timestamp option and it will remain active for the current render and subsequent renders for this scene.

If you do a few sketches, each as a new drawing which is exposed in its own frame, you can render to a format which already supports sequence numbers. A file type of .png for example.

The goal of this feature request is to have file sequences across render requests, for the file types like .gif and .mp4 which do not already produce sequenced files.

One last thought that occurred to me while typing this. A generated name like: filename.timestamp.sequence.png could be done for those formats which are already produced as a sequence (.png, .jpg, .tif, etc.). This is useful when you want to have multiple file sequences, across render sessions. By that I mean, when .png is the chosen format, and a render is done, the current sequence will overwrite a prior set of files. Adding timestamp, per run, will allow for filenames like: myfile.timestamp1.0001.png, ...0002.png and on a subsequent run myfile.timestamp2.0001.png, ...0002.png to be saved to the folder. Multiple distinct runs of files that are in sequence. The timestamp value will be determined once for the current render session so that each output file in the series has the same filename.timestamp values and the sequence values increment per file as it is done today. Actually, this same sequencing across renders could be done with a render level sequence value too. filename.rendersequence1.0001.png, filename.rendersequence2.0001.png. So...file sequences can also use the timestamp and (render level) sequence values.

RodneyBaker commented 2 years ago

Yes @TomDoingArt that is the place where the initial filename is set (currently manually) which interupts the flow of drawing, autosave and any other process relying on a saved scene that has not yet been saved with a filename.

As I see it, thereafter the sketching process would recieve the date/time stamp updates. Unless of course it automatically starts that process with that first Save All dialogue.

Regarding the rendering aspect... Output Settings automatically inherits the scene name and that gets populated into the filename field. If the Scene is autopopulated with a name or date/timestamp then it would automatically inherit that even now.

I can of course see where users would usually not want their scenes to be date and time stamped and therefore that early supplying of a scene name should be optional.

In looking at your own rendering option proposal I don't see any issues there but really should look at it more deeply as my brain keeps shooting back to the Scene name as the source of extra keystrokes and unnecessary typing.

I do think most programs and standards try to avoid multiple dots/periods in a filename and even/often discourage the use of more than one... which is what we have as standard with Opentoonz. If I run across that reference I'll post it to this FR.

TomDoingArt commented 2 years ago

At that point in the application, the Scene file is being saved with that filename. The Level file which contains the drawings is saved under whichever name was chosen when the level was created. Default value: a series starting with A, then B, etc.

This feature request is all about the filename of the Render files. They are output files, not managed by Tahoma2D other than appearing in the output folder. Tahoma2D doesn't have to keep references to them in other files.

As I understand it, your sketches are drawings within a Level. Maybe you will use them as reference for subsequent drawing in another Level.

If you follow this workflow for your sketches, then you are in scope for this feature request: Draw something, Render to file. Draw further, Render to file. Those instances of running render, those are are the timestamp or render sequence events I am trying to capture in the filenames. So, when looking at the files later there will be a set of files for each time render was run. This make it possible to see progress over time, before/after comparison, stuff like that.

To continue to work those files...it will require a raster editor, or clean-up process to be run. They are raster files, same as any files brought in from another application. They are output from Tahoma2D point of view...no longer WIP files, not Level files.

RodneyBaker commented 2 years ago

As you indicate, the problem I outline is upstream of what you are after here. I just add it to this discussion as a consideration of how that scene name set (or not set) gets propogated into Output Settings, or at least can.

TomDoingArt commented 2 years ago

I do think most programs and standards try to avoid multiple dots/periods in a filename and even/often discourage the use of more than one... which is what we have as standard with Opentoonz. If I run across that reference I'll post it to this FR.

That will be good to know, what the standard/best practice is on filename format. My intention was to keep the parts of the filename separate for visual clarity and to simplify parsing if that becomes necessary.

TomDoingArt commented 2 years ago

As you indicate, the problem I outline is upstream of what you are after here. I just add it to this discussion as a consideration of how that scene name set (or not set) gets propogated into Output Settings, or at least can.

So...let us consider that. Multiple Scene files, like Scene1.timestamp1.tnz, Scene1.timestamp2.tnz, etc. in one project folder. They still refer to one set of resources in that folder structure, the Level files. Default level names are A.tlv, then B.tlv, no versioning in their names. That relationship between files is what I see as the complication if this feature request morphs into an active versioning solution. You will have to version the full Scene. Imagine multiple versions of all these files in one folder structure. So maybe you think to version the full Project, similar to that tool Darren T developed. That is why I am focused here on output files only. The files that are snapshots, point in time, no longer "active" files in the Tahoma2D space.

RodneyBaker commented 2 years ago

If versioning is the goal then I find myself wondering if there might be a better/alternative approach. I do not know off hand what that might be although I do have related thoughts to versioning for sure. Most of those would not have much to do with actual filenaming as in versioning available/visible file and filename tends to remain the same. The idea of most modern version approaches being to store only the changes.

I think here I should reiterate that I don't see any issues with your proposal. Being able to add a timestamp to a rendered image would be great. :)

TomDoingArt commented 2 years ago

Yes, the goal of this feature request is to have simple versioning of output files by a file naming convention, adding a timestamp or sequence number. The issue this solves is: not overwriting previously rendered files so that before/after comparison can be done using image viewing tools, compositing software, stuff like that.