code cleanup: use booleans for mesh and selection code.
This commit is contained in:
parent
cb11af8b06
commit
e7c15beaf6
|
@ -212,7 +212,7 @@ void BKE_mesh_calc_normals_mapping_ex(
|
|||
struct MVert *mverts, int numVerts,
|
||||
struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3],
|
||||
struct MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3],
|
||||
const short only_face_normals);
|
||||
const bool only_face_normals);
|
||||
|
||||
void BKE_mesh_calc_normals(
|
||||
struct MVert *mverts, int numVerts,
|
||||
|
|
|
@ -75,7 +75,7 @@ struct DerivedMesh *multires_make_derived_from_derived(struct DerivedMesh *dm,
|
|||
|
||||
struct MultiresModifierData *find_multires_modifier_before(struct Scene *scene,
|
||||
struct ModifierData *lastmd);
|
||||
struct MultiresModifierData *get_multires_modifier(struct Scene *scene, struct Object *ob, int use_first);
|
||||
struct MultiresModifierData *get_multires_modifier(struct Scene *scene, struct Object *ob, bool use_first);
|
||||
struct DerivedMesh *get_multires_dm(struct Scene *scene, struct MultiresModifierData *mmd,
|
||||
struct Object *ob);
|
||||
void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
|
||||
|
|
|
@ -57,12 +57,14 @@
|
|||
|
||||
static RNG *brush_rng;
|
||||
|
||||
void BKE_brush_system_init(void) {
|
||||
void BKE_brush_system_init(void)
|
||||
{
|
||||
brush_rng = BLI_rng_new(0);
|
||||
BLI_rng_srandom(brush_rng, 31415682);
|
||||
}
|
||||
|
||||
void BKE_brush_system_exit(void) {
|
||||
void BKE_brush_system_exit(void)
|
||||
{
|
||||
BLI_rng_free(brush_rng);
|
||||
}
|
||||
|
||||
|
|
|
@ -1814,7 +1814,7 @@ void BKE_mesh_calc_normals_mapping_ex(MVert *mverts, int numVerts,
|
|||
MLoop *mloop, MPoly *mpolys,
|
||||
int numLoops, int numPolys, float (*polyNors_r)[3],
|
||||
MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3],
|
||||
const short only_face_normals)
|
||||
const bool only_face_normals)
|
||||
{
|
||||
float (*pnors)[3] = polyNors_r, (*fnors)[3] = faceNors_r;
|
||||
int i;
|
||||
|
|
|
@ -310,7 +310,7 @@ MultiresModifierData *find_multires_modifier_before(Scene *scene, ModifierData *
|
|||
/* used for applying scale on mdisps layer and syncing subdivide levels when joining objects
|
||||
* use_first - return first multires modifier if all multires'es are disabled
|
||||
*/
|
||||
MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, int use_first)
|
||||
MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, bool use_first)
|
||||
{
|
||||
ModifierData *md;
|
||||
MultiresModifierData *mmd = NULL, *firstmmd = NULL;
|
||||
|
|
|
@ -1037,7 +1037,7 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned
|
|||
}
|
||||
}
|
||||
|
||||
static int ed_marker_select(bContext *C, const wmEvent *event, int extend, int camera)
|
||||
static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool camera)
|
||||
{
|
||||
ListBase *markers = ED_context_get_markers(C);
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
|
@ -1106,8 +1106,8 @@ static int ed_marker_select(bContext *C, const wmEvent *event, int extend, int c
|
|||
|
||||
static int ed_marker_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
short extend = RNA_boolean_get(op->ptr, "extend");
|
||||
short camera = 0;
|
||||
bool extend = RNA_boolean_get(op->ptr, "extend");
|
||||
bool camera = false;
|
||||
#ifdef DURIAN_CAMERA_SWITCH
|
||||
camera = RNA_boolean_get(op->ptr, "camera");
|
||||
#endif
|
||||
|
|
|
@ -454,7 +454,7 @@ static int ebone_select_flag(EditBone *ebone)
|
|||
}
|
||||
|
||||
/* context: editmode armature in view3d */
|
||||
int mouse_armature(bContext *C, const int mval[2], int extend, int deselect, int toggle)
|
||||
bool mouse_armature(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
bArmature *arm = obedit->data;
|
||||
|
@ -550,10 +550,10 @@ int mouse_armature(bContext *C, const int mval[2], int extend, int deselect, int
|
|||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, vc.obedit);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
/* called from editview.c, for mode-less pose selection */
|
||||
/* assumes scene obact and basact is still on old situation */
|
||||
int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, short hits,
|
||||
short extend, short deselect, short toggle)
|
||||
bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
Object *ob = base->object;
|
||||
Bone *nearBone;
|
||||
|
@ -575,7 +575,7 @@ void POSE_OT_select_hierarchy(wmOperatorType *ot)
|
|||
|
||||
/* -------------------------------------- */
|
||||
|
||||
static short pose_select_same_group(bContext *C, Object *ob, short extend)
|
||||
static short pose_select_same_group(bContext *C, Object *ob, bool extend)
|
||||
{
|
||||
bArmature *arm = (ob) ? ob->data : NULL;
|
||||
bPose *pose = (ob) ? ob->pose : NULL;
|
||||
|
@ -607,7 +607,7 @@ static short pose_select_same_group(bContext *C, Object *ob, short extend)
|
|||
}
|
||||
|
||||
/* deselect all bones before selecting new ones? */
|
||||
if ((extend == 0) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
|
||||
if ((extend == false) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
|
||||
pchan->bone->flag &= ~BONE_SELECTED;
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
@ -634,7 +634,7 @@ static short pose_select_same_group(bContext *C, Object *ob, short extend)
|
|||
return changed;
|
||||
}
|
||||
|
||||
static short pose_select_same_layer(bContext *C, Object *ob, short extend)
|
||||
static short pose_select_same_layer(bContext *C, Object *ob, bool extend)
|
||||
{
|
||||
bPose *pose = (ob) ? ob->pose : NULL;
|
||||
bArmature *arm = (ob) ? ob->data : NULL;
|
||||
|
@ -652,7 +652,7 @@ static short pose_select_same_layer(bContext *C, Object *ob, short extend)
|
|||
layers |= pchan->bone->layer;
|
||||
|
||||
/* deselect all bones before selecting new ones? */
|
||||
if ((extend == 0) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
|
||||
if ((extend == false) && (pchan->bone->flag & BONE_UNSELECTABLE) == 0)
|
||||
pchan->bone->flag &= ~BONE_SELECTED;
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
@ -673,7 +673,7 @@ static short pose_select_same_layer(bContext *C, Object *ob, short extend)
|
|||
return changed;
|
||||
}
|
||||
|
||||
static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
|
||||
static int pose_select_same_keyingset(bContext *C, Object *ob, bool extend)
|
||||
{
|
||||
KeyingSet *ks = ANIM_scene_get_active_keyingset(CTX_data_scene(C));
|
||||
KS_Path *ksp;
|
||||
|
@ -690,7 +690,7 @@ static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
|
|||
return 0;
|
||||
|
||||
/* if not extending selection, deselect all selected first */
|
||||
if (extend == 0) {
|
||||
if (extend == false) {
|
||||
CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
|
||||
{
|
||||
if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0)
|
||||
|
|
|
@ -4201,7 +4201,7 @@ void CURVE_OT_make_segment(wmOperatorType *ot)
|
|||
|
||||
/***************** pick select from 3d view **********************/
|
||||
|
||||
int mouse_nurb(bContext *C, const int mval[2], int extend, int deselect, int toggle)
|
||||
bool mouse_nurb(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
Curve *cu = obedit->data;
|
||||
|
@ -4314,10 +4314,10 @@ int mouse_nurb(bContext *C, const int mval[2], int extend, int deselect, int tog
|
|||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/******************** spin operator ***********************/
|
||||
|
|
|
@ -1526,7 +1526,7 @@ static int gp_convert_layer_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
||||
static bool gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
int link_strokes = RNA_boolean_get(ptr, "use_link_strokes");
|
||||
|
@ -1542,7 +1542,7 @@ static int gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
|||
strcmp(prop_id, "radius_multiplier") == 0 ||
|
||||
strcmp(prop_id, "use_link_strokes") == 0)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Never show this prop */
|
||||
|
@ -1550,44 +1550,44 @@ static int gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
|||
return FALSE;
|
||||
|
||||
if (link_strokes) {
|
||||
/* Only show when link_stroke is TRUE */
|
||||
/* Only show when link_stroke is true */
|
||||
if (strcmp(prop_id, "timing_mode") == 0)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (timing_mode != GP_STROKECONVERT_TIMING_NONE) {
|
||||
/* Only show when link_stroke is TRUE and stroke timing is enabled */
|
||||
/* Only show when link_stroke is true and stroke timing is enabled */
|
||||
if (strcmp(prop_id, "frame_range") == 0 ||
|
||||
strcmp(prop_id, "start_frame") == 0)
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only show if we have valid timing data! */
|
||||
if (valid_timing && strcmp(prop_id, "use_realtime") == 0)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
/* Only show if realtime or valid_timing is FALSE! */
|
||||
if ((!realtime || !valid_timing) && strcmp(prop_id, "end_frame") == 0)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
if (valid_timing && timing_mode == GP_STROKECONVERT_TIMING_CUSTOMGAP) {
|
||||
/* Only show for custom gaps! */
|
||||
if (strcmp(prop_id, "gap_duration") == 0)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
/* Only show randomness for non-null custom gaps! */
|
||||
if (strcmp(prop_id, "gap_randomness") == 0 && (gap_duration > 0.0f))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
/* Only show seed for randomize action! */
|
||||
if (strcmp(prop_id, "seed") == 0 && (gap_duration > 0.0f) && (gap_randomness > 0.0f))
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Else, hidden! */
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gp_convert_ui(bContext *C, wmOperator *op)
|
||||
|
|
|
@ -123,8 +123,8 @@ void ED_armature_deselect_all(struct Object *obedit, int toggle);
|
|||
void ED_armature_deselect_all_visible(struct Object *obedit);
|
||||
|
||||
int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer,
|
||||
short hits, short extend, short deselect, short toggle);
|
||||
int mouse_armature(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
|
||||
short hits, bool extend, bool deselect, bool toggle);
|
||||
bool mouse_armature(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
int join_armature_exec(struct bContext *C, struct wmOperator *op);
|
||||
struct Bone *get_indexed_bone(struct Object *ob, int index);
|
||||
float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only);
|
||||
|
|
|
@ -63,7 +63,7 @@ void load_editNurb(struct Object *obedit);
|
|||
void make_editNurb(struct Object *obedit);
|
||||
void free_editNurb(struct Object *obedit);
|
||||
|
||||
int mouse_nurb(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
|
||||
bool mouse_nurb(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
|
||||
struct Nurb *add_nurbs_primitive(struct bContext *C, struct Object *obedit, float mat[4][4], int type, int newob);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ void ED_keymap_metaball(struct wmKeyConfig *keyconf);
|
|||
|
||||
struct MetaElem *add_metaball_primitive(struct bContext *C, struct Object *obedit, float mat[4][4], float dia, int type, int newname);
|
||||
|
||||
int mouse_mball(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
|
||||
bool mouse_mball(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
|
||||
void free_editMball(struct Object *obedit);
|
||||
void make_editMball(struct Object *obedit);
|
||||
|
|
|
@ -74,7 +74,7 @@ struct rcti;
|
|||
|
||||
|
||||
/* editmesh_utils.c */
|
||||
void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const short use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */
|
||||
void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const bool use_select); /* note, replaces EM_cache_x_mirror_vert in trunk */
|
||||
void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to);
|
||||
struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
|
||||
void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
|
||||
|
@ -93,7 +93,7 @@ void EDBM_index_arrays_ensure(struct BMEditMesh *em, const char htype)
|
|||
void EDBM_index_arrays_init(struct BMEditMesh *em, const char htype);
|
||||
void EDBM_index_arrays_free(struct BMEditMesh *em);
|
||||
#ifndef NDEBUG
|
||||
int EDBM_index_arrays_check(struct BMEditMesh *em);
|
||||
bool EDBM_index_arrays_check(struct BMEditMesh *em);
|
||||
#endif
|
||||
struct BMVert *EDBM_vert_at_index(struct BMEditMesh *em, int index);
|
||||
struct BMEdge *EDBM_edge_at_index(struct BMEditMesh *em, int index);
|
||||
|
@ -137,29 +137,29 @@ void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag);
|
|||
|
||||
|
||||
/* editmesh_select.c */
|
||||
void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, int extend);
|
||||
void EDBM_select_mirrored(struct Object *obedit, struct BMEditMesh *em, bool extend);
|
||||
void EDBM_automerge(struct Scene *scene, struct Object *ob, int update);
|
||||
|
||||
int EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
|
||||
bool EDBM_backbuf_border_init(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
|
||||
int EDBM_backbuf_check(unsigned int index);
|
||||
void EDBM_backbuf_free(void);
|
||||
|
||||
int EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot,
|
||||
bool EDBM_backbuf_border_mask_init(struct ViewContext *vc, const int mcords[][2], short tot,
|
||||
short xmin, short ymin, short xmax, short ymax);
|
||||
int EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads);
|
||||
bool EDBM_backbuf_circle_init(struct ViewContext *vc, short xs, short ys, short rads);
|
||||
|
||||
struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *r_dist, const short sel, const short strict);
|
||||
struct BMVert *EDBM_vert_find_nearest(struct ViewContext *vc, float *r_dist, const bool sel, const bool strict);
|
||||
struct BMEdge *EDBM_edge_find_nearest(struct ViewContext *vc, float *r_dist);
|
||||
struct BMFace *EDBM_face_find_nearest(struct ViewContext *vc, float *r_dist);
|
||||
|
||||
int EDBM_select_pick(struct bContext *C, const int mval[2], short extend, short deselect, short toggle);
|
||||
bool EDBM_select_pick(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
|
||||
void EDBM_selectmode_set(struct BMEditMesh *em);
|
||||
void EDBM_selectmode_convert(struct BMEditMesh *em, const short selectmode_old, const short selectmode_new);
|
||||
|
||||
/* user access this */
|
||||
int EDBM_selectmode_toggle(struct bContext *C, const short selectmode_new,
|
||||
const int action, const int use_extend, const int use_expand);
|
||||
bool EDBM_selectmode_toggle(struct bContext *C, const short selectmode_new,
|
||||
const int action, const bool use_extend, const bool use_expand);
|
||||
|
||||
|
||||
void EDBM_deselect_by_material(struct BMEditMesh *em, const short index, const short select);
|
||||
|
@ -183,17 +183,17 @@ void EMBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEd
|
|||
|
||||
/* editface.c */
|
||||
void paintface_flush_flags(struct Object *ob);
|
||||
int paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], int extend, int deselect, int toggle);
|
||||
int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int select, int extend);
|
||||
void paintface_deselect_all_visible(struct Object *ob, int action, short flush_flags);
|
||||
bool paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, bool select, bool extend);
|
||||
void paintface_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
|
||||
void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], int mode);
|
||||
int paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
|
||||
bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
|
||||
|
||||
void paintface_hide(struct Object *ob, const int unselected);
|
||||
void paintface_reveal(struct Object *ob);
|
||||
|
||||
void paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags);
|
||||
void paintvert_select_ungrouped(struct Object *ob, short extend, short flush_flags);
|
||||
void paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
|
||||
void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags);
|
||||
void paintvert_flush_flags(struct Object *ob);
|
||||
|
||||
/* mirrtopo */
|
||||
|
@ -204,9 +204,9 @@ typedef struct MirrTopoStore_t {
|
|||
int prev_ob_mode;
|
||||
} MirrTopoStore_t;
|
||||
|
||||
int ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
|
||||
bool ED_mesh_mirrtopo_recalc_check(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store);
|
||||
void ED_mesh_mirrtopo_init(struct Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store,
|
||||
const short skip_em_vert_array_init);
|
||||
const bool skip_em_vert_array_init);
|
||||
void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
|
||||
|
||||
|
||||
|
@ -286,9 +286,9 @@ int mesh_get_x_mirror_vert(struct Object *ob, int index);
|
|||
struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, const float co[3], int index);
|
||||
int *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em);
|
||||
|
||||
int ED_mesh_pick_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size, int use_zbuf);
|
||||
int ED_mesh_pick_face(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size);
|
||||
int ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size);
|
||||
bool ED_mesh_pick_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size, bool use_zbuf);
|
||||
bool ED_mesh_pick_face(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size);
|
||||
bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size);
|
||||
|
||||
#define ED_MESH_PICK_DEFAULT_VERT_SIZE 50
|
||||
#define ED_MESH_PICK_DEFAULT_FACE_SIZE 3
|
||||
|
|
|
@ -164,7 +164,7 @@ void ED_object_constraint_update(struct Object *ob);
|
|||
void ED_object_constraint_dependency_update(struct Main *bmain, struct Object *ob);
|
||||
|
||||
/* object_lattice.c */
|
||||
int mouse_lattice(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
|
||||
bool mouse_lattice(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
void undo_push_lattice(struct bContext *C, const char *name);
|
||||
|
||||
/* object_lattice.c */
|
||||
|
@ -190,7 +190,7 @@ int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene,
|
|||
struct Object *ob, struct ModifierData *md, int mode);
|
||||
int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
|
||||
|
||||
int ED_object_iter_other(struct Main *bmain, struct Object *orig_ob, int include_orig,
|
||||
int ED_object_iter_other(struct Main *bmain, struct Object *orig_ob, const bool include_orig,
|
||||
int (*callback)(struct Object *ob, void *callback_data),
|
||||
void *callback_data);
|
||||
|
||||
|
|
|
@ -58,10 +58,10 @@ void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra
|
|||
void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
|
||||
|
||||
/* selection tools */
|
||||
int PE_mouse_particles(struct bContext *C, const int mval[2], int extend, int deselect, int toggle);
|
||||
int PE_border_select(struct bContext *C, struct rcti *rect, int select, int extend);
|
||||
int PE_mouse_particles(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
|
||||
int PE_border_select(struct bContext *C, struct rcti *rect, bool select, bool extend);
|
||||
int PE_circle_select(struct bContext *C, int selecting, const int mval[2], float rad);
|
||||
int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, short extend, short select);
|
||||
int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, bool extend, bool select);
|
||||
void PE_deselect_all_visible(struct PTCacheEdit *edit);
|
||||
|
||||
/* undo */
|
||||
|
|
|
@ -264,7 +264,7 @@ void view3d_opengl_read_pixels(struct ARegion *ar, int x, int y, int w, int h, i
|
|||
void view3d_get_transformation(const struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
|
||||
|
||||
/* XXX should move to BLI_math */
|
||||
int edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2]);
|
||||
bool edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2]);
|
||||
|
||||
/* get 3d region from context, also if mouse is in header or toolbar */
|
||||
struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C);
|
||||
|
|
|
@ -608,7 +608,7 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, int x, in
|
|||
uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, const char *tip);
|
||||
|
||||
uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2);
|
||||
int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align);
|
||||
int uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *), const char label_align);
|
||||
|
||||
/* Links
|
||||
*
|
||||
|
@ -762,7 +762,7 @@ void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct Pointe
|
|||
void uiLayoutContextCopy(uiLayout *layout, struct bContextStore *context);
|
||||
const char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing
|
||||
void uiLayoutOperatorButs(const struct bContext *C, struct uiLayout *layout, struct wmOperator *op,
|
||||
int (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
|
||||
bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
|
||||
const char label_align, const short flag);
|
||||
struct MenuType *uiButGetMenuType(uiBut *but);
|
||||
|
||||
|
|
|
@ -2914,7 +2914,7 @@ static void ui_layout_operator_buts__reset_cb(bContext *UNUSED(C), void *op_pt,
|
|||
|
||||
/* this function does not initialize the layout, functions can be called on the layout before and after */
|
||||
void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,
|
||||
int (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
|
||||
bool (*check_prop)(struct PointerRNA *, struct PropertyRNA *),
|
||||
const char label_align, const short flag)
|
||||
{
|
||||
if (!op->properties) {
|
||||
|
|
|
@ -137,7 +137,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
|
|||
* in cases where PROP_HIDDEN flag can't be used for a property.
|
||||
*/
|
||||
int uiDefAutoButsRNA(uiLayout *layout, PointerRNA *ptr,
|
||||
int (*check_prop)(PointerRNA *, PropertyRNA *),
|
||||
bool (*check_prop)(PointerRNA *, PropertyRNA *),
|
||||
const char label_align)
|
||||
{
|
||||
uiLayout *split, *col;
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
#include "io_collada.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "WM_types.h"
|
||||
#include "WM_api.h"
|
||||
|
||||
|
|
|
@ -252,9 +252,9 @@ static int select_exec(bContext *C, wmOperator *op)
|
|||
MaskSpline *spline;
|
||||
MaskSplinePoint *point = NULL;
|
||||
float co[2];
|
||||
short extend = RNA_boolean_get(op->ptr, "extend");
|
||||
short deselect = RNA_boolean_get(op->ptr, "deselect");
|
||||
short toggle = RNA_boolean_get(op->ptr, "toggle");
|
||||
bool extend = RNA_boolean_get(op->ptr, "extend");
|
||||
bool deselect = RNA_boolean_get(op->ptr, "deselect");
|
||||
bool toggle = RNA_boolean_get(op->ptr, "toggle");
|
||||
|
||||
int is_handle = 0;
|
||||
const float threshold = 19;
|
||||
|
@ -263,7 +263,7 @@ static int select_exec(bContext *C, wmOperator *op)
|
|||
|
||||
point = ED_mask_point_find_nearest(C, mask, co, threshold, &masklay, &spline, &is_handle, NULL);
|
||||
|
||||
if (extend == 0 && deselect == 0 && toggle == 0)
|
||||
if (extend == false && deselect == false && toggle == false)
|
||||
ED_mask_select_toggle_all(mask, SEL_DESELECT);
|
||||
|
||||
if (point) {
|
||||
|
|
|
@ -203,7 +203,8 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
|
|||
MLoop *ml;
|
||||
MEdge *med;
|
||||
char *linkflag;
|
||||
int a, b, do_it = TRUE, mark = 0;
|
||||
int a, b, mark = 0;
|
||||
bool do_it = true;
|
||||
|
||||
ehash = BLI_edgehash_new();
|
||||
seamhash = BLI_edgehash_new();
|
||||
|
@ -234,7 +235,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
|
|||
}
|
||||
|
||||
while (do_it) {
|
||||
do_it = FALSE;
|
||||
do_it = false;
|
||||
|
||||
/* expand selection */
|
||||
mp = me->mpoly;
|
||||
|
@ -257,7 +258,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind
|
|||
if (mark) {
|
||||
linkflag[a] = 1;
|
||||
hash_add_face(ehash, mp, me->mloop + mp->loopstart);
|
||||
do_it = TRUE;
|
||||
do_it = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -315,7 +316,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, const int UNUSED(m
|
|||
paintface_flush_flags(ob);
|
||||
}
|
||||
|
||||
void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
|
||||
void paintface_deselect_all_visible(Object *ob, int action, bool flush_flags)
|
||||
{
|
||||
Mesh *me;
|
||||
MPoly *mpoly;
|
||||
|
@ -374,14 +375,15 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
|
|||
}
|
||||
}
|
||||
|
||||
int paintface_minmax(Object *ob, float r_min[3], float r_max[3])
|
||||
bool paintface_minmax(Object *ob, float r_min[3], float r_max[3])
|
||||
{
|
||||
Mesh *me;
|
||||
MPoly *mp;
|
||||
MTexPoly *tf;
|
||||
MLoop *ml;
|
||||
MVert *mvert;
|
||||
int a, b, ok = FALSE;
|
||||
int a, b;
|
||||
bool ok = false;
|
||||
float vec[3], bmat[3][3];
|
||||
|
||||
me = BKE_mesh_from_object(ob);
|
||||
|
@ -404,7 +406,7 @@ int paintface_minmax(Object *ob, float r_min[3], float r_max[3])
|
|||
minmax_v3v3_v3(r_min, r_max, vec);
|
||||
}
|
||||
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
@ -483,7 +485,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
|
|||
}
|
||||
#endif
|
||||
|
||||
int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], int extend, int deselect, int toggle)
|
||||
bool paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
Mesh *me;
|
||||
MPoly *mpoly, *mpoly_sel;
|
||||
|
@ -493,13 +495,13 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
|
|||
me = BKE_mesh_from_object(ob);
|
||||
|
||||
if (!ED_mesh_pick_face(C, ob, mval, &index, ED_MESH_PICK_DEFAULT_FACE_SIZE))
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
if (index >= me->totpoly)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
mpoly_sel = me->mpoly + index;
|
||||
if (mpoly_sel->flag & ME_HIDE) return 0;
|
||||
if (mpoly_sel->flag & ME_HIDE) return false;
|
||||
|
||||
/* clear flags */
|
||||
mpoly = me->mpoly;
|
||||
|
@ -534,10 +536,10 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
|
|||
paintface_flush_flags(ob);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
|
||||
ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
||||
int do_paintface_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
Object *ob = vc->obact;
|
||||
Mesh *me;
|
||||
|
@ -556,8 +558,8 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
|||
|
||||
selar = MEM_callocN(me->totpoly + 1, "selar");
|
||||
|
||||
if (extend == 0 && select) {
|
||||
paintface_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE);
|
||||
if (extend == false && select) {
|
||||
paintface_deselect_all_visible(vc->obact, SEL_DESELECT, false);
|
||||
|
||||
mpoly = me->mpoly;
|
||||
for (a = 1; a <= me->totpoly; a++, mpoly++) {
|
||||
|
@ -652,8 +654,8 @@ void paintvert_flush_flags(Object *ob)
|
|||
}
|
||||
}
|
||||
}
|
||||
/* note: if the caller passes FALSE to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
|
||||
void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
|
||||
/* note: if the caller passes false to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
|
||||
void paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags)
|
||||
{
|
||||
Mesh *me;
|
||||
MVert *mvert;
|
||||
|
@ -712,7 +714,7 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
|
|||
}
|
||||
}
|
||||
|
||||
void paintvert_select_ungrouped(Object *ob, short extend, short flush_flags)
|
||||
void paintvert_select_ungrouped(Object *ob, bool extend, bool flush_flags)
|
||||
{
|
||||
Mesh *me = BKE_mesh_from_object(ob);
|
||||
MVert *mv;
|
||||
|
@ -724,7 +726,7 @@ void paintvert_select_ungrouped(Object *ob, short extend, short flush_flags)
|
|||
}
|
||||
|
||||
if (!extend) {
|
||||
paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE);
|
||||
paintvert_deselect_all_visible(ob, SEL_DESELECT, false);
|
||||
}
|
||||
|
||||
dv = me->dvert;
|
||||
|
@ -769,7 +771,7 @@ static int mirrtopo_vert_sort(const void *v1, const void *v2)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store)
|
||||
bool ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store)
|
||||
{
|
||||
int totvert;
|
||||
int totedge;
|
||||
|
@ -788,16 +790,16 @@ int ED_mesh_mirrtopo_recalc_check(Mesh *me, const int ob_mode, MirrTopoStore_t *
|
|||
(totvert != mesh_topo_store->prev_vert_tot) ||
|
||||
(totedge != mesh_topo_store->prev_edge_tot))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_topo_store,
|
||||
const short skip_em_vert_array_init)
|
||||
const bool skip_em_vert_array_init)
|
||||
{
|
||||
MEdge *medge;
|
||||
BMEditMesh *em = me->edit_btmesh;
|
||||
|
@ -900,7 +902,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, const int ob_mode, MirrTopoStore_t *mesh_to
|
|||
index_lookup = MEM_mallocN(totvert * sizeof(*index_lookup), "mesh_topo_lookup");
|
||||
|
||||
if (em) {
|
||||
if (skip_em_vert_array_init == FALSE) {
|
||||
if (skip_em_vert_array_init == false) {
|
||||
EDBM_index_arrays_ensure(em, BM_VERT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ static Object *make_prim_init(bContext *C, const char *idname,
|
|||
|
||||
*state = 0;
|
||||
if (obedit == NULL || obedit->type != OB_MESH) {
|
||||
obedit = ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer);
|
||||
obedit = ED_object_add_type(C, OB_MESH, loc, rot, false, layer);
|
||||
|
||||
rename_id((ID *)obedit, idname);
|
||||
rename_id((ID *)obedit->data, idname);
|
||||
|
@ -72,7 +72,7 @@ static Object *make_prim_init(bContext *C, const char *idname,
|
|||
*state = 1;
|
||||
}
|
||||
|
||||
*dia = ED_object_new_primitive_matrix(C, obedit, loc, rot, mat, FALSE);
|
||||
*dia = ED_object_new_primitive_matrix(C, obedit, loc, rot, mat, false);
|
||||
|
||||
return obedit;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ static void make_prim_finish(bContext *C, Object *obedit, int *state, int enter_
|
|||
EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX);
|
||||
|
||||
/* only recalc editmode tessface if we are staying in editmode */
|
||||
EDBM_update_generic(em, !exit_editmode, TRUE);
|
||||
EDBM_update_generic(em, !exit_editmode, true);
|
||||
|
||||
/* userdef */
|
||||
if (exit_editmode) {
|
||||
|
@ -134,7 +134,7 @@ void MESH_OT_primitive_plane_add(wmOperatorType *ot)
|
|||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static int add_primitive_cube_exec(bContext *C, wmOperator *op)
|
||||
|
@ -174,7 +174,7 @@ void MESH_OT_primitive_cube_add(wmOperatorType *ot)
|
|||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static const EnumPropertyItem fill_type_items[] = {
|
||||
|
@ -235,7 +235,7 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
|
|||
RNA_def_property_subtype(prop, PROP_DISTANCE);
|
||||
RNA_def_enum(ot->srna, "fill_type", fill_type_items, 0, "Fill Type", "");
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
|
||||
|
@ -296,7 +296,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
|
|||
RNA_def_property_subtype(prop, PROP_DISTANCE);
|
||||
RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Cap Fill Type", "");
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static int add_primitive_cone_exec(bContext *C, wmOperator *op)
|
||||
|
@ -356,7 +356,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
|
|||
RNA_def_property_subtype(prop, PROP_DISTANCE);
|
||||
RNA_def_enum(ot->srna, "end_fill_type", fill_type_items, 1, "Base Fill Type", "");
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static int add_primitive_grid_exec(bContext *C, wmOperator *op)
|
||||
|
@ -409,7 +409,7 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot)
|
|||
prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, FLT_MAX);
|
||||
RNA_def_property_subtype(prop, PROP_DISTANCE);
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
|
||||
|
@ -455,7 +455,7 @@ void MESH_OT_primitive_monkey_add(wmOperatorType *ot)
|
|||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
|
||||
|
@ -507,7 +507,7 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
|
|||
prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, 100.00);
|
||||
RNA_def_property_subtype(prop, PROP_DISTANCE);
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
||||
static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
|
||||
|
@ -559,5 +559,5 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
|
|||
prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00);
|
||||
RNA_def_property_subtype(prop, PROP_DISTANCE);
|
||||
|
||||
ED_object_add_generic_props(ot, TRUE);
|
||||
ED_object_add_generic_props(ot, true);
|
||||
}
|
||||
|
|
|
@ -1200,7 +1200,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
|
|||
|
||||
for (i = 0; i < tot; i++, result++) {
|
||||
BMLoop *l1;
|
||||
BMFace *hitf;
|
||||
BMFace *f_hit;
|
||||
ListBase *lst;
|
||||
Ref *ref;
|
||||
|
||||
|
@ -1233,7 +1233,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
|
|||
continue;
|
||||
}
|
||||
if ((kcd->vc.rv3d->rflag & RV3D_CLIPPING) &&
|
||||
ED_view3d_clipping_test(kcd->vc.rv3d, p, TRUE))
|
||||
ED_view3d_clipping_test(kcd->vc.rv3d, p, true))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1243,7 +1243,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
|
|||
mul_m4_v3(kcd->ob->imat, view);
|
||||
|
||||
if (kcd->cut_through) {
|
||||
hitf = FALSE;
|
||||
f_hit = NULL;
|
||||
}
|
||||
else {
|
||||
/* check if this point is visible in the viewport */
|
||||
|
@ -1267,11 +1267,11 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
|
|||
add_v3_v3(p1, no);
|
||||
|
||||
/* ray cast */
|
||||
hitf = BMBVH_RayCast(bmtree, p1, no, NULL, NULL);
|
||||
f_hit = BMBVH_RayCast(bmtree, p1, no, NULL, NULL);
|
||||
}
|
||||
|
||||
/* ok, if visible add the new point */
|
||||
if (!hitf && !BLI_smallhash_haskey(ehash, (intptr_t)kfe)) {
|
||||
if (!f_hit && !BLI_smallhash_haskey(ehash, (intptr_t)kfe)) {
|
||||
BMEdgeHit hit;
|
||||
|
||||
if (len_squared_v3v3(p, kcd->curr.co) < depsilon_sq ||
|
||||
|
@ -1555,7 +1555,7 @@ static int knife_sample_screen_density(KnifeTool_OpData *kcd, const float radius
|
|||
dis_sq = len_squared_v2v2(kfv->sco, sco);
|
||||
if (dis_sq < radius_sq) {
|
||||
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
|
||||
if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
|
||||
if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, true) == 0) {
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
@ -1634,7 +1634,7 @@ static KnifeEdge *knife_find_closest_edge(KnifeTool_OpData *kcd, float p[3], flo
|
|||
|
||||
interp_v3_v3v3(vec, kfe->v1->cageco, kfe->v2->cageco, lambda);
|
||||
|
||||
if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
|
||||
if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, true) == 0) {
|
||||
cure = kfe;
|
||||
curdis = dis;
|
||||
}
|
||||
|
@ -1725,7 +1725,7 @@ static KnifeVert *knife_find_closest_vert(KnifeTool_OpData *kcd, float p[3], flo
|
|||
dis_sq = len_squared_v2v2(kfv->sco, sco);
|
||||
if (dis_sq < curdis_sq && dis_sq < maxdist_sq) {
|
||||
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
|
||||
if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
|
||||
if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, true) == 0) {
|
||||
curv = kfv;
|
||||
curdis_sq = dis_sq;
|
||||
}
|
||||
|
@ -1933,7 +1933,7 @@ static void remerge_faces(KnifeTool_OpData *kcd)
|
|||
if (BLI_array_count(faces) > 0) {
|
||||
idx = BM_elem_index_get(faces[0]);
|
||||
|
||||
f2 = BM_faces_join(bm, faces, BLI_array_count(faces), TRUE);
|
||||
f2 = BM_faces_join(bm, faces, BLI_array_count(faces), true);
|
||||
if (f2) {
|
||||
BMO_elem_flag_enable(bm, f2, FACE_NEW);
|
||||
BM_elem_index_set(f2, idx); /* set_dirty! *//* BMESH_TODO, check if this is valid or not */
|
||||
|
@ -2144,7 +2144,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
|
|||
|
||||
f2 = BM_face_create_quad_tri(bm,
|
||||
v1, v2, v3, NULL,
|
||||
NULL, FALSE);
|
||||
NULL, false);
|
||||
|
||||
BMO_elem_flag_enable(bm, f2, FACE_NEW);
|
||||
|
||||
|
@ -2184,7 +2184,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
|
|||
BM_elem_attrs_copy(bm, bm, f2, f);
|
||||
|
||||
BM_ITER_ELEM (l1, &liter1, f, BM_LOOPS_OF_FACE) {
|
||||
BM_loop_interp_from_face(bm, l1, f2, TRUE, TRUE);
|
||||
BM_loop_interp_from_face(bm, l1, f2, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2434,11 +2434,11 @@ static ListBase *find_hole(KnifeTool_OpData *kcd, ListBase *fedges)
|
|||
}
|
||||
|
||||
/* Try to find "nice" diagonals - short, and far apart from each other.
|
||||
* If found, return TRUE and make a 'main chain' going across f which uses
|
||||
* If found, return true and make a 'main chain' going across f which uses
|
||||
* the two diagonals and one part of the hole, and a 'side chain' that
|
||||
* completes the hole. */
|
||||
static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, ListBase **mainchain,
|
||||
ListBase **sidechain)
|
||||
static bool find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, ListBase **mainchain,
|
||||
ListBase **sidechain)
|
||||
{
|
||||
float **fco, **hco;
|
||||
BMVert **fv;
|
||||
|
@ -2450,14 +2450,14 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
|
|||
ListBase *chain;
|
||||
BMVert *v;
|
||||
BMIter iter;
|
||||
int nh, nf, i, j, k, m, ax, ay, ok, sep = 0 /* Quite warnings */, bestsep;
|
||||
int nh, nf, i, j, k, m, ax, ay, sep = 0 /* Quite warnings */, bestsep;
|
||||
int besti[2], bestj[2];
|
||||
float d, bestd;
|
||||
|
||||
nh = BLI_countlist(hole);
|
||||
nf = f->len;
|
||||
if (nh < 2 || nf < 3)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
/* Gather 2d projections of hole and face vertex coordinates.
|
||||
* Use best-axis projection - not completely accurate, maybe revisit */
|
||||
|
@ -2518,18 +2518,20 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
|
|||
bestd = FLT_MAX;
|
||||
}
|
||||
for (j = 0; j < nf; j++) {
|
||||
bool ok;
|
||||
|
||||
if (m == 1 && j == bestj[0])
|
||||
continue;
|
||||
d = len_squared_v2v2(hco[i], fco[j]);
|
||||
if (d > bestd)
|
||||
continue;
|
||||
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
for (k = 0; k < nh && ok; k++) {
|
||||
if (k == i || (k + 1) % nh == i)
|
||||
continue;
|
||||
if (isect_line_line_v2(hco[i], fco[j], hco[k], hco[(k + 1) % nh]))
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
}
|
||||
if (!ok)
|
||||
continue;
|
||||
|
@ -2537,7 +2539,7 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
|
|||
if (k == j || (k + 1) % nf == j)
|
||||
continue;
|
||||
if (isect_line_line_v2(hco[i], fco[j], fco[k], fco[(k + 1) % nf]))
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
}
|
||||
if (ok) {
|
||||
besti[m] = i;
|
||||
|
@ -2572,14 +2574,14 @@ static int find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, Li
|
|||
}
|
||||
*sidechain = chain;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMFace *f)
|
||||
static bool knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMFace *f)
|
||||
{
|
||||
/* BMesh *bm = kcd->em->bm; */ /* UNUSED */
|
||||
BMVert *v1, *v2;
|
||||
|
@ -2589,7 +2591,7 @@ static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMF
|
|||
int v1inside, v2inside;
|
||||
|
||||
if (!f)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
v1 = kfe->v1->v;
|
||||
v2 = kfe->v2->v;
|
||||
|
@ -2608,7 +2610,7 @@ static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMF
|
|||
v1inside = l1 ? 0 : BM_face_point_inside_test(f, kfe->v1->co);
|
||||
v2inside = l2 ? 0 : BM_face_point_inside_test(f, kfe->v2->co);
|
||||
if ((l1 && v2inside) || (l2 && v1inside) || (v1inside && v2inside))
|
||||
return TRUE;
|
||||
return true;
|
||||
if (l1 && l2) {
|
||||
/* Can have case where v1 and v2 are on shared chain between two faces.
|
||||
* BM_face_legal_splits does visibility and self-intersection tests,
|
||||
|
@ -2617,7 +2619,7 @@ static int knife_edge_in_face(KnifeTool_OpData *UNUSED(kcd), KnifeEdge *kfe, BMF
|
|||
mid_v3_v3v3(mid, kfe->v1->co, kfe->v2->co);
|
||||
return BM_face_point_inside_test(f, mid);
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Split face f with KnifeEdges on chain. f remains as one side, the face formed is put in *newface.
|
||||
|
@ -2658,7 +2660,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
|
|||
*newface = NULL;
|
||||
}
|
||||
else {
|
||||
*newface = BM_face_split(bm, f, v1, v2, &lnew, NULL, TRUE);
|
||||
*newface = BM_face_split(bm, f, v1, v2, &lnew, NULL, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -2670,7 +2672,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
|
|||
for (l_iter = lnew->next, i = 0; i < nco; l_iter = l_iter->next, i++) {
|
||||
BLI_assert(equals_v3v3(cos[i], l_iter->v->co));
|
||||
if (kcd->select_result) {
|
||||
BM_edge_select_set(bm, l_iter->e, TRUE);
|
||||
BM_edge_select_set(bm, l_iter->e, true);
|
||||
}
|
||||
kverts[i]->v = l_iter->v;
|
||||
}
|
||||
|
@ -2680,7 +2682,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha
|
|||
/* the select chain above doesnt account for the first loop */
|
||||
if (kcd->select_result) {
|
||||
if (lnew) {
|
||||
BM_edge_select_set(bm, lnew->e, TRUE);
|
||||
BM_edge_select_set(bm, lnew->e, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2717,7 +2719,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe
|
|||
if (fnew_kfedges->first)
|
||||
knife_make_face_cuts(kcd, fnew, fnew_kfedges);
|
||||
|
||||
/* find_chain should always remove edges if it returns TRUE,
|
||||
/* find_chain should always remove edges if it returns true,
|
||||
* but guard against infinite loop anyway */
|
||||
count = BLI_countlist(kfedges);
|
||||
if (count >= oldcount) {
|
||||
|
@ -2783,7 +2785,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe
|
|||
knife_make_face_cuts(kcd, fnew2, fnew2_kfedges);
|
||||
if (f == fhole)
|
||||
break;
|
||||
/* find_hole should always remove edges if it returns TRUE,
|
||||
/* find_hole should always remove edges if it returns true,
|
||||
* but guard against infinite loop anyway */
|
||||
count = BLI_countlist(kfedges);
|
||||
if (count >= oldcount) {
|
||||
|
@ -2887,7 +2889,7 @@ static void knifetool_finish_ex(KnifeTool_OpData *kcd)
|
|||
#endif
|
||||
|
||||
EDBM_mesh_normals_update(kcd->em);
|
||||
EDBM_update_generic(kcd->em, TRUE, TRUE);
|
||||
EDBM_update_generic(kcd->em, true, true);
|
||||
}
|
||||
static void knifetool_finish(wmOperator *op)
|
||||
{
|
||||
|
@ -3191,7 +3193,7 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
knife_update_active(kcd);
|
||||
knife_update_header(C, kcd);
|
||||
ED_region_tag_redraw(kcd->ar);
|
||||
do_refresh = TRUE;
|
||||
do_refresh = true;
|
||||
break;
|
||||
case KNF_MODAL_MIDPOINT_OFF:
|
||||
kcd->snap_midpoints = false;
|
||||
|
@ -3200,29 +3202,29 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
knife_update_active(kcd);
|
||||
knife_update_header(C, kcd);
|
||||
ED_region_tag_redraw(kcd->ar);
|
||||
do_refresh = TRUE;
|
||||
do_refresh = true;
|
||||
break;
|
||||
case KNF_MODEL_IGNORE_SNAP_ON:
|
||||
ED_region_tag_redraw(kcd->ar);
|
||||
kcd->ignore_vert_snapping = kcd->ignore_edge_snapping = true;
|
||||
knife_update_header(C, kcd);
|
||||
do_refresh = TRUE;
|
||||
do_refresh = true;
|
||||
break;
|
||||
case KNF_MODEL_IGNORE_SNAP_OFF:
|
||||
ED_region_tag_redraw(kcd->ar);
|
||||
kcd->ignore_vert_snapping = kcd->ignore_edge_snapping = false;
|
||||
knife_update_header(C, kcd);
|
||||
do_refresh = TRUE;
|
||||
do_refresh = true;
|
||||
break;
|
||||
case KNF_MODAL_ANGLE_SNAP_TOGGLE:
|
||||
kcd->angle_snapping = !kcd->angle_snapping;
|
||||
knife_update_header(C, kcd);
|
||||
do_refresh = TRUE;
|
||||
do_refresh = true;
|
||||
break;
|
||||
case KNF_MODAL_CUT_THROUGH_TOGGLE:
|
||||
kcd->cut_through = !kcd->cut_through;
|
||||
knife_update_header(C, kcd);
|
||||
do_refresh = TRUE;
|
||||
do_refresh = true;
|
||||
break;
|
||||
case KNF_MODAL_NEW_CUT:
|
||||
ED_region_tag_redraw(kcd->ar);
|
||||
|
@ -3301,8 +3303,8 @@ void MESH_OT_knife_tool(wmOperatorType *ot)
|
|||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
|
||||
|
||||
RNA_def_boolean(ot->srna, "use_occlude_geometry", TRUE, "Occlude Geometry", "Only cut the front most geometry");
|
||||
RNA_def_boolean(ot->srna, "only_selected", FALSE, "Only Selected", "Only cut selected geometry");
|
||||
RNA_def_boolean(ot->srna, "use_occlude_geometry", true, "Occlude Geometry", "Only cut the front most geometry");
|
||||
RNA_def_boolean(ot->srna, "only_selected", false, "Only Selected", "Only cut selected geometry");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ typedef struct RingSelOpData {
|
|||
BMEdge *eed;
|
||||
NumInput num;
|
||||
|
||||
int extend;
|
||||
int do_cut;
|
||||
bool extend;
|
||||
bool do_cut;
|
||||
} RingSelOpData;
|
||||
|
||||
/* modal loop selection drawing callback */
|
||||
|
@ -186,7 +186,7 @@ static void edgering_sel(RingSelOpData *lcd, int previewlines, int select)
|
|||
BMW_NIL_LAY);
|
||||
|
||||
for (eed = BMW_begin(&walker, eed_start); eed; eed = BMW_step(&walker)) {
|
||||
BM_edge_select_set(em->bm, eed, TRUE);
|
||||
BM_edge_select_set(em->bm, eed, true);
|
||||
}
|
||||
BMW_end(&walker);
|
||||
|
||||
|
@ -276,9 +276,9 @@ static void ringsel_finish(bContext *C, wmOperator *op)
|
|||
const int cuts = RNA_int_get(op->ptr, "number_cuts");
|
||||
const float smoothness = 0.292f * RNA_float_get(op->ptr, "smoothness");
|
||||
#ifdef BMW_EDGERING_NGON
|
||||
const int use_only_quads = FALSE;
|
||||
const bool use_only_quads = false;
|
||||
#else
|
||||
const int use_only_quads = TRUE;
|
||||
const bool use_only_quads = false;
|
||||
#endif
|
||||
|
||||
if (lcd->eed) {
|
||||
|
@ -293,11 +293,11 @@ static void ringsel_finish(bContext *C, wmOperator *op)
|
|||
BM_mesh_esubdivide(em->bm, BM_ELEM_SELECT,
|
||||
smoothness, 0.0f, 0.0f,
|
||||
cuts,
|
||||
SUBDIV_SELECT_LOOPCUT, SUBD_PATH, 0, TRUE,
|
||||
SUBDIV_SELECT_LOOPCUT, SUBD_PATH, 0, true,
|
||||
use_only_quads, 0);
|
||||
|
||||
/* tessface is already re-recalculated */
|
||||
EDBM_update_generic(em, FALSE, TRUE);
|
||||
EDBM_update_generic(em, false, true);
|
||||
|
||||
/* force edge slide to edge select mode in in face select mode */
|
||||
if (em->selectmode & SCE_SELECT_FACE) {
|
||||
|
@ -349,7 +349,7 @@ static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
|
|||
|
||||
|
||||
/* called when modal loop selection gets set up... */
|
||||
static int ringsel_init(bContext *C, wmOperator *op, int do_cut)
|
||||
static int ringsel_init(bContext *C, wmOperator *op, bool do_cut)
|
||||
{
|
||||
RingSelOpData *lcd;
|
||||
|
||||
|
@ -423,7 +423,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
float smoothness = RNA_float_get(op->ptr, "smoothness");
|
||||
int cuts = RNA_int_get(op->ptr, "number_cuts");
|
||||
RingSelOpData *lcd = op->customdata;
|
||||
int show_cuts = 0;
|
||||
bool show_cuts = false;
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
|
@ -471,12 +471,12 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
cuts++;
|
||||
RNA_int_set(op->ptr, "number_cuts", cuts);
|
||||
ringsel_find_edge(lcd, cuts);
|
||||
show_cuts = TRUE;
|
||||
show_cuts = true;
|
||||
}
|
||||
else {
|
||||
smoothness = min_ff(smoothness + 0.05f, 4.0f);
|
||||
RNA_float_set(op->ptr, "smoothness", smoothness);
|
||||
show_cuts = TRUE;
|
||||
show_cuts = true;
|
||||
}
|
||||
|
||||
ED_region_tag_redraw(lcd->ar);
|
||||
|
@ -491,12 +491,12 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
cuts = max_ii(cuts - 1, 0);
|
||||
RNA_int_set(op->ptr, "number_cuts", cuts);
|
||||
ringsel_find_edge(lcd, cuts);
|
||||
show_cuts = TRUE;
|
||||
show_cuts = true;
|
||||
}
|
||||
else {
|
||||
smoothness = max_ff(smoothness - 0.05f, 0.0f);
|
||||
RNA_float_set(op->ptr, "smoothness", smoothness);
|
||||
show_cuts = TRUE;
|
||||
show_cuts = true;
|
||||
}
|
||||
|
||||
ED_region_tag_redraw(lcd->ar);
|
||||
|
@ -534,7 +534,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
|
||||
RNA_int_set(op->ptr, "number_cuts", cuts);
|
||||
ringsel_find_edge(lcd, cuts);
|
||||
show_cuts = TRUE;
|
||||
show_cuts = true;
|
||||
|
||||
ED_region_tag_redraw(lcd->ar);
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ static BMEdge *edbm_ripsel_edge_mark_step(BMVert *v, const int uid)
|
|||
|
||||
BM_edge_loop_pair(e, &l_a, &l_b); /* no need to check, we know this will be true */
|
||||
|
||||
/* so (IS_VISIT_DONE == TRUE) */
|
||||
/* so (IS_VISIT_DONE == true) */
|
||||
BM_elem_index_set(l_a, uid);
|
||||
BM_elem_index_set(l_b, uid);
|
||||
|
||||
|
@ -246,7 +246,7 @@ static EdgeLoopPair *edbm_ripsel_looptag_helper(BMesh *bm)
|
|||
}
|
||||
|
||||
/* set contiguous loops ordered 'uid' values for walking after split */
|
||||
while (TRUE) {
|
||||
while (true) {
|
||||
int tot = 0;
|
||||
BMIter eiter;
|
||||
BMEdge *e_step;
|
||||
|
@ -373,7 +373,7 @@ static void edbm_ripsel_deselect_helper(BMesh *bm, EdgeLoopPair *eloop_pairs,
|
|||
e = (score_a > score_b) ? lp->l_a->e : lp->l_b->e;
|
||||
v_prev = edbm_ripsel_edloop_pair_start_vert(e);
|
||||
for (; e; e = edbm_ripsel_edge_uid_step(e, &v_prev)) {
|
||||
BM_edge_select_set(bm, e, FALSE);
|
||||
BM_edge_select_set(bm, e, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -486,9 +486,9 @@ static void edbm_tagged_loop_pairs_do_fill_faces(BMesh *bm, UnorderedLoopPair *u
|
|||
}
|
||||
|
||||
/* face should never exist */
|
||||
BLI_assert(BM_face_exists(f_verts, f_verts[3] ? 4 : 3, &f) == FALSE);
|
||||
BLI_assert(BM_face_exists(f_verts, f_verts[3] ? 4 : 3, &f) == false);
|
||||
|
||||
f = BM_face_create_quad_tri_v(bm, f_verts, f_verts[3] ? 4 : 3, f_example, FALSE);
|
||||
f = BM_face_create_quad_tri_v(bm, f_verts, f_verts[3] ? 4 : 3, f_example, false);
|
||||
|
||||
l_iter = BM_FACE_FIRST_LOOP(f);
|
||||
|
||||
|
@ -511,21 +511,21 @@ static void edbm_tagged_loop_pairs_do_fill_faces(BMesh *bm, UnorderedLoopPair *u
|
|||
/* --- end 'face-fill' code --- */
|
||||
|
||||
|
||||
static int edbm_rip_call_edgesplit(BMEditMesh *em, wmOperator *op)
|
||||
static bool edbm_rip_call_edgesplit(BMEditMesh *em, wmOperator *op)
|
||||
{
|
||||
BMOperator bmop;
|
||||
|
||||
if (!EDBM_op_init(em, &bmop, op, "split_edges edges=%he verts=%hv use_verts=%b",
|
||||
BM_ELEM_TAG, BM_ELEM_SELECT, TRUE))
|
||||
BM_ELEM_TAG, BM_ELEM_SELECT, true))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
BMO_op_exec(em->bm, &bmop);
|
||||
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
|
||||
return FALSE;
|
||||
if (!EDBM_op_finish(em, &bmop, op, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -549,7 +549,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
float projectMat[4][4], fmval[3] = {event->mval[0], event->mval[1]};
|
||||
float dist = FLT_MAX;
|
||||
float d;
|
||||
int is_wire;
|
||||
bool is_wire;
|
||||
|
||||
BMEditSelection ese;
|
||||
int totboundary_edge = 0;
|
||||
|
@ -585,7 +585,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
* otherwise we can't a face away from a wire edge */
|
||||
totboundary_edge += (is_boundary != 0 || BM_edge_is_wire(e));
|
||||
if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
|
||||
if (is_boundary == FALSE && BM_edge_is_manifold(e)) {
|
||||
if (is_boundary == false && BM_edge_is_manifold(e)) {
|
||||
d = edbm_rip_edgedist(ar, projectMat, e->v1->co, e->v2->co, fmval, INSET_DEFAULT);
|
||||
if (d < dist) {
|
||||
dist = d;
|
||||
|
@ -640,22 +640,22 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
* - the boundary edge total is greater then 2,
|
||||
* in this case edge split _can_ work but we get far nicer results if we use this special case.
|
||||
* - there are only 2 edges but we are a wire vert. */
|
||||
if ((is_wire == FALSE && totboundary_edge > 2) ||
|
||||
(is_wire == TRUE && totboundary_edge > 1))
|
||||
if ((is_wire == false && totboundary_edge > 2) ||
|
||||
(is_wire == true && totboundary_edge > 1))
|
||||
{
|
||||
BMVert **vout;
|
||||
int vout_len;
|
||||
|
||||
BM_vert_select_set(bm, v, FALSE);
|
||||
BM_vert_select_set(bm, v, false);
|
||||
|
||||
if (bmesh_vert_separate(bm, v, &vout, &vout_len) == FALSE) {
|
||||
if (bmesh_vert_separate(bm, v, &vout, &vout_len) == false) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
else if (vout_len < 2) {
|
||||
MEM_freeN(vout);
|
||||
/* set selection back to avoid active-unselected vertex */
|
||||
BM_vert_select_set(bm, v, TRUE);
|
||||
BM_vert_select_set(bm, v, true);
|
||||
/* should never happen */
|
||||
BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces");
|
||||
return OPERATOR_CANCELLED;
|
||||
|
@ -673,7 +673,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
* either by its face corner, or connected edge (when no faces are attached) */
|
||||
for (i = 0; i < vout_len; i++) {
|
||||
|
||||
if (BM_vert_is_wire(vout[i]) == FALSE) {
|
||||
if (BM_vert_is_wire(vout[i]) == false) {
|
||||
/* find the best face corner */
|
||||
BM_ITER_ELEM (l, &iter, vout[i], BM_LOOPS_OF_VERT) {
|
||||
if (!BM_elem_flag_test(l->f, BM_ELEM_HIDDEN)) {
|
||||
|
@ -709,7 +709,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
|
||||
/* select the vert from the best region */
|
||||
v = vout[vi_best];
|
||||
BM_vert_select_set(bm, v, TRUE);
|
||||
BM_vert_select_set(bm, v, true);
|
||||
|
||||
if (ese.ele) {
|
||||
BM_select_history_store(bm, v);
|
||||
|
@ -804,7 +804,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
|
||||
/* disable by default, re-enable winner at end */
|
||||
BM_vert_select_set(bm, v, FALSE);
|
||||
BM_vert_select_set(bm, v, false);
|
||||
|
||||
BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) {
|
||||
/* calculate a point in the face, rather then calculate the middle,
|
||||
|
@ -829,7 +829,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
}
|
||||
|
||||
if (v_best) {
|
||||
BM_vert_select_set(bm, v_best, TRUE);
|
||||
BM_vert_select_set(bm, v_best, true);
|
||||
if (ese.ele) {
|
||||
BM_select_history_store(bm, v_best);
|
||||
}
|
||||
|
@ -878,14 +878,14 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
|
||||
/* expand edge selection */
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
int all_manifold;
|
||||
bool all_manifold;
|
||||
int totedge_manifold; /* manifold, visible edges */
|
||||
int i;
|
||||
|
||||
e2 = NULL;
|
||||
i = 0;
|
||||
totedge_manifold = 0;
|
||||
all_manifold = TRUE;
|
||||
all_manifold = true;
|
||||
BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
|
||||
|
||||
if (!BM_edge_is_wire(e) &&
|
||||
|
@ -901,8 +901,8 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
}
|
||||
|
||||
/** #BM_vert_other_disk_edge has no hidden checks so don't check hidden here */
|
||||
if ((all_manifold == TRUE) && (BM_edge_is_manifold(e) == FALSE)) {
|
||||
all_manifold = FALSE;
|
||||
if ((all_manifold == true) && (BM_edge_is_manifold(e) == false)) {
|
||||
all_manifold = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -911,7 +911,7 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
/* note: if the case of 3 edges has one change in loop stepping,
|
||||
* if this becomes more involved we may be better off splitting
|
||||
* the 3 edge case into its own else-if branch */
|
||||
if ((totedge_manifold == 4 || totedge_manifold == 3) || (all_manifold == FALSE)) {
|
||||
if ((totedge_manifold == 4 || totedge_manifold == 3) || (all_manifold == false)) {
|
||||
BMLoop *l_a = e2->l;
|
||||
BMLoop *l_b = l_a->radial_next;
|
||||
|
||||
|
@ -1034,7 +1034,7 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
EDBM_update_generic(em, TRUE, TRUE);
|
||||
EDBM_update_generic(em, true, true);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1056,6 +1056,6 @@ void MESH_OT_rip(wmOperatorType *ot)
|
|||
|
||||
/* to give to transform */
|
||||
Transform_Properties(ot, P_PROPORTIONAL);
|
||||
RNA_def_boolean(ot->srna, "mirror", FALSE, "Mirror Editing", "");
|
||||
RNA_def_boolean(ot->srna, "use_fill", FALSE, "Fill", "Fill the ripped region");
|
||||
RNA_def_boolean(ot->srna, "mirror", false, "Mirror Editing", "");
|
||||
RNA_def_boolean(ot->srna, "use_fill", false, "Fill", "Fill the ripped region");
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
|
||||
/* ****************************** MIRROR **************** */
|
||||
|
||||
void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
|
||||
void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, bool extend)
|
||||
{
|
||||
BMVert *v1, *v2;
|
||||
BMIter iter;
|
||||
|
@ -88,7 +88,7 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
|
|||
}
|
||||
}
|
||||
|
||||
EDBM_verts_mirror_cache_begin(em, TRUE);
|
||||
EDBM_verts_mirror_cache_begin(em, true);
|
||||
|
||||
if (!extend)
|
||||
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
|
||||
|
@ -99,7 +99,7 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
|
|||
|
||||
v2 = EDBM_verts_mirror_get(em, v1);
|
||||
if (v2 && !BM_elem_flag_test(v2, BM_ELEM_HIDDEN)) {
|
||||
BM_vert_select_set(em->bm, v2, TRUE);
|
||||
BM_vert_select_set(em->bm, v2, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ void EDBM_automerge(Scene *scene, Object *obedit, int update)
|
|||
BM_ELEM_SELECT, scene->toolsettings->doublimit);
|
||||
|
||||
if (LIKELY(ok) && update) {
|
||||
EDBM_update_generic(em, TRUE, TRUE);
|
||||
EDBM_update_generic(em, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -184,19 +184,19 @@ static void draw_triangulated(const int mcords[][2], const short tot)
|
|||
|
||||
/* reads rect, and builds selection array for quick lookup */
|
||||
/* returns if all is OK */
|
||||
int EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xmax, short ymax)
|
||||
bool EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xmax, short ymax)
|
||||
{
|
||||
struct ImBuf *buf;
|
||||
unsigned int *dr;
|
||||
int a;
|
||||
|
||||
if (vc->obedit == NULL || vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
|
||||
if (buf == NULL) return 0;
|
||||
if (bm_vertoffs == 0) return 0;
|
||||
if (buf == NULL) return false;
|
||||
if (bm_vertoffs == 0) return false;
|
||||
|
||||
dr = buf->rect;
|
||||
|
||||
|
@ -210,7 +210,7 @@ int EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xmax
|
|||
dr++;
|
||||
}
|
||||
IMB_freeImBuf(buf);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
int EDBM_backbuf_check(unsigned int index)
|
||||
|
@ -233,7 +233,7 @@ void EDBM_backbuf_free(void)
|
|||
* - grab again and compare
|
||||
* returns 'OK'
|
||||
*/
|
||||
int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
|
||||
bool EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax)
|
||||
{
|
||||
unsigned int *dr, *drm;
|
||||
struct ImBuf *buf, *bufmask;
|
||||
|
@ -242,16 +242,16 @@ int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
|
|||
/* method in use for face selecting too */
|
||||
if (vc->obedit == NULL) {
|
||||
if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
|
||||
if (buf == NULL) return 0;
|
||||
if (bm_vertoffs == 0) return 0;
|
||||
if (buf == NULL) return false;
|
||||
if (bm_vertoffs == 0) return false;
|
||||
|
||||
dr = buf->rect;
|
||||
|
||||
|
@ -282,7 +282,7 @@ int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
|
|||
bufmask = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
|
||||
|
||||
if (bufmask == NULL) {
|
||||
return 0; /* only when mem alloc fails, go crash somewhere else! */
|
||||
return false; /* only when mem alloc fails, go crash somewhere else! */
|
||||
}
|
||||
else {
|
||||
drm = bufmask->rect;
|
||||
|
@ -299,11 +299,11 @@ int EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
|
|||
IMB_freeImBuf(buf);
|
||||
IMB_freeImBuf(bufmask);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* circle shaped sample area */
|
||||
int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
|
||||
bool EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
|
||||
{
|
||||
struct ImBuf *buf;
|
||||
unsigned int *dr;
|
||||
|
@ -313,18 +313,18 @@ int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
|
|||
/* method in use for face selecting too */
|
||||
if (vc->obedit == NULL) {
|
||||
if (!(paint_facesel_test(vc->obact) || paint_vertsel_test(vc->obact))) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (vc->v3d->drawtype < OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT) == 0) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
xmin = xs - rads; xmax = xs + rads;
|
||||
ymin = ys - rads; ymax = ys + rads;
|
||||
buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
|
||||
if (bm_vertoffs == 0) return 0;
|
||||
if (buf == NULL) return 0;
|
||||
if (bm_vertoffs == 0) return false;
|
||||
if (buf == NULL) return false;
|
||||
|
||||
dr = buf->rect;
|
||||
|
||||
|
@ -340,7 +340,7 @@ int EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
|
|||
}
|
||||
|
||||
IMB_freeImBuf(buf);
|
||||
return 1;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ static unsigned int findnearestvert__backbufIndextest(void *handle, unsigned int
|
|||
* if 0, unselected vertice are given the bias
|
||||
* strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased
|
||||
*/
|
||||
BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const short sel, const short strict)
|
||||
BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const bool sel, const bool strict)
|
||||
{
|
||||
if (vc->v3d->drawtype > OB_WIRE && (vc->v3d->flag & V3D_ZBUF_SELECT)) {
|
||||
float distance;
|
||||
|
@ -436,7 +436,7 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const short sel,
|
|||
data.lastIndex = lastSelectedIndex;
|
||||
data.mval_fl[0] = vc->mval[0];
|
||||
data.mval_fl[1] = vc->mval[1];
|
||||
data.select = sel;
|
||||
data.select = sel ? BM_ELEM_SELECT : 0;
|
||||
data.dist = *r_dist;
|
||||
data.strict = strict;
|
||||
data.closest = NULL;
|
||||
|
@ -482,7 +482,7 @@ static void findnearestedge__doClosest(void *userData, BMEdge *eed, const float
|
|||
vec[1] = eed->v1->co[1] + lambda * (eed->v2->co[1] - eed->v1->co[1]);
|
||||
vec[2] = eed->v1->co[2] + lambda * (eed->v2->co[2] - eed->v1->co[2]);
|
||||
|
||||
if (ED_view3d_clipping_test(data->vc.rv3d, vec, TRUE) == 0) {
|
||||
if (ED_view3d_clipping_test(data->vc.rv3d, vec, true) == 0) {
|
||||
data->dist = distance;
|
||||
data->closest = eed;
|
||||
}
|
||||
|
@ -729,14 +729,14 @@ static int similar_face_select_exec(bContext *C, wmOperator *op)
|
|||
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
|
||||
|
||||
/* select the output */
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, TRUE);
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "faces.out", BM_FACE, BM_ELEM_SELECT, true);
|
||||
|
||||
/* finish the operator */
|
||||
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
|
||||
if (!EDBM_op_finish(em, &bmop, op, true)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
EDBM_update_generic(em, FALSE, FALSE);
|
||||
EDBM_update_generic(em, false, false);
|
||||
|
||||
/* we succeeded */
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -770,15 +770,15 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
|
|||
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
|
||||
|
||||
/* select the output */
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, TRUE);
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, true);
|
||||
EDBM_selectmode_flush(em);
|
||||
|
||||
/* finish the operator */
|
||||
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
|
||||
if (!EDBM_op_finish(em, &bmop, op, true)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
EDBM_update_generic(em, FALSE, FALSE);
|
||||
EDBM_update_generic(em, false, false);
|
||||
|
||||
/* we succeeded */
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -814,16 +814,16 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
|
|||
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
|
||||
|
||||
/* select the output */
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, TRUE);
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "verts.out", BM_VERT, BM_ELEM_SELECT, true);
|
||||
|
||||
/* finish the operator */
|
||||
if (!EDBM_op_finish(em, &bmop, op, TRUE)) {
|
||||
if (!EDBM_op_finish(em, &bmop, op, true)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
EDBM_selectmode_flush(em);
|
||||
|
||||
EDBM_update_generic(em, FALSE, FALSE);
|
||||
EDBM_update_generic(em, false, false);
|
||||
|
||||
/* we succeeded */
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -976,9 +976,9 @@ void MESH_OT_select_mode(wmOperatorType *ot)
|
|||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
prop = RNA_def_boolean(ot->srna, "use_extend", FALSE, "Extend", "");
|
||||
prop = RNA_def_boolean(ot->srna, "use_extend", false, "Extend", "");
|
||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||
prop = RNA_def_boolean(ot->srna, "use_expand", FALSE, "Expand", "");
|
||||
prop = RNA_def_boolean(ot->srna, "use_expand", false, "Expand", "");
|
||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||
ot->prop = prop = RNA_def_enum(ot->srna, "type", elem_items, 0, "Type", "");
|
||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||
|
@ -990,7 +990,7 @@ void MESH_OT_select_mode(wmOperatorType *ot)
|
|||
|
||||
/* **************** LOOP SELECTS *************** */
|
||||
|
||||
static void walker_select(BMEditMesh *em, int walkercode, void *start, int select)
|
||||
static void walker_select(BMEditMesh *em, int walkercode, void *start, const bool select)
|
||||
{
|
||||
BMesh *bm = em->bm;
|
||||
BMElem *ele;
|
||||
|
@ -1041,14 +1041,14 @@ static int edbm_loop_multiselect_exec(bContext *C, wmOperator *op)
|
|||
if (looptype) {
|
||||
for (edindex = 0; edindex < totedgesel; edindex += 1) {
|
||||
eed = edarray[edindex];
|
||||
walker_select(em, BMW_EDGERING, eed, TRUE);
|
||||
walker_select(em, BMW_EDGERING, eed, true);
|
||||
}
|
||||
EDBM_selectmode_flush(em);
|
||||
}
|
||||
else {
|
||||
for (edindex = 0; edindex < totedgesel; edindex += 1) {
|
||||
eed = edarray[edindex];
|
||||
walker_select(em, BMW_LOOP, eed, TRUE);
|
||||
walker_select(em, BMW_LOOP, eed, true);
|
||||
}
|
||||
EDBM_selectmode_flush(em);
|
||||
}
|
||||
|
@ -1084,12 +1084,12 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot)
|
|||
|
||||
/* ***************** loop select (non modal) ************** */
|
||||
|
||||
static void mouse_mesh_loop(bContext *C, const int mval[2], short extend, short deselect, short toggle, short ring)
|
||||
static void mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool ring)
|
||||
{
|
||||
ViewContext vc;
|
||||
BMEditMesh *em;
|
||||
BMEdge *eed;
|
||||
int select = TRUE;
|
||||
bool select = true;
|
||||
float dist = 50.0f;
|
||||
float mvalf[2];
|
||||
|
||||
|
@ -1103,21 +1103,21 @@ static void mouse_mesh_loop(bContext *C, const int mval[2], short extend, short
|
|||
|
||||
eed = EDBM_edge_find_nearest(&vc, &dist);
|
||||
if (eed) {
|
||||
if (extend == 0 && deselect == 0 && toggle == 0) {
|
||||
if (extend == false && deselect == false && toggle == false) {
|
||||
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
|
||||
}
|
||||
|
||||
if (extend) {
|
||||
select = TRUE;
|
||||
select = true;
|
||||
}
|
||||
else if (deselect) {
|
||||
select = FALSE;
|
||||
select = false;
|
||||
}
|
||||
else if (BM_elem_flag_test(eed, BM_ELEM_SELECT) == 0) {
|
||||
select = TRUE;
|
||||
select = true;
|
||||
}
|
||||
else if (toggle) {
|
||||
select = FALSE;
|
||||
select = false;
|
||||
}
|
||||
|
||||
if (em->selectmode & SCE_SELECT_FACE) {
|
||||
|
@ -1208,7 +1208,8 @@ static int edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
|||
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
mouse_mesh_loop(C, event->mval, RNA_boolean_get(op->ptr, "extend"),
|
||||
mouse_mesh_loop(C, event->mval,
|
||||
RNA_boolean_get(op->ptr, "extend"),
|
||||
RNA_boolean_get(op->ptr, "deselect"),
|
||||
RNA_boolean_get(op->ptr, "toggle"),
|
||||
RNA_boolean_get(op->ptr, "ring"));
|
||||
|
@ -1341,15 +1342,15 @@ static int edgetag_context_check(Scene *scene, BMesh *bm, BMEdge *e)
|
|||
{
|
||||
switch (scene->toolsettings->edge_mode) {
|
||||
case EDGE_MODE_SELECT:
|
||||
return BM_elem_flag_test(e, BM_ELEM_SELECT) ? TRUE : FALSE;
|
||||
return BM_elem_flag_test(e, BM_ELEM_SELECT) ? true : false;
|
||||
case EDGE_MODE_TAG_SEAM:
|
||||
return BM_elem_flag_test(e, BM_ELEM_SEAM);
|
||||
case EDGE_MODE_TAG_SHARP:
|
||||
return !BM_elem_flag_test(e, BM_ELEM_SMOOTH);
|
||||
case EDGE_MODE_TAG_CREASE:
|
||||
return BM_elem_float_data_get(&bm->edata, e, CD_CREASE) ? TRUE : FALSE;
|
||||
return BM_elem_float_data_get(&bm->edata, e, CD_CREASE) ? true : false;
|
||||
case EDGE_MODE_TAG_BEVEL:
|
||||
return BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT) ? TRUE : FALSE;
|
||||
return BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT) ? true : false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1386,7 +1387,7 @@ static int edgetag_shortest_path(Scene *scene, BMesh *bm, BMEdge *e_src, BMEdge
|
|||
edgetag_ensure_cd_flag(scene, OBACT->data);
|
||||
|
||||
BM_ITER_MESH_INDEX (e, &eiter, bm, BM_EDGES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == FALSE) {
|
||||
if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == false) {
|
||||
BM_elem_flag_disable(e, BM_ELEM_TAG);
|
||||
}
|
||||
else {
|
||||
|
@ -1435,14 +1436,14 @@ static int edgetag_shortest_path(Scene *scene, BMesh *bm, BMEdge *e_src, BMEdge
|
|||
}
|
||||
|
||||
if (e == e_dst) {
|
||||
short all_set = TRUE;
|
||||
bool all_set = true;
|
||||
|
||||
/* Check whether the path is already completely tagged.
|
||||
* if it is, the tags will be cleared instead of set. */
|
||||
e = e_dst;
|
||||
do {
|
||||
if (!edgetag_context_check(scene, bm, e)) {
|
||||
all_set = FALSE;
|
||||
all_set = false;
|
||||
break;
|
||||
}
|
||||
} while ((e = edges_prev[BM_elem_index_get(e)]));
|
||||
|
@ -1521,12 +1522,12 @@ static int mouse_mesh_shortest_path_edge(ViewContext *vc)
|
|||
break;
|
||||
}
|
||||
|
||||
EDBM_update_generic(em, FALSE, FALSE);
|
||||
EDBM_update_generic(em, false, false);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1603,7 +1604,7 @@ static int facetag_shortest_path(Scene *scene, BMesh *bm, BMFace *f_src, BMFace
|
|||
// BM_mesh_elem_index_ensure(bm, BM_VERT /* | BM_EDGE */); // NOT NEEDED FOR FACETAG
|
||||
|
||||
BM_ITER_MESH_INDEX (f, &fiter, bm, BM_FACES_OF_MESH, i) {
|
||||
if (BM_elem_flag_test(f, BM_ELEM_HIDDEN) == FALSE) {
|
||||
if (BM_elem_flag_test(f, BM_ELEM_HIDDEN) == false) {
|
||||
BM_elem_flag_disable(f, BM_ELEM_TAG);
|
||||
}
|
||||
else {
|
||||
|
@ -1652,14 +1653,14 @@ static int facetag_shortest_path(Scene *scene, BMesh *bm, BMFace *f_src, BMFace
|
|||
}
|
||||
|
||||
if (f == f_dst) {
|
||||
short all_set = TRUE;
|
||||
bool all_set = true;
|
||||
|
||||
/* Check whether the path is already completely tagged.
|
||||
* if it is, the tags will be cleared instead of set. */
|
||||
f = f_dst;
|
||||
do {
|
||||
if (!facetag_context_check(scene, bm, f)) {
|
||||
all_set = FALSE;
|
||||
all_set = false;
|
||||
break;
|
||||
}
|
||||
} while ((f = faces_prev[BM_elem_index_get(f)]));
|
||||
|
@ -1687,7 +1688,7 @@ static int mouse_mesh_shortest_path_face(ViewContext *vc)
|
|||
f_dst = EDBM_face_find_nearest(vc, &dist);
|
||||
if (f_dst) {
|
||||
int path = 0;
|
||||
BMFace *f_act = BM_active_face_get(em->bm, FALSE, TRUE);
|
||||
BMFace *f_act = BM_active_face_get(em->bm, false, true);
|
||||
|
||||
if (f_act) {
|
||||
if (f_act != f_dst) {
|
||||
|
@ -1712,12 +1713,12 @@ static int mouse_mesh_shortest_path_face(ViewContext *vc)
|
|||
|
||||
BM_active_face_set(em->bm, f_dst);
|
||||
|
||||
EDBM_update_generic(em, FALSE, FALSE);
|
||||
EDBM_update_generic(em, false, false);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1787,7 +1788,7 @@ void MESH_OT_select_shortest_path(wmOperatorType *ot)
|
|||
/* ************************************************** */
|
||||
/* here actual select happens */
|
||||
/* gets called via generic mouse select operator */
|
||||
int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselect, short toggle)
|
||||
bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
ViewContext vc;
|
||||
BMVert *eve = NULL;
|
||||
|
@ -1802,7 +1803,7 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
|
|||
if (unified_findnearest(&vc, &eve, &eed, &efa)) {
|
||||
|
||||
/* Deselect everything */
|
||||
if (extend == 0 && deselect == 0 && toggle == 0)
|
||||
if (extend == false && deselect == false && toggle == false)
|
||||
EDBM_flag_disable_all(vc.em, BM_ELEM_SELECT);
|
||||
|
||||
if (efa) {
|
||||
|
@ -1813,13 +1814,13 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
|
|||
/* Work-around: deselect first, so we can guarantee it will */
|
||||
/* be active even if it was already selected */
|
||||
BM_select_history_remove(vc.em->bm, efa);
|
||||
BM_face_select_set(vc.em->bm, efa, FALSE);
|
||||
BM_face_select_set(vc.em->bm, efa, false);
|
||||
BM_select_history_store(vc.em->bm, efa);
|
||||
BM_face_select_set(vc.em->bm, efa, TRUE);
|
||||
BM_face_select_set(vc.em->bm, efa, true);
|
||||
}
|
||||
else if (deselect) {
|
||||
BM_select_history_remove(vc.em->bm, efa);
|
||||
BM_face_select_set(vc.em->bm, efa, FALSE);
|
||||
BM_face_select_set(vc.em->bm, efa, false);
|
||||
}
|
||||
else {
|
||||
/* set the last selected face */
|
||||
|
@ -1827,11 +1828,11 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
|
|||
|
||||
if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
|
||||
BM_select_history_store(vc.em->bm, efa);
|
||||
BM_face_select_set(vc.em->bm, efa, TRUE);
|
||||
BM_face_select_set(vc.em->bm, efa, true);
|
||||
}
|
||||
else if (toggle) {
|
||||
BM_select_history_remove(vc.em->bm, efa);
|
||||
BM_face_select_set(vc.em->bm, efa, FALSE);
|
||||
BM_face_select_set(vc.em->bm, efa, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1840,22 +1841,22 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
|
|||
/* Work-around: deselect first, so we can guarantee it will */
|
||||
/* be active even if it was already selected */
|
||||
BM_select_history_remove(vc.em->bm, eed);
|
||||
BM_edge_select_set(vc.em->bm, eed, FALSE);
|
||||
BM_edge_select_set(vc.em->bm, eed, false);
|
||||
BM_select_history_store(vc.em->bm, eed);
|
||||
BM_edge_select_set(vc.em->bm, eed, TRUE);
|
||||
BM_edge_select_set(vc.em->bm, eed, true);
|
||||
}
|
||||
else if (deselect) {
|
||||
BM_select_history_remove(vc.em->bm, eed);
|
||||
BM_edge_select_set(vc.em->bm, eed, FALSE);
|
||||
BM_edge_select_set(vc.em->bm, eed, false);
|
||||
}
|
||||
else {
|
||||
if (!BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
|
||||
BM_select_history_store(vc.em->bm, eed);
|
||||
BM_edge_select_set(vc.em->bm, eed, TRUE);
|
||||
BM_edge_select_set(vc.em->bm, eed, true);
|
||||
}
|
||||
else if (toggle) {
|
||||
BM_select_history_remove(vc.em->bm, eed);
|
||||
BM_edge_select_set(vc.em->bm, eed, FALSE);
|
||||
BM_edge_select_set(vc.em->bm, eed, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1864,22 +1865,22 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
|
|||
/* Work-around: deselect first, so we can guarantee it will */
|
||||
/* be active even if it was already selected */
|
||||
BM_select_history_remove(vc.em->bm, eve);
|
||||
BM_vert_select_set(vc.em->bm, eve, FALSE);
|
||||
BM_vert_select_set(vc.em->bm, eve, false);
|
||||
BM_select_history_store(vc.em->bm, eve);
|
||||
BM_vert_select_set(vc.em->bm, eve, TRUE);
|
||||
BM_vert_select_set(vc.em->bm, eve, true);
|
||||
}
|
||||
else if (deselect) {
|
||||
BM_select_history_remove(vc.em->bm, eve);
|
||||
BM_vert_select_set(vc.em->bm, eve, FALSE);
|
||||
BM_vert_select_set(vc.em->bm, eve, false);
|
||||
}
|
||||
else {
|
||||
if (!BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
|
||||
BM_select_history_store(vc.em->bm, eve);
|
||||
BM_vert_select_set(vc.em->bm, eve, TRUE);
|
||||
BM_vert_select_set(vc.em->bm, eve, true);
|
||||
}
|
||||
else if (toggle) {
|
||||
BM_select_history_remove(vc.em->bm, eve);
|
||||
BM_vert_select_set(vc.em->bm, eve, FALSE);
|
||||
BM_vert_select_set(vc.em->bm, eve, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1896,10 +1897,10 @@ int EDBM_select_pick(bContext *C, const int mval[2], short extend, short deselec
|
|||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void edbm_strip_selections(BMEditMesh *em)
|
||||
|
@ -1951,12 +1952,12 @@ void EDBM_selectmode_set(BMEditMesh *em)
|
|||
else if (em->selectmode & SCE_SELECT_EDGE) {
|
||||
/* deselect vertices, and select again based on edge select */
|
||||
eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
|
||||
for (; eve; eve = BM_iter_step(&iter)) BM_vert_select_set(em->bm, eve, FALSE);
|
||||
for (; eve; eve = BM_iter_step(&iter)) BM_vert_select_set(em->bm, eve, false);
|
||||
|
||||
eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
|
||||
for (; eed; eed = BM_iter_step(&iter)) {
|
||||
if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
|
||||
BM_edge_select_set(em->bm, eed, TRUE);
|
||||
BM_edge_select_set(em->bm, eed, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1966,12 +1967,12 @@ void EDBM_selectmode_set(BMEditMesh *em)
|
|||
else if (em->selectmode & SCE_SELECT_FACE) {
|
||||
/* deselect eges, and select again based on face select */
|
||||
eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
|
||||
for (; eed; eed = BM_iter_step(&iter)) BM_edge_select_set(em->bm, eed, FALSE);
|
||||
for (; eed; eed = BM_iter_step(&iter)) BM_edge_select_set(em->bm, eed, false);
|
||||
|
||||
efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
|
||||
for (; efa; efa = BM_iter_step(&iter)) {
|
||||
if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
|
||||
BM_face_select_set(em->bm, efa, TRUE);
|
||||
BM_face_select_set(em->bm, efa, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1995,7 +1996,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
|
|||
|
||||
BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
|
||||
if (BM_elem_flag_test(eed, BM_ELEM_TAG)) {
|
||||
BM_edge_select_set(em->bm, eed, TRUE);
|
||||
BM_edge_select_set(em->bm, eed, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2007,7 +2008,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
|
|||
|
||||
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
|
||||
BM_face_select_set(em->bm, efa, TRUE);
|
||||
BM_face_select_set(em->bm, efa, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2021,7 +2022,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
|
|||
|
||||
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
|
||||
BM_face_select_set(em->bm, efa, TRUE);
|
||||
BM_face_select_set(em->bm, efa, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2029,13 +2030,13 @@ void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const s
|
|||
}
|
||||
|
||||
/* user facing function, does notification and undo push */
|
||||
int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
|
||||
const int action, const int use_extend, const int use_expand)
|
||||
bool EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
|
||||
const int action, const bool use_extend, const bool use_expand)
|
||||
{
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
BMEditMesh *em = NULL;
|
||||
int ret = FALSE;
|
||||
bool ret = false;
|
||||
|
||||
if (obedit && obedit->type == OB_MESH) {
|
||||
em = BMEdit_FromObject(obedit);
|
||||
|
@ -2052,21 +2053,21 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
|
|||
case 0: /* disable */
|
||||
/* check we have something to do */
|
||||
if ((em->selectmode & selectmode_new) == 0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
em->selectmode &= ~selectmode_new;
|
||||
break;
|
||||
case 1: /* enable */
|
||||
/* check we have something to do */
|
||||
if ((em->selectmode & selectmode_new) != 0) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
em->selectmode |= selectmode_new;
|
||||
break;
|
||||
case 2: /* toggle */
|
||||
/* can't disable this flag if its the only one set */
|
||||
if (em->selectmode == selectmode_new) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
em->selectmode ^= selectmode_new;
|
||||
break;
|
||||
|
@ -2080,7 +2081,7 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
|
|||
em->selectmode = SCE_SELECT_VERTEX;
|
||||
ts->selectmode = em->selectmode;
|
||||
EDBM_selectmode_set(em);
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
break;
|
||||
case SCE_SELECT_EDGE:
|
||||
if (use_extend == 0 || em->selectmode == 0) {
|
||||
|
@ -2094,7 +2095,7 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
|
|||
}
|
||||
ts->selectmode = em->selectmode;
|
||||
EDBM_selectmode_set(em);
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
break;
|
||||
case SCE_SELECT_FACE:
|
||||
if (use_extend == 0 || em->selectmode == 0) {
|
||||
|
@ -2109,14 +2110,14 @@ int EDBM_selectmode_toggle(bContext *C, const short selectmode_new,
|
|||
}
|
||||
ts->selectmode = em->selectmode;
|
||||
EDBM_selectmode_set(em);
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
break;
|
||||
default:
|
||||
BLI_assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == TRUE) {
|
||||
if (ret == true) {
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
|
||||
WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
}
|
||||
|
@ -2185,25 +2186,25 @@ int EDBM_select_interior_faces(BMEditMesh *em)
|
|||
BMIter eiter;
|
||||
BMFace *efa;
|
||||
BMEdge *eed;
|
||||
int ok;
|
||||
int change = FALSE;
|
||||
bool ok;
|
||||
bool change = false;
|
||||
|
||||
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
|
||||
continue;
|
||||
|
||||
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
BM_ITER_ELEM (eed, &eiter, efa, BM_EDGES_OF_FACE) {
|
||||
if (BM_edge_face_count(eed) < 3) {
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
BM_face_select_set(bm, efa, TRUE);
|
||||
change = TRUE;
|
||||
BM_face_select_set(bm, efa, true);
|
||||
change = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2216,9 +2217,9 @@ static void linked_limit_default(bContext *C, wmOperator *op)
|
|||
Object *obedit = CTX_data_edit_object(C);
|
||||
BMEditMesh *em = BMEdit_FromObject(obedit);
|
||||
if (em->selectmode == SCE_SELECT_FACE)
|
||||
RNA_boolean_set(op->ptr, "limit", TRUE);
|
||||
RNA_boolean_set(op->ptr, "limit", true);
|
||||
else
|
||||
RNA_boolean_set(op->ptr, "limit", FALSE);
|
||||
RNA_boolean_set(op->ptr, "limit", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2378,7 +2379,7 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
|
|||
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
|
||||
for (efa = BMW_begin(&walker, efa); efa; efa = BMW_step(&walker)) {
|
||||
BM_face_select_set(bm, efa, TRUE);
|
||||
BM_face_select_set(bm, efa, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2560,7 +2561,7 @@ static void walker_deselect_nth(BMEditMesh *em, int nth, int offset, BMHeader *h
|
|||
if (!BM_elem_flag_test(ele, BM_ELEM_TAG)) {
|
||||
/* Deselect elements that aren't at "nth" depth from active */
|
||||
if ((offset + BMW_current_depth(&walker)) % nth) {
|
||||
BM_elem_select_set(bm, ele, FALSE);
|
||||
BM_elem_select_set(bm, ele, false);
|
||||
}
|
||||
BM_elem_flag_enable(ele, BM_ELEM_TAG);
|
||||
}
|
||||
|
@ -2619,7 +2620,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
|
|||
}
|
||||
}
|
||||
else if (em->selectmode & SCE_SELECT_FACE) {
|
||||
f = BM_active_face_get(em->bm, TRUE, FALSE);
|
||||
f = BM_active_face_get(em->bm, true, false);
|
||||
if (f) {
|
||||
*r_efa = f;
|
||||
return;
|
||||
|
@ -2666,7 +2667,7 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
EDBM_update_generic(em, FALSE, FALSE);
|
||||
EDBM_update_generic(em, false, false);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -2723,14 +2724,14 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
|
|||
const float sharp = RNA_float_get(op->ptr, "sharpness");
|
||||
|
||||
BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
|
||||
if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == FALSE &&
|
||||
if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) == false &&
|
||||
BM_edge_loop_pair(e, &l1, &l2))
|
||||
{
|
||||
/* edge has exactly two neighboring faces, check angle */
|
||||
const float angle = angle_normalized_v3v3(l1->f->no, l2->f->no);
|
||||
|
||||
if (fabsf(angle) > sharp) {
|
||||
BM_edge_select_set(em->bm, e, TRUE);
|
||||
BM_edge_select_set(em->bm, e, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2791,7 +2792,7 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
|
|||
f = stack[i - 1];
|
||||
i--;
|
||||
|
||||
BM_face_select_set(em->bm, f, TRUE);
|
||||
BM_face_select_set(em->bm, f, true);
|
||||
|
||||
BM_elem_flag_enable(f, BM_ELEM_TAG);
|
||||
|
||||
|
@ -2867,13 +2868,13 @@ static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
|
|||
|
||||
BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
|
||||
if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN) && !BM_vert_is_manifold(v)) {
|
||||
BM_vert_select_set(em->bm, v, TRUE);
|
||||
BM_vert_select_set(em->bm, v, true);
|
||||
}
|
||||
}
|
||||
|
||||
BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
|
||||
if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && !BM_edge_is_manifold(e)) {
|
||||
BM_edge_select_set(em->bm, e, TRUE);
|
||||
BM_edge_select_set(em->bm, e, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2918,7 +2919,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
|
|||
if (em->selectmode & SCE_SELECT_VERTEX) {
|
||||
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
|
||||
if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
|
||||
BM_vert_select_set(em->bm, eve, TRUE);
|
||||
BM_vert_select_set(em->bm, eve, true);
|
||||
}
|
||||
}
|
||||
EDBM_selectmode_flush(em);
|
||||
|
@ -2926,7 +2927,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
|
|||
else if (em->selectmode & SCE_SELECT_EDGE) {
|
||||
BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
|
||||
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
|
||||
BM_edge_select_set(em->bm, eed, TRUE);
|
||||
BM_edge_select_set(em->bm, eed, true);
|
||||
}
|
||||
}
|
||||
EDBM_selectmode_flush(em);
|
||||
|
@ -2934,7 +2935,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
|
|||
else {
|
||||
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
|
||||
BM_face_select_set(em->bm, efa, TRUE);
|
||||
BM_face_select_set(em->bm, efa, true);
|
||||
}
|
||||
}
|
||||
EDBM_selectmode_flush(em);
|
||||
|
@ -3037,14 +3038,14 @@ static int edbm_select_next_loop_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
|
||||
if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
|
||||
BM_elem_flag_enable(l->next->v, BM_ELEM_TAG);
|
||||
BM_vert_select_set(em->bm, l->v, FALSE);
|
||||
BM_vert_select_set(em->bm, l->v, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
|
||||
if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
|
||||
BM_vert_select_set(em->bm, v, TRUE);
|
||||
BM_vert_select_set(em->bm, v, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3076,7 +3077,7 @@ static int edbm_region_to_loop_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
BMEdge *e;
|
||||
BMIter iter;
|
||||
|
||||
BM_mesh_elem_hflag_disable_all(em->bm, BM_EDGE, BM_ELEM_TAG, FALSE);
|
||||
BM_mesh_elem_hflag_disable_all(em->bm, BM_EDGE, BM_ELEM_TAG, false);
|
||||
|
||||
BM_ITER_MESH (f, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
BMLoop *l1, *l2;
|
||||
|
@ -3099,7 +3100,7 @@ static int edbm_region_to_loop_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
|
||||
BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
|
||||
if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
|
||||
BM_edge_select_set(em->bm, e, TRUE);
|
||||
BM_edge_select_set(em->bm, e, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3290,7 +3291,7 @@ static int edbm_loop_to_region_exec(bContext *C, wmOperator *op)
|
|||
|
||||
BM_ITER_MESH (f, &iter, em->bm, BM_FACES_OF_MESH) {
|
||||
if (BM_elem_flag_test(f, BM_ELEM_TAG) && !BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
|
||||
BM_face_select_set(em->bm, f, TRUE);
|
||||
BM_face_select_set(em->bm, f, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -114,7 +114,7 @@ void EDBM_mesh_ensure_valid_dm_hack(Scene *scene, BMEditMesh *em)
|
|||
|
||||
void EDBM_mesh_normals_update(BMEditMesh *em)
|
||||
{
|
||||
BM_mesh_normals_update(em->bm, TRUE);
|
||||
BM_mesh_normals_update(em->bm, true);
|
||||
}
|
||||
|
||||
void EDBM_mesh_clear(BMEditMesh *em)
|
||||
|
@ -169,7 +169,7 @@ void EDBM_stats_update(BMEditMesh *em)
|
|||
}
|
||||
}
|
||||
|
||||
int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *fmt, ...)
|
||||
bool EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *fmt, ...)
|
||||
{
|
||||
BMesh *bm = em->bm;
|
||||
va_list list;
|
||||
|
@ -179,7 +179,7 @@ int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
|
|||
if (!BMO_op_vinitf(bm, bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
|
||||
BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
|
||||
va_end(list);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!em->emcopy)
|
||||
|
@ -188,12 +188,12 @@ int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
|
|||
|
||||
va_end(list);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* returns 0 on error, 1 on success. executes and finishes a bmesh operator */
|
||||
int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int report)
|
||||
bool EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const bool do_report)
|
||||
{
|
||||
const char *errmsg;
|
||||
|
||||
|
@ -202,7 +202,7 @@ int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int r
|
|||
if (BMO_error_get(em->bm, &errmsg, NULL)) {
|
||||
BMEditMesh *emcopy = em->emcopy;
|
||||
|
||||
if (report) {
|
||||
if (do_report) {
|
||||
BKE_report(op->reports, RPT_ERROR, errmsg);
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int r
|
|||
BMEdit_RecalcTessellation(em);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
em->emcopyusers--;
|
||||
|
@ -233,11 +233,11 @@ int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int r
|
|||
em->emcopy = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
|
||||
bool EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
|
||||
{
|
||||
BMesh *bm = em->bm;
|
||||
BMOperator bmop;
|
||||
|
@ -248,7 +248,7 @@ int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
|
|||
if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
|
||||
BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
|
||||
va_end(list);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!em->emcopy)
|
||||
|
@ -258,10 +258,10 @@ int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
|
|||
BMO_op_exec(bm, &bmop);
|
||||
|
||||
va_end(list);
|
||||
return EDBM_op_finish(em, &bmop, op, TRUE);
|
||||
return EDBM_op_finish(em, &bmop, op, true);
|
||||
}
|
||||
|
||||
int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const char *fmt, ...)
|
||||
bool EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_slot_out, const char *fmt, ...)
|
||||
{
|
||||
BMOpSlot *slot_select_out;
|
||||
BMesh *bm = em->bm;
|
||||
|
@ -274,7 +274,7 @@ int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_
|
|||
if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
|
||||
BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
|
||||
va_end(list);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!em->emcopy)
|
||||
|
@ -286,15 +286,15 @@ int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *select_
|
|||
slot_select_out = BMO_slot_get(bmop.slots_out, select_slot_out);
|
||||
hflag = slot_select_out->slot_subtype.elem & BM_ALL_NOLOOP;
|
||||
|
||||
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
|
||||
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
|
||||
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, select_slot_out, hflag, BM_ELEM_SELECT, TRUE);
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, select_slot_out, hflag, BM_ELEM_SELECT, true);
|
||||
|
||||
va_end(list);
|
||||
return EDBM_op_finish(em, &bmop, op, TRUE);
|
||||
return EDBM_op_finish(em, &bmop, op, true);
|
||||
}
|
||||
|
||||
int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
|
||||
bool EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
|
||||
{
|
||||
BMesh *bm = em->bm;
|
||||
BMOperator bmop;
|
||||
|
@ -304,7 +304,7 @@ int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
|
|||
|
||||
if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
|
||||
va_end(list);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!em->emcopy)
|
||||
|
@ -314,7 +314,7 @@ int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
|
|||
BMO_op_exec(bm, &bmop);
|
||||
|
||||
va_end(list);
|
||||
return EDBM_op_finish(em, &bmop, NULL, FALSE);
|
||||
return EDBM_op_finish(em, &bmop, NULL, false);
|
||||
}
|
||||
|
||||
void EDBM_selectmode_to_scene(bContext *C)
|
||||
|
@ -352,9 +352,9 @@ void EDBM_mesh_make(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
|
|||
/* currently executing operators re-tessellates, so we can avoid doing here
|
||||
* but at some point it may need to be added back. */
|
||||
#if 0
|
||||
me->edit_btmesh = BMEdit_Create(bm, TRUE);
|
||||
me->edit_btmesh = BMEdit_Create(bm, true);
|
||||
#else
|
||||
me->edit_btmesh = BMEdit_Create(bm, FALSE);
|
||||
me->edit_btmesh = BMEdit_Create(bm, false);
|
||||
#endif
|
||||
|
||||
me->edit_btmesh->selectmode = me->edit_btmesh->bm->selectmode = ts->selectmode;
|
||||
|
@ -368,7 +368,7 @@ void EDBM_mesh_load(Object *ob)
|
|||
Mesh *me = ob->data;
|
||||
BMesh *bm = me->edit_btmesh->bm;
|
||||
|
||||
BM_mesh_bm_to_me(bm, me, FALSE);
|
||||
BM_mesh_bm_to_me(bm, me, false);
|
||||
|
||||
#ifdef USE_TESSFACE_DEFAULT
|
||||
BKE_mesh_tessface_calc(me);
|
||||
|
@ -400,7 +400,7 @@ void EDBM_index_arrays_ensure(BMEditMesh *em, const char htype)
|
|||
BLI_assert((htype & ~BM_ALL_NOLOOP) == 0);
|
||||
|
||||
/* in debug mode double check we didn't need to recalculate */
|
||||
BLI_assert(EDBM_index_arrays_check(em) == TRUE);
|
||||
BLI_assert(EDBM_index_arrays_check(em) == true);
|
||||
|
||||
if (htype_needed & BM_VERT) {
|
||||
em->vert_index = MEM_mallocN(sizeof(void **) * em->bm->totvert, "em->vert_index");
|
||||
|
@ -465,7 +465,7 @@ void EDBM_index_arrays_free(BMEditMesh *em)
|
|||
|
||||
/* debug check only - no need to optimize */
|
||||
#ifndef NDEBUG
|
||||
int EDBM_index_arrays_check(BMEditMesh *em)
|
||||
bool EDBM_index_arrays_check(BMEditMesh *em)
|
||||
{
|
||||
BMIter iter;
|
||||
BMElem *ele;
|
||||
|
@ -474,7 +474,7 @@ int EDBM_index_arrays_check(BMEditMesh *em)
|
|||
if (em->vert_index) {
|
||||
BM_ITER_MESH_INDEX (ele, &iter, em->bm, BM_VERTS_OF_MESH, i) {
|
||||
if (ele != (BMElem *)em->vert_index[i]) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ int EDBM_index_arrays_check(BMEditMesh *em)
|
|||
if (em->edge_index) {
|
||||
BM_ITER_MESH_INDEX (ele, &iter, em->bm, BM_EDGES_OF_MESH, i) {
|
||||
if (ele != (BMElem *)em->edge_index[i]) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -490,12 +490,12 @@ int EDBM_index_arrays_check(BMEditMesh *em)
|
|||
if (em->face_index) {
|
||||
BM_ITER_MESH_INDEX (ele, &iter, em->bm, BM_FACES_OF_MESH, i) {
|
||||
if (ele != (BMElem *)em->face_index[i]) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -546,10 +546,10 @@ void EDBM_select_more(BMEditMesh *em)
|
|||
|
||||
BMO_op_initf(em->bm, &bmop, BMO_FLAG_DEFAULTS,
|
||||
"region_extend geom=%hvef use_constrict=%b use_faces=%b",
|
||||
BM_ELEM_SELECT, FALSE, use_faces);
|
||||
BM_ELEM_SELECT, false, use_faces);
|
||||
BMO_op_exec(em->bm, &bmop);
|
||||
/* don't flush selection in edge/vertex mode */
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
|
||||
BMO_slot_buffer_hflag_enable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? true : false);
|
||||
BMO_op_finish(em->bm, &bmop);
|
||||
|
||||
EDBM_selectmode_flush(em);
|
||||
|
@ -562,10 +562,10 @@ void EDBM_select_less(BMEditMesh *em)
|
|||
|
||||
BMO_op_initf(em->bm, &bmop, BMO_FLAG_DEFAULTS,
|
||||
"region_extend geom=%hvef use_constrict=%b use_faces=%b",
|
||||
BM_ELEM_SELECT, TRUE, use_faces);
|
||||
BM_ELEM_SELECT, true, use_faces);
|
||||
BMO_op_exec(em->bm, &bmop);
|
||||
/* don't flush selection in edge/vertex mode */
|
||||
BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? TRUE : FALSE);
|
||||
BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_out, "geom.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, use_faces ? true : false);
|
||||
BMO_op_finish(em->bm, &bmop);
|
||||
|
||||
EDBM_selectmode_flush(em);
|
||||
|
@ -573,12 +573,12 @@ void EDBM_select_less(BMEditMesh *em)
|
|||
|
||||
void EDBM_flag_disable_all(BMEditMesh *em, const char hflag)
|
||||
{
|
||||
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, FALSE);
|
||||
BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, false);
|
||||
}
|
||||
|
||||
void EDBM_flag_enable_all(BMEditMesh *em, const char hflag)
|
||||
{
|
||||
BM_mesh_elem_hflag_enable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, TRUE);
|
||||
BM_mesh_elem_hflag_enable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, true);
|
||||
}
|
||||
|
||||
/**************-------------- Undo ------------*****************/
|
||||
|
@ -623,7 +623,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata)
|
|||
|
||||
/* BM_mesh_validate(em->bm); */ /* for troubleshooting */
|
||||
|
||||
BM_mesh_bm_to_me(em->bm, &um->me, FALSE);
|
||||
BM_mesh_bm_to_me(em->bm, &um->me, false);
|
||||
|
||||
um->selectmode = em->selectmode;
|
||||
um->shapenr = em->bm->shapenr;
|
||||
|
@ -644,12 +644,12 @@ static void undoMesh_to_editbtMesh(void *umv, void *em_v, void *UNUSED(obdata))
|
|||
|
||||
bm = BM_mesh_create(&bm_mesh_allocsize_default);
|
||||
|
||||
BM_mesh_bm_from_me(bm, &um->me, FALSE, ob->shapenr);
|
||||
BM_mesh_bm_from_me(bm, &um->me, false, ob->shapenr);
|
||||
|
||||
/* face normals need recalculation since we are not calling through an operator */
|
||||
BM_mesh_normals_update(bm, TRUE);
|
||||
BM_mesh_normals_update(bm, true);
|
||||
|
||||
em_tmp = BMEdit_Create(bm, TRUE);
|
||||
em_tmp = BMEdit_Create(bm, true);
|
||||
*em = *em_tmp;
|
||||
|
||||
em->selectmode = um->selectmode;
|
||||
|
@ -667,7 +667,7 @@ static void free_undo(void *me_v)
|
|||
MEM_freeN(me->key);
|
||||
}
|
||||
|
||||
BKE_mesh_free(me, FALSE);
|
||||
BKE_mesh_free(me, false);
|
||||
MEM_freeN(me);
|
||||
}
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index)
|
|||
* preference */
|
||||
#define BM_SEARCH_MAXDIST_MIRR 0.00002f
|
||||
#define BM_CD_LAYER_ID "__mirror_index"
|
||||
void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const short use_select)
|
||||
void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const bool use_select)
|
||||
{
|
||||
Mesh *me = (Mesh *)em->ob->data;
|
||||
BMesh *bm = em->bm;
|
||||
|
@ -1162,7 +1162,7 @@ void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const short use_select)
|
|||
BM_mesh_elem_index_ensure(bm, BM_VERT);
|
||||
|
||||
if (topo) {
|
||||
ED_mesh_mirrtopo_init(me, -1, &mesh_topo_store, TRUE);
|
||||
ED_mesh_mirrtopo_init(me, -1, &mesh_topo_store, true);
|
||||
}
|
||||
else {
|
||||
tree = BMBVH_NewBVH(em, 0, NULL, NULL);
|
||||
|
@ -1283,7 +1283,7 @@ void EDBM_mesh_hide(BMEditMesh *em, int swap)
|
|||
|
||||
BM_ITER_MESH (ele, &iter, em->bm, itermode) {
|
||||
if (BM_elem_flag_test(ele, BM_ELEM_SELECT) ^ swap)
|
||||
BM_elem_hide_set(em->bm, ele, TRUE);
|
||||
BM_elem_hide_set(em->bm, ele, true);
|
||||
}
|
||||
|
||||
EDBM_selectmode_flush(em);
|
||||
|
@ -1335,7 +1335,7 @@ void EDBM_mesh_reveal(BMEditMesh *em)
|
|||
|
||||
BM_ITER_MESH (ele, &iter, em->bm, iter_types[i]) {
|
||||
if (BM_elem_flag_test(ele, BM_ELEM_TAG)) {
|
||||
BM_elem_select_set(em->bm, ele, TRUE);
|
||||
BM_elem_select_set(em->bm, ele, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1364,6 +1364,6 @@ void EDBM_update_generic(BMEditMesh *em, const bool do_tessface, const bool is_d
|
|||
}
|
||||
else {
|
||||
/* in debug mode double check we didn't need to recalculate */
|
||||
BLI_assert(EDBM_index_arrays_check(em) == TRUE);
|
||||
BLI_assert(EDBM_index_arrays_check(em) == true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -349,7 +349,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
|
|||
BMEditMesh *em;
|
||||
int layernum_dst;
|
||||
|
||||
short is_init = FALSE;
|
||||
bool is_init = false;
|
||||
|
||||
if (me->edit_btmesh) {
|
||||
em = me->edit_btmesh;
|
||||
|
@ -376,7 +376,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
|
|||
const int layernum_src = CustomData_get_active_layer(&em->bm->ldata, CD_MLOOPUV);
|
||||
BM_data_layer_copy(em->bm, &em->bm->ldata, CD_MLOOPUV, layernum_src, layernum_dst);
|
||||
|
||||
is_init = TRUE;
|
||||
is_init = true;
|
||||
}
|
||||
if (active_set || layernum_dst == 0) {
|
||||
CustomData_set_layer_active(&em->bm->ldata, CD_MLOOPUV, layernum_dst);
|
||||
|
@ -391,7 +391,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
|
|||
CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DUPLICATE, me->mtpoly, me->totpoly, name);
|
||||
CustomData_add_layer_named(&me->ldata, CD_MLOOPUV, CD_DUPLICATE, me->mloopuv, me->totloop, name);
|
||||
CustomData_add_layer_named(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface, name);
|
||||
is_init = TRUE;
|
||||
is_init = true;
|
||||
}
|
||||
else {
|
||||
CustomData_add_layer_named(&me->pdata, CD_MTEXPOLY, CD_DEFAULT, NULL, me->totpoly, name);
|
||||
|
@ -410,7 +410,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s
|
|||
}
|
||||
|
||||
/* don't overwrite our copied coords */
|
||||
if (is_init == FALSE) {
|
||||
if (is_init == false) {
|
||||
ED_mesh_uv_loop_reset_ex(me, layernum_dst);
|
||||
}
|
||||
|
||||
|
@ -550,7 +550,7 @@ static int mesh_uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
Object *ob = ED_object_context(C);
|
||||
Mesh *me = ob->data;
|
||||
|
||||
if (ED_mesh_uv_texture_add(C, me, NULL, TRUE) == -1)
|
||||
if (ED_mesh_uv_texture_add(C, me, NULL, true) == -1)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -699,7 +699,7 @@ static int mesh_vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
Object *ob = ED_object_context(C);
|
||||
Mesh *me = ob->data;
|
||||
|
||||
if (ED_mesh_color_add(C, scene, ob, me, NULL, TRUE) == -1)
|
||||
if (ED_mesh_color_add(C, scene, ob, me, NULL, true) == -1)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -757,7 +757,7 @@ static int mesh_customdata_clear_exec__internal(bContext *C,
|
|||
int tot;
|
||||
CustomData *data = mesh_customdata_get_type(me, htype, &tot);
|
||||
|
||||
BLI_assert(CustomData_layertype_is_singleton(type) == TRUE);
|
||||
BLI_assert(CustomData_layertype_is_singleton(type) == true);
|
||||
|
||||
if (CustomData_has_layer(data, type)) {
|
||||
if (me->edit_btmesh) {
|
||||
|
@ -786,21 +786,21 @@ static int mesh_customdata_clear_mask_poll(bContext *C)
|
|||
|
||||
/* special case - can't run this if we're in sculpt mode */
|
||||
if (ob->mode & OB_MODE_SCULPT) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (me->id.lib == NULL) {
|
||||
CustomData *data = GET_CD_DATA(me, vdata);
|
||||
if (CustomData_has_layer(data, CD_PAINT_MASK)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
data = GET_CD_DATA(me, ldata);
|
||||
if (CustomData_has_layer(data, CD_GRID_PAINT_MASK)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
static int mesh_customdata_clear_mask_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
|
@ -843,11 +843,11 @@ static int mesh_customdata_clear_skin_poll(bContext *C)
|
|||
if (me->id.lib == NULL) {
|
||||
CustomData *data = GET_CD_DATA(me, vdata);
|
||||
if (CustomData_has_layer(data, CD_MVERT_SKIN)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
static int mesh_customdata_clear_skin_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
|
@ -875,20 +875,20 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
|
|||
{
|
||||
int *polyindex = NULL;
|
||||
float (*face_nors)[3];
|
||||
int tessface_input = FALSE;
|
||||
bool tessface_input = false;
|
||||
|
||||
if (mesh->totface > 0 && mesh->totpoly == 0) {
|
||||
BKE_mesh_convert_mfaces_to_mpolys(mesh);
|
||||
|
||||
/* would only be converting back again, don't bother */
|
||||
tessface_input = TRUE;
|
||||
tessface_input = true;
|
||||
}
|
||||
|
||||
if (calc_edges || ((mesh->totpoly || mesh->totface) && mesh->totedge == 0))
|
||||
BKE_mesh_calc_edges(mesh, calc_edges, true);
|
||||
|
||||
if (calc_tessface) {
|
||||
if (tessface_input == FALSE) {
|
||||
if (tessface_input == false) {
|
||||
BKE_mesh_tessface_calc(mesh);
|
||||
}
|
||||
}
|
||||
|
@ -911,7 +911,7 @@ void ED_mesh_update(Mesh *mesh, bContext *C, int calc_edges, int calc_tessface)
|
|||
mesh->totloop, mesh->totpoly,
|
||||
NULL /* polyNors_r */,
|
||||
mesh->mface, mesh->totface,
|
||||
polyindex, face_nors, FALSE);
|
||||
polyindex, face_nors, false);
|
||||
#else
|
||||
BKE_mesh_calc_normals(mesh->mvert, mesh->totvert,
|
||||
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
|
||||
|
@ -1239,7 +1239,7 @@ void ED_mesh_calc_normals(Mesh *mesh)
|
|||
#ifdef USE_BMESH_MPOLY_NORMALS
|
||||
BKE_mesh_calc_normals_mapping_ex(mesh->mvert, mesh->totvert,
|
||||
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
|
||||
NULL, NULL, 0, NULL, NULL, FALSE);
|
||||
NULL, NULL, 0, NULL, NULL, false);
|
||||
#else
|
||||
BKE_mesh_calc_normals(mesh->mvert, mesh->totvert,
|
||||
mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly,
|
||||
|
|
|
@ -59,24 +59,24 @@ struct LinkNode;
|
|||
*/
|
||||
|
||||
/*calls a bmesh op, reporting errors to the user, etc*/
|
||||
int EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
|
||||
bool EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...);
|
||||
|
||||
int EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op,
|
||||
const char *selectslot, const char *fmt, ...);
|
||||
bool EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op,
|
||||
const char *selectslot, const char *fmt, ...);
|
||||
|
||||
/* same as above, but doesn't report errors.*/
|
||||
int EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...);
|
||||
bool EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...);
|
||||
|
||||
/* these next two functions are the split version of EDBM_op_callf, so you can
|
||||
* do stuff with a bmesh operator, after initializing it but before executing
|
||||
* it.
|
||||
*
|
||||
* execute the operator with BM_Exec_Op */
|
||||
int EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop,
|
||||
struct wmOperator *op, const char *fmt, ...);
|
||||
bool EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop,
|
||||
struct wmOperator *op, const char *fmt, ...);
|
||||
/*cleans up after a bmesh operator*/
|
||||
int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
|
||||
struct wmOperator *op, const int report);
|
||||
bool EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop,
|
||||
struct wmOperator *op, const bool do_report);
|
||||
|
||||
void EDBM_stats_update(struct BMEditMesh *em);
|
||||
|
||||
|
|
|
@ -320,7 +320,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
|
|||
|
||||
if (createob) {
|
||||
/* create new object */
|
||||
obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, lay);
|
||||
obedit = ED_object_add_type(C, OB_MESH, co, rot, false, lay);
|
||||
}
|
||||
else {
|
||||
obedit = base->object;
|
||||
|
@ -401,7 +401,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
|
|||
EDBM_vert_at_index(em, face[0]),
|
||||
EDBM_vert_at_index(em, face[2]),
|
||||
EDBM_vert_at_index(em, face[1]), NULL,
|
||||
NULL, FALSE);
|
||||
NULL, false);
|
||||
|
||||
/* set navigation polygon idx to the custom layer */
|
||||
polygonIdx = (int *)CustomData_bmesh_get(&em->bm->pdata, newFace->head.data, CD_RECAST);
|
||||
|
@ -500,7 +500,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
|
|||
BMEditMesh *em = BMEdit_FromObject(obedit);
|
||||
|
||||
/* do work here */
|
||||
BMFace *efa_act = BM_active_face_get(em->bm, FALSE, FALSE);
|
||||
BMFace *efa_act = BM_active_face_get(em->bm, false, false);
|
||||
|
||||
if (efa_act) {
|
||||
if (CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
|
||||
|
@ -633,16 +633,16 @@ static int navmesh_obmode_data_poll(bContext *C)
|
|||
Mesh *me = ob->data;
|
||||
return CustomData_has_layer(&me->pdata, CD_RECAST);
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int navmesh_obmode_poll(bContext *C)
|
||||
{
|
||||
Object *ob = ED_object_active_context(C);
|
||||
if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static int navmesh_reset_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
|
|
|
@ -206,52 +206,52 @@ void ED_operatormacros_mesh(void)
|
|||
WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", "Rip polygons and move the result",
|
||||
OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_rip");
|
||||
RNA_boolean_set(otmacro->ptr, "use_fill", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "use_fill", false);
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
||||
|
||||
/* annoying we can't pass 'use_fill' through the macro */
|
||||
ot = WM_operatortype_append_macro("MESH_OT_rip_move_fill", "Rip Fill", "Rip-fill polygons and move the result",
|
||||
OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_rip");
|
||||
RNA_boolean_set(otmacro->ptr, "use_fill", TRUE);
|
||||
RNA_boolean_set(otmacro->ptr, "use_fill", true);
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move",
|
||||
"Extrude region and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move",
|
||||
"Extrude faces and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move",
|
||||
"Extrude edges and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move",
|
||||
"Extrude vertices and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", false);
|
||||
}
|
||||
|
||||
/* note mesh keymap also for other space? */
|
||||
|
@ -268,29 +268,29 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
|||
WM_keymap_add_item(keymap, "MESH_OT_inset", IKEY, KM_PRESS, 0, 0);
|
||||
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "vertex_only", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "vertex_only", false);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_bevel", BKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "vertex_only", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "vertex_only", true);
|
||||
|
||||
/* selecting */
|
||||
/* standard mouse selection goes via space_view3d */
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "extend", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "extend", false);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", false);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", false);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "extend", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "extend", false);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", false);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", true);
|
||||
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT | KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "extend", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "extend", false);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", false);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", false);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT | KM_ALT | KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "extend", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "extend", false);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", false);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", true);
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
|
@ -305,9 +305,9 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
|||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", false);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "deselect", true);
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL | KM_SHIFT | KM_ALT), 0);
|
||||
|
||||
|
@ -318,16 +318,16 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
|||
|
||||
/* hide */
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(kmi->ptr, "unselected", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "unselected", false);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "unselected", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "unselected", true);
|
||||
WM_keymap_add_item(keymap, "MESH_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
|
||||
|
||||
/* tools */
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "inside", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "inside", false);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "inside", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "inside", true);
|
||||
|
||||
WM_keymap_add_item(keymap, "VIEW3D_OT_edit_mesh_extrude_move_normal", EKEY, KM_PRESS, 0, 0); /* python operator */
|
||||
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_extrude", EKEY, KM_PRESS, KM_ALT, 0);
|
||||
|
@ -340,9 +340,9 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
|||
WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0);
|
||||
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "use_beauty", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "use_beauty", true);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "use_beauty", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "use_beauty", false);
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
|
||||
|
||||
|
@ -368,20 +368,20 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
|||
WM_keymap_add_item(keymap, "TRANSFORM_OT_vert_slide", VKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
/* use KM_CLICK because same key is used for tweaks */
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "rotate_source", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "rotate_source", true);
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_SHIFT | KM_CTRL, 0);
|
||||
RNA_boolean_set(kmi->ptr, "rotate_source", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "rotate_source", false);
|
||||
|
||||
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(kmi->ptr, "use_occlude_geometry", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "only_selected", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "use_occlude_geometry", true);
|
||||
RNA_boolean_set(kmi->ptr, "only_selected", false);
|
||||
|
||||
kmi = WM_keymap_add_item(keymap, "MESH_OT_knife_tool", KKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "use_occlude_geometry", FALSE);
|
||||
RNA_boolean_set(kmi->ptr, "only_selected", TRUE);
|
||||
RNA_boolean_set(kmi->ptr, "use_occlude_geometry", false);
|
||||
RNA_boolean_set(kmi->ptr, "only_selected", true);
|
||||
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
|
@ -401,7 +401,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
|||
}
|
||||
|
||||
ED_keymap_proportional_cycle(keyconf, keymap);
|
||||
ED_keymap_proportional_editmode(keyconf, keymap, TRUE);
|
||||
ED_keymap_proportional_editmode(keyconf, keymap, true);
|
||||
|
||||
knifetool_modal_keymap(keyconf);
|
||||
}
|
||||
|
|
|
@ -430,8 +430,8 @@ int join_mesh_exec(bContext *C, wmOperator *op)
|
|||
|
||||
multiresModifier_prepare_join(scene, base->object, ob);
|
||||
|
||||
if ((mmd = get_multires_modifier(scene, base->object, TRUE))) {
|
||||
ED_object_iter_other(bmain, base->object, TRUE,
|
||||
if ((mmd = get_multires_modifier(scene, base->object, true))) {
|
||||
ED_object_iter_other(bmain, base->object, true,
|
||||
ED_object_multires_update_totlevels_cb,
|
||||
&mmd->totlvl);
|
||||
}
|
||||
|
@ -724,9 +724,9 @@ static void mesh_octree_add_nodes(MocNode **basetable, const float co[3], const
|
|||
float fx, fy, fz;
|
||||
int vx, vy, vz;
|
||||
|
||||
if ((finite(co[0]) == FALSE) ||
|
||||
(finite(co[1]) == FALSE) ||
|
||||
(finite(co[2]) == FALSE))
|
||||
if ((finite(co[0]) == false) ||
|
||||
(finite(co[1]) == false) ||
|
||||
(finite(co[2]) == false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ int mesh_mirrtopo_table(Object *ob, char mode)
|
|||
}
|
||||
}
|
||||
else if (mode == 's') { /* start table */
|
||||
ED_mesh_mirrtopo_init(ob->data, ob->mode, &mesh_topo_store, FALSE);
|
||||
ED_mesh_mirrtopo_init(ob->data, ob->mode, &mesh_topo_store, false);
|
||||
}
|
||||
else if (mode == 'e') { /* end table */
|
||||
ED_mesh_mirrtopo_free(&mesh_topo_store);
|
||||
|
@ -957,9 +957,9 @@ static BMVert *editbmesh_get_x_mirror_vert_spatial(Object *ob, BMEditMesh *em, c
|
|||
intptr_t poinval;
|
||||
|
||||
/* ignore nan verts */
|
||||
if ((finite(co[0]) == FALSE) ||
|
||||
(finite(co[1]) == FALSE) ||
|
||||
(finite(co[2]) == FALSE))
|
||||
if ((finite(co[0]) == false) ||
|
||||
(finite(co[1]) == false) ||
|
||||
(finite(co[2]) == false))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1174,9 +1174,9 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em)
|
|||
* Face selection in object mode,
|
||||
* currently only weight-paint and vertex-paint use this.
|
||||
*
|
||||
* \return boolean TRUE == Found
|
||||
* \return boolean true == Found
|
||||
*/
|
||||
int ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
|
||||
bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
|
||||
{
|
||||
ViewContext vc;
|
||||
Mesh *me = ob->data;
|
||||
|
@ -1184,7 +1184,7 @@ int ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *
|
|||
BLI_assert(me && GS(me->id.name) == ID_ME);
|
||||
|
||||
if (!me || me->totpoly == 0)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
|
||||
|
@ -1201,17 +1201,17 @@ int ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int *
|
|||
}
|
||||
|
||||
if ((*index) <= 0 || (*index) > (unsigned int)me->totpoly)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
(*index)--;
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Use when the back buffer stores face index values. but we want a vert.
|
||||
* This gets the face then finds the closest vertex to mval.
|
||||
*/
|
||||
int ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
|
||||
bool ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size)
|
||||
{
|
||||
unsigned int poly_index;
|
||||
Mesh *me = ob->data;
|
||||
|
@ -1257,18 +1257,18 @@ int ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], unsigned
|
|||
|
||||
if (v_idx_best != -1) {
|
||||
*index = v_idx_best;
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vertex selection in object mode,
|
||||
* currently only weight paint uses this.
|
||||
*
|
||||
* \return boolean TRUE == Found
|
||||
* \return boolean true == Found
|
||||
*/
|
||||
typedef struct VertPickData {
|
||||
const MVert *mvert;
|
||||
|
@ -1296,7 +1296,7 @@ static void ed_mesh_pick_vert__mapFunc(void *userData, int index, const float co
|
|||
}
|
||||
}
|
||||
}
|
||||
int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size, int use_zbuf)
|
||||
bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *index, int size, bool use_zbuf)
|
||||
{
|
||||
ViewContext vc;
|
||||
Mesh *me = ob->data;
|
||||
|
@ -1304,7 +1304,7 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
|
|||
BLI_assert(me && GS(me->id.name) == ID_ME);
|
||||
|
||||
if (!me || me->totvert == 0)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
|
||||
|
@ -1322,7 +1322,7 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
|
|||
}
|
||||
|
||||
if ((*index) <= 0 || (*index) > (unsigned int)me->totvert)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
(*index)--;
|
||||
}
|
||||
|
@ -1341,7 +1341,7 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
|
|||
ED_view3d_init_mats_rv3d(ob, rv3d);
|
||||
|
||||
if (dm == NULL) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* setup data */
|
||||
|
@ -1356,11 +1356,11 @@ int ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int *
|
|||
dm->release(dm);
|
||||
|
||||
if (data.v_idx_best == -1) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
*index = data.v_idx_best;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -411,7 +411,7 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
|
|||
|
||||
/* Select MetaElement with mouse click (user can select radius circle or
|
||||
* stiffness circle) */
|
||||
int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int toggle)
|
||||
bool mouse_mball(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
static MetaElem *startelem = NULL;
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
|
@ -487,11 +487,11 @@ int mouse_mball(bContext *C, const int mval[2], int extend, int deselect, int to
|
|||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, mb);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -638,7 +638,7 @@ static BPoint *findnearestLattvert(ViewContext *vc, const int mval[2], int sel)
|
|||
return data.bp;
|
||||
}
|
||||
|
||||
int mouse_lattice(bContext *C, const int mval[2], int extend, int deselect, int toggle)
|
||||
bool mouse_lattice(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
ViewContext vc;
|
||||
BPoint *bp = NULL;
|
||||
|
@ -663,10 +663,10 @@ int mouse_lattice(bContext *C, const int mval[2], int extend, int deselect, int
|
|||
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
|
||||
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/******************************** Undo *************************/
|
||||
|
|
|
@ -198,7 +198,7 @@ static int object_has_modifier(const Object *ob, const ModifierData *exclude,
|
|||
* If the callback ever returns TRUE, iteration will stop and the
|
||||
* function value will be TRUE. Otherwise the function returns FALSE.
|
||||
*/
|
||||
int ED_object_iter_other(Main *bmain, Object *orig_ob, int include_orig,
|
||||
int ED_object_iter_other(Main *bmain, Object *orig_ob, const bool include_orig,
|
||||
int (*callback)(Object *ob, void *callback_data),
|
||||
void *callback_data)
|
||||
{
|
||||
|
|
|
@ -843,20 +843,20 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static int parent_set_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
||||
static bool parent_set_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
int type = RNA_enum_get(ptr, "type");
|
||||
|
||||
/* Only show XMirror for PAR_ARMATURE_ENVELOPE and PAR_ARMATURE_AUTO! */
|
||||
if (strcmp(prop_id, "xmirror") == 0) {
|
||||
if (STREQ(prop_id, "xmirror")) {
|
||||
if (ELEM(type, PAR_ARMATURE_ENVELOPE, PAR_ARMATURE_AUTO))
|
||||
return TRUE;
|
||||
return true;
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void parent_set_ui(bContext *C, wmOperator *op)
|
||||
|
|
|
@ -894,13 +894,13 @@ void OBJECT_OT_select_grouped(wmOperatorType *ot)
|
|||
static int object_select_by_layer_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
unsigned int layernum;
|
||||
short extend, match;
|
||||
bool extend, match;
|
||||
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
layernum = RNA_int_get(op->ptr, "layers");
|
||||
match = RNA_enum_get(op->ptr, "match");
|
||||
|
||||
if (extend == 0) {
|
||||
if (extend == false) {
|
||||
CTX_DATA_BEGIN (C, Base *, base, visible_bases)
|
||||
{
|
||||
ED_base_object_select(base, BA_DESELECT);
|
||||
|
@ -910,12 +910,12 @@ static int object_select_by_layer_exec(bContext *C, wmOperator *op)
|
|||
|
||||
CTX_DATA_BEGIN (C, Base *, base, visible_bases)
|
||||
{
|
||||
int ok = 0;
|
||||
bool ok = false;
|
||||
|
||||
if (match == 1) /* exact */
|
||||
if (match == true) /* exact */
|
||||
ok = (base->lay == (1 << (layernum - 1)));
|
||||
else /* shared layers */
|
||||
ok = (base->lay & (1 << (layernum - 1)));
|
||||
ok = (base->lay & (1 << (layernum - 1))) != 0;
|
||||
|
||||
if (ok)
|
||||
ED_base_object_select(base, BA_SELECT);
|
||||
|
@ -1072,7 +1072,7 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot)
|
|||
static int object_select_mirror_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
short extend;
|
||||
bool extend;
|
||||
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
||||
|
@ -1093,7 +1093,7 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
}
|
||||
|
||||
if (extend == 0) ED_base_object_select(primbase, BA_DESELECT);
|
||||
if (extend == false) ED_base_object_select(primbase, BA_DESELECT);
|
||||
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
@ -1128,11 +1128,11 @@ void OBJECT_OT_select_mirror(wmOperatorType *ot)
|
|||
static int object_select_random_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
float percent;
|
||||
short extend;
|
||||
bool extend;
|
||||
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
||||
if (extend == 0) {
|
||||
if (extend == false) {
|
||||
CTX_DATA_BEGIN (C, Base *, base, visible_bases)
|
||||
{
|
||||
ED_base_object_select(base, BA_DESELECT);
|
||||
|
|
|
@ -1403,7 +1403,7 @@ void PARTICLE_OT_select_all(wmOperatorType *ot)
|
|||
|
||||
/************************ pick select operator ************************/
|
||||
|
||||
int PE_mouse_particles(bContext *C, const int mval[2], int extend, int deselect, int toggle)
|
||||
int PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
|
||||
{
|
||||
PEData data;
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
|
@ -1584,7 +1584,7 @@ void PE_deselect_all_visible(PTCacheEdit *edit)
|
|||
}
|
||||
}
|
||||
|
||||
int PE_border_select(bContext *C, rcti *rect, int select, int extend)
|
||||
int PE_border_select(bContext *C, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
|
@ -1636,7 +1636,7 @@ int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad)
|
|||
|
||||
/************************ lasso select operator ************************/
|
||||
|
||||
int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short extend, short select)
|
||||
int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, bool extend, bool select)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
|
|
|
@ -27,14 +27,14 @@
|
|||
* \ingroup edrend
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#include "WM_api.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "ED_render.h"
|
||||
|
||||
#include "WM_api.h"
|
||||
|
||||
#include "render_intern.h" // own include
|
||||
|
||||
#if (defined(WITH_QUICKTIME) && !defined(USE_QTKIT))
|
||||
|
|
|
@ -232,11 +232,11 @@ static int screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static int screenshot_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
static bool screenshot_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
|
||||
return !(strcmp(prop_id, "filepath") == 0);
|
||||
return !(STREQ(prop_id, "filepath"));
|
||||
}
|
||||
|
||||
static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
|
||||
|
|
|
@ -449,7 +449,7 @@ static int sound_mixdown_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
|||
|
||||
#ifdef WITH_AUDASPACE
|
||||
|
||||
static int sound_mixdown_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
static bool sound_mixdown_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
return !(strcmp(prop_id, "filepath") == 0 ||
|
||||
|
|
|
@ -45,8 +45,8 @@ void console_scrollback_prompt_end(struct SpaceConsole *sc, ConsoleLine *cl_dumm
|
|||
/* console_ops.c */
|
||||
void console_history_free(SpaceConsole *sc, ConsoleLine *cl);
|
||||
void console_scrollback_free(SpaceConsole *sc, ConsoleLine *cl);
|
||||
ConsoleLine *console_history_add_str(struct SpaceConsole *sc, char *str, int own);
|
||||
ConsoleLine *console_scrollback_add_str(struct SpaceConsole *sc, char *str, int own);
|
||||
ConsoleLine *console_history_add_str(struct SpaceConsole *sc, char *str, bool own);
|
||||
ConsoleLine *console_scrollback_add_str(struct SpaceConsole *sc, char *str, bool own);
|
||||
|
||||
ConsoleLine *console_history_verify(const struct bContext *C);
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ static ConsoleLine *console_history_find(SpaceConsole *sc, const char *str, Cons
|
|||
}
|
||||
|
||||
/* return 0 if no change made, clamps the range */
|
||||
static int console_line_cursor_set(ConsoleLine *cl, int cursor)
|
||||
static bool console_line_cursor_set(ConsoleLine *cl, int cursor)
|
||||
{
|
||||
int cursor_new;
|
||||
|
||||
|
@ -125,11 +125,11 @@ static int console_line_cursor_set(ConsoleLine *cl, int cursor)
|
|||
else cursor_new = cursor;
|
||||
|
||||
if (cursor_new == cl->cursor) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
cl->cursor = cursor_new;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if 0 // XXX unused
|
||||
|
@ -188,7 +188,7 @@ static ConsoleLine *console_scrollback_add(const bContext *C, ConsoleLine *from)
|
|||
}
|
||||
#endif
|
||||
|
||||
static ConsoleLine *console_lb_add_str__internal(ListBase *lb, char *str, int own)
|
||||
static ConsoleLine *console_lb_add_str__internal(ListBase *lb, char *str, bool own)
|
||||
{
|
||||
ConsoleLine *ci = MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add");
|
||||
if (own) ci->line = str;
|
||||
|
@ -199,11 +199,11 @@ static ConsoleLine *console_lb_add_str__internal(ListBase *lb, char *str, int ow
|
|||
BLI_addtail(lb, ci);
|
||||
return ci;
|
||||
}
|
||||
ConsoleLine *console_history_add_str(SpaceConsole *sc, char *str, int own)
|
||||
ConsoleLine *console_history_add_str(SpaceConsole *sc, char *str, bool own)
|
||||
{
|
||||
return console_lb_add_str__internal(&sc->history, str, own);
|
||||
}
|
||||
ConsoleLine *console_scrollback_add_str(SpaceConsole *sc, char *str, int own)
|
||||
ConsoleLine *console_scrollback_add_str(SpaceConsole *sc, char *str, bool own)
|
||||
{
|
||||
ConsoleLine *ci = console_lb_add_str__internal(&sc->scrollback, str, own);
|
||||
console_select_offset(sc, ci->len + 1);
|
||||
|
@ -276,7 +276,7 @@ static int console_move_exec(bContext *C, wmOperator *op)
|
|||
ConsoleLine *ci = console_history_verify(C);
|
||||
|
||||
int type = RNA_enum_get(op->ptr, "type");
|
||||
int done = FALSE;
|
||||
bool done = false;
|
||||
int pos;
|
||||
|
||||
switch (type) {
|
||||
|
|
|
@ -190,12 +190,12 @@ static void file_panel_operator_header(const bContext *C, Panel *pa)
|
|||
BLI_strncpy(pa->drawname, RNA_struct_ui_name(op->type->srna), sizeof(pa->drawname));
|
||||
}
|
||||
|
||||
static int file_panel_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
static bool file_panel_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
return !(strcmp(prop_id, "filepath") == 0 ||
|
||||
strcmp(prop_id, "directory") == 0 ||
|
||||
strcmp(prop_id, "filename") == 0
|
||||
return !(STREQ(prop_id, "filepath") ||
|
||||
STREQ(prop_id, "directory") ||
|
||||
STREQ(prop_id, "filename")
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1483,15 +1483,15 @@ static int image_save_as_cancel(bContext *UNUSED(C), wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static int image_save_as_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
||||
static bool image_save_as_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
|
||||
return !(strcmp(prop_id, "filepath") == 0 ||
|
||||
strcmp(prop_id, "directory") == 0 ||
|
||||
strcmp(prop_id, "filename") == 0 ||
|
||||
return !(STREQ(prop_id, "filepath") ||
|
||||
STREQ(prop_id, "directory") ||
|
||||
STREQ(prop_id, "filename") ||
|
||||
/* when saving a copy, relative path has no effect */
|
||||
((strcmp(prop_id, "relative_path") == 0) && RNA_boolean_get(ptr, "copy"))
|
||||
((STREQ(prop_id, "relative_path")) && RNA_boolean_get(ptr, "copy"))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -320,10 +320,10 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
|||
View2D *v2d = UI_view2d_fromcontext(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
|
||||
short extend = RNA_boolean_get(op->ptr, "extend");
|
||||
short linked_handle = RNA_boolean_get(op->ptr, "linked_handle");
|
||||
short left_right = RNA_boolean_get(op->ptr, "left_right");
|
||||
short linked_time = RNA_boolean_get(op->ptr, "linked_time");
|
||||
const bool extend = RNA_boolean_get(op->ptr, "extend");
|
||||
const bool linked_handle = RNA_boolean_get(op->ptr, "linked_handle");
|
||||
const bool linked_time = RNA_boolean_get(op->ptr, "linked_time");
|
||||
bool left_right = RNA_boolean_get(op->ptr, "left_right");
|
||||
|
||||
Sequence *seq, *neighbor, *act_orig;
|
||||
int hand, sel_side;
|
||||
|
@ -673,7 +673,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, cons
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
View2D *v2d = UI_view2d_fromcontext(C);
|
||||
|
||||
short extend = RNA_boolean_get(op->ptr, "extend");
|
||||
bool extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
||||
Sequence *mouse_seq;
|
||||
int selected, hand;
|
||||
|
|
|
@ -127,7 +127,7 @@ bool view3d_get_view_aligned_coordinate(ARegion *ar, float fp[3], const int mval
|
|||
ED_view3d_win_to_delta(ar, mval_f, dvec, zfac);
|
||||
sub_v3_v3(fp, dvec);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
/* fallback to the view center */
|
||||
|
@ -262,17 +262,17 @@ typedef struct LassoSelectUserData {
|
|||
rctf _rect_fl;
|
||||
const int (*mcords)[2];
|
||||
int moves;
|
||||
int select;
|
||||
bool select;
|
||||
|
||||
/* runtime */
|
||||
int pass;
|
||||
int is_done;
|
||||
int is_change;
|
||||
bool is_done;
|
||||
bool is_change;
|
||||
} LassoSelectUserData;
|
||||
|
||||
static void view3d_userdata_lassoselect_init(LassoSelectUserData *r_data,
|
||||
ViewContext *vc, const rcti *rect, const int (*mcords)[2],
|
||||
const int moves, const int select)
|
||||
const int moves, const bool select)
|
||||
{
|
||||
r_data->vc = vc;
|
||||
|
||||
|
@ -286,8 +286,8 @@ static void view3d_userdata_lassoselect_init(LassoSelectUserData *r_data,
|
|||
|
||||
/* runtime */
|
||||
r_data->pass = 0;
|
||||
r_data->is_done = FALSE;
|
||||
r_data->is_change = FALSE;
|
||||
r_data->is_done = false;
|
||||
r_data->is_change = false;
|
||||
}
|
||||
|
||||
static int view3d_selectable_data(bContext *C)
|
||||
|
@ -356,7 +356,7 @@ static void do_lasso_select_pose__doSelectBone(void *userData, struct bPoseChann
|
|||
bArmature *arm = data->vc->obact->data;
|
||||
|
||||
if (PBONE_SELECTABLE(arm, pchan->bone)) {
|
||||
int is_point_done = FALSE;
|
||||
bool is_point_done = false;
|
||||
int points_proj_tot = 0;
|
||||
|
||||
const int x0 = screen_co_a[0];
|
||||
|
@ -370,7 +370,7 @@ static void do_lasso_select_pose__doSelectBone(void *userData, struct bPoseChann
|
|||
if (BLI_rcti_isect_pt(data->rect, x0, y0) &&
|
||||
BLI_lasso_is_point_inside(data->mcords, data->moves, x0, y0, INT_MAX))
|
||||
{
|
||||
is_point_done = TRUE;
|
||||
is_point_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,23 +380,23 @@ static void do_lasso_select_pose__doSelectBone(void *userData, struct bPoseChann
|
|||
if (BLI_rcti_isect_pt(data->rect, x1, y1) &&
|
||||
BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, INT_MAX))
|
||||
{
|
||||
is_point_done = TRUE;
|
||||
is_point_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* if one of points selected, we skip the bone itself */
|
||||
if ((is_point_done == TRUE) ||
|
||||
((is_point_done == FALSE) && (points_proj_tot == 2) &&
|
||||
if ((is_point_done == true) ||
|
||||
((is_point_done == false) && (points_proj_tot == 2) &&
|
||||
BLI_lasso_is_edge_inside(data->mcords, data->moves, x0, y0, x1, y1, INT_MAX)))
|
||||
{
|
||||
if (data->select) pchan->bone->flag |= BONE_SELECTED;
|
||||
else pchan->bone->flag &= ~BONE_SELECTED;
|
||||
data->is_change = TRUE;
|
||||
data->is_change = true;
|
||||
}
|
||||
data->is_change |= is_point_done;
|
||||
}
|
||||
}
|
||||
static void do_lasso_select_pose(ViewContext *vc, Object *ob, const int mcords[][2], short moves, short select)
|
||||
static void do_lasso_select_pose(ViewContext *vc, Object *ob, const int mcords[][2], short moves, bool select)
|
||||
{
|
||||
ViewContext vc_tmp;
|
||||
LassoSelectUserData data;
|
||||
|
@ -437,11 +437,11 @@ static void object_deselect_all_visible(Scene *scene, View3D *v3d)
|
|||
}
|
||||
}
|
||||
|
||||
static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], const short moves, short extend, short select)
|
||||
static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], const short moves, bool extend, bool select)
|
||||
{
|
||||
Base *base;
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
object_deselect_all_visible(vc->scene, vc->v3d);
|
||||
|
||||
for (base = vc->scene->base.first; base; base = base->next) {
|
||||
|
@ -486,7 +486,7 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, cons
|
|||
BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, IS_CLIPPED))
|
||||
{
|
||||
BM_edge_select_set(data->vc->em->bm, eed, data->select);
|
||||
data->is_done = TRUE;
|
||||
data->is_done = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -507,7 +507,7 @@ static void do_lasso_select_mesh__doSelectFace(void *userData, BMFace *efa, cons
|
|||
}
|
||||
}
|
||||
|
||||
static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
|
||||
static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select)
|
||||
{
|
||||
LassoSelectUserData data;
|
||||
ToolSettings *ts = vc->scene->toolsettings;
|
||||
|
@ -521,7 +521,7 @@ static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short m
|
|||
|
||||
view3d_userdata_lassoselect_init(&data, vc, &rect, mcords, moves, select);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT);
|
||||
|
||||
/* for non zbuf projections, don't change the GL state */
|
||||
|
@ -543,7 +543,7 @@ static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short m
|
|||
data.pass = 0;
|
||||
mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_PROJ_TEST_CLIP_NEAR);
|
||||
|
||||
if (data.is_done == 0) {
|
||||
if (data.is_done == false) {
|
||||
data.pass = 1;
|
||||
mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, V3D_PROJ_TEST_CLIP_NEAR);
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BP
|
|||
}
|
||||
}
|
||||
|
||||
static void do_lasso_select_curve(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
|
||||
static void do_lasso_select_curve(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select)
|
||||
{
|
||||
LassoSelectUserData data;
|
||||
rcti rect;
|
||||
|
@ -604,7 +604,7 @@ static void do_lasso_select_curve(ViewContext *vc, const int mcords[][2], short
|
|||
|
||||
view3d_userdata_lassoselect_init(&data, vc, &rect, mcords, moves, select);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
CU_deselect_all(vc->obedit);
|
||||
|
||||
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
|
||||
|
@ -621,7 +621,7 @@ static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, const
|
|||
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
|
||||
}
|
||||
}
|
||||
static void do_lasso_select_lattice(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
|
||||
static void do_lasso_select_lattice(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select)
|
||||
{
|
||||
LassoSelectUserData data;
|
||||
rcti rect;
|
||||
|
@ -630,7 +630,7 @@ static void do_lasso_select_lattice(ViewContext *vc, const int mcords[][2], shor
|
|||
|
||||
view3d_userdata_lassoselect_init(&data, vc, &rect, mcords, moves, select);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
ED_setflagsLatt(vc->obedit, 0);
|
||||
|
||||
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
|
||||
|
@ -643,7 +643,7 @@ static void do_lasso_select_armature__doSelectBone(void *userData, struct EditBo
|
|||
bArmature *arm = data->vc->obedit->data;
|
||||
|
||||
if (EBONE_SELECTABLE(arm, ebone)) {
|
||||
int is_point_done = FALSE;
|
||||
bool is_point_done = false;
|
||||
int points_proj_tot = 0;
|
||||
|
||||
const int x0 = screen_co_a[0];
|
||||
|
@ -657,7 +657,7 @@ static void do_lasso_select_armature__doSelectBone(void *userData, struct EditBo
|
|||
if (BLI_rcti_isect_pt(data->rect, x0, y0) &&
|
||||
BLI_lasso_is_point_inside(data->mcords, data->moves, x0, y0, INT_MAX))
|
||||
{
|
||||
is_point_done = TRUE;
|
||||
is_point_done = true;
|
||||
if (data->select) ebone->flag |= BONE_ROOTSEL;
|
||||
else ebone->flag &= ~BONE_ROOTSEL;
|
||||
}
|
||||
|
@ -669,26 +669,26 @@ static void do_lasso_select_armature__doSelectBone(void *userData, struct EditBo
|
|||
if (BLI_rcti_isect_pt(data->rect, x1, y1) &&
|
||||
BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, INT_MAX))
|
||||
{
|
||||
is_point_done = TRUE;
|
||||
is_point_done = true;
|
||||
if (data->select) ebone->flag |= BONE_TIPSEL;
|
||||
else ebone->flag &= ~BONE_TIPSEL;
|
||||
}
|
||||
}
|
||||
|
||||
/* if one of points selected, we skip the bone itself */
|
||||
if ((is_point_done == FALSE) && (points_proj_tot == 2) &&
|
||||
if ((is_point_done == false) && (points_proj_tot == 2) &&
|
||||
BLI_lasso_is_edge_inside(data->mcords, data->moves, x0, y0, x1, y1, INT_MAX))
|
||||
{
|
||||
if (data->select) ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
data->is_change = TRUE;
|
||||
data->is_change = true;
|
||||
}
|
||||
|
||||
data->is_change |= is_point_done;
|
||||
}
|
||||
}
|
||||
|
||||
static void do_lasso_select_armature(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
|
||||
static void do_lasso_select_armature(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select)
|
||||
{
|
||||
LassoSelectUserData data;
|
||||
rcti rect;
|
||||
|
@ -699,7 +699,7 @@ static void do_lasso_select_armature(ViewContext *vc, const int mcords[][2], sho
|
|||
|
||||
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
ED_armature_deselect_all_visible(vc->obedit);
|
||||
|
||||
armature_foreachScreenBone(vc, do_lasso_select_armature__doSelectBone, &data, V3D_PROJ_TEST_CLIP_DEFAULT);
|
||||
|
@ -721,17 +721,17 @@ static void do_lasso_select_mball__doSelectElem(void *userData, struct MetaElem
|
|||
{
|
||||
if (data->select) ml->flag |= SELECT;
|
||||
else ml->flag &= ~SELECT;
|
||||
data->is_change = TRUE;
|
||||
data->is_change = true;
|
||||
}
|
||||
}
|
||||
static void do_lasso_select_meta(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
|
||||
static void do_lasso_select_meta(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select)
|
||||
{
|
||||
LassoSelectUserData data;
|
||||
rcti rect;
|
||||
|
||||
MetaBall *mb = (MetaBall *)vc->obedit->data;
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
BKE_mball_deselect_all(mb);
|
||||
|
||||
BLI_lasso_boundbox(&rect, mcords, moves);
|
||||
|
@ -753,7 +753,7 @@ static void do_lasso_select_meshobject__doSelectVert(void *userData, MVert *mv,
|
|||
BKE_BIT_TEST_SET(mv->flag, data->select, SELECT);
|
||||
}
|
||||
}
|
||||
static void do_lasso_select_paintvert(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
|
||||
static void do_lasso_select_paintvert(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select)
|
||||
{
|
||||
const int use_zbuf = (vc->v3d->flag & V3D_ZBUF_SELECT);
|
||||
Object *ob = vc->obact;
|
||||
|
@ -763,8 +763,8 @@ static void do_lasso_select_paintvert(ViewContext *vc, const int mcords[][2], sh
|
|||
if (me == NULL || me->totvert == 0)
|
||||
return;
|
||||
|
||||
if (extend == 0 && select)
|
||||
paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */
|
||||
if (extend == false && select)
|
||||
paintvert_deselect_all_visible(ob, SEL_DESELECT, false); /* flush selection at the end */
|
||||
|
||||
BLI_lasso_boundbox(&rect, mcords, moves);
|
||||
|
||||
|
@ -790,7 +790,7 @@ static void do_lasso_select_paintvert(ViewContext *vc, const int mcords[][2], sh
|
|||
|
||||
paintvert_flush_flags(ob);
|
||||
}
|
||||
static void do_lasso_select_paintface(ViewContext *vc, const int mcords[][2], short moves, short extend, short select)
|
||||
static void do_lasso_select_paintface(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select)
|
||||
{
|
||||
Object *ob = vc->obact;
|
||||
Mesh *me = ob ? ob->data : NULL;
|
||||
|
@ -799,8 +799,8 @@ static void do_lasso_select_paintface(ViewContext *vc, const int mcords[][2], sh
|
|||
if (me == NULL || me->totpoly == 0)
|
||||
return;
|
||||
|
||||
if (extend == 0 && select)
|
||||
paintface_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */
|
||||
if (extend == false && select)
|
||||
paintface_deselect_all_visible(ob, SEL_DESELECT, false); /* flush selection at the end */
|
||||
|
||||
bm_vertoffs = me->totpoly + 1; /* max index array */
|
||||
|
||||
|
@ -847,7 +847,7 @@ static void do_lasso_select_node(int mcords[][2], short moves, short select)
|
|||
|
||||
static void view3d_lasso_select(bContext *C, ViewContext *vc,
|
||||
const int mcords[][2], short moves,
|
||||
short extend, short select)
|
||||
bool extend, bool select)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
|
||||
|
@ -902,7 +902,7 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op)
|
|||
const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
|
||||
|
||||
if (mcords) {
|
||||
short extend, select;
|
||||
bool extend, select;
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
/* setup view context for argument to callbacks */
|
||||
|
@ -1033,7 +1033,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op)
|
|||
{
|
||||
int name_index = RNA_enum_get(op->ptr, "name");
|
||||
short toggle = RNA_boolean_get(op->ptr, "toggle");
|
||||
short changed = 0;
|
||||
bool change = false;
|
||||
const char *name = object_mouse_select_menu_data[name_index].idname;
|
||||
|
||||
if (!toggle) {
|
||||
|
@ -1041,7 +1041,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op)
|
|||
{
|
||||
if (base->flag & SELECT) {
|
||||
ED_base_object_select(base, BA_DESELECT);
|
||||
changed = 1;
|
||||
change = true;
|
||||
}
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
@ -1053,7 +1053,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op)
|
|||
if (STREQ(name, base->object->id.name + 2)) {
|
||||
ED_base_object_activate(C, base);
|
||||
ED_base_object_select(base, BA_SELECT);
|
||||
changed = 1;
|
||||
change = true;
|
||||
}
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
@ -1062,7 +1062,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op)
|
|||
memset(object_mouse_select_menu_data, 0, sizeof(object_mouse_select_menu_data));
|
||||
|
||||
/* undo? */
|
||||
if (changed) {
|
||||
if (change) {
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C));
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -1112,12 +1112,12 @@ static void deselectall_except(Scene *scene, Base *b) /* deselect all except b
|
|||
static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], short toggle)
|
||||
{
|
||||
short baseCount = 0;
|
||||
short ok;
|
||||
bool ok;
|
||||
LinkNode *linklist = NULL;
|
||||
|
||||
CTX_DATA_BEGIN (C, Base *, base, selectable_bases)
|
||||
{
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
|
||||
/* two selection methods, the CTRL select uses max dist of 15 */
|
||||
if (buffer) {
|
||||
|
@ -1125,7 +1125,7 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int
|
|||
for (a = 0; a < hits; a++) {
|
||||
/* index was converted */
|
||||
if (base->selcol == buffer[(4 * a) + 3])
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1134,7 +1134,7 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int
|
|||
|
||||
temp = abs(base->sx - mval[0]) + abs(base->sy - mval[1]);
|
||||
if (temp < dist)
|
||||
ok = TRUE;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
|
@ -1185,15 +1185,15 @@ static Base *object_mouse_select_menu(bContext *C, ViewContext *vc, unsigned int
|
|||
}
|
||||
}
|
||||
|
||||
static int selectbuffer_has_bones(const unsigned int *buffer, const unsigned int hits)
|
||||
static bool selectbuffer_has_bones(const unsigned int *buffer, const unsigned int hits)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < hits; i++) {
|
||||
if (buffer[(4 * i) + 3] & 0xFFFF0000) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* we want a select buffer with bones, if there are... */
|
||||
|
@ -1203,7 +1203,7 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff
|
|||
rcti rect;
|
||||
int offs;
|
||||
short hits15, hits9 = 0, hits5 = 0;
|
||||
short has_bones15 = FALSE, has_bones9 = FALSE, has_bones5 = FALSE;
|
||||
bool has_bones15 = false, has_bones9 = false, has_bones5 = false;
|
||||
|
||||
BLI_rcti_init(&rect, mval[0] - 14, mval[0] + 14, mval[1] - 14, mval[1] + 14);
|
||||
hits15 = view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect);
|
||||
|
@ -1255,20 +1255,22 @@ static short mixed_bones_object_selectbuffer(ViewContext *vc, unsigned int *buff
|
|||
}
|
||||
|
||||
/* returns basact */
|
||||
static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], Base *startbase, int has_bones)
|
||||
static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int hits, const int mval[2],
|
||||
Base *startbase, bool has_bones)
|
||||
{
|
||||
Scene *scene = vc->scene;
|
||||
View3D *v3d = vc->v3d;
|
||||
Base *base, *basact = NULL;
|
||||
static int lastmval[2] = {-100, -100};
|
||||
int a, do_nearest = FALSE;
|
||||
int a;
|
||||
bool do_nearest = false;
|
||||
|
||||
/* define if we use solid nearest select or not */
|
||||
if (v3d->drawtype > OB_WIRE) {
|
||||
do_nearest = TRUE;
|
||||
do_nearest = true;
|
||||
if (ABS(mval[0] - lastmval[0]) < 3 && ABS(mval[1] - lastmval[1]) < 3) {
|
||||
if (!has_bones) /* hrms, if theres bones we always do nearest */
|
||||
do_nearest = FALSE;
|
||||
do_nearest = false;
|
||||
}
|
||||
}
|
||||
lastmval[0] = mval[0]; lastmval[1] = mval[1];
|
||||
|
@ -1362,7 +1364,7 @@ Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2])
|
|||
hits = mixed_bones_object_selectbuffer(&vc, buffer, mval);
|
||||
|
||||
if (hits > 0) {
|
||||
const int has_bones = selectbuffer_has_bones(buffer, hits);
|
||||
const bool has_bones = selectbuffer_has_bones(buffer, hits);
|
||||
basact = mouse_select_eval_buffer(&vc, buffer, hits, mval, vc.scene->base.first, has_bones);
|
||||
}
|
||||
|
||||
|
@ -1389,7 +1391,7 @@ static void deselect_all_tracks(MovieTracking *tracking)
|
|||
}
|
||||
|
||||
/* mval is region coords */
|
||||
static int mouse_select(bContext *C, const int mval[2], short extend, short deselect, short toggle, short obcenter, short enumerate)
|
||||
static bool mouse_select(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool obcenter, short enumerate)
|
||||
{
|
||||
ViewContext vc;
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
|
@ -1397,7 +1399,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
Base *base, *startbase = NULL, *basact = NULL, *oldbasact = NULL;
|
||||
float dist = 100.0f;
|
||||
int retval = 0;
|
||||
int retval = false;
|
||||
short hits;
|
||||
const float mval_fl[2] = {(float)mval[0], (float)mval[1]};
|
||||
|
||||
|
@ -1449,7 +1451,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
|
|||
|
||||
if (hits > 0) {
|
||||
/* note: bundles are handling in the same way as bones */
|
||||
const int has_bones = selectbuffer_has_bones(buffer, hits);
|
||||
const bool has_bones = selectbuffer_has_bones(buffer, hits);
|
||||
|
||||
/* note; shift+alt goes to group-flush-selecting */
|
||||
if (has_bones == 0 && enumerate) {
|
||||
|
@ -1502,7 +1504,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
|
|||
basact->flag |= SELECT;
|
||||
basact->object->flag = basact->flag;
|
||||
|
||||
retval = 1;
|
||||
retval = true;
|
||||
|
||||
WM_event_add_notifier(C, NC_MOVIECLIP | ND_SELECT, track);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
|
||||
|
@ -1526,7 +1528,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
|
|||
basact->flag |= SELECT;
|
||||
basact->object->flag = basact->flag;
|
||||
|
||||
retval = 1;
|
||||
retval = true;
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, basact->object);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object);
|
||||
|
||||
|
@ -1546,7 +1548,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short dese
|
|||
|
||||
/* so, do we have something selected? */
|
||||
if (basact) {
|
||||
retval = 1;
|
||||
retval = true;
|
||||
|
||||
if (vc.obedit) {
|
||||
/* only do select */
|
||||
|
@ -1601,8 +1603,8 @@ typedef struct BoxSelectUserData {
|
|||
|
||||
/* runtime */
|
||||
int pass;
|
||||
int is_done;
|
||||
int is_change;
|
||||
bool is_done;
|
||||
bool is_change;
|
||||
} BoxSelectUserData;
|
||||
|
||||
static void view3d_userdata_boxselect_init(BoxSelectUserData *r_data,
|
||||
|
@ -1618,29 +1620,29 @@ static void view3d_userdata_boxselect_init(BoxSelectUserData *r_data,
|
|||
|
||||
/* runtime */
|
||||
r_data->pass = 0;
|
||||
r_data->is_done = FALSE;
|
||||
r_data->is_change = FALSE;
|
||||
r_data->is_done = false;
|
||||
r_data->is_change = false;
|
||||
}
|
||||
|
||||
int edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
|
||||
bool edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
|
||||
{
|
||||
int radius_squared = radius * radius;
|
||||
|
||||
/* check points in circle itself */
|
||||
if (len_squared_v2v2(cent, screen_co_a) <= radius_squared) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (len_squared_v2v2(cent, screen_co_b) <= radius_squared) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
/* pointdistline */
|
||||
if (dist_squared_to_line_segment_v2(cent, screen_co_a, screen_co_b) < (float)radius_squared) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
static void do_paintvert_box_select__doSelectVert(void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
|
||||
|
@ -1651,7 +1653,7 @@ static void do_paintvert_box_select__doSelectVert(void *userData, MVert *mv, con
|
|||
BKE_BIT_TEST_SET(mv->flag, data->select, SELECT);
|
||||
}
|
||||
}
|
||||
static int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
||||
static int do_paintvert_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
const int use_zbuf = (vc->v3d->flag & V3D_ZBUF_SELECT);
|
||||
Mesh *me;
|
||||
|
@ -1669,8 +1671,8 @@ static int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int
|
|||
return OPERATOR_CANCELLED;
|
||||
|
||||
|
||||
if (extend == 0 && select)
|
||||
paintvert_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE);
|
||||
if (extend == false && select)
|
||||
paintvert_deselect_all_visible(vc->obact, SEL_DESELECT, false);
|
||||
|
||||
if (use_zbuf) {
|
||||
selar = MEM_callocN(me->totvert + 1, "selar");
|
||||
|
@ -1754,13 +1756,13 @@ static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoi
|
|||
}
|
||||
}
|
||||
}
|
||||
static int do_nurbs_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
||||
static int do_nurbs_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
BoxSelectUserData data;
|
||||
|
||||
view3d_userdata_boxselect_init(&data, vc, rect, select);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
CU_deselect_all(vc->obedit);
|
||||
|
||||
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
|
||||
|
@ -1777,13 +1779,13 @@ static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, const fl
|
|||
bp->f1 = data->select ? (bp->f1 | SELECT) : (bp->f1 & ~SELECT);
|
||||
}
|
||||
}
|
||||
static int do_lattice_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
||||
static int do_lattice_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
BoxSelectUserData data;
|
||||
|
||||
view3d_userdata_boxselect_init(&data, vc, rect, select);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
ED_setflagsLatt(vc->obedit, 0);
|
||||
|
||||
ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
|
||||
|
@ -1808,7 +1810,7 @@ static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, const
|
|||
if (data->pass == 0) {
|
||||
if (edge_fully_inside_rect(data->rect_fl, screen_co_a, screen_co_b)) {
|
||||
BM_edge_select_set(data->vc->em->bm, eed, data->select);
|
||||
data->is_done = TRUE;
|
||||
data->is_done = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1826,7 +1828,7 @@ static void do_mesh_box_select__doSelectFace(void *userData, BMFace *efa, const
|
|||
BM_face_select_set(data->vc->em->bm, efa, data->select);
|
||||
}
|
||||
}
|
||||
static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
||||
static int do_mesh_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
BoxSelectUserData data;
|
||||
ToolSettings *ts = vc->scene->toolsettings;
|
||||
|
@ -1834,7 +1836,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
|
|||
|
||||
view3d_userdata_boxselect_init(&data, vc, rect, select);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT);
|
||||
|
||||
/* for non zbuf projections, don't change the GL state */
|
||||
|
@ -1879,7 +1881,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
|
|||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int do_meta_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
||||
static int do_meta_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
MetaBall *mb = (MetaBall *)vc->obedit->data;
|
||||
MetaElem *ml;
|
||||
|
@ -1890,7 +1892,7 @@ static int do_meta_box_select(ViewContext *vc, rcti *rect, int select, int exten
|
|||
|
||||
hits = view3d_opengl_select(vc, buffer, MAXPICKBUF, rect);
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
BKE_mball_deselect_all(mb);
|
||||
|
||||
for (ml = mb->editelems->first; ml; ml = ml->next) {
|
||||
|
@ -1913,7 +1915,7 @@ static int do_meta_box_select(ViewContext *vc, rcti *rect, int select, int exten
|
|||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int do_armature_box_select(ViewContext *vc, rcti *rect, short select, short extend)
|
||||
static int do_armature_box_select(ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
bArmature *arm = vc->obedit->data;
|
||||
EditBone *ebone;
|
||||
|
@ -1928,7 +1930,7 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, short select, sho
|
|||
for (ebone = arm->edbo->first; ebone; ebone = ebone->next)
|
||||
ebone->flag &= ~BONE_DONE;
|
||||
|
||||
if (extend == 0 && select)
|
||||
if (extend == false && select)
|
||||
ED_armature_deselect_all_visible(vc->obedit);
|
||||
|
||||
/* first we only check points inside the border */
|
||||
|
@ -1983,7 +1985,7 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, short select, sho
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, int select, int extend)
|
||||
static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, bool select, bool extend)
|
||||
{
|
||||
Bone *bone;
|
||||
Object *ob = vc->obact;
|
||||
|
@ -1999,7 +2001,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i
|
|||
else
|
||||
bone_only = 0;
|
||||
|
||||
if (extend == 0 && select) {
|
||||
if (extend == false && select) {
|
||||
if (bone_only) {
|
||||
CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
|
||||
{
|
||||
|
@ -2091,8 +2093,8 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
|
|||
{
|
||||
ViewContext vc;
|
||||
rcti rect;
|
||||
short extend;
|
||||
short select;
|
||||
bool extend;
|
||||
bool select;
|
||||
|
||||
int ret = OPERATOR_CANCELLED;
|
||||
|
||||
|
@ -2187,12 +2189,12 @@ void VIEW3D_OT_select_border(wmOperatorType *ot)
|
|||
ot->flag = OPTYPE_UNDO;
|
||||
|
||||
/* rna */
|
||||
WM_operator_properties_gesture_border(ot, TRUE);
|
||||
WM_operator_properties_gesture_border(ot, true);
|
||||
}
|
||||
|
||||
/* mouse selection in weight paint */
|
||||
/* gets called via generic mouse select operator */
|
||||
static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], short extend, short deselect, short toggle, Object *obact)
|
||||
static bool mouse_weight_paint_vertex_select(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, Object *obact)
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
const int use_zbuf = (v3d->flag & V3D_ZBUF_SELECT);
|
||||
|
@ -2213,14 +2215,14 @@ static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], shor
|
|||
mv->flag ^= SELECT;
|
||||
}
|
||||
else {
|
||||
paintvert_deselect_all_visible(obact, SEL_DESELECT, FALSE);
|
||||
paintvert_deselect_all_visible(obact, SEL_DESELECT, false);
|
||||
mv->flag |= SELECT;
|
||||
}
|
||||
paintvert_flush_flags(obact);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obact->data);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* ****** Mouse Select ****** */
|
||||
|
@ -2230,13 +2232,13 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
|||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
Object *obact = CTX_data_active_object(C);
|
||||
short extend = RNA_boolean_get(op->ptr, "extend");
|
||||
short deselect = RNA_boolean_get(op->ptr, "deselect");
|
||||
short toggle = RNA_boolean_get(op->ptr, "toggle");
|
||||
short center = RNA_boolean_get(op->ptr, "center");
|
||||
short enumerate = RNA_boolean_get(op->ptr, "enumerate");
|
||||
short object = RNA_boolean_get(op->ptr, "object");
|
||||
int retval = 0;
|
||||
bool extend = RNA_boolean_get(op->ptr, "extend");
|
||||
bool deselect = RNA_boolean_get(op->ptr, "deselect");
|
||||
bool toggle = RNA_boolean_get(op->ptr, "toggle");
|
||||
bool center = RNA_boolean_get(op->ptr, "center");
|
||||
bool enumerate = RNA_boolean_get(op->ptr, "enumerate");
|
||||
bool object = RNA_boolean_get(op->ptr, "object");
|
||||
bool retval = false;
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
|
@ -2247,10 +2249,10 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
|||
/* ack, this is incorrect but to do this correctly we would need an
|
||||
* alternative editmode/objectmode keymap, this copies the functionality
|
||||
* from 2.4x where Ctrl+Select in editmode does object select only */
|
||||
center = FALSE;
|
||||
center = false;
|
||||
}
|
||||
|
||||
if (obedit && object == FALSE) {
|
||||
if (obedit && object == false) {
|
||||
if (obedit->type == OB_MESH)
|
||||
retval = EDBM_select_pick(C, event->mval, extend, deselect, toggle);
|
||||
else if (obedit->type == OB_ARMATURE)
|
||||
|
@ -2317,7 +2319,7 @@ typedef struct CircleSelectUserData {
|
|||
float radius_squared;
|
||||
|
||||
/* runtime */
|
||||
int is_change;
|
||||
bool is_change;
|
||||
} CircleSelectUserData;
|
||||
|
||||
static void view3d_userdata_circleselect_init(CircleSelectUserData *r_data,
|
||||
|
@ -2333,7 +2335,7 @@ static void view3d_userdata_circleselect_init(CircleSelectUserData *r_data,
|
|||
r_data->radius_squared = rad * rad;
|
||||
|
||||
/* runtime */
|
||||
r_data->is_change = FALSE;
|
||||
r_data->is_change = false;
|
||||
}
|
||||
|
||||
static void mesh_circle_doSelectVert(void *userData, BMVert *eve, const float screen_co[2], int UNUSED(index))
|
||||
|
@ -2540,14 +2542,14 @@ static void do_circle_select_pose__doSelectBone(void *userData, struct bPoseChan
|
|||
bArmature *arm = data->vc->obact->data;
|
||||
|
||||
if (PBONE_SELECTABLE(arm, pchan->bone)) {
|
||||
int is_point_done = FALSE;
|
||||
bool is_point_done = false;
|
||||
int points_proj_tot = 0;
|
||||
|
||||
/* project head location to screenspace */
|
||||
if (screen_co_a[0] != IS_CLIPPED) {
|
||||
points_proj_tot++;
|
||||
if (pchan_circle_doSelectJoint(data, pchan, screen_co_a)) {
|
||||
is_point_done = TRUE;
|
||||
is_point_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2555,7 +2557,7 @@ static void do_circle_select_pose__doSelectBone(void *userData, struct bPoseChan
|
|||
if (screen_co_b[0] != IS_CLIPPED) {
|
||||
points_proj_tot++;
|
||||
if (pchan_circle_doSelectJoint(data, pchan, screen_co_a)) {
|
||||
is_point_done = TRUE;
|
||||
is_point_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2566,12 +2568,12 @@ static void do_circle_select_pose__doSelectBone(void *userData, struct bPoseChan
|
|||
/* only if the endpoints didn't get selected, deal with the middle of the bone too
|
||||
* It works nicer to only do this if the head or tail are not in the circle,
|
||||
* otherwise there is no way to circle select joints alone */
|
||||
if ((is_point_done == FALSE) && (points_proj_tot == 2) &&
|
||||
if ((is_point_done == false) && (points_proj_tot == 2) &&
|
||||
edge_inside_circle(data->mval_fl, data->radius, screen_co_a, screen_co_b))
|
||||
{
|
||||
if (data->select) pchan->bone->flag |= BONE_SELECTED;
|
||||
else pchan->bone->flag &= ~BONE_SELECTED;
|
||||
data->is_change = TRUE;
|
||||
data->is_change = true;
|
||||
}
|
||||
|
||||
data->is_change |= is_point_done;
|
||||
|
@ -2626,22 +2628,22 @@ static void do_circle_select_armature__doSelectBone(void *userData, struct EditB
|
|||
bArmature *arm = data->vc->obedit->data;
|
||||
|
||||
if (EBONE_SELECTABLE(arm, ebone)) {
|
||||
int is_point_done = FALSE;
|
||||
bool is_point_done = false;
|
||||
int points_proj_tot = 0;
|
||||
|
||||
/* project head location to screenspace */
|
||||
if (screen_co_a[0] != IS_CLIPPED) {
|
||||
points_proj_tot++;
|
||||
if (armature_circle_doSelectJoint(data, ebone, screen_co_a, TRUE)) {
|
||||
is_point_done = TRUE;
|
||||
if (armature_circle_doSelectJoint(data, ebone, screen_co_a, true)) {
|
||||
is_point_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* project tail location to screenspace */
|
||||
if (screen_co_b[0] != IS_CLIPPED) {
|
||||
points_proj_tot++;
|
||||
if (armature_circle_doSelectJoint(data, ebone, screen_co_b, FALSE)) {
|
||||
is_point_done = TRUE;
|
||||
if (armature_circle_doSelectJoint(data, ebone, screen_co_b, false)) {
|
||||
is_point_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2652,12 +2654,12 @@ static void do_circle_select_armature__doSelectBone(void *userData, struct EditB
|
|||
/* only if the endpoints didn't get selected, deal with the middle of the bone too
|
||||
* It works nicer to only do this if the head or tail are not in the circle,
|
||||
* otherwise there is no way to circle select joints alone */
|
||||
if ((is_point_done == FALSE) && (points_proj_tot == 2) &&
|
||||
if ((is_point_done == false) && (points_proj_tot == 2) &&
|
||||
edge_inside_circle(data->mval_fl, data->radius, screen_co_a, screen_co_b))
|
||||
{
|
||||
if (data->select) ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
data->is_change = TRUE;
|
||||
data->is_change = true;
|
||||
}
|
||||
|
||||
data->is_change |= is_point_done;
|
||||
|
@ -2688,7 +2690,7 @@ static void do_circle_select_mball__doSelectElem(void *userData, struct MetaElem
|
|||
if (len_squared_v2v2(data->mval_fl, screen_co) <= data->radius_squared) {
|
||||
if (data->select) ml->flag |= SELECT;
|
||||
else ml->flag &= ~SELECT;
|
||||
data->is_change = TRUE;
|
||||
data->is_change = true;
|
||||
}
|
||||
}
|
||||
static void mball_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
|
||||
|
@ -2728,12 +2730,12 @@ static void obedit_circle_select(ViewContext *vc, short select, const int mval[2
|
|||
}
|
||||
}
|
||||
|
||||
static int object_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
|
||||
static bool object_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
|
||||
{
|
||||
Scene *scene = vc->scene;
|
||||
const float radius_squared = rad * rad;
|
||||
const float mval_fl[2] = {mval[0], mval[1]};
|
||||
int is_change = FALSE;
|
||||
bool is_change = false;
|
||||
int select_flag = select ? SELECT : 0;
|
||||
|
||||
Base *base;
|
||||
|
@ -2746,7 +2748,7 @@ static int object_circle_select(ViewContext *vc, int select, const int mval[2],
|
|||
{
|
||||
if (len_squared_v2v2(mval_fl, screen_co) <= radius_squared) {
|
||||
ED_base_object_select(base, select);
|
||||
is_change = TRUE;
|
||||
is_change = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1013,7 +1013,7 @@ static int select_edgeloop_uv_edge_tag_faces(BMEditMesh *em, UvMapVert *first1,
|
|||
}
|
||||
|
||||
static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit *hit,
|
||||
float limit[2], const short extend)
|
||||
float limit[2], const bool extend)
|
||||
{
|
||||
BMFace *efa;
|
||||
BMIter iter, liter;
|
||||
|
@ -1124,7 +1124,7 @@ static int select_edgeloop(Scene *scene, Image *ima, BMEditMesh *em, NearestHit
|
|||
|
||||
/*********************** linked select ***********************/
|
||||
|
||||
static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float limit[2], NearestHit *hit, int extend)
|
||||
static void select_linked(Scene *scene, Image *ima, BMEditMesh *em, const float limit[2], NearestHit *hit, bool extend)
|
||||
{
|
||||
BMFace *efa;
|
||||
BMLoop *l;
|
||||
|
@ -1909,7 +1909,7 @@ static int sticky_select(float *limit, int hitv[4], int v, float *hituv[4], floa
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int mouse_select(bContext *C, const float co[2], int extend, int loop)
|
||||
static int mouse_select(bContext *C, const float co[2], bool extend, bool loop)
|
||||
{
|
||||
SpaceImage *sima = CTX_wm_space_image(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
@ -2227,11 +2227,11 @@ static int mouse_select(bContext *C, const float co[2], int extend, int loop)
|
|||
static int select_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
float co[2];
|
||||
int extend, loop;
|
||||
bool extend, loop;
|
||||
|
||||
RNA_float_get_array(op->ptr, "location", co);
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
loop = 0;
|
||||
loop = false;
|
||||
|
||||
return mouse_select(C, co, extend, loop);
|
||||
}
|
||||
|
@ -2272,11 +2272,11 @@ static void UV_OT_select(wmOperatorType *ot)
|
|||
static int select_loop_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
float co[2];
|
||||
int extend, loop;
|
||||
bool extend, loop;
|
||||
|
||||
RNA_float_get_array(op->ptr, "location", co);
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
loop = 1;
|
||||
loop = true;
|
||||
|
||||
return mouse_select(C, co, extend, loop);
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
|
||||
#include <Python.h>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_define.h"
|
||||
|
||||
|
|
|
@ -234,9 +234,9 @@ void WM_operator_properties_free(struct PointerRNA *ptr);
|
|||
void WM_operator_properties_filesel(struct wmOperatorType *ot, int filter, short type, short action, short flag, short display);
|
||||
void WM_operator_properties_border(struct wmOperatorType *ot);
|
||||
void WM_operator_properties_border_to_rcti(struct wmOperator *op, struct rcti *rect);
|
||||
void WM_operator_properties_gesture_border(struct wmOperatorType *ot, int extend);
|
||||
void WM_operator_properties_gesture_border(struct wmOperatorType *ot, bool extend);
|
||||
void WM_operator_properties_mouse_select(struct wmOperatorType *ot);
|
||||
void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor);
|
||||
void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, bool cursor);
|
||||
void WM_operator_properties_select_all(struct wmOperatorType *ot);
|
||||
|
||||
int WM_operator_check_ui_enabled(const struct bContext *C, const char *idname);
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
#include "GHOST_C-api.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLO_sys_types.h"
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
@ -44,8 +46,8 @@
|
|||
#include "BKE_global.h"
|
||||
#include "BKE_main.h"
|
||||
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
#include "WM_api.h"
|
||||
#include "wm_cursors.h"
|
||||
|
||||
/* XXX this still is mess from old code */
|
||||
|
|
|
@ -1183,7 +1183,7 @@ void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
|
|||
rect->ymax = RNA_int_get(op->ptr, "ymax");
|
||||
}
|
||||
|
||||
void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
|
||||
void WM_operator_properties_gesture_border(wmOperatorType *ot, bool extend)
|
||||
{
|
||||
RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
|
||||
|
||||
|
@ -1201,7 +1201,7 @@ void WM_operator_properties_mouse_select(wmOperatorType *ot)
|
|||
RNA_def_boolean(ot->srna, "toggle", 0, "Toggle Selection", "Toggle the selection");
|
||||
}
|
||||
|
||||
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
|
||||
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, bool cursor)
|
||||
{
|
||||
RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, "X Start", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xend", 0, INT_MIN, INT_MAX, "X End", "", INT_MIN, INT_MAX);
|
||||
|
|
Loading…
Reference in New Issue