remove scriptlinks,

they were not working and we have plans for better script integration in 2.5
This commit is contained in:
Campbell Barton 2009-07-22 09:41:41 +00:00
parent 53c1b562af
commit ffb8ac01a2
37 changed files with 12 additions and 501 deletions

@ -98,11 +98,6 @@ void object_to_mat4(struct Object *ob, float mat[][4]);
void set_no_parent_ipo(int val); void set_no_parent_ipo(int val);
void disable_where_script(short on);
int during_script(void);
void disable_where_scriptlink(short on);
int during_scriptlink(void);
void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime); void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime);
void where_is_object(struct Scene *scene, struct Object *ob); void where_is_object(struct Scene *scene, struct Object *ob);
void where_is_object_simul(struct Scene *scene, struct Object *ob); void where_is_object_simul(struct Scene *scene, struct Object *ob);

@ -387,10 +387,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
/* now tag update flags, to ensure deformers get calculated on redraw */ /* now tag update flags, to ensure deformers get calculated on redraw */
DAG_scene_update_flags(CTX_data_scene(C), CTX_data_scene(C)->lay); DAG_scene_update_flags(CTX_data_scene(C), CTX_data_scene(C)->lay);
if (G.f & G_DOSCRIPTLINKS) {
/* there's an onload scriptlink to execute in screenmain */
// XXX mainqenter(ONLOAD_SCRIPT, 1);
}
if (G.sce != filename) /* these are the same at times, should never copy to the same location */ if (G.sce != filename) /* these are the same at times, should never copy to the same location */
strcpy(G.sce, filename); strcpy(G.sce, filename);

@ -1997,8 +1997,6 @@ static void dag_object_time_update_flags(Object *ob)
} }
} }
if(ob->scriptlink.totscript) ob->recalc |= OB_RECALC_OB;
if(ob->parent) { if(ob->parent) {
/* motion path or bone child */ /* motion path or bone child */
if(ob->parent->type==OB_CURVE || ob->parent->type==OB_ARMATURE) ob->recalc |= OB_RECALC_OB; if(ob->parent->type==OB_CURVE || ob->parent->type==OB_ARMATURE) ob->recalc |= OB_RECALC_OB;

@ -1900,16 +1900,10 @@ void write_stl(Scene *scene, char *str)
if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0; if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0;
if(BLI_testextensie(str,".stl")==0) strcat(str, ".stl"); if(BLI_testextensie(str,".stl")==0) strcat(str, ".stl");
if (!during_script()) {
if (BLI_exists(str))
; //XXX if(saveover(str)==0)
//XXX return;
}
fpSTL= fopen(str, "wb"); fpSTL= fopen(str, "wb");
if(fpSTL==NULL) { if(fpSTL==NULL) {
if (!during_script()) ; //XXX error("Can't write file"); //XXX error("Can't write file");
return; return;
} }
strcpy(temp_dir, str); strcpy(temp_dir, str);
@ -2233,11 +2227,11 @@ void write_vrml(Scene *scene, char *str)
if(BLI_testextensie(str,".blend")) str[ strlen(str)-6]= 0; if(BLI_testextensie(str,".blend")) str[ strlen(str)-6]= 0;
if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0; if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0;
if(BLI_testextensie(str,".wrl")==0) strcat(str, ".wrl"); if(BLI_testextensie(str,".wrl")==0) strcat(str, ".wrl");
//XXX saveover() if(!during_script() && saveover(str)==0) return; //XXX saveover() if(saveover(str)==0) return;
fp= fopen(str, "w"); fp= fopen(str, "w");
if(fp==NULL && !during_script()) { if(fp==NULL) {
//XXX error("Can't write file"); //XXX error("Can't write file");
return; return;
} }
@ -2544,15 +2538,15 @@ void write_dxf(struct Scene *scene, char *str)
if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0; if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0;
if(BLI_testextensie(str,".dxf")==0) strcat(str, ".dxf"); if(BLI_testextensie(str,".dxf")==0) strcat(str, ".dxf");
if (!during_script()) {
if (BLI_exists(str)) if (BLI_exists(str)) {
; //XXX if(saveover(str)==0) ; //XXX if(saveover(str)==0)
// return; // return;
} }
fp= fopen(str, "w"); fp= fopen(str, "w");
if(fp==NULL && !during_script()) { if(fp==NULL) {
//XXX error("Can't write file"); //XXX error("Can't write file");
return; return;
} }

@ -80,10 +80,6 @@ void free_material(Material *ma)
{ {
MTex *mtex; MTex *mtex;
int a; int a;
#ifndef DISABLE_PYTHON
BPY_free_scriptlink(&ma->scriptlink);
#endif
for(a=0; a<MAX_MTEX; a++) { for(a=0; a<MAX_MTEX; a++) {
mtex= ma->mtex[a]; mtex= ma->mtex[a];
@ -210,10 +206,6 @@ Material *copy_material(Material *ma)
id_us_plus((ID *)man->mtex[a]->tex); id_us_plus((ID *)man->mtex[a]->tex);
} }
} }
#ifndef DISABLE_PYTHON
BPY_copy_scriptlink(&ma->scriptlink);
#endif
if(ma->ramp_col) man->ramp_col= MEM_dupallocN(ma->ramp_col); if(ma->ramp_col) man->ramp_col= MEM_dupallocN(ma->ramp_col);
if(ma->ramp_spec) man->ramp_spec= MEM_dupallocN(ma->ramp_spec); if(ma->ramp_spec) man->ramp_spec= MEM_dupallocN(ma->ramp_spec);

@ -266,10 +266,6 @@ void free_object(Object *ob)
free_actuators(&ob->actuators); free_actuators(&ob->actuators);
free_constraints(&ob->constraints); free_constraints(&ob->constraints);
#ifndef DISABLE_PYTHON
BPY_free_scriptlink(&ob->scriptlink);
#endif
if(ob->pd){ if(ob->pd){
if(ob->pd->tex) if(ob->pd->tex)
@ -645,10 +641,7 @@ Camera *copy_camera(Camera *cam)
camn= copy_libblock(cam); camn= copy_libblock(cam);
camn->adt= BKE_copy_animdata(cam->adt); camn->adt= BKE_copy_animdata(cam->adt);
#ifndef DISABLE_PYTHON
BPY_copy_scriptlink(&camn->scriptlink);
#endif
return camn; return camn;
} }
@ -797,9 +790,7 @@ Lamp *copy_lamp(Lamp *la)
#endif // XXX old animation system #endif // XXX old animation system
if (la->preview) lan->preview = BKE_previewimg_copy(la->preview); if (la->preview) lan->preview = BKE_previewimg_copy(la->preview);
#ifndef DISABLE_PYTHON
BPY_copy_scriptlink(&la->scriptlink);
#endif
return lan; return lan;
} }
@ -857,9 +848,6 @@ void make_local_lamp(Lamp *la)
void free_camera(Camera *ca) void free_camera(Camera *ca)
{ {
#ifndef DISABLE_PYTHON
BPY_free_scriptlink(&ca->scriptlink);
#endif
BKE_free_animdata((ID *)ca); BKE_free_animdata((ID *)ca);
} }
@ -868,11 +856,6 @@ void free_lamp(Lamp *la)
MTex *mtex; MTex *mtex;
int a; int a;
/* scriptlinks */
#ifndef DISABLE_PYTHON
BPY_free_scriptlink(&la->scriptlink);
#endif
for(a=0; a<MAX_MTEX; a++) { for(a=0; a<MAX_MTEX; a++) {
mtex= la->mtex[a]; mtex= la->mtex[a];
if(mtex && mtex->tex) mtex->tex->id.us--; if(mtex && mtex->tex) mtex->tex->id.us--;
@ -1210,9 +1193,7 @@ Object *copy_object(Object *ob)
modifier_copyData(md, nmd); modifier_copyData(md, nmd);
BLI_addtail(&obn->modifiers, nmd); BLI_addtail(&obn->modifiers, nmd);
} }
#ifndef DISABLE_PYTHON
BPY_copy_scriptlink(&ob->scriptlink);
#endif
obn->prop.first = obn->prop.last = NULL; obn->prop.first = obn->prop.last = NULL;
copy_properties(&obn->prop, &ob->prop); copy_properties(&obn->prop, &ob->prop);
@ -1843,26 +1824,6 @@ void set_no_parent_ipo(int val)
no_parent_ipo= val; no_parent_ipo= val;
} }
static int during_script_flag=0;
void disable_where_script(short on)
{
during_script_flag= on;
}
int during_script(void) {
return during_script_flag;
}
static int during_scriptlink_flag=0;
void disable_where_scriptlink(short on)
{
during_scriptlink_flag= on;
}
int during_scriptlink(void) {
return during_scriptlink_flag;
}
void where_is_object_time(Scene *scene, Object *ob, float ctime) void where_is_object_time(Scene *scene, Object *ob, float ctime)
{ {
float *fp1, *fp2, slowmat[4][4] = MAT4_UNITY; float *fp1, *fp2, slowmat[4][4] = MAT4_UNITY;
@ -1962,11 +1923,6 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
constraints_clear_evalob(cob); constraints_clear_evalob(cob);
} }
#ifndef DISABLE_PYTHON
if(ob->scriptlink.totscript && !during_script()) {
if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript((ID *)ob, SCRIPT_REDRAW);
}
#endif
/* set negative scale flag in object */ /* set negative scale flag in object */
Crossf(vec, ob->obmat[0], ob->obmat[1]); Crossf(vec, ob->obmat[0], ob->obmat[1]);
@ -2338,9 +2294,6 @@ void object_handle_update(Scene *scene, Object *ob)
} }
else else
where_is_object(scene, ob); where_is_object(scene, ob);
#ifndef DISABLE_PYTHON
if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript((ID *)ob, SCRIPT_OBJECTUPDATE);
#endif
} }
if(ob->recalc & OB_RECALC_DATA) { if(ob->recalc & OB_RECALC_DATA) {
@ -2429,9 +2382,6 @@ void object_handle_update(Scene *scene, Object *ob)
psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated; psys_get_modifier(ob, psys)->flag &= ~eParticleSystemFlag_psys_updated;
} }
} }
#ifndef DISABLE_PYTHON
if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript((ID *)ob, SCRIPT_OBDATAUPDATE);
#endif
} }
/* the no-group proxy case, we call update */ /* the no-group proxy case, we call update */

