From c0a13322cdea417885ce9f88d0b42ff0ef62483c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 11 Feb 2014 18:23:59 +0600 Subject: Fix T38553: Crash load new level; array modifier using curve length Since threaded object update we've disabled in-place curve evaluation (in cases when applying curve modifier with target curve non-evaluated yet). This requires game engine to take care of DAG and object evaluation (currently it's designed to export only objects it able to render). This workaround will make sure that curve_cache for curves is up-to-date. --- .../Converter/BL_BlenderDataConversion.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source/gameengine') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index ebd9430401c..c823665c3bb 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -34,6 +34,19 @@ # pragma warning (disable:4786) #endif +/* Since threaded object update we've disabled in-place + * curve evaluation (in cases when applying curve modifier + * with target curve non-evaluated yet). + * + * This requires game engine to take care of DAG and object + * evaluation (currently it's designed to export only objects + * it able to render). + * + * This workaround will make sure that curve_cache for curves + * is up-to-date. + */ +#define THREADED_DAG_WORKAROUND + #include #include #include @@ -143,6 +156,7 @@ extern "C" { #include "BKE_material.h" /* give_current_material */ #include "BKE_image.h" #include "IMB_imbuf_types.h" +#include "BKE_displist.h" extern Material defmaterial; /* material.c */ } @@ -1985,6 +1999,15 @@ static KX_GameObject *gameobject_from_blenderobject( break; } +#ifdef THREADED_DAG_WORKAROUND + case OB_CURVE: + { + if (ob->curve_cache == NULL) { + BKE_displist_make_curveTypes(blenderscene, ob, FALSE); + } + } +#endif + } if (gameobj) { -- cgit v1.2.3