More referenced library issues: if an Object loses the Armature (because
for example the linked file removed it) the Object still had the Pose and
posemode flag set, crashing Blender.
This commit is contained in:
Ton Roosendaal
2006-11-30 16:44:34 +00:00
parent 342c900220
commit 94da40a3d8
2 changed files with 9 additions and 0 deletions

View File

@@ -307,6 +307,8 @@ void set_scene_bg(Scene *sce)
flag= ob->flag & (OB_FROMGROUP);
base->flag |= flag;
/* not too nice... for recovering objects with lost data */
if(ob->pose==NULL) base->flag &= ~OB_POSEMODE;
ob->flag= base->flag;
ob->ctime= -1234567.0; /* force ipo to be calculated later */

View File

@@ -2613,6 +2613,13 @@ static void lib_link_object(FileData *fd, Main *main)
warn= 1;
if(ob->id.lib) printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name);
else printf("Object %s lost data. Lib:%x\n", ob->id.name+2, (unsigned int) ob->id.lib);
if(ob->pose) {
free_pose_channels(ob->pose);
MEM_freeN(ob->pose);
ob->pose= NULL;
ob->flag &= ~OB_POSEMODE;
}
}
for(a=0; a<ob->totcol; a++) ob->mat[a]= newlibadr_us(fd, ob->id.lib, ob->mat[a]);