Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_scene_types.h"
#include "BKE_customdata.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_subdiv.h"
#include "BKE_subsurf.h"
#include "BLI_math_vector.h"
#include "DEG_depsgraph_query.h"
#include "multires_reshape.h"
Go to the source code of this file.
void multiresModifier_base_apply | ( | struct Depsgraph * | depsgraph, |
Object * | object, | ||
MultiresModifierData * | mmd | ||
) |
Definition at line 240 of file multires_reshape.c.
References depsgraph, multires_force_sculpt_rebuild(), multires_reshape_apply_base_refine_from_base(), multires_reshape_apply_base_refine_from_deform(), multires_reshape_apply_base_refit_base_mesh(), multires_reshape_apply_base_update_mesh_coords(), multires_reshape_assign_final_coords_from_mdisps(), multires_reshape_context_create_from_object(), multires_reshape_context_free(), multires_reshape_object_grids_to_tangent_displacement(), and multires_reshape_store_original_grids().
Referenced by multires_base_apply_exec().
bool multiresModifier_reshapeFromCCG | ( | const int | tot_level, |
Mesh * | coarse_mesh, | ||
struct SubdivCCG * | subdiv_ccg | ||
) |
Definition at line 124 of file multires_reshape.c.
References MultiresReshapeContext::level, multires_ensure_external_read(), multires_reshape_assign_final_coords_from_ccg(), multires_reshape_context_create_from_ccg(), multires_reshape_context_free(), multires_reshape_ensure_grids(), multires_reshape_object_grids_to_tangent_displacement(), multires_reshape_smooth_object_grids_with_details(), multires_reshape_store_original_grids(), and MultiresReshapeContext::top.
Referenced by multires_flush_sculpt_updates(), and object_update_from_subsurf_ccg().
bool multiresModifier_reshapeFromDeformModifier | ( | struct Depsgraph * | depsgraph, |
struct Object * | object, | ||
struct MultiresModifierData * | mmd, | ||
struct ModifierData * | deform_md | ||
) |
Definition at line 82 of file multires_reshape.c.
References BKE_id_free(), BKE_mesh_vert_coords_alloc(), BKE_modifier_deform_verts(), BKE_multires_create_mesh(), ModifierEvalContext::depsgraph, depsgraph, Object::flag, float(), MultiresModifierData::lvl, MEM_freeN, MOD_APPLY_IGNORE_SIMPLIFY, MOD_APPLY_USECACHE, multiresModifier_reshapeFromVertcos(), NULL, MultiresModifierData::renderlvl, result, MultiresModifierData::sculptlvl, MultiresModifierData::totlvl, and Mesh::totvert.
Referenced by modifier_apply_obdata().
bool multiresModifier_reshapeFromObject | ( | struct Depsgraph * | depsgraph, |
struct MultiresModifierData * | mmd, | ||
struct Object * | dst, | ||
struct Object * | src | ||
) |
Returns truth on success, false otherwise.
This function might fail in cases like source and destination not having matched amount of vertices.
Definition at line 56 of file multires_reshape.c.
References BKE_mesh_vert_coords_alloc(), CD_MASK_BAREMESH, DEG_get_evaluated_object(), DEG_get_evaluated_scene(), depsgraph, float(), MEM_freeN, mesh_get_eval_final(), multiresModifier_reshapeFromVertcos(), result, and src.
Referenced by multires_reshape_exec().
bool multiresModifier_reshapeFromVertcos | ( | struct Depsgraph * | depsgraph, |
struct Object * | object, | ||
struct MultiresModifierData * | mmd, | ||
const float(*) | vert_coords[3], | ||
const int | num_vert_coords | ||
) |
Definition at line 33 of file multires_reshape.c.
References Object::data, depsgraph, MultiresReshapeContext::level, multires_reshape_assign_final_coords_from_vertcos(), multires_reshape_context_create_from_object(), multires_reshape_context_free(), multires_reshape_ensure_grids(), multires_reshape_object_grids_to_tangent_displacement(), multires_reshape_smooth_object_grids_with_details(), multires_reshape_store_original_grids(), and MultiresReshapeContext::top.
Referenced by multiresModifier_reshapeFromDeformModifier(), and multiresModifier_reshapeFromObject().
void multiresModifier_subdivide | ( | Object * | object, |
MultiresModifierData * | mmd, | ||
const eMultiresSubdivideModeType | mode | ||
) |
Definition at line 154 of file multires_reshape.c.
References Object::mode, multiresModifier_subdivide_to_level(), and MultiresModifierData::totlvl.
Referenced by multires_subdivide_exec().
void multiresModifier_subdivide_to_level | ( | struct Object * | object, |
struct MultiresModifierData * | mmd, | ||
int | top_level, | ||
eMultiresSubdivideModeType | mode | ||
) |
Subdivide displacement to the given level. If level is lower than the current top level nothing happens.
Definition at line 162 of file multires_reshape.c.
References CD_CALLOC, CD_MDISPS, CustomData_add_layer(), CustomData_has_layer(), ELEM, Mesh::ldata, MultiresReshapeContext::level, Object::mode, multires_flush_sculpt_updates(), multires_reshape_assign_final_elements_from_orig_mdisps(), multires_reshape_context_create_from_modifier(), multires_reshape_context_free(), multires_reshape_ensure_grids(), multires_reshape_free_original_grids(), multires_reshape_object_grids_to_tangent_displacement(), multires_reshape_smooth_object_grids(), multires_reshape_smooth_object_grids_with_details(), multires_reshape_store_original_grids(), multires_set_tot_level(), multires_subdivide_create_tangent_displacement_linear_grids(), MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE, NULL, MultiresReshapeContext::top, Mesh::totloop, and MultiresModifierData::totlvl.
Referenced by multiresModifier_subdivide(), and multiresModifier_sync_levels_ex().