Commit Graph

384 Commits

Author SHA1 Message Date
e125ed5958 - fix a bug with softbody, verts were copied out of order (meant
history was lost... I think, dunno this code well.)
 - commented out code to do merging of quad with 3 verts shared in
   mirror mode... didnt seem worth the effort and mesh still wasnt
   perfect afterwards
 - bug fix, indices for triangles were not swapped correctly in
   mirror, could lead to crash with subsurf in editmode
2005-07-23 06:05:29 +00:00
fd6a1732e2 - vertex indexing in softbody was wrong after I switch loop direction 2005-07-19 20:29:22 +00:00
59a2980611 - some missing changes for switch of mesh_modifier to
deform new verts array.

I don't really know how to use softbody, so it would be nice
if someone would test this for me.
2005-07-19 04:27:43 +00:00
09b5272639 - split mesh_deform off from object_deform
- changed mesh_modifier, sbObjectStep, object_deform to take vertexCo
   argument instead of operating on mesh
 - fixed bug where a derived mesh would not be returned in editmode
 - removed object_wave, replaced by init_wave_deform and calc_wave_deform
 - moved cached DerivedMesh to Object, not Mesh... fixes heisenbugs
   with linked objects
2005-07-19 02:36:21 +00:00
b30b8bdd08 Bug #2624
Typo in bspline interpolation code... a '1' should be '2', causing the
fourth key of interpolation always be equal to third.
Only shows error with larger key steps, like 5 frames or more. Nice it
was found before release!
2005-05-25 21:54:13 +00:00
524e411dbf rule OB_SB_GOAL flag over SOFTGOALSNAP optimization in all cases 2005-05-24 22:17:23 +00:00
83792faa3f Two softbody thingies;
- fixed error in option "Enable Goal" which didn't work with Vertex groups
  assigned

- renamed some buttons & fixed tooltips. A doc online will be there soon
2005-05-20 12:15:50 +00:00
aca394e341 On "Add duplicate object" the softbody baking info wasn't freed.
Note: currently the 'baking' stores the entire animation system, which
makes further animation refining (or duplicating) useless for a Baked
SoftBody. You can even delete the entire anim system.
This can be presented as a feature too (saves slow armature stuff).
However, I might check on a 'relative' bake too.
2005-05-12 14:00:12 +00:00
42126cb5fc Added baking for softbodies.
Works as follows;
- press the 'show bake settings' button (no space left... :)
- define start/end frame for bake, and an interval step.
  The baked result interpolates nicely (Bspline, 4 keys) so in general a
  step size of 2 or 3 still gives OK results.
- Press "BAKE". This will do a full animation + playback. Press ESC if it
  you don't want it.

Once Baked, the BAKE button becomes a FREE BAKE. As reminder the softbody
buttons get blocked with error() menu.

This saves OK in a file. Renders any frame, including fields and moblur.
You can also set a "Timeoffs" for the softbody. And yes, this should be
in the NLA once... :)

NOTE! With this commit, files saved with the old (first commit) version by
Jens Ole won't read the settings back... he stored all sofbody variables in
Object, which was moved to a new struct when I did my first commit on SB
(over a month ago)

Also note that I moved particle deflecting & softbody to a new include.
2005-05-02 13:28:13 +00:00
b705434c72 A couple more simple gcc4.X warnings fixed.
softbody.c I removed an unused var.
text.c added return values to 2 return statements that didn't have anything.
Makefile added $(FIX_STUBS_WARNINGS) to CFLAGS for the stub.
source/blender/src/editface.c  fixed up int vs unsigned int stuff
source/blender/src/resources.c had two vars declared as unsigned char *
and then inputs to them were cast as char * so updated the casts.

Kent
2005-04-28 14:37:15 +00:00
8fbecd24e8 Built in an escape from sbObjectStep() if transform() is used. Has to be
done for lattices... these keep calling this during transform, causing
the lattice itself and its children (if soft) to remain static on same
position.

Real solution has to be 2-fold:
- store deformed lattice points in Lattice, as a "DispList"
- usage of proper depgraph :)

There's also the idea to keep simulating softbody during a transform, to
give feedback on what softbody does... later.
2005-04-25 08:30:49 +00:00
9083ab1a14 cleaned up parameter list for SoftBodyDetectCollision(...)
SoftBodyDetectCollision() is handeling the case
'user wants to prevent self intersection by declaring SB object a deflection target'
ahh .. yeah .. i can see the bug reports on that
(me shrugs .. never promised that to work)
2005-04-24 20:51:47 +00:00
55f4ead5a2 gave softbody runge kutta error limit a nice default value 2005-04-22 17:58:39 +00:00
c5214c1571 rescaled stregth of wind and forcefield effects by some magnitudes
wind 250
field 1000
yeah WARNING to all testers:
tighten belts
scale down wind and forcefield settings (IPOs)
2005-04-21 18:58:15 +00:00
8a75569f9a Testing, 1, 2, 3... (just added enter) 2005-04-21 11:24:44 +00:00
be3eec3014 Softbody: added "time" button, to control speed for wriggling. Low values
make it slower, higher values faster.

