diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-30 05:31:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-30 05:31:39 +0300 |
commit | 4c1b7f311da58269654655359a8bddf439cc8ce9 (patch) | |
tree | 432bcc4ecb1932ee0a4e21a61b50fb0a922635f1 /source/blender/makesrna/intern/rna_object.c | |
parent | 002b1835062b9ae213828b202c02059212bdef2e (diff) | |
parent | 7a27f64ecb5ac4c6cac3a27436d7b25037e62054 (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 04d56921ca6..70192198e14 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -383,36 +383,44 @@ static void rna_Object_matrix_basis_set(PointerRNA *ptr, const float values[16]) BKE_object_apply_mat4(ob, (float(*)[4])values, false, false); } -void rna_Object_internal_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +void rna_Object_internal_update_data_impl(PointerRNA *ptr) { DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->owner_id); } -void rna_Object_internal_update_data_dependency(Main *bmain, Scene *scene, PointerRNA *ptr) +void rna_Object_internal_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + rna_Object_internal_update_data_impl(ptr); +} + +void rna_Object_internal_update_data_dependency(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { DEG_relations_tag_update(bmain); - rna_Object_internal_update_data(bmain, scene, ptr); + rna_Object_internal_update_data_impl(ptr); } -static void rna_Object_active_shape_update(bContext *C, PointerRNA *ptr) +static void rna_Object_active_shape_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; - Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); - if (CTX_data_edit_object(C) == ob) { + if (BKE_object_is_in_editmode(ob)) { /* exit/enter editmode to get new shape */ switch (ob->type) { - case OB_MESH: + case OB_MESH: { + Mesh *me = ob->data; + BMEditMesh *em = me->edit_mesh; + int select_mode = em->selectmode; EDBM_mesh_load(bmain, ob); - EDBM_mesh_make(ob, scene->toolsettings->selectmode, true); + EDBM_mesh_make(ob, select_mode, true); + em = me->edit_mesh; - DEG_id_tag_update(ob->data, 0); + DEG_id_tag_update(&me->id, 0); - EDBM_mesh_normals_update(((Mesh *)ob->data)->edit_mesh); - BKE_editmesh_looptri_calc(((Mesh *)ob->data)->edit_mesh); + EDBM_mesh_normals_update(em); + BKE_editmesh_looptri_calc(em); break; + } case OB_CURVE: case OB_SURF: ED_curve_editnurb_load(bmain, ob); @@ -425,7 +433,7 @@ static void rna_Object_active_shape_update(bContext *C, PointerRNA *ptr) } } - rna_Object_internal_update_data(bmain, scene, ptr); + rna_Object_internal_update_data_impl(ptr); } static void rna_Object_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) @@ -3105,7 +3113,6 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shapenr"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* XXX this is really unpredictable... */ RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", |