Cycles: svn merge -r41467:41531 ^/trunk/blender
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 4 Nov 2011 20:21:40 +0000 (20:21 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 4 Nov 2011 20:21:40 +0000 (20:21 +0000)
188 files changed:
CMakeLists.txt
build_files/cmake/Modules/FindPythonLibsUnix.cmake
build_files/cmake/project_info.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
doc/python_api/examples/bpy.app.handlers.1.py [new file with mode: 0644]
doc/python_api/examples/bpy.app.handlers.py [new file with mode: 0644]
doc/python_api/sphinx_doc_gen.py
intern/audaspace/Python/AUD_PyAPI.cpp
intern/ghost/CMakeLists.txt
intern/ghost/intern/GHOST_SystemPathsX11.cpp
release/scripts/modules/bpy/__init__.py
release/scripts/presets/camera/APS-C_DSLR.py [new file with mode: 0644]
release/scripts/presets/camera/Blender.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_1100D.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_1D.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_1DS.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_500D.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_550D.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_5D.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_600D.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_60D.py [new file with mode: 0644]
release/scripts/presets/camera/Canon_7D.py [new file with mode: 0644]
release/scripts/presets/camera/Nikon_D300S.py [new file with mode: 0644]
release/scripts/presets/camera/Nikon_D3100.py [new file with mode: 0644]
release/scripts/presets/camera/Nikon_D35.py [new file with mode: 0644]
release/scripts/presets/camera/Nikon_D5000.py [new file with mode: 0644]
release/scripts/presets/camera/Nikon_D5100.py [new file with mode: 0644]
release/scripts/presets/camera/Nikon_D7000.py [new file with mode: 0644]
release/scripts/presets/camera/Nikon_D90.py [new file with mode: 0644]
release/scripts/presets/camera/Red_Epic.py [new file with mode: 0644]
release/scripts/presets/camera/Red_One_2K.py [new file with mode: 0644]
release/scripts/presets/camera/Red_One_3K.py [new file with mode: 0644]
release/scripts/presets/camera/Red_One_4K.py [new file with mode: 0644]
release/scripts/presets/camera/full_frame_35mm_film.py [new file with mode: 0644]
release/scripts/presets/camera/micro_four_thirds.py [new file with mode: 0644]
release/scripts/presets/camera/super_16_film.py [new file with mode: 0644]
release/scripts/presets/camera/super_35_film.py [new file with mode: 0644]
release/scripts/startup/bl_operators/presets.py
release/scripts/startup/bl_ui/properties_data_camera.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_graph.py
release/scripts/startup/bl_ui/space_nla.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_time.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/blenfont/intern/blf_font.c
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_curve.h
source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/BLI_math_rotation.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/uvproject.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/CameraExporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/editors/include/ED_render.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/object/object_bake.c
source/blender/editors/object/object_transform.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_view.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_view.c
source/blender/imbuf/intern/moviecache.c
source/blender/makesdna/DNA_camera_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_camera.c
source/blender/makesrna/intern/rna_controller.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_sensor.c
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/nodes/composite/nodes/node_composite_alphaOver.c
source/blender/nodes/composite/nodes/node_composite_bilateralblur.c
source/blender/nodes/composite/nodes/node_composite_blur.c
source/blender/nodes/composite/nodes/node_composite_brightness.c
source/blender/nodes/composite/nodes/node_composite_channelMatte.c
source/blender/nodes/composite/nodes/node_composite_chromaMatte.c
source/blender/nodes/composite/nodes/node_composite_colorMatte.c
source/blender/nodes/composite/nodes/node_composite_colorSpill.c
source/blender/nodes/composite/nodes/node_composite_colorbalance.c
source/blender/nodes/composite/nodes/node_composite_crop.c
source/blender/nodes/composite/nodes/node_composite_curves.c
source/blender/nodes/composite/nodes/node_composite_defocus.c
source/blender/nodes/composite/nodes/node_composite_diffMatte.c
source/blender/nodes/composite/nodes/node_composite_directionalblur.c
source/blender/nodes/composite/nodes/node_composite_displace.c
source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
source/blender/nodes/composite/nodes/node_composite_filter.c
source/blender/nodes/composite/nodes/node_composite_flip.c
source/blender/nodes/composite/nodes/node_composite_gamma.c
source/blender/nodes/composite/nodes/node_composite_glare.c
source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
source/blender/nodes/composite/nodes/node_composite_huecorrect.c
source/blender/nodes/composite/nodes/node_composite_idMask.c
source/blender/nodes/composite/nodes/node_composite_invert.c
source/blender/nodes/composite/nodes/node_composite_lensdist.c
source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
source/blender/nodes/composite/nodes/node_composite_mapUV.c
source/blender/nodes/composite/nodes/node_composite_mapValue.c
source/blender/nodes/composite/nodes/node_composite_normalize.c
source/blender/nodes/composite/nodes/node_composite_premulkey.c
source/blender/nodes/composite/nodes/node_composite_rgb.c
source/blender/nodes/composite/nodes/node_composite_rotate.c
source/blender/nodes/composite/nodes/node_composite_scale.c
source/blender/nodes/composite/nodes/node_composite_sepcombHSVA.c
source/blender/nodes/composite/nodes/node_composite_sepcombRGBA.c
source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c
source/blender/nodes/composite/nodes/node_composite_sepcombYUVA.c
source/blender/nodes/composite/nodes/node_composite_tonemap.c
source/blender/nodes/composite/nodes/node_composite_translate.c
source/blender/nodes/composite/nodes/node_composite_vecBlur.c
source/blender/nodes/composite/nodes/node_composite_zcombine.c
source/blender/nodes/shader/nodes/node_shader_geom.c
source/blender/python/BPY_extern.h
source/blender/python/generic/IDProp.c
source/blender/python/generic/IDProp.h
source/blender/python/generic/py_capi_utils.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_props.c
source/blender/quicktime/apple/qtkit_import.m
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/initrender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/shadbuf.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator.c
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Expressions/ListValue.cpp
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/StringValue.h
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_Camera.h
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_PythonSeq.cpp
source/gameengine/Ketsji/KX_PythonSeq.h
source/gameengine/Rasterizer/RAS_CameraData.h
source/gameengine/Rasterizer/RAS_FramingManager.cpp
source/gameengine/Rasterizer/RAS_FramingManager.h
source/gameengine/VideoTexture/BlendType.h
source/gameengine/VideoTexture/FilterBase.cpp
source/gameengine/VideoTexture/ImageBase.cpp
source/gameengine/VideoTexture/ImageRender.cpp
source/gameengine/VideoTexture/Texture.cpp
source/gameengine/VideoTexture/blendVideoTex.cpp

index 3ca7085c107e6e65f0f06dd39a91584234178686..0230fb34d0c7a58cdf336467cdd17122f508ba93 100644 (file)
@@ -158,6 +158,8 @@ endif()
 if(UNIX AND NOT APPLE)
        option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)"   ON)
        option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
+       option(WITH_XDG_USER_DIRS    "Build with XDG Base Directory Specification (only config and documents for now)" OFF)
+       mark_as_advanced(WITH_XDG_USER_DIRS)
 else()
        # not an option for other OS's
        set(WITH_BUILTIN_GLEW ON)
index fd5d20920dac4d3f4945b0f17d4f75251700d5e2..8c3ff64d3f3b1b915257d96ba89f7d0d958bc002 100644 (file)
@@ -44,8 +44,19 @@ SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for p
 MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
 
 
+# if the user passes these defines as args, we dont want to overwrite
+SET(_IS_INC_DEF OFF)
+SET(_IS_LIB_DEF OFF)
+IF(DEFINED PYTHON_INCLUDE_DIR)
+  SET(_IS_INC_DEF ON)
+ENDIF()
+IF(DEFINED PYTHON_LIBRARY)
+  SET(_IS_LIB_DEF ON)
+ENDIF()
+
+
 # only search for the dirs if we havn't already
-IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
+IF((NOT _IS_INC_DEF) OR (NOT _IS_LIB_DEF))
 
   SET(_python_ABI_FLAGS
     "m;mu;u; "    # release
@@ -66,30 +77,38 @@ IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
     #ENDIF()
     STRING(REPLACE " " "" _CURRENT_ABI_FLAGS ${_CURRENT_ABI_FLAGS})
 
-    FIND_PATH(PYTHON_INCLUDE_DIR
-      NAMES
-        Python.h
-      HINTS
-        ${_python_SEARCH_DIRS}
-      PATH_SUFFIXES
-        include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
-    )
-
-    FIND_LIBRARY(PYTHON_LIBRARY
-      NAMES
-        "python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}"
-      HINTS
-        ${_python_SEARCH_DIRS}
-      PATH_SUFFIXES
-        lib64 lib
-    )
+    IF(NOT DEFINED PYTHON_INCLUDE_DIR)
+      FIND_PATH(PYTHON_INCLUDE_DIR
+        NAMES
+          Python.h
+        HINTS
+          ${_python_SEARCH_DIRS}
+        PATH_SUFFIXES
+          include/python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}
+      )
+    ENDIF()
+
+    IF(NOT DEFINED PYTHON_LIBRARY)
+      FIND_LIBRARY(PYTHON_LIBRARY
+        NAMES
+          "python${PYTHON_VERSION}${_CURRENT_ABI_FLAGS}"
+        HINTS
+          ${_python_SEARCH_DIRS}
+        PATH_SUFFIXES
+          lib64 lib
+      )
+    ENDIF()
 
     IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
       break()
     ELSE()
       # ensure we dont find values from 2 different ABI versions
-      UNSET(PYTHON_INCLUDE_DIR CACHE)
-      UNSET(PYTHON_LIBRARY CACHE)
+      IF(NOT _IS_INC_DEF)
+        UNSET(PYTHON_INCLUDE_DIR CACHE)
+      ENDIF()
+      IF(NOT _IS_LIB_DEF)
+        UNSET(PYTHON_LIBRARY CACHE)
+      ENDIF()
     ENDIF()
   ENDFOREACH()
 
@@ -100,6 +119,9 @@ IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
   UNSET(_python_SEARCH_DIRS)
 ENDIF()
 
+UNSET(_IS_INC_DEF)
+UNSET(_IS_LIB_DEF)
+
 # handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF 
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
index da1f2087f4f15c7c0a5e2bbea0dfc96c29526b68..eed002ce7ba4c868ba7caa5c2bfdd95aef93f8a9 100755 (executable)
@@ -234,4 +234,3 @@ def project_name_get(path, fallback="Blender", prefix="Blender_"):
             if "/branches/" in l:
                 return prefix + l.rsplit("/branches/", 1)[-1].split("/", 1)[0]
     return fallback
-
index ec37b3046c8345b8444e1ccde7467eb01ede9302..1e4821180d619cce355691316af23c77503b36dc 100644 (file)
@@ -149,6 +149,20 @@ WITH_BF_3DMOUSE = True
 
 WITH_BF_OPENMP = True
 
+'''
+WITH_BF_OIIO = True
+BF_OIIO = LIBDIR + '/openimageio'
+BF_OIIO_INC = '${BF_OIIO}/include'
+BF_OIIO_LIB = 'OpenImageIO'
+BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+
+WITH_BF_BOOST = True
+BF_BOOST = LIBDIR + '/boost'
+BF_BOOST_INC = '${BF_BOOST}/include'
+BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_46_1 libboost_filesystem-vc90-mt-s-1_46_1 libboost_regex-vc90-mt-s-1_46_1 libboost_system-vc90-mt-s-1_46_1 libboost_thread-vc90-mt-s-1_46_1'
+BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
+'''
+
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
index afa64e03e80dd05cf020fb455116e9dc9a062464..0920d9375ae33c5a43795dbff8caf2d7f58065aa 100644 (file)
@@ -153,6 +153,20 @@ WITH_BF_3DMOUSE = True
 
 WITH_BF_OPENMP = True
 
+'''
+WITH_BF_OIIO = True
+BF_OIIO = LIBDIR + '/openimageio'
+BF_OIIO_INC = '${BF_OIIO}/include'
+BF_OIIO_LIB = 'OpenImageIO'
+BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
+
+WITH_BF_BOOST = True
+BF_BOOST = LIBDIR + '/boost'
+BF_BOOST_INC = '${BF_BOOST}/include'
+BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_45 libboost_filesystem-vc90-mt-s-1_45 libboost_regex-vc90-mt-s-1_45 libboost_system-vc90-mt-s-1_45 libboost_thread-vc90-mt-s-1_45'
+BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
+'''
+
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
index 875d8f7388b06a03baa6ca1f023f61ba4d9708de..44f9a4c8062a6b60bcb100e88e66fc6be54d5e89 100644 (file)
@@ -192,6 +192,11 @@ def setup_staticlibs(lenv):
     if lenv['WITH_BF_OPENMP']:
         if lenv['OURPLATFORM'] == 'linuxcross':
             libincs += Split(lenv['BF_OPENMP_LIBPATH'])
+            
+    if lenv['WITH_BF_OIIO']:
+        libincs += Split(lenv['BF_OIIO_LIBPATH'])
+    if lenv['WITH_BF_BOOST']:
+        libincs += Split(lenv['BF_BOOST_LIBPATH'])
 
     # setting this last so any overriding of manually libs could be handled
     if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
@@ -275,6 +280,11 @@ def setup_syslibs(lenv):
             if not lenv['WITH_BF_STATIC3DMOUSE']:
                 syslibs += Split(lenv['BF_3DMOUSE_LIB'])
 
+    if lenv['WITH_BF_OIIO']:
+        syslibs += Split(lenv['BF_OIIO_LIB'])
+    if lenv['WITH_BF_BOOST']:
+        syslibs += Split(lenv['BF_BOOST_LIB'])
+
     syslibs += lenv['LLIBS']
 
     return syslibs
index a678bc68f5459fc65f455ef28ffbe3087eecdffc..68054fe485e3d6326408c6ddb8152a946c162aab 100644 (file)
@@ -116,7 +116,9 @@ def validate_arguments(args, bc):
             'WITH_BF_INTERNATIONAL',
             'BF_GETTEXT', 'BF_GETTEXT_INC', 'BF_GETTEXT_LIB', 'WITH_BF_GETTEXT_STATIC', 'BF_GETTEXT_LIB_STATIC', 'BF_GETTEXT_LIBPATH',
             'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
-            'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'WITH_BF_ELTOPO', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
+            'WITH_BF_GAMEENGINE',
+            'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
+            'WITH_BF_ELTOPO',
             'BF_WINTAB', 'BF_WINTAB_INC',
             'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
             'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
@@ -133,12 +135,10 @@ def validate_arguments(args, bc):
             'WITHOUT_BF_INSTALL',
             'WITHOUT_BF_PYTHON_INSTALL',
             'WITHOUT_BF_OVERWRITE_INSTALL',
-            'WITH_BF_OPENMP',
-            'BF_OPENMP',
-            'BF_OPENMP_INC',
-            'BF_OPENMP_LIBPATH',
+            'WITH_BF_OPENMP', 'BF_OPENMP', 'BF_OPENMP_LIBPATH',
             'WITH_GHOST_COCOA',
             'WITH_GHOST_SDL',
+            'BF_GHOST_DEBUG',
             'USE_QTKIT',
             'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
             'BF_X264_CONFIG',
@@ -147,7 +147,6 @@ def validate_arguments(args, bc):
             'BF_NUMJOBS',
             'BF_MSVS',
             'BF_VERSION',
-            'BF_GHOST_DEBUG',
             'WITH_BF_RAYOPTIMIZATION',
             'BF_RAYOPTIMIZATION_SSE_FLAGS',
             'WITH_BF_FLUID',
@@ -155,7 +154,10 @@ def validate_arguments(args, bc):
             'WITH_BF_BOOLEAN',
             'WITH_BF_CXX_GUARDEDALLOC',
             'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
-            'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
+            'BUILDBOT_BRANCH',
+            'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
+            'WITH_BF_OIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIBPATH',
+            'WITH_BF_BOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIBPATH'
             ]
     
     # Have options here that scons expects to be lists
@@ -239,9 +241,9 @@ def read_opts(env, cfg, args):
         ('LCGDIR', 'location of cvs lib dir'),
         (BoolVariable('WITH_BF_PYTHON', 'Compile with python', True)),
         (BoolVariable('WITH_BF_PYTHON_SAFETY', 'Internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency)', False)),
-        ('BF_PYTHON', 'base path for python', ''),
+        ('BF_PYTHON', 'Base path for python', ''),
         ('BF_PYTHON_VERSION', 'Python version to use', ''),
-        ('BF_PYTHON_INC', 'include path for Python headers', ''),
+        ('BF_PYTHON_INC', 'Include path for Python headers', ''),
         ('BF_PYTHON_BINARY', 'Path to the Python interpreter', ''),
         ('BF_PYTHON_LIB', 'Python library', ''),
         ('BF_PYTHON_DLL', 'Python dll - used on Windows only', ''),
@@ -257,8 +259,8 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_BOOLEAN', 'Build with boolean modifier', True)),
         ('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
         (BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
-        ('BF_OPENAL', 'base path for OpenAL', ''),
-        ('BF_OPENAL_INC', 'include path for python headers', ''),
+        ('BF_OPENAL', 'Base path for OpenAL', ''),
+        ('BF_OPENAL_INC', 'Include path for python headers', ''),
         ('BF_OPENAL_LIB', 'Path to OpenAL library', ''),
         ('BF_OPENAL_LIB_STATIC', 'Path to OpenAL static library', ''),
         ('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
@@ -532,6 +534,16 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)),
 
         ('BUILDBOT_BRANCH', 'Buildbot branch name', ''),
+        
+        (BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
+        ('BF_OIIO_INC', 'OIIO include path', ''),
+        ('BF_OIIO_LIB', 'OIIO library', ''),
+        ('BF_OIIO_LIBPATH', 'OIIO library path', ''),
+        
+        (BoolVariable('WITH_BF_BOOST', 'Build with Boost', False)),
+        ('BF_BOOST_INC', 'Boost include path', ''),
+        ('BF_BOOST_LIB', 'Boost library', ''),
+        ('BF_BOOST_LIBPATH', 'Boost library path', '')
     ) # end of opts.AddOptions()
 
     return localopts
diff --git a/doc/python_api/examples/bpy.app.handlers.1.py b/doc/python_api/examples/bpy.app.handlers.1.py
new file mode 100644 (file)
index 0000000..a6591f6
--- /dev/null
@@ -0,0 +1,20 @@
+"""
+Persistent Handler Example
+++++++++++++++++++++++++++
+
+By default handlers are freed when loading new files, in some cases you may
+wan't the handler stay running across multiple files (when the handler is
+part of an addon for example).
+
+For this the :data:`bpy.app.handlers.persistent` decorator needs to be used.
+"""
+
+import bpy
+from bpy.app.handlers import persistent
+
+
+@persistent
+def load_handler(dummy):
+   print("Load Handler:", bpy.data.filepath)
+
+bpy.app.handlers.load_post.append(load_handler)
diff --git a/doc/python_api/examples/bpy.app.handlers.py b/doc/python_api/examples/bpy.app.handlers.py
new file mode 100644 (file)
index 0000000..7c17606
--- /dev/null
@@ -0,0 +1,12 @@
+"""
+Basic Handler Example
++++++++++++++++++++++
+This script shows the most simple example of adding a handler.
+"""
+
+import bpy
+
+def my_handler(scene):
+   print("Frame Change", scene.frame_current)
+
+bpy.app.handlers.frame_change_pre.append(my_handler)
\ No newline at end of file
index 5843e5ddb6c699e1689568ee2c52a1d55ddc4e90..3c43b5bc4dab1ef3195ed5404c5f57644bb2eb65 100644 (file)
@@ -50,7 +50,7 @@ For PDF generation
 
 # Check we're running in blender
 if __import__("sys").modules.get("bpy") is None:
-    print("\nError, this script must run from inside blender2.5")
+    print("\nError, this script must run from inside blender")
     print(script_help_msg)
 
     import sys
@@ -70,13 +70,14 @@ else:
     # for testing so doc-builds dont take so long.
     EXCLUDE_MODULES = (
         "bpy.context",
-        "bpy.app",
+        #"bpy.app",
+        #"bpy.app.handlers",
         "bpy.path",
         "bpy.data",
         "bpy.props",
         "bpy.utils",
         "bpy.context",
-        "bpy.types",  # supports filtering
+        "bpy.types",  # supports filtering
         "bpy.ops",  # supports filtering
         "bpy_extras",
         "bge",
@@ -109,8 +110,18 @@ INFO_DOCS = (
     ("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"),
     )
 
-# import rpdb2; rpdb2.start_embedded_debugger('test')
 
+# -----------------------------------------------------------------------------
+# configure compile time options
+
+try:
+    __import__("aud")
+except ImportError:
+    print("Warning: Built without 'aud' module, docs incomplete...")
+    EXCLUDE_MODULES = EXCLUDE_MODULES + ("aud", )
+
+
+# import rpdb2; rpdb2.start_embedded_debugger('test')
 import os
 import inspect
 import bpy
@@ -120,6 +131,7 @@ import rna_info
 ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
 MethodDescriptorType = type(dict.get)
 GetSetDescriptorType = type(int.real)
+from types import MemberDescriptorType
 
 EXAMPLE_SET = set()
 EXAMPLE_SET_USED = set()
@@ -134,6 +146,14 @@ else:
     _BPY_PROP_COLLECTION_ID = "collection"
 
 
+def is_struct_seq(value):
+    return isinstance(value, tuple) and type(tuple) != tuple and hasattr(value, "n_fields")
+
+
+def module_id_as_ref(name):
+    return "mod_" + name.replace(".", "__")
+
+
 def undocumented_message(module_name, type_name, identifier):
     if str(type_name).startswith('<module'):
         preloadtitle = '%s.%s' % (module_name, identifier)
@@ -305,6 +325,10 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
         fw(ident + ".. attribute:: %s\n\n" % identifier)
         write_indented_lines(ident + "   ", fw, doc, False)
         fw("\n")
+    elif type(descr) == MemberDescriptorType:  # same as above but use 'data'
+        fw(ident + ".. data:: %s\n\n" % identifier)
+        write_indented_lines(ident + "   ", fw, doc, False)
+        fw("\n")
     elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType):
         write_indented_lines(ident, fw, doc, False)
         fw("\n")
@@ -367,6 +391,10 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
 
     write_title(fw, "%s (%s)" % (title, module_name), "=")
 
+    # write reference, annoying since we should be able to direct reference the
+    # modules but we cant always!
+    fw(".. _%s:\n\n" % module_id_as_ref(module_name))
+
     fw(".. module:: %s\n\n" % module_name)
 
     if module.__doc__:
@@ -411,59 +439,91 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
         if key.startswith("__"):
             continue
         # naughty, we also add getset's into PyStructs, this is not typical py but also not incorrect.
-        if type(descr) == types.GetSetDescriptorType:  # 'bpy_app_type' name is only used for examples and messages
-            py_descr2sphinx("", fw, descr, module_name, "bpy_app_type", key)
+
+        # type_name is only used for examples and messages
+        type_name = str(type(module)).strip("<>").split(" ", 1)[-1][1:-1]  # "<class 'bpy.app.handlers'>" --> bpy.app.handlers
+        if type(descr) == types.GetSetDescriptorType:
+            py_descr2sphinx("", fw, descr, module_name, type_name, key)
             attribute_set.add(key)
+    descr_sorted = []
     for key, descr in sorted(type(module).__dict__.items()):
         if key.startswith("__"):
             continue
 
-        if type(descr) == types.MemberDescriptorType:
+        if type(descr) == MemberDescriptorType:
             if descr.__doc__:
-                fw(".. data:: %s\n\n" % key)
-                write_indented_lines("   ", fw, descr.__doc__, False)
-                fw("\n")
-                attribute_set.add(key)
-
-    del key, descr
+                value = getattr(module, key, None)
+                value_type = type(value)
+                descr_sorted.append((key, descr, value, type(value)))
+    # sort by the valye type
+    descr_sorted.sort(key=lambda descr_data: str(descr_data[3]))
+    for key, descr, value, value_type in descr_sorted:
+        type_name = value_type.__name__
+        py_descr2sphinx("", fw, descr, module_name, type_name, key)
+
+        if is_struct_seq(value):
+            # ack, cant use typical reference because we double up once here
+            # and one fort he module!
+            full_name = "%s.%s" % (module_name, type_name)
+            fw("   :ref:`%s submodule details <%s>`\n\n\n" % (full_name, module_id_as_ref(full_name)))
+            del full_name
+
+        attribute_set.add(key)
+
+    del key, descr, descr_sorted
 
     classes = []
     submodules = []
 
+    # use this list so we can sort by type
+    module_dir_value_type = []
+
     for attribute in module_dir:
-        if not attribute.startswith("_"):
-            if attribute in attribute_set:
-                continue
+        if attribute.startswith("_"):
+            continue
 
-            if attribute.startswith("n_"):  # annoying exception, needed for bpy.app
-                continue
+        if attribute in attribute_set:
+            continue
 
-            value = getattr(module, attribute)
-
-            value_type = type(value)
-
-            if value_type == types.FunctionType:
-                pyfunc2sphinx("", fw, attribute, value, is_class=False)
-            elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType):  # both the same at the moment but to be future proof
-                # note: can't get args from these, so dump the string as is
-                # this means any module used like this must have fully formatted docstrings.
-                py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
-            elif value_type == type:
-                classes.append((attribute, value))
-            elif issubclass(value_type, types.ModuleType):
-                submodules.append((attribute, value))
-            elif value_type in (bool, int, float, str, tuple):
-                # constant, not much fun we can do here except to list it.
-                # TODO, figure out some way to document these!
-                fw(".. data:: %s\n\n" % attribute)
-                write_indented_lines("   ", fw, "constant value %s" % repr(value), False)
-                fw("\n")
-            else:
-                print("\tnot documenting %s.%s of %r type" % (module_name, attribute, value_type.__name__))
-                continue
+        if attribute.startswith("n_"):  # annoying exception, needed for bpy.app
+            continue
+
+        # workaround for bpy.app documenting .index() and .count()
+        if isinstance(module, tuple) and hasattr(tuple, attribute):
+            continue
+
+        value = getattr(module, attribute)
+
+        module_dir_value_type.append((attribute, value, type(value)))
+
+    # sort by str of each type
+    # this way lists, functions etc are grouped.
+    module_dir_value_type.sort(key=lambda triple: str(triple[2]))
+
+    for attribute, value, value_type in module_dir_value_type:
+        if value_type == types.FunctionType:
+            pyfunc2sphinx("", fw, attribute, value, is_class=False)
+        elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType):  # both the same at the moment but to be future proof
+            # note: can't get args from these, so dump the string as is
+            # this means any module used like this must have fully formatted docstrings.
+            py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
+        elif value_type == type:
+            classes.append((attribute, value))
+        elif issubclass(value_type, types.ModuleType):
+            submodules.append((attribute, value))
+        elif value_type in (bool, int, float, str, tuple):
+            # constant, not much fun we can do here except to list it.
+            # TODO, figure out some way to document these!
+            #fw(".. data:: %s\n\n" % attribute)
+            write_indented_lines("   ", fw, "constant value %s" % repr(value), False)
+            fw("\n")
+        else:
+            print("\tnot documenting %s.%s of %r type" % (module_name, attribute, value_type.__name__))
+            continue
 
