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>2004-10-01 18:04:17 +0400
committerTon Roosendaal <ton@blender.org>2004-10-01 18:04:17 +0400
commit04f5baee3a8ccfbe21c3f9eed49809f24fd7fddf (patch)
tree944e6e6b5b7dbc9711d9d1a87f3c158c6a3fd137 /source/blender/src/editobject.c
parentd818141744bff49c8c7ae6befd7ba901bd2d869f (diff)
OK. Here's the long awaited first step (V0.01!) of SoftBody. It is called
from within mesh_modifiers (kernel deform.c). It copies vertices to a temporal particle system (struct SoftBody with BodyPoint structs) to do physics tricks with it. For each frame change the delta movements (based on standard ipo anim or even other deforms (later) are applied to the physics system. How to apply and calculate satisfying results is not my thing... so here I'll commu- nicate with others for. Since it's in the modifier stack, the SoftBody code can run entirely on original data (no displists!). Right now I've implemented 2 things; - "Goal" which is a per vertex value for how much the current position should take into account (goal=1 is without physics). This is a powerful method for artists to get control over what moves and not. Right now i read the vertex color for it. - And some spring stuff, which now only works based on force moving it to the originial location. This doesnt work with 'goal'... erhm. - You can re-use physics vars from engine, used right now is (in Object) - damping - springf (spring factor) - softflag (to set types, or activate softbody for it - The SoftBody pointer in struct Object is only runtime, nothing saved in file To prevent all users going to complain it doesn't work, I've hidden the functionality. :) The buttons to set softbody 'on' only show now (psst psst) when the object has name "soft" as first 4 characters. You can find the buttons in the F7 Particle Interaction Panel (which should be renamed 'physics properties' later or so. Demo file: http://www.blender.org/bf/softbody.blend
Diffstat (limited to 'source/blender/src/editobject.c')
-rw-r--r--source/blender/src/editobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index 6b58e260e2d..7617660ec15 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -113,6 +113,7 @@
#include "BKE_property.h"
#include "BKE_sca.h"
#include "BKE_scene.h"
+#include "BKE_softbody.h"
#include "BKE_subsurf.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
@@ -1547,6 +1548,8 @@ void exit_editmode(int freedata) /* freedata==0 at render, 1= freedata, 2= do un
}
scrarea_queue_headredraw(curarea);
+ if(ob->softflag) object_to_softbody(ob);
+
if(G.obedit==NULL && freedata==2)
BIF_undo_push("Editmode");
}