Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2018-04-16 21:35:59 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-04-16 21:35:59 +0300
commitc7d6aa4338527c4fe580bcbf7f8533f582583e13 (patch)
treee14c93d1f9cde421374db161b276d29dc4289bc7 /source/blender/makesrna
parent4ed21f13608901b10f8f4b37cee9a054a91da0bd (diff)
parent34ab90f546f097cada951b2c9ca22bf271996980 (diff)
Merge branch 'blender2.8' into blender2.8-workbench
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_key.c2
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_material.c2
-rw-r--r--source/blender/makesrna/intern/rna_mesh_utils.h2
-rw-r--r--source/blender/makesrna/intern/rna_meta.c1
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c25
-rw-r--r--source/blender/makesrna/intern/rna_pose.c4
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c4
-rw-r--r--source/blender/makesrna/intern/rna_space_api.c19
9 files changed, 25 insertions, 42 deletions
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index a47a5c604b4..472298a3053 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -713,7 +713,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
prop = RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "ShapeKey");
- RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL);
+ RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL | PROP_PTR_NO_OWNERSHIP);
RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get",
"rna_ShapeKey_relative_key_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key");
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 077dac262b6..41970a69c6c 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -302,14 +302,8 @@ Mesh *rna_Main_meshes_new_from_object(
Main *bmain, ReportList *reports, Depsgraph *depsgraph,
Object *ob, int apply_modifiers, int calc_tessface, int calc_undeformed)
{
- EvaluationContext eval_ctx;
Scene *sce = DEG_get_evaluated_scene(depsgraph);
- DEG_evaluation_context_init(&eval_ctx, DEG_get_mode(depsgraph));
- eval_ctx.ctime = DEG_get_ctime(depsgraph);
- eval_ctx.view_layer = DEG_get_evaluated_view_layer(depsgraph);
- eval_ctx.depsgraph = depsgraph;
-
switch (ob->type) {
case OB_FONT:
case OB_CURVE:
@@ -322,7 +316,7 @@ Mesh *rna_Main_meshes_new_from_object(
return NULL;
}
- return BKE_mesh_new_from_object(&eval_ctx, bmain, sce, ob, apply_modifiers, calc_tessface, calc_undeformed);
+ return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_tessface, calc_undeformed);
}
static Lamp *rna_Main_lamps_new(Main *bmain, const char *name, int type)
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index bf6e13e587c..8bc818d2658 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -376,7 +376,7 @@ static const EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_ORCO);
if (ma->material_type == MA_TYPE_VOLUME) {
-
+ /* pass */
}
else if (ELEM(ma->material_type, MA_TYPE_SURFACE, MA_TYPE_HALO, MA_TYPE_WIRE)) {
RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_UV);
diff --git a/source/blender/makesrna/intern/rna_mesh_utils.h b/source/blender/makesrna/intern/rna_mesh_utils.h
index 05274e13e1e..a85e2095121 100644
--- a/source/blender/makesrna/intern/rna_mesh_utils.h
+++ b/source/blender/makesrna/intern/rna_mesh_utils.h
@@ -85,7 +85,7 @@
} \
else { \
layer = NULL; \
- } \
+ } \
return rna_pointer_inherit_refine(ptr, &RNA_##layer_rna_type, layer); \
} \
\
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index 8589d819360..124f3a2fbe2 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -48,6 +48,7 @@
#include "BKE_mball.h"
#include "BKE_main.h"
+#include "BKE_scene.h"
#include "DEG_depsgraph.h"
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 012545cb5d2..0caffb4867c 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3144,11 +3144,6 @@ void rna_ShaderNodePointDensity_density_cache(bNode *self,
return;
}
- EvaluationContext eval_ctx;
- DEG_evaluation_context_init_from_depsgraph(&eval_ctx,
- depsgraph,
- DEG_get_mode(depsgraph));
-
/* Make sure there's no cached data. */
BKE_texture_pointdensity_free_data(pd);
RE_point_density_free(pd);
@@ -3177,8 +3172,7 @@ void rna_ShaderNodePointDensity_density_cache(bNode *self,
shader_point_density->cached_resolution = shader_point_density->resolution;
/* Single-threaded sampling of the voxel domain. */
- RE_point_density_cache(&eval_ctx,
- pd);
+ RE_point_density_cache(depsgraph, pd);
}
void rna_ShaderNodePointDensity_density_calc(bNode *self,
@@ -3195,11 +3189,6 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self,
return;
}
- EvaluationContext eval_ctx;
- DEG_evaluation_context_init_from_depsgraph(&eval_ctx,
- depsgraph,
- DEG_get_mode(depsgraph));
-
/* TODO(sergey): Will likely overflow, but how to pass size_t via RNA? */
*length = 4 * resolution * resolution * resolution;
@@ -3208,10 +3197,7 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self,
}
/* Single-threaded sampling of the voxel domain. */
- RE_point_density_sample(&eval_ctx,
- pd,
- resolution,
- *values);
+ RE_point_density_sample(depsgraph, pd, resolution, *values);
/* We're done, time to clean up. */
BKE_texture_pointdensity_free_data(pd);
@@ -3233,12 +3219,7 @@ void rna_ShaderNodePointDensity_density_minmax(bNode *self,
return;
}
- EvaluationContext eval_ctx;
- DEG_evaluation_context_init_from_depsgraph(&eval_ctx,
- depsgraph,
- DEG_get_mode(depsgraph));
-
- RE_point_density_minmax(&eval_ctx, pd, r_min, r_max);
+ RE_point_density_minmax(depsgraph, pd, r_min, r_max);
}
#else
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index f50be85c446..84f3738d15d 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -908,7 +908,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop = RNA_def_property(srna, "bbone_custom_handle_start", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bbone_prev");
RNA_def_property_struct_type(prop, "PoseBone");
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_EDITABLE | PROP_PTR_NO_OWNERSHIP);
RNA_def_property_ui_text(prop, "B-Bone Start Handle",
"Bone that serves as the start handle for the B-Bone curve");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
@@ -924,7 +924,7 @@ static void rna_def_pose_channel(BlenderRNA *brna)
prop = RNA_def_property(srna, "bbone_custom_handle_end", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bbone_next");
RNA_def_property_struct_type(prop, "PoseBone");
- RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_flag(prop, PROP_EDITABLE | PROP_PTR_NO_OWNERSHIP);
RNA_def_property_ui_text(prop, "B-Bone End Handle",
"Bone that serves as the end handle for the B-Bone curve");
RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable");
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index d2afb43d65e..7887ea49f19 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -163,7 +163,7 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, int previe
}
static void rna_Scene_ray_cast(
- Scene *scene, ViewLayer *view_layer,
+ Scene *scene, ViewLayer *UNUSED(view_layer),
float origin[3], float direction[3], float ray_dist,
int *r_success, float r_location[3], float r_normal[3], int *r_index,
Object **r_ob, float r_obmat[16])
@@ -171,7 +171,7 @@ static void rna_Scene_ray_cast(
normalize_v3(direction);
SnapObjectContext *sctx = ED_transform_snap_object_context_create(
- G.main, scene, view_layer, 0);
+ G.main, scene, 0);
bool ret = ED_transform_snap_object_project_ray_ex(
sctx,
diff --git a/source/blender/makesrna/intern/rna_space_api.c b/source/blender/makesrna/intern/rna_space_api.c
index 822f5cbb4b6..f1206b7130f 100644
--- a/source/blender/makesrna/intern/rna_space_api.c
+++ b/source/blender/makesrna/intern/rna_space_api.c
@@ -39,20 +39,27 @@
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 = sa->spacedata.first;
- Scene *scene = ED_screen_scene_find(sc, G.main->wm.first);
-
- ED_view3d_update_viewmat(&eval_ctx, scene, v3d, ar, NULL, NULL, NULL);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmWindow *win;
+
+ for (win = wm->windows.first; win; win = win->next) {
+ if (WM_window_get_active_screen(win) == sc) {
+ Scene *scene = WM_window_get_active_scene(win);
+ ViewLayer *view_layer = WM_window_get_active_view_layer(win);
+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true);
+
+ ED_view3d_update_viewmat(depsgraph, scene, v3d, ar, NULL, NULL, NULL);
+ break;
+ }
+ }
}
}