Fixed various errors with Blender allowing editing Library linked data.
CTRL+V on buttons NKEY Panels join mesh join curve editing buttons boolean vpaint faceselect Manipulator Also; Transform() got in useless loop when you entered without anything selected. Not sure why Martin recoded it this way... maybe as a first step to handlerify it? For evil Python Aussie Bosses? :P
This commit is contained in:
@@ -2739,6 +2739,7 @@ void editing_panels()
|
||||
|
||||
ob= OBACT;
|
||||
if(ob==NULL) return;
|
||||
if(ob->id.lib) uiSetButLock(1, "Can't edit library data");
|
||||
|
||||
switch(ob->type) {
|
||||
case OB_MESH:
|
||||
@@ -2818,5 +2819,5 @@ void editing_panels()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
uiClearButLock();
|
||||
}
|
||||
|
||||
@@ -1565,6 +1565,8 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
|
||||
|
||||
if(uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204)==0) return;
|
||||
|
||||
if(ob->id.lib) uiSetButLock(1, "Can't edit library data");
|
||||
|
||||
if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT)) {
|
||||
uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw
|
||||
}
|
||||
@@ -1610,6 +1612,7 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "SizeZ:", 160, 30, 140, 19, &(ob->size[2]), -lim, lim, 100, 3, "");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
uiClearButLock();
|
||||
}
|
||||
|
||||
static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGROUND
|
||||
|
||||
@@ -3374,7 +3374,7 @@ void join_curve(int type)
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
nextb= base->next;
|
||||
if TESTBASE(base) {
|
||||
if TESTBASELIB(base) {
|
||||
if(base->object->type==type) {
|
||||
if(base->object != ob) {
|
||||
|
||||
|
||||
@@ -1202,6 +1202,7 @@ void set_faceselect() /* toggle */
|
||||
Mesh *me = 0;
|
||||
|
||||
scrarea_queue_headredraw(curarea);
|
||||
if(ob->id.lib) return;
|
||||
|
||||
if(G.f & G_FACESELECT) G.f &= ~G_FACESELECT;
|
||||
else {
|
||||
|
||||
@@ -1958,12 +1958,13 @@ void special_editmenu(void)
|
||||
}
|
||||
else {
|
||||
Base *base, *base_select= NULL;
|
||||
Object *ob= OBACT;
|
||||
|
||||
// Get the active object mesh.
|
||||
Mesh *me= get_mesh(OBACT);
|
||||
Mesh *me= get_mesh(ob);
|
||||
|
||||
// If the active object is a mesh...
|
||||
if (me) {
|
||||
if (me && ob->id.lib==NULL) {
|
||||
// Bring up a little menu with the boolean operation choices on.
|
||||
nr= pupmenu("Boolean %t|Intersect%x1|Union%x2|Difference%x3");
|
||||
|
||||
@@ -1975,7 +1976,7 @@ void special_editmenu(void)
|
||||
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
if(base->flag & SELECT) {
|
||||
if TESTBASELIB(base) {
|
||||
if(base->object != OBACT) base_select= base;
|
||||
}
|
||||
|
||||
@@ -3269,7 +3270,7 @@ void std_rmouse_transform(void (*xf_func)(int, int))
|
||||
initTransform(TFM_TRANSLATION, CTX_NONE);
|
||||
Transform();
|
||||
}
|
||||
else
|
||||
else if(xf_func)
|
||||
xf_func('g', 0);
|
||||
|
||||
while(get_mbut() & mousebut) BIF_wait_for_statechange();
|
||||
@@ -3290,7 +3291,7 @@ void std_rmouse_transform(void (*xf_func)(int, int))
|
||||
|
||||
void rightmouse_transform(void)
|
||||
{
|
||||
std_rmouse_transform(Transform);
|
||||
std_rmouse_transform(NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -3311,7 +3312,7 @@ void single_object_users(int flag)
|
||||
|
||||
if( (base->flag & flag)==flag) {
|
||||
|
||||
if(ob->id.lib==0 && ob->id.us>1) {
|
||||
if(ob->id.lib==NULL && ob->id.us>1) {
|
||||
|
||||
obn= copy_object(ob);
|
||||
ob->id.us--;
|
||||
@@ -3328,7 +3329,7 @@ void single_object_users(int flag)
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
ob= base->object;
|
||||
if(ob->id.lib==0) {
|
||||
if(ob->id.lib==NULL) {
|
||||
if( (base->flag & flag)==flag) {
|
||||
|
||||
relink_constraints(&base->object->constraints);
|
||||
@@ -3395,7 +3396,7 @@ void single_obdata_users(int flag)
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
ob= base->object;
|
||||
if(ob->id.lib==0 && (base->flag & flag)==flag ) {
|
||||
if(ob->id.lib==NULL && (base->flag & flag)==flag ) {
|
||||
id= ob->data;
|
||||
|
||||
if(id && id->us>1 && id->lib==0) {
|
||||
@@ -3527,7 +3528,7 @@ void single_mat_users(int flag)
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
ob= base->object;
|
||||
if(ob->id.lib==0 && (flag==0 || (base->flag & SELECT)) ) {
|
||||
if(ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) {
|
||||
|
||||
for(a=1; a<=ob->totcol; a++) {
|
||||
ma= give_current_material(ob, a);
|
||||
@@ -3764,7 +3765,7 @@ void make_local(void)
|
||||
while(base) {
|
||||
ob= base->object;
|
||||
if( (base->flag & SELECT)) {
|
||||
if(ob->id.lib==0) {
|
||||
if(ob->id.lib==NULL) {
|
||||
ID_NEW(ob->parent);
|
||||
ID_NEW(ob->track);
|
||||
}
|
||||
|
||||
@@ -431,8 +431,9 @@ static int ui_but_copy_paste(uiBut *but, char mode)
|
||||
static float rgb[3];
|
||||
void *poin;
|
||||
|
||||
poin= but->poin;
|
||||
if(mode=='v' && but->lock) return;
|
||||
|
||||
poin= but->poin;
|
||||
|
||||
if ELEM3(but->type, NUM, NUMSLI, HSVSLI) {
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ void join_mesh(void)
|
||||
/* count */
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
if TESTBASE(base) {
|
||||
if TESTBASELIB(base) {
|
||||
if(base->object->type==OB_MESH) {
|
||||
me= base->object->data;
|
||||
totvert+= me->totvert;
|
||||
@@ -173,7 +173,7 @@ void join_mesh(void)
|
||||
/* if needed add edges to other meshes */
|
||||
if(hasedges) {
|
||||
for(base= FIRSTBASE; base; base= base->next) {
|
||||
if TESTBASE(base) {
|
||||
if TESTBASELIB(base) {
|
||||
if(base->object->type==OB_MESH) {
|
||||
me= base->object->data;
|
||||
if(me->medge==NULL) make_edges(me);
|
||||
@@ -196,7 +196,7 @@ void join_mesh(void)
|
||||
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
if TESTBASE(base) {
|
||||
if TESTBASELIB(base) {
|
||||
if(ob!=base->object && base->object->type==OB_MESH) {
|
||||
me= base->object->data;
|
||||
|
||||
@@ -272,7 +272,7 @@ void join_mesh(void)
|
||||
base= FIRSTBASE;
|
||||
while(base) {
|
||||
nextb= base->next;
|
||||
if TESTBASE(base) {
|
||||
if TESTBASELIB(base) {
|
||||
if(base->object->type==OB_MESH) {
|
||||
|
||||
me= base->object->data;
|
||||
|
||||
@@ -514,6 +514,8 @@ void Transform()
|
||||
short pmval[2] = {0, 0}, mval[2], val;
|
||||
unsigned short event;
|
||||
|
||||
if(Trans.total==0) return; // added, can happen now! (ton)
|
||||
|
||||
Mat3One(mati);
|
||||
|
||||
// Emptying event queue
|
||||
|
||||
@@ -353,13 +353,10 @@ int calc_manipulator_stats(ScrArea *sa)
|
||||
|
||||
base= (G.scene->base.first);
|
||||
while(base) {
|
||||
if(v3d->lay & base->lay) {
|
||||
|
||||
if(base->flag & SELECT) {
|
||||
if(ob==NULL) ob= base->object;
|
||||
calc_tw_center(base->object->obmat[3]);
|
||||
totsel++;
|
||||
}
|
||||
if TESTBASELIB(base) {
|
||||
if(ob==NULL) ob= base->object;
|
||||
calc_tw_center(base->object->obmat[3]);
|
||||
totsel++;
|
||||
}
|
||||
base= base->next;
|
||||
}
|
||||
|
||||
@@ -329,6 +329,8 @@ void clear_vpaint()
|
||||
|
||||
ob= OBACT;
|
||||
me= get_mesh(ob);
|
||||
if(ob->id.lib) return;
|
||||
|
||||
if(me==0 || me->totface==0) return;
|
||||
|
||||
if(me->tface) tface_to_mcol(me);
|
||||
@@ -793,6 +795,8 @@ void weight_paint(void)
|
||||
if(indexar==NULL) init_vertexpaint();
|
||||
|
||||
ob= OBACT;
|
||||
if(ob->id.lib) return;
|
||||
|
||||
me= get_mesh(ob);
|
||||
if (!me->dvert){
|
||||
return;
|
||||
@@ -957,8 +961,10 @@ void vertex_paint()
|
||||
if(indexar==NULL) init_vertexpaint();
|
||||
|
||||
ob= OBACT;
|
||||
if(ob->id.lib) return;
|
||||
|
||||
me= get_mesh(ob);
|
||||
if(me==0 || me->totface==0) return;
|
||||
if(me==NULL || me->totface==0) return;
|
||||
if(ob->lay & G.vd->lay); else error("Active object is not in this layer");
|
||||
|
||||
if(me->tface==NULL && me->mcol==NULL) make_vertexcol();
|
||||
@@ -1119,6 +1125,7 @@ void set_wpaint(void) /* toggle */
|
||||
|
||||
scrarea_queue_headredraw(curarea);
|
||||
ob= OBACT;
|
||||
if(ob->id.lib) return;
|
||||
me= get_mesh(ob);
|
||||
|
||||
if(me && me->totface>=MAXINDEX) {
|
||||
@@ -1155,6 +1162,11 @@ void set_vpaint(void) /* toggle */
|
||||
|
||||
scrarea_queue_headredraw(curarea);
|
||||
ob= OBACT;
|
||||
if(ob->id.lib) {
|
||||
G.f &= ~G_VERTEXPAINT;
|
||||
return;
|
||||
}
|
||||
|
||||
me= get_mesh(ob);
|
||||
|
||||
if(me && me->totface>=MAXINDEX) {
|
||||
|
||||
Reference in New Issue
Block a user