116 const char defgrpName[64],
164 int i, j, totalr = 0;
169 for (i = 0, mlt = mlooptri; i < mtri_tot; i++, mlt++) {
171 for (j = 0; j < 3; j++) {
172 const uint v_index = mloop[mlt->
tri[j]].
v;
173 map[v_index].
count++;
179 for (i = 0; i < mvert_tot; i++) {
181 index_iter += map[i].
count;
184 for (i = 0, mlt = mlooptri; i < mtri_tot; i++, mlt++) {
185 for (j = 0; j < 3; j++) {
186 const uint v_index = mloop[mlt->
tri[j]].
v;
188 map[v_index].
count++;
202 int i, vid[2], totalr = 0;
206 for (i = 0, me = medge; i < medge_tot; i++, me++) {
215 for (i = 0; i < mvert_tot; i++) {
217 index_iter += map[i].
count;
220 for (i = 0, me = medge; i < medge_tot; i++, me++) {
275 co[0] = sys->
co[vidt[0]];
276 co[1] = sys->
co[vidt[1]];
277 co[2] = sys->
co[vidt[2]];
284 for (j = 0; j < 3; j++) {
285 const float *
v1, *
v2, *v3;
288 idv[1] = vidt[(j + 1) % i];
289 idv[2] = vidt[(j + 2) % i];
291 v1 = sys->
co[idv[0]];
292 v2 = sys->
co[idv[1]];
293 v3 = sys->
co[idv[2]];
298 sys->
delta[idv[0]][0] +=
v1[0] * (w2 + w3);
299 sys->
delta[idv[0]][1] +=
v1[1] * (w2 + w3);
300 sys->
delta[idv[0]][2] +=
v1[2] * (w2 + w3);
302 sys->
delta[idv[0]][0] -=
v2[0] * w2;
303 sys->
delta[idv[0]][1] -=
v2[1] * w2;
304 sys->
delta[idv[0]][2] -=
v2[2] * w2;
306 sys->
delta[idv[0]][0] -= v3[0] * w3;
307 sys->
delta[idv[0]][1] -= v3[1] * w3;
308 sys->
delta[idv[0]][2] -= v3[2] * w3;
319 int vid, *vidn =
NULL;
320 float minj, mjt, qj[3], vj[3];
328 for (j = 0; j < ln; j++) {
345 float pj[3], ni[3], di[3];
346 float uij[3], dun[3], e2[3], pi[3], fni[3],
vn[3][3];
347 int i, j, num_fni, k, fi;
370 for (fi = 0; fi < num_fni; fi++) {
373 vin = sys->
tris[fidn[fi]];
374 for (j = 0; j < 3; j++) {
393 fni[0] =
alpha * ni[0] +
beta * uij[0] + gamma * e2[0];
394 fni[1] =
alpha * ni[1] +
beta * uij[1] + gamma * e2[1];
395 fni[2] =
alpha * ni[2] +
beta * uij[2] + gamma * e2[2];
412 int vid, i, j, n, na;
419 for (i = 0; i < n; i++) {
424 for (i = 0; i < na; i++) {
434 for (i = 0; i < n; i++) {
439 for (i = 0; i < na; i++) {
449 for (j = 1; j <= sys->
repeat; j++) {
452 for (i = 0; i < na; i++) {
481 for (i = 0; i < n; i++) {
486 for (i = 0; i < na; i++) {
496 for (j = 1; j <= sys->
repeat; j++) {
499 for (i = 0; i < na; i++) {
534 return (dvert !=
NULL);
561 for (i = 0; i < numVerts; i++) {
578 memcpy(sys->
index_anchors, index_anchors,
sizeof(
int) * total_anchors);
579 memcpy(sys->
co, vertexCos,
sizeof(
float[3]) * numVerts);
582 memcpy(lmd->
vertexco, vertexCos,
sizeof(
float[3]) * numVerts);
598 sys->
tris[i][0] = mloop[mlooptri[i].
tri[0]].
v;
599 sys->
tris[i][1] = mloop[mlooptri[i].
tri[1]].
v;
600 sys->
tris[i][2] = mloop[mlooptri[i].
tri[2]].
v;
612 int total_anchors = 0;
633 for (i = 0; i < numVerts; i++) {
651 float(*filevertexCos)[3];
654 filevertexCos =
NULL;
670 filevertexCos =
MEM_malloc_arrayN(numVerts,
sizeof(
float[3]),
"TempModDeformCoordinates");
671 memcpy(filevertexCos, lmd->
vertexco,
sizeof(
float[3]) * numVerts);
695 "Vertex group '%s' is not valid, or maybe empty",
709 "Vertex group '%s' is not valid, or maybe empty",
714 filevertexCos =
MEM_malloc_arrayN(numVerts,
sizeof(
float[3]),
"TempDeformCoordinates");
715 memcpy(filevertexCos, lmd->
vertexco,
sizeof(
float[3]) * numVerts);
756 bool UNUSED(useRenderParams))
779 float (*vertexCos)[3],
796 float (*vertexCos)[3],
803 if (mesh_src !=
NULL) {
850 "OBJECT_OT_laplaciandeform_bind");
877 "LaplacianDeformModifierData",
typedef float(TangentPoint)[2]
void BKE_id_free(struct Main *bmain, void *idv)
const struct MLoopTri * BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh)
int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh)
void BKE_mesh_wrapper_ensure_mdata(struct Mesh *me)
@ eModifierTypeFlag_SupportsEditmode
@ eModifierTypeFlag_AcceptsMesh
void BKE_modifier_copydata_generic(const struct ModifierData *md, struct ModifierData *md_dst, const int flag)
@ eModifierTypeType_OnlyDeform
void BKE_modifier_set_error(const struct Object *ob, struct ModifierData *md, const char *format,...) ATTR_PRINTF_FORMAT(3
float cotangent_tri_weight_v3(const float v1[3], const float v2[3], const float v3[3])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_INIT(stack, tot)
#define STACK_SIZE(stack)
void BLO_read_float3_array(BlendDataReader *reader, int array_size, float **ptr_p)
void BLO_write_float3_array(BlendWriter *writer, uint num, const float *data_ptr)
#define CD_MASK_MDEFORMVERT
#define DNA_struct_default_get(struct_name)
struct LaplacianDeformModifierData LaplacianDeformModifierData
@ MOD_LAPLACIANDEFORM_BIND
@ MOD_LAPLACIANDEFORM_INVERT_VGROUP
@ eModifierType_LaplacianDeform
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint vn
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
PointerRNA * modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr)
void modifier_panel_end(uiLayout *layout, PointerRNA *ptr)
PanelType * modifier_panel_register(ARegionType *region_type, ModifierType type, PanelDrawFn draw)
void modifier_vgroup_ui(uiLayout *layout, PointerRNA *ptr, PointerRNA *ob_ptr, const char *vgroup_prop, const char *invert_vgroup_prop, const char *text)
Mesh * MOD_deform_mesh_eval_get(Object *ob, struct BMEditMesh *em, Mesh *mesh, const float(*vertexCos)[3], const int num_verts, const bool use_normals, const bool use_orco)
void MOD_get_vgroup(Object *ob, struct Mesh *mesh, const char *name, MDeformVert **dvert, int *defgrp_index)
StructRNA RNA_LaplacianDeformModifier
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemS(uiLayout *layout)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static CCL_NAMESPACE_BEGIN const double alpha
void EIG_linear_solver_variable_set(LinearSolver *solver, int rhs, int index, double value)
void EIG_linear_solver_right_hand_side_add(LinearSolver *solver, int rhs, int index, double value)
LinearSolver * EIG_linear_least_squares_solver_new(int num_rows, int num_columns, int num_rhs)
void EIG_linear_solver_delete(LinearSolver *solver)
double EIG_linear_solver_variable_get(LinearSolver *solver, int rhs, int index)
void EIG_linear_solver_matrix_add(LinearSolver *solver, int row, int col, double value)
bool EIG_linear_solver_solve(LinearSolver *solver)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
int RNA_string_length(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
ccl_device_inline float beta(float x, float y)