Commit Graph

246 Commits

Author SHA1 Message Date
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
Bastien Montagne b809340960 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	source/blender/blenkernel/BKE_particle.h
	source/blender/blenkernel/intern/modifier.c
	source/blender/blenkernel/intern/object_update.c
	source/blender/blenkernel/intern/particle_system.c
	source/blender/editors/object/object_modifier.c
	source/blender/editors/physics/physics_fluid.c
	source/blender/makesrna/intern/rna_particle.c
	source/blender/modifiers/intern/MOD_particlesystem.c
2018-05-31 15:37:15 +02:00
Bastien Montagne b53d358261 Cleanup: remove G.main from BKE modifier. 2018-05-31 15:24:30 +02:00
Bastien Montagne 72f4ac99c7 Cleanup/fix wrong modifiers targets handling in COW context.
Modifiers stack only get COW/evaluated IDs, so no need to go auery again
DEG for those. Further more, now unified handling of EditBMesh case (was
done on case-by-case basis in a few modifiers, not all for some reason).

We are still missing the ability to get final and cage deformed meshes
when in Edit mode though, this is to be defined/implemented in depsgraph.
2018-05-30 12:04:06 +02:00
Dalai Felinto e8c8ff4f86 Fix all modifiers that depended on BKE_modifier_get_evaluated_mesh_from_object
This fix applying the following modifiers:
* Boolean (working already)
* Array
* Mesh Deform
* Surface Deform
* Vertex Weight Proximity

This function was to return evaluated mesh. So it should get the evaluated
object at all times. So in this case it makes more sense to simply pass the
depsgraph (or in this case the ModifierEvalContext that contains both the
depsgraph and the flag.

Solution discussed with Bastien Montagne.
2018-05-24 16:43:21 +02:00
Mai Lavelle c43dbc2bc2 Add modifier_deformVerts_ensure_normals, modifier_applyModifier_ensure_normals
Same as `modwrap_deformVerts` and `modwrap_applyModifier` but for `Mesh`.
2018-05-16 06:07:50 -04:00
Jeroen Bakker 6d155dc462 T54983: Bone selection overlay
Bone selection overlay is only available in pose mode.
and when active overrules the selection buffer.

This is currently `tricked` by switching the draw engines, but this is
an exception. Not sure how to solve this in a better way.

After this is solved we can look at how to localize the dim effect to only the objects connected to the active armatures. Currently it dims the whole screen (including background).

@campbellbarton I added you as reviewer as it you have done a lot in the DRW_draw_select_loop

Reviewers: campbellbarton, fclem

Reviewed By: fclem

Subscribers: campbellbarton

Tags: #bf_blender_2.8, #code_quest

Maniphest Tasks: T54983

Differential Revision: https://developer.blender.org/D3241
2018-05-11 08:17:05 +02:00
Bastien Montagne e53cf14280 Cleanup/refactor: Move get_mesh_eval_for_modifier from MOD_util to BKE_modifier.
Because some modifiers' actual code is in BKE... Also renamed to more
BKE-valid name BKE_modifier_get_evaluated_mesh_from_object.
2018-05-09 12:47:23 +02:00
Bastien Montagne 53a56b7b6c Merge branch 'master' into blender2.8 2018-05-08 15:20:18 +02:00
Bastien Montagne 3740f7593d Cleanup: Nuke empty dummy wrappers around modifier_copyData_generic().
This also changes signature of modifier copy callback, first (source)
parameter is now a const, which is saner anyway!
2018-05-08 15:04:10 +02:00
Sybren A. Stüvel 334b55fd2e Extract common modifier parameters into ModifierEvalContext struct
The contents of the ModifierEvalContext struct are constant while iterating
over the modifier stack. The struct thus should be only created once, outside
any loop over the modifiers.
2018-05-01 18:02:17 +02:00
Sybren A. Stüvel 6b9f1ffe6e Formatting 2018-05-01 18:02:17 +02:00
Mai Lavelle be4df85919 Modifiers: Add wrapper functions with Mesh / DerivedMesh conversion
Makes the follow changes:

- Add new `deform*` and `apply*` function pointers to `ModifierTypeInfo` that take `Mesh`, and rename the old functions to indicate that they take `DerivedMesh`. These new functions are currently set to `NULL` for all modifiers.
- Add wrapper `modifier_deform*` and `modifier_apply*` functions in two variants: one that works with `Mesh` and the other which works with `DerivedMesh` that is named with `*_DM_depercated`. These functions check which type of data the modifier supports and converts if necessary
- Update the rest of Blender to be aware and make use of these new functions

The goal of these changes is to make it possible to port to using `Mesh` incrementally without ever needing to enter into a state where modifiers don't work. After everything has been ported over the old functions and wrappers could be removed.

Reviewers: campbellbarton, sergey, mont29

Subscribers: sybren

Tags: #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3155
2018-05-01 18:02:17 +02:00
Brecht Van Lommel 34ab90f546 Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.

This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.

Differential Revision: https://developer.blender.org/D3152
2018-04-16 19:55:33 +02:00
Campbell Barton 1c24c04e60 Remove workspace object mode, reverts changes w/ 2.8
This caused too many problems syncing object modes
with multiple objects/windows/workspaces, see: D3130 for details.
2018-04-05 18:21:14 +02:00
Bastien Montagne 160e62b88c Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/BKE_object.h
2018-04-04 15:03:55 +02:00
Bastien Montagne d59c2d12b1 Fix modifier freeing code re. ID refcounting.
Free code should not handle ID refcounting at all. This has to be done
at higher level, since in some case we want to free (temp) data that
actually did not refcount at all its IDs.

This change seems to be working OK, but as usual in that area, only
lots of testing in real-case situation will say whether there are some
hidden bugs or not.
2018-04-04 14:58:52 +02:00
Campbell Barton 171c756f20 Merge branch 'master' into blender2.8 2018-02-23 13:10:39 +11:00
Campbell Barton dd77e45151 Cleanup: header guards & style 2018-02-23 12:59:55 +11:00
Sergey Sharybin 4a0d8f92f6 Remove old depsgraph from modifiers relations update context 2018-02-22 14:09:45 +01:00
Sergey Sharybin 539987766b Merge branch 'master' into blender2.8 2018-02-22 14:08:27 +01:00
Sergey Sharybin 3d1c0afe0e Depsgraph: Remove unused bmain from modifiers relations update context 2018-02-22 14:07:08 +01:00
Sergey Sharybin 6e860bef28 Merge branch 'master' into blender2.8 2018-02-22 13:05:00 +01:00
Sergey Sharybin df04520602 Depsgraph: Wrap all arguments foe modifiers relations update into a struct
Makes it easier to add or remove fields needed to update relations.
2018-02-22 12:54:06 +01:00
Campbell Barton ce0cb4de8d Object Mode: use eval_ctx for modifiers_isCorrectableDeformed
Some other minor changes from D3037 as well
2018-02-06 19:35:06 +11:00
Dalai Felinto 3abe8b3292 Rename any instance of scene layer or render layer in code with view layer
The RenderResult struct still has a listbase of RenderLayer, but that's ok
since this is strictly for rendering.

* Subversion bump (to 2.80.2)
* DNA low level doversion (renames) - only for .blend created since 2.80 started

Note: We can't use DNA_struct_elem_find or get file version in init_structDNA,
so we are manually iterating over the array of the SDNA elements instead.

Note 2: This doversion change with renames can be reverted in a few months. But
so far it's required for 2.8 files created between October 2016 and now.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D2927
2017-11-23 07:48:23 -02:00
Campbell Barton 1b462e5a51 Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places,
pass eval-context instead since its not simple to reason about what
what nested functions do when they can access and change almost anything.

Also use const to prevent unexpected modifications.

This fixes crash loading files with shadows,
since off-screen buffers use a NULL context for rendering.
2017-08-16 12:46:04 +10:00
Bastien Montagne 41830cc432 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 20:34:36 +02:00
Bastien Montagne 9da7dfa158 Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).

This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.

It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).

Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!

As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.

Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
Luca Rood 1c4c288727 Pass EvaluationContext argument everywhere
Note that some little parts of code have been dissabled because eval_ctx
was not available there. This should be resolved once DerivedMesh is
replaced.
2017-07-21 14:47:26 +02:00
Sergey Sharybin e5ee6cb448 Depsgraph: Remove meaningless comment
We are already on the new depsgraph only for quite some time now.
2017-07-12 11:08:51 +02:00
Luca Rood 913e9350a5 Convert BaseLegacy to Base (part) 2017-04-24 16:09:04 +02:00
Bastien Montagne 3e9ade6e31 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/depsgraph.c
	source/blender/blenkernel/intern/library_query.c
2017-01-31 10:47:43 +01:00
Bastien Montagne b5682a6fdd Cleanup: use 'cb_flag', not 'cd_flag' for library_query callbacks.
`cd_flag` tends to be used for CustomData flags in mesh area, while for
library_query those are rather callback flags...
2017-01-31 10:41:25 +01:00
Sergey Sharybin 5be2a62ca3 Merge branch 'master' into blender2.8 2017-01-24 14:56:56 +01:00
Sergey Sharybin b6ccba9241 Fix typo in comment 2017-01-24 14:56:35 +01:00
Sergey Sharybin 218b06eb83 Depsgraph: Remove legacy updateDepgraph callbacks from modifiers 2017-01-24 12:49:23 +01:00
Lukas Tönne 6ecab6dd8e Revert particle system and point cache removal in blender2.8 branch.
This reverts commit 5aa19be912 and b4a721af69.

Due to postponement of particle system rewrite it was decided to put particle code
back into the 2.8 branch for the time being.
2016-12-28 17:30:58 +01:00
Bastien Montagne faec430914 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/blender_curves.cpp
	source/blender/blenkernel/intern/dynamicpaint.c
	source/blender/blenkernel/intern/particle.c
	source/blender/blenloader/intern/versioning_270.c
	source/blender/editors/physics/particle_edit.c
	source/blender/editors/transform/transform_snap_object.c
	source/blender/editors/util/undo.c
	source/blender/makesrna/intern/rna_object_force.c
2016-05-24 16:48:10 +02:00
Philipp Oeser 7a8bd2eaea Fix T47737: Lattice crashes w/ smooth modifier
Add flag for modifiers that support lattice
2016-05-18 22:46:29 +10:00
Lukas Tönne d8d49befa0 Removed particle system and particle instance modifiers. 2016-04-13 11:45:15 +02:00
Bastien Montagne f375028a25 Modifiers: add 'cd_flag' parameter to their ID looping callbacks, needed
since some IDs (objects) are not 'refcounted' while others (textures) are...

Partial merge from id-remap branch.
2015-10-08 15:05:37 +02:00
Bastien Montagne e5552f8241 Cleanup: use proper `ObjectWalkFunc` typedef in modifiers' object callback func.
Also, fix own stupidity, no need to define ID callback in case we only have objects,
calling code knows to fallback to `foreachObjectLink()` when `foreachIDLink()` is missing...
2015-10-05 15:57:10 +02:00
Sergey Sharybin 3d36489672 OpenSubdiv: Commit of OpenSubdiv integration into Blender
This commit contains all the remained parts needed for initial integration of
OpenSubdiv into Blender's subdivision surface code. Includes both GPU and CPU
backends which works in the following way:

- When SubSurf modifier is the last in the modifiers stack then GPU pipeline
  of OpenSubdiv is used, making viewport performance as fast as possible.

  This also requires graphscard with GLSL 1.5 support. If this requirement is
  not met, then no GPU pipeline is used at all.

- If SubSurf is not a last modifier or if DerivesMesh is being evaluated for
  rendering then CPU limit evaluation API from OpenSubdiv is used. This only
  replaces the legacy evaluation code from CCGSubSurf_legacy, but keeps CCG
  structures exactly the same as they used to be for ages now.

This integration is fully covered with ifdef and not enabled by default
because there are several TODOs to be solved first:

- Face varying data interpolation is not really cleanly implemented for GPU
  in OpenSubdiv 3.0. It is also not implemented for limit evaluation API.

  This basically means we'll have really hard time supporting UVs.

- Limit evaluation only works with adaptivly subdivided meshes so far, which
  basically means all the points of CCG are pushed to the limit. This gives
  different result from old code.

- There are some serious optimizations possible on the topology refiner
  creation, which would speed up initial OpenSubdiv mesh creation.

