Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/image_ops.c
| Show First 20 Lines • Show All 1,269 Lines • ▼ Show 20 Lines | if (!exists) { | ||||
| else { | else { | ||||
| ima->flag &= ~IMA_USE_VIEWS; | ima->flag &= ~IMA_USE_VIEWS; | ||||
| BKE_image_free_views(ima); | BKE_image_free_views(ima); | ||||
| } | } | ||||
| if ((range->length > 1) && (ima->source == IMA_SRC_FILE)) { | if ((range->length > 1) && (ima->source == IMA_SRC_FILE)) { | ||||
| if (range->udim_tiles.first && range->offset == 1001) { | if (range->udim_tiles.first && range->offset == 1001) { | ||||
| ima->source = IMA_SRC_TILED; | ima->source = IMA_SRC_TILED; | ||||
| for (LinkData *node = range->udim_tiles.first; node; node = node->next) { | LISTBASE_FOREACH (LinkData *, node, &range->udim_tiles) { | ||||
| BKE_image_add_tile(ima, POINTER_AS_INT(node->data), NULL); | BKE_image_add_tile(ima, POINTER_AS_INT(node->data), NULL); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ima->source = IMA_SRC_SEQUENCE; | ima->source = IMA_SRC_SEQUENCE; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Show All 17 Lines | static int image_open_exec(bContext *C, wmOperator *op) | ||||
| const bool use_multiview = RNA_boolean_get(op->ptr, "use_multiview"); | const bool use_multiview = RNA_boolean_get(op->ptr, "use_multiview"); | ||||
| const bool use_udim = RNA_boolean_get(op->ptr, "use_udim_detecting"); | const bool use_udim = RNA_boolean_get(op->ptr, "use_udim_detecting"); | ||||
| if (!op->customdata) { | if (!op->customdata) { | ||||
| image_open_init(C, op); | image_open_init(C, op); | ||||
| } | } | ||||
| ListBase ranges = ED_image_filesel_detect_sequences(bmain, op, use_udim); | ListBase ranges = ED_image_filesel_detect_sequences(bmain, op, use_udim); | ||||
| for (ImageFrameRange *range = ranges.first; range; range = range->next) { | LISTBASE_FOREACH (ImageFrameRange *, range, &ranges) { | ||||
| Image *ima_range = image_open_single( | Image *ima_range = image_open_single( | ||||
| bmain, op, range, BKE_main_blendfile_path(bmain), is_relative_path, use_multiview); | bmain, op, range, BKE_main_blendfile_path(bmain), is_relative_path, use_multiview); | ||||
| /* take the first image */ | /* take the first image */ | ||||
| if ((ima == NULL) && ima_range) { | if ((ima == NULL) && ima_range) { | ||||
| ima = ima_range; | ima = ima_range; | ||||
| frame_seq_len = range->length; | frame_seq_len = range->length; | ||||
| frame_ofs = range->offset; | frame_ofs = range->offset; | ||||
| Show All 33 Lines | else { | ||||
| Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; | Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; | ||||
| if (tex && tex->type == TEX_IMAGE) { | if (tex && tex->type == TEX_IMAGE) { | ||||
| iuser = &tex->iuser; | iuser = &tex->iuser; | ||||
| } | } | ||||
| if (iuser == NULL) { | if (iuser == NULL) { | ||||
| Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data; | Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data; | ||||
| if (cam) { | if (cam) { | ||||
| for (CameraBGImage *bgpic = cam->bg_images.first; bgpic; bgpic = bgpic->next) { | LISTBASE_FOREACH (CameraBGImage *, bgpic, &cam->bg_images) { | ||||
| if (bgpic->ima == ima) { | if (bgpic->ima == ima) { | ||||
| iuser = &bgpic->iuser; | iuser = &bgpic->iuser; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,030 Lines • Show Last 20 Lines | |||||