Blender  V2.93
Functions
displist.c File Reference
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_vfont_types.h"
#include "BLI_bitmap.h"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
#include "BLI_scanfill.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_anim_path.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_font.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_lib_id.h"
#include "BKE_mball.h"
#include "BKE_mball_tessellate.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BLI_sys_types.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"

Go to the source code of this file.

Functions

static void boundbox_displist_object (Object *ob)
 
void BKE_displist_elem_free (DispList *dl)
 
void BKE_displist_free (ListBase *lb)
 
DispListBKE_displist_find_or_create (ListBase *lb, int type)
 
DispListBKE_displist_find (ListBase *lb, int type)
 
bool BKE_displist_has_faces (const ListBase *lb)
 
void BKE_displist_copy (ListBase *lbn, const ListBase *lb)
 
void BKE_displist_normals_add (ListBase *lb)
 
void BKE_displist_count (const ListBase *lb, int *totvert, int *totface, int *tottri)
 
bool BKE_displist_surfindex_get (const DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4)
 
static void curve_to_displist (const Curve *cu, const ListBase *nubase, const bool for_render, ListBase *r_dispbase)
 
void BKE_displist_fill (const ListBase *dispbase, ListBase *to, const float normal_proj[3], const bool flip_normal)
 
static void bevels_to_filledpoly (const Curve *cu, ListBase *dispbase)
 
static void curve_to_filledpoly (const Curve *cu, ListBase *dispbase)
 
static float displist_calc_taper (Depsgraph *depsgraph, const Scene *scene, Object *taperobj, float fac)
 
float BKE_displist_calc_taper (Depsgraph *depsgraph, const Scene *scene, Object *taperobj, int cur, int tot)
 
void BKE_displist_make_mball (Depsgraph *depsgraph, Scene *scene, Object *ob)
 
void BKE_displist_make_mball_forRender (Depsgraph *depsgraph, Scene *scene, Object *ob, ListBase *dispbase)
 
static ModifierDatacurve_get_tessellate_point (const Scene *scene, const Object *ob, const bool for_render, const bool editmode)
 
bool BKE_curve_calc_modifiers_pre (Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *source_nurb, ListBase *target_nurb, const bool for_render)
 
static float(* displist_vert_coords_alloc (ListBase *dispbase, int *r_vert_len))[3]
 
static void displist_vert_coords_apply (ListBase *dispbase, const float(*allverts)[3])
 
static void curve_calc_modifiers_post (Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *dispbase, Mesh **r_final, const bool for_render, const bool force_mesh_conversion)
 
static void displist_surf_indices (DispList *dl)
 
void BKE_displist_make_surf (Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *dispbase, Mesh **r_final, const bool for_render, const bool for_orco)
 
static void rotateBevelPiece (const Curve *cu, const BevPoint *bevp, const BevPoint *nbevp, const DispList *dlb, const float bev_blend, const float widfac, const float radius_factor, float **r_data)
 
static void fillBevelCap (const Nurb *nu, const DispList *dlb, const float *prev_fp, ListBase *dispbase)
 
static void calc_bevfac_segment_mapping (const BevList *bl, float bevfac, float spline_length, int *r_bev, float *r_blend)
 
static void calc_bevfac_spline_mapping (const BevList *bl, float bevfac, float spline_length, int *r_bev, float *r_blend)
 
static void calc_bevfac_mapping_default (const BevList *bl, int *r_start, float *r_firstblend, int *r_steps, float *r_lastblend)
 
static void calc_bevfac_mapping (const Curve *cu, const BevList *bl, const Nurb *nu, int *r_start, float *r_firstblend, int *r_steps, float *r_lastblend)
 
static void do_makeDispListCurveTypes (Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *dispbase, const bool for_render, const bool for_orco, Mesh **r_final)
 
void BKE_displist_make_curveTypes (Depsgraph *depsgraph, const Scene *scene, Object *ob, const bool for_render, const bool for_orco)
 
void BKE_displist_make_curveTypes_forRender (Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *dispbase, Mesh **r_final, const bool for_orco)
 
void BKE_displist_minmax (const ListBase *dispbase, float min[3], float max[3])
 

Function Documentation

◆ bevels_to_filledpoly()

static void bevels_to_filledpoly ( const Curve cu,
ListBase dispbase 
)
static

◆ BKE_curve_calc_modifiers_pre()

bool BKE_curve_calc_modifiers_pre ( Depsgraph depsgraph,
const Scene scene,
Object ob,
ListBase source_nurb,
ListBase target_nurb,
const bool  for_render 
)

◆ BKE_displist_calc_taper()

float BKE_displist_calc_taper ( Depsgraph depsgraph,
const Scene scene,
Object taperobj,
int  cur,
int  tot 
)

Definition at line 677 of file displist.c.

References depsgraph, displist_calc_taper(), float(), and scene.

