Commit Graph

434 Commits

Author SHA1 Message Date
9e05d6efb5 Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;

http://www.blender3d.org/cms/Armature_Envelopes.647.0.html

Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).

Also part of this commit is:

- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
  keep the PoseMode hidden Bones separate from EditMode.
  (In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
  mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
  data. Sounds logical, but remember that VertexGroups are partial on a
  Mesh, partial on Object. Weird design decision though...
  Anyhoo, at this moment the only way to have Bone Envelopes deform, is
  by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
  depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
  set.
2005-08-19 12:35:15 +00:00
2872263377 - New feature: shift+ctrl+t in Mesh editmode splits quads in exact opposite
way. Requested for low-poly modeling.

- fix: on exit editmode, the code always created a mesh->dvert block...
  silly, this made other code confused which decided whether to use
  dverts (vertex groups) or not.

- removed obsolete call from armature.c. Also fixed name of function there,
  preparation work for nicer support in Blender for "deform envelopes"
2005-08-17 13:26:42 +00:00
1dcec68ab4 EditMode armature: mirrored editing feature.
- Option is in EditButtons, Armature panel.
- Currently only local X-axis mirror (seems to be default anyway)
- Transform then applies changes to the mirrored-name bone as well.
- Extrude: also does the counterpart Bone
- New: SHIFT+E extrude: extrudes 2 mirrored Bones out of a normal Bone.
  (creating names by appening _L and _R)

Or in short: you can now model a full rig without any manual naming!
Of course the names are not too nice... a couple of ideas to explore;
- rename a mirrored bone renames counterpart too
- allow in weightpaint mode to select Bones
- and of course mirrored edit in PoseMode (if that's useful...)

Important note: I tweaked the naming convention a bit; names like
Bone_L.005 and Bone_R.005 are considered counterparts. However, if
you use the "Flip names" option, the number extension is still
truncated.

BTW: Commits in Zr's code are fixes for gcc warnings. :)
2005-08-15 14:02:03 +00:00
109950ada4 New; Wkey in Armature Editmode. Has option for flipping names too.
(And moved flip_name to armature kernel)
2005-08-13 19:41:45 +00:00
5afdfc6ac1 - remove some silly array copying code for nurb displist generation
- converted dl->flag to use consistent defines for cyclic U/V
2005-08-11 22:27:53 +00:00
76d2f0da9e - couldn't help myself, got distracted working on something else and
wondered what these silly data pointers in MDeformVert were for.
   Turns out they aren't even need! Just taking up extra memory and
   space and confusing the armature deform algorithm. Naturally I
   had to clean things up. Sorry Ton.

   Deform weights are still stored in a pretty expensive and unnecessary
   way, probably use about twice as much memory as needed, and do
   way too many memory allocs.
 - moved armature_deform_verts into armature.c
 - some python code accessed the MDeformWeight data pointers, but
   did so in a completely wrong way, I am positive this code could
   never have worked (or maybe things changed during tons refactor),
   regardless it wouldn't work now... will test later.
2005-08-11 06:44:32 +00:00
4cc96528b8 Nice time saver for Armatures: Introduced Bone type "Hinge", which doesn't
inherit pose rotation/scale from its parent pose-channel.
Button is available in Editing Buttons for PoseMode as well as EditMode.

Aim is to reduce overhead of Constraint usage (copy location).

(in object.c I removed old code for IK)
2005-07-28 10:01:10 +00:00
aefd9e462f When entering editmode on Armature, the Pose now defaults to a correct
restposition, also for deform and bone childs.
2005-07-24 15:16:37 +00:00
4d273d8d5b Armature-Pose IK goodies!
- Added option to the IK buttons, to have it use the 'tip' as end of the
  IK chain. I never really understood this old convention (IK didn't work
  on the Bone itself).
  Old files still will read OK though. But I made the "To Tip" a default
  when adding new IK constraints.

- Hotkey CTRL+I: add IK, with option to have it adding an Empty target,
  or use a selected Bone as target. With the new non-modal PoseMode, it
  gives instant access to playing with the IK chain.

- Hotkey ALT+I: clears IK, on all selected Bones

- Hotkey ALT+C: clears Constraints on all selected Bones (incl IK)
2005-07-24 11:36:05 +00:00
948f27c0d8 Killed silly modal PoseMode mode! :)
- PoseMode now is a state Armature Objects can be in. So, while in PoseMode
  for an Armature, you can just select another Object or Armature.
- The old PoseMode options (transform, insert keys etc) are accessible
  with making the Armature Object 'active' (and have object in PoseMode).
- At this moment no multiple Poses can be transformed/edited at the same
  time.
- The old hotkey CTRL+TAB, and view3d header menu, still work to set an
  Object's PoseMode

It was quite a lot recode, so tests & reports are welcome.

Oh, as a bonus I added Lasso Select for Bones in PoseMode! It selects using
only the line between root and tip of the Bone.
2005-07-23 18:52:31 +00:00
291af7418e Two small fixes (armatures);
- adding relations to pose-constraints should call DAG on the pose
- prevented constraints to break "IK" chains
2005-07-18 19:36:17 +00:00
9919df089d Third attempt to fix crash on leave editmode + delete loadsa bones! :)
Now certain pointers get cleared better, prevent reading freed data...
2005-07-17 22:15:12 +00:00
141e577353 More fixes thanks to irc testing;
- On exit editmode and after deleting bones, a pointer in PoseChannels
  was not set NULL correctly, causing potential crashes.