@ -54,7 +54,6 @@
#include "DNA_meta_types.h" #include "DNA_meta_types.h"
#include "DNA_object_types.h" #include "DNA_object_types.h"
#include "DNA_scene_types.h" #include "DNA_scene_types.h"
#include "DNA_scriptlink_types.h"
#include "DNA_texture_types.h" #include "DNA_texture_types.h"
#include "DNA_userdef_types.h" #include "DNA_userdef_types.h"
@ -142,10 +141,6 @@ void free_scene(Scene *sce)
BLI_freelistN(&sce->base); BLI_freelistN(&sce->base);
seq_free_editing(sce->ed); seq_free_editing(sce->ed);
#ifndef DISABLE_PYTHON
BPY_free_scriptlink(&sce->scriptlink);
#endif
BKE_free_animdata((ID *)sce); BKE_free_animdata((ID *)sce);
BKE_keyingsets_free(&sce->keyingsets); BKE_keyingsets_free(&sce->keyingsets);
@ -398,9 +393,6 @@ void set_scene_bg(Scene *scene)
ob->ctime= -1234567.0; /* force ipo to be calculated later */ ob->ctime= -1234567.0; /* force ipo to be calculated later */
} }
/* no full animation update, this to enable render code to work (render code calls own animation updates) */ /* no full animation update, this to enable render code to work (render code calls own animation updates) */
/* do we need FRAMECHANGED in set_scene? */
// if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED, 0);
} }
/* called from creator.c */ /* called from creator.c */
@ -659,9 +651,6 @@ void scene_update_for_newframe(Scene *sce, unsigned int lay)
/* clear animation overrides */ /* clear animation overrides */
// XXX TODO... // XXX TODO...
#ifndef DISABLE_PYTHON
if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED, 0);
#endif
/* sets first, we allow per definition current scene to have dependencies on sets */ /* sets first, we allow per definition current scene to have dependencies on sets */
for(sce= sce->set; sce; sce= sce->set) for(sce= sce->set; sce; sce= sce->set)
scene_update(sce, lay); scene_update(sce, lay);

