|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_modifier_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BLI_linklist.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "BKE_DerivedMesh.h"#include "BKE_crazyspace.h"#include "BKE_editmesh.h"#include "BKE_lib_id.h"#include "BKE_mesh.h"#include "BKE_mesh_wrapper.h"#include "BKE_modifier.h"#include "BKE_multires.h"#include "DEG_depsgraph_query.h"Go to the source code of this file.
| void BKE_crazyspace_build_sculpt | ( | struct Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| Object * | object, | ||
| float(**) | deformmats[3][3], | ||
| float(**) | deformcos[3] | ||
| ) |
Definition at line 440 of file crazyspace.c.
References Freestyle::a, BKE_crazyspace_set_quats_mesh(), BKE_id_free(), BKE_mesh_copy_for_eval(), BKE_mesh_vert_coords_alloc(), BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), BKE_sculpt_get_first_deform_matrices(), copy_m3_m3(), crazyspace_init_object_for_eval(), crazyspace_init_verts_and_matrices(), crazyspace_modifier_supports_deform(), Object::data, ModifierTypeInfo::deformMatrices, ModifierTypeInfo::deformVerts, depsgraph, eModifierMode_Realtime, float(), if(), MEM_callocN, MEM_dupallocN, MEM_freeN, MEM_mallocN, mesh, mul_m3_m3m3(), ModifierData::next, NULL, quat_to_mat3(), scene, Mesh::totvert, ModifierData::type, and unit_m3().
Referenced by sculpt_update_object().
| int BKE_crazyspace_get_first_deform_matrices_editbmesh | ( | struct Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| Object * | ob, | ||
| BMEditMesh * | em, | ||
| float(**) | deformmats[3][3], | ||
| float(**) | deformcos[3] | ||
| ) |
Returns an array of deform matrices for crazy-space correction, and the number of modifiers left.
Definition at line 250 of file crazyspace.c.
References Freestyle::a, BKE_id_free(), BKE_mesh_wrapper_from_editmesh_with_coords(), BKE_modifier_calc_data_masks(), BKE_modifier_get_info(), BKE_modifier_is_correctable_deformed(), BKE_modifiers_clear_errors(), BKE_modifiers_get_cage_index(), BKE_modifiers_get_virtual_modifierlist(), BLI_linklist_free(), CD_MASK_BAREMESH, Object::data, ModifierTypeInfo::deformMatricesEM, depsgraph, editbmesh_modifier_is_enabled(), editbmesh_vert_coords_alloc(), eModifierMode_Editmode, eModifierMode_Realtime, eModifierTypeType_OnlyDeform, float(), CDMaskLink::mask, MEM_mallocN, ModifierData::next, NULL, scene, ModifierTypeInfo::type, ModifierData::type, and unit_m3().
Referenced by transform_convert_mesh_crazyspace_detect().
Definition at line 102 of file crazyspace.c.
References BMEditMesh::bm, CD_MASK_BAREMESH, Object::data, DEG_get_evaluated_object(), DEG_get_evaluated_scene(), DEG_get_input_scene(), depsgraph, Mesh::edit_mesh, editbmesh_get_eval_cage_from_orig(), float(), makeDerivedMesh(), MEM_mallocN, mesh_get_mapped_verts_coords(), modifiers_disable_subsurf_temporary(), scene, and BMesh::totvert.
Referenced by transform_convert_mesh_crazyspace_detect().
| void BKE_crazyspace_set_quats_editmesh | ( | BMEditMesh * | em, |
| float(*) | origcos[3], | ||
| float(*) | mappedcos[3], | ||
| float(*) | quats[4], | ||
| const bool | use_select | ||
| ) |
Definition at line 130 of file crazyspace.c.
References BMEditMesh::bm, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_elem_index_get, BM_elem_index_set, BM_ELEM_SELECT, BM_ELEM_TAG, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_ITER_MESH_INDEX, BM_VERT, BM_VERTS_OF_MESH, BMVert::co, BMesh::elem_index_dirty, BMLoop::next, BMLoop::prev, set_crazy_vertex_quat(), BMLoop::v, and v.
Referenced by transform_convert_mesh_crazyspace_detect().
| void BKE_crazyspace_set_quats_mesh | ( | Mesh * | me, |
| float(*) | origcos[3], | ||
| float(*) | mappedcos[3], | ||
| float(*) | quats[4] | ||
| ) |
Definition at line 192 of file crazyspace.c.
References MVert::co, MVert::flag, MPoly::loopstart, ME_VERT_TMP_TAG, Mesh::mloop, Mesh::mpoly, Mesh::mvert, set_crazy_vertex_quat(), MPoly::totloop, Mesh::totpoly, Mesh::totvert, and MLoop::v.
Referenced by BKE_crazyspace_build_sculpt().
| int BKE_sculpt_get_first_deform_matrices | ( | struct Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| Object * | object, | ||
| float(**) | deformmats[3][3], | ||
| float(**) | deformcos[3] | ||
| ) |
Definition at line 367 of file crazyspace.c.
References BKE_id_free(), BKE_mesh_copy_for_eval(), BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), BLI_assert, crazyspace_init_object_for_eval(), crazyspace_init_verts_and_matrices(), crazyspace_modifier_supports_deform(), crazyspace_modifier_supports_deform_matrices(), Object::data, ModifierTypeInfo::deformMatrices, depsgraph, eModifierMode_Realtime, float(), get_multires_modifier(), ModifierData::next, NULL, OB_MODE_SCULPT, scene, MultiresModifierData::sculptlvl, Mesh::totvert, and ModifierData::type.
Referenced by BKE_crazyspace_build_sculpt().
|
static |
Crazy-space evaluation needs to have an object which has all the fields evaluated, but the mesh data being at undeformed state. This way it can re-apply modifiers and also have proper pointers to key data blocks.
Similar to BKE_object_eval_reset(), but does not modify the actual evaluated object.
Definition at line 328 of file crazyspace.c.
References Object::data, Object_Runtime::data_orig, DEG_get_evaluated_object(), depsgraph, NULL, and Object::runtime.
Referenced by BKE_crazyspace_build_sculpt(), and BKE_sculpt_get_first_deform_matrices().
|
static |
Definition at line 339 of file crazyspace.c.
References Freestyle::a, BKE_mesh_vert_coords_alloc(), BLI_assert, MEM_callocN, mesh, Mesh::totvert, and unit_m3().
Referenced by BKE_crazyspace_build_sculpt(), and BKE_sculpt_get_first_deform_matrices().
|
static |
Definition at line 361 of file crazyspace.c.
References BKE_modifier_get_info(), eModifierTypeType_OnlyDeform, ModifierTypeInfo::type, and ModifierData::type.
Referenced by BKE_crazyspace_build_sculpt(), and BKE_sculpt_get_first_deform_matrices().
|
static |
Definition at line 352 of file crazyspace.c.
References BKE_modifier_get_info(), ELEM, eModifierType_Multires, eModifierType_Subsurf, eModifierTypeType_OnlyDeform, ModifierTypeInfo::type, and ModifierData::type.
Referenced by BKE_sculpt_get_first_deform_matrices().
Definition at line 85 of file crazyspace.c.
References BKE_modifiers_get_cage_index(), eModifierMode_DisableTemporary, eModifierType_Subsurf, ListBase::first, ModifierData::mode, Object::modifiers, ModifierData::next, NULL, scene, and ModifierData::type.
Referenced by BKE_crazyspace_get_mapped_editverts().
|
static |
Definition at line 69 of file crazyspace.c.
References q1, sub_qt_qtqt(), and tan_calc_quat_v3().
Referenced by BKE_crazyspace_set_quats_editmesh(), and BKE_crazyspace_set_quats_mesh().
| BLI_INLINE void tan_calc_quat_v3 | ( | float | r_quat[4], |
| const float | co_1[3], | ||
| const float | co_2[3], | ||
| const float | co_3[3] | ||
| ) |
Definition at line 47 of file crazyspace.c.
References cross_v3_v3v3(), nor, normalize_v3(), sub_v3_v3v3(), tri_to_quat_ex(), and unit_qt().
Referenced by set_crazy_vertex_quat().