Blender  V3.3
Macros | Functions | Variables
lattice.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_bitmap.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_curve_types.h"
#include "DNA_defaults.h"
#include "DNA_key_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_anim_data.h"
#include "BKE_curve.h"
#include "BKE_deform.h"
#include "BKE_displist.h"
#include "BKE_idtype.h"
#include "BKE_lattice.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "DEG_depsgraph_query.h"
#include "BLO_read_write.h"

Go to the source code of this file.

Macros

#define DNA_DEPRECATED_ALLOW
 

Functions

static void lattice_init_data (ID *id)
 
static void lattice_copy_data (Main *bmain, ID *id_dst, const ID *id_src, const int flag)
 
static void lattice_free_data (ID *id)
 
static void lattice_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void lattice_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void lattice_blend_read_data (BlendDataReader *reader, ID *id)
 
static void lattice_blend_read_lib (BlendLibReader *reader, ID *id)
 
static void lattice_blend_read_expand (BlendExpander *expander, ID *id)
 
int BKE_lattice_index_from_uvw (Lattice *lt, const int u, const int v, const int w)
 
void BKE_lattice_index_to_uvw (Lattice *lt, const int index, int *r_u, int *r_v, int *r_w)
 
int BKE_lattice_index_flip (Lattice *lt, const int index, const bool flip_u, const bool flip_v, const bool flip_w)
 
void BKE_lattice_bitmap_from_flag (Lattice *lt, BLI_bitmap *bitmap, const uint8_t flag, const bool clear, const bool respecthide)
 
void calc_lat_fudu (int flag, int res, float *r_fu, float *r_du)
 
