2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup modifiers
|
2011-02-25 13:57:17 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2011-02-13 14:16:36 +00:00
|
|
|
/* so modifier types match their defines */
|
|
|
|
|
#include "MOD_modifiertypes.h"
|
|
|
|
|
|
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 15:05:57 +05:00
|
|
|
#include "DEG_depsgraph_build.h"
|
|
|
|
|
|
2022-05-09 16:59:31 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-07-11 09:15:20 +00:00
|
|
|
struct MDeformVert;
|
2018-04-25 16:47:52 +02:00
|
|
|
struct Mesh;
|
2010-04-11 22:12:30 +00:00
|
|
|
struct ModifierData;
|
2018-12-07 15:45:53 +01:00
|
|
|
struct ModifierEvalContext;
|
2011-07-11 09:15:20 +00:00
|
|
|
struct Object;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2018-12-07 15:45:53 +01:00
|
|
|
void MOD_init_texture(struct MappingInfoModifierData *dmd, const struct ModifierEvalContext *ctx);
|
2021-12-08 17:12:33 +11:00
|
|
|
/**
|
|
|
|
|
* \param cos: may be NULL, in which case we use directly mesh vertices' coordinates.
|
|
|
|
|
*/
|
2018-05-07 18:14:15 +02:00
|
|
|
void MOD_get_texture_coords(struct MappingInfoModifierData *dmd,
|
2018-12-07 15:45:53 +01:00
|
|
|
const struct ModifierEvalContext *ctx,
|
2018-05-07 18:14:15 +02:00
|
|
|
struct Object *ob,
|
|
|
|
|
struct Mesh *mesh,
|
2018-05-08 11:57:34 +02:00
|
|
|
float (*cos)[3],
|
2018-05-07 18:14:15 +02:00
|
|
|
float (*r_texco)[3]);
|
2018-06-29 19:02:19 +02:00
|
|
|
|
2020-09-04 20:59:13 +02:00
|
|
|
void MOD_previous_vcos_store(struct ModifierData *md, const float (*vert_coords)[3]);
|
2018-06-29 19:02:19 +02:00
|
|
|
|
2021-12-08 17:12:33 +11:00
|
|
|
/**
|
|
|
|
|
* \returns a mesh if mesh == NULL, for deforming modifiers that need it.
|
|
|
|
|
*/
|
2018-11-27 17:21:16 +01:00
|
|
|
struct Mesh *MOD_deform_mesh_eval_get(struct Object *ob,
|
2018-05-12 08:21:07 +02:00
|
|
|
struct BMEditMesh *em,
|
|
|
|
|
struct Mesh *mesh,
|
2020-06-12 14:29:59 +10:00
|
|
|
const float (*vertexCos)[3],
|
2022-03-28 12:29:47 +11:00
|
|
|
int verts_num,
|
2022-01-07 11:38:08 +11:00
|
|
|
bool use_orco);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-29 19:02:19 +02:00
|
|
|
void MOD_get_vgroup(struct Object *ob,
|
2018-05-12 08:21:07 +02:00
|
|
|
struct Mesh *mesh,
|
|
|
|
|
const char *name,
|
Mesh: Remove redundant custom data pointers
For copy-on-write, we want to share attribute arrays between meshes
where possible. Mutable pointers like `Mesh.mvert` make that difficult
by making ownership vague. They also make code more complex by adding
redundancy.
The simplest solution is just removing them and retrieving layers from
`CustomData` as needed. Similar changes have already been applied to
curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of
the pointers generally makes code more obvious and more reusable.
Mesh data is now accessed with a C++ API (`Mesh::edges()` or
`Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`).
The CoW changes this commit makes possible are described in T95845
and T95842, and started in D14139 and D14140. The change also simplifies
the ongoing mesh struct-of-array refactors from T95965.
**RNA/Python Access Performance**
Theoretically, accessing mesh elements with the RNA API may become
slower, since the layer needs to be found on every random access.
However, overhead is already high enough that this doesn't make a
noticible differenc, and performance is actually improved in some
cases. Random access can be up to 10% faster, but other situations
might be a bit slower. Generally using `foreach_get/set` are the best
way to improve performance. See the differential revision for more
discussion about Python performance.
Cycles has been updated to use raw pointers and the internal Blender
mesh types, mostly because there is no sense in having this overhead
when it's already compiled with Blender. In my tests this roughly
halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million
face grid).
Differential Revision: https://developer.blender.org/D15488
2022-09-05 11:56:34 -05:00
|
|
|
const struct MDeformVert **dvert,
|
2018-05-12 08:21:07 +02:00
|
|
|
int *defgrp_index);
|
2010-04-25 01:10:03 +00:00
|
|
|
|
2020-04-10 22:00:21 +02:00
|
|
|
void MOD_depsgraph_update_object_bone_relation(struct DepsNodeHandle *node,
|
|
|
|
|
struct Object *object,
|
|
|
|
|
const char *bonename,
|
|
|
|
|
const char *description);
|
2022-05-09 16:59:31 +02:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
2022-05-19 10:02:28 +10:00
|
|
|
#endif
|