diff options
author | Hans Goudey <h.goudey@me.com> | 2021-08-24 21:38:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-08-24 21:38:53 +0300 |
commit | 5ef3afd87c54b47614254d95c9b2e9a17c60f76e (patch) | |
tree | 80f08c54548007de7908e04182cb201abddb9a4e /source/blender/blenkernel/intern | |
parent | f53cf5141d37c5f6cb59d58c1b2c074979bdb3f0 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |