Merge remote-tracking branch 'origin/master' into blender2.8
authorRay Molenkamp <github@lazydodo.com>
Mon, 28 May 2018 20:35:59 +0000 (14:35 -0600)
committerRay Molenkamp <github@lazydodo.com>
Mon, 28 May 2018 20:35:59 +0000 (14:35 -0600)
1  2 
CMakeLists.txt
build_files/cmake/platform/platform_win32.cmake
source/blender/blenkernel/intern/rigidbody.c
source/blender/makesrna/intern/makesrna.c

diff --combined CMakeLists.txt
@@@ -156,6 -156,7 +156,6 @@@ option_defaults_init
        _init_OPENCOLORIO
        _init_SDL
        _init_FFTW3
 -      _init_GAMEENGINE
        _init_OPENSUBDIV
  )
  
@@@ -225,10 -226,15 +225,10 @@@ option(WITH_FFTW3         "Enable FFTW
  option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
  option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
  mark_as_advanced(WITH_SYSTEM_BULLET)
 -option(WITH_GAMEENGINE    "Enable Game Engine" ${_init_GAMEENGINE})
 -if(APPLE)
 -      set(WITH_GAMEENGINE_DECKLINK OFF)
 -else()
 -      option(WITH_GAMEENGINE_DECKLINK "Support BlackMagicDesign DeckLink cards in the Game Engine" ON)
 -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)
  
