Blender  V3.3
Classes | Macros
curve_deform.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BKE_anim_path.h"
#include "BKE_curve.h"
#include "BKE_editmesh.h"
#include "BKE_lattice.h"
#include "BKE_modifier.h"
#include "BKE_deform.h"

Go to the source code of this file.

Classes

struct  CurveDeform
 

Macros

#define DEFORM_OP(dvert)
 
#define DEFORM_OP_MINMAX(dvert)
 
#define DEFORM_OP_CLAMPED(dvert)
 

Functions

Curve Deform Internal Utilities
static void init_curve_deform (const Object *ob_curve, const Object *ob_target, CurveDeform *cd)
 
static bool calc_curve_deform (const Object *ob_curve, float co[3], const short axis, const CurveDeform *cd, float r_quat[4])
 
Curve Deform #BKE_curve_deform_coords API

#BKE_curve_deform and related functions.

static void curve_deform_coords_impl (const Object *ob_curve, const Object *ob_target, float(*vert_coords)[3], const int vert_coords_len, const MDeformVert *dvert, const int defgrp_index, const short flag, const short defaxis, BMEditMesh *em_target)
 
void BKE_curve_deform_coords (const Object *ob_curve, const Object *ob_target, float(*vert_coords)[3], const int vert_coords_len, const MDeformVert *dvert, const int defgrp_index, const short flag, const short defaxis)
 
void BKE_curve_deform_coords_with_editmesh (const Object *ob_curve, const Object *ob_target, float(*vert_coords)[3], const int vert_coords_len, const int defgrp_index, const short flag, const short defaxis, BMEditMesh *em_target)
 
void BKE_curve_deform_co (const Object *ob_curve, const Object *ob_target, const float orco[3], float vec[3], const int no_rot_axis, float r_mat[3][3])
 

Detailed Description

Deform coordinates by a curve object (used by modifier).

Definition in file curve_deform.c.

Macro Definition Documentation

◆ DEFORM_OP

#define DEFORM_OP (   dvert)
Value:
{ \
const float weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dvert, defgrp_index) : \
BKE_defvert_find_weight(dvert, defgrp_index); \
if (weight > 0.0f) { \
float vec[3]; \
mul_m4_v3(cd.curvespace, vert_coords[a]); \
copy_v3_v3(vec, vert_coords[a]); \
calc_curve_deform(ob_curve, vec, defaxis, &cd, NULL); \
interp_v3_v3v3(vert_coords[a], vert_coords[a], vec, weight); \
mul_m4_v3(cd.objectspace, vert_coords[a]); \
} \
} \
((void)0)
float BKE_defvert_find_weight(const struct MDeformVert *dvert, int defgroup)
Definition: deform.c:704
SyclQueue void void size_t num_bytes void
static unsigned a[3]
Definition: RandGen.cpp:78

◆ DEFORM_OP_CLAMPED

#define DEFORM_OP_CLAMPED (   dvert)
Value:
{ \
const float weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dvert, defgrp_index) : \
BKE_defvert_find_weight(dvert, defgrp_index); \
if (weight > 0.0f) { \
float vec[3]; \
copy_v3_v3(vec, vert_coords[a]); \
calc_curve_deform(ob_curve, vec, defaxis, &cd, NULL); \
interp_v3_v3v3(vert_coords[a], vert_coords[a], vec, weight); \
mul_m4_v3(cd.objectspace, vert_coords[a]); \
} \
} \
((void)0)

◆ DEFORM_OP_MINMAX

#define DEFORM_OP_MINMAX (   dvert)
Value:
{ \
const float weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dvert, defgrp_index) : \
BKE_defvert_find_weight(dvert, defgrp_index); \
if (weight > 0.0f) { \
mul_m4_v3(cd.curvespace, vert_coords[a]); \
minmax_v3v3_v3(cd.dmin, cd.dmax, vert_coords[a]); \
} \
} \
((void)0)

Function Documentation

◆ BKE_curve_deform_co()

void BKE_curve_deform_co ( const Object ob_curve,
const Object ob_target,
const float  orco[3],
float  vec[3],
const int  no_rot_axis,
float  r_mat[3][3] 
)

◆ BKE_curve_deform_coords()

void BKE_curve_deform_coords ( const Object ob_curve,
const Object ob_target,
float(*)  vert_coords[3],
const int  vert_coords_len,
const MDeformVert dvert,
const int  defgrp_index,
const short  flag,
const short  defaxis 
)

Definition at line 364 of file curve_deform.c.

References curve_deform_coords_impl(), and NULL.

◆ BKE_curve_deform_coords_with_editmesh()

void BKE_curve_deform_coords_with_editmesh ( const Object ob_curve,
const Object ob_target,
float(*)  vert_coords[3],
const int  vert_coords_len,
const int  defgrp_index,
const short  flag,
const short  defaxis,
BMEditMesh em_target 
)

Definition at line 377 of file curve_deform.c.

References curve_deform_coords_impl(), and NULL.

◆ calc_curve_deform()

static bool calc_curve_deform ( const Object ob_curve,
float  co[3],
const short  axis,
const CurveDeform cd,
float  r_quat[4] 
)
static

◆ curve_deform_coords_impl()

static void curve_deform_coords_impl ( const Object ob_curve,
const Object ob_target,
float(*)  vert_coords[3],
const int  vert_coords_len,
const MDeformVert dvert,
const int  defgrp_index,
const short  flag,
const short  defaxis,
BMEditMesh em_target 
)
static

◆ init_curve_deform()

static void init_curve_deform ( const Object ob_curve,
const Object ob_target,
CurveDeform cd 
)
static