-
Notifications
You must be signed in to change notification settings - Fork 566
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
Blender integration improvements #3749
Conversation
- Rename 'animation_speed' to 'length_multiplier' everywhere - Use length_multiplier in computing progress slider min/max - Update slider label whenever value changes (using computed length)
- Add utility functions to avoid repeating common operations - Use shorter names, and assign oft-repeated attribute chains to alias names - Remove some redundant/ineffectual code - Fix dissolve.py compatibility with Blender 2.90+ by removing deprecated apply_as named arg from modifier_apply() call
I think I need to add one more progress bar state, "Initializing", for when it's starting a new render. Currently the progress bar is re-enabled showing "Saving", for however long it takes to get the first "Generating" log line — which can be a second or more on some of the particle-physics scenes. (Edit: Done.) |
- Each preview / animation render task will launch in its own thread, which shuts down immediately on completion so that the next one gets its own, fresh thread.
With the commit I just added, I was also able to achieve what FEELS to me like a noticeable (not large, but detectable) improvement in Blender's rendering speed, by re-working the background processing so that each Blender job runs in its own dedicated, short-lived thread. Now, no threads are launched until Blender needs to be run, at which point a thread is spawned that shuts down immediately on completion. Someone will need to double-check me on that, it's possible I'm imagining it — but it seems to me like it's more responsive that way. |
(If nothing else, the thread impermanence makes it much less likely a Blender thread will be the source of any crashes at application exit.) |
ae73939
to
23ce9c8
Compare
I'm going to merge this, as it contains fixes for the issues multiple users have been experiencing with the most recent Blender versions (both 2.83 and 2.90). Hopefully it doesn't cause any new issues, but if it does we'll deal with them. |
This is a resurrection of my PR #3357, which had to be closed due to unresolvable merge conflicts. It makes the same improvements to the Animated Titles UI and processing as that PR, plus additional enhancements.
Fixes #3744, fixes #3740, fixes #3730, fixes #3389
As in the previous PR:
Computing animation length (fixes Animated Title: "Dissolving Text" is not working properly when Animation Length != default #3356)
animation_speed
parameter is renamed tolength_multiplier
throughout, as the former name seems almost intentionally confusing.length_multiplier
is used to compute the progress slider end value and labeling (frame #/#) everywhere, to properly account for adjusted lengthsRender selection is now done from the command line
The blender
.py
files no longer trigger the actual rendering process. Instead, they merely set up the scene, and then stop. In addition, they don't limit the frame range for previewing. Blender wil be executed with a-a
argument (or-f frame#
in preview mode) to render all or one of the configured frames.This is primarily a debugging convenience, as it means that Blender can now be launched with one of the Python scripts applied. This allows us to examine the scene in its final configuration immediately before rendering.
For example, this command loads
dissolve.blend
into the Blender GUI, with all of thedissolve.py
parameters applied:These commands render from a configured scene (since
start_frame
andend_frame
are no longer set to the same frame, this even works from a preview script):In addition:
Blender is launched with the
--factory-defaults
argument, preventing it from reading the user's preferences file. Significantly, if the user has customized the language used by Blender, this will ensure that our runs create and output all data in English. This allows us to parse the output successfully, and prevents customization of default object names from interfering with our code that makes assumptions about objects being labeled in their default English names.The previous change is also leveraged to enhance our parsing of the Blender output and display inter-frame progress updates. Now, instead of using only the frame slider as its progress display, whenever Blender is rendering a frame (preview or final), a progress bar and label will be displayed at the bottom of the window next to the dialog buttons.
This label will progress through three steps:
The "Rendering" lines will also update the progress bar to reflect the N / M chunks completion status.
This should make the rendering process a bit more informative, especially with some of the particle physics scenes where things can get really busy, at which point each frame takes foreeeeeever to render.
My fixes for the particle physics Blends are also included. (Including an update to Dissolve that disables
show_dead
, an option that was causing the model to reset itself after the lifetime of the particles expired.I also reworked the version check so that it's now its own function, and tweaked the regular expression used to detect the version since Blender 2.83 changed the
-v
output format again, and our previous expression wasn't matching.Oh, yes, and the setup process no longer copies the original script into the output directory, then modifies it. Instead, it simply reads from the original script, and writes a modified version to the output directory.
Forgot one:
scaledContents
in the UI definition, as that option causes the image to fill the label completely even if it means distorting it.