Commit Graph

206 Commits

Author SHA1 Message Date
Antonio Vazquez 2bb9a465e6 Fix T76498: Refactoring - Rename BKE modifiers funtions 2020-05-08 10:34:35 +02:00
Brecht Van Lommel aa09a46fd7 Objects: add infrastructure for hair, pointcloud, volume modifiers
There is no user visible difference in standard builds, as there are no
volume modifiers yet. When using WITH_NEW_OBJECT_TYPES some deform only
modifiers are now available for hair and pointcloud objects.

Differential Revision: https://developer.blender.org/D7141
2020-04-22 14:20:31 +02:00
Jeroen Bakker 7ed3ebbc6e Fix T67888: Incorrect Wireframe After Applying SubSurf/MultiRes
Show control edges stores the control edges in the mesh which is
picked up by the draw manager. When applyng a subsurf (or multires) we
don't want that data present in the base mesh. Any rebuilding of the mesh
would overwrite the data anyway.

This patch introduces a new flag for applying modifiers
that can be checked to ignore storing display specific data in
the base mesh.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7163
2020-03-26 15:34:53 +01:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Bastien Montagne 56116bbdf4 Cleanup/refactor: Rename `BKE_library` files to `BKE_lib`.
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.

Part of T72604.
2020-02-10 13:00:42 +01:00
Jacques Lucke f3db5a0965 Cleanup: Improve usage of extern "C" 2020-02-07 17:22:11 +01:00
Sergey Sharybin fc2b966fc7 Refactor: Add C++ guard code to headers
C++ is used more and more, and it is becoming more and more annoying to
keep track of whether header have C++ guard or not.

Is easier and more clear to be consistent in all headers and have such
guards in all headers.
2019-11-29 14:39:54 +01:00
Sybren A. Stüvel 75808620ce Made ob param of `modifiers_getVirtualModifierList` const
The `modifiers_getVirtualModifierList()` function previously took a non-
const `Object *ob` parameter, preventing it from being called from more
restrictive functions. Since the function doesn't modify the passed
object, it could easily be made const.

No functional changes.
2019-11-26 16:26:52 +01:00
Sybren A. Stüvel e15ab630c6 Added little explanation of eModifierTypeType_(Non)Constructive
Thanks to @campbellbarton for the explanation.
2019-10-10 13:25:54 +02:00
Pablo Dobarro 6db6267d85 Sculpt: Disable remesh operators with Multires
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5964
2019-10-03 15:28:35 +02:00
Campbell Barton 6eadd40597 Cleanup: redundant struct declarations 2019-08-25 16:45:47 +10:00
Campbell Barton 807b6c4848 Revert "Fix T66949: Can't select bones from multiple objects in wpaint mode"
This reverts commit 9e9fbb39d7.

Adding back object+pose bone selection support removes the need for this fix.
2019-07-18 12:22:39 +10:00
Campbell Barton 9e9fbb39d7 Fix T66949: Can't select bones from multiple objects in wpaint mode 2019-07-17 18:39:42 +10:00
Clément Foucault 226c6f086a Fix T62941 Subdivision Modifier Showing all face dots
Previously in 2.79 we were using a specialized drawing using derivedMesh.

Now the subsurf modifier tag each center vertex as facedot and let the
DRWManager pick it up.

Some modifiers (deforming ones) do not clear the tag so we can use this
technique even if there is deforming modifiers after subsurf modifiers.
2019-07-08 18:09:52 +02:00
Brecht Van Lommel 15dd289992 Mesh: don't compute CD_ORCO layer when there are no deforming modifiers
This saves memory and evaluation time for simple static meshes with e.g. a
subdivision surface modifier. If no CD_ORCO layer exists then we assume the
actual vertex coordinates are equal to the original undeformed coordinates.
2019-06-13 20:03:06 +02:00
Campbell Barton 6529d20d79 Cleanup: spelling in comments 2019-06-12 09:43:49 +10:00
Campbell Barton aa42da0385 Cleanup: comments (long lines) in blenkernel 2019-04-27 12:07:07 +10:00
Campbell Barton 333cdbb410 Cleanup: comment blocks 2019-04-18 07:59:28 +02:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton eb9237eb20 Cleanup: style 2019-04-09 08:44:06 +02:00
Sergey Sharybin 59f6371a85 Fix T63252: Bind in Mesh Deform Modifier fails
A regression since 64c8d72ef1.

The solution is to force modifier evaluation for an evaluated
object, and let it to copy binding data back to original when
is being evaluated for binding.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4642
2019-04-04 15:49:30 +02:00
Brecht Van Lommel 2c5a919212 Cleanup: remove unused modifier methods. 2019-03-30 19:17:05 +01:00
Brecht Van Lommel c39d82daf4 Cleanup: remove unused derivedmesh code. 2019-03-28 20:02:59 +01:00
Sergey Sharybin 8fb0b9aebb Subdiv: Enable topology cache in edit mode
The general idea of this change is to have a runtime data pointer
in the ModifierData, so it can be preserved through copy-on-write
updates by the dependency graph.

