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
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2005-07-20 00:14:17 +0400
committerDaniel Dunbar <daniel@zuster.org>2005-07-20 00:14:17 +0400
commit1df154d14026daf7837f7ed6ea6553145436ae52 (patch)
tree32eae4e00158f1c9a320ef524b4b53ad7ac4139d /source/blender/blenkernel/intern/lattice.c
parentf1763b2f0878096d5ddb5b6aa96bda71aaeb6be1 (diff)
- split {curve,lattice,armature}_deform_verts out of mesh_deform
- removed mesh_deform (merge into mesh_modifier) - switch python lattice_apply function to use object_apply_deform, this isn't exactly equivalent but the python system shouldn't have been calling that deep into the kernel anyway. New feature: Modifier stack - added Object.modifiers (list of ModifierData elements) - added DNA_modifier_types.h o contains type definition for the file data for the various modifier types - added BKE_modifier.h o contains modifierType_get_info (access to modifier type registry) o structs and defines for runtime modifier usage - updated mesh_calc_modifiers to evaluate modifier stack (note that for the time being it also evaluates the old style modifiers so files should load and work as normal). - add file handling modifier code (todo: don't replicate on object copy) - add modifier stack UI code (lives in object panel) Only real new feature at the moment is that you can apply lattices and curves *after* a subdivision surface which was never possible before. Todo: - DEP graph updating does not work correctly yet, so you generally have to tab cycle to see results. - editmode calculation does not use modifier stack. - bug fixes (there must be a few in there somewhere)
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r--source/blender/blenkernel/intern/lattice.c85
1 files changed, 37 insertions, 48 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index eff9d813afd..140c4d74822 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -516,64 +516,53 @@ static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *c
}
-int mesh_deform(Object *ob, float (*vertexCos)[3])
+void curve_deform_verts(Object *cuOb, Object *target, float (*vertexCos)[3], int numVerts)
{
- Mesh *me = ob->data;
- int a;
-
- if(ob->parent==NULL || ob->type!=OB_MESH || !me->totvert) return 0;
+ Curve *cu = cuOb->data;
+ int a, flag = cu->flag;
+ CurveDeform cd;
- if(ob->parent->type==OB_CURVE && ob->partype==PARSKEL) {
- Curve *cu = ob->parent->data;
- int flag = cu->flag;
- CurveDeform cd;
+ cu->flag |= (CU_PATH|CU_FOLLOW); // needed for path & bevlist
+
+ init_curve_deform(cuOb, target, &cd);
- cu->flag |= (CU_PATH|CU_FOLLOW); // needed for path & bevlist
-
- init_curve_deform(ob->parent, ob, &cd);
-
- /* transformation to curve space, and min max*/
- INIT_MINMAX(cd.dmin, cd.dmax);
-
- for(a=0; a<me->totvert; a++) {
- Mat4MulVecfl(cd.curvespace, vertexCos[a]);
- DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
- }
+ INIT_MINMAX(cd.dmin, cd.dmax);
+
+ for(a=0; a<numVerts; a++) {
+ Mat4MulVecfl(cd.curvespace, vertexCos[a]);
+ DO_MINMAX(vertexCos[a], cd.dmin, cd.dmax);
+ }
- for(a=0; a<me->totvert; a++) {
- calc_curve_deform(ob->parent, vertexCos[a], ob->trackflag, &cd);
- Mat4MulVecfl(cd.objectspace, vertexCos[a]); /* move coord back to objectspace */
- }
+ for(a=0; a<numVerts; a++) {
+ calc_curve_deform(cuOb, vertexCos[a], target->trackflag, &cd);
+ Mat4MulVecfl(cd.objectspace, vertexCos[a]);
+ }
- cu->flag = flag;
+ cu->flag = flag;
+}
- return 1;
- }
- else if(ob->parent->type==OB_LATTICE) {
- init_latt_deform(ob->parent, ob);
- if(ob->type==OB_MESH) {
- for(a=0; a<me->totvert; a++) {
- calc_latt_deform(vertexCos[a]);
- }
- }
- end_latt_deform();
+void lattice_deform_verts(Object *laOb, Object *target, float (*vertexCos)[3], int numVerts)
+{
+ int a;
- return 1;
+ init_latt_deform(laOb, target);
+
+ for(a=0; a<numVerts; a++) {
+ calc_latt_deform(vertexCos[a]);
}
- else if(ob->parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
- if (ob->parent==G.obedit) // misleading making displists... very bad
- return 1;
-
- init_armature_deform (ob->parent, ob);
- for(a=0; a<me->totvert; a++) {
- calc_armature_deform(ob->parent, vertexCos[a], a);
- }
-
- return 1;
+ end_latt_deform();
+}
+
+void armature_deform_verts(Object *armOb, Object *target, float (*vertexCos)[3], int numVerts)
+{
+ int a;
+
+ init_armature_deform(armOb, target);
+
+ for(a=0; a<numVerts; a++) {
+ calc_armature_deform(armOb, vertexCos[a], a);
}
-
- return 0;
}
int object_deform(Object *ob)