@ -291,10 +291,6 @@ void BKE_screen_area_free(ScrArea *sa)
BKE_spacedata_freelist(&sa->spacedata); BKE_spacedata_freelist(&sa->spacedata);
BLI_freelistN(&sa->actionzones); BLI_freelistN(&sa->actionzones);
#ifndef DISABLE_PYTHON
BPY_free_scriptlink(&sa->scriptlink);
#endif
} }
/* don't free screen itself */ /* don't free screen itself */

@ -36,7 +36,6 @@
#include "DNA_world_types.h" #include "DNA_world_types.h"
#include "DNA_texture_types.h" #include "DNA_texture_types.h"
#include "DNA_scriptlink_types.h"
#include "DNA_scene_types.h" #include "DNA_scene_types.h"
#include "DNA_object_types.h" #include "DNA_object_types.h"
#include "DNA_camera_types.h" #include "DNA_camera_types.h"
@ -66,10 +65,7 @@ void free_world(World *wrld)
{ {
MTex *mtex; MTex *mtex;
int a; int a;
#ifndef DISABLE_PYTHON
BPY_free_scriptlink(&wrld->scriptlink);
#endif
for(a=0; a<MAX_MTEX; a++) { for(a=0; a<MAX_MTEX; a++) {
mtex= wrld->mtex[a]; mtex= wrld->mtex[a];
if(mtex && mtex->tex) mtex->tex->id.us--; if(mtex && mtex->tex) mtex->tex->id.us--;
@ -126,9 +122,6 @@ World *copy_world(World *wrld)
} }
if (wrld->preview) wrldn->preview = BKE_previewimg_copy(wrld->preview); if (wrld->preview) wrldn->preview = BKE_previewimg_copy(wrld->preview);
#ifndef DISABLE_PYTHON
BPY_copy_scriptlink(&wrld->scriptlink);
#endif
#if 0 // XXX old animation system #if 0 // XXX old animation system
id_us_plus((ID *)wrldn->ipo); id_us_plus((ID *)wrldn->ipo);

@ -1565,33 +1565,6 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p
return prv; return prv;
} }
/* ************ READ SCRIPTLINK *************** */
static void lib_link_scriptlink(FileData *fd, ID *id, ScriptLink *slink)
{
int i;
for(i=0; i<slink->totscript; i++) {
slink->scripts[i]= newlibadr(fd, id->lib, slink->scripts[i]);
}
}
static void direct_link_scriptlink(FileData *fd, ScriptLink *slink)
{
slink->scripts= newdataadr(fd, slink->scripts);
test_pointer_array(fd, (void **)&slink->scripts);
slink->flag= newdataadr(fd, slink->flag);
if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
int a;
for(a=0; a<slink->totscript; a++) {
SWITCH_SHORT(slink->flag[a]);
}
}
}
/* ************ READ ANIMATION STUFF ***************** */ /* ************ READ ANIMATION STUFF ***************** */
/* Legacy Data Support (for Version Patching) ----------------------------- */ /* Legacy Data Support (for Version Patching) ----------------------------- */
@ -2367,8 +2340,6 @@ static void lib_link_camera(FileData *fd, Main *main)
ca->dof_ob= newlibadr_us(fd, ca->id.lib, ca->dof_ob); ca->dof_ob= newlibadr_us(fd, ca->id.lib, ca->dof_ob);
lib_link_scriptlink(fd, &ca->id, &ca->scriptlink);
ca->id.flag -= LIB_NEEDLINK; ca->id.flag -= LIB_NEEDLINK;
} }
ca= ca->id.next; ca= ca->id.next;
@ -2379,8 +2350,6 @@ static void direct_link_camera(FileData *fd, Camera *ca)
{ {
ca->adt= newdataadr(fd, ca->adt); ca->adt= newdataadr(fd, ca->adt);
direct_link_animdata(fd, ca->adt); direct_link_animdata(fd, ca->adt);
direct_link_scriptlink(fd, &ca->scriptlink);
} }
@ -2407,8 +2376,6 @@ static void lib_link_lamp(FileData *fd, Main *main)
la->ipo= newlibadr_us(fd, la->id.lib, la->ipo); // XXX depreceated - old animation system la->ipo= newlibadr_us(fd, la->id.lib, la->ipo); // XXX depreceated - old animation system
lib_link_scriptlink(fd, &la->id, &la->scriptlink);
la->id.flag -= LIB_NEEDLINK; la->id.flag -= LIB_NEEDLINK;
} }
la= la->id.next; la= la->id.next;
@ -2421,8 +2388,6 @@ static void direct_link_lamp(FileData *fd, Lamp *la)
la->adt= newdataadr(fd, la->adt); la->adt= newdataadr(fd, la->adt);
direct_link_animdata(fd, la->adt); direct_link_animdata(fd, la->adt);
direct_link_scriptlink(fd, &la->scriptlink);
for(a=0; a<MAX_MTEX; a++) { for(a=0; a<MAX_MTEX; a++) {
la->mtex[a]= newdataadr(fd, la->mtex[a]); la->mtex[a]= newdataadr(fd, la->mtex[a]);
@ -2568,8 +2533,6 @@ static void lib_link_world(FileData *fd, Main *main)
} }
} }
lib_link_scriptlink(fd, &wrld->id, &wrld->scriptlink);
wrld->id.flag -= LIB_NEEDLINK; wrld->id.flag -= LIB_NEEDLINK;
} }
wrld= wrld->id.next; wrld= wrld->id.next;
@ -2582,8 +2545,6 @@ static void direct_link_world(FileData *fd, World *wrld)
wrld->adt= newdataadr(fd, wrld->adt); wrld->adt= newdataadr(fd, wrld->adt);
direct_link_animdata(fd, wrld->adt); direct_link_animdata(fd, wrld->adt);
direct_link_scriptlink(fd, &wrld->scriptlink);
for(a=0; a<MAX_MTEX; a++) { for(a=0; a<MAX_MTEX; a++) {
wrld->mtex[a]= newdataadr(fd, wrld->mtex[a]); wrld->mtex[a]= newdataadr(fd, wrld->mtex[a]);
@ -2921,7 +2882,6 @@ static void lib_link_material(FileData *fd, Main *main)
mtex->object= newlibadr(fd, ma->id.lib, mtex->object); mtex->object= newlibadr(fd, ma->id.lib, mtex->object);
} }
} }
lib_link_scriptlink(fd, &ma->id, &ma->scriptlink);
if(ma->nodetree) if(ma->nodetree)
lib_link_ntree(fd, &ma->id, ma->nodetree); lib_link_ntree(fd, &ma->id, ma->nodetree);
@ -2946,8 +2906,6 @@ static void direct_link_material(FileData *fd, Material *ma)
ma->ramp_col= newdataadr(fd, ma->ramp_col); ma->ramp_col= newdataadr(fd, ma->ramp_col);
ma->ramp_spec= newdataadr(fd, ma->ramp_spec); ma->ramp_spec= newdataadr(fd, ma->ramp_spec);
direct_link_scriptlink(fd, &ma->scriptlink);
ma->nodetree= newdataadr(fd, ma->nodetree); ma->nodetree= newdataadr(fd, ma->nodetree);
if(ma->nodetree) if(ma->nodetree)
direct_link_nodetree(fd, ma->nodetree); direct_link_nodetree(fd, ma->nodetree);
@ -3585,7 +3543,6 @@ static void lib_link_object(FileData *fd, Main *main)
if(ob->pd->tex) if(ob->pd->tex)
ob->pd->tex=newlibadr_us(fd, ob->id.lib, ob->pd->tex); ob->pd->tex=newlibadr_us(fd, ob->id.lib, ob->pd->tex);
lib_link_scriptlink(fd, &ob->id, &ob->scriptlink);
lib_link_particlesystems(fd, ob, &ob->id, &ob->particlesystem); lib_link_particlesystems(fd, ob, &ob->id, &ob->particlesystem);
lib_link_modifiers(fd, ob); lib_link_modifiers(fd, ob);
} }
@ -3785,8 +3742,6 @@ static void direct_link_object(FileData *fd, Object *ob)
link_list(fd, &ob->constraintChannels); link_list(fd, &ob->constraintChannels);
// >>> XXX depreceated - old animation system // >>> XXX depreceated - old animation system
direct_link_scriptlink(fd, &ob->scriptlink);
ob->mat= newdataadr(fd, ob->mat); ob->mat= newdataadr(fd, ob->mat);
test_pointer_array(fd, (void **)&ob->mat); test_pointer_array(fd, (void **)&ob->mat);
ob->matbits= newdataadr(fd, ob->matbits); ob->matbits= newdataadr(fd, ob->matbits);
@ -4039,8 +3994,6 @@ static void lib_link_scene(FileData *fd, Main *main)
} }
SEQ_END SEQ_END
lib_link_scriptlink(fd, &sce->id, &sce->scriptlink);
if(sce->nodetree) { if(sce->nodetree) {
lib_link_ntree(fd, &sce->id, sce->nodetree); lib_link_ntree(fd, &sce->id, sce->nodetree);
composite_patch(sce->nodetree, sce); composite_patch(sce->nodetree, sce);
@ -4216,8 +4169,6 @@ static void direct_link_scene(FileData *fd, Scene *sce)
} }
} }
} }
direct_link_scriptlink(fd, &sce->scriptlink);
sce->r.avicodecdata = newdataadr(fd, sce->r.avicodecdata); sce->r.avicodecdata = newdataadr(fd, sce->r.avicodecdata);
if (sce->r.avicodecdata) { if (sce->r.avicodecdata) {
@ -4372,9 +4323,6 @@ static void lib_link_screen(FileData *fd, Main *main)
sa->full= newlibadr(fd, sc->id.lib, sa->full); sa->full= newlibadr(fd, sc->id.lib, sa->full);
/* space handler scriptlinks */
lib_link_scriptlink(fd, &sc->id, &sa->scriptlink);
for (sl= sa->spacedata.first; sl; sl= sl->next) { for (sl= sa->spacedata.first; sl; sl= sl->next) {
if(sl->spacetype==SPACE_VIEW3D) { if(sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl; View3D *v3d= (View3D*) sl;
@ -4553,16 +4501,6 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
while(sa) { while(sa) {
SpaceLink *sl; SpaceLink *sl;
if (sa->scriptlink.totscript) {
/* restore screen area script links */
ScriptLink *slink = &sa->scriptlink;
int script_idx;
for (script_idx = 0; script_idx < slink->totscript; script_idx++) {
slink->scripts[script_idx] = restore_pointer_by_name(newmain,
(ID *)slink->scripts[script_idx], 1);
}
}
for (sl= sa->spacedata.first; sl; sl= sl->next) { for (sl= sa->spacedata.first; sl; sl= sl->next) {
if(sl->spacetype==SPACE_VIEW3D) { if(sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl; View3D *v3d= (View3D*) sl;
@ -4939,9 +4877,6 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
sa->v2= newdataadr(fd, sa->v2); sa->v2= newdataadr(fd, sa->v2);
sa->v3= newdataadr(fd, sa->v3); sa->v3= newdataadr(fd, sa->v3);
sa->v4= newdataadr(fd, sa->v4); sa->v4= newdataadr(fd, sa->v4);
/* space handler scriptlinks */
direct_link_scriptlink(fd, &sa->scriptlink);
} }
} }
@ -10200,15 +10135,6 @@ static void expand_modifier(FileData *fd, Main *mainvar, ModifierData *md)
} }
} }
static void expand_scriptlink(FileData *fd, Main *mainvar, ScriptLink *slink)
{
int i;
for(i=0; i<slink->totscript; i++) {
expand_doit(fd, mainvar, slink->scripts[i]);
}
}
static void expand_object(FileData *fd, Main *mainvar, Object *ob) static void expand_object(FileData *fd, Main *mainvar, Object *ob)
{ {
ModifierData *md; ModifierData *md;
@ -10336,7 +10262,6 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
if(ob->pd && ob->pd->tex) if(ob->pd && ob->pd->tex)
expand_doit(fd, mainvar, ob->pd->tex); expand_doit(fd, mainvar, ob->pd->tex);
expand_scriptlink(fd, mainvar, &ob->scriptlink);
} }
static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)

@ -498,12 +498,6 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
writestruct(wd, DATA, "bNodeLink", 1, link); writestruct(wd, DATA, "bNodeLink", 1, link);
} }
static void write_scriptlink(WriteData *wd, ScriptLink *slink)
{
writedata(wd, DATA, sizeof(void *)*slink->totscript, slink->scripts);
writedata(wd, DATA, sizeof(short)*slink->totscript, slink->flag);
}
static void current_screen_compat(Main *mainvar, bScreen **screen) static void current_screen_compat(Main *mainvar, bScreen **screen)
{ {
wmWindowManager *wm; wmWindowManager *wm;
@ -1183,7 +1177,6 @@ static void write_objects(WriteData *wd, ListBase *idbase, int write_undo)
write_sensors(wd, &ob->sensors); write_sensors(wd, &ob->sensors);
write_controllers(wd, &ob->controllers); write_controllers(wd, &ob->controllers);
write_actuators(wd, &ob->actuators); write_actuators(wd, &ob->actuators);
write_scriptlink(wd, &ob->scriptlink);
write_pose(wd, ob->pose); write_pose(wd, ob->pose);
write_defgroups(wd, &ob->defbase); write_defgroups(wd, &ob->defbase);
write_constraints(wd, &ob->constraints); write_constraints(wd, &ob->constraints);
@ -1271,9 +1264,6 @@ static void write_cameras(WriteData *wd, ListBase *idbase)
if (cam->id.properties) IDP_WriteProperty(cam->id.properties, wd); if (cam->id.properties) IDP_WriteProperty(cam->id.properties, wd);
if (cam->adt) write_animdata(wd, cam->adt); if (cam->adt) write_animdata(wd, cam->adt);
/* direct data */
write_scriptlink(wd, &cam->scriptlink);
} }
cam= cam->id.next; cam= cam->id.next;
@ -1601,8 +1591,6 @@ static void write_materials(WriteData *wd, ListBase *idbase)
if(ma->ramp_col) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_col); if(ma->ramp_col) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_col);
if(ma->ramp_spec) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_spec); if(ma->ramp_spec) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_spec);
write_scriptlink(wd, &ma->scriptlink);
/* nodetree is integral part of material, no libdata */ /* nodetree is integral part of material, no libdata */
if(ma->nodetree) { if(ma->nodetree) {
writestruct(wd, DATA, "bNodeTree", 1, ma->nodetree); writestruct(wd, DATA, "bNodeTree", 1, ma->nodetree);
@ -1633,8 +1621,6 @@ static void write_worlds(WriteData *wd, ListBase *idbase)
if(wrld->mtex[a]) writestruct(wd, DATA, "MTex", 1, wrld->mtex[a]); if(wrld->mtex[a]) writestruct(wd, DATA, "MTex", 1, wrld->mtex[a]);
} }
write_scriptlink(wd, &wrld->scriptlink);
write_previews(wd, wrld->preview); write_previews(wd, wrld->preview);
} }
wrld= wrld->id.next; wrld= wrld->id.next;
@ -1663,8 +1649,6 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
if(la->curfalloff) if(la->curfalloff)
write_curvemapping(wd, la->curfalloff); write_curvemapping(wd, la->curfalloff);
write_scriptlink(wd, &la->scriptlink);
write_previews(wd, la->preview); write_previews(wd, la->preview);
} }
@ -1776,8 +1760,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
} }
} }
write_scriptlink(wd, &sce->scriptlink);
if (sce->r.avicodecdata) { if (sce->r.avicodecdata) {
writestruct(wd, DATA, "AviCodecData", 1, sce->r.avicodecdata); writestruct(wd, DATA, "AviCodecData", 1, sce->r.avicodecdata);
if (sce->r.avicodecdata->lpFormat) writedata(wd, DATA, sce->r.avicodecdata->cbFormat, sce->r.avicodecdata->lpFormat); if (sce->r.avicodecdata->lpFormat) writedata(wd, DATA, sce->r.avicodecdata->cbFormat, sce->r.avicodecdata->lpFormat);
@ -1919,9 +1901,6 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
writestruct(wd, DATA, "Panel", 1, pa); writestruct(wd, DATA, "Panel", 1, pa);
} }
/* space handler scriptlinks */
write_scriptlink(wd, &sa->scriptlink);
sl= sa->spacedata.first; sl= sa->spacedata.first;
while(sl) { while(sl) {
for(ar= sl->regionbase.first; ar; ar= ar->next) for(ar= sl->regionbase.first; ar; ar= ar->next)

@ -910,13 +910,6 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
ARegion *newar= BKE_area_region_copy(st, ar); ARegion *newar= BKE_area_region_copy(st, ar);
BLI_addtail(&sa1->regionbase, newar); BLI_addtail(&sa1->regionbase, newar);
} }
#ifndef DISABLE_PYTHON
/* scripts */
BPY_free_scriptlink(&sa1->scriptlink);
sa1->scriptlink= sa2->scriptlink;
BPY_copy_scriptlink(&sa1->scriptlink); /* copies internal pointers */
#endif
} }
/* *********** Space switching code *********** */ /* *********** Space switching code *********** */

