-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
When rendering with option --save_section the rendered file names are appended with 0001, 0002, 0003 instead of the "name" attribute. #3471
Comments
Not sure I agree. The name could perhaps appear somewhere in the filename, but replacing the numbering completely leads to unsorted files in the file explorer. |
That could be an idea!
when you render all of them you would have them unsorted, no? :) |
Because if you read them back from disk it becomes a problem of sorting the files by name |
This sounds more like a developer issue than a user issue. |
I would like to take on this issue |
It is still a user issue because if you drag the section files (with no numbering) into a video editor then they will appear sorted by name, because lexically sorting files is a standard in many software projects. So by removing the numbers, you force the user to add the files one by one and sort them manually in a video editor, which is way more work than it needs to be. Summary: It is indeed a user problem, that's why we have the numbers! |
True that they are sorted by name in video software but this is in-fact very desirable. I can make an example. Say that you are making a video to explain complex numbers. To re-use good chunk of the code you decide to use sections into a "cartesian_representation" Then, at some point, you think it is a good idea and you add another section "definition_of_i" Then, after a while, you think that is good to write a section where you show some identities and an introduction, but at the same time you don't want to refactor the previous part because it may easily become a nightmare and also the previous section are good to go as they are. Furthermore, you don't want to create another class because you can easily re-use what has been done in the previous sections. This is not an unusual scenario I can promise you. You add a couple of sections: "introduction" At the end, when you render you would have the files names as: ComplexNumbers_cartesian_representation.mov When I import these files into my video editor I will have exactly the same names. In my opinion this is very handy and clear and the post-production work would go like a breeze. ComplexNumbers_001.mov which does not have the same clarity. I should remember who is who, or I have to inspect them one-by-one to find the clip I need. Hence, I wouldn't say that the current implementation is to solve a user problem. When working in post-production is way better having the names of the clips rather than just having numbers. Adding both names and numbers could be somewhat confusing - but still way better than having just numbers and still acceptable: ComplexNumbers_cartesian_representation_001.mov To be the devil's advocate, one here could wonder: what shall be the first clip to add in the storyline? ComplexNumbers_introduction_005.mov or ComplexNumbers_cartesian_representation_001.mov? One could just ignore the appended numbers, but then why adding them in first place? |
We could just do both, As section names do not need to be valid identifiers, users will have to avoid naming their sections in a way that results in illegal characters in file names. |
…or do something like this perhaps? |
There are misunderstandings in mainly 2 topics, which must be clarified for this discussion to advance:
1. The differences between a scene and a section
Apples and oranges:
In short:
Therefore, they can't be really compared in this sense (false equivalence). While it is OK to have unsorted scenes (because they can function as standalone projects), we cannot really say the same about sections in the same scene. For the layout you described:
those sections could've been their own scenes instead, defined in a # complex_number.py
class CartesianRepresentation(Scene):
# ...
class PolarRepresentation(Scene):
# ... leading to a layout like this instead:
Because, otherwise, making a huge scene called For reusing code between scenes, it's better to define custom classes or functions for the things we need to reuse: new Mobjects which consist of the same elements, or functions which perform the same sequence of actions. In that last case, maybe even subclassing Scene, defining a custom method, and make other scenes subclass it. As for sections, some options for the
Of course, doing that with every scene leads up to a huge amount of videos in your folder, and finding a specific video will get a bit harder. But the good thing is: they're sequentially ordered, they have numbers in their filenames to help identify them because of the logical, temporal order in which they were shown on scene. 2. The ideas we've been discussingThere have been 4 ideas discussed here. I'll label them as [A], [B], [C], [D]:
So, recapping:
For the same example, it would be good to have this, which fits [C]:
But why not both ([C])?.
[B] is an issue for everyone and everything that wants to work with sections in any more complex manner. Suppose that I want to develop a specific software which takes a scene as input and displays its animation timeline, and when I edit the scene code only the changed part is rerendered, letting me see my changes instantly and how they fit with the rest. Eventually I would need to support sections. For that, it would be helpful if they were already chronologically ordered. Removing the numbers breaks that purpose and would make it more difficult for me to find the order of the sections. I would need to find a way to map a section to its correct position in the section order. The thing is, the file numbering already does that.
That's a straw man fallacy: MrDiver never said that "the current implementation is to solve an user problem". Instead, he argued that removing the numbers creates another problem.
The issue is, no one has argued in favor of this idea which I labelled as [D] (everything points to [C] instead). The argument is whether to keep or not the sorting by number. [D] does not help: if the number is after the name, it doesn't affect the file order and it becomes useless for those purposes. IMO, [D] is possibly the worst of all 4 ideas. On the other hand, [C] does keep the sorting by number, which is nice for sections, while being readable at the same time: they are chronologically sorted, but also the number part is only 4 digits long, so the users can immediately read the name of the section, be reminded of what the section was about, and still understand that it was supposed to be in that specific position. That's why I think that idea [C] is the best one.
They should have been scenes instead of sections: |
Let's just leave it at we will have both the number and the section name in a format that was already commented in the PR. |
I am not sure if this shall be categorized as a bug, so let me know if I have to move it elsewhere.
As per title, when rendering with option
--save_section
the rendered file names are appended with 0001, 0002, 0003 instead of the "name" attribute.for example, say that iI have something like the following:
and then I render with
--save-sections
option‚ then the rendered files have names:whereas it would be nicer if they inherit the section name, e.g.
The text was updated successfully, but these errors were encountered: