Image: remove fields option for image sequences
Remove support for loading interlaced image sequences because its less common now to record interlaced video, the option to de-interlace video on load remains.
This commit is contained in:
@@ -977,7 +977,6 @@ CameraBGImage *BKE_camera_background_image_new(Camera *cam)
|
||||
|
||||
bgpic->scale = 1.0f;
|
||||
bgpic->alpha = 0.5f;
|
||||
bgpic->iuser.fie_ima = 2;
|
||||
bgpic->iuser.ok = 1;
|
||||
bgpic->iuser.flag |= IMA_ANIM_ALWAYS;
|
||||
bgpic->flag |= CAM_BGIMG_FLAG_EXPANDED;
|
||||
|
||||
@@ -3129,7 +3129,7 @@ static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr)
|
||||
#endif /* WITH_OPENEXR */
|
||||
|
||||
/* common stuff to do with images after loading */
|
||||
static void image_initialize_after_load(Image *ima, ImBuf *ibuf)
|
||||
static void image_initialize_after_load(Image *ima, ImBuf *UNUSED(ibuf))
|
||||
{
|
||||
/* Preview is NULL when it has never been used as an icon before.
|
||||
* Never handle previews/icons outside of main thread. */
|
||||
@@ -3137,11 +3137,6 @@ static void image_initialize_after_load(Image *ima, ImBuf *ibuf)
|
||||
BKE_icon_changed(BKE_icon_id_ensure(&ima->id));
|
||||
}
|
||||
|
||||
/* fields */
|
||||
if (ima->flag & IMA_FIELDS) {
|
||||
if (ima->flag & IMA_STD_FIELD) de_interlace_st(ibuf);
|
||||
else de_interlace_ng(ibuf);
|
||||
}
|
||||
/* timer */
|
||||
BKE_image_tag_time(ima);
|
||||
|
||||
@@ -4249,7 +4244,7 @@ void BKE_image_pool_release_ibuf(Image *ima, ImBuf *ibuf, ImagePool *pool)
|
||||
|
||||
int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool *r_is_in_range)
|
||||
{
|
||||
const int len = (iuser->fie_ima * iuser->frames) / 2;
|
||||
const int len = iuser->frames;
|
||||
|
||||
if (r_is_in_range) {
|
||||
*r_is_in_range = false;
|
||||
@@ -4290,7 +4285,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool
|
||||
if (fieldnr) cfra++;
|
||||
|
||||
/* transform to images space */
|
||||
framenr = (cfra + iuser->fie_ima - 2) / iuser->fie_ima;
|
||||
framenr = cfra;
|
||||
if (framenr > iuser->frames) framenr = iuser->frames;
|
||||
|
||||
if (iuser->cycl) {
|
||||
|
||||
@@ -2480,7 +2480,6 @@ void BKE_object_empty_draw_type_set(Object *ob, const int value)
|
||||
ob->iuser->flag |= IMA_ANIM_ALWAYS;
|
||||
ob->iuser->frames = 100;
|
||||
ob->iuser->sfra = 1;
|
||||
ob->iuser->fie_ima = 2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -233,7 +233,6 @@ void BKE_texture_default(Tex *tex)
|
||||
tex->texfilter = TXF_EWA;
|
||||
tex->afmax = 8;
|
||||
tex->xrepeat = tex->yrepeat = 1;
|
||||
tex->fie_ima = 2;
|
||||
tex->sfra = 1;
|
||||
tex->frames = 0;
|
||||
tex->offset = 0;
|
||||
@@ -267,7 +266,6 @@ void BKE_texture_default(Tex *tex)
|
||||
tex->vn_distm = 0;
|
||||
tex->vn_coltype = 0;
|
||||
|
||||
tex->iuser.fie_ima = 2;
|
||||
tex->iuser.ok = 1;
|
||||
tex->iuser.frames = 100;
|
||||
tex->iuser.sfra = 1;
|
||||
|
||||
@@ -1254,7 +1254,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
||||
|
||||
tex->iuser.frames = 1;
|
||||
tex->iuser.sfra = 1;
|
||||
tex->iuser.fie_ima = 2;
|
||||
tex->iuser.ok = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +380,6 @@ static void do_version_ntree_242_2(bNodeTree *ntree)
|
||||
iuser->sfra = nia->sfra;
|
||||
iuser->offset = nia->nr-1;
|
||||
iuser->cycl = nia->cyclic;
|
||||
iuser->fie_ima = 2;
|
||||
iuser->ok = 1;
|
||||
|
||||
node->storage = iuser;
|
||||
@@ -389,7 +388,6 @@ static void do_version_ntree_242_2(bNodeTree *ntree)
|
||||
else {
|
||||
ImageUser *iuser = node->storage = MEM_callocN(sizeof(ImageUser), "node image user");
|
||||
iuser->sfra = 1;
|
||||
iuser->fie_ima = 2;
|
||||
iuser->ok = 1;
|
||||
}
|
||||
}
|
||||
@@ -1844,13 +1842,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
||||
ima = blo_do_versions_newlibadr(fd, lib, tex->ima);
|
||||
if (tex->imaflag & TEX_ANIM5_)
|
||||
ima->source = IMA_SRC_MOVIE;
|
||||
if (tex->imaflag & TEX_FIELDS_)
|
||||
ima->flag |= IMA_FIELDS;
|
||||
if (tex->imaflag & TEX_STD_FIELD_)
|
||||
ima->flag |= IMA_STD_FIELD;
|
||||
}
|
||||
tex->iuser.frames = tex->frames;
|
||||
tex->iuser.fie_ima = (char)tex->fie_ima;
|
||||
tex->iuser.offset = tex->offset;
|
||||
tex->iuser.sfra = tex->sfra;
|
||||
tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC_)!=0;
|
||||
@@ -1864,18 +1857,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
||||
for (ma = bmain->mat.first; ma; ma = ma->id.next)
|
||||
if (ma->nodetree)
|
||||
do_version_ntree_242_2(ma->nodetree);
|
||||
|
||||
for (sc = bmain->screen.first; sc; sc = sc->id.next) {
|
||||
ScrArea *sa;
|
||||
for (sa = sc->areabase.first; sa; sa = sa->next) {
|
||||
SpaceLink *sl;
|
||||
for (sl = sa->spacedata.first; sl; sl = sl->next) {
|
||||
if (sl->spacetype == SPACE_IMAGE) {
|
||||
((SpaceImage *)sl)->iuser.fie_ima = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bmain->subversionfile < 4) {
|
||||
|
||||
@@ -1000,25 +1000,6 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
|
||||
col = uiLayoutColumn(layout, false);
|
||||
uiItemR(col, &imaptr, "use_deinterlace", 0, IFACE_("Deinterlace"), ICON_NONE);
|
||||
}
|
||||
|
||||
split = uiLayoutSplit(layout, 0.0f, false);
|
||||
|
||||
col = uiLayoutColumn(split, false);
|
||||
/* XXX Why only display fields_per_frame only for video image types?
|
||||
* And why allow fields for non-video image types at all??? */
|
||||
if (BKE_image_is_animated(ima)) {
|
||||
uiLayout *subsplit = uiLayoutSplit(col, 0.0f, false);
|
||||
uiLayout *subcol = uiLayoutColumn(subsplit, false);
|
||||
uiItemR(subcol, &imaptr, "use_fields", 0, NULL, ICON_NONE);
|
||||
subcol = uiLayoutColumn(subsplit, false);
|
||||
uiLayoutSetActive(subcol, RNA_boolean_get(&imaptr, "use_fields"));
|
||||
uiItemR(subcol, userptr, "fields_per_frame", 0, IFACE_("Fields"), ICON_NONE);
|
||||
}
|
||||
else
|
||||
uiItemR(col, &imaptr, "use_fields", 0, NULL, ICON_NONE);
|
||||
row = uiLayoutRow(col, false);
|
||||
uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields"));
|
||||
uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1340,7 +1340,6 @@ static int image_open_exec(bContext *C, wmOperator *op)
|
||||
else {
|
||||
iuser->offset = frame_ofs - 1;
|
||||
}
|
||||
iuser->fie_ima = 2;
|
||||
iuser->scene = scene;
|
||||
BKE_image_init_imageuser(ima, iuser);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,6 @@ static SpaceLink *image_new(const ScrArea *UNUSED(area), const Scene *UNUSED(sce
|
||||
simage->flag = SI_SHOW_GPENCIL | SI_USE_ALPHA | SI_COORDFLOATS;
|
||||
|
||||
simage->iuser.ok = true;
|
||||
simage->iuser.fie_ima = 2;
|
||||
simage->iuser.frames = 100;
|
||||
simage->iuser.flag = IMA_SHOW_STEREO | IMA_ANIM_ALWAYS;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ typedef struct ImageUser {
|
||||
int framenr; /* movies, sequences: current to display */
|
||||
int frames; /* total amount of frames to use */
|
||||
int offset, sfra; /* offset within movie, start frame in global time */
|
||||
char fie_ima, cycl; /* fields/image in movie, cyclic flag */
|
||||
char _pad, cycl; /* cyclic flag */
|
||||
char ok;
|
||||
|
||||
char multiview_eye; /* multiview current eye - for internal use of drawing routines */
|
||||
@@ -157,8 +157,8 @@ typedef struct Image {
|
||||
|
||||
/* Image.flag */
|
||||
enum {
|
||||
IMA_FIELDS = (1 << 0),
|
||||
IMA_STD_FIELD = (1 << 1),
|
||||
// IMA_FIELDS = (1 << 0),
|
||||
// IMA_STD_FIELD = (1 << 1),
|
||||
#ifdef DNA_DEPRECATED
|
||||
IMA_DO_PREMUL = (1 << 2), /* deprecated, should not be used */
|
||||
#endif
|
||||
|
||||
@@ -192,7 +192,7 @@ typedef struct Tex {
|
||||
short extend;
|
||||
|
||||
/* variables disabled, moved to struct iuser */
|
||||
short fie_ima;
|
||||
short _pad0;
|
||||
int len;
|
||||
int frames, offset, sfra;
|
||||
|
||||
@@ -319,7 +319,7 @@ typedef struct ColorMapping {
|
||||
|
||||
/* imaflag unused, only for version check */
|
||||
#ifdef DNA_DEPRECATED_ALLOW
|
||||
#define TEX_FIELDS_ 8
|
||||
// #define TEX_FIELDS_ 8
|
||||
#define TEX_ANIMCYCLIC_ 64
|
||||
#define TEX_ANIM5_ 128
|
||||
#define TEX_ANTIALI_ 256
|
||||
|
||||
@@ -99,27 +99,6 @@ static void rna_Image_source_set(PointerRNA *ptr, int value)
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_Image_fields_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
Image *ima = ptr->id.data;
|
||||
ImBuf *ibuf;
|
||||
void *lock;
|
||||
|
||||
ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
|
||||
|
||||
if (ibuf) {
|
||||
short nr = 0;
|
||||
|
||||
if (!(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields)) nr = 1;
|
||||
if ((ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields)) nr = 1;
|
||||
|
||||
if (nr)
|
||||
BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE);
|
||||
}
|
||||
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
}
|
||||
|
||||
static void rna_Image_reload_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
|
||||
{
|
||||
Image *ima = ptr->id.data;
|
||||
@@ -562,13 +541,6 @@ static void rna_def_imageuser(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
|
||||
prop = RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "fie_ima");
|
||||
RNA_def_property_range(prop, 1, 200);
|
||||
RNA_def_property_ui_text(prop, "Fields per Frame", "Number of fields per rendered frame (2 fields is 1 image)");
|
||||
RNA_def_property_update(prop, 0, "rna_ImageUser_update");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
|
||||
prop = RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, NULL, "layer");
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */
|
||||
@@ -672,11 +644,6 @@ static void rna_def_image(BlenderRNA *brna)
|
||||
{IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
static const EnumPropertyItem prop_field_order_items[] = {
|
||||
{0, "EVEN", 0, "Upper First", "Upper field first"},
|
||||
{IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
};
|
||||
static const EnumPropertyItem alpha_mode_items[] = {
|
||||
{IMA_ALPHA_STRAIGHT, "STRAIGHT", 0, "Straight", "Transparent RGB and alpha pixels are unmodified"},
|
||||
{IMA_ALPHA_PREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"},
|
||||
@@ -727,22 +694,6 @@ static void rna_def_image(BlenderRNA *brna)
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Packed Files", "Collection of packed images");
|
||||
|
||||
prop = RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
|
||||
RNA_def_property_enum_items(prop, prop_field_order_items);
|
||||
RNA_def_property_ui_text(prop, "Field Order", "Order of video fields (select which lines are displayed first)");
|
||||
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);
|
||||
|
||||
/* booleans */
|
||||
prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
|
||||
RNA_def_property_ui_text(prop, "Fields", "Use fields of the image");
|
||||
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_fields_update");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
|
||||
|
||||
prop = RNA_def_property(srna, "use_view_as_render", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_VIEW_AS_RENDER);
|
||||
|
||||
@@ -304,7 +304,6 @@ static void node_composit_init_image(bNodeTree *ntree, bNode *node)
|
||||
node->storage = iuser;
|
||||
iuser->frames = 1;
|
||||
iuser->sfra = 1;
|
||||
iuser->fie_ima = 2;
|
||||
iuser->ok = 1;
|
||||
iuser->flag |= IMA_ANIM_ALWAYS;
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode *node
|
||||
ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user");
|
||||
node->storage = iuser;
|
||||
iuser->sfra = 1;
|
||||
iuser->fie_ima = 2;
|
||||
iuser->ok = 1;
|
||||
node->custom1 = 50; /* default 50% split */
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ static void node_composit_init_viewer(bNodeTree *UNUSED(ntree), bNode *node)
|
||||
ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user");
|
||||
node->storage = iuser;
|
||||
iuser->sfra = 1;
|
||||
iuser->fie_ima = 2;
|
||||
iuser->ok = 1;
|
||||
node->custom3 = 0.5f;
|
||||
node->custom4 = 0.5f;
|
||||
|
||||
@@ -48,7 +48,6 @@ static void node_shader_init_tex_environment(bNodeTree *UNUSED(ntree), bNode *no
|
||||
tex->projection = SHD_PROJ_EQUIRECTANGULAR;
|
||||
tex->iuser.frames = 1;
|
||||
tex->iuser.sfra = 1;
|
||||
tex->iuser.fie_ima = 2;
|
||||
tex->iuser.ok = 1;
|
||||
|
||||
node->storage = tex;
|
||||
|
||||
@@ -48,7 +48,6 @@ static void node_shader_init_tex_image(bNodeTree *UNUSED(ntree), bNode *node)
|
||||
tex->color_space = SHD_COLORSPACE_COLOR;
|
||||
tex->iuser.frames = 1;
|
||||
tex->iuser.sfra = 1;
|
||||
tex->iuser.fie_ima = 2;
|
||||
tex->iuser.ok = 1;
|
||||
|
||||
node->storage = tex;
|
||||
|
||||
@@ -93,7 +93,6 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node)
|
||||
ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user");
|
||||
node->storage = iuser;
|
||||
iuser->sfra = 1;
|
||||
iuser->fie_ima = 2;
|
||||
iuser->ok = 1;
|
||||
iuser->flag |= IMA_ANIM_ALWAYS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user