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:
authorJoshua Leung <aligorith@gmail.com>2010-04-05 10:52:27 +0400
committerJoshua Leung <aligorith@gmail.com>2010-04-05 10:52:27 +0400
commit747b98582482bb447cad03bc9ffc52a1c50440e2 (patch)
treea57c9363ea961a4d7adf49f9abd5802fc5c3b648 /source/blender/blenloader
parent547838476109b909259a7608e4c092214da91387 (diff)
Bugfixes for Grease Pencil and the Image Editor (includes fix for #20921):
* Fixed crash with when/after undoing Grease Pencil sketches in the Image Editor. To get this working, I've had to sacrifice the backwards-compat loading for old .blend files from 2.49 which were using the same pointer as the new data (local data vs datablock data). If anyone has any ingenious hacks to fix this, go ahead, but otherwise, some caution is advised here... * Grease Pencil block used for Image Editor instances can now be changed * Enabled proper active polls on the advanced 3D-view projection methods for drawing. These are not valid in views other than the 3D-View, and so should not be shown as available for use elsewhere (though may still be shown just so that users know what mode an 'imported' datablock may be using). * Enabled proper updates for Grease Pencil editing in the Image Editor. Was missing notifiers for this stuff. * When drawing in the Image Editor with no image active, the system now (quietly) switches to using screen-space 'view' vs 'cursor' space for the strokes, since the previous behaviour was confusing with strokes disappearing after drawing them. IMO this is a much better option than the confusion that occurred before, even though it does change the user's settings under their feet!
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b23b0edb285..856b4eaa8ba 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4610,6 +4610,11 @@ static void lib_link_screen(FileData *fd, Main *main)
SpaceImage *sima= (SpaceImage *)sl;
sima->image= newlibadr_us(fd, sc->id.lib, sima->image);
+
+ /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
+ * so fingers crossed this works fine!
+ */
+ sima->gpd= newlibadr_us(fd, sc->id.lib, sima->gpd);
}
else if(sl->spacetype==SPACE_NLA){
SpaceNla *snla= (SpaceNla *)sl;
@@ -4824,6 +4829,11 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
SpaceImage *sima= (SpaceImage *)sl;
sima->image= restore_pointer_by_name(newmain, (ID *)sima->image, 1);
+
+ /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
+ * so assume that here we're doing for undo only...
+ */
+ sima->gpd= restore_pointer_by_name(newmain, (ID *)sima->gpd, 1);
}
else if(sl->spacetype==SPACE_NLA){
SpaceNla *snla= (SpaceNla *)sl;
@@ -5086,13 +5096,18 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
SpaceImage *sima= (SpaceImage *)sl;
sima->cumap= newdataadr(fd, sima->cumap);
- sima->gpd= newdataadr(fd, sima->gpd);
- if (sima->gpd)
- direct_link_gpencil(fd, sima->gpd);
if(sima->cumap)
direct_link_curvemapping(fd, sima->cumap);
+
sima->iuser.scene= NULL;
sima->iuser.ok= 1;
+
+ /* WARNING: gpencil data is no longer stored directly in sima after 2.5
+ * so sacrifice a few old files for now to avoid crashes with new files!
+ */
+ //sima->gpd= newdataadr(fd, sima->gpd);
+ //if (sima->gpd)
+ // direct_link_gpencil(fd, sima->gpd);
}
else if(sl->spacetype==SPACE_NODE) {
SpaceNode *snode= (SpaceNode *)sl;