[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47217] branches/soc-2011-tomato/source/ blender: rename macros for mask point selection - were a bit confusing.
Campbell Barton
ideasman42 at gmail.com
Wed May 30 13:52:44 CEST 2012
Revision: 47217
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47217
Author: campbellbarton
Date: 2012-05-30 11:52:44 +0000 (Wed, 30 May 2012)
Log Message:
-----------
rename macros for mask point selection - were a bit confusing.
Modified Paths:
--------------
branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
branches/soc-2011-tomato/source/blender/blenkernel/intern/curve.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c
branches/soc-2011-tomato/source/blender/editors/mask/mask_ops.c
branches/soc-2011-tomato/source/blender/editors/mask/mask_relationships.c
branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c
branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_mask.h 2012-05-30 11:52:44 UTC (rev 47217)
@@ -135,16 +135,16 @@
/* rasterization */
void BKE_mask_rasterize(struct Mask *mask, int width, int height, float *buffer);
-#define MASKPOINT_ISSEL(p) ( ((p)->bezt.f1 | (p)->bezt.f2 | (p)->bezt.f2) & SELECT)
-#define MASKPOINT_SEL(p) { (p)->bezt.f1 |= SELECT; (p)->bezt.f2 |= SELECT; (p)->bezt.f3 |= SELECT; } (void)0
-#define MASKPOINT_DESEL(p) { (p)->bezt.f1 &= ~SELECT; (p)->bezt.f2 &= ~SELECT; (p)->bezt.f3 &= ~SELECT; } (void)0
-#define MASKPOINT_INVSEL(p) { (p)->bezt.f1 ^= SELECT; (p)->bezt.f2 ^= SELECT; (p)->bezt.f3 ^= SELECT; } (void)0
+#define MASKPOINT_ISSEL_ANY(p) ( ((p)->bezt.f1 | (p)->bezt.f2 | (p)->bezt.f2) & SELECT)
+#define MASKPOINT_ISSEL_KNOT(p) ( (p)->bezt.f2 & SELECT)
+#define MASKPOINT_ISSEL_HANDLE_ONLY(p) ( (((p)->bezt.f1 | (p)->bezt.f2) & SELECT) && (((p)->bezt.f2 & SELECT) == 0) )
+#define MASKPOINT_ISSEL_HANDLE(p) ( (((p)->bezt.f1 | (p)->bezt.f2) & SELECT) )
-#define MASKPOINT_CV_ISSEL(p) ( (p)->bezt.f2 & SELECT)
+#define MASKPOINT_SEL_ALL(p) { (p)->bezt.f1 |= SELECT; (p)->bezt.f2 |= SELECT; (p)->bezt.f3 |= SELECT; } (void)0
+#define MASKPOINT_DESEL_ALL(p) { (p)->bezt.f1 &= ~SELECT; (p)->bezt.f2 &= ~SELECT; (p)->bezt.f3 &= ~SELECT; } (void)0
+#define MASKPOINT_INVSEL_ALL(p) { (p)->bezt.f1 ^= SELECT; (p)->bezt.f2 ^= SELECT; (p)->bezt.f3 ^= SELECT; } (void)0
-#define MASKPOINT_HANDLE_ONLY_ISSEL(p) ( (((p)->bezt.f1 | (p)->bezt.f2) & SELECT) && (((p)->bezt.f2 & SELECT) == 0) )
-#define MASKPOINT_HANDLE_ISSEL(p) ( (((p)->bezt.f1 | (p)->bezt.f2) & SELECT) )
-#define MASKPOINT_HANDLE_SEL(p) { (p)->bezt.f1 |= SELECT; (p)->bezt.f3 |= SELECT; } (void)0
-#define MASKPOINT_HANDLE_DESEL(p) { (p)->bezt.f1 &= ~SELECT; (p)->bezt.f3 &= ~SELECT; } (void)0
+#define MASKPOINT_SEL_HANDLE(p) { (p)->bezt.f1 |= SELECT; (p)->bezt.f3 |= SELECT; } (void)0
+#define MASKPOINT_DESEL_HANDLE(p) { (p)->bezt.f1 &= ~SELECT; (p)->bezt.f3 &= ~SELECT; } (void)0
#endif
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/curve.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/curve.c 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/curve.c 2012-05-30 11:52:44 UTC (rev 47217)
@@ -3200,8 +3200,7 @@
else {
BPoint *bp = nu->bp;
- for (i = 0; i < nu->pntsu * nu->pntsv; i++, bp++) {
- copy_v3_v3(co, bp->vec); co += 3;
+ for (i = 0; i < nu->pntsu * nu->pntsv; i++, bp++) { copy_v3_v3(co, bp->vec); co += 3;
}
}
}
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c 2012-05-30 11:52:44 UTC (rev 47217)
@@ -655,10 +655,10 @@
int i;
if (select) {
- MASKPOINT_SEL(point);
+ MASKPOINT_SEL_ALL(point);
}
else {
- MASKPOINT_DESEL(point);
+ MASKPOINT_DESEL_ALL(point);
}
for (i = 0; i < point->tot_uw; i++) {
@@ -674,10 +674,10 @@
void BKE_mask_point_select_set_handle(MaskSplinePoint *point, int select)
{
if (select) {
- MASKPOINT_HANDLE_SEL(point);
+ MASKPOINT_SEL_HANDLE(point);
}
else {
- MASKPOINT_HANDLE_DESEL(point);
+ MASKPOINT_DESEL_HANDLE(point);
}
}
Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c 2012-05-30 11:52:44 UTC (rev 47217)
@@ -124,7 +124,7 @@
int sel = FALSE;
if (j == 0) {
- sel = MASKPOINT_ISSEL(point);
+ sel = MASKPOINT_ISSEL_ANY(point);
}
else {
sel = point->uw[j - 1].flag & SELECT;
@@ -174,7 +174,7 @@
}
/* draw CV point */
- if (MASKPOINT_CV_ISSEL(point)) {
+ if (MASKPOINT_ISSEL_KNOT(point)) {
if (point == maskobj->act_point)
glColor3f(1.0f, 1.0f, 1.0f);
else
@@ -189,7 +189,7 @@
/* draw handle points */
if (has_handle) {
- if (MASKPOINT_HANDLE_ISSEL(point)) {
+ if (MASKPOINT_ISSEL_HANDLE(point)) {
if (point == maskobj->act_point)
glColor3f(1.0f, 1.0f, 1.0f);
else
Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_ops.c 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_ops.c 2012-05-30 11:52:44 UTC (rev 47217)
@@ -660,7 +660,7 @@
ED_mask_select_flush_all(mask);
}
}
- else if (!MASKPOINT_ISSEL(slidedata->point)) {
+ else if (!MASKPOINT_ISSEL_ANY(slidedata->point)) {
ED_mask_select_toggle_all(mask, SEL_DESELECT);
BKE_mask_point_select_set(slidedata->point, TRUE);
@@ -963,7 +963,7 @@
BKE_mask_parent_init(&new_point->parent);
/* select new point */
- MASKPOINT_SEL(new_point);
+ MASKPOINT_SEL_ALL(new_point);
ED_mask_select_flush_all(mask);
}
@@ -1040,7 +1040,7 @@
for (i = 0; i < cur_spline->tot_point; i++) {
MaskSplinePoint *cur_point = &cur_spline->points[i];
- if (MASKPOINT_ISSEL(cur_point)) {
+ if (MASKPOINT_ISSEL_ANY(cur_point)) {
if (*spline != NULL && *spline != cur_spline) {
*spline = NULL;
*point = NULL;
@@ -1088,7 +1088,7 @@
point_index = (point - spline->points);
- MASKPOINT_DESEL(point);
+ MASKPOINT_DESEL_ALL(point);
if ((spline->flag & MASK_SPLINE_CYCLIC) ||
(point_index > 0 && point_index != spline->tot_point - 1))
@@ -1222,7 +1222,7 @@
RNA_float_get_array(op->ptr, "location", co);
- if (maskobj && maskobj->act_point && MASKPOINT_ISSEL(maskobj->act_point)) {
+ if (maskobj && maskobj->act_point && MASKPOINT_ISSEL_ANY(maskobj->act_point)) {
/* cheap trick - double click for cyclic */
MaskSpline *spline = maskobj->act_spline;
@@ -1469,7 +1469,7 @@
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
- if (!MASKPOINT_ISSEL(point))
+ if (!MASKPOINT_ISSEL_ANY(point))
count++;
}
@@ -1495,7 +1495,7 @@
for (i = 0, j = 0; i < tot_point_orig; i++) {
MaskSplinePoint *point = &spline->points[i];
- if (!MASKPOINT_ISSEL(point)) {
+ if (!MASKPOINT_ISSEL_ANY(point)) {
if (point == maskobj->act_point)
maskobj->act_point = &new_points[j];
@@ -1571,7 +1571,7 @@
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
- if (MASKPOINT_ISSEL(point)) {
+ if (MASKPOINT_ISSEL_ANY(point)) {
BezTriple *bezt = &point->bezt;
bezt->h1 = bezt->h2 = handle_type;
Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_relationships.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_relationships.c 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_relationships.c 2012-05-30 11:52:44 UTC (rev 47217)
@@ -74,7 +74,7 @@
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
- if (MASKPOINT_ISSEL(point)) {
+ if (MASKPOINT_ISSEL_ANY(point)) {
point->parent.flag &= ~MASK_PARENT_ACTIVE;
}
}
@@ -144,7 +144,7 @@
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
- if (MASKPOINT_ISSEL(point)) {
+ if (MASKPOINT_ISSEL_ANY(point)) {
point->parent.id_type = ID_MC;
point->parent.id = &clip->id;
strcpy(point->parent.parent, tracking->name);
Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c 2012-05-30 11:52:44 UTC (rev 47217)
@@ -64,7 +64,7 @@
for (i = 0; i < tot_point; i++) {
MaskSplinePoint *point = &points[i];
- if (MASKPOINT_ISSEL(point))
+ if (MASKPOINT_ISSEL_ANY(point))
return TRUE;
}
@@ -159,7 +159,7 @@
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *cur_point = &spline->points[i];
- if (MASKPOINT_ISSEL(cur_point)) {
+ if (MASKPOINT_ISSEL_ANY(cur_point)) {
spline->flag |= SELECT;
}
else {
@@ -248,7 +248,7 @@
maskobj->act_spline = spline;
maskobj->act_point = point;
- if (!MASKPOINT_HANDLE_ISSEL(point)) {
+ if (!MASKPOINT_ISSEL_HANDLE(point)) {
BKE_mask_point_select_set_handle(point, TRUE);
}
else if (toggle) {
@@ -270,7 +270,7 @@
maskobj->act_spline = spline;
maskobj->act_point = point;
- if (!MASKPOINT_ISSEL(point)) {
+ if (!MASKPOINT_ISSEL_ANY(point)) {
BKE_mask_point_select_set(point, TRUE);
}
else if (toggle) {
Modified: branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c 2012-05-30 10:24:34 UTC (rev 47216)
+++ branches/soc-2011-tomato/source/blender/editors/transform/transform_conversions.c 2012-05-30 11:52:44 UTC (rev 47217)
@@ -5890,7 +5890,7 @@
{
BezTriple *bezt = &point->bezt;
float aspx, aspy;
- short is_sel_point = MASKPOINT_ISSEL(point);
+ short is_sel_point = MASKPOINT_ISSEL_ANY(point);
tdm->point = point;
copy_m3_m3(tdm->vec, bezt->vec);
@@ -5994,8 +5994,8 @@
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
- if (MASKPOINT_ISSEL(point)) {
- if (MASKPOINT_CV_ISSEL(point))
+ if (MASKPOINT_ISSEL_ANY(point)) {
+ if (MASKPOINT_ISSEL_KNOT(point))
countsel += 3;
else
countsel += 1;
@@ -6033,10 +6033,10 @@
for (i = 0; i < spline->tot_point; i++) {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list