Blender V2.61 - r43446
|
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_pbvh.h"
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_paint.h"
#include "BKE_scene.h"
#include "BKE_subsurf.h"
#include "BKE_object.h"
#include "CCGSubSurf.h"
#include <math.h>
#include <string.h>
Go to the source code of this file.
Defines | |
#define | DNA_DEPRECATED_ALLOW |
Functions | |
static void | multires_mvert_to_ss (DerivedMesh *dm, MVert *mvert) |
static void | multiresModifier_disp_run (DerivedMesh *dm, Mesh *me, int invert, int add, DMGridData **oldGridData, int totlvl) |
DerivedMesh * | get_multires_dm (Scene *scene, MultiresModifierData *mmd, Object *ob) |
MultiresModifierData * | find_multires_modifier_before (Scene *scene, ModifierData *lastmd) |
MultiresModifierData * | get_multires_modifier (Scene *scene, Object *ob, int use_first) |
static int | multires_get_level (Object *ob, MultiresModifierData *mmd, int render) |
static void | multires_set_tot_level (Object *ob, MultiresModifierData *mmd, int lvl) |
static void | multires_dm_mark_as_modified (DerivedMesh *dm) |
void | multires_mark_as_modified (Object *ob) |
void | multires_force_update (Object *ob) |
void | multires_force_external_reload (Object *ob) |
void | multires_force_render_update (Object *ob) |
int | multiresModifier_reshapeFromDM (Scene *scene, MultiresModifierData *mmd, Object *ob, DerivedMesh *srcdm) |
int | multiresModifier_reshape (Scene *scene, MultiresModifierData *mmd, Object *dst, Object *src) |
int | multiresModifier_reshapeFromDeformMod (Scene *scene, MultiresModifierData *mmd, Object *ob, ModifierData *md) |
static int | get_levels_from_disps (Object *ob) |
void | multiresModifier_set_levels_from_disps (MultiresModifierData *mmd, Object *ob) |
static void | multires_set_tot_mdisps (Mesh *me, int lvl) |
static void | multires_reallocate_mdisps (Mesh *me, MDisps *mdisps, int lvl) |
static void | column_vectors_to_mat3 (float mat[][3], float v1[3], float v2[3], float v3[3]) |
static void | multires_copy_grid (float(*gridA)[3], float(*gridB)[3], int sizeA, int sizeB) |
static void | multires_copy_dm_grid (DMGridData *gridA, DMGridData *gridB, int sizeA, int sizeB) |
static void | multires_del_higher (MultiresModifierData *mmd, Object *ob, int lvl) |
void | multiresModifier_del_levels (MultiresModifierData *mmd, Object *ob, int direction) |
static DerivedMesh * | multires_dm_create_local (Object *ob, DerivedMesh *dm, int lvl, int totlvl, int simple) |
static DerivedMesh * | subsurf_dm_create_local (Object *ob, DerivedMesh *dm, int lvl, int simple, int optimal, int plain_uv) |
static float | v3_dist_from_plane (float v[3], float center[3], float no[3]) |
void | multiresModifier_base_apply (MultiresModifierData *mmd, Object *ob) |
static void | multires_subdivide (MultiresModifierData *mmd, Object *ob, int totlvl, int updateblock, int simple) |
void | multiresModifier_subdivide (MultiresModifierData *mmd, Object *ob, int updateblock, int simple) |
static void | grid_tangent (int gridSize, int index, int x, int y, int axis, DMGridData **gridData, float t[3]) |
static void | multiresModifier_update (DerivedMesh *dm) |
void | multires_stitch_grids (Object *ob) |
DerivedMesh * | multires_dm_create_from_derived (MultiresModifierData *mmd, int local_mmd, DerivedMesh *dm, Object *ob, int useRenderParams, int UNUSED(isFinalCalc)) |
void | old_mdisps_bilinear (float out[3], float(*disps)[3], const int st, float u, float v) |
static void | old_mdisps_rotate (int S, int UNUSED(newside), int oldside, int x, int y, float *u, float *v) |
static void | old_mdisps_convert (MFace *mface, MDisps *mdisp) |
void | multires_load_old_250 (Mesh *me) |
static void | multires_free_level (MultiresLevel *lvl) |
void | multires_free (Multires *mr) |
static void | create_old_vert_face_map (ListBase **map, IndexNode **mem, const MultiresFace *mface, const int totvert, const int totface) |
static void | create_old_vert_edge_map (ListBase **map, IndexNode **mem, const MultiresEdge *medge, const int totvert, const int totedge) |
static MultiresFace * | find_old_face (ListBase *map, MultiresFace *faces, int v1, int v2, int v3, int v4) |
static MultiresEdge * | find_old_edge (ListBase *map, MultiresEdge *edges, int v1, int v2) |
static void | multires_load_old_edges (ListBase **emap, MultiresLevel *lvl, int *vvmap, int dst, int v1, int v2, int mov) |
static void | multires_load_old_faces (ListBase **fmap, ListBase **emap, MultiresLevel *lvl, int *vvmap, int dst, int v1, int v2, int v3, int v4, int st2, int st3) |
static void | multires_load_old_dm (DerivedMesh *dm, Mesh *me, int totlvl) |
static void | multires_load_old_vcols (Mesh *me) |
static void | multires_load_old_face_flags (Mesh *me) |
void | multires_load_old (Object *ob, Mesh *me) |
static void | multires_sync_levels (Scene *scene, Object *ob, Object *to_ob) |
static void | multires_apply_smat (Scene *scene, Object *ob, float smat[3][3]) |
int | multires_mdisp_corners (MDisps *s) |
void | multiresModifier_scale_disp (Scene *scene, Object *ob) |
void | multiresModifier_prepare_join (Scene *scene, Object *ob, Object *to_ob) |
void | multires_topology_changed (Scene *scene, Object *ob) |
void | multires_mdisp_smooth_bounds (MDisps *disps) |
static void | mdisp_get_crn_rect (int face_side, float crn[3][4][2]) |
static int | mdisp_pt_in_crn (float p[2], float crn[4][2]) |
static void | face_to_crn_interp (float u, float v, float v1[2], float v2[2], float v3[2], float v4[2], float *x) |
void | mdisp_rot_crn_to_face (const int S, const int corners, const int face_side, const float x, const float y, float *u, float *v) |
int | mdisp_rot_face_to_crn (const int corners, const int face_side, const float u, const float v, float *x, float *y) |
int | mdisp_rot_face_to_quad_crn (const int corners, const int face_side, const float u, const float v, float *x, float *y) |
void | mdisp_apply_weight (const int S, const int corners, int x, int y, const int face_side, float crn_weight[4][2], float *u_r, float *v_r) |
void | mdisp_flip_disp (const int S, const int corners, const float axis_x[2], const float axis_y[2], float disp[3]) |
void | mdisp_join_tris (MDisps *dst, MDisps *tri1, MDisps *tri2) |
Variables | |
static const int | multires_max_levels = 13 |
static const int | multires_grid_tot [] = {0, 4, 9, 25, 81, 289, 1089, 4225, 16641, 66049, 263169, 1050625, 4198401, 16785409} |
static const int | multires_side_tot [] = {0, 2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097} |
Definition in file multires.c.
#define DNA_DEPRECATED_ALLOW |
Definition at line 36 of file multires.c.
static void column_vectors_to_mat3 | ( | float | mat[][3], |
float | v1[3], | ||
float | v2[3], | ||
float | v3[3] | ||
) | [static] |
Definition at line 337 of file multires.c.
References copy_v3_v3().
Referenced by multires_apply_smat(), and multiresModifier_disp_run().
static void create_old_vert_edge_map | ( | ListBase ** | map, |
IndexNode ** | mem, | ||
const MultiresEdge * | medge, | ||
const int | totvert, | ||
const int | totedge | ||
) | [static] |
Definition at line 1129 of file multires.c.
References BLI_addtail(), i, IndexNode::index, MEM_callocN(), and NULL.
Referenced by multires_load_old_dm().
static void create_old_vert_face_map | ( | ListBase ** | map, |
IndexNode ** | mem, | ||
const MultiresFace * | mface, | ||
const int | totvert, | ||
const int | totface | ||
) | [static] |
Definition at line 1110 of file multires.c.
References BLI_addtail(), i, IndexNode::index, MEM_callocN(), NULL, and MultiresFace::v.
Referenced by multires_load_old_dm().
static void face_to_crn_interp | ( | float | u, |
float | v, | ||
float | v1[2], | ||
float | v2[2], | ||
float | v3[2], | ||
float | v4[2], | ||
float * | x | ||
) | [static] |
Definition at line 1958 of file multires.c.
References simple_enum_gen::d, maxf(), and sqrtf.
Referenced by mdisp_rot_face_to_quad_crn().
MultiresModifierData* find_multires_modifier_before | ( | Scene * | scene, |
ModifierData * | lastmd | ||
) | [read] |
Definition at line 87 of file multires.c.
References eModifierMode_Realtime, eModifierType_Multires, modifier_isEnabled(), NULL, ModifierData::prev, and ModifierData::type.
Referenced by modifier_apply_obdata().
static MultiresEdge* find_old_edge | ( | ListBase * | map, |
MultiresEdge * | edges, | ||
int | v1, | ||
int | v2 | ||
) | [static] |
Definition at line 1175 of file multires.c.
References IndexNode::index, IndexNode::next, and NULL.
Referenced by multires_load_old_dm(), multires_load_old_edges(), and multires_load_old_faces().
static MultiresFace* find_old_face | ( | ListBase * | map, |
MultiresFace * | faces, | ||
int | v1, | ||
int | v2, | ||
int | v3, | ||
int | v4 | ||
) | [static] |
Definition at line 1148 of file multires.c.
References i, IndexNode::index, IndexNode::next, NULL, and MultiresFace::v.
Referenced by multires_load_old_faces().
static int get_levels_from_disps | ( | Object * | ob | ) | [static] |
Definition at line 256 of file multires.c.
References CD_MDISPS, CustomData_get_layer(), Object::data, Mesh::fdata, i, Mesh::mface, MDisps::totdisp, Mesh::totface, and MFace::v4.
Referenced by multiresModifier_set_levels_from_disps().
DerivedMesh* get_multires_dm | ( | Scene * | scene, |
MultiresModifierData * | mmd, | ||
Object * | ob | ||
) | [read] |
Definition at line 72 of file multires.c.
References ModifierTypeInfo::applyModifier, CD_MASK_BAREMESH, CDDM_copy(), mesh_get_derived_deform(), modifierType_getInfo(), mti, and ModifierData::type.
Referenced by multires_apply_smat(), multiresModifier_reshapeFromDeformMod(), and multiresModifier_reshapeFromDM().
MultiresModifierData* get_multires_modifier | ( | Scene * | scene, |
Object * | ob, | ||
int | use_first | ||
) | [read] |
Definition at line 104 of file multires.c.
References eModifierMode_Realtime, eModifierType_Multires, ListBase::first, modifier_isEnabled(), Object::modifiers, ModifierData::next, NULL, and ModifierData::type.
Referenced by mesh_calc_modifiers(), multires_apply_smat(), multires_sync_levels(), multires_topology_changed(), multiresbake_check(), multiresbake_create_hiresdm(), multiresbake_create_loresdm(), and sculpt_get_first_deform_matrices().
static void grid_tangent | ( | int | gridSize, |
int | index, | ||
int | x, | ||
int | y, | ||
int | axis, | ||
DMGridData ** | gridData, | ||
float | t[3] | ||
) | [static] |
Definition at line 688 of file multires.c.
References co, and sub_v3_v3v3().
Referenced by multires_apply_smat(), and multiresModifier_disp_run().
void mdisp_apply_weight | ( | const int | S, |
const int | corners, | ||
int | x, | ||
int | y, | ||
const int | face_side, | ||
float | crn_weight[4][2], | ||
float * | u_r, | ||
float * | v_r | ||
) |
Definition at line 2105 of file multires.c.
References mdisp_rot_crn_to_face().
Referenced by layerInterp_mdisps().
void mdisp_flip_disp | ( | const int | S, |
const int | corners, | ||
const float | axis_x[2], | ||
const float | axis_y[2], | ||
float | disp[3] | ||
) |
Definition at line 2139 of file multires.c.
References add_v2_v2v2(), copy_v2_v2(), dot_v2v2(), len_v2(), mul_v2_v2fl(), and project_v2_v2v2().
Referenced by layerInterp_mdisps().
static void mdisp_get_crn_rect | ( | int | face_side, |
float | crn[3][4][2] | ||
) | [static] |
Definition at line 1914 of file multires.c.
Referenced by mdisp_rot_crn_to_face(), and mdisp_rot_face_to_quad_crn().
Definition at line 2182 of file multires.c.
References MDisps::disps, mdisp_rot_crn_to_face(), mdisp_rot_face_to_quad_crn(), MEM_callocN(), MEM_freeN(), old_mdisps_bilinear(), sqrt(), and MDisps::totdisp.
Referenced by layerInterp_mdisps().
static int mdisp_pt_in_crn | ( | float | p[2], |
float | crn[4][2] | ||
) | [static] |
Definition at line 1938 of file multires.c.
References cross_v2v2(), and sub_v2_v2v2().
Referenced by mdisp_rot_face_to_quad_crn().
void mdisp_rot_crn_to_face | ( | const int | S, |
const int | corners, | ||
const int | face_side, | ||
const float | x, | ||
const float | y, | ||
float * | u, | ||
float * | v | ||
) |
Definition at line 1977 of file multires.c.
References interp_v2_v2v2(), isect_seg_seg_v2_point(), mdisp_get_crn_rect(), and p.
Referenced by mdisp_apply_weight(), and mdisp_join_tris().
int mdisp_rot_face_to_crn | ( | const int | corners, |
const int | face_side, | ||
const float | u, | ||
const float | v, | ||
float * | x, | ||
float * | y | ||
) |
Definition at line 2005 of file multires.c.
References simple_enum_gen::w.
Referenced by get_ccgdm_data().
int mdisp_rot_face_to_quad_crn | ( | const int | corners, |
const int | face_side, | ||
const float | u, | ||
const float | v, | ||
float * | x, | ||
float * | y | ||
) |
Definition at line 2060 of file multires.c.
References face_to_crn_interp(), mdisp_get_crn_rect(), mdisp_pt_in_crn(), and p.
Referenced by layerInterp_mdisps(), and mdisp_join_tris().
Definition at line 1603 of file multires.c.
References CD_MASK_BAREMESH, CD_MASK_MDISPS, CD_MDISPS, CDDM_apply_vert_coords(), DMGridData::co, co, column_vectors_to_mat3(), CustomData_external_read(), CustomData_get_layer(), data, Object::data, MDisps::disps, eMultiresModifierFlag_PlainUv, Mesh::fdata, MultiresModifierData::flags, get_multires_dm(), get_multires_modifier(), DerivedMesh::getGridData, DerivedMesh::getGridOffset, DerivedMesh::getGridSize, grid_tangent(), i, Mesh::id, invert_m3(), MultiresModifierData::lvl, MEM_freeN(), MEM_mallocN(), mesh_get_derived_deform(), Mesh::mface, mul_m3_v3(), mul_v3_m3v3(), multires_side_tot, DMGridData::no, normalize_v3(), NULL, DerivedMesh::release, MultiresModifierData::simple, sub_v3_v3v3(), subsurf_dm_create_local(), Mesh::totface, and MultiresModifierData::totlvl.
Referenced by multiresModifier_prepare_join(), and multiresModifier_scale_disp().
static void multires_copy_dm_grid | ( | DMGridData * | gridA, |
DMGridData * | gridB, | ||
int | sizeA, | ||
int | sizeB | ||
) | [static] |
Definition at line 364 of file multires.c.
References co, and copy_v3_v3().
Referenced by multires_subdivide(), and multiresModifier_update().
static void multires_copy_grid | ( | float(*) | gridA[3], |
float(*) | gridB[3], | ||
int | sizeA, | ||
int | sizeB | ||
) | [static] |
Definition at line 344 of file multires.c.
References copy_v3_v3().
Referenced by multires_del_higher().
static void multires_del_higher | ( | MultiresModifierData * | mmd, |
Object * | ob, | ||
int | lvl | ||
) | [static] |
Definition at line 384 of file multires.c.
References CD_MASK_MDISPS, CD_MDISPS, CustomData_external_read(), CustomData_external_remove(), CustomData_free_layer_active(), CustomData_get_layer(), Object::data, MDisps::disps, Mesh::fdata, i, Mesh::id, MEM_callocN(), MEM_freeN(), Mesh::mface, multires_copy_grid(), multires_force_update(), multires_grid_tot, multires_set_tot_level(), multires_set_tot_mdisps(), multires_side_tot, MDisps::totdisp, Mesh::totface, MultiresModifierData::totlvl, and MFace::v4.
Referenced by multires_sync_levels(), and multiresModifier_del_levels().
DerivedMesh* multires_dm_create_from_derived | ( | MultiresModifierData * | mmd, |
int | local_mmd, | ||
DerivedMesh * | dm, | ||
Object * | ob, | ||
int | useRenderParams, | ||
int | UNUSEDisFinalCalc | ||
) |
Definition at line 918 of file multires.c.
References CD_MASK_MDISPS, CustomData_external_read(), Object::data, eMultiresModifierFlag_ControlEdges, eMultiresModifierFlag_PlainUv, Mesh::fdata, MultiresModifierData::flags, DerivedMesh::getGridData, DerivedMesh::getGridSize, DerivedMesh::getNumGrids, i, Mesh::id, CCGDerivedMesh::local_mmd, CCGDerivedMesh::lvl, MEM_callocN(), MEM_freeN(), CCGDerivedMesh::mmd, CCGDerivedMesh::modified, CCGDerivedMesh::multires, multires_get_level(), multires_set_tot_mdisps(), multiresModifier_disp_run(), multiresModifier_update(), CCGDerivedMesh::ob, MultiresModifierData::simple, subsurf_dm_create_local(), Mesh::totface, MultiresModifierData::totlvl, CCGDerivedMesh::totlvl, and CCGDerivedMesh::update.
static DerivedMesh* multires_dm_create_local | ( | Object * | ob, |
DerivedMesh * | dm, | ||
int | lvl, | ||
int | totlvl, | ||
int | simple | ||
) | [static] |
Definition at line 456 of file multires.c.
References MultiresModifierData::lvl, multires_dm_create_from_derived(), NULL, MultiresModifierData::renderlvl, MultiresModifierData::sculptlvl, MultiresModifierData::simple, and MultiresModifierData::totlvl.
Referenced by multires_subdivide(), multiresModifier_base_apply(), and multiresModifier_update().
static void multires_dm_mark_as_modified | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 152 of file multires.c.
References CCGDerivedMesh::modified, and CCGDerivedMesh::multires.
Referenced by multires_load_old(), multires_mark_as_modified(), and multiresModifier_reshapeFromDM().
void multires_force_external_reload | ( | Object * | ob | ) |
Definition at line 179 of file multires.c.
References CD_MASK_MDISPS, CustomData_external_reload(), Mesh::fdata, get_mesh(), Mesh::id, multires_force_update(), and Mesh::totface.
void multires_force_render_update | ( | Object * | ob | ) |
Definition at line 187 of file multires.c.
References eModifierType_Multires, Object::mode, modifiers_findByType(), multires_force_update(), and OB_MODE_SCULPT.
Referenced by screen_render_invoke().
void multires_force_update | ( | Object * | ob | ) |
Definition at line 164 of file multires.c.
References BLI_pbvh_free(), Object::derivedFinal, DerivedMesh::needsFree, NULL, SculptSession::pbvh, DerivedMesh::release, and Object::sculpt.
Referenced by ED_sculpt_force_update(), init_multiresbake_job(), modifier_apply_obdata(), multires_del_higher(), multires_force_external_reload(), multires_force_render_update(), multires_subdivide(), multiresbake_image_exec_locked(), multiresModifier_base_apply(), multiresModifier_del_levels(), multiresModifier_reshapeFromDM(), sculpt_toggle_mode(), and set_mesh().
void multires_free | ( | Multires * | mr | ) |
Definition at line 1082 of file multires.c.
References BLI_freelistN(), CustomData_free(), Multires::edge_creases, Multires::edge_flags, Multires::fdata, ListBase::first, Multires::levels, MEM_freeN(), multires_free_level(), MultiresLevel::next, MultiresLevel::totface, MultiresLevel::totvert, Multires::vdata, and Multires::verts.
Referenced by direct_link_mesh(), and multires_load_old().
static void multires_free_level | ( | MultiresLevel * | lvl | ) | [static] |
Definition at line 1073 of file multires.c.
References MultiresLevel::colfaces, MultiresLevel::edges, MultiresLevel::faces, and MEM_freeN().
Referenced by multires_free().
static int multires_get_level | ( | Object * | ob, |
MultiresModifierData * | mmd, | ||
int | render | ||
) | [static] |
Definition at line 131 of file multires.c.
References get_render_subsurf_level(), MultiresModifierData::lvl, Object::mode, MultiresModifierData::modifier, OB_MODE_SCULPT, Scene::r, MultiresModifierData::renderlvl, ModifierData::scene, and MultiresModifierData::sculptlvl.
Referenced by multires_dm_create_from_derived(), multiresModifier_del_levels(), and multiresModifier_reshapeFromDeformMod().
Definition at line 1511 of file multires.c.
References BLI_insertlinkbefore(), CD_CALLOC, CD_MEDGE, CD_MFACE, CD_MVERT, CD_REFERENCE, CDDM_from_mesh(), CustomData_add_layer(), CustomData_free_layers(), CustomDataLayer::data, MultiresLevel::edges, eModifierType_Multires, eModifierTypeType_OnlyDeform, MultiresLevel::faces, Mesh::fdata, ListBase::first, i, CustomData::layers, MultiresModifierData::lvl, MultiresFace::mat_nr, MFace::mat_nr, Mesh::medge, Mesh::mface, modifier_new(), Object::modifiers, modifierType_getInfo(), multires_dm_create_from_derived(), multires_dm_mark_as_modified(), multires_free(), multires_load_old_dm(), multires_load_old_face_flags(), multires_load_old_vcols(), multiresModifier_subdivide(), Mesh::mvert, ModifierData::next, NULL, DerivedMesh::release, Mesh::totedge, MultiresLevel::totedge, Mesh::totface, MultiresLevel::totface, MultiresModifierData::totlvl, Mesh::totvert, MultiresLevel::totvert, CustomDataLayer::type, ModifierTypeInfo::type, ModifierData::type, MultiresFace::v, MultiresEdge::v, MFace::v1, MEdge::v1, MFace::v2, MEdge::v2, MFace::v3, MFace::v4, and Mesh::verts.
Referenced by do_versions().
void multires_load_old_250 | ( | Mesh * | me | ) |
Definition at line 1058 of file multires.c.
References CD_MDISPS, CustomData_get_layer(), Mesh::fdata, Mesh::mface, old_mdisps_convert(), and Mesh::totface.
Referenced by do_versions().
static void multires_load_old_dm | ( | DerivedMesh * | dm, |
Mesh * | me, | ||
int | totlvl | ||
) | [static] |
Definition at line 1298 of file multires.c.
References co, copy_v3_v3(), create_old_vert_edge_map(), create_old_vert_face_map(), MultiresLevel::edges, MultiresLevel::faces, find_old_edge(), ListBase::first, DerivedMesh::getNumVerts, DerivedMesh::getVertArray, i, Multires::level_count, Multires::levels, MEM_callocN(), MEM_freeN(), MultiresEdge::mid, multires_load_old_faces(), multires_mvert_to_ss(), multires_side_tot, MultiresLevel::next, pow(), MultiresLevel::prev, MultiresLevel::totedge, MultiresLevel::totface, MultiresLevel::totvert, MultiresFace::v, and Multires::verts.
Referenced by multires_load_old().
static void multires_load_old_edges | ( | ListBase ** | emap, |
MultiresLevel * | lvl, | ||
int * | vvmap, | ||
int | dst, | ||
int | v1, | ||
int | v2, | ||
int | mov | ||
) | [static] |
Definition at line 1189 of file multires.c.
References MultiresLevel::edges, find_old_edge(), MultiresEdge::mid, and MultiresLevel::next.
Referenced by multires_load_old_faces().
static void multires_load_old_face_flags | ( | Mesh * | me | ) | [static] |
Definition at line 1495 of file multires.c.
References MultiresLevel::faces, MFace::flag, MultiresFace::flag, i, Mesh::mface, and Mesh::totface.
Referenced by multires_load_old().
static void multires_load_old_faces | ( | ListBase ** | fmap, |
ListBase ** | emap, | ||
MultiresLevel * | lvl, | ||
int * | vvmap, | ||
int | dst, | ||
int | v1, | ||
int | v2, | ||
int | v3, | ||
int | v4, | ||
int | st2, | ||
int | st3 | ||
) | [static] |
Definition at line 1200 of file multires.c.
References MultiresLevel::edges, MultiresLevel::faces, find_old_edge(), find_old_face(), MultiresFace::mid, MultiresEdge::mid, multires_load_old_edges(), and MultiresLevel::next.
Referenced by multires_load_old_dm().
static void multires_load_old_vcols | ( | Mesh * | me | ) | [static] |
Definition at line 1466 of file multires.c.
References MultiresCol::a, MCol::a, MultiresCol::b, MCol::b, CD_MCOL, MultiresColFace::col, MultiresLevel::colfaces, CustomData_get_layer(), Mesh::fdata, MultiresCol::g, MCol::g, i, MultiresCol::r, MCol::r, and Mesh::totface.
Referenced by multires_load_old().
void multires_mark_as_modified | ( | Object * | ob | ) |
Definition at line 158 of file multires.c.
References Object::derivedFinal, and multires_dm_mark_as_modified().
Referenced by sculpt_flush_update(), and sculpt_undo_restore().
int multires_mdisp_corners | ( | MDisps * | s | ) |
Definition at line 1696 of file multires.c.
References MDisps::totdisp.
Referenced by layerInterp_mdisps(), layerSwap_mdisps(), layerValidate_mdisps(), multires_mdisp_smooth_bounds(), and multires_topology_changed().
void multires_mdisp_smooth_bounds | ( | MDisps * | disps | ) |
Definition at line 1786 of file multires.c.
References data, MDisps::disps, mul_v3_fl(), multires_mdisp_corners(), sqrt(), and MDisps::totdisp.
Referenced by layerInterp_mdisps().
static void multires_mvert_to_ss | ( | DerivedMesh * | dm, |
MVert * | mvert | ||
) | [static] |
Definition at line 1237 of file multires.c.
References ccgSubSurf_getEdgeData(), ccgSubSurf_getEdgeSize(), ccgSubSurf_getFaceCenterData(), ccgSubSurf_getFaceGridData(), ccgSubSurf_getFaceGridEdgeData(), ccgSubSurf_getFaceNumVerts(), ccgSubSurf_getGridSize(), ccgSubSurf_getNumEdges(), ccgSubSurf_getNumFaces(), ccgSubSurf_getNumVerts(), ccgSubSurf_getVertData(), ccgSubSurf_updateToFaces(), DMGridData::co, MVert::co, copy_v3_v3(), credits_svn_gen::e, CCGDerivedMesh::edge, CCGDerivedMesh::edgeMap, CCGDerivedMesh::face, CCGDerivedMesh::faceMap, i, NULL, CCGDerivedMesh::ss, CCGDerivedMesh::vert, and CCGDerivedMesh::vertMap.
Referenced by multires_load_old_dm(), and multiresModifier_reshapeFromDM().
Definition at line 319 of file multires.c.
References MDisps::disps, i, MEM_callocN(), MEM_freeN(), Mesh::mface, multires_grid_tot, MDisps::totdisp, Mesh::totface, and MFace::v4.
Referenced by multires_subdivide(), and multiresModifier_disp_run().
static void multires_set_tot_level | ( | Object * | ob, |
MultiresModifierData * | mmd, | ||
int | lvl | ||
) | [static] |
Definition at line 141 of file multires.c.
References CLAMPIS, MultiresModifierData::lvl, MAX2, Object::mode, OB_MODE_SCULPT, MultiresModifierData::renderlvl, MultiresModifierData::sculptlvl, and MultiresModifierData::totlvl.
Referenced by multires_del_higher(), multires_subdivide(), and multiresModifier_del_levels().
static void multires_set_tot_mdisps | ( | Mesh * | me, |
int | lvl | ||
) | [static] |
Definition at line 304 of file multires.c.
References CD_MDISPS, CustomData_get_layer(), Mesh::fdata, i, Mesh::mface, multires_grid_tot, MDisps::totdisp, Mesh::totface, and MFace::v4.
Referenced by multires_del_higher(), multires_dm_create_from_derived(), multires_topology_changed(), multiresModifier_del_levels(), and multiresModifier_update().
void multires_stitch_grids | ( | Object * | ob | ) |
Definition at line 899 of file multires.c.
References BLI_pbvh_get_grid_updates(), ccgSubSurf_stitchFaces(), Object::derivedFinal, MEM_freeN(), CCGDerivedMesh::pbvh, and CCGDerivedMesh::ss.
Referenced by sculpt_fix_noise_tear(), and smooth().
static void multires_subdivide | ( | MultiresModifierData * | mmd, |
Object * | ob, | ||
int | totlvl, | ||
int | updateblock, | ||
int | simple | ||
) | [static] |
Definition at line 606 of file multires.c.
References ccgSubSurf_updateFromFaces(), ccgSubSurf_updateLevels(), CD_DEFAULT, CD_MASK_BAREMESH, CD_MDISPS, CDDM_from_mesh(), CustomData_add_layer(), CustomData_get_layer(), Object::data, MDisps::disps, DM_set_only_copy(), eMultiresModifierFlag_PlainUv, Mesh::fdata, MultiresModifierData::flags, DerivedMesh::getGridData, DerivedMesh::getGridSize, DerivedMesh::getNumGrids, i, MEM_callocN(), MEM_freeN(), multires_copy_dm_grid(), multires_dm_create_local(), multires_force_update(), multires_max_levels, multires_reallocate_mdisps(), multires_set_tot_level(), multiresModifier_disp_run(), NULL, DerivedMesh::release, subsurf_dm_create_local(), Mesh::totface, and MultiresModifierData::totlvl.
Referenced by multires_sync_levels(), and multiresModifier_subdivide().
Definition at line 1580 of file multires.c.
References CD_MDISPS, CustomData_external_remove(), CustomData_free_layer_active(), Object::data, Mesh::fdata, get_multires_modifier(), Mesh::id, multires_del_higher(), multires_subdivide(), MultiresModifierData::simple, Mesh::totface, and MultiresModifierData::totlvl.
Referenced by multiresModifier_prepare_join().
Definition at line 1734 of file multires.c.
References CD_MASK_MDISPS, CD_MDISPS, CustomData_external_read(), CustomData_get_layer(), Object::data, Mesh::fdata, get_multires_modifier(), i, Mesh::id, MEM_callocN(), MEM_freeN(), Mesh::mface, multires_mdisp_corners(), multires_set_tot_mdisps(), NULL, Mesh::totface, MultiresModifierData::totlvl, and MFace::v4.
Referenced by load_editMesh().
void multiresModifier_base_apply | ( | MultiresModifierData * | mmd, |
Object * | ob | ||
) |
Definition at line 495 of file multires.c.
References add_v3_v3(), CD_MASK_BAREMESH, CDDM_from_mesh(), MVert::co, copy_v3_v3(), DM_set_only_copy(), eMultiresModifierFlag_PlainUv, MultiresModifierData::flags, get_mesh(), DerivedMesh::getFaceMap, DerivedMesh::getGridData, DerivedMesh::getNumVerts, DerivedMesh::getVertCo, i, IndexNode::index, MEM_callocN(), MEM_freeN(), Mesh::mface, mul_v3_fl(), multires_dm_create_local(), multires_force_update(), multiresModifier_disp_run(), Mesh::mvert, IndexNode::next, normal_quad_v3(), normal_tri_v3(), normalize_v3(), NULL, DerivedMesh::release, subsurf_dm_create_local(), MultiresModifierData::totlvl, Mesh::totvert, MFace::v1, v3_dist_from_plane(), and MFace::v4.
Referenced by multires_base_apply_exec().
void multiresModifier_del_levels | ( | MultiresModifierData * | mmd, |
Object * | ob, | ||
int | direction | ||
) |
Definition at line 436 of file multires.c.
References CD_MASK_MDISPS, CD_MDISPS, CustomData_external_read(), CustomData_get_layer(), Mesh::fdata, get_mesh(), Mesh::id, multires_del_higher(), multires_force_update(), multires_get_level(), multires_set_tot_level(), multires_set_tot_mdisps(), Mesh::totface, and MultiresModifierData::totlvl.
Referenced by multires_higher_levels_delete_exec().
static void multiresModifier_disp_run | ( | DerivedMesh * | dm, |
Mesh * | me, | ||
int | invert, | ||
int | add, | ||
DMGridData ** | oldGridData, | ||
int | totlvl | ||
) | [static] |
Definition at line 712 of file multires.c.
References add_v3_v3(), add_v3_v3v3(), ccgSubSurf_stitchFaces(), ccgSubSurf_updateNormals(), CD_DEFAULT, CD_MDISPS, DMGridData::co, co, column_vectors_to_mat3(), CustomData_add_layer(), CustomData_get_layer(), simple_enum_gen::d, data, MDisps::disps, Mesh::fdata, DerivedMesh::getGridData, DerivedMesh::getGridOffset, DerivedMesh::getGridSize, grid_tangent(), i, invert_m3(), Mesh::mface, mul_v3_m3v3(), multires_reallocate_mdisps(), multires_side_tot, DMGridData::no, normalize_v3(), NULL, CCGDerivedMesh::ss, sub_v3_v3v3(), Mesh::totface, and MFace::v4.
Referenced by multires_dm_create_from_derived(), multires_subdivide(), multiresModifier_base_apply(), and multiresModifier_update().
Definition at line 1719 of file multires.c.
References invert_m3(), mul_m3_m3m3(), multires_apply_smat(), multires_sync_levels(), and object_scale_to_mat3().
Referenced by join_mesh_exec().
int multiresModifier_reshape | ( | Scene * | scene, |
MultiresModifierData * | mmd, | ||
Object * | dst, | ||
Object * | src | ||
) |
Definition at line 215 of file multires.c.
References CD_MASK_BAREMESH, mesh_get_derived_final(), and multiresModifier_reshapeFromDM().
Referenced by multires_reshape_exec().
int multiresModifier_reshapeFromDeformMod | ( | Scene * | scene, |
MultiresModifierData * | mmd, | ||
Object * | ob, | ||
ModifierData * | md | ||
) |
Definition at line 221 of file multires.c.
References CDDM_apply_vert_coords(), CDDM_copy(), ModifierTypeInfo::deformVerts, get_multires_dm(), DerivedMesh::getNumVerts, DerivedMesh::getVertCos, MEM_callocN(), MEM_freeN(), modifierType_getInfo(), mti, multires_get_level(), multiresModifier_reshapeFromDM(), DerivedMesh::release, and ModifierData::type.
Referenced by modifier_apply_obdata().
int multiresModifier_reshapeFromDM | ( | Scene * | scene, |
MultiresModifierData * | mmd, | ||
Object * | ob, | ||
DerivedMesh * | srcdm | ||
) |
Definition at line 193 of file multires.c.
References get_multires_dm(), DerivedMesh::getNumVerts, DerivedMesh::getVertArray, multires_dm_mark_as_modified(), multires_force_update(), multires_mvert_to_ss(), and DerivedMesh::release.
Referenced by multiresModifier_reshape(), and multiresModifier_reshapeFromDeformMod().
Definition at line 1709 of file multires.c.
References multires_apply_smat(), and object_scale_to_mat3().
Referenced by apply_objects_internal().
void multiresModifier_set_levels_from_disps | ( | MultiresModifierData * | mmd, |
Object * | ob | ||
) |
Definition at line 286 of file multires.c.
References CD_MDISPS, CustomData_get_layer(), Object::data, Mesh::edit_mesh, Mesh::fdata, EditMesh::fdata, get_levels_from_disps(), MultiresModifierData::lvl, MIN2, MultiresModifierData::renderlvl, MultiresModifierData::sculptlvl, and MultiresModifierData::totlvl.
Referenced by ED_object_modifier_add(), and test_object_modifiers().
void multiresModifier_subdivide | ( | MultiresModifierData * | mmd, |
Object * | ob, | ||
int | updateblock, | ||
int | simple | ||
) |
Definition at line 683 of file multires.c.
References multires_subdivide(), and MultiresModifierData::totlvl.
Referenced by multires_load_old(), and multires_subdivide_exec().
static void multiresModifier_update | ( | DerivedMesh * | dm | ) | [static] |
Definition at line 804 of file multires.c.
References ccgSubSurf_updateFromFaces(), ccgSubSurf_updateLevels(), CD_MASK_BAREMESH, CD_MASK_MDISPS, CD_MDISPS, CDDM_copy(), CDDM_from_mesh(), co, CustomData_external_read(), CustomData_get_layer(), Object::data, Object::derivedDeform, DM_set_only_copy(), eMultiresModifierFlag_PlainUv, Mesh::fdata, MultiresModifierData::flags, DerivedMesh::getGridData, DerivedMesh::getGridSize, DerivedMesh::getNumGrids, i, Mesh::id, CCGDerivedMesh::lvl, MEM_callocN(), MEM_freeN(), CCGDerivedMesh::mmd, CCGDerivedMesh::multires, multires_copy_dm_grid(), multires_dm_create_local(), multires_set_tot_mdisps(), multiresModifier_disp_run(), NULL, CCGDerivedMesh::ob, DerivedMesh::release, MultiresModifierData::simple, sub_v3_v3v3(), subsurf_dm_create_local(), Mesh::totface, CCGDerivedMesh::totlvl, and MultiresModifierData::totlvl.
Referenced by multires_dm_create_from_derived().
void old_mdisps_bilinear | ( | float | out[3], |
float(*) | disps[3], | ||
const int | st, | ||
float | u, | ||
float | v | ||
) |
Definition at line 973 of file multires.c.
References add_v3_v3v3(), simple_enum_gen::d, mul_v3_fl(), and mul_v3_v3fl().
Referenced by layerInterp_mdisps(), mdisp_join_tris(), and old_mdisps_convert().
Definition at line 1024 of file multires.c.
References MDisps::disps, log(), M_LN2, MEM_callocN(), MEM_freeN(), multires_grid_tot, multires_side_tot, old_mdisps_bilinear(), old_mdisps_rotate(), sqrt(), SWAP, MDisps::totdisp, and MFace::v4.
Referenced by multires_load_old_250().
static void old_mdisps_rotate | ( | int | S, |
int | UNUSEDnewside, | ||
int | oldside, | ||
int | x, | ||
int | y, | ||
float * | u, | ||
float * | v | ||
) | [static] |
Definition at line 1014 of file multires.c.
Referenced by old_mdisps_convert().
static DerivedMesh* subsurf_dm_create_local | ( | Object * | ob, |
DerivedMesh * | dm, | ||
int | lvl, | ||
int | simple, | ||
int | optimal, | ||
int | plain_uv | ||
) | [static] |
Definition at line 469 of file multires.c.
References eSubsurfModifierFlag_ControlEdges, eSubsurfModifierFlag_SubsurfUv, SubsurfModifierData::flags, SubsurfModifierData::levels, ME_SIMPLE_SUBSURF, Object::mode, NULL, OB_MODE_EDIT, SubsurfModifierData::renderLevels, SubsurfModifierData::subdivType, and subsurf_make_derived_from_derived().
Referenced by multires_apply_smat(), multires_dm_create_from_derived(), multires_subdivide(), multiresModifier_base_apply(), and multiresModifier_update().
static float v3_dist_from_plane | ( | float | v[3], |
float | center[3], | ||
float | no[3] | ||
) | [static] |
Definition at line 488 of file multires.c.
References dot_v3v3(), and sub_v3_v3v3().
Referenced by multiresModifier_base_apply().
const int multires_grid_tot[] = {0, 4, 9, 25, 81, 289, 1089, 4225, 16641, 66049, 263169, 1050625, 4198401, 16785409} [static] |
Definition at line 66 of file multires.c.
Referenced by multires_del_higher(), multires_reallocate_mdisps(), multires_set_tot_mdisps(), and old_mdisps_convert().
const int multires_max_levels = 13 [static] |
Definition at line 65 of file multires.c.
Referenced by multires_subdivide().
const int multires_side_tot[] = {0, 2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097} [static] |
Definition at line 67 of file multires.c.
Referenced by multires_apply_smat(), multires_del_higher(), multires_load_old_dm(), multiresModifier_disp_run(), and old_mdisps_convert().