Commit Graph

85 Commits

Author SHA1 Message Date
e03b1668e0 code cleanup: remove unused functions
- IsectLLPt2Df
- isect_point_quad_uv_v2
- isect_point_face_uv_v2

These are obsoleted by resolve_tri_uv, resolve_quad_uv

also add attributes for unused function results for some math functions.
2013-08-01 17:15:11 +00:00
76e989d7b1 function renaming for own recently added BLI_math functions, suggested by Brecht. 2013-07-30 10:58:36 +00:00
c754eaa0f9 add inline functions getting a single axis from mul_m3_v3() 2013-07-28 19:46:33 +00:00
e6b22d287f utility function for printing arbitrary sizes vectors. 2013-07-11 15:32:26 +00:00
8b2c5e693c Fix #35634: weight paint did not do z-buffer culling anymore on Windows after recent change to size of bool. 2013-06-13 17:11:09 +00:00
0ee45c9301 more optimal method of calculating the normal for the solidify modifier.
When adding 2 unit length vectors, the length can be used to calculate the angle.
2013-05-08 14:33:02 +00:00
b0752f1b89 add interp_v3_v3v3v3_uv() to use for use with uv value from isect_ray_tri_v3(), rename tree -> bmtree for BMBVHTree. 2013-04-17 05:49:06 +00:00
502ddd3128 code cleanup: warnings and style. 2013-04-12 00:50:40 +00:00
b77acc2879 add 2d length functions for testing pixel coords. len_manhattan_v2_int, len_manhattan_v2v2_int 2013-04-11 02:23:45 +00:00
82636ab0fb improved method of getting the tangent axis from a bmesh triangle,
rather then getting the longest edge, get the edge which which is most different from the 2 others ends up giving more useful results: for an isosceles triangle it returns the base weather its longer or shorter then the other sides.
2013-04-04 08:47:07 +00:00
1fea6220a2 Woot woot commit.
Stencil style texture mapping. Ready for field testing and user feedback.

This commit adds stencil like brushes, like those that existed on old ptex branch.
(with the exception of clip colour)
To control the position of the stencil, you use

Q: translation
Shift - Q: scaling
Ctrl - Q: rotation

There's extra work that has been done to make this work:

* Support for coloured overlay in vertex/texture painting
* Also made A button do stroke mode selection like in sculpt mode,
when mask painting is inactive.

There are some TODOs to work on during bcon3:

* Support tiled and stencil mode in 2D painting. Support alpha textures also.
* Tidy up overlay code. There's some confusion there due
to the way we use the primary brush texture sometimes for alpha, other times
for colour control.

WIP design docs will be in

