More SoftBody stuff:
- after grab/duplicate the softbody didn't get a reset signal - added 'copy properties' for softbody settings - duplicate object didn't copy softbody yet
This commit is contained in:
@@ -43,10 +43,12 @@ struct Object;
|
|||||||
struct Camera;
|
struct Camera;
|
||||||
struct BoundBox;
|
struct BoundBox;
|
||||||
struct View3D;
|
struct View3D;
|
||||||
|
struct SoftBody;
|
||||||
|
|
||||||
void clear_workob(void);
|
void clear_workob(void);
|
||||||
void copy_baseflags(void);
|
void copy_baseflags(void);
|
||||||
void copy_objectflags(void);
|
void copy_objectflags(void);
|
||||||
|
struct SoftBody *copy_softbody(struct SoftBody *sb);
|
||||||
void update_base_layer(struct Object *ob);
|
void update_base_layer(struct Object *ob);
|
||||||
void free_object(struct Object *ob);
|
void free_object(struct Object *ob);
|
||||||
void unlink_object(struct Object *ob);
|
void unlink_object(struct Object *ob);
|
||||||
|
@@ -745,6 +745,18 @@ void base_init_from_view3d(Base *base, View3D *v3d)
|
|||||||
v3d->viewquat[0]= -v3d->viewquat[0];
|
v3d->viewquat[0]= -v3d->viewquat[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SoftBody *copy_softbody(SoftBody *sb)
|
||||||
|
{
|
||||||
|
SoftBody *sbn;
|
||||||
|
|
||||||
|
sbn= MEM_dupallocN(sb);
|
||||||
|
sbn->totspring= sbn->totpoint= 0;
|
||||||
|
sbn->bpoint= NULL;
|
||||||
|
sbn->bspring= NULL;
|
||||||
|
sbn->ctime= 0.0f;
|
||||||
|
|
||||||
|
return sbn;
|
||||||
|
}
|
||||||
|
|
||||||
Object *copy_object(Object *ob)
|
Object *copy_object(Object *ob)
|
||||||
{
|
{
|
||||||
@@ -785,7 +797,6 @@ Object *copy_object(Object *ob)
|
|||||||
if (actcon)
|
if (actcon)
|
||||||
obn->activecon = actcon;
|
obn->activecon = actcon;
|
||||||
|
|
||||||
if(ob->pd) obn->pd= MEM_dupallocN(ob->pd);
|
|
||||||
|
|
||||||
/* increase user numbers */
|
/* increase user numbers */
|
||||||
id_us_plus((ID *)obn->data);
|
id_us_plus((ID *)obn->data);
|
||||||
@@ -794,7 +805,9 @@ Object *copy_object(Object *ob)
|
|||||||
for(a=0; a<obn->totcol; a++) id_us_plus((ID *)obn->mat[a]);
|
for(a=0; a<obn->totcol; a++) id_us_plus((ID *)obn->mat[a]);
|
||||||
|
|
||||||
obn->disp.first= obn->disp.last= NULL;
|
obn->disp.first= obn->disp.last= NULL;
|
||||||
obn->soft= NULL;
|
|
||||||
|
if(ob->pd) obn->pd= MEM_dupallocN(ob->pd);
|
||||||
|
obn->soft= copy_softbody(ob->soft);
|
||||||
|
|
||||||
return obn;
|
return obn;
|
||||||
}
|
}
|
||||||
|
@@ -1269,7 +1269,7 @@ void sbFree(SoftBody *sb)
|
|||||||
/* makes totally fresh start situation */
|
/* makes totally fresh start situation */
|
||||||
void sbObjectToSoftbody(Object *ob)
|
void sbObjectToSoftbody(Object *ob)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(ob->type) {
|
switch(ob->type) {
|
||||||
case OB_MESH:
|
case OB_MESH:
|
||||||
mesh_to_softbody(ob);
|
mesh_to_softbody(ob);
|
||||||
|
@@ -2430,6 +2430,8 @@ void copy_attr_menu()
|
|||||||
|
|
||||||
if( give_parteff(ob) ) strcat(str, "|Particle Settings%x20");
|
if( give_parteff(ob) ) strcat(str, "|Particle Settings%x20");
|
||||||
|
|
||||||
|
if(ob->soft) strcat(str, "|Soft Body Settings%x23");
|
||||||
|
|
||||||
event= pupmenu(str);
|
event= pupmenu(str);
|
||||||
if(event<= 0) return;
|
if(event<= 0) return;
|
||||||
|
|
||||||
@@ -2602,7 +2604,7 @@ void copy_attr(short event)
|
|||||||
makeDispList(base->object);
|
makeDispList(base->object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(event==22){
|
else if(event==22) {
|
||||||
/* Clear the constraints on the target */
|
/* Clear the constraints on the target */
|
||||||
free_constraints(&base->object->constraints);
|
free_constraints(&base->object->constraints);
|
||||||
free_constraint_channels(&base->object->constraintChannels);
|
free_constraint_channels(&base->object->constraintChannels);
|
||||||
@@ -2616,6 +2618,12 @@ void copy_attr(short event)
|
|||||||
|
|
||||||
base->object->activecon = NULL;
|
base->object->activecon = NULL;
|
||||||
}
|
}
|
||||||
|
else if(event==23) {
|
||||||
|
base->object->softflag= ob->softflag;
|
||||||
|
if(base->object->soft) sbFree(base->object->soft);
|
||||||
|
|
||||||
|
base->object->soft= copy_softbody(ob->soft);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
base= base->next;
|
base= base->next;
|
||||||
@@ -4368,7 +4376,6 @@ void special_aftertrans_update(char mode, int flip, short canceled, int keyflags
|
|||||||
Base *base;
|
Base *base;
|
||||||
MetaBall *mb;
|
MetaBall *mb;
|
||||||
Curve *cu;
|
Curve *cu;
|
||||||
Ika *ika;
|
|
||||||
int doit,redrawipo=0;
|
int doit,redrawipo=0;
|
||||||
|
|
||||||
|
|
||||||
@@ -4449,11 +4456,6 @@ void special_aftertrans_update(char mode, int flip, short canceled, int keyflags
|
|||||||
|
|
||||||
where_is_object(ob);
|
where_is_object(ob);
|
||||||
|
|
||||||
if(ob->type==OB_IKA) {
|
|
||||||
ika= ob->data;
|
|
||||||
VecMat4MulVecfl(ika->effg, ob->obmat, ika->eff);
|
|
||||||
itterate_ika(ob);
|
|
||||||
}
|
|
||||||
if(ob->type==OB_ARMATURE && canceled) {
|
if(ob->type==OB_ARMATURE && canceled) {
|
||||||
/* Unfortunately, sometimes when you escape
|
/* Unfortunately, sometimes when you escape
|
||||||
* a transform on an object that is the
|
* a transform on an object that is the
|
||||||
@@ -4504,6 +4506,8 @@ void special_aftertrans_update(char mode, int flip, short canceled, int keyflags
|
|||||||
makeDispList(ob);
|
makeDispList(ob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ob->softflag & OB_SB_ENABLE) sbObjectReset(ob);
|
||||||
|
|
||||||
where_is_object(ob); /* always do, for track etc. */
|
where_is_object(ob); /* always do, for track etc. */
|
||||||
|
|
||||||
/* Set autokey if necessary */
|
/* Set autokey if necessary */
|
||||||
|
Reference in New Issue
Block a user