Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-30 10:09:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-30 10:09:23 +0400
commit449f8ce4feeef8cfa57a8cbe299e0e718b9473b4 (patch)
treea2a78c88dc4c3313d746908c70f119765a1caeac /source/blender/blenkernel/intern/image.c
parent1b7d264f1e9ac20e124e1e1d6138c6b7eda9be2c (diff)
bugfix [#22859] Multi-user images cant be made into single user in texure panel.
turns out this isnt exactly a bug since support was never written for this but may as well support it. now rna/py can do image.copy() too.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index ffd0b378f07..77607ae25b6 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -287,17 +287,25 @@ static void image_assign_ibuf(Image *ima, ImBuf *ibuf, int index, int frame)
}
/* empty image block, of similar type and filename */
-Image *BKE_image_copy(Image *ima)
+Image *copy_image(Image *ima)
{
- Image *new= image_alloc(ima->id.name+2, ima->source, ima->type);
+ Image *nima= image_alloc(ima->id.name+2, ima->source, ima->type);
- BLI_strncpy(new->name, ima->name, sizeof(ima->name));
-
- new->gen_x= ima->gen_x;
- new->gen_y= ima->gen_y;
- new->gen_type= ima->gen_type;
+ BLI_strncpy(nima->name, ima->name, sizeof(ima->name));
+
+ nima->flag= ima->flag;
+ nima->tpageflag= ima->tpageflag;
- return new;
+ nima->gen_x= ima->gen_x;
+ nima->gen_y= ima->gen_y;
+ nima->gen_type= ima->gen_type;
+
+ nima->animspeed= ima->animspeed;
+
+ nima->aspx= ima->aspx;
+ nima->aspy= ima->aspy;
+
+ return nima;
}
void BKE_image_merge(Image *dest, Image *source)