@ -465,7 +465,6 @@ static void screen_copy(bScreen *to, bScreen *from)
sa->spacedata.first= sa->spacedata.last= NULL; sa->spacedata.first= sa->spacedata.last= NULL;
sa->regionbase.first= sa->regionbase.last= NULL; sa->regionbase.first= sa->regionbase.last= NULL;
sa->actionzones.first= sa->actionzones.last= NULL; sa->actionzones.first= sa->actionzones.last= NULL;
sa->scriptlink.totscript= 0;
area_copy_data(sa, saf, 0); area_copy_data(sa, saf, 0);
} }

@ -552,16 +552,6 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s
} }
outliner_add_element(soops, lb, sce->world, te, 0, 0); outliner_add_element(soops, lb, sce->world, te, 0, 0);
if(sce->scriptlink.scripts) {
int a= 0;
tenla= outliner_add_element(soops, lb, sce, te, TSE_SCRIPT_BASE, 0);
tenla->name= "Scripts";
for (a=0; a<sce->scriptlink.totscript; a++) {
outliner_add_element(soops, &tenla->subtree, sce->scriptlink.scripts[a], tenla, 0, 0);
}
}
} }
static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv,
@ -768,15 +758,6 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
ten->directdata= defgroup; ten->directdata= defgroup;
} }
} }
if(ob->scriptlink.scripts) {
TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_SCRIPT_BASE, 0);
int a= 0;
tenla->name= "Scripts";
for (a=0; a<ob->scriptlink.totscript; a++) { /* ** */
outliner_add_element(soops, &tenla->subtree, ob->scriptlink.scripts[a], te, 0, 0);
}
}
if(ob->dup_group) if(ob->dup_group)
outliner_add_element(soops, &te->subtree, ob->dup_group, te, 0, 0); outliner_add_element(soops, &te->subtree, ob->dup_group, te, 0, 0);

