brainrender: VideoMaker ~ actors not rendered bug

The VideoMaker class is a bit buggy. Some actors (e.g. cells) are not rendered in the video frames. This is probably because in brainrender.scene the vtkplotter plotter is populated with show(*self.get_actors()... while videomaker uses show().

This will be fixed when I update the VideoMaker class (currently under development in the Animation branch), but for now a workaround is to:

  1. render the scene with Scene.render()
  2. Close the scene by pressing ‘q’
  3. Use videomaker to crate the video.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19

Most upvoted comments

Hi,

If you’ll look to the example script I’ve linked above you’ll notice that I’ve changed a few things around as I’ve reorganised the code.

The code for making videos is not in brainrender.animation.video, which means that you’ll have to change

from brainrender.Utils.videomaker import VideoMaker

to

from brainrender.animation.video import BasicVideoMaker as VideoMaker

This is an example of how you can make a simple video:

import brainrender
brainrender.WHOLE_SCREEN = True
brainrender.SHADER_STYLE = 'cartoon'
from brainrender.scene import Scene


from brainrender.animation.video import BasicVideoMaker  as VideoMaker


scene = Scene(display_inset=False, camera="sagittal")

scene.add_brain_regions(['MOs'])

vmkr = VideoMaker(scene)
vmkr.make_video(azimuth=1, niters=360, duration=30, save_name="test")

The problem with windows is (presumably) a bug with vtkplotter which is what brainrender uses for creating the renderings and the videos. You won’t get an error because of it, so the code should run smoothly, but unfortunately the video will not be formatted correctly.

p.s.: I’m hoping for the author of vtkplotter to fix this issue soon, but if you need to make a video urgently we can work out a solution together, let me know 😃