Commit Graph

655 Commits

Author SHA1 Message Date
164841e30e Code cleanup: style 2014-05-09 18:29:42 +10:00
732bc8fcae Clarification of UI messages:
Show that modifier may not be supported in dyntopo rather than sculpt
mode in general. This is useful information since users may confuse the
two. Multires for instance is surely supported in sculpt mode, but not
in dyntopo.
2014-05-08 19:25:46 +03:00
0d85be5950 Fix T39950, part 2.
Warn when a modifier does not support optimal drawing and mask/hidden
parts display.

User report was that hidden parts became visible after adding a new
modifier subdivision. Subdivision was added with the Ctrl+number keys.
First part of the fix was to make sure we add a multires instead of the
subsurf modifier in sculpt mode with the PageUp/Down Ctrl+number keys.

We can't really stop users from having added a subsurf modifier already.
We could be "smart" and convert subsurf to mulrires upon entering sculpt
mode maybe but that can easily backfire - or users may actually want
that. For now, just warn that the modifier won't support Hiding/Masking
and optimal drawing.
2014-05-08 19:15:46 +03:00
5a8d7af642 Fix T40074: Autosmooth option causes assert failure when selected.
No need to call `dm_ensure_display_normals()` when using loop normals,
poly/vert ones have already been computed!
2014-05-08 17:48:00 +02:00
2e07109feb Code cleanup: naming.
Prepend BKE_ to the functions moved in blenkernel for recent bug fix.
2014-05-07 02:59:23 +03:00
20f7aaf6be Fix issue discovered while investigating T39950:
Sculpt mode drawing fails after deleting a subsurf modifier
in sculpt mode and undoing.

This was quite difficult to spot. Main cause was that mesh data was not
synchronized properly between undo and sculpt code because we generated
a pbvh on derivedmesh invalidation without really refreshing the rest of
the data. This could result in undo and drawing operating on different
data.

To solve this and avoid bad level calls I had to move quite some code
around. Crazyspace is now moved to blenkernel, as did some sculpt calls
that make sure sculpt data are properly refreshed.
2014-05-06 23:44:06 +03:00
e08db08a84 Fix T39997: Multiple boolean modifiers sharing the same right operand crashes
The issue was caused by the temporary CD layers being allocated for subsurf
meshes, same as we've got back in 881fb43.

In the long run this temporary storage is to be re-considered, but it'll also
imply re-considering of the Derivedmesh interaction as well. For now let's
use a simpler solution which is forbidding modifiers to call getArray for other
objects' derivedMeshes but use an API calls which would allocate local copy of
the data preventing race condition of shared data in DM.
2014-05-03 16:13:01 +02:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
c3d3ae3ee7 Code cleanup: avoid warning about bit-shift outside int range 2014-04-28 03:05:37 +10:00
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +10:00
dda5678669 Cleanup in modifier stack evaluation: deduplicate final tessellation handling code between
editmode and objectmode functions. No behavioral change expected!
2014-04-23 14:17:39 +02:00
ea753710bf Fix another shading issue with new split normals (deform modifier after a subsurf one).
Just always tag tessellated CDlayers as dirty when we recompute split normals!

Also simplified a bit end of mesh_calc_modifiers.
2014-04-21 17:58:05 +02:00
1c0b6c4f30 Code cleanup: use bools for DM 2014-04-17 20:03:39 +10:00
18e4224142 Split Normals I (1/5): basis for split normals (nearly nothing user-visible here):
* Add a new calcLoopNormals function to DerivedMesh struct, and implement it for CDDM and CCGDM (subsurf).
  EditDerivedBMesh (edit mode DM) only gets a dummy one in this commit.
* Add a tessellated version of CD_LOOPNORMAL layer (CD_TESSLOOPNORMAL), with relevant code to handle it
  (tessellation, rna access, etc.).
* Change auto_smooth options of Mesh (angle now in radian internaly, and toggle is now used to enable/disable
  split normals in DM creation process). Note BI render code is not touched here, hence its behavior regarding
  this option is now incoherent, will be addressed in a separate commit.

