forked from bartvdbraak/blender
code cleanup:
make vertex/weight flag names consistent ME_EDIT_VERT_SEL --> ME_EDIT_PAINT_VERT_SEL ME_EDIT_PAINT_MASK --> ME_EDIT_PAINT_FACE_SEL also remove unused header BLO_soundfile.h
This commit is contained in:
parent
4c5093ad48
commit
7dca6dbf0b
@ -114,7 +114,7 @@ typedef struct Global {
|
||||
#define G_BACKBUFSEL (1 << 4)
|
||||
#define G_PICKSEL (1 << 5)
|
||||
|
||||
/* #define G_FACESELECT (1 << 8) use (mesh->editflag & ME_EDIT_PAINT_MASK) */
|
||||
/* #define G_FACESELECT (1 << 8) use (mesh->editflag & ME_EDIT_PAINT_FACE_SEL) */
|
||||
|
||||
#define G_SCRIPT_AUTOEXEC (1 << 13)
|
||||
#define G_SCRIPT_OVERRIDE_PREF (1 << 14) /* when this flag is set ignore the userprefs */
|
||||
|
@ -154,7 +154,7 @@ int paint_facesel_test(Object *ob)
|
||||
return ( (ob != NULL) &&
|
||||
(ob->type == OB_MESH) &&
|
||||
(ob->data != NULL) &&
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) &&
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_FACE_SEL) &&
|
||||
(ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))
|
||||
);
|
||||
}
|
||||
@ -165,7 +165,7 @@ int paint_vertsel_test(Object *ob)
|
||||
return ( (ob != NULL) &&
|
||||
(ob->type == OB_MESH) &&
|
||||
(ob->data != NULL) &&
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) &&
|
||||
(((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_VERT_SEL) &&
|
||||
(ob->mode & OB_MODE_WEIGHT_PAINT)
|
||||
);
|
||||
}
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
#ifndef __BLO_SOUNDFILE_H__
|
||||
#define __BLO_SOUNDFILE_H__
|
||||
|
||||
/** \file BLO_soundfile.h
|
||||
* \ingroup blenloader
|
||||
*/
|
||||
|
||||
#include "DNA_sound_types.h"
|
||||
#include "DNA_packedFile_types.h"
|
||||
|
||||
struct bSound;
|
||||
struct PackedFile;
|
||||
|
||||
#endif
|
||||
|
@ -52,7 +52,6 @@ set(SRC
|
||||
BLO_blend_defs.h
|
||||
BLO_readfile.h
|
||||
BLO_runtime.h
|
||||
BLO_soundfile.h
|
||||
BLO_sys_types.h
|
||||
BLO_undofile.h
|
||||
BLO_writefile.h
|
||||
|
@ -666,8 +666,8 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
|
||||
*err_str = NULL;
|
||||
|
||||
/* count triangles and create mask */
|
||||
if ((use_face_sel = ((me->editflag & ME_EDIT_PAINT_MASK) != 0)) ||
|
||||
(use_vert_sel = ((me->editflag & ME_EDIT_VERT_SEL) != 0)))
|
||||
if ((use_face_sel = ((me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0)) ||
|
||||
(use_vert_sel = ((me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0)))
|
||||
{
|
||||
mask = MEM_callocN(sizeof(int) * me->totvert, "heat_bone_weighting mask");
|
||||
|
||||
|
@ -88,7 +88,7 @@ static int vertex_group_use_vert_sel(Object *ob)
|
||||
if (ob->mode == OB_MODE_EDIT) {
|
||||
return TRUE;
|
||||
}
|
||||
else if (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) {
|
||||
else if (ob->type == OB_MESH && ((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_VERT_SEL) {
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
@ -1410,7 +1410,7 @@ static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength,
|
||||
Mesh *me = ob->data;
|
||||
MVert *mvert = me->mvert;
|
||||
int *verts = NULL;
|
||||
if (!(me->editflag & ME_EDIT_VERT_SEL))
|
||||
if (!(me->editflag & ME_EDIT_PAINT_VERT_SEL))
|
||||
return;
|
||||
for (i = 0; i < me->totvert && mvert; i++, mvert++) {
|
||||
if (mvert->flag & SELECT) {
|
||||
@ -2071,7 +2071,7 @@ void ED_vgroup_mirror(Object *ob, const short mirror_weights, const short flip_v
|
||||
/* object mode / weight paint */
|
||||
MVert *mv, *mv_mirr;
|
||||
int vidx, vidx_mirr;
|
||||
const int use_vert_sel = (me->editflag & ME_EDIT_VERT_SEL) != 0;
|
||||
const int use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
|
||||
|
||||
if (me->dvert == NULL) {
|
||||
goto cleanup;
|
||||
|
@ -3344,7 +3344,7 @@ static void project_paint_begin(ProjPaintState *ps)
|
||||
|
||||
tpage = project_paint_face_image(ps, ps->dm_mtface, face_index);
|
||||
|
||||
if (tpage && ((((Mesh *)ps->ob->data)->editflag & ME_EDIT_PAINT_MASK) == 0 || mf->flag & ME_FACE_SEL)) {
|
||||
if (tpage && ((((Mesh *)ps->ob->data)->editflag & ME_EDIT_PAINT_FACE_SEL) == 0 || mf->flag & ME_FACE_SEL)) {
|
||||
|
||||
float *v1coSS, *v2coSS, *v3coSS, *v4coSS = NULL;
|
||||
|
||||
@ -5104,7 +5104,7 @@ static int texture_paint_init(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
pop->s.ob = ob;
|
||||
pop->s.do_facesel = (me->editflag & ME_EDIT_PAINT_MASK) != 0;
|
||||
pop->s.do_facesel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
|
||||
|
||||
/* for non prohect paint we need */
|
||||
/* fill in derived mesh */
|
||||
@ -5705,7 +5705,7 @@ static int image_paint_sample_color_poll(bContext *C)
|
||||
if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
|
||||
Mesh *me = BKE_mesh_from_object(obact);
|
||||
if (me) {
|
||||
return !(me->editflag & ME_EDIT_PAINT_MASK);
|
||||
return !(me->editflag & ME_EDIT_PAINT_FACE_SEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ static void do_shared_vertex_tesscol(Mesh *me)
|
||||
{
|
||||
/* if no mcol: do not do */
|
||||
/* if tface: only the involved faces, otherwise all */
|
||||
const int use_face_sel = (me->editflag & ME_EDIT_PAINT_MASK);
|
||||
const int use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL);
|
||||
MFace *mface;
|
||||
int a;
|
||||
short *scolmain, *scol;
|
||||
@ -284,7 +284,7 @@ static void do_shared_vertex_tesscol(Mesh *me)
|
||||
|
||||
static void do_shared_vertexcol(Mesh *me, int do_tessface)
|
||||
{
|
||||
const int use_face_sel = (me->editflag & ME_EDIT_PAINT_MASK);
|
||||
const int use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL);
|
||||
MPoly *mp;
|
||||
float (*scol)[4];
|
||||
int i, j, has_shared = 0;
|
||||
@ -459,7 +459,7 @@ void vpaint_fill(Object *ob, unsigned int paintcol)
|
||||
if (!me->mloopcol) return; /* possible we can't make mcol's */
|
||||
|
||||
|
||||
selected = (me->editflag & ME_EDIT_PAINT_MASK);
|
||||
selected = (me->editflag & ME_EDIT_PAINT_FACE_SEL);
|
||||
|
||||
mp = me->mpoly;
|
||||
for (i = 0; i < me->totpoly; i++, mp++) {
|
||||
@ -1030,7 +1030,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
me = BKE_mesh_from_object(vc.obact);
|
||||
|
||||
if (me && me->dvert && vc.v3d && vc.rv3d) {
|
||||
const int use_vert_sel = (me->editflag & ME_EDIT_VERT_SEL) != 0;
|
||||
const int use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
|
||||
int v_idx_best = -1;
|
||||
unsigned int index;
|
||||
|
||||
@ -1115,7 +1115,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA
|
||||
|
||||
if (me && me->dvert && vc.v3d && vc.rv3d && vc.obact->defbase.first) {
|
||||
const int defbase_tot = BLI_countlist(&vc.obact->defbase);
|
||||
const int use_vert_sel = (me->editflag & ME_EDIT_VERT_SEL) != 0;
|
||||
const int use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
|
||||
int *groups = MEM_callocN(defbase_tot * sizeof(int), "groups");
|
||||
int found = FALSE;
|
||||
unsigned int index;
|
||||
@ -2006,10 +2006,10 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
|
||||
mesh_octree_table(NULL, NULL, NULL, 'e');
|
||||
mesh_mirrtopo_table(NULL, 'e');
|
||||
|
||||
if (me->editflag & ME_EDIT_VERT_SEL) {
|
||||
if (me->editflag & ME_EDIT_PAINT_VERT_SEL) {
|
||||
BKE_mesh_flush_select_from_verts(me);
|
||||
}
|
||||
else if (me->editflag & ME_EDIT_PAINT_MASK) {
|
||||
else if (me->editflag & ME_EDIT_PAINT_FACE_SEL) {
|
||||
BKE_mesh_flush_select_from_polys(me);
|
||||
}
|
||||
}
|
||||
@ -2241,14 +2241,14 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
|
||||
|
||||
swap_m4m4(wpd->vc.rv3d->persmat, mat);
|
||||
|
||||
use_vert_sel = (me->editflag & ME_EDIT_VERT_SEL) != 0;
|
||||
use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
|
||||
|
||||
/* which faces are involved */
|
||||
if (wp->flag & VP_AREA) {
|
||||
/* Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell */
|
||||
me->editflag &= ~ME_EDIT_VERT_SEL;
|
||||
me->editflag &= ~ME_EDIT_PAINT_VERT_SEL;
|
||||
totindex = sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
|
||||
me->editflag |= use_vert_sel ? ME_EDIT_VERT_SEL : 0;
|
||||
me->editflag |= use_vert_sel ? ME_EDIT_PAINT_VERT_SEL : 0;
|
||||
}
|
||||
else {
|
||||
indexar[0] = view3d_sample_backbuf(vc, mval[0], mval[1]);
|
||||
@ -2256,7 +2256,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
|
||||
else totindex = 0;
|
||||
}
|
||||
|
||||
if ((me->editflag & ME_EDIT_PAINT_MASK) && me->mpoly) {
|
||||
if ((me->editflag & ME_EDIT_PAINT_FACE_SEL) && me->mpoly) {
|
||||
for (index = 0; index < totindex; index++) {
|
||||
if (indexar[index] && indexar[index] <= me->totpoly) {
|
||||
MPoly *mpoly = ((MPoly *)me->mpoly) + (indexar[index] - 1);
|
||||
@ -2496,7 +2496,7 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */
|
||||
|
||||
ob->mode &= ~OB_MODE_VERTEX_PAINT;
|
||||
|
||||
if (me->editflag & ME_EDIT_PAINT_MASK) {
|
||||
if (me->editflag & ME_EDIT_PAINT_FACE_SEL) {
|
||||
BKE_mesh_flush_select_from_polys(me);
|
||||
}
|
||||
}
|
||||
@ -2793,7 +2793,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
|
||||
else totindex = 0;
|
||||
}
|
||||
|
||||
if ((me->editflag & ME_EDIT_PAINT_MASK) && me->mpoly) {
|
||||
if ((me->editflag & ME_EDIT_PAINT_FACE_SEL) && me->mpoly) {
|
||||
for (index = 0; index < totindex; index++) {
|
||||
if (indexar[index] && indexar[index] <= me->totpoly) {
|
||||
MPoly *mpoly = ((MPoly *)me->mpoly) + (indexar[index] - 1);
|
||||
@ -3124,7 +3124,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
|
||||
copy_wpaint_prev(wp, me->dvert, me->totvert);
|
||||
|
||||
/* on init only, convert face -> vert sel */
|
||||
if (me->editflag & ME_EDIT_PAINT_MASK) {
|
||||
if (me->editflag & ME_EDIT_PAINT_FACE_SEL) {
|
||||
BKE_mesh_flush_select_from_polys(me);
|
||||
}
|
||||
|
||||
@ -3137,7 +3137,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
|
||||
data.sco_end = sco_end;
|
||||
data.sco_line_div = 1.0f / len_v2v2(sco_start, sco_end);
|
||||
data.def_nr = ob->actdef - 1;
|
||||
data.use_select = (me->editflag & (ME_EDIT_PAINT_MASK | ME_EDIT_VERT_SEL));
|
||||
data.use_select = (me->editflag & (ME_EDIT_PAINT_FACE_SEL | ME_EDIT_PAINT_VERT_SEL));
|
||||
data.vert_cache = gesture->userdata;
|
||||
data.type = RNA_enum_get(op->ptr, "type");
|
||||
|
||||
|
@ -7106,7 +7106,7 @@ static void bbs_mesh_solid(Scene *scene, Object *ob)
|
||||
|
||||
glColor3ub(0, 0, 0);
|
||||
|
||||
if ((me->editflag & ME_EDIT_PAINT_MASK))
|
||||
if ((me->editflag & ME_EDIT_PAINT_FACE_SEL))
|
||||
dm->drawMappedFaces(dm, bbs_mesh_solid_hide__setDrawOpts, GPU_enable_material, NULL, me, 0);
|
||||
else
|
||||
dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, GPU_enable_material, NULL, me, 0);
|
||||
@ -7160,7 +7160,7 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
|
||||
}
|
||||
else {
|
||||
Mesh *me = ob->data;
|
||||
if ((me->editflag & ME_EDIT_VERT_SEL) &&
|
||||
if ((me->editflag & ME_EDIT_PAINT_VERT_SEL) &&
|
||||
/* currently vertex select only supports weight paint */
|
||||
(ob->mode & OB_MODE_WEIGHT_PAINT))
|
||||
{
|
||||
|
@ -147,15 +147,15 @@ typedef struct TFace {
|
||||
#define ME_EDIT_MIRROR_Y (1 << 1) // unused so far
|
||||
#define ME_EDIT_MIRROR_Z (1 << 2) // unused so far
|
||||
|
||||
#define ME_EDIT_PAINT_MASK (1 << 3)
|
||||
#define ME_EDIT_PAINT_FACE_SEL (1 << 3)
|
||||
#define ME_EDIT_MIRROR_TOPO (1 << 4)
|
||||
#define ME_EDIT_VERT_SEL (1 << 5)
|
||||
#define ME_EDIT_PAINT_VERT_SEL (1 << 5)
|
||||
|
||||
/* we cant have both flags enabled at once,
|
||||
* flags defined in DNA_scene_types.h */
|
||||
#define ME_EDIT_PAINT_SEL_MODE(_me) ( \
|
||||
(_me->editflag & ME_EDIT_PAINT_MASK) ? SCE_SELECT_FACE : \
|
||||
(_me->editflag & ME_EDIT_VERT_SEL) ? SCE_SELECT_VERTEX : \
|
||||
(_me->editflag & ME_EDIT_PAINT_FACE_SEL) ? SCE_SELECT_FACE : \
|
||||
(_me->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : \
|
||||
0 \
|
||||
)
|
||||
|
||||
|
@ -152,12 +152,9 @@ void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
static void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Mesh *me = ptr->data;
|
||||
if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
|
||||
me->editflag &= ~ME_EDIT_PAINT_MASK;
|
||||
BKE_mesh_flush_select_from_polys_ex(me->mvert, me->totvert,
|
||||
me->mloop,
|
||||
me->medge, me->totedge,
|
||||
me->mpoly, me->totpoly);
|
||||
if ((me->editflag & ME_EDIT_PAINT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_FACE_SEL)) {
|
||||
me->editflag &= ~ME_EDIT_PAINT_FACE_SEL;
|
||||
BKE_mesh_flush_select_from_polys(me);
|
||||
}
|
||||
rna_Mesh_update_draw(bmain, scene, ptr);
|
||||
}
|
||||
@ -165,8 +162,8 @@ static void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
static void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
Mesh *me = ptr->data;
|
||||
if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
|
||||
me->editflag &= ~ME_EDIT_VERT_SEL;
|
||||
if ((me->editflag & ME_EDIT_PAINT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_FACE_SEL)) {
|
||||
me->editflag &= ~ME_EDIT_PAINT_VERT_SEL;
|
||||
BKE_mesh_flush_select_from_verts(me);
|
||||
}
|
||||
rna_Mesh_update_draw(bmain, scene, ptr);
|
||||
@ -2971,13 +2968,13 @@ static void rna_def_mesh(BlenderRNA *brna)
|
||||
"(for when both sides of mesh have matching, unique topology)");
|
||||
|
||||
prop = RNA_def_property(srna, "use_paint_mask", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_FACE_SEL);
|
||||
RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting");
|
||||
RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Mesh_update_facemask");
|
||||
|
||||
prop = RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_VERT_SEL);
|
||||
RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
|
||||
RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask");
|
||||
|
Loading…
Reference in New Issue
Block a user