◆ BKE_displist_copy()

void BKE_displist_copy ( ListBase lbn,
const ListBase lb 
)

◆ BKE_displist_count()

void BKE_displist_count ( const ListBase lb,
int *  totvert,
int *  totface,
int *  tottri 
)

Definition at line 211 of file displist.c.

References DL_CYCL_U, DL_CYCL_V, DL_INDEX3, DL_INDEX4, DL_POLY, DL_SEGM, DL_SURF, and LISTBASE_FOREACH.

◆ BKE_displist_elem_free()

void BKE_displist_elem_free ( DispList dl)

Definition at line 65 of file displist.c.

References DispList::index, MEM_freeN, DispList::nors, and DispList::verts.

Referenced by BKE_displist_free().

◆ BKE_displist_fill()

void BKE_displist_fill ( const ListBase dispbase,
ListBase to,
const float  normal_proj[3],
const bool  flip_normal 
)

◆ BKE_displist_find()

DispList* BKE_displist_find ( ListBase lb,
int  type 
)

◆ BKE_displist_find_or_create()

DispList* BKE_displist_find_or_create ( ListBase lb,
int  type 
)

Definition at line 90 of file displist.c.

References BLI_addtail(), LISTBASE_FOREACH, MEM_callocN, DispList::type, and type.

◆ BKE_displist_free()

void BKE_displist_free ( ListBase lb)

◆ BKE_displist_has_faces()

bool BKE_displist_has_faces ( const ListBase lb)

Definition at line 116 of file displist.c.

References DL_INDEX3, DL_INDEX4, DL_SURF, ELEM, and LISTBASE_FOREACH.

◆ BKE_displist_make_curveTypes()

void BKE_displist_make_curveTypes ( Depsgraph depsgraph,
const Scene scene,
Object ob,
const bool  for_render,
const bool  for_orco 
)

◆ BKE_displist_make_curveTypes_forRender()

void BKE_displist_make_curveTypes_forRender ( Depsgraph depsgraph,
const Scene scene,
Object ob,
ListBase dispbase,
Mesh **  r_final,
const bool  for_orco 
)

◆ BKE_displist_make_mball()

void BKE_displist_make_mball ( Depsgraph depsgraph,
Scene scene,
Object ob 
)

◆ BKE_displist_make_mball_forRender()

void BKE_displist_make_mball_forRender ( Depsgraph depsgraph,
Scene scene,
Object ob,
ListBase dispbase 
)

◆ BKE_displist_make_surf()

void BKE_displist_make_surf ( Depsgraph depsgraph,
const Scene scene,
Object ob,
ListBase dispbase,
Mesh **  r_final,
const bool  for_render,
const bool  for_orco 
)

◆ BKE_displist_minmax()

void BKE_displist_minmax ( const ListBase dispbase,
float  min[3],
float  max[3] 
)

Definition at line 1769 of file displist.c.

References Freestyle::a, DL_INDEX3, LISTBASE_FOREACH, max, min, minmax_v3v3_v3(), and zero_v3().

Referenced by boundbox_displist_object().

◆ BKE_displist_normals_add()

void BKE_displist_normals_add ( ListBase lb)

◆ BKE_displist_surfindex_get()

bool BKE_displist_surfindex_get ( const DispList dl,
int  a,
int *  b,
int *  p1,
int *  p2,
int *  p3,
int *  p4 
)

◆ boundbox_displist_object()

static void boundbox_displist_object ( Object ob)
static

◆ calc_bevfac_mapping()

static void calc_bevfac_mapping ( const Curve cu,
const BevList bl,
const Nurb nu,
int *  r_start,
float r_firstblend,
int *  r_steps,
float r_lastblend 
)
static

◆ calc_bevfac_mapping_default()

static void calc_bevfac_mapping_default ( const BevList bl,
int *  r_start,
float r_firstblend,
int *  r_steps,
float r_lastblend 
)
static

Definition at line 1376 of file displist.c.

References BevList::nr.

Referenced by calc_bevfac_mapping(), and do_makeDispListCurveTypes().

◆ calc_bevfac_segment_mapping()

static void calc_bevfac_segment_mapping ( const BevList bl,
float  bevfac,
float  spline_length,
int *  r_bev,
float r_blend 
)
static

Definition at line 1328 of file displist.c.

References BevList::nr, BevList::segbevcount, and BevList::seglen.

Referenced by calc_bevfac_mapping().

◆ calc_bevfac_spline_mapping()

static void calc_bevfac_spline_mapping ( const BevList bl,
float  bevfac,
float  spline_length,
int *  r_bev,
float r_blend 
)
static

Definition at line 1354 of file displist.c.

References BevList::bevpoints, len, BevList::nr, and BevPoint::offset.

Referenced by calc_bevfac_mapping().

◆ curve_calc_modifiers_post()

