[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43123] branches/asset-browser: asset browser: new SpaceType for asset browser
Andrea Weikert
elubie at gmx.net
Wed Jan 4 10:42:51 CET 2012
Revision: 43123
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43123
Author: elubie
Date: 2012-01-04 09:42:42 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
asset browser: new SpaceType for asset browser
* added skeleton code for new space type
Modified Paths:
--------------
branches/asset-browser/release/scripts/startup/bl_ui/__init__.py
branches/asset-browser/source/blender/blenkernel/BKE_context.h
branches/asset-browser/source/blender/blenkernel/intern/context.c
branches/asset-browser/source/blender/blenloader/intern/writefile.c
branches/asset-browser/source/blender/editors/CMakeLists.txt
branches/asset-browser/source/blender/editors/SConscript
branches/asset-browser/source/blender/editors/include/ED_space_api.h
branches/asset-browser/source/blender/editors/interface/resources.c
branches/asset-browser/source/blender/editors/screen/area.c
branches/asset-browser/source/blender/editors/space_api/spacetypes.c
branches/asset-browser/source/blender/makesdna/DNA_space_types.h
branches/asset-browser/source/blender/makesdna/DNA_userdef_types.h
branches/asset-browser/source/blender/makesrna/intern/rna_space.c
branches/asset-browser/source/blender/makesrna/intern/rna_userdef.c
branches/asset-browser/source/creator/CMakeLists.txt
Added Paths:
-----------
branches/asset-browser/release/scripts/startup/bl_ui/space_asset.py
branches/asset-browser/source/blender/editors/space_asset/
branches/asset-browser/source/blender/editors/space_asset/CMakeLists.txt
branches/asset-browser/source/blender/editors/space_asset/SConscript
branches/asset-browser/source/blender/editors/space_asset/space_asset.c
Modified: branches/asset-browser/release/scripts/startup/bl_ui/__init__.py
===================================================================
--- branches/asset-browser/release/scripts/startup/bl_ui/__init__.py 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/release/scripts/startup/bl_ui/__init__.py 2012-01-04 09:42:42 UTC (rev 43123)
@@ -53,6 +53,7 @@
"properties_scene",
"properties_texture",
"properties_world",
+ "space_asset",
"space_clip",
"space_console",
"space_dopesheet",
Added: branches/asset-browser/release/scripts/startup/bl_ui/space_asset.py
===================================================================
--- branches/asset-browser/release/scripts/startup/bl_ui/space_asset.py (rev 0)
+++ branches/asset-browser/release/scripts/startup/bl_ui/space_asset.py 2012-01-04 09:42:42 UTC (rev 43123)
@@ -0,0 +1,41 @@
+# ##### 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Header, Menu
+
+
+class ASSET_HT_header(Header):
+ bl_space_type = 'ASSET_BROWSER'
+
+ def draw(self, context):
+ layout = self.layout
+ print("draw space asset")
+ window = context.window
+ scene = context.scene
+ rd = scene.render
+
+ row = layout.row(align=True)
+ row.template_header()
+
+ layout.separator()
+
+if __name__ == "__main__": # only for live edit.
+ print("registered space library")
+ bpy.utils.register_module(__name__)
Property changes on: branches/asset-browser/release/scripts/startup/bl_ui/space_asset.py
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: branches/asset-browser/source/blender/blenkernel/BKE_context.h
===================================================================
--- branches/asset-browser/source/blender/blenkernel/BKE_context.h 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/blenkernel/BKE_context.h 2012-01-04 09:42:42 UTC (rev 43123)
@@ -160,6 +160,7 @@
struct SpaceInfo *CTX_wm_space_info(const bContext *C);
struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C);
struct SpaceClip *CTX_wm_space_clip(const bContext *C);
+struct SpaceAsset *CTX_wm_space_asset(const bContext *C);
void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm);
void CTX_wm_window_set(bContext *C, struct wmWindow *win);
Modified: branches/asset-browser/source/blender/blenkernel/intern/context.c
===================================================================
--- branches/asset-browser/source/blender/blenkernel/intern/context.c 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/blenkernel/intern/context.c 2012-01-04 09:42:42 UTC (rev 43123)
@@ -368,6 +368,13 @@
return NULL;
}
+struct SpaceAsset *CTX_wm_space_asset(const bContext *C)
+{
+ if(C->wm.area && C->wm.area->spacetype==SPACE_ASSET)
+ return C->wm.area->spacedata.first;
+ return NULL;
+}
+
void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
{
C->wm.manager= wm;
Modified: branches/asset-browser/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/asset-browser/source/blender/blenloader/intern/writefile.c 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/blenloader/intern/writefile.c 2012-01-04 09:42:42 UTC (rev 43123)
@@ -2278,6 +2278,9 @@
else if(sl->spacetype==SPACE_CLIP) {
writestruct(wd, DATA, "SpaceClip", 1, sl);
}
+ else if(sl->spacetype==SPACE_ASSET) {
+ writestruct(wd, DATA, "SpaceAsset", 1, sl);
+ }
sl= sl->next;
}
Modified: branches/asset-browser/source/blender/editors/CMakeLists.txt
===================================================================
--- branches/asset-browser/source/blender/editors/CMakeLists.txt 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/editors/CMakeLists.txt 2012-01-04 09:42:42 UTC (rev 43123)
@@ -34,6 +34,7 @@
add_subdirectory(sound)
add_subdirectory(space_action)
add_subdirectory(space_api)
+ add_subdirectory(space_asset)
add_subdirectory(space_buttons)
add_subdirectory(space_clip)
add_subdirectory(space_console)
Modified: branches/asset-browser/source/blender/editors/SConscript
===================================================================
--- branches/asset-browser/source/blender/editors/SConscript 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/editors/SConscript 2012-01-04 09:42:42 UTC (rev 43123)
@@ -16,6 +16,7 @@
'physics/SConscript',
'render/SConscript',
'sound/SConscript',
+ 'space_asset/SConscript',
'space_buttons/SConscript',
'space_clip/SConscript',
'space_file/SConscript',
Modified: branches/asset-browser/source/blender/editors/include/ED_space_api.h
===================================================================
--- branches/asset-browser/source/blender/editors/include/ED_space_api.h 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/editors/include/ED_space_api.h 2012-01-04 09:42:42 UTC (rev 43123)
@@ -55,6 +55,7 @@
void ED_spacetype_console(void);
void ED_spacetype_userpref(void);
void ED_spacetype_clip(void);
+void ED_spacetype_asset(void);
/* calls for instancing and freeing spacetype static data
called in WM_init_exit */
Modified: branches/asset-browser/source/blender/editors/interface/resources.c
===================================================================
--- branches/asset-browser/source/blender/editors/interface/resources.c 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/editors/interface/resources.c 2012-01-04 09:42:42 UTC (rev 43123)
@@ -153,6 +153,8 @@
case SPACE_CLIP:
ts= &btheme->tclip;
break;
+ case SPACE_ASSET:
+ ts= &btheme->tasset;
default:
ts= &btheme->tv3d;
break;
@@ -555,7 +557,7 @@
ui_theme_init_new_do(&btheme->tuserpref);
ui_theme_init_new_do(&btheme->tconsole);
ui_theme_init_new_do(&btheme->tclip);
-
+ ui_theme_init_new_do(&btheme->tasset);
}
@@ -818,6 +820,10 @@
SETCOL(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
SETCOL(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
btheme->tclip.handle_vertex_size= 4;
+
+ /* space asset */
+ /* to have something initialized */
+ btheme->tasset= btheme->tfile;
}
@@ -1718,6 +1724,15 @@
if (U.tweak_threshold == 0 )
U.tweak_threshold= 10;
+ {
+ bTheme *btheme;
+ for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ if((btheme->tasset.back[3]) == 0) {
+ btheme->tasset= btheme->tfile;
+ }
+ }
+ }
+
/* funny name, but it is GE stuff, moves userdef stuff to engine */
// XXX space_set_commmandline_options();
/* this timer uses U */
Modified: branches/asset-browser/source/blender/editors/screen/area.c
===================================================================
--- branches/asset-browser/source/blender/editors/screen/area.c 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/editors/screen/area.c 2012-01-04 09:42:42 UTC (rev 43123)
@@ -1480,6 +1480,7 @@
"|%l"
"|File Browser %x5"
+ "|Asset Browser %x21"
"|%l"
Modified: branches/asset-browser/source/blender/editors/space_api/spacetypes.c
===================================================================
--- branches/asset-browser/source/blender/editors/space_api/spacetypes.c 2012-01-04 09:27:34 UTC (rev 43122)
+++ branches/asset-browser/source/blender/editors/space_api/spacetypes.c 2012-01-04 09:42:42 UTC (rev 43123)
@@ -91,6 +91,7 @@
ED_spacetype_console();
ED_spacetype_userpref();
ED_spacetype_clip();
+ ED_spacetype_asset();
// ...
/* register operator types for screen and all spaces */
Property changes on: branches/asset-browser/source/blender/editors/space_asset
___________________________________________________________________
Added: bugtraq:number
+ true
Added: branches/asset-browser/source/blender/editors/space_asset/CMakeLists.txt
===================================================================
--- branches/asset-browser/source/blender/editors/space_asset/CMakeLists.txt (rev 0)
+++ branches/asset-browser/source/blender/editors/space_asset/CMakeLists.txt 2012-01-04 09:42:42 UTC (rev 43123)
@@ -0,0 +1,42 @@
+# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Jacques Beaurain.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+ ../include
+ ../../blenfont
+ ../../blenkernel
+ ../../blenlib
+ ../../blenloader
+ ../../imbuf
+ ../../makesdna
+ ../../makesrna
+ ../../windowmanager
+ ../../../../intern/guardedalloc
+)
+
+set(INC_SYS
+ ${GLEW_INCLUDE_PATH}
+)
+
+set(SRC
+ space_asset.c
+)
+
+blender_add_lib(bf_editor_space_asset "${SRC}" "${INC}" "${INC_SYS}")
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list