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-11-08 17:16:49 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-11-08 23:39:01 +0300
commit206c94fea98d44ed9667607638c455c7c0e63822 (patch)
treeddc1f6f30c18d10674daaeeaee6b465550447709 /source/blender/editors/animation
parent670e6cab4319b94c96c6a61cb76199f1054b935a (diff)
Farewell Scene->base
While getting rid of Scene->base we got the following fixes: * Fix "Convert To" operator * Fix "NLA allowing to selected objects that are not selectable * Fix scene.objects (readonly, no option to link/unlink) Note: Collada needs to use the context SceneLayer for adding objects however I added a placeholder, so Collada maintainers can fix this properly.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c19
-rw-r--r--source/blender/editors/animation/anim_markers.c6
2 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 26ba61f0f20..e705d0268e3 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -2684,6 +2684,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
{
bDopeSheet *ads = (bDopeSheet *)ac->data;
Scene *sce = (Scene *)ads->source;
+ SceneLayer *scene_layer = ac->scene_layer;
BaseLegacy *base = (BaseLegacy *)ale->data;
Object *ob = base->object;
AnimData *adt = ob->adt;
@@ -2691,30 +2692,30 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
/* set selection status */
if (selectmode == SELECT_INVERT) {
/* swap select */
- base->flag_legacy ^= SELECT;
- BKE_scene_base_flag_sync_from_base(base);
+ ED_object_base_select(base, BA_INVERT);
+ BKE_scene_object_base_flag_sync_from_base(base);
if (adt) adt->flag ^= ADT_UI_SELECTED;
}
else {
- BaseLegacy *b;
+ Base *b;
/* deselect all */
/* TODO: should this deselect all other types of channels too? */
- for (b = sce->base.first; b; b = b->next) {
- b->flag_legacy &= ~SELECT;
- BKE_scene_base_flag_sync_from_base(b);
+ for (b = scene_layer->object_bases.first; b; b = b->next) {
+ ED_object_base_select(b, BA_DESELECT);
+ BKE_scene_object_base_flag_sync_from_base(b);
if (b->object->adt) b->object->adt->flag &= ~(ADT_UI_SELECTED | ADT_UI_ACTIVE);
}
/* select object now */
- base->flag_legacy |= SELECT;
- ob->flag |= SELECT;
+ ED_object_base_select(base, BA_SELECT);
+ BKE_scene_object_base_flag_sync_from_base(base);
if (adt) adt->flag |= ADT_UI_SELECTED;
}
/* change active object - regardless of whether it is now selected [T37883] */
- ED_base_object_activate(C, base); /* adds notifier */
+ ED_object_base_activate(C, base); /* adds notifier */
if ((adt) && (adt->flag & ADT_UI_SELECTED))
adt->flag |= ADT_UI_ACTIVE;
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index b24f48a10f9..4821fdd6af7 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -1143,13 +1143,13 @@ static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool
if (camera) {
Scene *scene = CTX_data_scene(C);
- SceneLayer *sl = CTX_data_scene_layer(C);
+ SceneLayer *scene_layer = CTX_data_scene_layer(C);
Base *base;
TimeMarker *marker;
int sel = 0;
if (!extend)
- BKE_scene_base_deselect_all(scene);
+ BKE_scene_layer_base_deselect_all(scene_layer);
for (marker = markers->first; marker; marker = marker->next) {
if (marker->frame == cfra) {
@@ -1161,7 +1161,7 @@ static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool
for (marker = markers->first; marker; marker = marker->next) {
if (marker->camera) {
if (marker->frame == cfra) {
- base = BKE_scene_layer_base_find(sl, marker->camera);
+ base = BKE_scene_layer_base_find(scene_layer, marker->camera);
if (base) {
ED_object_base_select(base, sel);
if (sel)