Merging r59130 through r59135 from trunk into soc-2013-depsgraph_mt
This commit is contained in:
@@ -1600,7 +1600,10 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
|
||||
pchanw.next = pchan->next;
|
||||
pchanw.parent = pchan->parent;
|
||||
pchanw.child = pchan->child;
|
||||
|
||||
|
||||
pchanw.mpath = pchan->mpath;
|
||||
pchan->mpath = NULL;
|
||||
|
||||
/* this is freed so copy a copy, else undo crashes */
|
||||
if (pchanw.prop) {
|
||||
pchanw.prop = IDP_CopyProperty(pchanw.prop);
|
||||
|
||||
@@ -816,6 +816,13 @@ void BM_editselection_plane(BMEditSelection *ese, float r_plane[3])
|
||||
}
|
||||
}
|
||||
|
||||
static BMEditSelection *bm_select_history_create(BMHeader *ele)
|
||||
{
|
||||
BMEditSelection *ese = (BMEditSelection *) MEM_callocN(sizeof(BMEditSelection), "BMEdit Selection");
|
||||
ese->htype = ele->htype;
|
||||
ese->ele = (BMElem *)ele;
|
||||
return ese;
|
||||
}
|
||||
|
||||
/* --- macro wrapped funcs --- */
|
||||
bool _bm_select_history_check(BMesh *bm, const BMHeader *ele)
|
||||
@@ -837,9 +844,7 @@ bool _bm_select_history_remove(BMesh *bm, BMHeader *ele)
|
||||
|
||||
void _bm_select_history_store_notest(BMesh *bm, BMHeader *ele)
|
||||
{
|
||||
BMEditSelection *ese = (BMEditSelection *) MEM_callocN(sizeof(BMEditSelection), "BMEdit Selection");
|
||||
ese->htype = ele->htype;
|
||||
ese->ele = (BMElem *)ele;
|
||||
BMEditSelection *ese = bm_select_history_create(ele);
|
||||
BLI_addtail(&(bm->selected), ese);
|
||||
}
|
||||
|
||||
@@ -849,6 +854,20 @@ void _bm_select_history_store(BMesh *bm, BMHeader *ele)
|
||||
BM_select_history_store_notest(bm, (BMElem *)ele);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _bm_select_history_store_after_notest(BMesh *bm, BMEditSelection *ese_ref, BMHeader *ele)
|
||||
{
|
||||
BMEditSelection *ese = bm_select_history_create(ele);
|
||||
BLI_insertlinkafter(&(bm->selected), ese_ref, ese);
|
||||
}
|
||||
|
||||
void _bm_select_history_store_after(BMesh *bm, BMEditSelection *ese_ref, BMHeader *ele)
|
||||
{
|
||||
if (!BM_select_history_check(bm, (BMElem *)ele)) {
|
||||
BM_select_history_store_after_notest(bm, ese_ref, (BMElem *)ele);
|
||||
}
|
||||
}
|
||||
/* --- end macro wrapped funcs --- */
|
||||
|
||||
|
||||
@@ -861,16 +880,13 @@ void BM_select_history_clear(BMesh *bm)
|
||||
|
||||
void BM_select_history_validate(BMesh *bm)
|
||||
{
|
||||
BMEditSelection *ese, *nextese;
|
||||
BMEditSelection *ese, *ese_next;
|
||||
|
||||
ese = bm->selected.first;
|
||||
|
||||
while (ese) {
|
||||
nextese = ese->next;
|
||||
for (ese = bm->selected.first; ese; ese = ese_next) {
|
||||
ese_next = ese->next;
|
||||
if (!BM_elem_flag_test(ese->ele, BM_ELEM_SELECT)) {
|
||||
BLI_freelinkN(&(bm->selected), ese);
|
||||
}
|
||||
ese = nextese;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +87,15 @@ void BM_editselection_plane(BMEditSelection *ese, float r_plane[3]);
|
||||
#define BM_select_history_remove(bm, ele) _bm_select_history_remove(bm, &(ele)->head)
|
||||
#define BM_select_history_store_notest(bm, ele) _bm_select_history_store_notest(bm, &(ele)->head)
|
||||
#define BM_select_history_store(bm, ele) _bm_select_history_store(bm, &(ele)->head)
|
||||
#define BM_select_history_store_after_notest(bm, ese_ref, ele) _bm_select_history_store_after_notest(bm, ese_ref, &(ele)->head)
|
||||
#define BM_select_history_store_after(bm, ese, ese_ref) _bm_select_history_store_after(bm, ese_ref, &(ele)->head)
|
||||
|
||||
bool _bm_select_history_check(BMesh *bm, const BMHeader *ele);
|
||||
bool _bm_select_history_remove(BMesh *bm, BMHeader *ele);
|
||||
void _bm_select_history_store_notest(BMesh *bm, BMHeader *ele);
|
||||
void _bm_select_history_store(BMesh *bm, BMHeader *ele);
|
||||
void _bm_select_history_store_after(BMesh *bm, BMEditSelection *ese_ref, BMHeader *ele);
|
||||
void _bm_select_history_store_after_notest(BMesh *bm, BMEditSelection *ese_ref, BMHeader *ele);
|
||||
|
||||
void BM_select_history_validate(BMesh *bm);
|
||||
void BM_select_history_clear(BMesh *em);
|
||||
|
||||
@@ -1986,7 +1986,7 @@ int BM_mesh_calc_edge_groups(BMesh *bm, int *r_groups_array, int (**r_group_inde
|
||||
|
||||
BM_elem_index_set(e, i); /* set_inline */
|
||||
}
|
||||
bm->elem_index_dirty &= ~BM_FACE;
|
||||
bm->elem_index_dirty &= ~BM_EDGE;
|
||||
|
||||
/* detect groups */
|
||||
stack = MEM_mallocN(sizeof(*stack) * tot_edges, __func__);
|
||||
|
||||
@@ -103,6 +103,21 @@ void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only, con
|
||||
BMIter iter;
|
||||
BMEdge *e;
|
||||
|
||||
bool use_ese = false;
|
||||
GHash *ese_gh = NULL;
|
||||
|
||||
if (copy_select && bm->selected.first) {
|
||||
BMEditSelection *ese;
|
||||
|
||||
ese_gh = BLI_ghash_ptr_new(__func__);
|
||||
for (ese = bm->selected.first; ese; ese = ese->next) {
|
||||
if (ese->htype != BM_FACE) {
|
||||
BLI_ghash_insert(ese_gh, ese->ele, ese);
|
||||
}
|
||||
}
|
||||
|
||||
use_ese = true;
|
||||
}
|
||||
|
||||
if (tag_only == false) {
|
||||
BM_mesh_elem_hflag_enable_all(bm, BM_EDGE | (use_verts ? BM_VERT : 0), BM_ELEM_TAG, false);
|
||||
@@ -135,9 +150,18 @@ void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only, con
|
||||
BM_elem_flag_enable(e, BM_ELEM_INTERNAL_TAG);
|
||||
|
||||
/* keep splitting until each loop has its own edge */
|
||||
do {
|
||||
bmesh_edge_separate(bm, e, e->l, copy_select);
|
||||
} while (!BM_edge_is_boundary(e));
|
||||
while (!BM_edge_is_boundary(e)) {
|
||||
BMLoop *l_sep = e->l;
|
||||
bmesh_edge_separate(bm, e, l_sep, copy_select);
|
||||
BLI_assert(l_sep->e != e);
|
||||
|
||||
if (use_ese) {
|
||||
BMEditSelection *ese = BLI_ghash_lookup(ese_gh, e);
|
||||
if (UNLIKELY(ese)) {
|
||||
BM_select_history_store_after_notest(bm, ese, l_sep->e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
|
||||
BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
|
||||
@@ -157,14 +181,39 @@ void BM_mesh_edgesplit(BMesh *bm, const bool use_verts, const bool tag_only, con
|
||||
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
|
||||
if (BM_elem_flag_test(e->v1, BM_ELEM_TAG)) {
|
||||
BM_elem_flag_disable(e->v1, BM_ELEM_TAG);
|
||||
bmesh_vert_separate(bm, e->v1, NULL, NULL, copy_select);
|
||||
}
|
||||
if (BM_elem_flag_test(e->v2, BM_ELEM_TAG)) {
|
||||
BM_elem_flag_disable(e->v2, BM_ELEM_TAG);
|
||||
bmesh_vert_separate(bm, e->v2, NULL, NULL, copy_select);
|
||||
unsigned int i;
|
||||
for (i = 0; i < 2; i++) {
|
||||
BMVert *v = ((&e->v1)[i]);
|
||||
if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
|
||||
BM_elem_flag_disable(v, BM_ELEM_TAG);
|
||||
|
||||
if (use_ese) {
|
||||
BMVert **vtar;
|
||||
int vtar_len;
|
||||
|
||||
bmesh_vert_separate(bm, v, &vtar, &vtar_len, copy_select);
|
||||
|
||||
if (vtar_len) {
|
||||
BMEditSelection *ese = BLI_ghash_lookup(ese_gh, v);
|
||||
if (UNLIKELY(ese)) {
|
||||
int j;
|
||||
for (j = 0; j < vtar_len; j++) {
|
||||
BLI_assert(v != vtar[j]);
|
||||
BM_select_history_store_after_notest(bm, ese, vtar[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
MEM_freeN(vtar);
|
||||
}
|
||||
else {
|
||||
bmesh_vert_separate(bm, v, NULL, NULL, copy_select);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (use_ese) {
|
||||
BLI_ghash_free(ese_gh, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,16 +90,14 @@ enum TfmMode {
|
||||
|
||||
/* TRANSFORM CONTEXTS */
|
||||
#define CTX_NONE 0
|
||||
#define CTX_TEXTURE 1
|
||||
#define CTX_EDGE 2
|
||||
#define CTX_NO_PET 4
|
||||
#define CTX_TWEAK 8
|
||||
#define CTX_NO_MIRROR 16
|
||||
#define CTX_AUTOCONFIRM 32
|
||||
#define CTX_BMESH 64
|
||||
#define CTX_NDOF 128
|
||||
#define CTX_MOVIECLIP 256
|
||||
#define CTX_MASK 512
|
||||
#define CTX_TEXTURE (1 << 0)
|
||||
#define CTX_EDGE (1 << 1)
|
||||
#define CTX_NO_PET (1 << 2)
|
||||
#define CTX_NO_MIRROR (1 << 3)
|
||||
#define CTX_AUTOCONFIRM (1 << 4)
|
||||
#define CTX_NDOF (1 << 5)
|
||||
#define CTX_MOVIECLIP (1 << 6)
|
||||
#define CTX_MASK (1 << 7)
|
||||
|
||||
/* Standalone call to get the transformation center corresponding to the current situation
|
||||
* returns 1 if successful, 0 otherwise (usually means there's no selection)
|
||||
|
||||
@@ -952,6 +952,8 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *eve
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
BM_select_history_validate(bm);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,12 +1324,6 @@ int transformEvent(TransInfo *t, const wmEvent *event)
|
||||
t->redraw |= TREDRAW_HARD;
|
||||
}
|
||||
break;
|
||||
// case LEFTMOUSE:
|
||||
// case RIGHTMOUSE:
|
||||
// if (WM_modal_tweak_exit(event, t->event_type))
|
||||
//// if (t->options & CTX_TWEAK)
|
||||
// t->state = TRANS_CONFIRM;
|
||||
// break;
|
||||
case LEFTALTKEY:
|
||||
case RIGHTALTKEY:
|
||||
if (ELEM(t->spacetype, SPACE_SEQ, SPACE_VIEW3D)) {
|
||||
@@ -1374,7 +1368,7 @@ int calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], int c
|
||||
t->state = TRANS_RUNNING;
|
||||
|
||||
/* avoid calculating PET */
|
||||
t->options = CTX_NONE | CTX_NO_PET;
|
||||
t->options = CTX_NO_PET;
|
||||
|
||||
t->mode = TFM_DUMMY;
|
||||
|
||||
|
||||
@@ -6668,10 +6668,6 @@ void createTransData(bContext *C, TransInfo *t)
|
||||
sort_trans_data_dist(t);
|
||||
}
|
||||
}
|
||||
else if (t->options == CTX_BMESH) {
|
||||
// TRANSFORM_FIX_ME
|
||||
//createTransBMeshVerts(t, G.editBMesh->bm, G.editBMesh->td);
|
||||
}
|
||||
else if (t->spacetype == SPACE_IMAGE) {
|
||||
t->flag |= T_POINTS | T_2D_EDIT;
|
||||
if (t->options & CTX_MASK) {
|
||||
|
||||
Reference in New Issue
Block a user