diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 3de9e632ff6..a4298c8c3aa 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -22,6 +22,7 @@ #include "DNA_space_types.h" #include "BKE_brush.h" +#include "BKE_layer.h" #include "BKE_material.h" #include "BKE_paint.h" @@ -164,7 +165,8 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr)) Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob); if (!edit) { @@ -184,7 +186,8 @@ static void rna_ParticleEdit_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); @@ -214,8 +217,10 @@ static const EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { + const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); # if 0 Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); @@ -373,7 +378,8 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); @@ -388,12 +394,13 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) static void rna_Sculpt_ShowMask_update(bContext *C, PointerRNA *UNUSED(ptr)) { + Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *object = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *object = BKE_view_layer_active_object_get(view_layer); if (object == NULL || object->sculpt == NULL) { return; } - Scene *scene = CTX_data_scene(C); Sculpt *sd = scene->toolsettings->sculpt; object->sculpt->show_mask = ((sd->flags & SCULPT_HIDE_MASK) == 0); if (object->sculpt->pbvh != NULL) { @@ -487,7 +494,8 @@ static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob && ob->type == OB_MESH) { /* of course we need to invalidate here */ @@ -504,7 +512,8 @@ static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); if (ob && ob->type == OB_MESH) { ED_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); @@ -523,7 +532,8 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); + BKE_view_layer_synced_ensure(scene, view_layer); + Object *ob = BKE_view_layer_active_object_get(view_layer); bScreen *screen; Image *ima = scene->toolsettings->imapaint.canvas; @@ -1040,7 +1050,7 @@ static void rna_def_paint_mode(BlenderRNA *brna) RNA_def_property_pointer_funcs( prop, NULL, NULL, NULL, "rna_PaintModeSettings_canvas_image_poll"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE); - RNA_def_property_ui_text(prop, "Texture", "Image used as as painting target"); + RNA_def_property_ui_text(prop, "Texture", "Image used as painting target"); } static void rna_def_image_paint(BlenderRNA *brna) @@ -1303,6 +1313,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED); RNA_def_property_ui_text( prop, "Interpolate", "Interpolate new particles from the existing ones"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "totaddkey"); |