[Bf-blender-cvs] [d6f9e6bf0ce] temp-udim-images: Merge remote-tracking branch 'origin/blender2.8' into udim
Lukas Stockner
noreply at git.blender.org
Mon Jun 11 22:21:55 CEST 2018
Commit: d6f9e6bf0ce3f3412c85473d5412284918d9b2b0
Author: Lukas Stockner
Date: Mon Jun 11 22:10:47 2018 +0200
Branches: temp-udim-images
https://developer.blender.org/rBd6f9e6bf0ce3f3412c85473d5412284918d9b2b0
Merge remote-tracking branch 'origin/blender2.8' into udim
===================================================================
===================================================================
diff --cc intern/cycles/render/nodes.cpp
index 487108a551d,3a531f87c10..19fbfa882bb
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@@ -1514,6 -1488,19 +1514,19 @@@ void PointDensityTextureNode::attribute
ShaderNode::attributes(shader, attributes);
}
+ void PointDensityTextureNode::add_image()
+ {
+ if(slot == -1) {
+ ImageMetaData metadata;
+ slot = image_manager->add_image(filename.string(), builtin_data,
- false, 0,
++ false, 0, 0,
+ interpolation,
+ EXTENSION_CLIP,
+ true,
+ metadata);
+ }
+ }
+
void PointDensityTextureNode::compile(SVMCompiler& compiler)
{
ShaderInput *vector_in = input("Vector");
diff --cc source/blender/blenkernel/intern/image.c
index accbf052de4,c1ecabcfb5a..e822d0db469
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@@ -4450,23 -4362,16 +4450,23 @@@ void BKE_image_user_file_path(ImageUse
BLI_strncpy(filepath, ima->name, FILE_MAX);
}
- if (ima->source == IMA_SRC_SEQUENCE) {
+ if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_TILED)) {
char head[FILE_MAX], tail[FILE_MAX];
unsigned short numlen;
- int frame = iuser ? iuser->framenr : ima->lastframe;
+
+ int index;
+ if (ima->source == IMA_SRC_SEQUENCE) {
+ index = iuser ? iuser->framenr : ima->lastframe;
+ }
+ else {
+ index = 1001 + (iuser ? iuser->tile : 0);
+ }
BLI_stringdec(filepath, head, tail, &numlen);
- BLI_stringenc(filepath, head, tail, numlen, frame);
+ BLI_stringenc(filepath, head, tail, numlen, index);
}
- BLI_path_abs(filepath, ID_BLEND_PATH(G.main, &ima->id));
+ BLI_path_abs(filepath, ID_BLEND_PATH_FROM_GLOBAL(&ima->id));
}
bool BKE_image_has_alpha(struct Image *image)
diff --cc source/blender/editors/space_image/image_ops.c
index a3eafc05df1,39544eb55dd..dc8e24db379
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@@ -1232,8 -1179,8 +1232,8 @@@ static int image_sequence_get_len(Image
}
static Image *image_open_single(
- wmOperator *op, const char *filepath, const char *relbase,
+ Main *bmain, wmOperator *op, const char *filepath, const char *relbase,
- bool is_relative_path, bool use_multiview, int frame_seq_len)
+ bool is_relative_path, bool use_multiview, int frame_seq_len, int frame_seq_ofs)
{
bool exists = false;
Image *ima = NULL;
@@@ -1327,8 -1267,8 +1327,8 @@@ static int image_open_exec(bContext *C
}
Image *ima_range = image_open_single(
- op, filepath_range, BKE_main_blendfile_path(bmain),
+ bmain, op, filepath_range, BKE_main_blendfile_path(bmain),
- is_relative_path, use_multiview, frame_range_seq_len);
+ is_relative_path, use_multiview, frame_range_seq_len, frame_range_ofs);
/* take the first image */
if ((ima == NULL) && ima_range) {
@@@ -1340,14 -1280,10 +1340,14 @@@
BLI_freelistN(&frame_ranges_all);
}
else {
+ int sequence_len = 1;
+ if (use_udim) {
+ sequence_len = image_get_udim(filepath);
+ }
/* for drag & drop etc. */
ima = image_open_single(
- op, filepath, BKE_main_blendfile_path(bmain),
+ bmain, op, filepath, BKE_main_blendfile_path(bmain),
- is_relative_path, use_multiview, 1);
+ is_relative_path, use_multiview, 1, sequence_len);
}
if (ima == NULL) {
@@@ -1880,10 -1815,10 +1881,11 @@@ static void save_imbuf_post(ImBuf *ibuf
*/
static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveImageOptions *simopts, bool do_newpath)
{
+ Main *bmain = CTX_data_main(C);
Image *ima = ED_space_image(sima);
void *lock;
- ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
+ /* TODO(lukas): Saving tiled images */
+ ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock, 0);
Scene *scene;
RenderResult *rr = NULL;
bool ok = false;
More information about the Bf-blender-cvs
mailing list