@ -280,17 +280,10 @@ static void text_unlink(Main *bmain, Text *text)
* disabled it will leave invalid pointers in files! */ * disabled it will leave invalid pointers in files! */
#ifndef DISABLE_PYTHON #ifndef DISABLE_PYTHON
// XXX BPY_clear_bad_scriptlinks(text);
// XXX BPY_free_pyconstraint_links(text); // XXX BPY_free_pyconstraint_links(text);
// XXX free_text_controllers(text); // XXX free_text_controllers(text);
// XXX free_dome_warp_text(text); // XXX free_dome_warp_text(text);
/* check if this text was used as script link:
* this check function unsets the pointers and returns how many
* script links used this Text */
if(0) // XXX BPY_text_check_all_scriptlinks (text))
; // XXX notifier: allqueue(REDRAWBUTSSCRIPT, 0);
/* equivalently for pynodes: */ /* equivalently for pynodes: */
if(0) // XXX nodeDynamicUnlinkText ((ID*)text)) if(0) // XXX nodeDynamicUnlinkText ((ID*)text))
; // XXX notifier: allqueue(REDRAWNODE, 0); ; // XXX notifier: allqueue(REDRAWNODE, 0);

@ -2085,10 +2085,6 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
// addafterqueue(ar->win, BACKBUFDRAW, 1); // addafterqueue(ar->win, BACKBUFDRAW, 1);
//} //}
} }
#ifndef DISABLE_PYTHON
/* XXX here was scriptlink */
#endif
} }

