Revision: 37011
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37011
Author:   nazgul
Date:     2011-05-30 04:18:02 +0000 (Mon, 30 May 2011)
Log Message:
-----------
Camera tracking integration
===========================

- Initial implementaiton of new ID named MovieClip.
  Currently it has plactically the same functionality as
  images, but this functionality would be widen in nearest future.

- Initial implementation of SpaceClip.
  This space is supposed to be used for acting with MovieClips
  (opening, playbacking, math-moving interaction and so on).

  Currently you could open image sequence/movie file here, pan/zoom,
  use a playback here.

  I've added cache visualizer to this space, but it's currently more
  a developer's feature to see how cache system works, but it could
  be adopted for further artists' usage (something like cache visuzlizer
  for simulations).

- Added new theme area for Space Clip.
  No special colors were defined here yet.

- Implementation of basic cache system for movies.
  This cache system is very familiar with sequence cache system,
  but it supposed to be more portable: at least cache keys aren't
  limited with sequence-based data and current seqcache could
  became an interface between sequencer and moviecache without
  much logic (only logic related on keys handling would be necessary
  here).

  Implemented basic limitors (ab\mount of cached imbuf's), so it'll
  be a bit more difficult to go out of memory when playing long
  animations in Image Editor (this cache system could be used for
  images too, in the future).

- Very basic tools implementation -- only sceletion added, no
  real tool implemented (only camera focal length added to the UI
  which hasn't got real affect on anything).

Assorted notes:
- Not sure about best behaviour for Unlink clip button: should
  it be imageeditor-like (with de-referencing only) or text-editor
  like (with removing datablock from file).
- Also not sure if tools/properties should be splitted into
  different areas or it'll be better to have tools and settings
  for this tool/item/etc in the same area (tools at the top,
  properties are under them).
  Code for properties area is '#if 0'-ed.
- Sound isn't supported during playback in movie clip.

Modified Paths:
--------------
    branches/soc-2011-tomato/release/datafiles/blenderbuttons
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/__init__.py
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_time.py
    branches/soc-2011-tomato/source/blender/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_context.h
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_main.h
    branches/soc-2011-tomato/source/blender/blenkernel/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/blenkernel/intern/context.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/idcode.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/library.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/readblenentry.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.h
    branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c
    branches/soc-2011-tomato/source/blender/editors/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/SConscript
    branches/soc-2011-tomato/source/blender/editors/datafiles/blenderbuttons.c
    branches/soc-2011-tomato/source/blender/editors/datafiles/startup.blend.c
    branches/soc-2011-tomato/source/blender/editors/include/ED_space_api.h
    branches/soc-2011-tomato/source/blender/editors/include/UI_icons.h
    branches/soc-2011-tomato/source/blender/editors/interface/resources.c
    branches/soc-2011-tomato/source/blender/editors/screen/area.c
    branches/soc-2011-tomato/source/blender/editors/screen/screen_edit.c
    branches/soc-2011-tomato/source/blender/editors/screen/screen_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_api/spacetypes.c
    branches/soc-2011-tomato/source/blender/editors/util/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/makesdna/DNA_ID.h
    branches/soc-2011-tomato/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-tomato/source/blender/makesdna/DNA_space_types.h
    branches/soc-2011-tomato/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2011-tomato/source/blender/makesdna/intern/makesdna.c
    branches/soc-2011-tomato/source/blender/makesrna/RNA_access.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/makesrna/intern/makesrna.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_ID.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_internal.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_main.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_main_api.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_screen.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_space.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c
    branches/soc-2011-tomato/source/blender/windowmanager/WM_types.h
    branches/soc-2011-tomato/source/blenderplayer/bad_level_call_stubs/stubs.c
    branches/soc-2011-tomato/source/creator/CMakeLists.txt

Added Paths:
-----------
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_moviecache.h
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_movieclip.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/moviecache.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c
    branches/soc-2011-tomato/source/blender/editors/include/ED_movieclip.h
    branches/soc-2011-tomato/source/blender/editors/space_clip/
    branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/space_clip/SConscript
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_editor.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_header.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_intern.h
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_movieclip_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_movieclip.c

Modified: branches/soc-2011-tomato/release/datafiles/blenderbuttons
===================================================================
(Binary files differ)

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/__init__.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/__init__.py  
2011-05-30 04:10:25 UTC (rev 37010)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/__init__.py  
2011-05-30 04:18:02 UTC (rev 37011)
@@ -51,6 +51,7 @@
     "properties_scene",
     "properties_texture",
     "properties_world",
+    "space_clip",
     "space_console",
     "space_dopesheet",
     "space_filebrowser",

Added: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py        
                        (rev 0)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py        
2011-05-30 04:18:02 UTC (rev 37011)
@@ -0,0 +1,141 @@
+# ##### 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
+
+
+class CLIP_HT_header(bpy.types.Header):
+    bl_space_type = 'CLIP_EDITOR'
+
+    def draw(self, context):
+        layout = self.layout
+
+        sc = context.space_data
+
+        row = layout.row(align=True)
+        row.template_header()
+
+        if context.area.show_menus:
+            sub = row.row(align=True)
+            sub.menu("CLIP_MT_view")
+            sub.menu("CLIP_MT_clip")
+
+        layout.template_ID(sc, "clip")
+
+
+class CLIP_PT_tools(bpy.types.Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'TOOLS'
+    bl_label = "Tools"
+
+    def draw(self, context):
+        layout = self.layout
+        clip = context.space_data.clip
+
+        if clip:
+            ts = context.tool_settings
+            col = layout.column()
+            col.prop(ts.movieclip, 'tool', expand=True)
+        else:
+            layout.operator('clip.open', icon='FILESEL')
+
+class CLIP_PT_footage_camera(bpy.types.Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'TOOLS'
+    bl_label = "Footage Settings"
+
+    @classmethod
+    def poll(cls, context):
+        clip = context.space_data.clip
+        ts = context.tool_settings
+        tool = ts.movieclip.tool
+
+        return (clip and tool == 'FOOTAGE')
+
+    def draw(self, context):
+        layout = self.layout
+
+        sc = context.space_data
+        clip = sc.clip
+
+        layout.label(text="File Path:")
+        layout.prop(clip, "filepath", text="")
+
+
+class CLIP_PT_tracking_camera(bpy.types.Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'TOOLS'
+    bl_label = "Camera Data"
+
+    @classmethod
+    def poll(cls, context):
+        clip = context.space_data.clip
+        ts = context.tool_settings
+        tool = ts.movieclip.tool
+
+        return (clip and tool == 'CAMERA')
+
+    def draw(self, context):
+        layout = self.layout
+
+        sc = context.space_data
+        clip = sc.clip
+
+        layout.prop(clip.tracking.camera, "focal_length")
+
+
+class CLIP_PT_debug(bpy.types.Panel):
+    bl_space_type = 'CLIP_EDITOR'
+    bl_region_type = 'TOOLS'
+    bl_label = "Debug"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw(self, context):
+        layout = self.layout
+        sc = context.space_data
+
+        layout.prop(sc, "show_cache")
+
+
+class CLIP_MT_view(bpy.types.Menu):
+    bl_label = "View"
+
+    def draw(self, context):
+        layout = self.layout
+
+        # layout.operator("clip.properties", icon='MENU_PANEL')
+        layout.operator("clip.tools", icon='MENU_PANEL')
+        layout.separator()
+
+        layout.operator("screen.area_dupli")
+        layout.operator("screen.screen_full_area")
+
+
+class CLIP_MT_clip(bpy.types.Menu):
+    bl_label = "Clip"
+
+    def draw(self, context):
+        layout = self.layout
+
+        sc = context.space_data
+
+        layout.operator('clip.open')
+
+if __name__ == "__main__":  # only for live edit.
+    bpy.utils.register_module(__name__)

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_time.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_time.py        
2011-05-30 04:10:25 UTC (rev 37010)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_time.py        
2011-05-30 04:18:02 UTC (rev 37011)
@@ -178,6 +178,7 @@
         layout.prop(screen, "use_play_image_editors")
         layout.prop(screen, "use_play_sequence_editors")
         layout.prop(screen, "use_play_node_editors")
+        layout.prop(screen, "use_play_clip_editors")
 
         layout.separator()
 

Modified: branches/soc-2011-tomato/source/blender/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/CMakeLists.txt      2011-05-30 
04:10:25 UTC (rev 37010)
+++ branches/soc-2011-tomato/source/blender/CMakeLists.txt      2011-05-30 
04:18:02 UTC (rev 37011)
@@ -82,6 +82,7 @@
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_view3d_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_windowmanager_types.h
        ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_world_types.h
+       ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_movieclip_types.h
 )
 
 add_subdirectory(editors)

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_context.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_context.h    
2011-05-30 04:10:25 UTC (rev 37010)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_context.h    
2011-05-30 04:18:02 UTC (rev 37011)
@@ -63,6 +63,7 @@
 struct wmWindowManager;
 struct SpaceText;
 struct SpaceImage;
+struct SpaceClip;
 struct ID;
 
 /* Structs */
@@ -160,6 +161,7 @@
 struct SpaceAction *CTX_wm_space_action(const bContext *C);
 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);
 
 void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm);
 void CTX_wm_window_set(bContext *C, struct wmWindow *win);
@@ -254,6 +256,7 @@
 struct Image *CTX_data_edit_image(const bContext *C);
 
 struct Text *CTX_data_edit_text(const bContext *C);
+struct MovieClip *CTX_data_edit_movieclip(const bContext *C);
 
 int CTX_data_selected_nodes(const bContext *C, ListBase *list);
 

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_main.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_main.h       
2011-05-30 04:10:25 UTC (rev 37010)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_main.h       
2011-05-30 04:18:02 UTC (rev 37011)
@@ -86,6 +86,7 @@
        ListBase particle;
        ListBase wm;
        ListBase gpencil;
+       ListBase movieclip;
 
        char id_tag_update[256];
 } Main;

Added: branches/soc-2011-tomato/source/blender/blenkernel/BKE_moviecache.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_moviecache.h         
                (rev 0)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_moviecache.h 
2011-05-30 04:18:02 UTC (rev 37011)
@@ -0,0 +1,54 @@
+/*
+ * $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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation,
+ *                 Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BKE_MOVIECACHE_H
+#define BKE_MOVIECACHE_H
+
+/** \file BKE_moviecache.h
+ *  \ingroup bke
+ *  \author Sergey Sharybin
+ */
+
+#include "BLI_ghash.h"
+
+/* Cache system for movie data - now supports stroting ImBufs only
+   Supposed to provide unified cache system for movie clips, sequencer and
+   other movie-related areas */
+
+struct ImBuf;
+struct MovieCache;
+
+typedef void (*MovieCacheGetKeyDataFP) (void *userkey, int *framenr);
+
+struct MovieCache *BKE_moviecache_create(int keysize, GHashHashFP hashfp, 
GHashCmpFP cmpfp, MovieCacheGetKeyDataFP getdatafp);
+void BKE_moviecache_put(struct MovieCache *cache, void *userkey, struct ImBuf 
*ibuf);
+struct ImBuf* BKE_moviecache_get(struct MovieCache *cache, void *userkey);
+void BKE_moviecache_free(struct MovieCache *cache);
+void BKE_moviecache_get_cache_segments(struct MovieCache *cache, int 
*totseg_r, int **points_r);
+
+#endif

Added: branches/soc-2011-tomato/source/blender/blenkernel/BKE_movieclip.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_movieclip.h          
                (rev 0)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_movieclip.h  
2011-05-30 04:18:02 UTC (rev 37011)
@@ -0,0 +1,51 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to