-----
Bugfixes for #6816 and #6988: Under Windows, Blender would crash if boolean
operations were done on objects which resulted in an empty mesh. Problem was
"iterators" created for ConvertCSGDescriptorsToDerivedMesh() tried to access
invalid memory.
In this commit, a new way to set the bone roll is introduced. It aligns the z-axis of the selected bone(s) to the 3D-Cursor, so that the cursor intersects with the YZ plane.
This makes it easier to align bone rolls to a target, for use in rigs where arms/legs are not horizontal/vertical. To use this, just press Ctrl N, and choose the "Align Z-Axis to 3D-Cursor" option.
Credits go to Robert Christian (wavez) for providing the method as a working BPy script, that demonstrated this in action.
* Now, when X-Mirror is turned on for the armature, the roll from bones being 'rolled' is also mirrored.
* Disabled transform-constraints for this mode, as it didn't really make sense.
Now the Outliner can be scrolled horizontally too. This was the first patch I ever submitted, but it's gone through many revisions due to ugly Blender bugs that needed to be fixed.
Code Notes:
* I discovered an ancient bug which would cause Blender to hang when loading a file saved with horizontal scrollbars turned on for the Outliner/OOPS.
* Therefore, I've added special B_SCROLLO and HOR_SCROLLO defines for use by the Outliner only. These are used in place of B_SCROLL and HOR_SCROLL so that older Blender's won't choke on this stuff. Thanks for this suggestion Ton.
* The hanging occurred in draw_scroll in draw_ipo.c
Recent font preview commit didn't have the proper enclosing #ifdef INTERNATIONAL
blocks. Honestly, I have no idea why we bother, but added them anyway.
===============================
This is a new armature deform interpolation method using Dual Quaternions,
which reduces the artifacts of linear blend skinning:
http://www.blender.org/development/current-projects/changes-since-244/skinning/
Based on the paper and provided code:
Skinning with Dual Quaternions
Ladislav Kavan, Steven Collins, Jiri Zara, Carol O'Sullivan.
Symposium on Interactive 3D Graphics and Games, 2007.
This code was always kludgy and this clean it up a bit.
insertmatrixkey() has been properly renamed insertkey_float().
Matrix calculations have been excised from the interface code,
and placed in insertmatrixkey(), so that you can call it from
anywhere without preliminaries and the proper values are calced
based on the passed adr code.
By much request, several semi-bug reports and discussion with
production animators, visual keying is now used automatic
for objects and bones that have constraints that cause them
to ignore their Ipos (CopyLoc, TrackTo, etc.). In those cases,
visual keying is used instead of the normal Ipo insertion
method. This "auto" functionality is toggled from the
"Use Visual Keying" button found along with "Needed" and
"Available" in the Edit Methods prefs.
Logic as to which constraints trigger visual keying on
which adrcodes can be tweaked in match_adr_constraint()
src/editipo.c
This has been tested by a couple of people, myself included,
but I may not have hit every constraint case, so evolutionary
feedback is welcome.
* Swapped the order of the CSpace menus. This is so that it makes more sense with the Transform Constraint, to follow a source (target) -> destination (owner) flow.
* 'Local Space' option for Objects has been renamed 'Local (Without Parent) Space'
Previous bugfix of spec not being included in only shadow lamps had 2 errors.
There weren't any checks for if shi->spec and shi->shad go below 0 because of
an only shadow lamp, and also the code for including spec in only shadow lamps
was slightly wrong.
* Transform Constraint should now work in more cases. Somehow the old code (for location case) wasn't working correctly.
* ChildOf Constraint applied on objects, should now get the right 'inverse'/'offset' matrix set. It now uses the same code that is used by Blender's parenting method to do so.
===============================
An improved CrazySpace correction is now used for Armature modifiers that use
vertex groups, and that are the first enabled modifiers in the stack. This is
a a specific case, but also a common one.
http://www.blender.org/development/current-projects/changes-since-244/skinning/
Implementation Notes:
- The quaternion crazyspace correction is still used for modifiers other than
the armature modifier.
- Modifiers can now provide a deform matrix per vertex to be used for
crazyspace correction, only the armature modifier implements this now.
===================
This is a new automatic vertex weighting method, next to the existing
envelope based method. The details are here:
http://www.blender.org/development/current-projects/changes-since-244/skinning/
This is based on section 4 of the paper:
"Automatic Rigging and Animation of 3D Characters"
Ilya Baran and Jovan Popovic, SIGGRAPH 2007
Implementation Notes:
- Generic code for making mesh laplacian matrices has been added, which
is only used by bone heat weighting at the moment.
- Bone to vertex visibility checking is done with the raytracing code.
- Fixed an issue in the subsurf limit calculation function, where the
position of vertices on boundary edges was wrong. It is still not the
correct position, but at least it's in the neighbourhood now.
At last, the 'Local' option for Armatures works properly!
Tonight I went through carefully and cross-checked the code once again, and found several bad mistakes I had made. These were:
* the value of one variable from the armatures code was not what I expected it to be, based off the name).
* Mat4MulSerie swaps the first two args! Grrr...
Note:
There's only one rig that I've tested that was broken. That was slikdigit's "mancandy", and the part in question was the jaw. It is likely that a few more rigs out there (in particular, their 'local' action constraints) relied on the wacky rotation values that used to be used, so are now broken.
sceneSequence.h - bad type check, dosnt matter really since that define isnt used yet.
SurfNurb.c - was using lib hashing function and surfNurbs not a lib! (own mistake)
buttons_editing.c - Curves PathLen button was MAXFRAMEF and pathlen is a short so the button wrapped around.
caused errors on only shadow lamps; fixed this by adding back in the original
intensity > 0.0 check in the only shadow if statement, where it belonged in the
first place.
In addition, the specular pass was not correctly affected by only shadow lamps,
severely reducing the usefulness of this feature. For example, using four
spotlamps to create an omnidirectional buffered shadow lamp didn't work.
This commit fixes the Draw module. All buttons/widgets created via the Draw
module in a SpaceScript area are now inserted into a global list attached to
the SpaceScript data. This list is cleared before each draw, when freeing
the space, and when the area is switched to another space.c
This is necessary to prevent Blender's internal UI code from getting invalid
pointers to python data. In addition, it allows storing widget tooltips
inside the python Button objects, which solves that little bit of stupidity.
Note that this reverts the previous weaklist solution. In fact, I had to go
over each previous commit by Campbell after this code originally branched
before the weaklist commit and re-add each commit. So if anything is
missing, just tell me, or feel free to re-add it.
two separate files, raytrace.c and rayshade.c. The tracing code can now
be used separately from the renderer (will be used in a later commit),
and the raytracing acceleration structure can now also be easily replaced,
if someone wants to experiment with that.
This fixes a bug reported in IRC. getParentBoneName() was returning a string (most likely from an old bone-parent that got removed), even when the parent wasn't an Armature.
Tracking is now tempolarily disabled while an object matrix used for space conversions stuff is calculated. This used to be done before the constraints recode.
Now PoseBones should transform normally again with constraints applied and in other cases. I've gone back to the old code that used to be there before the recode, and added the constraint inverse (as appropriate) into that.
* Reverting a previous commit where I wrongly assumed that the code was not doing things the right way. This makes a few cases work better normally again.
* Object-level Transforms should now perform normally again. Now, transforms are only get inverse-corrected for constraints if certain constraints are the first 'active' constraint.
* PoseBone-level Transforms still need to be fixed, although I might have done a few tweaks here.
* Action constraints on some older files (namely mancandy) should now get correctly loaded. Wrong check for subversion number was being used
* Removed unneeded version patches