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:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c27
-rw-r--r--source/blender/editors/interface/interface_handlers.c27
-rw-r--r--source/blender/editors/interface/interface_templates.c14
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c6
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c10
-rw-r--r--source/blender/editors/transform/transform_conversions.c13
6 files changed, 37 insertions, 60 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index a7c37d371e5..8ac7406462d 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -1529,7 +1529,7 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-
+/* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */
static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
{
/* identifiers */
@@ -1551,7 +1551,7 @@ static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
/* setting to set */
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-
+/* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */
static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
{
/* identifiers */
@@ -1574,28 +1574,6 @@ static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-static void ANIM_OT_channels_setting_invert (wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Invert Channel Setting";
- ot->idname= "ANIM_OT_channels_setting_toggle";
- ot->description= "Invert specified setting on all selected animation channels";
-
- /* api callbacks */
- ot->invoke= WM_menu_invoke;
- ot->exec= animchannels_setflag_exec;
- ot->poll= animedit_poll_channels_active;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* props */
- /* flag-setting mode */
- RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_INVERT, "Mode", "");
- /* setting to set */
- ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
-}
-
static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
{
/* identifiers */
@@ -2401,7 +2379,6 @@ void ED_operatortypes_animchannels(void)
WM_operatortype_append(ANIM_OT_channels_setting_enable);
WM_operatortype_append(ANIM_OT_channels_setting_disable);
- WM_operatortype_append(ANIM_OT_channels_setting_invert);
WM_operatortype_append(ANIM_OT_channels_setting_toggle);
WM_operatortype_append(ANIM_OT_channels_delete);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index cfb375c2558..cadc57c9881 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -3607,31 +3607,6 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
-static int verg_colorband(const void *a1, const void *a2)
-{
- const CBData *x1=a1, *x2=a2;
-
- if( x1->pos > x2->pos ) return 1;
- else if( x1->pos < x2->pos) return -1;
- return WM_UI_HANDLER_CONTINUE;
-}
-
-static void ui_colorband_update(ColorBand *coba)
-{
- int a;
-
- if(coba->tot<2) return;
-
- for(a=0; a<coba->tot; a++) coba->data[a].cur= a;
- qsort(coba->data, coba->tot, sizeof(CBData), verg_colorband);
- for(a=0; a<coba->tot; a++) {
- if(coba->data[a].cur==coba->cur) {
- coba->cur= a;
- break;
- }
- }
-}
-
static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx)
{
float dx;
@@ -3644,7 +3619,7 @@ static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx
data->dragcbd->pos += dx;
CLAMP(data->dragcbd->pos, 0.0f, 1.0f);
- ui_colorband_update(data->coba);
+ colorband_update_sort(data->coba);
data->dragcbd= data->coba->data + data->coba->cur; /* because qsort */
data->draglastx= mx;
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 3093a4d40f9..55e89ea4428 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1305,6 +1305,16 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v)
rna_update_cb(C, cb_v, NULL);
}
+static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v)
+{
+ uiBut *bt= bt_v;
+ ColorBand *coba= coba_v;
+
+ /* sneaky update here, we need to sort the colorband points to be in order,
+ however the RNA pointer then is wrong, so we update it */
+ colorband_update_sort(coba);
+ bt->rnapoin.data = coba->data + coba->cur;
+}
/* offset aligns from bottom, standard width 300, height 115 */
static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb)
@@ -1348,7 +1358,11 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
PointerRNA ptr;
RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr);
row= uiLayoutRow(layout, 0);
+
uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE);
+ bt= block->buttons.last;
+ uiButSetFunc(bt, colorband_update_cb, bt, coba);
+
uiItemR(row, &ptr, "color", 0, "", ICON_NONE);
}
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index b1a25d093d2..26516bcda99 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -43,6 +43,7 @@
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_main.h"
+#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -160,6 +161,11 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
FileBrowseOp *fbo;
char *str;
+ if (CTX_wm_space_file(C)) {
+ BKE_report(op->reports, RPT_ERROR, "Can't activate a file selector, one already open");
+ return OPERATOR_CANCELLED;
+ }
+
uiFileBrowseContextProperty(C, &ptr, &prop);
if(!prop)
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index 935dda864bf..6a9c2755330 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -3417,15 +3417,15 @@ static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
{
SpaceClip *sc= CTX_wm_space_clip(C);
MovieClip *clip= ED_space_clip(sc);
- int frames= RNA_int_get(op->ptr, "frames");
- float error= RNA_float_get(op->ptr, "error");
- int action= RNA_enum_get(op->ptr, "action");
- if(frames==0 && error==0 && action==0) {
+ if(!RNA_struct_property_is_set(op->ptr, "frames"))
RNA_int_set(op->ptr, "frames", clip->tracking.settings.clean_frames);
+
+ if(!RNA_struct_property_is_set(op->ptr, "error"))
RNA_float_set(op->ptr, "error", clip->tracking.settings.clean_error);
+
+ if(!RNA_struct_property_is_set(op->ptr, "action"))
RNA_enum_set(op->ptr, "action", clip->tracking.settings.clean_action);
- }
return clean_tracks_exec(C, op);
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 776cad6d89c..416fbd58a30 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2361,12 +2361,17 @@ void flushTransSeq(TransInfo *t)
if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { /* originally TFM_TIME_EXTEND, transform changes */
/* Special annoying case here, need to calc metas with TFM_TIME_EXTEND only */
- seq= seqbasep->first;
- while(seq) {
- if (seq->type == SEQ_META && seq->flag & SELECT)
+ /* calc all meta's then effects [#27953] */
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (seq->type == SEQ_META && seq->flag & SELECT) {
calc_sequence(t->scene, seq);
- seq= seq->next;
+ }
+ }
+ for (seq = seqbasep->first; seq; seq = seq->next) {
+ if (seq->seq1 || seq->seq2 || seq->seq3) {
+ calc_sequence(t->scene, seq);
+ }
}
}