Lot of code... 2 new features:

1) Curve deform
http://www.blender3d.org/cms/Curve_Deform.392.0.html
Works simple as expected, but keep track of the rotation axis
in F7 buttons (Track X Y Z)
Only Mesh deform supported now.

Code changes:
- centralized deformation calls in curve_modifiers() mesh_modifiers()
etcetera. Here also other effects can be added like wave. Now the
evaluation order is fixed, but should become optional. It also doesnt
use the Displist anymore as deform-input. That latter part is unfinished
yet.
This code also is used for Hooks and will be needed for softbody

- made convention stricter that displists are being checked on in
drawobject(), this to prevent routines to make new displists recursively
(like armature does). Now a freedisplist() is sufficient to signal that
a new displaylist should be made.

2) Object Hooks
http://www.blender3d.org/cms/Object_Hooks.391.0.html
Support for Hooks is added to Mesh, Lattice, Curve and Surface objects.
For Armatures this would require some more work & research.
Main goal for this feature is to provide quick & simple access to the
underlying geometry in Objects on Object level, supporting hierarchies and
Ipos etc.
This commit is contained in:
2004-09-14 19:03:11 +00:00
parent 807339b4a7
commit 37f57288cb
22 changed files with 1319 additions and 309 deletions

View File

@@ -2122,7 +2122,7 @@ static void lib_link_object(FileData *fd, Main *main)
bSensor *sens;
bController *cont;
bActuator *act;
ObHook *hook;
void *poin;
int warn=0, a;
@@ -2240,6 +2240,10 @@ static void lib_link_object(FileData *fd, Main *main)
}
lib_link_scriptlink(fd, &ob->id, &ob->scriptlink);
for(hook= ob->hooks.first; hook; hook= hook->next) {
hook->parent= newlibadr(fd, ob->id.lib, hook->parent);
}
}
ob= ob->id.next;
}
@@ -2270,7 +2274,8 @@ static void direct_link_object(FileData *fd, Object *ob)
bSensor *sens;
bController *cont;
bActuator *act;
ObHook *hook;
ob->disp.first=ob->disp.last= 0;
ob->pose= newdataadr(fd, ob->pose);
@@ -2335,7 +2340,18 @@ static void direct_link_object(FileData *fd, Object *ob)
act= act->next;
}
ob->bb= 0;
link_list(fd, &ob->hooks);
for(hook= ob->hooks.first; hook; hook= hook->next) {
hook->indexar= newdataadr(fd, hook->indexar);
if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
int a;
for(a=0; a<hook->totindex; a++) {
SWITCH_INT(hook->indexar[a]);
}
}
}
ob->bb= NULL;
}
/* ************ READ SCENE ***************** */

View File

@@ -655,7 +655,8 @@ static void write_constraint_channels(WriteData *wd, ListBase *chanbase)
static void write_objects(WriteData *wd, ListBase *idbase)
{
Object *ob;
ObHook *hook;
ob= idbase->first;
while(ob) {
if(ob->id.us>0) {
@@ -677,6 +678,11 @@ static void write_objects(WriteData *wd, ListBase *idbase)
write_nlastrips(wd, &ob->nlastrips);
writestruct(wd, DATA, "PartDeflect", 1, ob->pd);
for(hook= ob->hooks.first; hook; hook= hook->next) {
writestruct(wd, DATA, "ObHook", 1, hook);
writedata(wd, DATA, sizeof(int)*hook->totindex, hook->indexar);
}
}
ob= ob->id.next;
}