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:
authorDalai Felinto <dfelinto@gmail.com>2017-05-02 13:57:41 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-05-02 13:59:07 +0300
commitd3964db5bd6d0496c7fc11657681ecde2d96272d (patch)
tree9884f23e22ec459c4b4d00e4427aa39ce8c4ca97 /source/blender/makesrna/intern/rna_space.c
parenta9d6a07d78f78ea4a3a634d81c87f8001c1d61e9 (diff)
RNA: Remove remaining relevant scene->basact and BaseLegacy
Note: In one case (rna_Scene_editmesh_select_mode_set) I had to resort to the temporary solution of BKE_scene_layer_context_active. This is fine for now, but it will be a problem once workspaces are introduced. In this case the fix is to use a temporary value in the set routine, and actually only set the active object in the update function (which can take bContext).
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 6512400faaf..7bb888f1fc4 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1270,10 +1270,11 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu
}
}
-static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, bContext *C, Scene *UNUSED(scene), PointerRNA *ptr)
{
SpaceAction *saction = (SpaceAction *)(ptr->data);
- Object *obact = (scene->basact) ? scene->basact->object : NULL;
+ SceneLayer *sl = CTX_data_scene_layer(C);
+ Object *obact = OBACT_NEW;
/* we must set this action to be the one used by active object (if not pinned) */
if (obact /* && saction->pin == 0*/) {
@@ -1345,10 +1346,11 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po
}
}
-static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
+static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), bContext *C, Scene *UNUSED(scene), PointerRNA *ptr)
{
SpaceAction *saction = (SpaceAction *)(ptr->data);
- Object *obact = (scene->basact) ? scene->basact->object : NULL;
+ SceneLayer *sl = CTX_data_scene_layer(C);
+ Object *obact = OBACT_NEW;
/* special exceptions for ShapeKey Editor mode */
if (saction->mode == SACTCONT_SHAPEKEY) {
@@ -3461,6 +3463,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL,
"rna_Action_actedit_assign_poll");
RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
/* mode */
@@ -3468,6 +3471,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, mode_items);
RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
/* display */