Commit Graph

49608 Commits

Author SHA1 Message Date
Bastien Montagne
65a80708d4 Fix T46010: Bone offset between Rest Pose and Edit mode.
That one was hairy... To summarize:
* We were setting Bone.head/tail (aka **local** rest location of bone) from EditBone data, using **EditBone's parent computed armature space**.
* We use those local head/tail to define Bone's restpose (in `BKE_armature_where_is_bone()`), using **Bone's parent armature space** (aka parent's arm_mat).
* Because of bone's roll nightmare, the two above parent's matrices will often not be the same.
  In an ideal world, this should not affect locations (head/tail), but in real world of float it does - noticeably, in some extreme cases.

So! This commit cleans up things a bit (`fix_bonelist_roll()` was already doing much more than just fixing roll mess, has been renamed
to `armature_finalize_restpose()`), and ensures we do use (final!) parent's arm_mat local space to compute children's local head/tail as well.
This allows us to avoid too much imprecision here.

Checked the patch also with a complete Victor's rig from Gooseberry, seems to have no nasty side effects - fingers crossed!
2015-09-04 16:50:29 +02:00
Bastien Montagne
c882cbd37c Cleanup: Better to assert over bad condition (which shall never happen anyway), than just return with un-initialized mat... 2015-09-04 16:50:29 +02:00
Campbell Barton
39752eb912 Fix for isect_tri_tri_epsilon_v3 w/ small faces
tris with ~1e-05 edge lengths would fail
2015-09-04 22:29:12 +10:00
Campbell Barton
1d71ad2eaa Math Lib: Use plane intersect from graphics-gems 2015-09-04 22:13:20 +10:00
Campbell Barton
d0e7ba3fd1 Math Lib: avoid sqrt w/ triangle intersection 2015-09-04 22:06:36 +10:00
Campbell Barton
2ea96df159 Correct own error in line_point_factor
Passing zero epsilon allowed divide by zero.
2015-09-04 22:06:36 +10:00
Bastien Montagne
f79c748246 Armature: Cheap edit-to-object mode speedup.
`fix_bonelist_roll()` is already recursive, and was calling recursive `BKE_armature_where_is_bone()` twice!

Changed `BKE_armature_where_is_bone()` to controll whether we recurse over children or not.

With full Victor's rig, we gain 16% in `ED_armature_from_edit()` (from 31ms to 26ms).
With a dummy test-case 100 bones chain, we gain 80% in `ED_armature_from_edit()` (from 1.25ms to 0.25ms).

Not crucial, but still worth it. ;)
2015-09-04 12:26:52 +02:00
Campbell Barton
3e63c604e3 Partial revert of warning cleanup
These warnings are false-positives
2015-09-04 14:40:03 +10:00
Julian Eisel
ef629e0d50 Quiet warnings
We had too many warnings lately... was awaiting that someone would kill them - didn't happen -> goes to my commit ratio! :P
2015-09-04 01:04:37 +02:00
Campbell Barton
c3fef001ee View-Selected: use custom bones boundbox
Support using custom pose-bone transform and object when calculating view bounds.
2015-09-04 04:23:18 +10:00
Campbell Barton
54ad576666 Small tri intersect fails when not normalized
Logic was ok, but would run into precision issues.
2015-09-04 01:59:44 +10:00
Howard Trickey
10c93a582b Check for no-op edge separates to quiet asserts when inset individual.
This causes no change in behavior, since code was alreadying doing
a no-op in bmesh_edge_separate if the edge is a boundary.
But it tripped an assert, annoying in debug builds.
We want to leave assert in bmesh_edge_separate in case callers
expect there to be separate loops after this always.
So putting test in caller.
(Same worry about bmesh_urmv_loop? I checked callers and they
appear OK to me - they deal with the no-op return.)
2015-09-03 10:42:16 -04:00
Bastien Montagne
e5e65b1099 Fix T45984: Setting custom normals properly requires multiple calls to normals_split_custom_set()
The detection of needed sharp edges (based on given loop normals) would not fully work
on first run in case we started with a complete smooth cyclic loop fan (edge between
first and last loop of the fan would not get checked).
2015-09-03 12:20:50 +02:00
Sergey Sharybin
8e75abd29a ImBuf: Fix crash generating preview for really huge image
In fact, any user of IMB_scalefastImBuf() is now robust against working
with really hires images.
2015-09-03 12:49:04 +05:00
Sergey Sharybin
2ed4f98548 Compositor: Support changing distortion models in movie distortion node
Previously only polynomial model worked correct. now changing it to divisions
will work nicely as well.
2015-09-03 12:19:47 +05:00
Campbell Barton
6789d02112 Fix T45959: DistanceKey preview used wrong colors
Same issue as recent fix in ChannelMatte
2015-09-03 12:28:27 +10:00
Campbell Barton
46d731612d Animplayer passed -a, then warned its unknown
Also modify a copy of argv
2015-09-03 04:27:44 +10:00
Campbell Barton
1f16b3280f Fix T45979: animplayer crashes w/ DND and audio
Issues re-initializing audaspace
2015-09-03 04:15:08 +10:00
Sergey Sharybin
390bc05b32 Fix second part of T45987: Node preview was still using wrong color space 2015-09-02 22:46:06 +05:00
Bastien Montagne
c8cc664ce3 Fix T45995: Auto-set preview range sets superfluous end key.
get_keyframe_extents() would add an extra frame in case of mono-key fcurves in selected set...

