Blender V5.3
DNA_modifier_enums.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9
10#pragma once
11
12#include "BLI_enum_flags.hh"
13
14namespace blender {
15
16/* Grease Pencil Modifiers */
17
29
34
37 GP_NOISE_MOD_LOCATION = (1 << 1), /* Deprecated (only for versioning). */
38 GP_NOISE_MOD_STRENGTH = (1 << 2), /* Deprecated (only for versioning). */
39 GP_NOISE_MOD_THICKNESS = (1 << 3), /* Deprecated (only for versioning). */
45 GP_NOISE_MOD_UV = (1 << 9), /* Deprecated (only for versioning). */
48};
50
55
66
71
72/* Shrink-wrap Modifier */
73
81
95
102
107
108#ifdef DNA_DEPRECATED_ALLOW
110 MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE = (1 << 5),
111#endif
112
115};
117
118#define MOD_SHRINKWRAP_CULL_TARGET_MASK \
119 (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)
120
130
131/* TransferData modifier */
132
164
165#define DT_DATATYPE_IS_VERT(_dt) \
166 ELEM(_dt, \
167 DT_TYPE_MDEFORMVERT, \
168 DT_TYPE_SKIN, \
169 DT_TYPE_BWEIGHT_VERT, \
170 DT_TYPE_MLOOPCOL_VERT, \
171 DT_TYPE_MPROPCOL_VERT, \
172 DT_TYPE_MPROPCOL_VERT | DT_TYPE_MLOOPCOL_VERT)
173#define DT_DATATYPE_IS_EDGE(_dt) \
174 ELEM(_dt, \
175 DT_TYPE_CREASE, \
176 DT_TYPE_SHARP_EDGE, \
177 DT_TYPE_SEAM, \
178 DT_TYPE_BWEIGHT_EDGE, \
179 DT_TYPE_FREESTYLE_EDGE)
180#define DT_DATATYPE_IS_LOOP(_dt) \
181 ELEM(_dt, \
182 DT_TYPE_UV, \
183 DT_TYPE_LNOR, \
184 DT_TYPE_MLOOPCOL_LOOP, \
185 DT_TYPE_MPROPCOL_LOOP, \
186 DT_TYPE_MPROPCOL_LOOP | DT_TYPE_MLOOPCOL_LOOP)
187#define DT_DATATYPE_IS_FACE(_dt) ELEM(_dt, DT_TYPE_UV, DT_TYPE_SHARP_FACE, DT_TYPE_FREESTYLE_FACE)
188#define DT_DATATYPE_IS_MULTILAYERS(_dt) \
189 ELEM(_dt, \
190 DT_TYPE_MDEFORMVERT, \
191 DT_TYPE_MPROPCOL_VERT, \
192 DT_TYPE_MLOOPCOL_VERT, \
193 DT_TYPE_MPROPCOL_VERT | DT_TYPE_MLOOPCOL_VERT, \
194 DT_TYPE_MPROPCOL_LOOP, \
195 DT_TYPE_MLOOPCOL_LOOP, \
196 DT_TYPE_MPROPCOL_LOOP | DT_TYPE_MLOOPCOL_LOOP, \
197 DT_TYPE_UV)
198
207
208/* Below we keep positive values for real layers idx (generated dynamically). */
209
210/* How to select data layers, for types supporting multi-layers.
211 * Here too, some options are highly dependent on type of transferred data! */
212enum eDTLayersSrc : int {
215 /* Datatype-specific. */
219 /* Other types-related modes... */
220};
221
222/* How to map a source layer to a destination layer, for types supporting multi-layers.
223 * NOTE: if no matching layer can be found, it will be created. */
224enum eDTLayersDst : int {
225 DT_LAYERS_ACTIVE_DST = -1, /* Only for DT_LAYERS_FROMSEL_ACTIVE. */
228#if 0 /* TODO */
229 DT_LAYERS_CREATE_DST = -4, /* Never replace existing data in dst, always create new layers. */
230#endif
231};
232
233/* TODO:
234 * Add other 'from/to' mapping sources, like e.g. using a UVMap, etc.
235 * https://blenderartists.org/t/619105
236 *
237 * We could also use similar topology mappings inside a same mesh
238 * (cf. Campbell's 'select face islands from similar topology' WIP work).
239 * Also, users will have to check, whether we can get rid of some modes here,
240 * not sure all will be useful!
241 */
242enum eMRemapMode : int {
247
252
253 /* ***** Target's vertices ***** */
255 /* Nearest source vert. */
257
258 /* Nearest vertex of nearest edge. */
260 /* This one uses two verts of selected edge (weighted interpolation). */
261 /* Nearest point on nearest edge. */
264
265 /* Nearest vertex of nearest face. */
267 /* Those two use all verts of selected face (weighted interpolation). */
268 /* Nearest point on nearest face. */
271 /* Point on nearest face hit by ray from target vertex's normal. */
274
275 /* ***** Target's edges ***** */
277
278 /* Source edge which both vertices are nearest of destination ones. */
280
281 /* Nearest source edge (using mid-point). */
283
284 /* Nearest edge of nearest face (using mid-point). */
286
287 /* Cast a set of rays from along destination edge,
288 * interpolating its vertices' normals, and use hit source edges. */
291
292 /* ***** Target's loops ***** */
293 /* NOTE: when islands are given to loop mapping func,
294 * all loops from the same destination face will always be mapped
295 * to loops of source faces within a same island, regardless of mapping mode. */
297
298 /* Best normal-matching loop from nearest vert. */
301 /* Loop from best normal-matching face from nearest vert. */
304
305 /* Loop from nearest vertex of nearest face. */
307 /* Those two use all verts of selected face (weighted interpolation). */
308 /* Nearest point on nearest face. */
311 /* Point on nearest face hit by ray from target loop's normal. */
314
315 /* ***** Target's faces ***** */
317
318 /* Nearest source face. */
320 /* Source face from best normal-matching destination face. */
322
323 /* Project destination face onto source mesh using its normal,
324 * and use interpolation of all intersecting source faces. */
327
328 /* ***** Same topology, applies to all four elements types. ***** */
330};
332
333
336enum eCDTMixMode : int {
337 CDT_MIX_NOMIX = -1, /* Special case, only used because we abuse 'copy' CD callback. */
345 /* Etc. */
346};
347
348} // namespace blender
#define ENUM_OPERATORS(_enum_type)
BMesh Iterators.
@ CDT_MIX_REPLACE_ABOVE_THRESHOLD
@ CDT_MIX_REPLACE_BELOW_THRESHOLD
@ DT_MULTILAYER_INDEX_VCOL_VERT
@ DT_MULTILAYER_INDEX_MDEFORMVERT
@ DT_MULTILAYER_INDEX_INVALID
@ DT_MULTILAYER_INDEX_VCOL_LOOP
@ MREMAP_MODE_VERT_EDGEINTERP_NEAREST
@ MREMAP_MODE_LOOP_NEAREST_LOOPNOR
@ MREMAP_MODE_VERT_POLYINTERP_VNORPROJ
@ MREMAP_MODE_EDGE_VERT_NEAREST
@ MREMAP_MODE_EDGE_EDGEINTERP_VNORPROJ
@ MREMAP_MODE_VERT_FACE_NEAREST
@ MREMAP_MODE_LOOP_POLYINTERP_LNORPROJ
@ MREMAP_MODE_LOOP_POLYINTERP_NEAREST
@ MREMAP_MODE_POLY_POLYINTERP_PNORPROJ
@ MREMAP_MODE_LOOP_NEAREST_POLYNOR
@ MREMAP_MODE_VERT_EDGE_NEAREST
@ MREMAP_MODE_VERT_POLYINTERP_NEAREST
@ MREMAP_MODE_LOOP_POLY_NEAREST
@ MREMAP_MODE_EDGE_POLY_NEAREST
@ GP_ARRAY_UNIFORM_RANDOM_SCALE
@ GP_ARRAY_INVERT_LAYERPASS
@ GP_LENGTH_INVERT_CURVATURE
@ GP_LENGTH_INVERT_LAYERPASS
@ GP_LENGTH_INVERT_MATERIAL
@ MOD_SHRINKWRAP_ABOVE_SURFACE
@ MOD_SHRINKWRAP_OUTSIDE_SURFACE
@ MOD_SHRINKWRAP_ON_SURFACE
unsigned char uint8_t
Definition BKE_text.h:79
@ DT_LAYERS_VGROUP_SRC_BONE_SELECT
@ DT_LAYERS_VGROUP_SRC_BONE_DEFORM
@ MOD_SHRINKWRAP_NEAREST_VERTEX
@ MOD_SHRINKWRAP_NEAREST_SURFACE
@ MOD_SHRINKWRAP_TARGET_PROJECT
@ MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS
@ MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS
@ MOD_SHRINKWRAP_PROJECT_OVER_NORMAL
@ MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS
@ GP_NOISE_INVERT_LAYERPASS
@ MOD_SHRINKWRAP_INVERT_VGROUP
@ MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR
@ MOD_SHRINKWRAP_CULL_TARGET_BACKFACE
@ MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR
@ MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE
@ MOD_SHRINKWRAP_INVERT_CULL_TARGET