diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index ec1bac6686e..411f5f92280 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2739,7 +2739,8 @@ 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: editing_panel_links(ob); // no editmode! @@ -2818,5 +2819,5 @@ void editing_panels() } break; } - + uiClearButLock(); } diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 232c0672e72..4d8b0fa5fd7 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -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 diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c index dd4af70c3f7..360c9e62f45 100644 --- a/source/blender/src/editcurve.c +++ b/source/blender/src/editcurve.c @@ -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) { diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index 4f660db90f4..c22a6d9bd0d 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -1202,7 +1202,8 @@ 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 { if (ob && ob->type == OB_MESH) G.f |= G_FACESELECT; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 71c42e10dd1..3253c0d5420 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -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); } diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index d5ce89c3445..99912da752d 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -431,9 +431,10 @@ static int ui_but_copy_paste(uiBut *but, char mode) static float rgb[3]; void *poin; + if(mode=='v' && but->lock) return; + poin= but->poin; - if ELEM3(but->type, NUM, NUMSLI, HSVSLI) { if(mode=='c') { diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c index df1ac2c1797..7bd0c785b22 100644 --- a/source/blender/src/meshtools.c +++ b/source/blender/src/meshtools.c @@ -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; diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index bf7da510cd1..e2b8c51644d 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -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 diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c index 4fe2850b66c..09eb88d0e47 100644 --- a/source/blender/src/transform_manipulator.c +++ b/source/blender/src/transform_manipulator.c @@ -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; } diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index 8d711054a51..6acf0e0fcc5 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -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) {