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:
authorJohnny Matthews <johnny.matthews@gmail.com>2005-04-16 19:33:38 +0400
committerJohnny Matthews <johnny.matthews@gmail.com>2005-04-16 19:33:38 +0400
commit56591ade336734abd5ae099dd90eca5f5391187b (patch)
tree8c63ac7b71195a67a7f7a244538106ec88439785 /source/blender/python/api2_2x/Object.c
parent07ef51cdb18fbfd85612c64c772d2cfa79c6775c (diff)
The setup functions for SB and PI now initialize the vars to the defaults that are set in the UI when one of the panels are accessed. Current this happens whenever an SB or PI api function is called for the first time.
Diffstat (limited to 'source/blender/python/api2_2x/Object.c')
-rw-r--r--source/blender/python/api2_2x/Object.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index 23f80a21691..51640704bd4 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -3832,10 +3832,24 @@ int setupSB(Object* ob){
Mesh *me= ob->data;
if(me->medge==NULL) make_edges(me);
}
- if(ob->soft)
- return 1;
- else
+
+ if(ob->soft){
+ ob->soft->nodemass = 1.0;
+ ob->soft->grav = 0.0;
+ ob->soft->mediafrict = 0.5;
+ ob->soft->rklimit = 0.01;
+ ob->soft->goalspring = 0.5;
+ ob->soft->goalfrict = 0.0;
+ ob->soft->mingoal = 0.0;
+ ob->soft->maxgoal = 1.0;
+ ob->soft->inspring = 0.5;
+ ob->soft->infrict = 0.5;
+ ob->soft->defgoal = 0.7;
+ return 1;
+ }
+ else {
return 0;
+ }
}
int setupPI(Object* ob){
@@ -3843,8 +3857,20 @@ int setupPI(Object* ob){
ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
/* and if needed, init here */
}
- if(ob->pd)
- return 1;
- else
+
+ if(ob->pd){
+ ob->pd->deflect =0;
+ ob->pd->forcefield =0;
+ ob->pd->flag =0;
+ ob->pd->pdef_damp =0;
+ ob->pd->pdef_rdamp =0;
+ ob->pd->pdef_perm =0;
+ ob->pd->f_strength =0;
+ ob->pd->f_power =0;
+ ob->pd->maxdist =0;
+ return 1;
+ }
+ else{
return 0;
+ }
}