diff options
Diffstat (limited to 'source/blender/blenkernel/intern/sca.c')
-rw-r--r-- | source/blender/blenkernel/intern/sca.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 47d11bb9d29..74d2347ec39 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -37,7 +37,6 @@ #include <string.h> #include "MEM_guardedalloc.h" -#include "nla.h" /* For __NLA: Important, do not remove */ #include "DNA_text_types.h" #include "DNA_controller_types.h" #include "DNA_sensor_types.h" @@ -45,13 +44,14 @@ #include "DNA_object_types.h" #include "BLI_blenlib.h" -#include "BKE_bad_level_calls.h" #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_blender.h" #include "BKE_sca.h" +//#include "wm_event_types.h" + void free_text_controllers(Text *txt) { Object *ob; @@ -134,7 +134,7 @@ void init_sensor(bSensor *sens) switch(sens->type) { case SENS_ALWAYS: - sens->pulse = 1; + sens->pulse = 0; break; case SENS_TOUCH: sens->data= MEM_callocN(sizeof(bTouchSensor), "touchsens"); @@ -158,7 +158,7 @@ void init_sensor(bSensor *sens) break; case SENS_MOUSE: ms=sens->data= MEM_callocN(sizeof(bMouseSensor), "mousesens"); - ms->type= LEFTMOUSE; + //XXX ms->type= LEFTMOUSE; break; case SENS_COLLISION: sens->data= MEM_callocN(sizeof(bCollisionSensor), "colsens"); @@ -195,7 +195,7 @@ bSensor *new_sensor(int type) init_sensor(sens); strcpy(sens->name, "sensor"); - make_unique_prop_names(sens->name); +// XXX make_unique_prop_names(sens->name); return sens; } @@ -319,7 +319,7 @@ bController *new_controller(int type) init_controller(cont); strcpy(cont->name, "cont"); - make_unique_prop_names(cont->name); +// XXX make_unique_prop_names(cont->name); return cont; } @@ -491,7 +491,7 @@ bActuator *new_actuator(int type) init_actuator(act); strcpy(act->name, "act"); - make_unique_prop_names(act->name); +// XXX make_unique_prop_names(act->name); return act; } @@ -579,6 +579,10 @@ void set_sca_new_poins_ob(Object *ob) bCameraActuator *ca= act->data; ID_NEW(ca->ob); } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + ID_NEW(oa->reference); + } else if(act->type==ACT_SCENE) { bSceneActuator *sca= act->data; ID_NEW(sca->camera); @@ -606,6 +610,7 @@ void sca_remove_ob_poin(Object *obt, Object *ob) bMessageSensor *ms; bActuator *act; bCameraActuator *ca; + bObjectActuator *oa; bSceneActuator *sa; bEditObjectActuator *eoa; bPropertyActuator *pa; @@ -628,6 +633,10 @@ void sca_remove_ob_poin(Object *obt, Object *ob) ca= act->data; if(ca->ob==ob) ca->ob= NULL; break; + case ACT_OBJECT: + oa= act->data; + if(oa->reference==ob) oa->reference= NULL; + break; case ACT_PROPERTY: pa= act->data; if(pa->ob==ob) pa->ob= NULL; |