Commit Graph

655 Commits

Author SHA1 Message Date
f43e75c4d6 py api: BMesh.from_object() was using the derivedFinal, which isn't always available - or may not have UV data if in the wireframe view.
update the function to calculate the derived mesh with bmesh data-mask each time.

resolves bug [#33205] Bmesh "from_object" gives "no usable mesh data".

also found 'mesh_build_data' could run with non mesh objects and fail silently - add an assert.
2012-11-21 00:31:47 +00:00
2bb174cfa4 style cleanup: indentation 2012-11-09 09:33:28 +00:00
12ed0c64bc make use customdata typeoffset more, add an assert to ensure its to date. 2012-10-31 09:50:24 +00:00
00acdb6292 remove CD_POLYINDEX customdata layer:
reported as [#29376] BMESH_TODO: remove tessface CD_ORIGINDEX layer

for a single mesh there could be 3 origindex mappings stored, one on the polygons and 2 on the tessfaces.
(CD_POLYINDEX and CD_ORIGINDEX).

as Andrew suggests, now tessfaces (which are really a cache of polygons), using origindex to point to polygons on
the same derived mesh, and polygons only store the original index values.
2012-10-30 19:20:17 +00:00
ec67334e25 A few more BMesh errors messages translated, and "automated" translation for modifers too! 2012-10-27 11:12:09 +00:00
0e494b74c4 style cleanup 2012-10-26 04:14:10 +00:00
9804515cf0 bmesh todo: dont calculate normals in editmesh with modifiers applied, its assumed modifiers output correct normals at the moment. 2012-10-25 04:58:27 +00:00
2de2acc681 add CDDM_from_bmesh(), avoids using BMEditMesh in modifiers. 2012-10-24 07:24:11 +00:00
e038a1c613 reduce float comparisons for keying operation and despill. 2012-10-23 16:32:39 +00:00
b131359834 Fix #32867: normal map baking issue with flat shaded faces since bmesh. Also
removed the old unused normal map tangent computation code.
2012-10-23 14:57:49 +00:00
1767b65846 style cleanup: also rename bmesh_decimate.c --> bmesh_decimate_collapse.c 2012-10-23 03:38:26 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
Lukas Toenne
d3eb9dddd6 Better fix for #32846. Instead of using time change or object recalc condition, set an explicit object flag to disable particle system modifier update during dupli list creation. This is more transparent and should prevent issues with hair path generation being skipped. 2012-10-18 15:54:24 +00:00
3563904050 revert r50969, gives problems with weight paint + modifiers, need to investigate further after release. 2012-10-01 14:23:57 +00:00
a9efe26ab8 DM_set_only_copy() wasn't setting only-copy flags for loops and polygons. (should have been added during bmesh merge) 2012-10-01 04:59:21 +00:00
0d5d2146eb code cleanup: make shape key api names consistent with our new convention. 2012-09-19 10:12:07 +00:00
19863a7268 fix for 3 obvious mistakes/bugs. 2012-09-15 06:30:40 +00:00
7a71f58af3 fixes for NULL checks, remove some redundant checks and add some in that have been removed by accident as code has been updated. 2012-09-14 06:17:14 +00:00
a512cac545 code cleanup: move get_selected_defgroups into object_deform.c and make it behave like similar functions, also when drawing vertex weight colors, only call this function when multi-paint is enabled. 2012-09-05 03:45:32 +00:00
56534ecdcb style cleanup: also add debugging print function for derived mesh DM_debug_print_cdlayers() 2012-09-03 02:41:12 +00:00
ed0489bb6e style cleanup: also spelling 2012-08-24 23:22:34 +00:00
e9caa21830 fix own error in recent smoothview cleanup, also correct some cross references in bmesh docs. 2012-08-17 14:43:20 +00:00
84bf3e48c0 style cleanup: use c style comments in C code 2012-07-06 23:56:59 +00:00
1aa27e240c code cleanup: replace some non utf8 chars 2012-06-03 11:16:13 +00:00
9547b76c2e This fixes a precision issue in multi-paint so that near zero values do not cause flickering as you paint.
It also changes multi-paint's "zero weight color" to black again--it was unintentionally changed to red some time late last year when an aspect of the colors were changed.
2012-05-31 17:22:52 +00:00
3d98da9b0f Fix for bug [#31613] Cycles 3d viewport material display mode + skin modifier related crash
When in material display mode, mesh_calc_modifiers() calculates the
orco DerivedMesh, which uses a different CustomDataMask. In
particular, it does not necessarily include the current modifier's
requiredDataMask, so those layers might get set to NO_COPY. For the
skin modifier, this resulted in a crash when the modifier internally
copies the DerivedMesh and the output does not contain the expected
MVertSkin layer.

Fixed by adding the requiredDataMask to the orco DM's CustomDataMask.

Also added a debugging function to customdata.c:
customData_mask_layers__print(CustomDataMask mask);

This will print out the names of all the CD layer types in the mask.
2012-05-28 21:02:44 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
cffaa42d3a style cleanup: blenkernel 2012-05-12 19:18:02 +00:00
318b44fe5d Refactor of modifiers' apply function: now use a single bit-flag parameter to pass options, instead of having one parameter per boolean flag (i.e. replaces current useRenderParams and isFinalCalc by a single ModifierApplyFlag flag. ModifierApplyFlag is an enum defined in BKE_modifier.h). This way we won't anymore have to edit all modifier files when e.g. adding a new control flag!
Should have no effect over modifier behavior.
2012-05-09 15:00:26 +00:00
d20c129a9c style cleanup: whitespace/operators 2012-05-09 09:24:15 +00:00
3ef11693f5 Style cleanup: displist module 2012-05-07 06:58:03 +00:00
c91cee2bb9 code cleanup: naming - BKE_mesh_* 2012-05-05 21:28:12 +00:00
a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
a0ce240de9 Renamed "fake" OpenGL identifiers.
Any identifier that looks like an OpenGL identifier, but isn't, causes a false alarm by the glreport.py tool.  Most of these were in comments so I just rephrased the comments.  There were a couple of static functions/macros that were easy enough to rename.  Only the glTexco and glIndex fields of the DMVertexAttribs struct was public and had non-local uses.
2012-05-04 11:50:11 +00:00
343edf2722 style cleanup: function calls & whitespace. 2012-04-29 17:11:40 +00:00
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +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
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
1615b46963 style cleanup 2012-04-21 13:37:26 +00:00
6701933f5c style cleanup 2012-04-21 12:51:47 +00:00
3d2f1fd8f9 Fix crash with texture draw in edit mode after commit 45672.
Don't create empty tesselated faces layers in edit derivedmesh, these are
being created on the fly so this will conflicted, and use loop data for
opengl attributes for edit derivedmesh drawing.
2012-04-17 11:02:32 +00:00
caafc8184b Fix #30720: Creating Navmesh crashes blender
In fact there were several issues fixed (all of them regressions since bmesh merge):

- Creating navmesh crashed because creating new faces for mesh was trying to set
  default values for all customdata layers in this face. This requires memory
  pool created for this datablock.
  Usually this pool is creating on creating datablock if there're some elements
  to be stored in this block. In cases of regular primitive creating it wasn't
  an issue because they doesn't create customdata layers, they only creates
  geometry.
  Navigation mesh creates geometry and customdata layers (CD_RECAST layer)
  which used to confuse a bit custom data functions. Solved by ensuring there's
  memory pool created for polygons datablock after adding new custom data layer.
  Most probably it's better to be resolved on CD level (like smarter track on
  changed amount of stored data and so) but prefer not to make such global changes
  so close to the release.
- Toggling edit mode lead to loosing recast datalayer. Solved by adding recast
  layer to bmesh mask so it'll be copied to/from edit mesh.
- Some part of code assumed raycast layer is in face datablock, some that it's in
  polygon datablock. Made it to be in polygons datablock.
  Kind of temporary solution to make navmesh working, probably it'll fail if one
  will want to edit navmesh by hand after it was generated.
  Proper way would be to ensure the whole navmesh things are using ngons.
2012-04-16 13:53:30 +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
d5953568c8 use 'const float[3]' for derived mesh callback args. 2012-04-09 07:06:06 +00:00
906cd4d8a6 update python keywords (remove exec, print, add nonlocal) 2012-04-06 05:53:01 +00:00
e0ead26312 Partial fix [#30744] BMesh: Particle system face/volume emission doesn't work if there is a constructive modifier earlier.
When ORIGSPACE is added, it is now a loop data, so we need to mark tessdata as dirty too. Also fixed DM_ensure_tessface to check DM_DIRTY_TESS_CDLAYERS flag!

This fixes problems with subsurf + dynapaint + particles, however, some modifiers, like remesh, seems to create a new dm from scratch, hence loosing completely those CD layers… Note this bug already existed in 2.62, so this is not a regression.
2012-04-01 15:02:19 +00:00
5b88712ff9 move debug flag into its own global var (G.debug), split up debug options.
--debug
  --debug-ffmpeg
  --debug-python
  --debug-events
  --debug-wm

This makes debug output easier to read - event debug prints would flood output too much before.

For convenience:
  --debug-all turns all debug flags on (works as --debug did before).

also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.
2012-03-31 00:59:17 +00:00
47cd3d4b8e Fix for truncation of 64-bit CustomDataMasks.
Can't use GET_INT_FROM_POINTER anymore with CD masks, as this
truncates to 32-bit.

Bug: http://projects.blender.org/tracker/index.php?func=detail&aid=30680&group_id=9&atid=498
CR: http://codereview.appspot.com/5905059/
2012-03-26 16:25:21 +00:00
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00