@ -32,7 +32,6 @@
#define DNA_CAMERA_TYPES_H #define DNA_CAMERA_TYPES_H
#include "DNA_ID.h" #include "DNA_ID.h"
#include "DNA_scriptlink_types.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -61,7 +60,6 @@ typedef struct Camera {
struct Ipo *ipo; // XXX depreceated... old animation system struct Ipo *ipo; // XXX depreceated... old animation system
ScriptLink scriptlink;
struct Object *dof_ob; struct Object *dof_ob;
} Camera; } Camera;

@ -32,7 +32,6 @@
#define DNA_LAMP_TYPES_H #define DNA_LAMP_TYPES_H
#include "DNA_ID.h" #include "DNA_ID.h"
#include "DNA_scriptlink_types.h"
#ifndef MAX_MTEX #ifndef MAX_MTEX
#define MAX_MTEX 18 #define MAX_MTEX 18
@ -110,8 +109,6 @@ typedef struct Lamp {
/* preview */ /* preview */
struct PreviewImage *preview; struct PreviewImage *preview;
ScriptLink scriptlink;
} Lamp; } Lamp;
/* **************** LAMP ********************* */ /* **************** LAMP ********************* */

@ -32,7 +32,6 @@
#define DNA_MATERIAL_TYPES_H #define DNA_MATERIAL_TYPES_H
#include "DNA_ID.h" #include "DNA_ID.h"
#include "DNA_scriptlink_types.h"
#include "DNA_listBase.h" #include "DNA_listBase.h"
#ifndef MAX_MTEX #ifndef MAX_MTEX
@ -134,8 +133,6 @@ typedef struct Material {
/* yafray: absorption color, dispersion parameters and material preset menu */ /* yafray: absorption color, dispersion parameters and material preset menu */
float YF_ar, YF_ag, YF_ab, YF_dscale, YF_dpwr; float YF_ar, YF_ag, YF_ab, YF_dscale, YF_dpwr;
int YF_dsmp, YF_preset, YF_djit; int YF_dsmp, YF_preset, YF_djit;
ScriptLink scriptlink;
ListBase gpumaterial; /* runtime */ ListBase gpumaterial; /* runtime */
} Material; } Material;

@ -35,7 +35,6 @@
#include "DNA_listBase.h" #include "DNA_listBase.h"
#include "DNA_ID.h" #include "DNA_ID.h"
#include "DNA_scriptlink_types.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -172,7 +171,6 @@ typedef struct Object {
float empty_drawsize; float empty_drawsize;
float dupfacesca; /* dupliface scale */ float dupfacesca; /* dupliface scale */
ScriptLink scriptlink;
ListBase prop; ListBase prop;
ListBase sensors; ListBase sensors;
ListBase controllers; ListBase controllers;