http://wiki.blender.org/index.php/User:Psy-Fi/New_Brush_Tool_Design
2013-03-31 00:38:50 +00:00
80de3192a7 attempt to quiet warnings for gcc4.2 2013-03-13 15:41:14 +00:00
660be3da39 use gcc warning -Wredundant-decls, exposes some odd/duplicate declarations which have been removed. 2013-03-11 20:27:38 +00:00
2433404e4b add inline function mul_project_m4_v3_zfac() to get the z-depth value from a vector & mat4x4 2013-03-09 15:39:24 +00:00
8cde4e5182 add an influence slider to mesh cache. 2013-01-21 16:43:04 +00:00
32ce3a6ca7 utility vector functions for flipping one vector about another:
nicer then interp_v3_v3v3(v, v1, v2, -1.0f);
2013-01-18 23:07:27 +00:00
69b88cf719 Patch [#33196] Warning Fixes 11-16-2012
* MEM_CacheLimitier - Size type to int conversion, should be safe for now (doing my best Bill Gates 640k impression)
* OpenNL CMakeLists.txt - MSVC and GCC have slightly different ways to remove definitions (DEBUG) without the compiler complaining
* BLI_math inlines - The include guard name and inline option macro name should be different. Suppressed warning about not exporting any symbols from inline math library
* BLI string / utf8 - Fixed some inconsistencies between declarations and definitions
* nodes - node_composite_util is apparently not used unless you enable the legacy compositor, so it should not be compiled in that case.

Leaving out changes to BLI_fileops for now, need to do more testing.
2012-11-23 15:12:13 +00:00
987f6a7d4f code cleanup: move local math functions into math_geom.c, math_vector.c, no functional changes. 2012-11-15 13:24:14 +00:00
b32bf2c462 code cleanup: use min_/max_ math functions, add minmax_v2_v2v2. 2012-10-25 22:47:54 +00:00
cb634b9100 Google Summer of Code project: "Smoke Simulator Improvements & Fire".
Documentation & Test blend files:
------------------
http://wiki.blender.org/index.php/User:MiikaH/GSoC-2012-Smoke-Simulator-Improvements

Credits:
------------------
Miika Hamalainen (MiikaH): Student / Main programmer

Daniel Genrich (Genscher): Mentor / Programmer of merged patches from Smoke2 branch
Google: For Google Summer of Code 2012
2012-10-10 13:18:07 +00:00
c3ca19800c refactor screen foreach functions to accept float[2] arguments rather then int pairs.
overall means less converting between float and int (and short in some cases).
2012-10-10 01:22:19 +00:00
db051f2b2d fix MESH_OT_tris_convert_to_quads() limit options (uv and vertex color) were not working at all. 2012-09-19 04:48:34 +00:00
df51ab27ed code cleanup: BM_face_legal_splits() was doing some redundant assignments. 2012-09-05 23:22:47 +00:00
13254cde8c Alternate mask spline feather offset calculation method: now there are 2 [Even | Smooth]
- Even preserves thickness but can give unsightly loops
- Smooth gives nicer shape but can give unsightly feather/spline mismatch for 'S' shapes created by beziers.

This is an example where smooth works much nicer.

http://www.graphicall.org/ftp/ideasman42/mask_compare.png
2012-08-27 09:44:56 +00:00
df9ca0455c Fix [#31807] Ngon triangulation error
Notes:
*This implements a quite simple algorithm, which simply checks angles (actually, absolute cosines) of created tri and remaining face (which may be a tri, quad, or more NGon), so that both are "best" (ie avoid as much as possible too much narrow/wide corners), and also checks the new edge is OK (i.e. does not goes "out" of original face).
*Incidently, it fixes a typo in that bm_face_goodline() func!
*It's quite performant (a bit quicker than previous code, as far as I have tested it) and prevent creation of completely flat triangles as much as possible, but it's far from being a "best" solution (as it is still a "progressive" one)!
*It also introduces a new math func (in BLI_math_vector.h), cos_v3v3v3, which computes cosine (ie dot product of normalized vectors) and is roughly a quicker replacement for angle_v3v3v3, when real angles are not needed.
2012-06-24 16:19:19 +00:00
e1241030db yse BLI_math for the compositor in more places. 2012-06-12 20:04:55 +00:00
ceea98be2f math lib changes from tomato 2012-05-31 11:57:09 +00:00
305d341ec2 code cleanup: use vector math function minmax_v3v3_v3() and other minor vector function edits. 2012-05-13 11:05:52 +00:00
9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
41a5e731a2 bmesh: new wireframe tool
- makes wireframe from faces.
- options similar to inset (even offset, relative scale)
- copies face settings and loops (uvs, vcolors)
- optionally replaces the existing geometry.
2012-04-29 10:44:00 +00:00
c1c022342c fix for invalid use of memset when loading tiff images
- memset(..., 1.0); // isnt valid
- memset(pointer, sizeof(pointer)) // was using the sizeof the pointer, not the size of the array, since this was to fill in alpha values it was obviously wrong.
2012-04-23 23:57:17 +00:00
67f8e3a3a7 inline function for "Newell's Method" used for normal calc. 2012-04-16 16:49:37 +00:00
9ae0523921 fix [#30897] UVEditor: Snap Cursor to Selected
was writing the 3rd component of a 2D vector.
2012-04-11 07:47:09 +00:00
eb10402365 Fix #30638 and part of #30646.
Problem was that area calculation of polygons was done relative to the xy plane, and with a very obscure (to me at least) algorithm. That meant that vertical ngons would get 0 area. 

Commented initial code in case this is a strange optimization case that someone wants to use and used a cleaner algorithm: first project vertices to the ngon plane, defined by the normal of the ngon and the center (mean) of the ngon vertices. This will only be exact for convex and mostly planar ngons, still it is much better than the previous code.

Also fixed memory leak when stretch display was on.
2012-03-25 19:02:28 +00:00
ee9a00948b mathutils py api:
Vector.angle_signed(other)
  for 2D vectors to get the clockwise angle between them.

  in BLI math its called - angle_signed_v2v2()

shorthand for...

  atan2f((v1[1] * v2[0]) - (v1[0] * v2[1]), dot_v2v2(v1, v2))

also corrects compile error in last commit.
2012-03-14 06:14:15 +00:00
dfdfa3d51b code cleanup: replace macros VECCOPY, VECADD, VECSUB, INPR - with BLI_math funcs.
added copy float/double funcs: copy_v3fl_v3db(), copy_v3db_v3fl(). 2d & 4d too.
2012-03-09 06:04:17 +00:00
b18794c3b6 Add blenlib function to initialize vectors from a single float.
The new functions are copy_v2_fl, copy_v3_fl, and copy_v4_fl.
2012-02-29 04:17:26 +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
fe71f40f88 misc changes from bmesh, syncing across to trunk, no functional changes 2012-01-20 02:24:01 +00:00
a8081c1d2b Uv Tools branch GSOC 2011
=========================
Documentation: http://wiki.blender.org/index.php/User:Psy-Fi/UV_Tools

Major features include:

*16 bit image support in viewport
*Subsurf aware unwrapping
*Smart Stitch(snap/rotate islands, preview, middlepoint/endpoint stitching)
*Seams from islands tool (marks seams and sharp, depending on settings)
*Uv Sculpting(Grab/Pinch/Rotate)

All tools are complete apart from stitching that is considered stable but with an extra edge mode under development(will be in soc-2011-onion-uv-tools).
2012-01-17 16:31:13 +00:00
414370b8d4 Support for arbitrary sized vectors - (was limited by 2-4 previously)
patch http://codereview.appspot.com/5482043
from Andrew Hale

* Text from the submission *

This patch adds the ability to use arbitrary sized vectors from mathutils.
Currently vectors are only of size 2, 3 or 4 since they are generally restricted
to geometric applications. However, we can use arbitrary sized vectors for
efficient calculations and data manipulation.
2011-12-18 07:27:11 +00:00
c62d33c540 patch: [#29382] Arbitrary Length Array Function Additions and Modifications
from Andrew Hale (trumanblending), with some edits to use these in mathutils.Vector added.

Added Functions:
- dot_vn_vn - Dot product of two arrays
- normalize_vn_vn - Normalize an array and store the result in a second array
- normalize_vn - Normalize an array inplace

Renamed Functions:
Some functions have been renamed to make them consistent with the naming conventions used by fixed length array functions.
- fill_vni to fill_vn_i
- fill_vn to fill_vn_fl
2011-11-24 04:12:16 +00:00
96d73bfdcf replace VECCOPY with copy_v3_v3, same for 2d copy, also added vec copy functions for int & char. 2011-11-07 01:38:32 +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
4bd0a2ba2d replace VECCOPY -> copy_v3_v3, added copy_v*_v*_short too for typesafe copying, some parts of the code are copying float -> short normals without scaling. fix coming next. 2011-09-12 04:14:12 +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
722be28d68 sub_v4_v4v4 was taking float[3] arguments. 2011-08-26 22:37:20 +00:00
b481524fde fix for float projection painting, now updating correctly.
This fix also allows for partial update of the image, speeding up painting. 
The different code path implemented will be used to upload high resolution images to OpenGL when onion branch is merged.
Due to conversion of float textures to/from sRGB, corrections made to brush color sampling to take account of the image profile. This is not 100% correct yet as texture images used for projection painting strokes are not converted to/from sRGB yet(This has been decided due to loss of precision for 8-bit formats). It will have to do for now, though.

last-minute update, exr image loading is broken, will fix asap
2011-06-06 22:10:05 +00:00
Nathan Letwory
b97ad119b9 doxygen: add blenlib under core as module. 2011-02-18 13:58:08 +00:00