Code cleanup: naming.
Prepend BKE_ to the functions moved in blenkernel for recent bug fix.
This commit is contained in:
parent
02b1dbef8c
commit
2e07109feb
|
@ -40,12 +40,12 @@ struct BMEditMesh;
|
|||
struct Mesh;
|
||||
|
||||
/* crazyspace.c */
|
||||
float (*crazyspace_get_mapped_editverts(struct Scene *scene, struct Object *obedit))[3];
|
||||
void crazyspace_set_quats_editmesh(struct BMEditMesh *em, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4],
|
||||
float (*BKE_crazyspace_get_mapped_editverts(struct Scene *scene, struct Object *obedit))[3];
|
||||
void BKE_crazyspace_set_quats_editmesh(struct BMEditMesh *em, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4],
|
||||
const bool use_select);
|
||||
void crazyspace_set_quats_mesh(struct Mesh *me, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4]);
|
||||
int sculpt_get_first_deform_matrices(struct Scene *scene, struct Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]);
|
||||
void crazyspace_build_sculpt(struct Scene *scene, struct Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]);
|
||||
void BKE_crazyspace_set_quats_mesh(struct Mesh *me, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4]);
|
||||
int BKE_sculpt_get_first_deform_matrices(struct Scene *scene, struct Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]);
|
||||
void BKE_crazyspace_build_sculpt(struct Scene *scene, struct Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -173,18 +173,18 @@ typedef struct SculptSession {
|
|||
int average_stroke_counter;
|
||||
} SculptSession;
|
||||
|
||||
void free_sculptsession(struct Object *ob);
|
||||
void free_sculptsession_deformMats(struct SculptSession *ss);
|
||||
void sculptsession_bm_to_me(struct Object *ob, bool reorder);
|
||||
void sculptsession_bm_to_me_for_render(struct Object *object);
|
||||
void sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob,
|
||||
void BKE_free_sculptsession(struct Object *ob);
|
||||
void BKE_free_sculptsession_deformMats(struct SculptSession *ss);
|
||||
void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder);
|
||||
void BKE_sculptsession_bm_to_me_for_render(struct Object *object);
|
||||
void BKE_sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, struct Object *ob,
|
||||
bool need_pmap, bool need_mask);
|
||||
struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct Object *ob);
|
||||
int ED_sculpt_mask_layers_ensure(struct Object *ob,
|
||||
struct MultiresModifierData *BKE_sculpt_multires_active(struct Scene *scene, struct Object *ob);
|
||||
int BKE_sculpt_mask_layers_ensure(struct Object *ob,
|
||||
struct MultiresModifierData *mmd);
|
||||
|
||||
enum {
|
||||
ED_SCULPT_MASK_LAYER_CALC_VERT = (1 << 0),
|
||||
ED_SCULPT_MASK_LAYER_CALC_LOOP = (1 << 1)
|
||||
SCULPT_MASK_LAYER_CALC_VERT = (1 << 0),
|
||||
SCULPT_MASK_LAYER_CALC_LOOP = (1 << 1)
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -2252,7 +2252,7 @@ static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask,
|
|||
/* create PBVH immediately (would be created on the fly too,
|
||||
* but this avoids waiting on first stroke) */
|
||||
|
||||
sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, false, false);
|
||||
BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, false, false);
|
||||
}
|
||||
|
||||
BLI_assert(!(ob->derivedFinal->dirty & DM_DIRTY_NORMALS));
|
||||
|
|
|
@ -118,7 +118,7 @@ static int modifiers_disable_subsurf_temporary(Object *ob)
|
|||
}
|
||||
|
||||
/* disable subsurf temporal, get mapped cos, and enable it */
|
||||
float (*crazyspace_get_mapped_editverts(Scene *scene, Object *obedit))[3]
|
||||
float (*BKE_crazyspace_get_mapped_editverts(Scene *scene, Object *obedit))[3]
|
||||
{
|
||||
Mesh *me = obedit->data;
|
||||
DerivedMesh *dm;
|
||||
|
@ -153,7 +153,7 @@ float (*crazyspace_get_mapped_editverts(Scene *scene, Object *obedit))[3]
|
|||
return vertexcos;
|
||||
}
|
||||
|
||||
void crazyspace_set_quats_editmesh(BMEditMesh *em, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4],
|
||||
void BKE_crazyspace_set_quats_editmesh(BMEditMesh *em, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4],
|
||||
const bool use_select)
|
||||
{
|
||||
BMFace *f;
|
||||
|
@ -215,7 +215,7 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float (*origcos)[3], float (*
|
|||
}
|
||||
}
|
||||
|
||||
void crazyspace_set_quats_mesh(Mesh *me, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4])
|
||||
void BKE_crazyspace_set_quats_mesh(Mesh *me, float (*origcos)[3], float (*mappedcos)[3], float (*quats)[4])
|
||||
{
|
||||
int i;
|
||||
MVert *mvert;
|
||||
|
@ -328,7 +328,7 @@ int editbmesh_get_first_deform_matrices(Scene *scene, Object *ob, BMEditMesh *em
|
|||
return numleft;
|
||||
}
|
||||
|
||||
int sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
|
||||
int BKE_sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
|
||||
{
|
||||
ModifierData *md;
|
||||
DerivedMesh *dm;
|
||||
|
@ -387,9 +387,9 @@ int sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**deformma
|
|||
return numleft;
|
||||
}
|
||||
|
||||
void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
|
||||
void BKE_crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3])
|
||||
{
|
||||
int totleft = sculpt_get_first_deform_matrices(scene, ob, deformmats, deformcos);
|
||||
int totleft = BKE_sculpt_get_first_deform_matrices(scene, ob, deformmats, deformcos);
|
||||
|
||||
if (totleft) {
|
||||
/* there are deformation modifier which doesn't support deformation matrices
|
||||
|
@ -421,7 +421,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
|
|||
|
||||
quats = MEM_mallocN(me->totvert * sizeof(*quats), "crazy quats");
|
||||
|
||||
crazyspace_set_quats_mesh(me, origVerts, deformedVerts, quats);
|
||||
BKE_crazyspace_set_quats_mesh(me, origVerts, deformedVerts, quats);
|
||||
|
||||
for (i = 0; i < me->totvert; i++) {
|
||||
float qmat[3][3], tmat[3][3];
|
||||
|
|
|
@ -400,7 +400,7 @@ void BKE_object_free_ex(Object *ob, bool do_id_user)
|
|||
if (ob->bsoft) bsbFree(ob->bsoft);
|
||||
if (ob->gpulamp.first) GPU_lamp_free(ob);
|
||||
|
||||
free_sculptsession(ob);
|
||||
BKE_free_sculptsession(ob);
|
||||
|
||||
if (ob->pc_ids.first) BLI_freelistN(&ob->pc_ids);
|
||||
|
||||
|
@ -3062,7 +3062,7 @@ void BKE_object_sculpt_modifiers_changed(Object *ob)
|
|||
ss->pbvh = NULL;
|
||||
}
|
||||
|
||||
free_sculptsession_deformMats(ob->sculpt);
|
||||
BKE_free_sculptsession_deformMats(ob->sculpt);
|
||||
}
|
||||
else {
|
||||
PBVHNode **nodes;
|
||||
|
|
|
@ -397,7 +397,7 @@ void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, const float mouse_
|
|||
}
|
||||
}
|
||||
|
||||
void free_sculptsession_deformMats(SculptSession *ss)
|
||||
void BKE_free_sculptsession_deformMats(SculptSession *ss)
|
||||
{
|
||||
if (ss->orig_cos) MEM_freeN(ss->orig_cos);
|
||||
if (ss->deform_cos) MEM_freeN(ss->deform_cos);
|
||||
|
@ -427,7 +427,7 @@ static void sculptsession_bm_to_me_update_data_only(Object *ob, bool reorder)
|
|||
}
|
||||
}
|
||||
|
||||
void sculptsession_bm_to_me(Object *ob, bool reorder)
|
||||
void BKE_sculptsession_bm_to_me(Object *ob, bool reorder)
|
||||
{
|
||||
if (ob && ob->sculpt) {
|
||||
sculptsession_bm_to_me_update_data_only(ob, reorder);
|
||||
|
@ -437,7 +437,7 @@ void sculptsession_bm_to_me(Object *ob, bool reorder)
|
|||
}
|
||||
}
|
||||
|
||||
void sculptsession_bm_to_me_for_render(Object *object)
|
||||
void BKE_sculptsession_bm_to_me_for_render(Object *object)
|
||||
{
|
||||
if (object && object->sculpt) {
|
||||
if (object->sculpt->bm) {
|
||||
|
@ -464,14 +464,14 @@ void sculptsession_bm_to_me_for_render(Object *object)
|
|||
}
|
||||
}
|
||||
|
||||
void free_sculptsession(Object *ob)
|
||||
void BKE_free_sculptsession(Object *ob)
|
||||
{
|
||||
if (ob && ob->sculpt) {
|
||||
SculptSession *ss = ob->sculpt;
|
||||
DerivedMesh *dm = ob->derivedFinal;
|
||||
|
||||
if (ss->bm) {
|
||||
sculptsession_bm_to_me(ob, true);
|
||||
BKE_sculptsession_bm_to_me(ob, true);
|
||||
BM_mesh_free(ss->bm);
|
||||
}
|
||||
|
||||
|
@ -507,7 +507,7 @@ void free_sculptsession(Object *ob)
|
|||
|
||||
/* Sculpt mode handles multires differently from regular meshes, but only if
|
||||
* it's the last modifier on the stack and it is not on the first level */
|
||||
MultiresModifierData *sculpt_multires_active(Scene *scene, Object *ob)
|
||||
MultiresModifierData *BKE_sculpt_multires_active(Scene *scene, Object *ob)
|
||||
{
|
||||
Mesh *me = (Mesh *)ob->data;
|
||||
ModifierData *md;
|
||||
|
@ -544,7 +544,7 @@ static bool sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
|
|||
{
|
||||
ModifierData *md;
|
||||
Mesh *me = (Mesh *)ob->data;
|
||||
MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
|
||||
MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
|
||||
VirtualModifierData virtualModifierData;
|
||||
|
||||
if (mmd || ob->sculpt->bm)
|
||||
|
@ -572,13 +572,13 @@ static bool sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
|
|||
/**
|
||||
* \param need_mask So the DerivedMesh thats returned has mask data
|
||||
*/
|
||||
void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
|
||||
void BKE_sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
|
||||
bool need_pmap, bool need_mask)
|
||||
{
|
||||
DerivedMesh *dm;
|
||||
SculptSession *ss = ob->sculpt;
|
||||
Mesh *me = ob->data;
|
||||
MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
|
||||
MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
|
||||
|
||||
ss->modifiers_active = sculpt_modifiers_active(scene, sd, ob);
|
||||
ss->show_diffuse_color = (sd->flags & SCULPT_SHOW_DIFFUSE) != 0;
|
||||
|
@ -586,13 +586,13 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
|
|||
if (need_mask) {
|
||||
if (mmd == NULL) {
|
||||
if (!CustomData_has_layer(&me->vdata, CD_PAINT_MASK)) {
|
||||
ED_sculpt_mask_layers_ensure(ob, NULL);
|
||||
BKE_sculpt_mask_layers_ensure(ob, NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK)) {
|
||||
#if 1
|
||||
ED_sculpt_mask_layers_ensure(ob, mmd);
|
||||
BKE_sculpt_mask_layers_ensure(ob, mmd);
|
||||
#else /* if we wanted to support adding mask data while multi-res painting, we would need to do this */
|
||||
if ((ED_sculpt_mask_layers_ensure(ob, mmd) & ED_SCULPT_MASK_LAYER_CALC_LOOP)) {
|
||||
/* remake the derived mesh */
|
||||
|
@ -642,11 +642,11 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
|
|||
if (!ss->orig_cos) {
|
||||
int a;
|
||||
|
||||
free_sculptsession_deformMats(ss);
|
||||
BKE_free_sculptsession_deformMats(ss);
|
||||
|
||||
ss->orig_cos = (ss->kb) ? BKE_key_convert_to_vertcos(ob, ss->kb) : BKE_mesh_vertexCos_get(me, NULL);
|
||||
|
||||
crazyspace_build_sculpt(scene, ob, &ss->deform_imats, &ss->deform_cos);
|
||||
BKE_crazyspace_build_sculpt(scene, ob, &ss->deform_imats, &ss->deform_cos);
|
||||
BKE_pbvh_apply_vertCos(ss->pbvh, ss->deform_cos);
|
||||
|
||||
for (a = 0; a < me->totvert; ++a) {
|
||||
|
@ -655,7 +655,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
|
|||
}
|
||||
}
|
||||
else {
|
||||
free_sculptsession_deformMats(ss);
|
||||
BKE_free_sculptsession_deformMats(ss);
|
||||
}
|
||||
|
||||
/* if pbvh is deformed, key block is already applied to it */
|
||||
|
@ -670,7 +670,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob,
|
|||
}
|
||||
}
|
||||
|
||||
int ED_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd)
|
||||
int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd)
|
||||
{
|
||||
const float *paint_mask;
|
||||
Mesh *me = ob->data;
|
||||
|
@ -728,14 +728,14 @@ int ED_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd)
|
|||
}
|
||||
}
|
||||
|
||||
ret |= ED_SCULPT_MASK_LAYER_CALC_LOOP;
|
||||
ret |= SCULPT_MASK_LAYER_CALC_LOOP;
|
||||
}
|
||||
|
||||
/* create vertex paint mask layer if there isn't one already */
|
||||
if (!paint_mask) {
|
||||
CustomData_add_layer(&me->vdata, CD_PAINT_MASK,
|
||||
CD_CALLOC, NULL, me->totvert);
|
||||
ret |= ED_SCULPT_MASK_LAYER_CALC_VERT;
|
||||
ret |= SCULPT_MASK_LAYER_CALC_VERT;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -161,7 +161,7 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
|
|||
|
||||
if (ob->mode & OB_MODE_SCULPT) {
|
||||
/* ensure that grid paint mask layer is created */
|
||||
ED_sculpt_mask_layers_ensure(ob, (MultiresModifierData *)new_md);
|
||||
BKE_sculpt_mask_layers_ensure(ob, (MultiresModifierData *)new_md);
|
||||
}
|
||||
}
|
||||
else if (type == eModifierType_Skin) {
|
||||
|
@ -1187,7 +1187,7 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op)
|
|||
|
||||
if (ob->mode & OB_MODE_SCULPT) {
|
||||
/* ensure that grid paint mask layer is created */
|
||||
ED_sculpt_mask_layers_ensure(ob, mmd);
|
||||
BKE_sculpt_mask_layers_ensure(ob, mmd);
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
|
|
@ -86,7 +86,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
|
|||
ARegion *ar = CTX_wm_region(C);
|
||||
struct Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
struct MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
|
||||
struct MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
|
||||
PaintMaskFloodMode mode;
|
||||
float value;
|
||||
DerivedMesh *dm;
|
||||
|
@ -98,7 +98,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
|
|||
mode = RNA_enum_get(op->ptr, "mode");
|
||||
value = RNA_float_get(op->ptr, "value");
|
||||
|
||||
ED_sculpt_mask_layers_ensure(ob, mmd);
|
||||
BKE_sculpt_mask_layers_ensure(ob, mmd);
|
||||
|
||||
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
|
||||
pbvh = dm->getPBVH(ob, dm);
|
||||
|
@ -195,7 +195,7 @@ int do_sculpt_mask_box_select(ViewContext *vc, rcti *rect, bool select, bool UNU
|
|||
ARegion *ar = vc->ar;
|
||||
struct Scene *scene = vc->scene;
|
||||
Object *ob = vc->obact;
|
||||
struct MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
|
||||
struct MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
|
||||
PaintMaskFloodMode mode;
|
||||
float value;
|
||||
DerivedMesh *dm;
|
||||
|
@ -212,7 +212,7 @@ int do_sculpt_mask_box_select(ViewContext *vc, rcti *rect, bool select, bool UNU
|
|||
ED_view3d_clipping_calc(&bb, clip_planes, &mats, rect);
|
||||
mul_m4_fl(clip_planes, -1.0f);
|
||||
|
||||
ED_sculpt_mask_layers_ensure(ob, mmd);
|
||||
BKE_sculpt_mask_layers_ensure(ob, mmd);
|
||||
|
||||
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
|
||||
pbvh = dm->getPBVH(ob, dm);
|
||||
|
@ -359,8 +359,8 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
|
|||
ED_view3d_clipping_calc(&bb, clip_planes, &mats, &data.rect);
|
||||
mul_m4_fl(clip_planes, -1.0f);
|
||||
|
||||
mmd = sculpt_multires_active(vc.scene, ob);
|
||||
ED_sculpt_mask_layers_ensure(ob, mmd);
|
||||
mmd = BKE_sculpt_multires_active(vc.scene, ob);
|
||||
BKE_sculpt_mask_layers_ensure(ob, mmd);
|
||||
dm = mesh_get_derived_final(vc.scene, ob, CD_MASK_BAREMESH);
|
||||
pbvh = dm->getPBVH(ob, dm);
|
||||
ob->sculpt->pbvh = pbvh;
|
||||
|
|
|
@ -4095,7 +4095,7 @@ static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob)
|
|||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
Brush *brush = BKE_paint_brush(&sd->paint);
|
||||
|
||||
sculpt_update_mesh_elements(CTX_data_scene(C), sd, ob,
|
||||
BKE_sculpt_update_mesh_elements(CTX_data_scene(C), sd, ob,
|
||||
sculpt_any_smooth_mode(brush, ss->cache, 0), false);
|
||||
}
|
||||
}
|
||||
|
@ -4261,7 +4261,7 @@ static int sculpt_brush_stroke_init(bContext *C, wmOperator *op)
|
|||
sculpt_brush_init_tex(scene, sd, ss);
|
||||
|
||||
is_smooth = sculpt_any_smooth_mode(brush, NULL, mode);
|
||||
sculpt_update_mesh_elements(scene, sd, ob, is_smooth, need_mask);
|
||||
BKE_sculpt_update_mesh_elements(scene, sd, ob, is_smooth, need_mask);
|
||||
|
||||
zero_v3(ob->sculpt->average_stroke_accum);
|
||||
ob->sculpt->average_stroke_counter = 0;
|
||||
|
@ -4701,7 +4701,7 @@ void sculpt_update_after_dynamic_topology_toggle(bContext *C)
|
|||
Sculpt *sd = scene->toolsettings->sculpt;
|
||||
|
||||
/* Create the PBVH */
|
||||
sculpt_update_mesh_elements(scene, sd, ob, false, false);
|
||||
BKE_sculpt_update_mesh_elements(scene, sd, ob, false, false);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
|
||||
}
|
||||
|
||||
|
@ -4779,7 +4779,7 @@ void sculpt_dynamic_topology_disable(bContext *C,
|
|||
BKE_mesh_update_customdata_pointers(me, false);
|
||||
}
|
||||
else {
|
||||
sculptsession_bm_to_me(ob, true);
|
||||
BKE_sculptsession_bm_to_me(ob, true);
|
||||
}
|
||||
|
||||
/* Clear data */
|
||||
|
@ -4947,7 +4947,7 @@ static void sculpt_init_session(Scene *scene, Object *ob)
|
|||
{
|
||||
ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
|
||||
|
||||
sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false);
|
||||
BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4959,7 +4959,7 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
|||
const int mode_flag = OB_MODE_SCULPT;
|
||||
const bool is_mode_set = (ob->mode & mode_flag) != 0;
|
||||
Mesh *me;
|
||||
MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
|
||||
MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
|
||||
int flush_recalc = 0;
|
||||
|
||||
if (!is_mode_set) {
|
||||
|
@ -4992,7 +4992,7 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
|||
/* Leave sculptmode */
|
||||
ob->mode &= ~mode_flag;
|
||||
|
||||
free_sculptsession(ob);
|
||||
BKE_free_sculptsession(ob);
|
||||
|
||||
paint_cursor_delete_textures();
|
||||
}
|
||||
|
@ -5030,7 +5030,7 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
|||
|
||||
/* Create sculpt mode session data */
|
||||
if (ob->sculpt)
|
||||
free_sculptsession(ob);
|
||||
BKE_free_sculptsession(ob);
|
||||
|
||||
sculpt_init_session(scene, ob);
|
||||
|
||||
|
@ -5038,7 +5038,7 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
|
|||
if (mmd) {
|
||||
/* XXX, we could attempt to support adding mask data mid-sculpt mode (with multi-res)
|
||||
* but this ends up being quite tricky (and slow) */
|
||||
ED_sculpt_mask_layers_ensure(ob, mmd);
|
||||
BKE_sculpt_mask_layers_ensure(ob, mmd);
|
||||
}
|
||||
|
||||
BKE_paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT);
|
||||
|
|
|
@ -112,7 +112,7 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo
|
|||
if (kb) {
|
||||
ob->shapenr = BLI_findindex(&key->block, kb) + 1;
|
||||
|
||||
sculpt_update_mesh_elements(scene, sd, ob, 0, false);
|
||||
BKE_sculpt_update_mesh_elements(scene, sd, ob, 0, false);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob);
|
||||
}
|
||||
else {
|
||||
|
@ -413,7 +413,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
|
|||
}
|
||||
}
|
||||
|
||||
sculpt_update_mesh_elements(scene, sd, ob, 0, need_mask);
|
||||
BKE_sculpt_update_mesh_elements(scene, sd, ob, 0, need_mask);
|
||||
|
||||
/* call _after_ sculpt_update_mesh_elements() which may update 'ob->derivedFinal' */
|
||||
dm = mesh_get_derived_final(scene, ob, 0);
|
||||
|
@ -469,7 +469,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
|
|||
BKE_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb, &rebuild);
|
||||
BKE_pbvh_update(ss->pbvh, PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateRedraw, NULL);
|
||||
|
||||
if (sculpt_multires_active(scene, ob)) {
|
||||
if (BKE_sculpt_multires_active(scene, ob)) {
|
||||
if (rebuild)
|
||||
multires_mark_as_modified(ob, MULTIRES_HIDDEN_MODIFIED);
|
||||
else
|
||||
|
@ -483,7 +483,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
|
|||
BKE_mesh_calc_normals_tessface(mesh->mvert, mesh->totvert,
|
||||
mesh->mface, mesh->totface, NULL);
|
||||
|
||||
free_sculptsession_deformMats(ss);
|
||||
BKE_free_sculptsession_deformMats(ss);
|
||||
tag_update |= true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2247,9 +2247,9 @@ static void createTransEditVerts(TransInfo *t)
|
|||
if (totleft > 0)
|
||||
#endif
|
||||
{
|
||||
mappedcos = crazyspace_get_mapped_editverts(t->scene, t->obedit);
|
||||
mappedcos = BKE_crazyspace_get_mapped_editverts(t->scene, t->obedit);
|
||||
quats = MEM_mallocN(em->bm->totvert * sizeof(*quats), "crazy quats");
|
||||
crazyspace_set_quats_editmesh(em, defcos, mappedcos, quats, !propmode);
|
||||
BKE_crazyspace_set_quats_editmesh(em, defcos, mappedcos, quats, !propmode);
|
||||
if (mappedcos)
|
||||
MEM_freeN(mappedcos);
|
||||
}
|
||||
|
|
|
@ -158,12 +158,12 @@ void ED_editors_flush_edits(const bContext *C, bool for_render)
|
|||
|
||||
if (for_render) {
|
||||
/* flush changes from dynamic topology sculpt */
|
||||
sculptsession_bm_to_me_for_render(obact);
|
||||
BKE_sculptsession_bm_to_me_for_render(obact);
|
||||
}
|
||||
else {
|
||||
/* Set reorder=false so that saving the file doesn't reorder
|
||||
* the BMesh's elements */
|
||||
sculptsession_bm_to_me(obact, false);
|
||||
BKE_sculptsession_bm_to_me(obact, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue