Commit Graph

640 Commits

Author SHA1 Message Date
c8cbe63947 Cycles: fix issues with texture coordinates and object scale. Auto texture
space size and location were outdated often, and already computed on demand
by blender internal, now do that through RNA as well.
2012-05-08 23:39:31 +00:00
6f20ef6d87 optimize ngon angle calculation in solidify modifier (was doing prev/next vector subtract and normalize for every vertex). now store the previous normalized vector for re-use.
also add BKE_mesh_poly_calc_angles() which is mostly a reference for now.
2012-05-08 14:58:38 +00:00
c93d7a193a style cleanup: BKE_*.c files which deal with library functions 2012-05-06 15:15:33 +00:00
c91cee2bb9 code cleanup: naming - BKE_mesh_* 2012-05-05 21:28:12 +00:00
1dccd4c98a code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
2012-05-05 16:03:57 +00:00
a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
4c5502bfd6 code cleanup: function naming for BLI functions. 2012-05-05 00:23:55 +00:00
8b1c1e9f61 code cleanup: use much simpler (and likely faster) polygon normal calculation in object mode. 2012-05-04 13:13:45 +00:00
5da2135eef code cleanup: double promotion & some style cleanup 2012-05-03 21:35:04 +00:00
959a717d91 Fix #31250, #31248: wrong vertex normals after transform apply, collada import,
sculpt shape key switch. All cases that called this function needed parameter
only_face_normals set to false, so changed it now.

Also fixed wrong user count for imported mesh from collada and simplified
previous fix for tesselated faces to polygons conversion.
2012-05-02 23:36:34 +00:00
f88cfd9168 Code and style cleanup in own modules in BKE and also mball module
- Make sure functions are named in way BKE_<object>_<action> (same way as RNA callbacks)
- Make functions which are used by mball.c only static and remove their prototypes
  from public header file.