void BKE_lattice_resize (Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
 
LatticeBKE_lattice_add (Main *bmain, const char *name)
 
bool object_deform_mball (Object *ob, ListBase *dispbase)
 
static BPointlatt_bp (Lattice *lt, int u, int v, int w)
 
void outside_lattice (Lattice *lt)
 
void BKE_lattice_vert_coords_get (const Lattice *lt, float(*vert_coords)[3])
 
float(* BKE_lattice_vert_coords_alloc (const Lattice *lt, int *r_vert_len))[3]
 
void BKE_lattice_vert_coords_apply_with_mat4 (struct Lattice *lt, const float(*vert_coords)[3], const float mat[4][4])
 
void BKE_lattice_vert_coords_apply (Lattice *lt, const float(*vert_coords)[3])
 
void BKE_lattice_modifiers_calc (struct Depsgraph *depsgraph, Scene *scene, Object *ob)
 
struct MDeformVertBKE_lattice_deform_verts_get (const struct Object *oblatt)
 
struct BPointBKE_lattice_active_point_get (Lattice *lt)
 
void BKE_lattice_center_median (Lattice *lt, float cent[3])
 
static void boundbox_lattice (Object *ob)
 
BoundBoxBKE_lattice_boundbox_get (Object *ob)
 
void BKE_lattice_minmax_dl (Object *ob, Lattice *lt, float min[3], float max[3])
 
void BKE_lattice_minmax (Lattice *lt, float min[3], float max[3])
 
void BKE_lattice_center_bounds (Lattice *lt, float cent[3])
 
void BKE_lattice_transform (Lattice *lt, const float mat[4][4], bool do_keys)
 
void BKE_lattice_translate (Lattice *lt, const float offset[3], bool do_keys)
 
bool BKE_lattice_is_any_selected (const Lattice *lt)
 
void BKE_lattice_eval_geometry (struct Depsgraph *UNUSED(depsgraph), Lattice *UNUSED(latt))
 
void BKE_lattice_batch_cache_dirty_tag (Lattice *lt, int mode)
 
void BKE_lattice_batch_cache_free (Lattice *lt)
 

Variables

IDTypeInfo IDType_ID_LT
 
void(* BKE_lattice_batch_cache_dirty_tag_cb )(Lattice *lt, int mode) = NULL
 
void(* BKE_lattice_batch_cache_free_cb )(Lattice *lt) = NULL
 

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 23 of file lattice.c.

Function Documentation

◆ BKE_lattice_active_point_get()

struct BPoint* BKE_lattice_active_point_get ( Lattice lt)

◆ BKE_lattice_add()

Lattice* BKE_lattice_add ( Main bmain,
const char *  name 
)

Definition at line 392 of file lattice.c.

References BKE_id_new(), and ID_LT.

Referenced by BKE_object_obdata_add_from_type().

◆ BKE_lattice_batch_cache_dirty_tag()

void BKE_lattice_batch_cache_dirty_tag ( Lattice lt,
int  mode 
)

◆ BKE_lattice_batch_cache_free()

void BKE_lattice_batch_cache_free ( Lattice lt)

Definition at line 790 of file lattice.c.

References Lattice::batch_cache, and BKE_lattice_batch_cache_free_cb.

Referenced by lattice_free_data().

◆ BKE_lattice_bitmap_from_flag()

void BKE_lattice_bitmap_from_flag ( Lattice lt,
BLI_bitmap bitmap,
const uint8_t  flag,
const bool  clear,
const bool  respecthide 
)

◆ BKE_lattice_boundbox_get()

BoundBox* BKE_lattice_boundbox_get ( Object ob)

Definition at line 652 of file lattice.c.

References Object_Runtime::bb, boundbox_lattice(), and Object::runtime.

Referenced by BKE_object_boundbox_get().

◆ BKE_lattice_center_bounds()

void BKE_lattice_center_bounds ( Lattice lt,
float  cent[3] 
)

Definition at line 696 of file lattice.c.

References BKE_lattice_minmax(), INIT_MINMAX, max, mid_v3_v3v3(), and min.

Referenced by object_origin_set_exec().

◆ BKE_lattice_center_median()

void BKE_lattice_center_median ( Lattice lt,
float  cent[3] 
)

◆ BKE_lattice_deform_verts_get()

struct MDeformVert* BKE_lattice_deform_verts_get ( const struct Object oblatt)

◆ BKE_lattice_eval_geometry()

void BKE_lattice_eval_geometry ( struct Depsgraph UNUSEDdepsgraph,
Lattice UNUSEDlatt 
)

Definition at line 776 of file lattice.c.

◆ BKE_lattice_index_flip()

int BKE_lattice_index_flip ( Lattice lt,
const int  index,
const bool  flip_u,
const bool  flip_v,
const bool  flip_w 
)

◆ BKE_lattice_index_from_uvw()

int BKE_lattice_index_from_uvw ( Lattice lt,
const int  u,
const int  v,
const int  w 
)

◆ BKE_lattice_index_to_uvw()

void BKE_lattice_index_to_uvw ( Lattice lt,
const int  index,
int *  r_u,
int *  r_v,
int *  r_w 
)

Definition at line 213 of file lattice.c.

References Lattice::pntsu, and Lattice::pntsv.

Referenced by BKE_lattice_index_flip().

◆ BKE_lattice_is_any_selected()

bool BKE_lattice_is_any_selected ( const Lattice lt)

◆ BKE_lattice_minmax()

void BKE_lattice_minmax ( Lattice lt,
float  min[3],
float  max[3] 
)

◆ BKE_lattice_minmax_dl()

void BKE_lattice_minmax_dl ( Object ob,
Lattice lt,
float  min[3],
float  max[3] 
)

◆ BKE_lattice_modifiers_calc()

void BKE_lattice_modifiers_calc ( struct Depsgraph depsgraph,
Scene scene,
Object ob 
)

◆ BKE_lattice_resize()

void BKE_lattice_resize ( Lattice lt,
int  uNew,
int  vNew,
int  wNew,
Object ltOb 
)

◆ BKE_lattice_transform()

void BKE_lattice_transform ( Lattice lt,
const float  mat[4][4],
bool  do_keys 
)

◆ BKE_lattice_translate()

void BKE_lattice_translate ( Lattice lt,
const float  offset[3],
bool  do_keys 
)

◆ BKE_lattice_vert_coords_alloc()

float(* BKE_lattice_vert_coords_alloc ( const Lattice lt,
int *  r_vert_len 
) )[3]

◆ BKE_lattice_vert_coords_apply()

void BKE_lattice_vert_coords_apply ( Lattice lt,
const float(*)  vert_coords[3] 
)

◆ BKE_lattice_vert_coords_apply_with_mat4()

void BKE_lattice_vert_coords_apply_with_mat4 ( struct Lattice lt,
const float(*)  vert_coords[3],
const float  mat[4][4] 
)

◆ BKE_lattice_vert_coords_get()

void BKE_lattice_vert_coords_get ( const Lattice lt,
float(*)  vert_coords[3] 
)

◆ boundbox_lattice()

static void boundbox_lattice ( Object ob)
static

◆ calc_lat_fudu()

void calc_lat_fudu ( int  flag,
int  res,
float r_fu,
float r_du 
)

Definition at line 264 of file lattice.c.

References LT_GRID.

Referenced by BKE_lattice_resize(), and blo_do_versions_pre250().

◆ latt_bp()

static BPoint* latt_bp ( Lattice lt,
int  u,
int  v,
int  w 
)
static

Definition at line 416 of file lattice.c.

References BKE_lattice_index_from_uvw(), Lattice::def, v, and w().

Referenced by outside_lattice().

◆ lattice_blend_read_data()

static void lattice_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ lattice_blend_read_expand()

static void lattice_blend_read_expand ( BlendExpander expander,
ID id 
)
static

Definition at line 168 of file lattice.c.

References BLO_expand, and Lattice::key.

◆ lattice_blend_read_lib()

static void lattice_blend_read_lib ( BlendLibReader reader,
ID id 
)
static

Definition at line 161 of file lattice.c.

References BLO_read_id_address, Lattice::id, Lattice::key, and ID::lib.

◆ lattice_blend_write()

static void lattice_blend_write ( BlendWriter writer,
ID id,
const void id_address 
)
static

◆ lattice_copy_data()

static void lattice_copy_data ( Main bmain,
ID id_dst,
const ID id_src,
const int  flag 
)
static

◆ lattice_foreach_id()

static void lattice_foreach_id ( ID id,
LibraryForeachIDData data 
)
static

Definition at line 115 of file lattice.c.

References BKE_LIB_FOREACHID_PROCESS_IDSUPER, data, IDWALK_CB_USER, Lattice::key, and lattice.

◆ lattice_free_data()

static void lattice_free_data ( ID id)
static

◆ lattice_init_data()

static void lattice_init_data ( ID id)
static

◆ object_deform_mball()

bool object_deform_mball ( Object ob,
ListBase dispbase 
)

◆ outside_lattice()

void outside_lattice ( Lattice lt)

Variable Documentation

◆ BKE_lattice_batch_cache_dirty_tag_cb

void(* BKE_lattice_batch_cache_dirty_tag_cb) (Lattice *lt, int mode) ( Lattice lt,
int  mode 
) = NULL

Definition at line 781 of file lattice.c.

Referenced by BKE_lattice_batch_cache_dirty_tag(), and DRW_engines_register().

◆ BKE_lattice_batch_cache_free_cb

void(* BKE_lattice_batch_cache_free_cb) (Lattice *lt) ( Lattice lt) = NULL

Definition at line 782 of file lattice.c.

Referenced by BKE_lattice_batch_cache_free(), and DRW_engines_register().

◆ IDType_ID_LT

IDTypeInfo IDType_ID_LT
Initial value:
= {
.id_code = ID_LT,
.id_filter = FILTER_ID_LT,
.main_listbase_index = INDEX_ID_LT,
.struct_size = sizeof(Lattice),
.name = "Lattice",
.name_plural = "lattices",
.translation_context = BLT_I18NCONTEXT_ID_LATTICE,
.asset_type_info = NULL,
.copy_data = lattice_copy_data,
.free_data = lattice_free_data,
.make_local = NULL,
.foreach_id = lattice_foreach_id,
.foreach_cache = NULL,
.foreach_path = NULL,
.owner_get = NULL,
.blend_write = lattice_blend_write,
.blend_read_data = lattice_blend_read_data,
.blend_read_lib = lattice_blend_read_lib,
.blend_read_expand = lattice_blend_read_expand,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = NULL,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition: BKE_idtype.h:39
#define BLT_I18NCONTEXT_ID_LATTICE
@ INDEX_ID_LT
Definition: DNA_ID.h:1032
#define FILTER_ID_LT
Definition: DNA_ID.h:909
@ ID_LT
Definition: DNA_ID_enums.h:54
struct Lattice Lattice
static void init_data(ModifierData *md)
static void lattice_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: lattice.c:161
static void lattice_blend_read_expand(BlendExpander *expander, ID *id)
Definition: lattice.c:168
static void lattice_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: lattice.c:121
static void lattice_free_data(ID *id)
Definition: lattice.c:86
static void lattice_blend_read_data(BlendDataReader *reader, ID *id)
Definition: lattice.c:145
static void lattice_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
Definition: lattice.c:61
static void lattice_init_data(ID *id)
Definition: lattice.c:49
static void lattice_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: lattice.c:115

Definition at line 175 of file lattice.c.

Referenced by blender::bke::tests::test_lattice_deform_free(), and blender::bke::tests::test_lattice_deform_init().