Commit Graph

39 Commits

Author SHA1 Message Date
3d5330f789 vertex group changes,
use more api functions more (some vertex group editing functions were copied about), also make some functions int oapi calls.

- remove defgroup_find_index(), use BLI_findlink instead since they both work the same way.
- move static function getNearestPointOnPlane() to BLI_math api function closest_to_plane_v3()
- ED_vgroup_give_parray() added option to return an array where unselected verts are NULL (simplifies code & works for lattice when it didn't before).
- more consistant error checking of ob->actdef.
2011-12-14 21:08:08 +00:00
06c3d5bd09 de-duplicate dominant axis calculation, exact same checks were in 6 different places.
added function:  axis_dominant_v3(...)
2011-12-02 22:14:20 +00:00
e5f40a1aac - pyapi mathutils.geometry.intersect_plane_plane
- isect_plane_plane_v3 uses better method
- minor refactor - arg name changes & some args as const.
2011-11-20 05:56:21 +00:00
c993ee678a new math utility function isect_plane_plane_v3 2011-11-13 16:28:52 +00:00
817b6cb9a8 mathutils.geometry.distance_point_to_plane(pt, plane_co, plane_no) - utility function, BLI math version too. 2011-11-12 10:06:56 +00:00
46ae692710 Merge with trunk r41342 2011-10-28 17:00:53 +00:00
fae903e263 Dynamic Paint:
* More code changes pointed by Brecht in codereview.
* Some user interface improvements.
* Updating brush settings now also updates canvas preview.
2011-10-28 14:46:09 +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
c896fcae79 Merge with trunk r37849 2011-06-27 08:11:05 +00:00
933a65a76f 2d version of line/circle intersec function. 2011-06-26 11:08:12 +00:00
8eb119a5cd renamed math functions and made public
lambda_cp_line --> line_point_factor_v3
 lambda_cp_line2 --> line_point_factor_v2

correction to previous commit function name
 isect_seg_sphere_v3 --> isect_line_sphere_v3
 ... since its not clipped.

added a clip argument to the python version of the function.
2011-06-26 08:07:09 +00:00
540c2eee56 math func to find the intersection(s) between a segment and a sphere for C/python.
from python:
  i1, i2 = mathutils.geometry.intersect_line_sphere(l1, l2, sphere, radius)
2011-06-26 07:21:19 +00:00
b937a4f5b6 Merge with trunk r37546 2011-06-16 12:00:03 +00:00
a1c22262fe Bake from multires mesh
=======================

Added option to baked named "Bake From Multires" which is avaliable for
normals baking and displacement baking.

If this option is enabled, then no additional hi-res meshes and render
structures would be created . This saves plenty of memory and meshes
with millions of faces could be successfully baked in few minutes.

Baking happens from highest level against viewport subdivision level,
so workflow is following:
  - Set viewport level to level at which texture would be applied
    during final rendering.
  - Choose Displacement/Normals baking.
  - Enable "Bake From Multires" option.
  - You're ready to bake.

Displacement baker had aditional option named "Low Resolution Mesh".
This option is used to set if you want texture for realtime (games)
usage.

Internally it does the following:
  - If it's disabled, displacement is calculated from subdivided
    viewport level, so texture looks "smooth" (it's how default
    baked works).
  - If it's enabled, dispalcement is calculated against unsubdivided
    viewport levels. This leads to "scales". This isn;t useful for
    offline renders much, but very useful for creating game textures.

Special thanks to Morten Mikkelsen (aka sparky) for all mathematics
and other work he've done fr this patch!
2011-06-05 20:54:04 +00:00
3b41ab432b Applied Dynamic Paint 1.18f patch as a codebase for GSoC. 2011-05-24 07:08:58 +00:00
391dbde03d added math function isect_line_plane_v3(), use for window_to_3d rather then having it inline. 2011-05-19 03:49:57 +00:00
5f5cdf9d00 for bug [#27358] Transform bug when transform > 500
mouse coords would with cont. grab would wrap at short.
use mouse coords as int rather then short.

this problem still happens on linux because of XTranslateCoordinates
2011-05-12 16:47:36 +00:00
088899236b =trunk=
Recommitted eltopo collision code (but disabled by default)
with Genscher's permission.

To use, you need to install liblapack and libblas
2011-05-01 21:39:13 +00:00
6bb626f253 minor changes
- remove some warnings
- fix typos
- cmake allow in-source build (when WITH_IN_SOURCE_BUILD is defined)
- cmake, use an explicit list of rna files (don't glob)
2011-04-21 05:49:47 +00:00
66f5ac408e edit definitions to use const for non modified args, also correct incorrect definition for clip_line_plane(). 2011-04-20 06:47:16 +00:00
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
b97ad119b9 doxygen: add blenlib under core as module. 2011-02-18 13:58:08 +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
86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00
28e689b9aa bugfix [#25498] Projection paint clone tool leaves seams 2011-01-06 09:32:25 +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
fa4bbbb249 Maintenance,
- remove some redundant declarations
- changed VertexTangent and Path structs to avoid compiler alignment padding.
2010-12-04 13:00:28 +00:00
5faa29b01d move window matrix translation into its own function. (no functional changes) 2010-10-02 19:06:20 +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
081c1205a3 correct fsf address 2010-02-12 13:34:04 +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
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
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
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
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