diff options
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 25 |
5 files changed, 39 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index a4deee5a2c3..26904cac17f 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -158,6 +158,9 @@ endif() if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) + list(APPEND INC + ../../python + ) endif() if(WITH_GAMEENGINE) diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 861eca9bd9b..65453556523 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -358,7 +358,13 @@ Mesh *rna_Main_meshes_new_from_object( if (render) { ListBase disp = {NULL, NULL}; - BKE_displist_make_mball_forRender(sce, ob, &disp); + /* TODO(sergey): This is gonna to work for until EvaluationContext + * only contains for_render flag. As soon as CoW is + * implemented, this is to be rethinked. + */ + EvaluationContext eval_ctx = {0}; + eval_ctx.for_render = render; + BKE_displist_make_mball_forRender(&eval_ctx, sce, ob, &disp); BKE_mesh_from_metaball(&disp, tmpmesh); BKE_displist_free(&disp); } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index f29eb7800b5..85e0d91fc71 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -168,6 +168,8 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce, int settings) { int for_render = settings == eModifierMode_Render; + EvaluationContext eval_ctx = {0}; + eval_ctx.for_render = for_render; if (!(ob->transflag & OB_DUPLI)) { BKE_report(reports, RPT_ERROR, "Object does not have duplis"); @@ -181,10 +183,10 @@ static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene * free_object_duplilist(ob->duplilist); ob->duplilist = NULL; } - if (G.is_rendering) + if (for_render) dupli_render_particle_set(sce, ob, 0, 1); - ob->duplilist = object_duplilist(sce, ob, for_render); - if (G.is_rendering) + ob->duplilist = object_duplilist(&eval_ctx, sce, ob); + if (for_render) dupli_render_particle_set(sce, ob, 0, 0); /* ob->duplilist should now be freed with Object.free_duplilist */ } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index adc0f7ad892..82447c2e5b4 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -4514,7 +4514,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "pic"); RNA_def_property_ui_text(prop, "Output Path", diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index ae6c5e71e6e..a0a0ec96711 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -54,6 +54,10 @@ #include "ED_transform.h" +#ifdef WITH_PYTHON +# include "BPY_extern.h" +#endif + static void rna_Scene_frame_set(Scene *scene, int frame, float subframe) { double cfra = (double)frame + (double)subframe; @@ -61,7 +65,16 @@ static void rna_Scene_frame_set(Scene *scene, int frame, float subframe) CLAMP(cfra, MINAFRAME, MAXFRAME); BKE_scene_frame_set(scene, cfra); - BKE_scene_update_for_newframe(G.main, scene, (1 << 20) - 1); +#ifdef WITH_PYTHON + BPy_BEGIN_ALLOW_THREADS; +#endif + + BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene, (1 << 20) - 1); + +#ifdef WITH_PYTHON + BPy_END_ALLOW_THREADS; +#endif + BKE_scene_camera_switch_update(scene); /* don't do notifier when we're rendering, avoid some viewport crashes @@ -78,7 +91,15 @@ static void rna_Scene_frame_set(Scene *scene, int frame, float subframe) static void rna_Scene_update_tagged(Scene *scene) { - BKE_scene_update_tagged(G.main, scene); +#ifdef WITH_PYTHON + BPy_BEGIN_ALLOW_THREADS; +#endif + + BKE_scene_update_tagged(G.main->eval_ctx, G.main, scene); + +#ifdef WITH_PYTHON + BPy_END_ALLOW_THREADS; +#endif } static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name) |