예제 #1
0
/* ID should be not NULL */
void BKE_unpack_id(Main *bmain, ID *id, ReportList *reports, int how)
{
	switch (GS(id->name)) {
		case ID_IM:
		{
			Image *ima = (Image *)id;
			if (BKE_image_has_packedfile(ima)) {
				unpackImage(reports, ima, how);
			}
			break;
		}
		case ID_VF:
		{
			VFont *vf = (VFont *)id;
			if (vf->packedfile) {
				unpackVFont(reports, vf, how);
			}
			break;
		}
		case ID_SO:
		{
			bSound *snd = (bSound *)id;
			if (snd->packedfile) {
				unpackSound(bmain, reports, snd, how);
			}
			break;
		}
		case ID_LI:
		{
			Library *li = (Library *)id;
			BKE_reportf(reports, RPT_ERROR, "Cannot unpack individual Library file, '%s'", li->name);
			break;
		}
	}
}
예제 #2
0
void unpackAll(Main *bmain, ReportList *reports, int how)
{
	Image *ima;
	VFont *vf;
	bSound *sound;

	for (ima=bmain->image.first; ima; ima=ima->id.next)
		if (ima->packedfile)
			unpackImage(reports, ima, how);

	for (vf=bmain->vfont.first; vf; vf=vf->id.next)
		if (vf->packedfile)
			unpackVFont(reports, vf, how);

	for (sound=bmain->sound.first; sound; sound=sound->id.next)
		if (sound->packedfile)
			unpackSound(bmain, reports, sound, how);
}
예제 #3
0
/* ID should be not NULL */
void BKE_unpack_id(Main *bmain, ID *id, ReportList *reports, int how)
{
    if (GS(id->name) == ID_IM) {
        Image *ima = (Image *)id;
        if (ima->packedfile)
            unpackImage(reports, ima, how);
    }
    if (GS(id->name) == ID_VF) {
        VFont *vf = (VFont *)id;
        if (vf->packedfile)
            unpackVFont(reports, vf, how);
    }
    if (GS(id->name) == ID_SO) {
        bSound *snd = (bSound *)id;
        if (snd->packedfile)
            unpackSound(bmain, reports, snd, how);
    }
    if (GS(id->name) == ID_LI) {
        Library *li = (Library *)id;
        BKE_reportf(reports, RPT_ERROR, "Cannot unpack individual Library file, '%s'", li->name);
    }
}