Commit Graph

46 Commits

Author SHA1 Message Date
549b5e1222 Fix/change in normal computation, now the viewport uses the same angle
weighted normals as the render engine, and the render engine will copy
normals from the mesh rather than always recalculating them.

Subsurf/multires still use regular vertex normals, but they are expected
to be sufficiently high resolution to not need this.

This means that normal maps displayed in the viewport actually match the
render engine exactly and don't have artifacts due to this discrepancy.
It of course also avoids unexpected surprises where your render normals
look different than your viewport normals.

Subversion bumped to 4 for version patch to recalculate normals.

Patch by Morten Mikkelsen, with some small changes.
2011-03-20 13:35:35 +00:00
Nathan Letwory
7900b5949f doxygen: blender/blenlib tagged. 2011-02-27 20:37:56 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
0955c664aa fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +00:00
691f2abad1 fix [#25684] Grease pencil strokes with "Surface" option attach erratically to curves.
added new functions
- view_autodist_depth_segment()
- plot_line_v2v2i(), which takes a callback and plots x/y points.
2011-02-02 03:32:58 +00:00
fd448bcfc7 remove/comment unused defines, also zero FileGlobal.filename to quiet valgrind. 2011-01-16 21:12:38 +00:00
3b74074aec remove unused code & variables. 2011-01-08 12:43:44 +00:00
89c9aaaa25 remove references to BKE_utildefines where its not needed.
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
2011-01-07 19:18:31 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
28e689b9aa bugfix [#25498] Projection paint clone tool leaves seams 2011-01-06 09:32:25 +00:00
5f64450726 remove assignments which are unused. 2011-01-06 01:29:13 +00:00
4f343642b1 isect_seg_seg_v2_point was modifying the value of line vectors passed.
this could be confusing later on, now swap the pointers rather then changing their values.
2010-12-12 01:36:10 +00:00
448d24e7a0 New math util funcitons:
- equals_v2v2
- project_v2_v2v2
- isect_seg_seg_v2_point
which would be necessery for my further multires interpolation commit

M_Geometry_LineIntersect2D now uses isect_seg_seg_v2_point(). Behaviour of this
function was changed a bit -- it haven't returned intersection point in several
cases when two segments are making angle.
2010-12-11 21:27:39 +00:00
34ea1cf0b2 minor changes to the python api.
- pep8 script was giving an error on non utf8 scons source files.
- use PyList_SET_ITEM macro when list type is ensured.
- all mathutils types use subtypes to create new types when available.
- use defines MAT3_UNITY, MAT4_UNITY to initialize unit matrices.
2010-11-28 06:03:30 +00:00
369a5cc29e fix for compiling with the c90 standard, support for non-static variable initializers is a c99 feature. 2010-11-02 13:12:30 +00:00
25bbf99a79 replace SIDE_OF_LINE macro with line_point_side_v2() inline function.
made a number of files build without unused warnings.
2010-10-15 05:18:45 +00:00
a6e7823942 make fly mode border draw into a area drawing callback rather then using a flag (no functional change). 2010-10-02 19:31:23 +00:00
5faa29b01d move window matrix translation into its own function. (no functional changes) 2010-10-02 19:06:20 +00:00
728b713d86 use more BLI math functions. 2010-08-15 15:14:08 +00:00
885bbe6999 from Luca's recent commit noticed there are more typo's: lenght -> length 2010-07-25 01:45:53 +00:00
75410037fd - correct some spelling errors.
- remove FreeCamera struct (wasnt used)
- remove world color alpha values (not used anywhre).
2010-07-20 10:41:08 +00:00
5505697ac5 Merge GSOC Sculpt Branch: 28499-30319
https://svn.blender.org/svnroot/bf-blender/branches/soc-2010-jwilkins
See log of that branch for details.
2010-07-14 14:11:03 +00:00
402a26e79f quiet warnings in screw modifier, also fix bad args for lookat_m4 and polarview_m4 to rotate_m4, however these functions are not used at the moment so it didnt cause any problems. 2010-06-02 07:40:50 +00:00
fba7ebcbea replace add_v3_v3v3() --> add_v3_v3() where possible 2010-04-21 12:27:48 +00:00
9a85013692 Merge various small changes from render branch:
* Division by zero fix for TNT SVD code.
* Sound fix, in case ffmpeg decode fails, don't use the samples.
* Fix for incorrect bounds of transformed objects in new raytracing code.
* Gave memory arena's a name used for allocations for easier memory
  usage debugging.
* Dupligroup no_draw option was using layers but not restrict view/render
  setting. (not a bugfix exactly but would do display list context switching
  while drawing for no reason).
* Fix objects instanced on hair particles not giving consistent results
  when the object is transformed.
* New math functions: madd_v4_v4fl, len_squared_v3v3, interp_v4_v4v4v4,
  mul_v4_m4v4, SH and form factor functions, box_minmax_bounds_m4.
* mul_m4_m4m4 and mul_m3_m3m3 now accept the same pointers for multiple
  arguments.
* endjob callback for WM jobs system.
* Geometry node uv/color layer now has search list/autocomplete.
* Various small buildsystem tweaks, not strictly needed yet in trunk.
2010-04-15 10:28:32 +00:00
1e9bf0cfdb spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text) 2010-03-22 09:30:00 +00:00
07b547980d remove unused includes for blenlib, left ifdef's for non linux os's alone. 2010-03-20 18:52:03 +00:00
bf4d8ffe3a Fix #21458: tangent space normal maps didn't work correct in some
cases due to recent fix to avoid division by zero.
2010-03-05 15:36:05 +00:00
8497b2f851 typo in zeroing a vector 2010-02-12 14:46:04 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
f590151725 avoid nan tangents which happen with cubes that have generated UVs 2010-02-03 19:16:18 +00:00
8ec59c7c68 Math Lib:
* inline some more functions, from math_base and math_vector
* also made some changes to the way inline is done so it can
  work for more than one file
* reflect_v3_v3v3 requires input vectors to be normalized now.
* added rgb_to_grayscale
* added zero_v4, copy_v4_v4, swap_v4_v4, is_one_v3
* added box_clip_bounds_m4 to clip a bounding box against a
  projection matrix
2010-01-22 11:10:24 +00:00
d16547ab73 Alt+B view clipping is now taken into account properly for sculpt, particle
edit and snapping, by clipping the view ray.
2010-01-05 14:26:38 +00:00
11e529f4f7 made the array interpolation function from last commit into a generic function
/* given an array with some invalid values this function interpolates valid values
 * replacing the invalid ones */
int interp_sparse_array(float *array, int list_size, float skipval)
2010-01-01 15:57:17 +00:00
0767cdd4a0 Transfer Shape Key
Useful if you have 2 different characters with the same base mesh (matching indicies), and want to copy a facial expression for eg, from one to another.
Durian request to re-use shapes between characters. 

* Copies the active shape to other selected objects
* Different methods to apply the shape
* * OFFSET, simple translation offset
* * RELATIVE (EDGE/FACE), Use Barycentric transformation to copy the shape. This means the target mesh can be a different orientation and scale and the shape should still apply since the surrounding geometry is used as a basis for the offset.

bug: barycentric transform's depth was inverted.

Note:
* This isnt added into a menu yet,
* This cant be redone since adding a shape key messes up the redo stack. needs fixing for other scripts too.
2009-12-27 11:14:06 +00:00
fde4686d77 barycentric transform utility geometry function.
From 2 triangles and 1 point, the relative position between the point and the first triangle is applied to the second triangle to find the target point.
the barycentric weights are calculated in 2D space with a signed area so values outside the triangle bounds are supported.

wrapped by python:
 pt_to = Geometry.BarycentricTransform(pt_from, t1a, t1b, t1c, t2a, t1b, t1c)

NOTE: 
- moved some barycentric weight functions out of projection painting into the math lib.
- ended up making some of the math functions use const args.
TODO:
- support exceptional cases. zero area tries and similar.
2009-12-27 01:32:58 +00:00
5e48ab8d75 Sculpt:
* Increase epsilon for intersection a bit more, ortho view + small
  faces are problematic.
* Fix a redraw issue with one partial redraw too much at the end of
  the stroke.
2009-12-16 19:19:08 +00:00
cb4d9a7427 Sculpt:
* Temporary workaround for sculpt not working well with small polygons,
  still seems to be some issues, but can at least paint now.
* Small optimization avoiding local function variable aliasing.
2009-12-11 16:59:09 +00:00
b83751d8c2 Math Lib: merging over some changes from the sculpt branch:
* swap v2/v3
* multiply-and-add (madd) v3
* inline v3 short/float conversion
* mul_v3_m3v3
2009-11-28 13:11:41 +00:00
12968cdd8a adding function
vcloud_estimate_transform(..) to math library
comments there (@math_geom.c) should explain what it does
-- removing attached clutter from softbody.c
2009-11-25 23:54:21 +00:00
4f47f21d44 small corrections, no functionality change 2009-11-12 12:48:39 +00:00
c53a8105da Project snapping is too slow for sintel's head at subsurf level 2, ifdef'd out per face snapping and added BVH raycasting.
adjust epsilon value for isect_ray_tri_v3()

from the comment...
/* note: these values were 0.000001 in 2.4x but for projection snapping on
 * a human head (1BU==1m), subsurf level 2, this gave many errors */
- 0.000001 -> 0.00000001
2009-11-12 11:45:29 +00:00
0807bc176a Actionzones (i.e. corner widgets for splitting views) were broken after the math-lib commit. Was caused by functions that got renamed to the same name but the order of arguments were different. 2009-11-11 01:32:38 +00:00
4617bb68ba Math Lib
* Pre-conversion commit removing old arithb.c code, this will not compile,
  next commit fixes that.
2009-11-10 20:40:18 +00:00
385875632d Math Lib
* Fix remaining issues before conversion.
* Inline various vector functions, currently enabled for all platforms.
  I expect this to work in GCC/MSVC at least, if other platforms don't
  support it, #ifdef's can be added.
2009-11-10 19:13:05 +00:00
60ea745613 Math Lib Reorganization
* New header and source files.
* Still need a few tweaks before switching code to use them.
2009-11-09 22:42:41 +00:00