Merging r37732 through r37862 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 27 Jun 2011 14:20:48 +0000 (14:20 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 27 Jun 2011 14:20:48 +0000 (14:20 +0000)
1  2 
CMakeLists.txt
intern/itasc/ConstraintSet.cpp
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/CMakeLists.txt
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_userdef.c

diff --combined CMakeLists.txt
index 09685ba29c3bbbc647d5858c389d3070f6baacdf,88a1c63adadb0c484a7b04526c6fd2bc03a07817..fda6459efbb23954601d5da12c2b0778cfacf035
@@@ -57,6 -57,9 +57,9 @@@ endif(
  # this starts out unset
  list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules")
  
+ # avoid having empty buildtype
+ set(CMAKE_BUILD_TYPE_INIT "Release")
  # quiet output for Makefiles, 'make -s' helps too
  # set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
  
@@@ -104,6 -107,9 +107,9 @@@ option(WITH_BULLET        "Enable Bulle
  option(WITH_GAMEENGINE    "Enable Game Engine" ON)
  option(WITH_PLAYER        "Build Player" OFF)
  
+ option(WITH_AUDASPACE    "Build with blenders audio library" ON)
+ mark_as_advanced(WITH_AUDASPACE)
  option(WITH_HEADLESS      "Build without graphical support (renderfarm, server mode only)" OFF)
  mark_as_advanced(WITH_HEADLESS)
  
@@@ -159,9 -165,6 +165,9 @@@ option(WITH_SAMPLERATE    "Enable sampl
  option(WITH_LZO           "Enable fast LZO compression (used for pointcache)" ON)
  option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)" ON)
  
 +# Tracking
 +option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
 +
  # Misc
  option(WITH_RAYOPTIMIZATION   "Enable use of SIMD (SSE) optimizations for the raytracer" ON) 
  if(UNIX AND NOT APPLE)
@@@ -203,8 -206,8 +209,8 @@@ if(NOT WITH_GAMEENGINE AND WITH_PLAYER
        message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
  endif()
  
- if(NOT WITH_SAMPLERATE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
-       message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK require WITH_SAMPLERATE")
+ if(NOT WITH_AUDASPACE AND (WITH_OPENAL OR WITH_SDL OR WITH_JACK))
+       message(FATAL_ERROR "WITH_OPENAL/WITH_SDL/WITH_JACK/WITH_CODEC_FFMPEG require WITH_AUDASPACE")
  endif()
  
  if(NOT WITH_IMAGE_OPENJPEG AND WITH_IMAGE_REDCODE)
@@@ -544,13 -547,13 +550,13 @@@ elseif(WIN32
  
        if(MSVC)
                if(CMAKE_CL_64)
-                       set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid )
+                       set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
                else()
-                       set(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
+                       set(LLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid)
                endif()
                
-               set(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /we4013 /wd4018 /wd4800 /wd4244 /wd4305 /wd4065 /wd4267" CACHE STRING "MSVC MT C++ flags " FORCE)
-               set(CMAKE_C_FLAGS   "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /we4013 /wd4018 /wd4800 /wd4244 /wd4305 /wd4065 /wd4267" CACHE STRING "MSVC MT C++ flags " FORCE)
+               set(CMAKE_CXX_FLAGS "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013" CACHE STRING "MSVC MT C++ flags " FORCE)
+               set(CMAKE_C_FLAGS   "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_CONSOLE /D_LIB /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /EHsc" CACHE STRING "MSVC MT C++ flags " FORCE)
  
                if(CMAKE_CL_64)
                        set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE)
  
                # MSVC only, Mingw doesnt need
                if(CMAKE_CL_64)
-                       set(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib /STACK:2097152 ")
+                       set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:X64 /STACK:2097152 /OPT:NOREF /INCREMENTAL:NO /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ")
                else()
-                       set(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib /STACK:2097152 ")
+                       set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /MACHINE:IX86 /STACK:2097152 /INCREMENTAL:NO /LARGEADDRESSAWARE /NODEFAULTLIB:\"msvcrt.lib\" /NODEFAULTLIB:\"msvcmrt.lib\" /NODEFAULTLIB:\"msvcurt.lib\" /NODEFAULTLIB:\"msvcrtd.lib\" ")
                endif()
  
                set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ")
                        set(PYTHON_VERSION 3.2)
                        set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}")
                        # set(PYTHON_BINARY python) # not used yet
-                       set(PYTHON_LIBRARIES python32mw)
+                       set(PYTHON_LIBRARIES ${PYTHON}/lib/python32mw.lib)
                        set(PYTHON_LIBPATH ${PYTHON}/lib)
                endif()
  
@@@ -996,7 -999,7 +1002,7 @@@ endif(
  # Common.
  
  if(APPLE OR WIN32)
-       if(NOT IS_DIRECTORY "${LIBDIR}")
+       if(NOT EXISTS "${LIBDIR}/")
                message(FATAL_ERROR "Apple and Windows require pre-compiled libs at: '${LIBDIR}'")
        endif()
  endif()
index a4a440f8e0552fa3169de8c83da739acc698ec87,b07dc5bb9837308d4066d462130e264cf6076781..91b6e914a403bebaa21ac40a55b72e90b09d85b9
@@@ -80,7 -80,7 +80,7 @@@ void ConstraintSet::modelUpdate(Frame& 
  
  double ConstraintSet::getMaxTimestep(double& timestep)
  {
 -      e_scalar maxChidot = m_chidot.cwise().abs().maxCoeff();
 +      e_scalar maxChidot = m_chidot.array().abs().maxCoeff();
        if (timestep*maxChidot > m_maxDeltaChi) {
                timestep = m_maxDeltaChi/maxChidot;
        }
@@@ -134,6 -134,7 +134,7 @@@ bool ConstraintSet::setControlParameter
                break;
        default:
                assert(action==ACT_NONE);
+               break;
        }
        return setControlParameters(&values, 1, timestep);
  }
@@@ -161,9 -162,9 +162,9 @@@ bool ConstraintSet::closeLoop()
          }else
              m_B.row(i) = m_U.col(i)/m_S(i);
  
 -    m_Jf_inv=(m_V*m_B).lazy();
 +    m_Jf_inv.noalias()=m_V*m_B;
  
 -    m_chi+=(m_Jf_inv*m_tdelta).lazy();
 +    m_chi.noalias()+=m_Jf_inv*m_tdelta;
      updateJacobian();
        // m_externalPose-m_internalPose in end effector frame
        // this is just to compare the pose, a different formula would work too
index ac41e689277672a1f031590d47212d780e90efe3,2b58f2a216fbff9a615300c5f9eba99fb946c34c..0096549bc8f47bb3ebedc370265405ff0abca293
@@@ -774,10 -774,16 +774,16 @@@ class VIEW3D_MT_object_specials(bpy.typ
          if obj.type == 'CAMERA':
              layout.operator_context = 'INVOKE_REGION_WIN'
  
-             props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
-             props.data_path_iter = "selected_editable_objects"
-             props.data_path_item = "data.lens"
-             props.input_scale = 0.1
+             if obj.data.type == 'PERSP':
+                 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
+                 props.data_path_iter = "selected_editable_objects"
+                 props.data_path_item = "data.lens"
+                 props.input_scale = 0.1
+             else:
+                 props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
+                 props.data_path_iter = "selected_editable_objects"
+                 props.data_path_item = "data.ortho_scale"
+                 props.input_scale = 0.01
  
              if not obj.data.dof_object:
                  #layout.label(text="Test Has DOF obj");
@@@ -1100,17 -1106,18 +1106,18 @@@ class VIEW3D_MT_sculpt(bpy.types.Menu)
          layout.operator_menu_enum("brush.curve_preset", "shape")
          layout.separator()
  
-         sculpt_tool = brush.sculpt_tool
+         if brush is not None:  # unlikely but can happen
+             sculpt_tool = brush.sculpt_tool
  
-         if sculpt_tool != 'GRAB':
-             layout.prop_menu_enum(brush, "stroke_method")
+             if sculpt_tool != 'GRAB':
+                 layout.prop_menu_enum(brush, "stroke_method")
  
-             if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
-                 layout.prop_menu_enum(brush, "direction")
+                 if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
+                     layout.prop_menu_enum(brush, "direction")
  
-             if sculpt_tool == 'LAYER':
-                 layout.prop(brush, "use_persistent")
-                 layout.operator("sculpt.set_persistent_base")
+                 if sculpt_tool == 'LAYER':
+                     layout.prop(brush, "use_persistent")
+                     layout.operator("sculpt.set_persistent_base")
  
          layout.separator()
          layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
@@@ -1245,7 -1252,7 +1252,7 @@@ class VIEW3D_MT_pose(bpy.types.Menu)
          layout.separator()
  
          layout.menu("VIEW3D_MT_pose_showhide")
-         layout.operator_menu_enum("pose.flags_set", 'mode', text="Bone Settings")
+         layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
  
  
  class VIEW3D_MT_pose_transform(bpy.types.Menu):
@@@ -1366,6 -1373,49 +1373,49 @@@ class VIEW3D_MT_pose_apply(bpy.types.Me
          layout.operator("pose.visual_transform_apply")
  
  
+ class BoneOptions:
+     def draw(self, context):
+         layout = self.layout
+         options = [
+             "show_wire",
+             "use_deform",
+             "use_envelope_multiply",
+             "use_inherit_rotation",
+             "use_inherit_scale",
+         ]
+         if context.mode == 'EDIT_ARMATURE':
+             bone_props = bpy.types.EditBone.bl_rna.properties
+             data_path_iter = "selected_bones"
+             opt_suffix = ""
+             options.append("lock")
+         else:  # posemode
+             bone_props = bpy.types.Bone.bl_rna.properties
+             data_path_iter = "selected_pose_bones"
+             opt_suffix = "bone."
+         for opt in options:
+             props = layout.operator("wm.context_collection_boolean_set", text=bone_props[opt].name)
+             props.data_path_iter = data_path_iter
+             props.data_path_item = opt_suffix + opt
+             props.type = self.type
+ class VIEW3D_MT_bone_options_toggle(bpy.types.Menu, BoneOptions):
+     bl_label = "Toggle Bone Options"
+     type = 'TOGGLE'
+ class VIEW3D_MT_bone_options_enable(bpy.types.Menu, BoneOptions):
+     bl_label = "Enable Bone Options"
+     type = 'ENABLE'
+ class VIEW3D_MT_bone_options_disable(bpy.types.Menu, BoneOptions):
+     bl_label = "Disable Bone Options"
+     type = 'DISABLE'
  # ********** Edit Menus, suffix from ob.type **********
  
  
@@@ -1959,7 -2009,7 +2009,7 @@@ class VIEW3D_MT_edit_armature(bpy.types
  
          layout.separator()
  
-         layout.operator_menu_enum("armature.flags_set", "mode", text="Bone Settings")
+         layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
  
  
  class VIEW3D_MT_armature_specials(bpy.types.Menu):
@@@ -2235,10 -2285,8 +2285,10 @@@ class VIEW3D_PT_background_image(bpy.ty
              box = layout.box()
              row = box.row(align=True)
              row.prop(bg, "show_expanded", text="", emboss=False)
 -            if bg.image:
 +            if bg.source == 'IMAGE' and bg.image:
                  row.prop(bg.image, "name", text="", emboss=False)
 +            if bg.source == 'MOVIE' and bg.clip:
 +                row.prop(bg.clip, "name", text="", emboss=False)
              else:
                  row.label(text="Not Set")
              row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
  
              if bg.show_expanded:
                  row = box.row()
 -                row.template_ID(bg, "image", open="image.open")
 -                if (bg.image):
 -                    box.template_image(bg, "image", bg.image_user, compact=True)
 +                row.prop(bg, "source", expand=True)
  
 +                hasbg = False
 +                if bg.source == 'IMAGE':
 +                    row = box.row()
 +                    row.template_ID(bg, "image", open="image.open")
 +                    if (bg.image):
 +                        box.template_image(bg, "image", bg.image_user, compact=True)
 +                        hasbg = True
 +
 +                elif bg.source == 'MOVIE':
 +                    row = box.row()
 +                    row.template_ID(bg, "clip", open="clip.open")
 +
 +                    if bg.clip:
 +                        box.template_movieclip(bg, "clip", bg.clip_user, compact=True)
 +                        hasbg = True
 +
 +                if hasbg:
                      box.prop(bg, "opacity", slider=True)
                      if bg.view_axis != 'CAMERA':
                          box.prop(bg, "size")
index e050d8a6d9e739244c0562344ce6d93cc489078f,a19d48daa75d936c95ace7e0e07c085ffec85ca7..ee6b3d7aa3bee84764762b1473a40e00bc71d2d0
@@@ -43,8 -43,6 +43,6 @@@ set(IN
        ../nodes
        ../editors/include
        ../render/extern/include
-       ../../../intern/audaspace/intern
-       ../../../intern/ffmpeg
        ../../../intern/bsp/extern ../blenfont
        ../../../intern/decimation/extern
        ../../../intern/elbeem/extern
@@@ -116,8 -114,6 +114,8 @@@ set(SR
        intern/mesh.c
        intern/mesh_validate.c
        intern/modifier.c
 +      intern/movieclip.c
 +      intern/moviecache.c
        intern/multires.c
        intern/nla.c
        intern/node.c
        intern/suggestions.c
        intern/text.c
        intern/texture.c
 +      intern/tracking.c
        intern/unit.c
        intern/world.c
        intern/writeavi.c
        BKE_mball.h
        BKE_mesh.h
        BKE_modifier.h
 +      BKE_movieclip.h
 +      BKE_moviecache.h
        BKE_multires.h
        BKE_nla.h
        BKE_node.h
        BKE_suggestions.h
        BKE_text.h
        BKE_texture.h
 +      BKE_tracking.h
        BKE_unit.h
        BKE_utildefines.h
        BKE_world.h
  
  add_definitions(-DGLEW_STATIC)
  
+ if(WITH_AUDASPACE)
+       list(APPEND INC
+               ../../../intern/audaspace/intern
+       )
+       add_definitions(-DWITH_AUDASPACE)
+ endif()
  if(WITH_BULLET)
        list(APPEND INC ../../../extern/bullet2/src)
        add_definitions(-DUSE_BULLET)
@@@ -284,6 -283,7 +289,7 @@@ if(WITH_CODEC_QUICKTIME
  endif()
  
  if(WITH_CODEC_FFMPEG)
+       list(APPEND INC ../../../intern/ffmpeg)
        list(APPEND INC_SYS ${FFMPEG_INCLUDE_DIRS})
        add_definitions(-DWITH_FFMPEG)
  endif()
@@@ -320,11 -320,6 +326,11 @@@ if(WITH_LZMA
        add_definitions(-DWITH_LZMA)
  endif()
  
 +if(WITH_LIBMV)
 +      list(APPEND INC ../../../extern/libmv)
 +      add_definitions(-DWITH_LIBMV)
 +endif()
 +
  if(MSVC)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
  endif()
index 3096e8f9827efc275b4bcfbc6d5c39e7522abae6,2637e114fbc891a242d047cef46064b2d0201b68..3e76277dff084decf23066857f8c675dc2a8bfc4
@@@ -88,7 -88,6 +88,7 @@@
  #include "DNA_space_types.h"
  #include "DNA_vfont_types.h"
  #include "DNA_world_types.h"
 +#include "DNA_movieclip_types.h"
  
  #include "MEM_guardedalloc.h"
  
@@@ -1033,8 -1032,6 +1033,8 @@@ void blo_freefiledata(FileData *fd
                        oldnewmap_free(fd->globmap);
                if (fd->imamap)
                        oldnewmap_free(fd->imamap);
 +              if (fd->movieclipmap)
 +                      oldnewmap_free(fd->movieclipmap);
                if (fd->libmap && !(fd->flags & FD_FLAGS_NOT_MY_LIBMAP))
                        oldnewmap_free(fd->libmap);
                if (fd->bheadmap)
@@@ -1110,13 -1107,6 +1110,13 @@@ static void *newimaadr(FileData *fd, vo
        return NULL;
  }
  
 +static void *newmclipadr(FileData *fd, void *adr)              /* used to restore movie clip data after undo */
 +{
 +      if(fd->movieclipmap && adr)
 +              return oldnewmap_lookup_and_inc(fd->movieclipmap, adr);
 +      return NULL;
 +}
 +
  
  static void *newlibadr(FileData *fd, void *lib, void *adr)            /* only lib data */
  {
@@@ -1245,38 -1235,6 +1245,38 @@@ void blo_end_image_pointer_map(FileDat
        }
  }
  
 +void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain)
 +{
 +      MovieClip *clip= oldmain->movieclip.first;
 +
 +      fd->movieclipmap= oldnewmap_new();
 +
 +      for(;clip; clip= clip->id.next) {
 +              if(clip->ibuf_cache)
 +                      oldnewmap_insert(fd->movieclipmap, clip->ibuf_cache, clip->ibuf_cache, 0);
 +      }
 +}
 +
 +/* set old main movie clips caches to zero if it has been restored */
 +/* this works because freeing old main only happens after this call */
 +void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
 +{
 +      OldNew *entry= fd->movieclipmap->entries;
 +      MovieClip *clip= oldmain->movieclip.first;
 +      int i;
 +
 +      /* used entries were restored, so we put them to zero */
 +      for (i=0; i<fd->movieclipmap->nentries; i++, entry++) {
 +              if (entry->nr>0)
 +                              entry->newp= NULL;
 +      }
 +
 +      for(;clip; clip= clip->id.next) {
 +              clip->ibuf_cache= newmclipadr(fd, clip->ibuf_cache);
 +      }
 +}
 +
 +
  /* undo file support: add all library pointers in lookup */
  void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd)
  {
@@@ -3580,6 -3538,18 +3580,18 @@@ static void direct_link_mesh(FileData *
                mesh->mr->edge_creases= newdataadr(fd, mesh->mr->edge_creases);
  
                mesh->mr->verts = newdataadr(fd, mesh->mr->verts);
+               
+               /* If mesh has the same number of vertices as the
+                  highest multires level, load the current mesh verts
+                  into multires and discard the old data. Needed
+                  because some saved files either do not have a verts
+                  array, or the verts array contains out-of-date
+                  data. */
+               if(mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert) {
+                       if(mesh->mr->verts)
+                               MEM_freeN(mesh->mr->verts);
+                       mesh->mr->verts = MEM_dupallocN(mesh->mvert);
+               }
                        
                for(; lvl; lvl= lvl->next) {
                        lvl->verts= newdataadr(fd, lvl->verts);
                }
        }
  
-       /* Gracefully handle corrupted mesh */
+       /* if multires is present but has no valid vertex data,
+          there's no way to recover it; silently remove multires */
        if(mesh->mr && !mesh->mr->verts) {
-               /* If totals match, simply load the current mesh verts into multires */
-               if(mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert)
-                       mesh->mr->verts = MEM_dupallocN(mesh->mvert);
-               else {
-                       /* Otherwise, we can't recover the data, silently remove multires */
-                       multires_free(mesh->mr);
-                       mesh->mr = NULL;
-               }
+               multires_free(mesh->mr);
+               mesh->mr = NULL;
        }
        
        if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) {
@@@ -4845,7 -4810,6 +4852,7 @@@ static void lib_link_screen(FileData *f
  
                                                for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
                                                        bgpic->ima= newlibadr_us(fd, sc->id.lib, bgpic->ima);
 +                                                      bgpic->clip= newlibadr_us(fd, sc->id.lib, bgpic->clip);
                                                }
                                                if(v3d->localvd) {
                                                        v3d->localvd->camera= newlibadr(fd, sc->id.lib, v3d->localvd->camera);
                                                
                                                snode->linkdrag.first = snode->linkdrag.last = NULL;
                                        }
 +                                      else if(sl->spacetype==SPACE_CLIP) {
 +                                              SpaceClip *sclip= (SpaceClip *)sl;
 +
 +                                              sclip->clip= newlibadr_us(fd, sc->id.lib, sclip->clip);
 +                                      }
                                }
                                sa= sa->next;
                        }
@@@ -5063,7 -5022,6 +5070,7 @@@ void lib_link_screen_restore(Main *newm
                                        
                                        for(bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
                                                bgpic->ima= restore_pointer_by_name(newmain, (ID *)bgpic->ima, 1);
 +                                              bgpic->clip= restore_pointer_by_name(newmain, (ID *)bgpic->clip, 1);
                                        }
                                        if(v3d->localvd) {
                                                /*Base *base;*/
                                                        snode->nodetree= ((Tex *)snode->id)->nodetree;
                                        }
                                }
 +                              else if(sl->spacetype==SPACE_CLIP) {
 +                                      SpaceClip *sclip= (SpaceClip *)sl;
 +
 +                                      sclip->clip= restore_pointer_by_name(newmain, (ID *)sclip->clip, 1);
 +                              }
                        }
                        sa= sa->next;
                }
@@@ -5652,60 -5605,6 +5659,60 @@@ static void lib_link_group(FileData *fd
        }
  }
  
 +/* ***************** READ MOVIECLIP *************** */
 +
 +static void direct_link_movieclip(FileData *fd, MovieClip *clip)
 +{
 +      MovieTrackingTrack *track;
 +      MovieTrackingBundle *bundle;
 +
 +      if(fd->movieclipmap) clip->ibuf_cache= newmclipadr(fd, clip->ibuf_cache);
 +      else clip->ibuf_cache= NULL;
 +
 +      clip->adt= newdataadr(fd, clip->adt);
 +      direct_link_animdata(fd, clip->adt);
 +
 +      link_list(fd, &clip->tracking.tracks);
 +
 +      track= clip->tracking.tracks.first;
 +      while(track) {
 +              track->bundle= newdataadr(fd, track->bundle);
 +              track->markers= newdataadr(fd, track->markers);
 +
 +              track= track->next;
 +      }
 +
 +      link_list(fd, &clip->tracking.bundles);
 +      bundle= clip->tracking.bundles.first;
 +      while(bundle) {
 +              bundle->track= newdataadr(fd, bundle->track);
 +
 +              bundle= bundle->next;
 +      }
 +
 +      clip->last_sel= newdataadr(fd, clip->last_sel);
 +      if(clip->last_sel==NULL)
 +              clip->sel_type= MCLIP_SEL_NONE;
 +
 +      clip->anim= NULL;
 +      clip->tracking_context= NULL;
 +}
 +
 +static void lib_link_movieclip(FileData *fd, Main *main)
 +{
 +      MovieClip *clip;
 +
 +      clip= main->movieclip.first;
 +      while(clip) {
 +              if(clip->id.flag & LIB_NEEDLINK) {
 +                      if(clip->adt) lib_link_animdata(fd, &clip->id, clip->adt);
 +
 +                      clip->id.flag -= LIB_NEEDLINK;
 +              }
 +              clip= clip->id.next;
 +      }
 +}
 +
  /* ************** GENERAL & MAIN ******************** */
  
  
@@@ -5739,7 -5638,6 +5746,7 @@@ static const char *dataname(short id_co
                case ID_BR: return "Data from BR";
                case ID_PA: return "Data from PA";
                case ID_GD: return "Data from GD";
 +              case ID_MC: return "Data from MC";
        }
        return "Data from Lib Block";
        
@@@ -5906,9 -5804,6 +5913,9 @@@ static BHead *read_libblock(FileData *f
                case ID_GD:
                        direct_link_gpencil(fd, (bGPdata *)id);
                        break;
 +              case ID_MC:
 +                      direct_link_movieclip(fd, (MovieClip *)id);
 +                      break;
        }
        
        /*link direct data of ID properties*/
@@@ -11706,9 -11601,7 +11713,7 @@@ static void do_versions(FileData *fd, L
                                        }
        }
  
-       /* put compatibility code here until next subversion bump */
-       {
+       if (main->versionfile < 258 || (main->versionfile == 258 && main->subversionfile < 1)){
                /* screen view2d settings were not properly initialized [#27164]
                 * v2d->scroll caused the bug but best reset other values too which are in old blend files only.
                 * need to make less ugly - possibly an iterator? */
                                }
                        }
                }
+               {
+                       ParticleSettings *part;
+                       for(part = main->particle.first; part; part = part->id.next) {
+                               /* Initialize particle billboard scale */
+                               part->bb_size[0] = part->bb_size[1] = 1.0f;
+                       }
+               }
+       }
+       
+       /* put compatibility code here until next subversion bump */
+       {
+       
        }
        
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
@@@ -11820,7 -11727,6 +11839,7 @@@ static void lib_link_all(FileData *fd, 
        lib_link_nodetree(fd, main);    /* has to be done after scene/materials, this will verify group nodes */
        lib_link_brush(fd, main);
        lib_link_particlesettings(fd, main);
 +      lib_link_movieclip(fd, main);
  
        lib_link_mesh(fd, main);                /* as last: tpage images with users at zero */
  
@@@ -11858,7 -11764,8 +11877,8 @@@ static BHead *read_userdef(BlendFileDat
  
        // XXX
        user->uifonts.first= user->uifonts.last= NULL;
-       user->uistyles.first= user->uistyles.last= NULL;
+       
+       link_list(fd, &user->uistyles);
  
        /* free fd->datamap again */
        oldnewmap_free_unused(fd->datamap);
index 6772ce7f41dd203a1386359f40c8226aae5b6622,d5192eaf09c3e27d6f309e99e9d98a037ad9ef55..4689a69a87f3a4596c49b6252d50b3bf496743ba
@@@ -129,7 -129,6 +129,7 @@@ Any case: direct data is ALWAYS after t
  #include "DNA_vfont_types.h"
  #include "DNA_world_types.h"
  #include "DNA_windowmanager_types.h"
 +#include "DNA_movieclip_types.h"
  
  #include "MEM_guardedalloc.h" // MEM_freeN
  #include "BLI_blenlib.h"
@@@ -724,7 -723,8 +724,8 @@@ static void write_userdef(WriteData *wd
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
        bAddon *bext;
+       uiStyle *style;
+       
        writestruct(wd, USER, "UserDef", 1, &U);
  
        for(btheme= U.themes.first; btheme; btheme=btheme->next)
  
        for(bext= U.addons.first; bext; bext=bext->next)
                writestruct(wd, DATA, "bAddon", 1, bext);
+       
+       for(style= U.uistyles.first; style; style= style->next) {
+               writestruct(wd, DATA, "uiStyle", 1, style);
+       }
  }
  
  static void write_boid_state(WriteData *wd, BoidState *state)
@@@ -2171,9 -2175,6 +2176,9 @@@ static void write_screens(WriteData *wd
                                else if(sl->spacetype==SPACE_USERPREF) {
                                        writestruct(wd, DATA, "SpaceUserPref", 1, sl);
                                }
 +                              else if(sl->spacetype==SPACE_CLIP) {
 +                                      writestruct(wd, DATA, "SpaceClip", 1, sl);
 +                              }
  
                                sl= sl->next;
                        }
@@@ -2405,43 -2406,6 +2410,43 @@@ static void write_scripts(WriteData *wd
        }
  }
  
 +static void write_movieclips(WriteData *wd, ListBase *idbase)
 +{
 +      MovieClip *clip;
 +
 +      clip= idbase->first;
 +      while(clip) {
 +              if(clip->id.us>0 || wd->current) {
 +                      MovieTrackingTrack *track;
 +                      MovieTrackingBundle *bundle;
 +                      writestruct(wd, ID_MC, "MovieClip", 1, clip);
 +
 +                      if (clip->adt) write_animdata(wd, clip->adt);
 +
 +                      track= clip->tracking.tracks.first;
 +                      while(track) {
 +                              writestruct(wd, DATA, "MovieTrackingTrack", 1, track);
 +                              if(track->markers)
 +                                      writedata(wd, DATA, track->markersnr*sizeof(MovieTrackingMarker), track->markers);
 +
 +                              track= track->next;
 +                      }
 +
 +                      bundle= clip->tracking.bundles.first;
 +                      while(bundle) {
 +                              writestruct(wd, DATA, "MovieTrackingBundle", 1, bundle);
 +
 +                              bundle= bundle->next;
 +                      }
 +              }
 +
 +              clip= clip->id.next;
 +      }
 +
 +      /* flush helps the compression for undo-save */
 +      mywrite(wd, MYWRITE_FLUSH, 0);
 +}
 +
  /* context is usually defined by WM, two cases where no WM is available:
   * - for forward compatibility, curscreen has to be saved
   * - for undofile, curscene needs to be saved */
@@@ -2542,7 -2506,6 +2547,7 @@@ static int write_file_handle(Main *main
        write_brushes  (wd, &mainvar->brush);
        write_scripts  (wd, &mainvar->script);
        write_gpencils (wd, &mainvar->gpencil);
 +      write_movieclips (wd, &mainvar->movieclip);
        write_libraries(wd,  mainvar->next);
  
        if (write_user_block) {
index a23984fce59b3aed20016c0083827c3b8c5afe4d,1db29855c1842b5963f255175976957e3b0a8e46..275b7afd3894ec1fdb7064a9983c411d5bdce4e8
@@@ -60,7 -60,6 +60,7 @@@ set(DEFSR
        rna_mesh.c
        rna_meta.c
        rna_modifier.c
 +      rna_movieclip.c
        rna_nla.c
        rna_nodetree.c
        rna_object.c
@@@ -83,7 -82,6 +83,7 @@@
        rna_text.c
        rna_texture.c
        rna_timeline.c
 +      rna_tracking.c
        rna_ui.c
        rna_userdef.c
        rna_vfont.c
@@@ -173,6 -171,10 +173,10 @@@ if(WITH_IMAGE_HDR
        add_definitions(-DWITH_HDR)
  endif()
  
+ if(WITH_AUDASPACE)
+       add_definitions(-DWITH_AUDASPACE)
+ endif()
  if(WITH_CODEC_QUICKTIME)
        list(APPEND INC ../../quicktime)
        add_definitions(-DWITH_QUICKTIME)
index 8174e629d572746d429d84713a0dcb573daaf908,7da538e171b909eb50ac83a569efaf16cefd1074..56f0cb216409241ccbfa7c86203bd3c2d8f4db48
@@@ -644,6 -644,25 +644,25 @@@ static char *rna_def_property_get_func(
        return func;
  }
  
+ /* defined min/max variables to be used by rna_clamp_value() */
+ static void rna_clamp_value_range(FILE *f, PropertyRNA *prop)
+ {
+       if(prop->type == PROP_FLOAT) {
+               FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop;
+               if(fprop->range) {
+                       fprintf(f, "    float prop_clamp_min, prop_clamp_max;\n");
+                       fprintf(f, "    %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(fprop->range));
+               }
+       }
+       else if(prop->type == PROP_INT) {
+               IntPropertyRNA *iprop= (IntPropertyRNA*)prop;
+               if(iprop->range) {
+                       fprintf(f, "    int prop_clamp_min, prop_clamp_max;\n");
+                       fprintf(f, "    %s(ptr, &prop_clamp_min, &prop_clamp_max);\n", rna_function_string(iprop->range));
+               }
+       }
+ }
  static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
  {
        if(prop->type == PROP_INT) {
                if(iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) {
                        if(array) fprintf(f, "CLAMPIS(values[i], ");
                        else fprintf(f, "CLAMPIS(value, ");
-                       rna_int_print(f, iprop->hardmin); fprintf(f, ", ");
-                       rna_int_print(f, iprop->hardmax); fprintf(f, ");\n");
+                       if(iprop->range) {
+                               fprintf(f, "prop_clamp_min, prop_clamp_max);");
+                       }
+                       else {
+                               rna_int_print(f, iprop->hardmin); fprintf(f, ", ");
+                               rna_int_print(f, iprop->hardmax); fprintf(f, ");\n");
+                       }
                        return;
                }
        }
                if(fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) {
                        if(array) fprintf(f, "CLAMPIS(values[i], ");
                        else fprintf(f, "CLAMPIS(value, ");
-                       rna_float_print(f, fprop->hardmin); fprintf(f, ", ");
-                       rna_float_print(f, fprop->hardmax); fprintf(f, ");\n");
+                       if(fprop->range) {
+                               fprintf(f, "prop_clamp_min, prop_clamp_max);");
+                       }
+                       else {
+                               rna_float_print(f, fprop->hardmin); fprintf(f, ", ");
+                               rna_float_print(f, fprop->hardmax); fprintf(f, ");\n");
+                       }
                        return;
                }
        }
@@@ -767,11 -796,13 +796,13 @@@ static char *rna_def_property_set_func(
                                                char *lenfunc= rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set_length");
                                                fprintf(f, "    int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
                                                fprintf(f, "    int len= %s(ptr, arraylen);\n\n", lenfunc);
+                                               rna_clamp_value_range(f, prop);
                                                fprintf(f, "    for(i=0; i<len; i++) {\n");
                                                MEM_freeN(lenfunc);
                                        }
                                        else {
                                                fprintf(f, "    int i;\n\n");
+                                               rna_clamp_value_range(f, prop);
                                                fprintf(f, "    for(i=0; i<%d; i++) {\n", prop->totarraylength);
                                        }
  
                                                fprintf(f, "    data->%s |= value;\n", dp->dnaname);
                                        }
                                        else {
+                                               rna_clamp_value_range(f, prop);
                                                fprintf(f, "    data->%s= %s", dp->dnaname, (dp->booleannegative)? "!": "");
                                                rna_clamp_value(f, prop, 0);
                                        }
@@@ -2438,8 -2470,6 +2470,8 @@@ static RNAProcessItem PROCESS_ITEMS[]= 
        {"rna_vfont.c", NULL, RNA_def_vfont},
        {"rna_wm.c", "rna_wm_api.c", RNA_def_wm},
        {"rna_world.c", NULL, RNA_def_world},   
 +      {"rna_movieclip.c", NULL, RNA_def_movieclip},
 +      {"rna_tracking.c", NULL, RNA_def_tracking},
        {NULL, NULL}};
  
  static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const char *api_filename)
index d64824a8e8e6f36b86b0e6d2ad0e2b0b5cf5b88d,3ce84e3a19f91a9bc037541080bd3ae9ad728aca..efe2ada9ad6eb41a48b4c3c8f68a63426ec83d0a
@@@ -142,7 -142,6 +142,7 @@@ short RNA_type_to_ID_code(StructRNA *ty
        if(RNA_struct_is_a(type, &RNA_VectorFont)) return ID_VF;
        if(RNA_struct_is_a(type, &RNA_World)) return ID_WO;
        if(RNA_struct_is_a(type, &RNA_WindowManager)) return ID_WM;
 +      if(RNA_struct_is_a(type, &RNA_MovieClip)) return ID_MC;
  
        return 0;
  }
@@@ -176,7 -175,6 +176,7 @@@ StructRNA *ID_code_to_RNA_type(short id
                case ID_VF: return &RNA_VectorFont;
                case ID_WO: return &RNA_World;
                case ID_WM: return &RNA_WindowManager;
 +              case ID_MC: return &RNA_MovieClip;
                default: return &RNA_ID;
        }
  }
@@@ -412,15 -410,15 +412,15 @@@ static void rna_def_ID_materials(Blende
        RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials");
  
        func= RNA_def_function(srna, "append", "material_append_id");
-       RNA_def_function_ui_description(func, "Add a new material to Mesh.");
+       RNA_def_function_ui_description(func, "Add a new material to the data block.");
        parm= RNA_def_pointer(func, "material", "Material", "", "Material to add.");
        RNA_def_property_flag(parm, PROP_REQUIRED);
        
        func= RNA_def_function(srna, "pop", "material_pop_id");
-       RNA_def_function_ui_description(func, "Add a new material to Mesh.");
-       parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Frame number to set.", 0, INT_MAX);
+       RNA_def_function_ui_description(func, "Remove a material from the data block.");
+       parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of material to remove.", 0, INT_MAX);
        RNA_def_property_flag(parm, PROP_REQUIRED);
-       parm= RNA_def_pointer(func, "material", "Material", "", "Material to add.");
+       parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
        RNA_def_function_return(func, parm);
  }
  
index ea5b433677634f1998c4d8e33a027f4d7692f638,f4753e2efbe9bfa3836d3f62ffd96515a288919a..139d2ec3168a008904caca455edbead0d4132b11
@@@ -69,7 -69,6 +69,7 @@@ EnumPropertyItem space_type_items[] = 
        {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""},
        {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""},
        {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""},
 +      {SPACE_CLIP, "CLIP_EDITOR", 0, "Clip Editor", ""},
        {0, NULL, 0, NULL, NULL}};
  
  static EnumPropertyItem draw_channels_items[] = {
@@@ -123,7 -122,6 +123,7 @@@ EnumPropertyItem viewport_shade_items[
  #include "ED_screen.h"
  #include "ED_view3d.h"
  #include "ED_sequencer.h"
 +#include "ED_clip.h"
  
  #include "IMB_imbuf_types.h"
  
@@@ -170,8 -168,6 +170,8 @@@ static StructRNA* rna_Space_refine(stru
                        return &RNA_SpaceConsole;
                case SPACE_USERPREF:
                        return &RNA_SpaceUserPreferences;
 +              case SPACE_CLIP:
 +                      return &RNA_SpaceClipEditor;
                default:
                        return &RNA_Space;
        }
@@@ -704,7 -700,7 +704,7 @@@ static void rna_ConsoleLine_cursor_inde
        ConsoleLine *ci= (ConsoleLine*)ptr->data;
  
        *min= 0;
-       *max= ci->len;
+       *max= ci->len; /* intentionally _not_ -1 */
  }
  
  /* Space Dopesheet */
@@@ -897,13 -893,6 +897,13 @@@ static EnumPropertyItem *rna_SpacePrope
        return item;
  }
  
 +static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value)
 +{
 +      SpaceClip *sc= (SpaceClip*)(ptr->data);
 +
 +      ED_space_clip_set(NULL, sc, (MovieClip*)value.data);
 +}
 +
  #else
  
  static void rna_def_space(BlenderRNA *brna)
@@@ -1107,45 -1096,21 +1107,45 @@@ static void rna_def_background_image(Bl
                {(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"},
                {0, NULL, 0, NULL, NULL}};
  
 +      static EnumPropertyItem bgpic_source_items[] = {
 +              {V3D_BGPIC_IMAGE, "IMAGE", 0, "Image", ""},
 +              {V3D_BGPIC_MOVIE, "MOVIE", 0, "Movie", ""},
 +          {0, NULL, 0, NULL, NULL}
 +      };
 +
        srna= RNA_def_struct(brna, "BackgroundImage", NULL);
        RNA_def_struct_sdna(srna, "BGpic");
        RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background");
  
 +      prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "source");
 +      RNA_def_property_enum_items(prop, bgpic_source_items);
 +      RNA_def_property_ui_text(prop, "Background Source", "Data source used for background");
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
 +
        prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "ima");
        RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
  
 +      prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_pointer_sdna(prop, NULL, "clip");
 +      RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space");
 +      RNA_def_property_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
 +
        prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "iuser");
        RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
 +
 +      prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_flag(prop, PROP_NEVER_NULL);
 +      RNA_def_property_pointer_sdna(prop, NULL, "cuser");
 +      RNA_def_property_ui_text(prop, "Clip User", "Parameters defining which frame of the movie clip is displayed");
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
        
        prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "xof");
@@@ -2596,75 -2561,6 +2596,75 @@@ static void rna_def_space_logic(Blender
  
  }
  
 +static void rna_def_space_clip(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      srna= RNA_def_struct(brna, "SpaceClipEditor", "Space");
 +      RNA_def_struct_sdna(srna, "SpaceClip");
 +      RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data");
 +
 +      /* movieclip */
 +      prop= RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Movie Clip", "Movie clip displayed and edited in this space");
 +      RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceClipEditor_clip_set", NULL, NULL);
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* clip user */
 +      prop= RNA_def_property(srna, "clip_user", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_flag(prop, PROP_NEVER_NULL);
 +      RNA_def_property_pointer_sdna(prop, NULL, "user");
 +      RNA_def_property_ui_text(prop, "Movie Clip User", "Parameters defining which frame of the movie clip is displayed");
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* show pattern */
 +      prop= RNA_def_property(srna, "show_marker_pattern", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_ui_text(prop, "Show Marker Pattern", "Show pattern boundbox for markers");
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_PATTERN);
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* show search */
 +      prop= RNA_def_property(srna, "show_marker_search", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_ui_text(prop, "Show Marker Search", "Show search boundbox for markers");
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_SEARCH);
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* lock to selection */
 +      prop= RNA_def_property(srna, "lock_selection", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_ui_text(prop, "Lock to Selection", "Lock viewport to selected markers during playback");
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_LOCK_SELECTION);
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* show markers pathes */
 +      prop= RNA_def_property(srna, "show_marker_path", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_MARKER_PATH);
 +      RNA_def_property_ui_text(prop, "Show Marker Path", "Show path of markers");
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* path length */
 +      prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
 +      RNA_def_property_int_sdna(prop, NULL, "path_length");
 +      RNA_def_property_range(prop, 0, 50);
 +      RNA_def_property_ui_text(prop, "Path Length", "Length of displaying path, in frames");
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* ** debug flags ** */
 +
 +      /* show cache */
 +      prop= RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_ui_text(prop, "Show Cache", "Show cached frames for current clip");
 +      RNA_def_property_boolean_sdna(prop, NULL, "debug_flag", SC_DBG_SHOW_CACHE);
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +
 +      /* show tiny markers */
 +      prop= RNA_def_property(srna, "show_tiny_markers", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_ui_text(prop, "Show Tiny Markers", "Show markers tiny");
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_TINY_MARKER);
 +      RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 +}
 +
  void RNA_def_space(BlenderRNA *brna)
  {
        rna_def_space(brna);
        rna_def_space_userpref(brna);
        rna_def_space_node(brna);
        rna_def_space_logic(brna);
 +      rna_def_space_clip(brna);
  }
  
  #endif
index 0b2946dbb9549c1a452d7fa4c668a0be6e583398,4d1e1f175f2ca2df3b57c13d579a33bfec7eb2d1..1240d647d5d4119073d36e20932d9f97864cdb17
@@@ -361,36 -361,37 +361,37 @@@ static void rna_def_userdef_theme_ui_st
        RNA_def_struct_sdna(srna, "uiStyle");
        RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
        
+       /* (not used yet)
        prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
        RNA_def_property_range(prop, 0.5, 2.0);
        RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
-       
+       */
        prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
        RNA_def_property_struct_type(prop, "ThemeFontStyle");
-       RNA_def_property_ui_text(prop, "Panel Font", "");
+       RNA_def_property_ui_text(prop, "Panel Style", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
-       
+ /*    (not used yet)
        prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
        RNA_def_property_struct_type(prop, "ThemeFontStyle");
        RNA_def_property_ui_text(prop, "Group Label Font", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
-       
+ */    
        prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
        RNA_def_property_struct_type(prop, "ThemeFontStyle");
-       RNA_def_property_ui_text(prop, "Widget Label Font", "");
+       RNA_def_property_ui_text(prop, "Widget Label Style", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
        
        prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "widget");
        RNA_def_property_struct_type(prop, "ThemeFontStyle");
-       RNA_def_property_ui_text(prop, "Widget Font", "");
+       RNA_def_property_ui_text(prop, "Widget Style", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
        
  }     
@@@ -1002,12 -1003,6 +1003,12 @@@ static void rna_def_userdef_theme_space
        RNA_def_property_range(prop, 1, 5);
        RNA_def_property_ui_text(prop, "Outline Width", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 +
 +      prop= RNA_def_property(srna, "bundle_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
 +      RNA_def_property_float_sdna(prop, NULL, "bundle_solid");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Bundle Solid", "");
 +      RNA_def_property_update(prop, 0, "rna_userdef_update");
  }
  
  static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
@@@ -1743,44 -1738,6 +1744,44 @@@ static void rna_def_userdef_theme_color
        RNA_def_property_update(prop, 0, "rna_userdef_update");
  }
  
 +static void rna_def_userdef_theme_space_clip(BlenderRNA *brna)
 +{
 +      StructRNA *srna;
 +      PropertyRNA *prop;
 +
 +      /* space_clip */
 +
 +      srna= RNA_def_struct(brna, "ThemeClipEditor", NULL);
 +      RNA_def_struct_sdna(srna, "ThemeSpace");
 +      RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor");
 +
 +      rna_def_userdef_theme_spaces_main(srna, SPACE_CLIP);
 +
 +      prop= RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
 +      RNA_def_property_float_sdna(prop, NULL, "marker_outline");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Marker Outline Color", "");
 +      RNA_def_property_update(prop, 0, "rna_userdef_update");
 +
 +      prop= RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
 +      RNA_def_property_float_sdna(prop, NULL, "marker");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Marker Color", "");
 +      RNA_def_property_update(prop, 0, "rna_userdef_update");
 +
 +      prop= RNA_def_property(srna, "active_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
 +      RNA_def_property_float_sdna(prop, NULL, "act_marker");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Active Marker Color", "");
 +      RNA_def_property_update(prop, 0, "rna_userdef_update");
 +
 +      prop= RNA_def_property(srna, "selected_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
 +      RNA_def_property_float_sdna(prop, NULL, "sel_marker");
 +      RNA_def_property_array(prop, 3);
 +      RNA_def_property_ui_text(prop, "Selected Marker Color", "");
 +      RNA_def_property_update(prop, 0, "rna_userdef_update");
 +}
 +
  static void rna_def_userdef_themes(BlenderRNA *brna)
  {
        StructRNA *srna;
                {15, "INFO", ICON_INFO, "Info", ""},
                {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
                {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
 +          {20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
                {0, NULL, 0, NULL, NULL}};
  
        srna= RNA_def_struct(brna, "Theme", NULL);
        RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
        RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
        RNA_def_property_ui_text(prop, "Bone Color Sets", "");
 +
 +      prop= RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_flag(prop, PROP_NEVER_NULL);
 +      RNA_def_property_pointer_sdna(prop, NULL, "tclip");
 +      RNA_def_property_struct_type(prop, "ThemeClipEditor");
 +      RNA_def_property_ui_text(prop, "Clip Editor", "");
  }
  
  static void rna_def_userdef_addon(BlenderRNA *brna)
@@@ -1974,7 -1924,6 +1975,7 @@@ static void rna_def_userdef_dothemes(Bl
        rna_def_userdef_theme_space_console(brna);
        rna_def_userdef_theme_space_sound(brna);
        rna_def_userdef_theme_space_logic(brna);
 +      rna_def_userdef_theme_space_clip(brna);
        rna_def_userdef_theme_colorset(brna);
        rna_def_userdef_themes(brna);
  }