@@@ -310,6 -316,7 +310,6 @@@ option(WITH_IMAGE_TIFF          "Enabl
  option(WITH_IMAGE_DDS           "Enable DDS Image Support" ON)
  option(WITH_IMAGE_CINEON        "Enable CINEON and DPX Image Support" ON)
  option(WITH_IMAGE_HDR           "Enable HDR Image Support" ON)
 -option(WITH_IMAGE_FRAMESERVER   "Enable image FrameServer Support for rendering" ON)
  
  # Audio/Video format support
  option(WITH_CODEC_AVI           "Enable Blenders own AVI file support (raw/jpeg)" ON)
@@@ -372,14 -379,10 +372,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)
@@@ -460,16 -463,28 +460,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)
@@@ -495,10 -510,11 +495,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)
@@@ -601,17 -617,15 +601,17 @@@ endif(
  #-----------------------------------------------------------------------------
  # Check for conflicting/unsupported configurations
  
 -if(NOT WITH_BLENDER AND NOT WITH_PLAYER AND NOT WITH_CYCLES_STANDALONE)
 +if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
        message(FATAL_ERROR
 -              "At least one of WITH_BLENDER or WITH_PLAYER or "
 -              "WITH_CYCLES_STANDALONE must be enabled, nothing to do!"
 +              "At least one of WITH_BLENDER or WITH_CYCLES_STANDALONE "
 +              "must be enabled, nothing to do!"
        )
  endif()
  
 -if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
 -      message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 +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_JACK)
                message(FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE")
        endif()
 -      if(WITH_GAMEENGINE)
 -              message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
 -      endif()
  endif()
  
  if(NOT WITH_SDL AND WITH_GHOST_SDL)
  endif()
  
  # python module, needs some different options
 -if(WITH_PYTHON_MODULE AND WITH_PLAYER)
 -      message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF")
 -endif()
 -
  if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
        message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
  endif()
@@@ -655,10 -676,15 +655,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()
@@@ -727,9 -753,30 +727,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()
  
@@@ -991,11 -1038,19 +991,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)
@@@ -1145,6 -1203,10 +1145,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
@@@ -1509,15 -1578,10 +1509,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)
@@@ -1548,7 -1612,12 +1548,12 @@@ else(
  endif()
  
  # Visual Studio has all standards it supports available by default
- if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
+ # Clang on windows copies this behavior and does not support these switches
+ if(
+       CMAKE_COMPILER_IS_GNUCC OR
+       (CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR
+       (CMAKE_C_COMPILER_ID MATCHES "Intel")
+ )
        # Use C99 + GNU extensions, works with GCC, Clang, ICC
        if(WITH_C11)
                set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
@@@ -1602,7 -1671,7 +1607,7 @@@ if(WITH_GTESTS
        include(GTestTesting)
  endif()
  
 -if(WITH_BLENDER OR WITH_PLAYER)
 +if(WITH_BLENDER)
        add_subdirectory(intern)
        add_subdirectory(extern)
  
@@@ -1627,6 -1696,13 +1632,6 @@@ if(WITH_BLENDER
  endif()
  
  
 -#-----------------------------------------------------------------------------
 -# Blender Player
 -if(WITH_PLAYER)
 -      add_subdirectory(source/blenderplayer)
 -endif()
 -
 -
  #-----------------------------------------------------------------------------
  # Testing
  add_subdirectory(tests)
@@@ -1641,6 -1717,9 +1646,6 @@@ include(build_files/cmake/packaging.cma
  if(WITH_BLENDER)
        openmp_delayload(blender)
  endif()
 -if(WITH_PLAYER)
 -      openmp_delayload(blenderplayer)
 -endif()
  
  #-----------------------------------------------------------------------------
  # Print Final Configuration
@@@ -1674,6 -1753,8 +1679,6 @@@ if(FIRST_RUN
        message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
  
        info_cfg_text("Build Options:")
 -      info_cfg_option(WITH_GAMEENGINE)
 -      info_cfg_option(WITH_PLAYER)
        info_cfg_option(WITH_BULLET)
        info_cfg_option(WITH_IK_SOLVER)
        info_cfg_option(WITH_IK_ITASC)
  
        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)
@@@ -29,7 -29,10 +29,10 @@@ if(NOT MSVC
        message(FATAL_ERROR "Compiler is unsupported")
  endif()
  
- # Libraries configuration for Windows when compiling with MSVC.
+ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
+       set(MSVC_CLANG On)
+       file(TO_CMAKE_PATH $ENV{VCToolsRedistDir} MSVC_REDIST_DIR)
+ endif()
  
  set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
  
@@@ -121,8 -124,16 +124,16 @@@ include(InstallRequiredSystemLibraries
  
  remove_cc_flag("/MDd" "/MD")
  
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
- set(CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
+ if(MSVC_CLANG) # Clangs version of cl doesn't support all flags 
+       if(NOT WITH_CXX11) # C++11 is on by default in clang-cl and can't be turned off, if c++11 is not enabled in blender repress some c++11 related warnings. 
+               set(CXX_WARN_FLAGS "-Wno-inconsistent-missing-override")
+       endif()
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
+       set(CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference")
+ else()
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc")
+       set(CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} /nologo /J /Gd /MP")
+ endif()
  
  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
  set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
@@@ -534,21 -545,22 +545,21 @@@ set(WINTAB_INC ${LIBDIR}/wintab/include
  if(WITH_OPENAL)
        set(OPENAL ${LIBDIR}/openal)
        set(OPENALDIR ${LIBDIR}/openal)
 -      set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
 +      set(OPENAL_INCLUDE_DIR ${OPENAL}/include/AL)
        set(OPENAL_LIBPATH ${OPENAL}/lib)
        if(MSVC)
                set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/openal32.lib)
        else()
                set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/wrap_oal.lib)
        endif()
 -      
 +
  endif()
  
  if(WITH_CODEC_SNDFILE)
 -      set(SNDFILE ${LIBDIR}/sndfile)
 -      set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
 -      set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
 -      set(SNDFILE_LIBRARIES ${SNDFILE_LIBPATH}/libsndfile-1.lib)
 -      
 +      set(LIBSNDFILE ${LIBDIR}/sndfile)
 +      set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
 +      set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib) # TODO, deprecate
 +      set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
  endif()
  
  if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
@@@ -55,7 -55,7 +55,7 @@@
  #include "DNA_scene_types.h"
  
  #include "BKE_cdderivedmesh.h"
 -#include "BKE_depsgraph.h"
 +#include "BKE_collection.h"
  #include "BKE_effect.h"
  #include "BKE_global.h"
  #include "BKE_library.h"
@@@ -67,7 -67,6 +67,7 @@@
  #include "BKE_scene.h"
  
  #include "DEG_depsgraph.h"
 +#include "DEG_depsgraph_query.h"
  
  /* ************************************** */
  /* Memory Management */
@@@ -94,30 -93,26 +94,30 @@@ void BKE_rigidbody_free_world(RigidBody
  
        if (rbw->physics_world) {
                /* free physics references, we assume that all physics objects in will have been added to the world */
 -              GroupObject *go;
                if (rbw->constraints) {
 -                      for (go = rbw->constraints->gobject.first; go; go = go->next) {
 -                              if (go->ob && go->ob->rigidbody_constraint) {
 -                                      RigidBodyCon *rbc = go->ob->rigidbody_constraint;
 -
 -                                      if (rbc->physics_constraint)
 +                      FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->constraints, object)
 +                      {
 +                              if (object->rigidbody_constraint) {
 +                                      RigidBodyCon *rbc = object->rigidbody_constraint;
 +                                      if (rbc->physics_constraint) {
                                                RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
 +                                      }
                                }
                        }
 +                      FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
                }
 -              if (rbw->group) {
 -                      for (go = rbw->group->gobject.first; go; go = go->next) {
 -                              if (go->ob && go->ob->rigidbody_object) {
 -                                      RigidBodyOb *rbo = go->ob->rigidbody_object;
  
 -                                      if (rbo->physics_object)
 +              if (rbw->group) {
 +                      FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->group, object)
 +                      {
 +                              if (object->rigidbody_object) {
 +                                      RigidBodyOb *rbo = object->rigidbody_object;
 +                                      if (rbo->physics_object) {
                                                RB_dworld_remove_body(rbw->physics_world, rbo->physics_object);
 +                                      }
                                }
                        }
 +                      FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
                }
                /* free dynamics world */
                RB_dworld_delete(rbw->physics_world);
@@@ -1025,8 -1020,8 +1025,8 @@@ RigidBodyOb *BKE_rigidbody_create_objec
        rbo->lin_sleep_thresh = 0.4f; /* 0.4 is half of Bullet default */
        rbo->ang_sleep_thresh = 0.5f; /* 0.5 is half of Bullet default */
  
 -      rbo->lin_damping = 0.04f; /* 0.04 is game engine default */
 -      rbo->ang_damping = 0.1f; /* 0.1 is game engine default */
 +      rbo->lin_damping = 0.04f;
 +      rbo->ang_damping = 0.1f;
  
        rbo->col_groups = 1;
  
@@@ -1138,6 -1133,7 +1138,6 @@@ void BKE_rigidbody_remove_object(Scene 
        RigidBodyWorld *rbw = scene->rigidbody_world;
        RigidBodyOb *rbo = ob->rigidbody_object;
        RigidBodyCon *rbc;
 -      GroupObject *go;
        int i;
  
        if (rbw) {
  
                /* remove object from rigid body constraints */
                if (rbw->constraints) {
 -                      for (go = rbw->constraints->gobject.first; go; go = go->next) {
 -                              Object *obt = go->ob;
 +                      FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->constraints, obt)
 +                      {
                                if (obt && obt->rigidbody_constraint) {
                                        rbc = obt->rigidbody_constraint;
                                        if (ELEM(ob, rbc->ob1, rbc->ob2)) {
                                        }
                                }
                        }
 +                      FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
                }
        }
  
@@@ -1200,23 -1195,20 +1200,23 @@@ void BKE_rigidbody_remove_constraint(Sc
  /* Update object array and rigid body count so they're in sync with the rigid body group */
  static void rigidbody_update_ob_array(RigidBodyWorld *rbw)
  {
 -      GroupObject *go;
 +      const ListBase objects = BKE_collection_object_cache_get(rbw->group);
        int i, n;
  
 -      n = BLI_listbase_count(&rbw->group->gobject);
 +      n = BLI_listbase_count(&objects);
  
        if (rbw->numbodies != n) {
                rbw->numbodies = n;
                rbw->objects = realloc(rbw->objects, sizeof(Object *) * rbw->numbodies);
        }
  
 -      for (go = rbw->group->gobject.first, i = 0; go; go = go->next, i++) {
 -              Object *ob = go->ob;
 -              rbw->objects[i] = ob;
 +      i = 0;
 +      FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->group, object)
 +      {
 +              rbw->objects[i] = object;
 +              i++;
        }
 +      FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
  }
  
  static void rigidbody_update_sim_world(Scene *scene, RigidBodyWorld *rbw)
        rigidbody_update_ob_array(rbw);
  }
  
 -static void rigidbody_update_sim_ob(Scene *scene, RigidBodyWorld *rbw, Object *ob, RigidBodyOb *rbo)
 +static void rigidbody_update_sim_ob(struct Depsgraph *depsgraph, Scene *scene, RigidBodyWorld *rbw, Object *ob, RigidBodyOb *rbo)
  {
        float loc[3];
        float rot[4];
                ListBase *effectors;
  
                /* get effectors present in the group specified by effector_weights */
 -              effectors = pdInitEffectors(scene, ob, NULL, effector_weights, true);
 +              effectors = pdInitEffectors(depsgraph, scene, ob, NULL, effector_weights, true);
                if (effectors) {
                        float eff_force[3] = {0.0f, 0.0f, 0.0f};
                        float eff_loc[3], eff_vel[3];
   *
   * \param rebuild Rebuild entire simulation
   */
 -static void rigidbody_update_simulation(Scene *scene, RigidBodyWorld *rbw, bool rebuild)
 +static void rigidbody_update_simulation(struct Depsgraph *depsgraph, Scene *scene, RigidBodyWorld *rbw, bool rebuild)
  {
 -      GroupObject *go;
 -
        /* update world */
        if (rebuild)
                BKE_rigidbody_validate_sim_world(scene, rbw, true);
         * Memory management needs redesign here, this is just a dirty workaround.
         */
        if (rebuild && rbw->constraints) {
 -              for (go = rbw->constraints->gobject.first; go; go = go->next) {
 -                      Object *ob = go->ob;
 -                      if (ob) {
 -                              RigidBodyCon *rbc = ob->rigidbody_constraint;
 -                              if (rbc && rbc->physics_constraint) {
 -                                      RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
 -                                      RB_constraint_delete(rbc->physics_constraint);
 -                                      rbc->physics_constraint = NULL;
 -                              }
 +              FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->constraints, ob)
 +              {
 +                      RigidBodyCon *rbc = ob->rigidbody_constraint;
 +                      if (rbc && rbc->physics_constraint) {
 +                              RB_dworld_remove_constraint(rbw->physics_world, rbc->physics_constraint);
 +                              RB_constraint_delete(rbc->physics_constraint);
 +                              rbc->physics_constraint = NULL;
                        }
                }
 +              FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
        }
  
        /* update objects */
 -      for (go = rbw->group->gobject.first; go; go = go->next) {
 -              Object *ob = go->ob;
 -
 -              if (ob && ob->type == OB_MESH) {
 +      FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->group, ob)
 +      {
 +              if (ob->type == OB_MESH) {
                        /* validate that we've got valid object set up here... */
                        RigidBodyOb *rbo = ob->rigidbody_object;
                        /* update transformation matrix of the object so we don't get a frame of lag for simple animations */
 -                      BKE_object_where_is_calc(scene, ob);
 +                      BKE_object_where_is_calc(depsgraph, scene, ob);
  
                        if (rbo == NULL) {
                                /* Since this object is included in the sim group but doesn't have
                        }
  
                        /* update simulation object... */
 -                      rigidbody_update_sim_ob(scene, rbw, ob, rbo);
 +                      rigidbody_update_sim_ob(depsgraph, scene, rbw, ob, rbo);
                }
        }
 +      FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
        
        /* update constraints */
        if (rbw->constraints == NULL) /* no constraints, move on */
                return;
 -      for (go = rbw->constraints->gobject.first; go; go = go->next) {
 -              Object *ob = go->ob;
  
 -              if (ob) {
 -                      /* validate that we've got valid object set up here... */
 -                      RigidBodyCon *rbc = ob->rigidbody_constraint;
 -                      /* update transformation matrix of the object so we don't get a frame of lag for simple animations */
 -                      BKE_object_where_is_calc(scene, ob);
 +      FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->constraints, ob)
 +      {
 +              /* validate that we've got valid object set up here... */
 +              RigidBodyCon *rbc = ob->rigidbody_constraint;
 +              /* update transformation matrix of the object so we don't get a frame of lag for simple animations */
 +              BKE_object_where_is_calc(depsgraph, scene, ob);
  
 -                      if (rbc == NULL) {
 -                              /* Since this object is included in the group but doesn't have
 -                               * constraint settings (perhaps it was added manually), add!
 -                               */
 -                              ob->rigidbody_constraint = BKE_rigidbody_create_constraint(scene, ob, RBC_TYPE_FIXED);
 -                              rigidbody_validate_sim_constraint(rbw, ob, true);
 +              if (rbc == NULL) {
 +                      /* Since this object is included in the group but doesn't have
 +                       * constraint settings (perhaps it was added manually), add!
 +                       */
 +                      ob->rigidbody_constraint = BKE_rigidbody_create_constraint(scene, ob, RBC_TYPE_FIXED);
 +                      rigidbody_validate_sim_constraint(rbw, ob, true);
  
 -                              rbc = ob->rigidbody_constraint;
 +                      rbc = ob->rigidbody_constraint;
 +              }
 +              else {
 +                      /* perform simulation data updates as tagged */
 +                      if (rebuild) {
 +                              /* World has been rebuilt so rebuild constraint */
 +                              rigidbody_validate_sim_constraint(rbw, ob, true);
                        }
 -                      else {
 -                              /* perform simulation data updates as tagged */
 -                              if (rebuild) {
 -                                      /* World has been rebuilt so rebuild constraint */
 -                                      rigidbody_validate_sim_constraint(rbw, ob, true);
 -                              }
 -                              else if (rbc->flag & RBC_FLAG_NEEDS_VALIDATE) {
 -                                      rigidbody_validate_sim_constraint(rbw, ob, false);
 -                              }
 -                              rbc->flag &= ~RBC_FLAG_NEEDS_VALIDATE;
 +                      else if (rbc->flag & RBC_FLAG_NEEDS_VALIDATE) {
 +                              rigidbody_validate_sim_constraint(rbw, ob, false);
                        }
 +                      rbc->flag &= ~RBC_FLAG_NEEDS_VALIDATE;
                }
        }
 +      FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
  }
  
  static void rigidbody_update_simulation_post_step(RigidBodyWorld *rbw)
  {
 -      GroupObject *go;
 -
 -      for (go = rbw->group->gobject.first; go; go = go->next) {
 -              Object *ob = go->ob;
 -
 -              if (ob) {
 -                      RigidBodyOb *rbo = ob->rigidbody_object;
 -                      /* reset kinematic state for transformed objects */
 -                      if (rbo && (ob->flag & SELECT) && (G.moving & G_TRANSFORM_OBJ)) {
 -                              RB_body_set_kinematic_state(rbo->physics_object, rbo->flag & RBO_FLAG_KINEMATIC || rbo->flag & RBO_FLAG_DISABLED);
 -                              RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
 -                              /* deactivate passive objects so they don't interfere with deactivation of active objects */
 -                              if (rbo->type == RBO_TYPE_PASSIVE)
 -                                      RB_body_deactivate(rbo->physics_object);
 -                      }
 +      FOREACH_COLLECTION_BASE_RECURSIVE_BEGIN(rbw->group, base)
 +      {
 +              Object *ob = base->object;
 +              RigidBodyOb *rbo = ob->rigidbody_object;
 +              /* Reset kinematic state for transformed objects. */
 +              if (rbo && (base->flag & BASE_SELECTED) && (G.moving & G_TRANSFORM_OBJ)) {
 +                      RB_body_set_kinematic_state(rbo->physics_object, rbo->flag & RBO_FLAG_KINEMATIC || rbo->flag & RBO_FLAG_DISABLED);
 +                      RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo));
 +                      /* Deactivate passive objects so they don't interfere with deactivation of active objects. */
 +                      if (rbo->type == RBO_TYPE_PASSIVE)
 +                              RB_body_deactivate(rbo->physics_object);
                }
        }
 +      FOREACH_COLLECTION_BASE_RECURSIVE_END
  }
  
  bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float ctime)
@@@ -1565,7 -1564,7 +1565,7 @@@ void BKE_rigidbody_cache_reset(RigidBod
  
  /* Rebuild rigid body world */
  /* NOTE: this needs to be called before frame update to work correctly */
 -void BKE_rigidbody_rebuild_world(Scene *scene, float ctime)
 +void BKE_rigidbody_rebuild_world(struct Depsgraph *depsgraph, Scene *scene, float ctime)
  {
        RigidBodyWorld *rbw = scene->rigidbody_world;
        PointCache *cache;
        cache = rbw->pointcache;
  
        /* flag cache as outdated if we don't have a world or number of objects in the simulation has changed */
 -      if (rbw->physics_world == NULL || rbw->numbodies != BLI_listbase_count(&rbw->group->gobject)) {
 +      const ListBase objects = BKE_collection_object_cache_get(rbw->group);
 +      if (rbw->physics_world == NULL || rbw->numbodies != BLI_listbase_count(&objects)) {
                cache->flag |= PTCACHE_OUTDATED;
        }
  
        if (ctime == startframe + 1 && rbw->ltime == startframe) {
                if (cache->flag & PTCACHE_OUTDATED) {
                        BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
 -                      rigidbody_update_simulation(scene, rbw, true);
 +                      rigidbody_update_simulation(depsgraph, scene, rbw, true);
                        BKE_ptcache_validate(cache, (int)ctime);
                        cache->last_exact = 0;
                        cache->flag &= ~PTCACHE_REDO_NEEDED;
  }
  
  /* Run RigidBody simulation for the specified physics world */
 -void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
 +void BKE_rigidbody_do_simulation(struct Depsgraph *depsgraph, Scene *scene, float ctime)
  {
        float timestep;
        RigidBodyWorld *rbw = scene->rigidbody_world;
        }
  
        /* advance simulation, we can only step one frame forward */
 -      if (can_simulate) {
 +      if (ctime == rbw->ltime + 1) {
                /* write cache for first frame when on second frame */
                if (rbw->ltime == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) {
                        BKE_ptcache_write(&pid, startframe);
                }
  
                /* update and validate simulation */
 -              rigidbody_update_simulation(scene, rbw, false);
 +              rigidbody_update_simulation(depsgraph, scene, rbw, false);
  
                /* calculate how much time elapsed since last step in seconds */
                timestep = 1.0f / (float)FPS * (ctime - rbw->ltime) * rbw->time_scale;
  #else  /* WITH_BULLET */
  
  /* stubs */
- #ifdef __GNUC__
+ #if defined(__GNUC__) || defined(__clang__)
  #  pragma GCC diagnostic push
  #  pragma GCC diagnostic ignored "-Wunused-parameter"
  #endif
@@@ -1683,10 -1681,10 +1683,10 @@@ void BKE_rigidbody_sync_transforms(Rigi
  void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle) {}
  bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, float ctime) { return false; }
  void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {}
 -void BKE_rigidbody_rebuild_world(Scene *scene, float ctime) {}
 -void BKE_rigidbody_do_simulation(Scene *scene, float ctime) {}
 +void BKE_rigidbody_rebuild_world(struct Depsgraph *depsgraph, Scene *scene, float ctime) {}
 +void BKE_rigidbody_do_simulation(struct Depsgraph *depsgraph, Scene *scene, float ctime) {}
  
- #ifdef __GNUC__
+ #if defined(__GNUC__) || defined(__clang__)
  #  pragma GCC diagnostic pop
  #endif
  
  /* -------------------- */
  /* Depsgraph evaluation */
  
 -void BKE_rigidbody_rebuild_sim(EvaluationContext *UNUSED(eval_ctx),
 +void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph,
                                 Scene *scene)
  {
 -      float ctime = BKE_scene_frame_get(scene);
 -      DEG_debug_print_eval_time(__func__, scene->id.name, scene, ctime);
 +      float ctime = DEG_get_ctime(depsgraph);
 +      DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime);
        /* rebuild sim data (i.e. after resetting to start of timeline) */
        if (BKE_scene_check_rigidbody_active(scene)) {
 -              BKE_rigidbody_rebuild_world(scene, ctime);
 +              BKE_rigidbody_rebuild_world(depsgraph, scene, ctime);
        }
  }
  
 -void BKE_rigidbody_eval_simulation(EvaluationContext *UNUSED(eval_ctx),
 +void BKE_rigidbody_eval_simulation(struct Depsgraph *depsgraph,
                                     Scene *scene)
  {
 -      float ctime = BKE_scene_frame_get(scene);
 -      DEG_debug_print_eval_time(__func__, scene->id.name, scene, ctime);
 +      float ctime = DEG_get_ctime(depsgraph);
 +      DEG_debug_print_eval_time(depsgraph, __func__, scene->id.name, scene, ctime);
        /* evaluate rigidbody sim */
        if (BKE_scene_check_rigidbody_active(scene)) {
 -              BKE_rigidbody_do_simulation(scene, ctime);
 +              BKE_rigidbody_do_simulation(depsgraph, scene, ctime);
        }
  }
  
 -void BKE_rigidbody_object_sync_transforms(EvaluationContext *UNUSED(eval_ctx),
 +void BKE_rigidbody_object_sync_transforms(struct Depsgraph *depsgraph,
                                            Scene *scene,
                                            Object *ob)
  {
        RigidBodyWorld *rbw = scene->rigidbody_world;
 -      float ctime = BKE_scene_frame_get(scene);
 -      DEG_debug_print_eval_time(__func__, ob->id.name, ob, ctime);
 +      float ctime = DEG_get_ctime(depsgraph);
 +      DEG_debug_print_eval_time(depsgraph, __func__, ob->id.name, ob, ctime);
        /* read values pushed into RBO from sim/cache... */
        BKE_rigidbody_sync_transforms(rbw, ob, ctime);
  }
@@@ -905,7 -905,7 +905,7 @@@ static char *rna_def_property_set_func(
                                }
                                else {
                                        PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop;
 -                                      StructRNA *type = rna_find_struct((const char *)pprop->type);
 +                                      StructRNA *type = (pprop->type) ? rna_find_struct((const char *)pprop->type) : NULL;
                                        if (type && (type->flag & STRUCT_ID)) {
                                                fprintf(f, "    if (value.data)\n");
                                                fprintf(f, "            id_lib_extern((ID *)value.data);\n\n");
@@@ -2466,24 -2466,12 +2466,24 @@@ static void rna_auto_types(void
  
        for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {
                /* DNA name for Screen is patched in 2.5, we do the reverse here .. */
 -              if (ds->dnaname && STREQ(ds->dnaname, "Screen"))
 -                      ds->dnaname = "bScreen";
 +              if (ds->dnaname) {
 +                      if (STREQ(ds->dnaname, "Screen"))
 +                              ds->dnaname = "bScreen";
 +                      if (STREQ(ds->dnaname, "Group"))
 +                              ds->dnaname = "Collection";
 +                      if (STREQ(ds->dnaname, "GroupObject"))
 +                              ds->dnaname = "CollectionObject";
 +              }
  
                for (dp = ds->cont.properties.first; dp; dp = dp->next) {
 -                      if (dp->dnastructname && STREQ(dp->dnastructname, "Screen"))
 -                              dp->dnastructname = "bScreen";
 +                      if (dp->dnastructname) {
 +                              if (STREQ(dp->dnastructname, "Screen"))
 +                                      dp->dnastructname = "bScreen";
 +                              if (STREQ(dp->dnastructname, "Group"))
 +                                      dp->dnastructname = "Collection";
 +                              if (STREQ(dp->dnastructname, "GroupObject"))
 +                                      dp->dnastructname = "CollectionObject";
 +                      }
  
                        if (dp->dnatype) {
                                if (dp->prop->type == PROP_POINTER) {
@@@ -3019,28 -3007,6 +3019,28 @@@ static void rna_generate_property(FILE 
                        }
                        break;
                }
 +              case PROP_POINTER:
 +              {
 +                      PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
 +
 +                      /* XXX This systematically enforces that flag on ID pointers... we'll probably have to revisit. :/ */
 +                      StructRNA *type = rna_find_struct((const char *)pprop->type);
 +                      if (type && (type->flag & STRUCT_ID)) {
 +                              prop->flag |= PROP_PTR_NO_OWNERSHIP;
 +                      }
 +                      break;
 +              }
 +              case PROP_COLLECTION:
 +              {
 +                      CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop;
 +
 +                      /* XXX This systematically enforces that flag on ID pointers... we'll probably have to revisit. :/ */
 +                      StructRNA *type = rna_find_struct((const char *)cprop->item_type);
 +                      if (type && (type->flag & STRUCT_ID)) {
 +                              prop->flag |= PROP_PTR_NO_OWNERSHIP;
 +                      }
 +                      break;
 +              }
                default:
                        break;
        }
                prop->arraylength[1],
                prop->arraylength[2],
                prop->totarraylength);
 -      fprintf(f, "\t%s%s, %d, %s, %s,\n",
 +      fprintf(f, "\t%s%s, %d, %s, %s, %s, %s, %s,\n",
                (prop->flag & PROP_CONTEXT_UPDATE) ? "(UpdateFunc)" : "",
                rna_function_string(prop->update),
                prop->noteflag,
                rna_function_string(prop->editable),
 -              rna_function_string(prop->itemeditable));
 +              rna_function_string(prop->itemeditable),
 +              rna_function_string(prop->override_diff),
 +              rna_function_string(prop->override_store),
 +              rna_function_string(prop->override_apply));
  
        if (prop->flag_internal & PROP_INTERN_RAW_ACCESS) rna_set_raw_offset(f, srna, prop);
        else fprintf(f, "\t0, -1");
@@@ -3374,6 -3337,7 +3374,6 @@@ static RNAProcessItem PROCESS_ITEMS[] 
        {"rna_action.c", "rna_action_api.c", RNA_def_action},
        {"rna_animation.c", "rna_animation_api.c", RNA_def_animation},
        {"rna_animviz.c", NULL, RNA_def_animviz},
 -      {"rna_actuator.c", "rna_actuator_api.c", RNA_def_actuator},
        {"rna_armature.c", "rna_armature_api.c", RNA_def_armature},
        {"rna_boid.c", NULL, RNA_def_boid},
        {"rna_brush.c", NULL, RNA_def_brush},
        {"rna_color.c", NULL, RNA_def_color},
        {"rna_constraint.c", NULL, RNA_def_constraint},
        {"rna_context.c", NULL, RNA_def_context},
 -      {"rna_controller.c", "rna_controller_api.c", RNA_def_controller},
        {"rna_curve.c", "rna_curve_api.c", RNA_def_curve},
 -      {"rna_depsgraph.c", NULL, RNA_def_depsgraph},
        {"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint},
        {"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve},
        {"rna_fluidsim.c", NULL, RNA_def_fluidsim},
        {"rna_gpencil.c", NULL, RNA_def_gpencil},
 -      {"rna_group.c", NULL, RNA_def_group},
 +      {"rna_group.c", NULL, RNA_def_collections},
        {"rna_image.c", "rna_image_api.c", RNA_def_image},
        {"rna_key.c", NULL, RNA_def_key},
        {"rna_lamp.c", NULL, RNA_def_lamp},
        {"rna_lattice.c", "rna_lattice_api.c", RNA_def_lattice},
 +      {"rna_layer.c", NULL, RNA_def_view_layer},
        {"rna_linestyle.c", NULL, RNA_def_linestyle},
        {"rna_main.c", "rna_main_api.c", RNA_def_main},
        {"rna_material.c", "rna_material_api.c", RNA_def_material},
        {"rna_nodetree.c", NULL, RNA_def_nodetree},
        {"rna_object.c", "rna_object_api.c", RNA_def_object},
        {"rna_object_force.c", NULL, RNA_def_object_force},
 +      {"rna_depsgraph.c", NULL, RNA_def_depsgraph},
        {"rna_packedfile.c", NULL, RNA_def_packedfile},
        {"rna_palette.c", NULL, RNA_def_palette},
        {"rna_particle.c", NULL, RNA_def_particle},
        {"rna_pose.c", "rna_pose_api.c", RNA_def_pose},
 -      {"rna_property.c", NULL, RNA_def_gameproperty},
 +      {"rna_lightprobe.c", NULL, RNA_def_lightprobe},
        {"rna_render.c", NULL, RNA_def_render},
        {"rna_rigidbody.c", NULL, RNA_def_rigidbody},
        {"rna_scene.c", "rna_scene_api.c", RNA_def_scene},
        {"rna_screen.c", NULL, RNA_def_screen},
        {"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint},
 -      {"rna_sensor.c", "rna_sensor_api.c", RNA_def_sensor},
        {"rna_sequencer.c", "rna_sequencer_api.c", RNA_def_sequencer},
        {"rna_smoke.c", NULL, RNA_def_smoke},
        {"rna_space.c", "rna_space_api.c", RNA_def_space},
        {"rna_userdef.c", NULL, RNA_def_userdef},
        {"rna_vfont.c", "rna_vfont_api.c", RNA_def_vfont},
        {"rna_wm.c", "rna_wm_api.c", RNA_def_wm},
 +      {"rna_wm_manipulator.c", "rna_wm_manipulator_api.c", RNA_def_wm_manipulator},
 +      {"rna_workspace.c", "rna_workspace_api.c", RNA_def_workspace},
        {"rna_world.c", NULL, RNA_def_world},
        {"rna_movieclip.c", NULL, RNA_def_movieclip},
        {"rna_tracking.c", NULL, RNA_def_tracking},
@@@ -3482,7 -3445,7 +3482,7 @@@ static void rna_generate(BlenderRNA *br
  
        /* we want the included C files to have warnings enabled but for the generated code
         * ignore unused-parameter warnings which are hard to prevent */
- #ifdef __GNUC__
+ #if defined( __GNUC__) || defined(__clang__)
        fprintf(f, "#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n\n");
  #endif
  
@@@ -3746,7 -3709,7 +3746,7 @@@ static const char *cpp_classes = "
  "     COLLECTION_PROPERTY_LENGTH_##has_length(sname, identifier) \\\n"
  "     COLLECTION_PROPERTY_LOOKUP_INT_##has_lookup_int(sname, identifier) \\\n"
  "     COLLECTION_PROPERTY_LOOKUP_STRING_##has_lookup_string(sname, identifier) \\\n"
 -"     Collection<sname, type, sname##_##identifier##_begin, \\\n"
 +"     CollectionRef<sname, type, sname##_##identifier##_begin, \\\n"
  "             sname##_##identifier##_next, sname##_##identifier##_end, \\\n"
  "             sname##_##identifier##_length_wrap, \\\n"
  "             sname##_##identifier##_lookup_int_wrap, sname##_##identifier##_lookup_string_wrap, collection_funcs> identifier;\n"
  "     operator void*() { return ptr.data; }\n"
  "     operator bool() { return ptr.data != NULL; }\n"
  "\n"
 +"     bool operator==(const Pointer &other) { return ptr.data == other.ptr.data; }\n"
 +"     bool operator!=(const Pointer &other) { return ptr.data != other.ptr.data; }\n"
 +"\n"
  "     PointerRNA ptr;\n"
  "};\n"
  "\n"
  "template<typename Tp, typename T, TBeginFunc Tbegin, TNextFunc Tnext, TEndFunc Tend,\n"
  "         TLengthFunc Tlength, TLookupIntFunc Tlookup_int, TLookupStringFunc Tlookup_string,\n"
  "         typename Tcollection_funcs>\n"
 -"class Collection : public Tcollection_funcs {\n"
 +"class CollectionRef : public Tcollection_funcs {\n"
  "public:\n"
 -"     Collection(const PointerRNA &p) : Tcollection_funcs(p), ptr(p) {}\n"
 +"     CollectionRef(const PointerRNA &p) : Tcollection_funcs(p), ptr(p) {}\n"
  "\n"
  "     void begin(CollectionIterator<T, Tbegin, Tnext, Tend>& iter)\n"
  "     { iter.begin(ptr); }\n"