2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2014 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2015-01-09 21:19:12 +01:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup modifiers
|
2015-01-09 21:19:12 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "BLI_utildefines.h"
|
2019-02-25 11:56:24 +01:00
|
|
|
|
2024-02-19 15:54:48 +01:00
|
|
|
#include "BLT_translation.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
#include "DNA_mesh_types.h"
|
2024-02-19 15:54:48 +01:00
|
|
|
#include "DNA_meshdata_types.h"
|
2015-01-09 21:19:12 +01:00
|
|
|
#include "DNA_modifier_types.h"
|
|
|
|
|
#include "DNA_object_types.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "DNA_screen_types.h"
|
2015-01-09 21:19:12 +01:00
|
|
|
|
2024-02-19 15:54:48 +01:00
|
|
|
#include "BKE_context.hh"
|
2023-11-16 11:41:55 +01:00
|
|
|
#include "BKE_customdata.hh"
|
2015-01-12 12:03:28 +01:00
|
|
|
#include "BKE_data_transfer.h"
|
2024-01-15 12:44:04 -05:00
|
|
|
#include "BKE_lib_id.hh"
|
2024-01-18 12:20:42 +01:00
|
|
|
#include "BKE_lib_query.hh"
|
2023-03-12 22:29:15 +01:00
|
|
|
#include "BKE_mesh.hh"
|
2023-08-02 22:14:18 +02:00
|
|
|
#include "BKE_mesh_mapping.hh"
|
|
|
|
|
#include "BKE_mesh_remap.hh"
|
2023-11-14 09:30:40 +01:00
|
|
|
#include "BKE_modifier.hh"
|
2024-02-19 15:54:48 +01:00
|
|
|
#include "BKE_report.h"
|
|
|
|
|
#include "BKE_screen.hh"
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "UI_interface.hh"
|
|
|
|
|
#include "UI_resources.hh"
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-08-10 22:40:27 +02:00
|
|
|
#include "RNA_access.hh"
|
2022-03-14 16:54:46 +01:00
|
|
|
#include "RNA_prototypes.h"
|
2015-01-09 21:19:12 +01:00
|
|
|
|
2024-02-19 15:54:48 +01:00
|
|
|
#include "DEG_depsgraph_query.hh"
|
|
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
#include "MEM_guardedalloc.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-05-04 18:35:37 +02:00
|
|
|
#include "MOD_ui_common.hh"
|
2024-02-19 15:54:48 +01:00
|
|
|
#include "MOD_util.hh"
|
2015-01-09 21:19:12 +01:00
|
|
|
|
|
|
|
|
/**************************************
|
|
|
|
|
* Modifiers functions. *
|
|
|
|
|
**************************************/
|
2023-07-27 12:04:18 +10:00
|
|
|
static void init_data(ModifierData *md)
|
2015-01-09 21:19:12 +01:00
|
|
|
{
|
|
|
|
|
DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
|
|
|
|
|
int i;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
dtmd->ob_source = nullptr;
|
2015-01-09 21:19:12 +01:00
|
|
|
dtmd->data_types = 0;
|
|
|
|
|
|
|
|
|
|
dtmd->vmap_mode = MREMAP_MODE_VERT_NEAREST;
|
|
|
|
|
dtmd->emap_mode = MREMAP_MODE_EDGE_NEAREST;
|
|
|
|
|
dtmd->lmap_mode = MREMAP_MODE_LOOP_NEAREST_POLYNOR;
|
|
|
|
|
dtmd->pmap_mode = MREMAP_MODE_POLY_NEAREST;
|
|
|
|
|
|
|
|
|
|
dtmd->map_max_distance = 1.0f;
|
|
|
|
|
dtmd->map_ray_radius = 0.0f;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < DT_MULTILAYER_INDEX_MAX; i++) {
|
|
|
|
|
dtmd->layers_select_src[i] = DT_LAYERS_ALL_SRC;
|
|
|
|
|
dtmd->layers_select_dst[i] = DT_LAYERS_NAME_DST;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dtmd->mix_mode = CDT_MIX_TRANSFER;
|
|
|
|
|
dtmd->mix_factor = 1.0f;
|
|
|
|
|
dtmd->defgrp_name[0] = '\0';
|
|
|
|
|
|
|
|
|
|
dtmd->flags = MOD_DATATRANSFER_OBSRC_TRANSFORM;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static void required_data_mask(ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
|
2015-01-09 21:19:12 +01:00
|
|
|
{
|
|
|
|
|
DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
|
|
|
|
|
|
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:13:40 +01:00
|
|
|
if (dtmd->defgrp_name[0] != '\0') {
|
2015-01-09 21:19:12 +01:00
|
|
|
/* We need vertex groups! */
|
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:13:40 +01:00
|
|
|
r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
|
2015-01-09 21:19:12 +01:00
|
|
|
}
|
|
|
|
|
|
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:13:40 +01:00
|
|
|
BKE_object_data_transfer_dttypes_to_cdmask(dtmd->data_types, r_cddata_masks);
|
2015-01-09 21:19:12 +01:00
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static bool depends_on_normals(ModifierData *md)
|
2015-01-09 21:19:12 +01:00
|
|
|
{
|
|
|
|
|
DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
|
|
|
|
|
int item_types = BKE_object_data_transfer_get_dttypes_item_types(dtmd->data_types);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
if ((item_types & ME_VERT) && (dtmd->vmap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if ((item_types & ME_EDGE) && (dtmd->emap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if ((item_types & ME_LOOP) && (dtmd->lmap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if ((item_types & ME_POLY) && (dtmd->pmap_mode & (MREMAP_USE_NORPROJ | MREMAP_USE_NORMAL))) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static void foreach_ID_link(ModifierData *md, Object *ob, IDWalkFunc walk, void *user_data)
|
2015-01-09 21:19:12 +01:00
|
|
|
{
|
|
|
|
|
DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
|
2023-07-27 12:04:18 +10:00
|
|
|
walk(user_data, ob, (ID **)&dtmd->ob_source, IDWALK_CB_NOP);
|
2015-01-09 21:19:12 +01:00
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static void update_depsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
|
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
|
|
|
{
|
|
|
|
|
DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
|
2022-10-02 11:16:14 -05:00
|
|
|
if (dtmd->ob_source != nullptr) {
|
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:13:40 +01:00
|
|
|
CustomData_MeshMasks cddata_masks = {0};
|
|
|
|
|
BKE_object_data_transfer_dttypes_to_cdmask(dtmd->data_types, &cddata_masks);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-12-03 18:09:45 +03:00
|
|
|
DEG_add_object_relation(
|
|
|
|
|
ctx->node, dtmd->ob_source, DEG_OB_COMP_GEOMETRY, "DataTransfer Modifier");
|
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:13:40 +01:00
|
|
|
DEG_add_customdata_mask(ctx->node, dtmd->ob_source, &cddata_masks);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-27 21:14:35 +01:00
|
|
|
if (dtmd->flags & MOD_DATATRANSFER_OBSRC_TRANSFORM) {
|
|
|
|
|
DEG_add_object_relation(
|
|
|
|
|
ctx->node, dtmd->ob_source, DEG_OB_COMP_TRANSFORM, "DataTransfer Modifier");
|
2022-08-04 12:11:31 +02:00
|
|
|
DEG_add_depends_on_transform_relation(ctx->node, "DataTransfer Modifier");
|
2018-11-27 21:14:35 +01:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static bool is_disabled(const Scene * /*scene*/, ModifierData *md, bool /*use_render_params*/)
|
2015-01-09 21:19:12 +01:00
|
|
|
{
|
|
|
|
|
/* If no source object, bypass. */
|
2019-08-23 15:50:53 +02:00
|
|
|
DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
|
|
|
|
|
/* The object type check is only needed here in case we have a placeholder
|
|
|
|
|
* object assigned (because the library containing the mesh is missing).
|
|
|
|
|
*
|
2019-08-31 01:19:22 +10:00
|
|
|
* In other cases it should be impossible to have a type mismatch.
|
2019-08-23 15:50:53 +02:00
|
|
|
*/
|
|
|
|
|
return !dtmd->ob_source || dtmd->ob_source->type != OB_MESH;
|
2015-01-09 21:19:12 +01:00
|
|
|
}
|
|
|
|
|
|
2015-02-15 18:46:46 +01:00
|
|
|
#define DT_TYPES_AFFECT_MESH \
|
|
|
|
|
(DT_TYPE_BWEIGHT_VERT | DT_TYPE_BWEIGHT_EDGE | DT_TYPE_CREASE | DT_TYPE_SHARP_EDGE | \
|
|
|
|
|
DT_TYPE_LNOR | DT_TYPE_SHARP_FACE)
|
2015-01-09 21:19:12 +01:00
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *me_mod)
|
2015-01-09 21:19:12 +01:00
|
|
|
{
|
|
|
|
|
DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
|
2018-06-21 14:39:28 +02:00
|
|
|
Mesh *result = me_mod;
|
2015-01-09 21:19:12 +01:00
|
|
|
ReportList reports;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-08-01 13:53:25 +10:00
|
|
|
/* Only used to check whether we are operating on org data or not... */
|
2023-12-08 16:40:06 -05:00
|
|
|
const Mesh *mesh = static_cast<const Mesh *>(ctx->object->data);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-03-26 11:25:07 +01:00
|
|
|
Object *ob_source = dtmd->ob_source;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
const bool invert_vgroup = (dtmd->flags & MOD_DATATRANSFER_INVERT_VGROUP) != 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
const float max_dist = (dtmd->flags & MOD_DATATRANSFER_MAP_MAXDIST) ? dtmd->map_max_distance :
|
|
|
|
|
FLT_MAX;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
SpaceTransform space_transform_data;
|
|
|
|
|
SpaceTransform *space_transform = (dtmd->flags & MOD_DATATRANSFER_OBSRC_TRANSFORM) ?
|
|
|
|
|
&space_transform_data :
|
2022-10-02 11:16:14 -05:00
|
|
|
nullptr;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
if (space_transform) {
|
2018-12-07 15:45:53 +01:00
|
|
|
BLI_SPACE_TRANSFORM_SETUP(space_transform, ctx->object, ob_source);
|
2015-01-09 21:19:12 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-12-08 16:40:06 -05:00
|
|
|
const blender::Span<blender::float3> me_positions = mesh->vert_positions();
|
|
|
|
|
const blender::Span<blender::int2> me_edges = mesh->edges();
|
2023-06-14 11:59:32 -04:00
|
|
|
const blender::Span<blender::float3> result_positions = result->vert_positions();
|
|
|
|
|
|
Mesh: Move edges to a generic attribute
Implements #95966, as the final step of #95965.
This commit changes the storage of mesh edge vertex indices from the
`MEdge` type to the generic `int2` attribute type. This follows the
general design for geometry and the attribute system, where the data
storage type and the usage semantics are separated.
The main benefit of the change is reduced memory usage-- the
requirements of storing mesh edges is reduced by 1/3. For example,
this saves 8MB on a 1 million vertex grid. This also gives performance
benefits to any memory-bound mesh processing algorithm that uses edges.
Another benefit is that all of the edge's vertex indices are
contiguous. In a few cases, it's helpful to process all of them as
`Span<int>` rather than `Span<int2>`. Similarly, the type is more
likely to match a generic format used by a library, or code that
shouldn't know about specific Blender `Mesh` types.
Various Notes:
- The `.edge_verts` name is used to reflect a mapping between domains,
similar to `.corner_verts`, etc. The period means that it the data
shouldn't change arbitrarily by the user or procedural operations.
- `edge[0]` is now used instead of `edge.v1`
- Signed integers are used instead of unsigned to reduce the mixing
of signed-ness, which can be error prone.
- All of the previously used core mesh data types (`MVert`, `MEdge`,
`MLoop`, `MPoly` are now deprecated. Only generic types are used).
- The `vec2i` DNA type is used in the few C files where necessary.
Pull Request: https://projects.blender.org/blender/blender/pulls/106638
2023-04-17 13:47:41 +02:00
|
|
|
const blender::Span<blender::int2> result_edges = result->edges();
|
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
|
|
|
|
2023-12-08 16:40:06 -05:00
|
|
|
if (((result == mesh) || (me_positions.data() == result_positions.data()) ||
|
2023-02-23 10:39:51 -05:00
|
|
|
(me_edges.data() == result_edges.data())) &&
|
2018-06-21 14:39:28 +02:00
|
|
|
(dtmd->data_types & DT_TYPES_AFFECT_MESH))
|
|
|
|
|
{
|
2020-02-13 14:01:52 +11:00
|
|
|
/* We need to duplicate data here, otherwise setting custom normals, edges' sharpness, etc.,
|
2023-02-12 14:37:16 +11:00
|
|
|
* could modify org mesh, see #43671. */
|
2022-10-02 11:16:14 -05:00
|
|
|
result = (Mesh *)BKE_id_copy_ex(nullptr, &me_mod->id, nullptr, LIB_ID_COPY_LOCALIZE);
|
2015-02-15 18:46:46 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
BKE_reports_init(&reports, RPT_STORE);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-07-03 23:08:40 +10:00
|
|
|
/* NOTE: no islands precision for now here. */
|
2020-08-11 21:46:06 +10:00
|
|
|
if (BKE_object_data_transfer_ex(ctx->depsgraph,
|
|
|
|
|
ob_source,
|
|
|
|
|
ctx->object,
|
|
|
|
|
result,
|
|
|
|
|
dtmd->data_types,
|
|
|
|
|
false,
|
|
|
|
|
dtmd->vmap_mode,
|
|
|
|
|
dtmd->emap_mode,
|
|
|
|
|
dtmd->lmap_mode,
|
|
|
|
|
dtmd->pmap_mode,
|
|
|
|
|
space_transform,
|
|
|
|
|
false,
|
|
|
|
|
max_dist,
|
|
|
|
|
dtmd->map_ray_radius,
|
|
|
|
|
0.0f,
|
|
|
|
|
dtmd->layers_select_src,
|
|
|
|
|
dtmd->layers_select_dst,
|
|
|
|
|
dtmd->mix_mode,
|
|
|
|
|
dtmd->mix_factor,
|
|
|
|
|
dtmd->defgrp_name,
|
|
|
|
|
invert_vgroup,
|
|
|
|
|
&reports))
|
|
|
|
|
{
|
2022-10-12 20:55:26 -05:00
|
|
|
result->runtime->is_original_bmesh = false;
|
2020-08-11 21:46:06 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-09 21:19:12 +01:00
|
|
|
if (BKE_reports_contain(&reports, RPT_ERROR)) {
|
2020-08-11 17:07:15 +10:00
|
|
|
const char *report_str = BKE_reports_string(&reports, RPT_ERROR);
|
2020-10-26 17:07:58 +11:00
|
|
|
BKE_modifier_set_error(ctx->object, md, "%s", report_str);
|
2020-08-11 17:07:15 +10:00
|
|
|
MEM_freeN((void *)report_str);
|
2015-01-09 21:19:12 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-10-13 11:29:59 +02:00
|
|
|
BKE_reports_free(&reports);
|
|
|
|
|
|
2018-06-21 14:39:28 +02:00
|
|
|
return result;
|
2015-01-09 21:19:12 +01:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *sub, *row;
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
|
|
|
|
PointerRNA ob_ptr;
|
2020-09-02 14:13:26 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, true);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(row, ptr, "object", UI_ITEM_NONE, IFACE_("Source"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
sub = uiLayoutRow(row, true);
|
|
|
|
|
uiLayoutSetPropDecorate(sub, false);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(sub, ptr, "use_object_transform", UI_ITEM_NONE, "", ICON_ORIENTATION_GLOBAL);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "mix_mode", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-10-23 14:36:57 +02:00
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
|
uiLayoutSetActive(row,
|
|
|
|
|
!ELEM(RNA_enum_get(ptr, "mix_mode"),
|
|
|
|
|
CDT_MIX_NOMIX,
|
|
|
|
|
CDT_MIX_REPLACE_ABOVE_THRESHOLD,
|
|
|
|
|
CDT_MIX_REPLACE_BELOW_THRESHOLD));
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(row, ptr, "mix_factor", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-10-22 10:25:08 -05:00
|
|
|
uiItemO(layout, IFACE_("Generate Data Layers"), ICON_NONE, "OBJECT_OT_datalayout_transfer");
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
modifier_panel_end(layout, ptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void vertex_panel_draw_header(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "use_vert_data", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void vertex_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
bool use_vert_data = RNA_boolean_get(ptr, "use_vert_data");
|
2020-06-05 10:41:03 -04:00
|
|
|
uiLayoutSetActive(layout, use_vert_data);
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
uiItemR(layout, ptr, "data_types_verts", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "vert_mapping", UI_ITEM_NONE, IFACE_("Mapping"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void vertex_vgroup_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(layout, RNA_enum_get(ptr, "data_types_verts") & DT_TYPE_MDEFORMVERT);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(
|
|
|
|
|
layout, ptr, "layers_vgroup_select_src", UI_ITEM_NONE, IFACE_("Layer Selection"), ICON_NONE);
|
|
|
|
|
uiItemR(
|
|
|
|
|
layout, ptr, "layers_vgroup_select_dst", UI_ITEM_NONE, IFACE_("Layer Mapping"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void edge_panel_draw_header(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "use_edge_data", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void edge_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_edge_data"));
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
uiItemR(layout, ptr, "data_types_edges", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "edge_mapping", UI_ITEM_NONE, IFACE_("Mapping"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void face_corner_panel_draw_header(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "use_loop_data", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void face_corner_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_loop_data"));
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
uiItemR(layout, ptr, "data_types_loops", UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "loop_mapping", UI_ITEM_NONE, IFACE_("Mapping"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void vert_vcol_panel_draw(const bContext * /*C*/, Panel *panel)
|
2022-04-05 11:42:55 -07:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2022-04-05 11:42:55 -07:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
uiLayoutSetActive(layout,
|
|
|
|
|
RNA_enum_get(ptr, "data_types_verts") &
|
|
|
|
|
(DT_TYPE_MPROPCOL_VERT | DT_TYPE_MLOOPCOL_VERT));
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout,
|
|
|
|
|
ptr,
|
|
|
|
|
"layers_vcol_vert_select_src",
|
|
|
|
|
UI_ITEM_NONE,
|
|
|
|
|
IFACE_("Layer Selection"),
|
|
|
|
|
ICON_NONE);
|
|
|
|
|
uiItemR(layout,
|
|
|
|
|
ptr,
|
|
|
|
|
"layers_vcol_vert_select_dst",
|
|
|
|
|
UI_ITEM_NONE,
|
|
|
|
|
IFACE_("Layer Mapping"),
|
|
|
|
|
ICON_NONE);
|
2022-04-05 11:42:55 -07:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void face_corner_vcol_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2022-04-05 11:42:55 -07:00
|
|
|
uiLayoutSetActive(layout,
|
|
|
|
|
RNA_enum_get(ptr, "data_types_loops") &
|
|
|
|
|
(DT_TYPE_MPROPCOL_LOOP | DT_TYPE_MLOOPCOL_LOOP));
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout,
|
|
|
|
|
ptr,
|
|
|
|
|
"layers_vcol_loop_select_src",
|
|
|
|
|
UI_ITEM_NONE,
|
|
|
|
|
IFACE_("Layer Selection"),
|
|
|
|
|
ICON_NONE);
|
|
|
|
|
uiItemR(layout,
|
|
|
|
|
ptr,
|
|
|
|
|
"layers_vcol_loop_select_dst",
|
|
|
|
|
UI_ITEM_NONE,
|
|
|
|
|
IFACE_("Layer Mapping"),
|
|
|
|
|
ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void face_corner_uv_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(layout, RNA_enum_get(ptr, "data_types_loops") & DT_TYPE_UV);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "layers_uv_select_src", UI_ITEM_NONE, IFACE_("Layer Selection"), ICON_NONE);
|
|
|
|
|
uiItemR(layout, ptr, "layers_uv_select_dst", UI_ITEM_NONE, IFACE_("Layer Mapping"), ICON_NONE);
|
|
|
|
|
uiItemR(layout, ptr, "islands_precision", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void face_panel_draw_header(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "use_poly_data", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void face_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_poly_data"));
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "data_types_polys", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "poly_mapping", UI_ITEM_NONE, IFACE_("Mapping"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-03 17:37:25 -05:00
|
|
|
static void advanced_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *row, *sub;
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2022-10-02 11:16:14 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
row = uiLayoutRowWithHeading(layout, true, IFACE_("Max Distance"));
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(row, ptr, "use_max_distance", UI_ITEM_NONE, "", ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
sub = uiLayoutRow(row, true);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max_distance"));
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(sub, ptr, "max_distance", UI_ITEM_NONE, "", ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "ray_radius", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static void panel_register(ARegionType *region_type)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
PanelType *panel_type = modifier_panel_register(
|
|
|
|
|
region_type, eModifierType_DataTransfer, panel_draw);
|
|
|
|
|
PanelType *vertex_panel = modifier_subpanel_register(
|
|
|
|
|
region_type, "vertex", "", vertex_panel_draw_header, vertex_panel_draw, panel_type);
|
2022-10-02 11:16:14 -05:00
|
|
|
modifier_subpanel_register(region_type,
|
|
|
|
|
"vertex_vgroup",
|
|
|
|
|
"Vertex Groups",
|
|
|
|
|
nullptr,
|
|
|
|
|
vertex_vgroup_panel_draw,
|
|
|
|
|
vertex_panel);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2022-04-05 11:42:55 -07:00
|
|
|
modifier_subpanel_register(
|
2022-10-02 11:16:14 -05:00
|
|
|
region_type, "vert_vcol", "Colors", nullptr, vert_vcol_panel_draw, vertex_panel);
|
2022-04-05 11:42:55 -07:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
modifier_subpanel_register(
|
|
|
|
|
region_type, "edge", "", edge_panel_draw_header, edge_panel_draw, panel_type);
|
|
|
|
|
|
|
|
|
|
PanelType *face_corner_panel = modifier_subpanel_register(region_type,
|
|
|
|
|
"face_corner",
|
|
|
|
|
"",
|
|
|
|
|
face_corner_panel_draw_header,
|
|
|
|
|
face_corner_panel_draw,
|
|
|
|
|
panel_type);
|
|
|
|
|
modifier_subpanel_register(region_type,
|
|
|
|
|
"face_corner_vcol",
|
2022-04-05 11:42:55 -07:00
|
|
|
"Colors",
|
2022-10-02 11:16:14 -05:00
|
|
|
nullptr,
|
2020-06-05 10:41:03 -04:00
|
|
|
face_corner_vcol_panel_draw,
|
|
|
|
|
face_corner_panel);
|
|
|
|
|
modifier_subpanel_register(
|
2022-10-02 11:16:14 -05:00
|
|
|
region_type, "face_corner_uv", "UVs", nullptr, face_corner_uv_panel_draw, face_corner_panel);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
modifier_subpanel_register(
|
|
|
|
|
region_type, "face", "", face_panel_draw_header, face_panel_draw, panel_type);
|
|
|
|
|
modifier_subpanel_register(
|
2022-10-02 11:16:14 -05:00
|
|
|
region_type, "advanced", "Topology Mapping", nullptr, advanced_panel_draw, panel_type);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2015-02-15 18:46:46 +01:00
|
|
|
#undef DT_TYPES_AFFECT_MESH
|
2015-01-09 21:19:12 +01:00
|
|
|
|
|
|
|
|
ModifierTypeInfo modifierType_DataTransfer = {
|
2023-07-26 17:08:14 +02:00
|
|
|
/*idname*/ "DataTransfer",
|
2023-01-16 12:41:11 +11:00
|
|
|
/*name*/ N_("DataTransfer"),
|
2023-07-27 12:04:18 +10:00
|
|
|
/*struct_name*/ "DataTransferModifierData",
|
|
|
|
|
/*struct_size*/ sizeof(DataTransferModifierData),
|
2023-01-16 12:41:11 +11:00
|
|
|
/*srna*/ &RNA_DataTransferModifier,
|
2023-11-14 10:03:56 +01:00
|
|
|
/*type*/ ModifierTypeType::NonGeometrical,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*flags*/ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsMapping |
|
2023-12-05 09:30:13 -05:00
|
|
|
eModifierTypeFlag_SupportsEditmode,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*icon*/ ICON_MOD_DATA_TRANSFER,
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
/*copy_data*/ BKE_modifier_copydata_generic,
|
|
|
|
|
|
|
|
|
|
/*deform_verts*/ nullptr,
|
|
|
|
|
/*deform_matrices*/ nullptr,
|
|
|
|
|
/*deform_verts_EM*/ nullptr,
|
|
|
|
|
/*deform_matrices_EM*/ nullptr,
|
|
|
|
|
/*modify_mesh*/ modify_mesh,
|
|
|
|
|
/*modify_geometry_set*/ nullptr,
|
|
|
|
|
|
|
|
|
|
/*init_data*/ init_data,
|
|
|
|
|
/*required_data_mask*/ required_data_mask,
|
|
|
|
|
/*free_data*/ nullptr,
|
|
|
|
|
/*is_disabled*/ is_disabled,
|
|
|
|
|
/*update_depsgraph*/ update_depsgraph,
|
|
|
|
|
/*depends_on_time*/ nullptr,
|
|
|
|
|
/*depends_on_normals*/ depends_on_normals,
|
|
|
|
|
/*foreach_ID_link*/ foreach_ID_link,
|
|
|
|
|
/*foreach_tex_link*/ nullptr,
|
|
|
|
|
/*free_runtime_data*/ nullptr,
|
|
|
|
|
/*panel_register*/ panel_register,
|
|
|
|
|
/*blend_write*/ nullptr,
|
|
|
|
|
/*blend_read*/ nullptr,
|
2024-01-18 22:51:30 +01:00
|
|
|
/*foreach_cache*/ nullptr,
|
2015-01-09 21:19:12 +01:00
|
|
|
};
|