[Bf-blender-cvs] [7922b62519c] blender2.8: Workaround crash rendering font objects

Sergey Sharybin noreply at git.blender.org
Fri Nov 10 11:14:42 CET 2017


Commit: 7922b62519c1cfce7911f9f40c1d9b5ac4174fa8
Author: Sergey Sharybin
Date:   Fri Nov 10 11:09:10 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB7922b62519c1cfce7911f9f40c1d9b5ac4174fa8

Workaround crash rendering font objects

Needs a proper scene layer and dependency graph, which we do not have
yet during render pipeline.

===================================================================

M	source/blender/makesrna/intern/rna_main_api.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 3f0b213efac..698d67478d8 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -306,9 +306,20 @@ Mesh *rna_Main_meshes_new_from_object(
 {
 	EvaluationContext eval_ctx;
 
+	/* XXX: This should never happen, but render pipeline is not ready to give
+	 * proper scene_layer, and will always pass NULL here. For until we port
+	 * pipeline form SceneRenderLayer to SceneLayer we have this stub to prevent
+	 * some obvious crashes.
+	 *                                                         - sergey -
+	 */
+	if (scene_layer == NULL) {
+		scene_layer = sce->render_layers.first;
+	}
+
 	DEG_evaluation_context_init(&eval_ctx, settings);
 	eval_ctx.ctime = (float)sce->r.cfra + sce->r.subframe;
 	eval_ctx.scene_layer = scene_layer;
+	eval_ctx.depsgraph = BKE_scene_get_depsgraph(sce, scene_layer, false);
 
 	switch (ob->type) {
 		case OB_FONT:



More information about the Bf-blender-cvs mailing list