-            attribute_set.add(attribute)
-            # TODO, more types...
+        attribute_set.add(attribute)
+        # TODO, more types...
+    del module_dir_value_type
 
     # TODO, bpy_extras does this already, mathutils not.
     """
@@ -1103,6 +1163,8 @@ def rna2sphinx(BASEPATH):
         fw("   bpy.path.rst\n\n")
     if "bpy.app" not in EXCLUDE_MODULES:
         fw("   bpy.app.rst\n\n")
+    if "bpy.app.handlers" not in EXCLUDE_MODULES:
+        fw("   bpy.app.handlers.rst\n\n")
 
     # C modules
     if "bpy.props" not in EXCLUDE_MODULES:
@@ -1242,6 +1304,10 @@ def rna2sphinx(BASEPATH):
         from bpy import app as module
         pymodule2sphinx(BASEPATH, "bpy.app", module, "Application Data")
 
+    if "bpy.app.handlers" not in EXCLUDE_MODULES:
+        from bpy.app import handlers as module
+        pymodule2sphinx(BASEPATH, "bpy.app.handlers", module, "Application Handlers")
+
     if "bpy.props" not in EXCLUDE_MODULES:
         from bpy import props as module
         pymodule2sphinx(BASEPATH, "bpy.props", module, "Property Definitions")
index 0dfa39de66c6355aabd81c4e886ee9ee4ba7bccd..bbc7a0ca52e691e6246cb9b8426dac7c810a41ea 100644 (file)
@@ -226,7 +226,7 @@ Factory_lowpass(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "f|f:lowpass", &frequency, &Q))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -267,7 +267,7 @@ Factory_delay(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "f:delay", &delay))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -303,7 +303,7 @@ PyDoc_STRVAR(M_aud_Factory_join_doc,
 static PyObject *
 Factory_join(Factory* self, PyObject* object)
 {
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
 
        if(!PyObject_TypeCheck(object, type))
        {
@@ -354,7 +354,7 @@ Factory_highpass(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "f|f:highpass", &frequency, &Q))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -395,7 +395,7 @@ Factory_limit(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "ff:limit", &start, &end))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -439,7 +439,7 @@ Factory_pitch(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "f:pitch", &factor))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -481,7 +481,7 @@ Factory_volume(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "f:volume", &volume))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -524,7 +524,7 @@ Factory_fadein(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "ff:fadein", &start, &length))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -568,7 +568,7 @@ Factory_fadeout(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "ff:fadeout", &start, &length))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -610,7 +610,7 @@ Factory_loop(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "i:loop", &loop))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -646,7 +646,7 @@ PyDoc_STRVAR(M_aud_Factory_mix_doc,
 static PyObject *
 Factory_mix(Factory* self, PyObject* object)
 {
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
 
        if(!PyObject_TypeCheck(object, type))
        {
@@ -686,7 +686,7 @@ PyDoc_STRVAR(M_aud_Factory_pingpong_doc,
 static PyObject *
 Factory_pingpong(Factory* self)
 {
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -725,7 +725,7 @@ PyDoc_STRVAR(M_aud_Factory_reverse_doc,
 static PyObject *
 Factory_reverse(Factory* self)
 {
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -763,7 +763,7 @@ PyDoc_STRVAR(M_aud_Factory_buffer_doc,
 static PyObject *
 Factory_buffer(Factory* self)
 {
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -802,7 +802,7 @@ Factory_square(Factory* self, PyObject* args)
        if(!PyArg_ParseTuple(args, "|f:square", &threshold))
                return NULL;
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
@@ -905,7 +905,7 @@ Factory_filter(Factory* self, PyObject* args)
        else
                a.push_back(1);
 
-       PyTypeObject* type = ((PyObject*)self)->ob_type;
+       PyTypeObject* type = Py_TYPE(self);
        Factory *parent = (Factory*)type->tp_alloc(type, 0);
 
        if(parent != NULL)
index 4446426098a8bd4539c27d96077ac58405e41577..a84ff5825a930cf8a7d54456fcc9d8321fdacd32 100644 (file)
@@ -108,6 +108,10 @@ if(WITH_INPUT_NDOF)
        )
 endif()
 
+if(WITH_XDG_USER_DIRS)
+       add_definitions(-DWITH_XDG_USER_DIRS)
+endif()
+
 if(WITH_HEADLESS OR WITH_GHOST_SDL)
        if(WITH_HEADLESS)
                list(APPEND SRC
index 1456bdef54310dcb942e779e0c27cc9650a8e0d6..726149138ed7bdf1dc7fae339be6e69a96684af8 100644 (file)
 #include <stdio.h> // for fprintf only
 #include <cstdlib> // for exit
 
+#ifdef WITH_XDG_USER_DIRS
+#  include <pwd.h> // for get home without use getenv()
+#  include <limits.h> // for PATH_MAX
+#endif
+
 #ifdef PREFIX
 static const char *static_path= PREFIX "/share" ;
 #else
@@ -63,7 +68,27 @@ const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const
 
 const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
 {
+#ifndef WITH_XDG_USER_DIRS
        return (const GHOST_TUns8 *)getenv("HOME");
+#else /* WITH_XDG_USER_DIRS */
+       const char *home= getenv("XDG_CONFIG_HOME");
+
+       if (home) {
+               return (const GHOST_TUns8 *)home;
+       }
+       else {
+               static char user_path[PATH_MAX];
+
+               home= getenv("HOME");
+
+               if (home == NULL) {
+                       home= getpwuid(getuid())->pw_dir;
+               }
+
+               snprintf(user_path, sizeof(user_path), "%s/.config", home);
+               return (const GHOST_TUns8 *)user_path;
+       }
+#endif /* WITH_XDG_USER_DIRS */
 }
 
 const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const
index 5fe5cfd7cf4e0bc14249d66c0332ac8e71d97136..75572a6294e20a993e301823700e570f91fd1833 100644 (file)
@@ -54,6 +54,8 @@ def main():
 
     # fake module to allow:
     #   from bpy.types import Panel
+    sys.modules["bpy.app"] = app
+    sys.modules["bpy.app.handlers"] = app.handlers
     sys.modules["bpy.types"] = types
 
     #~ if "-d" in sys.argv: # Enable this to measure start up speed
diff --git a/release/scripts/presets/camera/APS-C_DSLR.py b/release/scripts/presets/camera/APS-C_DSLR.py
new file mode 100644 (file)
index 0000000..829e03c
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.3
+bpy.context.object.data.sensor_height = 14.9
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Blender.py b/release/scripts/presets/camera/Blender.py
new file mode 100644 (file)
index 0000000..9fa4ab7
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 32
+bpy.context.object.data.sensor_height = 18
+bpy.context.object.data.sensor_fit = 'AUTO'
diff --git a/release/scripts/presets/camera/Canon_1100D.py b/release/scripts/presets/camera/Canon_1100D.py
new file mode 100644 (file)
index 0000000..54f2cf7
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.2
+bpy.context.object.data.sensor_height = 14.7
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_1D.py b/release/scripts/presets/camera/Canon_1D.py
new file mode 100644 (file)
index 0000000..0bb0e91
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 27.9
+bpy.context.object.data.sensor_height = 18.6
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_1DS.py b/release/scripts/presets/camera/Canon_1DS.py
new file mode 100644 (file)
index 0000000..158a623
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 36.0
+bpy.context.object.data.sensor_height = 24.0
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_500D.py b/release/scripts/presets/camera/Canon_500D.py
new file mode 100644 (file)
index 0000000..829e03c
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.3
+bpy.context.object.data.sensor_height = 14.9
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_550D.py b/release/scripts/presets/camera/Canon_550D.py
new file mode 100644 (file)
index 0000000..829e03c
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.3
+bpy.context.object.data.sensor_height = 14.9
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_5D.py b/release/scripts/presets/camera/Canon_5D.py
new file mode 100644 (file)
index 0000000..158a623
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 36.0
+bpy.context.object.data.sensor_height = 24.0
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_600D.py b/release/scripts/presets/camera/Canon_600D.py
new file mode 100644 (file)
index 0000000..829e03c
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.3
+bpy.context.object.data.sensor_height = 14.9
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_60D.py b/release/scripts/presets/camera/Canon_60D.py
new file mode 100644 (file)
index 0000000..829e03c
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.3
+bpy.context.object.data.sensor_height = 14.9
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Canon_7D.py b/release/scripts/presets/camera/Canon_7D.py
new file mode 100644 (file)
index 0000000..829e03c
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.3
+bpy.context.object.data.sensor_height = 14.9
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Nikon_D300S.py b/release/scripts/presets/camera/Nikon_D300S.py
new file mode 100644 (file)
index 0000000..a0505bf
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 23.6
+bpy.context.object.data.sensor_height = 15.8
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Nikon_D3100.py b/release/scripts/presets/camera/Nikon_D3100.py
new file mode 100644 (file)
index 0000000..238d9c2
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 23.1
+bpy.context.object.data.sensor_height = 15.4
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Nikon_D35.py b/release/scripts/presets/camera/Nikon_D35.py
new file mode 100644 (file)
index 0000000..e6dc62d
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 36.0
+bpy.context.object.data.sensor_height = 23.9
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Nikon_D5000.py b/release/scripts/presets/camera/Nikon_D5000.py
new file mode 100644 (file)
index 0000000..a0505bf
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 23.6
+bpy.context.object.data.sensor_height = 15.8
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Nikon_D5100.py b/release/scripts/presets/camera/Nikon_D5100.py
new file mode 100644 (file)
index 0000000..1d819cc
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 23.6
+bpy.context.object.data.sensor_height = 15.6
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Nikon_D7000.py b/release/scripts/presets/camera/Nikon_D7000.py
new file mode 100644 (file)
index 0000000..1d819cc
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 23.6
+bpy.context.object.data.sensor_height = 15.6
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Nikon_D90.py b/release/scripts/presets/camera/Nikon_D90.py
new file mode 100644 (file)
index 0000000..a0505bf
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 23.6
+bpy.context.object.data.sensor_height = 15.8
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Red_Epic.py b/release/scripts/presets/camera/Red_Epic.py
new file mode 100644 (file)
index 0000000..14f4aba
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 30.0
+bpy.context.object.data.sensor_height = 15.0
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Red_One_2K.py b/release/scripts/presets/camera/Red_One_2K.py
new file mode 100644 (file)
index 0000000..ef2708f
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 11.1
+bpy.context.object.data.sensor_height = 6.24
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Red_One_3K.py b/release/scripts/presets/camera/Red_One_3K.py
new file mode 100644 (file)
index 0000000..5ddff27
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 16.65
+bpy.context.object.data.sensor_height = 9.36
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/Red_One_4K.py b/release/scripts/presets/camera/Red_One_4K.py
new file mode 100644 (file)
index 0000000..8ab9b38
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 22.2
+bpy.context.object.data.sensor_height = 12.6
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/full_frame_35mm_film.py b/release/scripts/presets/camera/full_frame_35mm_film.py
new file mode 100644 (file)
index 0000000..d3e141b
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 36
+bpy.context.object.data.sensor_height = 24
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/micro_four_thirds.py b/release/scripts/presets/camera/micro_four_thirds.py
new file mode 100644 (file)
index 0000000..36fb0aa
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 17.3
+bpy.context.object.data.sensor_height = 13.0
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/super_16_film.py b/release/scripts/presets/camera/super_16_film.py
new file mode 100644 (file)
index 0000000..1e42953
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 12.52
+bpy.context.object.data.sensor_height = 7.41
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
diff --git a/release/scripts/presets/camera/super_35_film.py b/release/scripts/presets/camera/super_35_film.py
new file mode 100644 (file)
index 0000000..65ccb0f
--- /dev/null
@@ -0,0 +1,4 @@
+import bpy
+bpy.context.object.data.sensor_width = 24.89
+bpy.context.object.data.sensor_height = 18.66
+bpy.context.object.data.sensor_fit = 'HORIZONTAL'
index 2e42105fbf0032f01e5bdb6ea70b2c78d221875a..21ac128f1775edfb173a27a47e63f13ac6637a48 100644 (file)
@@ -195,6 +195,25 @@ class AddPresetRender(AddPresetBase, Operator):
     preset_subdir = "render"
 
 
+class AddPresetCamera(AddPresetBase, Operator):
+    '''Add a Camera Preset'''
+    bl_idname = "camera.preset_add"
+    bl_label = "Add Camera Preset"
+    preset_menu = "CAMERA_MT_presets"
+
+    preset_defines = [
+        "cam = bpy.context.object.data"
+    ]
+
+    preset_values = [
+        "cam.sensor_width",
+        "cam.sensor_height",
+        "cam.sensor_fit"
+    ]
+
+    preset_subdir = "camera"
+
+
 class AddPresetSSS(AddPresetBase, Operator):
     '''Add a Subsurface Scattering Preset'''
     bl_idname = "material.sss_preset_add"
index 7787773177762d79f0bd39dab662058e478c7274..0abbf281754e2d547e385a40647d34361786598f 100644 (file)
@@ -33,6 +33,14 @@ class CameraButtonsPanel():
         return context.camera and (engine in cls.COMPAT_ENGINES)
 
 
+class CAMERA_MT_presets(bpy.types.Menu):
+    bl_label = "Camera Presets"
+    preset_subdir = "camera"
+    preset_operator = "script.execute_preset"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+    draw = bpy.types.Menu.draw_preset
+
+
 class DATA_PT_context_camera(CameraButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
@@ -54,7 +62,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel):
             split.separator()
 
 
-class DATA_PT_camera(CameraButtonsPanel, Panel):
+class DATA_PT_lens(CameraButtonsPanel, Panel):
     bl_label = "Lens"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
@@ -69,12 +77,12 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
 
         col = split.column()
         if cam.type == 'PERSP':
+            row = col.row()
             if cam.lens_unit == 'MILLIMETERS':
-                col.prop(cam, "lens")
+                row.prop(cam, "lens")
             elif cam.lens_unit == 'DEGREES':
-                col.prop(cam, "angle")
-            col = split.column()
-            col.prop(cam, "lens_unit", text="")
+                row.prop(cam, "angle")
+            row.prop(cam, "lens_unit", text="")
 
         elif cam.type == 'ORTHO':
             col.prop(cam, "ortho_scale")
@@ -100,6 +108,35 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
         col.prop(cam, "clip_start", text="Start")
         col.prop(cam, "clip_end", text="End")
 
+class DATA_PT_camera(CameraButtonsPanel, Panel):
+    bl_label = "Camera"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        cam = context.camera
+
+        row = layout.row(align=True)
+
+        row.menu("CAMERA_MT_presets", text=bpy.types.CAMERA_MT_presets.bl_label)
+        row.operator("camera.preset_add", text="", icon="ZOOMIN")
+        row.operator("camera.preset_add", text="", icon="ZOOMOUT").remove_active = True
+
+        layout.label(text="Sensor:")
+
+        split = layout.split()
+
+        col = split.column(align=True)
+        if cam.sensor_fit == 'AUTO':
+            col.prop(cam, "sensor_width", text="Size")
+        else:
+            col.prop(cam, "sensor_width", text="Width")
+            col.prop(cam, "sensor_height", text="Height")
+
+        col = split.column(align=True)
+        col.prop(cam, "sensor_fit", text="")
+
 class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
     bl_label = "Depth of Field"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -109,6 +146,8 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
 
         cam = context.camera
 
+        layout.label(text="Focus:")
+
         split = layout.split()
         split.prop(cam, "dof_object", text="")
 
@@ -132,10 +171,12 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
         col.prop(cam, "show_limits", text="Limits")
         col.prop(cam, "show_mist", text="Mist")
         col.prop(cam, "show_title_safe", text="Title Safe")
+        col.prop(cam, "show_sensor", text="Sensor")
         col.prop(cam, "show_name", text="Name")
-        col.prop_menu_enum(cam, "show_guide")
 
         col = split.column()
+        col.prop_menu_enum(cam, "show_guide")
+        col.separator()
         col.prop(cam, "draw_size", text="Size")
         col.separator()
         col.prop(cam, "show_passepartout", text="Passepartout")
index 90dcc99e6d74859f58fcf2f57748543e44a11b8d..106bbd857174070072a8b22f6988c4a6db2cbacb 100644 (file)
@@ -213,18 +213,10 @@ class DOPESHEET_MT_marker(Menu):
     def draw(self, context):
         layout = self.layout
 
-        st = context.space_data
-
-        #layout.operator_context = 'EXEC_REGION_WIN'
-
-        layout.operator("marker.add", "Add Marker")
-        layout.operator("marker.duplicate", text="Duplicate Marker")
-        layout.operator("marker.delete", text="Delete Marker")
+        from .space_time import marker_menu_generic
+        marker_menu_generic(layout)
 
-        layout.separator()
-
-        layout.operator("marker.rename", text="Rename Marker")
-        layout.operator("marker.move", text="Grab/Move Marker")
+        st = context.space_data
 
         if st.mode in {'ACTION', 'SHAPEKEY'} and st.action:
             layout.separator()
index d4b8c415a7f4fcb989004ce1c11b7ea668942bfa..b57d421dfaf44d36c0c9b26d787f9aff6ea64982 100644 (file)
@@ -144,16 +144,8 @@ class GRAPH_MT_marker(Menu):
     def draw(self, context):
         layout = self.layout
 
-        #layout.operator_context = 'EXEC_REGION_WIN'
-
-        layout.operator("marker.add", "Add Marker")
-        layout.operator("marker.duplicate", text="Duplicate Marker")
-        layout.operator("marker.delete", text="Delete Marker")
-
-        layout.separator()
-
-        layout.operator("marker.rename", text="Rename Marker")
-        layout.operator("marker.move", text="Grab/Move Marker")
+        from .space_time import marker_menu_generic
+        marker_menu_generic(layout)
 
         # TODO: pose markers for action edit mode only?
 
index ffead81c5070f8ea4635a9d58e349fb42a325fb4..c878c20c8a71413eb41042e04894413e999cba75 100644 (file)
@@ -104,16 +104,8 @@ class NLA_MT_marker(Menu):
     def draw(self, context):
         layout = self.layout
 
-        #layout.operator_context = 'EXEC_REGION_WIN'
-
-        layout.operator("marker.add", "Add Marker")
-        layout.operator("marker.duplicate", text="Duplicate Marker")
-        layout.operator("marker.delete", text="Delete Marker")
-
-        layout.separator()
-
-        layout.operator("marker.rename", text="Rename Marker")
-        layout.operator("marker.move", text="Grab/Move Marker")
+        from .space_time import marker_menu_generic
+        marker_menu_generic(layout)
 
 
 class NLA_MT_edit(Menu):
index 2e957effccdb0a8a7171c01b37edb6e7149e8365..a4dcf64b679f1db3524aba084d4b24a4ea1b26a9 100644 (file)
@@ -158,18 +158,8 @@ class SEQUENCER_MT_marker(Menu):
     def draw(self, context):
         layout = self.layout
 
-        #layout.operator_context = 'EXEC_REGION_WIN'
-
-        layout.operator("marker.add", "Add Marker")
-        layout.operator("marker.duplicate", text="Duplicate Marker")
-        layout.operator("marker.delete", text="Delete Marker")
-
-        layout.separator()
-
-        layout.operator("marker.rename", text="Rename Marker")
-        layout.operator("marker.move", text="Grab/Move Marker")
-
-        #layout.operator("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS)
+        from .space_time import marker_menu_generic
+        marker_menu_generic(layout)
 
 
 class SEQUENCER_MT_change(Menu):
index db009fe43c223aa697ddfe7892d612aeb305a575..6f8e6a574ec02a82f1a3cebf8946f92ac31268c7 100644 (file)
@@ -36,6 +36,7 @@ class TIME_HT_header(Header):
 
         if context.area.show_menus:
             row.menu("TIME_MT_view")
+            row.menu("TIME_MT_marker")
             row.menu("TIME_MT_frame")
             row.menu("TIME_MT_playback")
 
@@ -91,6 +92,15 @@ class TIME_HT_header(Header):
         row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
 
 
+class TIME_MT_marker(bpy.types.Menu):
+    bl_label = "Marker"
+
+    def draw(self, context):
+        layout = self.layout
+
+        marker_menu_generic(layout)
+
+
 class TIME_MT_view(Menu):
     bl_label = "View"
 
@@ -142,17 +152,6 @@ class TIME_MT_frame(Menu):
     def draw(self, context):
         layout = self.layout
 
-        layout.operator("marker.add", text="Add Marker")
-        layout.operator("marker.duplicate", text="Duplicate Marker")
-        layout.operator("marker.delete", text="Delete Marker")
-
-        layout.separator()
-
-        layout.operator("marker.rename", text="Rename Marker")
-        layout.operator("marker.move", text="Grab/Move Marker")
-
-        layout.separator()
-
         layout.operator("time.start_frame_set")
         layout.operator("time.end_frame_set")
 
@@ -197,5 +196,28 @@ class TIME_MT_autokey(Menu):
         layout.prop_enum(tools, "auto_keying_mode", 'ADD_REPLACE_KEYS')
         layout.prop_enum(tools, "auto_keying_mode", 'REPLACE_KEYS')
 
+
+def marker_menu_generic(layout):
+
+    #layout.operator_context = 'EXEC_REGION_WIN'
+
+    layout.column()
+    layout.operator("marker.add", "Add Marker")
+    layout.operator("marker.duplicate", text="Duplicate Marker")
+
+    if(len(bpy.data.scenes) > 10):
+        layout.operator_context = 'INVOKE_DEFAULT'
+        layout.operator("marker.make_links_scene", text="Duplicate Marker to Scene...", icon='OUTLINER_OB_EMPTY')
+    else:
+        layout.operator_menu_enum("marker.make_links_scene", "scene", text="Duplicate Marker to Scene...")
+
+    layout.operator("marker.delete", text="Delete Marker")
+
+    layout.separator()
+
+    layout.operator("marker.rename", text="Rename Marker")
+    layout.operator("marker.move", text="Grab/Move Marker")
+
+
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)
index 07c860fca31117be7443e15ddac4c1a977c6eb3e..3f5b7b86e89ef753f77f40290070830be5ef108c 100644 (file)
@@ -976,10 +976,8 @@ class VIEW3D_MT_make_links(Menu):
         if(len(bpy.data.scenes) > 10):
             layout.operator_context = 'INVOKE_DEFAULT'
             layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY')
-            layout.operator("object.make_links_scene", text="Markers to Scene...", icon='OUTLINER_OB_EMPTY')
         else:
             layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...")
-            layout.operator_menu_enum("marker.make_links_scene", "scene", text="Markers to Scene...")
 
         layout.operator_enum("object.make_links_data", "type")  # inline
 
index 9518ccb5f80be51f4e3b3deae08f415c303ce658..96201a4b9607d2a2f14e75a29a26710767d463d3 100644 (file)
@@ -481,12 +481,9 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
             col.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)
 
         # Particle Mode #
-
-        # XXX This needs a check if psys is editable.
         if context.particle_edit_object:
             tool = settings.tool
 
-            # XXX Select Particle System
             layout.column().prop(settings, "tool", expand=True)
 
             if tool != 'NONE':
@@ -825,13 +822,11 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
 
             if brush.use_anchor:
                 col.separator()
-                row = col.row()
-                row.prop(brush, "use_edge_to_edge", "Edge To Edge")
+                col.prop(brush, "use_edge_to_edge", "Edge To Edge")
 
             if brush.use_airbrush:
                 col.separator()
-                row = col.row()
-                row.prop(brush, "rate", text="Rate", slider=True)
+                col.prop(brush, "rate", text="Rate", slider=True)
 
             if brush.use_space:
                 col.separator()
@@ -857,8 +852,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
                 row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
         else:
-            row = col.row()
-            row.prop(brush, "use_airbrush")
+            col.prop(brush, "use_airbrush")
 
             row = col.row()
             row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
@@ -867,8 +861,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
             col.separator()
 
             if not image_paint:
-                row = col.row()
-                row.prop(brush, "use_smooth_stroke")
+                col.prop(brush, "use_smooth_stroke")
 
                 col = layout.column()
                 col.active = brush.use_smooth_stroke
@@ -879,9 +872,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
 
             col = layout.column()
             col.active = (not brush.use_anchor) and (brush.sculpt_tool not in {'GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'})
-
-            row = col.row()
-            row.prop(brush, "use_space")
+            col.prop(brush, "use_space")
 
             row = col.row()
             row.active = brush.use_space
@@ -1011,14 +1002,10 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel):
         else:
             col.prop(brush, "cursor_color_add", text="Color")
 
-        col = layout.column()
-        col.label(text="Icon:")
-
-        row = col.row(align=True)
-        row.prop(brush, "use_custom_icon")
+        col = layout.column(align=True)
+        col.prop(brush, "use_custom_icon")
         if brush.use_custom_icon:
-            row = col.row(align=True)
-            row.prop(brush, "icon_filepath", text="")
+            col.prop(brush, "icon_filepath", text="")
 
 # ********** default tools for weight-paint ****************
 
@@ -1133,53 +1120,46 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
         use_projection = ipaint.use_projection
 
         col = layout.column()
-        sub = col.column()
-        sub.active = use_projection
-        sub.prop(ipaint, "use_occlude")
-        sub.prop(ipaint, "use_backface_culling")
+        col.active = use_projection
+        col.prop(ipaint, "use_occlude")
+        col.prop(ipaint, "use_backface_culling")
 
-        split = layout.split()
+        row = layout.row()
+        row.active = (use_projection)
+        row.prop(ipaint, "use_normal_falloff")
 
-        col = split.column()
-        col.active = (use_projection)
-        col.prop(ipaint, "use_normal_falloff")
+        sub = row.row()
+        sub.active = (ipaint.use_normal_falloff)
+        sub.prop(ipaint, "normal_angle", text="")
 
-        col = split.column()
-        col.active = (ipaint.use_normal_falloff and use_projection)
-        col.prop(ipaint, "normal_angle", text="")
+        split = layout.split()
 
-        col = layout.column(align=False)
-        row = col.row()
-        row.active = (use_projection)
-        row.prop(ipaint, "use_stencil_layer", text="Stencil")
+        split.active = (use_projection)
+        split.prop(ipaint, "use_stencil_layer", text="Stencil")
 
-        row2 = row.row(align=False)
-        row2.active = (use_projection and ipaint.use_stencil_layer)
-        row2.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name)
-        row2.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
+        row = split.row()
+        row.active = (ipaint.use_stencil_layer)
+        row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name)
+        row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
 
-        col = layout.column()
-        sub = col.column()
-        row = sub.row()
+        row = layout.row()
         row.active = (settings.brush.image_tool == 'CLONE')
-
         row.prop(ipaint, "use_clone_layer", text="Layer")
         row.menu("VIEW3D_MT_tools_projectpaint_clone", text=mesh.uv_texture_clone.name)
 
-        sub = col.column()
-        sub.prop(ipaint, "seam_bleed")
+        layout.prop(ipaint, "seam_bleed")
+
+        col = layout.column()
+        col.label(text="External Editing:")
 
-        col.label(text="External Editing")
         row = col.split(align=True, percentage=0.55)
         row.operator("image.project_edit", text="Quick Edit")
         row.operator("image.project_apply", text="Apply")
-        row = col.row(align=True)
-        row.prop(ipaint, "screen_grab_size", text="")
 
-        sub = col.column()
-        sub.operator("paint.project_image", text="Apply Camera Image")
+        col.row().prop(ipaint, "screen_grab_size", text="")
 
-        sub.operator("image.save_dirty", text="Save All Edited")
+        col.operator("paint.project_image", text="Apply Camera Image")
+        col.operator("image.save_dirty", text="Save All Edited")
 
 
 class VIEW3D_PT_imagepaint_options(PaintPanel):
index bebc87cc5d44773781246977085495e2fc1be343..7ec7e2357dd0205ca0c2c372d867a3f4c27b4cf1 100644 (file)
@@ -122,36 +122,37 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
 /* Note,
  * blf_font_ensure_ascii_table(font); must be called before this macro */
 
-#define BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table)             \
-       if(((c)= (str)[i]) < 0x80) {                                              \
-               g= (glyph_ascii_table)[c];                                            \
-               i++;                                                                  \
+#define BLF_UTF8_NEXT_FAST(_font, _g, _str, _i, _c, _glyph_ascii_table)       \
+       if(((_c)= (_str)[_i]) < 0x80) {                                           \
+               _g= (_glyph_ascii_table)[_c];                                         \
+               _i++;                                                                 \
        }                                                                         \
-       else if ((c= BLI_str_utf8_as_unicode_step((str), &(i))) != BLI_UTF8_ERR) {               \
-               if ((g= blf_glyph_search((font)->glyph_cache, c)) == NULL) {          \
-                       g= blf_glyph_add(font, FT_Get_Char_Index((font)->face, c), c);    \
+       else if ((_c= BLI_str_utf8_as_unicode_step(_str, &(_i)))!=BLI_UTF8_ERR) { \
+               if ((_g= blf_glyph_search((_font)->glyph_cache, _c)) == NULL) {       \
+                       _g= blf_glyph_add(_font,                                          \
+                                         FT_Get_Char_Index((_font)->face, _c), _c);      \
                }                                                                     \
        }                                                                         \
 
 
 #define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode)                     \
-       const short has_kerning= FT_HAS_KERNING((_font)->face);                   \
-       const FT_UInt kern_mode= (has_kerning == 0) ? 0 :                         \
+       const short _has_kerning= FT_HAS_KERNING((_font)->face);                  \
+       const FT_UInt _kern_mode= (_has_kerning == 0) ? 0 :                       \
                                 (((_font)->flags & BLF_KERNING_DEFAULT) ?        \
                                  ft_kerning_default : FT_KERNING_UNFITTED)       \
 
 
-#define BLF_KERNING_STEP(_font, kern_mode, g_prev, g, delta, pen_x)           \
+#define BLF_KERNING_STEP(_font, _kern_mode, _g_prev, _g, _delta, _pen_x)      \
 {                                                                             \
-       if (g_prev) {                                                             \
-               delta.x= delta.y= 0;                                                  \
+       if (_g_prev) {                                                            \
+               _delta.x= _delta.y= 0;                                                \
                if (FT_Get_Kerning((_font)->face,                                     \
-                                  (g_prev)->idx,                                     \
-                                  (g)->idx,                                          \
-                                  kern_mode,                                         \
-                                  &(delta)) == 0)                                    \
+                                  (_g_prev)->idx,                                    \
+                                  (_g)->idx,                                         \
+                                  _kern_mode,                                        \
+                                  &(_delta)) == 0)                                   \
                {                                                                     \
-                       pen_x += delta.x >> 6;                                            \
+                       _pen_x += delta.x >> 6;                                           \
                }                                                                     \
        }                                                                         \
 }                                                                             \
index 71771b6077d44a93350ae4373bc9667a45299985..9b28f083a24b7fc266cba1654d066f5a07e3a55c 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION                        260
-#define BLENDER_SUBVERSION             0
+#define BLENDER_SUBVERSION             1
 
 #define BLENDER_MINVERSION             250
 #define BLENDER_MINSUBVERSION  0
index 9282f0ef29adf297bd67685afc6022afadb7f9c6..f0704741ebb21f5b98a86fae1e899872755ec03f 100644 (file)
@@ -65,6 +65,7 @@ void make_local_curve( struct Curve *cu);
 struct ListBase *curve_editnurbs(struct Curve *cu);
 short curve_type( struct Curve *cu);
 void test_curve_type( struct Object *ob);
+void update_curve_dimension( struct Curve *cu );
 void tex_space_curve( struct Curve *cu);
 int count_curveverts( struct ListBase *nurb);
 int count_curveverts_without_handles( struct ListBase *nurb);
index 0b0637fb42a24f4227260cce18dc58ff4885d405..e0b8e40d73172c6b434038556c982c9aa6947085 100644 (file)
@@ -133,6 +133,9 @@ void        DAG_pose_sort(struct Object *ob);
                /* callback for editors module to do updates */
 void   DAG_editors_update_cb(void (*func)(struct Main *bmain, struct ID *id));
 
+               /* debugging */
+void   DAG_print_dependencies(struct Main *bmain, struct Scene *scene, struct Object *ob);
+
 #ifdef __cplusplus
 }
 #endif
index bc9134b40b847d5951635970a8cf9b92f57a1fa2..5ccdd7c04af30628e628f28d769993d299840a08 100644 (file)
@@ -58,7 +58,7 @@ typedef struct Global {
        /* flag: if != 0 G.main->name contains valid relative base path */
        int relbase_valid;
 
-       /* strings of recent opend files */
+       /* strings of recent opened files */
        struct ListBase recent_files;
         
        short afbreek, moving, file_loaded;
index 393568c6b60369498b5a9ea15251080363eaf927..c5a24c1e5e9bfdea1005dd08be2bbb5e69fc4ac1 100644 (file)
@@ -139,9 +139,12 @@ struct KeyBlock *object_insert_shape_key(struct Scene *scene, struct Object *ob,
 int object_is_modified(struct Scene *scene, struct Object *ob);
 
 void object_camera_mode(struct RenderData *rd, struct Object *camera);
+void object_camera_intrinsics(struct Object *camera, struct Camera **cam_r, short *is_ortho, float *shiftx, float *shifty,
+                       float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit);
 void object_camera_matrix(
                struct RenderData *rd, struct Object *camera, int winx, int winy, short field_second,
-               float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, float *ycor,
+               float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens,
+               float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor,
                float *viewdx, float *viewdy);
 
 void camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3],
index 5b6d7e3cd96a41eb9d999bcbec4d0bc978756e32..77a351d534e6a9a9edba04b55c9459afdef267e4 100644 (file)
  */
 
 struct ARegion;
-struct bContext;
-struct bContextDataResult;
-struct bScreen;
-struct ListBase;
-struct Panel;
 struct Header;
+struct ListBase;
 struct Menu;
+struct Panel;
+struct Scene;
 struct ScrArea;
 struct SpaceType;
-struct Scene;
+struct View3D;
+struct bContext;
+struct bContextDataResult;
+struct bScreen;
+struct uiLayout;
+struct uiMenuItem;
+struct wmKeyConfig;
 struct wmNotifier;
 struct wmWindow;
 struct wmWindowManager;
-struct wmKeyConfig;
-struct uiLayout;
-struct uiMenuItem;
 
 #include "RNA_types.h"
 
@@ -239,6 +240,7 @@ void        BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
 void   BKE_screen_area_free(struct ScrArea *sa);
 
 struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type);
+struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min);
 
 void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
 void BKE_screen_view3d_scene_sync(struct bScreen *sc);
index 2ef13318af4b743273e7715cb2bcfee1a0b0c2c4..f939c168f51e5276881aa86b4934ecae7df2dc1f 100644 (file)
@@ -753,6 +753,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level,
        extern int enable_cu_speed;     /* object.c */
        Object copyob = {{NULL}};
        int cfrao = scene->r.cfra;
+       int dupend = ob->dupend;
        
        /* simple prevention of too deep nested groups */
        if (level > MAX_DUPLI_RECUR) return;
@@ -773,7 +774,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level,
        /* duplicate over the required range */
        if (ob->transflag & OB_DUPLINOSPEED) enable_cu_speed= 0;
        
-       for (scene->r.cfra= ob->dupsta; scene->r.cfra<=ob->dupend; scene->r.cfra++) {
+       for (scene->r.cfra= ob->dupsta; scene->r.cfra<=dupend; scene->r.cfra++) {
                short ok= 1;
                
                /* - dupoff = how often a frames within the range shouldn't be made into duplis
index aebf3198cf4276865bce7359ffc81f499f38096c..8b5cf3bd19680e7d7463eb7aca50bdedb3824cd1 100644 (file)
@@ -447,7 +447,8 @@ static void contarget_get_mesh_mat (Object *ob, const char *substring, float mat
        }
        else {
                /* when not in EditMode, use the 'final' derived mesh, depsgraph
-                * ensures we build with CD_MDEFORMVERT layer */
+                * ensures we build with CD_MDEFORMVERT layer 
+                */
                dm = (DerivedMesh *)ob->derivedFinal;
        }
        
@@ -1256,10 +1257,7 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
                        float quat[4];
                        if ((data->followflag & FOLLOWPATH_STATIC) == 0) {
                                /* animated position along curve depending on time */
-                               if (cob->scene)
-                                       curvetime= bsystem_time(cob->scene, ct->tar, cu->ctime, 0.0) - data->offset;
-                               else    
-                                       curvetime= cu->ctime - data->offset;
+                               curvetime= cu->ctime - data->offset;
                                
                                /* ctime is now a proper var setting of Curve which gets set by Animato like any other var that's animated,
                                 * but this will only work if it actually is animated... 
index 5d2180fe70219d7d78bef014d7a24abe370507ba..adc08f5cd9f76553ce1c6475862c9ce85f436c6c 100644 (file)
@@ -315,9 +315,34 @@ short curve_type(Curve *cu)
        return OB_CURVE;
 }
 
+void update_curve_dimension(Curve *cu)
+{
+       ListBase *nurbs= BKE_curve_nurbs(cu);
+       Nurb *nu= nurbs->first;
+
+       if(cu->flag&CU_3D) {
+               for( ; nu; nu= nu->next) {
+                       nu->flag &= ~CU_2D;
+               }
+       }
+       else {
+               for( ; nu; nu= nu->next) {
+                       nu->flag |= CU_2D;
+                       test2DNurb(nu);
+
+                       /* since the handles are moved they need to be auto-located again */
+                       if(nu->type == CU_BEZIER)
+                               calchandlesNurb(nu);
+               }
+       }
+}
+
 void test_curve_type(Object *ob)
-{      
-       ob->type = curve_type(ob->data);
+{
+       ob->type= curve_type(ob->data);
+
+       if(ob->type==OB_CURVE)
+               update_curve_dimension((Curve *)ob->data);
 }
 
 void tex_space_curve(Curve *cu)
index 9d51571346f2a0a5ea7f2860d4b142f54a1e3eb0..51edee9ea7128c30c4a0692d115e100fff66804f 100644 (file)
@@ -591,9 +591,9 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
 
                        if(part->ren_as == PART_DRAW_OB && part->dup_ob) {
                                node2 = dag_get_node(dag, part->dup_ob);
-                               dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation");
+                               dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Particle Object Visualisation");
                                if(part->dup_ob->type == OB_MBALL)
-                                       dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA, "Particle Object Visualisation");
+                                       dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualisation");
                        }
 
                        if(part->ren_as == PART_DRAW_GR && part->dup_group) {
@@ -799,6 +799,7 @@ DagNode * dag_find_node (DagForest *forest,void * fob)
 }
 
 static int ugly_hack_sorry= 1; // prevent type check
+static int dag_print_dependencies= 0; // debugging
 
 /* no checking of existence, use dag_find_node first or dag_get_node */
 DagNode * dag_add_node (DagForest *forest, void * fob)
@@ -926,7 +927,6 @@ static const char *dag_node_name(DagNode *node)
                return ((bPoseChannel*)(node->ob))->name;
 }
 
-#if 0
 static void dag_node_print_dependencies(DagNode *node)
 {
        DagAdjList *itA;
@@ -937,7 +937,6 @@ static void dag_node_print_dependencies(DagNode *node)
                printf("  %s through %s\n", dag_node_name(itA->node), itA->name);
        printf("\n");
 }
-#endif
 
 static int dag_node_print_dependency_recurs(DagNode *node, DagNode *endnode)
 {
@@ -998,6 +997,11 @@ static void dag_check_cycle(DagForest *dag)
        DagNode *node;
        DagAdjList *itA;
 
+       /* debugging print */
+       if(dag_print_dependencies)
+               for(node = dag->DagNode.first; node; node= node->next)
+                       dag_node_print_dependencies(node);
+
        /* tag nodes unchecked */
        for(node = dag->DagNode.first; node; node= node->next)
                node->color= DAG_WHITE;
@@ -2834,5 +2838,22 @@ void DAG_pose_sort(Object *ob)
        ugly_hack_sorry= 1;
 }
 
+/* ************************ DAG DEBUGGING ********************* */
 
+void DAG_print_dependencies(Main *bmain, Scene *scene, Object *ob)
+{
+       /* utility for debugging dependencies */
+       dag_print_dependencies= 1;
+
+       if(ob && (ob->mode & OB_MODE_POSE)) {
+               printf("\nDEPENDENCY RELATIONS for %s\n\n", ob->id.name+2);
+               DAG_pose_sort(ob);
+       }
+       else {
+               printf("\nDEPENDENCY RELATIONS for %s\n\n", scene->id.name+2);
+               DAG_scene_sort(bmain, scene);
+       }
+       
+       dag_print_dependencies= 0;
+}
 
index ce53ec3ac9b7e228658a0d3dc8b1b5a418efefbc..4f87c194790f629c3ffa0899a6abcf6b2ec3f40b 100644 (file)
@@ -1325,7 +1325,7 @@ void nodeSetActive(bNodeTree *ntree, bNode *node)
                node->flag |= NODE_ACTIVE_TEXTURE;
 }
 
-/* use flags are not persistant yet, groups might need different tagging, so we do it each time
+/* use flags are not persistent yet, groups might need different tagging, so we do it each time
    when we need to get this info */
 void ntreeSocketUseFlags(bNodeTree *ntree)
 {
index a5edd569bc2345045307b80daee3f7775ab3a9e1..9a0dbd2a2ebf166895e60b7a9c41dcb8d5e10a72 100644 (file)
@@ -724,6 +724,7 @@ void *add_camera(const char *name)
        cam=  alloc_libblock(&G.main->camera, ID_CA, name);
 
        cam->lens= 35.0f;
+       cam->sensor_x = 32.f;
        cam->clipsta= 0.1f;
        cam->clipend= 100.0f;
        cam->drawsize= 0.5f;
@@ -2954,27 +2955,23 @@ void object_camera_mode(RenderData *rd, Object *camera)
        }
 }
 
-/* 'lens' may be set for envmap only */
-void object_camera_matrix(
-               RenderData *rd, Object *camera, int winx, int winy, short field_second,
-               float winmat[][4], rctf *viewplane, float *clipsta, float *clipend, float *lens, float *ycor,
-               float *viewdx, float *viewdy
-) {
-       Camera *cam=NULL;
-       float pixsize;
-       float shiftx=0.0, shifty=0.0, winside, viewfac;
-       short is_ortho= FALSE;
+void object_camera_intrinsics(Object *camera, Camera **cam_r, short *is_ortho, float *shiftx, float *shifty,
+                       float *clipsta, float *clipend, float *lens, float *sensor_x, float *sensor_y, short *sensor_fit)
+{
+       Camera *cam= NULL;
 
-       /* question mark */
-       (*ycor)= rd->yasp / rd->xasp;
-       if(rd->mode & R_FIELDS)
-               (*ycor) *= 2.0f;
+       (*shiftx)= 0.0f;
+       (*shifty)= 0.0f;
+
+       (*sensor_x)= DEFAULT_SENSOR_WIDTH;
+       (*sensor_y)= DEFAULT_SENSOR_HEIGHT;
+       (*sensor_fit)= CAMERA_SENSOR_FIT_AUTO;
 
        if(camera->type==OB_CAMERA) {
                cam= camera->data;
 
                if(cam->type == CAM_ORTHO) {
-                       is_ortho= TRUE;
+                       *is_ortho= TRUE;
                }
 
                /* solve this too... all time depending stuff is in convertblender.c?
@@ -2987,11 +2984,14 @@ void object_camera_matrix(
                        execute_ipo(&cam->id, cam->ipo);
                }
 #endif // XXX old animation system
-               shiftx=cam->shiftx;
-               shifty=cam->shifty;
+               (*shiftx)=cam->shiftx;
+               (*shifty)=cam->shifty;
                (*lens)= cam->lens;
+               (*sensor_x)= cam->sensor_x;
+               (*sensor_y)= cam->sensor_y;
                (*clipsta)= cam->clipsta;
                (*clipend)= cam->clipend;
+               (*sensor_fit)= cam->sensor_fit;
        }
        else if(camera->type==OB_LAMP) {
                Lamp *la= camera->data;
@@ -3005,7 +3005,7 @@ void object_camera_matrix(
                (*clipend)= la->clipend;
        }
        else {  /* envmap exception... */;
-               if((*lens)==0.0f)
+               if((*lens)==0.0f) /* is this needed anymore? */
                        (*lens)= 16.0f;
 
                if((*clipsta)==0.0f || (*clipend)==0.0f) {
@@ -3014,25 +3014,69 @@ void object_camera_matrix(
                }
        }
 
+       (*cam_r)= cam;
+}
+
+/* 'lens' may be set for envmap only */
+void object_camera_matrix(
+               RenderData *rd, Object *camera, int winx, int winy, short field_second,
+               float winmat[][4], rctf *viewplane, float *clipsta, float *clipend, float *lens,
+               float *sensor_x, float *sensor_y, short *sensor_fit, float *ycor,
+               float *viewdx, float *viewdy)
+{
+       Camera *cam=NULL;
+       float pixsize;
+       float shiftx=0.0, shifty=0.0, winside, viewfac;
+       short is_ortho= FALSE;
+
+       /* question mark */
+       (*ycor)= rd->yasp / rd->xasp;
+       if(rd->mode & R_FIELDS)
+               (*ycor) *= 2.0f;
+
+       object_camera_intrinsics(camera, &cam, &is_ortho, &shiftx, &shifty, clipsta, clipend, lens, sensor_x, sensor_y, sensor_fit);
+
        /* ortho only with camera available */
        if(cam && is_ortho) {
-               if(rd->xasp*winx >= rd->yasp*winy) {
+               if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) {
+                       if(rd->xasp*winx >= rd->yasp*winy) viewfac= winx;
+                       else viewfac= (*ycor) * winy;
+               }
+               else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
                        viewfac= winx;
                }
-               else {
+               else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
                        viewfac= (*ycor) * winy;
                }
+
                /* ortho_scale == 1.0 means exact 1 to 1 mapping */
                pixsize= cam->ortho_scale/viewfac;
        }
        else {
-               if(rd->xasp*winx >= rd->yasp*winy)      viewfac= ((*lens) * winx)/32.0f;
-               else                                                            viewfac= (*ycor) * ((*lens) * winy)/32.0f;
+               if((*sensor_fit)==CAMERA_SENSOR_FIT_AUTO) {
+                       if(rd->xasp*winx >= rd->yasp*winy)      viewfac= ((*lens) * winx) / (*sensor_x);
+                       else                                    viewfac= (*ycor) * ((*lens) * winy) / (*sensor_x);
+               }
+               else if((*sensor_fit)==CAMERA_SENSOR_FIT_HOR) {
+                       viewfac= ((*lens) * winx) / (*sensor_x);
+               }
+               else { /* if((*sensor_fit)==CAMERA_SENSOR_FIT_VERT) { */
+                       viewfac= ((*lens) * winy) / (*sensor_y);
+               }
+
                pixsize= (*clipsta) / viewfac;
        }
 
        /* viewplane fully centered, zbuffer fills in jittered between -.5 and +.5 */
        winside= MAX2(winx, winy);
+
+       if(cam) {
+               if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR)
+                       winside= winx;
+               else if(cam->sensor_fit==CAMERA_SENSOR_FIT_VERT)
+                       winside= winy;
+       }
+
        viewplane->xmin= -0.5f*(float)winx + shiftx*winside;
        viewplane->ymin= -0.5f*(*ycor)*(float)winy + shifty*winside;
        viewplane->xmax=  0.5f*(float)winx + shiftx*winside;
@@ -3076,7 +3120,17 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
                float aspx= (float) scene->r.xsch*scene->r.xasp;
                float aspy= (float) scene->r.ysch*scene->r.yasp;
 
-               if(aspx < aspy) {
+               if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
+                       if(aspx < aspy) {
+                               r_asp[0]= aspx / aspy;
+                               r_asp[1]= 1.0;
+                       }
+                       else {
+                               r_asp[0]= 1.0;
+                               r_asp[1]= aspy / aspx;
+                       }
+               }
+               else if(camera->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
                        r_asp[0]= aspx / aspy;
                        r_asp[1]= 1.0;
                }
@@ -3102,16 +3156,18 @@ void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const sh
        else {
                /* that way it's always visible - clipsta+0.1 */
                float fac;
+               float half_sensor= 0.5f*((camera->sensor_fit==CAMERA_SENSOR_FIT_VERT) ? (camera->sensor_y) : (camera->sensor_x));
+
                *r_drawsize= drawsize / ((scale[0] + scale[1] + scale[2]) / 3.0f);
 
                if(do_clip) {
                        /* fixed depth, variable size (avoids exceeding clipping range) */
                        depth = -(camera->clipsta + 0.1f);
-                       fac = depth / (camera->lens/-16.0f * scale[2]);
+                       fac = depth / (camera->lens/(-half_sensor) * scale[2]);
                }
                else {
                        /* fixed size, variable depth (stays a reasonable size in the 3D view) */
-                       depth= *r_drawsize * camera->lens/-16.0f * scale[2];
+                       depth= *r_drawsize * camera->lens/(-half_sensor) * scale[2];
                        fac= *r_drawsize;
                }
 
index 7ba0a642cdd7fe64f922d58705c7ad48a42724a5..93ff8ee08fc8bd37a6e4fbee28e9eac652e7c217 100644 (file)
@@ -990,6 +990,10 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen
 /* this is called in main loop, doing tagged updates before redraw */
 void scene_update_tagged(Main *bmain, Scene *scene)
 {
+       /* keep this first */
+       BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
+
+       /* flush recalc flags to dependencies */
        DAG_ids_flush_tagged(bmain);
 
        BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
@@ -997,11 +1001,13 @@ void scene_update_tagged(Main *bmain, Scene *scene)
        scene->physics_settings.quick_cache_step= 0;
 
        /* update all objects: drivers, matrices, displists, etc. flags set
-          by depgraph or manual, no layer check here, gets correct flushed */
+          by depgraph or manual, no layer check here, gets correct flushed
 
+          in the future this should handle updates for all datablocks, not
+          only objects and scenes. - brecht */
        scene_update_tagged_recursive(bmain, scene, scene);
 
-       /* recalc scene animation data here (for sequencer) */
+       /* extra call here to recalc scene animation (for sequencer) */
        {
                AnimData *adt= BKE_animdata_from_id(&scene->id);
                float ctime = BKE_curframe(scene);
@@ -1010,15 +1016,15 @@ void scene_update_tagged(Main *bmain, Scene *scene)
                        BKE_animsys_evaluate_animdata(scene, &scene->id, adt, ctime, 0);
        }
        
+       /* quick point cache updates */
        if (scene->physics_settings.quick_cache_step)
                BKE_ptcache_quick_cache_all(bmain, scene);
 
+       /* notify editors about recalc */
        DAG_ids_check_recalc(bmain);
 
+       /* keep this last */
        BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST);
-
-       /* in the future this should handle updates for all datablocks, not
-          only objects and scenes. - brecht */
 }
 
 void scene_clear_tagged(Main *bmain, Scene *UNUSED(scene))
@@ -1033,7 +1039,8 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
        Scene *sce_iter;
 
        /* keep this first */
-       BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_PRE);
+       BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE);
+       BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
 
        sound_set_cfra(sce->r.cfra);
        
@@ -1045,6 +1052,10 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
                        DAG_scene_sort(bmain, sce_iter);
        }
 
+       /* flush recalc flags to dependencies, if we were only changing a frame
+          this would not be necessary, but if a user or a script has modified
+          some datablock before scene_update_tagged was called, we need the flush */
+       DAG_ids_flush_tagged(bmain);
 
        /* Following 2 functions are recursive
         * so dont call within 'scene_update_tagged_recursive' */
@@ -1065,8 +1076,8 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
        scene_update_tagged_recursive(bmain, sce, sce);
 
        /* keep this last */
-       BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_SCENE_UPDATE_POST);
-       BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_POST);
+       BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST);
+       BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST);
 
        DAG_ids_clear_recalc(bmain);
 }
index 02e6fe945f341dc26e5a6336ad21fc2978ce05a4..3d28e45f6b77a6aaa921b5587673f4231b34fbf2 100644 (file)
@@ -351,6 +351,29 @@ ARegion *BKE_area_find_region_type(ScrArea *sa, int type)
        return NULL;
 }
 
+/* note, using this function is generally a last resort, you really want to be
+ * using the context when you can - campbell
+ * -1 for any type */
+struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min)
+{
+       ScrArea *sa, *big= NULL;
+       int size, maxsize= 0;
+
+       for(sa= sc->areabase.first; sa; sa= sa->next) {
+               if ((spacetype == -1) || sa->spacetype == spacetype) {
+                       if (min <= sa->winx && min <= sa->winy) {
+                               size= sa->winx*sa->winy;
+                               if (size > maxsize) {
+                                       maxsize= size;
+                                       big= sa;
+                               }
+                       }
+               }
+       }
+
+       return big;
+}
+
 void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene)
 {
        int bit;
index c8b6c030d616d9450b69dda60ab41920b560f89e..b6a371707bbb84d73c61f0274b1d1c477afb59cc 100644 (file)
@@ -1747,6 +1747,9 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
        if(!mcol)
                mcol = dm->getFaceDataArray(dm, CD_MCOL);
 
+       if(!mcol)
+               mcol = dm->getFaceDataArray(dm, CD_TEXTURE_MCOL);
+
        totface = ccgSubSurf_getNumFaces(ss);
        for(i = 0; i < totface; i++) {
                CCGFace *f = ccgdm->faceMap[i].face;
index aef1c4bb46cb4e13c17a4ac92e2924f342562868..fca7c3469a1d08cd0c0714412ee4b45cbd259a5a 100644 (file)
@@ -179,8 +179,8 @@ void dquat_to_mat4(float R[4][4], DualQuat *dq);
 void quat_apply_track(float quat[4], short axis, short upflag);
 void vec_apply_track(float vec[3], short axis);
 
-float lens_to_angle(float lens);
-float angle_to_lens(float angle);
+float focallength_to_fov(float focal_length, float sensor);
+float fov_to_focallength(float fov, float sensor);
 
 float angle_wrap_rad(float angle);
 float angle_wrap_deg(float angle);
index 4711acbb60057362bf3f0f8953b7b99a5780af60..5d54ffbeb36437a07f46c677155fea42c72dc8b6 100644 (file)
@@ -148,4 +148,8 @@ if(WITH_OPENMP)
        add_definitions(-DPARALLEL=1)
 endif()
 
+if(WITH_XDG_USER_DIRS)
+       add_definitions(-DWITH_XDG_USER_DIRS)
+endif()
+
 blender_add_lib(bf_blenlib "${SRC}" "${INC}" "${INC_SYS}")
index 0ca8b72c1e3d140662aa3052ff89cd7c9e8ddf22..7fecbae8229eeb02c842ef16b7f0965a6e85d26b 100644 (file)
@@ -1688,14 +1688,14 @@ void vec_apply_track(float vec[3], short axis)
 }
 
 /* lens/angle conversion (radians) */
-float lens_to_angle(float lens)
+float focallength_to_fov(float focal_length, float sensor)
 {
-       return 2.0f * atanf(16.0f/lens);
+       return 2.0f * atanf((sensor/2.0f) / focal_length);
 }
 
-float angle_to_lens(float angle)
+float fov_to_focallength(float hfov, float sensor)
 {
-       return 16.0f / tanf(angle * 0.5f);
+       return (sensor/2.0f) / tanf(hfov * 0.5f);
 }
 
 /* 'mod_inline(-3,4)= 1', 'fmod(-3,4)= -3' */
index bbb62db58f285bfbd8ec23064163cf1e39d03e05..7aa84523e9d0c396b77f811c29f9e123a4833f85 100644 (file)
@@ -52,7 +52,7 @@
 #include "GHOST_Path-api.h"
 
 #if defined WIN32 && !defined _LIBC
-# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */
+#  include "BLI_fnmatch.h" /* use fnmatch included in blenlib */
 #else
 #  ifndef _GNU_SOURCE
 #    define _GNU_SOURCE
 #endif
 
 #ifdef WIN32
-#include <io.h>
-
-#ifdef _WIN32_IE
-#undef _WIN32_IE
-#endif
-#define _WIN32_IE 0x0501
-#include <windows.h>
-#include <shlobj.h>
-
-#include "BLI_winstuff.h"
-
+#  include <io.h>
+#  ifdef _WIN32_IE
+#    undef _WIN32_IE
+#  endif
+#  define _WIN32_IE 0x0501
+#  include <windows.h>
+#  include <shlobj.h>
+#  include "BLI_winstuff.h"
 #else /* non windows */
-
-#ifdef WITH_BINRELOC
-#include "binreloc.h"
-#endif
-
+#  ifdef WITH_BINRELOC
+#    include "binreloc.h"
+#  endif
 #endif /* WIN32 */
 
 /* standard paths */
 #ifdef WIN32
-#define BLENDER_USER_FORMAT            "%s\\Blender Foundation\\Blender\\%s"
-#define BLENDER_SYSTEM_FORMAT          "%s\\Blender Foundation\\Blender\\%s"
+#  define BLENDER_USER_FORMAT          "%s\\Blender Foundation\\Blender\\%s"
+#  define BLENDER_SYSTEM_FORMAT                "%s\\Blender Foundation\\Blender\\%s"
 #elif defined(__APPLE__)
-#define BLENDER_USER_FORMAT                    "%s/Blender/%s"
-#define BLENDER_SYSTEM_FORMAT                  "%s/Blender/%s"
-#else
-#define BLENDER_USER_FORMAT                    "%s/.blender/%s"
-#define BLENDER_SYSTEM_FORMAT                  "%s/blender/%s"
+#  define BLENDER_USER_FORMAT                  "%s/Blender/%s"
+#  define BLENDER_SYSTEM_FORMAT                        "%s/Blender/%s"
+#else /* UNIX */
+#  ifndef WITH_XDG_USER_DIRS /* oldschool unix ~/.blender/ */
+#    define BLENDER_USER_FORMAT                        "%s/.blender/%s"
+#  else /* new XDG ~/blender/.config/ */
+#    define BLENDER_USER_FORMAT                        "%s/blender/%s"
+#  endif // WITH_XDG_USER_DIRS
+#  define BLENDER_SYSTEM_FORMAT                        "%s/blender/%s"
 #endif
 
 /* local */
@@ -797,10 +796,18 @@ void BLI_getlastdir(const char* dir, char *last, const size_t maxlen)
    as default location to save documents */
 const char *BLI_getDefaultDocumentFolder(void)
 {
-       #if !defined(WIN32)
+#ifndef WIN32
+
+#ifdef WITH_XDG_USER_DIRS
+               const char *xdg_documents_dir= getenv("XDG_DOCUMENTS_DIR");
+               if (xdg_documents_dir) {
+                       return xdg_documents_dir;
+               }
+#endif
+
                return getenv("HOME");
 
-       #else /* Windows */
+#else /* Windows */
                const char * ret;
                static char documentfolder[MAXPATHLEN];
                HRESULT hResult;
@@ -825,7 +832,7 @@ const char *BLI_getDefaultDocumentFolder(void)
                }
                
                return NULL;
-       #endif
+#endif /* WIN32 */
 }
 
 /* NEW stuff, to be cleaned up when fully migrated */
index 30625e7b34eb5401fd49bc56beb06d79dcbd2a35..8b00d8e48a69ec9c570d2d97d114824f62160317 100644 (file)
@@ -141,7 +141,7 @@ UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, fl
        uci.do_pano = (camera->flag & CAM_PANORAMA);
        uci.do_persp = (camera->type==CAM_PERSP);
 
-       uci.camangle= lens_to_angle(camera->lens) / 2.0f;
+       uci.camangle= focallength_to_fov(camera->lens, camera->sensor_x) / 2.0f;
        uci.camsize= uci.do_persp ? tanf(uci.camangle) : camera->ortho_scale;
 
        /* account for scaled cameras */
index 5c59ae20c7b7ca113feeef0278ce1ef3437f6576..c0d52747d568006de04e62aaa1fabe8d27cb2daa 100644 (file)
@@ -12286,8 +12286,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                ntree_tmp_cycles_emission_version_patch(fd, lib, ma->nodetree);
        }
 
-       /* put compatibility code here until next subversion bump */
-       {
+       if (main->versionfile < 260){
                {
                        /* set default alpha value of Image outputs in image and render layer nodes to 0 */
                        Scene *sce;
@@ -12320,6 +12319,31 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                }
                        }
                }
+
+       }
+
+       if (main->versionfile < 260 || (main->versionfile == 260 && main->subversionfile < 1)){
+               Object *ob;
+
+               for (ob= main->object.first; ob; ob= ob->id.next) {
+                       ob->collision_boundtype= ob->boundtype;
+               }
+
+               {
+                       Camera *cam;
+                       for(cam= main->camera.first; cam; cam= cam->id.next) {
+                               if (cam->sensor_x < 0.01)
+                                       cam->sensor_x = DEFAULT_SENSOR_WIDTH;
+
+                               if (cam->sensor_y < 0.01)
+                                       cam->sensor_y = DEFAULT_SENSOR_HEIGHT;
+                       }
+               }
+       }
+
+       /* put compatibility code here until next subversion bump */
+       {
+               
        }
 
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
index 6fa2c8763e06ae2773303a9417ad8822bce124b1..fcb98cc7c32d10f9dd9e152a3f03c31ba80d76c0 100644 (file)
@@ -71,7 +71,7 @@ void CamerasExporter::operator()(Object *ob, Scene *sce)
        
        if (cam->type == CAM_PERSP) {
                COLLADASW::PerspectiveOptic persp(mSW);
-               persp.setXFov(RAD2DEGF(lens_to_angle(cam->lens)), "xfov");
+               persp.setXFov(RAD2DEGF(focallength_to_fov(cam->lens, cam->sensor_x)), "xfov");
                persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio");
                persp.setZFar(cam->clipend, false , "zfar");
                persp.setZNear(cam->clipsta,false , "znear");
index 8d133979fa4f655bdc6d332c2131cbad7fc8ea52..8cdb1065699b66b23cd5f17f68de1c7c1ee6fda0 100644 (file)
@@ -814,7 +814,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
                                                double aspect = camera->getAspectRatio().getValue();
                                                double xfov = aspect*yfov;
                                                // xfov is in degrees, cam->lens is in millimiters
-                                               cam->lens = angle_to_lens(DEG2RADF(xfov));
+                                               cam->lens = fov_to_focallength(DEG2RADF(xfov), cam->sensor_x);
                                        }
                                        break;
                        }
@@ -835,7 +835,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
                                        {
                                                double x = camera->getXFov().getValue();
                                                // x is in degrees, cam->lens is in millimiters
-                                               cam->lens = angle_to_lens(DEG2RADF(x));
+                                               cam->lens = fov_to_focallength(DEG2RADF(x), cam->sensor_x);
                                        }
                                        break;
                        }
@@ -852,7 +852,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
                                        {
                                        double yfov = camera->getYFov().getValue();
                                        // yfov is in degrees, cam->lens is in millimiters
-                                       cam->lens = angle_to_lens(DEG2RADF(yfov));
+                                       cam->lens = fov_to_focallength(DEG2RADF(yfov), cam->sensor_x);
                                        }
                                        break;
                        }
index 8c0fa3a89a37e52ec22c1ed16752ad4bb236767c..7461f5e9e9f12c930a72e76500540112143c480b 100644 (file)
@@ -56,7 +56,7 @@ typedef struct RenderInfo {
        short curtile, tottile, status;
        rcti disprect;                  /* storage for view3d preview rect */
        unsigned int* rect;             
-       struct Render *re;              /* persistant render */
+       struct Render *re;              /* persistent render */
 } RenderInfo;
 
 /* ri->status */
index a6316dc0e9ec96e65c7ea005ecf597754504d50a..eff4d1f6397c6056942417602b803bf4ffe6741f 100644 (file)
@@ -2569,10 +2569,12 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
        if(block->curlayout)
                ui_layout_add_but(block->curlayout, but);
 
+#ifdef WITH_PYTHON
        /* if the 'UI_OT_editsource' is running, extract the source info from the button  */
        if (UI_editsource_enable_check()) {
                UI_editsource_active_but_test(but);
        }
+#endif
 
        return but;
 }
index e49cb4898d98f0b2f605d38cb08bd3c30889a1aa..0ba141163b351a33798b647c2ef0b01c48421804 100644 (file)
@@ -3216,6 +3216,63 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
        return changed;
 }
 
+static void ui_ndofedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, wmNDOFMotionData *ndof, int shift)
+{
+       float *hsv= ui_block_hsv_get(but->block);
+       float rgb[3];
+       float sensitivity = (shift?0.15:0.3) * ndof->dt;
+       
+       int color_profile = but->block->color_profile;
+       
+       if (but->rnaprop) {
+               if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA)
+                       color_profile = BLI_PR_NONE;
+       }
+
+       ui_get_but_vectorf(but, rgb);
+       rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+       
+       switch((int)but->a1) {
+               case UI_GRAD_SV:
+                       hsv[2] += ndof->ry * sensitivity;
+                       hsv[1] += ndof->rx * sensitivity;
+                       break;
+               case UI_GRAD_HV:
+                       hsv[0] += ndof->ry * sensitivity;
+                       hsv[2] += ndof->rx * sensitivity;
+                       break;
+               case UI_GRAD_HS:
+                       hsv[0] += ndof->ry * sensitivity;
+                       hsv[1] += ndof->rx * sensitivity;
+                       break;
+               case UI_GRAD_H:
+                       hsv[0] += ndof->ry * sensitivity;
+                       break;
+               case UI_GRAD_S:
+                       hsv[1] += ndof->ry * sensitivity;
+                       break;
+               case UI_GRAD_V:
+                       hsv[2] += ndof->ry * sensitivity;
+                       break;
+               case UI_GRAD_V_ALT:     
+                       /* vertical 'value' strip */
+                       
+                       /* exception only for value strip - use the range set in but->min/max */
+                       hsv[2] += ndof->rx * sensitivity;
+                       
+                       if (color_profile)
+                               hsv[2] = srgb_to_linearrgb(hsv[2]);
+                       
+                       CLAMP(hsv[2], but->softmin, but->softmax);
+               default:
+                       assert(!"invalid hsv type");
+       }
+       
+       hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
+       copy_v3_v3(data->vec, rgb);
+       ui_set_but_vectorf(but, data->vec);
+}
+
 static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
 {
        int mx, my;
@@ -3238,8 +3295,18 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
                        
                        return WM_UI_HANDLER_BREAK;
                }
+               else if (event->type == NDOF_MOTION) {
+                       wmNDOFMotionData *ndof = (wmNDOFMotionData*) event->customdata;
+                       
+                       ui_ndofedit_but_HSVCUBE(but, data, ndof, event->shift);
+                       
+                       button_activate_state(C, but, BUTTON_STATE_EXIT);
+                       ui_apply_button(C, but->block, but, data, 1);
+                       
+                       return WM_UI_HANDLER_BREAK;
+               }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        if (but->a1==UI_GRAD_V_ALT){
                                int len;
                                
@@ -3337,11 +3404,62 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx
        return changed;
 }
 
+static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmNDOFMotionData *ndof, int shift)
+{
+       float *hsv= ui_block_hsv_get(but->block);
+       float rgb[3];
+       float phi, r /*, sqr */ /* UNUSED */, v[2];
+       float sensitivity = (shift ? 0.15f : 0.3f) * ndof->dt;
+       
+       ui_get_but_vectorf(but, rgb);
+       rgb_to_hsv_compat(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+       
+       /* Convert current colour on hue/sat disc to circular coordinates phi, r */
+       phi = fmodf(hsv[0]+0.25f, 1.0f) * -2.0f*M_PI;
+       r = hsv[1];
+       /* sqr= r>0.f?sqrtf(r):1; */ /* UNUSED */
+       
+       /* Convert to 2d vectors */
+       v[0] = r * cosf(phi);
+       v[1] = r * sinf(phi);
+       
+       /* Use ndof device y and x rotation to move the vector in 2d space */
+       v[0] += ndof->ry * sensitivity;
+       v[1] += ndof->rx * sensitivity;
+
+       /* convert back to polar coords on circle */
+       phi = atan2(v[0], v[1])/(2.0f*(float)M_PI) + 0.5f;
+       
+       /* use ndof z rotation to additionally rotate hue */
+       phi -= ndof->rz * sensitivity * 0.5f;
+       
+       r = len_v2(v);
+       CLAMP(r, 0.0f, 1.0f);
+       
+       /* convert back to hsv values, in range [0,1] */
+       hsv[0] = fmodf(phi, 1.0f);
+       hsv[1] = r;
+
+       /* exception, when using color wheel in 'locked' value state:
+        * allow choosing a hue for black values, by giving a tiny increment */
+       if (but->flag & UI_BUT_COLOR_LOCK) { // lock
+               if (hsv[2] == 0.0f) hsv[2] = 0.0001f;
+       }
+       
+       hsv_to_rgb(hsv[0], hsv[1], hsv[2], data->vec, data->vec+1, data->vec+2);
+       
+       if((but->flag & UI_BUT_VEC_SIZE_LOCK) && (data->vec[0] || data->vec[1] || data->vec[2])) {
+               normalize_v3(data->vec);
+               mul_v3_fl(data->vec, but->a2);
+       }
+       
+       ui_set_but_vectorf(but, data->vec);
+}
+
 
 static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event)
 {
        int mx, my;
-       
        mx= event->x;
        my= event->y;
        ui_window_to_block(data->region, block, &mx, &my);
@@ -3360,8 +3478,18 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
                        
                        return WM_UI_HANDLER_BREAK;
                }
+               else if (event->type == NDOF_MOTION) {
+                       wmNDOFMotionData *ndof = (wmNDOFMotionData*) event->customdata;
+                       
+                       ui_ndofedit_but_HSVCIRCLE(but, data, ndof, event->shift);
+
+                       button_activate_state(C, but, BUTTON_STATE_EXIT);
+                       ui_apply_button(C, but->block, but, data, 1);
+                       
+                       return WM_UI_HANDLER_BREAK;
+               }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        int len;
                        
                        /* reset only saturation */
@@ -3810,7 +3938,7 @@ static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandle
                        return WM_UI_HANDLER_BREAK;
                }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        Histogram *hist = (Histogram *)but->poin;
                        hist->ymax = 1.f;
                        
@@ -3893,7 +4021,7 @@ static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleB
                        return WM_UI_HANDLER_BREAK;
                }
                /* XXX hardcoded keymap check.... */
-               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
+               else if (event->type == DELKEY && event->val == KM_PRESS) {
                        Scopes *scopes = (Scopes *)but->poin;
                        scopes->wavefrm_yfac = 1.f;
 
index 27f94ae8e49ad454e27e7551cd641542f3b2da3a..5803054caa71d80d37bbdd62b997b1e95f51bf04 100644 (file)
@@ -43,6 +43,7 @@
 #include "BLI_utildefines.h"
 
 #include "BKE_context.h"
+#include "BKE_screen.h"
 #include "BKE_global.h"
 #include "BKE_text.h" /* for UI_OT_reports_to_text */
 #include "BKE_report.h"
@@ -476,6 +477,7 @@ static void UI_OT_reports_to_textblock(wmOperatorType *ot)
        ot->exec= reports_to_text_exec;
 }
 
+#ifdef WITH_PYTHON
 
 /* ------------------------------------------------------------------------- */
 /* EditSource Utility funcs and operator,
@@ -576,24 +578,6 @@ void UI_editsource_active_but_test(uiBut *but)
 
 /* editsource operator component */
 
-static ScrArea *biggest_text_view(bContext *C)
-{
-       bScreen *sc= CTX_wm_screen(C);
-       ScrArea *sa, *big= NULL;
-       int size, maxsize= 0;
-
-       for(sa= sc->areabase.first; sa; sa= sa->next) {
-               if(sa->spacetype==SPACE_TEXT) {
-                       size= sa->winx * sa->winy;
-                       if(size > maxsize) {
-                               maxsize= size;
-                               big= sa;
-                       }
-               }
-       }
-       return big;
-}
-
 static int editsource_text_edit(bContext *C, wmOperator *op,
                                 char filepath[240], int line)
 {
@@ -618,7 +602,7 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
        else {
                /* naughty!, find text area to set, not good behavior
                 * but since this is a dev tool lets allow it - campbell */
-               ScrArea *sa= biggest_text_view(C);
+               ScrArea *sa= BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TEXT, 0);
                if(sa) {
                        SpaceText *st= sa->spacedata.first;
                        st->text= text;
@@ -711,6 +695,7 @@ static void UI_OT_editsource(wmOperatorType *ot)
        ot->exec= editsource_exec;
 }
 
+#endif /* WITH_PYTHON */
 
 /* ********************************************************* */
 /* Registration */
@@ -723,6 +708,9 @@ void UI_buttons_operatortypes(void)
        WM_operatortype_append(UI_OT_reset_default_button);
        WM_operatortype_append(UI_OT_copy_to_selected_button);
        WM_operatortype_append(UI_OT_reports_to_textblock); // XXX: temp?
+
+#ifdef WITH_PYTHON
        WM_operatortype_append(UI_OT_editsource);
+#endif
 }
 
index e29dfaa0a239badab6d8e06800a2b48211608b07..5487cbdadb2307dfc189ec937f4b45487337dc64 100644 (file)
@@ -54,6 +54,7 @@
 #include "BLI_math_geom.h"
 
 #include "BKE_blender.h"
+#include "BKE_screen.h"
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
@@ -1202,24 +1203,6 @@ static int thread_break(void *UNUSED(arg))
        return G.afbreek;
 }
 
-static ScrArea *biggest_image_area(bScreen *screen)
-{
-       ScrArea *sa, *big= NULL;
-       int size, maxsize= 0;
-
-       for(sa= screen->areabase.first; sa; sa= sa->next) {
-               if(sa->spacetype==SPACE_IMAGE) {
-                       size= sa->winx*sa->winy;
-                       if(sa->winx > 10 && sa->winy > 10 && size > maxsize) {
-                               maxsize= size;
-                               big= sa;
-                       }
-               }
-       }
-       return big;
-}
-
-
 typedef struct BakeRender {
        Render *re;
        Main *main;
@@ -1270,7 +1253,7 @@ static void init_bake_internal(BakeRender *bkr, bContext *C)
        /* get editmode results */
        ED_object_exit_editmode(C, 0);  /* 0 = does not exit editmode */
 
-       bkr->sa= biggest_image_area(CTX_wm_screen(C)); /* can be NULL */
+       bkr->sa= BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_IMAGE, 10); /* can be NULL */
        bkr->main= CTX_data_main(C);
        bkr->scene= scene;
        bkr->actob= (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT : NULL;
index 1efe79fff9e1dff4df2979db1e7176973bd46a5e..a82ed95079f9c628f92ca491c5a4ce5920550fcd 100644 (file)
@@ -645,7 +645,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
                /* get the view settings if 'around' isnt set and the view is available */
                View3D *v3d= CTX_wm_view3d(C);
                copy_v3_v3(cursor, give_cursor(scene, v3d));
-               if(v3d && !RNA_property_is_set(op->ptr, "around"))
+               if(v3d && !RNA_property_is_set(op->ptr, "center"))
                        around= v3d->around;
        }
 
index 9c38b1ce98f8b24fb3a9a96f8c186ffd3ef0dc32..cc1c88430151ca8282947f74df8ddd1d20eb13f3 100644 (file)
@@ -503,6 +503,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
        const short is_animation= RNA_boolean_get(op->ptr, "animation");
        const short is_write_still= RNA_boolean_get(op->ptr, "write_still");
        struct Object *camera_override= v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
+       const char *name;
        
        /* only one render job at a time */
        if(WM_jobs_test(CTX_wm_manager(C), scene))
@@ -577,7 +578,10 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
        rj->reports= op->reports;
 
        /* setup job */
-       steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Render", jobflag);
+       if(RE_seq_render_active(scene, &scene->r)) name= "Sequence Render";
+       else name= "Render";
+
+       steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, name, jobflag);
        WM_jobs_customdata(steve, rj, render_freejob);
        WM_jobs_timer(steve, 0.2, NC_SCENE|ND_RENDER_RESULT, 0);
        WM_jobs_callbacks(steve, render_startjob, NULL, NULL, render_endjob);
index 47957c0bb5ad8631193024a2d21e3c66d7f72fbd..d8719c7d7cdbae895f470468f6daa53d39596770 100644 (file)
@@ -58,6 +58,7 @@
 
 /* returns biggest area that is not uv/image editor. Note that it uses buttons */
 /* window as the last possible alternative.                                                                       */
+/* would use BKE_screen_find_big_area(...) but this is too specific            */
 static ScrArea *biggest_non_image_area(bContext *C)
 {
        bScreen *sc= CTX_wm_screen(C);
@@ -85,22 +86,6 @@ static ScrArea *biggest_non_image_area(bContext *C)
        return big;
 }
 
-static ScrArea *biggest_area(bContext *C)
-{
-       bScreen *sc= CTX_wm_screen(C);
-       ScrArea *sa, *big= NULL;
-       int size, maxsize= 0;
-
-       for(sa= sc->areabase.first; sa; sa= sa->next) {
-               size= sa->winx*sa->winy;
-               if(size > maxsize) {
-                       maxsize= size;
-                       big= sa;
-               }
-       }
-       return big;
-}
-
 static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win)
 {
        wmWindowManager *wm= CTX_wm_manager(C);
@@ -206,7 +191,7 @@ void render_view_open(bContext *C, int mx, int my)
                        }
                        else {
                                /* use any area of decent size */
-                               sa= biggest_area(C);
+                               sa= BKE_screen_find_big_area(CTX_wm_screen(C), -1, 0);
                                if(sa->spacetype!=SPACE_IMAGE) {
                                        // XXX newspace(sa, SPACE_IMAGE);
                                        sima= sa->spacedata.first;
index 99412853ab9e91f55c4c3f03c35e1a4c8b336d89..dc6a647cadad506400ca0a553fccb247f5cf1aa3 100644 (file)
@@ -57,6 +57,7 @@
 #include "IMB_imbuf_types.h"
 
 #include "DNA_brush_types.h"
+#include "DNA_camera_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_node_types.h"
@@ -3040,7 +3041,8 @@ static void project_paint_begin(ProjPaintState *ps)
                                Object *camera= ps->scene->camera;
 
                                /* dont actually use these */
-                               float _viewdx, _viewdy, _ycor, _lens=0.0f;
+                               float _viewdx, _viewdy, _ycor, _lens=0.0f, _sensor_x=DEFAULT_SENSOR_WIDTH, _sensor_y= DEFAULT_SENSOR_HEIGHT;
+                               short _sensor_fit= CAMERA_SENSOR_FIT_AUTO;
                                rctf _viewplane;
 
                                /* viewmat & viewinv */
@@ -3052,7 +3054,7 @@ static void project_paint_begin(ProjPaintState *ps)
                                object_camera_mode(&ps->scene->r, camera);
                                object_camera_matrix(&ps->scene->r, camera, ps->winx, ps->winy, 0,
                                                winmat, &_viewplane, &ps->clipsta, &ps->clipend,
-                                               &_lens, &_ycor, &_viewdx, &_viewdy);
+                                               &_lens, &_sensor_x, &_sensor_y, &_sensor_fit, &_ycor, &_viewdx, &_viewdy);
 
                                ps->is_ortho= (ps->scene->r.mode & R_ORTHO) ? 1 : 0;
                        }
index 0b009dba65155c84ef4e2b3b5a660cec07c45b88..c26a4d52a9ecd8632364de65559cb0f9aae81d78 100644 (file)
@@ -208,7 +208,8 @@ typedef struct StrokeCache {
 
        int first_time; /* Beginning of stroke may do some things special */
 
-       bglMats *mats;
+       /* from ED_view3d_ob_project_mat_get() */
+       float projection_mat[4][4];
 
        /* Clean this up! */
        ViewContext *vc;
@@ -405,7 +406,8 @@ static int sculpt_brush_test_cube(SculptBrushTest *test, float co[3], float loca
        }
 }
 
-static float frontface(Brush *brush, float sculpt_normal[3], short no[3], float fno[3])
+static float frontface(Brush *brush, const float sculpt_normal[3],
+                      const short no[3], const float fno[3])
 {
        if (brush->flag & BRUSH_FRONTFACE) {
                float dot;
@@ -655,7 +657,11 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
 }
 
 /* Return a multiplier for brush strength on a particular vertex. */
-static float tex_strength(SculptSession *ss, Brush *br, float *point, const float len)
+static float tex_strength(SculptSession *ss, Brush *br, float point[3],
+                         const float len,
+                         const float sculpt_normal[3],
+                         const short vno[3],
+                         const float fno[3])
 {
        MTex *mtex = &br->mtex;
        float avg= 1;
@@ -673,7 +679,8 @@ static float tex_strength(SculptSession *ss, Brush *br, float *point, const floa
        }
        else if(ss->texcache) {
                float rotation = -mtex->rot;
-               float x, y, point_2d[3];
+               float symm_point[3], point_2d[2];
+               float x, y;
                float radius;
 
                /* if the active area is being applied for symmetry, flip it
@@ -681,12 +688,13 @@ static float tex_strength(SculptSession *ss, Brush *br, float *point, const floa
                   position in order to project it. This insures that the 
                   brush texture will be oriented correctly. */
 
-               flip_coord(point_2d, point, ss->cache->mirror_symmetry_pass);
+               flip_coord(symm_point, point, ss->cache->mirror_symmetry_pass);
 
                if (ss->cache->radial_symmetry_pass)
-                       mul_m4_v3(ss->cache->symm_rot_mat_inv, point_2d);
+                       mul_m4_v3(ss->cache->symm_rot_mat_inv, symm_point);
 
-               projectf(ss->cache->mats, point_2d, point_2d);
+               ED_view3d_project_float(ss->cache->vc->ar, symm_point, point_2d,
+                                       ss->cache->projection_mat);
 
                /* if fixed mode, keep coordinates relative to mouse */
                if(mtex->brush_map_mode == MTEX_MAP_MODE_FIXED) {
@@ -742,7 +750,10 @@ static float tex_strength(SculptSession *ss, Brush *br, float *point, const floa
 
        avg += br->texture_sample_bias;
 
-       avg *= brush_curve_strength(br, len, ss->cache->radius); /* Falloff curve */
+       /* Falloff curve */
+       avg *= brush_curve_strength(br, len, ss->cache->radius);
+
+       avg *= frontface(br, sculpt_normal, vno, fno);
 
        return avg;
 }
@@ -980,7 +991,8 @@ static void do_mesh_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *node,
 
        BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE) {
                if(sculpt_brush_test(&test, vd.co)) {
-                       const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, ss->cache->view_normal, vd.no, vd.fno);
+                       const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
+                                                                 ss->cache->view_normal, vd.no, vd.fno);
                        float avg[3], val[3];
 
                        neighbor_average(ss, avg, vd.vert_indices[vd.i]);
@@ -1073,7 +1085,8 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
                                fno= data[index].no;
 
                                if(sculpt_brush_test(&test, co)) {
-                                       const float fade = bstrength*tex_strength(ss, brush, co, test.dist)*frontface(brush, ss->cache->view_normal, NULL, fno);
+                                       const float fade = bstrength*tex_strength(ss, brush, co, test.dist,
+                                                                                 ss->cache->view_normal, NULL, fno);
                                        float *avg, val[3];
                                        float n;
 
@@ -1169,9 +1182,9 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if (sculpt_brush_test(&test, vd.co)) {
-                       //if(sculpt_brush_test_cyl(&test, vd.co, ss->cache->location, area_normal)) {
                                /* offset vertex */
-                               float fade = tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno);
+                               float fade = tex_strength(ss, brush, vd.co, test.dist,
+                                                         area_normal, vd.no, vd.fno);
 
                                mul_v3_v3fl(proxy[vd.i], offset, fade);
 
@@ -1225,7 +1238,8 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, vd.co)) {
                                /* offset vertex */
-                               const float fade = tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno);
+                               const float fade = tex_strength(ss, brush, vd.co, test.dist,
+                                                               area_normal, vd.no, vd.fno);
                                float val1[3];
                                float val2[3];
 
@@ -1266,7 +1280,8 @@ static void do_pinch_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, vd.co)) {
-                               float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, ss->cache->view_normal, vd.no, vd.fno);
+                               float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
+                                                                   ss->cache->view_normal, vd.no, vd.fno);
                                float val[3];
 
                                sub_v3_v3v3(val, test.location, vd.co);
@@ -1326,7 +1341,8 @@ static void do_grab_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, origco[vd.i])) {
-                               const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(brush, an, origno[vd.i], NULL);
+                               const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist,
+                                                                         an, origno[vd.i], NULL);
 
                                mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
 
@@ -1367,7 +1383,8 @@ static void do_nudge_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, vd.co)) {
-                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, an, vd.no, vd.fno);
+                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
+                                                                         an, vd.no, vd.fno);
 
                                mul_v3_v3fl(proxy[vd.i], cono, fade);
 
@@ -1416,7 +1433,8 @@ static void do_snake_hook_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, vd.co)) {
-                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, an, vd.no, vd.fno);
+                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
+                                                                         an, vd.no, vd.fno);
 
                                mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
 
@@ -1464,7 +1482,8 @@ static void do_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, origco[vd.i])) {
-                               const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(brush, an, origno[vd.i], NULL);
+                               const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist,
+                                                                         an, origno[vd.i], NULL);
 
                                mul_v3_v3fl(proxy[vd.i], cono, fade);
 
@@ -1510,7 +1529,8 @@ static void do_rotate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, origco[vd.i])) {
-                               const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(brush, an, origno[vd.i], NULL);
+                               const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist,
+                                                                         an, origno[vd.i], NULL);
 
                                mul_v3_m3v3(proxy[vd.i], m, origco[vd.i]);
                                sub_v3_v3(proxy[vd.i], origco[vd.i]);
@@ -1564,7 +1584,8 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, origco[vd.i])) {
-                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno);
+                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
+                                                                         area_normal, vd.no, vd.fno);
                                float *disp= &layer_disp[vd.i];
                                float val[3];
 
@@ -1615,7 +1636,8 @@ static void do_inflate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno
 
                BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
                        if(sculpt_brush_test(&test, vd.co)) {
-                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, ss->cache->view_normal, vd.no, vd.fno);
+                               const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist,
+                                                                         ss->cache->view_normal, vd.no, vd.fno);
                                float val[3];
 
                                if(vd.fno) copy_v3_v3(val, vd.fno);
@@ -1947,7 +1969,8 @@ static void do_flatten_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno
                                sub_v3_v3v3(val, intr, vd.co);
 
                                if (plane_trim(ss->cache, brush, val)) {
-                                       const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
+                                       const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist),
+                                                                                 an, vd.no, vd.fno);
 
                                        mul_v3_v3fl(proxy[vd.i], val, fade);
 
@@ -2020,7 +2043,9 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
                                        sub_v3_v3v3(val, intr, vd.co);
 
                                        if (plane_trim(ss->cache, brush, val)) {
-                                               const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
+                                               const float fade = bstrength*tex_strength(ss, brush, vd.co,
+                                                                                         sqrt(test.dist),
+                                                                                         an, vd.no, vd.fno);
 
                                                mul_v3_v3fl(proxy[vd.i], val, fade);
 
@@ -2111,7 +2136,9 @@ static void do_clay_tubes_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
                                        sub_v3_v3v3(val, intr, vd.co);
 
                                        if (plane_trim(ss->cache, brush, val)) {
-                                               const float fade = bstrength*tex_strength(ss, brush, vd.co, ss->cache->radius*test.dist)*frontface(brush, an, vd.no, vd.fno);
+                                               const float fade = bstrength*tex_strength(ss, brush, vd.co,
+                                                                                         ss->cache->radius*test.dist,
+                                                                                         an, vd.no, vd.fno);
 
                                                mul_v3_v3fl(proxy[vd.i], val, fade);
 
@@ -2172,7 +2199,9 @@ static void do_fill_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
                                        sub_v3_v3v3(val, intr, vd.co);
 
                                        if (plane_trim(ss->cache, brush, val)) {
-                                               const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
+                                               const float fade = bstrength*tex_strength(ss, brush, vd.co,
+                                                                                         sqrt(test.dist),
+                                                                                         an, vd.no, vd.fno);
 
                                                mul_v3_v3fl(proxy[vd.i], val, fade);
 
@@ -2233,7 +2262,9 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
                                        sub_v3_v3v3(val, intr, vd.co);
 
                                        if (plane_trim(ss->cache, brush, val)) {
-                                               const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
+                                               const float fade = bstrength*tex_strength(ss, brush, vd.co,
+                                                                                         sqrt(test.dist),
+                                                                                         an, vd.no, vd.fno);
 
                                                mul_v3_v3fl(proxy[vd.i], val, fade);
 
@@ -2782,8 +2813,6 @@ static void sculpt_cache_free(StrokeCache *cache)
 {
        if(cache->face_norms)
                MEM_freeN(cache->face_norms);
-       if(cache->mats)
-               MEM_freeN(cache->mats);
        MEM_freeN(cache);
 }
 
@@ -2882,8 +2911,8 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio
 
        cache->brush = brush;
 
-       cache->mats = MEM_callocN(sizeof(bglMats), "sculpt bglMats");
-       view3d_get_transformation(vc->ar, vc->rv3d, vc->obact, cache->mats);
+       /* cache projection matrix */
+       ED_view3d_ob_project_mat_get(cache->vc->rv3d, ob, cache->projection_mat);
 
        ED_view3d_global_to_vector(cache->vc->rv3d, cache->vc->rv3d->twmat[3], cache->true_view_normal);
        /* Initialize layer brush displacements and persistent coords */
index c83baf24c1c907777ae541704af975a18693a04b..7121e4872eb2eecedab1281df4f42991b216bf1e 100644 (file)
@@ -1009,11 +1009,17 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
        return (ibuf != NULL);
 }
 
-static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op)
+static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op, Scene *evil_scene)
 {
        if (RNA_property_is_set(op->ptr, "color_mode")) simopts->planes= RNA_enum_get(op->ptr, "color_mode");
        if (RNA_property_is_set(op->ptr, "file_format")) simopts->imtype= RNA_enum_get(op->ptr, "file_format");
-       // if (RNA_property_is_set(op->ptr, "subimtype")) simopts->subimtype= RNA_enum_get(op->ptr, "subimtype"); // XXX
+
+#if 0
+       if (RNA_property_is_set(op->ptr, "subimtype")) simopts->subimtype= RNA_enum_get(op->ptr, "subimtype"); // XXX
+#else
+       simopts->subimtype= evil_scene->r.subimtype;
+#endif
+
        if (RNA_property_is_set(op->ptr, "file_quality")) simopts->quality= RNA_int_get(op->ptr, "file_quality");
 
        if (RNA_property_is_set(op->ptr, "filepath")) {
@@ -1141,7 +1147,7 @@ static int image_save_as_exec(bContext *C, wmOperator *op)
        /* just incase to initialize values,
         * these should be set on invoke or by the caller. */
        save_image_options_defaults(&simopts);
-       save_image_options_from_op(&simopts, op);
+       save_image_options_from_op(&simopts, op, CTX_data_scene(C));
 
        save_image_doit(C, sima, op, &simopts, TRUE);
 
@@ -1225,7 +1231,7 @@ static int image_save_exec(bContext *C, wmOperator *op)
 
        if (save_image_options_init(&simopts, sima, scene, FALSE) == 0)
                return OPERATOR_CANCELLED;
-       save_image_options_from_op(&simopts, op);
+       save_image_options_from_op(&simopts, op, scene);
 
        if (BLI_exists(simopts.filepath) && BLI_file_is_writable(simopts.filepath)) {
                save_image_doit(C, sima, op, &simopts, FALSE);
index d2b97597cb88c7a09e3b02857889a1296abc5994..533d2555b26dad65c4bc1dc1ab747f20d69d615f 100644 (file)
@@ -850,6 +850,11 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
        }
 }
 
+void node_uifunc_group(uiLayout *layout, bContext *C, PointerRNA *ptr)
+{
+       uiTemplateIDBrowse(layout, C, ptr, "node_tree", NULL, NULL, NULL);
+}
+
 static void node_common_buts_whileloop(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 {
        uiItemR(layout, ptr, "max_iterations", 0, NULL, 0);
@@ -875,7 +880,7 @@ static void node_common_set_butfunc(bNodeType *ntype)
 {
        switch(ntype->type) {
                case NODE_GROUP:
-//                     ntype->uifunc= node_common_buts_group;
+                       ntype->uifunc= node_uifunc_group;
                        ntype->drawfunc= node_draw_group;
                        ntype->drawupdatefunc= node_update_group;
                        break;
index 925c4571a66144f0c4188ce8bca28a02f72c397f..794f898a1fcc754df251720d5ce4eed486c4ada8 100644 (file)
 #define TS_CHUNK       128
 
 /* ********************************************************* */
-/* Persistant Data */
+/* Persistent Data */
 
 static void outliner_storage_cleanup(SpaceOops *soops)
 {
@@ -156,7 +156,7 @@ static void outliner_storage_cleanup(SpaceOops *soops)
        }
 }
 
-static void check_persistant(SpaceOops *soops, TreeElement *te, ID *id, short type, short nr)
+static void check_persistent(SpaceOops *soops, TreeElement *te, ID *id, short type, short nr)
 {
        TreeStore *ts;
        TreeStoreElem *tselem;
@@ -818,7 +818,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
        /* add to the visual tree */
        BLI_addtail(lb, te);
        /* add to the storage */
-       check_persistant(soops, te, id, type, index);
+       check_persistent(soops, te, id, type, index);
        tselem= TREESTORE(te);  
        
        /* if we are searching for something expand to see child elements */
index 832c4795f150c808d0e4f21a9d312b1363ccf0a0..41c48a1af582718384ef3b3a3429ed75d59f2a7c 100644 (file)
        ((ELEM(vd->drawtype, OB_TEXTURE, OB_MATERIAL) && dt>OB_SOLID) || \
        (vd->drawtype==OB_SOLID && vd->flag2 & V3D_SOLID_TEX))
 
-static void draw_bounding_volume(Scene *scene, Object *ob);
+static void draw_bounding_volume(Scene *scene, Object *ob, short type);
 
 static void drawcube_size(float size);
 static void drawcircle_size(float size);
@@ -2706,7 +2706,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
        if(dt==OB_BOUNDBOX) {
                if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
-                       draw_bounding_volume(scene, ob);
+                       draw_bounding_volume(scene, ob, ob->boundtype);
        }
        else if(hasHaloMat || (totface==0 && totedge==0)) {
                glPointSize(1.5);
@@ -5511,7 +5511,7 @@ static void draw_bb_quadric(BoundBox *bb, short type)
        gluDeleteQuadric(qobj); 
 }
 
-static void draw_bounding_volume(Scene *scene, Object *ob)
+static void draw_bounding_volume(Scene *scene, Object *ob, short type)
 {
        BoundBox *bb= NULL;
        
@@ -5537,8 +5537,8 @@ static void draw_bounding_volume(Scene *scene, Object *ob)
        
        if(bb==NULL) return;
        
-       if(ob->boundtype==OB_BOUND_BOX) draw_box(bb->vec);
-       else draw_bb_quadric(bb, ob->boundtype);
+       if(type==OB_BOUND_BOX) draw_box(bb->vec);
+       else draw_bb_quadric(bb, type);
        
 }
 
@@ -6104,7 +6104,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                        }
                        else if(dt==OB_BOUNDBOX) {
                                if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
-                                       draw_bounding_volume(scene, ob);
+                                       draw_bounding_volume(scene, ob, ob->boundtype);
                        }
                        else if(ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb))
                                empty_object= drawDispList(scene, v3d, rv3d, base, dt);
@@ -6120,7 +6120,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                        }
                        else if(dt==OB_BOUNDBOX) {
                                if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
-                                       draw_bounding_volume(scene, ob);
+                                       draw_bounding_volume(scene, ob, ob->boundtype);
                        }
                        else if(ED_view3d_boundbox_clip(rv3d, ob->obmat, ob->bb ? ob->bb : cu->bb)) {
                                empty_object= drawDispList(scene, v3d, rv3d, base, dt);
@@ -6137,7 +6137,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                                drawmball(scene, v3d, rv3d, base, dt);
                        else if(dt==OB_BOUNDBOX) {
                                if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
-                                       draw_bounding_volume(scene, ob);
+                                       draw_bounding_volume(scene, ob, ob->boundtype);
                        }
                        else 
                                empty_object= drawmball(scene, v3d, rv3d, base, dt);
@@ -6379,6 +6379,14 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                        }
                }
 
+               if(ob->gameflag & OB_BOUNDS) {
+                       if(ob->boundtype!=ob->collision_boundtype || (dtx & OB_BOUNDBOX)==0) {
+                               setlinestyle(2);
+                               draw_bounding_volume(scene, ob, ob->collision_boundtype);
+                               setlinestyle(0);
+                       }
+               }
+
                /* draw extra: after normal draw because of makeDispList */
                if(dtx && (G.f & G_RENDER_OGL)==0) {
 
@@ -6386,8 +6394,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
                                drawaxes(1.0f, OB_ARROWS);
                        }
                        if(dtx & OB_BOUNDBOX) {
-                               if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
-                                       draw_bounding_volume(scene, ob);
+                               draw_bounding_volume(scene, ob, ob->boundtype);
                        }
                        if(dtx & OB_TEXSPACE) drawtexspace(ob);
                        if(dtx & OB_DRAWNAME) {
index 63b0f68f15839d2c740ea3f93989f22176082559..70cf113384bed552c76e456e9d1004277353d211 100644 (file)
@@ -139,6 +139,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
        float median[7], ve_median[7];
        int tot, totw, totweight, totedge, totradius;
        char defstr[320];
+       PointerRNA radius_ptr;
 
        median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= median[6]= 0.0;
        tot= totw= totweight= totedge= totradius= 0;
@@ -210,6 +211,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                BezTriple *bezt;
                int a;
                ListBase *nurbs= curve_editnurbs(cu);
+               StructRNA *seltype= NULL;
+               void *selp= NULL;
 
                nu= nurbs->first;
                while(nu) {
@@ -224,6 +227,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                                totweight++;
                                                median[5]+= bezt->radius;
                                                totradius++;
+                                               selp= bezt;
+                                               seltype= &RNA_BezierSplinePoint;
                                        }
                                        else {
                                                if(bezt->f1 & SELECT) {
@@ -251,12 +256,17 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                                totweight++;
                                                median[5]+= bp->radius;
                                                totradius++;
+                                               selp= bp;
+                                               seltype= &RNA_SplinePoint;
                                        }
                                        bp++;
                                }
                        }
                        nu= nu->next;
                }
+
+               if(totradius==1)
+                       RNA_pointer_create(&cu->id, seltype, selp, &radius_ptr);
        }
        else if(ob->type==OB_LATTICE) {
                Lattice *lt= ob->data;
@@ -319,9 +329,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                uiBlockEndAlign(block);
                                if(totweight)
                                        uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:",   0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "");
-                               if(totradius)
-                                       uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:",   0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
+                               if(totradius) {
+                                       if(totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 20, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL);
+                                       else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:",      0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
                                }
+                       }
                        else {
                                uiBlockBeginAlign(block);
                                uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global",            0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
@@ -329,8 +341,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                                uiBlockEndAlign(block);
                                if(totweight)
                                        uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:",   0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "");
-                               if(totradius)
-                                       uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:",   0, 40, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs");
+                               if(totradius) {
+                                       if(totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 40, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL);
+                                       else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:",      0, 40, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs");
+                               }
                        }
                }
                else {
index 3d2558699eff5dbf761701f0b94f69aa94c2e762..a8cb436a942802af0b2152fffc7e69df76d437ed 100644 (file)
@@ -921,17 +921,34 @@ static void draw_selected_name(Scene *scene, Object *ob)
        BLF_draw_default(offset,  10, 0.0f, info, sizeof(info)-1);
 }
 
-void view3d_viewborder_size_get(Scene *scene, ARegion *ar, float size_r[2])
+void view3d_viewborder_size_get(Scene *scene, Object *camob, ARegion *ar, float size_r[2])
 {
-       float winmax= MAX2(ar->winx, ar->winy);
        float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp);
-       
-       if(aspect > 1.0f) {
-               size_r[0]= winmax;
-               size_r[1]= winmax/aspect;
-       } else {
-               size_r[0]= winmax*aspect;
-               size_r[1]= winmax;
+       short sensor_fit= CAMERA_SENSOR_FIT_AUTO;
+
+       if(camob && camob->type==OB_CAMERA) {
+               Camera *cam= (Camera *)camob->data;
+               sensor_fit= cam->sensor_fit;
+       }
+
+       if(sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
+               float winmax= MAX2(ar->winx, ar->winy);
+
+               if(aspect > 1.0f) {
+                       size_r[0]= winmax;
+                       size_r[1]= winmax/aspect;
+               } else {
+                       size_r[0]= winmax*aspect;
+                       size_r[1]= winmax;
+               }
+       }
+       else if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+               size_r[0]= ar->winx;
+               size_r[1]= ar->winx/aspect;
+       }
+       else {
+               size_r[0]= ar->winy*aspect;
+               size_r[1]= ar->winy;
        }
 }
 
@@ -941,7 +958,7 @@ void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, Region
        float size[2];
        float dx= 0.0f, dy= 0.0f;
        
-       view3d_viewborder_size_get(scene, ar, size);
+       view3d_viewborder_size_get(scene, v3d->camera, ar, size);
 
        size[0]= size[0]*zoomfac;
        size[1]= size[1]*zoomfac;
@@ -1208,6 +1225,21 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
                        uiSetRoundBox(UI_CNR_ALL);
                        uiDrawBox(GL_LINE_LOOP, x1, y1, x2, y2, 12.0);
                }
+               if (ca && (ca->flag & CAM_SHOWSENSOR)) {
+                       /* assume fixed sensor width for now */
+
+                       /* float sensor_aspect = ca->sensor_x / ca->sensor_y; */ /* UNUSED */
+                       float sensor_scale = (x2i-x1i) / ca->sensor_x;
+                       float sensor_height = sensor_scale * ca->sensor_y;
+
+                       float ymid = y1i + (y2i-y1i)/2.f;
+                       float sy1= ymid - sensor_height/2.f;
+                       float sy2= ymid + sensor_height/2.f;
+
+                       UI_ThemeColorShade(TH_WIRE, 100);
+
+                       uiDrawBox(GL_LINE_LOOP, x1i, sy1, x2i, sy2, 2.0f);
+               }
        }
 
        setlinestyle(0);
@@ -2403,10 +2435,12 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
        /* render 3d view */
        if(rv3d->persp==RV3D_CAMOB && v3d->camera) {
                float winmat[4][4];
-               float _clipsta, _clipend, _lens, _yco, _dx, _dy;
+               float _clipsta, _clipend, _lens, _yco, _dx, _dy, _sensor_x= DEFAULT_SENSOR_WIDTH, _sensor_y= DEFAULT_SENSOR_HEIGHT;
+               short _sensor_fit= CAMERA_SENSOR_FIT_AUTO;
                rctf _viewplane;
 
-               object_camera_matrix(&scene->r, v3d->camera, sizex, sizey, 0, winmat, &_viewplane, &_clipsta, &_clipend, &_lens, &_yco, &_dx, &_dy);
+               object_camera_matrix(&scene->r, v3d->camera, sizex, sizey, 0, winmat, &_viewplane, &_clipsta, &_clipend, &_lens,
+                       &_sensor_x, &_sensor_y, &_sensor_fit, &_yco, &_dx, &_dy);
 
                ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat);
        }
@@ -2461,9 +2495,10 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int w
        invert_m4_m4(rv3d.viewmat, rv3d.viewinv);
 
        {
-               float _yco, _dx, _dy;
+               float _yco, _dx, _dy, _sensor_x= DEFAULT_SENSOR_WIDTH, _sensor_y= DEFAULT_SENSOR_HEIGHT;
+               short _sensor_fit= CAMERA_SENSOR_FIT_AUTO;
                rctf _viewplane;
-               object_camera_matrix(&scene->r, v3d.camera, width, height, 0, rv3d.winmat, &_viewplane, &v3d.near, &v3d.far, &v3d.lens, &_yco, &_dx, &_dy);
+               object_camera_matrix(&scene->r, v3d.camera, width, height, 0, rv3d.winmat, &_viewplane, &v3d.near, &v3d.far, &v3d.lens, &_sensor_x, &_sensor_y, &_sensor_fit, &_yco, &_dx, &_dy);
        }
 
        mul_m4_m4m4(rv3d.persmat, rv3d.viewmat, rv3d.winmat);
index ea8db17daf0a33f863016ea13d90ebc02b2a9df2..e7fbdaf1debb7abce8c22466cb9211a17512cd21 100644 (file)
@@ -2255,13 +2255,14 @@ static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was
 {
        ARegion *ar= CTX_wm_region(C);
        RegionView3D *rv3d= CTX_wm_region_view3d(C);
+       View3D *v3d= CTX_wm_view3d(C);
        Scene *scene= CTX_data_scene(C);
        float xfac, yfac;
        float size[2];
 
        rv3d->camdx= rv3d->camdy= 0.0f;
 
-       view3d_viewborder_size_get(scene, ar, size);
+       view3d_viewborder_size_get(scene, v3d->camera, ar, size);
 
        /* 4px is just a little room from the edge of the area */
        xfac= (float)ar->winx / (float)(size[0] + 4);
@@ -2523,13 +2524,13 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot)
 }
 
 /* sets the view to 1:1 camera/render-pixel */
-static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar)
+static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar, View3D *v3d)
 {
        RegionView3D *rv3d= ar->regiondata;
        float size[2];
        int im_width= (scene->r.size*scene->r.xsch)/100;
        
-       view3d_viewborder_size_get(scene, ar, size);
+       view3d_viewborder_size_get(scene, v3d->camera, ar, size);
 
        rv3d->camzoom= BKE_screen_view3d_zoom_from_fac((float)im_width/size[0]);
        CLAMP(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
@@ -2540,7 +2541,7 @@ static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op))
        Scene *scene= CTX_data_scene(C);
        ARegion *ar= CTX_wm_region(C);
 
-       view3d_set_1_to_1_viewborder(scene, ar);
+       view3d_set_1_to_1_viewborder(scene, ar, CTX_wm_view3d(C));
 
        WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C));
 
index b087c7ac8736d05115d3d127079dbf9a57f16fe1..b07d2d1ca738bbb90610a3421ac7b1c5b461b54b 100644 (file)
@@ -135,7 +135,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
 void view3d_clr_clipping(void);
 void view3d_set_clipping(RegionView3D *rv3d);
 void add_view3d_after(ListBase *lb, Base *base, int flag);
-void view3d_viewborder_size_get(struct Scene *scene, struct ARegion *ar, float size_r[2]);
+void view3d_viewborder_size_get(struct Scene *scene, struct Object *camob, struct ARegion *ar, float size_r[2]);
 
 void circf(float x, float y, float rad);
 void circ(float x, float y, float rad);
index 93c577619dea4c070efd4f47be1c144447df490e..7de1f2a85bb8dd03387f0aa02c356027b6639959 100644 (file)
@@ -966,10 +966,14 @@ int ED_view3d_clip_range_get(View3D *v3d, RegionView3D *rv3d, float *clipsta, fl
 int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
 {
        Camera *cam=NULL;
-       float lens, fac, x1, y1, x2, y2;
+       float lens, sensor_x =DEFAULT_SENSOR_WIDTH, sensor_y= DEFAULT_SENSOR_HEIGHT, fac, x1, y1, x2, y2;
        float winx= (float)winxi, winy= (float)winyi;
        int orth= 0;
-       
+       short sensor_fit= CAMERA_SENSOR_FIT_AUTO;
+
+       /* currnetly using sensor size (depends on fov calculating method) */
+       float sensor= DEFAULT_SENSOR_WIDTH;
+
        lens= v3d->lens;        
        
        *clipsta= v3d->near;
@@ -992,8 +996,13 @@ int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winy
                        else if(v3d->camera->type==OB_CAMERA) {
                                cam= v3d->camera->data;
                                lens= cam->lens;
+                               sensor_x= cam->sensor_x;
+                               sensor_y= cam->sensor_y;
                                *clipsta= cam->clipsta;
                                *clipend= cam->clipend;
+                               sensor_fit= cam->sensor_fit;
+
+                               sensor= (cam->sensor_fit==CAMERA_SENSOR_FIT_VERT) ? (cam->sensor_y) : (cam->sensor_x);
                        }
                }
        }
@@ -1024,21 +1033,44 @@ int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winy
                if(cam && cam->type==CAM_ORTHO) {
                        /* ortho_scale == 1 means exact 1 to 1 mapping */
                        float dfac= 2.0f*cam->ortho_scale/fac;
-                       
-                       if(winx>winy) x1= -dfac;
-                       else x1= -winx*dfac/winy;
+
+                       if(sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
+                               if(winx>winy) {
+                                       x1= -dfac;
+                                       y1= -winy*dfac/winx;
+                               }
+                               else {
+                                       x1= -winx*dfac/winy;
+                                       y1= -dfac;
+                               }
+                       }
+                       else if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+                               x1= -dfac;
+                               y1= -winy*dfac/winx;
+                       }
+                       else {
+                               x1= -winx*dfac/winy;
+                               y1= -dfac;
+                       }
+
                        x2= -x1;
-                       
-                       if(winx>winy) y1= -winy*dfac/winx;
-                       else y1= -dfac;
                        y2= -y1;
+
                        orth= 1;
                }
                else {
                        float dfac;
                        
-                       if(winx>winy) dfac= 64.0f/(fac*winx*lens);
-                       else dfac= 64.0f/(fac*winy*lens);
+                       if(sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
+                               if(winx>winy) dfac= (sensor_x * 2.0) / (fac*winx*lens);
+                               else dfac= (sensor_x * 2.0) / (fac*winy*lens);
+                       }
+                       else if(sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+                               dfac= (sensor_x * 2.0) / (fac*winx*lens);
+                       }
+                       else {
+                               dfac= (sensor_y * 2.0) / (fac*winy*lens);
+                       }
                        
                        x1= - *clipsta * winx*dfac;
                        x2= -x1;
@@ -1057,8 +1089,8 @@ int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winy
                                dy += cam->shifty * cam->ortho_scale;
                        }
                        else {
-                               dx += cam->shiftx * (cam->clipsta / cam->lens) * 32.0f;
-                               dy += cam->shifty * (cam->clipsta / cam->lens) * 32.0f;
+                               dx += cam->shiftx * (cam->clipsta / cam->lens) * sensor;
+                               dy += cam->shifty * (cam->clipsta / cam->lens) * sensor;
                        }
 
                        x1+= dx;
@@ -1076,7 +1108,14 @@ int ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winxi, int winy
                        *pixsize= 1.0f/viewfac;
                }
                else {
-                       viewfac= (((winx >= winy)? winx: winy)*lens)/32.0f;
+                       float size= ((winx >= winy)? winx: winy);
+
+                       if(sensor_fit==CAMERA_SENSOR_FIT_HOR)
+                               size= winx;
+                       else if(sensor_fit==CAMERA_SENSOR_FIT_VERT)
+                               size= winy;
+
+                       viewfac= (size*lens)/sensor;
                        *pixsize= *clipsta/viewfac;
                }
        }
index 7492b6aec44be3d15b722b5899aea3018d6bf8be..1d752fe9c6d9b7f53b26c6b7fea291cc02706289 100644 (file)
@@ -230,7 +230,7 @@ void IMB_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf)
 
        key= BLI_mempool_alloc(cache->keys_pool);
        key->cache_owner= cache;
-       key->userkey= BLI_mempool_alloc(cache->userkeys_pool);;
+       key->userkey= BLI_mempool_alloc(cache->userkeys_pool);
        memcpy(key->userkey, userkey, cache->keysize);
 
        item= BLI_mempool_alloc(cache->items_pool);
index 8ad6821702a582e8ec3ec5f8631d19e8ec27f1bc..292f920da66f4179d06907165ebe2ae28f04600f 100644 (file)
@@ -51,6 +51,7 @@ typedef struct Camera {
        float passepartalpha;
        float clipsta, clipend;
        float lens, ortho_scale, drawsize;
+       float sensor_x, sensor_y;
        float shiftx, shifty;
        
        /* yafray: dof params */
@@ -61,6 +62,9 @@ typedef struct Camera {
        struct Ipo *ipo;                        // XXX depreceated... old animation system
        
        struct Object *dof_ob;
+
+       char sensor_fit;
+       char pad[7];
 } Camera;
 
 /* **************** CAMERA ********************* */
@@ -88,10 +92,18 @@ typedef struct Camera {
 #define CAM_ANGLETOGGLE                32
 #define CAM_DS_EXPAND          64
 #define CAM_PANORAMA           128
+#define CAM_SHOWSENSOR         256
 
 /* yafray: dof sampling switch */
 /* #define CAM_YF_NO_QMC       512 */ /* depreceated */
 
+/* Sensor fit */
+#define CAMERA_SENSOR_FIT_AUTO 0
+#define CAMERA_SENSOR_FIT_HOR  1
+#define CAMERA_SENSOR_FIT_VERT 2
+
+#define DEFAULT_SENSOR_WIDTH   32.0f
+#define DEFAULT_SENSOR_HEIGHT  18.0f
 
 #ifdef __cplusplus
 }
index 3e17d7f494214e0934b98cee24d9b0bac607f2f8..d158f227df5aa2cd946674d1f3cf0a3433925593 100644 (file)
@@ -265,7 +265,9 @@ typedef struct Object {
        ListBase *duplilist;    /* for temporary dupli list storage, only for use by RNA API */
 
        float ima_ofs[2];               /* offset for image empties */
-       char pad3[8];
+
+       short collision_boundtype;      /* bounding box type used for collision */
+       char pad3[6];
 } Object;
 
 /* Warning, this is not used anymore because hooks are now modifiers */
index cf593555bc76902068212f3ccb91c4b4723f20ff..204f7b0b0ecfcb29d5c77f577f484632fd485c39 100644 (file)
@@ -70,6 +70,7 @@ extern StructRNA RNA_ArmatureSensor;
 extern StructRNA RNA_ArrayModifier;
 extern StructRNA RNA_BackgroundImage;
 extern StructRNA RNA_BevelModifier;
+extern StructRNA RNA_SplinePoint;
 extern StructRNA RNA_BezierSplinePoint;
 extern StructRNA RNA_BlendData;
 extern StructRNA RNA_BlendTexture;
index 596e1a7f35779fe8ac2d25bb29551ad92bb26a28..db71dee26ced3d3aa09fe50d0c4181b9acd29c8b 100644 (file)
@@ -109,6 +109,18 @@ static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr)
        }
 }
 
+void rna_Actuator_name_set(PointerRNA *ptr, const char *value)
+{
+       bActuator *act= (bActuator *)ptr->data;
+
+       BLI_strncpy_utf8(act->name, value, sizeof(act->name));
+
+       if (ptr->id.data) {
+               Object *ob= (Object *)ptr->id.data;
+               BLI_uniquename(&ob->actuators, act, "Actuator", '.', offsetof(bActuator, name), sizeof(act->name));
+       }
+}
+
 static void rna_Actuator_type_set(struct PointerRNA *ptr, int value)
 {
        bActuator *act= (bActuator *)ptr->data;
@@ -525,6 +537,7 @@ void rna_def_actuator(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_ui_text(prop, "Name", "");
+       RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Actuator_name_set");
        RNA_def_struct_name_property(srna, prop);
 
        prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
index 9e89c4aaab0a62911116e8793a43763e71da5ea4..1e7a969caaa3a07b02130baef013ed4c5b7f0b5b 100644 (file)
 #ifdef RNA_RUNTIME
 
 #include "BKE_object.h"
+#include "BKE_depsgraph.h"
 
 /* only for rad/deg conversion! can remove later */
+static float get_camera_sensor(Camera *cam)
+{
+       if(cam->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
+               return cam->sensor_x;
+       }
+       else if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) {
+               return cam->sensor_x;
+       }
+       else {
+               return cam->sensor_y;
+       }
+}
+
 static float rna_Camera_angle_get(PointerRNA *ptr)
 {
        Camera *cam= ptr->id.data;
-
-       return lens_to_angle(cam->lens);
+       float sensor= get_camera_sensor(cam);
+       return focallength_to_fov(cam->lens, sensor);
 }
 
 static void rna_Camera_angle_set(PointerRNA *ptr, float value)
 {
        Camera *cam= ptr->id.data;
-       cam->lens= angle_to_lens(value);
+       float sensor= get_camera_sensor(cam);
+       cam->lens= fov_to_focallength(value, sensor);
+}
+
+static float rna_Camera_angle_x_get(PointerRNA *ptr)
+{
+       Camera *cam= ptr->id.data;
+       return focallength_to_fov(cam->lens, cam->sensor_x);
+}
+
+static void rna_Camera_angle_x_set(PointerRNA *ptr, float value)
+{
+       Camera *cam= ptr->id.data;
+       cam->lens= fov_to_focallength(value, cam->sensor_x);
+}
+
+static float rna_Camera_angle_y_get(PointerRNA *ptr)
+{
+       Camera *cam= ptr->id.data;
+       return focallength_to_fov(cam->lens, cam->sensor_y);
+}
+
+static void rna_Camera_angle_y_set(PointerRNA *ptr, float value)
+{
+       Camera *cam= ptr->id.data;
+       cam->lens= fov_to_focallength(value, cam->sensor_y);
+}
+
+static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+       Camera *camera= (Camera*)ptr->id.data;
+
+       DAG_id_tag_update(&camera->id, 0);
 }
 
 #else
@@ -79,6 +125,11 @@ void RNA_def_camera(BlenderRNA *brna)
                {0, "MILLIMETERS", 0, "Millimeters", ""},
                {CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""},
                {0, NULL, 0, NULL, NULL}};
+       static EnumPropertyItem sensor_fit_items[] = {
+               {CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Calculate field of view using sensor size, with direction depending on image resolution"},
+               {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Calculate field of view using sensor width"},
+               {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Calculate field of view using sensor height"},
+               {0, NULL, 0, NULL, NULL}};
 
        srna= RNA_def_struct(brna, "Camera", "ID");
        RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings");
@@ -88,7 +139,7 @@ void RNA_def_camera(BlenderRNA *brna)
        prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, prop_type_items);
        RNA_def_property_ui_text(prop, "Type", "Camera types");
-       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
 
        prop= RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "dtx");
@@ -96,7 +147,13 @@ void RNA_def_camera(BlenderRNA *brna)
        RNA_def_property_flag(prop, PROP_ENUM_FLAG);
        RNA_def_property_ui_text(prop, "Composition Guides",  "Draw overlay");
        RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
-       
+
+       prop= RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "sensor_fit");
+       RNA_def_property_enum_items(prop, sensor_fit_items);
+       RNA_def_property_ui_text(prop, "Sensor Fit", "Mode of calculating field of view from sensor dimensions and focal length");
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
+
        /* Number values */
 
        prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
@@ -104,6 +161,27 @@ void RNA_def_camera(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
        RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
 
+       prop= RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE);
+       RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+       RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view in degrees");
+       RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
+
+       prop= RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE);
+       RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+       RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view in degrees");
+       RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
+
+       prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+       RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
+       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+       RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view in degrees");
+       RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
+
        prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
        RNA_def_property_float_sdna(prop, NULL, "clipsta");
        RNA_def_property_range(prop, 0.001f, FLT_MAX);
@@ -120,20 +198,27 @@ void RNA_def_camera(BlenderRNA *brna)
        RNA_def_property_float_sdna(prop, NULL, "lens");
        RNA_def_property_range(prop, 1.0f, 5000.0f);
        RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters");
-       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
-       
-       prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
-       RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0));
-       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-       RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens field of view in degrees");
-       RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); /* only for deg/rad conversion */
-       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
+
+       prop= RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "sensor_x");
+       RNA_def_property_range(prop, 1.0f, FLT_MAX);
+       RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
+       RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters");
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
+
+       prop= RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "sensor_y");
+       RNA_def_property_range(prop, 1.0f, FLT_MAX);
+       RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
+       RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters");
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
 
        prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
        RNA_def_property_range(prop, 0.01f, 4000.0f);
        RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
-       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
 
        prop= RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
        RNA_def_property_float_sdna(prop, NULL, "drawsize");
@@ -147,14 +232,14 @@ void RNA_def_camera(BlenderRNA *brna)
        RNA_def_property_range(prop, -10.0f, 10.0f);
        RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
        RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift");
-       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
 
        prop= RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "shifty");
        RNA_def_property_range(prop, -10.0f, 10.0f);
        RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3);
        RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift");
-       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update");
 
        prop= RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
        RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
@@ -188,6 +273,11 @@ void RNA_def_camera(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view");
        RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
 
+       prop= RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWSENSOR);
+       RNA_def_property_ui_text(prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view");
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+
        prop= RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
        RNA_def_property_enum_items(prop, prop_lens_unit_items);
index fe899f99ed276aea5a8c12a5031b99bd012a28f7..89239c10ffd4fdab109dc71cd4af4a5485770403 100644 (file)
@@ -75,6 +75,18 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
        }
 }
 
+void rna_Constroller_name_set(PointerRNA *ptr, const char *value)
+{
+       bController *cont= (bController *)ptr->data;
+
+       BLI_strncpy_utf8(cont->name, value, sizeof(cont->name));
+
+       if (ptr->id.data) {
+               Object *ob= (Object *)ptr->id.data;
+               BLI_uniquename(&ob->controllers, cont, "Controller", '.', offsetof(bController, name), sizeof(cont->name));
+       }
+}
+
 static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
 {
        bController *cont= (bController *)ptr->data;
@@ -177,6 +189,7 @@ void RNA_def_controller(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_ui_text(prop, "Name", "");
+       RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constroller_name_set");
        RNA_def_struct_name_property(srna, prop);
        RNA_def_property_update(prop, NC_LOGIC, NULL);
 
index cbac594a80fe5f3342de147d9e555890d70c2a17..93fdc2b21364da9977e6a2642735c67f628506d9 100644 (file)
@@ -268,26 +268,10 @@ static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int
 static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
 {
        Curve *cu= (Curve*)ptr->id.data;
-       ListBase *nurbs= BKE_curve_nurbs(cu);
-       Nurb *nu= nurbs->first;
+       if(value==CU_3D) cu->flag |=  CU_3D;
+       else cu->flag &= ~CU_3D;
 
-       if(value==CU_3D) {
-               cu->flag |=  CU_3D;
-               for( ; nu; nu= nu->next) {
-                       nu->flag &= ~CU_2D;
-               }
-       }
-       else {
-               cu->flag &= ~CU_3D;
-               for( ; nu; nu= nu->next) {
-                       nu->flag |= CU_2D;
-                       test2DNurb(nu);
-
-                       /* since the handles are moved they need to be auto-located again */
-                       if(nu->type == CU_BEZIER)
-                               calchandlesNurb(nu);
-               }
-       }
+       update_curve_dimension(cu);
 }
 
 static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free))
index 92c84da165b86c813e6d8bc9c16681b60070ae7d..076bdfe1964ee2d96792fbfd5f04ade06dae2b57 100644 (file)
@@ -324,7 +324,7 @@ void RNA_def_main(BlenderRNA *brna)
        prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL);
-       RNA_def_property_ui_text(prop, "File is Saved", "Have recent edits been saved to disk");
+       RNA_def_property_ui_text(prop, "File Has Unsaved Changes", "Have recent edits been saved to disk");
 
        prop= RNA_def_property(srna, "is_saved", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
index a0402ed3593598ca6006a7061c96a0a59bce606d..1b80e33b40c7204d730ed31d1fcdf00e276d20c2 100644 (file)
@@ -568,7 +568,6 @@ static int rna_Main_textures_is_updated_get(PointerRNA *ptr) { return DAG_id_typ
 static int rna_Main_brushes_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_BR); }
 static int rna_Main_worlds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_WO); }
 static int rna_Main_groups_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_GR); }
-static int rna_Main_shape_keys_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_KE); }
 static int rna_Main_texts_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_TXT); }
 static int rna_Main_speakers_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SPK); }
 static int rna_Main_sounds_is_updated_get(PointerRNA *ptr) { return DAG_id_type_tagged(ptr->data, ID_SO); }
index 0fa63671951bc41f853e387ab5db619858c0afe9..7e2700629ad37b8bcb213ed0ef6b846861d59056 100644 (file)
@@ -948,10 +948,10 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
                if (ob->type == OB_MESH) {
                        /* this is needed to refresh the derived meshes draw func */
                        DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
-                       WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data);
                }
        }
 
+       WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data);
 }
 
 static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr)
@@ -1532,9 +1532,10 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
        prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS);
        RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default");
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
 
        prop= RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE);
-       RNA_def_property_enum_sdna(prop, NULL, "boundtype");
+       RNA_def_property_enum_sdna(prop, NULL, "collision_boundtype");
        RNA_def_property_enum_items(prop, collision_bounds_items);
        RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf");
        RNA_def_property_ui_text(prop, "Collision Bounds",  "Select the collision type");
@@ -1803,8 +1804,6 @@ static void rna_def_object(BlenderRNA *brna)
                {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"},
                {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"},
                {OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"},
-               {OB_BOUND_TRIANGLE_MESH, "POLYHEDRON", 0, "Polyhedron", "Draw bounds as polyhedron"},
-               {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", "Draw bounds as capsule"},
                {0, NULL, 0, NULL, NULL}};
 
        static EnumPropertyItem dupli_items[] = {
@@ -2226,7 +2225,7 @@ static void rna_def_object(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "use_dupli_frames_speed", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED);
-       RNA_def_property_ui_text(prop, "Dupli Frames Speed", "Set dupliframes to use the frame"); // TODO, better descriptio!
+       RNA_def_property_ui_text(prop, "Dupli Frames Speed", "Set dupliframes to use the current frame instead of parent curve's evaluation time");
        RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
 
        prop= RNA_def_property(srna, "use_dupli_vertices_rotation", PROP_BOOLEAN, PROP_NONE);
index 217b50b38e5f5367ab43767172a624a2881cc1e3..ba58a66a2d6f1deebe08fa40e647784ee6f24079 100644 (file)
@@ -102,6 +102,18 @@ static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr)
        }
 }
 
+void rna_Sensor_name_set(PointerRNA *ptr, const char *value)
+{
+       bSensor *sens= (bSensor *)ptr->data;
+
+       BLI_strncpy_utf8(sens->name, value, sizeof(sens->name));
+
+       if (ptr->id.data) {
+               Object *ob= (Object *)ptr->id.data;
+               BLI_uniquename(&ob->sensors, sens, "Sensor", '.', offsetof(bSensor, name), sizeof(sens->name));
+       }
+}
+
 static void rna_Sensor_type_set(struct PointerRNA *ptr, int value)
 {
        bSensor *sens= (bSensor *)ptr->data;
@@ -260,6 +272,7 @@ static void rna_def_sensor(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_ui_text(prop, "Name", "Sensor name");
+       RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Sensor_name_set");
        RNA_def_struct_name_property(srna, prop);
        RNA_def_property_update(prop, NC_LOGIC, NULL);
 
index 36d773ad605548fc31ef3662b898ff64ebb2b172..d5dd0078a8093a8be3fb97272e468ec4c8ed127a 100644 (file)
@@ -38,6 +38,7 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_object_types.h"
+#include "DNA_scene_types.h"
 
 #include "BLI_math.h"
 #include "BLI_string.h"
@@ -159,7 +160,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
        float scax= umd->scalex ? umd->scalex : 1.0f;
        float scay= umd->scaley ? umd->scaley : 1.0f;
        int free_uci= 0;
-       
+
        aspect = aspx / aspy;
 
        for(i = 0; i < umd->num_projectors; ++i)
@@ -194,16 +195,28 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
                                free_uci= 1;
                        }
                        else {
-                               float scale= (cam->type == CAM_PERSP) ? cam->clipsta * 32.0f / cam->lens : cam->ortho_scale;
+                               float sensor= (cam->sensor_fit == CAMERA_SENSOR_FIT_VERT) ? (cam->sensor_y) : cam->sensor_x;
+                               float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor / cam->lens : cam->ortho_scale;
                                float xmax, xmin, ymax, ymin;
 
-                               if(aspect > 1.0f) {
+                               if(cam->sensor_fit==CAMERA_SENSOR_FIT_AUTO) {
+                                       if(aspect > 1.0f) {
+                                               xmax = 0.5f * scale;
+                                               ymax = xmax / aspect;
+                                       } else {
+                                               ymax = 0.5f * scale;
+                                               xmax = ymax * aspect;
+                                       }
+                               }
+                               else if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) {
                                        xmax = 0.5f * scale;
                                        ymax = xmax / aspect;
-                               } else {
+                               }
+                               else {
                                        ymax = 0.5f * scale;
                                        xmax = ymax * aspect;
                                }
+
                                xmin = -xmax;
                                ymin = -ymax;
 
index d9774453d3eede18712c4eccd0e33855bf40e0ec..b542954948ae83ab4133e8f687382b7457885405 100644 (file)
@@ -35,8 +35,8 @@
 /* **************** ALPHAOVER ******************** */
 static bNodeSocketTemplate cmp_node_alphaover_in[]= {
        {       SOCK_FLOAT, 1, "Fac",                   1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_alphaover_out[]= {
index fe04e69993f4f9870bce05c54e76111efdc0a5c4..166eae9d1bca23bd74dd44f75bf1281087720949 100644 (file)
@@ -33,8 +33,8 @@
 
 /* **************** BILATERALBLUR ******************** */
 static bNodeSocketTemplate cmp_node_bilateralblur_in[]= {
-       { SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.0f}, 
-       { SOCK_RGBA, 1, "Determinator", 0.8f, 0.8f, 0.8f, 1.0f}, 
+       { SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f}, 
+       { SOCK_RGBA, 1, "Determinator", 1.0f, 1.0f, 1.0f, 1.0f}, 
        { -1, 0, "" } 
 };
 
index 2db803859519db4bf624592aa365c78f0799b8aa..188ac653506e972fe0d06d56a01b855889e98894 100644 (file)
@@ -35,7 +35,7 @@
 
 /* **************** BLUR ******************** */
 static bNodeSocketTemplate cmp_node_blur_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "Size",                  1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
        {       -1, 0, ""       }
 };
index 95099e7adfb7e1c955d6dd92d7a720960e628d67..9153e3899fccb7ee6c8f66ce1de5c73aad6f6249 100644 (file)
@@ -37,7 +37,7 @@
 /* **************** Brigh and contrsast  ******************** */
 
 static bNodeSocketTemplate cmp_node_brightcontrast_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "Bright",                0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE},
        {       SOCK_FLOAT, 1, "Contrast",              0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE},
        {       -1, 0, ""       }
index dbdfc6712dc61598b3697e49e0f765a4239926eb..10f0afb6cf693165cf6440ecce5aa5d3777b0c4c 100644 (file)
@@ -35,7 +35,7 @@
 
 /* ******************* Channel Matte Node ********************************* */
 static bNodeSocketTemplate cmp_node_channel_matte_in[]={
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
        {-1,0,""}
 };
 
index 71bb7c35d017f8c9796d26abfcfad84e086ed3e1..25891aeaa687845e0f776e0dd63468f12887999c 100644 (file)
@@ -34,8 +34,8 @@
 
 /* ******************* Chroma Key ********************************************************** */
 static bNodeSocketTemplate cmp_node_chroma_in[]={
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
-       {SOCK_RGBA,1,"Key Color", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
+       {SOCK_RGBA,1,"Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
        {-1,0,""}
 };
 
index a82d8cf1f41bfc45efd8ff2b7e54dd5fdb79e2ab..3dfc3a193a8c95312ab91beba35cbdead00696de 100644 (file)
@@ -34,8 +34,8 @@
 
 /* ******************* Color Key ********************************************************** */
 static bNodeSocketTemplate cmp_node_color_in[]={
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
-       {SOCK_RGBA,1,"Key Color", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
+       {SOCK_RGBA,1,"Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
        {-1,0,""}
 };
 
index 6b833d44f72afc635d68886f841d528590905311..c85a81b9bdbdc291ee80dfa57903270e7ae91bbb 100644 (file)
@@ -37,7 +37,7 @@
 
 /* ******************* Color Spill Supression ********************************* */
 static bNodeSocketTemplate cmp_node_color_spill_in[]={
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
        {SOCK_FLOAT, 1, "Fac",  1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
        {-1,0,""}
 };
index e9176db4c0d062f6d823069f1c69319204cb2e48..eb75802c0a649b0c15b342b8e39f1c2518dbb775 100644 (file)
@@ -37,7 +37,7 @@
 /* ******************* Color Balance ********************************* */
 static bNodeSocketTemplate cmp_node_colorbalance_in[]={
        {SOCK_FLOAT, 1, "Fac",  1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
        {-1,0,""}
 };
 
index c20593726cc707baef56fb90ae4f8958c696e651..7847726c68ea6265b5a372fda387bbc05b11674b 100644 (file)
@@ -35,7 +35,7 @@
 /* **************** Crop  ******************** */
 
 static bNodeSocketTemplate cmp_node_crop_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_crop_out[]= {
index c796a01f5a8bb64d6b17b099e33e0341a532c151..675710942fbfccdade6f2be2643726253a18a425 100644 (file)
@@ -121,7 +121,7 @@ void register_node_type_cmp_curve_vec(ListBase *lb)
 /* **************** CURVE RGB  ******************** */
 static bNodeSocketTemplate cmp_node_curve_rgb_in[]= {
        {       SOCK_FLOAT, 1, "Fac",   1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_FACTOR},
-       {       SOCK_RGBA, 1, "Image",  0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_RGBA, 1, "Black Level",    0.0f, 0.0f, 0.0f, 1.0f},
        {       SOCK_RGBA, 1, "White Level",    1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
index 72a9897188c01d79b9b1d4398b4bbbfcb5c2d408..2232c4a489e17bf049fe84e4c58c995d831685c4 100644 (file)
@@ -34,8 +34,8 @@
 
 /* ************ qdn: Defocus node ****************** */
 static bNodeSocketTemplate cmp_node_defocus_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
-       {       SOCK_FLOAT, 1, "Z",                     0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
+       {       SOCK_FLOAT, 1, "Z",                     1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_defocus_out[]= {
index 8b1647414dab51c1cb8486434dd5e36791a75b1a..c621d5240446e1ff200d0a8ac4008ebe44c67b75 100644 (file)
@@ -34,8 +34,8 @@
 
 /* ******************* channel Difference Matte ********************************* */
 static bNodeSocketTemplate cmp_node_diff_matte_in[]={
-       {SOCK_RGBA,1,"Image 1", 0.8f, 0.8f, 0.8f, 1.0f},
-       {SOCK_RGBA,1,"Image 2", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image 1", 1.0f, 1.0f, 1.0f, 1.0f},
+       {SOCK_RGBA,1,"Image 2", 1.0f, 1.0f, 1.0f, 1.0f},
        {-1,0,""}
 };
 
index c77dc16bbf37a399b47bf50b9be596e13024345a..591870d0911f21595cd7d18044bf237bc488fbc6 100644 (file)
@@ -33,7 +33,7 @@
 #include "node_composite_util.h"
 
 static bNodeSocketTemplate cmp_node_dblur_in[]= {
-       {       SOCK_RGBA, 1, "Image", 0.8f, 0.8f, 0.8f, 1.f},
+       {       SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.f},
        {       -1, 0, ""       }
 };
 
index 8242acb6d496221bc851395c66947585bb18ce5a..02a1d203bef24277d7005735e2d9c4ae0b71cfda 100644 (file)
@@ -36,7 +36,7 @@
 /* **************** Displace  ******************** */
 
 static bNodeSocketTemplate cmp_node_displace_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_VECTOR, 1, "Vector",                       1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_TRANSLATION},
        {       SOCK_FLOAT, 1, "X Scale",                               0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR},
        {       SOCK_FLOAT, 1, "Y Scale",                               0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR},
index c4c6abbd718ca27f9c12ee2a4c65d84deeda11d5..401b143aac309cb8c2c34ca0cf43e8191baf9f08 100644 (file)
@@ -34,8 +34,8 @@
 
 /* ******************* channel Distance Matte ********************************* */
 static bNodeSocketTemplate cmp_node_distance_matte_in[]={
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
-       {SOCK_RGBA,1,"Key Color", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
+       {SOCK_RGBA,1,"Key Color", 1.0f, 1.0f, 1.0f, 1.0f},
        {-1,0,""}
 };
 
index 717942a0ec91e261d63c42955f7a56cf697f2b65..071ee84377c848301945ec0267e57616280794a5 100644 (file)
@@ -34,8 +34,8 @@
 
 /* **************** FILTER  ******************** */
 static bNodeSocketTemplate cmp_node_filter_in[]= {
-       {       SOCK_FLOAT, 1, "Fac",                   1.0f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_FLOAT, 1, "Fac",                   1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_filter_out[]= {
index ba1b72a1fb41e669d6e4190849865e12712d8848..01f58182227d43c85ebd45143833fbb8980fe630 100644 (file)
@@ -34,7 +34,7 @@
 
 /* **************** Flip  ******************** */
 static bNodeSocketTemplate cmp_node_flip_in[]= {
-       {       SOCK_RGBA, 1, "Image",              0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",              1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 
index 1f8f934b1ba7e5ba65e6b83554ceee92a78c8a19..2bb600db99de18aceb10f5fe793278bf1f9f4ff6 100644 (file)
@@ -36,7 +36,7 @@
 /* **************** Gamma Tools  ******************** */
   
 static bNodeSocketTemplate cmp_node_gamma_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "Gamma",                 1.0f, 0.0f, 0.0f, 0.0f, 0.001f, 10.0f, PROP_UNSIGNED},
        {       -1, 0, ""       }
 };
index 8660a4d612f3b23992a34f2a6414de8fc8edaa71..f4391a1af773fa594fa1b96bb03b88f5931d2131 100644 (file)
@@ -33,7 +33,7 @@
 #include "node_composite_util.h"
 
 static bNodeSocketTemplate cmp_node_glare_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_glare_out[]= {
index a1c17abfdf62278d0a405bfad22a880698379151..c2304b37c0db4411291b840ddb82e157a4c1e112 100644 (file)
@@ -36,7 +36,7 @@
 /* **************** Hue Saturation ******************** */
 static bNodeSocketTemplate cmp_node_hue_sat_in[]= {
        {       SOCK_FLOAT, 1, "Fac",                   1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_hue_sat_out[]= {
index 6b9196d58dc48ae91277ce1094c2813f1abe6711..f18eca3dfcc637cfbbf3699714e2f724837f53ac 100644 (file)
@@ -34,7 +34,7 @@
 
 static bNodeSocketTemplate cmp_node_huecorrect_in[]= {
        {       SOCK_FLOAT, 1, "Fac",   1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
-       {       SOCK_RGBA, 1, "Image",  0.0f, 0.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 
index cf21efb000e031897b37e869d0cf02d58e0ca4ae..914483bc52fe794113ff0681cbbd6cda1f2cc017 100644 (file)
@@ -36,7 +36,7 @@
 /* **************** ID Mask  ******************** */
 
 static bNodeSocketTemplate cmp_node_idmask_in[]= {
-       {       SOCK_FLOAT, 1, "ID value",                      0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE},
+       {       SOCK_FLOAT, 1, "ID value",                      1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_idmask_out[]= {
index 25ac24cf185a91fa219d9c77e32ecf26bda111c7..c428e37bd35f756e9657f10d9d539a89face1e96 100644 (file)
@@ -34,7 +34,7 @@
 /* **************** INVERT ******************** */
 static bNodeSocketTemplate cmp_node_invert_in[]= { 
        { SOCK_FLOAT, 1, "Fac", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, 
-       { SOCK_RGBA, 1, "Color", 0.0f, 0.0f, 0.0f, 1.0f}, 
+       { SOCK_RGBA, 1, "Color", 1.0f, 1.0f, 1.0f, 1.0f}, 
        { -1, 0, "" } 
 };
 
index 4d2794d844d18dedaa362de77d0cd292eeea2a95..e57f405ed6804788ebe5d76aa60085a68f91adac 100644 (file)
@@ -33,7 +33,7 @@
 #include "node_composite_util.h"
 
 static bNodeSocketTemplate cmp_node_lensdist_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "Distort",       0.f, 0.f, 0.f, 0.f, -0.999f, 1.f, PROP_NONE},
        {       SOCK_FLOAT, 1, "Dispersion", 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, PROP_NONE},
        {       -1, 0, ""       }
index 8c37b3dd90f7235c56f9a839258db9f46a051ed3..8573849b069a74583016b01939f15e21242003c8 100644 (file)
@@ -35,7 +35,7 @@
 
 /* ******************* Luma Matte Node ********************************* */
 static bNodeSocketTemplate cmp_node_luma_matte_in[]={
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_RGBA,1,"Image", 1.0f, 1.0f, 1.0f, 1.0f},
        {-1,0,""}
 };
 
index f4daf49f55db238ddfe6f244c0d185bec6e71749..5dc6d1c3aaa4d060f26e9f52b203c7189d993a9a 100644 (file)
@@ -35,7 +35,7 @@
 /* **************** Map UV  ******************** */
 
 static bNodeSocketTemplate cmp_node_mapuv_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_VECTOR, 1, "UV",                   1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE},
        {       -1, 0, ""       }
 };
index 30eb0b8640bb473821e4001ac5f6b73258ac3c3b..81e963d4790bf6cc345688078c407665a7b105c1 100644 (file)
@@ -34,7 +34,7 @@
 
 /* **************** MAP VALUE ******************** */
 static bNodeSocketTemplate cmp_node_map_value_in[]= {
-       {       SOCK_FLOAT, 1, "Value",                 1.0f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE},
+       {       SOCK_FLOAT, 1, "Value",                 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_map_value_out[]= {
index a119a0b7de37ff36bf69d33127e71352a4d75dec..36206d82d0bbbd6ea23a864271f8147acc269b76 100644 (file)
@@ -35,7 +35,7 @@
 
 /* **************** NORMALIZE single channel, useful for Z buffer ******************** */
 static bNodeSocketTemplate cmp_node_normalize_in[]= {
-       {   SOCK_FLOAT, 1, "Value",         1.0f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE},
+       {   SOCK_FLOAT, 1, "Value",         1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
        {   -1, 0, ""   }
 };
 static bNodeSocketTemplate cmp_node_normalize_out[]= {
index 7ce2f80e58050c71332185074f83e799cc68168e..b188b0dd32379830f01ca8ccfe165bea5605e472 100644 (file)
@@ -36,7 +36,7 @@
 /* **************** Premul and Key Alpha Convert ******************** */
 
 static bNodeSocketTemplate cmp_node_premulkey_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_premulkey_out[]= {
index e86de3c7839f2e2469a03ba8cac0dc0fc8b31e34..a7c820ddce6b3a9f92a371989cba27df99b06c3c 100644 (file)
@@ -35,7 +35,7 @@
 
 /* **************** RGB ******************** */
 static bNodeSocketTemplate cmp_node_rgb_out[]= {
-       {       SOCK_RGBA, 0, "RGBA",                   0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 0, "RGBA",                   0.5f, 0.5f, 0.5f, 1.0f},
        {       -1, 0, ""       }
 };
 
index 74ab33eb093b720be33145b11d3d7af60f71b340..96712baf8b0629ef83a09d10c5ac97464ed32459 100644 (file)
@@ -35,7 +35,7 @@
 /* **************** Rotate  ******************** */
 
 static bNodeSocketTemplate cmp_node_rotate_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "Degr",                  0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_ANGLE},
        {       -1, 0, ""       }
 };
@@ -60,6 +60,7 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac
 
                rad= (M_PI*in[1]->vec[0])/180.0f;
 
+
                s= sin(rad);
                c= cos(rad);
                centx= cbuf->x/2;
index 48631a18dcb272e3104e8d43dcefe1a5a3db264f..5eb789ae0c92a2b8c00dcb7935151efe38ae1ddb 100644 (file)
@@ -37,7 +37,7 @@
 #define CMP_SCALE_MAX  12000
 
 static bNodeSocketTemplate cmp_node_scale_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "X",                             1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX, PROP_FACTOR},
        {       SOCK_FLOAT, 1, "Y",                             1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX, PROP_FACTOR},
        {       -1, 0, ""       }
index 4a5036a6a7f624f1ab2a8fd95193dc30e0eaff4d..bf58d443aecac84ae807a59f4e0301770267833d 100644 (file)
@@ -35,7 +35,7 @@
 
 /* **************** SEPARATE HSVA ******************** */
 static bNodeSocketTemplate cmp_node_sephsva_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_sephsva_out[]= {
index 143c67d099acbd2c8f014744235217b9a3f80159..ade2b22bf35f1f0115185ba0050b4da529415bdc 100644 (file)
@@ -34,7 +34,7 @@
 
 /* **************** SEPARATE RGBA ******************** */
 static bNodeSocketTemplate cmp_node_seprgba_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_seprgba_out[]= {
index 502d19991019ef9088af28c35180936f2f7e3933..3b3d57bf442bd02e1d5e2d20ee62c92468b8c010 100644 (file)
@@ -35,7 +35,7 @@
 
 /* **************** SEPARATE YCCA ******************** */
 static bNodeSocketTemplate cmp_node_sepycca_in[]= {
-       {  SOCK_RGBA, 1, "Image",        0.8f, 0.8f, 0.8f, 1.0f},
+       {  SOCK_RGBA, 1, "Image",        1.0f, 1.0f, 1.0f, 1.0f},
        {  -1, 0, ""   }
 };
 static bNodeSocketTemplate cmp_node_sepycca_out[]= {
index 5a766df29ed153ba6ee1a5e5f0c6d29d2e47663d..aedb5652e61c87f67684108773613563e139337c 100644 (file)
@@ -35,7 +35,7 @@
 
 /* **************** SEPARATE YUVA ******************** */
 static bNodeSocketTemplate cmp_node_sepyuva_in[]= {
-       {  SOCK_RGBA, 1, "Image",        0.8f, 0.8f, 0.8f, 1.0f},
+       {  SOCK_RGBA, 1, "Image",        1.0f, 1.0f, 1.0f, 1.0f},
        {  -1, 0, ""   }
 };
 static bNodeSocketTemplate cmp_node_sepyuva_out[]= {
index c243c104774704fe8a48c26b7fe68818e5b8194b..36e583a77ff3d694ef90d95a480b6efbdca61646 100644 (file)
@@ -33,7 +33,7 @@
 #include "node_composite_util.h"
 
 static bNodeSocketTemplate cmp_node_tonemap_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_tonemap_out[]= {
index 1865d6fc3d48d772f50b43160c39f7ff3f5ef076..2b25ef92a1e0e61045b9549f7668c9657bdcc511 100644 (file)
@@ -36,7 +36,7 @@
 /* **************** Translate  ******************** */
 
 static bNodeSocketTemplate cmp_node_translate_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "X",     0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE},
        {       SOCK_FLOAT, 1, "Y",     0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE},
        {       -1, 0, ""       }
index cdf56c230d81e8a47048da467a0d9b8fb25d7e78..a0fbcec198ad504dcf65f1c5a245c0d73f639d15 100644 (file)
@@ -35,7 +35,7 @@
 
 /* **************** VECTOR BLUR ******************** */
 static bNodeSocketTemplate cmp_node_vecblur_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, "Z",                     0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE},
        {       SOCK_VECTOR, 1, "Speed",                        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_VELOCITY},
        {       -1, 0, ""       }
index 46a66957eacd2fa20443d969650b2b444aa9fd9d..7aac35399607aefb5007f5fe5f75bc76202ab2d4 100644 (file)
 /* **************** Z COMBINE ******************** */
        /* lazy coder note: node->custom2 is abused to send signal */
 static bNodeSocketTemplate cmp_node_zcombine_in[]= {
-       {       SOCK_RGBA, 1, "Image",          0.8f, 0.8f, 0.8f, 1.0f},
-       {       SOCK_FLOAT, 1, "Z",                     0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 10000.0f, PROP_NONE},
-       {       SOCK_RGBA, 1, "Image",          0.8f, 0.8f, 0.8f, 1.0f},
-       {       SOCK_FLOAT, 1, "Z",                     0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 10000.0f, PROP_NONE},
+       {       SOCK_RGBA, 1, "Image",          1.0f, 1.0f, 1.0f, 1.0f},
+       {       SOCK_FLOAT, 1, "Z",                     1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 10000.0f, PROP_NONE},
+       {       SOCK_RGBA, 1, "Image",          1.0f, 1.0f, 1.0f, 1.0f},
+       {       SOCK_FLOAT, 1, "Z",                     1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 10000.0f, PROP_NONE},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_zcombine_out[]= {
index be8fe64c753551d79055d177359324594a46dbdd..88fbdc99f821312d1344de8bb965feba0fd9bdcc 100644 (file)
@@ -140,6 +140,7 @@ void register_node_type_sh_geom(ListBase *lb)
 
        node_type_base(&ntype, SH_NODE_GEOM, "Geometry", NODE_CLASS_INPUT, NODE_OPTIONS);
        node_type_compatibility(&ntype, NODE_OLD_SHADING);
+       node_type_compatibility(&ntype, NODE_OLD_SHADING);
        node_type_socket_templates(&ntype, NULL, sh_node_geom_out);
        node_type_size(&ntype, 120, 80, 160);
        node_type_init(&ntype, node_shader_init_geometry);
index d8ddcd593a8a64fd0cd9482fe4466ccacc591837..29e0185c2f242cb37d0332a9090d31e9c24cee2d 100644 (file)
@@ -71,7 +71,7 @@ void  BPY_text_free_code(struct Text *text);
 void   BPY_modules_update(struct bContext *C); // XXX - annoying, need this for pointers that get out of date
 void   BPY_modules_load_user(struct bContext *C);
 
-void   BPY_app_handlers_reset(void);
+void   BPY_app_handlers_reset(const short do_all);
 
 void   BPY_driver_reset(void);
 float  BPY_driver_exec(struct ChannelDriver *driver);
index 076b4811d07c34422378abad77c0a0da7c2bd574..6d869a7eb1ff087d5dc112ca662037d96c6510ed 100644 (file)
@@ -195,19 +195,22 @@ static PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *UNUSED(closure)
 
 static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *UNUSED(closure))
 {
-       char *st;
+       const char *name;
+       Py_ssize_t name_size;
+
        if (!PyUnicode_Check(value)) {
                PyErr_SetString(PyExc_TypeError, "expected a string!");
                return -1;
        }
 
-       st = _PyUnicode_AsSt