Fix saving and loading of the template variable (it incorrectedly counted as a user).
authorMartin Poirier <theeth@yahoo.com>
Thu, 13 Nov 2008 18:57:10 +0000 (18:57 +0000)
committerMartin Poirier <theeth@yahoo.com>
Thu, 13 Nov 2008 18:57:10 +0000 (18:57 +0000)
source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c

index a25afeafaef5fb3edd115b3ff865439c82d6cecb..0b153c3c065a9b1ec4400d492a55cfcd7c1248bc 100644 (file)
@@ -521,6 +521,7 @@ void unlink_object(Object *ob)
        while(sce) {
                if(sce->id.lib==NULL) {
                        if(sce->camera==ob) sce->camera= NULL;
+                       if(sce->toolsettings->skgen_template==ob) sce->toolsettings->skgen_template = NULL;
                }
                sce= sce->id.next;
        }
index c3937dce0412f7fd2843734f44724b1c43f85a00..ea8db51a300cba7b2de8f433eaac71d9ea5e767b 100644 (file)
@@ -3460,7 +3460,7 @@ static void lib_link_scene(FileData *fd, Main *main)
                                newlibadr_us(fd, sce->id.lib, sce->toolsettings->imapaint.brush);
 
        
-                       sce->toolsettings->skgen_template = newlibadr_us(fd, sce->id.lib, sce->toolsettings->skgen_template);
+                       sce->toolsettings->skgen_template = newlibadr(fd, sce->id.lib, sce->toolsettings->skgen_template);
 
                        /* Sculptdata textures */
                        for(a=0; a<MAX_MTEX; ++a) {