[Bf-blender-cvs] [5ef3afd87c5] master: Fix T90900: Crash when rendering geometry nodes created curve

Hans Goudey noreply at git.blender.org
Tue Aug 24 20:39:01 CEST 2021


Commit: 5ef3afd87c54b47614254d95c9b2e9a17c60f76e
Author: Hans Goudey
Date:   Tue Aug 24 13:38:53 2021 -0500
Branches: master
https://developer.blender.org/rB5ef3afd87c54b47614254d95c9b2e9a17c60f76e

Fix T90900: Crash when rendering geometry nodes created curve

The comment for data_eval mentions that it should contain a mesh for
curve objects, however with geometry nodes, objects can evaluate to
curves as well (though they are only containers for the `CurveEval`.
That is a larger issue, but with the upcoming geometry instancing patch
the situation changes, so this commit does not correct that. I also hope
to remove this code in favor of the new curve to mesh code soon.

Instead, just check the evaluated data type in this case, which prevents
the crash, though it is hacky.

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

M	source/blender/blenkernel/intern/mesh_convert.c

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

diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index 5b21213fb72..d5524312612 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -548,10 +548,12 @@ Mesh *BKE_mesh_new_nomain_from_curve(const Object *ob)
   return BKE_mesh_new_nomain_from_curve_displist(ob, &disp);
 }
 
-/* this may fail replacing ob->data, be sure to check ob->type */
 static void mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const char *obdata_name)
 {
-  Object *ob1;
+  if (ob->runtime.data_eval && GS(((ID *)ob->runtime.data_eval)->name) != ID_ME) {
+    return;
+  }
+
   Mesh *me_eval = (Mesh *)ob->runtime.data_eval;
   Mesh *me;
   MVert *allvert = NULL;



More information about the Bf-blender-cvs mailing list