From BlenderWiki

< Dev:Ref | Release Notes | Animation | Armatures
Revision as of 00:57, 2 March 2009 by Terrywallwork (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[edit] 2.40 Release

[edit] IK WORK

[edit] NEW IK work

 First commit of Brecht's new IK work. This only does the IK module.
 Full logs for changes will be added later. Worth to note now;
 - support for 'tree IK' added
 - DOF and stiffness per IK bone (in pose only)
 - Orientation IK support (target rotates -> chain follows)
 
 Here's how IK works now;
 
 - IK chains can go all the way to the furthest parent Bone. Disregarding
   the old option "IK to Parent" and disgregarding whether a Bone has an
   offset to its parent (offsets now work for IK, so you can also make
   T-bones).
 - The old "IK to Parent" option now only does what it should do: it denotes
   whether a Bone is directly connected to a Parent Bone, or not.
   In the UI and in code this option is now called "Connected".
 - You can also define yourself which Bone will become the "Root" for an IK
   chain. This can be any Parent of the IK tip (where the IK constraint is).
   By default it goes all the way, unless you set a value for the new IK
   Constraint Panel option "Chain Lenght".
 - "Tree IK" now is detected automatic, when multiple IK Roots are on the
   same Bone, and when there's a branched structure.
   Multiple IK's on a single chain (no branches) is still executed as usual,
   doing the IK's sequentially.
 - Note: Branched structures, with _partial_ overlapping IK chains, that don't
   share the same Root will possibly disconnect branches.
 - When you select a Bone with IK, it now draws a yellow dashed line to its
   Root.
 - The IK options "Location Weight" and "Rotation Weight" are relative,
   in case there's a Tree IK structure. These weights cannot be set to
   zero. To animate or disable IK Targets, use the "Influence" slider.
 - This new IK is backwards and upwards compatible for Blender files.
   Of course, the new features won't show in older Blender binaries! :)

[edit] Degrees of Freedom (Rotation Limits)

 First version of visualizing the DoF (french degrees!) for Pose-bones. It
 now only draws the limits for X and Z rotations (Y is bone axis itself).
 
 It only draws for selected Bones that are part of IK, and have limits set.
 Most work was getting code OK to setup drawing this 'DoF space', so now
 experiments can be done with more drawing types.
 
 ALso; Buttons for DoFs now only draw if the pose-bones are part of an IK
 chain.
 - Changed xz limit drawing to use same formulas as the limiting in the IK
   module -- the previous method could be off pretty far.
 - Added drawing of transparent surface for it, instead of just the border.
 - Added "stretch IK", allowing bones not only to rotate, but also scale.
   The "Stretch" value below the DoF buttons is used to enabled this.

[edit] Floor constraint

 Roland Hess' Floor Constraint patch:
 https://projects.blender.org/tracker/?func=detail&aid=2993&group_id=9&atid=127

[edit] Rotation constraint

 allows to only copy X,Y,Z axis rotations.
 
 Note this is based on eulers, so might give the common issues. :)
 For most cases it goes fine though, especially with only 1 axis constraint.

[edit] hotkey for add constraints

 New: Hotkey/menu access in 3D window to add constraints. Works in PoseMode
 as well as for Objects. Hotkey: CTRL+ALT+C (bit clumsy I know, but I like
 to use the Ckey).
 
 Constraints are added to the active Object or Bone.
 Based on selection context, the menu has three versions:
 
 Pose Mode:
   - if another bone is selected, bone becomes target
   - else if another Object is selected, Object becomes target
   - else it adds a new Empty as target
 Object Mode
   - if another Object is selected: Object becomes target
   - else it adds a new Empty as target
 
 Same works this way now for CTRL+I, "Add IK".
 
 To be solved: ALT+C in PoseMode is "Clear Constraints", but in Object Mode
 it does "Convert" still...

[edit] Targetless IK

 Two new IK features.
 
 1) Target-less IK
 
 If you add an IK constraint without a target set (no object or bone target),
 it now can be grabbed and moved with IK, using its own Bone tip or root as
 target itself. This way you can use IK for posing, without having the IK
 executed while it animates or while a Pose is being solved for real IK.
 
 After grabbing "Target-less IK", it applies the resulted motion in the
 pose-channels, which then can be used to insert keypositions.
 
 The Target-less IK bone can still be rotated without IK, also its chain
 can be edited as usual.
 
 UI: The CTRL+I menu gives this as an option too. In the 3D window it is
 drawn with orangish color.
 
 Note that IK is not resistant to non-uniform scaling yet.

[edit] Auto IK

 2) Auto-IK
 
 When the option "Automatic IK" is set, in Edit Buttons Armature Panel,
 it creates automatic temporal Target-less IK for the Bone you grab or
 translate.
 
 The rules are:
 
 - it only works when a single Bone is selected
 - if the Bone is a root bone (no parent), it adds IK to the end of the
   chain(s)
 - otherwise it adds the IK to the active Bone
 - the temporal IK chain only consists of connected Bones.
 
 This method is still a bit experimental. Maybe it should become a special
 grabbing option (like SHIFT+G in Pose Mode). It also only works OK for rigs
 that fit for it well... when a rig already is fully setup with IK it can't
 do much good. :)


