Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c18
-rw-r--r--source/blender/blenloader/intern/writefile.c3
2 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 38240ceeafa..624bfedf6cd 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -112,6 +112,7 @@
#include "BKE_action.h"
#include "BKE_armature.h"
+#include "BKE_colortools.h"
#include "BKE_constraint.h"
#include "BKE_curve.h"
#include "BKE_customdata.h"
@@ -1917,6 +1918,11 @@ static void direct_link_lamp(FileData *fd, Lamp *la)
for(a=0; a<MAX_MTEX; a++) {
la->mtex[a]= newdataadr(fd, la->mtex[a]);
}
+
+ la->curfalloff= newdataadr(fd, la->curfalloff);
+ if(la->curfalloff)
+ direct_link_curvemapping(fd, la->curfalloff);
+
la->preview = direct_link_preview_image(fd, la->preview);
}
@@ -6670,6 +6676,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
+ if(main->versionfile <= 245) {
+ Lamp *la;
+ if (main->versionfile != 245 || main->subversionfile < 1) {
+ for(la=main->lamp.first; la; la= la->id.next) {
+ if (la->mode & LA_QUAD) la->falloff_type = LA_FALLOFF_SLIDERS;
+ else la->falloff_type = LA_FALLOFF_INVLINEAR;
+
+ la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
+ curvemapping_initialize(la->curfalloff);
+ }
+ }
+ }
if (main->versionfile <= 245) {
bScreen *sc;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 90873efb5b9..4f09f51bc87 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1380,6 +1380,9 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
if(la->mtex[a]) writestruct(wd, DATA, "MTex", 1, la->mtex[a]);
}
+ if(la->curfalloff)
+ write_curvemapping(wd, la->curfalloff);
+
write_scriptlink(wd, &la->scriptlink);
write_previews(wd, la->preview);