Blender V2.61 - r43446
|
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_material_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BLI_scanfill.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BKE_displist.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_object.h"
#include "BKE_mball.h"
#include "BKE_material.h"
#include "BKE_curve.h"
#include "BKE_key.h"
#include "BKE_anim.h"
#include "BKE_font.h"
#include "BKE_lattice.h"
#include "BKE_modifier.h"
#include "BLO_sys_types.h"
Go to the source code of this file.
Functions | |
static void | boundbox_displist (Object *ob) |
void | free_disp_elem (DispList *dl) |
void | freedisplist (ListBase *lb) |
DispList * | find_displist_create (ListBase *lb, int type) |
DispList * | find_displist (ListBase *lb, int type) |
int | displist_has_faces (ListBase *lb) |
void | copy_displist (ListBase *lbn, ListBase *lb) |
void | addnormalsDispList (ListBase *lb) |
void | count_displist (ListBase *lb, int *totvert, int *totface) |
int | surfindex_displist (DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4) |
static void | curve_to_displist (Curve *cu, ListBase *nubase, ListBase *dispbase, int forRender) |
void | filldisplist (ListBase *dispbase, ListBase *to, int flipnormal) |
static void | bevels_to_filledpoly (Curve *cu, ListBase *dispbase) |
static void | curve_to_filledpoly (Curve *cu, ListBase *UNUSED(nurb), ListBase *dispbase) |
float | calc_taper (Scene *scene, Object *taperobj, int cur, int tot) |
void | makeDispListMBall (Scene *scene, Object *ob) |
void | makeDispListMBall_forRender (Scene *scene, Object *ob, ListBase *dispbase) |
static ModifierData * | curve_get_tesselate_point (Scene *scene, Object *ob, int forRender, int editmode) |
static void | curve_calc_modifiers_pre (Scene *scene, Object *ob, int forRender, float(**originalVerts_r)[3], float(**deformedVerts_r)[3], int *numVerts_r) |
static float(* | displist_get_allverts (ListBase *dispbase, int *totvert))[3] |
static void | displist_apply_allverts (ListBase *dispbase, float(*allverts)[3]) |
static void | curve_calc_modifiers_post (Scene *scene, Object *ob, ListBase *dispbase, DerivedMesh **derivedFinal, int forRender, float(*originalVerts)[3], float(*deformedVerts)[3]) |
static void | displist_surf_indices (DispList *dl) |
static DerivedMesh * | create_orco_dm (Scene *scene, Object *ob) |
static void | add_orco_dm (Scene *scene, Object *ob, DerivedMesh *dm, DerivedMesh *orcodm) |
static void | curve_calc_orcodm (Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender) |
void | makeDispListSurf (Scene *scene, Object *ob, ListBase *dispbase, DerivedMesh **derivedFinal, int forRender, int forOrco) |
static void | do_makeDispListCurveTypes (Scene *scene, Object *ob, ListBase *dispbase, DerivedMesh **derivedFinal, int forRender, int forOrco) |
void | makeDispListCurveTypes (Scene *scene, Object *ob, int forOrco) |
void | makeDispListCurveTypes_forRender (Scene *scene, Object *ob, ListBase *dispbase, DerivedMesh **derivedFinal, int forOrco) |
void | makeDispListCurveTypes_forOrco (struct Scene *scene, struct Object *ob, struct ListBase *dispbase) |
float * | makeOrcoDispList (Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender) |
Variables | |
Material | defmaterial |
Definition in file displist.c.
static void add_orco_dm | ( | Scene * | scene, |
Object * | ob, | ||
DerivedMesh * | dm, | ||
DerivedMesh * | orcodm | ||
) | [static] |
Definition at line 997 of file displist.c.
References CD_ASSIGN, CD_ORCO, co, Object::data, DM_add_vert_layer(), DM_get_vert_data_layer(), DerivedMesh::getNumVerts, DerivedMesh::getVertCos, Curve::loc, make_orco_curve(), MEM_callocN(), MEM_freeN(), and Curve::size.
Referenced by curve_calc_orcodm().
void addnormalsDispList | ( | ListBase * | lb | ) |
Definition at line 159 of file displist.c.
References add_v3_v3(), DL_INDEX3, DL_SURF, ListBase::first, MEM_callocN(), DispList::next, normal_quad_v3(), normalize_v3(), DispList::nors, DispList::nr, NULL, DispList::parts, surfindex_displist(), DispList::type, and DispList::verts.
Referenced by drawDispList().
Definition at line 534 of file displist.c.
References BLI_addtail(), DispList::charidx, DispList::col, copy_v3_v3(), CU_BACK, CU_FRONT, DL_BACK_CURVE, DL_CYCL_U, DL_CYCL_V, DL_FRONT_CURVE, DL_POLY, DL_SURF, filldisplist(), ListBase::first, Curve::flag, DispList::flag, freedisplist(), ListBase::last, MEM_callocN(), MEM_mallocN(), DispList::next, DispList::nr, NULL, DispList::parts, DispList::type, and DispList::verts.
Referenced by curve_to_filledpoly().
static void boundbox_displist | ( | Object * | ob | ) | [static] |
Definition at line 1426 of file displist.c.
References Curve::bb, boundbox_set_from_min_max(), Object::data, Object::disp, DL_INDEX3, DO_MINMAX, ELEM3, ListBase::first, INIT_MINMAX, max, MEM_callocN(), min, DispList::next, DispList::nr, NULL, OB_CURVE, OB_FONT, OB_SURF, DispList::parts, DispList::type, Object::type, DispList::verts, and zero_v3().
Referenced by makeDispListCurveTypes(), and makeDispListMBall().
Definition at line 619 of file displist.c.
References Object::disp, ListBase::first, makeDispListCurveTypes(), DispList::nr, NULL, OB_CURVE, Object::type, and DispList::verts.
Referenced by do_guides(), and do_makeDispListCurveTypes().
Definition at line 135 of file displist.c.
References DispList::bevelSplitFlag, BLI_addtail(), DispList::col1, DispList::col2, ListBase::first, freedisplist(), DispList::index, MEM_dupallocN(), DispList::next, DispList::nors, and DispList::verts.
Referenced by do_makeDispListCurveTypes(), and makeDispListSurf().
void count_displist | ( | ListBase * | lb, |
int * | totvert, | ||
int * | totface | ||
) |
Definition at line 226 of file displist.c.
References DL_INDEX3, DL_INDEX4, DL_POLY, DL_SEGM, DL_SURF, ListBase::first, DispList::next, DispList::nr, DispList::parts, and DispList::type.
Referenced by stats_object().
static DerivedMesh* create_orco_dm | ( | Scene * | scene, |
Object * | ob | ||
) | [static] |
Definition at line 983 of file displist.c.
References CDDM_from_curve_customDB(), freedisplist(), makeDispListCurveTypes_forOrco(), and NULL.
Referenced by curve_calc_orcodm().
static void curve_calc_modifiers_post | ( | Scene * | scene, |
Object * | ob, | ||
ListBase * | dispbase, | ||
DerivedMesh ** | derivedFinal, | ||
int | forRender, | ||
float(*) | originalVerts[3], | ||
float(*) | deformedVerts[3] | ||
) | [static] |
Definition at line 825 of file displist.c.
References ModifierTypeInfo::applyModifier, BKE_curve_nurbs(), CDDM_apply_vert_coords(), CDDM_calc_normals(), CDDM_copy(), CDDM_from_curve_customDB(), CU_DEFORM_FILL, curve_applyVertexCos(), curve_get_tesselate_point(), curve_to_filledpoly(), Object::data, ModifierTypeInfo::deformVerts, displist_apply_allverts(), displist_get_allverts(), Curve::editnurb, ELEM, eModifierMode_Editmode, eModifierMode_Realtime, eModifierMode_Render, eModifierTypeType_DeformOrConstruct, eModifierTypeType_OnlyDeform, Curve::flag, DerivedMesh::getNumVerts, DerivedMesh::getVertCos, ModifierTypeInfo::isDisabled, MEM_freeN(), MEM_mallocN(), ModifierData::mode, modifiers_getVirtualModifierList(), modifierType_getInfo(), mti, ModifierData::next, NULL, OB_CURVE, OB_FONT, DerivedMesh::release, ModifierData::scene, ModifierData::type, Object::type, and ModifierTypeInfo::type.
Referenced by do_makeDispListCurveTypes(), and makeDispListSurf().
static void curve_calc_modifiers_pre | ( | Scene * | scene, |
Object * | ob, | ||
int | forRender, | ||
float(**) | originalVerts_r[3], | ||
float(**) | deformedVerts_r[3], | ||
int * | numVerts_r | ||
) | [static] |
Definition at line 723 of file displist.c.
References BKE_curve_nurbs(), curve_applyKeyVertexTilts(), curve_applyVertexCos(), curve_get_tesselate_point(), curve_getKeyVertexCos(), curve_getVertexCos(), Object::data, ModifierTypeInfo::deformVerts, do_ob_key(), Curve::editnurb, eModifierMode_Editmode, eModifierMode_Realtime, eModifierMode_Render, eModifierTypeType_OnlyDeform, ModifierTypeInfo::isDisabled, MEM_dupallocN(), MEM_freeN(), ModifierData::mode, modifiers_getVirtualModifierList(), modifierType_getInfo(), mti, ModifierData::next, NULL, ModifierData::scene, ModifierData::type, and ModifierTypeInfo::type.
Referenced by do_makeDispListCurveTypes(), and makeDispListSurf().
static void curve_calc_orcodm | ( | Scene * | scene, |
Object * | ob, | ||
DerivedMesh * | derivedFinal, | ||
int | forRender | ||
) | [static] |
Definition at line 1032 of file displist.c.
References add_orco_dm(), ModifierTypeInfo::applyModifier, create_orco_dm(), curve_get_tesselate_point(), Object::data, Curve::editnurb, eModifierMode_Editmode, eModifierMode_Realtime, eModifierMode_Render, eModifierTypeType_Constructive, ModifierTypeInfo::isDisabled, ModifierData::mode, modifiers_getVirtualModifierList(), modifierType_getInfo(), mti, ModifierData::next, NULL, DerivedMesh::release, ModifierData::scene, ModifierData::type, and ModifierTypeInfo::type.
Referenced by makeOrcoDispList().
static ModifierData* curve_get_tesselate_point | ( | Scene * | scene, |
Object * | ob, | ||
int | forRender, | ||
int | editmode | ||
) | [static] |
Definition at line 690 of file displist.c.
References ELEM3, eModifierMode_ApplyOnSpline, eModifierMode_Editmode, eModifierMode_Realtime, eModifierMode_Render, eModifierType_Hook, eModifierType_MeshDeform, eModifierType_Softbody, eModifierTypeType_Constructive, ModifierData::mode, modifier_isEnabled(), modifiers_getVirtualModifierList(), modifierType_getInfo(), mti, ModifierData::next, NULL, ModifierData::type, and ModifierTypeInfo::type.
Referenced by curve_calc_modifiers_post(), curve_calc_modifiers_pre(), and curve_calc_orcodm().
static void curve_to_displist | ( | Curve * | cu, |
ListBase * | nubase, | ||
ListBase * | dispbase, | ||
int | forRender | ||
) | [static] |
Definition at line 282 of file displist.c.
References Nurb::bezt, BLI_addtail(), Nurb::bp, DispList::charidx, Nurb::charidx, check_valid_nurb_u(), DispList::col, copy_v3_v3(), CU_BEZIER, CU_NURB_CYCLIC, CU_NURBS, CU_POLY, data, DL_POLY, DL_SEGM, ListBase::first, Nurb::flagu, forward_diff_bezier(), BezTriple::h1, BezTriple::h2, HD_VECT, Nurb::hide, len(), makeNurbcurve(), Nurb::mat_nr, MEM_callocN(), Nurb::next, DispList::nr, NULL, DispList::parts, Nurb::pntsu, Nurb::resolu, Curve::resolu_ren, SEGMENTSU, DispList::type, Nurb::type, BezTriple::vec, BPoint::vec, and DispList::verts.
Referenced by do_makeDispListCurveTypes().
Definition at line 602 of file displist.c.
References bevels_to_filledpoly(), CU_3D, DL_SURF, filldisplist(), ListBase::first, and Curve::flag.
Referenced by curve_calc_modifiers_post(), and do_makeDispListCurveTypes().
static void displist_apply_allverts | ( | ListBase * | dispbase, |
float(*) | allverts[3] | ||
) | [static] |
Definition at line 812 of file displist.c.
References DL_INDEX3, ListBase::first, DispList::next, DispList::nr, offs, DispList::parts, DispList::type, and DispList::verts.
Referenced by curve_calc_modifiers_post().
static float(* displist_get_allverts | ( | ListBase * | dispbase, |
int * | totvert | ||
) | )[3] [static] |
Definition at line 791 of file displist.c.
References DL_INDEX3, MEM_mallocN(), DispList::next, DispList::nr, offs, DispList::parts, DispList::type, and DispList::verts.
Referenced by curve_calc_modifiers_post().
int displist_has_faces | ( | ListBase * | lb | ) |
Definition at line 125 of file displist.c.
References DL_INDEX3, DL_INDEX4, DL_SURF, ELEM3, ListBase::first, DispList::next, and DispList::type.
Referenced by drawDispList(), and drawObjectSelect().
static void displist_surf_indices | ( | DispList * | dl | ) | [static] |
Definition at line 953 of file displist.c.
References DispList::index, MEM_mallocN(), DispList::nr, DispList::parts, surfindex_displist(), and DispList::totindex.
Referenced by do_makeDispListCurveTypes(), and makeDispListSurf().
static void do_makeDispListCurveTypes | ( | Scene * | scene, |
Object * | ob, | ||
ListBase * | dispbase, | ||
DerivedMesh ** | derivedFinal, | ||
int | forRender, | ||
int | forOrco | ||
) | [static] |
Definition at line 1181 of file displist.c.
References Curve::bev, DispList::bevelSplitFlag, Curve::bevobj, BKE_curve_nurbs(), BKE_text_to_curve(), BLI_addtail(), BLI_freelistN(), calc_curvepath(), calc_taper(), DispList::charidx, DispList::col, DispList::col2, copy_displist(), BevPoint::cosa, CU_2D, CU_3D, CU_BACK, CU_DEFORM_FILL, CU_FRONT, CU_PATH, curve_calc_modifiers_post(), curve_calc_modifiers_pre(), curve_to_displist(), curve_to_filledpoly(), Object::data, data, Object::derivedFinal, Curve::disp, displist_surf_indices(), DL_BACK_CURVE, DL_CYCL_U, DL_CYCL_V, DL_FRONT_CURVE, DL_POLY, DL_SEGM, DL_SURF, ELEM, ELEM3, ListBase::first, Curve::flag, DispList::flag, free_path(), freedisplist(), G, makebevelcurve(), makeBevelList(), makeDispListSurf(), MEM_callocN(), mul_qt_v3(), BevList::next, DispList::next, BevList::nr, DispList::nr, NULL, OB_CURVE, OB_FONT, OB_SURF, DispList::parts, Curve::path, BevList::poly, BevPoint::quat, BevPoint::radius, DispList::rt, BevPoint::sina, BevPoint::split_tag, Curve::taperobj, tex_space_curve(), DispList::type, Object::type, BevPoint::vec, DispList::verts, and Curve::width.
Referenced by makeDispListCurveTypes(), makeDispListCurveTypes_forOrco(), and makeDispListCurveTypes_forRender().
Definition at line 418 of file displist.c.
References BLI_addfilledge(), BLI_addfillvert(), BLI_addhead(), BLI_edgefill(), BLI_end_edgefill(), EditVert::co, DispList::col, copy_v3_v3(), DL_INDEX3, DL_POLY, fillfacebase, fillvertbase, ListBase::first, DispList::index, EditVert::l, MEM_callocN(), MEM_mallocN(), EditFace::next, EditVert::next, DispList::nr, NULL, DispList::parts, SWAP, EditVert::tmp, DispList::type, EditFace::v1, EditFace::v2, EditFace::v3, and DispList::verts.
Referenced by bevels_to_filledpoly(), curve_to_filledpoly(), draw_triangulated(), and M_Geometry_tesselate_polygon().
Definition at line 112 of file displist.c.
References ListBase::first, DispList::next, NULL, and DispList::type.
Referenced by contarget_get_lattice_mat(), drawlattice(), give_parvert(), init_latt_deform(), and lattice_foreachScreenVert().
Definition at line 95 of file displist.c.
References BLI_addtail(), ListBase::first, MEM_callocN(), DispList::next, and DispList::type.
void free_disp_elem | ( | DispList * | dl | ) |
Definition at line 70 of file displist.c.
References DispList::bevelSplitFlag, DispList::col1, DispList::col2, DispList::index, MEM_freeN(), DispList::nors, and DispList::verts.
Referenced by freedisplist().
void freedisplist | ( | ListBase * | lb | ) |
Definition at line 83 of file displist.c.
References BLI_remlink(), ListBase::first, and free_disp_elem().
Referenced by bevels_to_filledpoly(), clear_mesh_caches(), convert_exec(), copy_displist(), create_orco_dm(), do_makeDispListCurveTypes(), draw_triangulated(), free_curve(), free_mball(), init_render_curve(), init_render_mball(), init_render_surf(), lattice_calc_modifiers(), M_Geometry_tesselate_polygon(), make_orco_curve(), makebevelcurve(), makeDispListCurveTypes(), makeDispListMBall(), object_free_display(), object_remove_material_slot(), and resizelattice().
Definition at line 1361 of file displist.c.
References Object::bb, boundbox_displist(), Object::data, Object::derivedFinal, Curve::disp, Object::disp, DM_set_object_boundbox(), do_makeDispListCurveTypes(), ELEM3, freedisplist(), MEM_freeN(), NULL, OB_CURVE, OB_FONT, OB_SURF, and Object::type.
Referenced by arrayModifier_doArray(), BKE_text_to_curve(), calc_curve_deform(), calc_taper(), clampto_get_tarmat(), convert_exec(), curvetomesh(), draw_object(), followpath_get_tarmat(), makebevelcurve(), meshdeform_bind_exec(), ob_parcurve(), object_handle_update(), parent_set_exec(), precalculate_effector(), pycon_get_tarmat(), splineik_get_tarmat(), and splineik_init_tree_from_pchan().
void makeDispListCurveTypes_forOrco | ( | struct Scene * | scene, |
struct Object * | ob, | ||
struct ListBase * | dispbase | ||
) |
Definition at line 1399 of file displist.c.
References do_makeDispListCurveTypes(), and NULL.
Referenced by create_orco_dm(), and make_orco_curve().
void makeDispListCurveTypes_forRender | ( | Scene * | scene, |
Object * | ob, | ||
ListBase * | dispbase, | ||
DerivedMesh ** | derivedFinal, | ||
int | forOrco | ||
) |
Definition at line 1393 of file displist.c.
References do_makeDispListCurveTypes().
Referenced by init_render_curve(), and makebevelcurve().
Definition at line 660 of file displist.c.
References boundbox_displist(), Object::disp, find_basis_mball(), freedisplist(), G, metaball_polygonize(), OB_MBALL, object_deform_mball(), tex_space_mball(), and Object::type.
Referenced by convert_exec(), draw_bounding_volume(), drawDispList(), meshdeform_bind_exec(), and object_handle_update().
Definition at line 682 of file displist.c.
References metaball_polygonize(), object_deform_mball(), and tex_space_mball().
Referenced by init_render_mball().
void makeDispListSurf | ( | Scene * | scene, |
Object * | ob, | ||
ListBase * | dispbase, | ||
DerivedMesh ** | derivedFinal, | ||
int | forRender, | ||
int | forOrco | ||
) |
Definition at line 1085 of file displist.c.
References BLI_addtail(), DispList::charidx, Nurb::charidx, DispList::col, copy_displist(), CU_2D, CU_NURB_CYCLIC, curve_calc_modifiers_post(), curve_calc_modifiers_pre(), curve_editnurbs(), Object::data, data, Curve::disp, displist_surf_indices(), DL_CYCL_U, DL_CYCL_V, DL_POLY, DL_SEGM, DL_SURF, Curve::editnurb, ListBase::first, DispList::flag, Nurb::flag, Nurb::flagu, Nurb::flagv, Nurb::hide, len(), makeNurbcurve(), makeNurbfaces(), Nurb::mat_nr, MEM_callocN(), Nurb::next, DispList::nr, NULL, Curve::nurb, DispList::parts, Nurb::pntsu, Nurb::pntsv, Nurb::resolu, Curve::resolu_ren, Nurb::resolv, Curve::resolv_ren, DispList::rt, SEGMENTSU, tex_space_curve(), DispList::type, and DispList::verts.
Referenced by do_makeDispListCurveTypes(), and init_render_surf().
float* makeOrcoDispList | ( | Scene * | scene, |
Object * | ob, | ||
DerivedMesh * | derivedFinal, | ||
int | forRender | ||
) |
Definition at line 1405 of file displist.c.
References CD_ORCO, curve_calc_orcodm(), Object::derivedFinal, DerivedMesh::getVertDataArray, MEM_dupallocN(), and NULL.
Referenced by init_render_curve(), and init_render_surf().
int surfindex_displist | ( | DispList * | dl, |
int | a, | ||
int * | b, | ||
int * | p1, | ||
int * | p2, | ||
int * | p3, | ||
int * | p4 | ||
) |
Definition at line 252 of file displist.c.
References DL_CYCL_U, DL_CYCL_V, DispList::flag, DispList::nr, and DispList::parts.
Referenced by addnormalsDispList(), displist_surf_indices(), and init_render_curve().
Definition at line 71 of file material.c.
Referenced by BL_ConvertMesh(), give_current_material_or_def(), give_render_material(), GPU_begin_object_materials(), GPU_codegen_exit(), and GPU_materials_free().