@ -36,7 +36,6 @@ extern "C" {
#include "DNA_brush_types.h" #include "DNA_brush_types.h"
#include "DNA_vec_types.h" #include "DNA_vec_types.h"
#include "DNA_listBase.h" #include "DNA_listBase.h"
#include "DNA_scriptlink_types.h"
#include "DNA_ID.h" #include "DNA_ID.h"
struct Object; struct Object;
@ -660,8 +659,6 @@ typedef struct Scene {
struct RenderData r; struct RenderData r;
struct AudioData audio; /* DEPRECATED 2.5 */ struct AudioData audio; /* DEPRECATED 2.5 */
ScriptLink scriptlink;
ListBase markers; ListBase markers;
ListBase transform_spaces; ListBase transform_spaces;

@ -31,7 +31,6 @@
#include "DNA_view2d_types.h" #include "DNA_view2d_types.h"
#include "DNA_vec_types.h" #include "DNA_vec_types.h"
#include "DNA_scriptlink_types.h"
#include "DNA_ID.h" #include "DNA_ID.h"
struct SpaceType; struct SpaceType;
@ -125,8 +124,6 @@ typedef struct ScrArea {
short pad; short pad;
short do_refresh; /* private, for spacetype refresh callback */ short do_refresh; /* private, for spacetype refresh callback */
short cursor, flag; short cursor, flag;
ScriptLink scriptlink;
struct SpaceType *type; /* callbacks for this space type */ struct SpaceType *type; /* callbacks for this space type */

@ -1,79 +0,0 @@
/**
* blenlib/DNA_object_types.h (mar-2001 nzc)
*
* Scriptlink is hard-coded in object for some reason.
*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef DNA_SCRIPTLINK_TYPES_H
#define DNA_SCRIPTLINK_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
struct ID;
typedef struct ScriptLink {
struct ID **scripts;
short *flag;
short actscript, totscript;
int pad;
} ScriptLink;
/* **************** SCRIPTLINKS ********************* */
#define SCRIPT_FRAMECHANGED 1
#define SCRIPT_ONLOAD 2
#define SCRIPT_REDRAW 4
#define SCRIPT_ONSAVE 8
#define SCRIPT_RENDER 16
/* POSTRENDER is not meant for the UI, it simply calls the
* RENDER script links for clean-up actions */
#define SCRIPT_POSTRENDER 32
#define SCRIPT_OBJECTUPDATE 64
#define SCRIPT_OBDATAUPDATE 128
/* **************** SPACE HANDLERS ********************* */
/* these are special scriptlinks that can be assigned to
* a given space in a given ScrArea to:
* - (EVENT type) handle events sent to that space;
* - (EVENT_ALL type): handle release events, too;
* - (DRAW type) draw on the space after its own drawing function finishes.
*/
#define SPACEHANDLER_VIEW3D_DRAW 1
#define SPACEHANDLER_VIEW3D_EVENT 2
#define SPACEHANDLER_VIEW3D_EVENT_ALL 3
#ifdef __cplusplus
}
#endif
#endif

@ -32,7 +32,6 @@
#define DNA_WORLD_TYPES_H #define DNA_WORLD_TYPES_H
#include "DNA_ID.h" #include "DNA_ID.h"
#include "DNA_scriptlink_types.h"
struct AnimData; struct AnimData;
struct Ipo; struct Ipo;
@ -124,8 +123,6 @@ typedef struct World {
/* previews */ /* previews */
struct PreviewImage *preview; struct PreviewImage *preview;
ScriptLink scriptlink;
} World; } World;
/* **************** WORLD ********************* */ /* **************** WORLD ********************* */

@ -76,7 +76,6 @@ char *includefiles[] = {
"DNA_ID.h", "DNA_ID.h",
"DNA_ipo_types.h", "DNA_ipo_types.h",
"DNA_key_types.h", "DNA_key_types.h",
"DNA_scriptlink_types.h",
"DNA_text_types.h", "DNA_text_types.h",
"DNA_packedFile_types.h", "DNA_packedFile_types.h",
"DNA_camera_types.h", "DNA_camera_types.h",
@ -1105,7 +1104,6 @@ int main(int argc, char ** argv)
#include "DNA_ID.h" #include "DNA_ID.h"
#include "DNA_ipo_types.h" #include "DNA_ipo_types.h"
#include "DNA_key_types.h" #include "DNA_key_types.h"
#include "DNA_scriptlink_types.h"
#include "DNA_text_types.h" #include "DNA_text_types.h"
#include "DNA_packedFile_types.h" #include "DNA_packedFile_types.h"
#include "DNA_camera_types.h" #include "DNA_camera_types.h"

@ -338,7 +338,6 @@ extern StructRNA RNA_SceneRenderData;
extern StructRNA RNA_SceneRenderLayer; extern StructRNA RNA_SceneRenderLayer;
extern StructRNA RNA_SceneSequence; extern StructRNA RNA_SceneSequence;
extern StructRNA RNA_Screen; extern StructRNA RNA_Screen;
extern StructRNA RNA_ScriptLink;
extern StructRNA RNA_Sculpt; extern StructRNA RNA_Sculpt;
extern StructRNA RNA_Sensor; extern StructRNA RNA_Sensor;
extern StructRNA RNA_Sequence; extern StructRNA RNA_Sequence;

@ -1938,7 +1938,6 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_render.c", NULL, RNA_def_render}, {"rna_render.c", NULL, RNA_def_render},
{"rna_scene.c", NULL, RNA_def_scene}, {"rna_scene.c", NULL, RNA_def_scene},
{"rna_screen.c", NULL, RNA_def_screen}, {"rna_screen.c", NULL, RNA_def_screen},
{"rna_scriptlink.c", NULL, RNA_def_scriptlink},
{"rna_sensor.c", NULL, RNA_def_sensor}, {"rna_sensor.c", NULL, RNA_def_sensor},
{"rna_sequence.c", NULL, RNA_def_sequence}, {"rna_sequence.c", NULL, RNA_def_sequence},
{"rna_space.c", NULL, RNA_def_space}, {"rna_space.c", NULL, RNA_def_space},

@ -151,7 +151,6 @@ void RNA_def_render(struct BlenderRNA *brna);
void RNA_def_rna(struct BlenderRNA *brna); void RNA_def_rna(struct BlenderRNA *brna);
void RNA_def_scene(struct BlenderRNA *brna); void RNA_def_scene(struct BlenderRNA *brna);
void RNA_def_screen(struct BlenderRNA *brna); void RNA_def_screen(struct BlenderRNA *brna);
void RNA_def_scriptlink(struct BlenderRNA *brna);
void RNA_def_sensor(struct BlenderRNA *brna); void RNA_def_sensor(struct BlenderRNA *brna);
void RNA_def_sequence(struct BlenderRNA *brna); void RNA_def_sequence(struct BlenderRNA *brna);
void RNA_def_space(struct BlenderRNA *brna); void RNA_def_space(struct BlenderRNA *brna);

@ -350,12 +350,6 @@ static void rna_def_lamp(BlenderRNA *brna)
/* textures */ /* textures */
rna_def_mtex_common(srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get", "rna_Lamp_active_texture_index_set", "LampTextureSlot"); rna_def_mtex_common(srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get", "rna_Lamp_active_texture_index_set", "LampTextureSlot");
/* script link */
prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "scriptlink");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this lamp.");
} }
static void rna_def_lamp_falloff(StructRNA *srna) static void rna_def_lamp_falloff(StructRNA *srna)

@ -1242,11 +1242,6 @@ void RNA_def_material(BlenderRNA *brna)
/* common */ /* common */
rna_def_animdata_common(srna); rna_def_animdata_common(srna);
rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get", "rna_Material_active_texture_index_set", "MaterialTextureSlot"); rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get", "rna_Material_active_texture_index_set", "MaterialTextureSlot");
prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "scriptlink");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this material.");
rna_def_material_colors(srna); rna_def_material_colors(srna);
rna_def_material_diffuse(srna); rna_def_material_diffuse(srna);

