From d909e61d99d760e9c5ae0c9e29804ac609bf7b5f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 12 Feb 2011 17:51:02 +0000 Subject: Sculpting on deformed mesh ========================== Removed limitation of armatured-only objects for sculpting -- now all deformation modifiers are allowed in sculpt mode. Use crazyspace corrections like from transformation modules was used to support all deformation modifiers. Internal change: all crazyspace-related functions were noved to crazyspace.c P.S. Brush could make quite unexpected deformation for meshes which are deformed in specified way. Got patch for this and discussing with Brecht if it's really needed or maybe it could be done in better way. --- source/blender/editors/util/CMakeLists.txt | 1 + source/blender/editors/util/crazyspace.c | 394 +++++++++++++++++++++++++++++ 2 files changed, 395 insertions(+) create mode 100644 source/blender/editors/util/crazyspace.c (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index a2e0525cb0e..38c0dd7f0ba 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -34,6 +34,7 @@ set(SRC editmode_undo.c numinput.c undo.c + crazyspace.c util_intern.h # general includes diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c new file mode 100644 index 00000000000..8b03f1826e4 --- /dev/null +++ b/source/blender/editors/util/crazyspace.c @@ -0,0 +1,394 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2005 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "MEM_guardedalloc.h" + +#include "DNA_scene_types.h" +#include "DNA_object_types.h" +#include "DNA_modifier_types.h" +#include "DNA_meshdata_types.h" + +#include "BKE_DerivedMesh.h" +#include "BKE_modifier.h" +#include "BKE_multires.h" +#include "BKE_mesh.h" + +#include "BLI_utildefines.h" +#include "BLI_math.h" +#include "BLI_editVert.h" + +#define TAN_MAKE_VEC(a, b, c) a[0]= b[0] + 0.2f*(b[0]-c[0]); a[1]= b[1] + 0.2f*(b[1]-c[1]); a[2]= b[2] + 0.2f*(b[2]-c[2]) +static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, float *def1, float *def2, float *def3) +{ + float vecu[3], vecv[3]; + float q1[4], q2[4]; + + TAN_MAKE_VEC(vecu, v1, v2); + TAN_MAKE_VEC(vecv, v1, v3); + tri_to_quat( q1,v1, vecu, vecv); + + TAN_MAKE_VEC(vecu, def1, def2); + TAN_MAKE_VEC(vecv, def1, def3); + tri_to_quat( q2,def1, vecu, vecv); + + sub_qt_qtqt(quat, q2, q1); +} +#undef TAN_MAKE_VEC + +static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) +{ + float *vec = userData; + + vec+= 3*index; + VECCOPY(vec, co); +} + +static int modifiers_disable_subsurf_temporary(Object *ob) +{ + ModifierData *md; + int disabled = 0; + + for(md=ob->modifiers.first; md; md=md->next) + if(md->type==eModifierType_Subsurf) + if(md->mode & eModifierMode_OnCage) { + md->mode ^= eModifierMode_DisableTemporary; + disabled= 1; + } + + return disabled; +} + +/* disable subsurf temporal, get mapped cos, and enable it */ +float *crazyspace_get_mapped_editverts(Scene *scene, Object *obedit) +{ + Mesh *me= obedit->data; + DerivedMesh *dm; + float *vertexcos; + + /* disable subsurf temporal, get mapped cos, and enable it */ + if(modifiers_disable_subsurf_temporary(obedit)) { + /* need to make new derivemesh */ + makeDerivedMesh(scene, obedit, me->edit_mesh, CD_MASK_BAREMESH); + } + + /* now get the cage */ + dm= editmesh_get_derived_cage(scene, obedit, me->edit_mesh, CD_MASK_BAREMESH); + + vertexcos= MEM_mallocN(3*sizeof(float)*me->edit_mesh->totvert, "vertexcos map"); + dm->foreachMappedVert(dm, make_vertexcos__mapFunc, vertexcos); + + dm->release(dm); + + /* set back the flag, no new cage needs to be built, transform does it */ + modifiers_disable_subsurf_temporary(obedit); + + return vertexcos; +} + +void crazyspace_set_quats_editmesh(EditMesh *em, float *origcos, float *mappedcos, float *quats) +{ + EditVert *eve, *prev; + EditFace *efa; + float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4; + intptr_t index= 0; + + /* two abused locations in vertices */ + for(eve= em->verts.first; eve; eve= eve->next, index++) { + eve->tmp.p = NULL; + eve->prev= (EditVert *)index; + } + + /* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */ + for(efa= em->faces.first; efa; efa= efa->next) { + + /* retrieve mapped coordinates */ + v1= mappedcos + 3*(intptr_t)(efa->v1->prev); + v2= mappedcos + 3*(intptr_t)(efa->v2->prev); + v3= mappedcos + 3*(intptr_t)(efa->v3->prev); + + co1= (origcos)? origcos + 3*(intptr_t)(efa->v1->prev): efa->v1->co; + co2= (origcos)? origcos + 3*(intptr_t)(efa->v2->prev): efa->v2->co; + co3= (origcos)? origcos + 3*(intptr_t)(efa->v3->prev): efa->v3->co; + + if(efa->v2->tmp.p==NULL && efa->v2->f1) { + set_crazy_vertex_quat(quats, co2, co3, co1, v2, v3, v1); + efa->v2->tmp.p= (void*)quats; + quats+= 4; + } + + if(efa->v4) { + v4= mappedcos + 3*(intptr_t)(efa->v4->prev); + co4= (origcos)? origcos + 3*(intptr_t)(efa->v4->prev): efa->v4->co; + + if(efa->v1->tmp.p==NULL && efa->v1->f1) { + set_crazy_vertex_quat(quats, co1, co2, co4, v1, v2, v4); + efa->v1->tmp.p= (void*)quats; + quats+= 4; + } + if(efa->v3->tmp.p==NULL && efa->v3->f1) { + set_crazy_vertex_quat(quats, co3, co4, co2, v3, v4, v2); + efa->v3->tmp.p= (void*)quats; + quats+= 4; + } + if(efa->v4->tmp.p==NULL && efa->v4->f1) { + set_crazy_vertex_quat(quats, co4, co1, co3, v4, v1, v3); + efa->v4->tmp.p= (void*)quats; + quats+= 4; + } + } + else { + if(efa->v1->tmp.p==NULL && efa->v1->f1) { + set_crazy_vertex_quat(quats, co1, co2, co3, v1, v2, v3); + efa->v1->tmp.p= (void*)quats; + quats+= 4; + } + if(efa->v3->tmp.p==NULL && efa->v3->f1) { + set_crazy_vertex_quat(quats, co3, co1, co2, v3, v1, v2); + efa->v3->tmp.p= (void*)quats; + quats+= 4; + } + } + } + + /* restore abused prev pointer */ + for(prev= NULL, eve= em->verts.first; eve; prev= eve, eve= eve->next) + eve->prev= prev; + +} + +void crazyspace_set_quats_mesh(Mesh *me, float *origcos, float *mappedcos, float *quats) +{ + int i; + MVert *mvert; + MFace *mface; + float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4; + + mvert= me->mvert; + for(i=0; itotvert; i++, mvert++) + mvert->flag&= ~ME_VERT_TMP_TAG; + + /* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */ + mvert= me->mvert; + mface= me->mface; + for(i=0; itotface; i++, mface++) { + + /* retrieve mapped coordinates */ + v1= mappedcos + 3*mface->v1; + v2= mappedcos + 3*mface->v2; + v3= mappedcos + 3*mface->v3; + + co1= (origcos)? origcos + 3*mface->v1: mvert[mface->v1].co; + co2= (origcos)? origcos + 3*mface->v2: mvert[mface->v2].co; + co3= (origcos)? origcos + 3*mface->v3: mvert[mface->v3].co; + + if((mvert[mface->v2].flag&ME_VERT_TMP_TAG)==0) { + set_crazy_vertex_quat(&quats[mface->v2*4], co2, co3, co1, v2, v3, v1); + mvert[mface->v2].flag|= ME_VERT_TMP_TAG; + } + + if(mface->v4) { + v4= mappedcos + 3*mface->v4; + co4= (origcos)? origcos + 3*mface->v4: mvert[mface->v4].co; + + if((mvert[mface->v1].flag&ME_VERT_TMP_TAG)==0) { + set_crazy_vertex_quat(&quats[mface->v1*4], co1, co2, co4, v1, v2, v4); + mvert[mface->v1].flag|= ME_VERT_TMP_TAG; + } + if((mvert[mface->v3].flag&ME_VERT_TMP_TAG)==0) { + set_crazy_vertex_quat(&quats[mface->v3*4], co3, co4, co2, v3, v4, v2); + mvert[mface->v3].flag|= ME_VERT_TMP_TAG; + } + if((mvert[mface->v4].flag&ME_VERT_TMP_TAG)==0) { + set_crazy_vertex_quat(&quats[mface->v4*4], co4, co1, co3, v4, v1, v3); + mvert[mface->v4].flag|= ME_VERT_TMP_TAG; + } + } + else { + if((mvert[mface->v1].flag&ME_VERT_TMP_TAG)==0) { + set_crazy_vertex_quat(&quats[mface->v1*4], co1, co2, co3, v1, v2, v3); + mvert[mface->v1].flag|= ME_VERT_TMP_TAG; + } + if((mvert[mface->v3].flag&ME_VERT_TMP_TAG)==0) { + set_crazy_vertex_quat(&quats[mface->v3*4], co3, co1, co2, v3, v1, v2); + mvert[mface->v3].flag|= ME_VERT_TMP_TAG; + } + } + } +} + +int editmesh_get_first_deform_matrices(Scene *scene, Object *ob, EditMesh *em, float (**deformmats)[3][3], float (**deformcos)[3]) +{ + ModifierData *md; + DerivedMesh *dm; + int i, a, numleft = 0, numVerts = 0; + int cageIndex = modifiers_getCageIndex(scene, ob, NULL, 1); + float (*defmats)[3][3] = NULL, (*deformedVerts)[3] = NULL; + + modifiers_clearErrors(ob); + + dm = NULL; + md = modifiers_getVirtualModifierList(ob); + + /* compute the deformation matrices and coordinates for the first + modifiers with on cage editing that are enabled and support computing + deform matrices */ + for(i = 0; md && i <= cageIndex; i++, md = md->next) { + ModifierTypeInfo *mti = modifierType_getInfo(md->type); + + if(!editmesh_modifier_is_enabled(scene, md, dm)) + continue; + + if(mti->type==eModifierTypeType_OnlyDeform && mti->deformMatricesEM) { + if(!defmats) { + dm= editmesh_get_derived(em, NULL); + deformedVerts= editmesh_get_vertex_cos(em, &numVerts); + defmats= MEM_callocN(sizeof(*defmats)*numVerts, "defmats"); + + for(a=0; adeformMatricesEM(md, ob, em, dm, deformedVerts, defmats, + numVerts); + } + else + break; + } + + for(; md && i <= cageIndex; md = md->next, i++) + if(editmesh_modifier_is_enabled(scene, md, dm) && modifier_isCorrectableDeformed(md)) + numleft++; + + if(dm) + dm->release(dm); + + *deformmats= defmats; + *deformcos= deformedVerts; + + return numleft; +} + +int sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**deformmats)[3][3], float (**deformcos)[3]) +{ + ModifierData *md; + DerivedMesh *dm; + int a, numVerts= 0; + float (*defmats)[3][3]= NULL, (*deformedVerts)[3]= NULL; + MultiresModifierData *mmd= get_multires_modifier(scene, ob, 0); + int has_multires = mmd != NULL && mmd->sculptlvl > 0; + int numleft= 0; + + if(has_multires) { + *deformmats= NULL; + *deformcos= NULL; + return numleft; + } + + dm= NULL; + md= modifiers_getVirtualModifierList(ob); + + for(; md; md= md->next) { + ModifierTypeInfo *mti= modifierType_getInfo(md->type); + + if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue; + + if(mti->type==eModifierTypeType_OnlyDeform) { + if(!defmats) { + Mesh *me= (Mesh*)ob->data; + dm= mesh_create_derived(me, ob, NULL); + deformedVerts= mesh_getVertexCos(me, &numVerts); + defmats= MEM_callocN(sizeof(*defmats)*numVerts, "defmats"); + + for(a=0; adeformMatrices) mti->deformMatrices(md, ob, dm, deformedVerts, defmats, numVerts); + else break; + } + } + + for(; md; md= md->next) { + ModifierTypeInfo *mti= modifierType_getInfo(md->type); + + if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue; + + if(mti->type==eModifierTypeType_OnlyDeform) + numleft++; + } + + if(dm) + dm->release(dm); + + *deformmats= defmats; + *deformcos= deformedVerts; + + return numleft; +} + +void 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); + + if(totleft) { + /* there are deformation modifier which doesn't support deformation matricies + calculation. Need additional crazyspace correction */ + + float (*deformedVerts)[3]= *deformcos; + float (*origVerts)[3]= MEM_dupallocN(deformedVerts); + float *quats= NULL; + int i; + ModifierData *md= modifiers_getVirtualModifierList(ob); + Mesh *me= (Mesh*)ob->data; + + for(; md; md= md->next) { + ModifierTypeInfo *mti= modifierType_getInfo(md->type); + + if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue; + + if(mti->type==eModifierTypeType_OnlyDeform) + mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0, 0); + } + + quats= MEM_mallocN(me->totvert*sizeof(float)*4, "crazy quats"); + + crazyspace_set_quats_mesh(me, (float*)origVerts, (float*)deformedVerts, quats); + + for(i=0; itotvert; i++) { + float qmat[3][3], tmat[3][3]; + + quat_to_mat3(qmat, &quats[i*4]); + mul_m3_m3m3(tmat, qmat, (*deformmats)[i]); + copy_m3_m3((*deformmats)[i], tmat); + } + + MEM_freeN(origVerts); + MEM_freeN(quats); + } +} -- cgit v1.2.3 From 2b9c9e3ad91340389cecae35d68b8f95d084da80 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 14 Feb 2011 16:06:15 +0000 Subject: First modifiers with deformMatrices callback used to be applied twice when building crazytspace. Not sure why this worked. --- source/blender/editors/util/crazyspace.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 8b03f1826e4..7617e1d2066 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -363,7 +363,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3 float (*deformedVerts)[3]= *deformcos; float (*origVerts)[3]= MEM_dupallocN(deformedVerts); float *quats= NULL; - int i; + int i, deformed= 0; ModifierData *md= modifiers_getVirtualModifierList(ob); Mesh *me= (Mesh*)ob->data; @@ -372,8 +372,15 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3 if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue; - if(mti->type==eModifierTypeType_OnlyDeform) + if(mti->type==eModifierTypeType_OnlyDeform) { + /* skip leading modifiers which have been alredy + handled in sculpt_get_first_deform_matrices */ + if(mti->deformMatrices && !deformed) + continue; + mti->deformVerts(md, ob, NULL, deformedVerts, me->totvert, 0, 0); + deformed= 1; + } } quats= MEM_mallocN(me->totvert*sizeof(float)*4, "crazy quats"); -- cgit v1.2.3 From 8b7482892b2ecb456be60b42fe1625156d19e954 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Feb 2011 17:55:27 +0000 Subject: made most variables which are only used in a single file and not defined in header static for blenlib, blenkernel and editors. --- source/blender/editors/util/crazyspace.c | 2 ++ source/blender/editors/util/editmode_undo.c | 5 ++++- source/blender/editors/util/undo.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 7617e1d2066..20b7c255922 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -43,6 +43,8 @@ #include "BLI_math.h" #include "BLI_editVert.h" +#include "ED_util.h" + #define TAN_MAKE_VEC(a, b, c) a[0]= b[0] + 0.2f*(b[0]-c[0]); a[1]= b[1] + 0.2f*(b[1]-c[1]); a[2]= b[2] + 0.2f*(b[2]-c[2]) static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, float *def1, float *def2, float *def3) { diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 85f343e3311..767a2adacb2 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -46,11 +46,14 @@ #include "BKE_depsgraph.h" #include "BKE_global.h" +#include "ED_util.h" #include "ED_mesh.h" #include "UI_interface.h" #include "UI_resources.h" +#include "util_intern.h" + /* ***************** generic editmode undo system ********************* */ /* @@ -75,7 +78,7 @@ void undo_editmode_menu(void) // history menu /* ********************************************************************* */ /* ****** XXX ***** */ -void error(const char *UNUSED(arg)) {} +static void error(const char *UNUSED(arg)) {} /* ****** XXX ***** */ diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 0158719b2fb..a992e33e7d6 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -257,6 +257,7 @@ static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op)) return ed_undo_step(C, -1, NULL); } +#if 0 /* UNUSED */ void ED_undo_menu(bContext *C) { Object *obedit= CTX_data_edit_object(C); @@ -281,6 +282,7 @@ void ED_undo_menu(bContext *C) } } } +#endif /* ********************** */ -- cgit v1.2.3 From 322ff7dfe42a77da4caf63fcaa98a82ef6e6ecad Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 21 Feb 2011 12:35:04 +0000 Subject: I swear, it was just an innocence change in guardedalloc! The butterfly wing flap, causing a nice storm in the rest of blender. Now all dependencies should point ok again. CMakers, do double-test. --- source/blender/editors/util/CMakeLists.txt | 1 + source/blender/editors/util/SConscript | 1 + 2 files changed, 2 insertions(+) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index 38c0dd7f0ba..0be6ccaee2c 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript index 74ca2c89ba2..a694b211ca4 100644 --- a/source/blender/editors/util/SConscript +++ b/source/blender/editors/util/SConscript @@ -6,5 +6,6 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../makesrna' +incs += ' ../../blenloader' env.BlenderLib ( 'bf_editors_util', sources, Split(incs), [], libtype=['core'], priority=[130] ) -- cgit v1.2.3 From 36618a099673a4d6b8552a67d469a223153f55a1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 22 Feb 2011 02:42:19 +0000 Subject: operator ED_OT_undo_push, needed for editmode undo/redo glitch fix, (coming next). --- source/blender/editors/util/undo.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index a992e33e7d6..c3294657635 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -60,9 +60,13 @@ #include "WM_api.h" #include "WM_types.h" +#include "RNA_access.h" +#include "RNA_define.h" #include "util_intern.h" +#define MAXUNDONAME 64 /* XXX, make common define */ + /* ***************** generic undo system ********************* */ void ED_undo_push(bContext *C, const char *str) @@ -252,6 +256,14 @@ static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op)) return ed_undo_step(C, 1, NULL); } +static int ed_undo_push_exec(bContext *C, wmOperator *op) +{ + char str[MAXUNDONAME]; + RNA_string_get(op->ptr, "message", str); + ED_undo_push(C, str); + return OPERATOR_FINISHED; +} + static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op)) { return ed_undo_step(C, -1, NULL); @@ -298,6 +310,19 @@ void ED_OT_undo(wmOperatorType *ot) ot->poll= ED_operator_screenactive; } +void ED_OT_undo_push(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Undo Push"; + ot->description= "Add an undo state (internal use only)"; + ot->idname= "ED_OT_undo_push"; + + /* api callbacks */ + ot->exec= ed_undo_push_exec; + + RNA_def_string(ot->srna, "message", "Add an undo step *function may be moved*", MAXUNDONAME, "Undo Message", ""); +} + void ED_OT_redo(wmOperatorType *ot) { /* identifiers */ -- cgit v1.2.3 From 5b607701a7541c328cc058e10bd7a8c6d0c998ab Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 23 Feb 2011 10:52:22 +0000 Subject: doxygen: prevent GPL license block from being parsed as doxygen comment. --- source/blender/editors/util/crazyspace.c | 2 +- source/blender/editors/util/ed_util.c | 2 +- source/blender/editors/util/editmode_undo.c | 2 +- source/blender/editors/util/numinput.c | 2 +- source/blender/editors/util/undo.c | 2 +- source/blender/editors/util/util_intern.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 20b7c255922..20152f6681b 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 081bda60ba2..2f3392d7f8c 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 767a2adacb2..08f801b8039 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index ccdbe7dfd4e..6ae5963564e 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index c3294657635..c2f8ae16cb8 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/util_intern.h b/source/blender/editors/util/util_intern.h index b5750c55c87..c448377f6b0 100644 --- a/source/blender/editors/util/util_intern.h +++ b/source/blender/editors/util/util_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** -- cgit v1.2.3 From 4ed5cd6cef341727f230ff2d50feb460773a055d Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 27 Feb 2011 18:03:19 +0000 Subject: == UI icons == * Change ICON_NULL --> ICON_NONE to avoid two #defines with the same meaning. --- source/blender/editors/util/ed_util.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 2f3392d7f8c..f0acee0af2e 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -52,6 +52,7 @@ #include "ED_util.h" #include "UI_interface.h" +#include "UI_resources.h" #include "WM_types.h" #include "RNA_access.h" @@ -179,11 +180,11 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha uiLayout *layout; char line[FILE_MAXDIR + FILE_MAXFILE + 100]; - pup= uiPupMenuBegin(C, "Unpack file", ICON_NULL); + pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE); layout= uiPupMenuLayout(pup); sprintf(line, "Remove Pack"); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_REMOVE); RNA_string_set(&props_ptr, "id", id_name); @@ -197,7 +198,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha switch(checkPackedFile(local_name, pf)) { case PF_NOFILE: sprintf(line, "Create %s", local_name); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL); RNA_string_set(&props_ptr, "id", id_name); @@ -205,7 +206,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha case PF_EQUAL: sprintf(line, "Use %s (identical)", local_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL); RNA_string_set(&props_ptr, "id", id_name); @@ -213,13 +214,13 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha case PF_DIFFERS: sprintf(line, "Use %s (differs)", local_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL); RNA_string_set(&props_ptr, "id", id_name); sprintf(line, "Overwrite %s", local_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL); RNA_string_set(&props_ptr, "id", id_name); break; @@ -231,27 +232,27 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha case PF_NOFILE: sprintf(line, "Create %s", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL); RNA_string_set(&props_ptr, "id", id_name); break; case PF_EQUAL: sprintf(line, "Use %s (identical)", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL); RNA_string_set(&props_ptr, "id", id_name); break; case PF_DIFFERS: sprintf(line, "Use %s (differs)", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL); RNA_string_set(&props_ptr, "id", id_name); sprintf(line, "Overwrite %s", abs_name); //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL); - props_ptr= uiItemFullO(layout, opname, line, ICON_NULL, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL); RNA_string_set(&props_ptr, "id", id_name); break; -- cgit v1.2.3 From 95100afc1210e7f95a97c85b51ec94719db24b94 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 27 Feb 2011 20:29:51 +0000 Subject: doxygen: blender/editors tagged. --- source/blender/editors/util/crazyspace.c | 5 +++++ source/blender/editors/util/ed_util.c | 5 +++++ source/blender/editors/util/editmode_undo.c | 5 +++++ source/blender/editors/util/numinput.c | 5 +++++ source/blender/editors/util/undo.c | 5 +++++ source/blender/editors/util/util_intern.h | 5 +++++ 6 files changed, 30 insertions(+) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 20152f6681b..b72943d95e7 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/util/crazyspace.c + * \ingroup edutil + */ + + #include "MEM_guardedalloc.h" #include "DNA_scene_types.h" diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index f0acee0af2e..a81865fc3b4 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/util/ed_util.c + * \ingroup edutil + */ + + #include #include #include diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 08f801b8039..732e5087af2 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/util/editmode_undo.c + * \ingroup edutil + */ + + #include #include diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 6ae5963564e..a5954cdc215 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/util/numinput.c + * \ingroup edutil + */ + + #include /* fabs */ #include /* for sprintf */ diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index c2f8ae16cb8..b366a8460fc 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -27,6 +27,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/util/undo.c + * \ingroup edutil + */ + + #include #include diff --git a/source/blender/editors/util/util_intern.h b/source/blender/editors/util/util_intern.h index c448377f6b0..9ecfb07d535 100644 --- a/source/blender/editors/util/util_intern.h +++ b/source/blender/editors/util/util_intern.h @@ -26,6 +26,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/editors/util/util_intern.h + * \ingroup edutil + */ + + #ifndef ED_UTIL_INTERN_H #define ED_UTIL_INTERN_H -- cgit v1.2.3 From 3074529c7fa5ed250cfd168321dbc7b2ff59a345 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 3 Mar 2011 15:17:57 +0000 Subject: Fix #26273: mirror mod. + armature mod. + rotated armature == wrong reference axis for moving verts (when mirror comes first) Do not overwrite coord of vertices in mapped vertex array used for crazyspace corrections. This should make stuff use position of mesh vertex after deformation, not possible generated images of this vertices. --- source/blender/editors/util/crazyspace.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index b72943d95e7..8008d76344d 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -50,6 +50,11 @@ #include "ED_util.h" +typedef struct { + float *vertexcos; + short *flags; +} MappedUserData; + #define TAN_MAKE_VEC(a, b, c) a[0]= b[0] + 0.2f*(b[0]-c[0]); a[1]= b[1] + 0.2f*(b[1]-c[1]); a[2]= b[2] + 0.2f*(b[2]-c[2]) static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, float *def1, float *def2, float *def3) { @@ -70,10 +75,16 @@ static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s)) { - float *vec = userData; + MappedUserData *mappedData= (MappedUserData*)userData; + float *vec = mappedData->vertexcos; vec+= 3*index; - VECCOPY(vec, co); + if(!mappedData->flags[index]) { + /* we need coord from prototype vertex, not it clones or images, + suppose they stored in the beginning of vertex array stored in DM */ + VECCOPY(vec, co); + mappedData->flags[index]= 1; + } } static int modifiers_disable_subsurf_temporary(Object *ob) @@ -97,6 +108,9 @@ float *crazyspace_get_mapped_editverts(Scene *scene, Object *obedit) Mesh *me= obedit->data; DerivedMesh *dm; float *vertexcos; + int nverts= me->edit_mesh->totvert; + short *flags; + MappedUserData userData; /* disable subsurf temporal, get mapped cos, and enable it */ if(modifiers_disable_subsurf_temporary(obedit)) { @@ -107,14 +121,20 @@ float *crazyspace_get_mapped_editverts(Scene *scene, Object *obedit) /* now get the cage */ dm= editmesh_get_derived_cage(scene, obedit, me->edit_mesh, CD_MASK_BAREMESH); - vertexcos= MEM_mallocN(3*sizeof(float)*me->edit_mesh->totvert, "vertexcos map"); - dm->foreachMappedVert(dm, make_vertexcos__mapFunc, vertexcos); + vertexcos= MEM_callocN(3*sizeof(float)*nverts, "vertexcos map"); + flags= MEM_callocN(sizeof(short)*nverts, "vertexcos flags"); + + userData.vertexcos= vertexcos; + userData.flags= flags; + dm->foreachMappedVert(dm, make_vertexcos__mapFunc, &userData); dm->release(dm); /* set back the flag, no new cage needs to be built, transform does it */ modifiers_disable_subsurf_temporary(obedit); + MEM_freeN(flags); + return vertexcos; } -- cgit v1.2.3 From f6b21ecf840627f384c84e1a869ca54698792a87 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 12 Mar 2011 15:09:29 +0000 Subject: More on bug #26432 More undo-push disabling for switching render slots. Also added 'undo push' print in debug mode (blender -d) --- source/blender/editors/util/undo.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index b366a8460fc..2659863e592 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -80,6 +80,9 @@ void ED_undo_push(bContext *C, const char *str) Object *obedit= CTX_data_edit_object(C); Object *obact= CTX_data_active_object(C); + if (G.f & G_DEBUG) + printf("undo push %s\n", str); + if(obedit) { if (U.undosteps == 0) return; -- cgit v1.2.3 From c32ca47c6fbd7c94382bc2511dfba547f39a35c7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 16 Mar 2011 12:21:20 +0000 Subject: redo panel now runs check() function when defined, filesel and popup dialog were already doing this. --- source/blender/editors/util/undo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 2659863e592..60f551afa6e 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -362,6 +362,11 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op) if (G.f & G_DEBUG) printf("redo_cb: operator redo %s\n", op->type->name); ED_undo_pop_op(C, op); + + if(op->type->check) { + op->type->check(C, op); /* ignore return value since its running again anyway */ + } + retval= WM_operator_repeat(C, op); if((retval & OPERATOR_FINISHED)==0) { if (G.f & G_DEBUG) -- cgit v1.2.3 From a73c3fe5c992777718431d5e5bb5f8a2c3b7a1bc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Mar 2011 17:22:04 +0000 Subject: subsurf, derived mesh and other misc files: floats were being implicitly promoted to doubles, adjust to use floats. --- source/blender/editors/util/ed_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index a81865fc3b4..705fb83264c 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -157,13 +157,13 @@ void apply_keyb_grid(int shift, int ctrl, float *val, float fac1, float fac2, fl ctrl= !ctrl; if(ctrl && shift) { - if(fac3!= 0.0) *val= fac3*floor(*val/fac3 +.5); + if(fac3 != 0.0f) *val= fac3*floorf(*val/fac3 +0.5f); } else if(ctrl) { - if(fac2!= 0.0) *val= fac2*floor(*val/fac2 +.5); + if(fac2 != 0.0f) *val= fac2*floorf(*val/fac2 +0.5f); } else { - if(fac1!= 0.0) *val= fac1*floor(*val/fac1 +.5); + if(fac1 != 0.0f) *val= fac1*floorf(*val/fac1 +0.5f); } } -- cgit v1.2.3 From 91881dce85424860bb97d7e6ccbffc492ac98bd3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 30 Mar 2011 04:58:45 +0000 Subject: - include for BGE joystick sensor - remove print from numinput and get rid of some float/double warnings. - nicer align line-number in text editor. --- source/blender/editors/util/numinput.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index a5954cdc215..1b58a1e2a58 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -85,7 +85,7 @@ void outputNumInput(NumInput *n, char *str) else inv[0] = 0; - if( n->val[i] > 1e10 || n->val[i] < -1e10 ) + if( n->val[i] > 1e10f || n->val[i] < -1e10f ) sprintf(&str[j*20], "%s%.4e%c", inv, n->val[i], cur); else switch (n->ctrl[i]) { @@ -281,7 +281,7 @@ char handleNumInput(NumInput *n, wmEvent *event) if (!n->ctrl[idx]) n->ctrl[idx] = 1; - if (fabs(n->val[idx]) > 9999999.0f); + if (fabsf(n->val[idx]) > 9999999.0f); else if (n->ctrl[idx] == 1) { n->val[idx] *= 10; n->val[idx] += Val; @@ -303,7 +303,7 @@ char handleNumInput(NumInput *n, wmEvent *event) } } - printf("%f\n", n->val[idx]); + // printf("%f\n", n->val[idx]); /* REDRAW SINCE NUMBERS HAVE CHANGED */ return 1; -- cgit v1.2.3 From 6bb626f2532757873ff2ea9f6d2571cc5f344201 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Apr 2011 05:49:47 +0000 Subject: minor changes - remove some warnings - fix typos - cmake allow in-source build (when WITH_IN_SOURCE_BUILD is defined) - cmake, use an explicit list of rna files (don't glob) --- source/blender/editors/util/crazyspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 8008d76344d..a2b32ec7cf8 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -400,7 +400,7 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3 if(!modifier_isEnabled(scene, md, eModifierMode_Realtime)) continue; if(mti->type==eModifierTypeType_OnlyDeform) { - /* skip leading modifiers which have been alredy + /* skip leading modifiers which have been already handled in sculpt_get_first_deform_matrices */ if(mti->deformMatrices && !deformed) continue; -- cgit v1.2.3 From d000103e80c076fb5bbdfbc87dc978b5e693564d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 4 May 2011 13:15:42 +0000 Subject: Own TODO item: sculpting on constructive modifiers - Constructive modifiers are enabled by default in sculpt mode. - There's option to disable all constructive modifiers in the "Options" panel of toolbox in sculpt mode, - Use one column in options panel to make strings easier to read - No modifiers would still be applied on multires --- source/blender/editors/util/crazyspace.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index a2b32ec7cf8..9560924941d 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -425,4 +425,15 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3 MEM_freeN(origVerts); MEM_freeN(quats); } + + if(!*deformmats) { + int a, numVerts; + Mesh *me= (Mesh*)ob->data; + + *deformcos= mesh_getVertexCos(me, &numVerts); + *deformmats= MEM_callocN(sizeof(*(*deformmats))*numVerts, "defmats"); + + for(a=0; a