[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11920] trunk/blender: == imagebrowser ==
Andrea Weikert
elubie at gmx.net
Sun Sep 2 19:25:03 CEST 2007
Revision: 11920
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11920
Author: elubie
Date: 2007-09-02 19:25:03 +0200 (Sun, 02 Sep 2007)
Log Message:
-----------
== imagebrowser ==
Initial commit of imagebrowser in trunk.
BIG COMMIT!
Main changes:
* completely reworked imasel space
* creation and storage of the preview images for materials, textures, world and lamp
* thumbnails of images and movie files when browsing in the file system
* loading previews from external .blend when linking or appending
* thumbnail caching according to the Thumbnail Managing Standard: http://jens.triq.net/thumbnail-spec/
* for now just kept imasel access mostly as old imgbrowser (CTRL+F4, CTRL+F1) a bit hidden still.
* filtering of file types (images, movies, .blend, py,...)
* preliminary managing of bookmarks ('B' button to add, XKEY while bookmark active to delete)
More detailed info which will be updated here: http://wiki.blender.org/index.php/User:Elubie/PreviewImageBrowser
Places that need special review (and probably fixes):
* BLO_blendhandle_get_previews in readblenentry
* readfile.c: do_version and refactorings of do_library_append
* UI integration
TODO and known issues still:
* Accented characters do not display correctly with international fonts
* Crash was reported when browsing in directory with movie files
* Bookmark management still needs some UI work (second scrollbar?), feedback here is welcome!
Credits:
Samir Bharadwaj (samirbharadwaj at yahoo.com) for the icon images.
Many thanks to everyone who gave feedback and helped so far!
Modified Paths:
--------------
trunk/blender/projectfiles_vc7/blender/imbuf/BL_imbuf.vcproj
trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj
trunk/blender/source/blender/blenkernel/BKE_icons.h
trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
trunk/blender/source/blender/blenkernel/intern/icons.c
trunk/blender/source/blender/blenkernel/intern/image.c
trunk/blender/source/blender/blenkernel/intern/material.c
trunk/blender/source/blender/blenkernel/intern/object.c
trunk/blender/source/blender/blenkernel/intern/texture.c
trunk/blender/source/blender/blenkernel/intern/world.c
trunk/blender/source/blender/blenlib/BLI_blenlib.h
trunk/blender/source/blender/blenlib/BLI_storage_types.h
trunk/blender/source/blender/blenlib/intern/util.c
trunk/blender/source/blender/blenloader/BLO_readfile.h
trunk/blender/source/blender/blenloader/intern/readblenentry.c
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/blenloader/intern/writefile.c
trunk/blender/source/blender/imbuf/IMB_imbuf.h
trunk/blender/source/blender/imbuf/IMB_imbuf_types.h
trunk/blender/source/blender/imbuf/intern/allocimbuf.c
trunk/blender/source/blender/imbuf/intern/anim.c
trunk/blender/source/blender/imbuf/intern/png.c
trunk/blender/source/blender/include/BIF_fsmenu.h
trunk/blender/source/blender/include/BIF_imasel.h
trunk/blender/source/blender/include/BIF_interface_icons.h
trunk/blender/source/blender/include/BIF_resources.h
trunk/blender/source/blender/include/BIF_space.h
trunk/blender/source/blender/include/BSE_drawimasel.h
trunk/blender/source/blender/include/BSE_filesel.h
trunk/blender/source/blender/include/blendef.h
trunk/blender/source/blender/include/datatoc.h
trunk/blender/source/blender/include/interface.h
trunk/blender/source/blender/makesdna/DNA_ID.h
trunk/blender/source/blender/makesdna/DNA_image_types.h
trunk/blender/source/blender/makesdna/DNA_lamp_types.h
trunk/blender/source/blender/makesdna/DNA_material_types.h
trunk/blender/source/blender/makesdna/DNA_space_types.h
trunk/blender/source/blender/makesdna/DNA_texture_types.h
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/makesdna/DNA_world_types.h
trunk/blender/source/blender/python/api2_2x/Window.c
trunk/blender/source/blender/quicktime/apple/quicktime_import.c
trunk/blender/source/blender/src/buttons_scene.c
trunk/blender/source/blender/src/buttons_shading.c
trunk/blender/source/blender/src/drawimasel.c
trunk/blender/source/blender/src/drawnode.c
trunk/blender/source/blender/src/editimasel.c
trunk/blender/source/blender/src/editscreen.c
trunk/blender/source/blender/src/editsima.c
trunk/blender/source/blender/src/filesel.c
trunk/blender/source/blender/src/glutil.c
trunk/blender/source/blender/src/header_imasel.c
trunk/blender/source/blender/src/header_info.c
trunk/blender/source/blender/src/headerbuttons.c
trunk/blender/source/blender/src/imasel.c
trunk/blender/source/blender/src/interface_draw.c
trunk/blender/source/blender/src/interface_icons.c
trunk/blender/source/blender/src/resources.c
trunk/blender/source/blender/src/space.c
trunk/blender/source/blender/src/toets.c
trunk/blender/source/blender/src/usiblender.c
Added Paths:
-----------
trunk/blender/release/datafiles/prvicons
trunk/blender/source/blender/imbuf/IMB_thumbs.h
trunk/blender/source/blender/imbuf/intern/IMB_imginfo.h
trunk/blender/source/blender/imbuf/intern/imginfo.c
trunk/blender/source/blender/imbuf/intern/md5.c
trunk/blender/source/blender/imbuf/intern/md5.h
trunk/blender/source/blender/imbuf/intern/thumbs.c
trunk/blender/source/blender/include/BIF_filelist.h
trunk/blender/source/blender/src/filelist.c
trunk/blender/source/blender/src/fsmenu.c
trunk/blender/source/blender/src/prvicons.c
Modified: trunk/blender/projectfiles_vc7/blender/imbuf/BL_imbuf.vcproj
===================================================================
--- trunk/blender/projectfiles_vc7/blender/imbuf/BL_imbuf.vcproj 2007-09-02 16:34:02 UTC (rev 11919)
+++ trunk/blender/projectfiles_vc7/blender/imbuf/BL_imbuf.vcproj 2007-09-02 17:25:03 UTC (rev 11920)
@@ -383,12 +383,18 @@
RelativePath="..\..\..\source\blender\imbuf\intern\imageprocess.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\imbuf\intern\imginfo.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\imbuf\intern\iris.c">
</File>
<File
RelativePath="..\..\..\source\blender\imbuf\intern\jpeg.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\imbuf\intern\md5.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\imbuf\intern\openexr\openexr_api.cpp">
</File>
<File
@@ -419,6 +425,9 @@
RelativePath="..\..\..\source\blender\imbuf\intern\targa.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\imbuf\intern\thumbs.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\imbuf\intern\tiff.c">
</File>
<File
@@ -534,6 +543,9 @@
RelativePath="..\..\..\source\blender\imbuf\IMB_imbuf_types.h">
</File>
<File
+ RelativePath="..\..\..\source\blender\imbuf\intern\IMB_imginfo.h">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\imbuf\intern\IMB_iris.h">
</File>
<File
@@ -549,6 +561,9 @@
RelativePath="..\..\..\source\blender\imbuf\intern\IMB_targa.h">
</File>
<File
+ RelativePath="..\..\..\source\blender\imbuf\IMB_thumbs.h">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\imbuf\intern\IMB_tiff.h">
</File>
<File
Modified: trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj
===================================================================
--- trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj 2007-09-02 16:34:02 UTC (rev 11919)
+++ trunk/blender/projectfiles_vc7/blender/src/BL_src.vcproj 2007-09-02 17:25:03 UTC (rev 11920)
@@ -329,12 +329,18 @@
RelativePath="..\..\..\source\blender\src\eventdebug.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\src\filelist.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\src\filesel.c">
</File>
<File
RelativePath="..\..\..\source\blender\src\fluidsim.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\src\fsmenu.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\src\ghostwinlay.c">
</File>
<File
@@ -464,6 +470,9 @@
RelativePath="..\..\..\source\blender\src\previewrender.c">
</File>
<File
+ RelativePath="..\..\..\source\blender\src\prvicons.c">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\src\renderwin.c">
</File>
<File
@@ -681,6 +690,9 @@
RelativePath="..\..\..\source\blender\include\BIF_editview.h">
</File>
<File
+ RelativePath="..\..\..\source\blender\include\BIF_filelist.h">
+ </File>
+ <File
RelativePath="..\..\..\source\blender\include\BIF_fsmenu.h">
</File>
<File
Copied: trunk/blender/release/datafiles/prvicons (from rev 11849, branches/imgbrowser-elubie/release/datafiles/prvicons)
===================================================================
(Binary files differ)
Modified: trunk/blender/source/blender/blenkernel/BKE_icons.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_icons.h 2007-09-02 16:34:02 UTC (rev 11919)
+++ trunk/blender/source/blender/blenkernel/BKE_icons.h 2007-09-02 17:25:03 UTC (rev 11920)
@@ -1,34 +1,32 @@
/**
- * $Id$
- *
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
- */
+* $Id$
+*
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+* The Original Code is Copyright (C) 2006-2007 Blender Foundation.
+* All rights reserved.
+*
+* The Original Code is: all of this file.
+*
+* Contributor(s): none yet.
+*
+* ***** END GPL LICENSE BLOCK *****
+*
+*/
#ifndef BKE_ICONS_H
#define BKE_ICONS_H
@@ -44,12 +42,13 @@
void *drawinfo;
void *obj;
short type;
- short changed;
DrawInfoFreeFP drawinfo_free;
};
typedef struct Icon Icon;
+struct PreviewImage;
+
void BKE_icons_init(int first_dyn_id);
/* return icon id for library object or create new icon if not found */
@@ -71,5 +70,19 @@
/* free all icons */
void BKE_icons_free();
+/* free the preview image */
+void BKE_previewimg_free(struct PreviewImage **prv);
+/* free the preview image belonging to the id */
+void BKE_previewimg_free_id(ID *id);
+
+/* create a new preview image */
+struct PreviewImage* BKE_previewimg_create() ;
+
+/* create a copy of the preview image */
+struct PreviewImage* BKE_previewimg_copy(struct PreviewImage *prv);
+
+/* retrieve existing or create new preview image */
+PreviewImage* BKE_previewimg_get(ID *id);
+
#endif /* BKE_ICONS_H */
Modified: trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
===================================================================
--- trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c 2007-09-02 16:34:02 UTC (rev 11919)
+++ trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c 2007-09-02 17:25:03 UTC (rev 11920)
@@ -324,3 +324,7 @@
void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result) {}
void update_for_newframe() {}
+
+struct FileList;
+void BIF_filelist_freelib(struct FileList* filelist) {};
+
Modified: trunk/blender/source/blender/blenkernel/intern/icons.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/icons.c 2007-09-02 16:34:02 UTC (rev 11919)
+++ trunk/blender/source/blender/blenkernel/intern/icons.c 2007-09-02 17:25:03 UTC (rev 11920)
@@ -1,34 +1,32 @@
/**
- * $Id$
- *
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
- */
+* $Id$
+*
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+* The Original Code is Copyright (C) 2006-2007 Blender Foundation.
+* All rights reserved.
+*
+* The Original Code is: all of this file.
+*
+* Contributor(s): none yet.
+*
+* ***** END GPL LICENSE BLOCK *****
+*
+*/
#include <math.h>
#include <stdlib.h>
@@ -41,6 +39,11 @@
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
+#include "DNA_image_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
+#include "DNA_texture_types.h"
+#include "DNA_world_types.h"
#include "BLI_ghash.h"
@@ -111,7 +114,102 @@
gIcons = NULL;
}
+struct PreviewImage* BKE_previewimg_create()
+{
+ PreviewImage* prv_img = NULL;
+ int i;
+ prv_img = MEM_callocN(sizeof(PreviewImage), "img_prv");
+
+ for (i=0; i<PREVIEW_MIPMAPS; ++i) {
+ prv_img->changed[i] = 1;
+ }
+ return prv_img;
+}
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list