[Bf-blender-cvs] [9af4ff0] wiggly-widgets: Merge branch 'master' into wiggly-widgets
Julian Eisel
noreply at git.blender.org
Thu Dec 3 16:23:10 CET 2015
Commit: 9af4ff0465b451ac979976b405a7e7e246632850
Author: Julian Eisel
Date: Thu Dec 3 14:30:26 2015 +0100
Branches: wiggly-widgets
https://developer.blender.org/rB9af4ff0465b451ac979976b405a7e7e246632850
Merge branch 'master' into wiggly-widgets
Conflicts:
source/blender/blenloader/intern/versioning_270.c
source/blender/editors/interface/resources.c
source/blender/editors/screen/glutil.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/transform/transform_manipulator.c
===================================================================
===================================================================
diff --cc source/blender/editors/interface/resources.c
index f2bc449,5fb1afa..dc46b31
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@@ -1625,6 -1628,12 +1628,10 @@@ void init_userdef_do_versions(void
U.savetime = 1;
// XXX error(STRINGIFY(BLENDER_STARTUP_FILE)" is buggy, please consider removing it.\n");
}
+ /* transform widget settings */
- if (U.tw_hotspot == 0) {
- U.tw_hotspot = 14;
++ if (U.tw_size == 0) {
+ U.tw_size = 25; /* percentage of window size */
- U.tw_handlesize = 16; /* percentage of widget radius */
+ }
if (U.pad_rot_angle == 0.0f)
U.pad_rot_angle = 15.0f;
@@@ -2655,12 -2674,10 +2672,19 @@@
if (!USER_VERSION_ATLEAST(276, 3)) {
bTheme *btheme;
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_set(btheme->tseq.text_strip, 162, 151, 0, 255);
+ }
+ }
+
++ if (!USER_VERSION_ATLEAST(276, 4)) {
++ bTheme *btheme;
++ for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+ rgba_char_args_set_fl(btheme->tui.xaxis, 1.0f, 0.27f, 0.27f, 1.0f); /* red */
+ rgba_char_args_set_fl(btheme->tui.yaxis, 0.27f, 1.0f, 0.27f, 1.0f); /* green */
+ rgba_char_args_set_fl(btheme->tui.zaxis, 0.27f, 0.27f, 1.0f, 1.0f); /* blue */
+ }
+ }
+
if (U.pixelsize == 0.0f)
U.pixelsize = 1.0f;
diff --cc source/blender/editors/screen/glutil.c
index 5cd76a6,337a959..b1df428
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@@ -1097,8 -1082,7 +1083,7 @@@ void glaDrawImBuf_glsl(ImBuf *ibuf, flo
}
if (ok) {
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glColor4f(1.0, 1.0, 1.0, 1.0);
+ glColor4f(1.0, 1.0, 1.0, alpha);
if (ibuf->rect_float) {
int format = 0;
diff --cc source/blender/editors/space_graph/space_graph.c
index bb1919a,9f3bfe6..b15c1b8
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@@ -223,14 -219,9 +223,14 @@@ static void graph_main_region_init(wmWi
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+ /* widgets */
+ if (BLI_listbase_is_empty(&ar->widgetmaps)) {
+ BLI_addhead(&ar->widgetmaps, WM_widgetmap_from_type("Graph_Canvas", SPACE_IPO, RGN_TYPE_WINDOW, false));
+ }
}
- static void graph_main_area_draw(const bContext *C, ARegion *ar)
+ static void graph_main_region_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
SpaceIpo *sipo = CTX_wm_space_graph(C);
diff --cc source/blender/editors/space_sequencer/space_sequencer.c
index d657709,fce40f8..70adde9
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@@ -481,16 -478,11 +481,16 @@@ static void sequencer_main_region_init(
/* add drop boxes */
lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
-
+
WM_event_add_dropbox_handler(&ar->handlers, lb);
+
+ /* no modal keymap here, only operators use this currently */
+ if (BLI_listbase_is_empty(&ar->widgetmaps)) {
+ BLI_addhead(&ar->widgetmaps, WM_widgetmap_from_type("Seq_Canvas", SPACE_SEQ, RGN_TYPE_WINDOW, false));
+ }
}
- static void sequencer_main_area_draw(const bContext *C, ARegion *ar)
+ static void sequencer_main_region_draw(const bContext *C, ARegion *ar)
{
/* NLE - strip editing timeline interface */
draw_timeline_seq(C, ar);
@@@ -564,13 -556,9 +564,13 @@@ static void sequencer_preview_region_in
/* own keymap */
keymap = WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+
+ if (BLI_listbase_is_empty(&ar->widgetmaps)) {
+ BLI_addhead(&ar->widgetmaps, WM_widgetmap_from_type("Seq_Canvas", SPACE_SEQ, RGN_TYPE_PREVIEW, false));
+ }
}
- static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
+ static void sequencer_preview_region_draw(const bContext *C, ARegion *ar)
{
ScrArea *sa = CTX_wm_area(C);
SpaceSeq *sseq = sa->spacedata.first;
@@@ -604,12 -592,9 +604,12 @@@
ED_region_visible_rect(ar, &rect);
ED_scene_draw_fps(scene, &rect);
}
+
+ WM_widgetmap_widgets_update(C, ar->widgetmaps.first);
+ WM_widgetmap_widgets_draw(C, ar->widgetmaps.first, false, true);
}
- static void sequencer_preview_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
+ static void sequencer_preview_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --cc source/blender/editors/space_view3d/space_view3d.c
index 24a8721,a1c2c8c..b299875
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@@ -583,9 -564,10 +583,9 @@@ static void view3d_main_region_init(wmW
lb = WM_dropboxmap_find("View3D", SPACE_VIEW3D, RGN_TYPE_WINDOW);
WM_event_add_dropbox_handler(&ar->handlers, lb);
-
}
- static void view3d_main_area_exit(wmWindowManager *wm, ARegion *ar)
+ static void view3d_main_region_exit(wmWindowManager *wm, ARegion *ar)
{
RegionView3D *rv3d = ar->regiondata;
diff --cc source/blender/editors/space_view3d/view3d_draw.c
index 3c325f7,9393092..e0aa257
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@@ -4045,10 -4040,9 +4044,10 @@@ void view3d_main_region_draw(const bCon
clip_border = (render_border && !BLI_rcti_compare(&ar->drawrct, &border_rect));
/* draw viewport using opengl */
- if (v3d->drawtype != OB_RENDER || !view3d_main_area_do_render_draw(scene) || clip_border) {
- view3d_main_area_draw_objects(C, scene, v3d, ar, &grid_unit);
+ if (v3d->drawtype != OB_RENDER || !view3d_main_region_do_render_draw(scene) || clip_border) {
+ view3d_main_region_draw_objects(C, scene, v3d, ar, &grid_unit);
-
+ update_widgets = false; /* widgets were updated in view3d_main_area_draw_objects */
+
#ifdef DEBUG_DRAW
bl_debug_draw();
#endif
@@@ -4060,19 -4054,9 +4059,19 @@@
/* draw viewport using external renderer */
if (v3d->drawtype == OB_RENDER)
- view3d_main_area_draw_engine(C, scene, ar, v3d, clip_border, &border_rect);
+ view3d_main_region_draw_engine(C, scene, ar, v3d, clip_border, &border_rect);
- view3d_main_area_setup_view(scene, v3d, ar, NULL, NULL);
++ view3d_main_region_setup_view(scene, v3d, ar, NULL, NULL);
+ glClear(GL_DEPTH_BUFFER_BIT);
+
+ if (update_widgets) {
+ WM_widgetmap_widgets_update(C, ar->widgetmaps.first);
+ }
+ WM_widgetmap_widgets_draw(C, ar->widgetmaps.first, false, true);
+
+ ED_region_pixelspace(ar);
+
- view3d_main_area_draw_info(C, scene, ar, v3d, grid_unit, render_border);
+ view3d_main_region_draw_info(C, scene, ar, v3d, grid_unit, render_border);
v3d->flag |= V3D_INVALID_BACKBUF;
}
diff --cc source/blender/editors/transform/transform_manipulator.c
index 6a474ce,8131758..6644f4a
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@@ -599,10 -315,10 +599,10 @@@ static int calc_manipulator_stats(cons
}
} /* end editmesh */
else if (obedit->type == OB_ARMATURE) {
- bArmature *arm = obedit->data;
+ const bArmature *arm = obedit->data;
EditBone *ebo;
- if ((v3d->around == V3D_ACTIVE) && (ebo = arm->act_edbone)) {
+ if ((v3d->around == V3D_AROUND_ACTIVE) && (ebo = arm->act_edbone)) {
/* doesn't check selection or visibility intentionally */
if (ebo->flag & BONE_TIPSEL) {
calc_tw_center(scene, ebo->tail);
@@@ -744,13 -460,12 +744,13 @@@
}
else if (ob && (ob->mode & OB_MODE_POSE)) {
bPoseChannel *pchan;
- int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed
+ int mode = TFM_ROTATION; /* mislead counting bones... bah. We don't know the manipulator mode, could be mixed */
bool ok = false;
- if ((ob->lay & v3d->lay) == 0) return 0;
+ if ((ob->lay & v3d->lay) == 0)
+ return 0;
- if ((v3d->around == V3D_ACTIVE) && (pchan = BKE_pose_channel_active(ob))) {
+ if ((v3d->around == V3D_AROUND_ACTIVE) && (pchan = BKE_pose_channel_active(ob))) {
/* doesn't check selection or visibility intentionally */
Bone *bone = pchan->bone;
if (bone) {
@@@ -906,56 -638,230 +906,56 @@@ static void manipulator_drawflags_refre
}
}
-
-/* ******************** DRAWING STUFFIES *********** */
-
-static float screen_aligned(RegionView3D *rv3d, float mat[4][4])
-{
- glTranslate3fv(mat[3]);
-
- /* sets view screen aligned */
- glRotatef(-360.0f * saacos(rv3d->viewquat[0]) / (float)M_PI, rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]);
-
- return len_v3(mat[0]); /* draw scale */
-}
-
-
-/* radring = radius of doughnut rings
- * radhole = radius hole
- * start = starting segment (based on nrings)
- * end = end segment
- * nsides = amount of points in ring
- * nrigns = amount of rings
- */
-static void partial_doughnut(float radring, float radhole, int start, int end, int nsides, int nrings)
+static void manipulator_prepare_mat(Scene *scene, View3D *v3d, RegionView3D *rv3d)
{
- float theta, phi, theta1;
- float cos_theta, sin_theta;
- float cos_theta1, sin_theta1;
- float ring_delta, side_delta;
- int i, j, do_caps = true;
-
- if (start == 0 && end == nrings) do_caps = false;
-
- ring_delta = 2.0f * (float)M_PI / (float)nrings;
- side_delta = 2.0f * (float)M_PI / (float)nsides;
-
- theta = (float)M_PI + 0.5f * ring_delta;
- cos_theta = cosf(theta);
- sin_theta = sinf(theta);
-
- for (i = nrings - 1; i >= 0; i--) {
- theta1 = theta + ring_delta;
- cos_theta1 = cosf(theta1);
- sin_theta1 = sinf(theta1);
-
- if (do_caps && i == start) { // cap
- glBegin(GL_POLYGON);
- phi = 0.0;
- for (j = nsides; j >= 0; j--) {
- float cos_
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list