Further cleanup is coming.
2012-04-28 16:49:00 +00:00
ef054e165c style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros. 2012-04-28 15:14:16 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
ef0a4c0ba9 fix for bevel modifier creating invalid geometry - simply tell BM_face_split() to check for doubles. 2012-04-26 15:38:16 +00:00
6d2cd24010 fix memory leak in validating mesh and remove unneeded knife operator settings store. 2012-04-26 15:20:26 +00:00
ee6aaafd31 code cleanup: typos and set gcc attributes for string formatting. 2012-04-25 06:06:40 +00:00
e26ef899c3 clear the FGON edge flag when updating old meshes to polygons. (we may wan't to reuse the flag later) 2012-04-23 00:58:17 +00:00
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
e57d258169 - fix memory leak in mesh_strip_loose_polysloops(), occurred during 3ds import.
- updating normals in py/api's mesh.transform() wasn't working and gave annoying print, disable this, script authors can call calc_normals explicitly if they need.
2012-04-22 00:27:38 +00:00
7e7d28e3ad fix [#31048] converting curve object to mesh makes object disapper from 3D view 2012-04-21 13:08:26 +00:00
0635f8101c make scanfill threadsafe (wasnt threadsafe before BMesh merge but before the merge it didn't need to be) - now rendering uses its better if its threadsafe. 2012-04-16 06:48:57 +00:00
79693e4543 code cleanup: avoid confusion with incorrectly named argument to BLI_edgefill(), was 'mat_nr', now 'do_quad_tri_speedup' 2012-04-16 05:03:04 +00:00
60d3b8f27b Fix loading external MDisps, BMesh merge bug.
* When converting mfaces to mpolys, load external MDisp data in, add
  CustomDataExternal struct to loopdata if needed.

* Fix multires modifier's filepath RNA functions to use ldata rather
  than fdata.
2012-04-13 05:39:27 +00:00
d17efa64a6 improve mesh error prints and quiet a print in mesh_ensure_tessellation_customdata() which happened too often. 2012-04-12 14:36:57 +00:00
f3792b0f2b code cleanup: use uppercase for defines and dont end macro's with ; 2012-03-31 03:36:15 +00:00
42076f0a1f skip using bmesh operators for converting to/from undo meshes (gives some speedup) 2012-03-29 01:41:56 +00:00
09f29c0b70 style/name cleanup: have EDBM_* functions match our style guide and also match BM_ function naming conventions 2012-03-27 04:46:52 +00:00
f83a93e454 bmesh todo, unlikly but possible - entering editmode with faces and no polys.
rather then printing a warning and failing - convert them to polys.
2012-03-27 01:28:25 +00:00
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
2f348d8b5d style cleanup: mainly for mesh code, also some WM function use. 2012-03-24 02:51:46 +00:00
9751653410 Renaming CD_WEIGHT_MCOL/MLOOPCOL and their masks from WEIGHT to PREVIEW, as this layer is now also used for various preview tasks in Object mode.
“Cleanup” commit, no functional changes.
2012-03-22 08:41:50 +00:00
6628318fdb Port mball_to_mesh to use polys. 2012-03-20 14:23:22 +00:00
65a71a1bbf fix [#30583] very old blend files are loading post-bmesh with no face/uv information, just wires
versioning code called a customdata update function which ended up clearing tessfaces - before converting polygons to tessfaces.
Added check so tessfaces aren't cleared when there are no polygons.
2012-03-20 05:04:51 +00:00
fe4ba0a462 Remove debug print in create_vert_poly_map 2012-03-19 20:28:22 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
3633858fdb code cleanup:
* replace 2D vector copy with copy_v2_v2().
* use puts rather then printf for single strings.
* style cleanup for drawobject.c indentation.
2012-03-18 06:01:33 +00:00
91580c0929 swap BMLoopCol r/b color, requires subversion bump.
old mesh MCol 'r' was blue, 'b' was red, but theres no reason to keep this for bmesh with MLoopCol.

Loading old files works, saving legacy format works too.

What wont work is loading a file after this revision and loading it in an older revision since the bmesh merge.
(it wont crash but the blue and red will be swapped on vertex color layers).
2012-03-17 20:39:28 +00:00
3d87c23f4f Reduce poly map memory usage (used by sculpt smooth brush.)
Changed the create_vert_poly_map function to return a more compact
structure. Memory saved will vary depending on the mesh, but typically
it should be about one third of the old size.
2012-03-17 04:41:36 +00:00
c9d0de49b9 mesh_validate code for bmesh (i.e. polys/loops).
Everything seems to work well (many tests making random changes over various meshes went good), but the code is a bit complex and hard to follow, due to the various possibilities of invalid poly/loop combinations… Code also makes more operations than previous tri/quad faces version (hence is a bit slower), but I don’t think we can do otherwise, it’s just the price for bmesh flexibility. ;)

Note: added the py script I used to make the tests, under source/tests/...
2012-03-15 20:10:07 +00:00
7f2acc173e Add BKE mesh function to update edge/poly hidden flags from verts. 2012-03-14 06:31:14 +00:00
99f72dfbfc Add 'level' field to struct MDisps, companion to 'totdisp'.
Gets initialized when loading old files and updated at the same places
totdisp is updated. Saves having to do log+sqrt to extract level from
totdisp.
2012-03-14 03:10:18 +00:00
b330abc290 remove Object member from BMesh struct - was only used for undo and BMEditMesh already stores an object pointer.
also fix for own mistake with mesh conversion refactor, shape key index was off by 1 when switching editmode.
2012-03-11 19:58:56 +00:00
4dc35836ad code cleanup: remove unused variable assignents and added bmesh submodule links, doc correction reported by dfelinto. 2012-03-09 21:23: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
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
e61339a76f code cleanup: duplicate checks and double assignments. 2012-03-08 04:38:35 +00:00
db4a85162d edits to rna/tessface UV layer needed to get OBJ import/export functional.
add the function to create new UV layers, this only works when there are no polygon layers already created (to prevent confusion since scripts with polygon layers should be adding MTexPoly and MLoopUV layers)
2012-03-07 21:58:58 +00:00
bffeab99ae Fix for fracture object crash
Issue was caused by incorrect resetting of tesselated fave data in copy_mesh:
- CustomData_free will free data from original mesh because layers in new mesh
  are pointing to the same memory just after copy. So it's needed only to
  set some pointers to NULL.
- It was incorrect filling fdata with zeroes because of incorrect structure size used.
2012-03-06 16:22:41 +00:00
a5eadf14e0 copying a mesh was generating tessfaces which isnt needed 2012-03-05 18:05:06 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00