test commit
authorJens Ole Wund <bjornmose@gmx.net>
Fri, 1 Jun 2007 00:40:52 +0000 (00:40 +0000)
committerJens Ole Wund <bjornmose@gmx.net>
Fri, 1 Jun 2007 00:40:52 +0000 (00:40 +0000)
knit picking users complained about available options
with non softbody able objects

source/blender/src/buttons_object.c

index e47a80fe9fa15c766aa09454682f0492a0e68e9c..ed9b2043924c292c76631f5ba5d2b419ce708ce7 100644 (file)
@@ -2462,11 +2462,21 @@ static void object_softbodies__enable(void *ob_v, void *arg2)
        allqueue(REDRAWBUTSEDIT, 0);
 }
 
+static int _can_softbodies_at_all(Object *ob)
+{
+       // list of Yes
+    if ((ob->type==OB_MESH)
+               || (ob->type==OB_CURVE)
+               || (ob->type==OB_LATTICE)
+               ) return 1;
+       // else deny
+       return 0;
+}
 static void object_softbodies_II(Object *ob)
 {
        uiBlock *block;
        static int val;
-
+    if(!_can_softbodies_at_all(ob)) return;
        block= uiNewBlock(&curarea->uiblocks, "object_softbodies_II", UI_EMBOSS, UI_HELV, curarea->win);
        uiNewPanelTabbed("Soft Body", "Physics");
        if(uiNewPanel(curarea, block, "Soft Body Collision", "Physics", 651, 0, 318, 204)==0) return;
@@ -2545,9 +2555,9 @@ static void object_softbodies(Object *ob)
        uiBlock *block;
        static int val;
        uiBut *but;
+    if(!_can_softbodies_at_all(ob)) return;
        block= uiNewBlock(&curarea->uiblocks, "object_softbodies", UI_EMBOSS, UI_HELV, curarea->win);
        if(uiNewPanel(curarea, block, "Soft Body", "Physics", 640, 0, 318, 204)==0) return;
-
        uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
 
        val = modifiers_isSoftbodyEnabled(ob);