diff options
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 27 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 20 |
6 files changed, 47 insertions, 21 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 02aec9527f0..a219bbcfc8e 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -155,7 +155,7 @@ static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = { {GP_BRUSH_ERASER_SOFT, "SOFT", 0, - "Dissolve,", + "Dissolve", "Erase strokes, fading their points strength and thickness"}, {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"}, {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"}, diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 8e57de9baeb..64e6fc9059c 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -973,11 +973,18 @@ static void rna_def_constraint_childof(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SET_INVERSE); + RNA_def_property_ui_text( + prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "invmat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_python(BlenderRNA *brna) @@ -3152,6 +3159,12 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + prop = RNA_def_property(srna, "set_inverse_pending", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", OBJECTSOLVER_SET_INVERSE); + RNA_def_property_ui_text( + prop, "Set Inverse Pending", "Set to true to request recalculation of the inverse matrix"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + /* object */ prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "object"); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 9a4048e6aaa..cc0ebd8e6b2 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -5635,7 +5635,7 @@ static void rna_def_modifier_laplaciandeform(BlenderRNA *brna) prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "anchor_grp_name"); RNA_def_property_ui_text( - prop, "Vertex Group for Anchors", "Name of Vertex Group which determines Anchors"); + prop, "Anchor Weights", "Name of Vertex Group which determines Anchors"); RNA_def_property_string_funcs( prop, NULL, NULL, "rna_LaplacianDeformModifier_anchor_grp_name_set"); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 5552de00be8..cbeb8f17991 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -487,7 +487,7 @@ static Object *eval_object_ensure(Object *ob, ReportList *reports, PointerRNA *rnaptr_depsgraph) { - if (ob->runtime.mesh_eval == NULL) { + if (ob->runtime.data_eval == NULL) { Object *ob_orig = ob; Depsgraph *depsgraph = rnaptr_depsgraph != NULL ? rnaptr_depsgraph->data : NULL; if (depsgraph == NULL) { @@ -496,7 +496,7 @@ static Object *eval_object_ensure(Object *ob, if (depsgraph != NULL) { ob = DEG_get_evaluated_object(depsgraph, ob); } - if (ob == NULL || ob->runtime.mesh_eval == NULL) { + if (ob == NULL || BKE_object_get_evaluated_mesh(ob) == NULL) { BKE_reportf( reports, RPT_ERROR, "Object '%s' has no evaluated mesh data", ob_orig->id.name + 2); return NULL; @@ -521,8 +521,7 @@ static void rna_Object_ray_cast(Object *ob, /* TODO(sergey): This isn't very reliable check. It is possible to have non-NULL pointer * but which is out of date, and possibly dangling one. */ - if (ob->runtime.mesh_eval == NULL && - (ob = eval_object_ensure(ob, C, reports, rnaptr_depsgraph)) == NULL) { + if ((ob = eval_object_ensure(ob, C, reports, rnaptr_depsgraph)) == NULL) { return; } @@ -538,7 +537,8 @@ static void rna_Object_ray_cast(Object *ob, /* No need to managing allocation or freeing of the BVH data. * This is generated and freed as needed. */ - BKE_bvhtree_from_mesh_get(&treeData, ob->runtime.mesh_eval, BVHTREE_FROM_LOOPTRI, 4); + Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob); + BKE_bvhtree_from_mesh_get(&treeData, mesh_eval, BVHTREE_FROM_LOOPTRI, 4); /* may fail if the mesh has no faces, in that case the ray-cast misses */ if (treeData.tree != NULL) { @@ -559,8 +559,7 @@ static void rna_Object_ray_cast(Object *ob, copy_v3_v3(r_location, hit.co); copy_v3_v3(r_normal, hit.no); - *r_index = mesh_looptri_to_poly_index(ob->runtime.mesh_eval, - &treeData.looptri[hit.index]); + *r_index = mesh_looptri_to_poly_index(mesh_eval, &treeData.looptri[hit.index]); } } @@ -589,14 +588,14 @@ static void rna_Object_closest_point_on_mesh(Object *ob, { BVHTreeFromMesh treeData = {NULL}; - if (ob->runtime.mesh_eval == NULL && - (ob = eval_object_ensure(ob, C, reports, rnaptr_depsgraph)) == NULL) { + if ((ob = eval_object_ensure(ob, C, reports, rnaptr_depsgraph)) == NULL) { return; } /* No need to managing allocation or freeing of the BVH data. * this is generated and freed as needed. */ - BKE_bvhtree_from_mesh_get(&treeData, ob->runtime.mesh_eval, BVHTREE_FROM_LOOPTRI, 4); + Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob); + BKE_bvhtree_from_mesh_get(&treeData, mesh_eval, BVHTREE_FROM_LOOPTRI, 4); if (treeData.tree == NULL) { BKE_reportf(reports, @@ -617,8 +616,7 @@ static void rna_Object_closest_point_on_mesh(Object *ob, copy_v3_v3(r_location, nearest.co); copy_v3_v3(r_normal, nearest.no); - *r_index = mesh_looptri_to_poly_index(ob->runtime.mesh_eval, - &treeData.looptri[nearest.index]); + *r_index = mesh_looptri_to_poly_index(mesh_eval, &treeData.looptri[nearest.index]); goto finally; } @@ -659,8 +657,7 @@ void rna_Object_me_eval_info( switch (type) { case 1: case 2: - if (ob->runtime.mesh_eval == NULL && - (ob = eval_object_ensure(ob, C, NULL, rnaptr_depsgraph)) == NULL) { + if ((ob = eval_object_ensure(ob, C, NULL, rnaptr_depsgraph)) == NULL) { return; } } @@ -675,7 +672,7 @@ void rna_Object_me_eval_info( me_eval = ob->runtime.mesh_deform_eval; break; case 2: - me_eval = ob->runtime.mesh_eval; + me_eval = BKE_object_get_evaluated_mesh(ob); break; } diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index a3cf6fcd0b7..2031c444c9a 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -128,14 +128,12 @@ static int engine_get_preview_pixel_size(RenderEngine *UNUSED(engine), Scene *sc static void engine_bind_display_space_shader(RenderEngine *UNUSED(engine), Scene *UNUSED(scene)) { - GPUShader *shader = GPU_shader_get_builtin_shader(GPU_SHADER_2D_IMAGE_COLOR); + GPUShader *shader = GPU_shader_get_builtin_shader(GPU_SHADER_2D_IMAGE); GPU_shader_bind(shader); int img_loc = GPU_shader_get_uniform_ensure(shader, "image"); - int color_loc = GPU_shader_get_uniform_ensure(shader, "color"); GPU_shader_uniform_int(shader, img_loc, 0); - GPU_shader_uniform_vector(shader, color_loc, 3, 1, (float[3]){1.0f, 1.0f, 1.0f}); } static void engine_unbind_display_space_shader(RenderEngine *UNUSED(engine)) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3d5d5091bf1..762c1985fa9 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1280,9 +1280,26 @@ static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C, RNA_enum_item_add(&result, &totitem, item); } } + + RNA_enum_item_end(&result, &totitem); *r_free = true; return result; } +static int rna_3DViewShading_render_pass_get(PointerRNA *ptr) +{ + View3DShading *shading = (View3DShading *)ptr->data; + eViewLayerEEVEEPassType result = shading->render_pass; + Scene *scene = rna_3DViewShading_scene(ptr); + + if (result == EEVEE_RENDER_PASS_AO && ((scene->eevee.flag & SCE_EEVEE_GTAO_ENABLED) == 0)) { + result = EEVEE_RENDER_PASS_COMBINED; + } + if (result == EEVEE_RENDER_PASS_BLOOM && ((scene->eevee.flag & SCE_EEVEE_BLOOM_ENABLED) == 0)) { + result = EEVEE_RENDER_PASS_COMBINED; + } + + return result; +} static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA *ptr) { @@ -3379,7 +3396,8 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "render_pass"); RNA_def_property_enum_items(prop, rna_enum_view3dshading_render_pass_type_items); RNA_def_property_ui_text(prop, "Render Pass", "Render Pass to show in the viewport"); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_3DViewShading_render_pass_itemf"); + RNA_def_property_enum_funcs( + prop, "rna_3DViewShading_render_pass_get", NULL, "rna_3DViewShading_render_pass_itemf"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); } |