Page MenuHome

blender2.8: Initialize immediate mode in Animation Player
AbandonedPublic

Authored by Germano Cavalcante (mano-wii) on Mar 28 2017, 4:03 AM.

Details

Summary

Currently in blender 2.8 you can not use Animation Player, because the immediatemode is not initialized.
I tried to initialize and finalize the imm in the WM_main_playanim function, but apparently it is only possible to initialize it after calling playanim_window_open.
With this solution, immediate mode can be initialized and finalized consecutively, and I do not know if this is problematic.

https://docs.blender.org/manual/en/dev/render/output/animation_player.html

Diff Detail

Event Timeline

immInit & immDestroy should only be called once per application.

Immediate mode is only active for one window at a time. See how immActivate & immDeactivate are used when switching between windows. Same should be done here, since Animation Player apparently does not use a regular window.

Does all that make sense?

FYI D2288 is an earlier attempt at this.

Since animation player is its own mini application, it can use immInit/Destroy. Thanks for clarifying that point!

This revision is now accepted and ready to land.Apr 4 2017, 4:58 PM

To address problems mentioned in IRC, how about call immInit from WM_main_playanim before the wm_main_playanim_intern loop?

... how about call immInit from WM_main_playanim before the wm_main_playanim_intern loop?

Thus a failure occurs in glGenBuffers(1, &new_buffer_id); in buffer_id_alloc() in immInit() :\

Germano Cavalcante (mano-wii) abandoned this revision.EditedApr 6 2017, 6:57 AM

Committed rBff3880ff93f4
Thanks @Campbell Barton (campbellbarton) for pointing out the error:

"missing GPU_shader_free_builtin_shaders();"