- Action Window: select on 'ipo key' (little icon) didn't select/deselect
  the associated bone (old bug!)
- After unlinking an Action, the blue color in bones was not cleared

Also:

- Improved selection in editmode, doing it in 2 stages. Makes it a lot more
  accurate.
2005-07-17 19:08:04 +00:00
ef73b6f140 New: B-Bones now support adjusting the 'handle length', with the values
"In" and "Out" in the new posemode Panel, editing buttons.

http://www.blender.org/cms/Armature_draw_modes.629.0.html

Fix in image.c: just an unitialized variable.
2005-07-17 08:58:42 +00:00
e67ba0ae33 More armature goodies;
The B-Bones!
(where the B can be read as 'block' or 'bezier' or 'b-spline')

- set option on/off in edit buttons, armature panel
- scaling of B-bones only works in editmode, use ALT+S to make bones fatter
  or thinner. Also works for constrainted transform
- In pose mode, you now have a buttons panel with per-bone settings too
  Here you can find the "segments" button, which allows bones to
  interpolate between previous/next bones, including roll.
- Buttons to control interpolation ("In" and "Out" are disabled, doesn't
  work satisfying yet

NOTE: this doesn't give deform yet! Main purpose for now is to test if this
drawing method serves to animate/pose armatures well.
Still need to review proper interpolation methods... maybe bezier is too
limited.
2005-07-16 19:07:02 +00:00
01daf04ea6 - Object buttons, Hooks panel, clear offset didn't redraw correct
- Particle panel was drawing in wrong size
2005-07-11 19:31:15 +00:00
a7cd780ebf Armature;
- IK constraint now uses Ipo from action again
- Bug in last commit; the object action was ignored... did NLA always

Editmesh:

- when there are edges in mesh, it now only copies selection in edges
  when you have selectmode edge
2005-07-09 20:40:44 +00:00
d7bf5c0583 New! Pose-constraint Ipos now are integrated in NLA. ALso cleaned up the
weird disabled code that was hanging out there for ages.

Also cleaned up NLA blending itself, it was copying far too much data
around. Should be three times faster or so... need good test!

And restored Action Baking.
2005-07-09 19:37:38 +00:00
30f89a6db7 Armature drawing fixes;
- Dashed line to parent bone was drawn to wrong bone in Rest Position
- Dashed line had selection color of parent, not of own bone.
2005-07-09 14:08:09 +00:00
895c9a55d8 Two small fixes;
- ALT+R clear rotation on PoseMode didn't work when an Action was assigned
- 'Delete object' didn't set object pointers to NULL for Armature/Pose
  constraints (old bug)
2005-07-07 07:03:35 +00:00
4fb314b809 Action constraint works again. Needs revision though... do that with
testfiles i get from Bassam. :)

