-
Notifications
You must be signed in to change notification settings - Fork 3
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
ENH, MAINT: control "dead time" at end of mp4 movie renders? #15
Comments
If you boot up Blender, the default starting scene has a frame range from In Molecular Nodes when importing via the GUI I ensure that the frame range is updated to match the length of the trajectory, but I've left this to be part of the import operator and it won't trigger when setting up a Trajectory, so that it isn't constantly changing when importing different files. context.scene.frame_start = 0
context.scene.frame_end = niverse.trajectory.n_frames A quick fix for the above script will be this: import MDAnalysis as mda
from MDAnalysis.tests.datafiles import PSF, DCD
import ggmolvis
from ggmolvis.ggmolvis import GGMolVis
import bpy
ggmv = GGMolVis()
u = mda.Universe(PSF, DCD)
bpy.context.scene.frame_start = 0
bpy.context.scene.frame_end = u.trajectory.n_frames
system = u.select_atoms("all")
all_mol = ggmv.molecule(system)
bpy.context.scene.render.engine = "BLENDER_EEVEE_NEXT"
all_mol.render(resolution=(1000, 1000),
filepath="test.mp4",
mode="movie") This should probably be made to be part of the import code though. |
* Fixes yuxuanzhuang#15 * Add a new `frame_bounds` argument to `render()`, so that the start and end frame may be controlled conveniently by the user when producing a movie. I suppose the argument for why this should be available to the user vs. using raw `bpy` would be similar to the argument in favor of the original `frame` argument to render individual frames. * I can add some regression tests, but I'll wait to see if folks actually want this. The current testsuite still passes locally at least.
Ah, very nice! I don't mind if the default frames are weird, but being able to control the render range seems useful to me--I proposed that in #16. |
On the latest
main
branch (hash: cb9fb64) a simple 15-line script to render a quick movie withEEVEE
engine (below the fold) seems to produce a large amount of "dead time" with identical frames at the end of the movie.Reproducing Movie Making Code
Here is a sample of the movie produced (https://youtube.com/shorts/QoHMYdaPgGc?feature=share), with more than half of it representing "dead time" (MD frames where nothing happens). I did a visual inspection of the trajectory in VMD and confirmed there is no such "dead time"/dead frames in the actual trajectory.
I'll note that the number of frames generated by Blender is more than double the number of frames in the trajectory, but I'm not immediately certain this is a bug (could depend on sampling/interpolation/frame rate business, potentially?). In any case, perhaps it may be possible to use a sensible frame sampling default of some sort that might avoid this?
The text was updated successfully, but these errors were encountered: