diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_space_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space_api.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_space_api.c b/source/blender/makesrna/intern/rna_space_api.c index 8f771eda99d..822f5cbb4b6 100644 --- a/source/blender/makesrna/intern/rna_space_api.c +++ b/source/blender/makesrna/intern/rna_space_api.c @@ -31,23 +31,28 @@ #ifdef RNA_RUNTIME +#include "BKE_global.h" + +#include "ED_screen.h" #include "ED_text.h" -static void rna_RegionView3D_update(ID *id, RegionView3D *rv3d) +static void rna_RegionView3D_update(ID *id, RegionView3D *rv3d, bContext *C) { bScreen *sc = (bScreen *)id; + EvaluationContext eval_ctx; ScrArea *sa; ARegion *ar; + CTX_data_eval_ctx(C, &eval_ctx); + area_region_from_regiondata(sc, rv3d, &sa, &ar); if (sa && ar && sa->spacetype == SPACE_VIEW3D) { - View3D *v3d; + View3D *v3d = sa->spacedata.first; + Scene *scene = ED_screen_scene_find(sc, G.main->wm.first); - v3d = (View3D *)sa->spacedata.first; - - ED_view3d_update_viewmat(sc->scene, v3d, ar, NULL, NULL, NULL); + ED_view3d_update_viewmat(&eval_ctx, scene, v3d, ar, NULL, NULL, NULL); } } @@ -71,7 +76,7 @@ void RNA_api_region_view3d(StructRNA *srna) FunctionRNA *func; func = RNA_def_function(srna, "update", "rna_RegionView3D_update"); - RNA_def_function_flag(func, FUNC_USE_SELF_ID); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Recalculate the view matrices"); } |