Commit Graph

65 Commits

Author SHA1 Message Date
909fa34c5f BLI_matrix space_transform: Add a 'local-invariant' setter.
`BLI_space_transform_from_matrices()` defines a 'global-invariant' transform
(same point in global space, two different coordinates in local and target spaces).

New `BLI_space_transform_global_from_matrices()` is kind of opposite, it defines
a 'local-invariant' transform (two different points in global space, same coordinates in local and target spaces).

Useful to 'match' meshes.
2015-07-11 00:04:27 +02:00
9dadc8f599 Math Lib: add mul_v3_mat3_m4v3 2015-04-27 21:52:42 +10:00
af9da0be43 Complementary fix for rB8054372: Follow the common naming scheme by
using negate_mat3_m4 instead of negate_m4.

This avoids changing the behavior and only flips the 3x3 part of the
matrix.
2014-10-30 15:31:18 +01:00
c2dc51d827 Math Lib: add transpose_m3_m3, m3_m4, m4_m4 2014-10-30 12:15:14 +01:00
8054372d22 Fix negate_m3 (taking 4x4 matrix)
Cycles bake used incorrectly.
2014-10-30 10:29:37 +01:00
775a54485b Math Lib: add mul_v3_project_m4_v3 2014-09-16 15:41:17 +10:00
671f75a12a Math Lib: Add copy_m2_m2, unit_m2, zero_m2 2014-09-06 11:29:27 +10:00
3c9e11df37 Cleanup: Move SpaceTransform helpers from BKE_shrinkwrap to BLI_math_matrix. 2014-08-01 16:31:06 +02:00
8489b94e07 Math Lib: rename mul_serie_m3 to mul_m3_series & reorder args
Importantly, reversed mul_serie_m3 argument order (so it matches the m4 function)
2014-07-21 18:57:35 +10:00
7c7b7302d3 Math Lib: use variable length args for mul_serie_m3,m4 (instead of trailing NULL's) 2014-07-20 14:01:42 +10:00
1b76c638ad Code cleanup: remove MAT3/4_UNITY defines, just call unit_m3/4 2014-06-26 16:09:59 +10:00
b2cad79500 Math lib: add negate_m3, negate_m4 2014-05-30 00:26:32 +10:00
Dalai Felinto
7f089afc8b Bake-API: relaxing in the check for scale uniformity
It still warns the user that there may be an error, but the baking goes
on. Also using the new is_uniform_scaled_m4() instead of float comparison.

Reported and fix suggested by Campbell Barton as a concern over 2bfc3deb
2014-05-22 21:35:58 -03:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
a6e8137983 Convenience macro for print_ funcs, saves passing id each time 2014-03-30 15:04:20 +11:00
d4cc81d552 Fix T38870: Freezes when jumping in front of a keyframe.
Issue was caused by inverting a degenerate matrix when
evaluating drivers.

Solved by using tweaked inverse code (same as used in Cycles).

Should have no affect on cases when matrix is not degenerate.
2014-03-25 16:07:13 +06:00
99d050f88b Text3d: selection in editmode now follows rotated text along path 2014-01-05 22:20:33 +11:00
a304b5a988 correct typo 2013-10-25 22:12:05 +00:00
e9d5e9813c Code cleanup: added generic function copt_m3_m3d 2013-10-20 12:08:51 +00:00
fc8b0ed5e5 Move utility functions from mball to mathutils 2013-10-18 23:38:51 +00:00
9b09af0dca Fix #36701: Mask pivioting doesnt honor parenting
Made mask transformation aware of parent matrix.
2013-09-11 10:06:54 +00:00
76e989d7b1 function renaming for own recently added BLI_math functions, suggested by Brecht. 2013-07-30 10:58:36 +00:00
5dc3cfc983 fix [#36282] Spin error with non uniform scale
add support for passing object matrix to bmesh transform operators.
2013-07-26 11:15:22 +00:00
29df776b89 optimization: call one bmesh operator for rotate (not 3).
added pivot_m4() utility function since rotating about an arbitrary point is handy.
2013-07-26 06:12:49 +00:00
ec8d277c64 BLI_math rename functions:
- mult_m4_m4m4 -> mul_m4_m4m4
- mult_m3_m3m4 -> mul_m3_m3m4

these temporary names were used to avoid problems when argument order was switched.
2013-05-26 18:36:25 +00:00
89c8de1f48 add matrix multiply for projection that outputs 2d values. 2013-05-08 12:55:36 +00:00
4a7feafa49 Support object scale for mesh display options. (currently only uniform scale for thickness test) 2013-04-17 23:30:19 +00:00
ae58968e0a Blender Internal Render in viewport
Because of our release soon, feature has been added behind the Debug Menu.
CTRL+ALT+D and set it to -1. Or commandline --debug-value -1.

When debug set to -1, you can put the viewport to 'render' mode, just like
for Cycles. Notes for testers: (and please no bugs in tracker for this :)

- It renders without AA, MBlur, Panorama, Sequence, Composite
- Only active render layer gets rendered. Select another layer will re-render.
- But yes: it works for FreeStyle renders!
- Also does great for local view.
- BI is not well suited for incremental renders on view changes. This only
  works for non-raytrace scenes, or zoom in ortho or camera mode, or for 
  Material changes. In most cases a full re-render is being done.
- ESC works to stop the preview render.
- Borders render as well. (CTRL+B)
- Force a refresh with arrow key left/right. A lot of settings don't trigger
  re-render yet.

Tech notes:

- FreeStyle is adding a lot of temp objects/meshes in the Main database. This
caused DepsGraph to trigger changes (and redraws). I've prepended the names
for these temp objects with char number 27 (ESC), and made these names be
ignored for tag update checking.

- Fixed some bugs that were noticable with such excessive re-renders, like 
  for opening file window, quit during renders.
2013-04-16 17:39:20 +00:00
fcbd9c3a33 Old bug fix: Uv smart stitch failed to detect angle if islands were
rotated close to 180 degrees and there were edges both below and above
the 180 degree threshhold. Separating and averaging the negative and
positive angles seems to solve the issue making the tool a bit more
robust ;)
2013-02-11 22:52:13 +00:00
2eab18dc32 code cleanup: use const for matrix functions vector args. 2013-02-09 07:14:42 +00:00
2b875a947f skip calculating the normal for each face when triangulating, all callers make sure its valid. also remove some commented code (more then one generation of bmesh old). 2013-01-29 15:05:23 +00:00
e83e3b0cf7 math: Add functions to decompose transformation matrices
mat4_decompose() is similar to mat4_to_loc_rot_size() but returns
rotation as quaternion.
mat4_to_loc_quat() just returns location and rotation without size.
2013-01-23 05:56:05 +00:00
071a43f754 Fix #33497: seting object scale to 0 on one axis made moving verts in edit mode
impossible. In this case matrix inversion failed and didn't give a useful result.
Now it falls back to a pseudoinverse in that case, so that moving along the
other axes still works.

There may be other places that can benefit from this, but this is a place where
it has no significant performance impact, doing this in general for e.g. bone
matrices could be quite slow.
2012-12-14 21:41:22 +00:00
7c699a217a define the size of matrix args for both rows/cols. 2012-12-11 14:29:01 +00:00
2bb174cfa4 style cleanup: indentation 2012-11-09 09:33:28 +00:00
f727448e10 fix [#33106] Decimate modifier/collapse give bad result
FLT_EPSILON was too small to use when checking if the edge collapse result is an error.

add invert_m3_m3_ex(), invert_m3_ex() functiosn which take an epsilon to check the determinant, saves calculating it twice per edge collapse.
2012-11-07 09:28:59 +00:00
dbb40e805d py api: add mathutils.Matrix adjugate(d) methods, also add adjoint_m2_m2() to BLI_math_matrix 2012-10-29 03:36:55 +00:00
9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00
6527f42b6b Fix #31193: Normals don't have any Z component
Issue was caused by heavily non-uniform scale applied on object.
Run scale correction on face and vertex normals draw if there's non-uniform scale.
2012-05-01 11:01:24 +00:00
26b0255049 Fix for is_orthogonal check which in fact was checking for orthonormal matrix.
Separated it into two functions so now it'll be clear if check happens for
orthonormal or just orthogonal.
2012-04-01 00:14:41 +00:00
c6d80d1db1 Fix ##30455: Orthographic grid alignment jumps/shifts when zooming
Issue was caused by precision errors with floats.
Made internal grid drawing stuff using doubles and also added some
functions to multiply double vector by float matrix which also makes
all intermediate calculation in doubles.
2012-03-08 11:57:51 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
3311164b24 Math lib: matrix multiplication order fix for two functions that were
inconsistent with similar functions & math notation:

mul_m4_m4m4(R, B, A) => mult_m4_m4m4(R, A, B)
mul_m3_m3m4(R, B, A) => mult_m3_m3m4(R, A, B)

For branch maintainers, it should be relatively simple to fix things manually,
it's also possible run this script after merging to do automatic replacement:
http://www.pasteall.org/27459/python
2011-12-16 19:53:12 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
e16ba13251 use vector size and const args where possible (no functional change) 2011-09-12 13:00:24 +00:00
Lukas Toenne
8e0fe8bff7 Merged the particles-2010 branch with node improvements into trunk.
This branch adds mostly organizational improvements to the node system by renaming the node folders and files. A couple of internal features have been added too.
Detailed information can be found on the wiki page:

http://wiki.blender.org/index.php/User:Phonybone/Particles2010
2011-09-05 21:01:50 +00:00
2999d0fad9 rename mul_project_m4_v4 to mul_project_m4_v3. 2011-05-20 10:09:03 +00:00
Nathan Letwory
b97ad119b9 doxygen: add blenlib under core as module. 2011-02-18 13:58:08 +00:00
86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00