@ -1309,12 +1309,6 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parents time offset value"); RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parents time offset value");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update");
/* script link */
prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "scriptlink");
RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this object.");
/* drawing */ /* drawing */
prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE); prop= RNA_def_property(srna, "max_draw_type", PROP_ENUM, PROP_NONE);

@ -1,48 +0,0 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contributor(s): Blender Foundation (2008).
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <stdlib.h>
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"
#include "DNA_scriptlink_types.h"
#ifdef RNA_RUNTIME
#else
void RNA_def_scriptlink(BlenderRNA *brna)
{
StructRNA *srna;
srna= RNA_def_struct(brna, "ScriptLink", NULL);
RNA_def_struct_ui_text(srna, "Script Link", "Scripts linked to a datablock, to be executed on changes to the datablock.");
RNA_def_struct_ui_icon(srna, ICON_PYTHON);
}
#endif

@ -470,10 +470,6 @@ void RNA_def_world(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL); RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL);
RNA_def_property_ui_text(prop, "Stars", "World stars settings."); RNA_def_property_ui_text(prop, "Stars", "World stars settings.");
prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "scriptlink");
RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this object.");
rna_def_ambient_occlusion(brna); rna_def_ambient_occlusion(brna);
rna_def_world_mist(brna); rna_def_world_mist(brna);
rna_def_world_stars(brna); rna_def_world_stars(brna);

@ -37,7 +37,6 @@ struct Text; /* defined in DNA_text_types.h */
struct ID; /* DNA_ID.h */ struct ID; /* DNA_ID.h */
struct Object; /* DNA_object_types.h */ struct Object; /* DNA_object_types.h */
struct ChannelDriver; /* DNA_anim_types.h */ struct ChannelDriver; /* DNA_anim_types.h */
struct ScriptLink; /* DNA_scriptlink_types.h */
struct ListBase; /* DNA_listBase.h */ struct ListBase; /* DNA_listBase.h */
struct SpaceText; /* DNA_space_types.h */ struct SpaceText; /* DNA_space_types.h */
struct SpaceScript; /* DNA_space_types.h */ struct SpaceScript; /* DNA_space_types.h */
@ -110,13 +109,7 @@ extern "C" {
int BPY_run_script(struct Script *script); int BPY_run_script(struct Script *script);
void BPY_free_compiled_text( struct Text *text ); void BPY_free_compiled_text( struct Text *text );
void BPY_clear_bad_scriptlinks( struct Text *byebye );
int BPY_has_onload_script( void ); int BPY_has_onload_script( void );
void BPY_do_all_scripts( short event, short anim );
int BPY_check_all_scriptlinks( struct Text *text );
void BPY_do_pyscript( struct ID *id, short event );
void BPY_free_scriptlink( struct ScriptLink *slink );
void BPY_copy_scriptlink( struct ScriptLink *scriptlink );
int BPY_is_spacehandler(struct Text *text, char spacetype); int BPY_is_spacehandler(struct Text *text, char spacetype);
int BPY_del_spacehandler(struct Text *text, struct ScrArea *sa); int BPY_del_spacehandler(struct Text *text, struct ScrArea *sa);
@ -145,8 +138,6 @@ extern "C" {
void BPY_DECREF(void *pyob_ptr); /* Py_DECREF() */ void BPY_DECREF(void *pyob_ptr); /* Py_DECREF() */
/* void BPY_Err_Handle(struct Text *text); */ /* void BPY_Err_Handle(struct Text *text); */
/* void BPY_clear_bad_scriptlink(struct ID *id, struct Text *byebye); */
/* void BPY_clear_bad_scriptlist(struct ListBase *, struct Text *byebye); */
/* int BPY_spacetext_is_pywin(struct SpaceText *st); */ /* int BPY_spacetext_is_pywin(struct SpaceText *st); */
#ifdef __cplusplus #ifdef __cplusplus

@ -1,73 +0,0 @@
/**
* $Id:
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2008 Blender Foundation.
* All rights reserved.
*
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_lamp_types.h"
#include "DNA_camera_types.h"
#include "DNA_world_types.h"
#include "DNA_scene_types.h"
#include "DNA_material_types.h"
#include "BLI_blenlib.h"
#include "BKE_blender.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
/* only copies internal pointers, scriptlink usually is integral part of a struct */
void BPY_copy_scriptlink( struct ScriptLink *scriptlink )
{
if( scriptlink->totscript ) {
scriptlink->scripts = MEM_dupallocN(scriptlink->scripts);
scriptlink->flag = MEM_dupallocN(scriptlink->flag);
}
return;
}
/* not free slink itself */
void BPY_free_scriptlink( struct ScriptLink *slink )
{
if( slink->totscript ) {
if( slink->flag ) {
MEM_freeN( slink->flag );
slink->flag= NULL;
}
if( slink->scripts ) {
MEM_freeN( slink->scripts );
slink->scripts= NULL;
}
}
return;
}

@ -30,9 +30,7 @@
void BPY_post_start_python() {} void BPY_post_start_python() {}
//void BPY_run_python_script() {} //void BPY_run_python_script() {}
//void BPY_start_python() {} //void BPY_start_python() {}
void BPY_do_all_scripts() {}
void BPY_call_importloader() {} void BPY_call_importloader() {}
void BPY_do_pyscript() {}
void BPY_clear_script() {} void BPY_clear_script() {}
//void BPY_free_compiled_text() {} //void BPY_free_compiled_text() {}
void BPY_pyconstraint_eval() {} void BPY_pyconstraint_eval() {}

@ -554,8 +554,6 @@ void WM_write_file(bContext *C, char *target, ReportList *reports)
} }
/* send the OnSave event */ /* send the OnSave event */
// XXX if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript(&CTX_data_scene(C)->id, SCRIPT_ONSAVE);
for (li= G.main->library.first; li; li= li->id.next) { for (li= G.main->library.first; li; li= li->id.next) {
if (BLI_streq(li->name, target)) { if (BLI_streq(li->name, target)) {
BKE_report(reports, RPT_ERROR, "Cannot overwrite used library"); BKE_report(reports, RPT_ERROR, "Cannot overwrite used library");