static void curve_calc_modifiers_post ( Depsgraph depsgraph,
const Scene scene,
Object ob,
ListBase dispbase,
Mesh **  r_final,
const bool  for_render,
const bool  force_mesh_conversion 
)
static

◆ curve_get_tessellate_point()

static ModifierData* curve_get_tessellate_point ( const Scene scene,
const Object ob,
const bool  for_render,
const bool  editmode 
)
static

◆ curve_to_displist()

static void curve_to_displist ( const Curve cu,
const ListBase nubase,
const bool  for_render,
ListBase r_dispbase 
)
static

◆ curve_to_filledpoly()

static void curve_to_filledpoly ( const Curve cu,
ListBase dispbase 
)
static

◆ displist_calc_taper()

static float displist_calc_taper ( Depsgraph depsgraph,
const Scene scene,
Object taperobj,
float  fac 
)
static

◆ displist_surf_indices()

static void displist_surf_indices ( DispList dl)
static

◆ displist_vert_coords_alloc()

static float(* displist_vert_coords_alloc ( ListBase dispbase,
int *  r_vert_len 
) )[3]
static

Definition at line 862 of file displist.c.

References DL_INDEX3, float(), LISTBASE_FOREACH, and MEM_mallocN.

Referenced by curve_calc_modifiers_post().

◆ displist_vert_coords_apply()

static void displist_vert_coords_apply ( ListBase dispbase,
const float(*)  allverts[3] 
)
static

Definition at line 883 of file displist.c.

References DL_INDEX3, and LISTBASE_FOREACH.

Referenced by curve_calc_modifiers_post().

◆ do_makeDispListCurveTypes()

static void do_makeDispListCurveTypes ( Depsgraph depsgraph,
const Scene scene,
Object ob,
ListBase dispbase,
const bool  for_render,
const bool  for_orco,
Mesh **  r_final 
)
static

Definition at line 1464 of file displist.c.

References Freestyle::a, CurveCache::anim_path_accum_length, CurveCache::bev, Curve::bevfac1, Curve::bevfac2, BevList::bevpoints, BKE_anim_path_calc_data(), BKE_curve_bevel_make(), BKE_curve_bevelList_free(), BKE_curve_bevelList_make(), BKE_curve_calc_modifiers_pre(), BKE_curve_nurbs_get(), BKE_displist_fill(), BKE_displist_free(), BKE_displist_make_surf(), BKE_nurbList_duplicate(), BKE_nurbList_free(), BKE_vfont_to_curve_nubase(), BLI_addtail(), BLI_listbase_is_empty(), calc_bevfac_mapping(), calc_bevfac_mapping_default(), DispList::charidx, Nurb::charidx, DispList::col, copy_v3_v3(), BevPoint::cosa, CU_DEFORM_FILL, CU_FILL_CAPS, CU_MAP_TAPER, CU_NURB_CYCLIC, CU_PATH, CU_TAPER_RADIUS_ADD, CU_TAPER_RADIUS_MULTIPLY, Object_Runtime::curve_cache, curve_calc_modifiers_post(), curve_to_displist(), curve_to_filledpoly(), DAG_EVAL_NEED_CURVE_PATH, data, Object::data, Object_Runtime::data_eval, CurveCache::deformed_nurbs, DEG_get_eval_flags_for_id(), depsgraph, BevPoint::dir, displist_calc_taper(), displist_surf_indices(), DL_BACK_CURVE, DL_CYCL_U, DL_CYCL_V, DL_FRONT_CURVE, DL_POLY, DL_SEGM, DL_SURF, ELEM, fabsf, fillBevelCap(), ListBase::first, DispList::flag, Nurb::flag, Curve::flag, Nurb::flagu, float(), FO_EDIT, Object::id, len, LISTBASE_FOREACH, Nurb::mat_nr, MEM_callocN, MEM_freeN, MEM_mallocN, negate_v3_v3(), BevList::next, Nurb::next, DispList::nr, BevList::nr, NULL, OB_CURVE, OB_FONT, OB_SURF, DispList::parts, BevList::poly, BevPoint::radius, rotateBevelPiece(), DispList::rt, Object::runtime, scene, BevPoint::sina, steps, Curve::taper_radius_mode, Curve::taperobj, DispList::type, Object::type, BevPoint::vec, DispList::verts, and Curve::width.

Referenced by BKE_displist_make_curveTypes(), and BKE_displist_make_curveTypes_forRender().

◆ fillBevelCap()

static void fillBevelCap ( const Nurb nu,
const DispList dlb,
const float prev_fp,
ListBase dispbase 
)
static

◆ rotateBevelPiece()

static void rotateBevelPiece ( const Curve cu,
const BevPoint bevp,
const BevPoint nbevp,
const DispList dlb,
const float  bev_blend,
const float  widfac,
const float  radius_factor,
float **  r_data 
)
static