Reviewers: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D365
2014-04-13 12:19:00 +02:00
82628a6b0e Code cleanup: use struct type for mempool & style edits 2014-04-10 06:49:25 +10:00
1c811d96b2 Make material array account for mesh/object storage of materials 2014-04-09 18:37:54 +03:00
b5d3f183b0 Add material storage to derivedmesh.
The variables are considered invalid unless DM_update_materials is
called prior to use. Only use case currently is
mesh drawing. This helps with excessive allocation on the stack during
GPUObject creation, but may help elsewhere in the future as well.
2014-04-09 04:03:44 +03:00
45b02cee47 Code cleanup: no need to use calloc when memory is initialized after
also replace AT with __func__ since AT expands the full pathname
2014-04-04 14:26:01 +11:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
ea269c21ea Code cleanup: move edit-derivedmesh free to BKE_editmesh_free_derivedmesh 2014-02-28 20:12:45 +11:00
081a3412a9 Paint API: add BKE_paint_select_elem_test: to check on paint selection 2014-02-26 16:00:54 +11:00
b7fa08f88a Code cleanup: style 2014-02-22 11:14:15 +11:00
5621e63d36 Code cleanup: duplicate headers 2014-02-14 10:55:38 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
c37e8ecc50 Cleanup: int/short to bool in BKE_cdderivedmesh.h functions (and TRUE/FALSE to true/false in code using them). 2014-01-23 14:52:46 +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
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
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11: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
a5606fadbb Code Cleanup: remove object arg to CDDM_from_mesh mesh_create_derived 2013-12-26 08:27:08 +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
1b4afb161d code cleanup: typos 2013-11-05 04:23:46 +00:00
abee8a8717 Fix #37109: missing cycles texture display in edit mode.
My previous fix for uninitialized texture coordinates was not working well,
and in fact there was a bigger issue with GLSL drawing and missing attributes
with immediate draw mode. Now it will explicitly pass zero rather than having
it use whatever value was set last.
2013-10-17 14:04:10 +00:00
c9dfe7bd74 more localized fix for [#36299], only changes behavior for subsurf with orco in editmode 2013-09-12 10:41:00 +00:00
769c5bade5 fix [#36299] Skin Modifier causes crashes in combination with multiple Subdivision modifiers 2013-09-12 08:28:41 +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
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
4ee18eaf12 simplify length checks in DM_calc_auto_bump_scale 2013-09-03 22:22:45 +00:00
beffaa293e Made modifiers_getVirtualModifierList safe for threading
Move static variables to context filling in by this fcuntion
and owned by a callee function. This ensures no conflicts
between threads happens because of static variables used in
this function.

Also moved modifier types and virtual modifiers data to a
function called from creator. This is needed to be sure all
the information is properly initialied to the time when
threads starts to use this data.

--
svn merge -r57899:57900 ^/branches/soc-2013-depsgraph_mt
2013-08-19 09:05:34 +00:00
00b39c4e5b code cleanup: more confusion with 0/NULL/false 2013-08-07 03:55:21 +00:00
dd037a85a0 code cleanup: remove unused define, correct header guard mismatch, add NULL check so DM_to_mesh() can have a NULL object passed (currently not used) and remove redundant NULL check. 2013-08-03 23:58:17 +00:00
4982f200fa move alloca define into its own header since its not related to BLI_array 2013-07-28 10:38:25 +00:00
318aacbc8c Cleaning up some warnings that occur when an invalid navmesh is generated. 2013-07-19 22:07:38 +00:00
abe84a4f43 Fix #36139: cycles not taking texture spacing settings into account for
generated coordinates on text objects.
2013-07-15 11:11:36 +00:00
06be19c0ec add asserts for passing in bad index values to DM_get_***_data, CustomData_get() 2013-07-10 05:38:36 +00:00
32e917be8d correct typo in previous commit & minor changes. 2013-07-05 00:13:14 +00:00
9747e63094 fix for [#35911] wasn't complete, while weigths would show in editmode, weights that were modified by a weight modifier wouldn't. 2013-07-04 22:24:39 +00:00