Monkey: accidentally got inverted normals for they eye again. :)
2005-04-20 16:55:04 +00:00
1d47d662f9 removed my SB hack from particle collision code
(which still can't really handle moving targets)
leaving 2 bug fixes
1. multiple objects need a reset on cache variable
2. quads always need to be handled as 2 triangles
(since they don't need to share a plane)

added a collision detecting function in effect.c for SB
( no need to be there, but i did not find a better place )
but should handle 'moving targets' up to 0.2 blender units/frame

well .. important info in this case:
collision
uses 'face normal' to decide if *intrusion* happend
uses 'damping' of collision target to slow down movement
when *intrusion* happend

+some more removing unneeded code in softbody.c
2005-04-18 21:51:45 +00:00
07ef51cdb1 More SoftBody stuff:
- after grab/duplicate the softbody didn't get a reset signal
- added 'copy properties' for softbody settings
- duplicate object didn't copy softbody yet
2005-04-16 15:06:02 +00:00
7943f7990e Softbody:
- Added browsing for vertex group for "Goal" in SoftBody buttons.
- Means the default name "SOFTGOAL" isn't needed anymore
- temporally, on file read, the "SOFTGOAL" vertex group is set, if exists
- removing vertex group possible too
- changed softbody.c code to use this
2005-04-16 14:01:49 +00:00
22ccdea4d3 Rather give a pointer to a local copy of vital data to pdDoDeflection()
in sb_deflect_particle() than a pointer to data.

Changed de-swamping in sb collision to move along face normal.
2005-04-13 07:51:06 +00:00
c7b82c40c2 Did put softbody time scaling stuff to functions,
so we can decide later what proper timing is meant to be.
i've prepared something in static float sb_time_scale(Object *ob) [softbody.c] (ton :) )

'hacked in' particle collision system to match softbodies needs
naa .. i don't realy like the hack to int pdDoDeflection(..) in kernel .. effect.c  (but it works :) )
so .. until we'll have a 'nice' collision detector this is what 'softbodies simulator can live with'
did not remove intentionally test function static int sb_deflect_test(..) for further discussions

http://mitglied.lycos.de/mosebjorn/hidden/  sbcol6.blend should work for a while
2005-04-12 21:36:21 +00:00
982cd94269 Fixed uninitialized causing almost infinite loop.
Wind is media friction now, to have consitent relaxing when the squall is gone, fixed direrction.
2005-04-06 10:29:04 +00:00
331c25dda4 fixed small glitch multiplying nodemass twice (thanks ton)
claened up sbObjectStep(...) to follow 'time step rules'
added really care for framerate in scene
renamed arguments in softbody_calc_forces(...); and softbody_apply_forces(...); for better reading
fixed particle integration to be ODE solver compatible
2005-04-05 20:28:32 +00:00
7a377bcb05 - Made SoftBody work with Particle Force Fields.
- Added new (Particle) Deflector; type Wind.
  Wind gives constant directional force. It is animatable (Ipos) and reacts
  to Object scaling. Also uses FallOff. Works for particles and SoftBody
  quick movie check; http://www.blender.org/bf/0001_0250.avi
  test file is in download.blender.org/demo/test/wind_soft.blend

- Added MaxDist option for forcefields, to control its influence better.
  Is drawn as circle in 3d window.

Forcefields are a bit weak still... should react to scaling, or not; in
that case drawing should indicate it (done for spherical field now).
2005-04-04 18:09:47 +00:00
41ad061a09 Error in Softbody goal-min and goal-max correction. It was giving
not as result the range as indicated!
2005-04-03 20:57:31 +00:00
9ec8778288 SoftBody:
- on add new SoftBody, it creates automatically edges in Mesh now, gives
  too confusing results otherwise
- if no edges exist in mesh, it also doesnt add diagonals for faces in
  softbody

Transform;

- fixed stupid 'used unitialized' gcc warning (sorry theeth!)
- made dualAxisConstraint() accept string too
- little cleanup of prints in using Manipulators
2005-04-03 20:13:10 +00:00
8d92e6ced2 Added more dependencies to softbody, for correct recalc
For example; subsurfed softbody after play anim (ALT+A) didn't get
cleared correctly. Darn where_is_object stuff!
2005-04-03 16:57:16 +00:00
90df59630e More softbody goodness;
- Added Softbody effect for Lattices (not too useful yet without
  vertexgroups though)
- Added default vertex "goal" value + button, to be assigned when no
  vertexgroup exists (or vertex isn't in the group)
- Made softmin and softmax work as documented (defining min and max range)
- made changes in buttons send 'update' signal to softbody

And:

- added Nkey Properties to show lattice coordinates
2005-04-02 19:52:32 +00:00
88ea754045 Added signal OB_SB_REDO for ob->softflag to force a recalc.
Now used after weight painting, so it updates immediately.
2005-04-02 15:55:15 +00:00
bdb86d7c67 Integration stage of Softbody project
User level notes are in Wiki here;
http://wiki.blender.org/bin/view.pl/Blenderdev/Softbodies
And will be added in blender3d.org CMS later.

Tech level notes are still pending, but here's the most relevant ones;

- made ob->soft struct SoftBody to hold all settings, and read/save in
  files
- added (temporal!) conversion for the old settings. So: read old files
  with softbody experiments now, and save over!
- cleaned API calls for softbody, which are only 5 of them now:
  sbNew()
  sbFree()
  sbObjectStep()          (animation steps)
  sbObjectToSoftbody()    (full re-initialize data)
  sbObjectReset()         (only reset motion)
- API calls accepts time in frames now, within softbody.c it converts

Further, internally code was cleaned some (missing tabs etc). Also tried
to keep a well defined structure with hints how to add support for more
objects. Can write notes about that...
2005-04-02 13:57:23 +00:00
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00
bb0da8a7aa Did some checking to make sure a variable exits before trying to use it.
(Submitted by Vidarino on irc)

I also cleaned up a couple of warnings in the file.

Kent
2005-01-13 13:58:29 +00:00
912ef80bdc big softbody commit
some vertex group , weight painting stuff too
/me crosses fingers it does not break anything
2005-01-12 22:28:13 +00:00
f2b785296e Added 2 files for softbody plus sconscript! 2004-10-01 14:10:30 +00:00