Exemple #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;
		}
	}
}
static void rna_Image_unpack(Image *image, ReportList *reports, int method)
{
	if (!image->packedfile) {
		BKE_report(reports, RPT_ERROR, "Image not packed");
	}
	else if (BKE_image_is_animated(image)) {
		BKE_report(reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
		return;
	}
	else {
		/* reports its own error on failure */
		unpackImage(reports, image, method);
	}
}
Exemple #3
0
static void rna_Image_unpack(Image *image, ReportList *reports, int method)
{
	if (!image->packedfile) {
		BKE_report(reports, RPT_ERROR, "Image not packed");
	}
	else if (image->source==IMA_SRC_SEQUENCE || image->source==IMA_SRC_MOVIE) {
		BKE_report(reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
		return;
	}
	else {
		/* reports its own error on failier */
		unpackImage (reports, image, method);
	}
}
Exemple #4
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);
}
Exemple #5
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);
    }
}