Commit Graph

265 Commits

Author SHA1 Message Date
f9a6cb15e8 fix for remesh (infact any modifier that uses tessface's) not displaying geometry in editmode.
the bug was in CDDM_from_BMEditMesh which would create tessfaces even when use_tessface==FALSE.
2012-02-07 03:03:09 +00:00
5f6395d69e Code cleanup for BMesh CDDM access functions, no functional changes.
Renamed CDDM_get_face() to CDDM_get_poly() to match array access
functions. Added function definitions for CDDM_get_loop() and
CDDM_get_poly().
2012-02-07 01:13:04 +00:00
191c160d50 fix [#30083] Sculpt not redrawing with plain mesh 2012-02-06 06:56:54 +00:00
baa843d0d3 Code Cleanup: use vector functions for copying / adding UV's 2012-02-05 13:25:42 +00:00
b0db9df701 fix for error in recent commit. passing totface rather then totpoly, also add asserts if PBVH attempts to build without any faces (but with polys). 2012-02-05 07:09:30 +00:00
776ec0ec61 add function for getting a polygon map: dm->getPolyMap(ob, dm).
polygon version of dm->getFaceMap(ob, dm)

sculpt uses this for checking connectivity.
2012-02-05 06:20:51 +00:00
db785d1656 fix for crash converting a curve into a mesh (Alt+C conversion), this would crash on entering editmode.
now curves convert to polygons directly, rather then faces, and polygons after.
2012-02-03 04:58:55 +00:00
2ea8a3b8ca remove CDDM_copy second argument, added CDDM_copy_from_tessface instead.
this function caused too many conflicts and in most cases was zero anyway.
2012-01-29 21:59:47 +00:00
a928a610e7 for CDDM's dmcalcNormals now call CDDM_calc_normals(), not CDDM_calc_normals_mapping(), this means calculating normals will calculate MPoly and MVert normals but not tesselate the mesh (which is overkill for normal calculation anyway).
use CDDM_calc_normals over CDDM_calc_normals_mapping for editmode and ensure the final dm has tessfaces.
2012-01-19 23:34:53 +00:00
1f84876e89 ensure defoem DM has tessface data for the few places that need it.
also add a workaround for CDDM_recalc_tesselation_ex() which would add a CD_NORMAL to dm->fdata and then overwrite immediate
2012-01-19 19:23:25 +00:00
bc745a32d3 argument to mesh_recalcTesselation to skip copying normals from polygons. 2012-01-19 17:51:52 +00:00
9d782c8a1a argument for CDDM_from_BMEditMesh() so creating tessface data is optional, no functional changes since all callers use this so far. 2012-01-18 15:09:27 +00:00
939c4171c4 fix for editmode bmesh bug - found by testing script.
incorrect flag handling in CDDM_from_BMEditMesh() broke editmode deform verts (they would never be copied), issue was exposed when re-aligning layer values with trunk.
2012-01-18 14:52:47 +00:00
be1bc0eb98 rename
* CDDM_calc_edges --> CDDM_calc_edges_tessface
* CDDM_calc_edges_poly --> CDDM_calc_edges
2012-01-06 02:59:28 +00:00
5c59f0d589 added
* CDDM_calc_normals
* CDDM_calc_normals_tessface

these match what we have in trunk - CDDM_calc_normals_mapping() is kept for more comprehensive operatons.
2012-01-06 00:45:07 +00:00
ded0af482b rename CDDM_calc_normals() --> CDDM_calc_normals_mapping 2012-01-06 00:12:24 +00:00
2b2c1007f6 rename normal calc functions.
comparing bmesh to trunk, mesh_calc_normals() in bmesh is a much more comprehensive function, calculating mpoly,mface normals, where trunk only calculated vertex normals.

renamed:
* mesh_calc_normals() --> mesh_calc_normals_mapping_ex
* mesh_calc_tessface_normals --> mesh_calc_normals_tessface() - only calculates normals from tessface
* added mesh_calc_normals() - only calculates normals from poltys

this way we can have mesh_calc_normals() remain fast for parts of the code which only need vertex normals to be updated.

only refactor, no func changes- didnt replace mesh_calc_normals_mapping_ex() with mesh_calc_normals() anywhere yet.
2012-01-06 00:08:37 +00:00
20b425e5d1 minor changes for mirror modifier, bigger changes coming. 2012-01-03 09:37:57 +00:00
71bc053bb2 remesh now working for bmesh 2011-12-31 12:58:03 +00:00
45f1d7fa17 minor speedup to CDDM_merge_verts (called by mirror)
* was doing 2 edge hash lookups, where only 1 was needed.
* was checking MLoop verts and edges if they were -1, when they are never set to -1
2011-12-29 09:41:31 +00:00
ab5bef6fbb bmesh mirror modifier cleanup
* vertex map was a dynamicly realloc'd array when the final size was known, use a fixed array instead.
* vertex map was being calculated even when not used.
* face tesselation was being called twice.
* an unused deform group array was being created.
2011-12-29 09:15:06 +00:00
2da527b017 un-inline edgehash functions, BLI_edgehash_insert was far too big to inline.
and have edge hash use unsigned ints since edge verts are unsigned ints for MEdge's
2011-12-28 10:06:10 +00:00
dab41e0499 macro for getting next/previous MPoly loops 2011-12-28 07:10:27 +00:00
4bc4c018d1 set mloop edge and vertex as unsigned ints since face/edge reference verts as unsigned ints too 2011-12-28 04:43:29 +00:00
2457d4f5ab svn merge ^/trunk/blender -r42680:42722 2011-12-19 10:40:48 +00:00
90ef435145 Fix a bug in CustomData_duplicate_referenced_layer(_named) functions: MEM_dupallocN does not work with complex layers like CD_MDEFORMVERT ones, so rather use copy func when available. 2011-12-19 08:26:53 +00:00
74a1123059 Quite some compiler warnings... 2011-12-17 16:22:08 +00:00
980e68175b svn merge ^/trunk/blender -r42495:42516 2011-12-08 17:32:37 +00:00
a5fb261016 Fix #29520: issue drawing with VBO + GLSL + alpha pass. Includes some refactoring
to hopefully make alpha material drawing code more clear.
2011-12-07 22:03:49 +00:00
4b0b3f578c alternative fix for [#29338], now dont duplicate the vertex layer when calculating normals, instead only calculate face normals. 2011-12-07 01:12:53 +00:00
f07df7287e manual sync with trunk - pulling in changes where the issues are not bmesh spesific
- some merges added lines in multiple times
- removed some NULL checks that were only in bmesh
- enable cycles by default (was disabled because it used not to work)
- make formatting match
2011-12-04 23:13:28 +00:00
15ad39e684 svn merge ^/trunk/blender -r42303:42329 2011-12-02 01:01:07 +00:00
c21f19374b Fixed crash caused by recent VBO's changes
Crash was caused by non-initialized original index passing to compareDrawOptions
callback. Due to in some cases it's enough to know indices of faces in final DM
(like for comparing if the same texture used for mesh drawing) assume this
callback receives index in final DM and if it's needed it will make conversion
to original index itself.

This should help reaching extra speed if textured object is affected by
bevel modifiers, i.e.
2011-12-01 18:26:48 +00:00
f6f7e270e3 Slight refactor of VBO code to deal with multiple textures.
Added compareDrawSettings callback to driver mesh's callbacks which are
drawing textured faces (mapped and not mapped). This new callback checks
if two faces are drawing with the same settings (testures, shading etc)
and if they not, flush of faces happens into ogl using glDrawArrays and
next face would be drawn with it's own settings.

Currently implemented compareDrawSettings is used to resolve issue from
bug report only, probably there are extra places where this callback is
needed, but haven't seen configuration where current logic will fail,
so it should be ok.

Also reordered arguments passing to drawMappedFaces DM's callbacks,
so now all drawing callback are accepting list of callbacks and then
userData, instead of using mixed order of callbacks and userData which
was a bit confusing to work with.

This commit fixes:
- #26410: VBO & multitexture doesnt work
- #29464: VBO enabled causes UV coruption
2011-12-01 12:12:39 +00:00
56da69fd03 Fix for [#29467] Selection of active vertex color layer doesn't work
Need to push active layer indices from loops & polys to faces again after tesselations
2011-12-01 09:49:27 +00:00
f06bbaed92 split BMFlags_To_MEFlags & MEFlags_To_BMFlags into type specific calls, since we always know the types with these functions theres not much point in having generic calls with a type switch. 2011-12-01 01:41:56 +00:00
bc9b593909 More DM func renames, fixing some build breaks, renaming more stuff, also seems like it might be fixing the recent CDDM_copy corruption/leak bug 2011-11-30 18:03:56 +00:00
274080025d remove wrong solidify & draw changes i had checked in here and had also proposed for trunk, because the problem was fixed differently in trunk.
#-This line, and those below, will be ignored--

M    source/blender/modifiers/intern/MOD_solidify.c
M    source/blender/blenkernel/intern/cdderivedmesh.c
2011-11-30 06:27:38 +00:00
eb46f6bf0d More DM func renames, this one includes renames of the function pointer members of the DerivedMesh struct 2011-11-29 13:01:51 +00:00
4e86b48cbd Rename DM *_face_* funcs to be either *_tessface_* or *_poly_* to avoid confusion
This is the first step in a few changes to cleanup confusing/missing DM funcs
2011-11-29 05:09:54 +00:00
e73176ddfb fix for [#29437] normals incorrect using bevel modifier in edit mode 2011-11-28 10:57:30 +00:00
1e4ec06e07 r42101 causes problems. reverting and instead make correct CD_ORIGINDEX for tesselated faces to fix the problem. 2011-11-23 20:44:04 +00:00
dd001d85b2 fix for vertex paint and face mask selection - drawing was using CD_ORIGINDEX when it should use CD_POLYINDEX 2011-11-23 18:13:12 +00:00
d8f895c3b3 fix misisng edge hash free when CDDM_tessfaces_to_faces ran on an empty mesh 2011-11-23 17:48:55 +00:00
f850e76e04 remove assert & make warning print more helpful 2011-11-23 16:39:07 +00:00
e7cfaf1b5f ocean sim now works with bmesh 2011-11-22 19:43:09 +00:00
b5362607ab fixes from last merge 2011-11-22 12:05:46 +00:00
8a8566c894 Fix [#29256] Import images as planes add on doesn't work correctly in bmesh 2011-11-17 18:48:49 +00:00
9087cb91d4 quiet compiler warnings for BLI_array defines, split BLI_array_append into BLI_array_append / BLI_array_append_r, the latter returning the new array location. 2011-11-16 17:09:41 +00:00
da849bbfc0 prepare for flagging the bmesh has having invalid index values, so we can skip looping over all elements if its already valid.
- went over every BM_SetIndex call and added comments about its use, if its setting dirty values or correct ones.
- replace loops over all elements _just_ to set index values, with a new function, BM_ElemIndex_Ensure(...), this will eventually only initialize values when they are dirty.
2011-11-16 12:38:40 +00:00