Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2005-08-11 07:31:33 +0400
committerDaniel Dunbar <daniel@zuster.org>2005-08-11 07:31:33 +0400
commit75bcb4cd9805d58d4f79d5668860f47bf6f17194 (patch)
tree2ffccd1ed22d02e6706957077e3c782d39e46907 /source
parentac3ed0f92a8e8fab50312c716c8cbdf3f38616d9 (diff)
- added modifiers_getVirtualModifierList, returns pointer to first modifier
but including "virtual" modifiers (for example, an object skel-parented to a lattice has a virtual first lattice modifier) - removed mesh_modifier(), all functionality has been incorporated into modifier stack (well, keys still don't exist as a modifier, but I am not sure if they should). - added interface option to convert a virtual modifier into a real modifier - added option to parent to lattice object or lattice with deform - bug fix, patch of hook indices patched all hooks (oops) not just ones for edited mesh NOTE: Files saved with 2.38 that include an object parented to a lattice will not load correctly, because it will look like the object is parented only to the object (i.e. without deform). Can be simply fixed by reparenting or adding a lattice modifier. Older files are handled automatically.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_deform.h1
-rw-r--r--source/blender/blenkernel/BKE_modifier.h3
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c7
-rw-r--r--source/blender/blenkernel/intern/deform.c25
-rw-r--r--source/blender/blenkernel/intern/modifier.c51
-rw-r--r--source/blender/blenloader/intern/readfile.c4
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h1
-rw-r--r--source/blender/src/buttons_editing.c141
-rw-r--r--source/blender/src/editmesh.c34
-rw-r--r--source/blender/src/editmesh_tools.c2
-rw-r--r--source/blender/src/editobject.c16
11 files changed, 185 insertions, 100 deletions
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index a06940e883c..a151cff8879 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -48,7 +48,6 @@ struct bDeformGroup *get_named_vertexgroup (Object *ob, char *name);
int get_defgroup_num (struct Object *ob, struct bDeformGroup *dg);
int curve_modifier(struct Object *ob, char mode);
-void mesh_modifier(struct Object *ob, float (**vertexCos_r)[3]);
int lattice_modifier(struct Object *ob, char mode);
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 574f7b313b4..ce3082fc9b4 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -37,6 +37,7 @@ struct DerivedMesh;
struct DagForest;
struct DagNode;
struct Object;
+struct ListBase;
typedef enum {
/* Should not be used, only for None modifier type */
@@ -201,5 +202,7 @@ int modifiers_getCageIndex (struct Object *ob, int *lastPossibleCageIndex_r)
int modifiers_isSoftbodyEnabled (struct Object *ob);
+ModifierData* modifiers_getVirtualModifierList (struct Object *ob);
+
#endif
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 574ff1fd31a..e46bf147b73 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -60,6 +60,7 @@
#include "BKE_subsurf.h"
#include "BKE_deform.h"
#include "BKE_modifier.h"
+#include "BKE_key.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -1388,8 +1389,8 @@ DerivedMesh *mesh_create_derived_for_modifier(Object *ob, ModifierData *md)
static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], DerivedMesh **deform_r, DerivedMesh **final_r, int useRenderParams, int useDeform)
{
Mesh *me = ob->data;
- ModifierData *md= ob->modifiers.first;
- float (*deformedVerts)[3];
+ ModifierData *md= modifiers_getVirtualModifierList(ob);
+ float (*deformedVerts)[3] = NULL;
DerivedMesh *dm;
int numVerts = me->totvert;
@@ -1399,7 +1400,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], DerivedM
*final_r = NULL;
if (useDeform) {
- mesh_modifier(ob, &deformedVerts);
+ do_mesh_key(me);
/* Apply all leading deforming modifiers */
for (; md; md=md->next) {
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index e2cb842e16d..d89cca72728 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -156,31 +156,6 @@ int get_defgroup_num (Object *ob, bDeformGroup *dg)
/* *************** HOOK ****************** */
-void mesh_modifier(Object *ob, float (**vertexCos_r)[3])
-{
- Mesh *me= ob->data;
- float (*vertexCos)[3] = NULL;
-
- do_mesh_key(me);
-
- if (ob->parent && me->totvert) {
- if(ob->parent->type==OB_CURVE && ob->partype==PARSKEL) {
- if (!vertexCos) vertexCos = mesh_getVertexCos(me, NULL);
- curve_deform_verts(ob->parent, ob, vertexCos, me->totvert);
- }
- else if(ob->parent->type==OB_LATTICE) {
- if (!vertexCos) vertexCos = mesh_getVertexCos(me, NULL);
- lattice_deform_verts(ob->parent, ob, vertexCos, me->totvert);
- }
- else if(ob->parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
- if (!vertexCos) vertexCos = mesh_getVertexCos(me, NULL);
- armature_deform_verts(ob->parent, ob, vertexCos, me->totvert);
- }
- }
-
- *vertexCos_r = vertexCos;
-}
-
int curve_modifier(Object *ob, char mode)
{
static ListBase nurb={NULL, NULL};
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index f306986a8ef..6dc7cb5ca27 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -1468,3 +1468,54 @@ int modifiers_isSoftbodyEnabled(Object *ob)
return (md && md->mode&(eModifierMode_Realtime|eModifierMode_Render));
}
+
+ModifierData *modifiers_getVirtualModifierList(Object *ob)
+{
+ /* Kinda hacky, but should be fine since we are never
+ * reentrant and avoid free hassles.
+ */
+ static ArmatureModifierData amd;
+ static CurveModifierData cmd;
+ static LatticeModifierData lmd;
+ static int init = 1;
+
+ if (init) {
+ ModifierData *md;
+
+ md = modifier_new(eModifierType_Armature);
+ amd = *((ArmatureModifierData*) md);
+ modifier_free(md);
+
+ md = modifier_new(eModifierType_Curve);
+ cmd = *((CurveModifierData*) md);
+ modifier_free(md);
+
+ md = modifier_new(eModifierType_Lattice);
+ lmd = *((LatticeModifierData*) md);
+ modifier_free(md);
+
+ amd.modifier.mode |= eModifierMode_Virtual;
+ cmd.modifier.mode |= eModifierMode_Virtual;
+ lmd.modifier.mode |= eModifierMode_Virtual;
+
+ init = 0;
+ }
+
+ if (ob->parent) {
+ if(ob->parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
+ amd.object = ob->parent;
+ amd.modifier.next = ob->modifiers.first;
+ return &amd.modifier;
+ } else if(ob->parent->type==OB_CURVE && ob->partype==PARSKEL) {
+ cmd.object = ob->parent;
+ cmd.modifier.next = ob->modifiers.first;
+ return &cmd.modifier;
+ } else if(ob->parent->type==OB_LATTICE && ob->partype==PARSKEL) {
+ lmd.object = ob->parent;
+ lmd.modifier.next = ob->modifiers.first;
+ return &lmd.modifier;
+ }
+ }
+
+ return ob->modifiers.first;
+}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index cfecaa5e9f6..bda35404883 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4801,6 +4801,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
where_is_armature(arm);
}
for(ob= main->object.first; ob; ob= ob->id.next) {
+ if (ob->parent && ob->parent->type==OB_LATTICE) {
+ ob->partype = PARSKEL;
+ }
+
if (ob->softflag&OB_SB_ENABLE) {
if (ob->softflag&OB_SB_POSTDEF) {
ModifierData *md = ob->modifiers.first;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 5847e2cd01a..29703eb3e54 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -31,6 +31,7 @@ typedef enum ModifierMode {
eModifierMode_Editmode = (1<<2),
eModifierMode_OnCage = (1<<3),
eModifierMode_Expanded = (1<<4),
+ eModifierMode_Virtual = (1<<5),
} ModifierMode;
typedef struct ModifierData {
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 63303defd44..5c966b49c61 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -786,12 +786,33 @@ static void modifiers_clearHookOffset(void *ob_v, void *md_v)
}
}
+static void modifiers_convertToReal(void *ob_v, void *md_v)
+{
+ Object *ob = ob_v;
+ ModifierData *md = md_v;
+ ModifierData *nmd = modifier_new(md->type);
+
+ modifier_copyData(md, nmd);
+ nmd->mode &= ~eModifierMode_Virtual;
+
+ BLI_addhead(&ob->modifiers, nmd);
+
+ ob->partype = PAROBJECT;
+}
+
static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco, int *yco, int index, int cageIndex, int lastCageIndex)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- uiBut *but;
+ int isVirtual = md->mode&eModifierMode_Virtual;
int x = *xco, y = *yco, color = md->error?TH_REDALERT:TH_BUT_NEUTRAL;
short height, width = 295;
+ char str[128];
+ uiBut *but;
+
+ if (isVirtual) {
+ uiSetButLock(1, "Modifier is virtual and cannot be edited.");
+ color = TH_BUT_SETTING1;
+ }
uiBlockSetEmboss(block, UI_EMBOSSN);
uiDefIconButBitI(block, ICONTOG, eModifierMode_Expanded, B_MODIFIER_REDRAW, VICON_DISCLOSURE_TRI_RIGHT, x-10, y-2, 20, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Modifier");
@@ -805,54 +826,65 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
uiRoundBox(x+4+10, y-18, x+width+10, y+6, 5.0);
BIF_ThemeColor(color);
- uiBlockBeginAlign(block);
- uiDefBut(block, TEX, B_MODIFIER_REDRAW, "", x+10, y-1, width-120-60-10, 19, md->name, 0.0, sizeof(md->name)-1, 0.0, 0.0, "Modifier name");
+ if (isVirtual) {
+ sprintf(str, "%s (virtual)", md->name);
+ uiDefBut(block, LABEL, 0, str, x+10, y-1, width-120-60-10, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name");
- /* Softbody not allowed in this situation, enforce! */
- if (md->type!=eModifierType_Softbody || !(ob->pd && ob->pd->deflect)) {
- uiDefIconButBitI(block, TOG, eModifierMode_Render, B_MODIFIER_RECALC, ICON_SCENE, x+width-120-60, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering");
- uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_MODIFIER_RECALC, VICON_VIEW3D, x+width-120-60+20, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display");
- if (mti->flags&eModifierTypeFlag_SupportsEditmode) {
- uiDefIconButBitI(block, TOG, eModifierMode_Editmode, B_MODIFIER_RECALC, VICON_EDIT, x+width-120-60+40, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode (only if enabled for display)");
- }
- }
- uiBlockEndAlign(block);
-
- uiBlockSetEmboss(block, UI_EMBOSSR);
+ uiClearButLock();
- if (modifier_couldBeCage(md) && index<=lastCageIndex) {
- int icon, color;
+ but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Make Real", x+width-80, y, 60, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Convert virtual modifier to a real modifier");
+ uiButSetFunc(but, modifiers_convertToReal, ob, md);
+ uiSetButLock(1, "Modifier is virtual and cannot be edited.");
+ } else {
+ uiBlockBeginAlign(block);
+ uiDefBut(block, TEX, B_MODIFIER_REDRAW, "", x+10, y-1, width-120-60-10, 19, md->name, 0.0, sizeof(md->name)-1, 0.0, 0.0, "Modifier name");
+
+ /* Softbody not allowed in this situation, enforce! */
+ if (md->type!=eModifierType_Softbody || !(ob->pd && ob->pd->deflect)) {
+ uiDefIconButBitI(block, TOG, eModifierMode_Render, B_MODIFIER_RECALC, ICON_SCENE, x+width-120-60, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering");
+ uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_MODIFIER_RECALC, VICON_VIEW3D, x+width-120-60+20, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display");
+ if (mti->flags&eModifierTypeFlag_SupportsEditmode) {
+ uiDefIconButBitI(block, TOG, eModifierMode_Editmode, B_MODIFIER_RECALC, VICON_EDIT, x+width-120-60+40, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode (only if enabled for display)");
+ }
+ }
+ uiBlockEndAlign(block);
- uiSetRoundBox(15);
- if (index==cageIndex) {
- color = TH_BUT_SETTING;
- icon = VICON_EDITMODE_HLT;
- } else if (index<cageIndex) {
- color = TH_BUT_NEUTRAL;
- icon = VICON_EDITMODE_DEHLT;
- } else {
- color = TH_BUT_NEUTRAL;
- icon = ICON_BLANK1;
- }
- uiBlockSetCol(block, color);
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, icon, x+width-105, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
- uiButSetFunc(but, modifiers_setOnCage, ob, md);
- uiBlockSetCol(block, TH_AUTO);
- }
+ uiBlockSetEmboss(block, UI_EMBOSSR);
+
+ if (modifier_couldBeCage(md) && index<=lastCageIndex) {
+ int icon, color;
+
+ uiSetRoundBox(15);
+ if (index==cageIndex) {
+ color = TH_BUT_SETTING;
+ icon = VICON_EDITMODE_HLT;
+ } else if (index<cageIndex) {
+ color = TH_BUT_NEUTRAL;
+ icon = VICON_EDITMODE_DEHLT;
+ } else {
+ color = TH_BUT_NEUTRAL;
+ icon = ICON_BLANK1;
+ }
+ uiBlockSetCol(block, color);
+ but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, icon, x+width-105, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
+ uiButSetFunc(but, modifiers_setOnCage, ob, md);
+ uiBlockSetCol(block, TH_AUTO);
+ }
- uiBlockSetCol(block, TH_BUT_ACTION);
+ uiBlockSetCol(block, TH_BUT_ACTION);
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_UP, x+width-70, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier up in stack");
- uiButSetFunc(but, modifiers_moveUp, ob, md);
+ but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_UP, x+width-70, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier up in stack");
+ uiButSetFunc(but, modifiers_moveUp, ob, md);
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_DOWN, x+width-70+20, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier down in stack");
- uiButSetFunc(but, modifiers_moveDown, ob, md);
-
- uiBlockSetEmboss(block, UI_EMBOSSN);
+ but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_DOWN, x+width-70+20, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier down in stack");
+ uiButSetFunc(but, modifiers_moveDown, ob, md);
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
- but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_X, x+width-70+40, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Delete modifier");
- uiButSetFunc(but, modifiers_del, ob, md);
- uiBlockSetCol(block, TH_AUTO);
+ but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_X, x+width-70+40, y, 16, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Delete modifier");
+ uiButSetFunc(but, modifiers_del, ob, md);
+ uiBlockSetCol(block, TH_AUTO);
+ }
BIF_ThemeColor(color);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -860,7 +892,6 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
if (!(md->mode&eModifierMode_Expanded)) {
y -= 18;
} else {
- char str[128];
int cy = y - 8;
int lx = x + width - 60 - 15;
@@ -892,14 +923,16 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
uiSetRoundBox(12);
uiRoundBox(x+4+10, y-height, x+width+10, y, 5.0);
- uiBlockBeginAlign(block);
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Apply", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Apply the current modifier and remove from the stack");
- uiButSetFunc(but, modifiers_applyModifier, ob, md);
- if (md->type!=eModifierType_Softbody) {
- but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Copy", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Duplicate the current modifier at the same position in the stack");
- uiButSetFunc(but, modifiers_copyModifier, ob, md);
+ if (!isVirtual) {
+ uiBlockBeginAlign(block);
+ but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Apply", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Apply the current modifier and remove from the stack");
+ uiButSetFunc(but, modifiers_applyModifier, ob, md);
+ if (md->type!=eModifierType_Softbody) {
+ but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Copy", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Duplicate the current modifier at the same position in the stack");
+ uiButSetFunc(but, modifiers_copyModifier, ob, md);
+ }
+ uiBlockEndAlign(block);
}
- uiBlockEndAlign(block);
// uiDefButBitI(block, TOG, eModifierMode_Render, B_MODIFIER_RECALC, "Render", lx,(cy-=19),60,19,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering");
// uiDefButBitI(block, TOG, eModifierMode_Realtime, B_MODIFIER_RECALC, "3D View", lx,(cy-=19),60,19,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display");
@@ -997,6 +1030,10 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
*xco = x;
*yco = y;
+
+ if (isVirtual) {
+ uiClearButLock();
+ }
}
static void editing_panel_modifiers(Object *ob)
@@ -1019,8 +1056,10 @@ static void editing_panel_modifiers(Object *ob)
xco = 0;
yco = 160;
+ md = modifiers_getVirtualModifierList(ob);
+
uiPanelPush(block);
- for (i=0,md=ob->modifiers.first; md; i++, md=md->next) {
+ for (i=0; md; i++, md=md->next) {
draw_modifier(block, ob, md, &xco, &yco, i, cageIndex, lastCageIndex);
}
uiPanelPop(block);
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
index 54a298a54ed..a27f9af7c7e 100644
--- a/source/blender/src/editmesh.c
+++ b/source/blender/src/editmesh.c
@@ -1203,28 +1203,30 @@ void load_editMesh(void)
int i,j;
for (ob=G.main->object.first; ob; ob=ob->id.next) {
- for (md=ob->modifiers.first; md; md=md->next) {
- if (md->type==eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData*) md;
+ if (ob->data==me) {
+ for (md=ob->modifiers.first; md; md=md->next) {
+ if (md->type==eModifierType_Hook) {
+ HookModifierData *hmd = (HookModifierData*) md;
- if (!vertMap) {
- vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap");
+ if (!vertMap) {
+ vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap");
- for (eve=em->verts.first; eve; eve=eve->next) {
- if (eve->keyindex!=-1)
- vertMap[eve->keyindex] = eve;
+ for (eve=em->verts.first; eve; eve=eve->next) {
+ if (eve->keyindex!=-1)
+ vertMap[eve->keyindex] = eve;
+ }
}
- }
-
- for (i=j=0; i<hmd->totindex; i++) {
- eve = vertMap[hmd->indexar[i]];
- if (eve) {
- hmd->indexar[j++] = (long) eve->vn;
+ for (i=j=0; i<hmd->totindex; i++) {
+ eve = vertMap[hmd->indexar[i]];
+
+ if (eve) {
+ hmd->indexar[j++] = (long) eve->vn;
+ }
}
- }
- hmd->totindex = j;
+ hmd->totindex = j;
+ }
}
}
}
diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c
index 09bb08255bd..b839ed0f2b5 100644
--- a/source/blender/src/editmesh_tools.c
+++ b/source/blender/src/editmesh_tools.c
@@ -5145,8 +5145,6 @@ void subdivideflag(int flag, float rad, int beauty)
float fac, vec[3], vec1[3], len1, len2, len3, percent;
short test;
- printf("in old subdivideflag\n");
-
if(beauty & B_SMOOTH) {
short perc= 100;
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index 687e0f09f66..27a20ce7da4 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -1141,7 +1141,19 @@ void make_parent(void)
qual= G.qual;
par= BASACT->object;
- if(par->type == OB_CURVE){
+ if(par->type == OB_LATTICE){
+ mode= pupmenu("Make Parent %t|Normal Parent %x1|Lattice Deform %x2");
+ if(mode<=0){
+ return;
+ }
+ else if(mode==1) {
+ mode= PAROBJECT;
+ }
+ else if(mode==2) {
+ mode= PARSKEL;
+ }
+ }
+ else if(par->type == OB_CURVE){
bConstraint *con;
bFollowPathConstraint *data;
@@ -1303,7 +1315,7 @@ void make_parent(void)
if(qual & LR_ALTKEY) {
base->object->partype= PARVERT1;
}
- else if(par->type==OB_CURVE) {
+ else if(ELEM(par->type, OB_CURVE, OB_LATTICE)) {
base->object->partype= mode;
}
else {