Open IgorTatarnikov opened 4 weeks ago
Hi there, I have a related bug. Previously I managed to create nice videos with the following keyframes :
anim.add_keyframe(0, camera="top", zoom=1)
anim.add_keyframe(3, camera="sagittal", zoom=0.95)
anim.add_keyframe(6, camera="frontal", zoom=1)
anim.add_keyframe(9, camera="frontal", zoom=1.2)
anim.make_video(duration=12, fps=15)
This now results in the following video :
https://github.com/user-attachments/assets/7126b36f-b3fe-431f-bdb8-9fd35e3e1525
It seems the zoom factor is applied at each frame instead of each view. The animation example seems to work because it's rather short so the zoom does not have time to make the brain very small. In my example above, setting fps
to a low value (eg. 2 or 3) mitigates the problem, confirming that the zoom (in or out) is applied at each frame.
As suggested I tried settings resetcam=True
but I did not really know where exactly. I tried as an argument of each add_keyframe
but that did not change anything, then I tried directly here :
https://github.com/brainglobe/brainrender/blob/78c0426766087d79667e426af559b3a36fe20b9c/brainrender/render.py#L268
This worked and I got the expected result.
Before this gets fixed, do you have an idea where I could specify this argument from a script rather than editing the source file ?
I can also make a PR (if it's only a matter of settings resetcam=True
by default) if you don't have time.
Cheers !
After #364 the zoom parameter doesn't provide the correct scaling when passed to the
plotter.show
function.The following examples create an animation that first shows
zoom=1
and thenzoom=1.2
using thefrontal
camera.If
resetcam=False
(the current behaviour):https://github.com/user-attachments/assets/d7c51469-fa82-4cf1-957e-e7902549efa0
If
resetcam=True
:https://github.com/user-attachments/assets/605c799f-78f7-474d-ad9d-754ab6a23205
I believe the
resetcam=True
animation is the expected behaviour.