Commit Graph

94 Commits

Author SHA1 Message Date
21fddf7d1c C99/C++11: replace deprecated finite() by isfinite(). 2016-05-17 21:39:16 +02:00
2e348fd43e Cleanup: shadowing (blenkernel) 2015-11-23 17:40:10 +11:00
41bdd3fc39 Fix/enhance BKE_mesh_validate_arrays.
Aside from some minor cleanup, this commit:
* Fixes checking twice for multiple usage of same vert by a same poly.
* Fixes handling of ME_VERT_TMP_TAG vert flag by that check (there was no guaranty
  that flag was cleared for a poly's vertices before we start checking).
2015-11-16 15:46:56 +01:00
68797eda1f Fix mesh validate: 'r_changed' ignored loop edits 2015-10-07 14:38:36 +11:00
67e32b3195 Fix T45514 crash entering texpaint mode.
In the file of the report, stencil and clone indices
have fallen out of synch with the uv/mtexpoly layers.

Looks like the file has a long history, coming from 2.49
even. Unfortunately reporter cannot recall exact steps
to reproduce, so "fix" is to patch mesh.validate to
fix those indices.
2015-08-20 10:35:14 +03:00
1cf1f48893 Cleanup: fix mismatch in printf formating (int/unsigned int).
Noisy and annoying with new gcc5...
2015-06-19 12:31:25 +02:00
5217d2bc0e Use BKE_edgehash_ensure_p where possible 2015-04-07 10:53:58 +10:00
26a251202b Fix mesh-validate for polys using successive verts 2015-03-03 15:32:35 +11:00
d282728f1d mesh_validate: don't add invalid edges into the hash 2015-02-26 17:49:21 +11:00
1f527c6033 Fix BKE_mesh_validate_arrays, ignored do_fixes 2015-02-24 13:10:15 +11:00
7bae9ee6b6 Mesh validate: add an option to not clean temp/cache CDLayers.
This is mandatory for incoming custom normal imports from io scripts, because
often geometry here is corrupted, so we need to call mesh.validate() to clean it up.

Issue is, we cannot set custom normals before geometry is clean, so we need to store
temporary plain loop normals in a CD_NORMAL layer, validate, and then set custom normals.
So we need a way to prevent 'temp' lnors to be freed by validate.
2015-02-05 14:03:01 +01:00
46e2d5ee41 Cleanup: typo 2014-11-21 14:16:35 +01:00
5e6b79c1f5 Fix crash in BKE_mesh_validate_arrays 2014-08-19 21:11:57 +10:00
37da1dadb6 Fix mesh validate skipping first vertex 2014-08-19 18:49:54 +10:00
51120efbce Fix bug in validate mesh code (could use index out of range). 2014-07-25 18:44:32 +02:00
1097a3f70d Add helper to validate (and fix) material indices of meshes' polygons, curves' splines and texts' letters.
Useful especially for importer addons.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D650
2014-07-17 17:16:07 +02:00
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
63ccb26303 Code Cleanup: spelling 2014-01-17 17:35:03 +11:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
59e4600526 Fix [#37380] vertex paint colors don't render.
Another Evil Typo (r) one, you could add much more than the 8 allowed VCol layers!

Note: added some (warning-only) checks in mesh validate functions, but we still have a big issue with new cdlayer merge function, which could generate more than 8 layers of UVs or VCol... Don't know yet how to handle this situation. :(
2013-11-11 20:37:19 +00:00
3c05662f5e fix error where BKE_mesh_cd_validate layer renaming would use invalid index values. from r60260
also correct some comments.
2013-09-25 11:11:41 +00:00
2cca73eeb1 Fix [#36759] UV Project - Specified UV Map doesnt work properly
In fact, the issue was that names of mloopuv/mtespoly layers could very easily get out of sync (a simple rename was enough), while most tools (such as the UVProject modifier) expect matching layers to have the same name!

Now matching names are check on load, and renaming of a layer through RNA is guaranted to be synchronized with its counterparts.

Thanks to Brecht & Campbell for reviews.
2013-09-20 11:14:08 +00:00
6317f1eafd fix [#36291] Applying subsurf to mesh or setting subdivisions to zero crashes Blender
issue was mesh somehow had a mismatch of UV/texpoly layers. we may want to allow this in the future but for now sync on load just in case.
2013-09-16 06:00:25 +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
38075c7b3c fix for building on msvc 2013-09-04 06:50:15 +00:00
f3af9de618 debug option for modifier stack calculation USE_MODIFIER_VALIDATE,
checks that every modifier gives a valid mesh (very slow) - so off by default even in debug mode.
2013-09-04 01:29:34 +00:00
25ffb79a0b use reserve argument for more edgehashs 2013-08-24 14:40:15 +00:00
0b88b4fad7 when the size of an edgehash is known or can be guessed,
pass in the argument to reserve the size.
2013-08-24 13:47:57 +00:00
f2acb10b6b edge hash: take an arg for the guarded-malloc string (as ghash does) 2013-08-24 13:08:55 +00:00
d68917cb86 code cleanup: typos 2013-07-27 07:02:27 +00:00
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
8f9150871c Fix part of #34233: bad alpha blending for 2D image painting. This is a very
old issue, the formulas here were never quite right, should all work ok now
with byte and float images.

Some differences:

* Colors with zero alpha from the background will never have an influence, so
  you don't get alpha fringes when painting over such areas. This does give
  hard edges when looking at the RGB channels alone, but there's no way to
  avoid that and fringes at the same time, same behavior as other painting apps.

* Add/Subtract/Multiply/Lighten/Darken now leave the alpha channel unchanged
  and work only the RGB channels, again same behavior as many other apps.

* Erase/Add alpha now compensates for premultiplied float images to keep the
  straight RGB colors the same.

Next: fix projection painting.
2013-04-27 12:51:23 +00:00
319036f2d5 fix [#35026] Curve build modifier 2013-04-22 12:00:37 +00:00
858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
3dababa7ec code cleanup: name mesh functions more consistently, also use bools for mesh args. 2013-03-17 19:55:10 +00:00
a0351fd97e object converting curve/mball to a mesh would give invalid selection state (edges selected but nothing else).
add arg to BKE_mesh_calc_edges() so selecting newly created edges is optional.
2013-03-16 01:19:03 +00:00
0ac07404ba style cleanup: braces with multi-line statements, also add some comments. 2013-03-01 14:47:06 +00:00
d705c52e65 no longer use 'check_existing' to see if we need to have a save popup, instead use 'exec' operator on a saved file and
invoke on unsaved files.

correct missing memset --> CustomData_reset switch too.
2012-10-31 17:03:31 +00:00
67e2768570 quiet some -Wshadow warnings 2012-10-12 14:35:10 +00:00
b0598a203c Cosmetic updates to mesh validate messages. 2012-07-05 13:02:42 +00:00
e2e79b9e10 Validate mesh selection stack in mesh_validate function
Related on #31944: Blender crashes on switching to mesh edit mode
2012-07-02 09:57:31 +00:00
33e8feb880 Fix #31835: OBJ Importer corrupts a model (crash in edit mode)
Added back face validation to BKE_mesh_validate_arrays.

This is needed because some addons (like OBJ importer) are reading
tessfaces and then converting them to ngons and validation of tessfaces
is needed before such a conversion.

Validation of faces would happen only if there's no polys in mesh.
2012-06-28 09:08:11 +00:00
2ab62ce126 code cleanup: defines with braces - end with '(void)0' so callers must end with ';' like normal function.
... without this some editors dont parse the source so well.
2012-05-27 12:21:13 +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
c91cee2bb9 code cleanup: naming - BKE_mesh_* 2012-05-05 21:28:12 +00:00
6cc48ec555 mesh.validate() / BKE_mesh_validate() --- functions now check for duplicate vertices used within the same polygon.
(which would crash otherwise)
2012-04-25 07:23:20 +00:00
8765dfccf7 style cleanup: correct typos 2012-04-21 14:14:58 +00:00
40f4a4b6ba style cleanup: mesh validate.
also add code cleanup script which runs uncrustify and then undoes trailing whitespace edits (reducing diff noise)
2012-04-18 09:16:30 +00:00