Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-09-24 19:10:08 +0400
committerTon Roosendaal <ton@blender.org>2005-09-24 19:10:08 +0400
commit0ce3341aaaeea41f61cbbfde892d1d216156f3bd (patch)
tree95cd7ec5f54929017df09496ac6059673f92629b /source/blender
parentabe9799c471dd0b139b1422a811dbe4963c50e33 (diff)
Created a new sub-context ("tab") for all physics related button panels.
There we can find now Particles, Fields & deflectors, Soft Body and Fluids. This also as preparation for more work on the particle side (becomes two panels). Also renamed panels, and made sure the name "Soft Body" is spelled every- where the same! It uses an icon as was designed long ago already. Needs some thinking...
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/include/BIF_butspace.h14
-rw-r--r--source/blender/include/butspace.h1
-rw-r--r--source/blender/src/butspace.c10
-rw-r--r--source/blender/src/buttons_object.c51
-rw-r--r--source/blender/src/header_buttonswin.c3
5 files changed, 48 insertions, 31 deletions
diff --git a/source/blender/include/BIF_butspace.h b/source/blender/include/BIF_butspace.h
index 0b2997f3317..9882984a010 100644
--- a/source/blender/include/BIF_butspace.h
+++ b/source/blender/include/BIF_butspace.h
@@ -74,17 +74,21 @@ extern void validate_editbonebutton_cb(void *bonev, void *namev);
#define CONTEXT_LOGIC 6
/* buts->tab new */
-#define TAB_SCENE_RENDER 0
-#define TAB_SCENE_WORLD 1
-#define TAB_SCENE_ANIM 2
-#define TAB_SCENE_SOUND 3
-
#define TAB_SHADING_MAT 0
#define TAB_SHADING_TEX 1
#define TAB_SHADING_RAD 2
#define TAB_SHADING_WORLD 3
#define TAB_SHADING_LAMP 4
+#define TAB_OBJECT_OBJECT 0
+#define TAB_OBJECT_PHYSICS 1
+
+#define TAB_SCENE_RENDER 0
+#define TAB_SCENE_WORLD 1
+#define TAB_SCENE_ANIM 2
+#define TAB_SCENE_SOUND 3
+
+
/* buts->scaflag */
#define BUTS_SENS_SEL 1
#define BUTS_SENS_ACT 2
diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h
index db22433c273..76d2069a9a9 100644
--- a/source/blender/include/butspace.h
+++ b/source/blender/include/butspace.h
@@ -61,6 +61,7 @@ extern void do_soundbuts(unsigned short event);
/* object */
extern void object_panels(void);
+extern void physics_panels(void);
extern void do_object_panels(unsigned short event);
extern void do_constraintbuts(unsigned short event);
extern void object_panel_constraint(char *context);
diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c
index d9c7b7684e4..ca62281c4e5 100644
--- a/source/blender/src/butspace.c
+++ b/source/blender/src/butspace.c
@@ -423,9 +423,13 @@ void drawbutspace(ScrArea *sa, void *spacedata)
break;
case CONTEXT_OBJECT:
- /* no tabs */
- object_panels();
-
+ tab= sbuts->tab[CONTEXT_OBJECT];
+
+ if(tab==sbuts->tab[TAB_OBJECT_OBJECT])
+ object_panels();
+ else if(tab==sbuts->tab[TAB_OBJECT_PHYSICS])
+ physics_panels();
+
break;
case CONTEXT_SHADING:
tab= sbuts->tab[CONTEXT_SHADING];
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index d9a38eb14cd..296970107b0 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -1550,13 +1550,12 @@ void do_effects_panels(unsigned short event)
}
/* Panel for particle interaction settings */
-static void object_panel_deflectors(Object *ob)
+static void object_panel_fields(Object *ob)
{
uiBlock *block;
- block= uiNewBlock(&curarea->uiblocks, "object_panel_deflectors", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Constraints", "Object");
- if(uiNewPanel(curarea, block, "Particle Interaction", "Object", 640, 0, 318, 204)==0) return;
+ block= uiNewBlock(&curarea->uiblocks, "object_panel_fields", UI_EMBOSS, UI_HELV, curarea->win);
+ if(uiNewPanel(curarea, block, "Fields and Defection", "Physics", 420, 0, 318, 204)==0) return;
/* should become button, option? */
if(ob->pd==NULL) {
@@ -1589,7 +1588,7 @@ static void object_panel_deflectors(Object *ob)
// if(modifiers_isSoftbodyEnabled(ob)) {
if(0) {
- uiDefBut(block, LABEL, 0, "Object is Softbody,", 160,160,150,20, NULL, 0.0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "Object is Soft Body,", 160,160,150,20, NULL, 0.0, 0, 0, 0, "");
uiDefBut(block, LABEL, 0, "no Deflection possible", 160,140,150,20, NULL, 0.0, 0, 0, 0, "");
pd->deflect= 0;
}
@@ -1610,7 +1609,7 @@ static void object_panel_deflectors(Object *ob)
uiDefBut(block, LABEL, 0, "Soft Body", 160,60,150,20, NULL, 0.0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- uiDefButF(block, NUM, B_DIFF, "Damping:", 160,40,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during softbody collision");
+ uiDefButF(block, NUM, B_DIFF, "Damping:", 160,40,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during soft body collision");
uiDefButF(block, NUM, B_DIFF, "Inner:", 160,20,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness");
uiDefButF(block, NUM, B_DIFF, "Outer:", 160, 0,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness");
uiBlockBeginAlign(block);
@@ -1655,15 +1654,14 @@ static void object_softbodies(Object *ob)
uiBlock *block;
block= uiNewBlock(&curarea->uiblocks, "object_softbodies", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Constraints", "Object");
- if(uiNewPanel(curarea, block, "Softbody", "Object", 640, 0, 318, 204)==0) return;
+ if(uiNewPanel(curarea, block, "Soft Body", "Physics", 740, 0, 318, 204)==0) return;
/* do not allow to combine with force fields */
/* if(ob->pd && ob->pd->deflect) { */
/* no reason for that any more BM */
if(0) {
uiDefBut(block, LABEL, 0, "Object has Deflection,", 10,160,300,20, NULL, 0.0, 0, 0, 0, "");
- uiDefBut(block, LABEL, 0, "no Softbody possible", 10,140,300,20, NULL, 0.0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "no Soft Body possible", 10,140,300,20, NULL, 0.0, 0, 0, 0, "");
} else {
static int val;
uiBut *but;
@@ -1686,7 +1684,7 @@ static void object_softbodies(Object *ob)
uiDefButBitS(block, TOG, OB_SB_BAKESET, REDRAWBUTSOBJECT, "Bake settings", 180,200,130,20, &ob->softflag, 0, 0, 0, 0, "To convert simulation into baked (cached) result");
- if(sb->keys) uiSetButLock(1, "SoftBody is baked, free it first");
+ if(sb->keys) uiSetButLock(1, "Soft Body is baked, free it first");
if(ob->softflag & OB_SB_BAKESET) {
uiBlockBeginAlign(block);
@@ -1757,22 +1755,21 @@ static void object_softbodies(Object *ob)
}
-static void object_panel_effects(Object *ob)
+static void object_panel_particles(Object *ob)
{
Effect *eff;
uiBlock *block;
int a;
short x, y;
- block= uiNewBlock(&curarea->uiblocks, "object_panel_effects", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Constraints", "Object");
- if(uiNewPanel(curarea, block, "Effects", "Object", 640, 0, 418, 204)==0) return;
+ block= uiNewBlock(&curarea->uiblocks, "object_panel_particles", UI_EMBOSS, UI_HELV, curarea->win);
+ if(uiNewPanel(curarea, block, "Particles", "Physics", 0, 0, 418, 204)==0) return;
/* EFFECTS */
if (ob->type == OB_MESH) {
uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_NEWEFFECT, "NEW Effect", 550,187,124,27, 0, 0, 0, 0, 0, "Create a new effect");
+ uiDefBut(block, BUT, B_NEWEFFECT, "NEW", 550,187,124,27, 0, 0, 0, 0, 0, "Create a new Particle effect");
uiDefBut(block, BUT, B_DELEFFECT, "Delete", 676,187,62,27, 0, 0, 0, 0, 0, "Delete the effect");
uiBlockEndAlign(block);
}
@@ -1880,8 +1877,7 @@ static void object_panel_fluidsim(Object *ob)
const int objHeight = 20;
block= uiNewBlock(&curarea->uiblocks, "object_fluidsim", UI_EMBOSS, UI_HELV, curarea->win);
- uiNewPanelTabbed("Constraints", "Object");
- if(uiNewPanel(curarea, block, "Fluidsim", "Object", 640, 0, 318, 204)==0) return;
+ if(uiNewPanel(curarea, block, "Fluid Simulation", "Physics", 1060, 0, 318, 204)==0) return;
uiDefButBitS(block, TOG, OB_FLUIDSIM_ENABLE, REDRAWBUTSOBJECT, "Enable", 0,yline, 75,objHeight,
&ob->fluidsimFlag, 0, 0, 0, 0, "Sets object to participate in fluid simulation");
@@ -1996,14 +1992,23 @@ void object_panels()
object_panel_anim(ob);
object_panel_draw(ob);
object_panel_constraint("Object");
- if(ob->type==OB_MESH) {
- object_panel_effects(ob);
- }
- object_panel_deflectors(ob);
- object_softbodies(ob);
- object_panel_fluidsim(ob);
uiClearButLock();
}
}
+void physics_panels()
+{
+ Object *ob;
+
+ /* check context here */
+ ob= OBACT;
+ if(ob) {
+ if(ob->id.lib) uiSetButLock(1, "Can't edit library data");
+ object_panel_particles(ob);
+ object_panel_fields(ob);
+ object_softbodies(ob);
+ object_panel_fluidsim(ob);
+ }
+}
+
diff --git a/source/blender/src/header_buttonswin.c b/source/blender/src/header_buttonswin.c
index ad8c69feb55..48d814e3c91 100644
--- a/source/blender/src/header_buttonswin.c
+++ b/source/blender/src/header_buttonswin.c
@@ -619,6 +619,9 @@ void buts_buttons(void)
break;
case CONTEXT_OBJECT:
+ uiBlockBeginAlign(block);
+ uiDefIconButC(block, ROW, B_REDR, ICON_OBJECT, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_OBJECT, 0, 0, "Object buttons ");
+ uiDefIconButC(block, ROW, B_REDR, ICON_EFFECTS, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_PHYSICS, 0, 0, "Physics buttons");
break;
case CONTEXT_SHADING: