Commit Graph

16 Commits

Author SHA1 Message Date
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
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
Bastien Montagne b80cce2053 Cleanup: names: data transfer/mesh remap: dm -> me/mesh.
That area is now officially purged from the Devil.. errr... DerivedMesh!
2018-06-21 15:33:10 +02:00
Bastien Montagne ef90a8e12c Cleanup: data transfer: get rid of dual destination mesh.
Not needed anymore, we only actually need to know wether it's orig mesh
or eval one in a few places...
2018-06-21 15:33:10 +02:00
Bastien Montagne fffff5a993 Cleanup: nuke DM out of data transfer code.
This was actually rather hairy, this code is huge and complicated, easy
to make mistakes...

Good thing is, it will allow for significant simplification and more
(name) cleanup in following commits ;)
2018-06-21 15:33:10 +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 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
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
Campbell Barton e4b716a03f Cleanup: warnings, style 2015-07-25 07:44:25 +10:00
Bastien Montagne dd44754c5f Data Transfer: Add an option to 'auto-transform' destination mesh so that it matches best the source one.
This allows to match and transfer data between two meshes with similar shape but complete arbitrary different transform.

Note that the result will be best if the meshes (more precisely, their vertices) are exact copies of each other.
Otherwise, method used can only perform an approximated best match, which means you'll likely get better
results if you 'visually' make them match in 3D space (and use 'Object Transform') instead.
2015-07-13 18:05:38 +02:00
Bastien Montagne 2c3e4fbd7e Add Custom Loop Normals to Data Transfer.
Titles says everything, just two notes:
* We have to actually transfer plain *normals*, not 'compressed' clnors,
  so had to add pre/post process to transfer to make the conversions.
* Also added interpolation and advanced copy/mixing to CD_NORMAL, for same reasons.
2015-02-05 14:38:59 +01:00
Campbell Barton ca0605b3ae cleanup: minor edits 2015-01-14 23:53:39 +11:00
Bastien Montagne a3bfaa481f Cleanup: rename BKE's 'object_data_transfer' to 'data_transfer' to avoid same file names with ED_object's one. 2015-01-12 12:05:47 +01:00