[edit] Armature and Animation Coder Notes

 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!
 The huge commit is caused by cleaning up globals from struct Global. Many
 variables were unused or just not needed anymore. Did that to move the ugly
 G.zbuf to where it belongs, in the View3D space struct. :)
 What changed in IK lib:
 
 Fully restructured, with components now as follows:
   - IK_Solver: C <=> C++ interface
   - IK_QSegment: base class for bone/segment with 0
     to 3 DOF
   - IK_QTask: base class for a task (currently there's
     a position and a rotation task)
   - IK_QJacobian: the Jacobian matrix, with SVD
     decomposition, damping, etc
   - IK_QJacobianSolver: the iterative solver
 
 The exponential map parametrization is no longer used,
 instead we have now:
   - 3DOF and 2DOF XZ segments: directly update matrix
     with Rodrigues' formula
   - Other: Euler angles (no worries about singularities
     here)
 Computation of the Jacobian inverse has also changed:
   - The SVD algorithm is now based on LAPACK code,
     instead of NR, to avoid some problems with rounding
     errors.
   - When the problem is underconstrained (as is the case
     most of the time), the SVD is computed for the transpose
     of the Jacobian (faster).
   - A new damping algorithm called the Selectively Damped
     Least Squares is used, result in faster and more
     stable convergence.
   - Stiffness is implemented as if a weighted psuedo-inverse
     was used.
 Tree structure support.
 
 Rotation limits:
   - 3DOF and 2DOF XZ segments limits are based on a swing
     (direct axis-angle over XZ) and twist/roll (rotation
     over Y) decomposition. The swing region is an ellipse
     on a sphere.
   - Rotation limits are implemented using an inner clamping
     loop: as long as there is a violation, a violating DOF
     is clamped and removed from the Jacobian, and the solution
     is recomputed.
 Most work was on trying to unwind the spaghetti for editing ipos. Too much
 history and bad design got added here. Most evident changes:
 - made generic 'context' for detecting which Ipo is being edited, or to
   assign ipos or to retrieve ipo curves.
 - made generic insertkey() for all ipo types, including actions
 - shuffled a lot of code around to make things more logical. Also made
   sure local functions are not exported
 
 The implementation is based on a 8x8x8 Octree, where vertex locations are
 stored. Vertices on the threshold boundary of an Octree node are filled in
 the neighbour nodes as well, ensuring that the lookup works with threshold.
 The current size of the Octree gives good speedup, even for 128k vertices
 it only needs 256 lookup cycles per checked vertex.
 Same code could be used for the bevel tool for example.
 
 src/meshtools.c:
 int mesh_octree_table(Object *ob, float *co, char mode)  
 - mode 's' or 'e' is "start octree" or "end octree"
 - mode 'u' is "use", it then returns an index nr of the found vertex.
   (return -1 if not found)
 Various stuff in one commit;
 
 - Added (BKE_utildefines.h) POINTER_TO_INT(poin) and INT_TO_POINTER(int)
   defines, to help fixing issues with switch to 64 bits systems. This
   assumes that a) not more than 16GB mem is used and b) that address
   space is below the 1<<35 value. The latter has to be confirmed, but it
   seems to conform the current 64 bits generation of OSs (for mallocs).
 
   Needless to say; use long if you want to store pointers! This is for
   temporal fixing.
 
 - Added editmesh version for mesh-octree lookups, not used yet.
 
 - Better Matrix to Eul, code submitted by Brecht. No time yet to do it
   really nice (like a Mat3ToEulCompat(mat, eul, eulc))


[edit] Dependency Graph

This section is all about things that have gone on 'under the hood' stuff that will be of interest to open source developers, but not to the typical end user.

http://blender.org/cms/Dependency_Graph.633.0.html

 New button type: ROUNDBOX This replaces drawing with uiRoundBox()
 or glRect() in button Panels.
 Done Modifier and Constraints.
 
 Syntax:
 
 The last 4 free variables in the uiDefBut() call are:
 - float, corner-rounding (0.0-pixels),
 - not used,
 - short: roundbox type (bits, 1 2 4 8 for clockwise corners starting left/top)
 - short: color shade offset (color range 0-255)

[edit] Boundbox select

 Boundbox select object mode optimisation.
 
 Changed selectprojektie (and renamed to view3d_opengl_select as suggested by Ton)
 to accept a buffer size, so boundbox can adapt it's buffer size to the number of object
 in scene. Also, the loop is done more smartly, since glSelect fills the buffer in the same 
 order as the drawing order, so we save lops of looping on unselected object (which used
 to go through all the buffer before finding that they weren't selected).
 
 This scheme could probably be applied to all the other loops using glSelect. (good project
 for newbie coders)


[edit] button code cleanup

 LetterRip
 Log:
  - got rid of silly #define ..._BIT, #define ... (1<<..._BIT) stuff
  - switched almost all uiDefBut(..., TOG|BIT|..) to use UiDefButBit and the
    name of the actual bit define instead of just a magic constant, this makes
    searching the code much nicer. most of the credit here goes to LetterRip
    who did almost all of the conversions, I mostly just checked them over.