forked from bartvdbraak/blender
fix [#24499] Consistency Issue with LassoSelect/ExtendOption
Added extend option to lasso. also... - selecting bones wasn't checking their layer of if they were hidden in a number of places. - fixed memory leak. small unrealed changes - added PBONE_VISIBLE macro - renamed functions used for paint selectoin from *_tface to paintface_*. sine they no longer have anything todo with tface's. - removed scanfill include from BLI_blenlib.h, this is only used in very few places and quite specific. Noticed lasso select is broken for metaballs and face mask mode but this has been the case for a while, will look into it next.
This commit is contained in:
parent
b9c3bfa053
commit
6b767b8018
@ -119,6 +119,10 @@ typedef struct Mat4 {
|
||||
|
||||
Mat4 *b_bone_spline_setup(struct bPoseChannel *pchan, int rest);
|
||||
|
||||
/* like EBONE_VISIBLE */
|
||||
#define PBONE_VISIBLE(arm, bone) (((bone)->layer & (arm)->layer) && !((bone)->flag & BONE_HIDDEN_P))
|
||||
#define _BONE_VISIBLE(arm, bone) (((bone)->layer & (arm)->layer) && !((bone)->flag & BONE_HIDDEN_P))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "BLI_blenlib.h"
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_editVert.h"
|
||||
#include "BLI_scanfill.h"
|
||||
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_displist.h"
|
||||
|
@ -84,8 +84,6 @@ extern "C" {
|
||||
|
||||
#include "BLI_rect.h"
|
||||
|
||||
#include "BLI_scanfill.h"
|
||||
|
||||
#include "BLI_noise.h"
|
||||
|
||||
/**
|
||||
|
@ -1359,8 +1359,9 @@ static EditBone *editbone_get_child(bArmature *arm, EditBone *pabone, short use_
|
||||
for (curbone= arm->edbo->first; curbone; curbone= curbone->next) {
|
||||
if (curbone->parent == pabone) {
|
||||
if (use_visibility) {
|
||||
if ((arm->layer & curbone->layer) && !(pabone->flag & BONE_HIDDEN_A))
|
||||
if ((arm->layer & curbone->layer) && !(pabone->flag & BONE_HIDDEN_A)) {
|
||||
chbone = curbone;
|
||||
}
|
||||
}
|
||||
else
|
||||
chbone = curbone;
|
||||
@ -1887,7 +1888,7 @@ void ARMATURE_OT_delete(wmOperatorType *ot)
|
||||
* toggle==2: only active tag
|
||||
* toggle==3: swap (no test)
|
||||
*/
|
||||
void ED_armature_deselectall(Object *obedit, int toggle)
|
||||
void ED_armature_deselect_all(Object *obedit, int toggle)
|
||||
{
|
||||
bArmature *arm= obedit->data;
|
||||
EditBone *eBone;
|
||||
@ -1914,7 +1915,7 @@ void ED_armature_deselectall(Object *obedit, int toggle)
|
||||
for (eBone=arm->edbo->first;eBone;eBone=eBone->next) {
|
||||
if (sel==3) {
|
||||
/* invert selection of bone */
|
||||
if ((arm->layer & eBone->layer) && (eBone->flag & BONE_HIDDEN_A)==0) {
|
||||
if(EBONE_VISIBLE(arm, eBone)) {
|
||||
eBone->flag ^= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
if(arm->act_edbone==eBone)
|
||||
arm->act_edbone= NULL;
|
||||
@ -1922,7 +1923,7 @@ void ED_armature_deselectall(Object *obedit, int toggle)
|
||||
}
|
||||
else if (sel==1) {
|
||||
/* select bone */
|
||||
if(arm->layer & eBone->layer && (eBone->flag & BONE_HIDDEN_A)==0) {
|
||||
if(EBONE_VISIBLE(arm, eBone)) {
|
||||
eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
if(eBone->parent)
|
||||
eBone->parent->flag |= (BONE_TIPSEL);
|
||||
@ -1940,6 +1941,20 @@ void ED_armature_deselectall(Object *obedit, int toggle)
|
||||
ED_armature_sync_selection(arm->edbo);
|
||||
}
|
||||
|
||||
void ED_armature_deselect_all_visible(Object *obedit)
|
||||
{
|
||||
bArmature *arm= obedit->data;
|
||||
EditBone *ebone;
|
||||
|
||||
for (ebone= arm->edbo->first; ebone; ebone= ebone->next) {
|
||||
/* first and foremost, bone must be visible and selected */
|
||||
if (EBONE_VISIBLE(arm, ebone) && (ebone->flag & BONE_UNSELECTABLE)==0) {
|
||||
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
}
|
||||
}
|
||||
|
||||
ED_armature_sync_selection(arm->edbo);
|
||||
}
|
||||
|
||||
/* context: editmode armature in view3d */
|
||||
int mouse_armature(bContext *C, short mval[2], int extend)
|
||||
@ -1958,7 +1973,7 @@ int mouse_armature(bContext *C, short mval[2], int extend)
|
||||
if (nearBone) {
|
||||
|
||||
if (!extend)
|
||||
ED_armature_deselectall(obedit, 0);
|
||||
ED_armature_deselect_all(obedit, 0);
|
||||
|
||||
/* by definition the non-root connected bones have no root point drawn,
|
||||
so a root selection needs to be delivered to the parent tip */
|
||||
@ -2355,7 +2370,7 @@ void add_primitive_bone(Scene *scene, View3D *v3d, RegionView3D *rv3d)
|
||||
mul_m3_m3m3(totmat, obmat, viewmat);
|
||||
invert_m3_m3(imat, totmat);
|
||||
|
||||
ED_armature_deselectall(obedit, 0);
|
||||
ED_armature_deselect_all(obedit, 0);
|
||||
|
||||
/* Create a bone */
|
||||
bone= ED_armature_edit_bone_add(obedit->data, "Bone");
|
||||
@ -2408,7 +2423,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
to_root= 1;
|
||||
}
|
||||
|
||||
ED_armature_deselectall(obedit, 0);
|
||||
ED_armature_deselect_all(obedit, 0);
|
||||
|
||||
/* we re-use code for mirror editing... */
|
||||
flipbone= NULL;
|
||||
@ -3575,7 +3590,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
|
||||
mul_m3_m3m3(totmat, obmat, viewmat);
|
||||
invert_m3_m3(imat, totmat);
|
||||
|
||||
ED_armature_deselectall(obedit, 0);
|
||||
ED_armature_deselect_all(obedit, 0);
|
||||
|
||||
/* Create a bone */
|
||||
bone= ED_armature_edit_bone_add(obedit->data, name);
|
||||
@ -4441,7 +4456,7 @@ void ED_pose_deselectall (Object *ob, int test)
|
||||
/* Determine if we're selecting or deselecting */
|
||||
if (test==1) {
|
||||
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
|
||||
if ((pchan->bone->layer & arm->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
|
||||
if (PBONE_VISIBLE(arm, pchan->bone)) {
|
||||
if (pchan->bone->flag & BONE_SELECTED)
|
||||
break;
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op)
|
||||
if (pchan->parent == NULL) continue;
|
||||
else pabone= pchan->parent->bone;
|
||||
|
||||
if ((arm->layer & pabone->layer) && !(pabone->flag & BONE_HIDDEN_P)) {
|
||||
if (PBONE_VISIBLE(arm, pabone)) {
|
||||
if (!add_to_sel) curbone->flag &= ~BONE_SELECTED;
|
||||
pabone->flag |= BONE_SELECTED;
|
||||
arm->act_bone= pabone;
|
||||
@ -452,7 +452,7 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op)
|
||||
if (pchan->child == NULL) continue;
|
||||
else chbone = pchan->child->bone;
|
||||
|
||||
if ((arm->layer & chbone->layer) && !(chbone->flag & BONE_HIDDEN_P)) {
|
||||
if (PBONE_VISIBLE(arm, chbone)) {
|
||||
if (!add_to_sel) curbone->flag &= ~BONE_SELECTED;
|
||||
chbone->flag |= BONE_SELECTED;
|
||||
arm->act_bone= chbone;
|
||||
|
@ -91,8 +91,8 @@ typedef struct EditBone
|
||||
#define BONESEL_NOSEL (1<<31) /* Indicates a negative number */
|
||||
|
||||
/* useful macros */
|
||||
#define EBONE_VISIBLE(arm, ebone) ((arm->layer & ebone->layer) && !(ebone->flag & BONE_HIDDEN_A))
|
||||
#define EBONE_EDITABLE(ebone) ((ebone->flag & BONE_SELECTED) && !(ebone->flag & BONE_EDITMODE_LOCKED))
|
||||
#define EBONE_VISIBLE(arm, ebone) (((arm)->layer & (ebone)->layer) && !((ebone)->flag & BONE_HIDDEN_A))
|
||||
#define EBONE_EDITABLE(ebone) (((ebone)->flag & BONE_SELECTED) && !((ebone)->flag & BONE_EDITMODE_LOCKED))
|
||||
|
||||
/* used in bone_select_hierachy() */
|
||||
#define BONE_SELECT_PARENT 0
|
||||
@ -107,7 +107,8 @@ void ED_keymap_armature(struct wmKeyConfig *keyconf);
|
||||
void ED_armature_from_edit(struct Object *obedit);
|
||||
void ED_armature_to_edit(struct Object *ob);
|
||||
void ED_armature_edit_free(struct Object *ob);
|
||||
void ED_armature_deselectall(struct Object *obedit, int toggle);
|
||||
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);
|
||||
|
@ -181,12 +181,13 @@ void EM_deselect_by_material(struct EditMesh *em, int index);
|
||||
void EM_automerge(struct Scene *scene, struct Object *obedit, int update);
|
||||
|
||||
/* editface.c */
|
||||
void paintface_flush_flags(struct Object *ob);
|
||||
struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy);
|
||||
int face_select(struct bContext *C, struct Object *ob, short mval[2], int extend);
|
||||
void face_borderselect(struct bContext *C, struct Object *ob, struct rcti *rect, int select, int extend);
|
||||
void selectall_tface(struct Object *ob, int action);
|
||||
void select_linked_tfaces(struct bContext *C, struct Object *ob, short mval[2], int mode);
|
||||
int minmax_tface(struct Object *ob, float *min, float *max);
|
||||
int paintface_mouse_select(struct bContext *C, struct Object *ob, short mval[2], int extend);
|
||||
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);
|
||||
void paintface_select_linked(struct bContext *C, struct Object *ob, short mval[2], int mode);
|
||||
int paintface_minmax(struct Object *ob, float *min, float *max);
|
||||
|
||||
/* object_vgroup.c */
|
||||
|
||||
|
@ -59,7 +59,8 @@ void PE_update_object(struct Scene *scene, struct Object *ob, int useflag);
|
||||
int PE_mouse_particles(struct bContext *C, short *mval, int extend);
|
||||
int PE_border_select(struct bContext *C, struct rcti *rect, int select, int extend);
|
||||
int PE_circle_select(struct bContext *C, int selecting, short *mval, float rad);
|
||||
int PE_lasso_select(struct bContext *C, short mcords[][2], short moves, short select);
|
||||
int PE_lasso_select(struct bContext *C, short mcords[][2], short moves, short extend, short select);
|
||||
void PE_deselect_all_visible(struct PTCacheEdit *edit);
|
||||
|
||||
/* undo */
|
||||
void PE_undo_push(struct Scene *scene, char *str);
|
||||
|
@ -67,14 +67,9 @@
|
||||
/* own include */
|
||||
#include "mesh_intern.h"
|
||||
|
||||
/* ***************** XXX **************** */
|
||||
static int pupmenu(const char *UNUSED(dummy)) {return 0;}
|
||||
/* ***************** XXX **************** */
|
||||
|
||||
|
||||
/* copy the face flags, most importantly selection from the mesh to the final derived mesh,
|
||||
* use in object mode when selecting faces (while painting) */
|
||||
void object_facesel_flush_dm(Object *ob)
|
||||
void paintface_flush_flags(Object *ob)
|
||||
{
|
||||
Mesh *me= get_mesh(ob);
|
||||
DerivedMesh *dm= ob->derivedFinal;
|
||||
@ -162,7 +157,7 @@ MTFace *EM_get_active_mtface(EditMesh *em, EditFace **act_efa, MCol **mcol, int
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void reveal_tface(Scene *scene)
|
||||
void paintface_unhide(Scene *scene)
|
||||
{
|
||||
Mesh *me;
|
||||
MFace *mface;
|
||||
@ -181,11 +176,10 @@ void reveal_tface(Scene *scene)
|
||||
mface++;
|
||||
}
|
||||
|
||||
object_facesel_flush_dm(OBACT);
|
||||
// XXX notifier! object_tface_flags_changed(OBACT, 0);
|
||||
paintface_flush_flags(OBACT);
|
||||
}
|
||||
|
||||
void hide_tface(Scene *scene)
|
||||
void paintface_hide(Scene *scene)
|
||||
{
|
||||
Mesh *me;
|
||||
MFace *mface;
|
||||
@ -196,7 +190,7 @@ void hide_tface(Scene *scene)
|
||||
if(me==0 || me->totface==0) return;
|
||||
|
||||
if(alt) {
|
||||
reveal_tface(scene);
|
||||
paintface_unhide(scene);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -217,8 +211,7 @@ void hide_tface(Scene *scene)
|
||||
mface++;
|
||||
}
|
||||
|
||||
object_facesel_flush_dm(OBACT);
|
||||
// XXX notifier! object_tface_flags_changed(OBACT, 0);
|
||||
paintface_flush_flags(OBACT);
|
||||
}
|
||||
|
||||
/* Set tface seams based on edge data, uses hash table to find seam edges. */
|
||||
@ -236,7 +229,7 @@ static void hash_add_face(EdgeHash *ehash, MFace *mf)
|
||||
}
|
||||
|
||||
|
||||
void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index)
|
||||
static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index)
|
||||
{
|
||||
MFace *mf;
|
||||
int a, doit=1, mark=0;
|
||||
@ -338,12 +331,9 @@ void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index)
|
||||
}
|
||||
|
||||
MEM_freeN(linkflag);
|
||||
|
||||
// BIF_undo_push("Select linked UV face");
|
||||
// object_tface_flags_changed(OBACT, 0);
|
||||
}
|
||||
|
||||
void select_linked_tfaces(bContext *UNUSED(C), Object *ob, short UNUSED(mval[2]), int mode)
|
||||
void paintface_select_linked(bContext *UNUSED(C), Object *ob, short UNUSED(mval[2]), int mode)
|
||||
{
|
||||
Mesh *me;
|
||||
unsigned int index=0;
|
||||
@ -361,10 +351,11 @@ void select_linked_tfaces(bContext *UNUSED(C), Object *ob, short UNUSED(mval[2])
|
||||
|
||||
select_linked_tfaces_with_seams(mode, me, index);
|
||||
|
||||
object_facesel_flush_dm(ob);
|
||||
paintface_flush_flags(ob);
|
||||
}
|
||||
|
||||
void selectall_tface(Object *ob, int action)
|
||||
/* note: caller needs to run paintface_flush_flags(ob) after this */
|
||||
void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
|
||||
{
|
||||
Mesh *me;
|
||||
MFace *mface;
|
||||
@ -406,11 +397,12 @@ void selectall_tface(Object *ob, int action)
|
||||
mface++;
|
||||
}
|
||||
|
||||
object_facesel_flush_dm(ob);
|
||||
// XXX notifier! object_tface_flags_changed(OBACT, 0);
|
||||
if(flush_flags) {
|
||||
paintface_flush_flags(ob);
|
||||
}
|
||||
}
|
||||
|
||||
void selectswap_tface(Scene *scene)
|
||||
void paintface_select_swap(Scene *scene)
|
||||
{
|
||||
Mesh *me;
|
||||
MFace *mface;
|
||||
@ -430,11 +422,10 @@ void selectswap_tface(Scene *scene)
|
||||
mface++;
|
||||
}
|
||||
|
||||
object_facesel_flush_dm(OBACT);
|
||||
// XXX notifier! object_tface_flags_changed(OBACT, 0);
|
||||
paintface_flush_flags(OBACT);
|
||||
}
|
||||
|
||||
int minmax_tface(Object *ob, float *min, float *max)
|
||||
int paintface_minmax(Object *ob, float *min, float *max)
|
||||
{
|
||||
Mesh *me= get_mesh(ob);
|
||||
MFace *mf;
|
||||
@ -672,7 +663,7 @@ int edgetag_shortest_path(Scene *scene, EditMesh *em, EditEdge *source, EditEdge
|
||||
}
|
||||
|
||||
/* *************************************** */
|
||||
|
||||
#if 0
|
||||
static void seam_edgehash_insert_face(EdgeHash *ehash, MFace *mf)
|
||||
{
|
||||
BLI_edgehash_insert(ehash, mf->v1, mf->v2, NULL);
|
||||
@ -739,11 +730,10 @@ void seam_mark_clear_tface(Scene *scene, short mode)
|
||||
// unwrap_lscm(1);
|
||||
|
||||
me->drawflag |= ME_DRAWSEAMS;
|
||||
|
||||
// XXX notifier! object_tface_flags_changed(OBACT, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
int face_select(struct bContext *C, Object *ob, short mval[2], int extend)
|
||||
int paintface_mouse_select(struct bContext *C, Object *ob, short mval[2], int extend)
|
||||
{
|
||||
Mesh *me;
|
||||
MFace *mface, *msel;
|
||||
@ -780,48 +770,38 @@ int face_select(struct bContext *C, Object *ob, short mval[2], int extend)
|
||||
|
||||
/* image window redraw */
|
||||
|
||||
object_facesel_flush_dm(ob);
|
||||
// XXX notifier! object_tface_flags_changed(OBACT, 1);
|
||||
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;
|
||||
}
|
||||
|
||||
void face_borderselect(struct bContext *C, Object *ob, rcti *rect, int select, int extend)
|
||||
int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
|
||||
{
|
||||
Mesh *me;
|
||||
MFace *mface;
|
||||
struct ImBuf *ibuf;
|
||||
unsigned int *rt;
|
||||
int a, sx, sy, index;
|
||||
int a, index;
|
||||
char *selar;
|
||||
|
||||
ViewContext vc;
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
int sx= rect->xmax-rect->xmin+1;
|
||||
int sy= rect->ymax-rect->ymin+1;
|
||||
|
||||
me= get_mesh(ob);
|
||||
if(me==0) return;
|
||||
if(me->totface==0) return;
|
||||
me= get_mesh(vc->obact);
|
||||
|
||||
if(me==NULL || me->totface==0 || sx*sy <= 0)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
selar= MEM_callocN(me->totface+1, "selar");
|
||||
|
||||
sx= (rect->xmax-rect->xmin+1);
|
||||
sy= (rect->ymax-rect->ymin+1);
|
||||
if(sx*sy<=0) return;
|
||||
if (extend == 0 && select)
|
||||
paintface_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE);
|
||||
|
||||
if (extend == 0 && select) {
|
||||
mface= me->mface;
|
||||
for(a=1; a<=me->totface; a++, mface++) {
|
||||
if((mface->flag & ME_HIDE) == 0)
|
||||
mface->flag &= ~ME_FACE_SEL;
|
||||
}
|
||||
}
|
||||
|
||||
view3d_validate_backbuf(&vc);
|
||||
view3d_validate_backbuf(vc);
|
||||
|
||||
ibuf = IMB_allocImBuf(sx,sy,32,IB_rect);
|
||||
rt = ibuf->rect;
|
||||
glReadPixels(rect->xmin+vc.ar->winrct.xmin, rect->ymin+vc.ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
|
||||
glReadPixels(rect->xmin+vc->ar->winrct.xmin, rect->ymin+vc->ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
|
||||
if(ENDIAN_ORDER==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
|
||||
|
||||
a= sx*sy;
|
||||
@ -847,11 +827,11 @@ void face_borderselect(struct bContext *C, Object *ob, rcti *rect, int select, i
|
||||
IMB_freeImBuf(ibuf);
|
||||
MEM_freeN(selar);
|
||||
|
||||
|
||||
// XXX notifier! object_tface_flags_changed(OBACT, 0);
|
||||
#ifdef __APPLE__
|
||||
glReadBuffer(GL_BACK);
|
||||
#endif
|
||||
|
||||
object_facesel_flush_dm(ob);
|
||||
|
||||
paintface_flush_flags(vc->obact);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise
|
||||
#include "BLI_ghash.h"
|
||||
#include "BLI_linklist.h"
|
||||
#include "BLI_heap.h"
|
||||
#include "BLI_scanfill.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
|
@ -1513,6 +1513,17 @@ void PARTICLE_OT_select_linked(wmOperatorType *ot)
|
||||
}
|
||||
|
||||
/************************ border select operator ************************/
|
||||
void PE_deselect_all_visible(PTCacheEdit *edit)
|
||||
{
|
||||
POINT_P; KEY_K;
|
||||
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_SELECTED_KEYS {
|
||||
key->flag &= ~PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int PE_border_select(bContext *C, rcti *rect, int select, int extend)
|
||||
{
|
||||
@ -1524,16 +1535,8 @@ int PE_border_select(bContext *C, rcti *rect, int select, int extend)
|
||||
if(!PE_start_edit(edit))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
if (extend == 0 && select) {
|
||||
POINT_P; KEY_K;
|
||||
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_SELECTED_KEYS {
|
||||
key->flag &= ~PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (extend == 0 && select)
|
||||
PE_deselect_all_visible(edit);
|
||||
|
||||
PE_set_view3d_data(C, &data);
|
||||
data.rect= rect;
|
||||
@ -1574,7 +1577,7 @@ int PE_circle_select(bContext *C, int selecting, short *mval, float rad)
|
||||
|
||||
/************************ lasso select operator ************************/
|
||||
|
||||
int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select)
|
||||
int PE_lasso_select(bContext *C, short mcords[][2], short moves, short extend, short select)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
@ -1590,6 +1593,9 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select)
|
||||
if(!PE_start_edit(edit))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
if (extend == 0 && select)
|
||||
PE_deselect_all_visible(edit);
|
||||
|
||||
unit_m4(mat);
|
||||
|
||||
LOOP_VISIBLE_POINTS {
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_utildefines.h"
|
||||
#include "BKE_action.h"
|
||||
#include "BKE_armature.h"
|
||||
#include "BKE_sequencer.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
@ -234,7 +235,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
||||
if (obpose && obpose->pose && arm) {
|
||||
for (pchan= obpose->pose->chanbase.first; pchan; pchan= pchan->next) {
|
||||
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
|
||||
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
|
||||
if (PBONE_VISIBLE(arm, pchan->bone)) {
|
||||
CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan);
|
||||
}
|
||||
}
|
||||
@ -250,7 +251,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
|
||||
if (obpose && obpose->pose && arm) {
|
||||
for (pchan= obpose->pose->chanbase.first; pchan; pchan= pchan->next) {
|
||||
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
|
||||
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
|
||||
if (PBONE_VISIBLE(arm, pchan->bone)) {
|
||||
if (pchan->bone->flag & BONE_SELECTED || pchan->bone == arm->act_bone)
|
||||
CTX_data_list_add(result, &obpose->id, &RNA_PoseBone, pchan);
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ void BRUSH_OT_curve_preset(wmOperatorType *ot)
|
||||
/* face-select ops */
|
||||
static int paint_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
select_linked_tfaces(C, CTX_data_active_object(C), NULL, 2);
|
||||
paintface_select_linked(C, CTX_data_active_object(C), NULL, 2);
|
||||
ED_region_tag_redraw(CTX_wm_region(C));
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -255,7 +255,7 @@ void PAINT_OT_face_select_linked(wmOperatorType *ot)
|
||||
static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
{
|
||||
int mode= RNA_boolean_get(op->ptr, "extend") ? 1:0;
|
||||
select_linked_tfaces(C, CTX_data_active_object(C), event->mval, mode);
|
||||
paintface_select_linked(C, CTX_data_active_object(C), event->mval, mode);
|
||||
ED_region_tag_redraw(CTX_wm_region(C));
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
@ -277,7 +277,8 @@ void PAINT_OT_face_select_linked_pick(wmOperatorType *ot)
|
||||
|
||||
static int face_select_all_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
selectall_tface(CTX_data_active_object(C), RNA_enum_get(op->ptr, "action"));
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
paintface_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE);
|
||||
ED_region_tag_redraw(CTX_wm_region(C));
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -2211,8 +2211,8 @@ static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te,
|
||||
if(set) {
|
||||
if(!(ebone->flag & BONE_HIDDEN_A)) {
|
||||
bArmature *arm= scene->obedit->data;
|
||||
if(set==2) ED_armature_deselectall(scene->obedit, 2); // only clear active tag
|
||||
else ED_armature_deselectall(scene->obedit, 0); // deselect
|
||||
if(set==2) ED_armature_deselect_all(scene->obedit, 2); // only clear active tag
|
||||
else ED_armature_deselect_all(scene->obedit, 0); // deselect
|
||||
|
||||
ebone->flag |= BONE_SELECTED|BONE_ROOTSEL|BONE_TIPSEL;
|
||||
arm->act_edbone= ebone;
|
||||
|
@ -1979,7 +1979,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
|
||||
|
||||
/* catch exception for bone with hidden parent */
|
||||
flag= eBone->flag;
|
||||
if ( (eBone->parent) && ((eBone->parent->flag & BONE_HIDDEN_A) || (eBone->parent->layer & arm->layer)==0) )
|
||||
if ( (eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent))
|
||||
flag &= ~BONE_CONNECTED;
|
||||
|
||||
/* set temporary flag for drawing bone as active, but only if selected */
|
||||
@ -2018,7 +2018,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
|
||||
|
||||
/* catch exception for bone with hidden parent */
|
||||
flag= eBone->flag;
|
||||
if ( (eBone->parent) && ((eBone->parent->flag & BONE_HIDDEN_A) || (eBone->parent->layer & arm->layer)==0) )
|
||||
if ( (eBone->parent) && !EBONE_VISIBLE(arm, eBone->parent))
|
||||
flag &= ~BONE_CONNECTED;
|
||||
|
||||
/* set temporary flag for drawing bone as active, but only if selected */
|
||||
|
@ -1432,7 +1432,7 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) /* like a loca
|
||||
}
|
||||
}
|
||||
else if (paint_facesel_test(ob)) {
|
||||
ok= minmax_tface(ob, min, max);
|
||||
ok= paintface_minmax(ob, min, max);
|
||||
}
|
||||
else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT)) {
|
||||
ok= PE_minmax(scene, min, max);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -678,7 +678,7 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
|
||||
|
||||
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
|
||||
bone = pchan->bone;
|
||||
if ((bone->layer & arm->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
|
||||
if (PBONE_VISIBLE(arm, bone)) {
|
||||
if ((bone->flag & BONE_SELECTED) && !(ob->proxy && pchan->bone->layer & arm->layer_protected))
|
||||
bone->flag |= BONE_TRANSFORM;
|
||||
else
|
||||
|
@ -316,7 +316,7 @@ int calc_manipulator_stats(const bContext *C)
|
||||
bArmature *arm= obedit->data;
|
||||
EditBone *ebo;
|
||||
for (ebo= arm->edbo->first; ebo; ebo=ebo->next){
|
||||
if(ebo->layer & arm->layer && !(ebo->flag & BONE_HIDDEN_A)) {
|
||||
if(EBONE_VISIBLE(arm, ebo)) {
|
||||
if (ebo->flag & BONE_TIPSEL) {
|
||||
calc_tw_center(scene, ebo->tail);
|
||||
totsel++;
|
||||
|
@ -40,8 +40,6 @@ INCLUDE_DIRECTORIES(
|
||||
../blender/makesdna
|
||||
../blender/gpu
|
||||
../blender/windowmanager
|
||||
../kernel/gen_messaging
|
||||
../kernel/gen_system
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
@ -78,6 +76,11 @@ IF(WITH_PYTHON)
|
||||
ENDIF(WITH_PYTHON)
|
||||
|
||||
IF(WITH_GAMEENGINE)
|
||||
INCLUDE_DIRECTORIES(
|
||||
../kernel/gen_messaging
|
||||
../kernel/gen_system
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DWITH_GAMEENGINE)
|
||||
ENDIF(WITH_GAMEENGINE)
|
||||
|
||||
|
@ -57,8 +57,7 @@
|
||||
|
||||
#include "BLI_args.h"
|
||||
#include "BLI_threads.h"
|
||||
|
||||
#include "GEN_messaging.h"
|
||||
#include "BLI_scanfill.h" // for BLI_setErrorCallBack, TODO, move elsewhere
|
||||
|
||||
#include "DNA_ID.h"
|
||||
#include "DNA_scene_types.h"
|
||||
@ -98,6 +97,7 @@
|
||||
|
||||
/* for passing information between creator and gameengine */
|
||||
#ifdef WITH_GAMEENGINE
|
||||
#include "GEN_messaging.h"
|
||||
#include "SYS_System.h"
|
||||
#else /* dummy */
|
||||
#define SYS_SystemHandle int
|
||||
|
Loading…
Reference in New Issue
Block a user