diff options
author | Ton Roosendaal <ton@blender.org> | 2006-09-08 16:05:36 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-09-08 16:05:36 +0400 |
commit | be4e97911d169c36e81876ac3c79b46950b9f32b (patch) | |
tree | cb50109c3d996e353716327e37d4342509410d87 /source/blender/src/editobject.c | |
parent | bffe5dd087bd2fca6890efbbec298d928dd1f1e3 (diff) |
New: vertex-parent support for Lattice.
Works like vertex-parent for Mesh and Curve/Surface. Select one or three
vertices in edit mode, and use CTRL+Select to select another object.
Then press CTRL+P.
Diffstat (limited to 'source/blender/src/editobject.c')
-rw-r--r-- | source/blender/src/editobject.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 753353b24ff..98230db32ab 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -1121,7 +1121,21 @@ void make_vertex_parent(void) } nu= nu->next; } + } + else if(G.obedit->type==OB_LATTICE) { + a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; + bp= editLatt->def; + while(a--) { + if(bp->f1 & SELECT) { + if(v1==0) v1= nr; + else if(v2==0) v2= nr; + else if(v3==0) v3= nr; + else break; + } + nr++; + bp++; + } } if( !(v1 && v2==0 && v3==0) && !(v1 && v2 && v3) ) { @@ -1200,7 +1214,7 @@ void make_parent(void) if(G.scene->id.lib) return; if(G.obedit) { - if ELEM3(G.obedit->type, OB_MESH, OB_CURVE, OB_SURF) make_vertex_parent(); + if ELEM4(G.obedit->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE) make_vertex_parent(); else if (G.obedit->type==OB_ARMATURE) make_bone_parent(); return; } |