Now do the 'not same start/end frames' check later, and also use floor/ceil instead of round
(we want to start at frame 3 if first key is at frame 3.8, reversed-same goes for end frame).
2015-09-02 17:50:55 +02:00
Campbell Barton
5671611c40 CMake: use generator expressions 2015-09-03 01:26:28 +10:00
Campbell Barton
6f5d1e257e Add missing spin-lock to IMB_makeSingleUser 2015-09-02 23:23:44 +10:00
Bastien Montagne
525d7e02d4 Fix T45991: Transfer Weight tool UI is inconsistent and crashes blender.
Since data transfer when called from this tool has reversed behavior (it transfers **towards**
active object, as previous tool), we have to also reverse source/destination layers selection options.

Also fix 'reverse' option being saved, otherwise calling regular operator after 'transfer weights'
would stay in reverse mode, ugly!
2015-09-02 13:10:29 +02:00
Campbell Barton
5fe9b36aa6 Cleanup: style 2015-09-02 18:39:19 +10:00
Campbell Barton
41b99e40c0 b5287b1 removed important CCG_key_top_level call
Caused subsurf to crash w/o OSD
2015-09-02 15:39:17 +10:00
Campbell Barton
f6e0262a83 Enable guarded-alloc when --debug-all is passed 2015-09-02 13:41:12 +10:00
Campbell Barton
b3e1edf7f8 Correct help message for debug options 2015-09-02 13:38:55 +10:00
Campbell Barton
881047de88 Fix snapping edit-gpencil to edit-mesh
Reported in T45978

Was checking mesh selection state.
2015-09-02 11:29:04 +10:00
Bastien Montagne
a2714c9e4f RNA PreviewImage: add float pixels accessors.
Raw int pixels can be nice in some cases (much less memory used), but converting to/from float values
(as e.g. expected by/from Image) is not simple in py, error prone and rather slow.
2015-09-01 19:15:06 +02:00
Antony Riakiotakis
b5287b1b81 Avoid reupdating pbvh data in upload functions, these should have been
taken care of in draw functions.

Those iterate the whole PBVH tree so better avoid doing them, twice or
thrice.
2015-09-01 19:56:32 +03:00
Campbell Barton
45eb406748 Fix T45978: Ruler ignores new edit-mesh data 2015-09-02 02:28:16 +10:00
Campbell Barton
312cb0a957 Fix T45974: Bones fail to snap to verts
Was an issue with individual-origins + snap
2015-09-02 01:34:03 +10:00
Campbell Barton
ef931fecc3 Fix uninitialized normal var w/ objects snapping 2015-09-02 01:25:13 +10:00
Campbell Barton
2fcc38ad54 Assert vec_roll_to_mat3_normalized's gets a normalized vector 2015-09-02 00:43:53 +10:00
Antony Riakiotakis
282811f8b8 Fix projection painting normal culling operating on individual
triangles.

This made the normal-related artifacts of projection painting much more
apparent. Now we do culling based on
whole polygons. Pure backface culling still uses individual
triangles.
2015-09-01 16:00:07 +03:00
Sergey Sharybin
a660f27527 Don't use GCC-only pragma for all compilers 2015-09-01 17:40:10 +05:00
Campbell Barton
1140238acf Fix T45976: Crash accessing BMesh customdata
Layers returned from items() and values() could have an invalid index.
2015-09-01 19:59:26 +10:00
Sergey Sharybin
55f87590f0 Depsgraph: Fix compilation error with legacy depsgraph disabled
Reported by Campbell on IRC, partial patch by him as well.
2015-09-01 14:48:08 +05:00
Campbell Barton
74fae33ee5 Fix T45825: Macro redo disable options incorrectly
A non repeatable operator would disable editing options for all operators after it.
2015-09-01 18:43:29 +10:00
Campbell Barton
9304df5182 Fix T45939: Crash w/ BMesh.*.sort() 2015-09-01 16:07:34 +10:00
Campbell Barton
6db978f6d1 BMesh: add asserts for BMesh sort ghash lookups 2015-09-01 15:43:49 +10:00
Campbell Barton
a7b349d03c Cleanup: redundant cast 2015-09-01 15:01:13 +10:00
Campbell Barton
c86a519898 Use qsort_r for BMesh Py API 2015-09-01 13:56:08 +10:00
Bastien Montagne
b3f4bf87b4 Trade-marked BPlayer Fix (c) 2015-08-31 22:03:51 +02:00
Antony Riakiotakis
333feea6e9 Fix T45258, impossible to select brush when removing it from 2d
painting.

Also system added a brush every time it found no paint brush in the
system which is not what we would want.

Solution:
* Brush panel stays visible always, regardless of whether there is a
brush or not.
* We search for first available brush when we find no brush in paint
struct instead of always generating a new one.
* Generating and searching for a brush take a mode argument now. Needed
some refactoring to users of BKE_paint_init as well.
* Did some style cleanups for paint mode enums.

Patch is big but it's mostly argument refactoring.
2015-08-31 22:00:30 +03:00
Campbell Barton
0018483dfa error in last commit 2015-09-01 03:02:14 +10:00
Campbell Barton
705776db1f Fix T45954: Inset w/ interpolated vertex color
Accumulating ubyte color was overflowing.

Thanks to @mont29 for suggested fix.
2015-09-01 02:51:30 +10:00
Campbell Barton
929db33828 Write thumbnail directly
BlendThumbnail matches the on-disk format, so just write directly.
2015-09-01 01:52:27 +10:00
Campbell Barton
5f64b77ca5 Fix T45955: Python's pdb can't show script source 2015-08-31 23:41:13 +10:00
Campbell Barton
a603a3470c Revert fix for T45849 (part 2, tsk!) 2015-08-31 22:47:14 +10:00