[Bf-blender-cvs] [76ad40f] multiview: From review: changes in BKE_image_has_anim() and BKE_image_has_packedfile()

Dalai Felinto noreply at git.blender.org
Tue Nov 25 18:56:58 CET 2014


Commit: 76ad40fbf78cc91cfc2df1881abb747db21df7fe
Author: Dalai Felinto
Date:   Tue Nov 25 14:55:14 2014 -0200
Branches: multiview
https://developer.blender.org/rB76ad40fbf78cc91cfc2df1881abb747db21df7fe

>From review: changes in BKE_image_has_anim() and BKE_image_has_packedfile()

Comments by Sergey Sharybin:

* If packedFile becomes NULL for some and ima->packedfiles has still
  elements this sounds like a horrible error happened somewhere.

* If anims has items then the image is an animation. Imagine situation
  when you load movie file in image editor, save .blend file, then
  remove the movie file and re-load the file. Seems this case should be
  considered image is an animation i guess.

===================================================================

M	source/blender/blenkernel/intern/image.c

===================================================================

diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index dd691c7..b7b6a06 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -4245,12 +4245,12 @@ int BKE_image_sequence_guess_offset(Image *image)
 
 bool BKE_image_has_anim(Image *ima)
 {
-	return (!BLI_listbase_is_empty(&ima->anims)) && (((ImageAnim *) ima->anims.first)->anim != NULL);
+	return (BLI_listbase_is_empty(&ima->anims) == false);
 }
 
 bool BKE_image_has_packedfile(Image *ima)
 {
-	return (!BLI_listbase_is_empty(&ima->packedfiles)) && (((ImagePackedFile *) ima->packedfiles.first)->packedfile != NULL);
+	return (BLI_listbase_is_empty(&ima->packedfiles) == false);
 }
 
 /**




More information about the Bf-blender-cvs mailing list