Commit Graph

119 Commits

Author SHA1 Message Date
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
12348318d1 Fix T38328: GLSL display shows texture mapping completely messed up in some cases
Own stupid typo in rB28ca299d4dfc...
2014-01-23 08:37:07 +01:00
28ca299d4d Fix T38316: Half of a Face is Missing on Newly Created Cubes or Cylinders.
Own bug from rBc691551249f3. Now at least I understand why `test_index_face()` is needed for tessellated quads!

Added a bunch of comments to explain the issue, as it's far from an obvious one...

We loose some performances, but it's still much quicker than org code.
2014-01-22 19:56:21 +01:00
00119e5ac2 Code Cleanup: reduce sign conversion 2014-01-22 02:56:52 +11:00
c691551249 Optimize tessellation code (min 20% better, up to 300% with some CD layers to tessellate).
The main idea is to store (during tessellation) or recreate (during tessdata update) a tessfaceverts-to-loops mapping, and then update all tessdata
in one pass, instead of calling `BKE_mesh_loops_to_mface_corners` repeatedly for all tfaces!

Differential Revision: https://developer.blender.org/D226

Reviewed by Campbell, thanks a lot!
2014-01-21 16:32:47 +01:00
6ba02681de Fix a bunch of UI string issues... 2014-01-15 10:40:54 +01:00
8952f58375 Add tangent space computation/access from RNA (i.e. python).
This simply mimics code used for loopnormals, to enable py scripts to generate and access (temporary)
a tangent 3D vector and bitangent sign for each loop. Together with the split normals, this allow
to recreate a complete tangent space for normal mapping (bitangent = bitangent_sign * cross(normal, tangent)).

Expects all faces to be tri or quads.

Reviewed By: Brecht, campbellbarton

Differential Revision: https://developer.blender.org/D185
2014-01-11 11:51:19 +01:00
e23f77b935 Code Cleanup: move mesh mapping functions into their own file/header 2013-12-12 16:28:52 +11:00
f64ae4cbe5 MemArena: use size_t instead of int for alloc args and internal storage.
also add BLI_memarena_calloc to be used when calloc isnt enabled for the arena.
2013-12-02 17:51:27 +11:00
5da703e915 BMesh/Mesh: replace scanfill with polyfill 2013-11-30 22:13:52 +11:00
3264461598 move bmesh array lookup data and utility functions from editmesh into bmesh,
since enough bmesh operations can also take advantage of direct index lookups on verts/edges/faces.

developers note:
- EDBM_index_arrays_init/ensure/free -> BM_mesh_elem_table_ensure/init/free
- EDBM_vert/edge/face_at_index -> BM_vert/edge/face_at_index
- EDBM_uv_element_map_create/free -> BM_uv_element_map_create/free
- ED_uv_element_get -> BM_uv_element_get
2013-10-28 02:05:33 +00:00
e783611098 Arg! Fix another bug in split normal core algorithm (some flat faces were ignored, depending on the order of evaluation)... :/ 2013-10-19 13:48:51 +00:00
110b32cf6f Fix [#37012] The new export split normal does nor produce correct results.
Was a silly error introduced in algo during optimization, vertices having sharp and smooth edges would only get the first poly's normal for each "smooth loop group".

Also done a (minor) optimization, and some comment fixes.
2013-10-09 17:48:27 +00:00
92d94ccb08 misc minor changes
- make cmake osx use of -ftemplate-depth match scons.
- use array size within sizeof(), more compact.
- replace AT with __func__ where the function is unique enough.
- BLI_box_pack_2D -> 2d to match other functions.
- rename new mesh normal calculation to mesh.calc_normals_split()
2013-09-10 19:23:39 +00:00
4a2f6447ef Core code for split normals computation. Many thanks to ideasman for is optimization guiding and code reviews!
Note the API is not yet committed, as it may need a few more checks & tweaks. ;)
2013-09-10 12:48:08 +00:00
00bd7da674 correct error in recent changes for building with openmp.
rename DM_OMP_LIMIT to BKE_MESH_OMP_LIMIT and set to 0 when in debug mode, same for BM_OMP_LIMIT.
2013-09-09 05:42:26 +00:00
66efedd096 enable strict flags for mesh_evaluate.c 2013-09-09 03:12:23 +00:00
40b6532ec8 remove use of BLI_array in BKE_mesh_mpoly_to_mface(). was over-allocating anyway so just allocate the array once. 2013-09-09 02:16:22 +00:00
2646bbdccb move mesh evaluation functions (normal, mapping, smooth group... etc, calculations) into mesh_evaluate.c.
mesh.c was over 4k lines and complex functions mixed in with general library management.
2013-09-09 02:11:44 +00:00