- There are some hardcoded asumptions in the GPU and DerivedMesh areas which
  could be generalized.

  That's something where Antony and Campbell can help, making it so the code
  is structured in a way which is reusable by all planned viewport projects.

- There are also some workarounds in the dependency graph to make sure OpenGL
  buffers are only freed from the main thread.

Those who'll be wanting to make experiments with this code should grab dev
branch (NOT master) from

  https://github.com/Nazg-Gul/OpenSubdiv/tree/dev

There are some patches applied in there which we're working on on getting
into upstream.
2015-07-20 22:29:26 +02:00
Sergey Sharybin bac7353801 Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:

- More granular dependency relation nature, which solves issues with fake cycles
  in the dependencies.

- Move towards all-animatable, by better integration of drivers into the system.

- Lay down some basis for upcoming copy-on-write, overrides and so on.

The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.

It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.

There are number of assorted documents related on the design of the new system:

* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph

There are also some user-related information online:

* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/

Kudos to everyone who was involved into the project:

- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
  project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
  issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 16:06:37 +05:00
Campbell Barton 268524c025 Cleanup: use const for typeinfo 2015-03-30 21:18:49 +11:00
Campbell Barton b1d758ae6b Cleanup: redundant struct declarations 2015-03-29 03:56:39 +11:00
Sergey Sharybin aa4cb95a5c Pass proper bmain to the updateDepgraph() of modifiers
This is mainly to make physics modifiers being able to work
with it. For other cases this main is not needed.
2015-03-13 12:03:23 +05:00
Sergey Sharybin 67fa545ed0 Make modifier_unique_name return whether modifier was renamed or not 2015-02-13 13:46:51 +05:00
Sergey Sharybin 20550d6f7f Fix T40582: issues with apply scale when having multires and scene simplify
Reshape and applying scale matrix on multires needs to create DM with simplify
setting disabled. Added a special flag to modifier apply for this now.
2014-06-12 13:49:46 +06:00
Campbell Barton 7b7196e3ad Code cleanup: modifier_skin_customdata_ensure was a bad level call 2014-03-16 21:55:30 +11:00
Campbell Barton 2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
Campbell Barton 158b4e61a0 Mesh Modifiers: refactor copying using a generic function 2013-12-22 04:37:26 +11:00
Thomas Dinges f372758257 Interface / Modifiers: Don't show cage placeholder in modifier header, if the current modifier does not support it or the cage is disabled (like Subsurf 0).
This way we save some space but still avoid the jumping around while changing settings in the header itself.

Thanks to Brecht for help on this. :)
2013-12-13 20:57:54 +01:00
Bastien Montagne b375388959 Fix [#37266] Skin modifier can't be copied.
Patch by Martin Felke, many thanks.

When copying that modifier across objects, we also have to ensure that a skin CDLayer is present in dest objects (just as when adding it).
2013-11-01 08:31:36 +00:00
Campbell Barton 9794c70f65 modifiers_isCorrectableDeformed now checks a modifier is enabled before returning true,
also check deformMatricesEM callback for modifier_isCorrectableDeformed() rather then checking modifier types.
2013-09-24 00:56:47 +00:00
Sergey Sharybin 35b61a7512 Move GCC attributes into a centraized defines
Instead of having ifdef __GNUC__ all over the headers
to use special compiler's hints use a special file where
all things like this are concentrated.

Makes code easier to follow and allows to manage special
attributes in more efficient way.

Thanks Campbell for review!
2013-09-01 15:01:15 +00:00
Sergey Sharybin 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
Campbell Barton 418011907c remove nan copyrights from code added since blender become opensource (copy paste errors), also remove BKE_script.h 2013-07-02 10:14:59 +00:00
Campbell Barton d9ec2efe8f move modifier callback wrappers into modifier.c 2013-06-19 08:00:20 +00:00
Campbell Barton 532503e0cb fix for problem with creating weight-paint preview.
In the case where the modifier stack didnt need deform-verts to calculate,
they would not be available for the preview either.

This fixes a bug caused by r57206 which set mirror to preview so the mirrored
weights would be displayed, but it only worked when there was an armature after it, see [#35545].
2013-06-13 00:33:48 +00:00