Further removed old code that was ifdeffed hanging around still.
2005-07-04 20:09:32 +00:00
28a1e8277b Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs

A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;

- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes

Armatures;

Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!

Important to note is;

1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.

- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.

TODO NOW;

- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.

TODO LATER;

We now can do loadsa new nifty features as well; like:

- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...


Bugfixes;

- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change

-Ton-
2005-07-03 17:35:38 +00:00
d673c4a862 1) Bug fix 1776
Lattices seem to have deform lag, when they're animated with Ipos.
Found out this behaviour is already from before 2.25... solved with
removing a where_is_object() from deform code, but dont fully grasp
why.
Tested with good demo file, with motion blur too.

2) No functional changes, just made 2 files compile without warnings;

- added extra ifdefs __NLA_BLENDCON for unused calls
- removed zealot 'const' from function protos and variables, these cannot
  work there, and hence gave warnings
- added void pointer casts for array conversions in matrix code
2004-11-11 15:31:44 +00:00
1b293777b8 Brought back overkill of displist creation for armatures and deform...
Got some testfiles that I cannot get to work quickly, better do this
after release (again)
2004-10-28 21:12:26 +00:00
37f57288cb Lot of code... 2 new features:
1) Curve deform
http://www.blender3d.org/cms/Curve_Deform.392.0.html
Works simple as expected, but keep track of the rotation axis
in F7 buttons (Track X Y Z)
Only Mesh deform supported now.

Code changes:
- centralized deformation calls in curve_modifiers() mesh_modifiers()
etcetera. Here also other effects can be added like wave. Now the
evaluation order is fixed, but should become optional. It also doesnt
use the Displist anymore as deform-input. That latter part is unfinished
yet.
This code also is used for Hooks and will be needed for softbody

- made convention stricter that displists are being checked on in
drawobject(), this to prevent routines to make new displists recursively
(like armature does). Now a freedisplist() is sufficient to signal that
a new displaylist should be made.

2) Object Hooks
http://www.blender3d.org/cms/Object_Hooks.391.0.html
Support for Hooks is added to Mesh, Lattice, Curve and Surface objects.
For Armatures this would require some more work & research.
Main goal for this feature is to provide quick & simple access to the
underlying geometry in Objects on Object level, supporting hierarchies and
Ipos etc.
2004-09-14 19:03:11 +00:00
Chris Want
45a240260e Check that deformer is an armature defore updating the displists
of it's children (gives speed up for alt-A, animation rendering).
2004-05-02 22:03:22 +00:00
79d990f310 - Bug fix: MetaBalls was not polygonized, when armature (as parent of MetaBalls) was in pose mode. 2004-04-27 14:37:19 +00:00
aedf456938 - split the data structures that actually constitute a mesh
(MVert,MFace,etc) off into DNA_meshdata_types.h, to isolate areas
    of source that actually edit mesh *data* vs. areas that just edit
    mesh object information.
2004-03-20 22:55:42 +00:00
Chris Want
d311e96174 Armature speed ups, Part III
----------------------------

Another (major) armature speed up for bones with many constraints.

When tranform()-ing, figure out which bones need to be recalculated
beforehand and only update those bones.
2004-01-03 03:53:18 +00:00
Chris Want
c8a5bfc826 made verify_pose_channel() return the pose channel that is either
found or created (just removed some silly duplicated work).
2004-01-03 02:13:04 +00:00
Chris Want
c46a6de931 A fix for bug #96 (MNME's armature bug). The result of a
crossproduct was not checked for a zero vector.
2003-04-24 23:13:58 +00:00
Chris Want
c95692df7c Support for auto-skinning when parenting a mesh to an armature.
Applies to bones that do not have a boneclass of unskinnable
(set per bone in editmode in the button window).
2003-04-24 00:48:43 +00:00
d0e346d544 updated .c files to include:
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

Just need to finish cpp files now :)

Kent
--
mein@cs.umn.edu
2002-11-25 12:02:15 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00