merge with 2.5 (not trunk, last merge message said that on accident) at r22252
[blender.git] / source / blender / blenloader / intern / writefile.c
index d0d0d1a262e45700a8e2f970ba65da069e64382f..f94d81f1f6ed4e61df67f9cf6f151c3f4723d170 100644 (file)
@@ -130,6 +130,7 @@ Any case: direct data is ALWAYS after the lib block
 #include "DNA_sdna_types.h"
 #include "DNA_sequence_types.h"
 #include "DNA_sensor_types.h"
+#include "DNA_smoke_types.h"
 #include "DNA_space_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_sound_types.h"
@@ -498,12 +499,6 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree)
                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)
 {
        wmWindowManager *wm;
@@ -1122,6 +1117,18 @@ static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo)
                        writestruct(wd, DATA, "ClothCollSettings", 1, clmd->coll_parms);
                        write_pointcaches(wd, clmd->point_cache, PTCACHE_WRITE_CLOTH);
                } 
+               else if(md->type==eModifierType_Smoke) {
+                       SmokeModifierData *smd = (SmokeModifierData*) md;
+                       
+                       if(smd->type==MOD_SMOKE_TYPE_DOMAIN)
+                               writestruct(wd, DATA, "SmokeDomainSettings", 1, smd->domain);
+                       else if(smd->type==MOD_SMOKE_TYPE_FLOW)
+                               writestruct(wd, DATA, "SmokeFlowSettings", 1, smd->flow);
+                       /*
+                       else if(smd->type==MOD_SMOKE_TYPE_COLL)
+                               writestruct(wd, DATA, "SmokeCollSettings", 1, smd->coll);
+                       */
+               } 
                else if(md->type==eModifierType_Fluidsim) {
                        FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
                        
@@ -1183,7 +1190,6 @@ static void write_objects(WriteData *wd, ListBase *idbase, int write_undo)
                        write_sensors(wd, &ob->sensors);
                        write_controllers(wd, &ob->controllers);
                        write_actuators(wd, &ob->actuators);
-                       write_scriptlink(wd, &ob->scriptlink);
                        write_pose(wd, ob->pose);
                        write_defgroups(wd, &ob->defbase);
                        write_constraints(wd, &ob->constraints);
@@ -1271,9 +1277,6 @@ static void write_cameras(WriteData *wd, ListBase *idbase)
                        if (cam->id.properties) IDP_WriteProperty(cam->id.properties, wd);
                        
                        if (cam->adt) write_animdata(wd, cam->adt);
-                       
-                       /* direct data */
-                       write_scriptlink(wd, &cam->scriptlink);
                }
 
                cam= cam->id.next;
@@ -1294,6 +1297,7 @@ static void write_mballs(WriteData *wd, ListBase *idbase)
 
                        /* direct data */
                        writedata(wd, DATA, sizeof(void *)*mb->totcol, mb->mat);
+                       if (mb->adt) write_animdata(wd, mb->adt);
 
                        ml= mb->elems.first;
                        while(ml) {
@@ -1603,8 +1607,6 @@ static void write_materials(WriteData *wd, ListBase *idbase)
                        if(ma->ramp_col) writestruct(wd, DATA, "ColorBand", 1, ma->ramp_col);
                        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 */
                        if(ma->nodetree) {
                                writestruct(wd, DATA, "bNodeTree", 1, ma->nodetree);
@@ -1635,8 +1637,6 @@ static void write_worlds(WriteData *wd, ListBase *idbase)
                                if(wrld->mtex[a]) writestruct(wd, DATA, "MTex", 1, wrld->mtex[a]);
                        }
                        
-                       write_scriptlink(wd, &wrld->scriptlink);
-                       
                        write_previews(wd, wrld->preview);
                }
                wrld= wrld->id.next;
@@ -1665,8 +1665,6 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
                        if(la->curfalloff)
                                write_curvemapping(wd, la->curfalloff); 
                        
-                       write_scriptlink(wd, &la->scriptlink);
-                       
                        write_previews(wd, la->preview);
                        
                }
@@ -1778,8 +1776,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
                        }
                }
                
-               write_scriptlink(wd, &sce->scriptlink);
-               
                if (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);
@@ -1921,9 +1917,6 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
                                        writestruct(wd, DATA, "Panel", 1, pa);
                        }
                        
-                       /* space handler scriptlinks */
-                       write_scriptlink(wd, &sa->scriptlink);
-                       
                        sl= sa->spacedata.first;
                        while(sl) {
                                for(ar= sl->regionbase.first; ar; ar= ar->next)