[Bf-committers] Blender game transition
you.le at live.fr
Fri Mar 16 21:19:28 CET 2018
Hi, even if I don't really know where it leads, it seems that we can move Objects with the depsgraph in bge.
I don't really understand for now how to combine logic and blender depsgraph, but this is just an experiment to use depsgraph in bge.
The code is here:
The performances are not good for now. and I just tested on a cube.
The pipe is weird but as it is an experiment, we don't really care:
1) The logic updates "SGNodes" matrix (KX_KetsjiEngine::NextFrame)
2) I update Object (KX_GameObject's Object) with the resulted matrix (copy_m4_m4(ob->obmat, sgnodeObmat))
3) I tag the Object for update with DEG_id_tag_update(&ob->id, NC_OBJECT | ND_TRANSFORM);
4) I update the depsgraph with BKE_scene_graph_update_tagged(eval_ctx, depsgraph, bmain, scene, view_layer);
5) Then I run a complete render loop (create a viewport offscreen, set DST variables, fill eevee's cache, draw eevee's scene, free viewport and cache...)
On my level, this is just for experimental purposes, but I hope it could be useful to more experienced coders for interactive mode.
After step 1), the code if the following:
http://pasteall.org/878033/c (Sorry about the dirty state of the code)
More information about the Bf-committers