Instead of keeping track of a local array of positions in the modifier stack itself, use the existing edit mode SoA "edit cache" which already contains a contiguous array of positions. Combined with positions as a generic attribute, this means the state is contained just in the mesh (and the geometry set) making the code much easier to follow. To do this we make more use of the mesh wrapper system, where we can pass a `Mesh` that's actually stored with a `BMesh` and the extra cached array of positions. This also resolves some confusion-- it was weird to have the mesh wrapper system for this purpose but not use it. Since we always created a wrapped mesh in edit mode, there's no need for `MOD_deform_mesh_eval_get` at all anymore. That function was quite confusing with "eval" in its name when it really retrieved the original mesh. Many deform modifiers had placeholder edit mode evaluation functions. Since these didn't do anything and since the priority is node-based deformation now, I removed these. The case is documented more in the modifier type struct callbacks. Pull Request: https://projects.blender.org/blender/blender/pulls/108637
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup modifiers
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
/* so modifier types match their defines */
|
|
#include "MOD_modifiertypes.hh"
|
|
|
|
#include "DEG_depsgraph_build.h"
|
|
|
|
struct MDeformVert;
|
|
struct Mesh;
|
|
struct ModifierData;
|
|
struct ModifierEvalContext;
|
|
struct Object;
|
|
|
|
void MOD_init_texture(MappingInfoModifierData *dmd, const ModifierEvalContext *ctx);
|
|
/**
|
|
* \param cos: may be null, in which case we use directly mesh vertices' coordinates.
|
|
*/
|
|
void MOD_get_texture_coords(MappingInfoModifierData *dmd,
|
|
const ModifierEvalContext *ctx,
|
|
Object *ob,
|
|
Mesh *mesh,
|
|
float (*cos)[3],
|
|
float (*r_texco)[3]);
|
|
|
|
void MOD_previous_vcos_store(ModifierData *md, const float (*vert_coords)[3]);
|
|
|
|
void MOD_get_vgroup(const Object *ob,
|
|
const Mesh *mesh,
|
|
const char *name,
|
|
const MDeformVert **dvert,
|
|
int *defgrp_index);
|
|
|
|
void MOD_depsgraph_update_object_bone_relation(DepsNodeHandle *node,
|
|
Object *object,
|
|
const char *bonename,
|
|
const char *description);
|