Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 23 Mar 2018 14:25:27 +0000 (15:25 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 23 Mar 2018 14:25:27 +0000 (15:25 +0100)
1  2 
CMakeLists.txt
source/blender/makesrna/intern/rna_space.c

diff --combined CMakeLists.txt
index d45cfefcb78c03565f40b365d247888a5fb8dcf8,212587d6d080bf1bc6e94b37b208bb49e8424d50..0d9d06b398972d02b28a80855c63de22177d8acb
@@@ -244,8 -244,6 +244,8 @@@ endif(
  option(WITH_PLAYER        "Build Player" OFF)
  option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
  
 +option(WITH_CLAY_ENGINE    "Enable Clay engine" ON)
 +
  # Compositor
  option(WITH_COMPOSITOR         "Enable the tile based nodal compositor" ON)
  
@@@ -388,14 -386,10 +388,14 @@@ if(UNIX AND NOT APPLE
  endif()
  
  option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
 -if(WITH_PYTHON_INSTALL)
 -      option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder"  ON)
 +if(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
        set(PYTHON_NUMPY_PATH            "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
        mark_as_advanced(PYTHON_NUMPY_PATH)
 +      set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
 +      mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
 +endif()
 +if(WITH_PYTHON_INSTALL)
 +      option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder"  ON)
  
        if(UNIX AND NOT APPLE)
                option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@@ -476,16 -470,28 +476,16 @@@ endif(
  
  # OpenGL
  
 -option(WITH_GLEW_MX             "Support multiple GLEW contexts (experimental)"                                                                     OFF )
  option(WITH_GLEW_ES             "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
  option(WITH_GL_EGL              "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)"       OFF)
 -option(WITH_GL_PROFILE_COMPAT   "Support using the OpenGL 'compatibility' profile. (deprecated)"                                                    ON )
 -option(WITH_GL_PROFILE_CORE     "Support using the OpenGL 3.2+ 'core' profile."                                                                     OFF)
  option(WITH_GL_PROFILE_ES20     "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)"                                  OFF)
  
  mark_as_advanced(
 -      WITH_GLEW_MX
        WITH_GLEW_ES
        WITH_GL_EGL
 -      WITH_GL_PROFILE_COMPAT
 -      WITH_GL_PROFILE_CORE
        WITH_GL_PROFILE_ES20
  )
  
 -if(WITH_GL_PROFILE_COMPAT)
 -      set(WITH_GLU ON)
 -else()
 -      set(WITH_GLU OFF)
 -endif()
 -
  if(WIN32)
        option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
        mark_as_advanced(WITH_GL_ANGLE)
@@@ -511,10 -517,11 +511,10 @@@ if(APPLE
        set(WITH_CXX11 ON)
  elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
        set(_c11_init ON)
 -      set(_cxx11_init ON)
  else()
        set(_c11_init OFF)
 -      set(_cxx11_init OFF)
  endif()
 +set(_cxx11_init ON)
  
  option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
  mark_as_advanced(WITH_C11)
@@@ -527,6 -534,10 +527,6 @@@ if(CMAKE_COMPILER_IS_GNUCC
        mark_as_advanced(WITH_LINKER_GOLD)
  endif()
  
 -# Dependency graph
 -option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
 -mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
 -
  if(WIN32)
        # Use hardcoded paths or find_package to find externals
        option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@@ -589,12 -600,6 +589,12 @@@ if(NOT WITH_GAMEENGINE AND WITH_PLAYER
        message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
  endif()
  
 +if(NOT WITH_CXX11)
 +      if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
 +              message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
 +      endif()
 +endif()
 +
  if(NOT WITH_AUDASPACE)
        if(WITH_OPENAL)
                message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
@@@ -643,10 -648,15 +643,10 @@@ if(NOT WITH_BOOST
        endmacro()
  
        set_and_warn(WITH_CYCLES         OFF)
 -      set_and_warn(WITH_AUDASPACE      OFF)
        set_and_warn(WITH_INTERNATIONAL  OFF)
        set_and_warn(WITH_OPENVDB        OFF)
        set_and_warn(WITH_OPENCOLORIO    OFF)
 -
 -      set_and_warn(WITH_OPENAL         OFF)  # depends on AUDASPACE
 -      set_and_warn(WITH_GAMEENGINE     OFF)  # depends on AUDASPACE
 -      set_and_warn(WITH_PLAYER         OFF)  # depends on GAMEENGINE
 -elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL OR
 +elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
         WITH_OPENVDB OR WITH_OPENCOLORIO)
        # Keep enabled
  else()
@@@ -715,9 -725,30 +715,9 @@@ TEST_SHARED_PTR_SUPPORT(
  TEST_UNORDERED_MAP_SUPPORT()
  
  if(WITH_AUDASPACE)
 -      if(WITH_SYSTEM_AUDASPACE)
 -              set(AUDASPACE_DEFINITIONS
 -                      -DWITH_AUDASPACE
 -                      -DWITH_SYSTEM_AUDASPACE
 -                      "-DAUD_DEVICE_H=<AUD_Device.h>"
 -                      "-DAUD_SPECIAL_H=<AUD_Special.h>"
 -                      "-DAUD_SOUND_H=<AUD_Sound.h>"
 -                      "-DAUD_HANDLE_H=<AUD_Handle.h>"
 -                      "-DAUD_SEQUENCE_H=<AUD_Sequence.h>"
 -                      "-DAUD_TYPES_H=<AUD_Types.h>"
 -                      "-DAUD_PYTHON_H=<python/PyAPI.h>"
 -              )
 -      else()
 -              set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
 -              set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
 -              set(AUDASPACE_DEFINITIONS
 -                      -DWITH_AUDASPACE
 -                      "-DAUD_DEVICE_H=<AUD_C-API.h>"
 -                      "-DAUD_SPECIAL_H=<AUD_C-API.h>"
 -                      "-DAUD_SOUND_H=<AUD_C-API.h>"
 -                      "-DAUD_HANDLE_H=<AUD_C-API.h>"
 -                      "-DAUD_SEQUENCE_H=<AUD_C-API.h>"
 -                      "-DAUD_TYPES_H=<AUD_Space.h>"
 -              )
 +      if(NOT WITH_SYSTEM_AUDASPACE)
 +              set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
 +              set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings")
        endif()
  endif()
  
@@@ -970,11 -1001,19 +970,11 @@@ endif(
  find_package(OpenGL)
  blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
  
 -if(WITH_GLU)
 -      list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
 -      list(APPEND GL_DEFINITIONS -DWITH_GLU)
 -endif()
 -
  if(WITH_SYSTEM_GLES)
        find_package_wrapper(OpenGLES)
  endif()
  
 -if(WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE)
 -      list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
 -
 -elseif(WITH_GL_PROFILE_ES20)
 +if(WITH_GL_PROFILE_ES20)
        if(WITH_SYSTEM_GLES)
                if(NOT OPENGLES_LIBRARY)
                        message(FATAL_ERROR
  
        endif()
  
 +else()
 +      list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
 +
  endif()
  
  if(WITH_GL_EGL)
  
  endif()
  
 -if(WITH_GL_PROFILE_COMPAT)
 -      list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_COMPAT)
 -endif()
 -
 -if(WITH_GL_PROFILE_CORE)
 -      list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
 -endif()
 -
  if(WITH_GL_PROFILE_ES20)
        list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20)
 +else()
 +      list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
  endif()
  
  if(WITH_GL_EGL)
@@@ -1124,6 -1166,10 +1124,6 @@@ endif(
  #-----------------------------------------------------------------------------
  # Configure GLEW
  
 -if(WITH_GLEW_MX)
 -      list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
 -endif()
 -
  if(WITH_SYSTEM_GLEW)
        find_package(GLEW)
  
                message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
        endif()
  
 -      if(WITH_GLEW_MX)
 -              set(BLENDER_GLEW_LIBRARIES ${GLEW_MX_LIBRARY})
 -      else()
 -              set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
 -      endif()
 +      set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
  else()
        if(WITH_GLEW_ES)
                set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
                list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
  
                # These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
 -              if(NOT WITH_GL_PROFILE_ES20)
 +              if(WITH_GL_PROFILE_ES20)
 +                      list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
 +              else()
                        # No ES functions are needed
                        list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
 -              elseif(NOT (WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT))
 -                      # ES is enabled, but the other functions are all disabled
 -                      list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
                endif()
  
                if(WITH_GL_PROFILE_ES20)
  
  endif()
  
 -if(NOT WITH_GLU)
 -      list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
 -endif()
 +list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
  
  #-----------------------------------------------------------------------------
  # Configure Bullet
@@@ -1241,7 -1294,7 +1241,7 @@@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_C
                if(WIN32)
                        set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src/windows)
                else()
-                       set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/src)
+                       set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/glog/include)
                endif()
        endif()
  endif()
@@@ -1378,6 -1431,7 +1378,7 @@@ if(CMAKE_COMPILER_IS_GNUCC
        # flags to undo strict flags
        ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
        ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER        -Wno-unused-parameter)
+       ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION         -Wno-unused-function)
  
        if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
                ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH    -Wno-implicit-fallthrough)
@@@ -1487,15 -1541,10 +1488,15 @@@ if(WITH_PYTHON
                )
        endif()
  
 -      if(WIN32 OR APPLE)
 +      if(WIN32)
                # pass, we have this in an archive to extract
 -      elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
 -              find_python_package(numpy)
 +      elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
 +              if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
 +                      find_python_package(numpy)
 +                      unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
 +                      set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
 +                      mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
 +              endif()
        endif()
  
        if(WIN32 OR APPLE)
@@@ -1732,7 -1781,10 +1733,7 @@@ if(FIRST_RUN
  
        info_cfg_text("OpenGL:")
        info_cfg_option(WITH_GLEW_ES)
 -      info_cfg_option(WITH_GLU)
        info_cfg_option(WITH_GL_EGL)
 -      info_cfg_option(WITH_GL_PROFILE_COMPAT)
 -      info_cfg_option(WITH_GL_PROFILE_CORE)
        info_cfg_option(WITH_GL_PROFILE_ES20)
        if(WIN32)
                info_cfg_option(WITH_GL_ANGLE)
index c95b33d90ad8daae81c811c0b51b21c96302ec01,d6a304f4dfe6873b844011c3aeae62c7638c4b79..70ec6287924f310ae507cd15eb3bb87390a0d048
@@@ -45,7 -45,6 +45,7 @@@
  #include "DNA_sequence_types.h"
  #include "DNA_mask_types.h"
  #include "DNA_view3d_types.h"
 +#include "DNA_workspace_types.h"
  
  #include "RNA_access.h"
  #include "RNA_define.h"
  const EnumPropertyItem rna_enum_space_type_items[] = {
        /* empty must be here for python, is skipped for UI */
        {SPACE_EMPTY, "EMPTY", ICON_NONE, "Empty", ""},
+       /* General */
+       {0, "", ICON_NONE, "General", ""},
        {SPACE_VIEW3D, "VIEW_3D", ICON_VIEW3D, "3D View", "3D viewport"},
-       {0, "", ICON_NONE, NULL, NULL},
+       {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", "View and edit images and UV Maps"},
+       {SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", "Editor for node-based shading and compositing tools"},
+       {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequencer", "Video editing tools"},
+       {SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", "Motion tracking tools"},
+       /* Animation */
+       {0, "", ICON_NONE, "Animation", ""},
        {SPACE_TIME, "TIMELINE", ICON_TIME, "Timeline", "Timeline and playback controls"},
        {SPACE_IPO, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", "Edit drivers and keyframe interpolation"},
        {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"},
        {SPACE_NLA, "NLA_EDITOR", ICON_NLA, "NLA Editor", "Combine and layer Actions"},
-       {0, "", ICON_NONE, NULL, NULL},
-       {SPACE_IMAGE, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", "View and edit images and UV Maps"},
-       {SPACE_CLIP, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", "Motion tracking tools"},
-       {SPACE_SEQ, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", "Video editing tools"},
-       {SPACE_NODE, "NODE_EDITOR", ICON_NODETREE, "Node Editor", "Editor for node-based shading and compositing tools"},
+       /* Scripting */
+       {0, "", ICON_NONE, "Scripting", ""},
        {SPACE_TEXT, "TEXT_EDITOR", ICON_TEXT, "Text Editor", "Edit scripts and in-file documentation"},
        {SPACE_LOGIC, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", "Game logic editing"},
-       {0, "", ICON_NONE, NULL, NULL},
-       {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"},
+       {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", "Interactive programmatic console for "
+                       "advanced editing and script development"},
+       {SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages "
+                    "(drag down to expand and display)"},
+       /* Data */
+       {0, "", ICON_NONE, "Data", ""},
        {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available data-blocks"},
-       {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", "Edit persistent configuration settings"},
-       {SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages (drag down to expand and display)"},
-       {0, "", ICON_NONE, NULL, NULL},
+       {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"},
        {SPACE_FILE, "FILE_BROWSER", ICON_FILESEL, "File Browser", "Browse for files and assets"},
-       {0, "", ICON_NONE, NULL, NULL},
-       {SPACE_CONSOLE, "CONSOLE", ICON_CONSOLE, "Python Console", "Interactive programmatic console for advanced editing and script development"},
+       {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences",
+                        "Edit persistent configuration settings"},
        {0, NULL, 0, NULL, NULL}
  };
  
@@@ -197,7 -206,7 +207,7 @@@ const EnumPropertyItem rna_enum_clip_ed
  static const EnumPropertyItem buttons_context_items[] = {
        {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene"},
        {BCONTEXT_RENDER, "RENDER", ICON_SCENE, "Render", "Render"},
 -      {BCONTEXT_RENDER_LAYER, "RENDER_LAYER", ICON_RENDERLAYERS, "Render Layers", "Render layers"},
 +      {BCONTEXT_VIEW_LAYER, "VIEW_LAYER", ICON_RENDERLAYERS, "View Layers", "View layers"},
        {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"},
        {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"},
        {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraints", "Object constraints"},
        {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
        {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"},
        {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
 +      {BCONTEXT_COLLECTION, "COLLECTION", ICON_COLLAPSEMENU, "Collection", "Collection"},
 +      {BCONTEXT_WORKSPACE, "WORKSPACE", ICON_RENDER_RESULT, "Workspace", "Workspace"},
        {0, NULL, 0, NULL, NULL}
  };
  
@@@ -225,11 -232,6 +235,11 @@@ static const EnumPropertyItem buttons_t
        {0, NULL, 0, NULL, NULL}
  };
  
 +static const EnumPropertyItem buttons_collection_context_items[] = {
 +      {SB_COLLECTION_CTX_VIEW_LAYER, "VIEW_LAYER", ICON_RENDERLAYERS, "", "Show material textures"},
 +      {SB_COLLECTION_CTX_GROUP, "GROUP", ICON_GROUP, "", "Show world textures"},
 +      {0, NULL, 0, NULL, NULL}
 +};
  
  static const EnumPropertyItem fileselectparams_recursion_level_items[] = {
        {0, "NONE",  0, "None", "Only list current directory's content, with no recursion"},
@@@ -261,23 -263,17 +271,23 @@@ const EnumPropertyItem rna_enum_file_so
  #include "BKE_brush.h"
  #include "BKE_colortools.h"
  #include "BKE_context.h"
 -#include "BKE_depsgraph.h"
 +#include "BKE_layer.h"
 +#include "BKE_global.h"
  #include "BKE_nla.h"
  #include "BKE_paint.h"
  #include "BKE_scene.h"
  #include "BKE_screen.h"
  #include "BKE_icons.h"
 +#include "BKE_workspace.h"
 +
 +#include "DEG_depsgraph.h"
 +#include "DEG_depsgraph_build.h"
  
  #include "ED_buttons.h"
  #include "ED_fileselect.h"
  #include "ED_image.h"
  #include "ED_node.h"
 +#include "ED_transform.h"
  #include "ED_screen.h"
  #include "ED_view3d.h"
  #include "ED_sequencer.h"
@@@ -417,64 -413,44 +427,64 @@@ static void rna_Space_view2d_sync_updat
        }
  }
  
 -static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
 +static int rna_View3D_transform_orientation_get(PointerRNA *ptr)
 +{
 +      const View3D *v3d = (View3D *)ptr->data;
 +      /* convert to enum value */
 +      return (v3d->twmode == V3D_MANIP_CUSTOM) ? (v3d->twmode + v3d->custom_orientation_index) : v3d->twmode;
 +}
 +
 +void rna_View3D_transform_orientation_set(PointerRNA *ptr, int value)
  {
 -      Scene *scene = ((bScreen *)ptr->id.data)->scene;
        View3D *v3d = (View3D *)ptr->data;
 +      BIF_selectTransformOrientationValue(v3d, value);
 +}
  
 -      if (v3d->twmode < V3D_MANIP_CUSTOM)
 -              return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
 -      else
 -              return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation,
 -                                                BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
 +static PointerRNA rna_View3D_current_orientation_get(PointerRNA *ptr)
 +{
 +      View3D *v3d = (View3D *)ptr->data;
 +      TransformOrientation *orientation;
 +
 +      if (v3d->twmode < V3D_MANIP_CUSTOM) {
 +              orientation = NULL;
 +      }
 +      else {
 +              WorkSpace *workspace;
 +              bScreen *screen = ptr->id.data;
 +
 +              BKE_workspace_layout_find_global(G.main, screen, &workspace);
 +              orientation = BKE_workspace_transform_orientation_find(workspace, v3d->custom_orientation_index);
 +      }
 +
 +      return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, orientation);
  }
  
  const EnumPropertyItem *rna_TransformOrientation_itemf(
          bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free)
  {
 -      Scene *scene = NULL;
 -      ListBase *transform_spaces;
 -      TransformOrientation *ts = NULL;
 +      WorkSpace *workspace;
 +      ListBase *transform_orientations;
        EnumPropertyItem tmp = {0, "", 0, "", ""};
        EnumPropertyItem *item = NULL;
        int i = V3D_MANIP_CUSTOM, totitem = 0;
  
        RNA_enum_items_add(&item, &totitem, transform_orientation_items);
  
 -      if (ptr->type == &RNA_SpaceView3D)
 -              scene = ((bScreen *)ptr->id.data)->scene;
 -      else
 -              scene = CTX_data_scene(C);  /* can't use scene from ptr->id.data because that enum is also used by operators */
 -
 -      if (scene) {
 -              transform_spaces = &scene->transform_spaces;
 -              ts = transform_spaces->first;
 +      if (ptr->type == &RNA_SpaceView3D) {
 +              bScreen *screen = ptr->id.data;
 +              BKE_workspace_layout_find_global(G.main, screen, &workspace);
 +      }
 +      else {
 +              /* can't use scene from ptr->id.data because that enum is also used by operators */
 +              workspace = C ? CTX_wm_workspace(C) : NULL;
        }
  
 -      if (ts) {
 +      transform_orientations = workspace ? BKE_workspace_transform_orientations_get(workspace) : NULL;
 +
 +      if (transform_orientations && (BLI_listbase_is_empty(transform_orientations) == false)) {
                RNA_enum_item_add_separator(&item, &totitem);
  
 -              for (; ts; ts = ts->next) {
 +              for (TransformOrientation *ts = transform_orientations->first; ts; ts = ts->next) {
                        tmp.identifier = ts->name;
                        tmp.name = ts->name;
                        tmp.value = i++;
@@@ -493,10 -469,8 +503,10 @@@ static void rna_SpaceView3D_camera_upda
  {
        View3D *v3d = (View3D *)(ptr->data);
        if (v3d->scenelock) {
 +              wmWindowManager *wm = bmain->wm.first;
 +
                scene->camera = v3d->camera;
 -              BKE_screen_view3d_main_sync(&bmain->screen, scene);
 +              WM_windows_scene_data_sync(&wm->windows, scene);
        }
  }
  
@@@ -508,10 -482,8 +518,10 @@@ static void rna_SpaceView3D_lock_camera
        v3d->scenelock = value;
  
        if (value) {
 +              Scene *scene = ED_screen_scene_find(sc, G.main->wm.first);
                int bit;
 -              v3d->lay = sc->scene->lay;
 +
 +              v3d->lay = scene->lay;
                /* seek for layact */
                bit = 0;
                while (bit < 32) {
                        }
                        bit++;
                }
 -              v3d->camera = sc->scene->camera;
 +              v3d->camera = scene->camera;
        }
  }
  
  static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
  {
        View3D *v3d = (View3D *)(ptr->data);
 -      bScreen *sc = (bScreen *)ptr->id.data;
 -      Scene *scene = (Scene *)sc->scene;
 +      bScreen *screen = ptr->id.data;
 +      Scene *scene = ED_screen_scene_find(screen, G.main->wm.first);
        const float *loc = ED_view3d_cursor3d_get(scene, v3d);
  
        copy_v3_v3(values, loc);
  static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
  {
        View3D *v3d = (View3D *)(ptr->data);
 -      bScreen *sc = (bScreen *)ptr->id.data;
 -      Scene *scene = (Scene *)sc->scene;
 +      bScreen *screen = ptr->id.data;
 +      Scene *scene = ED_screen_scene_find(screen, G.main->wm.first);
        float *cursor = ED_view3d_cursor3d_get(scene, v3d);
  
        copy_v3_v3(cursor, values);
  static float rna_View3D_GridScaleUnit_get(PointerRNA *ptr)
  {
        View3D *v3d = (View3D *)(ptr->data);
 -      bScreen *sc = (bScreen *)ptr->id.data;
 -      Scene *scene = (Scene *)sc->scene;
 +      bScreen *screen = ptr->id.data;
 +      Scene *scene = ED_screen_scene_find(screen, G.main->wm.first);
  
        return ED_view3d_grid_scale(scene, v3d, NULL);
  }
@@@ -558,7 -530,7 +568,7 @@@ static void rna_SpaceView3D_layer_set(P
  {
        View3D *v3d = (View3D *)(ptr->data);
  
 -      v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
 +      v3d->lay = ED_view3d_view_layer_set(v3d->lay, values, &v3d->layact);
  }
  
  static int rna_SpaceView3D_active_layer_get(PointerRNA *ptr)
  
  static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
  {
 -      DAG_on_visible_update(bmain, false);
 +      DEG_on_visible_update(bmain, false);
  }
  
  static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
@@@ -733,18 -705,12 +743,18 @@@ static void rna_RegionView3D_view_matri
  
  static int rna_SpaceView3D_viewport_shade_get(PointerRNA *ptr)
  {
 -      Scene *scene = ((bScreen *)ptr->id.data)->scene;
 -      RenderEngineType *type = RE_engines_find(scene->r.engine);
 +      bScreen *screen = ptr->id.data;
 +
 +      Scene *scene = WM_windows_scene_get_from_screen(G.main->wm.first, screen);
 +      WorkSpace *workspace = WM_windows_workspace_get_from_screen(G.main->wm.first, screen);
 +
 +      ViewRender *view_render = BKE_viewrender_get(scene, workspace);
 +      RenderEngineType *type = RE_engines_find(view_render->engine_id);
 +
        View3D *v3d = (View3D *)ptr->data;
        int drawtype = v3d->drawtype;
  
 -      if (drawtype == OB_RENDER && !(type && type->view_draw))
 +      if (drawtype == OB_RENDER && !(type && type->render_to_view))
                return OB_SOLID;
  
        return drawtype;
@@@ -759,14 -725,11 +769,14 @@@ static void rna_SpaceView3D_viewport_sh
        v3d->drawtype = value;
  }
  
 -static const EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr,
 +static const EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *C, PointerRNA *UNUSED(ptr),
                                                                PropertyRNA *UNUSED(prop), bool *r_free)
  {
 -      Scene *scene = ((bScreen *)ptr->id.data)->scene;
 -      RenderEngineType *type = RE_engines_find(scene->r.engine);
 +      wmWindow *win = CTX_wm_window(C);
 +      Scene *scene = WM_window_get_active_scene(win);
 +      WorkSpace *workspace = WM_window_get_active_workspace(win);
 +      ViewRender *view_render = BKE_viewrender_get(scene, workspace);
 +      RenderEngineType *type = RE_engines_find(view_render->engine_id);
  
        EnumPropertyItem *item = NULL;
        int totitem = 0;
        RNA_enum_items_add_value(&item, &totitem, rna_enum_viewport_shade_items, OB_TEXTURE);
        RNA_enum_items_add_value(&item, &totitem, rna_enum_viewport_shade_items, OB_MATERIAL);
  
 -      if (type && type->view_draw)
 +      if (type && type->render_to_view)
                RNA_enum_items_add_value(&item, &totitem, rna_enum_viewport_shade_items, OB_RENDER);
  
        RNA_enum_item_end(&item, &totitem);
        return item;
  }
  
 -static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *UNUSED(C), PointerRNA *ptr,
 +static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *C, PointerRNA *UNUSED(ptr),
                                                                 PropertyRNA *UNUSED(prop), bool *UNUSED(r_free))
  {
 -      Scene *scene = ((bScreen *)ptr->id.data)->scene;
 +      Scene *scene = CTX_data_scene(C);
  
        if (scene->r.views_format == SCE_VIEWS_FORMAT_MULTIVIEW)
                return multiview_camera_items;
@@@ -857,31 -820,22 +867,31 @@@ static int rna_SpaceImageEditor_show_uv
  {
        SpaceImage *sima = (SpaceImage *)(ptr->data);
        bScreen *sc = (bScreen *)ptr->id.data;
 -      return ED_space_image_show_uvedit(sima, sc->scene->obedit);
 +      wmWindow *win = ED_screen_window_find(sc, G.main->wm.first);
 +      Object *obedit = OBEDIT_FROM_WINDOW(win);
 +
 +      return ED_space_image_show_uvedit(sima, obedit);
  }
  
  static int rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
  {
        SpaceImage *sima = (SpaceImage *)(ptr->data);
        bScreen *sc = (bScreen *)ptr->id.data;
 -      return ED_space_image_check_show_maskedit(sc->scene, sima);
 +      wmWindow *window = NULL;
 +      Scene *scene = ED_screen_scene_find_with_window(sc, G.main->wm.first, &window);
 +      ViewLayer *view_layer = BKE_view_layer_context_active_PLACEHOLDER(scene);
 +      const WorkSpace *workspace = WM_window_get_active_workspace(window);
 +      return ED_space_image_check_show_maskedit(sima, workspace, view_layer);
  }
  
  static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
  {
        SpaceImage *sima = (SpaceImage *)(ptr->data);
        bScreen *sc = (bScreen *)ptr->id.data;
 -
 -      ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image *)value.data);
 +      wmWindow *win;
 +      Scene *scene = ED_screen_scene_find_with_window(sc, G.main->wm.first, &win);
 +      Object *obedit = OBEDIT_FROM_WINDOW(win);
 +      ED_space_image_set(sima, scene, obedit, (Image *)value.data);
  }
  
  static void rna_SpaceImageEditor_mask_set(PointerRNA *ptr, PointerRNA value)
@@@ -1127,8 -1081,8 +1137,8 @@@ static const EnumPropertyItem *rna_Spac
                RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER);
        }
  
 -      if (sbuts->pathflag & (1 << BCONTEXT_RENDER_LAYER)) {
 -              RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_RENDER_LAYER);
 +      if (sbuts->pathflag & (1 << BCONTEXT_VIEW_LAYER)) {
 +              RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_VIEW_LAYER);
        }
  
        if (sbuts->pathflag & (1 << BCONTEXT_SCENE)) {
                RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORLD);
        }
  
 +      if (sbuts->pathflag & (1 << BCONTEXT_WORKSPACE)) {
 +              RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_WORKSPACE);
 +      }
 +
 +      if (sbuts->pathflag & (1 << BCONTEXT_COLLECTION)) {
 +              RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_COLLECTION);
 +      }
 +
        if (sbuts->pathflag & (1 << BCONTEXT_OBJECT)) {
                RNA_enum_items_add_value(&item, &totitem, buttons_context_items, BCONTEXT_OBJECT);
        }
@@@ -1328,12 -1274,10 +1338,12 @@@ static void rna_SpaceDopeSheetEditor_ac
        }
  }
  
 -static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, PointerRNA *ptr)
 +static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr)
  {
        SpaceAction *saction = (SpaceAction *)(ptr->data);
 -      Object *obact = (scene->basact) ? scene->basact->object : NULL;
 +      ViewLayer *view_layer = CTX_data_view_layer(C);
 +      Main *bmain = CTX_data_main(C);
 +      Object *obact = OBACT(view_layer);
  
        /* we must set this action to be the one used by active object (if not pinned) */
        if (obact /* && saction->pin == 0*/) {
                }
  
                /* force depsgraph flush too */
 -              DAG_id_tag_update(&obact->id, OB_RECALC_OB | OB_RECALC_DATA);
 +              DEG_id_tag_update(&obact->id, OB_RECALC_OB | OB_RECALC_DATA);
                /* Update relations as well, so new time source dependency is added. */
 -              DAG_relations_tag_update(bmain);
 +              DEG_relations_tag_update(bmain);
        }
  }
  
 -static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
 +static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr)
  {
        SpaceAction *saction = (SpaceAction *)(ptr->data);
 -      Object *obact = (scene->basact) ? scene->basact->object : NULL;
 +      ViewLayer *view_layer = CTX_data_view_layer(C);
 +      Object *obact = OBACT(view_layer);
  
        /* special exceptions for ShapeKey Editor mode */
        if (saction->mode == SACTCONT_SHAPEKEY) {
@@@ -1471,6 -1414,59 +1481,6 @@@ static void rna_Sequencer_view_type_upd
        ED_area_tag_refresh(sa);
  }
  
 -static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
 -{
 -      BGpic *bgpic = (BGpic *)ptr->data;
 -      return 1.0f - bgpic->blend;
 -}
 -
 -static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
 -{
 -      BGpic *bgpic = (BGpic *)ptr->data;
 -      bgpic->blend = 1.0f - value;
 -}
 -
 -/* radius internally (expose as a distance value) */
 -static float rna_BackgroundImage_size_get(PointerRNA *ptr)
 -{
 -      BGpic *bgpic = ptr->data;
 -      return bgpic->size * 2.0f;
 -}
 -
 -static void rna_BackgroundImage_size_set(PointerRNA *ptr, float value)
 -{
 -      BGpic *bgpic = ptr->data;
 -      bgpic->size = value * 0.5f;
 -}
 -
 -static BGpic *rna_BackgroundImage_new(View3D *v3d)
 -{
 -      BGpic *bgpic = ED_view3d_background_image_new(v3d);
 -
 -      WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
 -
 -      return bgpic;
 -}
 -
 -static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, PointerRNA *bgpic_ptr)
 -{
 -      BGpic *bgpic = bgpic_ptr->data;
 -      if (BLI_findindex(&v3d->bgpicbase, bgpic) == -1) {
 -              BKE_report(reports, RPT_ERROR, "Background image cannot be removed");
 -      }
 -
 -      ED_view3d_background_image_remove(v3d, bgpic);
 -      RNA_POINTER_INVALIDATE(bgpic_ptr);
 -
 -      WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
 -}
 -
 -static void rna_BackgroundImage_clear(View3D *v3d)
 -{
 -      ED_view3d_background_image_clear(v3d);
 -      WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d);
 -}
 -
  /* Space Node Editor */
  
  static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr, const PointerRNA value)
@@@ -2104,26 -2100,23 +2114,26 @@@ static void rna_def_space_outliner(Blen
        PropertyRNA *prop;
  
        static const EnumPropertyItem display_mode_items[] = {
 -              {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display data-blocks in all scenes"},
 -              {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display data-blocks in current scene"},
 -              {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display data-blocks in visible layers"},
 -              {SO_SELECTED, "SELECTED", 0, "Selected", "Display data-blocks of selected, visible objects"},
 -              {SO_ACTIVE, "ACTIVE", 0, "Active", "Display data-blocks of active object"},
 -              {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types",
 -                             "Display data-blocks of all objects of same type as selected object"},
 +              {SO_VIEW_LAYER, "VIEW_LAYER", 0, "View Layer", "Display the collections of the active view layer"},
 +              {SO_COLLECTIONS, "COLLECTIONS", 0, "Collections", "Display all collections based on the "
 +                               "master collection hierarchy"},
 +              {SO_SCENES, "SCENES", 0, "Scenes", "Display composition related data in all scenes"},
                {SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their data-blocks"},
                {SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence data-blocks"},
                {SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"},
                {SO_DATABLOCKS, "DATABLOCKS", 0, "Data-Blocks", "Display all raw data-blocks"},
 -              {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display user preference data"},
                {SO_ID_ORPHANS, "ORPHAN_DATA", 0, "Orphan Data",
                                "Display data-blocks which are unused and/or will be lost when the file is reloaded"},
                {0, NULL, 0, NULL, NULL}
        };
  
 +      static const EnumPropertyItem filter_state_items[] = {
 +              {SO_FILTER_OB_VISIBLE, "VISIBLE", ICON_RESTRICT_VIEW_OFF, "Visible", "Show visible objects"},
 +              {SO_FILTER_OB_SELECTED, "SELECTED", ICON_RESTRICT_SELECT_OFF, "Selected", "Show selected objects"},
 +              {SO_FILTER_OB_ACTIVE, "ACTIVE", ICON_LAYER_ACTIVE, "Active", "Show only the active object"},
 +              {0, NULL, 0, NULL, NULL}
 +      };
 +
        srna = RNA_def_struct(brna, "SpaceOutliner", "Space");
        RNA_def_struct_sdna(srna, "SpaceOops");
        RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
        prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE);
        RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
 +      RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 0);
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
        prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE);
        RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
 +      RNA_def_property_ui_icon(prop, ICON_OUTLINER_DATA_FONT, 0);
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
        prop = RNA_def_property(srna, "use_sort_alpha", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_SKIP_SORT_ALPHA);
        RNA_def_property_ui_text(prop, "Sort Alphabetically", "");
 +      RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0);
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
        prop = RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
        RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
 -}
 -
 -static void rna_def_background_image(BlenderRNA *brna)
 -{
 -      StructRNA *srna;
 -      PropertyRNA *prop;
 -
 -      /* note: combinations work but don't flip so arnt that useful */
 -      static const EnumPropertyItem bgpic_axis_items[] = {
 -              {0, "", 0, N_("X Axis"), ""},
 -              {(1 << RV3D_VIEW_LEFT), "LEFT", 0, "Left", "Show background image while looking to the left"},
 -              {(1 << RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", "Show background image while looking to the right"},
 -              /*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/
 -              {0, "", 0, N_("Y Axis"), ""},
 -              {(1 << RV3D_VIEW_BACK), "BACK", 0, "Back", "Show background image in back view"},
 -              {(1 << RV3D_VIEW_FRONT), "FRONT", 0, "Front", "Show background image in front view"},
 -              /*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/
 -              {0, "", 0, N_("Z Axis"), ""},
 -              {(1 << RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", "Show background image in bottom view"},
 -              {(1 << RV3D_VIEW_TOP), "TOP", 0, "Top", "Show background image in top view"},
 -              /*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/
 -              {0, "", 0, N_("Other"), ""},
 -              {0, "ALL", 0, "All Views", "Show background image in all views"},
 -              {(1 << RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", "Show background image in camera view"},
 -              {0, NULL, 0, NULL, NULL}
 -      };
 -
 -      static const EnumPropertyItem bgpic_source_items[] = {
 -              {V3D_BGPIC_IMAGE, "IMAGE", 0, "Image", ""},
 -              {V3D_BGPIC_MOVIE, "MOVIE_CLIP", 0, "Movie Clip", ""},
 -              {0, NULL, 0, NULL, NULL}
 -      };
 -
 -      static const EnumPropertyItem bgpic_camera_frame_items[] = {
 -              {0, "STRETCH", 0, "Stretch", ""},
 -              {V3D_BGPIC_CAMERA_ASPECT, "FIT", 0, "Fit", ""},
 -              {V3D_BGPIC_CAMERA_ASPECT | V3D_BGPIC_CAMERA_CROP, "CROP", 0, "Crop", ""},
 -              {0, NULL, 0, NULL, NULL}
 -      };
 -
 -      static const EnumPropertyItem bgpic_draw_depth_items[] = {
 -              {0, "BACK", 0, "Back", ""},
 -              {V3D_BGPIC_FOREGROUND, "FRONT", 0, "Front", ""},
 -              {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_struct_type(prop, "MovieClipUser");
 -      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");
 -      RNA_def_property_ui_text(prop, "X Offset", "Offset image horizontally from the world origin");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 -
 -      prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
 -      RNA_def_property_float_sdna(prop, NULL, "yof");
 -      RNA_def_property_ui_text(prop, "Y Offset", "Offset image vertically from the world origin");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 -
 -      prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
 -      RNA_def_property_float_sdna(prop, NULL, "size");
 -      RNA_def_property_float_funcs(prop, "rna_BackgroundImage_size_get", "rna_BackgroundImage_size_set", NULL);
 -      RNA_def_property_ui_text(prop, "Size", "Size of the background image (ortho view only)");
 -      RNA_def_property_range(prop, 0.0, FLT_MAX);
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 -
 -      prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
 -      RNA_def_property_float_sdna(prop, NULL, "rotation");
 -      RNA_def_property_ui_text(prop, "Rotation", "Rotation for the background image (ortho view only)");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 -
 -      prop = RNA_def_property(srna, "use_flip_x", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FLIP_X);
 -      RNA_def_property_ui_text(prop, "Flip Horizontally", "Flip the background image horizontally");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      /* Filters. */
 +      prop = RNA_def_property(srna, "use_filter_search", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_SEARCH);
 +      RNA_def_property_ui_text(prop, "Search Name", "Filter searched elements");
 +      RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      prop = RNA_def_property(srna, "use_flip_y", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FLIP_Y);
 -      RNA_def_property_ui_text(prop, "Flip Vertically", "Flip the background image vertically");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      prop = RNA_def_property(srna, "use_filters", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_ENABLE);
 +      RNA_def_property_ui_text(prop, "Use Filters", "Use filters");
 +      RNA_def_property_ui_icon(prop, ICON_FILTER, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
 -      RNA_def_property_float_sdna(prop, NULL, "blend");
 -      RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
 -      RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
 -      RNA_def_property_range(prop, 0.0, 1.0);
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OBJECT);
 +      RNA_def_property_ui_text(prop, "Filter Objects", "Show objects");
 +      RNA_def_property_ui_icon(prop, ICON_OBJECT_DATA, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      prop = RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
 -      RNA_def_property_enum_sdna(prop, NULL, "view");
 -      RNA_def_property_enum_items(prop, bgpic_axis_items);
 -      RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_CONTENT);
 +      RNA_def_property_ui_text(prop, "Filter Objects Contents", "Show what is inside the objects elements");
 +      RNA_def_property_ui_icon(prop, ICON_MODIFIER, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
 -      RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
 -      RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
 +      prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_CHILDREN);
 +      RNA_def_property_ui_text(prop, "Filter Objects Children", "Show children");
 +      RNA_def_property_ui_icon(prop, ICON_PLUS, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      prop = RNA_def_property(srna, "use_camera_clip", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP);
 -      RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      prop = RNA_def_property(srna, "use_filter_collection", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_COLLECTION);
 +      RNA_def_property_ui_text(prop, "Filter Collections", "Show collections");
 +      RNA_def_property_ui_icon(prop, ICON_COLLAPSEMENU, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      prop = RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_BGPIC_DISABLED);
 -      RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      /* Filters object state. */
 +      prop = RNA_def_property(srna, "use_filter_object_state", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_OB_STATE);
 +      RNA_def_property_ui_text(prop, "Filter Object State", "Filter objects based on their state (visible, ...)."
 +                                                            "This can be slow");
 +      RNA_def_property_ui_icon(prop, ICON_LAYER_USED, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      prop = RNA_def_property(srna, "show_on_foreground", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_FOREGROUND);
 -      RNA_def_property_ui_text(prop, "Show On Foreground", "Show this image in front of objects in viewport");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      prop = RNA_def_property(srna, "filter_state", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_sdna(prop, NULL, "filter_state");
 +      RNA_def_property_enum_items(prop, filter_state_items);
 +      RNA_def_property_ui_text(prop, "State Filter", "");
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      /* expose 1 flag as a enum of 2 items */
 -      prop = RNA_def_property(srna, "draw_depth", PROP_ENUM, PROP_NONE);
 -      RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
 -      RNA_def_property_enum_items(prop, bgpic_draw_depth_items);
 -      RNA_def_property_ui_text(prop, "Depth", "Draw under or over everything");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 +      /* Filters object type. */
 +      prop = RNA_def_property(srna, "use_filter_object_type", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_OB_TYPE);
 +      RNA_def_property_ui_text(prop, "Filter Object Type", "Show specific objects types");
 +      RNA_def_property_ui_icon(prop, ICON_MESH_CUBE, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      /* expose 2 flags as a enum of 3 items */
 -      prop = RNA_def_property(srna, "frame_method", PROP_ENUM, PROP_NONE);
 -      RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
 -      RNA_def_property_enum_items(prop, bgpic_camera_frame_items);
 -      RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 -}
 +      prop = RNA_def_property(srna, "use_filter_object_mesh", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_MESH);
 +      RNA_def_property_ui_text(prop, "Show Meshes", "Show mesh objects");
 +      RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_MESH, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop)
 -{
 -      StructRNA *srna;
 -      FunctionRNA *func;
 -      PropertyRNA *parm;
 +      prop = RNA_def_property(srna, "use_filter_object_armature", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_ARMATURE);
 +      RNA_def_property_ui_text(prop, "Show Armatures", "Show armature objects");
 +      RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_ARMATURE, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      RNA_def_property_srna(cprop, "BackgroundImages");
 -      srna = RNA_def_struct(brna, "BackgroundImages", NULL);
 -      RNA_def_struct_sdna(srna, "View3D");
 -      RNA_def_struct_ui_text(srna, "Background Images", "Collection of background images");
 +      prop = RNA_def_property(srna, "use_filter_object_empty", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_EMPTY);
 +      RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects");
 +      RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_EMPTY, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      func = RNA_def_function(srna, "new", "rna_BackgroundImage_new");
 -      RNA_def_function_ui_description(func, "Add new background image");
 -      parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
 -      RNA_def_function_return(func, parm);
 +      prop = RNA_def_property(srna, "use_filter_object_lamp", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_LAMP);
 +      RNA_def_property_ui_text(prop, "Show Lamps", "Show lamps objects");
 +      RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_LAMP, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      func = RNA_def_function(srna, "remove", "rna_BackgroundImage_remove");
 -      RNA_def_function_ui_description(func, "Remove background image");
 -      RNA_def_function_flag(func, FUNC_USE_REPORTS);
 -      parm = RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background");
 -      RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
 -      RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
 +      prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_CAMERA);
 +      RNA_def_property_ui_text(prop, "Show Cameras", "Show camera objects");
 +      RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_CAMERA, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  
 -      func = RNA_def_function(srna, "clear", "rna_BackgroundImage_clear");
 -      RNA_def_function_ui_description(func, "Remove all background images");
 +      prop = RNA_def_property(srna, "use_filter_object_others", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_OTHERS);
 +      RNA_def_property_ui_text(prop, "Show Other Objects", "Show curves, lattices, light probes, fonts, ...");
 +      RNA_def_property_ui_icon(prop, ICON_ZOOMIN, 0);
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
  }
  
 -
  static void rna_def_space_view3d(BlenderRNA *brna)
  {
        StructRNA *srna;
        RNA_def_property_ui_text(prop, "Backface Culling", "Use back face culling to hide the back side of faces");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
  
 -      prop = RNA_def_property(srna, "show_textured_shadeless", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHADELESS_TEX);
 -      RNA_def_property_ui_text(prop, "Shadeless", "Show shadeless texture without lighting in textured draw mode");
 +      prop = RNA_def_property(srna, "show_mode_shade_override", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_MODE_SHADE_OVERRIDE);
 +      RNA_def_property_ui_text(prop, "Full Shading", "Use full shading for mode drawing (to view final result)");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
  
        prop = RNA_def_property(srna, "show_occlude_wire", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
  
 -      prop = RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
 -      RNA_def_property_collection_sdna(prop, NULL, "bgpicbase", NULL);
 -      RNA_def_property_struct_type(prop, "BackgroundImage");
 -      RNA_def_property_ui_text(prop, "Background Images", "List of background images");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 -      rna_def_backgroundImages(brna, prop);
 -
 -      prop = RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPICS);
 -      RNA_def_property_ui_text(prop, "Display Background Images",
 -                               "Display reference images behind objects in the 3D View");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 -
        prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "around");
        RNA_def_property_enum_items(prop, pivot_items_full);
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
  
        prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
 -      RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR);
 +      RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_MANIPULATOR_DRAW);
        RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
        RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
        prop = RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "twmode");
        RNA_def_property_enum_items(prop, transform_orientation_items);
 -      RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TransformOrientation_itemf");
 +      RNA_def_property_enum_funcs(prop, "rna_View3D_transform_orientation_get", "rna_View3D_transform_orientation_set",
 +                                  "rna_TransformOrientation_itemf");
        RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
  
        prop = RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
        RNA_def_property_struct_type(prop, "TransformOrientation");
 -      RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
 +      RNA_def_property_pointer_funcs(prop, "rna_View3D_current_orientation_get", NULL, NULL, NULL);
        RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current transformation orientation");
  
        prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
@@@ -2848,11 -2944,6 +2858,11 @@@ static void rna_def_space_buttons(Blend
        RNA_def_property_ui_text(prop, "Limited Texture Context",
                                 "Use the limited version of texture user (for 'old shading' mode)");
  
 +      prop = RNA_def_property(srna, "collection_context", PROP_ENUM, PROP_NONE);
 +      RNA_def_property_enum_items(prop, buttons_collection_context_items);
 +      RNA_def_property_ui_text(prop, "Collection Context", "Which collection we want to show");
 +      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
 +
        /* pinned data */
        prop = RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "pinid");
@@@ -3317,7 -3408,7 +3327,7 @@@ static void rna_def_space_dopesheet(Ble
        PropertyRNA *prop;
  
        /* XXX: action-editor is currently for object-level only actions, so show that using object-icon hint */
 -      static const EnumPropertyItem mode_items[] = {
 +      static EnumPropertyItem mode_items[] = {
                {SACTCONT_DOPESHEET, "DOPESHEET", ICON_OOPS, "Dope Sheet", "Edit all keyframes in scene"},
                {SACTCONT_ACTION, "ACTION", ICON_OBJECT_DATA, "Action Editor", "Edit keyframes in active object's Object-level action"},
                {SACTCONT_SHAPEKEY, "SHAPEKEY", ICON_SHAPEKEY_DATA, "Shape Key Editor", "Edit keyframes in active object's Shape Keys action"},
        RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL,
                                       "rna_Action_actedit_assign_poll");
        RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
 +      RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
  
        /* mode */
        RNA_def_property_enum_sdna(prop, NULL, "mode");
        RNA_def_property_enum_items(prop, mode_items);
        RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
 +      RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
  
        /* display */
@@@ -3790,7 -3879,6 +3800,7 @@@ static void rna_def_fileselect_params(B
                               "Particles Settings", "Show/hide Particle Settings data-blocks"},
                {FILTER_ID_PAL, "PALETTE", ICON_COLOR, "Palettes", "Show/hide Palette data-blocks"},
                {FILTER_ID_PC, "PAINT_CURVE", ICON_CURVE_BEZCURVE, "Paint Curves", "Show/hide Paint Curve data-blocks"},
 +              {FILTER_ID_LP, "LIGHT_PROBE", ICON_RADIO, "Light Probes", "Show/hide Light Probe data-blocks"},
                {FILTER_ID_SCE, "SCENE", ICON_SCENE_DATA, "Scenes", "Show/hide Scene data-blocks"},
                {FILTER_ID_SPK, "SPEAKER", ICON_SPEAKER, "Speakers", "Show/hide Speaker data-blocks"},
                {FILTER_ID_SO, "SOUND", ICON_SOUND, "Sounds", "Show/hide Sound data-blocks"},
                {FILTER_ID_TXT, "TEXT", ICON_TEXT, "Texts", "Show/hide Text data-blocks"},
                {FILTER_ID_VF, "FONT", ICON_FONT_DATA, "Fonts", "Show/hide Font data-blocks"},
                {FILTER_ID_WO, "WORLD", ICON_WORLD_DATA, "Worlds", "Show/hide World data-blocks"},
 +              {FILTER_ID_WS, "WORK_SPACE", ICON_NONE, "Workspaces", "Show/hide workspace data-blocks"},
                {0, NULL, 0, NULL, NULL}
        };
  
             "Show/hide materials, nodetrees, textures and Freestyle's linestyles"},
                {FILTER_ID_IM | FILTER_ID_MC | FILTER_ID_MSK | FILTER_ID_SO,
             "IMAGE", ICON_IMAGE_DATA, "Images & Sounds", "Show/hide images, movie clips, sounds and masks"},
 -              {FILTER_ID_CA | FILTER_ID_LA | FILTER_ID_SPK | FILTER_ID_WO,
 +              {FILTER_ID_CA | FILTER_ID_LA | FILTER_ID_SPK | FILTER_ID_WO | FILTER_ID_WS,
             "ENVIRONMENT", ICON_WORLD_DATA, "Environment", "Show/hide worlds, lamps, cameras and speakers"},
                {FILTER_ID_BR | FILTER_ID_GD | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_CF,
             "MISC", ICON_GREASEPENCIL, "Miscellaneous", "Show/hide other data types"},
@@@ -4331,10 -4418,14 +4341,10 @@@ static void rna_def_space_node(BlenderR
        RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
  
 -      prop = RNA_def_property(srna, "backdrop_x", PROP_FLOAT, PROP_NONE);
 +      prop = RNA_def_property(srna, "backdrop_offset", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "xof");
 -      RNA_def_property_ui_text(prop, "Backdrop X", "Backdrop X offset");
 -      RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
 -
 -      prop = RNA_def_property(srna, "backdrop_y", PROP_FLOAT, PROP_NONE);
 -      RNA_def_property_float_sdna(prop, NULL, "yof");
 -      RNA_def_property_ui_text(prop, "Backdrop Y", "Backdrop Y offset");
 +      RNA_def_property_array(prop, 2);
 +      RNA_def_property_ui_text(prop, "Backdrop Offset", "Backdrop offset");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
  
        prop = RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE);
@@@ -4708,6 -4799,7 +4718,6 @@@ void RNA_def_space(BlenderRNA *brna
        rna_def_filemenu_entry(brna);
        rna_def_space_filebrowser(brna);
        rna_def_space_outliner(brna);
 -      rna_def_background_image(brna);
        rna_def_space_view3d(brna);
        rna_def_space_buttons(brna);
        rna_def_space_dopesheet(brna);