[Bf-blender-cvs] [0775680] UI-graphical-redesign: Merge branch 'master' into UI-graphical-redesign
Julian Eisel
noreply at git.blender.org
Thu Oct 22 19:26:09 CEST 2015
Commit: 0775680e4d05eda3c495a56dc0b6eafbe96dc586
Author: Julian Eisel
Date: Wed Oct 21 17:30:35 2015 +0200
Branches: UI-graphical-redesign
https://developer.blender.org/rB0775680e4d05eda3c495a56dc0b6eafbe96dc586
Merge branch 'master' into UI-graphical-redesign
Conflicts:
source/blender/blenkernel/BKE_blender.h
source/blender/blenloader/intern/versioning_270.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/resources.c
===================================================================
===================================================================
diff --cc source/blender/blenkernel/BKE_blender.h
index 1032e32,fb4a1a4..607f2a9
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@@ -41,8 -41,8 +41,8 @@@ extern "C"
/* these lines are grep'd, watch out for our not-so-awesome regex
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
- #define BLENDER_VERSION 275
- #define BLENDER_SUBVERSION 5
+ #define BLENDER_VERSION 276
-#define BLENDER_SUBVERSION 1
++#define BLENDER_SUBVERSION 2
/* Several breakages with 270, e.g. constraint deg vs rad */
#define BLENDER_MINVERSION 270
#define BLENDER_MINSUBVERSION 5
diff --cc source/blender/blenloader/intern/versioning_270.c
index 571a8cc,1f4aa3c..8cd82c6
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -852,47 -854,18 +854,61 @@@ void blo_do_versions_270(FileData *fd,
#undef BRUSH_TORUS
}
+ if (!MAIN_VERSION_ATLEAST(main, 276, 2)) {
+ if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "custom_scale")) {
+ Object *ob;
+
+ for (ob = main->object.first; ob; ob = ob->id.next) {
+ if (ob->pose) {
+ bPoseChannel *pchan;
+ for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ pchan->custom_scale = 1.0f;
+ }
+ }
+ }
+ }
+ }
+ {
+ bScreen *screen;
+ for (screen = main->screen.first; screen; screen = screen->id.next) {
+ ScrArea *sa;
+
+ for (sa = screen->areabase.first; sa; sa = sa->next) {
+ const char needed_type = (sa->spacetype == SPACE_CLIP) ? RGN_TYPE_PREVIEW : RGN_TYPE_WINDOW;
+ ARegion *ar = BKE_area_find_region_type(sa, needed_type);
+ SpaceLink *sl;
+
+ if (ar == NULL)
+ continue;
+
+ for (sl = sa->spacedata.first; sl; sl = sl->next) {
+ switch (sl->spacetype) {
+ case SPACE_TIME:
+ case SPACE_ACTION:
+ case SPACE_NLA:
+ ar->v2d.flag |= V2D_USES_UNITS_HORIZONTAL;
+ break;
+ case SPACE_IPO:
+ case SPACE_SEQ:
+ ar->v2d.flag |= (V2D_USES_UNITS_HORIZONTAL | V2D_USES_UNITS_VERTICAL);
+ break;
+ case SPACE_CLIP:
+ {
+ SpaceClip *sc = (SpaceClip *)sl;
+
+ if (sc->view == SC_VIEW_DOPESHEET) {
+ ar->v2d.flag |= V2D_USES_UNITS_HORIZONTAL;
+ }
+ else if (sc->view == SC_VIEW_GRAPH) {
+ ar->v2d.flag |= (V2D_USES_UNITS_HORIZONTAL | V2D_USES_UNITS_VERTICAL);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
}
diff --cc source/blender/editors/interface/interface.c
index 24f1f42,1fccf0f..51b354d
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@@ -1316,55 -1323,10 +1330,47 @@@ static void ui_but_to_pixelrect(rcti *r
rctf rectf;
ui_block_to_window_rctf(ar, block, &rectf, (but) ? &but->rect : &block->rect);
-
- rectf.xmin -= ar->winrct.xmin;
- rectf.ymin -= ar->winrct.ymin;
- rectf.xmax -= ar->winrct.xmin;
- rectf.ymax -= ar->winrct.ymin;
-
- rect->xmin = floorf(rectf.xmin);
- rect->ymin = floorf(rectf.ymin);
- rect->xmax = floorf(rectf.xmax);
- rect->ymax = floorf(rectf.ymax);
+ BLI_rcti_rctf_copy_floor(rect, &rectf);
+ BLI_rcti_translate(rect, -ar->winrct.xmin, -ar->winrct.ymin);
}
+
+/* project a rcti to pixels in regionspace */
+void ui_rcti_to_pixelrect(const ARegion *ar, uiBlock *block, rcti *rct_dst, const rcti *rct_src)
+{
+ rcti rect;
+
+ ui_block_to_window_rcti(ar, block, &rect, rct_src);
+
+ rect.xmin -= ar->winrct.xmin;
+ rect.ymin -= ar->winrct.ymin;
+ rect.xmax -= ar->winrct.xmin;
+ rect.ymax -= ar->winrct.ymin;
+
+ rct_dst->xmin = iroundf(rect.xmin);
+ rct_dst->ymin = iroundf(rect.ymin);
+ rct_dst->xmax = iroundf(rect.xmax);
+ rct_dst->ymax = iroundf(rect.ymax);
+}
+
+/* project a rctf to pixels in regionspace */
+void ui_rctf_to_pixelrect(const ARegion *ar, uiBlock *block, rctf *rct_dst, const rctf *rct_src)
+{
+ rctf rect;
+
+ ui_block_to_window_rctf(ar, block, &rect, rct_src);
+
+ rect.xmin -= ar->winrct.xmin;
+ rect.ymin -= ar->winrct.ymin;
+ rect.xmax -= ar->winrct.xmin;
+ rect.ymax -= ar->winrct.ymin;
+
+ rct_dst->xmin = floorf(rect.xmin);
+ rct_dst->ymin = floorf(rect.ymin);
+ rct_dst->xmax = floorf(rect.xmax);
+ rct_dst->ymax = floorf(rect.ymax);
+}
+
/* uses local copy of style, to scale things down, and allow widgets to change stuff */
void UI_block_draw(const bContext *C, uiBlock *block)
{
@@@ -2570,10 -2560,10 +2604,14 @@@ static void ui_but_free(const bContext
IMB_freeImBuf((struct ImBuf *)but->poin);
}
+ if (but->dragpoin && (but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
+ MEM_freeN(but->dragpoin);
+ }
+
+ if ((BLI_listbase_is_empty(&but->subbuts)) == false) {
+ BLI_freelistN(&but->subbuts);
+ }
+
BLI_assert(UI_butstore_is_registered(but->block, but) == false);
MEM_freeN(but);
@@@ -3150,25 -3140,20 +3188,40 @@@ void ui_block_cm_to_scene_linear_v3(uiB
IMB_colormanagement_display_to_scene_linear_v3(pixel, display);
}
+ void ui_block_cm_to_display_space_range(uiBlock *block, float *min, float *max)
+ {
+ struct ColorManagedDisplay *display = ui_block_cm_display_get(block);
+ float pixel[3];
+
+ copy_v3_fl(pixel, *min);
+ IMB_colormanagement_scene_linear_to_display_v3(pixel, display);
+ *min = min_fff(UNPACK3(pixel));
+
+ copy_v3_fl(pixel, *max);
+ IMB_colormanagement_scene_linear_to_display_v3(pixel, display);
+ *max = max_fff(UNPACK3(pixel));
+ }
+
+static uiSubBut *ui_def_subbut(
+ uiBut *but, const int type,
+ uiSubButAlign alignment,
+ const int width, const int height)
+{
+ uiSubBut *sbut = MEM_callocN(sizeof(uiSubBut), "uiSubBut");
+
+ sbut->type = type;
+ sbut->align = alignment;
+ sbut->width = width;
+ sbut->height = height;
+
+ /* sbut->rect is calculated later */
+
+ BLI_addtail(&but->subbuts, sbut);
+
+ return sbut;
+}
+
++
/**
* \brief ui_def_but is the function that draws many button types
*
diff --cc source/blender/editors/interface/interface_handlers.c
index ffb3207,010bb8b..bb22721
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@@ -381,7 -384,6 +384,7 @@@ static bool ui_but_contains_pt(uiBut *b
static bool ui_but_contains_point_px(ARegion *ar, uiBut *but, int x, int y);
static uiBut *ui_but_find_mouse_over_ex(ARegion *ar, const int x, const int y, const bool labeledit);
static uiBut *ui_but_find_mouse_over(ARegion *ar, const wmEvent *event);
- static uiSubBut *ui_subbut_find_mouse_over(const ARegion *ar, const uiBut *but, const int mouse_xy[2]);
++static uiSubBut *ui_subbut_find_mouse_over(ARegion *ar, uiBut *but, const int mouse_xy[2]);
static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type);
static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state);
static void button_activate_exit(
@@@ -6519,11 -6576,9 +6555,11 @@@ static bool ui_but_menu(bContext *C, ui
ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 0);
}
else {
- uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframe"),
+ uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Insert Keyframe"),
ICON_NONE, "ANIM_OT_keyframe_insert_button", "all", 1);
}
+
+ is_first_item = false;
}
if ((but->flag & UI_BUT_ANIMATED) && (but->rnapoin.type != &RNA_NlaStrip)) {
@@@ -6534,21 -6589,19 +6570,21 @@@
ICON_NONE, "ANIM_OT_keyframe_clear_button", "all", 0);
}
else {
- uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Clear Keyframes"),
+ uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Clear Keyframes"),
ICON_NONE, "ANIM_OT_keyframe_clear_button", "all", 1);
}
+
+ is_first_item = false;
}
/* Drivers */
if (but->flag & UI_BUT_DRIVEN) {
- uiItemS(layout);
+ ADD_SEPARATOR_CONDITIONAL
if (is_array_component) {
- uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Drivers"),
+ uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Drivers"),
ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1);
- uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Single Driver"),
+ uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Delete Single Driver"),
ICON_NONE, "ANIM_OT_driver_button_remove", "all", 0);
}
else {
@@@ -6556,25 -6609,23 +6592,25 @@@
ICON_NONE, "ANIM_OT_driver_button_remove", "all", 1);
}
- uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"),
+ uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy Driver"),
ICON_NONE, "ANIM_OT_copy_driver_button");
if (ANIM_driver_can_paste()) {
- uiItemO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
+ uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Paste Driver"),
ICON_NONE, "ANIM_OT_paste_driver_button");
}
+
+ is_first_item = false;
}
else if (but->flag & (UI_BUT_ANIMATED_KEY | UI_BUT_ANIMATED)) {
/* pass */
}
else if (is_anim) {
- uiItemS(layout);
+ ADD_SEPARATOR_CONDITIONAL
if (is_array_component) {
- uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Drivers"),
+ uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add Drivers"),
ICON_NONE, "ANIM_OT_driver_button_add", "all", 1);
- uiItemBooleanO(layout, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single Driver"),
+ uiItemBooleanO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add Single Driver"),
ICON_NONE, "ANIM_OT_driver_button_add", "all", 0);
}
else {
@@@ -6583,38 -6634,34 +6619,38 @@@
}
if (ANIM_driver_c
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list