This is where subdivision surface modifier can store its topology
cache, so it is not getting trashed on every copy-on-write which
is happening when moving a vertex.

Similar mechanism should be used by multiresolution, dynamic paint
and some other modifiers which cache evaluated data.

This fixes T61746.

Thing to keep in mind, that there are more reports about slow
subdivision surface in the tracker, but that boils down to the
fact that those have a lot of extraordinary vertices, and hence
a lot slower to evaluated topology.
Other thing is, this speeds up oeprations which doesn't change
topology (i.e. moving vertices).

Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T61746

Differential Revision: https://developer.blender.org/D4541
2019-03-18 17:11:43 +01:00
Bastien Montagne ab0bc65c24 Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.

Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!

As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).

Reviewers: brecht, campbellbarton, sergey

Differential Revision: https://developer.blender.org/D4407
2019-03-07 11:29:50 +01:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Bastien Montagne 7cca0f9998 Fix T61391: MeshDeform Modifier does not work on a solidified planar mesh.
`BKE_modifier_get_evaluated_mesh_from_evaluated_object()` used by
modifiers needing access to other objects' geometry probably skipped out
of the radar when cage and final evaluated meshes were added to
BMEditMesh? In any case, we do not need to duplicate (and then free!) a
temp mesh from editdata anymore, and we can even add instead a parameter
to get cage instead of final. Also makes modifiers code a bit simpler.
2019-02-11 20:24:07 +01:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton 65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
Campbell Barton c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Campbell Barton b8467273b8 Cleanup: redundant defines
Comment or remove unused defines.
2019-01-26 19:15:30 +11:00
Campbell Barton 49490e5cfb Merge branch 'master' into blender2.8 2018-12-12 13:02:09 +11:00
Bastien Montagne 1f1ea26d8c Fix typos. 2018-11-27 21:17:06 +01:00
Sergey Sharybin 91c6beb28a Cleanup: Remove unused modifiers callback
Was only used by subsurf in the past years, it is unlikely
other modifiers will every need this any time soon.
2018-10-24 14:04:29 +02:00
Campbell Barton b15123d279 Cleanup: remove unused derived mesh wrappers 2018-10-12 18:14:11 +11:00
Campbell Barton 75ac83610b Modifier: add non derived mesh modifier wrappers
Rename modifier_deformVerts_ensure_normals &
modifier_applyModifier_ensure_normals with wrappers that match 2.7x
convention.
2018-10-09 13:20:20 +11:00
Campbell Barton c8c3bbaade Cleanup: naming
Rename DerivedMesh modifier functions to make room for mesh versions.
2018-10-09 12:23:22 +11:00
Brecht Van Lommel 342e73f90f Spelling fixes in comments and descriptions (2.8 changes), patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 18:48:29 +02:00
Jacques Lucke b5dbe43d3e Cleanup: move DerivedMesh wrappers for modifiers further down the hierarchy
The main goal of this patch is to cleanup the interface of every modifier. More specifically the interface of modifiers should be DerivedMesh-free.
Internally some modifiers still use DerivedMesh. However I think it is better when the wrappers are in the modifiers so that higher level functions can use the simplified interface.

This patch removes the applyModifier_DM and applyModifierEM_DM functions. In a previous patch (rB3614d9d) the other functions that used DerivedMesh have been removed.

Reviewers: brecht
2018-09-20 12:04:17 +02:00
Jacques Lucke 3614d9d2a2 Cleanup: Remove some DerivedMesh wrappers for modifiers
Specifically the deformVerts_DM, deformMatrices_DM, deformVertsEM_DM and deformMatricesEM_DM functions are not used anymore.

Reviewer: brecht
2018-09-19 17:33:03 +02:00
Sergey Sharybin 6a2305191f Cleanup: Remove unused modifier evaluation flag 2018-09-06 11:47:44 +02:00
Sergey Sharybin e4ce5fd8d2 Modifiers: Use bool for boolean flag in isDisabled 2018-07-10 12:14:33 +02:00
Sybren A. Stüvel 60b9d413db Pass copy flag to modifier copyData function
This will allow modifiers to decide whether to copy or share caches between
ModifierData copies.
2018-07-04 14:52:14 +02:00
Campbell Barton 18d87e79e9 Merge branch 'master' into blender2.8 2018-06-29 09:25:40 +02:00
Campbell Barton b372766816 Cleanup: trailing newlines 2018-06-29 09:23:51 +02:00
Sergey Sharybin 6427141f7b Modifiers: Stop using md->scene in isDisabled() callback
This is first commit in series of changes to get rid of md->scene.
2018-06-21 18:04:05 +02:00
Campbell Barton 06a1a66a9b Merge branch 'master' into blender2.8 2018-06-17 17:10:19 +02:00
Campbell Barton 6fc8a74886 Cleanup: trailing space for blenkernel 2018-06-17 17:05:51 +02:00
Bastien Montagne 70f8eaf1b7 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
2018-06-09 15:18:21 +02:00
Bastien Montagne 638de72277 Cleanup: remove some G.main usages. 2018-06-09 15:17:04 +02:00