2010-04-11 22:12:30 +00:00
|
|
|
/*
|
2011-10-23 17:52:20 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2020-05-09 17:14:35 +10:00
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2011-10-23 17:52:20 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2005 by the Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
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
|
|
|
*/
|
|
|
|
|
|
2019-02-25 11:56:24 +01:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
2020-08-04 12:55:19 +10:00
|
|
|
#include "BLI_bitmap.h"
|
2019-02-25 11:56:24 +01:00
|
|
|
#include "BLI_math.h"
|
|
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BLT_translation.h"
|
|
|
|
|
|
2020-10-01 09:38:00 -05:00
|
|
|
#include "DNA_defaults.h"
|
2018-05-09 12:38:52 +02:00
|
|
|
#include "DNA_mesh_types.h"
|
2010-04-12 00:36:50 +00:00
|
|
|
#include "DNA_meshdata_types.h"
|
2010-08-04 04:01:27 +00:00
|
|
|
#include "DNA_object_types.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "DNA_screen_types.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
|
|
|
|
#include "BKE_action.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BKE_colortools.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BKE_context.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BKE_deform.h"
|
2018-05-09 12:38:52 +02:00
|
|
|
#include "BKE_editmesh.h"
|
2020-02-10 12:58:59 +01:00
|
|
|
#include "BKE_lib_id.h"
|
|
|
|
|
#include "BKE_lib_query.h"
|
2018-05-09 12:38:52 +02:00
|
|
|
#include "BKE_mesh.h"
|
2020-07-29 18:21:27 +02:00
|
|
|
#include "BKE_mesh_wrapper.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
#include "BKE_modifier.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BKE_screen.h"
|
|
|
|
|
|
|
|
|
|
#include "UI_interface.h"
|
|
|
|
|
#include "UI_resources.h"
|
|
|
|
|
|
2020-06-23 16:42:00 +02:00
|
|
|
#include "BLO_read_write.h"
|
|
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "RNA_access.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2018-12-07 15:45:53 +01:00
|
|
|
#include "DEG_depsgraph_query.h"
|
|
|
|
|
|
2010-04-12 22:33:43 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "MOD_ui_common.h"
|
2011-02-13 14:16:36 +00:00
|
|
|
#include "MOD_util.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2018-06-17 17:04:27 +02:00
|
|
|
static void initData(ModifierData *md)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-10-01 09:38:00 -05:00
|
|
|
BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(hmd, modifier));
|
|
|
|
|
|
|
|
|
|
MEMCPY_STRUCT_AFTER(hmd, DNA_struct_default_get(HookModifierData), modifier);
|
|
|
|
|
|
2019-08-07 03:21:55 +10:00
|
|
|
hmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2018-07-04 12:45:30 +02:00
|
|
|
static void copyData(const ModifierData *md, ModifierData *target, const int flag)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2018-05-08 15:04:10 +02:00
|
|
|
const HookModifierData *hmd = (const HookModifierData *)md;
|
2012-05-06 13:38:33 +00:00
|
|
|
HookModifierData *thmd = (HookModifierData *)target;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-05-08 10:14:02 +02:00
|
|
|
BKE_modifier_copydata_generic(md, target, flag);
|
2013-12-22 04:35:52 +11:00
|
|
|
|
2019-08-07 03:21:55 +10:00
|
|
|
thmd->curfalloff = BKE_curvemapping_copy(hmd->curfalloff);
|
2015-02-04 07:04:21 +11:00
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
thmd->indexar = MEM_dupallocN(hmd->indexar);
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
static void requiredDataMask(Object *UNUSED(ob),
|
|
|
|
|
ModifierData *md,
|
|
|
|
|
CustomData_MeshMasks *r_cddata_masks)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
|
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
/* ask for vertexgroups if we need them */
|
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 (hmd->name[0] != '\0') {
|
|
|
|
|
r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
|
|
|
|
|
}
|
|
|
|
|
if (hmd->indexar != NULL) {
|
|
|
|
|
/* TODO check which origindex are actually needed? */
|
|
|
|
|
r_cddata_masks->vmask |= CD_MASK_ORIGINDEX;
|
|
|
|
|
r_cddata_masks->emask |= CD_MASK_ORIGINDEX;
|
|
|
|
|
r_cddata_masks->pmask |= CD_MASK_ORIGINDEX;
|
|
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void freeData(ModifierData *md)
|
|
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2019-08-07 03:21:55 +10:00
|
|
|
BKE_curvemapping_free(hmd->curfalloff);
|
2015-02-04 07:04:21 +11:00
|
|
|
|
2018-05-08 14:21:02 +02:00
|
|
|
MEM_SAFE_FREE(hmd->indexar);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2018-07-10 12:14:08 +02:00
|
|
|
static bool isDisabled(const struct Scene *UNUSED(scene),
|
|
|
|
|
ModifierData *md,
|
|
|
|
|
bool UNUSED(useRenderParams))
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
|
|
|
|
return !hmd->object;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-01 18:05:23 +02:00
|
|
|
static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-10-01 18:05:23 +02:00
|
|
|
walk(userData, ob, (ID **)&hmd->object, IDWALK_CB_NOP);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2018-02-22 12:54:06 +01:00
|
|
|
static void updateDepsgraph(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
|
|
|
{
|
|
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
|
|
|
|
if (hmd->object != NULL) {
|
|
|
|
|
if (hmd->subtarget[0]) {
|
2018-02-22 12:54:06 +01:00
|
|
|
DEG_add_bone_relation(
|
|
|
|
|
ctx->node, hmd->object, hmd->subtarget, DEG_OB_COMP_BONE, "Hook Modifier");
|
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
|
|
|
}
|
2018-02-22 12:54:06 +01:00
|
|
|
DEG_add_object_relation(ctx->node, hmd->object, DEG_OB_COMP_TRANSFORM, "Hook Modifier");
|
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
|
|
|
}
|
2016-05-11 09:23:11 +02:00
|
|
|
/* We need own transformation as well. */
|
2019-02-12 12:01:17 +01:00
|
|
|
DEG_add_modifier_to_transform_relation(ctx->node, "Hook Modifier");
|
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
|
|
|
}
|
|
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
struct HookData_cb {
|
|
|
|
|
float (*vertexCos)[3];
|
|
|
|
|
|
2020-08-04 12:55:19 +10:00
|
|
|
/**
|
|
|
|
|
* When anything other than -1, use deform groups.
|
|
|
|
|
* This is not the same as checking `dvert` for NULL when we have edit-meshes.
|
|
|
|
|
*/
|
2015-02-04 07:04:21 +11:00
|
|
|
int defgrp_index;
|
|
|
|
|
|
|
|
|
|
struct CurveMapping *curfalloff;
|
|
|
|
|
|
|
|
|
|
char falloff_type;
|
|
|
|
|
float falloff;
|
|
|
|
|
float falloff_sq;
|
|
|
|
|
float fac_orig;
|
|
|
|
|
|
2019-09-19 13:32:36 +10:00
|
|
|
uint use_falloff : 1;
|
|
|
|
|
uint use_uniform : 1;
|
2015-02-04 07:04:21 +11:00
|
|
|
|
|
|
|
|
float cent[3];
|
|
|
|
|
|
|
|
|
|
float mat_uniform[3][3];
|
|
|
|
|
float mat[4][4];
|
2020-02-12 10:34:35 +01:00
|
|
|
|
|
|
|
|
bool invert_vgroup;
|
2015-02-04 07:04:21 +11:00
|
|
|
};
|
|
|
|
|
|
2020-08-04 12:55:19 +10:00
|
|
|
static BLI_bitmap *hook_index_array_to_bitmap(HookModifierData *hmd, const int numVerts)
|
|
|
|
|
{
|
|
|
|
|
BLI_bitmap *indexar_used = BLI_BITMAP_NEW(numVerts, __func__);
|
|
|
|
|
int i;
|
|
|
|
|
int *index_pt;
|
|
|
|
|
for (i = 0, index_pt = hmd->indexar; i < hmd->totindex; i++, index_pt++) {
|
|
|
|
|
const int j = *index_pt;
|
|
|
|
|
if (j < numVerts) {
|
|
|
|
|
BLI_BITMAP_ENABLE(indexar_used, i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return indexar_used;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
static float hook_falloff(const struct HookData_cb *hd, const float len_sq)
|
2010-10-15 08:32:27 +00:00
|
|
|
{
|
2015-02-04 07:04:21 +11:00
|
|
|
BLI_assert(hd->falloff_sq);
|
|
|
|
|
if (len_sq > hd->falloff_sq) {
|
|
|
|
|
return 0.0f;
|
|
|
|
|
}
|
2020-08-07 12:40:29 +02:00
|
|
|
if (len_sq > 0.0f) {
|
2015-02-04 07:04:21 +11:00
|
|
|
float fac;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (hd->falloff_type == eHook_Falloff_Const) {
|
|
|
|
|
fac = 1.0f;
|
|
|
|
|
goto finally;
|
|
|
|
|
}
|
|
|
|
|
else if (hd->falloff_type == eHook_Falloff_InvSquare) {
|
|
|
|
|
/* avoid sqrt below */
|
|
|
|
|
fac = 1.0f - (len_sq / hd->falloff_sq);
|
|
|
|
|
goto finally;
|
2010-10-15 08:32:27 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
fac = 1.0f - (sqrtf(len_sq) / hd->falloff);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
/* closely match PROP_SMOOTH and similar */
|
|
|
|
|
switch (hd->falloff_type) {
|
|
|
|
|
#if 0
|
|
|
|
|
case eHook_Falloff_None:
|
|
|
|
|
fac = 1.0f;
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
case eHook_Falloff_Curve:
|
2019-08-07 03:21:55 +10:00
|
|
|
fac = BKE_curvemapping_evaluateF(hd->curfalloff, 0, fac);
|
2015-02-04 07:04:21 +11:00
|
|
|
break;
|
|
|
|
|
case eHook_Falloff_Sharp:
|
|
|
|
|
fac = fac * fac;
|
|
|
|
|
break;
|
|
|
|
|
case eHook_Falloff_Smooth:
|
|
|
|
|
fac = 3.0f * fac * fac - 2.0f * fac * fac * fac;
|
|
|
|
|
break;
|
|
|
|
|
case eHook_Falloff_Root:
|
|
|
|
|
fac = sqrtf(fac);
|
|
|
|
|
break;
|
|
|
|
|
case eHook_Falloff_Linear:
|
|
|
|
|
/* pass */
|
|
|
|
|
break;
|
|
|
|
|
#if 0
|
|
|
|
|
case eHook_Falloff_Const:
|
|
|
|
|
fac = 1.0f;
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
case eHook_Falloff_Sphere:
|
|
|
|
|
fac = sqrtf(2 * fac - fac * fac);
|
|
|
|
|
break;
|
|
|
|
|
#if 0
|
|
|
|
|
case eHook_Falloff_InvSquare:
|
|
|
|
|
fac = fac * (2.0f - fac);
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
2010-10-15 08:32:27 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
finally:
|
|
|
|
|
return fac * hd->fac_orig;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return hd->fac_orig;
|
2010-10-15 08:32:27 +00:00
|
|
|
}
|
2015-02-04 07:04:21 +11:00
|
|
|
}
|
|
|
|
|
|
2020-08-04 12:55:19 +10:00
|
|
|
static void hook_co_apply(struct HookData_cb *hd, int j, const MDeformVert *dv)
|
2015-02-04 07:04:21 +11:00
|
|
|
{
|
|
|
|
|
float *co = hd->vertexCos[j];
|
|
|
|
|
float fac;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (hd->use_falloff) {
|
|
|
|
|
float len_sq;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (hd->use_uniform) {
|
|
|
|
|
float co_uniform[3];
|
|
|
|
|
mul_v3_m3v3(co_uniform, hd->mat_uniform, co);
|
|
|
|
|
len_sq = len_squared_v3v3(hd->cent, co_uniform);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
len_sq = len_squared_v3v3(hd->cent, co);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
fac = hook_falloff(hd, len_sq);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
fac = hd->fac_orig;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (fac) {
|
2020-08-04 12:55:19 +10:00
|
|
|
if (dv != NULL) {
|
|
|
|
|
fac *= hd->invert_vgroup ? 1.0f - BKE_defvert_find_weight(dv, hd->defgrp_index) :
|
|
|
|
|
BKE_defvert_find_weight(dv, hd->defgrp_index);
|
2015-02-04 07:04:21 +11:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (fac) {
|
|
|
|
|
float co_tmp[3];
|
|
|
|
|
mul_v3_m4v3(co_tmp, hd->mat, co);
|
|
|
|
|
interp_v3_v3v3(co, co, co_tmp, fac);
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-10-15 08:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-12 08:04:56 +02:00
|
|
|
static void deformVerts_do(HookModifierData *hmd,
|
2019-03-26 11:25:07 +01:00
|
|
|
const ModifierEvalContext *UNUSED(ctx),
|
2018-12-07 15:45:53 +01:00
|
|
|
Object *ob,
|
|
|
|
|
Mesh *mesh,
|
2020-08-04 12:55:19 +10:00
|
|
|
BMEditMesh *em,
|
2018-05-12 08:04:56 +02:00
|
|
|
float (*vertexCos)[3],
|
|
|
|
|
int numVerts)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2019-03-26 11:25:07 +01:00
|
|
|
Object *ob_target = hmd->object;
|
2018-12-07 15:45:53 +01:00
|
|
|
bPoseChannel *pchan = BKE_pose_channel_find_name(ob_target->pose, hmd->subtarget);
|
2015-02-04 07:04:21 +11:00
|
|
|
float dmat[4][4];
|
2010-10-15 08:32:27 +00:00
|
|
|
int i, *index_pt;
|
2020-08-04 12:55:19 +10:00
|
|
|
MDeformVert *dvert;
|
2015-02-04 07:04:21 +11:00
|
|
|
struct HookData_cb hd;
|
2020-02-12 10:34:35 +01:00
|
|
|
const bool invert_vgroup = (hmd->flag & MOD_HOOK_INVERT_VGROUP) != 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (hmd->curfalloff == NULL) {
|
|
|
|
|
/* should never happen, but bad lib linking could cause it */
|
2019-08-07 03:21:55 +10:00
|
|
|
hmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
|
2015-02-04 07:04:21 +11:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (hmd->curfalloff) {
|
2020-08-01 13:02:21 +10:00
|
|
|
BKE_curvemapping_init(hmd->curfalloff);
|
2015-02-04 07:04:21 +11:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
/* Generic data needed for applying per-vertex calculations (initialize all members) */
|
|
|
|
|
hd.vertexCos = vertexCos;
|
2020-08-04 12:55:19 +10:00
|
|
|
|
|
|
|
|
MOD_get_vgroup(ob, mesh, hmd->name, &dvert, &hd.defgrp_index);
|
|
|
|
|
int cd_dvert_offset = -1;
|
|
|
|
|
|
2020-09-10 17:58:05 +10:00
|
|
|
if (hd.defgrp_index != -1) {
|
|
|
|
|
/* Edit-mesh. */
|
|
|
|
|
if (em != NULL) {
|
|
|
|
|
cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT);
|
|
|
|
|
if (cd_dvert_offset == -1) {
|
|
|
|
|
hd.defgrp_index = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* Regular mesh. */
|
|
|
|
|
if (dvert == NULL) {
|
|
|
|
|
hd.defgrp_index = -1;
|
|
|
|
|
}
|
2020-08-04 12:55:19 +10:00
|
|
|
}
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
hd.curfalloff = hmd->curfalloff;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
hd.falloff_type = hmd->falloff_type;
|
|
|
|
|
hd.falloff = (hmd->falloff_type == eHook_Falloff_None) ? 0.0f : hmd->falloff;
|
2020-03-06 17:18:10 +01:00
|
|
|
hd.falloff_sq = square_f(hd.falloff);
|
2015-02-04 07:04:21 +11:00
|
|
|
hd.fac_orig = hmd->force;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
hd.use_falloff = (hd.falloff_sq != 0.0f);
|
|
|
|
|
hd.use_uniform = (hmd->flag & MOD_HOOK_UNIFORM_SPACE) != 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-02-12 10:34:35 +01:00
|
|
|
hd.invert_vgroup = invert_vgroup;
|
|
|
|
|
|
2015-02-04 07:04:21 +11:00
|
|
|
if (hd.use_uniform) {
|
|
|
|
|
copy_m3_m4(hd.mat_uniform, hmd->parentinv);
|
|
|
|
|
mul_v3_m3v3(hd.cent, hd.mat_uniform, hmd->cent);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
unit_m3(hd.mat_uniform); /* unused */
|
|
|
|
|
copy_v3_v3(hd.cent, hmd->cent);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
/* get world-space matrix of target, corrected for the space the verts are in */
|
|
|
|
|
if (hmd->subtarget[0] && pchan) {
|
|
|
|
|
/* bone target if there's a matching pose-channel */
|
2018-12-07 15:45:53 +01:00
|
|
|
mul_m4_m4m4(dmat, ob_target->obmat, pchan->pose_mat);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* just object target */
|
2018-12-07 15:45:53 +01:00
|
|
|
copy_m4_m4(dmat, ob_target->obmat);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
invert_m4_m4(ob->imat, ob->obmat);
|
2015-02-04 07:04:21 +11:00
|
|
|
mul_m4_series(hd.mat, ob->imat, dmat, hmd->parentinv);
|
|
|
|
|
/* --- done with 'hd' init --- */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-10-15 08:32:27 +00:00
|
|
|
/* Regarding index range checking below.
|
|
|
|
|
*
|
2018-05-09 12:38:52 +02:00
|
|
|
* This should always be true and I don't generally like
|
2010-10-15 08:32:27 +00:00
|
|
|
* "paranoid" style code like this, but old files can have
|
|
|
|
|
* indices that are out of range because old blender did
|
2020-03-12 12:24:15 +11:00
|
|
|
* not correct them on exit edit-mode. - zr
|
2010-10-15 08:32:27 +00:00
|
|
|
*/
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-24 06:24:53 +00:00
|
|
|
if (hmd->force == 0.0f) {
|
2010-10-15 08:32:27 +00:00
|
|
|
/* do nothing, avoid annoying checks in the loop */
|
|
|
|
|
}
|
2012-03-24 06:24:53 +00:00
|
|
|
else if (hmd->indexar) { /* vertex indices? */
|
2010-10-15 08:32:27 +00:00
|
|
|
const int *origindex_ar;
|
2018-05-09 12:38:52 +02:00
|
|
|
/* if mesh is present and has original index data, use it */
|
|
|
|
|
if (mesh && (origindex_ar = CustomData_get_layer(&mesh->vdata, CD_ORIGINDEX))) {
|
2020-08-04 12:55:19 +10:00
|
|
|
int numVerts_orig = numVerts;
|
|
|
|
|
if (ob->type == OB_MESH) {
|
|
|
|
|
const Mesh *me_orig = ob->data;
|
|
|
|
|
numVerts_orig = me_orig->totvert;
|
|
|
|
|
}
|
|
|
|
|
BLI_bitmap *indexar_used = hook_index_array_to_bitmap(hmd, numVerts_orig);
|
|
|
|
|
for (i = 0; i < numVerts; i++) {
|
|
|
|
|
int i_orig = origindex_ar[i];
|
|
|
|
|
BLI_assert(i_orig < numVerts_orig);
|
|
|
|
|
if (BLI_BITMAP_TEST(indexar_used, i_orig)) {
|
|
|
|
|
hook_co_apply(&hd, i, dvert ? &dvert[i] : NULL);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
}
|
2020-08-04 12:55:19 +10:00
|
|
|
MEM_freeN(indexar_used);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
2018-05-09 12:38:52 +02:00
|
|
|
else { /* missing mesh or ORIGINDEX */
|
2020-08-04 12:55:19 +10:00
|
|
|
if ((em != NULL) && (hd.defgrp_index != -1)) {
|
|
|
|
|
BLI_assert(em->bm->totvert == numVerts);
|
|
|
|
|
BLI_bitmap *indexar_used = hook_index_array_to_bitmap(hmd, numVerts);
|
|
|
|
|
BMIter iter;
|
|
|
|
|
BMVert *v;
|
|
|
|
|
BM_ITER_MESH_INDEX (v, &iter, em->bm, BM_VERTS_OF_MESH, i) {
|
|
|
|
|
if (BLI_BITMAP_TEST(indexar_used, i)) {
|
|
|
|
|
const MDeformVert *dv = BM_ELEM_CD_GET_VOID_P(v, cd_dvert_offset);
|
|
|
|
|
hook_co_apply(&hd, i, dv);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
MEM_freeN(indexar_used);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
for (i = 0, index_pt = hmd->indexar; i < hmd->totindex; i++, index_pt++) {
|
|
|
|
|
const int j = *index_pt;
|
|
|
|
|
if (j < numVerts) {
|
|
|
|
|
hook_co_apply(&hd, j, dvert ? &dvert[j] : NULL);
|
|
|
|
|
}
|
2010-10-15 08:32:27 +00:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
}
|
2010-10-15 08:32:27 +00:00
|
|
|
}
|
2020-08-04 12:55:19 +10:00
|
|
|
else if (hd.defgrp_index != -1) { /* vertex group hook */
|
|
|
|
|
if (em != NULL) {
|
|
|
|
|
BLI_assert(em->bm->totvert == numVerts);
|
|
|
|
|
BMIter iter;
|
|
|
|
|
BMVert *v;
|
|
|
|
|
BM_ITER_MESH_INDEX (v, &iter, em->bm, BM_VERTS_OF_MESH, i) {
|
|
|
|
|
const MDeformVert *dv = BM_ELEM_CD_GET_VOID_P(v, cd_dvert_offset);
|
|
|
|
|
hook_co_apply(&hd, i, dv);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
BLI_assert(dvert != NULL);
|
|
|
|
|
for (i = 0; i < numVerts; i++) {
|
|
|
|
|
hook_co_apply(&hd, i, &dvert[i]);
|
|
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-12 08:21:07 +02:00
|
|
|
static void deformVerts(struct ModifierData *md,
|
|
|
|
|
const struct ModifierEvalContext *ctx,
|
|
|
|
|
struct Mesh *mesh,
|
|
|
|
|
float (*vertexCos)[3],
|
|
|
|
|
int numVerts)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2018-05-09 12:38:52 +02:00
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
2018-11-27 17:21:16 +01:00
|
|
|
Mesh *mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false);
|
2011-12-15 08:57:48 +00:00
|
|
|
|
2020-08-04 12:55:19 +10:00
|
|
|
deformVerts_do(hmd, ctx, ctx->object, mesh_src, NULL, vertexCos, numVerts);
|
2018-05-09 17:37:54 +02:00
|
|
|
|
2018-11-27 20:10:41 +01:00
|
|
|
if (!ELEM(mesh_src, NULL, mesh)) {
|
2018-05-09 17:37:54 +02:00
|
|
|
BKE_id_free(NULL, mesh_src);
|
|
|
|
|
}
|
2011-12-08 15:50:28 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-12 08:04:56 +02:00
|
|
|
static void deformVertsEM(struct ModifierData *md,
|
2018-05-12 08:21:07 +02:00
|
|
|
const struct ModifierEvalContext *ctx,
|
|
|
|
|
struct BMEditMesh *editData,
|
|
|
|
|
struct Mesh *mesh,
|
|
|
|
|
float (*vertexCos)[3],
|
|
|
|
|
int numVerts)
|
2011-12-08 15:50:28 +00:00
|
|
|
{
|
2018-05-09 12:38:52 +02:00
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-08-04 12:55:19 +10:00
|
|
|
deformVerts_do(hmd, ctx, ctx->object, mesh, mesh ? NULL : editData, vertexCos, numVerts);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
static void panel_draw(const bContext *UNUSED(C), Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *row, *col;
|
|
|
|
|
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
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
PointerRNA hook_object_ptr = RNA_pointer_get(ptr, "object");
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(col, ptr, "object", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
if (!RNA_pointer_is_null(&hook_object_ptr) &&
|
|
|
|
|
RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) {
|
|
|
|
|
PointerRNA hook_object_data_ptr = RNA_pointer_get(&hook_object_ptr, "data");
|
|
|
|
|
uiItemPointerR(
|
2020-09-02 14:13:26 -05:00
|
|
|
col, ptr, "subtarget", &hook_object_data_ptr, "bones", IFACE_("Bone"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
2020-09-02 14:13:26 -05:00
|
|
|
modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "strength", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
if (RNA_enum_get(&ob_ptr, "mode") == OB_MODE_EDIT) {
|
|
|
|
|
row = uiLayoutRow(layout, true);
|
2020-10-22 10:25:08 -05:00
|
|
|
uiItemO(row, IFACE_("Reset"), ICON_NONE, "OBJECT_OT_hook_reset");
|
|
|
|
|
uiItemO(row, IFACE_("Recenter"), ICON_NONE, "OBJECT_OT_hook_recenter");
|
2020-06-05 10:41:03 -04:00
|
|
|
row = uiLayoutRow(layout, true);
|
2020-10-22 10:25:08 -05:00
|
|
|
uiItemO(row, IFACE_("Select"), ICON_NONE, "OBJECT_OT_hook_select");
|
|
|
|
|
uiItemO(row, IFACE_("Assign"), ICON_NONE, "OBJECT_OT_hook_assign");
|
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
|
|
|
}
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
static void falloff_panel_draw(const bContext *UNUSED(C), Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *row;
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
bool use_falloff = RNA_enum_get(ptr, "falloff_type") != eWarp_Falloff_None;
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, use_falloff);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(row, ptr, "falloff_radius", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "use_falloff_uniform", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
if (RNA_enum_get(ptr, "falloff_type") == eWarp_Falloff_Curve) {
|
|
|
|
|
uiTemplateCurveMapping(layout, ptr, "falloff_curve", 0, false, false, false, false);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void panelRegister(ARegionType *region_type)
|
|
|
|
|
{
|
|
|
|
|
PanelType *panel_type = modifier_panel_register(region_type, eModifierType_Hook, panel_draw);
|
|
|
|
|
modifier_subpanel_register(
|
|
|
|
|
region_type, "falloff", "Falloff", NULL, falloff_panel_draw, panel_type);
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-23 16:42:00 +02:00
|
|
|
static void blendWrite(BlendWriter *writer, const ModifierData *md)
|
|
|
|
|
{
|
|
|
|
|
const HookModifierData *hmd = (const HookModifierData *)md;
|
|
|
|
|
|
|
|
|
|
if (hmd->curfalloff) {
|
|
|
|
|
BKE_curvemapping_blend_write(writer, hmd->curfalloff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BLO_write_int32_array(writer, hmd->totindex, hmd->indexar);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void blendRead(BlendDataReader *reader, ModifierData *md)
|
|
|
|
|
{
|
|
|
|
|
HookModifierData *hmd = (HookModifierData *)md;
|
|
|
|
|
|
|
|
|
|
BLO_read_data_address(reader, &hmd->curfalloff);
|
|
|
|
|
if (hmd->curfalloff) {
|
|
|
|
|
BKE_curvemapping_blend_read(reader, hmd->curfalloff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BLO_read_int32_array(reader, hmd->totindex, &hmd->indexar);
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
ModifierTypeInfo modifierType_Hook = {
|
|
|
|
|
/* name */ "Hook",
|
|
|
|
|
/* structName */ "HookModifierData",
|
|
|
|
|
/* structSize */ sizeof(HookModifierData),
|
2020-09-25 12:49:18 +02:00
|
|
|
/* srna */ &RNA_HookModifier,
|
2010-04-11 22:12:30 +00:00
|
|
|
/* type */ eModifierTypeType_OnlyDeform,
|
2020-04-21 13:09:41 +02:00
|
|
|
/* flags */ eModifierTypeFlag_AcceptsCVs | eModifierTypeFlag_AcceptsVertexCosOnly |
|
2012-05-06 13:38:33 +00:00
|
|
|
eModifierTypeFlag_SupportsEditmode,
|
2020-09-25 12:45:30 +02:00
|
|
|
/* icon */ ICON_HOOK,
|
2010-04-11 22:12:30 +00:00
|
|
|
/* copyData */ copyData,
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-09 12:38:52 +02:00
|
|
|
/* deformVerts */ deformVerts,
|
2011-03-05 10:29:10 +00:00
|
|
|
/* deformMatrices */ NULL,
|
2018-05-09 12:38:52 +02:00
|
|
|
/* deformVertsEM */ deformVertsEM,
|
2011-03-05 10:29:10 +00:00
|
|
|
/* deformMatricesEM */ NULL,
|
2020-04-21 13:09:41 +02:00
|
|
|
/* modifyMesh */ NULL,
|
|
|
|
|
/* modifyHair */ NULL,
|
2020-12-10 14:35:02 +01:00
|
|
|
/* modifyGeometrySet */ NULL,
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
/* initData */ initData,
|
|
|
|
|
/* requiredDataMask */ requiredDataMask,
|
|
|
|
|
/* freeData */ freeData,
|
|
|
|
|
/* isDisabled */ isDisabled,
|
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
|
|
|
/* updateDepsgraph */ updateDepsgraph,
|
2011-03-05 10:29:10 +00:00
|
|
|
/* dependsOnTime */ NULL,
|
|
|
|
|
/* dependsOnNormals */ NULL,
|
2020-10-01 18:05:23 +02:00
|
|
|
/* foreachIDLink */ foreachIDLink,
|
2011-08-12 18:11:22 +00:00
|
|
|
/* foreachTexLink */ NULL,
|
2019-03-18 15:56:16 +01:00
|
|
|
/* freeRuntimeData */ NULL,
|
2020-06-05 10:41:03 -04:00
|
|
|
/* panelRegister */ panelRegister,
|
2020-06-23 16:42:00 +02:00
|
|
|
/* blendWrite */ blendWrite,
|
|
|
|
|
/* blendRead */ blendRead,
|
2010-04-11 22:12:30 +00:00
|
|
|
};
|