Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt214
-rw-r--r--GNUmakefile2
-rw-r--r--SConstruct16
-rw-r--r--build_files/buildbot/config/user-config-i686.py7
-rw-r--r--build_files/buildbot/config/user-config-player-i686.py7
-rw-r--r--build_files/buildbot/config/user-config-player-x86_64.py7
-rw-r--r--build_files/buildbot/config/user-config-x86_64.py7
-rw-r--r--build_files/buildbot/master_unpack.py4
-rw-r--r--build_files/cmake/Modules/FindPythonLibsUnix.cmake108
-rw-r--r--build_files/cmake/Modules/FindSamplerate.cmake70
-rw-r--r--build_files/cmake/cmake_static_check_cppcheck.py25
-rw-r--r--build_files/cmake/cmake_static_check_sparse.py14
-rw-r--r--build_files/cmake/cmake_static_check_splint.py16
-rw-r--r--build_files/cmake/config/blender_headless.cmake1
-rw-r--r--build_files/cmake/config/blender_lite.cmake1
-rw-r--r--build_files/cmake/config/bpy_module.cmake1
-rw-r--r--build_files/cmake/macros.cmake72
-rw-r--r--build_files/cmake/project_source_info.py46
-rw-r--r--build_files/package_spec/debian/control2
-rw-r--r--build_files/package_spec/pacman/PKGBUILD15
-rw-r--r--build_files/scons/config/darwin-config.py12
-rw-r--r--build_files/scons/config/freebsd7-config.py5
-rw-r--r--build_files/scons/config/freebsd8-config.py5
-rw-r--r--build_files/scons/config/freebsd9-config.py5
-rw-r--r--build_files/scons/config/irix6-config.py208
-rw-r--r--build_files/scons/config/linux-config.py7
-rw-r--r--build_files/scons/config/linuxcross-config.py5
-rw-r--r--build_files/scons/config/openbsd3-config.py5
-rw-r--r--build_files/scons/config/sunos5-config.py5
-rw-r--r--build_files/scons/config/win32-mingw-config.py5
-rw-r--r--build_files/scons/config/win32-vc-config.py7
-rw-r--r--build_files/scons/config/win64-vc-config.py9
-rw-r--r--build_files/scons/tools/Blender.py44
-rw-r--r--build_files/scons/tools/btools.py8
-rw-r--r--doc/build_systems/cmake.txt51
-rw-r--r--doc/manpage/blender.14
-rw-r--r--doc/python_api/examples/aud.py6
-rw-r--r--doc/python_api/rst/change_log.rst571
-rw-r--r--doc/python_api/sphinx_changelog_gen.py5
-rw-r--r--doc/python_api/sphinx_doc_gen.py26
-rw-r--r--extern/recastnavigation/CMakeLists.txt9
-rw-r--r--extern/recastnavigation/Recast/Include/Recast.h1297
-rw-r--r--extern/recastnavigation/Recast/Include/RecastAlloc.h122
-rw-r--r--extern/recastnavigation/Recast/Include/RecastAssert.h33
-rw-r--r--extern/recastnavigation/Recast/Source/Recast.cpp335
-rw-r--r--extern/recastnavigation/Recast/Source/RecastAlloc.cpp88
-rw-r--r--extern/recastnavigation/Recast/Source/RecastArea.cpp524
-rw-r--r--extern/recastnavigation/Recast/Source/RecastContour.cpp399
-rw-r--r--extern/recastnavigation/Recast/Source/RecastFilter.cpp250
-rw-r--r--extern/recastnavigation/Recast/Source/RecastLayers.cpp620
-rw-r--r--extern/recastnavigation/Recast/Source/RecastMesh.cpp679
-rw-r--r--extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp1068
-rw-r--r--extern/recastnavigation/Recast/Source/RecastRasterization.cpp167
-rw-r--r--extern/recastnavigation/Recast/Source/RecastRegion.cpp730
-rw-r--r--extern/recastnavigation/recast-capi.cpp362
-rw-r--r--extern/recastnavigation/recast-capi.h98
-rw-r--r--intern/audaspace/CMakeLists.txt17
-rw-r--r--intern/audaspace/Python/AUD_PyAPI.cpp22
-rw-r--r--intern/audaspace/SConscript7
-rw-r--r--intern/audaspace/intern/AUD_C-API.cpp17
-rw-r--r--intern/audaspace/intern/AUD_SequencerReader.cpp10
-rw-r--r--intern/container/CTR_List.h20
-rw-r--r--intern/container/CTR_Map.h248
-rw-r--r--intern/elbeem/intern/loop_tools.h4
-rw-r--r--intern/elbeem/intern/ntl_world.cpp1
-rw-r--r--intern/ffmpeg/ffmpeg_compat.h9
-rw-r--r--intern/ghost/CMakeLists.txt7
-rw-r--r--intern/ghost/GHOST_Types.h16
-rw-r--r--intern/ghost/SConscript18
-rw-r--r--intern/ghost/intern/GHOST_Buttons.h54
-rw-r--r--intern/ghost/intern/GHOST_DropTargetWin32.h2
-rw-r--r--intern/ghost/intern/GHOST_EventManager.h6
-rw-r--r--intern/ghost/intern/GHOST_ModifierKeys.h76
-rw-r--r--intern/ghost/intern/GHOST_System.h2
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.cpp122
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.h140
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.h122
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCarbon.h24
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCocoa.h18
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp72
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h4
-rw-r--r--intern/ghost/intern/GHOST_TaskbarWin32.h38
-rw-r--r--intern/ghost/intern/GHOST_Window.h10
-rw-r--r--intern/ghost/intern/GHOST_WindowCarbon.h66
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.h8
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.mm4
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp4
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp6
-rw-r--r--intern/ghost/test/gears/GHOST_C-Test.c80
-rw-r--r--intern/guardedalloc/MEM_sys_types.h15
-rw-r--r--intern/guardedalloc/intern/mallocn.c17
-rw-r--r--intern/mikktspace/mikktspace.c98
-rw-r--r--intern/opennl/superlu/superlu_sys_types.h18
-rw-r--r--intern/smoke/intern/MERSENNETWISTER.h2
-rw-r--r--intern/string/STR_HashedString.h2
-rw-r--r--intern/string/STR_String.h10
-rw-r--r--po/POTFILES.in21
-rw-r--r--po/README.txt81
-rwxr-xr-xpo/check_po.py93
-rwxr-xr-xpo/clean_po.py190
-rwxr-xr-xpo/merge_po.py167
-rw-r--r--po/messages.txt5433
-rwxr-xr-xpo/update_mo.py46
-rw-r--r--po/update_msg.py340
-rwxr-xr-xpo/update_po.py48
-rwxr-xr-xpo/update_pot.py33
-rw-r--r--release/bin/.blender/.Blanguages24
-rw-r--r--release/bin/.blender/fonts/droidsans.ttf.gzbin1961584 -> 2263650 bytes
-rw-r--r--release/irix-6.2-mips/extra/blender.iconbin638 -> 0 bytes
-rwxr-xr-xrelease/irix-6.2-mips/specific.sh34
-rw-r--r--release/scripts/modules/addon_utils.py1
-rw-r--r--release/scripts/modules/animsys_refactor.py668
-rw-r--r--release/scripts/modules/bpy/ops.py9
-rw-r--r--release/scripts/modules/bpy/path.py9
-rw-r--r--release/scripts/modules/bpy_extras/__init__.py2
-rw-r--r--release/scripts/modules/bpy_extras/anim_utils.py247
-rw-r--r--release/scripts/modules/bpy_extras/io_utils.py13
-rw-r--r--release/scripts/modules/bpy_extras/keyconfig_utils.py305
-rw-r--r--release/scripts/startup/bl_operators/__init__.py5
-rw-r--r--release/scripts/startup/bl_operators/anim.py274
-rw-r--r--release/scripts/startup/bl_operators/animsys_update.py699
-rw-r--r--release/scripts/startup/bl_operators/console.py109
-rw-r--r--release/scripts/startup/bl_operators/image.py15
-rw-r--r--release/scripts/startup/bl_operators/mesh.py2
-rw-r--r--release/scripts/startup/bl_operators/nla.py306
-rw-r--r--release/scripts/startup/bl_operators/object_align.py4
-rw-r--r--release/scripts/startup/bl_operators/object_quick_effects.py4
-rw-r--r--release/scripts/startup/bl_operators/screen_play_rendered_anim.py8
-rw-r--r--release/scripts/startup/bl_operators/sequencer.py6
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_smart_project.py3
-rw-r--r--release/scripts/startup/bl_operators/view3d.py88
-rw-r--r--release/scripts/startup/bl_operators/wm.py596
-rw-r--r--release/scripts/startup/bl_ui/__init__.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_animviz.py36
-rw-r--r--release/scripts/startup/bl_ui/properties_data_armature.py60
-rw-r--r--release/scripts/startup/bl_ui/properties_data_bone.py86
-rw-r--r--release/scripts/startup/bl_ui/properties_data_camera.py26
-rw-r--r--release/scripts/startup/bl_ui/properties_data_curve.py108
-rw-r--r--release/scripts/startup/bl_ui/properties_data_empty.py12
-rw-r--r--release/scripts/startup/bl_ui/properties_data_lamp.py110
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py32
-rw-r--r--release/scripts/startup/bl_ui/properties_data_metaball.py32
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py240
-rw-r--r--release/scripts/startup/bl_ui/properties_game.py148
-rw-r--r--release/scripts/startup/bl_ui/properties_material.py161
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py98
-rw-r--r--release/scripts/startup/bl_ui/properties_object_constraint.py222
-rw-r--r--release/scripts/startup/bl_ui/properties_particle.py250
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_cloth.py59
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py62
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_field.py61
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py98
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_smoke.py43
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_softbody.py57
-rw-r--r--release/scripts/startup/bl_ui/properties_render.py145
-rw-r--r--release/scripts/startup/bl_ui/properties_scene.py145
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py267
-rw-r--r--release/scripts/startup/bl_ui/properties_world.py29
-rw-r--r--release/scripts/startup/bl_ui/space_console.py88
-rw-r--r--release/scripts/startup/bl_ui/space_dopesheet.py59
-rw-r--r--release/scripts/startup/bl_ui/space_graph.py57
-rw-r--r--release/scripts/startup/bl_ui/space_image.py88
-rw-r--r--release/scripts/startup/bl_ui/space_info.py165
-rw-r--r--release/scripts/startup/bl_ui/space_logic.py9
-rw-r--r--release/scripts/startup/bl_ui/space_nla.py41
-rw-r--r--release/scripts/startup/bl_ui/space_node.py17
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py202
-rw-r--r--release/scripts/startup/bl_ui/space_text.py25
-rw-r--r--release/scripts/startup/bl_ui/space_time.py23
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py574
-rw-r--r--release/scripts/startup/bl_ui/space_userpref_keymap.py559
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py642
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py47
-rw-r--r--release/scripts/startup/keyingsets_builtins.py16
-rw-r--r--release/text/readme.html16
-rw-r--r--source/blender/avi/intern/avirgb.c6
-rw-r--r--source/blender/avi/intern/options.c6
-rw-r--r--source/blender/blenfont/BLF_api.h2
-rw-r--r--source/blender/blenfont/BLF_translation.h2
-rw-r--r--source/blender/blenfont/CMakeLists.txt4
-rw-r--r--source/blender/blenfont/SConscript2
-rw-r--r--source/blender/blenfont/intern/blf.c68
-rw-r--r--source/blender/blenfont/intern/blf_font.c3
-rw-r--r--source/blender/blenfont/intern/blf_lang.c17
-rw-r--r--source/blender/blenfont/intern/blf_translation.c6
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h2
-rw-r--r--source/blender/blenkernel/BKE_action.h2
-rw-r--r--source/blender/blenkernel/BKE_anim.h2
-rw-r--r--source/blender/blenkernel/BKE_animsys.h2
-rw-r--r--source/blender/blenkernel/BKE_armature.h2
-rw-r--r--source/blender/blenkernel/BKE_blender.h4
-rw-r--r--source/blender/blenkernel/BKE_bullet.h1
-rw-r--r--source/blender/blenkernel/BKE_cdderivedmesh.h54
-rw-r--r--source/blender/blenkernel/BKE_colortools.h2
-rw-r--r--source/blender/blenkernel/BKE_customdata.h54
-rw-r--r--source/blender/blenkernel/BKE_displist.h2
-rw-r--r--source/blender/blenkernel/BKE_fcurve.h2
-rw-r--r--source/blender/blenkernel/BKE_font.h5
-rw-r--r--source/blender/blenkernel/BKE_icons.h55
-rw-r--r--source/blender/blenkernel/BKE_material.h1
-rw-r--r--source/blender/blenkernel/BKE_mesh.h6
-rw-r--r--source/blender/blenkernel/BKE_navmesh_conversion.h56
-rw-r--r--source/blender/blenkernel/BKE_nla.h2
-rw-r--r--source/blender/blenkernel/BKE_object.h5
-rw-r--r--source/blender/blenkernel/BKE_packedFile.h2
-rw-r--r--source/blender/blenkernel/BKE_paint.h2
-rw-r--r--source/blender/blenkernel/BKE_particle.h4
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h53
-rw-r--r--source/blender/blenkernel/BKE_shrinkwrap.h2
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h3
-rw-r--r--source/blender/blenkernel/BKE_suggestions.h2
-rw-r--r--source/blender/blenkernel/BKE_unit.h1
-rw-r--r--source/blender/blenkernel/BKE_writeffmpeg.h2
-rw-r--r--source/blender/blenkernel/BKE_writeframeserver.h2
-rw-r--r--source/blender/blenkernel/CMakeLists.txt11
-rw-r--r--source/blender/blenkernel/intern/BME_conversions.c14
-rw-r--r--source/blender/blenkernel/intern/BME_structure.c8
-rw-r--r--source/blender/blenkernel/intern/BME_tools.c38
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c3
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.h3
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c204
-rw-r--r--source/blender/blenkernel/intern/action.c4
-rw-r--r--source/blender/blenkernel/intern/anim.c6
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c5
-rw-r--r--source/blender/blenkernel/intern/armature.c2
-rw-r--r--source/blender/blenkernel/intern/blender.c9
-rw-r--r--source/blender/blenkernel/intern/bmfont.c6
-rw-r--r--source/blender/blenkernel/intern/boids.c7
-rw-r--r--source/blender/blenkernel/intern/bullet.c3
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c1
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c89
-rw-r--r--source/blender/blenkernel/intern/cloth.c4
-rw-r--r--source/blender/blenkernel/intern/collision.c9
-rw-r--r--source/blender/blenkernel/intern/colortools.c78
-rw-r--r--source/blender/blenkernel/intern/constraint.c5
-rw-r--r--source/blender/blenkernel/intern/curve.c178
-rw-r--r--source/blender/blenkernel/intern/customdata.c68
-rw-r--r--source/blender/blenkernel/intern/deform.c9
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c14
-rw-r--r--source/blender/blenkernel/intern/displist.c9
-rw-r--r--source/blender/blenkernel/intern/effect.c4
-rw-r--r--source/blender/blenkernel/intern/fcurve.c15
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c2
-rw-r--r--source/blender/blenkernel/intern/font.c32
-rw-r--r--source/blender/blenkernel/intern/gpencil.c4
-rw-r--r--source/blender/blenkernel/intern/icons.c56
-rw-r--r--source/blender/blenkernel/intern/idcode.c3
-rw-r--r--source/blender/blenkernel/intern/image.c24
-rw-r--r--source/blender/blenkernel/intern/image_gen.c3
-rw-r--r--source/blender/blenkernel/intern/implicit.c14
-rw-r--r--source/blender/blenkernel/intern/ipo.c8
-rw-r--r--source/blender/blenkernel/intern/key.c13
-rw-r--r--source/blender/blenkernel/intern/lattice.c3
-rw-r--r--source/blender/blenkernel/intern/library.c4
-rw-r--r--source/blender/blenkernel/intern/material.c58
-rw-r--r--source/blender/blenkernel/intern/mball.c16
-rw-r--r--source/blender/blenkernel/intern/mesh.c22
-rw-r--r--source/blender/blenkernel/intern/modifier.c68
-rw-r--r--source/blender/blenkernel/intern/multires.c4
-rw-r--r--source/blender/blenkernel/intern/navmesh_conversion.c73
-rw-r--r--source/blender/blenkernel/intern/nla.c10
-rw-r--r--source/blender/blenkernel/intern/node.c2
-rw-r--r--source/blender/blenkernel/intern/object.c85
-rw-r--r--source/blender/blenkernel/intern/packedFile.c12
-rw-r--r--source/blender/blenkernel/intern/particle.c5
-rw-r--r--source/blender/blenkernel/intern/particle_system.c128
-rw-r--r--source/blender/blenkernel/intern/pointcache.c3
-rw-r--r--source/blender/blenkernel/intern/property.c7
-rw-r--r--source/blender/blenkernel/intern/sca.c6
-rw-r--r--source/blender/blenkernel/intern/scene.c15
-rw-r--r--source/blender/blenkernel/intern/script.c6
-rw-r--r--source/blender/blenkernel/intern/seqcache.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c11
-rw-r--r--source/blender/blenkernel/intern/sequencer.c7
-rw-r--r--source/blender/blenkernel/intern/sketch.c1
-rw-r--r--source/blender/blenkernel/intern/smoke.c2
-rw-r--r--source/blender/blenkernel/intern/softbody.c19
-rw-r--r--source/blender/blenkernel/intern/sound.c9
-rw-r--r--source/blender/blenkernel/intern/speaker.c4
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c6
-rw-r--r--source/blender/blenkernel/intern/text.c13
-rw-r--r--source/blender/blenkernel/intern/texture.c10
-rw-r--r--source/blender/blenkernel/intern/world.c5
-rw-r--r--source/blender/blenkernel/intern/writeavi.c7
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c31
-rw-r--r--source/blender/blenkernel/intern/writeframeserver.c11
-rw-r--r--source/blender/blenlib/BLI_callbacks.h2
-rw-r--r--source/blender/blenlib/intern/BLI_args.c3
-rw-r--r--source/blender/blenlib/intern/BLI_dynstr.c9
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c3
-rw-r--r--source/blender/blenlib/intern/bpath.c12
-rw-r--r--source/blender/blenlib/intern/math_base.c3
-rw-r--r--source/blender/blenlib/intern/path_util.c48
-rw-r--r--source/blender/blenlib/intern/pbvh.c2
-rw-r--r--source/blender/blenlib/intern/storage.c15
-rw-r--r--source/blender/blenlib/intern/string.c18
-rw-r--r--source/blender/blenlib/intern/threads.c5
-rw-r--r--source/blender/blenlib/intern/winstuff.c12
-rw-r--r--source/blender/blenloader/BLO_sys_types.h4
-rw-r--r--source/blender/blenloader/intern/readblenentry.c3
-rw-r--r--source/blender/blenloader/intern/readfile.c136
-rw-r--r--source/blender/blenloader/intern/writefile.c2
-rw-r--r--source/blender/collada/AnimationImporter.cpp24
-rw-r--r--source/blender/collada/AnimationImporter.h2
-rw-r--r--source/blender/collada/DocumentImporter.cpp2
-rw-r--r--source/blender/collada/MeshImporter.cpp2
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c4
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c2
-rw-r--r--source/blender/editors/animation/anim_draw.c4
-rw-r--r--source/blender/editors/animation/anim_filter.c7
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c4
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c10
-rw-r--r--source/blender/editors/animation/keyframes_edit.c6
-rw-r--r--source/blender/editors/animation/keyframing.c57
-rw-r--r--source/blender/editors/armature/armature_ops.c3
-rw-r--r--source/blender/editors/armature/editarmature.c2
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c16
-rw-r--r--source/blender/editors/armature/poselib.c2
-rw-r--r--source/blender/editors/armature/poseobject.c61
-rw-r--r--source/blender/editors/armature/reeb.c4
-rw-r--r--source/blender/editors/curve/editcurve.c32
-rw-r--r--source/blender/editors/curve/editfont.c9
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/include/ED_anim_api.h2
-rw-r--r--source/blender/editors/include/ED_keyframing.h5
-rw-r--r--source/blender/editors/include/UI_interface.h6
-rw-r--r--source/blender/editors/include/UI_interface_icons.h4
-rw-r--r--source/blender/editors/interface/CMakeLists.txt2
-rw-r--r--source/blender/editors/interface/SConscript2
-rw-r--r--source/blender/editors/interface/interface.c73
-rw-r--r--source/blender/editors/interface/interface_anim.c2
-rw-r--r--source/blender/editors/interface/interface_draw.c8
-rw-r--r--source/blender/editors/interface/interface_handlers.c339
-rw-r--r--source/blender/editors/interface/interface_icons.c22
-rw-r--r--source/blender/editors/interface/interface_intern.h37
-rw-r--r--source/blender/editors/interface/interface_layout.c10
-rw-r--r--source/blender/editors/interface/interface_ops.c22
-rw-r--r--source/blender/editors/interface/interface_panel.c2
-rw-r--r--source/blender/editors/interface/interface_regions.c79
-rw-r--r--source/blender/editors/interface/interface_style.c36
-rw-r--r--source/blender/editors/interface/interface_templates.c79
-rw-r--r--source/blender/editors/interface/interface_utils.c3
-rw-r--r--source/blender/editors/interface/interface_widgets.c6
-rw-r--r--source/blender/editors/interface/view2d_ops.c2
-rw-r--r--source/blender/editors/mesh/CMakeLists.txt12
-rw-r--r--source/blender/editors/mesh/SConscript10
-rw-r--r--source/blender/editors/mesh/editmesh_add.c36
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c4
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c60
-rw-r--r--source/blender/editors/mesh/mesh_intern.h14
-rw-r--r--source/blender/editors/mesh/mesh_navmesh.c692
-rw-r--r--source/blender/editors/mesh/mesh_ops.c8
-rw-r--r--source/blender/editors/object/CMakeLists.txt10
-rw-r--r--source/blender/editors/object/SConscript4
-rw-r--r--source/blender/editors/object/object_add.c8
-rw-r--r--source/blender/editors/object/object_bake.c3
-rw-r--r--source/blender/editors/object/object_edit.c6
-rw-r--r--source/blender/editors/object/object_intern.h5
-rw-r--r--source/blender/editors/object/object_navmesh.cpp628
-rw-r--r--source/blender/editors/object/object_ops.c9
-rw-r--r--source/blender/editors/object/object_relations.c6
-rw-r--r--source/blender/editors/object/object_transform.c18
-rw-r--r--source/blender/editors/object/object_vgroup.c87
-rw-r--r--source/blender/editors/physics/particle_edit.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c50
-rw-r--r--source/blender/editors/render/render_preview.c2
-rw-r--r--source/blender/editors/screen/area.c7
-rw-r--r--source/blender/editors/screen/glutil.c20
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c53
-rw-r--r--source/blender/editors/sculpt_paint/paint_undo.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c172
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
-rw-r--r--source/blender/editors/sound/sound_ops.c3
-rw-r--r--source/blender/editors/space_action/action_draw.c2
-rw-r--r--source/blender/editors/space_action/action_edit.c28
-rw-r--r--source/blender/editors/space_action/action_ops.c1
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c10
-rw-r--r--source/blender/editors/space_console/space_console.c2
-rw-r--r--source/blender/editors/space_file/file_draw.c6
-rw-r--r--source/blender/editors/space_file/file_ops.c8
-rw-r--r--source/blender/editors/space_file/filelist.c3
-rw-r--r--source/blender/editors/space_file/filesel.c16
-rw-r--r--source/blender/editors/space_file/space_file.c9
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c6
-rw-r--r--source/blender/editors/space_graph/graph_ops.c1
-rw-r--r--source/blender/editors/space_image/image_ops.c3
-rw-r--r--source/blender/editors/space_info/info_draw.c2
-rw-r--r--source/blender/editors/space_info/space_info.c2
-rw-r--r--source/blender/editors/space_logic/CMakeLists.txt2
-rw-r--r--source/blender/editors/space_logic/logic_window.c1
-rw-r--r--source/blender/editors/space_node/drawnode.c7
-rw-r--r--source/blender/editors/space_node/node_edit.c16
-rw-r--r--source/blender/editors/space_node/node_header.c2
-rw-r--r--source/blender/editors/space_node/node_intern.h1
-rw-r--r--source/blender/editors/space_node/node_ops.c5
-rw-r--r--source/blender/editors/space_node/space_node.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c7
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c7
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c279
-rw-r--r--source/blender/editors/space_text/text_draw.c10
-rw-r--r--source/blender/editors/space_text/text_python.c4
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c122
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c60
-rw-r--r--source/blender/editors/space_view3d/drawobject.c164
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c141
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c150
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c13
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c20
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c32
-rw-r--r--source/blender/editors/transform/transform.c49
-rw-r--r--source/blender/editors/transform/transform.h4
-rw-r--r--source/blender/editors/transform/transform_conversions.c85
-rw-r--r--source/blender/editors/transform/transform_generics.c9
-rw-r--r--source/blender/editors/transform/transform_input.c12
-rw-r--r--source/blender/editors/transform/transform_snap.c9
-rw-r--r--source/blender/editors/util/ed_util.c2
-rw-r--r--source/blender/editors/util/editmode_undo.c2
-rw-r--r--source/blender/editors/util/undo.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c4
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c10
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c6
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c11
-rw-r--r--source/blender/gpu/intern/gpu_draw.c13
-rw-r--r--source/blender/gpu/intern/gpu_material.c18
-rw-r--r--source/blender/imbuf/intern/anim_movie.c108
-rw-r--r--source/blender/imbuf/intern/bmp.c8
-rw-r--r--source/blender/imbuf/intern/imageprocess.c6
-rw-r--r--source/blender/imbuf/intern/indexer.c4
-rw-r--r--source/blender/imbuf/intern/indexer_dv.c3
-rw-r--r--source/blender/imbuf/intern/jpeg.c10
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp14
-rw-r--r--source/blender/imbuf/intern/targa.c3
-rw-r--r--source/blender/makesdna/DNA_ID.h6
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h2
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h2
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h2
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h8
-rw-r--r--source/blender/makesdna/DNA_object_types.h3
-rw-r--r--source/blender/makesdna/DNA_particle_types.h12
-rw-r--r--source/blender/makesdna/DNA_scene_types.h27
-rw-r--r--source/blender/makesdna/DNA_texture_types.h1
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h1
-rw-r--r--source/blender/makesdna/intern/CMakeLists.txt2
-rw-r--r--source/blender/makesrna/RNA_access.h3
-rw-r--r--source/blender/makesrna/RNA_define.h3
-rw-r--r--source/blender/makesrna/RNA_types.h9
-rw-r--r--source/blender/makesrna/SConscript2
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt3
-rw-r--r--source/blender/makesrna/intern/SConscript2
-rw-r--r--source/blender/makesrna/intern/makesrna.c5
-rw-r--r--source/blender/makesrna/intern/rna_ID.c26
-rw-r--r--source/blender/makesrna/intern/rna_access.c96
-rw-r--r--source/blender/makesrna/intern/rna_action.c32
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c10
-rw-r--r--source/blender/makesrna/intern/rna_animation.c4
-rw-r--r--source/blender/makesrna/intern/rna_armature.c38
-rw-r--r--source/blender/makesrna/intern/rna_boid.c2
-rw-r--r--source/blender/makesrna/intern/rna_camera.c3
-rw-r--r--source/blender/makesrna/intern/rna_camera_api.c88
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c44
-rw-r--r--source/blender/makesrna/intern/rna_color.c2
-rw-r--r--source/blender/makesrna/intern/rna_curve.c7
-rw-r--r--source/blender/makesrna/intern/rna_define.c230
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c60
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c6
-rw-r--r--source/blender/makesrna/intern/rna_group.c2
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_internal.h4
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_key.c2
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c4
-rw-r--r--source/blender/makesrna/intern/rna_main.c2
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_material.c101
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c169
-rw-r--r--source/blender/makesrna/intern/rna_meta.c3
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c25
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c5
-rw-r--r--source/blender/makesrna/intern/rna_object.c149
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c28
-rw-r--r--source/blender/makesrna/intern/rna_particle.c96
-rw-r--r--source/blender/makesrna/intern/rna_pose.c2
-rw-r--r--source/blender/makesrna/intern/rna_render.c8
-rw-r--r--source/blender/makesrna/intern/rna_rna.c25
-rw-r--r--source/blender/makesrna/intern/rna_scene.c227
-rw-r--r--source/blender/makesrna/intern/rna_screen.c6
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c41
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c6
-rw-r--r--source/blender/makesrna/intern/rna_sound.c2
-rw-r--r--source/blender/makesrna/intern/rna_space.c113
-rw-r--r--source/blender/makesrna/intern/rna_text.c2
-rw-r--r--source/blender/makesrna/intern/rna_texture.c133
-rw-r--r--source/blender/makesrna/intern/rna_ui.c8
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c10
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c199
-rw-r--r--source/blender/makesrna/intern/rna_wm.c14
-rw-r--r--source/blender/modifiers/CMakeLists.txt1
-rw-r--r--source/blender/modifiers/intern/MOD_armature.c3
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c2
-rw-r--r--source/blender/modifiers/intern/MOD_cast.c3
-rw-r--r--source/blender/modifiers/intern/MOD_curve.c3
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c5
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c7
-rw-r--r--source/blender/modifiers/intern/MOD_hook.c5
-rw-r--r--source/blender/modifiers/intern/MOD_lattice.c3
-rw-r--r--source/blender/modifiers/intern/MOD_navmesh.c307
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c3
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c7
-rw-r--r--source/blender/modifiers/intern/MOD_util.c1
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c9
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c3
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.c13
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.h2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c7
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgmix.c7
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c7
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_common.c3
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_idMask.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_image.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_lummaMatte.c2
-rw-r--r--source/blender/nodes/intern/node_common.c6
-rw-r--r--source/blender/nodes/intern/node_util.h2
-rw-r--r--source/blender/python/SConscript6
-rw-r--r--source/blender/python/generic/CMakeLists.txt4
-rw-r--r--source/blender/python/generic/IDProp.c2
-rw-r--r--source/blender/python/generic/bgl.c4
-rw-r--r--source/blender/python/generic/blf_py_api.c45
-rw-r--r--source/blender/python/generic/bpy_internal_import.c4
-rw-r--r--source/blender/python/generic/py_capi_utils.c19
-rw-r--r--source/blender/python/intern/CMakeLists.txt4
-rw-r--r--source/blender/python/intern/bpy_app_handlers.c2
-rw-r--r--source/blender/python/intern/bpy_driver.c7
-rw-r--r--source/blender/python/intern/bpy_operator.c41
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c2
-rw-r--r--source/blender/python/intern/bpy_props.c42
-rw-r--r--source/blender/python/intern/bpy_rna.c350
-rw-r--r--source/blender/python/intern/bpy_rna.h8
-rw-r--r--source/blender/python/intern/bpy_rna_anim.c10
-rw-r--r--source/blender/python/intern/bpy_rna_array.c12
-rw-r--r--source/blender/python/mathutils/mathutils.c10
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c2
-rw-r--r--source/blender/quicktime/SConscript5
-rw-r--r--source/blender/render/intern/include/render_types.h1
-rw-r--r--source/blender/render/intern/include/rendercore.h12
-rw-r--r--source/blender/render/intern/include/shading.h4
-rw-r--r--source/blender/render/intern/raytrace/rayobject.cpp2
-rw-r--r--source/blender/render/intern/raytrace/rayobject_qbvh.cpp4
-rw-r--r--source/blender/render/intern/raytrace/rayobject_svbvh.cpp4
-rw-r--r--source/blender/render/intern/raytrace/rayobject_vbvh.cpp4
-rw-r--r--source/blender/render/intern/source/convertblender.c27
-rw-r--r--source/blender/render/intern/source/envmap.c6
-rw-r--r--source/blender/render/intern/source/pipeline.c2
-rw-r--r--source/blender/render/intern/source/pixelshading.c3
-rw-r--r--source/blender/render/intern/source/rayshade.c241
-rw-r--r--source/blender/render/intern/source/render_texture.c25
-rw-r--r--source/blender/render/intern/source/rendercore.c2
-rw-r--r--source/blender/render/intern/source/shadeinput.c8
-rw-r--r--source/blender/render/intern/source/shadeoutput.c56
-rw-r--r--source/blender/render/intern/source/strand.c4
-rw-r--r--source/blender/render/intern/source/volume_precache.c178
-rw-r--r--source/blender/render/intern/source/voxeldata.c2
-rw-r--r--source/blender/render/intern/source/zbuf.c9
-rw-r--r--source/blender/windowmanager/CMakeLists.txt2
-rw-r--r--source/blender/windowmanager/SConscript2
-rw-r--r--source/blender/windowmanager/WM_types.h13
-rw-r--r--source/blender/windowmanager/intern/wm.c14
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c73
-rw-r--r--source/blender/windowmanager/intern/wm_files.c34
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c4
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c44
-rw-r--r--source/blender/windowmanager/intern/wm_window.c10
-rw-r--r--source/blenderplayer/CMakeLists.txt12
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c2
-rw-r--r--source/creator/CMakeLists.txt82
-rw-r--r--source/creator/creator.c69
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp31
-rw-r--r--source/gameengine/Converter/BL_ArmatureChannel.cpp26
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp2
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.cpp4
-rw-r--r--source/gameengine/Converter/BlenderWorldInfo.h20
-rw-r--r--source/gameengine/Converter/KX_IpoConvert.cpp2
-rw-r--r--source/gameengine/Expressions/KX_HashedPtr.cpp2
-rw-r--r--source/gameengine/Expressions/ListValue.cpp14
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h10
-rw-r--r--source/gameengine/GameLogic/SCA_2DFilterActuator.cpp2
-rw-r--r--source/gameengine/GameLogic/SCA_2DFilterActuator.h2
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickManager.cpp6
-rw-r--r--source/gameengine/GamePlayer/ghost/CMakeLists.txt2
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp2
-rw-r--r--source/gameengine/GamePlayer/ghost/SConscript2
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp18
-rw-r--r--source/gameengine/Ketsji/KX_Dome.h47
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_MouseFocusSensor.h2
-rw-r--r--source/gameengine/Ketsji/KX_NavMeshObject.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.h2
-rw-r--r--source/gameengine/Ketsji/KX_ObstacleSimulation.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_OrientationInterpolator.h12
-rw-r--r--source/gameengine/Ketsji/KX_ParentActuator.h6
-rw-r--r--source/gameengine/Ketsji/KX_PythonSeq.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_SCA_DynamicActuator.h8
-rw-r--r--source/gameengine/Ketsji/KX_SteeringActuator.cpp70
-rw-r--r--source/gameengine/Ketsji/KX_SteeringActuator.h4
-rw-r--r--source/gameengine/Ketsji/KX_VertexProxy.cpp4
-rw-r--r--source/gameengine/Network/NG_NetworkMessage.h2
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h4
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp4
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h2
-rw-r--r--source/gameengine/SceneGraph/SG_DList.h6
-rw-r--r--source/gameengine/SceneGraph/SG_Node.cpp4
-rw-r--r--source/gameengine/VideoTexture/ImageRender.h46
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.h6
-rw-r--r--source/tests/CMakeLists.txt66
-rw-r--r--source/tests/bl_load_py_modules.py1
626 files changed, 18722 insertions, 17622 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d10f915201..09acb9e77c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,8 +26,8 @@
# ***** END GPL LICENSE BLOCK *****
#-----------------------------------------------------------------------------
-# We don't allow in-source builds. This causes no end of troubles because
-# all out-of-source builds will use the CMakeCache.txt file there and even
+# We don't allow in-source builds. This causes no end of troubles because
+# all out-of-source builds will use the CMakeCache.txt file there and even
# build the libs and objects in it.
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
@@ -190,7 +190,6 @@ option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org
option(WITH_SDL "Enable SDL for sound and joystick support" ON)
option(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON)
option(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
-option(WITH_SAMPLERATE "Enable samplerate conversion" ON)
# Compression
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
@@ -198,12 +197,11 @@ option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)"
# Misc
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
-option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
+option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
if(UNIX AND NOT APPLE)
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
-option(WITH_API_INSTALL "Copy API header files into the blender install folder" ON)
# Cycles
option(WITH_CYCLES "Enable Cycles Render Engine" ON)
@@ -294,8 +292,7 @@ if(WITH_OPENIMAGEIO)
set(WITH_BOOST ON)
endif()
-
-TEST_SSE_SUPPORT()
+TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
# don't store paths to libs for portable distrobution
if(WITH_INSTALL_PORTABLE)
@@ -308,8 +305,8 @@ endif()
# linux only, not cached
set(WITH_BINRELOC OFF)
-# MAXOSX only, set to avoid uninitialized
-set(EXETYPE)
+# MAXOSX only, set to avoid uninitialized
+set(EXETYPE "")
# C/C++ flags
set(PLATFORM_CFLAGS)
@@ -320,26 +317,26 @@ set(CXX_WARNINGS)
# libraries to link the binary with passed to target_link_libraries()
# known as LLIBS to scons
-set(PLATFORM_LINKLIBS)
+set(PLATFORM_LINKLIBS "")
# Added to linker flags in setup_liblinks
# - CMAKE_EXE_LINKER_FLAGS
# - CMAKE_EXE_LINKER_FLAGS_DEBUG
-set(PLATFORM_LINKFLAGS)
-set(PLATFORM_LINKFLAGS_DEBUG)
+set(PLATFORM_LINKFLAGS "")
+set(PLATFORM_LINKFLAGS_DEBUG "")
# disabled for now, not supported
# option(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
-# On Unix:
+# On Unix:
# cmake ../blender \
# -D PYTHON_VERSION=3.2 \
# -D PYTHON_INCLUDE_DIR=/opt/py32/include/python3.2d \
# -D PYTHON_LIBRARY=/opt/py32/lib/libpython3.2d.so
#
-# On Macs:
+# On Macs:
# cmake ../blender \
# -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 \
# -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/config \
@@ -351,7 +348,7 @@ set(PLATFORM_LINKFLAGS_DEBUG)
#Platform specifics
if(UNIX AND NOT APPLE)
-
+
# needed for ubuntu 11.04
if(EXISTS "/usr/lib/x86_64-linux-gnu")
set(CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu;${CMAKE_LIBRARY_PATH}")
@@ -403,10 +400,12 @@ if(UNIX AND NOT APPLE)
if(WITH_SDL)
find_package(SDL)
- mark_as_advanced(SDLMAIN_LIBRARY)
- mark_as_advanced(SDL_INCLUDE_DIR)
- mark_as_advanced(SDL_LIBRARY)
- mark_as_advanced(SDL_LIBRARY_TEMP)
+ mark_as_advanced(
+ SDLMAIN_LIBRARY
+ SDL_INCLUDE_DIR
+ SDL_LIBRARY
+ SDL_LIBRARY_TEMP
+ )
# unset(SDLMAIN_LIBRARY CACHE)
if(NOT SDL_FOUND)
set(WITH_SDL OFF)
@@ -450,11 +449,13 @@ if(UNIX AND NOT APPLE)
PATHS
/sw/lib
)
- mark_as_advanced(ICONV_LIBRARY)
- mark_as_advanced(INTL_LIBRARY)
+ mark_as_advanced(
+ ICONV_LIBRARY
+ INTL_LIBRARY
+ )
if(INTL_LIBRARY AND ICONV_LIBRARY)
- set(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY})
+ set(GETTEXT_LIBRARIES ${INTL_LIBRARY} ${ICONV_LIBRARY})
endif()
endif()
@@ -465,13 +466,6 @@ if(UNIX AND NOT APPLE)
endif()
endif()
- if(WITH_SAMPLERATE)
- find_package(Samplerate)
- if(NOT SAMPLERATE_FOUND)
- set(WITH_SAMPLERATE OFF)
- endif()
- endif()
-
if(WITH_OPENCOLLADA)
find_package(OpenCOLLADA)
if(OPENCOLLADA_FOUND)
@@ -551,17 +545,17 @@ if(UNIX AND NOT APPLE)
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
mark_as_advanced(X11_XF86keysym_INCLUDE_PATH)
- list(APPEND PLATFORM_LINKLIBS ${X11_X11_LIB})
+ set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_X11_LIB}")
if(WITH_X11_XINPUT)
- list(APPEND PLATFORM_LINKLIBS ${X11_Xinput_LIB})
+ set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xinput_LIB}")
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(NOT WITH_PYTHON_MODULE)
# BSD's dont use libdl.so
- list(APPEND PLATFORM_LINKLIBS -ldl)
+ set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} -ldl")
# binreloc is linux only
set(BINRELOC_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/binreloc/include)
set(WITH_BINRELOC ON)
@@ -582,16 +576,16 @@ if(UNIX AND NOT APPLE)
# Intel C++ Compiler
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
# think these next two are broken
- find_program(XIAR xiar)
- if(XIAR)
+ find_program(XIAR xiar)
+ if(XIAR)
set(CMAKE_AR "${XIAR}")
- endif()
+ endif()
mark_as_advanced(XIAR)
- find_program(XILD xild)
- if(XILD)
+ find_program(XILD xild)
+ if(XILD)
set(CMAKE_LINKER "${XILD}")
- endif()
+ endif()
mark_as_advanced(XILD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise -prec_div -parallel")
@@ -614,7 +608,7 @@ elseif(WIN32)
message("64 bit compiler detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
endif()
-
+
add_definitions(-DWIN32)
if(WITH_INTERNATIONAL)
@@ -624,13 +618,6 @@ elseif(WIN32)
set(ICONV_LIBPATH ${ICONV}/lib)
endif()
- if(WITH_SAMPLERATE)
- set(SAMPLERATE ${LIBDIR}/samplerate)
- set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include)
- set(SAMPLERATE_LIBRARIES libsamplerate)
- set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
- endif()
-
set(PNG "${LIBDIR}/png")
set(PNG_INCLUDE_DIR "${PNG}/include")
set(PNG_LIBPATH ${PNG}/lib) # not cmake defined
@@ -639,7 +626,7 @@ elseif(WIN32)
set(JPEG_INCLUDE_DIR "${JPEG}/include")
set(JPEG_LIBPATH ${JPEG}/lib) # not cmake defined
- set(WINTAB_INC ${LIBDIR}/wintab/include)
+ set(WINTAB_INC ${LIBDIR}/wintab/include)
if(WITH_OPENAL)
set(OPENAL ${LIBDIR}/openal)
@@ -704,9 +691,9 @@ elseif(WIN32)
if(WITH_INTERNATIONAL)
set(GETTEXT ${LIBDIR}/gettext)
- set(GETTEXT_INC ${GETTEXT}/include)
+ set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
- set(GETTEXT_LIB gnu_gettext)
+ set(GETTEXT_LIBRARIES gnu_gettext)
endif()
if(CMAKE_CL_64)
@@ -747,7 +734,7 @@ elseif(WIN32)
${LIBDIR}/opencollada/include/COLLADABaseUtils/include
${LIBDIR}/opencollada/include/COLLADAFramework/include
${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
- ${LIBDIR}/opencollada/include/GeneratedSaxParser/include
+ ${LIBDIR}/opencollada/include/GeneratedSaxParser/include
)
set(OPENCOLLADA_LIBRARIES
@@ -804,7 +791,7 @@ elseif(WIN32)
set(OPENEXR_INCUDE ${OPENEXR}/include${MSVC_INC})
set(OPENEXR_INCLUDE_DIRS
${OPENEXR_INCUDE}
- ${OPENEXR_INCUDE}/IlmImf
+ ${OPENEXR_INCUDE}/IlmImf
${OPENEXR_INCUDE}/Iex
${OPENEXR_INCUDE}/Imath
)
@@ -890,9 +877,9 @@ elseif(WIN32)
if(WITH_INTERNATIONAL)
set(GETTEXT ${LIBDIR}/gcc/gettext)
- set(GETTEXT_INC ${GETTEXT}/include)
+ set(GETTEXT_INCLUDE_DIRS ${GETTEXT}/include)
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
- set(GETTEXT_LIB intl)
+ set(GETTEXT_LIBRARIES intl)
endif()
set(JPEG_LIBRARIES libjpeg)
@@ -907,7 +894,7 @@ elseif(WIN32)
set(PTHREADS_INCLUDE_DIRS ${PTHREADS}/include)
set(PTHREADS_LIBPATH ${PTHREADS}/lib)
set(PTHREADS_LIBRARIES pthreadGC2)
-
+
set(FREETYPE ${LIBDIR}/gcc/freetype)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2)
set(FREETYPE_LIBPATH ${FREETYPE}/lib)
@@ -927,13 +914,13 @@ elseif(WIN32)
${LIBDIR}/gcc/opencollada/include/COLLADABaseUtils/include
${LIBDIR}/gcc/opencollada/include/COLLADAFramework/include
${LIBDIR}/gcc/opencollada/include/COLLADASaxFrameworkLoader/include
- ${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include
+ ${LIBDIR}/gcc/opencollada/include/GeneratedSaxParser/include
)
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib ${OPENCOLLADA}/lib)
set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver expat pcre buffer ftoa)
set(PCRE_LIBRARIES pcre)
endif()
-
+
if(WITH_CODEC_FFMPEG)
set(FFMPEG ${LIBDIR}/ffmpeg)
set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include ${FFMPEG}/include)
@@ -960,7 +947,7 @@ elseif(WIN32)
set(JACK_INCLUDE_DIRS ${JACK}/include/jack ${JACK}/include)
set(JACK_LIBRARIES jack)
set(JACK_LIBPATH ${JACK}/lib)
-
+
# TODO, gives linking errors, force off
set(WITH_JACK OFF)
endif()
@@ -1020,7 +1007,7 @@ elseif(APPLE)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.0.0-powerpc)
endif()
endif()
-
+
if(WITH_OPENAL)
find_package(OpenAL)
@@ -1064,8 +1051,8 @@ elseif(APPLE)
if(WITH_INTERNATIONAL)
set(GETTEXT ${LIBDIR}/gettext)
- set(GETTEXT_INC "${GETTEXT}/include")
- set(GETTEXT_LIB intl iconv)
+ set(GETTEXT_INCLUDE_DIRS "${GETTEXT}/include")
+ set(GETTEXT_LIBRARIES intl iconv)
set(GETTEXT_LIBPATH ${GETTEXT}/lib)
endif()
@@ -1103,22 +1090,15 @@ elseif(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
endif()
- if(WITH_SAMPLERATE)
- set(SAMPLERATE ${LIBDIR}/samplerate)
- set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE}/include)
- set(SAMPLERATE_LIBRARIES samplerate)
- set(SAMPLERATE_LIBPATH ${SAMPLERATE}/lib)
- endif()
-
- find_library(SYSTEMSTUBS_LIBRARY
- NAMES
- SystemStubs
+ find_library(SYSTEMSTUBS_LIBRARY
+ NAMES
+ SystemStubs
PATHS
)
mark_as_advanced(SYSTEMSTUBS_LIBRARY)
if(SYSTEMSTUBS_LIBRARY)
set(PLATFORM_LINKLIBS stdc++ SystemStubs)
- else()
+ else()
set(PLATFORM_LINKLIBS stdc++)
endif()
@@ -1130,13 +1110,13 @@ elseif(APPLE)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
- #libSDL still needs 32bit carbon quicktime
+ #libSDL still needs 32bit carbon quicktime
endif()
elseif(WITH_CODEC_QUICKTIME)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
endif()
- # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
+ # XXX - SOME MAC DEV PLEASE TEST WITH THE SDK INSTALLED!
# ALSO SHOULD BE MOVED INTO OWN MODULE WHEN FUNCTIONAL
if(WITH_INPUT_NDOF)
# This thread it *should* work and check the framework - campbell
@@ -1229,11 +1209,11 @@ elseif(APPLE)
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
- set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
- set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
+ set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -fvariable-expansion-in-unroller")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
- set(CMAKE_CXX_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
- set(CMAKE_C_FLAGS_RELEASE "-O3 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
+ set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")
else()
set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
@@ -1252,43 +1232,34 @@ endif()
# See TEST_SSE_SUPPORT() for how this is defined.
if(WITH_RAYOPTIMIZATION)
- if(CMAKE_COMPILER_IS_GNUCC)
- set(_sse "-msse")
- set(_sse2 "-msse2")
- elseif(MSVC)
- set(_sse "/arch:SSE")
- set(_sse2 "/arch:SSE2")
- else()
- message(WARNING "SSE flags for this compiler not known")
- set(_sse)
- set(_sse2)
- endif()
-
if(SUPPORT_SSE_BUILD)
- set(PLATFORM_CFLAGS " ${_sse} ${PLATFORM_CFLAGS}")
+ set(PLATFORM_CFLAGS " ${COMPILER_SSE_FLAG} ${PLATFORM_CFLAGS}")
add_definitions(-D__SSE__ -D__MMX__)
endif()
if(SUPPORT_SSE2_BUILD)
- set(PLATFORM_CFLAGS " ${_sse2} ${PLATFORM_CFLAGS}")
+ set(PLATFORM_CFLAGS " ${COMPILER_SSE2_FLAG} ${PLATFORM_CFLAGS}")
add_definitions(-D__SSE2__)
if(NOT SUPPORT_SSE_BUILD) # dont double up
add_definitions(-D__MMX__)
endif()
endif()
- unset(_sse)
- unset(_sse2)
endif()
# set the endian define
-include(TestBigEndian)
-test_big_endian(_SYSTEM_BIG_ENDIAN)
-if(_SYSTEM_BIG_ENDIAN)
- add_definitions(-D__BIG_ENDIAN__)
-else()
+if(MSVC)
+ # for some reason this fails on msvc
add_definitions(-D__LITTLE_ENDIAN__)
+else()
+ include(TestBigEndian)
+ test_big_endian(_SYSTEM_BIG_ENDIAN)
+ if(_SYSTEM_BIG_ENDIAN)
+ add_definitions(-D__BIG_ENDIAN__)
+ else()
+ add_definitions(-D__LITTLE_ENDIAN__)
+ endif()
+ unset(_SYSTEM_BIG_ENDIAN)
endif()
-unset(_SYSTEM_BIG_ENDIAN)
if(WITH_IMAGE_OPENJPEG)
@@ -1307,7 +1278,7 @@ endif()
#-----------------------------------------------------------------------------
# Blender WebPlugin
-if(WITH_WEBPLUGIN)
+if(WITH_WEBPLUGIN)
set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
@@ -1319,13 +1290,13 @@ endif()
# Configure OpenGL.
find_package(OpenGL)
blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
-# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
-# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
+# unset(OPENGL_LIBRARIES CACHE) # not compat with older cmake
+# unset(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake
#-----------------------------------------------------------------------------
# Configure OpenMP.
if(WITH_OPENMP)
- find_package(OpenMP)
+ find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
@@ -1337,9 +1308,11 @@ if(WITH_OPENMP)
set(WITH_OPENMP OFF)
endif()
- mark_as_advanced(OpenMP_C_FLAGS)
- mark_as_advanced(OpenMP_CXX_FLAGS)
-endif()
+ mark_as_advanced(
+ OpenMP_C_FLAGS
+ OpenMP_CXX_FLAGS
+ )
+endif()
#-----------------------------------------------------------------------------
# Configure GLEW
@@ -1354,8 +1327,10 @@ else()
message(FATAL_ERROR "GLEW is required to build blender, install it or use WITH_BUILTIN_GLEW")
endif()
- mark_as_advanced(GLEW_LIBRARY)
- mark_as_advanced(GLEW_INCLUDE_PATH)
+ mark_as_advanced(
+ GLEW_LIBRARY
+ GLEW_INCLUDE_PATH
+ )
endif()
#-----------------------------------------------------------------------------
@@ -1363,7 +1338,7 @@ endif()
if(WITH_PYTHON_MODULE)
add_definitions(-DPy_ENABLE_SHARED)
-endif()
+endif()
#-----------------------------------------------------------------------------
# Extra compile flags
@@ -1372,7 +1347,7 @@ if((NOT WIN32) AND (NOT MSVC))
# used for internal debug checks
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
-
+
# assert() checks for this.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG")
@@ -1397,7 +1372,10 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
- ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
+
+ # # this causes too many warnings, disable
+ # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
+
# disable because it gives warnings for printf() & friends.
# ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
@@ -1405,7 +1383,9 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
- ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
+
+ # # this causes too many warnings, disable
+ # ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -1417,6 +1397,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
+ # disable numbered, false positives
+ set(C_WARNINGS "${C_WARNINGS} -wd188,186,144,913,556")
+ set(CXX_WARNINGS "${CXX_WARNINGS} -wd188,186,144,913,556")
+
endif()
# MSVC2010 fails to links C++ libs right
@@ -1491,6 +1475,7 @@ if(WITH_BLENDER)
add_subdirectory(source/creator)
endif()
+
#-----------------------------------------------------------------------------
# Blender Player
if(WITH_PLAYER)
@@ -1522,8 +1507,8 @@ if(FIRST_RUN)
macro(info_cfg_text
_text)
set(_config_msg "${_config_msg}\n\n ${_text}")
-
-
+
+
endmacro()
info_cfg_text("Build Options:")
@@ -1562,7 +1547,6 @@ if(FIRST_RUN)
info_cfg_option(WITH_JACK)
info_cfg_option(WITH_CODEC_FFMPEG)
info_cfg_option(WITH_CODEC_SNDFILE)
- info_cfg_option(WITH_SAMPLERATE)
info_cfg_text("Compression:")
info_cfg_option(WITH_LZMA)
diff --git a/GNUmakefile b/GNUmakefile
index 9915406e52c..aad3c58938c 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -164,7 +164,7 @@ package_archive:
# Other Targets
#
translations:
- $(BUILD_DIR)/bin/blender --background --python po/update_msg.py
+ $(BUILD_DIR)/bin/blender --background --factory-startup --python po/update_msg.py
python3 po/update_pot.py
python3 po/update_po.py
python3 po/update_mo.py
diff --git a/SConstruct b/SConstruct
index 42ee3342031..738466d389e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -30,6 +30,7 @@
# Then read all SConscripts and build
#
# TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
+# TODO: cleanup CCFLAGS / CPPFLAGS use, often both are set when we only need one.
import platform as pltfrm
@@ -277,32 +278,27 @@ if env['OURPLATFORM']=='darwin':
print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
env['WITH_BF_3DMOUSE'] = 0
else:
- env.Append(LINKFLAGS=['-weak_framework','3DconnexionClient'])
+ env.Append(LINKFLAGS=['-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
if env['WITH_BF_OPENMP'] == 1:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
env['CCFLAGS'].append('/openmp')
env['CPPFLAGS'].append('/openmp')
- env['CXXFLAGS'].append('/openmp')
else:
if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
env.Append(LINKFLAGS=['-openmp', '-static-intel'])
env['CCFLAGS'].append('-openmp')
env['CPPFLAGS'].append('-openmp')
- env['CXXFLAGS'].append('-openmp')
else:
env.Append(CCFLAGS=['-fopenmp'])
env.Append(CPPFLAGS=['-fopenmp'])
- env.Append(CXXFLAGS=['-fopenmp'])
if env['WITH_GHOST_COCOA'] == True:
env.Append(CFLAGS=['-DGHOST_COCOA'])
- env.Append(CXXFLAGS=['-DGHOST_COCOA'])
env.Append(CPPFLAGS=['-DGHOST_COCOA'])
if env['USE_QTKIT'] == True:
- env.Append(CFLAGS=['-DUSE_QTKIT'])
- env.Append(CXXFLAGS=['-DUSE_QTKIT'])
+ env.Append(CFLAGS=['-DUSE_QTKIT'])
env.Append(CPPFLAGS=['-DUSE_QTKIT'])
#check for additional debug libnames
@@ -334,23 +330,19 @@ if 'blendernogame' in B.targets:
# disable elbeem (fluidsim) compilation?
if env['BF_NO_ELBEEM'] == 1:
env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
- env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
env['CCFLAGS'].append('-DDISABLE_ELBEEM')
if btools.ENDIAN == "big":
env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
- env['CXXFLAGS'].append('-D__BIG_ENDIAN__')
env['CCFLAGS'].append('-D__BIG_ENDIAN__')
else:
env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
- env['CXXFLAGS'].append('-D__LITTLE_ENDIAN__')
env['CCFLAGS'].append('-D__LITTLE_ENDIAN__')
# TODO, make optional
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
-env['CXXFLAGS'].append('-DWITH_AUDASPACE')
env['CCFLAGS'].append('-DWITH_AUDASPACE')
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
@@ -523,7 +515,7 @@ if env['OURPLATFORM']!='darwin':
for f in df:
# This files aren't used anymore
- if f in ['.Blanguages', '.bfont.ttf']:
+ if f in (".bfont.ttf", ):
continue
if not env['WITH_BF_INTERNATIONAL']:
diff --git a/build_files/buildbot/config/user-config-i686.py b/build_files/buildbot/config/user-config-i686.py
index 5fe3d6891fd..f2197a05501 100644
--- a/build_files/buildbot/config/user-config-i686.py
+++ b/build_files/buildbot/config/user-config-i686.py
@@ -5,7 +5,7 @@ BF_NUMJOBS = 2
# Python configuration
BF_PYTHON_VERSION = '3.2'
BF_PYTHON_ABI_FLAGS = 'mu'
-BF_PYTHON = '/opt/python3.2'
+BF_PYTHON = '/opt/python3'
WITH_BF_STATICPYTHON = True
@@ -58,8 +58,6 @@ WITH_BF_PNG = True
BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32'
-WITH_BF_STATICLIBSAMPLERATE = True
-
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
@@ -91,6 +89,9 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
+# JACK
+WITH_BF_JACK = True
+
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']
diff --git a/build_files/buildbot/config/user-config-player-i686.py b/build_files/buildbot/config/user-config-player-i686.py
index 54e66e847df..99671ecc072 100644
--- a/build_files/buildbot/config/user-config-player-i686.py
+++ b/build_files/buildbot/config/user-config-player-i686.py
@@ -5,7 +5,7 @@ BF_NUMJOBS = 2
# Python configuration
BF_PYTHON_VERSION = '3.2'
BF_PYTHON_ABI_FLAGS = 'mu'
-BF_PYTHON = '/opt/python3.2'
+BF_PYTHON = '/opt/python3'
WITH_BF_STATICPYTHON = True
@@ -52,8 +52,6 @@ WITH_BF_PNG = True
BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib32'
-WITH_BF_STATICLIBSAMPLERATE = True
-
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
@@ -82,6 +80,9 @@ WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib32'
+# JACK
+WITH_BF_JACK = True
+
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']
diff --git a/build_files/buildbot/config/user-config-player-x86_64.py b/build_files/buildbot/config/user-config-player-x86_64.py
index 5d594229d3e..a1ca38880eb 100644
--- a/build_files/buildbot/config/user-config-player-x86_64.py
+++ b/build_files/buildbot/config/user-config-player-x86_64.py
@@ -5,7 +5,7 @@ BF_NUMJOBS = 2
# Python configuration
BF_PYTHON_VERSION = '3.2'
BF_PYTHON_ABI_FLAGS = 'mu'
-BF_PYTHON = '/opt/python3.2'
+BF_PYTHON = '/opt/python3'
WITH_BF_STATICPYTHON = True
@@ -52,8 +52,6 @@ WITH_BF_PNG = True
BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64'
-WITH_BF_STATICLIBSAMPLERATE = True
-
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
@@ -82,6 +80,9 @@ WITH_BF_STATIC3DMOUSE = True
BF_3DMOUSE = '/home/sources/staticlibs/spnav'
BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
+# JACK
+WITH_BF_JACK = True
+
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']
diff --git a/build_files/buildbot/config/user-config-x86_64.py b/build_files/buildbot/config/user-config-x86_64.py
index b8b2d7f7a5f..93fe3ca2e5b 100644
--- a/build_files/buildbot/config/user-config-x86_64.py
+++ b/build_files/buildbot/config/user-config-x86_64.py
@@ -5,7 +5,7 @@ BF_NUMJOBS = 2
# Python configuration
BF_PYTHON_VERSION = '3.2'
BF_PYTHON_ABI_FLAGS = 'mu'
-BF_PYTHON = '/opt/python3.2'
+BF_PYTHON = '/opt/python3'
WITH_BF_STATICPYTHON = True
@@ -58,8 +58,6 @@ WITH_BF_PNG = True
BF_PNG_LIB = 'libpng'
BF_PNG_LIBPATH = '/home/sources/staticlibs/lib64'
-WITH_BF_STATICLIBSAMPLERATE = True
-
WITH_BF_ZLIB = True
WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
@@ -91,6 +89,9 @@ BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib64'
WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True
+# JACK
+WITH_BF_JACK = True
+
# Compilation and optimization
BF_DEBUG = False
REL_CFLAGS = ['-O2']
diff --git a/build_files/buildbot/master_unpack.py b/build_files/buildbot/master_unpack.py
index ad7c09933c6..3df22ad8745 100644
--- a/build_files/buildbot/master_unpack.py
+++ b/build_files/buildbot/master_unpack.py
@@ -48,11 +48,11 @@ def get_platform(filename):
tokens = filename.split("-")
platforms = ('osx', 'mac', 'bsd',
'win', 'linux', 'source',
- 'irix', 'solaris')
+ 'solaris')
platform_tokens = []
found = False
- for i, token in enumerate(tokens):
+ for token in tokens:
if not found:
for platform in platforms:
if platform in token.lower():
diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
index 882f1e2ea77..fd5d20920da 100644
--- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake
+++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
@@ -34,67 +34,71 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
ENDIF()
-IF(DEFINED PYTHON_VERSION)
- SET(PYTHON_VERSION "${PYTHON_VERSION}" CACHE STRING "")
-ELSE()
- SET(PYTHON_VERSION 3.2 CACHE STRING "")
-ENDIF()
+SET(PYTHON_VERSION 3.2 CACHE STRING "Python Version (major and minor only)")
MARK_AS_ADVANCED(PYTHON_VERSION)
-SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
+
+# See: http://docs.python.org/extending/embedding.html#linking-requirements
+# for why this is needed
+SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
-SET(_python_ABI_FLAGS
- "m;mu;u; " # release
- "md;mud;ud;d" # debug
-)
-
-STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
-
-SET(_python_SEARCH_DIRS
- ${PYTHON_ROOT_DIR}
- "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
- "/opt/py${_PYTHON_VERSION_NO_DOTS}"
-)
-
-FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
- #IF(CMAKE_BUILD_TYPE STREQUAL Debug)
- # SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}")
- #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
+# only search for the dirs if we havn't already
+IF((NOT DEFINED PYTHON_INCLUDE_DIR) OR (NOT DEFINED PYTHON_LIBRARY))
+
+ SET(_python_ABI_FLAGS
+ "m;mu;u; " # release
+ "md;mud;ud;d" # debug
)
- 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)
- ENDIF()
-ENDFOREACH()
+ STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
-UNSET(_CURRENT_ABI_FLAGS)
-UNSET(_CURRENT_PATH)
+ SET(_python_SEARCH_DIRS
+ ${PYTHON_ROOT_DIR}
+ "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
+ "/opt/py${_PYTHON_VERSION_NO_DOTS}"
+ )
-UNSET(_python_ABI_FLAGS)
-UNSET(_python_SEARCH_DIRS)
+ FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
+ #IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+ # SET(_CURRENT_ABI_FLAGS "d${_CURRENT_ABI_FLAGS}")
+ #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(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)
+ ENDIF()
+ ENDFOREACH()
+
+ UNSET(_CURRENT_ABI_FLAGS)
+ UNSET(_CURRENT_PATH)
+
+ UNSET(_python_ABI_FLAGS)
+ UNSET(_python_SEARCH_DIRS)
+ENDIF()
# handle the QUIETLY and REQUIRED arguments and SET PYTHONLIBSUNIX_FOUND to TRUE IF
# all listed variables are TRUE
diff --git a/build_files/cmake/Modules/FindSamplerate.cmake b/build_files/cmake/Modules/FindSamplerate.cmake
deleted file mode 100644
index ea7a0d7a18c..00000000000
--- a/build_files/cmake/Modules/FindSamplerate.cmake
+++ /dev/null
@@ -1,70 +0,0 @@
-# - Find Samplerate library
-# Find the native Samplerate includes and library
-# This module defines
-# SAMPLERATE_INCLUDE_DIRS, where to find samplerate.h, Set when
-# SAMPLERATE_INCLUDE_DIR is found.
-# SAMPLERATE_LIBRARIES, libraries to link against to use Samplerate.
-# SAMPLERATE_ROOT_DIR, The base directory to search for Samplerate.
-# This can also be an environment variable.
-# SAMPLERATE_FOUND, If false, do not try to use Samplerate.
-#
-# also defined, but not for general use are
-# SAMPLERATE_LIBRARY, where to find the Samplerate library.
-
-#=============================================================================
-# Copyright 2011 Blender Foundation.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-# If SAMPLERATE_ROOT_DIR was defined in the environment, use it.
-IF(NOT SAMPLERATE_ROOT_DIR AND NOT $ENV{SAMPLERATE_ROOT_DIR} STREQUAL "")
- SET(SAMPLERATE_ROOT_DIR $ENV{SAMPLERATE_ROOT_DIR})
-ENDIF()
-
-SET(_samplerate_SEARCH_DIRS
- ${SAMPLERATE_ROOT_DIR}
- /usr/local
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
-)
-
-FIND_PATH(SAMPLERATE_INCLUDE_DIR
- NAMES
- samplerate.h
- HINTS
- ${_samplerate_SEARCH_DIRS}
- PATH_SUFFIXES
- include
-)
-
-FIND_LIBRARY(SAMPLERATE_LIBRARY
- NAMES
- samplerate
- HINTS
- ${_samplerate_SEARCH_DIRS}
- PATH_SUFFIXES
- lib64 lib
- )
-
-# handle the QUIETLY and REQUIRED arguments and set SAMPLERATE_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Samplerate DEFAULT_MSG
- SAMPLERATE_LIBRARY SAMPLERATE_INCLUDE_DIR)
-
-IF(SAMPLERATE_FOUND)
- SET(SAMPLERATE_LIBRARIES ${SAMPLERATE_LIBRARY})
- SET(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE_INCLUDE_DIR})
-ENDIF(SAMPLERATE_FOUND)
-
-MARK_AS_ADVANCED(
- SAMPLERATE_INCLUDE_DIR
- SAMPLERATE_LIBRARY
-)
diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py
index f6d46904794..1c8d619a513 100644
--- a/build_files/cmake/cmake_static_check_cppcheck.py
+++ b/build_files/cmake/cmake_static_check_cppcheck.py
@@ -37,12 +37,13 @@ CHECKER_BIN = "cppcheck"
CHECKER_ARGS = [
# not sure why this is needed, but it is.
- "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern/glew/include"),
+ "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
# "--check-config", # when includes are missing
# "--enable=all", # if you want sixty hundred pedantic suggestions
]
+
def main():
source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
@@ -57,19 +58,21 @@ def main():
check_commands.append((c, cmd))
- for i, (c, cmd) in enumerate(check_commands):
- percent = 100.0 * (i / (len(check_commands)-1))
+ process_functions = []
+
+ def my_process(i, c, cmd):
+ percent = 100.0 * (i / (len(check_commands) - 1))
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
-
- # if percent < 27.9:
- # continue
-
- # let cppcheck finish the line off...
- sys.stdout.write("%s " % percent_str)
sys.stdout.flush()
- process = subprocess.Popen(cmd)
- process.wait()
+ sys.stdout.write("%s " % percent_str)
+
+ return subprocess.Popen(cmd)
+
+ for i, (c, cmd) in enumerate(check_commands):
+ process_functions.append((my_process, (i, c, cmd)))
+
+ project_source_info.queue_processes(process_functions)
if __name__ == "__main__":
diff --git a/build_files/cmake/cmake_static_check_sparse.py b/build_files/cmake/cmake_static_check_sparse.py
index 9af53ed8008..aa2d56e5509 100644
--- a/build_files/cmake/cmake_static_check_sparse.py
+++ b/build_files/cmake/cmake_static_check_sparse.py
@@ -52,15 +52,21 @@ def main():
check_commands.append((c, cmd))
- for i, (c, cmd) in enumerate(check_commands):
+ def my_process(i, c, cmd):
percent = 100.0 * (i / (len(check_commands) - 1))
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
- sys.stdout.write("%s %s\n" % (percent_str, c))
sys.stdout.flush()
+ sys.stdout.write("%s %s\n" % (percent_str, c))
+
+ return subprocess.Popen(cmd)
+
+ process_functions = []
+ for i, (c, cmd) in enumerate(check_commands):
+ process_functions.append((my_process, (i, c, cmd)))
+
+ project_source_info.queue_processes(process_functions)
- process = subprocess.Popen(cmd)
- process.wait()
if __name__ == "__main__":
main()
diff --git a/build_files/cmake/cmake_static_check_splint.py b/build_files/cmake/cmake_static_check_splint.py
index 3614ab48cf8..08d83337426 100644
--- a/build_files/cmake/cmake_static_check_splint.py
+++ b/build_files/cmake/cmake_static_check_splint.py
@@ -58,9 +58,9 @@ CHECKER_ARGS = [
# re-definitions, rna causes most of these
"-redef",
"-syntax",
-
+
# dummy, witjout this splint complains with:
- # /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON
+ # /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON
"-D_PC_MAX_CANON=0",
]
@@ -84,15 +84,21 @@ def main():
check_commands.append((c, cmd))
- for i, (c, cmd) in enumerate(check_commands):
+ def my_process(i, c, cmd):
percent = 100.0 * (i / (len(check_commands) - 1))
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
sys.stdout.write("%s %s\n" % (percent_str, c))
sys.stdout.flush()
- process = subprocess.Popen(cmd)
- process.wait()
+ return subprocess.Popen(cmd)
+
+ process_functions = []
+ for i, (c, cmd) in enumerate(check_commands):
+ process_functions.append((my_process, (i, c, cmd)))
+
+ project_source_info.queue_processes(process_functions)
+
if __name__ == "__main__":
main()
diff --git a/build_files/cmake/config/blender_headless.cmake b/build_files/cmake/config/blender_headless.cmake
index bd69eed30dd..c4d64125744 100644
--- a/build_files/cmake/config/blender_headless.cmake
+++ b/build_files/cmake/config/blender_headless.cmake
@@ -11,7 +11,6 @@ set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.
set(WITH_AUDASPACE OFF CACHE FORCE BOOL)
-set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
set(WITH_FFTW3 OFF CACHE FORCE BOOL)
set(WITH_JACK OFF CACHE FORCE BOOL)
set(WITH_SDL OFF CACHE FORCE BOOL)
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index f09a8058f14..6791028a888 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -38,6 +38,5 @@ set(WITH_OPENCOLLADA OFF CACHE FORCE BOOL)
set(WITH_OPENMP OFF CACHE FORCE BOOL)
set(WITH_PYTHON_INSTALL OFF CACHE FORCE BOOL)
set(WITH_RAYOPTIMIZATION OFF CACHE FORCE BOOL)
-set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
set(WITH_SDL OFF CACHE FORCE BOOL)
set(WITH_X11_XINPUT OFF CACHE FORCE BOOL)
diff --git a/build_files/cmake/config/bpy_module.cmake b/build_files/cmake/config/bpy_module.cmake
index 5392705f0dc..6279f06214f 100644
--- a/build_files/cmake/config/bpy_module.cmake
+++ b/build_files/cmake/config/bpy_module.cmake
@@ -18,7 +18,6 @@ set(WITH_GAMEENGINE OFF CACHE FORCE BOOL)
# disable audio, its possible some devs may want this but for now disable
# so the python module doesnt hold the audio device and loads quickly.
set(WITH_AUDASPACE OFF CACHE FORCE BOOL)
-set(WITH_SAMPLERATE OFF CACHE FORCE BOOL)
set(WITH_FFTW3 OFF CACHE FORCE BOOL)
set(WITH_JACK OFF CACHE FORCE BOOL)
set(WITH_SDL OFF CACHE FORCE BOOL)
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 9671bffe2bd..db6c080d98d 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -187,9 +187,6 @@ macro(SETUP_LIBDIRS)
if(WITH_CODEC_SNDFILE)
link_directories(${SNDFILE_LIBPATH})
endif()
- if(WITH_SAMPLERATE)
- link_directories(${SAMPLERATE_LIBPATH})
- endif()
if(WITH_FFTW3)
link_directories(${FFTW3_LIBPATH})
endif()
@@ -219,6 +216,7 @@ macro(setup_liblinks
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
+ ${FREETYPE_LIBRARY}
${PLATFORM_LINKLIBS})
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
@@ -239,15 +237,8 @@ macro(setup_liblinks
target_link_libraries(${target} ${GLEW_LIBRARY})
endif()
- target_link_libraries(${target}
- ${OPENGL_glu_LIBRARY}
- ${JPEG_LIBRARIES}
- ${PNG_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${FREETYPE_LIBRARY})
-
if(WITH_INTERNATIONAL)
- target_link_libraries(${target} ${GETTEXT_LIB})
+ target_link_libraries(${target} ${GETTEXT_LIBRARIES})
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${ICONV_LIBRARIES})
@@ -266,9 +257,6 @@ macro(setup_liblinks
if(WITH_CODEC_SNDFILE)
target_link_libraries(${target} ${SNDFILE_LIBRARIES})
endif()
- if(WITH_SAMPLERATE)
- target_link_libraries(${target} ${SAMPLERATE_LIBRARIES})
- endif()
if(WITH_SDL)
target_link_libraries(${target} ${SDL_LIBRARY})
endif()
@@ -298,6 +286,11 @@ macro(setup_liblinks
target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
endif()
if(WITH_CODEC_FFMPEG)
+
+ # Strange!, without this ffmpeg gives linking errors (on linux)
+ # even though its linked above
+ target_link_libraries(${target} ${OPENGL_glu_LIBRARY})
+
target_link_libraries(${target} ${FFMPEG_LIBRARIES})
endif()
if(WITH_OPENCOLLADA)
@@ -338,44 +331,59 @@ macro(setup_liblinks
endif()
endmacro()
-macro(TEST_SSE_SUPPORT)
+macro(TEST_SSE_SUPPORT
+ _sse_flags
+ _sse2_flags)
+
include(CheckCSourceRuns)
# message(STATUS "Detecting SSE support")
- if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_REQUIRED_FLAGS "-msse -msse2")
+ if(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
+ set(${_sse_flags} "-msse")
+ set(${_sse2_flags} "-msse2")
elseif(MSVC)
- set(CMAKE_REQUIRED_FLAGS "/arch:SSE2") # TODO, SSE 1 ?
+ set(${_sse_flags} "/arch:SSE")
+ set(${_sse2_flags} "/arch:SSE2")
+ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
+ set(${_sse_flags} "") # icc defaults to -msse
+ set(${_sse2_flags} "-msse2")
+ else()
+ message(WARNING "SSE flags for this compiler: '${CMAKE_C_COMPILER_ID}' not known")
+ set(${_sse_flags})
+ set(${_sse2_flags})
endif()
- if(NOT DEFINED ${SUPPORT_SSE_BUILD})
+ set(CMAKE_REQUIRED_FLAGS "${${_sse_flags}} ${${_sse2_flags}}")
+
+ if(NOT DEFINED SUPPORT_SSE_BUILD)
+ # result cached
check_c_source_runs("
#include <xmmintrin.h>
- int main() { __m128 v = _mm_setzero_ps(); return 0; }"
+ int main(void) { __m128 v = _mm_setzero_ps(); return 0; }"
SUPPORT_SSE_BUILD)
-
+
if(SUPPORT_SSE_BUILD)
message(STATUS "SSE Support: detected.")
else()
message(STATUS "SSE Support: missing.")
endif()
- set(${SUPPORT_SSE_BUILD} ${SUPPORT_SSE_BUILD} CACHE INTERNAL "SSE Test")
- endif()
+ endif()
- if(NOT DEFINED ${SUPPORT_SSE2_BUILD})
+ if(NOT DEFINED SUPPORT_SSE2_BUILD)
+ # result cached
check_c_source_runs("
#include <emmintrin.h>
- int main() { __m128d v = _mm_setzero_pd(); return 0; }"
+ int main(void) { __m128d v = _mm_setzero_pd(); return 0; }"
SUPPORT_SSE2_BUILD)
if(SUPPORT_SSE2_BUILD)
message(STATUS "SSE2 Support: detected.")
else()
message(STATUS "SSE2 Support: missing.")
- endif()
- set(${SUPPORT_SSE2_BUILD} ${SUPPORT_SSE2_BUILD} CACHE INTERNAL "SSE2 Test")
+ endif()
endif()
+ unset(CMAKE_REQUIRED_FLAGS)
endmacro()
# when we have warnings as errors applied globally this
@@ -494,7 +502,7 @@ macro(get_blender_version)
if(${_out_version_char_empty})
set(BLENDER_VERSION_CHAR_INDEX "0")
else()
- set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w q y z)
+ set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1")
unset(_char_ls)
@@ -511,7 +519,7 @@ endmacro()
# hacks to override initial project settings
-# these macros must be called directly before/after project(Blender)
+# these macros must be called directly before/after project(Blender)
macro(blender_project_hack_pre)
# ----------------
# MINGW HACK START
@@ -553,8 +561,10 @@ macro(blender_project_hack_post)
# have libs we define and that cmake & scons builds match.
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
- mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
- mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
+ mark_as_advanced(
+ CMAKE_C_STANDARD_LIBRARIES
+ CMAKE_CXX_STANDARD_LIBRARIES
+ )
endif()
unset(_reset_standard_libraries)
diff --git a/build_files/cmake/project_source_info.py b/build_files/cmake/project_source_info.py
index c4b83d20ea5..c636d778aaa 100644
--- a/build_files/cmake/project_source_info.py
+++ b/build_files/cmake/project_source_info.py
@@ -27,7 +27,6 @@ __all__ = (
)
import os
-import sys
from os.path import join, dirname, normpath, abspath
SOURCE_DIR = join(dirname(__file__), "..", "..")
@@ -40,11 +39,6 @@ def is_c_header(filename):
return (ext in (".h", ".hpp", ".hxx"))
-def is_c_header(filename):
- ext = os.path.splitext(filename)[1]
- return (ext in (".h", ".hpp", ".hxx"))
-
-
def is_c(filename):
ext = os.path.splitext(filename)[1]
return (ext in (".c", ".cpp", ".cxx", ".m", ".mm", ".rc"))
@@ -79,6 +73,7 @@ def do_ignore(filepath, ignore_prefix_list):
def makefile_log():
import subprocess
+ import time
# Check blender is not 2.5x until it supports playback again
print("running make with --dry-run ...")
process = subprocess.Popen(["make", "--always-make", "--dry-run", "--keep-going", "VERBOSE=1"],
@@ -153,6 +148,45 @@ def build_info(use_c=True, use_cxx=True, ignore_prefix_list=None):
return source
+# could be moved elsewhere!, this just happens to be used by scripts that also
+# use this module.
+def queue_processes(process_funcs, job_total=-1):
+ """ Takes a list of function arg pairs, each function must return a process
+ """
+ import sys
+
+ if job_total == -1:
+ import multiprocessing
+ job_total = multiprocessing.cpu_count()
+ del multiprocessing
+
+ if job_total == 1:
+ for func, args in process_funcs:
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+ process = func(*args)
+ process.wait()
+ else:
+ import time
+
+ processes = []
+ for func, args in process_funcs:
+ # wait until a thread is free
+ while 1:
+ processes[:] = [p for p in processes if p.poll() is None]
+
+ if len(processes) <= job_total:
+ break
+ else:
+ time.sleep(0.1)
+
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+ processes.append(func(*args))
+
+
def main():
if not os.path.exists(join(CMAKE_DIR, "CMakeCache.txt")):
print("This script must run from the cmake build dir")
diff --git a/build_files/package_spec/debian/control b/build_files/package_spec/debian/control
index be703e05071..addd71760d8 100644
--- a/build_files/package_spec/debian/control
+++ b/build_files/package_spec/debian/control
@@ -2,7 +2,7 @@ Source: blender
Section: graphics
Priority: extra
Maintainer: Dan Eicher <dan@trollwerks.org>
-Build-Depends: debhelper (>= 7.0.50~), cmake, python3, python, libfreetype6-dev, libglu1-mesa-dev, libilmbase-dev, libopenexr-dev, libjpeg62-dev, libopenal-dev, libpng12-dev, libsamplerate0-dev, libsdl-dev, libtiff4-dev, libx11-dev, libxi-dev, zlib1g-dev, python3.2-dev, libopenjpeg-dev
+Build-Depends: debhelper (>= 7.0.50~), cmake, python3, python, libfreetype6-dev, libglu1-mesa-dev, libilmbase-dev, libopenexr-dev, libjpeg62-dev, libopenal-dev, libpng12-dev, libsdl-dev, libtiff4-dev, libx11-dev, libxi-dev, zlib1g-dev, python3.2-dev, libopenjpeg-dev
Standards-Version: 3.9.1
Homepage: http://blender.org/
X-Python3-Version: >= 3.2, << 3.3
diff --git a/build_files/package_spec/pacman/PKGBUILD b/build_files/package_spec/pacman/PKGBUILD
index 0c4164b1242..e59d1cf31d7 100644
--- a/build_files/package_spec/pacman/PKGBUILD
+++ b/build_files/package_spec/pacman/PKGBUILD
@@ -4,7 +4,7 @@
blender_srcdir=$(dirname $startdir)"/../.."
# value may be formatted: 35042:35051M
blender_revision=$(svnversion $blender_srcdir | cut -d: -f2 | awk '{print $3}')
-blender_version=$(grep BLENDER_VERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
+blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
blender_version=$(expr $blender_version / 100).$(expr $blender_version % 100) # 256 -> 2.56
blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blender_srcdir/source/blender/blenkernel/BKE_blender.h)
# blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
@@ -12,10 +12,12 @@ blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blen
# map the version a -> 1
# not to be confused with blender's internal subversions
if [ "$blender_version_char" ]; then
- blender_version=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
+ blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
+else
+ blender_version_full=${blender_version}
fi
-blender_ver_string=$blender_version+svn$blender_revision
+blender_ver_string=$blender_version+svn$blender_version_full
pkgname=blender-snapshot
pkgver=$blender_ver_string
@@ -25,7 +27,7 @@ arch=('i686' 'x86_64')
url="www.blender.org"
license=('GPL')
groups=()
-depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'libsamplerate' 'ffmpeg')
+depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg')
makedepends=('cmake' 'svn')
optdepends=()
provides=()
@@ -61,5 +63,8 @@ build() {
package() {
cd $srcdir/build
make DESTDIR="$pkgdir" install
- python -m compileall $pkgdir/usr/share/blender
+ python -m compileall \
+ $pkgdir/usr/share/blender/$blender_version/scripts/startup \
+ $pkgdir/usr/share/blender/$blender_version/scripts/modules \
+ $pkgdir/usr/share/blender/$blender_version/scripts/addons
}
diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py
index 29d2b39323e..0c132041d82 100644
--- a/build_files/scons/config/darwin-config.py
+++ b/build_files/scons/config/darwin-config.py
@@ -90,9 +90,10 @@ LIBDIR = '${LCGDIR}'
################### Dependency settings ##################
#############################################################################
-#Defaults openMP to true if compiler handles it
-if CC == 'gcc-4.2' or CC == 'llvm-gcc-4.2':
- WITH_BF_OPENMP = True # multithreading for fluids, cloth and smoke
+#Defaults openMP to true if compiler handles it ( only gcc 4.6.1 and newer )
+# if your compiler does not have accurate suffix you may have to enable it by hand !
+if CC.endswith('4.6.1'):
+ WITH_BF_OPENMP = True # multithreading for fluids, cloth, sculpt and smoke
else:
WITH_BF_OPENMP = False
@@ -147,11 +148,6 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
# TODO - set proper paths here (add precompiled to lib/ ? )
WITH_BF_JACK = False
BF_JACK = '/usr'
diff --git a/build_files/scons/config/freebsd7-config.py b/build_files/scons/config/freebsd7-config.py
index a73574abf67..fec7531b3c7 100644
--- a/build_files/scons/config/freebsd7-config.py
+++ b/build_files/scons/config/freebsd7-config.py
@@ -25,11 +25,6 @@ BF_CXX = '/usr/local'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-BF_LIBSAMPLERATE = '/usr/local'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_JACK = True
BF_JACK = '/usr/local'
BF_JACK_INC = '${BF_JACK}/include/jack'
diff --git a/build_files/scons/config/freebsd8-config.py b/build_files/scons/config/freebsd8-config.py
index dd7ab5f9ab9..eea89bf24ff 100644
--- a/build_files/scons/config/freebsd8-config.py
+++ b/build_files/scons/config/freebsd8-config.py
@@ -25,11 +25,6 @@ BF_CXX = '/usr/local'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-BF_LIBSAMPLERATE = '/usr/local'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_JACK = True
BF_JACK = '/usr/local'
BF_JACK_INC = '${BF_JACK}/include/jack'
diff --git a/build_files/scons/config/freebsd9-config.py b/build_files/scons/config/freebsd9-config.py
index 9c53d52ce71..a63da6e35f9 100644
--- a/build_files/scons/config/freebsd9-config.py
+++ b/build_files/scons/config/freebsd9-config.py
@@ -25,11 +25,6 @@ BF_CXX = '/usr/local'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-BF_LIBSAMPLERATE = '/usr/local'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_JACK = True
BF_JACK = '/usr/local'
BF_JACK_INC = '${BF_JACK}/include/jack'
diff --git a/build_files/scons/config/irix6-config.py b/build_files/scons/config/irix6-config.py
index 4ca7bcc7b64..e69de29bb2d 100644
--- a/build_files/scons/config/irix6-config.py
+++ b/build_files/scons/config/irix6-config.py
@@ -1,208 +0,0 @@
-import os
-
-LCGDIR = os.getcwd()+"/../lib/irix-6.5-mips"
-LIBDIR = LCGDIR
-
-BF_PYTHON = LCGDIR+'/python'
-BF_PYTHON_VERSION = '3.2'
-WITH_BF_STATICPYTHON = 'true'
-BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
-BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
-BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
-BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config/libpython${BF_PYTHON_VERSION}.a'
-
-WITH_BF_OPENAL = 'true'
-WITH_BF_STATICOPENAL = 'true'
-BF_OPENAL = LCGDIR+'/openal'
-BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'openal'
-BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
-BF_OPENAL_LIBPATH = LIBDIR + '/lib'
-
-BF_CXX = '/usr'
-WITH_BF_STATICCXX = 'false'
-BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-
-BF_LIBSAMPLERATE = LCGDIR+'/samplerate'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
-WITH_BF_SDL = 'true'
-BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix)
-BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
-BF_SDL_LIB = 'SDL audio iconv charset' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
-BF_SDL_LIBPATH = '${BF_SDL}/lib'
-
-WITH_BF_OPENEXR = 'false'
-WITH_BF_STATICOPENEXR = 'false'
-BF_OPENEXR = '/usr'
-# when compiling with your own openexr lib you might need to set...
-# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
-
-BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
-BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
-BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
-# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
-
-
-WITH_BF_DDS = 'false'
-
-WITH_BF_JPEG = 'false'
-BF_JPEG = LCGDIR+'/jpeg'
-BF_JPEG_INC = '${BF_JPEG}/include'
-BF_JPEG_LIB = 'jpeg'
-BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
-
-WITH_BF_PNG = 'false'
-BF_PNG = LCGDIR+"/png"
-BF_PNG_INC = '${BF_PNG}/include'
-BF_PNG_LIB = 'png'
-BF_PNG_LIBPATH = '${BF_PNG}/lib'
-
-BF_TIFF = '/usr/nekoware'
-BF_TIFF_INC = '${BF_TIFF}/include'
-
-WITH_BF_ZLIB = 'true'
-BF_ZLIB = LCGDIR+"/zlib"
-BF_ZLIB_INC = '${BF_ZLIB}/include'
-BF_ZLIB_LIB = 'z'
-BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
-
-WITH_BF_INTERNATIONAL = 'true'
-
-BF_GETTEXT = LCGDIR+'/gettext'
-BF_GETTEXT_INC = '${BF_GETTEXT}/include'
-BF_GETTEXT_LIB = 'gettextpo intl'
-BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
-
-WITH_BF_GAMEENGINE='false'
-WITH_BF_PLAYER = 'false'
-
-WITH_BF_BULLET = 'true'
-BF_BULLET = '#extern/bullet2/src'
-BF_BULLET_INC = '${BF_BULLET}'
-BF_BULLET_LIB = 'extern_bullet'
-
-#WITH_BF_NSPR = 'true'
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB =
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-#
-# Be paranoid regarding library creation (do not update archives)
-#BF_PARANOID = 'true'
-
-# enable freetype2 support for text objects
-BF_FREETYPE = LCGDIR+'/freetype'
-BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
-BF_FREETYPE_LIB = 'freetype'
-BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
-
-WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
-BF_QUICKTIME = '/usr/local'
-BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
-
-WITH_BF_ICONV = 'true'
-BF_ICONV = LIBDIR + "/iconv"
-BF_ICONV_INC = '${BF_ICONV}/include'
-BF_ICONV_LIB = 'iconv charset'
-BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
-
-WITH_BF_BINRELOC = 'false'
-
-# enable ffmpeg support
-WITH_BF_FFMPEG = 'true' # -DWITH_FFMPEG
-# Uncomment the following two lines to use system's ffmpeg
-BF_FFMPEG = LCGDIR+'/ffmpeg'
-BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice faad faac vorbis x264 ogg mp3lame z'
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
-BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-
-# enable ogg, vorbis and theora in ffmpeg
-WITH_BF_OGG = 'false' # -DWITH_OGG
-BF_OGG = '/usr'
-BF_OGG_INC = '${BF_OGG}/include'
-BF_OGG_LIB = 'ogg vorbis theoraenc theoradec'
-
-WITH_BF_OPENJPEG = 'false'
-BF_OPENJPEG = '#extern/libopenjpeg'
-BF_OPENJPEG_LIB = ''
-BF_OPENJPEG_INC = '${BF_OPENJPEG}'
-BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
-
-WITH_BF_REDCODE = 'false'
-BF_REDCODE = '#extern/libredcode'
-BF_REDCODE_LIB = ''
-BF_REDCODE_INC = '${BF_REDCODE}/include'
-BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
-
-# Mesa Libs should go here if your using them as well....
-WITH_BF_STATICOPENGL = 'false'
-BF_OPENGL = '/usr'
-BF_OPENGL_INC = '${BF_OPENGL}/include'
-BF_OPENGL_LIB = 'GL GLU X11 Xi Xext'
-BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
-BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/libXxf86vm.a ${BF_OPENGL}/libX11.a ${BF_OPENGL}/libXi.a ${BF_OPENGL}/libXext.a ${BF_OPENGL}/libXxf86vm.a'
-
-
-CC = 'c99'
-CXX = 'CC'
-
-
-CCFLAGS = ['-pipe','-fPIC', '-n32']
-
-CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC', '-n32']
-REL_CFLAGS = ['-DNDEBUG', '-O2']
-REL_CCFLAGS = ['-DNDEBUG', '-O2']
-##BF_DEPEND = 'true'
-##
-##AR = ar
-##ARFLAGS = ruv
-##ARFLAGSQUIET = ru
-##
-C_WARN = ['-no_prelink', '-ptused']
-
-CC_WARN = ['-no_prelink', '-ptused']
-
-##FIX_STUBS_WARNINGS = -Wno-unused
-
-LLIBS = 'c m dl pthread dmedia movie'
-##LOPTS = --dynamic
-##DYNLDFLAGS = -shared $(LDFLAGS)
-
-BF_PROFILE_FLAGS = ['-pg','-g']
-BF_PROFILE = 'false'
-
-BF_DEBUG = 'false'
-BF_DEBUG_CCFLAGS = ['-g']
-
-BF_BUILDDIR = '../build/irix6'
-BF_INSTALLDIR='../install/irix6'
-
-#Link against pthread
-LDIRS = []
-LDIRS.append(BF_FREETYPE_LIBPATH)
-LDIRS.append(BF_PNG_LIBPATH)
-LDIRS.append(BF_ZLIB_LIBPATH)
-LDIRS.append(BF_SDL_LIBPATH)
-LDIRS.append(BF_OPENAL_LIBPATH)
-LDIRS.append(BF_ICONV_LIBPATH)
-
-PLATFORM_LINKFLAGS = []
-for x in LDIRS:
- PLATFORM_LINKFLAGS.append("-L"+x)
-
-PLATFORM_LINKFLAGS += ['-L${LCGDIR}/jpeg/lib' , '-L/usr/lib32', '-n32', '-v', '-no_prelink']
-print PLATFORM_LINKFLAGS
-LINKFLAGS= PLATFORM_LINKFLAGS
diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py
index c6613ec0ac1..a26748cd8dc 100644
--- a/build_files/scons/config/linux-config.py
+++ b/build_files/scons/config/linux-config.py
@@ -23,13 +23,6 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-BF_LIBSAMPLERATE = '/usr'
-WITH_BF_STATICLIBSAMPLERATE = False
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-BF_LIBSAMPLERATE_LIB_STATIC = '${BF_LIBSAMPLERATE}/lib/libsamplerate.a'
-
WITH_BF_JACK = False
BF_JACK = '/usr'
BF_JACK_INC = '${BF_JACK}/include/jack'
diff --git a/build_files/scons/config/linuxcross-config.py b/build_files/scons/config/linuxcross-config.py
index 8057d478c31..070e18a5af0 100644
--- a/build_files/scons/config/linuxcross-config.py
+++ b/build_files/scons/config/linuxcross-config.py
@@ -23,11 +23,6 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
diff --git a/build_files/scons/config/openbsd3-config.py b/build_files/scons/config/openbsd3-config.py
index 67d850ff48d..83c515d52f3 100644
--- a/build_files/scons/config/openbsd3-config.py
+++ b/build_files/scons/config/openbsd3-config.py
@@ -16,11 +16,6 @@ WITH_BF_OPENAL = False
#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
-BF_LIBSAMPLERATE = '/usr/local'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_SDL = True
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
diff --git a/build_files/scons/config/sunos5-config.py b/build_files/scons/config/sunos5-config.py
index 828e286efee..0cf78c9220f 100644
--- a/build_files/scons/config/sunos5-config.py
+++ b/build_files/scons/config/sunos5-config.py
@@ -22,11 +22,6 @@ BF_CXX = '/usr'
WITH_BF_STATICCXX = False
BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-BF_LIBSAMPLERATE = '/usr/local'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'samplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_SDL = True
BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py
index 37d693db560..167ed502bf6 100644
--- a/build_files/scons/config/win32-mingw-config.py
+++ b/build_files/scons/config/win32-mingw-config.py
@@ -23,11 +23,6 @@ BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib'
BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include'
BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
-BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'libsamplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include'
diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py
index 2950ca9380f..9604eb5d320 100644
--- a/build_files/scons/config/win32-vc-config.py
+++ b/build_files/scons/config/win32-vc-config.py
@@ -29,11 +29,6 @@ BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
-BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'libsamplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_JACK = False
BF_JACK = LIBDIR + '/jack'
BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
@@ -152,6 +147,8 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
WITH_BF_3DMOUSE = True
+WITH_BF_OPENMP = True
+
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py
index 280ba3dd3f1..049b7eb5d40 100644
--- a/build_files/scons/config/win64-vc-config.py
+++ b/build_files/scons/config/win64-vc-config.py
@@ -17,7 +17,7 @@ BF_PYTHON_LIB = 'python32'
BF_PYTHON_DLL = '${BF_PYTHON_LIB}'
BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
-WITH_BF_OPENAL = False
+WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'wrap_oal'
@@ -40,11 +40,6 @@ BF_ICONV_INC = '${BF_ICONV}/include'
BF_ICONV_LIB = 'iconv'
BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
-BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
-BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
-BF_LIBSAMPLERATE_LIB = 'libsamplerate'
-BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
-
WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include'
@@ -156,6 +151,8 @@ BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
WITH_BF_3DMOUSE = True
+WITH_BF_OPENMP = True
+
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE','/arch:SSE2']
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index 54fa6077bf7..b9632bfffa7 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -131,7 +131,6 @@ def setup_staticlibs(lenv):
lenv['BF_JPEG_LIBPATH'],
lenv['BF_ZLIB_LIBPATH'],
lenv['BF_PNG_LIBPATH'],
- lenv['BF_LIBSAMPLERATE_LIBPATH'],
lenv['BF_ICONV_LIBPATH']
])
@@ -194,9 +193,6 @@ def setup_staticlibs(lenv):
if lenv['OURPLATFORM'] == 'linuxcross':
libincs += Split(lenv['BF_OPENMP_LIBPATH'])
- if lenv['WITH_BF_STATICLIBSAMPLERATE']:
- statlibs += Split(lenv['BF_LIBSAMPLERATE_LIB_STATIC'])
-
# setting this last so any overriding of manually libs could be handled
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
libincs.append('/usr/lib')
@@ -270,9 +266,6 @@ def setup_syslibs(lenv):
syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
syslibs.append(lenv['BF_EXPAT_LIB'])
- if not lenv['WITH_BF_STATICLIBSAMPLERATE']:
- syslibs += Split(lenv['BF_LIBSAMPLERATE_LIB'])
-
if lenv['WITH_BF_JEMALLOC']:
if not lenv['WITH_BF_STATICJEMALLOC']:
syslibs += Split(lenv['BF_JEMALLOC_LIB'])
@@ -561,25 +554,24 @@ def AppIt(target=None, source=None, env=None):
cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,installdir, binary, binary)
commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/'%(installdir, binary, VERSION)
-# print cmd
commands.getoutput(cmd)
cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION)
- cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/datafiles'%(installdir, binary, VERSION)
- commands.getoutput(cmd)
- cmd = 'cp -R %s/release/bin/.blender/locale %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
- commands.getoutput(cmd)
- cmd = 'cp -R %s/release/bin/.blender/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
- commands.getoutput(cmd)
- cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
- commands.getoutput(cmd)
+
+ # blenderplayer doesn't need all the files
+ if binary == 'blender':
+ cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/datafiles'%(installdir, binary, VERSION)
+ commands.getoutput(cmd)
+ cmd = 'cp -R %s/release/bin/.blender/locale %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
+ commands.getoutput(cmd)
+ cmd = 'cp -R %s/release/bin/.blender/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
+ commands.getoutput(cmd)
+ cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
+ commands.getoutput(cmd)
+
if env['WITH_OSX_STATICPYTHON']:
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
commands.getoutput(cmd)
cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
- commands.getoutput(cmd)
-
- if binary == 'blender':#not copy everything for blenderplayer
- cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd)
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
@@ -633,7 +625,11 @@ def UnixPyBundle(target=None, source=None, env=None):
run("rm -rf '%s/distutils'" % py_target)
run("rm -rf '%s/lib2to3'" % py_target)
run("rm -rf '%s/config'" % py_target)
- run("rm -rf '%s/config-*'" % py_target)
+
+ for f in os.listdir(py_target):
+ if f.startswith("config-"):
+ run("rm -rf '%s/%s'" % (py_target, f))
+
run("rm -rf '%s/site-packages'" % py_target)
run("mkdir '%s/site-packages'" % py_target) # python needs it.'
run("rm -rf '%s/idlelib'" % py_target)
@@ -695,7 +691,7 @@ class BlenderEnvironment(SConsEnvironment):
SConsEnvironment.Default(self, res)
resources.append(res)
- def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None, cc_compileflags=None, cxx_compileflags=None):
+ def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None, cc_compileflags=None, cxx_compileflags=None, cc_compilerchange=None, cxx_compilerchange=None):
global vcp
if not self or not libname or not sources:
print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC
@@ -733,6 +729,10 @@ class BlenderEnvironment(SConsEnvironment):
lenv.Replace(CCFLAGS = cc_compileflags)
if cxx_compileflags:
lenv.Replace(CXXFLAGS = cxx_compileflags)
+ if cc_compilerchange:
+ lenv.Replace(CC = cc_compilerchange)
+ if cxx_compilerchange:
+ lenv.Replace(CXX = cxx_compilerchange)
lenv.Append(CFLAGS = lenv['C_WARN'])
lenv.Append(CCFLAGS = lenv['CC_WARN'])
lenv.Append(CXXFLAGS = lenv['CXX_WARN'])
diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py
index caa83ea41be..fe56d40ea56 100644
--- a/build_files/scons/tools/btools.py
+++ b/build_files/scons/tools/btools.py
@@ -99,7 +99,6 @@ def validate_arguments(args, bc):
'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS',
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
- 'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH', 'WITH_BF_STATICLIBSAMPLERATE', 'BF_LIBSAMPLERATE_LIB_STATIC',
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH',
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC',
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
@@ -267,13 +266,6 @@ def read_opts(env, cfg, args):
('BF_SDL_LIB', 'SDL library', ''),
('BF_SDL_LIBPATH', 'SDL library path', ''),
- ('BF_LIBSAMPLERATE', 'libsamplerate aka SRC base path', ''),
- ('BF_LIBSAMPLERATE_INC', 'libsamplerate aka SRC include path', ''),
- ('BF_LIBSAMPLERATE_LIB', 'libsamplerate aka SRC library', ''),
- ('BF_LIBSAMPLERATE_LIBPATH', 'libsamplerate aka SRC library path', ''),
- ('BF_LIBSAMPLERATE_LIB_STATIC', 'Path to libsamplerate static library', ''),
- (BoolVariable('WITH_BF_STATICLIBSAMPLERATE', 'Staticly link to libsamplerate', False)),
-
(BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
('BF_JACK', 'jack base path', ''),
('BF_JACK_INC', 'jack include path', ''),
diff --git a/doc/build_systems/cmake.txt b/doc/build_systems/cmake.txt
index 1ff621c6e96..d0e8a088ca7 100644
--- a/doc/build_systems/cmake.txt
+++ b/doc/build_systems/cmake.txt
@@ -11,7 +11,7 @@ $Id$
3. Obtaining Dependencies
4. Deciding on a Build Environment
5. Configuring the build for the first time
- 6. Configuring the build after CVS updates
+ 6. Configuring the build after SVN updates
7. Specify alternate Python library versions and locations
@@ -36,7 +36,7 @@ $Id$
http://www.blender.org/cms/Getting_Dependencies.135.0.html that you
have all dependencies needed for building Blender. Note that for
windows many of these dependencies already come in the lib/windows
- module from CVS.
+ module from SVN.
4. Deciding on a Build Environment
----------------------------------
@@ -47,8 +47,8 @@ $Id$
have been successfully used to generate build files for the following
environments:
- 1. Microsoft Visual Studio 2005. There is a free version available
- at http://msdn.microsoft.com/vstudio/express/visualc/.
+ 1. Microsoft Visual Studio 2008. There is a free version available
+ at http://http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express
2. Xcode on Mac OSX
@@ -65,7 +65,7 @@ $Id$
with different Blender configurations (Audio/NoAudio, GameEngine/NoGameEngine etc.)
while maintaining a clean source tree. It also makes it possible to generate files
for different build systems on the same source tree. This also has benefits for
- general CVS management for the developer as patches and submit logs are much cleaner.
+ general SVN management for the developer as patches and submit logs are much cleaner.
Create a directory outside the blender source tree where you would like to build
Blender (from now on called $BLENDERBUILD). On the commandline you can then run
@@ -78,27 +78,27 @@ $Id$
% cd $BLENDERBUILD
% cmake
- ...
- ...
- --version [file] = Show program name/version banner and exit.
+ ...
+ ...
+ --version [file] = Show program name/version banner and exit.
- Generators
+ Generators
- The following generators are available on this platform:
- KDevelop3 = Generates KDevelop 3 project files.
- Unix Makefiles = Generates standard UNIX makefiles.
- Xcode = Generate XCode project files.
+ The following generators are available on this platform:
+ KDevelop3 = Generates KDevelop 3 project files.
+ Unix Makefiles = Generates standard UNIX makefiles.
+ Xcode = Generate XCode project files.
% cmake -G Xcode $BLENDERSOURCE
- ...
- ...
- -- Configuring blender
- -- Configuring blenderplayer
- -- Configuring done
- -- Generating done
- -- Build files have been written to: $BLENDERBUILD
+ ...
+ ...
+ -- Configuring blender
+ -- Configuring blenderplayer
+ -- Configuring done
+ -- Generating done
+ -- Build files have been written to: $BLENDERBUILD
This will generate the build files with default values. Specific features can
be enabled or disabled by running the ccmake "GUI" from $BLENDERBUILD as follows:
@@ -114,15 +114,15 @@ $Id$
It is also possible to use the commandline of 'cmake' to override certain
of these settings.
- 6. Configuring the build after CVS updates
+ 6. Configuring the build after SVN updates
------------------------------------------
The $BLENDERBUILD directory maintains a file called CMakeCache.txt which
remembers the initial run's settings for subsequent generation runs. After
- every CVS update it may be a good idea to rerun the generation before building
+ every SVN update it may be a good idea to rerun the generation before building
Blender again. Just rerun the original 'cmake' run to do this, the settings
will be remembered. For the example above the following will do after every
- 'cvs up':
+ 'svn up':
% cmake -G Xcode $BLENDERSOURCE
@@ -132,9 +132,9 @@ $Id$
The commandline can be used to override detected/default settings, e.g:
On Unix:
- cmake -D PYTHON_LIBRARY=/usr/local/lib/python3.1/config/libpython3.1.so -D PYTHON_INCLUDE_DIRS=/usr/local/include/python3.1 -G "Unix Makefiles" ../blender
+ cmake -D PYTHON_LIBRARY=/usr/local/lib/python3.2/config/libpython3.2.so -D PYTHON_INCLUDE_DIR=/usr/local/include/python3.2 ../blender
On Macs:
- cmake -D PYTHON_INCLUDE_DIRS=/System/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1 -G Xcode ../blender
+ cmake -D PYTHON_INCLUDE_DIRS=/System/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2 -G Xcode ../blender
Mote that this should only be needed once per build directory generation because it will keep the overrides in CMakeCache.txt for subsequent runs.
@@ -153,4 +153,3 @@ $Id$
on the various platforms.
/Jacques Beaurain (jbinto)
-
diff --git a/doc/manpage/blender.1 b/doc/manpage/blender.1
index ddf3a79b104..20cd40e32ee 100644
--- a/doc/manpage/blender.1
+++ b/doc/manpage/blender.1
@@ -1,4 +1,4 @@
-.TH "BLENDER" "1" "June 03, 2011" "Blender Blender 2\&.57 (sub 1)"
+.TH "BLENDER" "1" "September 22, 2011" "Blender Blender 2\&.59 (sub 3)"
.SH NAME
blender \- a 3D modelling and rendering package
@@ -15,7 +15,7 @@ Use Blender to create TV commercials, to make technical visualizations, business
http://www.blender.org
.SH OPTIONS
-Blender 2.57 (sub 1)
+Blender 2.59 (sub 3)
Usage: blender [args ...] [file] [args ...]
.br
.SS "Render Options:"
diff --git a/doc/python_api/examples/aud.py b/doc/python_api/examples/aud.py
index e41e8214cc0..2c74d6a0eb1 100644
--- a/doc/python_api/examples/aud.py
+++ b/doc/python_api/examples/aud.py
@@ -11,10 +11,10 @@ device = aud.device()
factory = aud.Factory('music.ogg')
# play the audio, this return a handle to control play/pause
-handle = device.play(sound)
+handle = device.play(factory)
# if the audio is not too big and will be used often you can buffer it
-factory_buffered = aud.Factory.buffer(sound)
-handle_buffered = device.play(buffered)
+factory_buffered = aud.Factory.buffer(factory)
+handle_buffered = device.play(factory_buffered)
# stop the sounds (otherwise they play until their ends)
handle.stop()
diff --git a/doc/python_api/rst/change_log.rst b/doc/python_api/rst/change_log.rst
index e7db5df4a1f..d332c4faff4 100644
--- a/doc/python_api/rst/change_log.rst
+++ b/doc/python_api/rst/change_log.rst
@@ -909,3 +909,574 @@ Added
* :class:`bpy.types.SceneGameData.use_glsl_color_management`
+
+2.58 to 2.59
+============
+
+bpy.types.Scene
+---------------
+
+Function Arguments
+^^^^^^^^^^^^^^^^^^
+
+* :class:`bpy.types.Scene.collada_export` (filepath, selected), *was (filepath)*
+
+bpy.types.MultiresModifier
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.MultiresModifier.use_subsurf_uv`
+
+bpy.types.KeyMap
+----------------
+
+Removed
+^^^^^^^
+
+* **copy_to_user**
+
+Renamed
+^^^^^^^
+
+* **is_user_defined** -> :class:`bpy.types.KeyMap.is_user_modified`
+
+bpy.types.SceneRenderLayer
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SceneRenderLayer.use_pass_material_index`
+
+bpy.types.ToolSettings
+----------------------
+
+Renamed
+^^^^^^^
+
+* **use_snap_project_self** -> :class:`bpy.types.ToolSettings.use_snap_self`
+
+bpy.types.UserPreferencesInput
+------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.UserPreferencesInput.ndof_fly_helicopter`
+* :class:`bpy.types.UserPreferencesInput.ndof_lock_horizon`
+* :class:`bpy.types.UserPreferencesInput.ndof_orbit_invert_axes`
+* :class:`bpy.types.UserPreferencesInput.ndof_sensitivity`
+* :class:`bpy.types.UserPreferencesInput.ndof_show_guide`
+* :class:`bpy.types.UserPreferencesInput.ndof_zoom_invert`
+* :class:`bpy.types.UserPreferencesInput.ndof_zoom_updown`
+
+Removed
+^^^^^^^
+
+* **edited_keymaps**
+* **ndof_pan_speed**
+* **ndof_rotate_speed**
+
+bpy.types.IDMaterials
+---------------------
+
+Function Arguments
+^^^^^^^^^^^^^^^^^^
+
+* :class:`bpy.types.IDMaterials.pop` (index, update_data), *was (index)*
+
+bpy.types.Material
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Material.pass_index`
+
+bpy.types.RenderLayer
+---------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.RenderLayer.use_pass_material_index`
+
+bpy.types.Object
+----------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Object.closest_point_on_mesh`
+
+bpy.types.ThemeNodeEditor
+-------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ThemeNodeEditor.noodle_curving`
+
+bpy.types.ChildOfConstraint
+---------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ChildOfConstraint.inverse_matrix`
+
+bpy.types.KeyConfigurations
+---------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.KeyConfigurations.addon`
+* :class:`bpy.types.KeyConfigurations.user`
+
+bpy.types.Image
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Image.use_generated_float`
+
+bpy.types.KeyMapItem
+--------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.KeyMapItem.is_user_modified`
+
+
+2.59 to 2.60
+============
+
+.. These have been manually added wait until RC to do final changelog!
+
+bpy.types.MeshTextureFace
+-------------------------
+
+Removed
+^^^^^^^
+
+* **use_image**
+* **use_object_color**
+* **use_blend_shared**
+
+Moved
+^^^^^
+
+* **hide** -> :class:`bpy.types.Material.game_settings.invisible`
+* **use_collision** -> :class:`bpy.types.Material.game_settings.physics`
+* **use_light** -> :class:`bpy.types.Material.game_settings.use_shadeless`
+* **use_twoside** -> :class:`bpy.types.Material.game_settings.backface_culling`
+* **use_bitmap_text** -> :class:`bpy.types.Material.game_settings.text`
+* **blend_type** -> :class:`bpy.types.Material.game_settings.alpha_blend`
+* **use_alpha_sort** -> :class:`bpy.types.Material.game_settings.alpha_blend`
+* **use_billboard** -> :class:`bpy.types.Material.game_settings.face_orientation`
+* **use_halo** -> :class:`bpy.types.Material.game_settings.face_orientation`
+* **use_shadow_cast** -> :class:`bpy.types.Material.game_settings.face_orientation`
+
+.. Automatically Generated, 2.59 -> r40804!
+
+bpy.types.RenderSettings
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.RenderSettings.ffmpeg_audio_channels`
+
+bpy.types.DriverTarget
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.DriverTarget.transform_space`
+
+Removed
+^^^^^^^
+
+* **use_local_space_transform**
+
+bpy.types.Sound
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Sound.factory`
+* :class:`bpy.types.Sound.use_mono`
+
+bpy.types.Camera
+----------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Camera.view_frame`
+
+bpy.types.Scene
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Scene.audio_volume`
+
+bpy.types.KeyingSet
+-------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.KeyingSet.refresh`
+
+bpy.types.Armature
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Armature.deform_method`
+
+bpy.types.GameObjectSettings
+----------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.GameObjectSettings.obstacle_radius`
+* :class:`bpy.types.GameObjectSettings.use_obstacle_create`
+
+bpy.types.BlendData
+-------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.BlendData.speakers`
+
+bpy.types.SolidifyModifier
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SolidifyModifier.thickness_vertex_group`
+
+bpy.types.ThemeGraphEditor
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ThemeGraphEditor.handle_auto_clamped`
+* :class:`bpy.types.ThemeGraphEditor.handle_sel_auto_clamped`
+
+bpy.types.CompositorNodeIDMask
+------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.CompositorNodeIDMask.use_smooth_mask`
+
+bpy.types.Node
+--------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Node.parent`
+
+bpy.types.Texture
+-----------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Texture.evaluate`
+
+bpy.types.UILayout
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.UILayout.template_keymap_item_properties`
+
+bpy.types.ToolSettings
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ToolSettings.use_multipaint`
+
+bpy.types.UserPreferencesInput
+------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.UserPreferencesInput.ndof_panx_invert_axis`
+* :class:`bpy.types.UserPreferencesInput.ndof_pany_invert_axis`
+* :class:`bpy.types.UserPreferencesInput.ndof_panz_invert_axis`
+* :class:`bpy.types.UserPreferencesInput.ndof_roll_invert_axis`
+* :class:`bpy.types.UserPreferencesInput.ndof_rotate_invert_axis`
+* :class:`bpy.types.UserPreferencesInput.ndof_tilt_invert_axis`
+
+bpy.types.LockedTrackConstraint
+-------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.LockedTrackConstraint.head_tail`
+
+bpy.types.SpaceGraphEditor
+--------------------------
+
+Moved
+^^^^^
+
+* use_fancy_drawing -> :class:`bpy.types.SpaceGraphEditor.use_beauty_drawing`
+
+bpy.types.ParticleSystem
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ParticleSystem.dt_frac`
+
+bpy.types.Mesh
+--------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Mesh.use_paint_mask_vertex`
+
+bpy.types.FCurve
+----------------
+
+Removed
+^^^^^^^
+
+* **use_auto_handle_clamp**
+
+bpy.types.DampedTrackConstraint
+-------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.DampedTrackConstraint.head_tail`
+
+bpy.types.ImageTexture
+----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ImageTexture.use_derivative_map`
+
+bpy.types.SoundSequence
+-----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SoundSequence.pan`
+* :class:`bpy.types.SoundSequence.pitch`
+
+Removed
+^^^^^^^
+
+* **attenuation**
+
+bpy.types.FModifier
+-------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.FModifier.blend_in`
+* :class:`bpy.types.FModifier.blend_out`
+* :class:`bpy.types.FModifier.frame_end`
+* :class:`bpy.types.FModifier.frame_start`
+* :class:`bpy.types.FModifier.influence`
+* :class:`bpy.types.FModifier.use_influence`
+* :class:`bpy.types.FModifier.use_restricted_range`
+
+bpy.types.EnvironmentMap
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.EnvironmentMap.clear`
+* :class:`bpy.types.EnvironmentMap.is_valid`
+* :class:`bpy.types.EnvironmentMap.save`
+
+bpy.types.UserPreferencesSystem
+-------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.UserPreferencesSystem.use_translate_interface`
+
+Removed
+^^^^^^^
+
+* **use_translate_buttons**
+* **use_translate_toolbox**
+
+bpy.types.LimitDistanceConstraint
+---------------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.LimitDistanceConstraint.head_tail`
+* :class:`bpy.types.LimitDistanceConstraint.use_transform_limit`
+
+bpy.types.MovieSequence
+-----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.MovieSequence.stream_index`
+
+bpy.types.Material
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Material.game_settings`
+
+bpy.types.Object
+----------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Object.matrix_parent_inverse`
+
+bpy.types.SequenceProxy
+-----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SequenceProxy.build_100`
+* :class:`bpy.types.SequenceProxy.build_25`
+* :class:`bpy.types.SequenceProxy.build_50`
+* :class:`bpy.types.SequenceProxy.build_75`
+* :class:`bpy.types.SequenceProxy.build_free_run`
+* :class:`bpy.types.SequenceProxy.build_free_run_rec_date`
+* :class:`bpy.types.SequenceProxy.build_record_run`
+* :class:`bpy.types.SequenceProxy.quality`
+* :class:`bpy.types.SequenceProxy.timecode`
+
+bpy.types.Sequence
+------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Sequence.waveform`
+
+bpy.types.DopeSheet
+-------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.DopeSheet.show_datablock_filters`
+* :class:`bpy.types.DopeSheet.show_speakers`
+
+bpy.types.ActionActuator
+------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ActionActuator.apply_to_children`
+* :class:`bpy.types.ActionActuator.layer`
+* :class:`bpy.types.ActionActuator.layer_weight`
+* :class:`bpy.types.ActionActuator.use_additive`
+* :class:`bpy.types.ActionActuator.use_force`
+* :class:`bpy.types.ActionActuator.use_local`
+
+bpy.types.VertexGroup
+---------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.VertexGroup.lock_weight`
+
+bpy.types.ThemeView3D
+---------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ThemeView3D.speaker`
+
+bpy.types.Image
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Image.pack`
+* :class:`bpy.types.Image.unpack`
+
+bpy.types.Curve
+---------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.Curve.fill_mode`
+
+Removed
+^^^^^^^
+
+* **use_fill_back**
+* **use_fill_front**
+
+bpy.types.ParticleSettings
+--------------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.ParticleSettings.adaptive_subframes`
+* :class:`bpy.types.ParticleSettings.courant_target`
+
+bpy.types.SceneGameData
+-----------------------
+
+Added
+^^^^^
+
+* :class:`bpy.types.SceneGameData.level_height`
+* :class:`bpy.types.SceneGameData.obstacle_simulation`
+* :class:`bpy.types.SceneGameData.recast_data`
+* :class:`bpy.types.SceneGameData.restrict_animation_updates`
+* :class:`bpy.types.SceneGameData.show_obstacle_simulation`
+
diff --git a/doc/python_api/sphinx_changelog_gen.py b/doc/python_api/sphinx_changelog_gen.py
index 7a56e73b7ad..3ded1035123 100644
--- a/doc/python_api/sphinx_changelog_gen.py
+++ b/doc/python_api/sphinx_changelog_gen.py
@@ -39,6 +39,9 @@ python doc/python_api/sphinx_changelog_gen.py \
--api_to blender_api_2_57.py \
--api_out changes.rst
+# Save the latest API dump in this folder, renaming it with its revision.
+# This way the next person updating it doesn't need to build an old Blender only for that
+
"""
# format
@@ -299,7 +302,7 @@ def api_changelog(api_from, api_to, api_out):
for func_id, args_old, args_new in func_args:
args_new = ", ".join(args_new)
args_old = ", ".join(args_old)
- fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, prop_id, args_new, args_old))
+ fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, func_id, args_new, args_old))
fw("\n")
fout.close()
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 1792cb00210..c1bed089b5a 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -161,7 +161,7 @@ def range_str(val):
def example_extract_docstring(filepath):
- file = open(filepath, 'r')
+ file = open(filepath, "r", encoding="utf-8")
line = file.readline()
line_no = 0
text = []
@@ -360,7 +360,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
if module_all:
module_dir = module_all
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
@@ -510,7 +510,7 @@ def pycontext2sphinx(BASEPATH):
# Only use once. very irregular
filepath = os.path.join(BASEPATH, "bpy.context.rst")
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("Context Access (bpy.context)\n")
fw("============================\n\n")
@@ -698,7 +698,7 @@ def pyrna2sphinx(BASEPATH):
# return
filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % struct.identifier)
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
base_id = getattr(struct.base, "identifier", "")
@@ -765,7 +765,7 @@ def pyrna2sphinx(BASEPATH):
fw(" .. attribute:: %s\n\n" % prop.identifier)
if prop.description:
fw(" %s\n\n" % prop.description)
-
+
# special exception, cant use genric code here for enums
if prop.type == "enum":
enum_text = pyrna_enum2sphinx(prop)
@@ -912,7 +912,7 @@ def pyrna2sphinx(BASEPATH):
def fake_bpy_type(class_value, class_name, descr_str, use_subclasses=True):
filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % class_name)
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
write_title(fw, class_name, "=")
@@ -963,7 +963,7 @@ def pyrna2sphinx(BASEPATH):
for op_module_name, ops_mod in op_modules.items():
filepath = os.path.join(BASEPATH, "bpy.ops.%s.rst" % op_module_name)
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
title = "%s Operators" % op_module_name.replace("_", " ").title()
@@ -1017,7 +1017,7 @@ def rna2sphinx(BASEPATH):
# conf.py - empty for now
filepath = os.path.join(BASEPATH, "conf.py")
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
version_string = ".".join(str(v) for v in bpy.app.version)
@@ -1053,7 +1053,7 @@ def rna2sphinx(BASEPATH):
# main page needed for sphinx (index.html)
filepath = os.path.join(BASEPATH, "contents.rst")
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n")
@@ -1169,7 +1169,7 @@ def rna2sphinx(BASEPATH):
# internal modules
if "bpy.ops" not in EXCLUDE_MODULES:
filepath = os.path.join(BASEPATH, "bpy.ops.rst")
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("Operators (bpy.ops)\n")
fw("===================\n\n")
@@ -1181,7 +1181,7 @@ def rna2sphinx(BASEPATH):
if "bpy.types" not in EXCLUDE_MODULES:
filepath = os.path.join(BASEPATH, "bpy.types.rst")
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("Types (bpy.types)\n")
fw("=================\n\n")
@@ -1194,7 +1194,7 @@ def rna2sphinx(BASEPATH):
# not actually a module, only write this file so we
# can reference in the TOC
filepath = os.path.join(BASEPATH, "bpy.data.rst")
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("Data Access (bpy.data)\n")
fw("======================\n\n")
@@ -1284,7 +1284,7 @@ def rna2sphinx(BASEPATH):
if 0:
filepath = os.path.join(BASEPATH, "bpy.rst")
- file = open(filepath, "w")
+ file = open(filepath, "w", encoding="utf-8")
fw = file.write
fw("\n")
diff --git a/extern/recastnavigation/CMakeLists.txt b/extern/recastnavigation/CMakeLists.txt
index 660b881dd07..3d8b7ab1513 100644
--- a/extern/recastnavigation/CMakeLists.txt
+++ b/extern/recastnavigation/CMakeLists.txt
@@ -53,18 +53,19 @@ set(SRC
Detour/Include/DetourTileNavMeshBuilder.h
Recast/Source/Recast.cpp
+ Recast/Source/RecastAlloc.cpp
+ Recast/Source/RecastArea.cpp
Recast/Source/RecastContour.cpp
Recast/Source/RecastFilter.cpp
- Recast/Source/RecastLog.cpp
+ Recast/Source/RecastLayers.cpp
Recast/Source/RecastMesh.cpp
Recast/Source/RecastMeshDetail.cpp
Recast/Source/RecastRasterization.cpp
Recast/Source/RecastRegion.cpp
- Recast/Source/RecastTimer.cpp
Recast/Include/Recast.h
- Recast/Include/RecastLog.h
- Recast/Include/RecastTimer.h
+ Recast/Include/RecastAlloc.h
+ Recast/Include/RecastAssert.h
)
blender_add_lib(extern_recastnavigation "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/extern/recastnavigation/Recast/Include/Recast.h b/extern/recastnavigation/Recast/Include/Recast.h
index f25ab47f8fa..4e20b0f0fff 100644
--- a/extern/recastnavigation/Recast/Include/Recast.h
+++ b/extern/recastnavigation/Recast/Include/Recast.h
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -19,298 +19,685 @@
#ifndef RECAST_H
#define RECAST_H
-// The units of the parameters are specified in parenthesis as follows:
-// (vx) voxels, (wu) world units
-struct rcConfig
+/// The value of PI used by Recast.
+static const float RC_PI = 3.14159265f;
+
+/// Recast log categories.
+/// @see rcContext
+enum rcLogCategory
{
- int width, height; // Dimensions of the rasterized heighfield (vx)
- int tileSize; // Width and Height of a tile (vx)
- int borderSize; // Non-navigable Border around the heightfield (vx)
- float cs, ch; // Grid cell size and height (wu)
- float bmin[3], bmax[3]; // Grid bounds (wu)
- float walkableSlopeAngle; // Maximum walkble slope angle in degrees.
- int walkableHeight; // Minimum height where the agent can still walk (vx)
- int walkableClimb; // Maximum height between grid cells the agent can climb (vx)
- int walkableRadius; // Radius of the agent in cells (vx)
- int maxEdgeLen; // Maximum contour edge length (vx)
- float maxSimplificationError; // Maximum distance error from contour to cells (vx)
- int minRegionSize; // Minimum regions size. Smaller regions will be deleted (vx)
- int mergeRegionSize; // Minimum regions size. Smaller regions will be merged (vx)
- int maxVertsPerPoly; // Max number of vertices per polygon
- float detailSampleDist; // Detail mesh sample spacing.
- float detailSampleMaxError; // Detail mesh simplification max sample error.
+ RC_LOG_PROGRESS = 1, ///< A progress log entry.
+ RC_LOG_WARNING, ///< A warning log entry.
+ RC_LOG_ERROR, ///< An error log entry.
};
-// Heightfield span.
-struct rcSpan
+/// Recast performance timer categories.
+/// @see rcContext
+enum rcTimerLabel
+{
+ /// The user defined total time of the build.
+ RC_TIMER_TOTAL,
+ /// A user defined build time.
+ RC_TIMER_TEMP,
+ /// The time to rasterize the triangles. (See: #rcRasterizeTriangle)
+ RC_TIMER_RASTERIZE_TRIANGLES,
+ /// The time to build the compact heightfield. (See: #rcBuildCompactHeightfield)
+ RC_TIMER_BUILD_COMPACTHEIGHTFIELD,
+ /// The total time to build the contours. (See: #rcBuildContours)
+ RC_TIMER_BUILD_CONTOURS,
+ /// The time to trace the boundaries of the contours. (See: #rcBuildContours)
+ RC_TIMER_BUILD_CONTOURS_TRACE,
+ /// The time to simplify the contours. (See: #rcBuildContours)
+ RC_TIMER_BUILD_CONTOURS_SIMPLIFY,
+ /// The time to filter ledge spans. (See: #rcFilterLedgeSpans)
+ RC_TIMER_FILTER_BORDER,
+ /// The time to filter low height spans. (See: #rcFilterWalkableLowHeightSpans)
+ RC_TIMER_FILTER_WALKABLE,
+ /// The time to apply the median filter. (See: #rcMedianFilterWalkableArea)
+ RC_TIMER_MEDIAN_AREA,
+ /// The time to filter low obstacles. (See: #rcFilterLowHangingWalkableObstacles)
+ RC_TIMER_FILTER_LOW_OBSTACLES,
+ /// The time to build the polygon mesh. (See: #rcBuildPolyMesh)
+ RC_TIMER_BUILD_POLYMESH,
+ /// The time to merge polygon meshes. (See: #rcMergePolyMeshes)
+ RC_TIMER_MERGE_POLYMESH,
+ /// The time to erode the walkable area. (See: #rcErodeWalkableArea)
+ RC_TIMER_ERODE_AREA,
+ /// The time to mark a box area. (See: #rcMarkBoxArea)
+ RC_TIMER_MARK_BOX_AREA,
+ /// The time to mark a cylinder area. (See: #rcMarkCylinderArea)
+ RC_TIMER_MARK_CYLINDER_AREA,
+ /// The time to mark a convex polygon area. (See: #rcMarkConvexPolyArea)
+ RC_TIMER_MARK_CONVEXPOLY_AREA,
+ /// The total time to build the distance field. (See: #rcBuildDistanceField)
+ RC_TIMER_BUILD_DISTANCEFIELD,
+ /// The time to build the distances of the distance field. (See: #rcBuildDistanceField)
+ RC_TIMER_BUILD_DISTANCEFIELD_DIST,
+ /// The time to blur the distance field. (See: #rcBuildDistanceField)
+ RC_TIMER_BUILD_DISTANCEFIELD_BLUR,
+ /// The total time to build the regions. (See: #rcBuildRegions, #rcBuildRegionsMonotone)
+ RC_TIMER_BUILD_REGIONS,
+ /// The total time to apply the watershed algorithm. (See: #rcBuildRegions)
+ RC_TIMER_BUILD_REGIONS_WATERSHED,
+ /// The time to expand regions while applying the watershed algorithm. (See: #rcBuildRegions)
+ RC_TIMER_BUILD_REGIONS_EXPAND,
+ /// The time to flood regions while applying the watershed algorithm. (See: #rcBuildRegions)
+ RC_TIMER_BUILD_REGIONS_FLOOD,
+ /// The time to filter out small regions. (See: #rcBuildRegions, #rcBuildRegionsMonotone)
+ RC_TIMER_BUILD_REGIONS_FILTER,
+ /// The time to build heightfield layers. (See: #rcBuildHeightfieldLayers)
+ RC_TIMER_BUILD_LAYERS,
+ /// The time to build the polygon mesh detail. (See: #rcBuildPolyMeshDetail)
+ RC_TIMER_BUILD_POLYMESHDETAIL,
+ /// The time to merge polygon mesh details. (See: #rcMergePolyMeshDetails)
+ RC_TIMER_MERGE_POLYMESHDETAIL,
+ /// The maximum number of timers. (Used for iterating timers.)
+ RC_MAX_TIMERS
+};
+
+/// Provides an interface for optional logging and performance tracking of the Recast
+/// build process.
+/// @ingroup recast
+class rcContext
+{
+public:
+
+ /// Contructor.
+ /// @param[in] state TRUE if the logging and performance timers should be enabled. [Default: true]
+ inline rcContext(bool state = true) : m_logEnabled(state), m_timerEnabled(state) {}
+ virtual ~rcContext() {}
+
+ /// Enables or disables logging.
+ /// @param[in] state TRUE if logging should be enabled.
+ inline void enableLog(bool state) { m_logEnabled = state; }
+
+ /// Clears all log entries.
+ inline void resetLog() { if (m_logEnabled) doResetLog(); }
+
+ /// Logs a message.
+ /// @param[in] category The category of the message.
+ /// @param[in] format The message.
+ void log(const rcLogCategory category, const char* format, ...);
+
+ /// Enables or disables the performance timers.
+ /// @param[in] state TRUE if timers should be enabled.
+ inline void enableTimer(bool state) { m_timerEnabled = state; }
+
+ /// Clears all peformance timers. (Resets all to unused.)
+ inline void resetTimers() { if (m_timerEnabled) doResetTimers(); }
+
+ /// Starts the specified performance timer.
+ /// @param label The category of timer.
+ inline void startTimer(const rcTimerLabel label) { if (m_timerEnabled) doStartTimer(label); }
+
+ /// Stops the specified performance timer.
+ /// @param label The category of the timer.
+ inline void stopTimer(const rcTimerLabel label) { if (m_timerEnabled) doStopTimer(label); }
+
+ /// Returns the total accumulated time of the specified performance timer.
+ /// @param label The category of the timer.
+ /// @return The accumulated time of the timer, or -1 if timers are disabled or the timer has never been started.
+ inline int getAccumulatedTime(const rcTimerLabel label) const { return m_timerEnabled ? doGetAccumulatedTime(label) : -1; }
+
+protected:
+
+ /// Clears all log entries.
+ virtual void doResetLog() {}
+
+ /// Logs a message.
+ /// @param[in] category The category of the message.
+ /// @param[in] msg The formatted message.
+ /// @param[in] len The length of the formatted message.
+ virtual void doLog(const rcLogCategory /*category*/, const char* /*msg*/, const int /*len*/) {}
+
+ /// Clears all timers. (Resets all to unused.)
+ virtual void doResetTimers() {}
+
+ /// Starts the specified performance timer.
+ /// @param[in] label The category of timer.
+ virtual void doStartTimer(const rcTimerLabel /*label*/) {}
+
+ /// Stops the specified performance timer.
+ /// @param[in] label The category of the timer.
+ virtual void doStopTimer(const rcTimerLabel /*label*/) {}
+
+ /// Returns the total accumulated time of the specified performance timer.
+ /// @param[in] label The category of the timer.
+ /// @return The accumulated time of the timer, or -1 if timers are disabled or the timer has never been started.
+ virtual int doGetAccumulatedTime(const rcTimerLabel /*label*/) const { return -1; }
+
+ /// True if logging is enabled.
+ bool m_logEnabled;
+
+ /// True if the performance timers are enabled.
+ bool m_timerEnabled;
+};
+
+/// Specifies a configuration to use when performing Recast builds.
+/// @ingroup recast
+struct rcConfig
{
- unsigned int smin : 15; // Span min height.
- unsigned int smax : 15; // Span max height.
- unsigned int flags : 2; // Span flags.
- rcSpan* next; // Next span in column.
+ /// The width of the field along the x-axis. [Limit: >= 0] [Units: vx]
+ int width;
+
+ /// The height of the field along the z-axis. [Limit: >= 0] [Units: vx]
+ int height;
+
+ /// The width/height size of tile's on the xz-plane. [Limit: >= 0] [Units: vx]
+ int tileSize;
+
+ /// The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
+ int borderSize;
+
+ /// The xz-plane cell size to use for fields. [Limit: > 0] [Units: wu]
+ float cs;
+
+ /// The y-axis cell size to use for fields. [Limit: > 0] [Units: wu]
+ float ch;
+
+ /// The minimum bounds of the field's AABB. [(x, y, z)] [Units: wu]
+ float bmin[3];
+
+ /// The maximum bounds of the field's AABB. [(x, y, z)] [Units: wu]
+ float bmax[3];
+
+ /// The maximum slope that is considered walkable. [Limits: 0 <= value < 90] [Units: Degrees]
+ float walkableSlopeAngle;
+
+ /// Minimum floor to 'ceiling' height that will still allow the floor area to
+ /// be considered walkable. [Limit: >= 3] [Units: vx]
+ int walkableHeight;
+
+ /// Maximum ledge height that is considered to still be traversable. [Limit: >=0] [Units: vx]
+ int walkableClimb;
+
+ /// The distance to erode/shrink the walkable area of the heightfield away from
+ /// obstructions. [Limit: >=0] [Units: vx]
+ int walkableRadius;
+
+ /// The maximum allowed length for contour edges along the border of the mesh. [Limit: >=0] [Units: vx]
+ int maxEdgeLen;
+
+ /// The maximum distance a simplfied contour's border edges should deviate
+ /// the original raw contour. [Limit: >=0] [Units: wu]
+ float maxSimplificationError;
+
+ /// The minimum number of cells allowed to form isolated island areas. [Limit: >=0] [Units: vx]
+ int minRegionArea;
+
+ /// Any regions with a span count smaller than this value will, if possible,
+ /// be merged with larger regions. [Limit: >=0] [Units: vx]
+ int mergeRegionArea;
+
+ /// The maximum number of vertices allowed for polygons generated during the
+ /// contour to polygon conversion process. [Limit: >= 3]
+ int maxVertsPerPoly;
+
+ /// Sets the sampling distance to use when generating the detail mesh.
+ /// (For height detail only.) [Limits: 0 or >= 0.9] [Units: wu]
+ float detailSampleDist;
+
+ /// The maximum distance the detail mesh surface should deviate from heightfield
+ /// data. (For height detail only.) [Limit: >=0] [Units: wu]
+ float detailSampleMaxError;
};
+/// Defines the number of bits allocated to rcSpan::smin and rcSpan::smax.
+static const int RC_SPAN_HEIGHT_BITS = 13;
+/// Defines the maximum value for rcSpan::smin and rcSpan::smax.
+static const int RC_SPAN_MAX_HEIGHT = (1<<RC_SPAN_HEIGHT_BITS)-1;
+
+/// The number of spans allocated per span spool.
+/// @see rcSpanPool
static const int RC_SPANS_PER_POOL = 2048;
-// Memory pool used for quick span allocation.
+/// Represents a span in a heightfield.
+/// @see rcHeightfield
+struct rcSpan
+{
+ unsigned int smin : 13; ///< The lower limit of the span. [Limit: < #smax]
+ unsigned int smax : 13; ///< The upper limit of the span. [Limit: <= #RC_SPAN_MAX_HEIGHT]
+ unsigned int area : 6; ///< The area id assigned to the span.
+ rcSpan* next; ///< The next span higher up in column.
+};
+
+/// A memory pool used for quick allocation of spans within a heightfield.
+/// @see rcHeightfield
struct rcSpanPool
{
- rcSpanPool* next; // Pointer to next pool.
- rcSpan items[1]; // Array of spans (size RC_SPANS_PER_POOL).
+ rcSpanPool* next; ///< The next span pool.
+ rcSpan items[RC_SPANS_PER_POOL]; ///< Array of spans in the pool.
};
-// Dynamic span-heightfield.
+/// A dynamic heightfield representing obstructed space.
+/// @ingroup recast
struct rcHeightfield
{
- inline rcHeightfield() : width(0), height(0), spans(0), pools(0), freelist(0) {}
- inline ~rcHeightfield()
- {
- // Delete span array.
- delete [] spans;
- // Delete span pools.
- while (pools)
- {
- rcSpanPool* next = pools->next;
- delete [] reinterpret_cast<unsigned char*>(pools);
- pools = next;
- }
- }
- int width, height; // Dimension of the heightfield.
- float bmin[3], bmax[3]; // Bounding box of the heightfield
- float cs, ch; // Cell size and height.
- rcSpan** spans; // Heightfield of spans (width*height).
- rcSpanPool* pools; // Linked list of span pools.
- rcSpan* freelist; // Pointer to next free span.
+ int width; ///< The width of the heightfield. (Along the x-axis in cell units.)
+ int height; ///< The height of the heightfield. (Along the z-axis in cell units.)
+ float bmin[3]; ///< The minimum bounds in world space. [(x, y, z)]
+ float bmax[3]; ///< The maximum bounds in world space. [(x, y, z)]
+ float cs; ///< The size of each cell. (On the xz-plane.)
+ float ch; ///< The height of each cell. (The minimum increment along the y-axis.)
+ rcSpan** spans; ///< Heightfield of spans (width*height).
+ rcSpanPool* pools; ///< Linked list of span pools.
+ rcSpan* freelist; ///< The next free span.
};
+/// Provides information on the content of a cell column in a compact heightfield.
struct rcCompactCell
{
- unsigned int index : 24; // Index to first span in column.
- unsigned int count : 8; // Number of spans in this column.
+ unsigned int index : 24; ///< Index to the first span in the column.
+ unsigned int count : 8; ///< Number of spans in the column.
};
+/// Represents a span of unobstructed space within a compact heightfield.
struct rcCompactSpan
{
- unsigned short y; // Bottom coordinate of the span.
- unsigned short reg; // Region ID
- unsigned short dist; // Distance to border
- unsigned short con; // Connections to neighbour cells.
- unsigned char h; // Height of the span.
- unsigned char flags; // Flags.
+ unsigned short y; ///< The lower extent of the span. (Measured from the heightfield's base.)
+ unsigned short reg; ///< The id of the region the span belongs to. (Or zero if not in a region.)
+ unsigned int con : 24; ///< Packed neighbor connection data.
+ unsigned int h : 8; ///< The height of the span. (Measured from #y.)
};
-// Compact static heightfield.
+/// A compact, static heightfield representing unobstructed space.
+/// @ingroup recast
struct rcCompactHeightfield
{
- inline rcCompactHeightfield() : maxDistance(0), maxRegions(0), cells(0), spans(0) {}
- inline ~rcCompactHeightfield() { delete [] cells; delete [] spans; }
- int width, height; // Width and height of the heighfield.
- int spanCount; // Number of spans in the heightfield.
- int walkableHeight, walkableClimb; // Agent properties.
- unsigned short maxDistance; // Maximum distance value stored in heightfield.
- unsigned short maxRegions; // Maximum Region Id stored in heightfield.
- float bmin[3], bmax[3]; // Bounding box of the heightfield.
- float cs, ch; // Cell size and height.
- rcCompactCell* cells; // Pointer to width*height cells.
- rcCompactSpan* spans; // Pointer to spans.
+ int width; ///< The width of the heightfield. (Along the x-axis in cell units.)
+ int height; ///< The height of the heightfield. (Along the z-axis in cell units.)
+ int spanCount; ///< The number of spans in the heightfield.
+ int walkableHeight; ///< The walkable height used during the build of the field. (See: rcConfig::walkableHeight)
+ int walkableClimb; ///< The walkable climb used during the build of the field. (See: rcConfig::walkableClimb)
+ int borderSize; ///< The AABB border size used during the build of the field. (See: rcConfig::borderSize)
+ unsigned short maxDistance; ///< The maximum distance value of any span within the field.
+ unsigned short maxRegions; ///< The maximum region id of any span within the field.
+ float bmin[3]; ///< The minimum bounds in world space. [(x, y, z)]
+ float bmax[3]; ///< The maximum bounds in world space. [(x, y, z)]
+ float cs; ///< The size of each cell. (On the xz-plane.)
+ float ch; ///< The height of each cell. (The minimum increment along the y-axis.)
+ rcCompactCell* cells; ///< Array of cells. [Size: #width*#height]
+ rcCompactSpan* spans; ///< Array of spans. [Size: #spanCount]
+ unsigned short* dist; ///< Array containing border distance data. [Size: #spanCount]
+ unsigned char* areas; ///< Array containing area id data. [Size: #spanCount]
+};
+
+/// Represents a heightfield layer within a layer set.
+/// @see rcHeightfieldLayerSet
+struct rcHeightfieldLayer
+{
+ float bmin[3]; ///< The minimum bounds in world space. [(x, y, z)]
+ float bmax[3]; ///< The maximum bounds in world space. [(x, y, z)]
+ float cs; ///< The size of each cell. (On the xz-plane.)
+ float ch; ///< The height of each cell. (The minimum increment along the y-axis.)
+ int width; ///< The width of the heightfield. (Along the x-axis in cell units.)
+ int height; ///< The height of the heightfield. (Along the z-axis in cell units.)
+ int minx; ///< The minimum x-bounds of usable data.
+ int maxx; ///< The maximum x-bounds of usable data.
+ int miny; ///< The minimum y-bounds of usable data. (Along the z-axis.)
+ int maxy; ///< The maximum y-bounds of usable data. (Along the z-axis.)
+ int hmin; ///< The minimum height bounds of usable data. (Along the y-axis.)
+ int hmax; ///< The maximum height bounds of usable data. (Along the y-axis.)
+ unsigned char* heights; ///< The heightfield. [Size: (width - borderSize*2) * (h - borderSize*2)]
+ unsigned char* areas; ///< Area ids. [Size: Same as #heights]
+ unsigned char* cons; ///< Packed neighbor connection information. [Size: Same as #heights]
+};
+
+/// Represents a set of heightfield layers.
+/// @ingroup recast
+/// @see rcAllocHeightfieldLayerSet, rcFreeHeightfieldLayerSet
+struct rcHeightfieldLayerSet
+{
+ rcHeightfieldLayer* layers; ///< The layers in the set. [Size: #nlayers]
+ int nlayers; ///< The number of layers in the set.
};
+/// Represents a simple, non-overlapping contour in field space.
struct rcContour
{
- inline rcContour() : verts(0), nverts(0), rverts(0), nrverts(0) { }
- inline ~rcContour() { delete [] verts; delete [] rverts; }
- int* verts; // Vertex coordinates, each vertex contains 4 components.
- int nverts; // Number of vertices.
- int* rverts; // Raw vertex coordinates, each vertex contains 4 components.
- int nrverts; // Number of raw vertices.
- unsigned short reg; // Region ID of the contour.
+ int* verts; ///< Simplified contour vertex and connection data. [Size: 4 * #nverts]
+ int nverts; ///< The number of vertices in the simplified contour.
+ int* rverts; ///< Raw contour vertex and connection data. [Size: 4 * #nrverts]
+ int nrverts; ///< The number of vertices in the raw contour.
+ unsigned short reg; ///< The region id of the contour.
+ unsigned char area; ///< The area id of the contour.
};
+/// Represents a group of related contours.
+/// @ingroup recast
struct rcContourSet
{
- inline rcContourSet() : conts(0), nconts(0) {}
- inline ~rcContourSet() { delete [] conts; }
- rcContour* conts; // Pointer to all contours.
- int nconts; // Number of contours.
- float bmin[3], bmax[3]; // Bounding box of the heightfield.
- float cs, ch; // Cell size and height.
+ rcContour* conts; ///< An array of the contours in the set. [Size: #nconts]
+ int nconts; ///< The number of contours in the set.
+ float bmin[3]; ///< The minimum bounds in world space. [(x, y, z)]
+ float bmax[3]; ///< The maximum bounds in world space. [(x, y, z)]
+ float cs; ///< The size of each cell. (On the xz-plane.)
+ float ch; ///< The height of each cell. (The minimum increment along the y-axis.)
+ int width; ///< The width of the set. (Along the x-axis in cell units.)
+ int height; ///< The height of the set. (Along the z-axis in cell units.)
+ int borderSize; ///< The AABB border size used to generate the source data from which the contours were derived.
};
-// Polymesh store a connected mesh of polygons.
-// The polygons are store in an array where each polygons takes
-// 'nvp*2' elements. The first 'nvp' elements are indices to vertices
-// and the second 'nvp' elements are indices to neighbour polygons.
-// If a polygona has less than 'bvp' vertices, the remaining indices
-// are set os 0xffff. If an polygon edge does not have a neighbour
-// the neighbour index is set to 0xffff.
-// Vertices can be transformed into world space as follows:
-// x = bmin[0] + verts[i*3+0]*cs;
-// y = bmin[1] + verts[i*3+1]*ch;
-// z = bmin[2] + verts[i*3+2]*cs;
+/// Represents a polygon mesh suitable for use in building a navigation mesh.
+/// @ingroup recast
struct rcPolyMesh
-{
- inline rcPolyMesh() : verts(0), polys(0), regs(0), nverts(0), npolys(0), nvp(3) {}
- inline ~rcPolyMesh() { delete [] verts; delete [] polys; delete [] regs; }
- unsigned short* verts; // Vertices of the mesh, 3 elements per vertex.
- unsigned short* polys; // Polygons of the mesh, nvp*2 elements per polygon.
- unsigned short* regs; // Regions of the polygons.
- int nverts; // Number of vertices.
- int npolys; // Number of polygons.
- int nvp; // Max number of vertices per polygon.
- float bmin[3], bmax[3]; // Bounding box of the mesh.
- float cs, ch; // Cell size and height.
+{
+ unsigned short* verts; ///< The mesh vertices. [Form: (x, y, z) * #nverts]
+ unsigned short* polys; ///< Polygon and neighbor data. [Length: #maxpolys * 2 * #nvp]
+ unsigned short* regs; ///< The region id assigned to each polygon. [Length: #maxpolys]
+ unsigned short* flags; ///< The user defined flags for each polygon. [Length: #maxpolys]
+ unsigned char* areas; ///< The area id assigned to each polygon. [Length: #maxpolys]
+ int nverts; ///< The number of vertices.
+ int npolys; ///< The number of polygons.
+ int maxpolys; ///< The number of allocated polygons.
+ int nvp; ///< The maximum number of vertices per polygon.
+ float bmin[3]; ///< The minimum bounds in world space. [(x, y, z)]
+ float bmax[3]; ///< The maximum bounds in world space. [(x, y, z)]
+ float cs; ///< The size of each cell. (On the xz-plane.)
+ float ch; ///< The height of each cell. (The minimum increment along the y-axis.)
+ int borderSize; ///< The AABB border size used to generate the source data from which the mesh was derived.
};
-// Detail mesh generated from a rcPolyMesh.
-// Each submesh represents a polygon in the polymesh and they are stored in
-// excatly same order. Each submesh is described as 4 values:
-// base vertex, vertex count, base triangle, triangle count. That is,
-// const unsigned char* t = &dtl.tris[(tbase+i)*3]; and
-// const float* v = &dtl.verts[(vbase+t[j])*3];
-// If the input polygon has 'n' vertices, those vertices are first in the
-// submesh vertex list. This allows to compres the mesh by not storing the
-// first vertices and using the polymesh vertices instead.
-
+/// Contains triangle meshes that represent detailed height data associated
+/// with the polygons in its associated polygon mesh object.
+/// @ingroup recast
struct rcPolyMeshDetail
{
- inline rcPolyMeshDetail() :
- meshes(0), verts(0), tris(0),
- nmeshes(0), nverts(0), ntris(0) {}
- inline ~rcPolyMeshDetail()
- {
- delete [] meshes; delete [] verts; delete [] tris;
- }
-
- unsigned short* meshes; // Pointer to all mesh data.
- float* verts; // Pointer to all vertex data.
- unsigned char* tris; // Pointer to all triangle data.
- int nmeshes; // Number of meshes.
- int nverts; // Number of total vertices.
- int ntris; // Number of triangles.
+ unsigned int* meshes; ///< The sub-mesh data. [Size: 4*#nmeshes]
+ float* verts; ///< The mesh vertices. [Size: 3*#nverts]
+ unsigned char* tris; ///< The mesh triangles. [Size: 4*#ntris]
+ int nmeshes; ///< The number of sub-meshes defined by #meshes.
+ int nverts; ///< The number of vertices in #verts.
+ int ntris; ///< The number of triangles in #tris.
};
+/// @name Allocation Functions
+/// Functions used to allocate and de-allocate Recast objects.
+/// @see rcAllocSetCustom
+/// @{
-// Simple dynamic array ints.
-class rcIntArray
-{
- int* m_data;
- int m_size, m_cap;
-public:
- inline rcIntArray() : m_data(0), m_size(0), m_cap(0) {}
- inline rcIntArray(int n) : m_data(0), m_size(0), m_cap(n) { m_data = new int[n]; }
- inline ~rcIntArray() { delete [] m_data; }
- void resize(int n);
- inline void push(int item) { resize(m_size+1); m_data[m_size-1] = item; }
- inline int pop() { if (m_size > 0) m_size--; return m_data[m_size]; }
- inline const int& operator[](int i) const { return m_data[i]; }
- inline int& operator[](int i) { return m_data[i]; }
- inline int size() const { return m_size; }
-};
+/// Allocates a heightfield object using the Recast allocator.
+/// @return A heightfield that is ready for initialization, or null on failure.
+/// @ingroup recast
+/// @see rcCreateHeightfield, rcFreeHeightField
+rcHeightfield* rcAllocHeightfield();
-enum rcSpanFlags
-{
- RC_WALKABLE = 0x01,
- RC_REACHABLE = 0x02,
-};
+/// Frees the specified heightfield object using the Recast allocator.
+/// @param[in] hf A heightfield allocated using #rcAllocHeightfield
+/// @ingroup recast
+/// @see rcAllocHeightfield
+void rcFreeHeightField(rcHeightfield* hf);
+
+/// Allocates a compact heightfield object using the Recast allocator.
+/// @return A compact heightfield that is ready for initialization, or null on failure.
+/// @ingroup recast
+/// @see rcBuildCompactHeightfield, rcFreeCompactHeightfield
+rcCompactHeightfield* rcAllocCompactHeightfield();
+
+/// Frees the specified compact heightfield object using the Recast allocator.
+/// @param[in] chf A compact heightfield allocated using #rcAllocCompactHeightfield
+/// @ingroup recast
+/// @see rcAllocCompactHeightfield
+void rcFreeCompactHeightfield(rcCompactHeightfield* chf);
+
+/// Allocates a heightfield layer set using the Recast allocator.
+/// @return A heightfield layer set that is ready for initialization, or null on failure.
+/// @ingroup recast
+/// @see rcBuildHeightfieldLayers, rcFreeHeightfieldLayerSet
+rcHeightfieldLayerSet* rcAllocHeightfieldLayerSet();
+
+/// Frees the specified heightfield layer set using the Recast allocator.
+/// @param[in] lset A heightfield layer set allocated using #rcAllocHeightfieldLayerSet
+/// @ingroup recast
+/// @see rcAllocHeightfieldLayerSet
+void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet* lset);
+
+/// Allocates a contour set object using the Recast allocator.
+/// @return A contour set that is ready for initialization, or null on failure.
+/// @ingroup recast
+/// @see rcBuildContours, rcFreeContourSet
+rcContourSet* rcAllocContourSet();
+
+/// Frees the specified contour set using the Recast allocator.
+/// @param[in] cset A contour set allocated using #rcAllocContourSet
+/// @ingroup recast
+/// @see rcAllocContourSet
+void rcFreeContourSet(rcContourSet* cset);
+
+/// Allocates a polygon mesh object using the Recast allocator.
+/// @return A polygon mesh that is ready for initialization, or null on failure.
+/// @ingroup recast
+/// @see rcBuildPolyMesh, rcFreePolyMesh
+rcPolyMesh* rcAllocPolyMesh();
+
+/// Frees the specified polygon mesh using the Recast allocator.
+/// @param[in] pmesh A polygon mesh allocated using #rcAllocPolyMesh
+/// @ingroup recast
+/// @see rcAllocPolyMesh
+void rcFreePolyMesh(rcPolyMesh* pmesh);
+
+/// Allocates a detail mesh object using the Recast allocator.
+/// @return A detail mesh that is ready for initialization, or null on failure.
+/// @ingroup recast
+/// @see rcBuildPolyMeshDetail, rcFreePolyMeshDetail
+rcPolyMeshDetail* rcAllocPolyMeshDetail();
+
+/// Frees the specified detail mesh using the Recast allocator.
+/// @param[in] dmesh A detail mesh allocated using #rcAllocPolyMeshDetail
+/// @ingroup recast
+/// @see rcAllocPolyMeshDetail
+void rcFreePolyMeshDetail(rcPolyMeshDetail* dmesh);
-// If heightfield region ID has the following bit set, the region is on border area
-// and excluded from many calculations.
+/// @}
+
+/// Heighfield border flag.
+/// If a heightfield region ID has this bit set, then the region is a border
+/// region and its spans are considered unwalkable.
+/// (Used during the region and contour build process.)
+/// @see rcCompactSpan::reg
static const unsigned short RC_BORDER_REG = 0x8000;
-// If contour region ID has the following bit set, the vertex will be later
-// removed in order to match the segments and vertices at tile boundaries.
+/// Border vertex flag.
+/// If a region ID has this bit set, then the associated element lies on
+/// a tile border. If a contour vertex's region ID has this bit set, the
+/// vertex will later be removed in order to match the segments and vertices
+/// at tile boundaries.
+/// (Used during the build process.)
+/// @see rcCompactSpan::reg, #rcContour::verts, #rcContour::rverts
static const int RC_BORDER_VERTEX = 0x10000;
-// Compact span neighbour helpers.
-inline int rcGetCon(const rcCompactSpan& s, int dir)
-{
- return (s.con >> (dir*4)) & 0xf;
-}
+/// Area border flag.
+/// If a region ID has this bit set, then the associated element lies on
+/// the border of an area.
+/// (Used during the region and contour build process.)
+/// @see rcCompactSpan::reg, #rcContour::verts, #rcContour::rverts
+static const int RC_AREA_BORDER = 0x20000;
-inline int rcGetDirOffsetX(int dir)
+/// Contour build flags.
+/// @see rcBuildContours
+enum rcBuildContoursFlags
{
- const int offset[4] = { -1, 0, 1, 0, };
- return offset[dir&0x03];
-}
+ RC_CONTOUR_TESS_WALL_EDGES = 0x01, ///< Tessellate solid (impassable) edges during contour simplification.
+ RC_CONTOUR_TESS_AREA_EDGES = 0x02, ///< Tessellate edges between areas during contour simplification.
+};
-inline int rcGetDirOffsetY(int dir)
-{
- const int offset[4] = { 0, 1, 0, -1 };
- return offset[dir&0x03];
-}
+/// Applied to the region id field of contour vertices in order to extract the region id.
+/// The region id field of a vertex may have several flags applied to it. So the
+/// fields value can't be used directly.
+/// @see rcContour::verts, rcContour::rverts
+static const int RC_CONTOUR_REG_MASK = 0xffff;
+
+/// An value which indicates an invalid index within a mesh.
+/// @note This does not necessarily indicate an error.
+/// @see rcPolyMesh::polys
+static const unsigned short RC_MESH_NULL_IDX = 0xffff;
+
+/// Represents the null area.
+/// When a data element is given this value it is considered to no longer be
+/// assigned to a usable area. (E.g. It is unwalkable.)
+static const unsigned char RC_NULL_AREA = 0;
+
+/// The default area id used to indicate a walkable polygon.
+/// This is also the maximum allowed area id, and the only non-null area id
+/// recognized by some steps in the build process.
+static const unsigned char RC_WALKABLE_AREA = 63;
+
+/// The value returned by #rcGetCon if the specified direction is not connected
+/// to another span. (Has no neighbor.)
+static const int RC_NOT_CONNECTED = 0x3f;
+
+/// @name General helper functions
+/// @{
-// Common helper functions
+/// Swaps the values of the two parameters.
+/// @param[in,out] a Value A
+/// @param[in,out] b Value B
template<class T> inline void rcSwap(T& a, T& b) { T t = a; a = b; b = t; }
+
+/// Returns the minimum of two values.
+/// @param[in] a Value A
+/// @param[in] b Value B
+/// @return The minimum of the two values.
template<class T> inline T rcMin(T a, T b) { return a < b ? a : b; }
+
+/// Returns the maximum of two values.
+/// @param[in] a Value A
+/// @param[in] b Value B
+/// @return The maximum of the two values.
template<class T> inline T rcMax(T a, T b) { return a > b ? a : b; }
+
+/// Returns the absolute value.
+/// @param[in] a The value.
+/// @return The absolute value of the specified value.
template<class T> inline T rcAbs(T a) { return a < 0 ? -a : a; }
+
+/// Return the square of a value.
+/// @param[in] a The value.
+/// @return The square of the value.
template<class T> inline T rcSqr(T a) { return a*a; }
+
+/// Clamps the value to the specified range.
+/// @param[in] v The value to clamp.
+/// @param[in] mn The minimum permitted return value.
+/// @param[in] mx The maximum permitted return value.
+/// @return The value, clamped to the specified range.
template<class T> inline T rcClamp(T v, T mn, T mx) { return v < mn ? mn : (v > mx ? mx : v); }
-// Common vector helper functions.
-inline void vcross(float* dest, const float* v1, const float* v2)
+/// Returns the square root of the value.
+/// @param[in] x The value.
+/// @return The square root of the vlaue.
+float rcSqrt(float x);
+
+/// Not documented. Internal use only.
+/// @param[in] x Not documented.
+/// @return Not documented.
+inline int rcAlign4(int x) { return (x+3) & ~3; }
+
+/// @}
+/// @name Vector helper functions.
+/// @{
+
+/// Derives the cross product of two vectors. (v1 x v2)
+/// @param[out] dest The cross product. [(x, y, z)]
+/// @param[in] v1 A Vector [(x, y, z)]
+/// @param[in] v2 A vector [(x, y, z)]
+inline void rcVcross(float* dest, const float* v1, const float* v2)
{
dest[0] = v1[1]*v2[2] - v1[2]*v2[1];
dest[1] = v1[2]*v2[0] - v1[0]*v2[2];
- dest[2] = v1[0]*v2[1] - v1[1]*v2[0];
+ dest[2] = v1[0]*v2[1] - v1[1]*v2[0];
}
-inline float vdot(const float* v1, const float* v2)
+/// Derives the dot product of two vectors. (v1 . v2)
+/// @param[in] v1 A Vector [(x, y, z)]
+/// @param[in] v2 A vector [(x, y, z)]
+/// @return The dot product.
+inline float rcVdot(const float* v1, const float* v2)
{
return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
}
-inline void vmad(float* dest, const float* v1, const float* v2, const float s)
+/// Performs a scaled vector addition. (v1 + (v2 * s))
+/// @param[out] dest The result vector. [(x, y, z)]
+/// @param[in] v1 The base vector [(x, y, z)]
+/// @param[in] v2 The vector to scale and add to @p v1. [(x, y, z)]
+/// @param[in] s The amount to scale @p v2 by before adding to @p v1.
+inline void rcVmad(float* dest, const float* v1, const float* v2, const float s)
{
dest[0] = v1[0]+v2[0]*s;
dest[1] = v1[1]+v2[1]*s;
dest[2] = v1[2]+v2[2]*s;
}
-inline void vadd(float* dest, const float* v1, const float* v2)
+/// Performs a vector addition. (@p v1 + @p v2)
+/// @param[out] dest The result vector. [(x, y, z)]
+/// @param[in] v1 The base vector [(x, y, z)]
+/// @param[in] v2 The vector to add to @p v1. [(x, y, z)]
+inline void rcVadd(float* dest, const float* v1, const float* v2)
{
dest[0] = v1[0]+v2[0];
dest[1] = v1[1]+v2[1];
dest[2] = v1[2]+v2[2];
}
-inline void vsub(float* dest, const float* v1, const float* v2)
+/// Performs a vector subtraction. (@p v1 - @p v2)
+/// @param[out] dest The result vector. [(x, y, z)]
+/// @param[in] v1 The base vector [(x, y, z)]
+/// @param[in] v2 The vector to subtract from @p v1. [(x, y, z)]
+inline void rcVsub(float* dest, const float* v1, const float* v2)
{
dest[0] = v1[0]-v2[0];
dest[1] = v1[1]-v2[1];
dest[2] = v1[2]-v2[2];
}
-inline void vmin(float* mn, const float* v)
+/// Selects the minimum value of each element from the specified vectors.
+/// @param[in, out] mn A vector. (Will be updated with the result.) [(x, y, z)]
+/// @param[in] v A vector. [(x, y, z)]
+inline void rcVmin(float* mn, const float* v)
{
mn[0] = rcMin(mn[0], v[0]);
mn[1] = rcMin(mn[1], v[1]);
mn[2] = rcMin(mn[2], v[2]);
}
-inline void vmax(float* mx, const float* v)
+/// Selects the maximum value of each element from the specified vectors.
+/// @param[in, out] mx A vector. (Will be updated with the result.) [(x, y, z)]
+/// @param[in] v A vector. [(x, y, z)]
+inline void rcVmax(float* mx, const float* v)
{
mx[0] = rcMax(mx[0], v[0]);
mx[1] = rcMax(mx[1], v[1]);
mx[2] = rcMax(mx[2], v[2]);
}
-inline void vcopy(float* dest, const float* v)
+/// Performs a vector copy.
+/// @param[out] dest The result. [(x, y, z)]
+/// @param[in] v The vector to copy [(x, y, z)]
+inline void rcVcopy(float* dest, const float* v)
{
dest[0] = v[0];
dest[1] = v[1];
dest[2] = v[2];
}
-inline float vdist(const float* v1, const float* v2)
+/// Returns the distance between two points.
+/// @param[in] v1 A point. [(x, y, z)]
+/// @param[in] v2 A point. [(x, y, z)]
+/// @return The distance between the two points.
+inline float rcVdist(const float* v1, const float* v2)
{
float dx = v2[0] - v1[0];
float dy = v2[1] - v1[1];
float dz = v2[2] - v1[2];
- return sqrtf(dx*dx + dy*dy + dz*dz);
+ return rcSqrt(dx*dx + dy*dy + dz*dz);
}
-inline float vdistSqr(const float* v1, const float* v2)
+/// Returns the square of the distance between two points.
+/// @param[in] v1 A point. [(x, y, z)]
+/// @param[in] v2 A point. [(x, y, z)]
+/// @return The square of the distance between the two points.
+inline float rcVdistSqr(const float* v1, const float* v2)
{
float dx = v2[0] - v1[0];
float dy = v2[1] - v1[1];
@@ -318,184 +705,424 @@ inline float vdistSqr(const float* v1, const float* v2)
return dx*dx + dy*dy + dz*dz;
}
-inline void vnormalize(float* v)
+/// Normalizes the vector.
+/// @param[in,out] v The vector to normalize. [(x, y, z)]
+inline void rcVnormalize(float* v)
{
- float d = 1.0f / sqrtf(rcSqr(v[0]) + rcSqr(v[1]) + rcSqr(v[2]));
+ float d = 1.0f / rcSqrt(rcSqr(v[0]) + rcSqr(v[1]) + rcSqr(v[2]));
v[0] *= d;
v[1] *= d;
v[2] *= d;
}
-inline bool vequal(const float* p0, const float* p1)
+/// Not documented. Internal use only.
+/// @param[in] p0 Not documented.
+/// @param[in] p1 Not documented.
+/// @return Not documented.
+inline bool rcVequal(const float* p0, const float* p1)
{
static const float thr = rcSqr(1.0f/16384.0f);
- const float d = vdistSqr(p0, p1);
+ const float d = rcVdistSqr(p0, p1);
return d < thr;
}
+/// @}
+/// @name Heightfield Functions
+/// @see rcHeightfield
+/// @{
-// Calculated bounding box of array of vertices.
-// Params:
-// verts - (in) array of vertices
-// nv - (in) vertex count
-// bmin, bmax - (out) bounding box
+/// Calculates the bounding box of an array of vertices.
+/// @ingroup recast
+/// @param[in] verts An array of vertices. [(x, y, z) * @p nv]
+/// @param[in] nv The number of vertices in the @p verts array.
+/// @param[out] bmin The minimum bounds of the AABB. [(x, y, z)] [Units: wu]
+/// @param[out] bmax The maximum bounds of the AABB. [(x, y, z)] [Units: wu]
void rcCalcBounds(const float* verts, int nv, float* bmin, float* bmax);
-// Calculates grid size based on bounding box and grid cell size.
-// Params:
-// bmin, bmax - (in) bounding box
-// cs - (in) grid cell size
-// w - (out) grid width
-// h - (out) grid height
+/// Calculates the grid size based on the bounding box and grid cell size.
+/// @ingroup recast
+/// @param[in] bmin The minimum bounds of the AABB. [(x, y, z)] [Units: wu]
+/// @param[in] bmax The maximum bounds of the AABB. [(x, y, z)] [Units: wu]
+/// @param[in] cs The xz-plane cell size. [Limit: > 0] [Units: wu]
+/// @param[out] w The width along the x-axis. [Limit: >= 0] [Units: vx]
+/// @param[out] h The height along the z-axis. [Limit: >= 0] [Units: vx]
void rcCalcGridSize(const float* bmin, const float* bmax, float cs, int* w, int* h);
-// Creates and initializes new heightfield.
-// Params:
-// hf - (in/out) heightfield to initialize.
-// width - (in) width of the heightfield.
-// height - (in) height of the heightfield.
-// bmin, bmax - (in) bounding box of the heightfield
-// cs - (in) grid cell size
-// ch - (in) grid cell height
-bool rcCreateHeightfield(rcHeightfield& hf, int width, int height,
+/// Initializes a new heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in,out] hf The allocated heightfield to initialize.
+/// @param[in] width The width of the field along the x-axis. [Limit: >= 0] [Units: vx]
+/// @param[in] height The height of the field along the z-axis. [Limit: >= 0] [Units: vx]
+/// @param[in] bmin The minimum bounds of the field's AABB. [(x, y, z)] [Units: wu]
+/// @param[in] bmax The maximum bounds of the field's AABB. [(x, y, z)] [Units: wu]
+/// @param[in] cs The xz-plane cell size to use for the field. [Limit: > 0] [Units: wu]
+/// @param[in] ch The y-axis cell size to use for field. [Limit: > 0] [Units: wu]
+bool rcCreateHeightfield(rcContext* ctx, rcHeightfield& hf, int width, int height,
const float* bmin, const float* bmax,
float cs, float ch);
-// Sets the WALKABLE flag for every triangle whose slope is below
-// the maximun walkable slope angle.
-// Params:
-// walkableSlopeAngle - (in) maximun slope angle in degrees.
-// verts - (in) array of vertices
-// nv - (in) vertex count
-// tris - (in) array of triangle vertex indices
-// nt - (in) triangle count
-// flags - (out) array of triangle flags
-void rcMarkWalkableTriangles(const float walkableSlopeAngle,
- const float* verts, int nv,
- const int* tris, int nt,
- unsigned char* flags);
-
-// Rasterizes a triangle into heightfield spans.
-// Params:
-// v0,v1,v2 - (in) the vertices of the triangle.
-// flags - (in) triangle flags (uses WALKABLE)
-// solid - (in) heighfield where the triangle is rasterized
-void rcRasterizeTriangle(const float* v0, const float* v1, const float* v2,
- unsigned char flags, rcHeightfield& solid);
-
-// Rasterizes the triangles into heightfield spans.
-// Params:
-// verts - (in) array of vertices
-// nv - (in) vertex count
-// tris - (in) array of triangle vertex indices
-// norms - (in) array of triangle normals
-// flags - (in) array of triangle flags (uses WALKABLE)
-// nt - (in) triangle count
-// solid - (in) heighfield where the triangles are rasterized
-void rcRasterizeTriangles(const float* verts, int nv,
- const int* tris, const unsigned char* flags, int nt,
- rcHeightfield& solid);
-
-// Removes WALKABLE flag from all spans that are at ledges. This filtering
-// removes possible overestimation of the conservative voxelization so that
-// the resulting mesh will not have regions hanging in air over ledges.
-// Params:
-// walkableHeight - (in) minimum height where the agent can still walk
-// walkableClimb - (in) maximum height between grid cells the agent can climb
-// solid - (in/out) heightfield describing the solid space
-void rcFilterLedgeSpans(const int walkableHeight,
- const int walkableClimb,
- rcHeightfield& solid);
-
-// Removes WALKABLE flag from all spans which have smaller than
-// 'walkableHeight' clearane above them.
-// Params:
-// walkableHeight - (in) minimum height where the agent can still walk
-// solid - (in/out) heightfield describing the solid space
-void rcFilterWalkableLowHeightSpans(int walkableHeight,
- rcHeightfield& solid);
-
-// Marks spans which are reachable from any of the topmost spans.
-// Params:
-// walkableHeight - (in) minimum height where the agent can still walk
-// walkableClimb - (in) maximum height between grid cells the agent can climb
-// solid - (in/out) heightfield describing the solid space
-// Returns false if operation ran out of memory.
-bool rcMarkReachableSpans(const int walkableHeight,
- const int walkableClimb,
- rcHeightfield& solid);
-
-// Builds compact representation of the heightfield.
-// Params:
-// walkableHeight - (in) minimum height where the agent can still walk
-// walkableClimb - (in) maximum height between grid cells the agent can climb
-// hf - (in) heightfield to be compacted
-// chf - (out) compact heightfield representing the open space.
-// Returns false if operation ran out of memory.
-bool rcBuildCompactHeightfield(const int walkableHeight, const int walkableClimb,
- unsigned char flags,
- rcHeightfield& hf,
- rcCompactHeightfield& chf);
-
-// Builds distance field and stores it into the combat heightfield.
-// Params:
-// chf - (in/out) compact heightfield representing the open space.
-// Returns false if operation ran out of memory.
-bool rcBuildDistanceField(rcCompactHeightfield& chf);
-
-// Divides the walkable heighfied into simple regions.
-// Each region has only one contour and no overlaps.
-// The regions are stored in the compact heightfield 'reg' field.
-// The regions will be shrinked by the radius of the agent.
-// The process sometimes creates small regions. The parameter
-// 'minRegionSize' specifies the smallest allowed regions size.
-// If the area of a regions is smaller than allowed, the regions is
-// removed or merged to neighbour region.
-// Params:
-// chf - (in/out) compact heightfield representing the open space.
-// walkableRadius - (in) the radius of the agent.
-// minRegionSize - (in) the smallest allowed regions size.
-// maxMergeRegionSize - (in) the largest allowed regions size which can be merged.
-// Returns false if operation ran out of memory.
-bool rcBuildRegions(rcCompactHeightfield& chf,
- int walkableRadius, int borderSize,
- int minRegionSize, int mergeRegionSize);
-
-// Builds simplified contours from the regions outlines.
-// Params:
-// chf - (in) compact heightfield which has regions set.
-// maxError - (in) maximum allowed distance between simplified countour and cells.
-// maxEdgeLen - (in) maximum allowed contour edge length in cells.
-// cset - (out) Resulting contour set.
-// Returns false if operation ran out of memory.
-bool rcBuildContours(rcCompactHeightfield& chf,
+/// Sets the area id of all triangles with a slope below the specified value
+/// to #RC_WALKABLE_AREA.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] walkableSlopeAngle The maximum slope that is considered walkable. [Limits: 0 <= value < 90]
+/// [Units: Degrees]
+/// @param[in] verts The vertices. [(x, y, z) * @p nv]
+/// @param[in] nv The number of vertices.
+/// @param[in] tris The triangle vertex indices. [(vertA, vertB, vertC) * @p nt]
+/// @param[in] nt The number of triangles.
+/// @param[out] areas The triangle area ids. [Length: >= @p nt]
+void rcMarkWalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, const float* verts, int nv,
+ const int* tris, int nt, unsigned char* areas);
+
+/// Sets the area id of all triangles with a slope greater than or equal to the specified value to #RC_NULL_AREA.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] walkableSlopeAngle The maximum slope that is considered walkable. [Limits: 0 <= value < 90]
+/// [Units: Degrees]
+/// @param[in] verts The vertices. [(x, y, z) * @p nv]
+/// @param[in] nv The number of vertices.
+/// @param[in] tris The triangle vertex indices. [(vertA, vertB, vertC) * @p nt]
+/// @param[in] nt The number of triangles.
+/// @param[out] areas The triangle area ids. [Length: >= @p nt]
+void rcClearUnwalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, const float* verts, int nv,
+ const int* tris, int nt, unsigned char* areas);
+
+/// Adds a span to the specified heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in,out] hf An initialized heightfield.
+/// @param[in] x The width index where the span is to be added.
+/// [Limits: 0 <= value < rcHeightfield::width]
+/// @param[in] y The height index where the span is to be added.
+/// [Limits: 0 <= value < rcHeightfield::height]
+/// @param[in] smin The minimum height of the span. [Limit: < @p smax] [Units: vx]
+/// @param[in] smax The maximum height of the span. [Limit: <= #RC_SPAN_MAX_HEIGHT] [Units: vx]
+/// @param[in] area The area id of the span. [Limit: <= #RC_WALKABLE_AREA)
+/// @param[in] flagMergeThr The merge theshold. [Limit: >= 0] [Units: vx]
+void rcAddSpan(rcContext* ctx, rcHeightfield& hf, const int x, const int y,
+ const unsigned short smin, const unsigned short smax,
+ const unsigned char area, const int flagMergeThr);
+
+/// Rasterizes a triangle into the specified heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] v0 Triangle vertex 0 [(x, y, z)]
+/// @param[in] v1 Triangle vertex 1 [(x, y, z)]
+/// @param[in] v2 Triangle vertex 2 [(x, y, z)]
+/// @param[in] area The area id of the triangle. [Limit: <= #RC_WALKABLE_AREA]
+/// @param[in, out] solid An initialized heightfield.
+/// @param[in] flagMergeThr The distance where the walkable flag is favored over the non-walkable flag.
+/// [Limit: >= 0] [Units: vx]
+void rcRasterizeTriangle(rcContext* ctx, const float* v0, const float* v1, const float* v2,
+ const unsigned char area, rcHeightfield& solid,
+ const int flagMergeThr = 1);
+
+/// Rasterizes an indexed triangle mesh into the specified heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] verts The vertices. [(x, y, z) * @p nv]
+/// @param[in] nv The number of vertices.
+/// @param[in] tris The triangle indices. [(vertA, vertB, vertC) * @p nt]
+/// @param[in] areas The area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: @p nt]
+/// @param[in] nt The number of triangles.
+/// @param[in, out] solid An initialized heightfield.
+/// @param[in] flagMergeThr The distance where the walkable flag is favored over the non-walkable flag.
+/// [Limit: >= 0] [Units: vx]
+void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int nv,
+ const int* tris, const unsigned char* areas, const int nt,
+ rcHeightfield& solid, const int flagMergeThr = 1);
+
+/// Rasterizes an indexed triangle mesh into the specified heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] verts The vertices. [(x, y, z) * @p nv]
+/// @param[in] nv The number of vertices.
+/// @param[in] tris The triangle indices. [(vertA, vertB, vertC) * @p nt]
+/// @param[in] areas The area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: @p nt]
+/// @param[in] nt The number of triangles.
+/// @param[in, out] solid An initialized heightfield.
+/// @param[in] flagMergeThr The distance where the walkable flag is favored over the non-walkable flag.
+/// [Limit: >= 0] [Units: vx]
+void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int nv,
+ const unsigned short* tris, const unsigned char* areas, const int nt,
+ rcHeightfield& solid, const int flagMergeThr = 1);
+
+/// Rasterizes triangles into the specified heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] verts The triangle vertices. [(ax, ay, az, bx, by, bz, cx, by, cx) * @p nt]
+/// @param[in] areas The area id's of the triangles. [Limit: <= #RC_WALKABLE_AREA] [Size: @p nt]
+/// @param[in] nt The number of triangles.
+/// @param[in, out] solid An initialized heightfield.
+/// @param[in] flagMergeThr The distance where the walkable flag is favored over the non-walkable flag.
+/// [Limit: >= 0] [Units: vx]
+void rcRasterizeTriangles(rcContext* ctx, const float* verts, const unsigned char* areas, const int nt,
+ rcHeightfield& solid, const int flagMergeThr = 1);
+
+/// Marks non-walkable spans as walkable if their maximum is within @p walkableClimp of a walkable neihbor.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] walkableClimb Maximum ledge height that is considered to still be traversable.
+/// [Limit: >=0] [Units: vx]
+/// @param[in,out] solid A fully built heightfield. (All spans have been added.)
+void rcFilterLowHangingWalkableObstacles(rcContext* ctx, const int walkableClimb, rcHeightfield& solid);
+
+/// Marks spans that are ledges as not-walkable.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] walkableHeight Minimum floor to 'ceiling' height that will still allow the floor area to
+/// be considered walkable. [Limit: >= 3] [Units: vx]
+/// @param[in] walkableClimb Maximum ledge height that is considered to still be traversable.
+/// [Limit: >=0] [Units: vx]
+/// @param[in,out] solid A fully built heightfield. (All spans have been added.)
+void rcFilterLedgeSpans(rcContext* ctx, const int walkableHeight,
+ const int walkableClimb, rcHeightfield& solid);
+
+/// Marks walkable spans as not walkable if the clearence above the span is less than the specified height.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] walkableHeight Minimum floor to 'ceiling' height that will still allow the floor area to
+/// be considered walkable. [Limit: >= 3] [Units: vx]
+/// @param[in,out] solid A fully built heightfield. (All spans have been added.)
+void rcFilterWalkableLowHeightSpans(rcContext* ctx, int walkableHeight, rcHeightfield& solid);
+
+/// Returns the number of spans contained in the specified heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] hf An initialized heightfield.
+/// @returns The number of spans in the heightfield.
+int rcGetHeightFieldSpanCount(rcContext* ctx, rcHeightfield& hf);
+
+/// @}
+/// @name Compact Heightfield Functions
+/// @see rcCompactHeightfield
+/// @{
+
+/// Builds a compact heightfield representing open space, from a heightfield representing solid space.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] walkableHeight Minimum floor to 'ceiling' height that will still allow the floor area
+/// to be considered walkable. [Limit: >= 3] [Units: vx]
+/// @param[in] walkableClimb Maximum ledge height that is considered to still be traversable.
+/// [Limit: >=0] [Units: vx]
+/// @param[in] hf The heightfield to be compacted.
+/// @param[out] chf The resulting compact heightfield. (Must be pre-allocated.)
+/// @returns True if the operation completed successfully.
+bool rcBuildCompactHeightfield(rcContext* ctx, const int walkableHeight, const int walkableClimb,
+ rcHeightfield& hf, rcCompactHeightfield& chf);
+
+/// Erodes the walkable area within the heightfield by the specified radius.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] radius The radius of erosion. [Limits: 0 < value < 255] [Units: vx]
+/// @param[in,out] chf The populated compact heightfield to erode.
+/// @returns True if the operation completed successfully.
+bool rcErodeWalkableArea(rcContext* ctx, int radius, rcCompactHeightfield& chf);
+
+/// Applies a median filter to walkable area types (based on area id), removing noise.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in,out] chf A populated compact heightfield.
+/// @returns True if the operation completed successfully.
+bool rcMedianFilterWalkableArea(rcContext* ctx, rcCompactHeightfield& chf);
+
+/// Applies an area id to all spans within the specified bounding box. (AABB)
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] bmin The minimum of the bounding box. [(x, y, z)]
+/// @param[in] bmax The maximum of the bounding box. [(x, y, z)]
+/// @param[in] areaId The area id to apply. [Limit: <= #RC_WALKABLE_AREA]
+/// @param[in,out] chf A populated compact heightfield.
+void rcMarkBoxArea(rcContext* ctx, const float* bmin, const float* bmax, unsigned char areaId,
+ rcCompactHeightfield& chf);
+
+/// Applies the area id to the all spans within the specified convex polygon.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] verts The vertices of the polygon [Fomr: (x, y, z) * @p nverts]
+/// @param[in] nverts The number of vertices in the polygon.
+/// @param[in] hmin The height of the base of the polygon.
+/// @param[in] hmax The height of the top of the polygon.
+/// @param[in] areaId The area id to apply. [Limit: <= #RC_WALKABLE_AREA]
+/// @param[in,out] chf A populated compact heightfield.
+void rcMarkConvexPolyArea(rcContext* ctx, const float* verts, const int nverts,
+ const float hmin, const float hmax, unsigned char areaId,
+ rcCompactHeightfield& chf);
+
+/// Applies the area id to all spans within the specified cylinder.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] pos The center of the base of the cylinder. [Form: (x, y, z)]
+/// @param[in] r The radius of the cylinder.
+/// @param[in] h The height of the cylinder.
+/// @param[in] areaId The area id to apply. [Limit: <= #RC_WALKABLE_AREA]
+/// @param[in,out] chf A populated compact heightfield.
+void rcMarkCylinderArea(rcContext* ctx, const float* pos,
+ const float r, const float h, unsigned char areaId,
+ rcCompactHeightfield& chf);
+
+/// Builds the distance field for the specified compact heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in,out] chf A populated compact heightfield.
+/// @returns True if the operation completed successfully.
+bool rcBuildDistanceField(rcContext* ctx, rcCompactHeightfield& chf);
+
+/// Builds region data for the heightfield using watershed partitioning.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in,out] chf A populated compact heightfield.
+/// @param[in] borderSize The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
+/// @param[in] minRegionArea The minimum number of cells allowed to form isolated island areas. [Limit: >=0]
+/// [Units: vx].
+/// @param[in] mergeRegionArea Any regions with a span count smaller than this value will, if possible,
+/// be merged with larger regions. [Limit: >=0] [Units: vx]
+/// @returns True if the operation completed successfully.
+bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf,
+ const int borderSize, const int minRegionArea, const int mergeRegionArea);
+
+/// Builds region data for the heightfield using simple monotone partitioning.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in,out] chf A populated compact heightfield.
+/// @param[in] borderSize The size of the non-navigable border around the heightfield. [Limit: >=0] [Units: vx]
+/// @param[in] minRegionArea The minimum number of cells allowed to form isolated island areas. [Limit: >=0]
+/// [Units: vx].
+/// @param[in] mergeRegionArea Any regions with a span count smaller than this value will, if possible,
+/// be merged with larger regions. [Limit: >=0] [Units: vx]
+/// @returns True if the operation completed successfully.
+bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf,
+ const int borderSize, const int minRegionArea, const int mergeRegionArea);
+
+
+/// Sets the neighbor connection data for the specified direction.
+/// @param[in] s The span to update.
+/// @param[in] dir The direction to set. [Limits: 0 <= value < 4]
+/// @param[in] i The index of the neighbor span.
+inline void rcSetCon(rcCompactSpan& s, int dir, int i)
+{
+ const unsigned int shift = (unsigned int)dir*6;
+ unsigned int con = s.con;
+ s.con = (con & ~(0x3f << shift)) | (((unsigned int)i & 0x3f) << shift);
+}
+
+/// Gets neighbor connection data for the specified direction.
+/// @param[in] s The span to check.
+/// @param[in] dir The direction to check. [Limits: 0 <= value < 4]
+/// @return The neighbor connection data for the specified direction,
+/// or #RC_NOT_CONNECTED if there is no connection.
+inline int rcGetCon(const rcCompactSpan& s, int dir)
+{
+ const unsigned int shift = (unsigned int)dir*6;
+ return (s.con >> shift) & 0x3f;
+}
+
+/// Gets the standard width (x-axis) offset for the specified direction.
+/// @param[in] dir The direction. [Limits: 0 <= value < 4]
+/// @return The width offset to apply to the current cell position to move
+/// in the direction.
+inline int rcGetDirOffsetX(int dir)
+{
+ const int offset[4] = { -1, 0, 1, 0, };
+ return offset[dir&0x03];
+}
+
+/// Gets the standard height (z-axis) offset for the specified direction.
+/// @param[in] dir The direction. [Limits: 0 <= value < 4]
+/// @return The height offset to apply to the current cell position to move
+/// in the direction.
+inline int rcGetDirOffsetY(int dir)
+{
+ const int offset[4] = { 0, 1, 0, -1 };
+ return offset[dir&0x03];
+}
+
+/// @}
+/// @name Layer, Contour, Polymesh, and Detail Mesh Functions
+/// @see rcHeightfieldLayer, rcContourSet, rcPolyMesh, rcPolyMeshDetail
+/// @{
+
+/// Builds a layer set from the specified compact heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] chf A fully built compact heightfield.
+/// @param[in] borderSize The size of the non-navigable border around the heightfield. [Limit: >=0]
+/// [Units: vx]
+/// @param[in] walkableHeight Minimum floor to 'ceiling' height that will still allow the floor area
+/// to be considered walkable. [Limit: >= 3] [Units: vx]
+/// @param[out] lset The resulting layer set. (Must be pre-allocated.)
+/// @returns True if the operation completed successfully.
+bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
+ const int borderSize, const int walkableHeight,
+ rcHeightfieldLayerSet& lset);
+
+/// Builds a contour set from the region outlines in the provided compact heightfield.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] chf A fully built compact heightfield.
+/// @param[in] maxError The maximum distance a simplfied contour's border edges should deviate
+/// the original raw contour. [Limit: >=0] [Units: wu]
+/// @param[in] maxEdgeLen The maximum allowed length for contour edges along the border of the mesh.
+/// [Limit: >=0] [Units: vx]
+/// @param[out] cset The resulting contour set. (Must be pre-allocated.)
+/// @param[in] buildFlags The build flags. (See: #rcBuildContoursFlags)
+/// @returns True if the operation completed successfully.
+bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
const float maxError, const int maxEdgeLen,
- rcContourSet& cset);
-
-// Builds connected convex polygon mesh from contour polygons.
-// Params:
-// cset - (in) contour set.
-// nvp - (in) maximum number of vertices per polygon.
-// mesh - (out) poly mesh.
-// Returns false if operation ran out of memory.
-bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh);
-
-bool rcMergePolyMeshes(rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh);
-
-// Builds detail triangle mesh for each polygon in the poly mesh.
-// Params:
-// mesh - (in) poly mesh to detail.
-// chf - (in) compacy height field, used to query height for new vertices.
-// sampleDist - (in) spacing between height samples used to generate more detail into mesh.
-// sampleMaxError - (in) maximum allowed distance between simplified detail mesh and height sample.
-// pmdtl - (out) detail mesh.
-// Returns false if operation ran out of memory.
-bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& chf,
+ rcContourSet& cset, const int flags = RC_CONTOUR_TESS_WALL_EDGES);
+
+/// Builds a polygon mesh from the provided contours.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] cset A fully built contour set.
+/// @param[in] nvp The maximum number of vertices allowed for polygons generated during the
+/// contour to polygon conversion process. [Limit: >= 3]
+/// @param[out] mesh The resulting polygon mesh. (Must be re-allocated.)
+/// @returns True if the operation completed successfully.
+bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh);
+
+/// Merges multiple polygon meshes into a single mesh.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] meshes An array of polygon meshes to merge. [Size: @p nmeshes]
+/// @param[in] nmeshes The number of polygon meshes in the meshes array.
+/// @param[in] mesh The resulting polygon mesh. (Must be pre-allocated.)
+/// @returns True if the operation completed successfully.
+bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh);
+
+/// Builds a detail mesh from the provided polygon mesh.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] mesh A fully built polygon mesh.
+/// @param[in] chf The compact heightfield used to build the polygon mesh.
+/// @param[in] sampleDist Sets the distance to use when samping the heightfield. [Limit: >=0] [Units: wu]
+/// @param[in] sampleMaxError The maximum distance the detail mesh surface should deviate from
+/// heightfield data. [Limit: >=0] [Units: wu]
+/// @param[out] dmesh The resulting detail mesh. (Must be pre-allocated.)
+/// @returns True if the operation completed successfully.
+bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompactHeightfield& chf,
const float sampleDist, const float sampleMaxError,
rcPolyMeshDetail& dmesh);
-bool rcMergePolyMeshDetails(rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh);
+/// Merges multiple detail meshes into a single detail mesh.
+/// @ingroup recast
+/// @param[in,out] ctx The build context to use during the operation.
+/// @param[in] meshes An array of detail meshes to merge. [Size: @p nmeshes]
+/// @param[in] nmeshes The number of detail meshes in the meshes array.
+/// @param[out] mesh The resulting detail mesh. (Must be pre-allocated.)
+/// @returns True if the operation completed successfully.
+bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh);
bool buildMeshAdjacency(unsigned short* polys, const int npolys, const int nverts, const int vertsPerPoly);
+/// @}
+
#endif // RECAST_H
+
+///////////////////////////////////////////////////////////////////////////
+
+// Due to the large amount of detail documentation for this file,
+// the content normally located at the end of the header file has been separated
+// out to a file in /Docs/Extern.
diff --git a/extern/recastnavigation/Recast/Include/RecastAlloc.h b/extern/recastnavigation/Recast/Include/RecastAlloc.h
new file mode 100644
index 00000000000..0038c1a5c54
--- /dev/null
+++ b/extern/recastnavigation/Recast/Include/RecastAlloc.h
@@ -0,0 +1,122 @@
+//
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+//
+
+#ifndef RECASTALLOC_H
+#define RECASTALLOC_H
+
+/// Provides hint values to the memory allocator on how long the
+/// memory is expected to be used.
+enum rcAllocHint
+{
+ RC_ALLOC_PERM, ///< Memory will persist after a function call.
+ RC_ALLOC_TEMP ///< Memory used temporarily within a function.
+};
+
+/// A memory allocation function.
+// @param[in] size The size, in bytes of memory, to allocate.
+// @param[in] rcAllocHint A hint to the allocator on how long the memory is expected to be in use.
+// @return A pointer to the beginning of the allocated memory block, or null if the allocation failed.
+/// @see rcAllocSetCustom
+typedef void* (rcAllocFunc)(int size, rcAllocHint hint);
+
+/// A memory deallocation function.
+/// @see rcAllocSetCustom
+// @param[in] ptr
+typedef void (rcFreeFunc)(void* ptr);
+
+/// Sets the base custom allocation functions to be used by Recast.
+/// @param[in] allocFunc The memory allocation function to be used by #rcAlloc
+/// @param[in] freeFunc The memory de-allocation function to be used by #rcFree
+void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc);
+
+/// Allocates a memory block.
+/// @param[in] size The size, in bytes of memory, to allocate.
+/// @param[in] hint A hint to the allocator on how long the memory is expected to be in use.
+/// @return A pointer to the beginning of the allocated memory block, or null if the allocation failed.
+void* rcAlloc(int size, rcAllocHint hint);
+
+/// Deallocates a memory block.
+/// @param[in] ptr A pointer to a memory block previously allocated using #rcAlloc.
+void rcFree(void* ptr);
+
+
+/// A simple dynamic array of integers.
+class rcIntArray
+{
+ int* m_data;
+ int m_size, m_cap;
+ inline rcIntArray(const rcIntArray&);
+ inline rcIntArray& operator=(const rcIntArray&);
+public:
+
+ /// Constructs an instance with an initial array size of zero.
+ inline rcIntArray() : m_data(0), m_size(0), m_cap(0) {}
+
+ /// Constructs an instance initialized to the specified size.
+ /// @param[in] n The initial size of the integer array.
+ inline rcIntArray(int n) : m_data(0), m_size(0), m_cap(0) { resize(n); }
+ inline ~rcIntArray() { rcFree(m_data); }
+
+ /// Specifies the new size of the integer array.
+ /// @param[in] n The new size of the integer array.
+ void resize(int n);
+
+ /// Push the specified integer onto the end of the array and increases the size by one.
+ /// @param[in] item The new value.
+ inline void push(int item) { resize(m_size+1); m_data[m_size-1] = item; }
+
+ /// Returns the value at the end of the array and reduces the size by one.
+ /// @return The value at the end of the array.
+ inline int pop() { if (m_size > 0) m_size--; return m_data[m_size]; }
+
+ /// The value at the specified array index.
+ /// @warning Does not provide overflow protection.
+ /// @param[in] i The index of the value.
+ inline const int& operator[](int i) const { return m_data[i]; }
+
+ /// The value at the specified array index.
+ /// @warning Does not provide overflow protection.
+ /// @param[in] i The index of the value.
+ inline int& operator[](int i) { return m_data[i]; }
+
+ /// The current size of the integer array.
+ inline int size() const { return m_size; }
+};
+
+/// A simple helper class used to delete an array when it goes out of scope.
+/// @note This class is rarely if ever used by the end user.
+template<class T> class rcScopedDelete
+{
+ T* ptr;
+ inline T* operator=(T* p);
+public:
+
+ /// Constructs an instance with a null pointer.
+ inline rcScopedDelete() : ptr(0) {}
+
+ /// Constructs an instance with the specified pointer.
+ /// @param[in] p An pointer to an allocated array.
+ inline rcScopedDelete(T* p) : ptr(p) {}
+ inline ~rcScopedDelete() { rcFree(ptr); }
+
+ /// The root array pointer.
+ /// @return The root array pointer.
+ inline operator T*() { return ptr; }
+};
+
+#endif
diff --git a/extern/recastnavigation/Recast/Include/RecastAssert.h b/extern/recastnavigation/Recast/Include/RecastAssert.h
new file mode 100644
index 00000000000..b58b8fcd286
--- /dev/null
+++ b/extern/recastnavigation/Recast/Include/RecastAssert.h
@@ -0,0 +1,33 @@
+//
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+//
+
+#ifndef RECASTASSERT_H
+#define RECASTASSERT_H
+
+// Note: This header file's only purpose is to include define assert.
+// Feel free to change the file and include your own implementation instead.
+
+#ifdef NDEBUG
+// From http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/
+# define rcAssert(x) do { (void)sizeof(x); } while(__LINE__==-1,false)
+#else
+# include <assert.h>
+# define rcAssert assert
+#endif
+
+#endif // RECASTASSERT_H
diff --git a/extern/recastnavigation/Recast/Source/Recast.cpp b/extern/recastnavigation/Recast/Source/Recast.cpp
index 0db26c2c1cd..283cf0c128b 100644
--- a/extern/recastnavigation/Recast/Source/Recast.cpp
+++ b/extern/recastnavigation/Recast/Source/Recast.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -22,35 +22,178 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <stdarg.h>
#include "Recast.h"
-#include "RecastLog.h"
-#include "RecastTimer.h"
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
+float rcSqrt(float x)
+{
+ return sqrtf(x);
+}
+
+/// @class rcContext
+/// @par
+///
+/// This class does not provide logging or timer functionality on its
+/// own. Both must be provided by a concrete implementation
+/// by overriding the protected member functions. Also, this class does not
+/// provide an interface for extracting log messages. (Only adding them.)
+/// So concrete implementations must provide one.
+///
+/// If no logging or timers are required, just pass an instance of this
+/// class through the Recast build process.
+///
-void rcIntArray::resize(int n)
+/// @par
+///
+/// Example:
+/// @code
+/// // Where ctx is an instance of rcContext and filepath is a char array.
+/// ctx->log(RC_LOG_ERROR, "buildTiledNavigation: Could not load '%s'", filepath);
+/// @endcode
+void rcContext::log(const rcLogCategory category, const char* format, ...)
{
- if (n > m_cap)
+ if (!m_logEnabled)
+ return;
+ static const int MSG_SIZE = 512;
+ char msg[MSG_SIZE];
+ va_list ap;
+ va_start(ap, format);
+ int len = vsnprintf(msg, MSG_SIZE, format, ap);
+ if (len >= MSG_SIZE)
{
- if (!m_cap) m_cap = 8;
- while (m_cap < n) m_cap *= 2;
- int* newData = new int[m_cap];
- if (m_size && newData) memcpy(newData, m_data, m_size*sizeof(int));
- delete [] m_data;
- m_data = newData;
+ len = MSG_SIZE-1;
+ msg[MSG_SIZE-1] = '\0';
}
- m_size = n;
+ va_end(ap);
+ doLog(category, msg, len);
+}
+
+rcHeightfield* rcAllocHeightfield()
+{
+ rcHeightfield* hf = (rcHeightfield*)rcAlloc(sizeof(rcHeightfield), RC_ALLOC_PERM);
+ memset(hf, 0, sizeof(rcHeightfield));
+ return hf;
+}
+
+void rcFreeHeightField(rcHeightfield* hf)
+{
+ if (!hf) return;
+ // Delete span array.
+ rcFree(hf->spans);
+ // Delete span pools.
+ while (hf->pools)
+ {
+ rcSpanPool* next = hf->pools->next;
+ rcFree(hf->pools);
+ hf->pools = next;
+ }
+ rcFree(hf);
+}
+
+rcCompactHeightfield* rcAllocCompactHeightfield()
+{
+ rcCompactHeightfield* chf = (rcCompactHeightfield*)rcAlloc(sizeof(rcCompactHeightfield), RC_ALLOC_PERM);
+ memset(chf, 0, sizeof(rcCompactHeightfield));
+ return chf;
+}
+
+void rcFreeCompactHeightfield(rcCompactHeightfield* chf)
+{
+ if (!chf) return;
+ rcFree(chf->cells);
+ rcFree(chf->spans);
+ rcFree(chf->dist);
+ rcFree(chf->areas);
+ rcFree(chf);
+}
+
+
+rcHeightfieldLayerSet* rcAllocHeightfieldLayerSet()
+{
+ rcHeightfieldLayerSet* lset = (rcHeightfieldLayerSet*)rcAlloc(sizeof(rcHeightfieldLayerSet), RC_ALLOC_PERM);
+ memset(lset, 0, sizeof(rcHeightfieldLayerSet));
+ return lset;
+}
+
+void rcFreeHeightfieldLayerSet(rcHeightfieldLayerSet* lset)
+{
+ if (!lset) return;
+ for (int i = 0; i < lset->nlayers; ++i)
+ {
+ rcFree(lset->layers[i].heights);
+ rcFree(lset->layers[i].areas);
+ rcFree(lset->layers[i].cons);
+ }
+ rcFree(lset->layers);
+ rcFree(lset);
+}
+
+
+rcContourSet* rcAllocContourSet()
+{
+ rcContourSet* cset = (rcContourSet*)rcAlloc(sizeof(rcContourSet), RC_ALLOC_PERM);
+ memset(cset, 0, sizeof(rcContourSet));
+ return cset;
+}
+
+void rcFreeContourSet(rcContourSet* cset)
+{
+ if (!cset) return;
+ for (int i = 0; i < cset->nconts; ++i)
+ {
+ rcFree(cset->conts[i].verts);
+ rcFree(cset->conts[i].rverts);
+ }
+ rcFree(cset->conts);
+ rcFree(cset);
+}
+
+rcPolyMesh* rcAllocPolyMesh()
+{
+ rcPolyMesh* pmesh = (rcPolyMesh*)rcAlloc(sizeof(rcPolyMesh), RC_ALLOC_PERM);
+ memset(pmesh, 0, sizeof(rcPolyMesh));
+ return pmesh;
+}
+
+void rcFreePolyMesh(rcPolyMesh* pmesh)
+{
+ if (!pmesh) return;
+ rcFree(pmesh->verts);
+ rcFree(pmesh->polys);
+ rcFree(pmesh->regs);
+ rcFree(pmesh->flags);
+ rcFree(pmesh->areas);
+ rcFree(pmesh);
+}
+
+rcPolyMeshDetail* rcAllocPolyMeshDetail()
+{
+ rcPolyMeshDetail* dmesh = (rcPolyMeshDetail*)rcAlloc(sizeof(rcPolyMeshDetail), RC_ALLOC_PERM);
+ memset(dmesh, 0, sizeof(rcPolyMeshDetail));
+ return dmesh;
+}
+
+void rcFreePolyMeshDetail(rcPolyMeshDetail* dmesh)
+{
+ if (!dmesh) return;
+ rcFree(dmesh->meshes);
+ rcFree(dmesh->verts);
+ rcFree(dmesh->tris);
+ rcFree(dmesh);
}
void rcCalcBounds(const float* verts, int nv, float* bmin, float* bmax)
{
// Calculate bounding box.
- vcopy(bmin, verts);
- vcopy(bmax, verts);
+ rcVcopy(bmin, verts);
+ rcVcopy(bmax, verts);
for (int i = 1; i < nv; ++i)
{
const float* v = &verts[i*3];
- vmin(bmin, v);
- vmax(bmax, v);
+ rcVmin(bmin, v);
+ rcVmax(bmax, v);
}
}
@@ -60,17 +203,25 @@ void rcCalcGridSize(const float* bmin, const float* bmax, float cs, int* w, int*
*h = (int)((bmax[2] - bmin[2])/cs+0.5f);
}
-bool rcCreateHeightfield(rcHeightfield& hf, int width, int height,
+/// @par
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// @see rcAllocHeightfield, rcHeightfield
+bool rcCreateHeightfield(rcContext* /*ctx*/, rcHeightfield& hf, int width, int height,
const float* bmin, const float* bmax,
float cs, float ch)
{
+ // TODO: VC complains about unref formal variable, figure out a way to handle this better.
+// rcAssert(ctx);
+
hf.width = width;
hf.height = height;
- hf.spans = new rcSpan*[hf.width*hf.height];
- vcopy(hf.bmin, bmin);
- vcopy(hf.bmax, bmax);
+ rcVcopy(hf.bmin, bmin);
+ rcVcopy(hf.bmax, bmax);
hf.cs = cs;
hf.ch = ch;
+ hf.spans = (rcSpan**)rcAlloc(sizeof(rcSpan*)*hf.width*hf.height, RC_ALLOC_PERM);
if (!hf.spans)
return false;
memset(hf.spans, 0, sizeof(rcSpan*)*hf.width*hf.height);
@@ -80,18 +231,29 @@ bool rcCreateHeightfield(rcHeightfield& hf, int width, int height,
static void calcTriNormal(const float* v0, const float* v1, const float* v2, float* norm)
{
float e0[3], e1[3];
- vsub(e0, v1, v0);
- vsub(e1, v2, v0);
- vcross(norm, e0, e1);
- vnormalize(norm);
+ rcVsub(e0, v1, v0);
+ rcVsub(e1, v2, v0);
+ rcVcross(norm, e0, e1);
+ rcVnormalize(norm);
}
-void rcMarkWalkableTriangles(const float walkableSlopeAngle,
- const float* verts, int nv,
+/// @par
+///
+/// Only sets the aread id's for the walkable triangles. Does not alter the
+/// area id's for unwalkable triangles.
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// @see rcHeightfield, rcClearUnwalkableTriangles, rcRasterizeTriangles
+void rcMarkWalkableTriangles(rcContext* /*ctx*/, const float walkableSlopeAngle,
+ const float* verts, int /*nv*/,
const int* tris, int nt,
- unsigned char* flags)
+ unsigned char* areas)
{
- const float walkableThr = cosf(walkableSlopeAngle/180.0f*(float)M_PI);
+ // TODO: VC complains about unref formal variable, figure out a way to handle this better.
+// rcAssert(ctx);
+
+ const float walkableThr = cosf(walkableSlopeAngle/180.0f*RC_PI);
float norm[3];
@@ -101,12 +263,45 @@ void rcMarkWalkableTriangles(const float walkableSlopeAngle,
calcTriNormal(&verts[tri[0]*3], &verts[tri[1]*3], &verts[tri[2]*3], norm);
// Check if the face is walkable.
if (norm[1] > walkableThr)
- flags[i] |= RC_WALKABLE;
+ areas[i] = RC_WALKABLE_AREA;
+ }
+}
+
+/// @par
+///
+/// Only sets the aread id's for the unwalkable triangles. Does not alter the
+/// area id's for walkable triangles.
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// @see rcHeightfield, rcClearUnwalkableTriangles, rcRasterizeTriangles
+void rcClearUnwalkableTriangles(rcContext* /*ctx*/, const float walkableSlopeAngle,
+ const float* verts, int /*nv*/,
+ const int* tris, int nt,
+ unsigned char* areas)
+{
+ // TODO: VC complains about unref formal variable, figure out a way to handle this better.
+// rcAssert(ctx);
+
+ const float walkableThr = cosf(walkableSlopeAngle/180.0f*RC_PI);
+
+ float norm[3];
+
+ for (int i = 0; i < nt; ++i)
+ {
+ const int* tri = &tris[i*3];
+ calcTriNormal(&verts[tri[0]*3], &verts[tri[1]*3], &verts[tri[2]*3], norm);
+ // Check if the face is walkable.
+ if (norm[1] <= walkableThr)
+ areas[i] = RC_NULL_AREA;
}
}
-static int getSpanCount(unsigned char flags, rcHeightfield& hf)
+int rcGetHeightFieldSpanCount(rcContext* /*ctx*/, rcHeightfield& hf)
{
+ // TODO: VC complains about unref formal variable, figure out a way to handle this better.
+// rcAssert(ctx);
+
const int w = hf.width;
const int h = hf.height;
int spanCount = 0;
@@ -116,7 +311,7 @@ static int getSpanCount(unsigned char flags, rcHeightfield& hf)
{
for (rcSpan* s = hf.spans[x + y*w]; s; s = s->next)
{
- if (s->flags == flags)
+ if (s->area != RC_NULL_AREA)
spanCount++;
}
}
@@ -124,21 +319,25 @@ static int getSpanCount(unsigned char flags, rcHeightfield& hf)
return spanCount;
}
-inline void setCon(rcCompactSpan& s, int dir, int i)
-{
- s.con &= ~(0xf << (dir*4));
- s.con |= (i&0xf) << (dir*4);
-}
-
-bool rcBuildCompactHeightfield(const int walkableHeight, const int walkableClimb,
- unsigned char flags, rcHeightfield& hf,
- rcCompactHeightfield& chf)
+/// @par
+///
+/// This is just the beginning of the process of fully building a compact heightfield.
+/// Various filters may be applied applied, then the distance field and regions built.
+/// E.g: #rcBuildDistanceField and #rcBuildRegions
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// @see rcAllocCompactHeightfield, rcHeightfield, rcCompactHeightfield, rcConfig
+bool rcBuildCompactHeightfield(rcContext* ctx, const int walkableHeight, const int walkableClimb,
+ rcHeightfield& hf, rcCompactHeightfield& chf)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_BUILD_COMPACTHEIGHTFIELD);
const int w = hf.width;
const int h = hf.height;
- const int spanCount = getSpanCount(flags, hf);
+ const int spanCount = rcGetHeightFieldSpanCount(ctx, hf);
// Fill in header.
chf.width = w;
@@ -147,27 +346,32 @@ bool rcBuildCompactHeightfield(const int walkableHeight, const int walkableClimb
chf.walkableHeight = walkableHeight;
chf.walkableClimb = walkableClimb;
chf.maxRegions = 0;
- vcopy(chf.bmin, hf.bmin);
- vcopy(chf.bmax, hf.bmax);
+ rcVcopy(chf.bmin, hf.bmin);
+ rcVcopy(chf.bmax, hf.bmax);
chf.bmax[1] += walkableHeight*hf.ch;
chf.cs = hf.cs;
chf.ch = hf.ch;
- chf.cells = new rcCompactCell[w*h];
+ chf.cells = (rcCompactCell*)rcAlloc(sizeof(rcCompactCell)*w*h, RC_ALLOC_PERM);
if (!chf.cells)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.cells' (%d)", w*h);
+ ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.cells' (%d)", w*h);
return false;
}
memset(chf.cells, 0, sizeof(rcCompactCell)*w*h);
- chf.spans = new rcCompactSpan[spanCount];
+ chf.spans = (rcCompactSpan*)rcAlloc(sizeof(rcCompactSpan)*spanCount, RC_ALLOC_PERM);
if (!chf.spans)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.spans' (%d)", spanCount);
+ ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.spans' (%d)", spanCount);
return false;
}
memset(chf.spans, 0, sizeof(rcCompactSpan)*spanCount);
+ chf.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*spanCount, RC_ALLOC_PERM);
+ if (!chf.areas)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Out of memory 'chf.areas' (%d)", spanCount);
+ return false;
+ }
+ memset(chf.areas, RC_NULL_AREA, sizeof(unsigned char)*spanCount);
const int MAX_HEIGHT = 0xffff;
@@ -185,12 +389,13 @@ bool rcBuildCompactHeightfield(const int walkableHeight, const int walkableClimb
c.count = 0;
while (s)
{
- if (s->flags == flags)
+ if (s->area != RC_NULL_AREA)
{
const int bot = (int)s->smax;
const int top = s->next ? (int)s->next->smin : MAX_HEIGHT;
chf.spans[idx].y = (unsigned short)rcClamp(bot, 0, 0xffff);
chf.spans[idx].h = (unsigned char)rcClamp(top - bot, 0, 0xff);
+ chf.areas[idx] = s->area;
idx++;
c.count++;
}
@@ -200,6 +405,8 @@ bool rcBuildCompactHeightfield(const int walkableHeight, const int walkableClimb
}
// Find neighbour connections.
+ const int MAX_LAYERS = RC_NOT_CONNECTED-1;
+ int tooHighNeighbour = 0;
for (int y = 0; y < h; ++y)
{
for (int x = 0; x < w; ++x)
@@ -208,14 +415,16 @@ bool rcBuildCompactHeightfield(const int walkableHeight, const int walkableClimb
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
rcCompactSpan& s = chf.spans[i];
+
for (int dir = 0; dir < 4; ++dir)
{
- setCon(s, dir, 0xf);
+ rcSetCon(s, dir, RC_NOT_CONNECTED);
const int nx = x + rcGetDirOffsetX(dir);
const int ny = y + rcGetDirOffsetY(dir);
// First check that the neighbour cell is in bounds.
if (nx < 0 || ny < 0 || nx >= w || ny >= h)
continue;
+
// Iterate over all neighbour spans and check if any of the is
// accessible from current cell.
const rcCompactCell& nc = chf.cells[nx+ny*w];
@@ -230,23 +439,34 @@ bool rcBuildCompactHeightfield(const int walkableHeight, const int walkableClimb
if ((top - bot) >= walkableHeight && rcAbs((int)ns.y - (int)s.y) <= walkableClimb)
{
// Mark direction as walkable.
- setCon(s, dir, k - (int)nc.index);
+ const int idx = k - (int)nc.index;
+ if (idx < 0 || idx > MAX_LAYERS)
+ {
+ tooHighNeighbour = rcMax(tooHighNeighbour, idx);
+ continue;
+ }
+ rcSetCon(s, dir, idx);
break;
}
}
+
}
}
}
}
- rcTimeVal endTime = rcGetPerformanceTimer();
-
- if (rcGetBuildTimes())
- rcGetBuildTimes()->buildCompact += rcGetDeltaTimeUsec(startTime, endTime);
+ if (tooHighNeighbour > MAX_LAYERS)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildCompactHeightfield: Heightfield has too many layers %d (max: %d)",
+ tooHighNeighbour, MAX_LAYERS);
+ }
+
+ ctx->stopTimer(RC_TIMER_BUILD_COMPACTHEIGHTFIELD);
return true;
}
+/*
static int getHeightfieldMemoryUsage(const rcHeightfield& hf)
{
int size = 0;
@@ -270,3 +490,4 @@ static int getCompactHeightFieldMemoryusage(const rcCompactHeightfield& chf)
size += sizeof(rcCompactCell) * chf.width * chf.height;
return size;
}
+*/ \ No newline at end of file
diff --git a/extern/recastnavigation/Recast/Source/RecastAlloc.cpp b/extern/recastnavigation/Recast/Source/RecastAlloc.cpp
new file mode 100644
index 00000000000..b5ec1516146
--- /dev/null
+++ b/extern/recastnavigation/Recast/Source/RecastAlloc.cpp
@@ -0,0 +1,88 @@
+//
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+//
+
+#include <stdlib.h>
+#include <string.h>
+#include "RecastAlloc.h"
+
+static void *rcAllocDefault(int size, rcAllocHint)
+{
+ return malloc(size);
+}
+
+static void rcFreeDefault(void *ptr)
+{
+ free(ptr);
+}
+
+static rcAllocFunc* sRecastAllocFunc = rcAllocDefault;
+static rcFreeFunc* sRecastFreeFunc = rcFreeDefault;
+
+/// @see rcAlloc, rcFree
+void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc)
+{
+ sRecastAllocFunc = allocFunc ? allocFunc : rcAllocDefault;
+ sRecastFreeFunc = freeFunc ? freeFunc : rcFreeDefault;
+}
+
+/// @see rcAllocSetCustom
+void* rcAlloc(int size, rcAllocHint hint)
+{
+ return sRecastAllocFunc(size, hint);
+}
+
+/// @par
+///
+/// @warning This function leaves the value of @p ptr unchanged. So it still
+/// points to the same (now invalid) location, and not to null.
+///
+/// @see rcAllocSetCustom
+void rcFree(void* ptr)
+{
+ if (ptr)
+ sRecastFreeFunc(ptr);
+}
+
+/// @class rcIntArray
+///
+/// While it is possible to pre-allocate a specific array size during
+/// construction or by using the #resize method, certain methods will
+/// automatically resize the array as needed.
+///
+/// @warning The array memory is not initialized to zero when the size is
+/// manually set during construction or when using #resize.
+
+/// @par
+///
+/// Using this method ensures the array is at least large enough to hold
+/// the specified number of elements. This can improve performance by
+/// avoiding auto-resizing during use.
+void rcIntArray::resize(int n)
+{
+ if (n > m_cap)
+ {
+ if (!m_cap) m_cap = n;
+ while (m_cap < n) m_cap *= 2;
+ int* newData = (int*)rcAlloc(m_cap*sizeof(int), RC_ALLOC_TEMP);
+ if (m_size && newData) memcpy(newData, m_data, m_size*sizeof(int));
+ rcFree(m_data);
+ m_data = newData;
+ }
+ m_size = n;
+}
+
diff --git a/extern/recastnavigation/Recast/Source/RecastArea.cpp b/extern/recastnavigation/Recast/Source/RecastArea.cpp
new file mode 100644
index 00000000000..a59acc53eb6
--- /dev/null
+++ b/extern/recastnavigation/Recast/Source/RecastArea.cpp
@@ -0,0 +1,524 @@
+//
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+//
+
+#include <float.h>
+#define _USE_MATH_DEFINES
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "Recast.h"
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
+
+/// @par
+///
+/// Basically, any spans that are closer to a boundary or obstruction than the specified radius
+/// are marked as unwalkable.
+///
+/// This method is usually called immediately after the heightfield has been built.
+///
+/// @see rcCompactHeightfield, rcBuildCompactHeightfield, rcConfig::walkableRadius
+bool rcErodeWalkableArea(rcContext* ctx, int radius, rcCompactHeightfield& chf)
+{
+ rcAssert(ctx);
+
+ const int w = chf.width;
+ const int h = chf.height;
+
+ ctx->startTimer(RC_TIMER_ERODE_AREA);
+
+ unsigned char* dist = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP);
+ if (!dist)
+ {
+ ctx->log(RC_LOG_ERROR, "erodeWalkableArea: Out of memory 'dist' (%d).", chf.spanCount);
+ return false;
+ }
+
+ // Init distance.
+ memset(dist, 0xff, sizeof(unsigned char)*chf.spanCount);
+
+ // Mark boundary cells.
+ for (int y = 0; y < h; ++y)
+ {
+ for (int x = 0; x < w; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ if (chf.areas[i] == RC_NULL_AREA)
+ {
+ dist[i] = 0;
+ }
+ else
+ {
+ const rcCompactSpan& s = chf.spans[i];
+ int nc = 0;
+ for (int dir = 0; dir < 4; ++dir)
+ {
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
+ {
+ const int nx = x + rcGetDirOffsetX(dir);
+ const int ny = y + rcGetDirOffsetY(dir);
+ const int ni = (int)chf.cells[nx+ny*w].index + rcGetCon(s, dir);
+ if (chf.areas[ni] != RC_NULL_AREA)
+ {
+ nc++;
+ }
+ }
+ }
+ // At least one missing neighbour.
+ if (nc != 4)
+ dist[i] = 0;
+ }
+ }
+ }
+ }
+
+ unsigned char nd;
+
+ // Pass 1
+ for (int y = 0; y < h; ++y)
+ {
+ for (int x = 0; x < w; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ const rcCompactSpan& s = chf.spans[i];
+
+ if (rcGetCon(s, 0) != RC_NOT_CONNECTED)
+ {
+ // (-1,0)
+ const int ax = x + rcGetDirOffsetX(0);
+ const int ay = y + rcGetDirOffsetY(0);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 0);
+ const rcCompactSpan& as = chf.spans[ai];
+ nd = (unsigned char)rcMin((int)dist[ai]+2, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+
+ // (-1,-1)
+ if (rcGetCon(as, 3) != RC_NOT_CONNECTED)
+ {
+ const int aax = ax + rcGetDirOffsetX(3);
+ const int aay = ay + rcGetDirOffsetY(3);
+ const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 3);
+ nd = (unsigned char)rcMin((int)dist[aai]+3, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+ }
+ }
+ if (rcGetCon(s, 3) != RC_NOT_CONNECTED)
+ {
+ // (0,-1)
+ const int ax = x + rcGetDirOffsetX(3);
+ const int ay = y + rcGetDirOffsetY(3);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 3);
+ const rcCompactSpan& as = chf.spans[ai];
+ nd = (unsigned char)rcMin((int)dist[ai]+2, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+
+ // (1,-1)
+ if (rcGetCon(as, 2) != RC_NOT_CONNECTED)
+ {
+ const int aax = ax + rcGetDirOffsetX(2);
+ const int aay = ay + rcGetDirOffsetY(2);
+ const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 2);
+ nd = (unsigned char)rcMin((int)dist[aai]+3, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+ }
+ }
+ }
+ }
+ }
+
+ // Pass 2
+ for (int y = h-1; y >= 0; --y)
+ {
+ for (int x = w-1; x >= 0; --x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ const rcCompactSpan& s = chf.spans[i];
+
+ if (rcGetCon(s, 2) != RC_NOT_CONNECTED)
+ {
+ // (1,0)
+ const int ax = x + rcGetDirOffsetX(2);
+ const int ay = y + rcGetDirOffsetY(2);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 2);
+ const rcCompactSpan& as = chf.spans[ai];
+ nd = (unsigned char)rcMin((int)dist[ai]+2, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+
+ // (1,1)
+ if (rcGetCon(as, 1) != RC_NOT_CONNECTED)
+ {
+ const int aax = ax + rcGetDirOffsetX(1);
+ const int aay = ay + rcGetDirOffsetY(1);
+ const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 1);
+ nd = (unsigned char)rcMin((int)dist[aai]+3, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+ }
+ }
+ if (rcGetCon(s, 1) != RC_NOT_CONNECTED)
+ {
+ // (0,1)
+ const int ax = x + rcGetDirOffsetX(1);
+ const int ay = y + rcGetDirOffsetY(1);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 1);
+ const rcCompactSpan& as = chf.spans[ai];
+ nd = (unsigned char)rcMin((int)dist[ai]+2, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+
+ // (-1,1)
+ if (rcGetCon(as, 0) != RC_NOT_CONNECTED)
+ {
+ const int aax = ax + rcGetDirOffsetX(0);
+ const int aay = ay + rcGetDirOffsetY(0);
+ const int aai = (int)chf.cells[aax+aay*w].index + rcGetCon(as, 0);
+ nd = (unsigned char)rcMin((int)dist[aai]+3, 255);
+ if (nd < dist[i])
+ dist[i] = nd;
+ }
+ }
+ }
+ }
+ }
+
+ const unsigned char thr = (unsigned char)(radius*2);
+ for (int i = 0; i < chf.spanCount; ++i)
+ if (dist[i] < thr)
+ chf.areas[i] = RC_NULL_AREA;
+
+ rcFree(dist);
+
+ ctx->stopTimer(RC_TIMER_ERODE_AREA);
+
+ return true;
+}
+
+static void insertSort(unsigned char* a, const int n)
+{
+ int i, j;
+ for (i = 1; i < n; i++)
+ {
+ const unsigned char value = a[i];
+ for (j = i - 1; j >= 0 && a[j] > value; j--)
+ a[j+1] = a[j];
+ a[j+1] = value;
+ }
+}
+
+/// @par
+///
+/// This filter is usually applied after applying area id's using functions
+/// such as #rcMarkBoxArea, #rcMarkConvexPolyArea, and #rcMarkCylinderArea.
+///
+/// @see rcCompactHeightfield
+bool rcMedianFilterWalkableArea(rcContext* ctx, rcCompactHeightfield& chf)
+{
+ rcAssert(ctx);
+
+ const int w = chf.width;
+ const int h = chf.height;
+
+ ctx->startTimer(RC_TIMER_MEDIAN_AREA);
+
+ unsigned char* areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP);
+ if (!areas)
+ {
+ ctx->log(RC_LOG_ERROR, "medianFilterWalkableArea: Out of memory 'areas' (%d).", chf.spanCount);
+ return false;
+ }
+
+ // Init distance.
+ memset(areas, 0xff, sizeof(unsigned char)*chf.spanCount);
+
+ for (int y = 0; y < h; ++y)
+ {
+ for (int x = 0; x < w; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ const rcCompactSpan& s = chf.spans[i];
+ if (chf.areas[i] == RC_NULL_AREA)
+ {
+ areas[i] = chf.areas[i];
+ continue;
+ }
+
+ unsigned char nei[9];
+ for (int j = 0; j < 9; ++j)
+ nei[j] = chf.areas[i];
+
+ for (int dir = 0; dir < 4; ++dir)
+ {
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
+ {
+ const int ax = x + rcGetDirOffsetX(dir);
+ const int ay = y + rcGetDirOffsetY(dir);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir);
+ if (chf.areas[ai] != RC_NULL_AREA)
+ nei[dir*2+0] = chf.areas[ai];
+
+ const rcCompactSpan& as = chf.spans[ai];
+ const int dir2 = (dir+1) & 0x3;
+ if (rcGetCon(as, dir2) != RC_NOT_CONNECTED)
+ {
+ const int ax2 = ax + rcGetDirOffsetX(dir2);
+ const int ay2 = ay + rcGetDirOffsetY(dir2);
+ const int ai2 = (int)chf.cells[ax2+ay2*w].index + rcGetCon(as, dir2);
+ if (chf.areas[ai2] != RC_NULL_AREA)
+ nei[dir*2+1] = chf.areas[ai2];
+ }
+ }
+ }
+ insertSort(nei, 9);
+ areas[i] = nei[4];
+ }
+ }
+ }
+
+ memcpy(chf.areas, areas, sizeof(unsigned char)*chf.spanCount);
+
+ rcFree(areas);
+
+ ctx->stopTimer(RC_TIMER_MEDIAN_AREA);
+
+ return true;
+}
+
+/// @par
+///
+/// The value of spacial parameters are in world units.
+///
+/// @see rcCompactHeightfield, rcMedianFilterWalkableArea
+void rcMarkBoxArea(rcContext* ctx, const float* bmin, const float* bmax, unsigned char areaId,
+ rcCompactHeightfield& chf)
+{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_MARK_BOX_AREA);
+
+ int minx = (int)((bmin[0]-chf.bmin[0])/chf.cs);
+ int miny = (int)((bmin[1]-chf.bmin[1])/chf.ch);
+ int minz = (int)((bmin[2]-chf.bmin[2])/chf.cs);
+ int maxx = (int)((bmax[0]-chf.bmin[0])/chf.cs);
+ int maxy = (int)((bmax[1]-chf.bmin[1])/chf.ch);
+ int maxz = (int)((bmax[2]-chf.bmin[2])/chf.cs);
+
+ if (maxx < 0) return;
+ if (minx >= chf.width) return;
+ if (maxz < 0) return;
+ if (minz >= chf.height) return;
+
+ if (minx < 0) minx = 0;
+ if (maxx >= chf.width) maxx = chf.width-1;
+ if (minz < 0) minz = 0;
+ if (maxz >= chf.height) maxz = chf.height-1;
+
+ for (int z = minz; z <= maxz; ++z)
+ {
+ for (int x = minx; x <= maxx; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+z*chf.width];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ rcCompactSpan& s = chf.spans[i];
+ if ((int)s.y >= miny && (int)s.y <= maxy)
+ {
+ if (chf.areas[i] != RC_NULL_AREA)
+ chf.areas[i] = areaId;
+ }
+ }
+ }
+ }
+
+ ctx->stopTimer(RC_TIMER_MARK_BOX_AREA);
+
+}
+
+
+static int pointInPoly(int nvert, const float* verts, const float* p)
+{
+ int i, j, c = 0;
+ for (i = 0, j = nvert-1; i < nvert; j = i++)
+ {
+ const float* vi = &verts[i*3];
+ const float* vj = &verts[j*3];
+ if (((vi[2] > p[2]) != (vj[2] > p[2])) &&
+ (p[0] < (vj[0]-vi[0]) * (p[2]-vi[2]) / (vj[2]-vi[2]) + vi[0]) )
+ c = !c;
+ }
+ return c;
+}
+
+/// @par
+///
+/// The value of spacial parameters are in world units.
+///
+/// The y-values of the polygon vertices are ignored. So the polygon is effectively
+/// projected onto the xz-plane at @p hmin, then extruded to @p hmax.
+///
+/// @see rcCompactHeightfield, rcMedianFilterWalkableArea
+void rcMarkConvexPolyArea(rcContext* ctx, const float* verts, const int nverts,
+ const float hmin, const float hmax, unsigned char areaId,
+ rcCompactHeightfield& chf)
+{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_MARK_CONVEXPOLY_AREA);
+
+ float bmin[3], bmax[3];
+ rcVcopy(bmin, verts);
+ rcVcopy(bmax, verts);
+ for (int i = 1; i < nverts; ++i)
+ {
+ rcVmin(bmin, &verts[i*3]);
+ rcVmax(bmax, &verts[i*3]);
+ }
+ bmin[1] = hmin;
+ bmax[1] = hmax;
+
+ int minx = (int)((bmin[0]-chf.bmin[0])/chf.cs);
+ int miny = (int)((bmin[1]-chf.bmin[1])/chf.ch);
+ int minz = (int)((bmin[2]-chf.bmin[2])/chf.cs);
+ int maxx = (int)((bmax[0]-chf.bmin[0])/chf.cs);
+ int maxy = (int)((bmax[1]-chf.bmin[1])/chf.ch);
+ int maxz = (int)((bmax[2]-chf.bmin[2])/chf.cs);
+
+ if (maxx < 0) return;
+ if (minx >= chf.width) return;
+ if (maxz < 0) return;
+ if (minz >= chf.height) return;
+
+ if (minx < 0) minx = 0;
+ if (maxx >= chf.width) maxx = chf.width-1;
+ if (minz < 0) minz = 0;
+ if (maxz >= chf.height) maxz = chf.height-1;
+
+
+ // TODO: Optimize.
+ for (int z = minz; z <= maxz; ++z)
+ {
+ for (int x = minx; x <= maxx; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+z*chf.width];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ rcCompactSpan& s = chf.spans[i];
+ if (chf.areas[i] == RC_NULL_AREA)
+ continue;
+ if ((int)s.y >= miny && (int)s.y <= maxy)
+ {
+ float p[3];
+ p[0] = chf.bmin[0] + (x+0.5f)*chf.cs;
+ p[1] = 0;
+ p[2] = chf.bmin[2] + (z+0.5f)*chf.cs;
+
+ if (pointInPoly(nverts, verts, p))
+ {
+ chf.areas[i] = areaId;
+ }
+ }
+ }
+ }
+ }
+
+ ctx->stopTimer(RC_TIMER_MARK_CONVEXPOLY_AREA);
+}
+
+/// @par
+///
+/// The value of spacial parameters are in world units.
+///
+/// @see rcCompactHeightfield, rcMedianFilterWalkableArea
+void rcMarkCylinderArea(rcContext* ctx, const float* pos,
+ const float r, const float h, unsigned char areaId,
+ rcCompactHeightfield& chf)
+{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_MARK_CYLINDER_AREA);
+
+ float bmin[3], bmax[3];
+ bmin[0] = pos[0] - r;
+ bmin[1] = pos[1];
+ bmin[2] = pos[2] - r;
+ bmax[0] = pos[0] + r;
+ bmax[1] = pos[1] + h;
+ bmax[2] = pos[2] + r;
+ const float r2 = r*r;
+
+ int minx = (int)((bmin[0]-chf.bmin[0])/chf.cs);
+ int miny = (int)((bmin[1]-chf.bmin[1])/chf.ch);
+ int minz = (int)((bmin[2]-chf.bmin[2])/chf.cs);
+ int maxx = (int)((bmax[0]-chf.bmin[0])/chf.cs);
+ int maxy = (int)((bmax[1]-chf.bmin[1])/chf.ch);
+ int maxz = (int)((bmax[2]-chf.bmin[2])/chf.cs);
+
+ if (maxx < 0) return;
+ if (minx >= chf.width) return;
+ if (maxz < 0) return;
+ if (minz >= chf.height) return;
+
+ if (minx < 0) minx = 0;
+ if (maxx >= chf.width) maxx = chf.width-1;
+ if (minz < 0) minz = 0;
+ if (maxz >= chf.height) maxz = chf.height-1;
+
+
+ for (int z = minz; z <= maxz; ++z)
+ {
+ for (int x = minx; x <= maxx; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+z*chf.width];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ rcCompactSpan& s = chf.spans[i];
+
+ if (chf.areas[i] == RC_NULL_AREA)
+ continue;
+
+ if ((int)s.y >= miny && (int)s.y <= maxy)
+ {
+ const float sx = chf.bmin[0] + (x+0.5f)*chf.cs;
+ const float sz = chf.bmin[2] + (z+0.5f)*chf.cs;
+ const float dx = sx - pos[0];
+ const float dz = sz - pos[2];
+
+ if (dx*dx + dz*dz < r2)
+ {
+ chf.areas[i] = areaId;
+ }
+ }
+ }
+ }
+ }
+
+ ctx->stopTimer(RC_TIMER_MARK_CYLINDER_AREA);
+}
diff --git a/extern/recastnavigation/Recast/Source/RecastContour.cpp b/extern/recastnavigation/Recast/Source/RecastContour.cpp
index 96f763a18f3..078c464e5f4 100644
--- a/extern/recastnavigation/Recast/Source/RecastContour.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastContour.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -21,8 +21,8 @@
#include <string.h>
#include <stdio.h>
#include "Recast.h"
-#include "RecastLog.h"
-#include "RecastTimer.h"
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
static int getCornerHeight(int x, int y, int i, int dir,
@@ -33,44 +33,46 @@ static int getCornerHeight(int x, int y, int i, int dir,
int ch = (int)s.y;
int dirp = (dir+1) & 0x3;
- unsigned short regs[4] = {0,0,0,0};
+ unsigned int regs[4] = {0,0,0,0};
- regs[0] = s.reg;
+ // Combine region and area codes in order to prevent
+ // border vertices which are in between two areas to be removed.
+ regs[0] = chf.spans[i].reg | (chf.areas[i] << 16);
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir);
const rcCompactSpan& as = chf.spans[ai];
ch = rcMax(ch, (int)as.y);
- regs[1] = as.reg;
- if (rcGetCon(as, dirp) != 0xf)
+ regs[1] = chf.spans[ai].reg | (chf.areas[ai] << 16);
+ if (rcGetCon(as, dirp) != RC_NOT_CONNECTED)
{
const int ax2 = ax + rcGetDirOffsetX(dirp);
const int ay2 = ay + rcGetDirOffsetY(dirp);
const int ai2 = (int)chf.cells[ax2+ay2*chf.width].index + rcGetCon(as, dirp);
const rcCompactSpan& as2 = chf.spans[ai2];
ch = rcMax(ch, (int)as2.y);
- regs[2] = as2.reg;
+ regs[2] = chf.spans[ai2].reg | (chf.areas[ai2] << 16);
}
}
- if (rcGetCon(s, dirp) != 0xf)
+ if (rcGetCon(s, dirp) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dirp);
const int ay = y + rcGetDirOffsetY(dirp);
const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dirp);
const rcCompactSpan& as = chf.spans[ai];
ch = rcMax(ch, (int)as.y);
- regs[3] = as.reg;
- if (rcGetCon(as, dir) != 0xf)
+ regs[3] = chf.spans[ai].reg | (chf.areas[ai] << 16);
+ if (rcGetCon(as, dir) != RC_NOT_CONNECTED)
{
const int ax2 = ax + rcGetDirOffsetX(dir);
const int ay2 = ay + rcGetDirOffsetY(dir);
const int ai2 = (int)chf.cells[ax2+ay2*chf.width].index + rcGetCon(as, dir);
const rcCompactSpan& as2 = chf.spans[ai2];
ch = rcMax(ch, (int)as2.y);
- regs[2] = as2.reg;
+ regs[2] = chf.spans[ai2].reg | (chf.areas[ai2] << 16);
}
}
@@ -86,8 +88,9 @@ static int getCornerHeight(int x, int y, int i, int dir,
// followed by two interior cells and none of the regions are out of bounds.
const bool twoSameExts = (regs[a] & regs[b] & RC_BORDER_REG) != 0 && regs[a] == regs[b];
const bool twoInts = ((regs[c] | regs[d]) & RC_BORDER_REG) == 0;
+ const bool intsSameArea = (regs[c]>>16) == (regs[d]>>16);
const bool noZeros = regs[a] != 0 && regs[b] != 0 && regs[c] != 0 && regs[d] != 0;
- if (twoSameExts && twoInts && noZeros)
+ if (twoSameExts && twoInts && intsSameArea && noZeros)
{
isBorderVertex = true;
break;
@@ -109,6 +112,8 @@ static void walkContour(int x, int y, int i,
unsigned char startDir = dir;
int starti = i;
+ const unsigned char area = chf.areas[i];
+
int iter = 0;
while (++iter < 40000)
{
@@ -116,6 +121,7 @@ static void walkContour(int x, int y, int i,
{
// Choose the edge corner
bool isBorderVertex = false;
+ bool isAreaBorder = false;
int px = x;
int py = getCornerHeight(x, y, i, dir, chf, isBorderVertex);
int pz = y;
@@ -127,16 +133,19 @@ static void walkContour(int x, int y, int i,
}
int r = 0;
const rcCompactSpan& s = chf.spans[i];
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir);
- const rcCompactSpan& as = chf.spans[ai];
- r = (int)as.reg;
+ r = (int)chf.spans[ai].reg;
+ if (area != chf.areas[ai])
+ isAreaBorder = true;
}
if (isBorderVertex)
r |= RC_BORDER_VERTEX;
+ if (isAreaBorder)
+ r |= RC_AREA_BORDER;
points.push(px);
points.push(py);
points.push(pz);
@@ -151,7 +160,7 @@ static void walkContour(int x, int y, int i,
const int nx = x + rcGetDirOffsetX(dir);
const int ny = y + rcGetDirOffsetY(dir);
const rcCompactSpan& s = chf.spans[i];
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const rcCompactCell& nc = chf.cells[nx+ny*chf.width];
ni = (int)nc.index + rcGetCon(s, dir);
@@ -174,9 +183,9 @@ static void walkContour(int x, int y, int i,
}
}
-static float distancePtSeg(int x, int y, int z,
- int px, int py, int pz,
- int qx, int qy, int qz)
+static float distancePtSeg(const int x, const int z,
+ const int px, const int pz,
+ const int qx, const int qz)
{
/* float pqx = (float)(qx - px);
float pqy = (float)(qy - py);
@@ -218,20 +227,40 @@ static float distancePtSeg(int x, int y, int z,
return dx*dx + dz*dz;
}
-static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float maxError, int maxEdgeLen)
+static void simplifyContour(rcIntArray& points, rcIntArray& simplified,
+ const float maxError, const int maxEdgeLen, const int buildFlags)
{
// Add initial points.
- bool noConnections = true;
+ bool hasConnections = false;
for (int i = 0; i < points.size(); i += 4)
{
- if ((points[i+3] & 0xffff) != 0)
+ if ((points[i+3] & RC_CONTOUR_REG_MASK) != 0)
{
- noConnections = false;
+ hasConnections = true;
break;
}
}
- if (noConnections)
+ if (hasConnections)
+ {
+ // The contour has some portals to other regions.
+ // Add a new point to every location where the region changes.
+ for (int i = 0, ni = points.size()/4; i < ni; ++i)
+ {
+ int ii = (i+1) % ni;
+ const bool differentRegs = (points[i*4+3] & RC_CONTOUR_REG_MASK) != (points[ii*4+3] & RC_CONTOUR_REG_MASK);
+ const bool areaBorders = (points[i*4+3] & RC_AREA_BORDER) != (points[ii*4+3] & RC_AREA_BORDER);
+ if (differentRegs || areaBorders)
+ {
+ simplified.push(points[i*4+0]);
+ simplified.push(points[i*4+1]);
+ simplified.push(points[i*4+2]);
+ simplified.push(i);
+ }
+ }
+ }
+
+ if (simplified.size() == 0)
{
// If there is no connections at all,
// create some initial points for the simplification process.
@@ -256,7 +285,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float ma
llz = z;
lli = i/4;
}
- if (x >= urx || (x == urx && z > urz))
+ if (x > urx || (x == urx && z > urz))
{
urx = x;
ury = y;
@@ -274,22 +303,6 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float ma
simplified.push(urz);
simplified.push(uri);
}
- else
- {
- // The contour has some portals to other regions.
- // Add a new point to every location where the region changes.
- for (int i = 0, ni = points.size()/4; i < ni; ++i)
- {
- int ii = (i+1) % ni;
- if ((points[i*4+3] & 0xffff) != (points[ii*4+3] & 0xffff))
- {
- simplified.push(points[i*4+0]);
- simplified.push(points[i*4+1]);
- simplified.push(points[i*4+2]);
- simplified.push(i);
- }
- }
- }
// Add points until all raw points are within
// error tolerance to the simplified shape.
@@ -298,34 +311,48 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float ma
{
int ii = (i+1) % (simplified.size()/4);
- int ax = simplified[i*4+0];
- int ay = simplified[i*4+1];
- int az = simplified[i*4+2];
- int ai = simplified[i*4+3];
-
- int bx = simplified[ii*4+0];
- int by = simplified[ii*4+1];
- int bz = simplified[ii*4+2];
- int bi = simplified[ii*4+3];
+ const int ax = simplified[i*4+0];
+ const int az = simplified[i*4+2];
+ const int ai = simplified[i*4+3];
+ const int bx = simplified[ii*4+0];
+ const int bz = simplified[ii*4+2];
+ const int bi = simplified[ii*4+3];
+
// Find maximum deviation from the segment.
float maxd = 0;
int maxi = -1;
- int ci = (ai+1) % pn;
+ int ci, cinc, endi;
- // Tesselate only outer edges.
- if ((points[ci*4+3] & 0xffff) == 0)
+ // Traverse the segment in lexilogical order so that the
+ // max deviation is calculated similarly when traversing
+ // opposite segments.
+ if (bx > ax || (bx == ax && bz > az))
{
- while (ci != bi)
+ cinc = 1;
+ ci = (ai+cinc) % pn;
+ endi = bi;
+ }
+ else
+ {
+ cinc = pn-1;
+ ci = (bi+cinc) % pn;
+ endi = ai;
+ }
+
+ // Tessellate only outer edges or edges between areas.
+ if ((points[ci*4+3] & RC_CONTOUR_REG_MASK) == 0 ||
+ (points[ci*4+3] & RC_AREA_BORDER))
+ {
+ while (ci != endi)
{
- float d = distancePtSeg(points[ci*4+0], points[ci*4+1]/4, points[ci*4+2],
- ax, ay/4, az, bx, by/4, bz);
+ float d = distancePtSeg(points[ci*4+0], points[ci*4+2], ax, az, bx, bz);
if (d > maxd)
{
maxd = d;
maxi = ci;
}
- ci = (ci+1) % pn;
+ ci = (ci+cinc) % pn;
}
}
@@ -336,7 +363,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float ma
{
// Add space for the new point.
simplified.resize(simplified.size()+4);
- int n = simplified.size()/4;
+ const int n = simplified.size()/4;
for (int j = n-1; j > i; --j)
{
simplified[j*4+0] = simplified[(j-1)*4+0];
@@ -357,33 +384,52 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float ma
}
// Split too long edges.
- if (maxEdgeLen > 0)
+ if (maxEdgeLen > 0 && (buildFlags & (RC_CONTOUR_TESS_WALL_EDGES|RC_CONTOUR_TESS_AREA_EDGES)) != 0)
{
for (int i = 0; i < simplified.size()/4; )
{
- int ii = (i+1) % (simplified.size()/4);
-
- int ax = simplified[i*4+0];
- int az = simplified[i*4+2];
- int ai = simplified[i*4+3];
+ const int ii = (i+1) % (simplified.size()/4);
- int bx = simplified[ii*4+0];
- int bz = simplified[ii*4+2];
- int bi = simplified[ii*4+3];
+ const int ax = simplified[i*4+0];
+ const int az = simplified[i*4+2];
+ const int ai = simplified[i*4+3];
+ const int bx = simplified[ii*4+0];
+ const int bz = simplified[ii*4+2];
+ const int bi = simplified[ii*4+3];
+
// Find maximum deviation from the segment.
int maxi = -1;
int ci = (ai+1) % pn;
+
+ // Tessellate only outer edges or edges between areas.
+ bool tess = false;
+ // Wall edges.
+ if ((buildFlags & RC_CONTOUR_TESS_WALL_EDGES) && (points[ci*4+3] & RC_CONTOUR_REG_MASK) == 0)
+ tess = true;
+ // Edges between areas.
+ if ((buildFlags & RC_CONTOUR_TESS_AREA_EDGES) && (points[ci*4+3] & RC_AREA_BORDER))
+ tess = true;
- // Tesselate only outer edges.
- if ((points[ci*4+3] & 0xffff) == 0)
+ if (tess)
{
int dx = bx - ax;
int dz = bz - az;
if (dx*dx + dz*dz > maxEdgeLen*maxEdgeLen)
{
- int n = bi < ai ? (bi+pn - ai) : (bi - ai);
- maxi = (ai + n/2) % pn;
+ // Round based on the segments in lexilogical order so that the
+ // max tesselation is consistent regardles in which direction
+ // segments are traversed.
+ if (bx > ax || (bx == ax && bz > az))
+ {
+ const int n = bi < ai ? (bi+pn - ai) : (bi - ai);
+ maxi = (ai + n/2) % pn;
+ }
+ else
+ {
+ const int n = bi < ai ? (bi+pn - ai) : (bi - ai);
+ maxi = (ai + (n+1)/2) % pn;
+ }
}
}
@@ -393,7 +439,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float ma
{
// Add space for the new point.
simplified.resize(simplified.size()+4);
- int n = simplified.size()/4;
+ const int n = simplified.size()/4;
for (int j = n-1; j > i; --j)
{
simplified[j*4+0] = simplified[(j-1)*4+0];
@@ -420,7 +466,7 @@ static void simplifyContour(rcIntArray& points, rcIntArray& simplified, float ma
// and the neighbour region is take from the next raw point.
const int ai = (simplified[i*4+3]+1) % pn;
const int bi = simplified[i*4+3];
- simplified[i*4+3] = (points[ai*4+3] & 0xffff) | (points[bi*4+3] & RC_BORDER_VERTEX);
+ simplified[i*4+3] = (points[ai*4+3] & RC_CONTOUR_REG_MASK) | (points[bi*4+3] & RC_BORDER_VERTEX);
}
}
@@ -446,7 +492,7 @@ static void removeDegenerateSegments(rcIntArray& simplified)
simplified[j*4+2] = simplified[(j+1)*4+2];
simplified[j*4+3] = simplified[(j+1)*4+3];
}
- simplified.pop();
+ simplified.resize(simplified.size()-4);
}
}
}
@@ -463,25 +509,40 @@ static int calcAreaOfPolygon2D(const int* verts, const int nverts)
return (area+1) / 2;
}
+inline bool ileft(const int* a, const int* b, const int* c)
+{
+ return (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]) <= 0;
+}
+
static void getClosestIndices(const int* vertsa, const int nvertsa,
const int* vertsb, const int nvertsb,
int& ia, int& ib)
{
int closestDist = 0xfffffff;
+ ia = -1, ib = -1;
for (int i = 0; i < nvertsa; ++i)
{
+ const int in = (i+1) % nvertsa;
+ const int ip = (i+nvertsa-1) % nvertsa;
const int* va = &vertsa[i*4];
+ const int* van = &vertsa[in*4];
+ const int* vap = &vertsa[ip*4];
+
for (int j = 0; j < nvertsb; ++j)
{
const int* vb = &vertsb[j*4];
- const int dx = vb[0] - va[0];
- const int dz = vb[2] - va[2];
- const int d = dx*dx + dz*dz;
- if (d < closestDist)
+ // vb must be "infront" of va.
+ if (ileft(vap,va,vb) && ileft(va,van,vb))
{
- ia = i;
- ib = j;
- closestDist = d;
+ const int dx = vb[0] - va[0];
+ const int dz = vb[2] - va[2];
+ const int d = dx*dx + dz*dz;
+ if (d < closestDist)
+ {
+ ia = i;
+ ib = j;
+ closestDist = d;
+ }
}
}
}
@@ -490,7 +551,7 @@ static void getClosestIndices(const int* vertsa, const int nvertsa,
static bool mergeContours(rcContour& ca, rcContour& cb, int ia, int ib)
{
const int maxVerts = ca.nverts + cb.nverts + 2;
- int* verts = new int[maxVerts*4];
+ int* verts = (int*)rcAlloc(sizeof(int)*maxVerts*4, RC_ALLOC_PERM);
if (!verts)
return false;
@@ -520,47 +581,73 @@ static bool mergeContours(rcContour& ca, rcContour& cb, int ia, int ib)
nv++;
}
- delete [] ca.verts;
+ rcFree(ca.verts);
ca.verts = verts;
ca.nverts = nv;
- delete [] cb.verts;
+ rcFree(cb.verts);
cb.verts = 0;
cb.nverts = 0;
return true;
}
-bool rcBuildContours(rcCompactHeightfield& chf,
+/// @par
+///
+/// The raw contours will match the region outlines exactly. The @p maxError and @p maxEdgeLen
+/// parameters control how closely the simplified contours will match the raw contours.
+///
+/// Simplified contours are generated such that the vertices for portals between areas match up.
+/// (They are considered mandatory vertices.)
+///
+/// Setting @p maxEdgeLength to zero will disabled the edge length feature.
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// @see rcAllocContourSet, rcCompactHeightfield, rcContourSet, rcConfig
+bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
const float maxError, const int maxEdgeLen,
- rcContourSet& cset)
+ rcContourSet& cset, const int buildFlags)
{
+ rcAssert(ctx);
+
const int w = chf.width;
const int h = chf.height;
+ const int borderSize = chf.borderSize;
- rcTimeVal startTime = rcGetPerformanceTimer();
+ ctx->startTimer(RC_TIMER_BUILD_CONTOURS);
- vcopy(cset.bmin, chf.bmin);
- vcopy(cset.bmax, chf.bmax);
+ rcVcopy(cset.bmin, chf.bmin);
+ rcVcopy(cset.bmax, chf.bmax);
+ if (borderSize > 0)
+ {
+ // If the heightfield was build with bordersize, remove the offset.
+ const float pad = borderSize*chf.cs;
+ cset.bmin[0] += pad;
+ cset.bmin[2] += pad;
+ cset.bmax[0] -= pad;
+ cset.bmax[2] -= pad;
+ }
cset.cs = chf.cs;
cset.ch = chf.ch;
+ cset.width = chf.width - chf.borderSize*2;
+ cset.height = chf.height - chf.borderSize*2;
+ cset.borderSize = chf.borderSize;
- const int maxContours = chf.maxRegions*2;
- cset.conts = new rcContour[maxContours];
+ int maxContours = rcMax((int)chf.maxRegions, 8);
+ cset.conts = (rcContour*)rcAlloc(sizeof(rcContour)*maxContours, RC_ALLOC_PERM);
if (!cset.conts)
return false;
cset.nconts = 0;
- unsigned char* flags = new unsigned char[chf.spanCount];
+ rcScopedDelete<unsigned char> flags = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP);
if (!flags)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'flags'.");
+ ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'flags' (%d).", chf.spanCount);
return false;
}
- rcTimeVal traceStartTime = rcGetPerformanceTimer();
-
+ ctx->startTimer(RC_TIMER_BUILD_CONTOURS_TRACE);
// Mark boundaries.
for (int y = 0; y < h; ++y)
@@ -572,7 +659,7 @@ bool rcBuildContours(rcCompactHeightfield& chf,
{
unsigned char res = 0;
const rcCompactSpan& s = chf.spans[i];
- if (!s.reg || (s.reg & RC_BORDER_REG))
+ if (!chf.spans[i].reg || (chf.spans[i].reg & RC_BORDER_REG))
{
flags[i] = 0;
continue;
@@ -580,15 +667,14 @@ bool rcBuildContours(rcCompactHeightfield& chf,
for (int dir = 0; dir < 4; ++dir)
{
unsigned short r = 0;
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir);
- const rcCompactSpan& as = chf.spans[ai];
- r = as.reg;
+ r = chf.spans[ai].reg;
}
- if (r == s.reg)
+ if (r == chf.spans[i].reg)
res |= (1 << dir);
}
flags[i] = res ^ 0xf; // Inverse, mark non connected edges.
@@ -596,9 +682,7 @@ bool rcBuildContours(rcCompactHeightfield& chf,
}
}
- rcTimeVal traceEndTime = rcGetPerformanceTimer();
-
- rcTimeVal simplifyStartTime = rcGetPerformanceTimer();
+ ctx->stopTimer(RC_TIMER_BUILD_CONTOURS_TRACE);
rcIntArray verts(256);
rcIntArray simplified(64);
@@ -615,36 +699,87 @@ bool rcBuildContours(rcCompactHeightfield& chf,
flags[i] = 0;
continue;
}
- unsigned short reg = chf.spans[i].reg;
+ const unsigned short reg = chf.spans[i].reg;
if (!reg || (reg & RC_BORDER_REG))
continue;
+ const unsigned char area = chf.areas[i];
verts.resize(0);
simplified.resize(0);
+
+ ctx->startTimer(RC_TIMER_BUILD_CONTOURS_TRACE);
walkContour(x, y, i, chf, flags, verts);
- simplifyContour(verts, simplified, maxError, maxEdgeLen);
+ ctx->stopTimer(RC_TIMER_BUILD_CONTOURS_TRACE);
+
+ ctx->startTimer(RC_TIMER_BUILD_CONTOURS_SIMPLIFY);
+ simplifyContour(verts, simplified, maxError, maxEdgeLen, buildFlags);
removeDegenerateSegments(simplified);
+ ctx->stopTimer(RC_TIMER_BUILD_CONTOURS_SIMPLIFY);
+
// Store region->contour remap info.
// Create contour.
if (simplified.size()/4 >= 3)
{
if (cset.nconts >= maxContours)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildContours: Too many contours %d, max %d.", cset.nconts, maxContours);
- return false;
+ // Allocate more contours.
+ // This can happen when there are tiny holes in the heightfield.
+ const int oldMax = maxContours;
+ maxContours *= 2;
+ rcContour* newConts = (rcContour*)rcAlloc(sizeof(rcContour)*maxContours, RC_ALLOC_PERM);
+ for (int j = 0; j < cset.nconts; ++j)
+ {
+ newConts[j] = cset.conts[j];
+ // Reset source pointers to prevent data deletion.
+ cset.conts[j].verts = 0;
+ cset.conts[j].rverts = 0;
+ }
+ rcFree(cset.conts);
+ cset.conts = newConts;
+
+ ctx->log(RC_LOG_WARNING, "rcBuildContours: Expanding max contours from %d to %d.", oldMax, maxContours);
}
rcContour* cont = &cset.conts[cset.nconts++];
cont->nverts = simplified.size()/4;
- cont->verts = new int[cont->nverts*4];
+ cont->verts = (int*)rcAlloc(sizeof(int)*cont->nverts*4, RC_ALLOC_PERM);
+ if (!cont->verts)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'verts' (%d).", cont->nverts);
+ return false;
+ }
memcpy(cont->verts, &simplified[0], sizeof(int)*cont->nverts*4);
+ if (borderSize > 0)
+ {
+ // If the heightfield was build with bordersize, remove the offset.
+ for (int i = 0; i < cont->nverts; ++i)
+ {
+ int* v = &cont->verts[i*4];
+ v[0] -= borderSize;
+ v[2] -= borderSize;
+ }
+ }
cont->nrverts = verts.size()/4;
- cont->rverts = new int[cont->nrverts*4];
+ cont->rverts = (int*)rcAlloc(sizeof(int)*cont->nrverts*4, RC_ALLOC_PERM);
+ if (!cont->rverts)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildContours: Out of memory 'rverts' (%d).", cont->nrverts);
+ return false;
+ }
memcpy(cont->rverts, &verts[0], sizeof(int)*cont->nrverts*4);
+ if (borderSize > 0)
+ {
+ // If the heightfield was build with bordersize, remove the offset.
+ for (int i = 0; i < cont->nrverts; ++i)
+ {
+ int* v = &cont->rverts[i*4];
+ v[0] -= borderSize;
+ v[2] -= borderSize;
+ }
+ }
/* cont->cx = cont->cy = cont->cz = 0;
for (int i = 0; i < cont->nverts; ++i)
@@ -658,13 +793,14 @@ bool rcBuildContours(rcCompactHeightfield& chf,
cont->cz /= cont->nverts;*/
cont->reg = reg;
+ cont->area = area;
}
}
}
}
// Check and merge droppings.
- // Sometimes the previous algorithms can fail and create several countours
+ // Sometimes the previous algorithms can fail and create several contours
// per area. This pass will try to merge the holes into the main region.
for (int i = 0; i < cset.nconts; ++i)
{
@@ -689,44 +825,29 @@ bool rcBuildContours(rcCompactHeightfield& chf,
}
if (mergeIdx == -1)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "rcBuildContours: Could not find merge target for bad contour %d.", i);
+ ctx->log(RC_LOG_WARNING, "rcBuildContours: Could not find merge target for bad contour %d.", i);
}
else
{
rcContour& mcont = cset.conts[mergeIdx];
// Merge by closest points.
- int ia, ib;
+ int ia = 0, ib = 0;
getClosestIndices(mcont.verts, mcont.nverts, cont.verts, cont.nverts, ia, ib);
+ if (ia == -1 || ib == -1)
+ {
+ ctx->log(RC_LOG_WARNING, "rcBuildContours: Failed to find merge points for %d and %d.", i, mergeIdx);
+ continue;
+ }
if (!mergeContours(mcont, cont, ia, ib))
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "rcBuildContours: Failed to merge contours %d and %d.", i, mergeIdx);
+ ctx->log(RC_LOG_WARNING, "rcBuildContours: Failed to merge contours %d and %d.", i, mergeIdx);
+ continue;
}
}
}
}
-
- delete [] flags;
-
- rcTimeVal simplifyEndTime = rcGetPerformanceTimer();
-
- rcTimeVal endTime = rcGetPerformanceTimer();
-
-// if (rcGetLog())
-// {
-// rcGetLog()->log(RC_LOG_PROGRESS, "Create contours: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
-// rcGetLog()->log(RC_LOG_PROGRESS, " - boundary: %.3f ms", rcGetDeltaTimeUsec(boundaryStartTime, boundaryEndTime)/1000.0f);
-// rcGetLog()->log(RC_LOG_PROGRESS, " - contour: %.3f ms", rcGetDeltaTimeUsec(contourStartTime, contourEndTime)/1000.0f);
-// }
-
- if (rcGetBuildTimes())
- {
- rcGetBuildTimes()->buildContours += rcGetDeltaTimeUsec(startTime, endTime);
- rcGetBuildTimes()->buildContoursTrace += rcGetDeltaTimeUsec(traceStartTime, traceEndTime);
- rcGetBuildTimes()->buildContoursSimplify += rcGetDeltaTimeUsec(simplifyStartTime, simplifyEndTime);
- }
+ ctx->stopTimer(RC_TIMER_BUILD_CONTOURS);
return true;
}
diff --git a/extern/recastnavigation/Recast/Source/RecastFilter.cpp b/extern/recastnavigation/Recast/Source/RecastFilter.cpp
index ebe60714a18..bf985c362c9 100644
--- a/extern/recastnavigation/Recast/Source/RecastFilter.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastFilter.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -20,15 +20,73 @@
#include <math.h>
#include <stdio.h>
#include "Recast.h"
-#include "RecastLog.h"
-#include "RecastTimer.h"
+#include "RecastAssert.h"
+/// @par
+///
+/// Allows the formation of walkable regions that will flow over low lying
+/// objects such as curbs, and up structures such as stairways.
+///
+/// Two neighboring spans are walkable if: <tt>rcAbs(currentSpan.smax - neighborSpan.smax) < waklableClimb</tt>
+///
+/// @warning Will override the effect of #rcFilterLedgeSpans. So if both filters are used, call
+/// #rcFilterLedgeSpans after calling this filter.
+///
+/// @see rcHeightfield, rcConfig
+void rcFilterLowHangingWalkableObstacles(rcContext* ctx, const int walkableClimb, rcHeightfield& solid)
+{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_FILTER_LOW_OBSTACLES);
+
+ const int w = solid.width;
+ const int h = solid.height;
+
+ for (int y = 0; y < h; ++y)
+ {
+ for (int x = 0; x < w; ++x)
+ {
+ rcSpan* ps = 0;
+ bool previousWalkable = false;
+ unsigned char previousArea = RC_NULL_AREA;
+
+ for (rcSpan* s = solid.spans[x + y*w]; s; ps = s, s = s->next)
+ {
+ const bool walkable = s->area != RC_NULL_AREA;
+ // If current span is not walkable, but there is walkable
+ // span just below it, mark the span above it walkable too.
+ if (!walkable && previousWalkable)
+ {
+ if (rcAbs((int)s->smax - (int)ps->smax) <= walkableClimb)
+ s->area = previousArea;
+ }
+ // Copy walkable flag so that it cannot propagate
+ // past multiple non-walkable objects.
+ previousWalkable = walkable;
+ previousArea = s->area;
+ }
+ }
+ }
+
+ ctx->stopTimer(RC_TIMER_FILTER_LOW_OBSTACLES);
+}
-void rcFilterLedgeSpans(const int walkableHeight,
- const int walkableClimb,
+/// @par
+///
+/// A ledge is a span with one or more neighbors whose maximum is further away than @p walkableClimb
+/// from the current span's maximum.
+/// This method removes the impact of the overestimation of conservative voxelization
+/// so the resulting mesh will not have regions hanging in the air over ledges.
+///
+/// A span is a ledge if: <tt>rcAbs(currentSpan.smax - neighborSpan.smax) > walkableClimb</tt>
+///
+/// @see rcHeightfield, rcConfig
+void rcFilterLedgeSpans(rcContext* ctx, const int walkableHeight, const int walkableClimb,
rcHeightfield& solid)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_FILTER_BORDER);
const int w = solid.width;
const int h = solid.height;
@@ -42,15 +100,19 @@ void rcFilterLedgeSpans(const int walkableHeight,
for (rcSpan* s = solid.spans[x + y*w]; s; s = s->next)
{
// Skip non walkable spans.
- if ((s->flags & RC_WALKABLE) == 0)
+ if (s->area == RC_NULL_AREA)
continue;
- const int bot = (int)s->smax;
- const int top = s->next ? (int)s->next->smin : MAX_HEIGHT;
+ const int bot = (int)(s->smax);
+ const int top = s->next ? (int)(s->next->smin) : MAX_HEIGHT;
// Find neighbours minimum height.
int minh = MAX_HEIGHT;
+ // Min and max height of accessible neighbours.
+ int asmin = s->smax;
+ int asmax = s->smax;
+
for (int dir = 0; dir < 4; ++dir)
{
int dx = x + rcGetDirOffsetX(dir);
@@ -77,30 +139,49 @@ void rcFilterLedgeSpans(const int walkableHeight,
ntop = ns->next ? (int)ns->next->smin : MAX_HEIGHT;
// Skip neightbour if the gap between the spans is too small.
if (rcMin(top,ntop) - rcMax(bot,nbot) > walkableHeight)
+ {
minh = rcMin(minh, nbot - bot);
+
+ // Find min/max accessible neighbour height.
+ if (rcAbs(nbot - bot) <= walkableClimb)
+ {
+ if (nbot < asmin) asmin = nbot;
+ if (nbot > asmax) asmax = nbot;
+ }
+
+ }
}
}
// The current span is close to a ledge if the drop to any
// neighbour span is less than the walkableClimb.
if (minh < -walkableClimb)
- s->flags &= ~RC_WALKABLE;
-
+ s->area = RC_NULL_AREA;
+
+ // If the difference between all neighbours is too large,
+ // we are at steep slope, mark the span as ledge.
+ if ((asmax - asmin) > walkableClimb)
+ {
+ s->area = RC_NULL_AREA;
+ }
}
}
}
- rcTimeVal endTime = rcGetPerformanceTimer();
-// if (rcGetLog())
-// rcGetLog()->log(RC_LOG_PROGRESS, "Filter border: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
- if (rcGetBuildTimes())
- rcGetBuildTimes()->filterBorder += rcGetDeltaTimeUsec(startTime, endTime);
+ ctx->stopTimer(RC_TIMER_FILTER_BORDER);
}
-void rcFilterWalkableLowHeightSpans(int walkableHeight,
- rcHeightfield& solid)
+/// @par
+///
+/// For this filter, the clearance above the span is the distance from the span's
+/// maximum to the next higher span's minimum. (Same grid column.)
+///
+/// @see rcHeightfield, rcConfig
+void rcFilterWalkableLowHeightSpans(rcContext* ctx, int walkableHeight, rcHeightfield& solid)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_FILTER_WALKABLE);
const int w = solid.width;
const int h = solid.height;
@@ -114,136 +195,13 @@ void rcFilterWalkableLowHeightSpans(int walkableHeight,
{
for (rcSpan* s = solid.spans[x + y*w]; s; s = s->next)
{
- const int bot = (int)s->smax;
- const int top = s->next ? (int)s->next->smin : MAX_HEIGHT;
+ const int bot = (int)(s->smax);
+ const int top = s->next ? (int)(s->next->smin) : MAX_HEIGHT;
if ((top - bot) <= walkableHeight)
- s->flags &= ~RC_WALKABLE;
+ s->area = RC_NULL_AREA;
}
}
}
- rcTimeVal endTime = rcGetPerformanceTimer();
-
-// if (rcGetLog())
-// rcGetLog()->log(RC_LOG_PROGRESS, "Filter walkable: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
- if (rcGetBuildTimes())
- rcGetBuildTimes()->filterWalkable += rcGetDeltaTimeUsec(startTime, endTime);
-}
-
-
-struct rcReachableSeed
-{
- inline void set(int ix, int iy, rcSpan* is)
- {
- x = (unsigned short)ix;
- y = (unsigned short)iy;
- s = is;
- }
- unsigned short x, y;
- rcSpan* s;
-};
-
-bool rcMarkReachableSpans(const int walkableHeight,
- const int walkableClimb,
- rcHeightfield& solid)
-{
- const int w = solid.width;
- const int h = solid.height;
- const int MAX_HEIGHT = 0xffff;
-
- rcTimeVal startTime = rcGetPerformanceTimer();
-
- // Build navigable space.
- const int MAX_SEEDS = w*h;
- rcReachableSeed* stack = new rcReachableSeed[MAX_SEEDS];
- if (!stack)
- {
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMarkReachableSpans: Out of memory 'stack' (%d).", MAX_SEEDS);
- return false;
- }
- int stackSize = 0;
-
- for (int y = 0; y < h; ++y)
- {
- for (int x = 0; x < w; ++x)
- {
- rcSpan* topSpan = solid.spans[x + y*w];
- if (!topSpan)
- continue;
- while (topSpan->next)
- topSpan = topSpan->next;
-
- // If the span is not walkable, skip it.
- if ((topSpan->flags & RC_WALKABLE) == 0)
- continue;
- // If the span has been visited already, skip it.
- if (topSpan->flags & RC_REACHABLE)
- continue;
-
- // Start flood fill.
- topSpan->flags |= RC_REACHABLE;
- stackSize = 0;
- stack[stackSize].set(x, y, topSpan);
- stackSize++;
-
- while (stackSize)
- {
- // Pop a seed from the stack.
- stackSize--;
- rcReachableSeed cur = stack[stackSize];
-
- const int bot = (int)cur.s->smax;
- const int top = cur.s->next ? (int)cur.s->next->smin : MAX_HEIGHT;
-
- // Visit neighbours in all 4 directions.
- for (int dir = 0; dir < 4; ++dir)
- {
- int dx = (int)cur.x + rcGetDirOffsetX(dir);
- int dy = (int)cur.y + rcGetDirOffsetY(dir);
- // Skip neighbour which are out of bounds.
- if (dx < 0 || dy < 0 || dx >= w || dy >= h)
- continue;
- for (rcSpan* ns = solid.spans[dx + dy*w]; ns; ns = ns->next)
- {
- // Skip neighbour if it is not walkable.
- if ((ns->flags & RC_WALKABLE) == 0)
- continue;
- // Skip the neighbour if it has been visited already.
- if (ns->flags & RC_REACHABLE)
- continue;
-
- const int nbot = (int)ns->smax;
- const int ntop = ns->next ? (int)ns->next->smin : MAX_HEIGHT;
- // Skip neightbour if the gap between the spans is too small.
- if (rcMin(top,ntop) - rcMax(bot,nbot) < walkableHeight)
- continue;
- // Skip neightbour if the climb height to the neighbour is too high.
- if (rcAbs(nbot - bot) >= walkableClimb)
- continue;
-
- // This neighbour has not been visited yet.
- // Mark it as reachable and add it to the seed stack.
- ns->flags |= RC_REACHABLE;
- if (stackSize < MAX_SEEDS)
- {
- stack[stackSize].set(dx, dy, ns);
- stackSize++;
- }
- }
- }
- }
- }
- }
-
- delete [] stack;
-
- rcTimeVal endTime = rcGetPerformanceTimer();
-
-// if (rcGetLog())
-// rcGetLog()->log(RC_LOG_PROGRESS, "Mark reachable: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
- if (rcGetBuildTimes())
- rcGetBuildTimes()->filterMarkReachable += rcGetDeltaTimeUsec(startTime, endTime);
-
- return true;
+ ctx->stopTimer(RC_TIMER_FILTER_WALKABLE);
}
diff --git a/extern/recastnavigation/Recast/Source/RecastLayers.cpp b/extern/recastnavigation/Recast/Source/RecastLayers.cpp
new file mode 100644
index 00000000000..617cf45fe66
--- /dev/null
+++ b/extern/recastnavigation/Recast/Source/RecastLayers.cpp
@@ -0,0 +1,620 @@
+//
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+//
+
+#include <float.h>
+#define _USE_MATH_DEFINES
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "Recast.h"
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
+
+
+static const int RC_MAX_LAYERS = RC_NOT_CONNECTED;
+static const int RC_MAX_NEIS = 16;
+
+struct rcLayerRegion
+{
+ unsigned char layers[RC_MAX_LAYERS];
+ unsigned char neis[RC_MAX_NEIS];
+ unsigned short ymin, ymax;
+ unsigned char layerId; // Layer ID
+ unsigned char nlayers; // Layer count
+ unsigned char nneis; // Neighbour count
+ unsigned char base; // Flag indicating if the region is hte base of merged regions.
+};
+
+
+static void addUnique(unsigned char* a, unsigned char& an, unsigned char v)
+{
+ const int n = (int)an;
+ for (int i = 0; i < n; ++i)
+ if (a[i] == v)
+ return;
+ a[an] = v;
+ an++;
+}
+
+static bool contains(const unsigned char* a, const unsigned char an, const unsigned char v)
+{
+ const int n = (int)an;
+ for (int i = 0; i < n; ++i)
+ if (a[i] == v)
+ return true;
+ return false;
+}
+
+inline bool overlapRange(const unsigned short amin, const unsigned short amax,
+ const unsigned short bmin, const unsigned short bmax)
+{
+ return (amin > bmax || amax < bmin) ? false : true;
+}
+
+
+
+struct rcLayerSweepSpan
+{
+ unsigned short ns; // number samples
+ unsigned char id; // region id
+ unsigned char nei; // neighbour id
+};
+
+/// @par
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// @see rcAllocHeightfieldLayerSet, rcCompactHeightfield, rcHeightfieldLayerSet, rcConfig
+bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
+ const int borderSize, const int walkableHeight,
+ rcHeightfieldLayerSet& lset)
+{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_BUILD_LAYERS);
+
+ const int w = chf.width;
+ const int h = chf.height;
+
+ rcScopedDelete<unsigned char> srcReg = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_TEMP);
+ if (!srcReg)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'srcReg' (%d).", chf.spanCount);
+ return false;
+ }
+ memset(srcReg,0xff,sizeof(unsigned char)*chf.spanCount);
+
+ const int nsweeps = chf.width;
+ rcScopedDelete<rcLayerSweepSpan> sweeps = (rcLayerSweepSpan*)rcAlloc(sizeof(rcLayerSweepSpan)*nsweeps, RC_ALLOC_TEMP);
+ if (!sweeps)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'sweeps' (%d).", nsweeps);
+ return false;
+ }
+
+
+ // Partition walkable area into monotone regions.
+ int prevCount[256];
+ unsigned char regId = 0;
+
+ for (int y = borderSize; y < h-borderSize; ++y)
+ {
+ memset(prevCount,0,sizeof(int)*regId);
+ unsigned char sweepId = 0;
+
+ for (int x = borderSize; x < w-borderSize; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ const rcCompactSpan& s = chf.spans[i];
+ if (chf.areas[i] == RC_NULL_AREA) continue;
+
+ unsigned char sid = 0xff;
+
+ // -x
+ if (rcGetCon(s, 0) != RC_NOT_CONNECTED)
+ {
+ const int ax = x + rcGetDirOffsetX(0);
+ const int ay = y + rcGetDirOffsetY(0);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 0);
+ if (chf.areas[ai] != RC_NULL_AREA && srcReg[ai] != 0xff)
+ sid = srcReg[ai];
+ }
+
+ if (sid == 0xff)
+ {
+ sid = sweepId++;
+ sweeps[sid].nei = 0xff;
+ sweeps[sid].ns = 0;
+ }
+
+ // -y
+ if (rcGetCon(s,3) != RC_NOT_CONNECTED)
+ {
+ const int ax = x + rcGetDirOffsetX(3);
+ const int ay = y + rcGetDirOffsetY(3);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 3);
+ const unsigned char nr = srcReg[ai];
+ if (nr != 0xff)
+ {
+ // Set neighbour when first valid neighbour is encoutered.
+ if (sweeps[sid].ns == 0)
+ sweeps[sid].nei = nr;
+
+ if (sweeps[sid].nei == nr)
+ {
+ // Update existing neighbour
+ sweeps[sid].ns++;
+ prevCount[nr]++;
+ }
+ else
+ {
+ // This is hit if there is nore than one neighbour.
+ // Invalidate the neighbour.
+ sweeps[sid].nei = 0xff;
+ }
+ }
+ }
+
+ srcReg[i] = sid;
+ }
+ }
+
+ // Create unique ID.
+ for (int i = 0; i < sweepId; ++i)
+ {
+ // If the neighbour is set and there is only one continuous connection to it,
+ // the sweep will be merged with the previous one, else new region is created.
+ if (sweeps[i].nei != 0xff && prevCount[sweeps[i].nei] == (int)sweeps[i].ns)
+ {
+ sweeps[i].id = sweeps[i].nei;
+ }
+ else
+ {
+ if (regId == 255)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Region ID overflow.");
+ return false;
+ }
+ sweeps[i].id = regId++;
+ }
+ }
+
+ // Remap local sweep ids to region ids.
+ for (int x = borderSize; x < w-borderSize; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ if (srcReg[i] != 0xff)
+ srcReg[i] = sweeps[srcReg[i]].id;
+ }
+ }
+ }
+
+ // Allocate and init layer regions.
+ const int nregs = (int)regId;
+ rcScopedDelete<rcLayerRegion> regs = (rcLayerRegion*)rcAlloc(sizeof(rcLayerRegion)*nregs, RC_ALLOC_TEMP);
+ if (!regs)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'regs' (%d).", nregs);
+ return false;
+ }
+ memset(regs, 0, sizeof(rcLayerRegion)*nregs);
+ for (int i = 0; i < nregs; ++i)
+ {
+ regs[i].layerId = 0xff;
+ regs[i].ymin = 0xffff;
+ regs[i].ymax = 0;
+ }
+
+ // Find region neighbours and overlapping regions.
+ for (int y = 0; y < h; ++y)
+ {
+ for (int x = 0; x < w; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+
+ unsigned char lregs[RC_MAX_LAYERS];
+ int nlregs = 0;
+
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ const rcCompactSpan& s = chf.spans[i];
+ const unsigned char ri = srcReg[i];
+ if (ri == 0xff) continue;
+
+ regs[ri].ymin = rcMin(regs[ri].ymin, s.y);
+ regs[ri].ymax = rcMax(regs[ri].ymax, s.y);
+
+ // Collect all region layers.
+ if (nlregs < RC_MAX_LAYERS)
+ lregs[nlregs++] = ri;
+
+ // Update neighbours
+ for (int dir = 0; dir < 4; ++dir)
+ {
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
+ {
+ const int ax = x + rcGetDirOffsetX(dir);
+ const int ay = y + rcGetDirOffsetY(dir);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir);
+ const unsigned char rai = srcReg[ai];
+ if (rai != 0xff && rai != ri)
+ addUnique(regs[ri].neis, regs[ri].nneis, rai);
+ }
+ }
+
+ }
+
+ // Update overlapping regions.
+ for (int i = 0; i < nlregs-1; ++i)
+ {
+ for (int j = i+1; j < nlregs; ++j)
+ {
+ if (lregs[i] != lregs[j])
+ {
+ rcLayerRegion& ri = regs[lregs[i]];
+ rcLayerRegion& rj = regs[lregs[j]];
+ addUnique(ri.layers, ri.nlayers, lregs[j]);
+ addUnique(rj.layers, rj.nlayers, lregs[i]);
+ }
+ }
+ }
+
+ }
+ }
+
+ // Create 2D layers from regions.
+ unsigned char layerId = 0;
+
+ static const int MAX_STACK = 64;
+ unsigned char stack[MAX_STACK];
+ int nstack = 0;
+
+ for (int i = 0; i < nregs; ++i)
+ {
+ rcLayerRegion& root = regs[i];
+ // Skip alreadu visited.
+ if (root.layerId != 0xff)
+ continue;
+
+ // Start search.
+ root.layerId = layerId;
+ root.base = 1;
+
+ nstack = 0;
+ stack[nstack++] = (unsigned char)i;
+
+ while (nstack)
+ {
+ // Pop front
+ rcLayerRegion& reg = regs[stack[0]];
+ nstack--;
+ for (int j = 0; j < nstack; ++j)
+ stack[j] = stack[j+1];
+
+ const int nneis = (int)reg.nneis;
+ for (int j = 0; j < nneis; ++j)
+ {
+ const unsigned char nei = reg.neis[j];
+ rcLayerRegion& regn = regs[nei];
+ // Skip already visited.
+ if (regn.layerId != 0xff)
+ continue;
+ // Skip if the neighbour is overlapping root region.
+ if (contains(root.layers, root.nlayers, nei))
+ continue;
+ // Skip if the height range would become too large.
+ const int ymin = rcMin(root.ymin, regn.ymin);
+ const int ymax = rcMin(root.ymax, regn.ymax);
+ if ((ymax - ymin) >= 255)
+ continue;
+
+ if (nstack < MAX_STACK)
+ {
+ // Deepen
+ stack[nstack++] = (unsigned char)nei;
+
+ // Mark layer id
+ regn.layerId = layerId;
+ // Merge current layers to root.
+ for (int k = 0; k < regn.nlayers; ++k)
+ addUnique(root.layers, root.nlayers, regn.layers[k]);
+ root.ymin = rcMin(root.ymin, regn.ymin);
+ root.ymax = rcMax(root.ymax, regn.ymax);
+ }
+ }
+ }
+
+ layerId++;
+ }
+
+ // Merge non-overlapping regions that are close in height.
+ const unsigned short mergeHeight = (unsigned short)walkableHeight * 4;
+
+ for (int i = 0; i < nregs; ++i)
+ {
+ rcLayerRegion& ri = regs[i];
+ if (!ri.base) continue;
+
+ unsigned char newId = ri.layerId;
+
+ for (;;)
+ {
+ unsigned char oldId = 0xff;
+
+ for (int j = 0; j < nregs; ++j)
+ {
+ if (i == j) continue;
+ rcLayerRegion& rj = regs[j];
+ if (!rj.base) continue;
+
+ // Skip if teh regions are not close to each other.
+ if (!overlapRange(ri.ymin,ri.ymax+mergeHeight, rj.ymin,rj.ymax+mergeHeight))
+ continue;
+ // Skip if the height range would become too large.
+ const int ymin = rcMin(ri.ymin, rj.ymin);
+ const int ymax = rcMin(ri.ymax, rj.ymax);
+ if ((ymax - ymin) >= 255)
+ continue;
+
+ // Make sure that there is no overlap when mergin 'ri' and 'rj'.
+ bool overlap = false;
+ // Iterate over all regions which have the same layerId as 'rj'
+ for (int k = 0; k < nregs; ++k)
+ {
+ if (regs[k].layerId != rj.layerId)
+ continue;
+ // Check if region 'k' is overlapping region 'ri'
+ // Index to 'regs' is the same as region id.
+ if (contains(ri.layers,ri.nlayers, (unsigned char)k))
+ {
+ overlap = true;
+ break;
+ }
+ }
+ // Cannot merge of regions overlap.
+ if (overlap)
+ continue;
+
+ // Can merge i and j.
+ oldId = rj.layerId;
+ break;
+ }
+
+ // Could not find anything to merge with, stop.
+ if (oldId == 0xff)
+ break;
+
+ // Merge
+ for (int j = 0; j < nregs; ++j)
+ {
+ rcLayerRegion& rj = regs[j];
+ if (rj.layerId == oldId)
+ {
+ rj.base = 0;
+ // Remap layerIds.
+ rj.layerId = newId;
+ // Add overlaid layers from 'rj' to 'ri'.
+ for (int k = 0; k < rj.nlayers; ++k)
+ addUnique(ri.layers, ri.nlayers, rj.layers[k]);
+ // Update heigh bounds.
+ ri.ymin = rcMin(ri.ymin, rj.ymin);
+ ri.ymax = rcMax(ri.ymax, rj.ymax);
+ }
+ }
+ }
+ }
+
+ // Compact layerIds
+ unsigned char remap[256];
+ memset(remap, 0, 256);
+
+ // Find number of unique layers.
+ layerId = 0;
+ for (int i = 0; i < nregs; ++i)
+ remap[regs[i].layerId] = 1;
+ for (int i = 0; i < 256; ++i)
+ {
+ if (remap[i])
+ remap[i] = layerId++;
+ else
+ remap[i] = 0xff;
+ }
+ // Remap ids.
+ for (int i = 0; i < nregs; ++i)
+ regs[i].layerId = remap[regs[i].layerId];
+
+ // No layers, return empty.
+ if (layerId == 0)
+ {
+ ctx->stopTimer(RC_TIMER_BUILD_LAYERS);
+ return true;
+ }
+
+ // Create layers.
+ rcAssert(lset.layers == 0);
+
+ const int lw = w - borderSize*2;
+ const int lh = h - borderSize*2;
+
+ // Build contracted bbox for layers.
+ float bmin[3], bmax[3];
+ rcVcopy(bmin, chf.bmin);
+ rcVcopy(bmax, chf.bmax);
+ bmin[0] += borderSize*chf.cs;
+ bmin[2] += borderSize*chf.cs;
+ bmax[0] -= borderSize*chf.cs;
+ bmax[2] -= borderSize*chf.cs;
+
+ lset.nlayers = (int)layerId;
+
+ lset.layers = (rcHeightfieldLayer*)rcAlloc(sizeof(rcHeightfieldLayer)*lset.nlayers, RC_ALLOC_PERM);
+ if (!lset.layers)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'layers' (%d).", lset.nlayers);
+ return false;
+ }
+ memset(lset.layers, 0, sizeof(rcHeightfieldLayer)*lset.nlayers);
+
+
+ // Store layers.
+ for (int i = 0; i < lset.nlayers; ++i)
+ {
+ unsigned char curId = (unsigned char)i;
+
+ // Allocate memory for the current layer.
+ rcHeightfieldLayer* layer = &lset.layers[i];
+ memset(layer, 0, sizeof(rcHeightfieldLayer));
+
+ const int gridSize = sizeof(unsigned char)*lw*lh;
+
+ layer->heights = (unsigned char*)rcAlloc(gridSize, RC_ALLOC_PERM);
+ if (!layer->heights)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'heights' (%d).", gridSize);
+ return false;
+ }
+ memset(layer->heights, 0xff, gridSize);
+
+ layer->areas = (unsigned char*)rcAlloc(gridSize, RC_ALLOC_PERM);
+ if (!layer->areas)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'areas' (%d).", gridSize);
+ return false;
+ }
+ memset(layer->areas, 0, gridSize);
+
+ layer->cons = (unsigned char*)rcAlloc(gridSize, RC_ALLOC_PERM);
+ if (!layer->cons)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildHeightfieldLayers: Out of memory 'cons' (%d).", gridSize);
+ return false;
+ }
+ memset(layer->cons, 0, gridSize);
+
+ // Find layer height bounds.
+ int hmin = 0, hmax = 0;
+ for (int j = 0; j < nregs; ++j)
+ {
+ if (regs[j].base && regs[j].layerId == curId)
+ {
+ hmin = (int)regs[j].ymin;
+ hmax = (int)regs[j].ymax;
+ }
+ }
+
+ layer->width = lw;
+ layer->height = lh;
+ layer->cs = chf.cs;
+ layer->ch = chf.ch;
+
+ // Adjust the bbox to fit the heighfield.
+ rcVcopy(layer->bmin, bmin);
+ rcVcopy(layer->bmax, bmax);
+ layer->bmin[1] = bmin[1] + hmin*chf.ch;
+ layer->bmax[1] = bmin[1] + hmax*chf.ch;
+ layer->hmin = hmin;
+ layer->hmax = hmax;
+
+ // Update usable data region.
+ layer->minx = layer->width;
+ layer->maxx = 0;
+ layer->miny = layer->height;
+ layer->maxy = 0;
+
+ // Copy height and area from compact heighfield.
+ for (int y = 0; y < lh; ++y)
+ {
+ for (int x = 0; x < lw; ++x)
+ {
+ const int cx = borderSize+x;
+ const int cy = borderSize+y;
+ const rcCompactCell& c = chf.cells[cx+cy*w];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ const rcCompactSpan& s = chf.spans[i];
+ // Skip unassigned regions.
+ if (srcReg[i] == 0xff)
+ continue;
+ // Skip of does nto belong to current layer.
+ unsigned char lid = regs[srcReg[i]].layerId;
+ if (lid != curId)
+ continue;
+
+ // Update data bounds.
+ layer->minx = rcMin(layer->minx, x);
+ layer->maxx = rcMax(layer->maxx, x);
+ layer->miny = rcMin(layer->miny, y);
+ layer->maxy = rcMax(layer->maxy, y);
+
+ // Store height and area type.
+ const int idx = x+y*lw;
+ layer->heights[idx] = (unsigned char)(s.y - hmin);
+ layer->areas[idx] = chf.areas[i];
+
+ // Check connection.
+ unsigned char portal = 0;
+ unsigned char con = 0;
+ for (int dir = 0; dir < 4; ++dir)
+ {
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
+ {
+ const int ax = cx + rcGetDirOffsetX(dir);
+ const int ay = cy + rcGetDirOffsetY(dir);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir);
+ unsigned char alid = srcReg[ai] != 0xff ? regs[srcReg[ai]].layerId : 0xff;
+ // Portal mask
+ if (chf.areas[ai] != RC_NULL_AREA && lid != alid)
+ {
+ portal |= (unsigned char)(1<<dir);
+ // Update height so that it matches on both sides of the portal.
+ const rcCompactSpan& as = chf.spans[ai];
+ if (as.y > hmin)
+ layer->heights[idx] = rcMax(layer->heights[idx], (unsigned char)(as.y - hmin));
+ }
+ // Valid connection mask
+ if (chf.areas[ai] != RC_NULL_AREA && lid == alid)
+ {
+ const int nx = ax - borderSize;
+ const int ny = ay - borderSize;
+ if (nx >= 0 && ny >= 0 && nx < lw && ny < lh)
+ con |= (unsigned char)(1<<dir);
+ }
+ }
+ }
+
+ layer->cons[idx] = (portal << 4) | con;
+ }
+ }
+ }
+
+ if (layer->minx > layer->maxx)
+ layer->minx = layer->maxx = 0;
+ if (layer->miny > layer->maxy)
+ layer->miny = layer->maxy = 0;
+ }
+
+ ctx->stopTimer(RC_TIMER_BUILD_LAYERS);
+
+ return true;
+}
diff --git a/extern/recastnavigation/Recast/Source/RecastMesh.cpp b/extern/recastnavigation/Recast/Source/RecastMesh.cpp
index 38d62904213..ef37d569a17 100644
--- a/extern/recastnavigation/Recast/Source/RecastMesh.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastMesh.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -21,9 +21,8 @@
#include <string.h>
#include <stdio.h>
#include "Recast.h"
-#include "RecastLog.h"
-#include "RecastTimer.h"
-
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
struct rcEdge
{
@@ -32,36 +31,37 @@ struct rcEdge
unsigned short poly[2];
};
-/*static */bool buildMeshAdjacency(unsigned short* polys, const int npolys,
+/*static*/ bool buildMeshAdjacency(unsigned short* polys, const int npolys,
const int nverts, const int vertsPerPoly)
{
// Based on code by Eric Lengyel from:
// http://www.terathon.com/code/edges.php
int maxEdgeCount = npolys*vertsPerPoly;
- unsigned short* firstEdge = new unsigned short[nverts + maxEdgeCount];
+ unsigned short* firstEdge = (unsigned short*)rcAlloc(sizeof(unsigned short)*(nverts + maxEdgeCount), RC_ALLOC_TEMP);
if (!firstEdge)
return false;
unsigned short* nextEdge = firstEdge + nverts;
int edgeCount = 0;
- rcEdge* edges = new rcEdge[maxEdgeCount];
+ rcEdge* edges = (rcEdge*)rcAlloc(sizeof(rcEdge)*maxEdgeCount, RC_ALLOC_TEMP);
if (!edges)
+ {
+ rcFree(firstEdge);
return false;
+ }
for (int i = 0; i < nverts; i++)
- firstEdge[i] = 0xffff;
-
- // Invalida indices are marked as 0xffff, the following code
- // handles them just fine.
+ firstEdge[i] = RC_MESH_NULL_IDX;
for (int i = 0; i < npolys; ++i)
{
unsigned short* t = &polys[i*vertsPerPoly*2];
for (int j = 0; j < vertsPerPoly; ++j)
{
+ if (t[j] == RC_MESH_NULL_IDX) break;
unsigned short v0 = t[j];
- unsigned short v1 = (j+1 >= vertsPerPoly || t[j+1] == 0xffff) ? t[0] : t[j+1];
+ unsigned short v1 = (j+1 >= vertsPerPoly || t[j+1] == RC_MESH_NULL_IDX) ? t[0] : t[j+1];
if (v0 < v1)
{
rcEdge& edge = edges[edgeCount];
@@ -73,7 +73,7 @@ struct rcEdge
edge.polyEdge[1] = 0;
// Insert edge
nextEdge[edgeCount] = firstEdge[v0];
- firstEdge[v0] = edgeCount;
+ firstEdge[v0] = (unsigned short)edgeCount;
edgeCount++;
}
}
@@ -84,11 +84,12 @@ struct rcEdge
unsigned short* t = &polys[i*vertsPerPoly*2];
for (int j = 0; j < vertsPerPoly; ++j)
{
+ if (t[j] == RC_MESH_NULL_IDX) break;
unsigned short v0 = t[j];
- unsigned short v1 = (j+1 >= vertsPerPoly || t[j+1] == 0xffff) ? t[0] : t[j+1];
+ unsigned short v1 = (j+1 >= vertsPerPoly || t[j+1] == RC_MESH_NULL_IDX) ? t[0] : t[j+1];
if (v0 > v1)
{
- for (unsigned short e = firstEdge[v1]; e != 0xffff; e = nextEdge[e])
+ for (unsigned short e = firstEdge[v1]; e != RC_MESH_NULL_IDX; e = nextEdge[e])
{
rcEdge& edge = edges[e];
if (edge.vert[1] == v0 && edge.poly[0] == edge.poly[1])
@@ -115,8 +116,8 @@ struct rcEdge
}
}
- delete [] firstEdge;
- delete [] edges;
+ rcFree(firstEdge);
+ rcFree(edges);
return true;
}
@@ -133,8 +134,8 @@ inline int computeVertexHash(int x, int y, int z)
return (int)(n & (VERTEX_BUCKET_COUNT-1));
}
-static int addVertex(unsigned short x, unsigned short y, unsigned short z,
- unsigned short* verts, int* firstVert, int* nextVert, int& nv)
+static unsigned short addVertex(unsigned short x, unsigned short y, unsigned short z,
+ unsigned short* verts, int* firstVert, int* nextVert, int& nv)
{
int bucket = computeVertexHash(x, 0, z);
int i = firstVert[bucket];
@@ -143,7 +144,7 @@ static int addVertex(unsigned short x, unsigned short y, unsigned short z,
{
const unsigned short* v = &verts[i*3];
if (v[0] == x && (rcAbs(v[1] - y) <= 2) && v[2] == z)
- return i;
+ return (unsigned short)i;
i = nextVert[i]; // next
}
@@ -156,7 +157,7 @@ static int addVertex(unsigned short x, unsigned short y, unsigned short z,
nextVert[i] = firstVert[bucket];
firstVert[bucket] = i;
- return i;
+ return (unsigned short)i;
}
inline int prev(int i, int n) { return i-1 >= 0 ? i-1 : n-1; }
@@ -196,7 +197,7 @@ inline bool collinear(const int* a, const int* b, const int* c)
// Returns true iff ab properly intersects cd: they share
// a point interior to both segments. The properness of the
// intersection is ensured by using strict leftness.
-bool intersectProp(const int* a, const int* b, const int* c, const int* d)
+static bool intersectProp(const int* a, const int* b, const int* c, const int* d)
{
// Eliminate improper cases.
if (collinear(a,b,c) || collinear(a,b,d) ||
@@ -287,7 +288,7 @@ static bool diagonal(int i, int j, int n, const int* verts, int* indices)
return inCone(i, j, n, verts, indices) && diagonalie(i, j, n, verts, indices);
}
-int triangulate(int n, const int* verts, int* indices, int* tris)
+static int triangulate(int n, const int* verts, int* indices, int* tris)
{
int ntris = 0;
int* dst = tris;
@@ -328,8 +329,6 @@ int triangulate(int n, const int* verts, int* indices, int* tris)
if (mini == -1)
{
// Should not happen.
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "triangulate: Failed to triangulate polygon.");
/* printf("mini == -1 ntris=%d n=%d\n", ntris, n);
for (int i = 0; i < n; i++)
{
@@ -379,7 +378,7 @@ int triangulate(int n, const int* verts, int* indices, int* tris)
static int countPolyVerts(const unsigned short* p, const int nvp)
{
for (int i = 0; i < nvp; ++i)
- if (p[i] == 0xffff)
+ if (p[i] == RC_MESH_NULL_IDX)
return i;
return nvp;
}
@@ -454,8 +453,7 @@ static int getPolyMergeValue(unsigned short* pa, unsigned short* pb,
return dx*dx + dy*dy;
}
-static void mergePolys(unsigned short* pa, unsigned short* pb,
- const unsigned short* verts, int ea, int eb,
+static void mergePolys(unsigned short* pa, unsigned short* pb, int ea, int eb,
unsigned short* tmp, const int nvp)
{
const int na = countPolyVerts(pa, nvp);
@@ -474,6 +472,7 @@ static void mergePolys(unsigned short* pa, unsigned short* pb,
memcpy(pa, tmp, sizeof(unsigned short)*nvp);
}
+
static void pushFront(int v, int* arr, int& an)
{
an++;
@@ -487,59 +486,157 @@ static void pushBack(int v, int* arr, int& an)
an++;
}
-static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int maxTris)
+static bool canRemoveVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short rem)
{
- unsigned short* tmpPoly;
- int ntris;
+ const int nvp = mesh.nvp;
+
+ // Count number of polygons to remove.
+ int numRemovedVerts = 0;
+ int numTouchedVerts = 0;
+ int numRemainingEdges = 0;
+ for (int i = 0; i < mesh.npolys; ++i)
+ {
+ unsigned short* p = &mesh.polys[i*nvp*2];
+ const int nv = countPolyVerts(p, nvp);
+ int numRemoved = 0;
+ int numVerts = 0;
+ for (int j = 0; j < nv; ++j)
+ {
+ if (p[j] == rem)
+ {
+ numTouchedVerts++;
+ numRemoved++;
+ }
+ numVerts++;
+ }
+ if (numRemoved)
+ {
+ numRemovedVerts += numRemoved;
+ numRemainingEdges += numVerts-(numRemoved+1);
+ }
+ }
+
+ // There would be too few edges remaining to create a polygon.
+ // This can happen for example when a tip of a triangle is marked
+ // as deletion, but there are no other polys that share the vertex.
+ // In this case, the vertex should not be removed.
+ if (numRemainingEdges <= 2)
+ return false;
+
+ // Find edges which share the removed vertex.
+ const int maxEdges = numTouchedVerts*2;
+ int nedges = 0;
+ rcScopedDelete<int> edges = (int*)rcAlloc(sizeof(int)*maxEdges*3, RC_ALLOC_TEMP);
+ if (!edges)
+ {
+ ctx->log(RC_LOG_WARNING, "canRemoveVertex: Out of memory 'edges' (%d).", maxEdges*3);
+ return false;
+ }
+
+ for (int i = 0; i < mesh.npolys; ++i)
+ {
+ unsigned short* p = &mesh.polys[i*nvp*2];
+ const int nv = countPolyVerts(p, nvp);
+
+ // Collect edges which touches the removed vertex.
+ for (int j = 0, k = nv-1; j < nv; k = j++)
+ {
+ if (p[j] == rem || p[k] == rem)
+ {
+ // Arrange edge so that a=rem.
+ int a = p[j], b = p[k];
+ if (b == rem)
+ rcSwap(a,b);
+
+ // Check if the edge exists
+ bool exists = false;
+ for (int k = 0; k < nedges; ++k)
+ {
+ int* e = &edges[k*3];
+ if (e[1] == b)
+ {
+ // Exists, increment vertex share count.
+ e[2]++;
+ exists = true;
+ }
+ }
+ // Add new edge.
+ if (!exists)
+ {
+ int* e = &edges[nedges*3];
+ e[0] = a;
+ e[1] = b;
+ e[2] = 1;
+ nedges++;
+ }
+ }
+ }
+ }
- static const int nvp = mesh.nvp;
+ // There should be no more than 2 open edges.
+ // This catches the case that two non-adjacent polygons
+ // share the removed vertex. In that case, do not remove the vertex.
+ int numOpenEdges = 0;
+ for (int i = 0; i < nedges; ++i)
+ {
+ if (edges[i*3+2] < 2)
+ numOpenEdges++;
+ }
+ if (numOpenEdges > 2)
+ return false;
+
+ return true;
+}
- int* edges = 0;
- int nedges = 0;
- int* hole = 0;
- int nhole = 0;
- int* hreg = 0;
- int nhreg = 0;
- int* tris = 0;
- int* tverts = 0;
- int* thole = 0;
- unsigned short* polys = 0;
- unsigned short* pregs = 0;
- int npolys = 0;
+static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short rem, const int maxTris)
+{
+ const int nvp = mesh.nvp;
// Count number of polygons to remove.
- int nrem = 0;
+ int numRemovedVerts = 0;
for (int i = 0; i < mesh.npolys; ++i)
{
unsigned short* p = &mesh.polys[i*nvp*2];
- for (int j = 0; j < nvp; ++j)
- if (p[j] == rem) { nrem++; break; }
+ const int nv = countPolyVerts(p, nvp);
+ for (int j = 0; j < nv; ++j)
+ {
+ if (p[j] == rem)
+ numRemovedVerts++;
+ }
}
-
- edges = new int[nrem*nvp*3];
+
+ int nedges = 0;
+ rcScopedDelete<int> edges = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp*4, RC_ALLOC_TEMP);
if (!edges)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'edges' (%d).", nrem*nvp*3);
- goto failure;
+ ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'edges' (%d).", numRemovedVerts*nvp*4);
+ return false;
}
- hole = new int[nrem*nvp];
+ int nhole = 0;
+ rcScopedDelete<int> hole = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP);
if (!hole)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hole' (%d).", nrem*nvp);
- goto failure;
+ ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hole' (%d).", numRemovedVerts*nvp);
+ return false;
}
- hreg = new int[nrem*nvp];
+
+ int nhreg = 0;
+ rcScopedDelete<int> hreg = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP);
if (!hreg)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hreg' (%d).", nrem*nvp);
- goto failure;
+ ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'hreg' (%d).", numRemovedVerts*nvp);
+ return false;
+ }
+
+ int nharea = 0;
+ rcScopedDelete<int> harea = (int*)rcAlloc(sizeof(int)*numRemovedVerts*nvp, RC_ALLOC_TEMP);
+ if (!harea)
+ {
+ ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'harea' (%d).", numRemovedVerts*nvp);
+ return false;
}
-
for (int i = 0; i < mesh.npolys; ++i)
{
unsigned short* p = &mesh.polys[i*nvp*2];
@@ -554,17 +651,20 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
{
if (p[j] != rem && p[k] != rem)
{
- int* e = &edges[nedges*3];
+ int* e = &edges[nedges*4];
e[0] = p[k];
e[1] = p[j];
e[2] = mesh.regs[i];
+ e[3] = mesh.areas[i];
nedges++;
}
}
// Remove the polygon.
unsigned short* p2 = &mesh.polys[(mesh.npolys-1)*nvp*2];
memcpy(p,p2,sizeof(unsigned short)*nvp);
+ memset(p+nvp,0xff,sizeof(unsigned short)*nvp);
mesh.regs[i] = mesh.regs[mesh.npolys-1];
+ mesh.areas[i] = mesh.areas[mesh.npolys-1];
mesh.npolys--;
--i;
}
@@ -589,16 +689,18 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
}
for (int i = 0; i < nedges; ++i)
{
- if (edges[i*3+0] > rem) edges[i*3+0]--;
- if (edges[i*3+1] > rem) edges[i*3+1]--;
+ if (edges[i*4+0] > rem) edges[i*4+0]--;
+ if (edges[i*4+1] > rem) edges[i*4+1]--;
}
if (nedges == 0)
return true;
- hole[nhole] = edges[0];
- hreg[nhole] = edges[2];
- nhole++;
+ // Start with one vertex, keep appending connected
+ // segments to the start and end of the hole.
+ pushBack(edges[0], hole, nhole);
+ pushBack(edges[2], hreg, nhreg);
+ pushBack(edges[3], harea, nharea);
while (nedges)
{
@@ -606,28 +708,34 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
for (int i = 0; i < nedges; ++i)
{
- const int ea = edges[i*3+0];
- const int eb = edges[i*3+1];
- const int r = edges[i*3+2];
+ const int ea = edges[i*4+0];
+ const int eb = edges[i*4+1];
+ const int r = edges[i*4+2];
+ const int a = edges[i*4+3];
bool add = false;
if (hole[0] == eb)
{
+ // The segment matches the beginning of the hole boundary.
pushFront(ea, hole, nhole);
pushFront(r, hreg, nhreg);
+ pushFront(a, harea, nharea);
add = true;
}
else if (hole[nhole-1] == ea)
{
+ // The segment matches the end of the hole boundary.
pushBack(eb, hole, nhole);
pushBack(r, hreg, nhreg);
+ pushBack(a, harea, nharea);
add = true;
}
if (add)
{
- // Remove edge.
- edges[i*3+0] = edges[(nedges-1)*3+0];
- edges[i*3+1] = edges[(nedges-1)*3+1];
- edges[i*3+2] = edges[(nedges-1)*3+2];
+ // The edge segment was added, remove it.
+ edges[i*4+0] = edges[(nedges-1)*4+0];
+ edges[i*4+1] = edges[(nedges-1)*4+1];
+ edges[i*4+2] = edges[(nedges-1)*4+2];
+ edges[i*4+3] = edges[(nedges-1)*4+3];
--nedges;
match = true;
--i;
@@ -638,28 +746,25 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
break;
}
- tris = new int[nhole*3];
+ rcScopedDelete<int> tris = (int*)rcAlloc(sizeof(int)*nhole*3, RC_ALLOC_TEMP);
if (!tris)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tris' (%d).", nhole*3);
- goto failure;
+ ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tris' (%d).", nhole*3);
+ return false;
}
- tverts = new int[nhole*4];
+ rcScopedDelete<int> tverts = (int*)rcAlloc(sizeof(int)*nhole*4, RC_ALLOC_TEMP);
if (!tverts)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tverts' (%d).", nhole*4);
- goto failure;
+ ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'tverts' (%d).", nhole*4);
+ return false;
}
- thole = new int[nhole];
+ rcScopedDelete<int> thole = (int*)rcAlloc(sizeof(int)*nhole, RC_ALLOC_TEMP);
if (!tverts)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'thole' (%d).", nhole);
- goto failure;
+ ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'thole' (%d).", nhole);
+ return false;
}
// Generate temp vertex array for triangulation.
@@ -674,27 +779,37 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
}
// Triangulate the hole.
- ntris = triangulate(nhole, &tverts[0], &thole[0], tris);
-
+ int ntris = triangulate(nhole, &tverts[0], &thole[0], tris);
+ if (ntris < 0)
+ {
+ ntris = -ntris;
+ ctx->log(RC_LOG_WARNING, "removeVertex: triangulate() returned bad results.");
+ }
+
// Merge the hole triangles back to polygons.
- polys = new unsigned short[(ntris+1)*nvp];
+ rcScopedDelete<unsigned short> polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*(ntris+1)*nvp, RC_ALLOC_TEMP);
if (!polys)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'polys' (%d).", (ntris+1)*nvp);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'polys' (%d).", (ntris+1)*nvp);
+ return false;
}
- pregs = new unsigned short[ntris];
+ rcScopedDelete<unsigned short> pregs = (unsigned short*)rcAlloc(sizeof(unsigned short)*ntris, RC_ALLOC_TEMP);
if (!pregs)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_WARNING, "removeVertex: Out of memory 'pregs' (%d).", ntris);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pregs' (%d).", ntris);
+ return false;
+ }
+ rcScopedDelete<unsigned char> pareas = (unsigned char*)rcAlloc(sizeof(unsigned char)*ntris, RC_ALLOC_TEMP);
+ if (!pregs)
+ {
+ ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pareas' (%d).", ntris);
+ return false;
}
- tmpPoly = &polys[ntris*nvp];
+ unsigned short* tmpPoly = &polys[ntris*nvp];
// Build initial polygons.
+ int npolys = 0;
memset(polys, 0xff, ntris*nvp*sizeof(unsigned short));
for (int j = 0; j < ntris; ++j)
{
@@ -704,7 +819,8 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
polys[npolys*nvp+0] = (unsigned short)hole[t[0]];
polys[npolys*nvp+1] = (unsigned short)hole[t[1]];
polys[npolys*nvp+2] = (unsigned short)hole[t[2]];
- pregs[npolys] = hreg[t[0]];
+ pregs[npolys] = (unsigned short)hreg[t[0]];
+ pareas[npolys] = (unsigned char)harea[t[0]];
npolys++;
}
}
@@ -714,11 +830,11 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
// Merge polygons.
if (nvp > 3)
{
- while (true)
+ for (;;)
{
// Find best polygons to merge.
int bestMergeVal = 0;
- int bestPa, bestPb, bestEa, bestEb;
+ int bestPa = 0, bestPb = 0, bestEa = 0, bestEb = 0;
for (int j = 0; j < npolys-1; ++j)
{
@@ -744,9 +860,10 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
// Found best, merge.
unsigned short* pa = &polys[bestPa*nvp];
unsigned short* pb = &polys[bestPb*nvp];
- mergePolys(pa, pb, mesh.verts, bestEa, bestEb, tmpPoly, nvp);
+ mergePolys(pa, pb, bestEa, bestEb, tmpPoly, nvp);
memcpy(pb, &polys[(npolys-1)*nvp], sizeof(unsigned short)*nvp);
pregs[bestPb] = pregs[npolys-1];
+ pareas[bestPb] = pareas[npolys-1];
npolys--;
}
else
@@ -766,50 +883,43 @@ static bool removeVertex(rcPolyMesh& mesh, const unsigned short rem, const int m
for (int j = 0; j < nvp; ++j)
p[j] = polys[i*nvp+j];
mesh.regs[mesh.npolys] = pregs[i];
+ mesh.areas[mesh.npolys] = pareas[i];
mesh.npolys++;
+ if (mesh.npolys > maxTris)
+ {
+ ctx->log(RC_LOG_ERROR, "removeVertex: Too many polygons %d (max:%d).", mesh.npolys, maxTris);
+ return false;
+ }
}
- delete [] edges;
- delete [] hole;
- delete [] hreg;
- delete [] tris;
- delete [] thole;
- delete [] tverts;
- delete [] polys;
- delete [] pregs;
-
return true;
-
-failure:
- delete [] edges;
- delete [] hole;
- delete [] hreg;
- delete [] tris;
- delete [] thole;
- delete [] tverts;
- delete [] polys;
- delete [] pregs;
-
- return false;
}
-
-bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
+/// @par
+///
+/// @note If the mesh data is to be used to construct a Detour navigation mesh, then the upper
+/// limit must be retricted to <= #DT_VERTS_PER_POLYGON.
+///
+/// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
+bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
{
- unsigned short* tmpPoly;
- rcTimeVal startTime = rcGetPerformanceTimer();
- rcTimeVal endTime;
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_BUILD_POLYMESH);
- vcopy(mesh.bmin, cset.bmin);
- vcopy(mesh.bmax, cset.bmax);
+ rcVcopy(mesh.bmin, cset.bmin);
+ rcVcopy(mesh.bmax, cset.bmax);
mesh.cs = cset.cs;
mesh.ch = cset.ch;
+ mesh.borderSize = cset.borderSize;
int maxVertices = 0;
int maxTris = 0;
int maxVertsPerCont = 0;
for (int i = 0; i < cset.nconts; ++i)
{
+ // Skip null contours.
+ if (cset.conts[i].nverts < 3) continue;
maxVertices += cset.conts[i].nverts;
maxTris += cset.conts[i].nverts - 2;
maxVertsPerCont = rcMax(maxVertsPerCont, cset.conts[i].nverts);
@@ -817,103 +927,95 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
if (maxVertices >= 0xfffe)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Too many vertices %d.", maxVertices);
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Too many vertices %d.", maxVertices);
return false;
}
-
- unsigned char* vflags = 0;
- int* nextVert = 0;
- int* firstVert = 0;
- int* indices = 0;
- int* tris = 0;
- unsigned short* polys = 0;
-
- vflags = new unsigned char[maxVertices];
+
+ rcScopedDelete<unsigned char> vflags = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxVertices, RC_ALLOC_TEMP);
if (!vflags)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.verts' (%d).", maxVertices);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.verts' (%d).", maxVertices);
+ return false;
}
memset(vflags, 0, maxVertices);
- mesh.verts = new unsigned short[maxVertices*3];
+ mesh.verts = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxVertices*3, RC_ALLOC_PERM);
if (!mesh.verts)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.verts' (%d).", maxVertices);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.verts' (%d).", maxVertices);
+ return false;
}
- mesh.polys = new unsigned short[maxTris*nvp*2];
+ mesh.polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxTris*nvp*2, RC_ALLOC_PERM);
if (!mesh.polys)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.polys' (%d).", maxTris*nvp*2);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.polys' (%d).", maxTris*nvp*2);
+ return false;
}
- mesh.regs = new unsigned short[maxTris];
+ mesh.regs = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxTris, RC_ALLOC_PERM);
if (!mesh.regs)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.regs' (%d).", maxTris);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.regs' (%d).", maxTris);
+ return false;
+ }
+ mesh.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxTris, RC_ALLOC_PERM);
+ if (!mesh.areas)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.areas' (%d).", maxTris);
+ return false;
}
+
mesh.nverts = 0;
mesh.npolys = 0;
mesh.nvp = nvp;
+ mesh.maxpolys = maxTris;
memset(mesh.verts, 0, sizeof(unsigned short)*maxVertices*3);
memset(mesh.polys, 0xff, sizeof(unsigned short)*maxTris*nvp*2);
memset(mesh.regs, 0, sizeof(unsigned short)*maxTris);
+ memset(mesh.areas, 0, sizeof(unsigned char)*maxTris);
- nextVert = new int[maxVertices];
+ rcScopedDelete<int> nextVert = (int*)rcAlloc(sizeof(int)*maxVertices, RC_ALLOC_TEMP);
if (!nextVert)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'nextVert' (%d).", maxVertices);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'nextVert' (%d).", maxVertices);
+ return false;
}
memset(nextVert, 0, sizeof(int)*maxVertices);
- firstVert = new int[VERTEX_BUCKET_COUNT];
+ rcScopedDelete<int> firstVert = (int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP);
if (!firstVert)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT);
+ return false;
}
for (int i = 0; i < VERTEX_BUCKET_COUNT; ++i)
firstVert[i] = -1;
- indices = new int[maxVertsPerCont];
+ rcScopedDelete<int> indices = (int*)rcAlloc(sizeof(int)*maxVertsPerCont, RC_ALLOC_TEMP);
if (!indices)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'indices' (%d).", maxVertsPerCont);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'indices' (%d).", maxVertsPerCont);
+ return false;
}
- tris = new int[maxVertsPerCont*3];
+ rcScopedDelete<int> tris = (int*)rcAlloc(sizeof(int)*maxVertsPerCont*3, RC_ALLOC_TEMP);
if (!tris)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'tris' (%d).", maxVertsPerCont*3);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'tris' (%d).", maxVertsPerCont*3);
+ return false;
}
- polys = new unsigned short[(maxVertsPerCont+1)*nvp];
+ rcScopedDelete<unsigned short> polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*(maxVertsPerCont+1)*nvp, RC_ALLOC_TEMP);
if (!polys)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'polys' (%d).", maxVertsPerCont*nvp);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'polys' (%d).", maxVertsPerCont*nvp);
+ return false;
}
- tmpPoly = &polys[maxVertsPerCont*nvp];
+ unsigned short* tmpPoly = &polys[maxVertsPerCont*nvp];
for (int i = 0; i < cset.nconts; ++i)
{
rcContour& cont = cset.conts[i];
- // Skip empty contours.
+ // Skip null contours.
if (cont.nverts < 3)
continue;
@@ -925,20 +1027,20 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
if (ntris <= 0)
{
// Bad triangulation, should not happen.
-/* for (int k = 0; k < cont.nverts; ++k)
+/* printf("\tconst float bmin[3] = {%ff,%ff,%ff};\n", cset.bmin[0], cset.bmin[1], cset.bmin[2]);
+ printf("\tconst float cs = %ff;\n", cset.cs);
+ printf("\tconst float ch = %ff;\n", cset.ch);
+ printf("\tconst int verts[] = {\n");
+ for (int k = 0; k < cont.nverts; ++k)
{
const int* v = &cont.verts[k*4];
printf("\t\t%d,%d,%d,%d,\n", v[0], v[1], v[2], v[3]);
- if (nBadPos < 100)
- {
- badPos[nBadPos*3+0] = v[0];
- badPos[nBadPos*3+1] = v[1];
- badPos[nBadPos*3+2] = v[2];
- nBadPos++;
- }
- }*/
+ }
+ printf("\t};\n\tconst int nverts = sizeof(verts)/(sizeof(int)*4);\n");*/
+ ctx->log(RC_LOG_WARNING, "rcBuildPolyMesh: Bad triangulation Contour %d.", i);
ntris = -ntris;
}
+
// Add and merge vertices.
for (int j = 0; j < cont.nverts; ++j)
{
@@ -972,11 +1074,11 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
// Merge polygons.
if (nvp > 3)
{
- while (true)
+ for(;;)
{
// Find best polygons to merge.
int bestMergeVal = 0;
- int bestPa, bestPb, bestEa, bestEb;
+ int bestPa = 0, bestPb = 0, bestEa = 0, bestEb = 0;
for (int j = 0; j < npolys-1; ++j)
{
@@ -1002,7 +1104,7 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
// Found best, merge.
unsigned short* pa = &polys[bestPa*nvp];
unsigned short* pb = &polys[bestPb*nvp];
- mergePolys(pa, pb, mesh.verts, bestEa, bestEb, tmpPoly, nvp);
+ mergePolys(pa, pb, bestEa, bestEb, tmpPoly, nvp);
memcpy(pb, &polys[(npolys-1)*nvp], sizeof(unsigned short)*nvp);
npolys--;
}
@@ -1014,7 +1116,6 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
}
}
-
// Store polygons.
for (int j = 0; j < npolys; ++j)
{
@@ -1023,7 +1124,13 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
for (int k = 0; k < nvp; ++k)
p[k] = q[k];
mesh.regs[mesh.npolys] = cont.reg;
+ mesh.areas[mesh.npolys] = cont.area;
mesh.npolys++;
+ if (mesh.npolys > maxTris)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Too many polygons %d (max:%d).", mesh.npolys, maxTris);
+ return false;
+ }
}
}
@@ -1033,131 +1140,174 @@ bool rcBuildPolyMesh(rcContourSet& cset, int nvp, rcPolyMesh& mesh)
{
if (vflags[i])
{
- if (!removeVertex(mesh, i, maxTris))
- goto failure;
- for (int j = i; j < mesh.nverts-1; ++j)
+ if (!canRemoveVertex(ctx, mesh, (unsigned short)i))
+ continue;
+ if (!removeVertex(ctx, mesh, (unsigned short)i, maxTris))
+ {
+ // Failed to remove vertex
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Failed to remove edge vertex %d.", i);
+ return false;
+ }
+ // Remove vertex
+ // Note: mesh.nverts is already decremented inside removeVertex()!
+ for (int j = i; j < mesh.nverts; ++j)
vflags[j] = vflags[j+1];
--i;
}
}
-
- delete [] vflags;
- delete [] firstVert;
- delete [] nextVert;
- delete [] indices;
- delete [] tris;
// Calculate adjacency.
if (!buildMeshAdjacency(mesh.polys, mesh.npolys, mesh.nverts, nvp))
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMesh: Adjacency failed.");
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Adjacency failed.");
return false;
}
- endTime = rcGetPerformanceTimer();
+ // Find portal edges
+ if (mesh.borderSize > 0)
+ {
+ const int w = cset.width;
+ const int h = cset.height;
+ for (int i = 0; i < mesh.npolys; ++i)
+ {
+ unsigned short* p = &mesh.polys[i*2*nvp];
+ for (int j = 0; j < nvp; ++j)
+ {
+ if (p[j] == RC_MESH_NULL_IDX) break;
+ // Skip connected edges.
+ if (p[nvp+j] != RC_MESH_NULL_IDX)
+ continue;
+ int nj = j+1;
+ if (nj >= nvp || p[nj] == RC_MESH_NULL_IDX) nj = 0;
+ const unsigned short* va = &mesh.verts[p[j]*3];
+ const unsigned short* vb = &mesh.verts[p[nj]*3];
+
+ if ((int)va[0] == 0 && (int)vb[0] == 0)
+ p[nvp+j] = 0x8000 | 0;
+ else if ((int)va[2] == h && (int)vb[2] == h)
+ p[nvp+j] = 0x8000 | 1;
+ else if ((int)va[0] == w && (int)vb[0] == w)
+ p[nvp+j] = 0x8000 | 2;
+ else if ((int)va[2] == 0 && (int)vb[2] == 0)
+ p[nvp+j] = 0x8000 | 3;
+ }
+ }
+ }
+
+ // Just allocate the mesh flags array. The user is resposible to fill it.
+ mesh.flags = (unsigned short*)rcAlloc(sizeof(unsigned short)*mesh.npolys, RC_ALLOC_PERM);
+ if (!mesh.flags)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: Out of memory 'mesh.flags' (%d).", mesh.npolys);
+ return false;
+ }
+ memset(mesh.flags, 0, sizeof(unsigned short) * mesh.npolys);
+
+ if (mesh.nverts > 0xffff)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: The resulting mesh has too many vertices %d (max %d). Data can be corrupted.", mesh.nverts, 0xffff);
+ }
+ if (mesh.npolys > 0xffff)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMesh: The resulting mesh has too many polygons %d (max %d). Data can be corrupted.", mesh.npolys, 0xffff);
+ }
-// if (rcGetLog())
-// rcGetLog()->log(RC_LOG_PROGRESS, "Build polymesh: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
- if (rcGetBuildTimes())
- rcGetBuildTimes()->buildPolymesh += rcGetDeltaTimeUsec(startTime, endTime);
+ ctx->stopTimer(RC_TIMER_BUILD_POLYMESH);
return true;
-
-failure:
- delete [] vflags;
- delete [] tmpPoly;
- delete [] firstVert;
- delete [] nextVert;
- delete [] indices;
- delete [] tris;
-
- return false;
}
-bool rcMergePolyMeshes(rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
+/// @see rcAllocPolyMesh, rcPolyMesh
+bool rcMergePolyMeshes(rcContext* ctx, rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
{
+ rcAssert(ctx);
+
if (!nmeshes || !meshes)
return true;
- rcTimeVal startTime = rcGetPerformanceTimer();
- rcTimeVal endTime;
-
- int* nextVert = 0;
- int* firstVert = 0;
- unsigned short* vremap = 0;
+ ctx->startTimer(RC_TIMER_MERGE_POLYMESH);
mesh.nvp = meshes[0]->nvp;
mesh.cs = meshes[0]->cs;
mesh.ch = meshes[0]->ch;
- vcopy(mesh.bmin, meshes[0]->bmin);
- vcopy(mesh.bmax, meshes[0]->bmax);
+ rcVcopy(mesh.bmin, meshes[0]->bmin);
+ rcVcopy(mesh.bmax, meshes[0]->bmax);
int maxVerts = 0;
int maxPolys = 0;
int maxVertsPerMesh = 0;
for (int i = 0; i < nmeshes; ++i)
{
- vmin(mesh.bmin, meshes[i]->bmin);
- vmax(mesh.bmax, meshes[i]->bmax);
+ rcVmin(mesh.bmin, meshes[i]->bmin);
+ rcVmax(mesh.bmax, meshes[i]->bmax);
maxVertsPerMesh = rcMax(maxVertsPerMesh, meshes[i]->nverts);
maxVerts += meshes[i]->nverts;
maxPolys += meshes[i]->npolys;
}
mesh.nverts = 0;
- mesh.verts = new unsigned short[maxVerts*3];
+ mesh.verts = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxVerts*3, RC_ALLOC_PERM);
if (!mesh.verts)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.verts' (%d).", maxVerts*3);
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.verts' (%d).", maxVerts*3);
return false;
}
mesh.npolys = 0;
- mesh.polys = new unsigned short[maxPolys*2*mesh.nvp];
+ mesh.polys = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxPolys*2*mesh.nvp, RC_ALLOC_PERM);
if (!mesh.polys)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.polys' (%d).", maxPolys*2*mesh.nvp);
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.polys' (%d).", maxPolys*2*mesh.nvp);
return false;
}
memset(mesh.polys, 0xff, sizeof(unsigned short)*maxPolys*2*mesh.nvp);
- mesh.regs = new unsigned short[maxPolys];
+ mesh.regs = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxPolys, RC_ALLOC_PERM);
if (!mesh.regs)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.regs' (%d).", maxPolys);
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.regs' (%d).", maxPolys);
return false;
}
memset(mesh.regs, 0, sizeof(unsigned short)*maxPolys);
+
+ mesh.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxPolys, RC_ALLOC_PERM);
+ if (!mesh.areas)
+ {
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.areas' (%d).", maxPolys);
+ return false;
+ }
+ memset(mesh.areas, 0, sizeof(unsigned char)*maxPolys);
+
+ mesh.flags = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxPolys, RC_ALLOC_PERM);
+ if (!mesh.flags)
+ {
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'mesh.flags' (%d).", maxPolys);
+ return false;
+ }
+ memset(mesh.flags, 0, sizeof(unsigned short)*maxPolys);
- nextVert = new int[maxVerts];
+ rcScopedDelete<int> nextVert = (int*)rcAlloc(sizeof(int)*maxVerts, RC_ALLOC_TEMP);
if (!nextVert)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'nextVert' (%d).", maxVerts);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'nextVert' (%d).", maxVerts);
+ return false;
}
memset(nextVert, 0, sizeof(int)*maxVerts);
- firstVert = new int[VERTEX_BUCKET_COUNT];
+ rcScopedDelete<int> firstVert = (int*)rcAlloc(sizeof(int)*VERTEX_BUCKET_COUNT, RC_ALLOC_TEMP);
if (!firstVert)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'firstVert' (%d).", VERTEX_BUCKET_COUNT);
+ return false;
}
for (int i = 0; i < VERTEX_BUCKET_COUNT; ++i)
firstVert[i] = -1;
- vremap = new unsigned short[maxVertsPerMesh];
+ rcScopedDelete<unsigned short> vremap = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxVertsPerMesh, RC_ALLOC_PERM);
if (!vremap)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'vremap' (%d).", maxVertsPerMesh);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Out of memory 'vremap' (%d).", maxVertsPerMesh);
+ return false;
}
memset(nextVert, 0, sizeof(int)*maxVerts);
@@ -1172,7 +1322,7 @@ bool rcMergePolyMeshes(rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
{
unsigned short* v = &pmesh->verts[j*3];
vremap[j] = addVertex(v[0]+ox, v[1], v[2]+oz,
- mesh.verts, firstVert, nextVert, mesh.nverts);
+ mesh.verts, firstVert, nextVert, mesh.nverts);
}
for (int j = 0; j < pmesh->npolys; ++j)
@@ -1180,10 +1330,12 @@ bool rcMergePolyMeshes(rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
unsigned short* tgt = &mesh.polys[mesh.npolys*2*mesh.nvp];
unsigned short* src = &pmesh->polys[j*2*mesh.nvp];
mesh.regs[mesh.npolys] = pmesh->regs[j];
+ mesh.areas[mesh.npolys] = pmesh->areas[j];
+ mesh.flags[mesh.npolys] = pmesh->flags[j];
mesh.npolys++;
for (int k = 0; k < mesh.nvp; ++k)
{
- if (src[k] == 0xffff) break;
+ if (src[k] == RC_MESH_NULL_IDX) break;
tgt[k] = vremap[src[k]];
}
}
@@ -1192,27 +1344,20 @@ bool rcMergePolyMeshes(rcPolyMesh** meshes, const int nmeshes, rcPolyMesh& mesh)
// Calculate adjacency.
if (!buildMeshAdjacency(mesh.polys, mesh.npolys, mesh.nverts, mesh.nvp))
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcMergePolyMeshes: Adjacency failed.");
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: Adjacency failed.");
return false;
}
-
- delete [] firstVert;
- delete [] nextVert;
- delete [] vremap;
-
- endTime = rcGetPerformanceTimer();
+ if (mesh.nverts > 0xffff)
+ {
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: The resulting mesh has too many vertices %d (max %d). Data can be corrupted.", mesh.nverts, 0xffff);
+ }
+ if (mesh.npolys > 0xffff)
+ {
+ ctx->log(RC_LOG_ERROR, "rcMergePolyMeshes: The resulting mesh has too many polygons %d (max %d). Data can be corrupted.", mesh.npolys, 0xffff);
+ }
- if (rcGetBuildTimes())
- rcGetBuildTimes()->mergePolyMesh += rcGetDeltaTimeUsec(startTime, endTime);
+ ctx->stopTimer(RC_TIMER_MERGE_POLYMESH);
return true;
-
-failure:
- delete [] firstVert;
- delete [] nextVert;
- delete [] vremap;
-
- return false;
}
diff --git a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
index 55ba28ae7cf..126529e9779 100644
--- a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -23,248 +23,75 @@
#include <stdlib.h>
#include <stdio.h>
#include "Recast.h"
-#include "RecastLog.h"
-#include "RecastTimer.h"
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
+static const unsigned RC_UNSET_HEIGHT = 0xffff;
+
struct rcHeightPatch
{
- inline rcHeightPatch() : data(0) {}
- inline ~rcHeightPatch() { delete [] data; }
+ inline rcHeightPatch() : data(0), xmin(0), ymin(0), width(0), height(0) {}
+ inline ~rcHeightPatch() { rcFree(data); }
unsigned short* data;
int xmin, ymin, width, height;
};
-
-static int circumCircle(const float xp, const float yp,
- const float x1, const float y1,
- const float x2, const float y2,
- const float x3, const float y3,
- float& xc, float& yc, float& rsqr)
+inline float vdot2(const float* a, const float* b)
{
- static const float EPSILON = 1e-6f;
-
- const float fabsy1y2 = rcAbs(y1-y2);
- const float fabsy2y3 = rcAbs(y2-y3);
-
- /* Check for coincident points */
- if (fabsy1y2 < EPSILON && fabsy2y3 < EPSILON)
- return 0;
-
- if (fabsy1y2 < EPSILON)
- {
- const float m2 = - (x3-x2) / (y3-y2);
- const float mx2 = (x2 + x3) / 2.0f;
- const float my2 = (y2 + y3) / 2.0f;
- xc = (x2 + x1) / 2.0f;
- yc = m2 * (xc - mx2) + my2;
- }
- else if (fabsy2y3 < EPSILON)
- {
- const float m1 = - (x2-x1) / (y2-y1);
- const float mx1 = (x1 + x2) / 2.0f;
- const float my1 = (y1 + y2) / 2.0f;
- xc = (x3 + x2) / 2.0f;
- yc = m1 * (xc - mx1) + my1;
- }
- else
- {
- const float m1 = - (x2-x1) / (y2-y1);
- const float m2 = - (x3-x2) / (y3-y2);
- const float mx1 = (x1 + x2) / 2.0f;
- const float mx2 = (x2 + x3) / 2.0f;
- const float my1 = (y1 + y2) / 2.0f;
- const float my2 = (y2 + y3) / 2.0f;
- xc = (m1 * mx1 - m2 * mx2 + my2 - my1) / (m1 - m2);
- if (fabsy1y2 > fabsy2y3)
- yc = m1 * (xc - mx1) + my1;
- else
- yc = m2 * (xc - mx2) + my2;
- }
-
- float dx,dy;
-
- dx = x2 - xc;
- dy = y2 - yc;
- rsqr = dx*dx + dy*dy;
-
- dx = xp - xc;
- dy = yp - yc;
- const float drsqr = dx*dx + dy*dy;
-
- return (drsqr <= rsqr) ? 1 : 0;
+ return a[0]*b[0] + a[2]*b[2];
}
-
-static float *_qsort_verts;
-static int ptcmp(const void *v1, const void *v2)
+
+inline float vdistSq2(const float* p, const float* q)
{
- const float* p1 = &_qsort_verts[(*(const int*)v1)*3];
- const float* p2 = &_qsort_verts[(*(const int*)v2)*3];
- if (p1[0] < p2[0])
- return -1;
- else if (p1[0] > p2[0])
- return 1;
- else
- return 0;
+ const float dx = q[0] - p[0];
+ const float dy = q[2] - p[2];
+ return dx*dx + dy*dy;
}
-// Based on Paul Bourke's triangulate.c
-// http://astronomy.swin.edu.au/~pbourke/terrain/triangulate/triangulate.c
-static void delaunay(const int nv, float *verts, rcIntArray& idx, rcIntArray& tris, rcIntArray& edges)
+inline float vdist2(const float* p, const float* q)
{
- // Sort vertices
- idx.resize(nv);
- for (int i = 0; i < nv; ++i)
- idx[i] = i;
- _qsort_verts = verts;
- qsort(&idx[0], idx.size(), sizeof(int), ptcmp);
-
- // Find the maximum and minimum vertex bounds.
- // This is to allow calculation of the bounding triangle
- float xmin = verts[0];
- float ymin = verts[2];
- float xmax = xmin;
- float ymax = ymin;
- for (int i = 1; i < nv; ++i)
- {
- xmin = rcMin(xmin, verts[i*3+0]);
- xmax = rcMax(xmax, verts[i*3+0]);
- ymin = rcMin(ymin, verts[i*3+2]);
- ymax = rcMax(ymax, verts[i*3+2]);
- }
- float dx = xmax - xmin;
- float dy = ymax - ymin;
- float dmax = (dx > dy) ? dx : dy;
- float xmid = (xmax + xmin) / 2.0f;
- float ymid = (ymax + ymin) / 2.0f;
-
- // Set up the supertriangle
- // This is a triangle which encompasses all the sample points.
- // The supertriangle coordinates are added to the end of the
- // vertex list. The supertriangle is the first triangle in
- // the triangle list.
- float sv[3*3];
-
- sv[0] = xmid - 20 * dmax;
- sv[1] = 0;
- sv[2] = ymid - dmax;
-
- sv[3] = xmid;
- sv[4] = 0;
- sv[5] = ymid + 20 * dmax;
-
- sv[6] = xmid + 20 * dmax;
- sv[7] = 0;
- sv[8] = ymid - dmax;
-
- tris.push(-3);
- tris.push(-2);
- tris.push(-1);
- tris.push(0); // not completed
-
- for (int i = 0; i < nv; ++i)
- {
- const float xp = verts[idx[i]*3+0];
- const float yp = verts[idx[i]*3+2];
-
- edges.resize(0);
-
- // Set up the edge buffer.
- // If the point (xp,yp) lies inside the circumcircle then the
- // three edges of that triangle are added to the edge buffer
- // and that triangle is removed.
- for (int j = 0; j < tris.size()/4; ++j)
- {
- int* t = &tris[j*4];
- if (t[3]) // completed?
- continue;
- const float* v1 = t[0] < 0 ? &sv[(t[0]+3)*3] : &verts[idx[t[0]]*3];
- const float* v2 = t[1] < 0 ? &sv[(t[1]+3)*3] : &verts[idx[t[1]]*3];
- const float* v3 = t[2] < 0 ? &sv[(t[2]+3)*3] : &verts[idx[t[2]]*3];
- float xc,yc,rsqr;
- int inside = circumCircle(xp,yp, v1[0],v1[2], v2[0],v2[2], v3[0],v3[2], xc,yc,rsqr);
- if (xc < xp && rcSqr(xp-xc) > rsqr)
- t[3] = 1;
- if (inside)
- {
- // Collect triangle edges.
- edges.push(t[0]);
- edges.push(t[1]);
- edges.push(t[1]);
- edges.push(t[2]);
- edges.push(t[2]);
- edges.push(t[0]);
- // Remove triangle j.
- t[0] = tris[tris.size()-4];
- t[1] = tris[tris.size()-3];
- t[2] = tris[tris.size()-2];
- t[3] = tris[tris.size()-1];
- tris.resize(tris.size()-4);
- j--;
- }
- }
-
- // Remove duplicate edges.
- const int ne = edges.size()/2;
- for (int j = 0; j < ne-1; ++j)
- {
- for (int k = j+1; k < ne; ++k)
- {
- // Dupe?, make null.
- if ((edges[j*2+0] == edges[k*2+1]) && (edges[j*2+1] == edges[k*2+0]))
- {
- edges[j*2+0] = 0;
- edges[j*2+1] = 0;
- edges[k*2+0] = 0;
- edges[k*2+1] = 0;
- }
- }
- }
-
- // Form new triangles for the current point
- // Skipping over any null.
- // All edges are arranged in clockwise order.
- for (int j = 0; j < ne; ++j)
- {
- if (edges[j*2+0] == edges[j*2+1]) continue;
- tris.push(edges[j*2+0]);
- tris.push(edges[j*2+1]);
- tris.push(i);
- tris.push(0); // not completed
- }
- }
-
- // Remove triangles with supertriangle vertices
- // These are triangles which have a vertex number greater than nv
- for (int i = 0; i < tris.size()/4; ++i)
- {
- int* t = &tris[i*4];
- if (t[0] < 0 || t[1] < 0 || t[2] < 0)
- {
- t[0] = tris[tris.size()-4];
- t[1] = tris[tris.size()-3];
- t[2] = tris[tris.size()-2];
- t[3] = tris[tris.size()-1];
- tris.resize(tris.size()-4);
- i--;
- }
- }
- // Triangle vertices are pointing to sorted vertices, remap indices.
- for (int i = 0; i < tris.size(); ++i)
- tris[i] = idx[tris[i]];
+ return sqrtf(vdistSq2(p,q));
}
-inline float vdot2(const float* a, const float* b)
+inline float vcross2(const float* p1, const float* p2, const float* p3)
+{
+ const float u1 = p2[0] - p1[0];
+ const float v1 = p2[2] - p1[2];
+ const float u2 = p3[0] - p1[0];
+ const float v2 = p3[2] - p1[2];
+ return u1 * v2 - v1 * u2;
+}
+
+static bool circumCircle(const float* p1, const float* p2, const float* p3,
+ float* c, float& r)
{
- return a[0]*b[0] + a[2]*b[2];
+ static const float EPS = 1e-6f;
+
+ const float cp = vcross2(p1, p2, p3);
+ if (fabsf(cp) > EPS)
+ {
+ const float p1Sq = vdot2(p1,p1);
+ const float p2Sq = vdot2(p2,p2);
+ const float p3Sq = vdot2(p3,p3);
+ c[0] = (p1Sq*(p2[2]-p3[2]) + p2Sq*(p3[2]-p1[2]) + p3Sq*(p1[2]-p2[2])) / (2*cp);
+ c[2] = (p1Sq*(p3[0]-p2[0]) + p2Sq*(p1[0]-p3[0]) + p3Sq*(p2[0]-p1[0])) / (2*cp);
+ r = vdist2(c, p1);
+ return true;
+ }
+
+ c[0] = p1[0];
+ c[2] = p1[2];
+ r = 0;
+ return false;
}
static float distPtTri(const float* p, const float* a, const float* b, const float* c)
{
float v0[3], v1[3], v2[3];
- vsub(v0, c,a);
- vsub(v1, b,a);
- vsub(v2, p,a);
+ rcVsub(v0, c,a);
+ rcVsub(v1, b,a);
+ rcVsub(v2, p,a);
const float dot00 = vdot2(v0, v0);
const float dot01 = vdot2(v0, v1);
@@ -273,15 +100,15 @@ static float distPtTri(const float* p, const float* a, const float* b, const flo
const float dot12 = vdot2(v1, v2);
// Compute barycentric coordinates
- float invDenom = 1.0f / (dot00 * dot11 - dot01 * dot01);
- float u = (dot11 * dot02 - dot01 * dot12) * invDenom;
+ const float invDenom = 1.0f / (dot00 * dot11 - dot01 * dot01);
+ const float u = (dot11 * dot02 - dot01 * dot12) * invDenom;
float v = (dot00 * dot12 - dot01 * dot02) * invDenom;
// If point lies inside the triangle, return interpolated y-coord.
static const float EPS = 1e-4f;
if (u >= -EPS && v >= -EPS && (u+v) <= 1+EPS)
{
- float y = a[1] + v0[1]*u + v1[1]*v;
+ const float y = a[1] + v0[1]*u + v1[1]*v;
return fabsf(y-p[1]);
}
return FLT_MAX;
@@ -332,7 +159,7 @@ static float distancePtSeg2d(const float* pt, const float* p, const float* q)
return dx*dx + dz*dz;
}
-static float distToTriMesh(const float* p, const float* verts, int nverts, const int* tris, int ntris)
+static float distToTriMesh(const float* p, const float* verts, const int /*nverts*/, const int* tris, const int ntris)
{
float dmin = FLT_MAX;
for (int i = 0; i < ntris; ++i)
@@ -366,35 +193,335 @@ static float distToPoly(int nvert, const float* verts, const float* p)
}
-static unsigned short getHeight(const float* pos, const float* bmin, const float ics, const rcHeightPatch& hp)
+static unsigned short getHeight(const float fx, const float fy, const float fz,
+ const float /*cs*/, const float ics, const float ch,
+ const rcHeightPatch& hp)
{
- int ix = (int)floorf((pos[0]-bmin[0])*ics + 0.01f);
- int iz = (int)floorf((pos[2]-bmin[2])*ics + 0.01f);
+ int ix = (int)floorf(fx*ics + 0.01f);
+ int iz = (int)floorf(fz*ics + 0.01f);
ix = rcClamp(ix-hp.xmin, 0, hp.width);
iz = rcClamp(iz-hp.ymin, 0, hp.height);
unsigned short h = hp.data[ix+iz*hp.width];
+ if (h == RC_UNSET_HEIGHT)
+ {
+ // Special case when data might be bad.
+ // Find nearest neighbour pixel which has valid height.
+ const int off[8*2] = { -1,0, -1,-1, 0,-1, 1,-1, 1,0, 1,1, 0,1, -1,1};
+ float dmin = FLT_MAX;
+ for (int i = 0; i < 8; ++i)
+ {
+ const int nx = ix+off[i*2+0];
+ const int nz = iz+off[i*2+1];
+ if (nx < 0 || nz < 0 || nx >= hp.width || nz >= hp.height) continue;
+ const unsigned short nh = hp.data[nx+nz*hp.width];
+ if (nh == RC_UNSET_HEIGHT) continue;
+
+ const float d = fabsf(nh*ch - fy);
+ if (d < dmin)
+ {
+ h = nh;
+ dmin = d;
+ }
+
+/* const float dx = (nx+0.5f)*cs - fx;
+ const float dz = (nz+0.5f)*cs - fz;
+ const float d = dx*dx+dz*dz;
+ if (d < dmin)
+ {
+ h = nh;
+ dmin = d;
+ } */
+ }
+ }
return h;
}
-static bool buildPolyDetail(const float* in, const int nin, unsigned short reg,
+
+enum EdgeValues
+{
+ UNDEF = -1,
+ HULL = -2,
+};
+
+static int findEdge(const int* edges, int nedges, int s, int t)
+{
+ for (int i = 0; i < nedges; i++)
+ {
+ const int* e = &edges[i*4];
+ if ((e[0] == s && e[1] == t) || (e[0] == t && e[1] == s))
+ return i;
+ }
+ return UNDEF;
+}
+
+static int addEdge(rcContext* ctx, int* edges, int& nedges, const int maxEdges, int s, int t, int l, int r)
+{
+ if (nedges >= maxEdges)
+ {
+ ctx->log(RC_LOG_ERROR, "addEdge: Too many edges (%d/%d).", nedges, maxEdges);
+ return UNDEF;
+ }
+
+ // Add edge if not already in the triangulation.
+ int e = findEdge(edges, nedges, s, t);
+ if (e == UNDEF)
+ {
+ int* e = &edges[nedges*4];
+ e[0] = s;
+ e[1] = t;
+ e[2] = l;
+ e[3] = r;
+ return nedges++;
+ }
+ else
+ {
+ return UNDEF;
+ }
+}
+
+static void updateLeftFace(int* e, int s, int t, int f)
+{
+ if (e[0] == s && e[1] == t && e[2] == UNDEF)
+ e[2] = f;
+ else if (e[1] == s && e[0] == t && e[3] == UNDEF)
+ e[3] = f;
+}
+
+static int overlapSegSeg2d(const float* a, const float* b, const float* c, const float* d)
+{
+ const float a1 = vcross2(a, b, d);
+ const float a2 = vcross2(a, b, c);
+ if (a1*a2 < 0.0f)
+ {
+ float a3 = vcross2(c, d, a);
+ float a4 = a3 + a2 - a1;
+ if (a3 * a4 < 0.0f)
+ return 1;
+ }
+ return 0;
+}
+
+static bool overlapEdges(const float* pts, const int* edges, int nedges, int s1, int t1)
+{
+ for (int i = 0; i < nedges; ++i)
+ {
+ const int s0 = edges[i*4+0];
+ const int t0 = edges[i*4+1];
+ // Same or connected edges do not overlap.
+ if (s0 == s1 || s0 == t1 || t0 == s1 || t0 == t1)
+ continue;
+ if (overlapSegSeg2d(&pts[s0*3],&pts[t0*3], &pts[s1*3],&pts[t1*3]))
+ return true;
+ }
+ return false;
+}
+
+static void completeFacet(rcContext* ctx, const float* pts, int npts, int* edges, int& nedges, const int maxEdges, int& nfaces, int e)
+{
+ static const float EPS = 1e-5f;
+
+ int* edge = &edges[e*4];
+
+ // Cache s and t.
+ int s,t;
+ if (edge[2] == UNDEF)
+ {
+ s = edge[0];
+ t = edge[1];
+ }
+ else if (edge[3] == UNDEF)
+ {
+ s = edge[1];
+ t = edge[0];
+ }
+ else
+ {
+ // Edge already completed.
+ return;
+ }
+
+ // Find best point on left of edge.
+ int pt = npts;
+ float c[3] = {0,0,0};
+ float r = -1;
+ for (int u = 0; u < npts; ++u)
+ {
+ if (u == s || u == t) continue;
+ if (vcross2(&pts[s*3], &pts[t*3], &pts[u*3]) > EPS)
+ {
+ if (r < 0)
+ {
+ // The circle is not updated yet, do it now.
+ pt = u;
+ circumCircle(&pts[s*3], &pts[t*3], &pts[u*3], c, r);
+ continue;
+ }
+ const float d = vdist2(c, &pts[u*3]);
+ const float tol = 0.001f;
+ if (d > r*(1+tol))
+ {
+ // Outside current circumcircle, skip.
+ continue;
+ }
+ else if (d < r*(1-tol))
+ {
+ // Inside safe circumcircle, update circle.
+ pt = u;
+ circumCircle(&pts[s*3], &pts[t*3], &pts[u*3], c, r);
+ }
+ else
+ {
+ // Inside epsilon circum circle, do extra tests to make sure the edge is valid.
+ // s-u and t-u cannot overlap with s-pt nor t-pt if they exists.
+ if (overlapEdges(pts, edges, nedges, s,u))
+ continue;
+ if (overlapEdges(pts, edges, nedges, t,u))
+ continue;
+ // Edge is valid.
+ pt = u;
+ circumCircle(&pts[s*3], &pts[t*3], &pts[u*3], c, r);
+ }
+ }
+ }
+
+ // Add new triangle or update edge info if s-t is on hull.
+ if (pt < npts)
+ {
+ // Update face information of edge being completed.
+ updateLeftFace(&edges[e*4], s, t, nfaces);
+
+ // Add new edge or update face info of old edge.
+ e = findEdge(edges, nedges, pt, s);
+ if (e == UNDEF)
+ addEdge(ctx, edges, nedges, maxEdges, pt, s, nfaces, UNDEF);
+ else
+ updateLeftFace(&edges[e*4], pt, s, nfaces);
+
+ // Add new edge or update face info of old edge.
+ e = findEdge(edges, nedges, t, pt);
+ if (e == UNDEF)
+ addEdge(ctx, edges, nedges, maxEdges, t, pt, nfaces, UNDEF);
+ else
+ updateLeftFace(&edges[e*4], t, pt, nfaces);
+
+ nfaces++;
+ }
+ else
+ {
+ updateLeftFace(&edges[e*4], s, t, HULL);
+ }
+}
+
+static void delaunayHull(rcContext* ctx, const int npts, const float* pts,
+ const int nhull, const int* hull,
+ rcIntArray& tris, rcIntArray& edges)
+{
+ int nfaces = 0;
+ int nedges = 0;
+ const int maxEdges = npts*10;
+ edges.resize(maxEdges*4);
+
+ for (int i = 0, j = nhull-1; i < nhull; j=i++)
+ addEdge(ctx, &edges[0], nedges, maxEdges, hull[j],hull[i], HULL, UNDEF);
+
+ int currentEdge = 0;
+ while (currentEdge < nedges)
+ {
+ if (edges[currentEdge*4+2] == UNDEF)
+ completeFacet(ctx, pts, npts, &edges[0], nedges, maxEdges, nfaces, currentEdge);
+ if (edges[currentEdge*4+3] == UNDEF)
+ completeFacet(ctx, pts, npts, &edges[0], nedges, maxEdges, nfaces, currentEdge);
+ currentEdge++;
+ }
+
+ // Create tris
+ tris.resize(nfaces*4);
+ for (int i = 0; i < nfaces*4; ++i)
+ tris[i] = -1;
+
+ for (int i = 0; i < nedges; ++i)
+ {
+ const int* e = &edges[i*4];
+ if (e[3] >= 0)
+ {
+ // Left face
+ int* t = &tris[e[3]*4];
+ if (t[0] == -1)
+ {
+ t[0] = e[0];
+ t[1] = e[1];
+ }
+ else if (t[0] == e[1])
+ t[2] = e[0];
+ else if (t[1] == e[0])
+ t[2] = e[1];
+ }
+ if (e[2] >= 0)
+ {
+ // Right
+ int* t = &tris[e[2]*4];
+ if (t[0] == -1)
+ {
+ t[0] = e[1];
+ t[1] = e[0];
+ }
+ else if (t[0] == e[0])
+ t[2] = e[1];
+ else if (t[1] == e[1])
+ t[2] = e[0];
+ }
+ }
+
+ for (int i = 0; i < tris.size()/4; ++i)
+ {
+ int* t = &tris[i*4];
+ if (t[0] == -1 || t[1] == -1 || t[2] == -1)
+ {
+ ctx->log(RC_LOG_WARNING, "delaunayHull: Removing dangling face %d [%d,%d,%d].", i, t[0],t[1],t[2]);
+ t[0] = tris[tris.size()-4];
+ t[1] = tris[tris.size()-3];
+ t[2] = tris[tris.size()-2];
+ t[3] = tris[tris.size()-1];
+ tris.resize(tris.size()-4);
+ --i;
+ }
+ }
+}
+
+
+inline float getJitterX(const int i)
+{
+ return (((i * 0x8da6b343) & 0xffff) / 65535.0f * 2.0f) - 1.0f;
+}
+
+inline float getJitterY(const int i)
+{
+ return (((i * 0xd8163841) & 0xffff) / 65535.0f * 2.0f) - 1.0f;
+}
+
+static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin,
const float sampleDist, const float sampleMaxError,
const rcCompactHeightfield& chf, const rcHeightPatch& hp,
float* verts, int& nverts, rcIntArray& tris,
- rcIntArray& edges, rcIntArray& idx, rcIntArray& samples)
+ rcIntArray& edges, rcIntArray& samples)
{
- static const int MAX_VERTS = 256;
- static const int MAX_EDGE = 64;
- float edge[(MAX_EDGE+1)*3];
+ static const int MAX_VERTS = 127;
+ static const int MAX_TRIS = 255; // Max tris for delaunay is 2n-2-k (n=num verts, k=num hull verts).
+ static const int MAX_VERTS_PER_EDGE = 32;
+ float edge[(MAX_VERTS_PER_EDGE+1)*3];
+ int hull[MAX_VERTS];
+ int nhull = 0;
nverts = 0;
for (int i = 0; i < nin; ++i)
- vcopy(&verts[i*3], &in[i*3]);
+ rcVcopy(&verts[i*3], &in[i*3]);
nverts = nin;
- const float ics = 1.0f/chf.cs;
+ const float cs = chf.cs;
+ const float ics = 1.0f/cs;
- // Tesselate outlines.
+ // Tessellate outlines.
// This is done in separate pass in order to ensure
// seamless height values across the ply boundaries.
if (sampleDist > 0)
@@ -403,17 +530,24 @@ static bool buildPolyDetail(const float* in, const int nin, unsigned short reg,
{
const float* vj = &in[j*3];
const float* vi = &in[i*3];
+ bool swapped = false;
// Make sure the segments are always handled in same order
// using lexological sort or else there will be seams.
if (fabsf(vj[0]-vi[0]) < 1e-6f)
{
if (vj[2] > vi[2])
+ {
rcSwap(vj,vi);
+ swapped = true;
+ }
}
else
{
if (vj[0] > vi[0])
+ {
rcSwap(vj,vi);
+ swapped = true;
+ }
}
// Create samples along the edge.
float dx = vi[0] - vj[0];
@@ -421,9 +555,10 @@ static bool buildPolyDetail(const float* in, const int nin, unsigned short reg,
float dz = vi[2] - vj[2];
float d = sqrtf(dx*dx + dz*dz);
int nn = 1 + (int)floorf(d/sampleDist);
- if (nn > MAX_EDGE) nn = MAX_EDGE;
+ if (nn >= MAX_VERTS_PER_EDGE) nn = MAX_VERTS_PER_EDGE-1;
if (nverts+nn >= MAX_VERTS)
nn = MAX_VERTS-1-nverts;
+
for (int k = 0; k <= nn; ++k)
{
float u = (float)k/(float)nn;
@@ -431,10 +566,10 @@ static bool buildPolyDetail(const float* in, const int nin, unsigned short reg,
pos[0] = vj[0] + dx*u;
pos[1] = vj[1] + dy*u;
pos[2] = vj[2] + dz*u;
- pos[1] = chf.bmin[1] + getHeight(pos, chf.bmin, ics, hp)*chf.ch;
+ pos[1] = getHeight(pos[0],pos[1],pos[2], cs, ics, chf.ch, hp)*chf.ch;
}
// Simplify samples.
- int idx[MAX_EDGE] = {0,nn};
+ int idx[MAX_VERTS_PER_EDGE] = {0,nn};
int nidx = 2;
for (int k = 0; k < nidx-1; )
{
@@ -468,31 +603,61 @@ static bool buildPolyDetail(const float* in, const int nin, unsigned short reg,
++k;
}
}
+
+ hull[nhull++] = j;
// Add new vertices.
- for (int k = 1; k < nidx-1; ++k)
+ if (swapped)
+ {
+ for (int k = nidx-2; k > 0; --k)
+ {
+ rcVcopy(&verts[nverts*3], &edge[idx[k]*3]);
+ hull[nhull++] = nverts;
+ nverts++;
+ }
+ }
+ else
{
- vcopy(&verts[nverts*3], &edge[idx[k]*3]);
- nverts++;
+ for (int k = 1; k < nidx-1; ++k)
+ {
+ rcVcopy(&verts[nverts*3], &edge[idx[k]*3]);
+ hull[nhull++] = nverts;
+ nverts++;
+ }
}
}
}
- // Tesselate the base mesh.
+
+ // Tessellate the base mesh.
edges.resize(0);
tris.resize(0);
- idx.resize(0);
- delaunay(nverts, verts, idx, tris, edges);
+
+ delaunayHull(ctx, nverts, verts, nhull, hull, tris, edges);
+
+ if (tris.size() == 0)
+ {
+ // Could not triangulate the poly, make sure there is some valid data there.
+ ctx->log(RC_LOG_WARNING, "buildPolyDetail: Could not triangulate polygon, adding default data.");
+ for (int i = 2; i < nverts; ++i)
+ {
+ tris.push(0);
+ tris.push(i-1);
+ tris.push(i);
+ tris.push(0);
+ }
+ return true;
+ }
if (sampleDist > 0)
{
// Create sample locations in a grid.
float bmin[3], bmax[3];
- vcopy(bmin, in);
- vcopy(bmax, in);
+ rcVcopy(bmin, in);
+ rcVcopy(bmax, in);
for (int i = 1; i < nin; ++i)
{
- vmin(bmin, &in[i*3]);
- vmax(bmax, &in[i*3]);
+ rcVmin(bmin, &in[i*3]);
+ rcVmax(bmax, &in[i*3]);
}
int x0 = (int)floorf(bmin[0]/sampleDist);
int x1 = (int)ceilf(bmax[0]/sampleDist);
@@ -505,56 +670,71 @@ static bool buildPolyDetail(const float* in, const int nin, unsigned short reg,
{
float pt[3];
pt[0] = x*sampleDist;
+ pt[1] = (bmax[1]+bmin[1])*0.5f;
pt[2] = z*sampleDist;
// Make sure the samples are not too close to the edges.
if (distToPoly(nin,in,pt) > -sampleDist/2) continue;
samples.push(x);
- samples.push(getHeight(pt, chf.bmin, ics, hp));
+ samples.push(getHeight(pt[0], pt[1], pt[2], cs, ics, chf.ch, hp));
samples.push(z);
+ samples.push(0); // Not added
}
}
// Add the samples starting from the one that has the most
// error. The procedure stops when all samples are added
// or when the max error is within treshold.
- const int nsamples = samples.size()/3;
+ const int nsamples = samples.size()/4;
for (int iter = 0; iter < nsamples; ++iter)
{
+ if (nverts >= MAX_VERTS)
+ break;
+
// Find sample with most error.
- float bestpt[3];
+ float bestpt[3] = {0,0,0};
float bestd = 0;
+ int besti = -1;
for (int i = 0; i < nsamples; ++i)
{
+ const int* s = &samples[i*4];
+ if (s[3]) continue; // skip added.
float pt[3];
- pt[0] = samples[i*3+0]*sampleDist;
- pt[1] = chf.bmin[1] + samples[i*3+1]*chf.ch;
- pt[2] = samples[i*3+2]*sampleDist;
+ // The sample location is jittered to get rid of some bad triangulations
+ // which are cause by symmetrical data from the grid structure.
+ pt[0] = s[0]*sampleDist + getJitterX(i)*cs*0.1f;
+ pt[1] = s[1]*chf.ch;
+ pt[2] = s[2]*sampleDist + getJitterY(i)*cs*0.1f;
float d = distToTriMesh(pt, verts, nverts, &tris[0], tris.size()/4);
if (d < 0) continue; // did not hit the mesh.
if (d > bestd)
{
bestd = d;
- vcopy(bestpt,pt);
+ besti = i;
+ rcVcopy(bestpt,pt);
}
}
// If the max error is within accepted threshold, stop tesselating.
- if (bestd <= sampleMaxError)
+ if (bestd <= sampleMaxError || besti == -1)
break;
-
+ // Mark sample as added.
+ samples[besti*4+3] = 1;
// Add the new sample point.
- vcopy(&verts[nverts*3],bestpt);
+ rcVcopy(&verts[nverts*3],bestpt);
nverts++;
// Create new triangulation.
// TODO: Incremental add instead of full rebuild.
edges.resize(0);
tris.resize(0);
- idx.resize(0);
- delaunay(nverts, verts, idx, tris, edges);
+ delaunayHull(ctx, nverts, verts, nhull, hull, tris, edges);
+ }
+ }
- if (nverts >= MAX_VERTS)
- break;
- }
+ const int ntris = tris.size()/4;
+ if (ntris > MAX_TRIS)
+ {
+ tris.resize(MAX_TRIS*4);
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Shrinking triangle count from %d to max %d.", ntris, MAX_TRIS);
}
return true;
@@ -562,82 +742,178 @@ static bool buildPolyDetail(const float* in, const int nin, unsigned short reg,
static void getHeightData(const rcCompactHeightfield& chf,
const unsigned short* poly, const int npoly,
- const unsigned short* verts,
+ const unsigned short* verts, const int bs,
rcHeightPatch& hp, rcIntArray& stack)
{
// Floodfill the heightfield to get 2D height data,
// starting at vertex locations as seeds.
- memset(hp.data, 0xff, sizeof(unsigned short)*hp.width*hp.height);
-
+ // Note: Reads to the compact heightfield are offset by border size (bs)
+ // since border size offset is already removed from the polymesh vertices.
+
+ memset(hp.data, 0, sizeof(unsigned short)*hp.width*hp.height);
+
stack.resize(0);
+ static const int offset[9*2] =
+ {
+ 0,0, -1,-1, 0,-1, 1,-1, 1,0, 1,1, 0,1, -1,1, -1,0,
+ };
+
// Use poly vertices as seed points for the flood fill.
for (int j = 0; j < npoly; ++j)
{
- const int ax = (int)verts[poly[j]*3+0];
- const int ay = (int)verts[poly[j]*3+1];
- const int az = (int)verts[poly[j]*3+2];
- if (ax < hp.xmin || ax >= hp.xmin+hp.width ||
- az < hp.ymin || az >= hp.ymin+hp.height)
- continue;
-
- const rcCompactCell& c = chf.cells[ax+az*chf.width];
- int dmin = 0xffff;
- int ai = -1;
- for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ int cx = 0, cz = 0, ci =-1;
+ int dmin = RC_UNSET_HEIGHT;
+ for (int k = 0; k < 9; ++k)
{
- const rcCompactSpan& s = chf.spans[i];
- int d = rcAbs(ay - (int)s.y);
- if (d < dmin)
+ const int ax = (int)verts[poly[j]*3+0] + offset[k*2+0];
+ const int ay = (int)verts[poly[j]*3+1];
+ const int az = (int)verts[poly[j]*3+2] + offset[k*2+1];
+ if (ax < hp.xmin || ax >= hp.xmin+hp.width ||
+ az < hp.ymin || az >= hp.ymin+hp.height)
+ continue;
+
+ const rcCompactCell& c = chf.cells[(ax+bs)+(az+bs)*chf.width];
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
- ai = i;
- dmin = d;
+ const rcCompactSpan& s = chf.spans[i];
+ int d = rcAbs(ay - (int)s.y);
+ if (d < dmin)
+ {
+ cx = ax;
+ cz = az;
+ ci = i;
+ dmin = d;
+ }
}
}
- if (ai != -1)
+ if (ci != -1)
{
- stack.push(ax);
- stack.push(az);
- stack.push(ai);
+ stack.push(cx);
+ stack.push(cz);
+ stack.push(ci);
}
}
-
+
+ // Find center of the polygon using flood fill.
+ int pcx = 0, pcz = 0;
+ for (int j = 0; j < npoly; ++j)
+ {
+ pcx += (int)verts[poly[j]*3+0];
+ pcz += (int)verts[poly[j]*3+2];
+ }
+ pcx /= npoly;
+ pcz /= npoly;
+
+ for (int i = 0; i < stack.size(); i += 3)
+ {
+ int cx = stack[i+0];
+ int cy = stack[i+1];
+ int idx = cx-hp.xmin+(cy-hp.ymin)*hp.width;
+ hp.data[idx] = 1;
+ }
+
while (stack.size() > 0)
{
int ci = stack.pop();
int cy = stack.pop();
int cx = stack.pop();
-
- // Skip already visited locations.
- int idx = cx-hp.xmin+(cy-hp.ymin)*hp.width;
- if (hp.data[idx] != 0xffff)
- continue;
+
+ // Check if close to center of the polygon.
+ if (rcAbs(cx-pcx) <= 1 && rcAbs(cy-pcz) <= 1)
+ {
+ stack.resize(0);
+ stack.push(cx);
+ stack.push(cy);
+ stack.push(ci);
+ break;
+ }
const rcCompactSpan& cs = chf.spans[ci];
- hp.data[idx] = cs.y;
for (int dir = 0; dir < 4; ++dir)
{
- if (rcGetCon(cs, dir) == 0xf) continue;
+ if (rcGetCon(cs, dir) == RC_NOT_CONNECTED) continue;
const int ax = cx + rcGetDirOffsetX(dir);
const int ay = cy + rcGetDirOffsetY(dir);
-
+
if (ax < hp.xmin || ax >= (hp.xmin+hp.width) ||
ay < hp.ymin || ay >= (hp.ymin+hp.height))
continue;
-
- if (hp.data[ax-hp.xmin+(ay-hp.ymin)*hp.width] != 0xffff)
+
+ if (hp.data[ax-hp.xmin+(ay-hp.ymin)*hp.width] != 0)
continue;
+
+ const int ai = (int)chf.cells[(ax+bs)+(ay+bs)*chf.width].index + rcGetCon(cs, dir);
- const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(cs, dir);
+ int idx = ax-hp.xmin+(ay-hp.ymin)*hp.width;
+ hp.data[idx] = 1;
stack.push(ax);
stack.push(ay);
stack.push(ai);
}
- }
+ }
+
+ memset(hp.data, 0xff, sizeof(unsigned short)*hp.width*hp.height);
+
+ // Mark start locations.
+ for (int i = 0; i < stack.size(); i += 3)
+ {
+ int cx = stack[i+0];
+ int cy = stack[i+1];
+ int ci = stack[i+2];
+ int idx = cx-hp.xmin+(cy-hp.ymin)*hp.width;
+ const rcCompactSpan& cs = chf.spans[ci];
+ hp.data[idx] = cs.y;
+ }
+
+ static const int RETRACT_SIZE = 256;
+ int head = 0;
+
+ while (head*3 < stack.size())
+ {
+ int cx = stack[head*3+0];
+ int cy = stack[head*3+1];
+ int ci = stack[head*3+2];
+ head++;
+ if (head >= RETRACT_SIZE)
+ {
+ head = 0;
+ if (stack.size() > RETRACT_SIZE*3)
+ memmove(&stack[0], &stack[RETRACT_SIZE*3], sizeof(int)*(stack.size()-RETRACT_SIZE*3));
+ stack.resize(stack.size()-RETRACT_SIZE*3);
+ }
+
+ const rcCompactSpan& cs = chf.spans[ci];
+ for (int dir = 0; dir < 4; ++dir)
+ {
+ if (rcGetCon(cs, dir) == RC_NOT_CONNECTED) continue;
+
+ const int ax = cx + rcGetDirOffsetX(dir);
+ const int ay = cy + rcGetDirOffsetY(dir);
+
+ if (ax < hp.xmin || ax >= (hp.xmin+hp.width) ||
+ ay < hp.ymin || ay >= (hp.ymin+hp.height))
+ continue;
+
+ if (hp.data[ax-hp.xmin+(ay-hp.ymin)*hp.width] != RC_UNSET_HEIGHT)
+ continue;
+
+ const int ai = (int)chf.cells[(ax+bs)+(ay+bs)*chf.width].index + rcGetCon(cs, dir);
+
+ const rcCompactSpan& as = chf.spans[ai];
+ int idx = ax-hp.xmin+(ay-hp.ymin)*hp.width;
+ hp.data[idx] = as.y;
+
+ stack.push(ax);
+ stack.push(ay);
+ stack.push(ai);
+ }
+ }
+
}
static unsigned char getEdgeFlags(const float* va, const float* vb,
@@ -664,51 +940,48 @@ static unsigned char getTriFlags(const float* va, const float* vb, const float*
return flags;
}
-
-
-bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& chf,
+/// @par
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// @see rcAllocPolyMeshDetail, rcPolyMesh, rcCompactHeightfield, rcPolyMeshDetail, rcConfig
+bool rcBuildPolyMeshDetail(rcContext* ctx, const rcPolyMesh& mesh, const rcCompactHeightfield& chf,
const float sampleDist, const float sampleMaxError,
rcPolyMeshDetail& dmesh)
{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_BUILD_POLYMESHDETAIL);
+
if (mesh.nverts == 0 || mesh.npolys == 0)
return true;
-
- rcTimeVal startTime = rcGetPerformanceTimer();
- rcTimeVal endTime;
-
- int vcap;
- int tcap;
-
+
const int nvp = mesh.nvp;
const float cs = mesh.cs;
const float ch = mesh.ch;
const float* orig = mesh.bmin;
+ const int borderSize = mesh.borderSize;
rcIntArray edges(64);
rcIntArray tris(512);
- rcIntArray idx(512);
rcIntArray stack(512);
rcIntArray samples(512);
float verts[256*3];
- float* poly = 0;
- int* bounds = 0;
rcHeightPatch hp;
int nPolyVerts = 0;
int maxhw = 0, maxhh = 0;
- bounds = new int[mesh.npolys*4];
+ rcScopedDelete<int> bounds = (int*)rcAlloc(sizeof(int)*mesh.npolys*4, RC_ALLOC_TEMP);
if (!bounds)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'bounds' (%d).", mesh.npolys*4);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'bounds' (%d).", mesh.npolys*4);
+ return false;
}
- poly = new float[nvp*3];
- if (!bounds)
+ rcScopedDelete<float> poly = (float*)rcAlloc(sizeof(float)*nvp*3, RC_ALLOC_TEMP);
+ if (!poly)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'poly' (%d).", nvp*3);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'poly' (%d).", nvp*3);
+ return false;
}
// Find max size for a polygon area.
@@ -725,7 +998,7 @@ bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& c
ymax = 0;
for (int j = 0; j < nvp; ++j)
{
- if(p[j] == 0xffff) break;
+ if(p[j] == RC_MESH_NULL_IDX) break;
const unsigned short* v = &mesh.verts[p[j]*3];
xmin = rcMin(xmin, (int)v[0]);
xmax = rcMax(xmax, (int)v[0]);
@@ -742,58 +1015,54 @@ bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& c
maxhh = rcMax(maxhh, ymax-ymin);
}
- hp.data = new unsigned short[maxhw*maxhh];
+ hp.data = (unsigned short*)rcAlloc(sizeof(unsigned short)*maxhw*maxhh, RC_ALLOC_TEMP);
if (!hp.data)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'hp.data' (%d).", maxhw*maxhh);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'hp.data' (%d).", maxhw*maxhh);
+ return false;
}
-
+
dmesh.nmeshes = mesh.npolys;
dmesh.nverts = 0;
dmesh.ntris = 0;
- dmesh.meshes = new unsigned short[dmesh.nmeshes*4];
+ dmesh.meshes = (unsigned int*)rcAlloc(sizeof(unsigned int)*dmesh.nmeshes*4, RC_ALLOC_PERM);
if (!dmesh.meshes)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.meshes' (%d).", dmesh.nmeshes*4);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.meshes' (%d).", dmesh.nmeshes*4);
+ return false;
}
- vcap = nPolyVerts+nPolyVerts/2;
- tcap = vcap*2;
+ int vcap = nPolyVerts+nPolyVerts/2;
+ int tcap = vcap*2;
dmesh.nverts = 0;
- dmesh.verts = new float[vcap*3];
+ dmesh.verts = (float*)rcAlloc(sizeof(float)*vcap*3, RC_ALLOC_PERM);
if (!dmesh.verts)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.verts' (%d).", vcap*3);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.verts' (%d).", vcap*3);
+ return false;
}
dmesh.ntris = 0;
- dmesh.tris = new unsigned char[tcap*4];
+ dmesh.tris = (unsigned char*)rcAlloc(sizeof(unsigned char*)*tcap*4, RC_ALLOC_PERM);
if (!dmesh.tris)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.tris' (%d).", tcap*4);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.tris' (%d).", tcap*4);
+ return false;
}
for (int i = 0; i < mesh.npolys; ++i)
{
const unsigned short* p = &mesh.polys[i*nvp*2];
- // Find polygon bounding box.
+ // Store polygon vertices for processing.
int npoly = 0;
for (int j = 0; j < nvp; ++j)
{
- if(p[j] == 0xffff) break;
+ if(p[j] == RC_MESH_NULL_IDX) break;
const unsigned short* v = &mesh.verts[p[j]*3];
- poly[j*3+0] = orig[0] + v[0]*cs;
- poly[j*3+1] = orig[1] + v[1]*ch;
- poly[j*3+2] = orig[2] + v[2]*cs;
+ poly[j*3+0] = v[0]*cs;
+ poly[j*3+1] = v[1]*ch;
+ poly[j*3+2] = v[2]*cs;
npoly++;
}
@@ -802,29 +1071,40 @@ bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& c
hp.ymin = bounds[i*4+2];
hp.width = bounds[i*4+1]-bounds[i*4+0];
hp.height = bounds[i*4+3]-bounds[i*4+2];
- getHeightData(chf, p, npoly, mesh.verts, hp, stack);
+ getHeightData(chf, p, npoly, mesh.verts, borderSize, hp, stack);
// Build detail mesh.
int nverts = 0;
- if (!buildPolyDetail(poly, npoly, mesh.regs[i],
+ if (!buildPolyDetail(ctx, poly, npoly,
sampleDist, sampleMaxError,
chf, hp, verts, nverts, tris,
- edges, idx, samples))
+ edges, samples))
{
- goto failure;
+ return false;
}
- // Offset detail vertices, unnecassary?
+ // Move detail verts to world space.
for (int j = 0; j < nverts; ++j)
- verts[j*3+1] += chf.ch;
+ {
+ verts[j*3+0] += orig[0];
+ verts[j*3+1] += orig[1] + chf.ch; // Is this offset necessary?
+ verts[j*3+2] += orig[2];
+ }
+ // Offset poly too, will be used to flag checking.
+ for (int j = 0; j < npoly; ++j)
+ {
+ poly[j*3+0] += orig[0];
+ poly[j*3+1] += orig[1];
+ poly[j*3+2] += orig[2];
+ }
// Store detail submesh.
const int ntris = tris.size()/4;
-
- dmesh.meshes[i*4+0] = dmesh.nverts;
- dmesh.meshes[i*4+1] = (unsigned short)nverts;
- dmesh.meshes[i*4+2] = dmesh.ntris;
- dmesh.meshes[i*4+3] = (unsigned short)ntris;
+
+ dmesh.meshes[i*4+0] = (unsigned int)dmesh.nverts;
+ dmesh.meshes[i*4+1] = (unsigned int)nverts;
+ dmesh.meshes[i*4+2] = (unsigned int)dmesh.ntris;
+ dmesh.meshes[i*4+3] = (unsigned int)ntris;
// Store vertices, allocate more memory if necessary.
if (dmesh.nverts+nverts > vcap)
@@ -832,16 +1112,15 @@ bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& c
while (dmesh.nverts+nverts > vcap)
vcap += 256;
- float* newv = new float[vcap*3];
+ float* newv = (float*)rcAlloc(sizeof(float)*vcap*3, RC_ALLOC_PERM);
if (!newv)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'newv' (%d).", vcap*3);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'newv' (%d).", vcap*3);
+ return false;
}
if (dmesh.nverts)
memcpy(newv, dmesh.verts, sizeof(float)*3*dmesh.nverts);
- delete [] dmesh.verts;
+ rcFree(dmesh.verts);
dmesh.verts = newv;
}
for (int j = 0; j < nverts; ++j)
@@ -857,16 +1136,15 @@ bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& c
{
while (dmesh.ntris+ntris > tcap)
tcap += 256;
- unsigned char* newt = new unsigned char[tcap*4];
+ unsigned char* newt = (unsigned char*)rcAlloc(sizeof(unsigned char)*tcap*4, RC_ALLOC_PERM);
if (!newt)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'newt' (%d).", tcap*4);
- goto failure;
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'newt' (%d).", tcap*4);
+ return false;
}
if (dmesh.ntris)
memcpy(newt, dmesh.tris, sizeof(unsigned char)*4*dmesh.ntris);
- delete [] dmesh.tris;
+ rcFree(dmesh.tris);
dmesh.tris = newt;
}
for (int j = 0; j < ntris; ++j)
@@ -879,29 +1157,19 @@ bool rcBuildPolyMeshDetail(const rcPolyMesh& mesh, const rcCompactHeightfield& c
dmesh.ntris++;
}
}
-
- delete [] bounds;
- delete [] poly;
-
- endTime = rcGetPerformanceTimer();
-
- if (rcGetBuildTimes())
- rcGetBuildTimes()->buildDetailMesh += rcGetDeltaTimeUsec(startTime, endTime);
+
+ ctx->stopTimer(RC_TIMER_BUILD_POLYMESHDETAIL);
return true;
-
-failure:
-
- delete [] bounds;
- delete [] poly;
-
- return false;
}
-bool rcMergePolyMeshDetails(rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh)
+/// @see rcAllocPolyMeshDetail, rcPolyMeshDetail
+bool rcMergePolyMeshDetails(rcContext* ctx, rcPolyMeshDetail** meshes, const int nmeshes, rcPolyMeshDetail& mesh)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+ ctx->startTimer(RC_TIMER_MERGE_POLYMESHDETAIL);
+
int maxVerts = 0;
int maxTris = 0;
int maxMeshes = 0;
@@ -915,29 +1183,26 @@ bool rcMergePolyMeshDetails(rcPolyMeshDetail** meshes, const int nmeshes, rcPoly
}
mesh.nmeshes = 0;
- mesh.meshes = new unsigned short[maxMeshes*4];
+ mesh.meshes = (unsigned int*)rcAlloc(sizeof(unsigned int)*maxMeshes*4, RC_ALLOC_PERM);
if (!mesh.meshes)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'pmdtl.meshes' (%d).", maxMeshes*4);
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'pmdtl.meshes' (%d).", maxMeshes*4);
return false;
}
mesh.ntris = 0;
- mesh.tris = new unsigned char[maxTris*4];
+ mesh.tris = (unsigned char*)rcAlloc(sizeof(unsigned char)*maxTris*4, RC_ALLOC_PERM);
if (!mesh.tris)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.tris' (%d).", maxTris*4);
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.tris' (%d).", maxTris*4);
return false;
}
mesh.nverts = 0;
- mesh.verts = new float[maxVerts*3];
+ mesh.verts = (float*)rcAlloc(sizeof(float)*maxVerts*3, RC_ALLOC_PERM);
if (!mesh.verts)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.verts' (%d).", maxVerts*3);
+ ctx->log(RC_LOG_ERROR, "rcBuildPolyMeshDetail: Out of memory 'dmesh.verts' (%d).", maxVerts*3);
return false;
}
@@ -948,18 +1213,18 @@ bool rcMergePolyMeshDetails(rcPolyMeshDetail** meshes, const int nmeshes, rcPoly
if (!dm) continue;
for (int j = 0; j < dm->nmeshes; ++j)
{
- unsigned short* dst = &mesh.meshes[mesh.nmeshes*4];
- unsigned short* src = &dm->meshes[j*4];
- dst[0] = mesh.nverts+src[0];
+ unsigned int* dst = &mesh.meshes[mesh.nmeshes*4];
+ unsigned int* src = &dm->meshes[j*4];
+ dst[0] = (unsigned int)mesh.nverts+src[0];
dst[1] = src[1];
- dst[2] = mesh.ntris+src[2];
+ dst[2] = (unsigned int)mesh.ntris+src[2];
dst[3] = src[3];
mesh.nmeshes++;
}
for (int k = 0; k < dm->nverts; ++k)
{
- vcopy(&mesh.verts[mesh.nverts*3], &dm->verts[k*3]);
+ rcVcopy(&mesh.verts[mesh.nverts*3], &dm->verts[k*3]);
mesh.nverts++;
}
for (int k = 0; k < dm->ntris; ++k)
@@ -972,10 +1237,7 @@ bool rcMergePolyMeshDetails(rcPolyMeshDetail** meshes, const int nmeshes, rcPoly
}
}
- rcTimeVal endTime = rcGetPerformanceTimer();
-
- if (rcGetBuildTimes())
- rcGetBuildTimes()->mergePolyMeshDetail += rcGetDeltaTimeUsec(startTime, endTime);
+ ctx->stopTimer(RC_TIMER_MERGE_POLYMESHDETAIL);
return true;
}
diff --git a/extern/recastnavigation/Recast/Source/RecastRasterization.cpp b/extern/recastnavigation/Recast/Source/RecastRasterization.cpp
index 658b0e1fb51..d2bb7c98f18 100644
--- a/extern/recastnavigation/Recast/Source/RecastRasterization.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastRasterization.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -20,8 +20,8 @@
#include <math.h>
#include <stdio.h>
#include "Recast.h"
-#include "RecastTimer.h"
-#include "RecastLog.h"
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
inline bool overlapBounds(const float* amin, const float* amax, const float* bmin, const float* bmax)
{
@@ -48,8 +48,7 @@ static rcSpan* allocSpan(rcHeightfield& hf)
{
// Create new page.
// Allocate memory for the new pool.
- const int size = (sizeof(rcSpanPool)-sizeof(rcSpan)) + sizeof(rcSpan)*RC_SPANS_PER_POOL;
- rcSpanPool* pool = reinterpret_cast<rcSpanPool*>(new unsigned char[size]);
+ rcSpanPool* pool = (rcSpanPool*)rcAlloc(sizeof(rcSpanPool), RC_ALLOC_PERM);
if (!pool) return 0;
pool->next = 0;
// Add the pool into the list of pools.
@@ -83,16 +82,17 @@ static void freeSpan(rcHeightfield& hf, rcSpan* ptr)
hf.freelist = ptr;
}
-static void addSpan(rcHeightfield& hf, int x, int y,
- unsigned short smin, unsigned short smax,
- unsigned short flags)
+static void addSpan(rcHeightfield& hf, const int x, const int y,
+ const unsigned short smin, const unsigned short smax,
+ const unsigned char area, const int flagMergeThr)
{
+
int idx = x + y*hf.width;
rcSpan* s = allocSpan(hf);
s->smin = smin;
s->smax = smax;
- s->flags = flags;
+ s->area = area;
s->next = 0;
// Empty cell, add he first span.
@@ -127,9 +127,8 @@ static void addSpan(rcHeightfield& hf, int x, int y,
s->smax = cur->smax;
// Merge flags.
-// if (s->smax == cur->smax)
- if (rcAbs((int)s->smax - (int)cur->smax) <= 1)
- s->flags |= cur->flags;
+ if (rcAbs((int)s->smax - (int)cur->smax) <= flagMergeThr)
+ s->area = rcMax(s->area, cur->area);
// Remove current span.
rcSpan* next = cur->next;
@@ -155,6 +154,21 @@ static void addSpan(rcHeightfield& hf, int x, int y,
}
}
+/// @par
+///
+/// The span addition can be set to favor flags. If the span is merged to
+/// another span and the new @p smax is within @p flagMergeThr units
+/// from the existing span, the span flags are merged.
+///
+/// @see rcHeightfield, rcSpan.
+void rcAddSpan(rcContext* /*ctx*/, rcHeightfield& hf, const int x, const int y,
+ const unsigned short smin, const unsigned short smax,
+ const unsigned char area, const int flagMergeThr)
+{
+// rcAssert(ctx);
+ addSpan(hf, x,y, smin, smax, area, flagMergeThr);
+}
+
static int clipPoly(const float* in, int n, float* out, float pnx, float pnz, float pd)
{
float d[12];
@@ -186,9 +200,10 @@ static int clipPoly(const float* in, int n, float* out, float pnx, float pnz, fl
}
static void rasterizeTri(const float* v0, const float* v1, const float* v2,
- unsigned char flags, rcHeightfield& hf,
+ const unsigned char area, rcHeightfield& hf,
const float* bmin, const float* bmax,
- const float cs, const float ics, const float ich)
+ const float cs, const float ics, const float ich,
+ const int flagMergeThr)
{
const int w = hf.width;
const int h = hf.height;
@@ -196,12 +211,12 @@ static void rasterizeTri(const float* v0, const float* v1, const float* v2,
const float by = bmax[1] - bmin[1];
// Calculate the bounding box of the triangle.
- vcopy(tmin, v0);
- vcopy(tmax, v0);
- vmin(tmin, v1);
- vmin(tmin, v2);
- vmax(tmax, v1);
- vmax(tmax, v2);
+ rcVcopy(tmin, v0);
+ rcVcopy(tmax, v0);
+ rcVmin(tmin, v1);
+ rcVmin(tmin, v2);
+ rcVmax(tmax, v1);
+ rcVmax(tmax, v2);
// If the triangle does not touch the bbox of the heightfield, skip the triagle.
if (!overlapBounds(bmin, bmax, tmin, tmax))
@@ -223,9 +238,9 @@ static void rasterizeTri(const float* v0, const float* v1, const float* v2,
for (int y = y0; y <= y1; ++y)
{
// Clip polygon to row.
- vcopy(&in[0], v0);
- vcopy(&in[1*3], v1);
- vcopy(&in[2*3], v2);
+ rcVcopy(&in[0], v0);
+ rcVcopy(&in[1*3], v1);
+ rcVcopy(&in[2*3], v2);
int nvrow = 3;
const float cz = bmin[2] + y*cs;
nvrow = clipPoly(in, nvrow, out, 0, 1, -cz);
@@ -256,38 +271,78 @@ static void rasterizeTri(const float* v0, const float* v1, const float* v2,
if (smax < 0.0f) continue;
if (smin > by) continue;
// Clamp the span to the heightfield bbox.
- if (smin < 0.0f) smin = bmin[1];
- if (smax > by) smax = bmax[1];
+ if (smin < 0.0f) smin = 0;
+ if (smax > by) smax = by;
// Snap the span to the heightfield height grid.
- unsigned short ismin = (unsigned short)rcClamp((int)floorf(smin * ich), 0, 0x7fff);
- unsigned short ismax = (unsigned short)rcClamp((int)ceilf(smax * ich), 0, 0x7fff);
+ unsigned short ismin = (unsigned short)rcClamp((int)floorf(smin * ich), 0, RC_SPAN_MAX_HEIGHT);
+ unsigned short ismax = (unsigned short)rcClamp((int)ceilf(smax * ich), (int)ismin+1, RC_SPAN_MAX_HEIGHT);
- addSpan(hf, x, y, ismin, ismax, flags);
+ addSpan(hf, x, y, ismin, ismax, area, flagMergeThr);
}
}
}
-void rcRasterizeTriangle(const float* v0, const float* v1, const float* v2,
- unsigned char flags, rcHeightfield& solid)
+/// @par
+///
+/// No spans will be added if the triangle does not overlap the heightfield grid.
+///
+/// @see rcHeightfield
+void rcRasterizeTriangle(rcContext* ctx, const float* v0, const float* v1, const float* v2,
+ const unsigned char area, rcHeightfield& solid,
+ const int flagMergeThr)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES);
const float ics = 1.0f/solid.cs;
const float ich = 1.0f/solid.ch;
- rasterizeTri(v0, v1, v2, flags, solid, solid.bmin, solid.bmax, solid.cs, ics, ich);
+ rasterizeTri(v0, v1, v2, area, solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr);
+
+ ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES);
+}
+
+/// @par
+///
+/// Spans will only be added for triangles that overlap the heightfield grid.
+///
+/// @see rcHeightfield
+void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int /*nv*/,
+ const int* tris, const unsigned char* areas, const int nt,
+ rcHeightfield& solid, const int flagMergeThr)
+{
+ rcAssert(ctx);
- rcTimeVal endTime = rcGetPerformanceTimer();
+ ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES);
+
+ const float ics = 1.0f/solid.cs;
+ const float ich = 1.0f/solid.ch;
+ // Rasterize triangles.
+ for (int i = 0; i < nt; ++i)
+ {
+ const float* v0 = &verts[tris[i*3+0]*3];
+ const float* v1 = &verts[tris[i*3+1]*3];
+ const float* v2 = &verts[tris[i*3+2]*3];
+ // Rasterize.
+ rasterizeTri(v0, v1, v2, areas[i], solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr);
+ }
- if (rcGetBuildTimes())
- rcGetBuildTimes()->rasterizeTriangles += rcGetDeltaTimeUsec(startTime, endTime);
+ ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES);
}
-
-void rcRasterizeTriangles(const float* verts, int nv,
- const int* tris, const unsigned char* flags, int nt,
- rcHeightfield& solid)
+
+/// @par
+///
+/// Spans will only be added for triangles that overlap the heightfield grid.
+///
+/// @see rcHeightfield
+void rcRasterizeTriangles(rcContext* ctx, const float* verts, const int /*nv*/,
+ const unsigned short* tris, const unsigned char* areas, const int nt,
+ rcHeightfield& solid, const int flagMergeThr)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES);
const float ics = 1.0f/solid.cs;
const float ich = 1.0f/solid.ch;
@@ -298,11 +353,35 @@ void rcRasterizeTriangles(const float* verts, int nv,
const float* v1 = &verts[tris[i*3+1]*3];
const float* v2 = &verts[tris[i*3+2]*3];
// Rasterize.
- rasterizeTri(v0, v1, v2, flags[i], solid, solid.bmin, solid.bmax, solid.cs, ics, ich);
+ rasterizeTri(v0, v1, v2, areas[i], solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr);
}
- rcTimeVal endTime = rcGetPerformanceTimer();
+ ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES);
+}
- if (rcGetBuildTimes())
- rcGetBuildTimes()->rasterizeTriangles += rcGetDeltaTimeUsec(startTime, endTime);
+/// @par
+///
+/// Spans will only be added for triangles that overlap the heightfield grid.
+///
+/// @see rcHeightfield
+void rcRasterizeTriangles(rcContext* ctx, const float* verts, const unsigned char* areas, const int nt,
+ rcHeightfield& solid, const int flagMergeThr)
+{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_RASTERIZE_TRIANGLES);
+
+ const float ics = 1.0f/solid.cs;
+ const float ich = 1.0f/solid.ch;
+ // Rasterize triangles.
+ for (int i = 0; i < nt; ++i)
+ {
+ const float* v0 = &verts[(i*3+0)*3];
+ const float* v1 = &verts[(i*3+1)*3];
+ const float* v2 = &verts[(i*3+2)*3];
+ // Rasterize.
+ rasterizeTri(v0, v1, v2, areas[i], solid, solid.bmin, solid.bmax, solid.cs, ics, ich, flagMergeThr);
+ }
+
+ ctx->stopTimer(RC_TIMER_RASTERIZE_TRIANGLES);
}
diff --git a/extern/recastnavigation/Recast/Source/RecastRegion.cpp b/extern/recastnavigation/Recast/Source/RecastRegion.cpp
index 5c557cf0681..4290972ed24 100644
--- a/extern/recastnavigation/Recast/Source/RecastRegion.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastRegion.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2009 Mikko Mononen memon@inside.org
+// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -23,13 +23,12 @@
#include <stdlib.h>
#include <stdio.h>
#include "Recast.h"
-#include "RecastLog.h"
-#include "RecastTimer.h"
+#include "RecastAlloc.h"
+#include "RecastAssert.h"
+#include <new>
-static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
- unsigned short* src, unsigned short* dst,
- unsigned short& maxDist)
+static void calculateDistanceField(rcCompactHeightfield& chf, unsigned short* src, unsigned short& maxDist)
{
const int w = chf.width;
const int h = chf.height;
@@ -47,11 +46,19 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
const rcCompactSpan& s = chf.spans[i];
+ const unsigned char area = chf.areas[i];
+
int nc = 0;
for (int dir = 0; dir < 4; ++dir)
{
- if (rcGetCon(s, dir) != 0xf)
- nc++;
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
+ {
+ const int ax = x + rcGetDirOffsetX(dir);
+ const int ay = y + rcGetDirOffsetY(dir);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir);
+ if (area == chf.areas[ai])
+ nc++;
+ }
}
if (nc != 4)
src[i] = 0;
@@ -59,6 +66,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
}
}
+
// Pass 1
for (int y = 0; y < h; ++y)
{
@@ -69,7 +77,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
{
const rcCompactSpan& s = chf.spans[i];
- if (rcGetCon(s, 0) != 0xf)
+ if (rcGetCon(s, 0) != RC_NOT_CONNECTED)
{
// (-1,0)
const int ax = x + rcGetDirOffsetX(0);
@@ -80,7 +88,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
src[i] = src[ai]+2;
// (-1,-1)
- if (rcGetCon(as, 3) != 0xf)
+ if (rcGetCon(as, 3) != RC_NOT_CONNECTED)
{
const int aax = ax + rcGetDirOffsetX(3);
const int aay = ay + rcGetDirOffsetY(3);
@@ -89,7 +97,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
src[i] = src[aai]+3;
}
}
- if (rcGetCon(s, 3) != 0xf)
+ if (rcGetCon(s, 3) != RC_NOT_CONNECTED)
{
// (0,-1)
const int ax = x + rcGetDirOffsetX(3);
@@ -100,7 +108,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
src[i] = src[ai]+2;
// (1,-1)
- if (rcGetCon(as, 2) != 0xf)
+ if (rcGetCon(as, 2) != RC_NOT_CONNECTED)
{
const int aax = ax + rcGetDirOffsetX(2);
const int aay = ay + rcGetDirOffsetY(2);
@@ -123,7 +131,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
{
const rcCompactSpan& s = chf.spans[i];
- if (rcGetCon(s, 2) != 0xf)
+ if (rcGetCon(s, 2) != RC_NOT_CONNECTED)
{
// (1,0)
const int ax = x + rcGetDirOffsetX(2);
@@ -134,7 +142,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
src[i] = src[ai]+2;
// (1,1)
- if (rcGetCon(as, 1) != 0xf)
+ if (rcGetCon(as, 1) != RC_NOT_CONNECTED)
{
const int aax = ax + rcGetDirOffsetX(1);
const int aay = ay + rcGetDirOffsetY(1);
@@ -143,7 +151,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
src[i] = src[aai]+3;
}
}
- if (rcGetCon(s, 1) != 0xf)
+ if (rcGetCon(s, 1) != RC_NOT_CONNECTED)
{
// (0,1)
const int ax = x + rcGetDirOffsetX(1);
@@ -154,7 +162,7 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
src[i] = src[ai]+2;
// (-1,1)
- if (rcGetCon(as, 0) != 0xf)
+ if (rcGetCon(as, 0) != RC_NOT_CONNECTED)
{
const int aax = ax + rcGetDirOffsetX(0);
const int aay = ay + rcGetDirOffsetY(0);
@@ -171,8 +179,6 @@ static unsigned short* calculateDistanceField(rcCompactHeightfield& chf,
for (int i = 0; i < chf.spanCount; ++i)
maxDist = rcMax(src[i], maxDist);
- return src;
-
}
static unsigned short* boxBlur(rcCompactHeightfield& chf, int thr,
@@ -191,17 +197,17 @@ static unsigned short* boxBlur(rcCompactHeightfield& chf, int thr,
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
const rcCompactSpan& s = chf.spans[i];
- int cd = (int)src[i];
+ const unsigned short cd = src[i];
if (cd <= thr)
{
dst[i] = cd;
continue;
}
- int d = cd;
+ int d = (int)cd;
for (int dir = 0; dir < 4; ++dir)
{
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
@@ -210,7 +216,7 @@ static unsigned short* boxBlur(rcCompactHeightfield& chf, int thr,
const rcCompactSpan& as = chf.spans[ai];
const int dir2 = (dir+1) & 0x3;
- if (rcGetCon(as, dir2) != 0xf)
+ if (rcGetCon(as, dir2) != RC_NOT_CONNECTED)
{
const int ax2 = ax + rcGetDirOffsetX(dir2);
const int ay2 = ay + rcGetDirOffsetY(dir2);
@@ -236,22 +242,24 @@ static unsigned short* boxBlur(rcCompactHeightfield& chf, int thr,
static bool floodRegion(int x, int y, int i,
- unsigned short level, unsigned short minLevel, unsigned short r,
+ unsigned short level, unsigned short r,
rcCompactHeightfield& chf,
- unsigned short* src,
+ unsigned short* srcReg, unsigned short* srcDist,
rcIntArray& stack)
{
const int w = chf.width;
+ const unsigned char area = chf.areas[i];
+
// Flood fill mark region.
stack.resize(0);
stack.push((int)x);
stack.push((int)y);
stack.push((int)i);
- src[i*2] = r;
- src[i*2+1] = 0;
+ srcReg[i] = r;
+ srcDist[i] = 0;
- unsigned short lev = level >= minLevel+2 ? level-2 : minLevel;
+ unsigned short lev = level >= 2 ? level-2 : 0;
int count = 0;
while (stack.size() > 0)
@@ -267,25 +275,30 @@ static bool floodRegion(int x, int y, int i,
for (int dir = 0; dir < 4; ++dir)
{
// 8 connected
- if (rcGetCon(cs, dir) != 0xf)
+ if (rcGetCon(cs, dir) != RC_NOT_CONNECTED)
{
const int ax = cx + rcGetDirOffsetX(dir);
const int ay = cy + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(cs, dir);
- unsigned short nr = src[ai*2];
+ if (chf.areas[ai] != area)
+ continue;
+ unsigned short nr = srcReg[ai];
+ if (nr & RC_BORDER_REG) // Do not take borders into account.
+ continue;
if (nr != 0 && nr != r)
ar = nr;
const rcCompactSpan& as = chf.spans[ai];
const int dir2 = (dir+1) & 0x3;
- if (rcGetCon(as, dir2) != 0xf)
+ if (rcGetCon(as, dir2) != RC_NOT_CONNECTED)
{
const int ax2 = ax + rcGetDirOffsetX(dir2);
const int ay2 = ay + rcGetDirOffsetY(dir2);
const int ai2 = (int)chf.cells[ax2+ay2*w].index + rcGetCon(as, dir2);
-
- unsigned short nr = src[ai2*2];
+ if (chf.areas[ai2] != area)
+ continue;
+ unsigned short nr = srcReg[ai2];
if (nr != 0 && nr != r)
ar = nr;
}
@@ -293,7 +306,7 @@ static bool floodRegion(int x, int y, int i,
}
if (ar != 0)
{
- src[ci*2] = 0;
+ srcReg[ci] = 0;
continue;
}
count++;
@@ -301,21 +314,20 @@ static bool floodRegion(int x, int y, int i,
// Expand neighbours.
for (int dir = 0; dir < 4; ++dir)
{
- if (rcGetCon(cs, dir) != 0xf)
+ if (rcGetCon(cs, dir) != RC_NOT_CONNECTED)
{
const int ax = cx + rcGetDirOffsetX(dir);
const int ay = cy + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(cs, dir);
- if (chf.spans[ai].dist >= lev)
+ if (chf.areas[ai] != area)
+ continue;
+ if (chf.dist[ai] >= lev && srcReg[ai] == 0)
{
- if (src[ai*2] == 0)
- {
- src[ai*2] = r;
- src[ai*2+1] = 0;
- stack.push(ax);
- stack.push(ay);
- stack.push(ai);
- }
+ srcReg[ai] = r;
+ srcDist[ai] = 0;
+ stack.push(ax);
+ stack.push(ay);
+ stack.push(ai);
}
}
}
@@ -326,8 +338,8 @@ static bool floodRegion(int x, int y, int i,
static unsigned short* expandRegions(int maxIter, unsigned short level,
rcCompactHeightfield& chf,
- unsigned short* src,
- unsigned short* dst,
+ unsigned short* srcReg, unsigned short* srcDist,
+ unsigned short* dstReg, unsigned short* dstDist,
rcIntArray& stack)
{
const int w = chf.width;
@@ -342,7 +354,7 @@ static unsigned short* expandRegions(int maxIter, unsigned short level,
const rcCompactCell& c = chf.cells[x+y*w];
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
- if (chf.spans[i].dist >= level && src[i*2] == 0)
+ if (chf.dist[i] >= level && srcReg[i] == 0 && chf.areas[i] != RC_NULL_AREA)
{
stack.push(x);
stack.push(y);
@@ -357,7 +369,8 @@ static unsigned short* expandRegions(int maxIter, unsigned short level,
{
int failed = 0;
- memcpy(dst, src, sizeof(unsigned short)*chf.spanCount*2);
+ memcpy(dstReg, srcReg, sizeof(unsigned short)*chf.spanCount);
+ memcpy(dstDist, srcDist, sizeof(unsigned short)*chf.spanCount);
for (int j = 0; j < stack.size(); j += 3)
{
@@ -370,29 +383,31 @@ static unsigned short* expandRegions(int maxIter, unsigned short level,
continue;
}
- unsigned short r = src[i*2];
+ unsigned short r = srcReg[i];
unsigned short d2 = 0xffff;
+ const unsigned char area = chf.areas[i];
const rcCompactSpan& s = chf.spans[i];
for (int dir = 0; dir < 4; ++dir)
{
- if (rcGetCon(s, dir) == 0xf) continue;
+ if (rcGetCon(s, dir) == RC_NOT_CONNECTED) continue;
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, dir);
- if (src[ai*2] > 0 && (src[ai*2] & RC_BORDER_REG) == 0)
+ if (chf.areas[ai] != area) continue;
+ if (srcReg[ai] > 0 && (srcReg[ai] & RC_BORDER_REG) == 0)
{
- if ((int)src[ai*2+1]+2 < (int)d2)
+ if ((int)srcDist[ai]+2 < (int)d2)
{
- r = src[ai*2];
- d2 = src[ai*2+1]+2;
+ r = srcReg[ai];
+ d2 = srcDist[ai]+2;
}
}
}
if (r)
{
stack[j+2] = -1; // mark as used
- dst[i*2] = r;
- dst[i*2+1] = d2;
+ dstReg[i] = r;
+ dstDist[i] = d2;
}
else
{
@@ -401,7 +416,8 @@ static unsigned short* expandRegions(int maxIter, unsigned short level,
}
// rcSwap source and dest.
- rcSwap(src, dst);
+ rcSwap(srcReg, dstReg);
+ rcSwap(srcDist, dstDist);
if (failed*3 == stack.size())
break;
@@ -414,17 +430,25 @@ static unsigned short* expandRegions(int maxIter, unsigned short level,
}
}
- return src;
+ return srcReg;
}
struct rcRegion
{
- inline rcRegion() : count(0), id(0), remap(false) {}
+ inline rcRegion(unsigned short i) :
+ spanCount(0),
+ id(i),
+ areaType(0),
+ remap(false),
+ visited(false)
+ {}
- int count;
- unsigned short id;
+ int spanCount; // Number of spans belonging to this region
+ unsigned short id; // ID of the region
+ unsigned char areaType; // Are type.
bool remap;
+ bool visited;
rcIntArray connections;
rcIntArray floors;
};
@@ -467,25 +491,27 @@ static void replaceNeighbour(rcRegion& reg, unsigned short oldId, unsigned short
removeAdjacentNeighbours(reg);
}
-static bool canMergeWithRegion(rcRegion& reg, unsigned short id)
+static bool canMergeWithRegion(const rcRegion& rega, const rcRegion& regb)
{
+ if (rega.areaType != regb.areaType)
+ return false;
int n = 0;
- for (int i = 0; i < reg.connections.size(); ++i)
+ for (int i = 0; i < rega.connections.size(); ++i)
{
- if (reg.connections[i] == id)
+ if (rega.connections[i] == regb.id)
n++;
}
if (n > 1)
return false;
- for (int i = 0; i < reg.floors.size(); ++i)
+ for (int i = 0; i < rega.floors.size(); ++i)
{
- if (reg.floors[i] == id)
+ if (rega.floors[i] == regb.id)
return false;
}
return true;
}
-static void addUniqueFloorRegion(rcRegion& reg, unsigned short n)
+static void addUniqueFloorRegion(rcRegion& reg, int n)
{
for (int i = 0; i < reg.floors.size(); ++i)
if (reg.floors[i] == n)
@@ -543,8 +569,8 @@ static bool mergeRegions(rcRegion& rega, rcRegion& regb)
for (int j = 0; j < regb.floors.size(); ++j)
addUniqueFloorRegion(rega, regb.floors[j]);
- rega.count += regb.count;
- regb.count = 0;
+ rega.spanCount += regb.spanCount;
+ regb.spanCount = 0;
regb.connections.resize(0);
return true;
@@ -562,26 +588,26 @@ static bool isRegionConnectedToBorder(const rcRegion& reg)
return false;
}
-static bool isSolidEdge(rcCompactHeightfield& chf, unsigned short* src,
+static bool isSolidEdge(rcCompactHeightfield& chf, unsigned short* srcReg,
int x, int y, int i, int dir)
{
const rcCompactSpan& s = chf.spans[i];
unsigned short r = 0;
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir);
- r = src[ai*2];
+ r = srcReg[ai];
}
- if (r == src[i*2])
+ if (r == srcReg[i])
return false;
return true;
}
static void walkContour(int x, int y, int i, int dir,
rcCompactHeightfield& chf,
- unsigned short* src,
+ unsigned short* srcReg,
rcIntArray& cont)
{
int startDir = dir;
@@ -589,12 +615,12 @@ static void walkContour(int x, int y, int i, int dir,
const rcCompactSpan& ss = chf.spans[i];
unsigned short curReg = 0;
- if (rcGetCon(ss, dir) != 0xf)
+ if (rcGetCon(ss, dir) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(ss, dir);
- curReg = src[ai*2];
+ curReg = srcReg[ai];
}
cont.push(curReg);
@@ -603,16 +629,16 @@ static void walkContour(int x, int y, int i, int dir,
{
const rcCompactSpan& s = chf.spans[i];
- if (isSolidEdge(chf, src, x, y, i, dir))
+ if (isSolidEdge(chf, srcReg, x, y, i, dir))
{
// Choose the edge corner
unsigned short r = 0;
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const int ax = x + rcGetDirOffsetX(dir);
const int ay = y + rcGetDirOffsetY(dir);
const int ai = (int)chf.cells[ax+ay*chf.width].index + rcGetCon(s, dir);
- r = src[ai*2];
+ r = srcReg[ai];
}
if (r != curReg)
{
@@ -627,7 +653,7 @@ static void walkContour(int x, int y, int i, int dir,
int ni = -1;
const int nx = x + rcGetDirOffsetX(dir);
const int ny = y + rcGetDirOffsetY(dir);
- if (rcGetCon(s, dir) != 0xf)
+ if (rcGetCon(s, dir) != RC_NOT_CONNECTED)
{
const rcCompactCell& nc = chf.cells[nx+ny*chf.width];
ni = (int)nc.index + rcGetCon(s, dir);
@@ -667,26 +693,26 @@ static void walkContour(int x, int y, int i, int dir,
}
}
-static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
+static bool filterSmallRegions(rcContext* ctx, int minRegionArea, int mergeRegionSize,
unsigned short& maxRegionId,
rcCompactHeightfield& chf,
- unsigned short* src)
+ unsigned short* srcReg)
{
const int w = chf.width;
const int h = chf.height;
-
- int nreg = maxRegionId+1;
- rcRegion* regions = new rcRegion[nreg];
+
+ const int nreg = maxRegionId+1;
+ rcRegion* regions = (rcRegion*)rcAlloc(sizeof(rcRegion)*nreg, RC_ALLOC_TEMP);
if (!regions)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "filterSmallRegions: Out of memory 'regions' (%d).", nreg);
+ ctx->log(RC_LOG_ERROR, "filterSmallRegions: Out of memory 'regions' (%d).", nreg);
return false;
}
-
- for (int i = 0; i < nreg; ++i)
- regions[i].id = (unsigned short)i;
+ // Construct regions
+ for (int i = 0; i < nreg; ++i)
+ new(&regions[i]) rcRegion((unsigned short)i);
+
// Find edge of a region and find connections around the contour.
for (int y = 0; y < h; ++y)
{
@@ -695,19 +721,19 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
const rcCompactCell& c = chf.cells[x+y*w];
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
- unsigned short r = src[i*2];
+ unsigned short r = srcReg[i];
if (r == 0 || r >= nreg)
continue;
rcRegion& reg = regions[r];
- reg.count++;
+ reg.spanCount++;
+
-
// Update floors.
for (int j = (int)c.index; j < ni; ++j)
{
if (i == j) continue;
- unsigned short floorId = src[j*2];
+ unsigned short floorId = srcReg[j];
if (floorId == 0 || floorId >= nreg)
continue;
addUniqueFloorRegion(reg, floorId);
@@ -717,11 +743,13 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
if (reg.connections.size() > 0)
continue;
+ reg.areaType = chf.areas[i];
+
// Check if this cell is next to a border.
int ndir = -1;
for (int dir = 0; dir < 4; ++dir)
{
- if (isSolidEdge(chf, src, x, y, i, dir))
+ if (isSolidEdge(chf, srcReg, x, y, i, dir))
{
ndir = dir;
break;
@@ -732,32 +760,77 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
{
// The cell is at border.
// Walk around the contour to find all the neighbours.
- walkContour(x, y, i, ndir, chf, src, reg.connections);
+ walkContour(x, y, i, ndir, chf, srcReg, reg.connections);
}
}
}
}
-
- // Remove too small unconnected regions.
+
+ // Remove too small regions.
+ rcIntArray stack(32);
+ rcIntArray trace(32);
for (int i = 0; i < nreg; ++i)
{
rcRegion& reg = regions[i];
if (reg.id == 0 || (reg.id & RC_BORDER_REG))
- continue;
- if (reg.count == 0)
+ continue;
+ if (reg.spanCount == 0)
continue;
+ if (reg.visited)
+ continue;
+
+ // Count the total size of all the connected regions.
+ // Also keep track of the regions connects to a tile border.
+ bool connectsToBorder = false;
+ int spanCount = 0;
+ stack.resize(0);
+ trace.resize(0);
+
+ reg.visited = true;
+ stack.push(i);
- if (reg.connections.size() == 1 && reg.connections[0] == 0)
+ while (stack.size())
{
- if (reg.count < minRegionSize)
+ // Pop
+ int ri = stack.pop();
+
+ rcRegion& creg = regions[ri];
+
+ spanCount += creg.spanCount;
+ trace.push(ri);
+
+ for (int j = 0; j < creg.connections.size(); ++j)
{
- // Non-connected small region, remove.
- reg.count = 0;
- reg.id = 0;
+ if (creg.connections[j] & RC_BORDER_REG)
+ {
+ connectsToBorder = true;
+ continue;
+ }
+ rcRegion& nreg = regions[creg.connections[j]];
+ if (nreg.visited)
+ continue;
+ if (nreg.id == 0 || (nreg.id & RC_BORDER_REG))
+ continue;
+ // Visit
+ stack.push(nreg.id);
+ nreg.visited = true;
}
}
- }
+ // If the accumulated regions size is too small, remove it.
+ // Do not remove areas which connect to tile borders
+ // as their size cannot be estimated correctly and removing them
+ // can potentially remove necessary areas.
+ if (spanCount < minRegionArea && !connectsToBorder)
+ {
+ // Kill all visited regions.
+ for (int j = 0; j < trace.size(); ++j)
+ {
+ regions[trace[j]].spanCount = 0;
+ regions[trace[j]].id = 0;
+ }
+ }
+ }
// Merge too small regions to neighbour regions.
int mergeCount = 0 ;
@@ -768,14 +841,14 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
{
rcRegion& reg = regions[i];
if (reg.id == 0 || (reg.id & RC_BORDER_REG))
- continue;
- if (reg.count == 0)
+ continue;
+ if (reg.spanCount == 0)
continue;
-
+
// Check to see if the region should be merged.
- if (reg.count > mergeRegionSize && isRegionConnectedToBorder(reg))
+ if (reg.spanCount > mergeRegionSize && isRegionConnectedToBorder(reg))
continue;
-
+
// Small region with more than 1 connection.
// Or region which is not connected to a border at all.
// Find smallest neighbour region that connects to this one.
@@ -786,11 +859,11 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
if (reg.connections[j] & RC_BORDER_REG) continue;
rcRegion& mreg = regions[reg.connections[j]];
if (mreg.id == 0 || (mreg.id & RC_BORDER_REG)) continue;
- if (mreg.count < smallest &&
- canMergeWithRegion(reg, mreg.id) &&
- canMergeWithRegion(mreg, reg.id))
+ if (mreg.spanCount < smallest &&
+ canMergeWithRegion(reg, mreg) &&
+ canMergeWithRegion(mreg, reg))
{
- smallest = mreg.count;
+ smallest = mreg.spanCount;
mergeId = mreg.id;
}
}
@@ -821,16 +894,16 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
}
}
while (mergeCount > 0);
-
+
// Compress region Ids.
for (int i = 0; i < nreg; ++i)
{
regions[i].remap = false;
- if (regions[i].id == 0) continue; // Skip nil regions.
- if (regions[i].id & RC_BORDER_REG) continue; // Skip external regions.
+ if (regions[i].id == 0) continue; // Skip nil regions.
+ if (regions[i].id & RC_BORDER_REG) continue; // Skip external regions.
regions[i].remap = true;
}
-
+
unsigned short regIdGen = 0;
for (int i = 0; i < nreg; ++i)
{
@@ -848,91 +921,88 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
}
}
maxRegionId = regIdGen;
-
+
// Remap regions.
for (int i = 0; i < chf.spanCount; ++i)
{
- if ((src[i*2] & RC_BORDER_REG) == 0)
- src[i*2] = regions[src[i*2]].id;
+ if ((srcReg[i] & RC_BORDER_REG) == 0)
+ srcReg[i] = regions[srcReg[i]].id;
}
- delete [] regions;
+ for (int i = 0; i < nreg; ++i)
+ regions[i].~rcRegion();
+ rcFree(regions);
return true;
}
-bool rcBuildDistanceField(rcCompactHeightfield& chf)
+/// @par
+///
+/// This is usually the second to the last step in creating a fully built
+/// compact heightfield. This step is required before regions are built
+/// using #rcBuildRegions or #rcBuildRegionsMonotone.
+///
+/// After this step, the distance data is available via the rcCompactHeightfield::maxDistance
+/// and rcCompactHeightfield::dist fields.
+///
+/// @see rcCompactHeightfield, rcBuildRegions, rcBuildRegionsMonotone
+bool rcBuildDistanceField(rcContext* ctx, rcCompactHeightfield& chf)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_BUILD_DISTANCEFIELD);
+
+ if (chf.dist)
+ {
+ rcFree(chf.dist);
+ chf.dist = 0;
+ }
- unsigned short* dist0 = new unsigned short[chf.spanCount];
- if (!dist0)
+ unsigned short* src = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP);
+ if (!src)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'dist0' (%d).", chf.spanCount);
+ ctx->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'src' (%d).", chf.spanCount);
return false;
}
- unsigned short* dist1 = new unsigned short[chf.spanCount];
- if (!dist1)
+ unsigned short* dst = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP);
+ if (!dst)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'dist1' (%d).", chf.spanCount);
- delete [] dist0;
+ ctx->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'dst' (%d).", chf.spanCount);
+ rcFree(src);
return false;
}
- unsigned short* src = dist0;
- unsigned short* dst = dist1;
-
unsigned short maxDist = 0;
- rcTimeVal distStartTime = rcGetPerformanceTimer();
-
- if (calculateDistanceField(chf, src, dst, maxDist) != src)
- rcSwap(src, dst);
+ ctx->startTimer(RC_TIMER_BUILD_DISTANCEFIELD_DIST);
+ calculateDistanceField(chf, src, maxDist);
chf.maxDistance = maxDist;
- rcTimeVal distEndTime = rcGetPerformanceTimer();
+ ctx->stopTimer(RC_TIMER_BUILD_DISTANCEFIELD_DIST);
- rcTimeVal blurStartTime = rcGetPerformanceTimer();
+ ctx->startTimer(RC_TIMER_BUILD_DISTANCEFIELD_BLUR);
// Blur
if (boxBlur(chf, 1, src, dst) != src)
rcSwap(src, dst);
// Store distance.
- for (int i = 0; i < chf.spanCount; ++i)
- chf.spans[i].dist = src[i];
-
- rcTimeVal blurEndTime = rcGetPerformanceTimer();
+ chf.dist = src;
- delete [] dist0;
- delete [] dist1;
-
- rcTimeVal endTime = rcGetPerformanceTimer();
+ ctx->stopTimer(RC_TIMER_BUILD_DISTANCEFIELD_BLUR);
+
+ ctx->stopTimer(RC_TIMER_BUILD_DISTANCEFIELD);
-/* if (rcGetLog())
- {
- rcGetLog()->log(RC_LOG_PROGRESS, "Build distance field: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
- rcGetLog()->log(RC_LOG_PROGRESS, " - dist: %.3f ms", rcGetDeltaTimeUsec(distStartTime, distEndTime)/1000.0f);
- rcGetLog()->log(RC_LOG_PROGRESS, " - blur: %.3f ms", rcGetDeltaTimeUsec(blurStartTime, blurEndTime)/1000.0f);
- }*/
- if (rcGetBuildTimes())
- {
- rcGetBuildTimes()->buildDistanceField += rcGetDeltaTimeUsec(startTime, endTime);
- rcGetBuildTimes()->buildDistanceFieldDist += rcGetDeltaTimeUsec(distStartTime, distEndTime);
- rcGetBuildTimes()->buildDistanceFieldBlur += rcGetDeltaTimeUsec(blurStartTime, blurEndTime);
- }
+ rcFree(dst);
return true;
}
-static void paintRectRegion(int minx, int maxx, int miny, int maxy,
- unsigned short regId, unsigned short minLevel,
- rcCompactHeightfield& chf, unsigned short* src)
+static void paintRectRegion(int minx, int maxx, int miny, int maxy, unsigned short regId,
+ rcCompactHeightfield& chf, unsigned short* srcReg)
{
- const int w = chf.width;
+ const int w = chf.width;
for (int y = miny; y < maxy; ++y)
{
for (int x = minx; x < maxx; ++x)
@@ -940,77 +1010,283 @@ static void paintRectRegion(int minx, int maxx, int miny, int maxy,
const rcCompactCell& c = chf.cells[x+y*w];
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
- if (chf.spans[i].dist >= minLevel)
- src[i*2] = regId;
+ if (chf.areas[i] != RC_NULL_AREA)
+ srcReg[i] = regId;
}
}
}
}
-bool rcBuildRegions(rcCompactHeightfield& chf,
- int walkableRadius, int borderSize,
- int minRegionSize, int mergeRegionSize)
+
+static const unsigned short RC_NULL_NEI = 0xffff;
+
+struct rcSweepSpan
+{
+ unsigned short rid; // row id
+ unsigned short id; // region id
+ unsigned short ns; // number samples
+ unsigned short nei; // neighbour id
+};
+
+/// @par
+///
+/// Non-null regions will consist of connected, non-overlapping walkable spans that form a single contour.
+/// Contours will form simple polygons.
+///
+/// If multiple regions form an area that is smaller than @p minRegionArea, then all spans will be
+/// re-assigned to the zero (null) region.
+///
+/// Partitioning can result in smaller than necessary regions. @p mergeRegionArea helps
+/// reduce unecessarily small regions.
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// The region data will be available via the rcCompactHeightfield::maxRegions
+/// and rcCompactSpan::reg fields.
+///
+/// @warning The distance field must be created using #rcBuildDistanceField before attempting to build regions.
+///
+/// @see rcCompactHeightfield, rcCompactSpan, rcBuildDistanceField, rcBuildRegionsMonotone, rcConfig
+bool rcBuildRegionsMonotone(rcContext* ctx, rcCompactHeightfield& chf,
+ const int borderSize, const int minRegionArea, const int mergeRegionArea)
{
- rcTimeVal startTime = rcGetPerformanceTimer();
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_BUILD_REGIONS);
const int w = chf.width;
const int h = chf.height;
+ unsigned short id = 1;
- unsigned short* tmp1 = new unsigned short[chf.spanCount*2];
- if (!tmp1)
+ rcScopedDelete<unsigned short> srcReg = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_TEMP);
+ if (!srcReg)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'src' (%d).", chf.spanCount);
+ return false;
+ }
+ memset(srcReg,0,sizeof(unsigned short)*chf.spanCount);
+
+ const int nsweeps = rcMax(chf.width,chf.height);
+ rcScopedDelete<rcSweepSpan> sweeps = (rcSweepSpan*)rcAlloc(sizeof(rcSweepSpan)*nsweeps, RC_ALLOC_TEMP);
+ if (!sweeps)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'tmp1' (%d).", chf.spanCount*2);
+ ctx->log(RC_LOG_ERROR, "rcBuildRegionsMonotone: Out of memory 'sweeps' (%d).", nsweeps);
return false;
}
- unsigned short* tmp2 = new unsigned short[chf.spanCount*2];
- if (!tmp2)
+
+
+ // Mark border regions.
+ if (borderSize > 0)
+ {
+ // Make sure border will not overflow.
+ const int bw = rcMin(w, borderSize);
+ const int bh = rcMin(h, borderSize);
+ // Paint regions
+ paintRectRegion(0, bw, 0, h, id|RC_BORDER_REG, chf, srcReg); id++;
+ paintRectRegion(w-bw, w, 0, h, id|RC_BORDER_REG, chf, srcReg); id++;
+ paintRectRegion(0, w, 0, bh, id|RC_BORDER_REG, chf, srcReg); id++;
+ paintRectRegion(0, w, h-bh, h, id|RC_BORDER_REG, chf, srcReg); id++;
+
+ chf.borderSize = borderSize;
+ }
+
+ rcIntArray prev(256);
+
+ // Sweep one line at a time.
+ for (int y = borderSize; y < h-borderSize; ++y)
{
- if (rcGetLog())
- rcGetLog()->log(RC_LOG_ERROR, "rcBuildDistanceField: Out of memory 'tmp2' (%d).", chf.spanCount*2);
- delete [] tmp1;
+ // Collect spans from this row.
+ prev.resize(id+1);
+ memset(&prev[0],0,sizeof(int)*id);
+ unsigned short rid = 1;
+
+ for (int x = borderSize; x < w-borderSize; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ const rcCompactSpan& s = chf.spans[i];
+ if (chf.areas[i] == RC_NULL_AREA) continue;
+
+ // -x
+ unsigned short previd = 0;
+ if (rcGetCon(s, 0) != RC_NOT_CONNECTED)
+ {
+ const int ax = x + rcGetDirOffsetX(0);
+ const int ay = y + rcGetDirOffsetY(0);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 0);
+ if ((srcReg[ai] & RC_BORDER_REG) == 0 && chf.areas[i] == chf.areas[ai])
+ previd = srcReg[ai];
+ }
+
+ if (!previd)
+ {
+ previd = rid++;
+ sweeps[previd].rid = previd;
+ sweeps[previd].ns = 0;
+ sweeps[previd].nei = 0;
+ }
+
+ // -y
+ if (rcGetCon(s,3) != RC_NOT_CONNECTED)
+ {
+ const int ax = x + rcGetDirOffsetX(3);
+ const int ay = y + rcGetDirOffsetY(3);
+ const int ai = (int)chf.cells[ax+ay*w].index + rcGetCon(s, 3);
+ if (srcReg[ai] && (srcReg[ai] & RC_BORDER_REG) == 0 && chf.areas[i] == chf.areas[ai])
+ {
+ unsigned short nr = srcReg[ai];
+ if (!sweeps[previd].nei || sweeps[previd].nei == nr)
+ {
+ sweeps[previd].nei = nr;
+ sweeps[previd].ns++;
+ prev[nr]++;
+ }
+ else
+ {
+ sweeps[previd].nei = RC_NULL_NEI;
+ }
+ }
+ }
+
+ srcReg[i] = previd;
+ }
+ }
+
+ // Create unique ID.
+ for (int i = 1; i < rid; ++i)
+ {
+ if (sweeps[i].nei != RC_NULL_NEI && sweeps[i].nei != 0 &&
+ prev[sweeps[i].nei] == (int)sweeps[i].ns)
+ {
+ sweeps[i].id = sweeps[i].nei;
+ }
+ else
+ {
+ sweeps[i].id = id++;
+ }
+ }
+
+ // Remap IDs
+ for (int x = borderSize; x < w-borderSize; ++x)
+ {
+ const rcCompactCell& c = chf.cells[x+y*w];
+
+ for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
+ {
+ if (srcReg[i] > 0 && srcReg[i] < rid)
+ srcReg[i] = sweeps[srcReg[i]].id;
+ }
+ }
+ }
+
+ ctx->startTimer(RC_TIMER_BUILD_REGIONS_FILTER);
+
+ // Filter out small regions.
+ chf.maxRegions = id;
+ if (!filterSmallRegions(ctx, minRegionArea, mergeRegionArea, chf.maxRegions, chf, srcReg))
+ return false;
+
+ ctx->stopTimer(RC_TIMER_BUILD_REGIONS_FILTER);
+
+ // Store the result out.
+ for (int i = 0; i < chf.spanCount; ++i)
+ chf.spans[i].reg = srcReg[i];
+
+ ctx->stopTimer(RC_TIMER_BUILD_REGIONS);
+
+ return true;
+}
+
+/// @par
+///
+/// Non-null regions will consist of connected, non-overlapping walkable spans that form a single contour.
+/// Contours will form simple polygons.
+///
+/// If multiple regions form an area that is smaller than @p minRegionArea, then all spans will be
+/// re-assigned to the zero (null) region.
+///
+/// Watershed partitioning can result in smaller than necessary regions, especially in diagonal corridors.
+/// @p mergeRegionArea helps reduce unecessarily small regions.
+///
+/// See the #rcConfig documentation for more information on the configuration parameters.
+///
+/// The region data will be available via the rcCompactHeightfield::maxRegions
+/// and rcCompactSpan::reg fields.
+///
+/// @warning The distance field must be created using #rcBuildDistanceField before attempting to build regions.
+///
+/// @see rcCompactHeightfield, rcCompactSpan, rcBuildDistanceField, rcBuildRegionsMonotone, rcConfig
+bool rcBuildRegions(rcContext* ctx, rcCompactHeightfield& chf,
+ const int borderSize, const int minRegionArea, const int mergeRegionArea)
+{
+ rcAssert(ctx);
+
+ ctx->startTimer(RC_TIMER_BUILD_REGIONS);
+
+ const int w = chf.width;
+ const int h = chf.height;
+
+ rcScopedDelete<unsigned short> buf = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount*4, RC_ALLOC_TEMP);
+ if (!buf)
+ {
+ ctx->log(RC_LOG_ERROR, "rcBuildRegions: Out of memory 'tmp' (%d).", chf.spanCount*4);
return false;
}
- rcTimeVal regStartTime = rcGetPerformanceTimer();
+ ctx->startTimer(RC_TIMER_BUILD_REGIONS_WATERSHED);
rcIntArray stack(1024);
rcIntArray visited(1024);
- unsigned short* src = tmp1;
- unsigned short* dst = tmp2;
+ unsigned short* srcReg = buf;
+ unsigned short* srcDist = buf+chf.spanCount;
+ unsigned short* dstReg = buf+chf.spanCount*2;
+ unsigned short* dstDist = buf+chf.spanCount*3;
- memset(src, 0, sizeof(unsigned short) * chf.spanCount*2);
+ memset(srcReg, 0, sizeof(unsigned short)*chf.spanCount);
+ memset(srcDist, 0, sizeof(unsigned short)*chf.spanCount);
unsigned short regionId = 1;
unsigned short level = (chf.maxDistance+1) & ~1;
-
- unsigned short minLevel = (unsigned short)(walkableRadius*2);
-
- const int expandIters = 4 + walkableRadius * 2;
- // Mark border regions.
- paintRectRegion(0, borderSize, 0, h, regionId|RC_BORDER_REG, minLevel, chf, src); regionId++;
- paintRectRegion(w-borderSize, w, 0, h, regionId|RC_BORDER_REG, minLevel, chf, src); regionId++;
- paintRectRegion(0, w, 0, borderSize, regionId|RC_BORDER_REG, minLevel, chf, src); regionId++;
- paintRectRegion(0, w, h-borderSize, h, regionId|RC_BORDER_REG, minLevel, chf, src); regionId++;
+ // TODO: Figure better formula, expandIters defines how much the
+ // watershed "overflows" and simplifies the regions. Tying it to
+ // agent radius was usually good indication how greedy it could be.
+// const int expandIters = 4 + walkableRadius * 2;
+ const int expandIters = 8;
+
+ if (borderSize > 0)
+ {
+ // Make sure border will not overflow.
+ const int bw = rcMin(w, borderSize);
+ const int bh = rcMin(h, borderSize);
+ // Paint regions
+ paintRectRegion(0, bw, 0, h, regionId|RC_BORDER_REG, chf, srcReg); regionId++;
+ paintRectRegion(w-bw, w, 0, h, regionId|RC_BORDER_REG, chf, srcReg); regionId++;
+ paintRectRegion(0, w, 0, bh, regionId|RC_BORDER_REG, chf, srcReg); regionId++;
+ paintRectRegion(0, w, h-bh, h, regionId|RC_BORDER_REG, chf, srcReg); regionId++;
- rcTimeVal expTime = 0;
- rcTimeVal floodTime = 0;
+ chf.borderSize = borderSize;
+ }
- while (level > minLevel)
+ while (level > 0)
{
level = level >= 2 ? level-2 : 0;
- rcTimeVal expStartTime = rcGetPerformanceTimer();
+ ctx->startTimer(RC_TIMER_BUILD_REGIONS_EXPAND);
// Expand current regions until no empty connected cells found.
- if (expandRegions(expandIters, level, chf, src, dst, stack) != src)
- rcSwap(src, dst);
+ if (expandRegions(expandIters, level, chf, srcReg, srcDist, dstReg, dstDist, stack) != srcReg)
+ {
+ rcSwap(srcReg, dstReg);
+ rcSwap(srcDist, dstDist);
+ }
- expTime += rcGetPerformanceTimer() - expStartTime;
+ ctx->stopTimer(RC_TIMER_BUILD_REGIONS_EXPAND);
- rcTimeVal floodStartTime = rcGetPerformanceTimer();
+ ctx->startTimer(RC_TIMER_BUILD_REGIONS_FLOOD);
// Mark new regions with IDs.
for (int y = 0; y < h; ++y)
@@ -1020,61 +1296,41 @@ bool rcBuildRegions(rcCompactHeightfield& chf,
const rcCompactCell& c = chf.cells[x+y*w];
for (int i = (int)c.index, ni = (int)(c.index+c.count); i < ni; ++i)
{
- if (chf.spans[i].dist < level || src[i*2] != 0)
+ if (chf.dist[i] < level || srcReg[i] != 0 || chf.areas[i] == RC_NULL_AREA)
continue;
-
- if (floodRegion(x, y, i, minLevel, level, regionId, chf, src, stack))
+ if (floodRegion(x, y, i, level, regionId, chf, srcReg, srcDist, stack))
regionId++;
}
}
}
- floodTime += rcGetPerformanceTimer() - floodStartTime;
-
+ ctx->stopTimer(RC_TIMER_BUILD_REGIONS_FLOOD);
}
// Expand current regions until no empty connected cells found.
- if (expandRegions(expandIters*8, minLevel, chf, src, dst, stack) != src)
- rcSwap(src, dst);
+ if (expandRegions(expandIters*8, 0, chf, srcReg, srcDist, dstReg, dstDist, stack) != srcReg)
+ {
+ rcSwap(srcReg, dstReg);
+ rcSwap(srcDist, dstDist);
+ }
- rcTimeVal regEndTime = rcGetPerformanceTimer();
+ ctx->stopTimer(RC_TIMER_BUILD_REGIONS_WATERSHED);
- rcTimeVal filterStartTime = rcGetPerformanceTimer();
+ ctx->startTimer(RC_TIMER_BUILD_REGIONS_FILTER);
// Filter out small regions.
chf.maxRegions = regionId;
- if (!filterSmallRegions(minRegionSize, mergeRegionSize, chf.maxRegions, chf, src))
+ if (!filterSmallRegions(ctx, minRegionArea, mergeRegionArea, chf.maxRegions, chf, srcReg))
return false;
- rcTimeVal filterEndTime = rcGetPerformanceTimer();
-
+ ctx->stopTimer(RC_TIMER_BUILD_REGIONS_FILTER);
+
// Write the result out.
for (int i = 0; i < chf.spanCount; ++i)
- chf.spans[i].reg = src[i*2];
-
- delete [] tmp1;
- delete [] tmp2;
+ chf.spans[i].reg = srcReg[i];
- rcTimeVal endTime = rcGetPerformanceTimer();
+ ctx->stopTimer(RC_TIMER_BUILD_REGIONS);
-/* if (rcGetLog())
- {
- rcGetLog()->log(RC_LOG_PROGRESS, "Build regions: %.3f ms", rcGetDeltaTimeUsec(startTime, endTime)/1000.0f);
- rcGetLog()->log(RC_LOG_PROGRESS, " - reg: %.3f ms", rcGetDeltaTimeUsec(regStartTime, regEndTime)/1000.0f);
- rcGetLog()->log(RC_LOG_PROGRESS, " - exp: %.3f ms", rcGetDeltaTimeUsec(0, expTime)/1000.0f);
- rcGetLog()->log(RC_LOG_PROGRESS, " - flood: %.3f ms", rcGetDeltaTimeUsec(0, floodTime)/1000.0f);
- rcGetLog()->log(RC_LOG_PROGRESS, " - filter: %.3f ms", rcGetDeltaTimeUsec(filterStartTime, filterEndTime)/1000.0f);
- }
-*/
- if (rcGetBuildTimes())
- {
- rcGetBuildTimes()->buildRegions += rcGetDeltaTimeUsec(startTime, endTime);
- rcGetBuildTimes()->buildRegionsReg += rcGetDeltaTimeUsec(regStartTime, regEndTime);
- rcGetBuildTimes()->buildRegionsExp += rcGetDeltaTimeUsec(0, expTime);
- rcGetBuildTimes()->buildRegionsFlood += rcGetDeltaTimeUsec(0, floodTime);
- rcGetBuildTimes()->buildRegionsFilter += rcGetDeltaTimeUsec(filterStartTime, filterEndTime);
- }
-
return true;
}
diff --git a/extern/recastnavigation/recast-capi.cpp b/extern/recastnavigation/recast-capi.cpp
index 52c4cdc90ed..42a9a4b82c8 100644
--- a/extern/recastnavigation/recast-capi.cpp
+++ b/extern/recastnavigation/recast-capi.cpp
@@ -30,8 +30,370 @@
#include <math.h>
#include "Recast.h"
+static rcContext *sctx;
+
+#define INIT_SCTX() \
+ if (sctx == NULL) sctx = new rcContext(false)
+
int recast_buildMeshAdjacency(unsigned short* polys, const int npolys,
const int nverts, const int vertsPerPoly)
{
return (int) buildMeshAdjacency(polys, npolys, nverts, vertsPerPoly);
}
+
+void recast_calcBounds(const float *verts, int nv, float *bmin, float *bmax)
+{
+ rcCalcBounds(verts, nv, bmin, bmax);
+}
+
+void recast_calcGridSize(const float *bmin, const float *bmax, float cs, int *w, int *h)
+{
+ rcCalcGridSize(bmin, bmax, cs, w, h);
+}
+
+struct recast_heightfield *recast_newHeightfield(void)
+{
+ return (struct recast_heightfield *) rcAllocHeightfield();
+}
+
+void recast_destroyHeightfield(struct recast_heightfield *heightfield)
+{
+ rcFreeHeightField((rcHeightfield *) heightfield);
+}
+
+int recast_createHeightfield(struct recast_heightfield *hf, int width, int height,
+ const float *bmin, const float* bmax, float cs, float ch)
+{
+ INIT_SCTX();
+ return rcCreateHeightfield(sctx, *(rcHeightfield *)hf, width, height, bmin, bmax, cs, ch);
+}
+
+void recast_markWalkableTriangles(const float walkableSlopeAngle,const float *verts, int nv,
+ const int *tris, int nt, unsigned char *flags)
+{
+ INIT_SCTX();
+ rcMarkWalkableTriangles(sctx, walkableSlopeAngle, verts, nv, tris, nt, flags);
+}
+
+void recast_rasterizeTriangles(const float *verts, int nv, const int *tris,
+ const unsigned char *flags, int nt, struct recast_heightfield *solid)
+{
+ INIT_SCTX();
+ rcRasterizeTriangles(sctx, verts, nv, tris, flags, nt, *(rcHeightfield *) solid);
+}
+
+void recast_filterLedgeSpans(const int walkableHeight, const int walkableClimb,
+ struct recast_heightfield *solid)
+{
+ INIT_SCTX();
+ rcFilterLedgeSpans(sctx, walkableHeight, walkableClimb, *(rcHeightfield *) solid);
+}
+
+void recast_filterWalkableLowHeightSpans(int walkableHeight, struct recast_heightfield *solid)
+{
+ INIT_SCTX();
+ rcFilterWalkableLowHeightSpans(sctx, walkableHeight, *(rcHeightfield *) solid);
+}
+
+void recast_filterLowHangingWalkableObstacles(const int walkableClimb, struct recast_heightfield *solid)
+{
+ INIT_SCTX();
+ rcFilterLowHangingWalkableObstacles(sctx, walkableClimb, *(rcHeightfield *) solid);
+}
+
+struct recast_compactHeightfield *recast_newCompactHeightfield(void)
+{
+ return (struct recast_compactHeightfield *) rcAllocCompactHeightfield();
+}
+
+void recast_destroyCompactHeightfield(struct recast_compactHeightfield *compactHeightfield)
+{
+ rcFreeCompactHeightfield( (rcCompactHeightfield *) compactHeightfield);
+}
+
+int recast_buildCompactHeightfield(const int walkableHeight, const int walkableClimb,
+ struct recast_heightfield *hf, struct recast_compactHeightfield *chf)
+{
+ INIT_SCTX();
+ return rcBuildCompactHeightfield(sctx, walkableHeight, walkableClimb,
+ *(rcHeightfield *) hf, *(rcCompactHeightfield *) chf);
+}
+
+int recast_erodeWalkableArea(int radius, struct recast_compactHeightfield *chf)
+{
+ INIT_SCTX();
+ return rcErodeWalkableArea(sctx, radius, *(rcCompactHeightfield *) chf);
+}
+
+int recast_buildDistanceField(struct recast_compactHeightfield *chf)
+{
+ INIT_SCTX();
+ return rcBuildDistanceField(sctx, *(rcCompactHeightfield *) chf);
+}
+
+int recast_buildRegions(struct recast_compactHeightfield *chf, int borderSize,
+ int minRegionSize, int mergeRegionSize)
+{
+ INIT_SCTX();
+ return rcBuildRegions(sctx, *(rcCompactHeightfield *) chf, borderSize,
+ minRegionSize, mergeRegionSize);
+}
+
+struct recast_contourSet *recast_newContourSet(void)
+{
+ return (struct recast_contourSet *) rcAllocContourSet();
+}
+
+void recast_destroyContourSet(struct recast_contourSet *contourSet)
+{
+ rcFreeContourSet((rcContourSet *) contourSet);
+}
+
+int recast_buildContours(struct recast_compactHeightfield *chf,
+ const float maxError, const int maxEdgeLen, struct recast_contourSet *cset)
+{
+ INIT_SCTX();
+ return rcBuildContours(sctx, *(rcCompactHeightfield *) chf, maxError, maxEdgeLen, *(rcContourSet *) cset);
+}
+
+struct recast_polyMesh *recast_newPolyMesh(void)
+{
+ return (recast_polyMesh *) rcAllocPolyMesh();
+}
+
+void recast_destroyPolyMesh(struct recast_polyMesh *polyMesh)
+{
+ rcFreePolyMesh((rcPolyMesh *) polyMesh);
+}
+
+int recast_buildPolyMesh(struct recast_contourSet *cset, int nvp, struct recast_polyMesh *mesh)
+{
+ INIT_SCTX();
+ return rcBuildPolyMesh(sctx, *(rcContourSet *) cset, nvp, * (rcPolyMesh *) mesh);
+}
+
+unsigned short *recast_polyMeshGetVerts(struct recast_polyMesh *mesh, int *nverts)
+{
+ rcPolyMesh *pmesh = (rcPolyMesh *)mesh;
+
+ if (nverts)
+ *nverts = pmesh->nverts;
+
+ return pmesh->verts;
+}
+
+void recast_polyMeshGetBoundbox(struct recast_polyMesh *mesh, float *bmin, float *bmax)
+{
+ rcPolyMesh *pmesh = (rcPolyMesh *)mesh;
+
+ if (bmin) {
+ bmin[0] = pmesh->bmin[0];
+ bmin[1] = pmesh->bmin[1];
+ bmin[2] = pmesh->bmin[2];
+ }
+
+ if (bmax) {
+ bmax[0] = pmesh->bmax[0];
+ bmax[1] = pmesh->bmax[1];
+ bmax[2] = pmesh->bmax[2];
+ }
+}
+
+void recast_polyMeshGetCell(struct recast_polyMesh *mesh, float *cs, float *ch)
+{
+ rcPolyMesh *pmesh = (rcPolyMesh *)mesh;
+
+ if (cs)
+ *cs = pmesh->cs;
+
+ if (ch)
+ *ch = pmesh->ch;
+}
+
+unsigned short *recast_polyMeshGetPolys(struct recast_polyMesh *mesh, int *npolys, int *nvp)
+{
+ rcPolyMesh *pmesh = (rcPolyMesh *)mesh;
+
+ if (npolys)
+ *npolys = pmesh->npolys;
+
+ if (nvp)
+ *nvp = pmesh->nvp;
+
+ return pmesh->polys;
+}
+
+struct recast_polyMeshDetail *recast_newPolyMeshDetail(void)
+{
+ return (struct recast_polyMeshDetail *) rcAllocPolyMeshDetail();
+}
+
+void recast_destroyPolyMeshDetail(struct recast_polyMeshDetail *polyMeshDetail)
+{
+ rcFreePolyMeshDetail((rcPolyMeshDetail *) polyMeshDetail);
+}
+
+int recast_buildPolyMeshDetail(const struct recast_polyMesh *mesh, const struct recast_compactHeightfield *chf,
+ const float sampleDist, const float sampleMaxError, struct recast_polyMeshDetail *dmesh)
+{
+ INIT_SCTX();
+ return rcBuildPolyMeshDetail(sctx, *(rcPolyMesh *) mesh, *(rcCompactHeightfield *) chf,
+ sampleDist, sampleMaxError, *(rcPolyMeshDetail *) dmesh);
+}
+
+float *recast_polyMeshDetailGetVerts(struct recast_polyMeshDetail *mesh, int *nverts)
+{
+ rcPolyMeshDetail *dmesh = (rcPolyMeshDetail *)mesh;
+
+ if (nverts)
+ *nverts = dmesh->nverts;
+
+ return dmesh->verts;
+}
+
+unsigned char *recast_polyMeshDetailGetTris(struct recast_polyMeshDetail *mesh, int *ntris)
+{
+ rcPolyMeshDetail *dmesh = (rcPolyMeshDetail *)mesh;
+
+ if (ntris)
+ *ntris = dmesh->ntris;
+
+ return dmesh->tris;
+}
+
+unsigned int *recast_polyMeshDetailGetMeshes(struct recast_polyMeshDetail *mesh, int *nmeshes)
+{
+ rcPolyMeshDetail *dmesh = (rcPolyMeshDetail *)mesh;
+
+ if (nmeshes)
+ *nmeshes = dmesh->nmeshes;
+
+ return dmesh->meshes;
+}
+
+// qsort based on FreeBSD source (libkern\qsort.c)
+typedef int cmp_t(void *, const void *, const void *);
+static inline char *med3(char *, char *, char *, cmp_t *, void *);
+static inline void swapfunc(char *, char *, int, int);
+
+#define min(a, b) (a) < (b) ? a : b
+#define swapcode(TYPE, parmi, parmj, n) \
+{ \
+ long i = (n) / sizeof (TYPE); \
+ TYPE *pi = (TYPE *) (parmi); \
+ TYPE *pj = (TYPE *) (parmj); \
+ do { \
+ TYPE t = *pi; \
+ *pi++ = *pj; \
+ *pj++ = t; \
+ } while (--i > 0); \
+}
+#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
+ es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
+
+static inline void swapfunc(char* a, char* b, int n, int swaptype)
+{
+ if(swaptype <= 1)
+ swapcode(long, a, b, n)
+ else
+ swapcode(char, a, b, n)
+}
+
+#define swap(a, b) \
+ if (swaptype == 0) { \
+ long t = *(long *)(a); \
+ *(long *)(a) = *(long *)(b);\
+ *(long *)(b) = t; \
+ } else \
+ swapfunc(a, b, es, swaptype)
+
+#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
+#define CMP(t, x, y) (cmp((t), (x), (y)))
+
+static inline char * med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk)
+{
+ return CMP(thunk, a, b) < 0 ?
+ (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
+ :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
+}
+
+void recast_qsort(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
+{
+ char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
+ int d, r, swaptype, swap_cnt;
+
+loop:
+ SWAPINIT(a, es);
+ swap_cnt = 0;
+ if (n < 7) {
+ for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
+ for (pl = pm;
+ pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
+ pl -= es)
+ swap(pl, pl - es);
+ return;
+ }
+ pm = (char *)a + (n / 2) * es;
+ if (n > 7) {
+ pl = (char *)a;
+ pn = (char *)a + (n - 1) * es;
+ if (n > 40) {
+ d = (n / 8) * es;
+ pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
+ pm = med3(pm - d, pm, pm + d, cmp, thunk);
+ pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
+ }
+ pm = med3(pl, pm, pn, cmp, thunk);
+ }
+ swap((char *)a, pm);
+ pa = pb = (char *)a + es;
+
+ pc = pd = (char *)a + (n - 1) * es;
+ for (;;) {
+ while (pb <= pc && (r = CMP(thunk, pb, a)) <= 0) {
+ if (r == 0) {
+ swap_cnt = 1;
+ swap(pa, pb);
+ pa += es;
+ }
+ pb += es;
+ }
+ while (pb <= pc && (r = CMP(thunk, pc, a)) >= 0) {
+ if (r == 0) {
+ swap_cnt = 1;
+ swap(pc, pd);
+ pd -= es;
+ }
+ pc -= es;
+ }
+ if (pb > pc)
+ break;
+ swap(pb, pc);
+ swap_cnt = 1;
+ pb += es;
+ pc -= es;
+ }
+ if (swap_cnt == 0) { /* Switch to insertion sort */
+ for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
+ for (pl = pm;
+ pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
+ pl -= es)
+ swap(pl, pl - es);
+ return;
+ }
+
+ pn = (char *)a + n * es;
+ r = min(pa - (char *)a, pb - pa);
+ vecswap((char *)a, pb - r, r);
+ r = min(pd - pc, pn - pd - es);
+ vecswap(pb, pn - r, r);
+ if ((r = pb - pa) > es)
+ recast_qsort(a, r / es, es, thunk, cmp);
+ if ((r = pd - pc) > es) {
+ /* Iterate rather than recurse to save stack space */
+ a = pn - r;
+ n = r / es;
+ goto loop;
+ }
+}
+
diff --git a/extern/recastnavigation/recast-capi.h b/extern/recastnavigation/recast-capi.h
index 0d20fdf9981..e8831bcdc58 100644
--- a/extern/recastnavigation/recast-capi.h
+++ b/extern/recastnavigation/recast-capi.h
@@ -28,13 +28,111 @@
#ifndef RECAST_C_API_H
#define RECAST_C_API_H
+// for size_t
+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif
+struct recast_polyMesh;
+struct recast_polyMeshDetail;
+struct recast_heightfield;
+struct recast_compactHeightfield;
+struct recast_contourSet;
+
+enum recast_SpanFlags
+{
+ RECAST_WALKABLE = 0x01,
+ RECAST_REACHABLE = 0x02
+};
+
int recast_buildMeshAdjacency(unsigned short* polys, const int npolys,
const int nverts, const int vertsPerPoly);
+void recast_calcBounds(const float *verts, int nv, float *bmin, float *bmax);
+
+void recast_calcGridSize(const float *bmin, const float *bmax, float cs, int *w, int *h);
+
+struct recast_heightfield *recast_newHeightfield(void);
+
+void recast_destroyHeightfield(struct recast_heightfield *heightfield);
+
+int recast_createHeightfield(struct recast_heightfield *hf, int width, int height,
+ const float *bmin, const float* bmax, float cs, float ch);
+
+void recast_markWalkableTriangles(const float walkableSlopeAngle,const float *verts, int nv,
+ const int *tris, int nt, unsigned char *flags);
+
+void recast_rasterizeTriangles(const float *verts, int nv, const int *tris,
+ const unsigned char *flags, int nt, struct recast_heightfield *solid);
+
+void recast_filterLedgeSpans(const int walkableHeight, const int walkableClimb,
+ struct recast_heightfield *solid);
+
+void recast_filterWalkableLowHeightSpans(int walkableHeight, struct recast_heightfield *solid);
+
+void recast_filterLowHangingWalkableObstacles(const int walkableClimb, struct recast_heightfield *solid);
+
+struct recast_compactHeightfield *recast_newCompactHeightfield(void);
+
+void recast_destroyCompactHeightfield(struct recast_compactHeightfield *compactHeightfield);
+
+int recast_buildCompactHeightfield(const int walkableHeight, const int walkableClimb,
+ struct recast_heightfield *hf, struct recast_compactHeightfield *chf);
+
+int recast_erodeWalkableArea(int radius, struct recast_compactHeightfield *chf);
+
+int recast_buildDistanceField(struct recast_compactHeightfield *chf);
+
+int recast_buildRegions(struct recast_compactHeightfield *chf, int borderSize,
+ int minRegionSize, int mergeRegionSize);
+
+/* Contour set */
+
+struct recast_contourSet *recast_newContourSet(void);
+
+void recast_destroyContourSet(struct recast_contourSet *contourSet);
+
+int recast_buildContours(struct recast_compactHeightfield *chf,
+ const float maxError, const int maxEdgeLen, struct recast_contourSet *cset);
+
+/* Poly mesh */
+
+struct recast_polyMesh *recast_newPolyMesh(void);
+
+void recast_destroyPolyMesh(struct recast_polyMesh *polyMesh);
+
+int recast_buildPolyMesh(struct recast_contourSet *cset, int nvp, struct recast_polyMesh *mesh);
+
+unsigned short *recast_polyMeshGetVerts(struct recast_polyMesh *mesh, int *nverts);
+
+void recast_polyMeshGetBoundbox(struct recast_polyMesh *mesh, float *bmin, float *bmax);
+
+void recast_polyMeshGetCell(struct recast_polyMesh *mesh, float *cs, float *ch);
+
+unsigned short *recast_polyMeshGetPolys(struct recast_polyMesh *mesh, int *npolys, int *nvp);
+
+/* Poly mesh detail */
+
+struct recast_polyMeshDetail *recast_newPolyMeshDetail(void);
+
+void recast_destroyPolyMeshDetail(struct recast_polyMeshDetail *polyMeshDetail);
+
+int recast_buildPolyMeshDetail(const struct recast_polyMesh *mesh, const struct recast_compactHeightfield *chf,
+ const float sampleDist, const float sampleMaxError, struct recast_polyMeshDetail *dmesh);
+
+float *recast_polyMeshDetailGetVerts(struct recast_polyMeshDetail *mesh, int *nverts);
+
+unsigned char *recast_polyMeshDetailGetTris(struct recast_polyMeshDetail *mesh, int *ntris);
+
+unsigned int *recast_polyMeshDetailGetMeshes(struct recast_polyMeshDetail *mesh, int *nmeshes);
+
+/* utility function: quick sort reentrant */
+typedef int recast_cmp_t(void *ctx, const void *a, const void *b);
+
+void recast_qsort(void *a, size_t n, size_t es, void *thunk, recast_cmp_t *cmp);
+
#ifdef __cplusplus
}
#endif
diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt
index 25510ebd2a5..e321673b07d 100644
--- a/intern/audaspace/CMakeLists.txt
+++ b/intern/audaspace/CMakeLists.txt
@@ -23,7 +23,6 @@
set(INC
.
FX
- SRC
intern
../ffmpeg
)
@@ -67,6 +66,7 @@ set(SRC
FX/AUD_SuperposeFactory.cpp
FX/AUD_SuperposeReader.cpp
FX/AUD_VolumeFactory.cpp
+
intern/AUD_3DMath.h
intern/AUD_AnimateableProperty.cpp
intern/AUD_AnimateableProperty.h
@@ -99,6 +99,7 @@ set(SRC
intern/AUD_IWriter.h
intern/AUD_JOSResampleFactory.cpp
intern/AUD_JOSResampleFactory.h
+ intern/AUD_JOSResampleReaderCoeff.cpp
intern/AUD_JOSResampleReader.cpp
intern/AUD_JOSResampleReader.h
intern/AUD_LinearResampleFactory.cpp
@@ -260,20 +261,6 @@ if(WITH_CODEC_SNDFILE)
)
endif()
-if(WITH_SAMPLERATE)
- add_definitions(-DWITH_SAMPLERATE)
- list(APPEND INC_SYS
- ${SAMPLERATE_INCLUDE_DIRS}
- )
- list(APPEND SRC
- SRC/AUD_SRCResampleFactory.cpp
- SRC/AUD_SRCResampleReader.cpp
-
- SRC/AUD_SRCResampleFactory.h
- SRC/AUD_SRCResampleReader.h
- )
-endif()
-
if(WITH_FFTW3 AND FALSE)
add_definitions(-DWITH_FFTW3)
list(APPEND INC
diff --git a/intern/audaspace/Python/AUD_PyAPI.cpp b/intern/audaspace/Python/AUD_PyAPI.cpp
index 928c67c5196..3ec088053ca 100644
--- a/intern/audaspace/Python/AUD_PyAPI.cpp
+++ b/intern/audaspace/Python/AUD_PyAPI.cpp
@@ -848,6 +848,8 @@ Factory_filter(Factory* self, PyObject* args)
{
PyObject* py_b;
PyObject* py_a = NULL;
+ Py_ssize_t py_a_len;
+ Py_ssize_t py_b_len;
if(!PyArg_ParseTuple(args, "O|O:filter", &py_b, &py_a))
return NULL;
@@ -858,7 +860,10 @@ Factory_filter(Factory* self, PyObject* args)
return NULL;
}
- if(!PySequence_Size(py_b) || (py_a != NULL && !PySequence_Size(py_a)))
+ py_a_len= py_a ? PySequence_Size(py_a) : 0;
+ py_b_len= PySequence_Size(py_b);
+
+ if(!py_b_len || ((py_a != NULL) && !py_b_len))
{
PyErr_SetString(PyExc_ValueError, "The sequence has to contain at least one value!");
return NULL;
@@ -867,30 +872,31 @@ Factory_filter(Factory* self, PyObject* args)
std::vector<float> a, b;
PyObject* py_value;
float value;
- int result;
- for(int i = 0; i < PySequence_Size(py_b); i++)
+ for(Py_ssize_t i = 0; i < py_b_len; i++)
{
py_value = PySequence_GetItem(py_b, i);
- result = PyArg_Parse(py_value, "f:filter", &value);
+ value= (float)PyFloat_AsDouble(py_value);
Py_DECREF(py_value);
- if(!result)
+ if (value==-1.0f && PyErr_Occurred()) {
return NULL;
+ }
b.push_back(value);
}
if(py_a)
{
- for(int i = 0; i < PySequence_Size(py_a); i++)
+ for(Py_ssize_t i = 0; i < py_a_len; i++)
{
py_value = PySequence_GetItem(py_a, i);
- result = PyArg_Parse(py_value, "f:filter", &value);
+ value= (float)PyFloat_AsDouble(py_value);
Py_DECREF(py_value);
- if(!result)
+ if (value==-1.0f && PyErr_Occurred()) {
return NULL;
+ }
a.push_back(value);
}
diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript
index 67f859b0e5f..b8d5a56a625 100644
--- a/intern/audaspace/SConscript
+++ b/intern/audaspace/SConscript
@@ -2,8 +2,8 @@
Import ('env')
-sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp') + env.Glob('SRC/*.cpp')
-incs = '. intern FX SRC ' + env['BF_PTHREADS_INC'] + ' ' + env['BF_LIBSAMPLERATE_INC']
+sources = env.Glob('intern/*.cpp') + env.Glob('FX/*.cpp')
+incs = '. intern FX ' + env['BF_PTHREADS_INC']
defs = []
if env['WITH_BF_FFMPEG']:
@@ -44,7 +44,4 @@ if env['WITH_BF_PYTHON']:
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
-# not optional with scons yet
-defs.append('WITH_SAMPLERATE')
-
env.BlenderLib ('bf_intern_audaspace', sources, Split(incs), defs, libtype=['intern','player'], priority = [25,215] )
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp
index d5c3e368e28..af053df9c50 100644
--- a/intern/audaspace/intern/AUD_C-API.cpp
+++ b/intern/audaspace/intern/AUD_C-API.cpp
@@ -1094,9 +1094,11 @@ int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length, int samples_pe
specs.specs = reader->getSpecs();
int len;
float samplejump = specs.rate / samples_per_second;
- float min, max, power;
+ float min, max, power, overallmax;
bool eos;
+ overallmax = 0;
+
for(int i = 0; i < length; i++)
{
len = floor(samplejump * (i+1)) - floor(samplejump * i);
@@ -1121,6 +1123,11 @@ int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length, int samples_pe
buffer[i * 3 + 1] = max;
buffer[i * 3 + 2] = sqrt(power) / len;
+ if(overallmax < max)
+ overallmax = max;
+ if(overallmax < -min)
+ overallmax = -min;
+
if(eos)
{
length = i;
@@ -1128,6 +1135,14 @@ int AUD_readSound(AUD_Sound* sound, sample_t* buffer, int length, int samples_pe
}
}
+ if(overallmax > 1.0f)
+ {
+ for(int i = 0; i < length * 3; i++)
+ {
+ buffer[i] /= overallmax;
+ }
+ }
+
return length;
}
diff --git a/intern/audaspace/intern/AUD_SequencerReader.cpp b/intern/audaspace/intern/AUD_SequencerReader.cpp
index c468de19580..c8af1161530 100644
--- a/intern/audaspace/intern/AUD_SequencerReader.cpp
+++ b/intern/audaspace/intern/AUD_SequencerReader.cpp
@@ -132,8 +132,14 @@ void AUD_SequencerReader::read(int& length, bool& eos, sample_t* buffer)
while(eit != m_factory->m_entries.end())
{
- handle = new AUD_SequencerHandle(*eit, m_device);
- handles.push_front(handle);
+ try
+ {
+ handle = new AUD_SequencerHandle(*eit, m_device);
+ handles.push_front(handle);
+ }
+ catch(AUD_Exception&)
+ {
+ }
eit++;
}
diff --git a/intern/container/CTR_List.h b/intern/container/CTR_List.h
index 83252e05fae..79af9ea5abc 100644
--- a/intern/container/CTR_List.h
+++ b/intern/container/CTR_List.h
@@ -37,18 +37,18 @@
class CTR_Link {
public:
- CTR_Link(
+ CTR_Link(
) ;
- CTR_Link(
+ CTR_Link(
CTR_Link *next,
CTR_Link *prev
) ;
-
+
CTR_Link *
getNext(
) const ;
-
+
CTR_Link *
getPrev(
) const ;
@@ -76,14 +76,14 @@ public:
) ;
private:
- CTR_Link *m_next;
- CTR_Link *m_prev;
+ CTR_Link *m_next;
+ CTR_Link *m_prev;
};
class CTR_List {
public:
- CTR_List(
+ CTR_List(
) ;
CTR_Link *
@@ -103,10 +103,10 @@ public:
addTail(
CTR_Link *link
) ;
-
+
private:
- CTR_Link m_head;
- CTR_Link m_tail;
+ CTR_Link m_head;
+ CTR_Link m_tail;
};
#endif
diff --git a/intern/container/CTR_Map.h b/intern/container/CTR_Map.h
index 1991ec19e3a..08aa26eb9e2 100644
--- a/intern/container/CTR_Map.h
+++ b/intern/container/CTR_Map.h
@@ -37,24 +37,24 @@
template <class Key, class Value>
class CTR_Map {
private:
- struct Entry {
- Entry (Entry *next, Key key, Value value) :
- m_next(next),
- m_key(key),
- m_value(value) {}
-
- Entry *m_next;
- Key m_key;
- Value m_value;
- };
-
+ struct Entry {
+ Entry (Entry *next, Key key, Value value) :
+ m_next(next),
+ m_key(key),
+ m_value(value) {}
+
+ Entry *m_next;
+ Key m_key;
+ Value m_value;
+ };
+
public:
- CTR_Map(int num_buckets = 100) : m_num_buckets(num_buckets) {
- m_buckets = new Entry *[num_buckets];
- for (int i = 0; i < num_buckets; ++i) {
- m_buckets[i] = 0;
- }
- }
+ CTR_Map(int num_buckets = 100) : m_num_buckets(num_buckets) {
+ m_buckets = new Entry *[num_buckets];
+ for (int i = 0; i < num_buckets; ++i) {
+ m_buckets[i] = 0;
+ }
+ }
CTR_Map(const CTR_Map& map)
{
@@ -68,114 +68,114 @@ public:
insert(entry->m_key, entry->m_value);
}
}
-
- int size() {
- int count=0;
- for (int i=0;i<m_num_buckets;i++)
- {
- Entry* bucket = m_buckets[i];
- while(bucket)
- {
- bucket = bucket->m_next;
- count++;
- }
- }
- return count;
- }
-
- Value* at(int index) {
- int count=0;
- for (int i=0;i<m_num_buckets;i++)
- {
- Entry* bucket = m_buckets[i];
- while(bucket)
- {
- if (count==index)
- {
- return &bucket->m_value;
- }
- bucket = bucket->m_next;
- count++;
- }
- }
- return 0;
- }
-
- Key* getKey(int index) {
- int count=0;
- for (int i=0;i<m_num_buckets;i++)
- {
- Entry* bucket = m_buckets[i];
- while(bucket)
- {
- if (count==index)
- {
- return &bucket->m_key;
- }
- bucket = bucket->m_next;
- count++;
- }
- }
- return 0;
- }
-
- void clear() {
- for (int i = 0; i < m_num_buckets; ++i) {
- Entry *entry_ptr = m_buckets[i];
-
- while (entry_ptr != 0) {
- Entry *tmp_ptr = entry_ptr->m_next;
- delete entry_ptr;
- entry_ptr = tmp_ptr;
- }
- m_buckets[i] = 0;
- }
- }
-
- ~CTR_Map() {
- clear();
- delete [] m_buckets;
- }
-
- void insert(const Key& key, const Value& value) {
- Entry *entry_ptr = m_buckets[key.hash() % m_num_buckets];
- while ((entry_ptr != 0) && !(key == entry_ptr->m_key)) {
- entry_ptr = entry_ptr->m_next;
- }
-
- if (entry_ptr != 0) {
- entry_ptr->m_value = value;
- }
- else {
- Entry **bucket = &m_buckets[key.hash() % m_num_buckets];
- *bucket = new Entry(*bucket, key, value);
- }
- }
-
- void remove(const Key& key) {
- Entry **entry_ptr = &m_buckets[key.hash() % m_num_buckets];
- while ((*entry_ptr != 0) && !(key == (*entry_ptr)->m_key)) {
- entry_ptr = &(*entry_ptr)->m_next;
- }
-
- if (*entry_ptr != 0) {
- Entry *tmp_ptr = (*entry_ptr)->m_next;
- delete *entry_ptr;
- *entry_ptr = tmp_ptr;
- }
- }
-
- Value *operator[](Key key) {
- Entry *bucket = m_buckets[key.hash() % m_num_buckets];
- while ((bucket != 0) && !(key == bucket->m_key)) {
- bucket = bucket->m_next;
- }
- return bucket != 0 ? &bucket->m_value : 0;
- }
-
+
+ int size() {
+ int count=0;
+ for (int i=0;i<m_num_buckets;i++)
+ {
+ Entry* bucket = m_buckets[i];
+ while(bucket)
+ {
+ bucket = bucket->m_next;
+ count++;
+ }
+ }
+ return count;
+ }
+
+ Value* at(int index) {
+ int count=0;
+ for (int i=0;i<m_num_buckets;i++)
+ {
+ Entry* bucket = m_buckets[i];
+ while(bucket)
+ {
+ if (count==index)
+ {
+ return &bucket->m_value;
+ }
+ bucket = bucket->m_next;
+ count++;
+ }
+ }
+ return 0;
+ }
+
+ Key* getKey(int index) {
+ int count=0;
+ for (int i=0;i<m_num_buckets;i++)
+ {
+ Entry* bucket = m_buckets[i];
+ while(bucket)
+ {
+ if (count==index)
+ {
+ return &bucket->m_key;
+ }
+ bucket = bucket->m_next;
+ count++;
+ }
+ }
+ return 0;
+ }
+
+ void clear() {
+ for (int i = 0; i < m_num_buckets; ++i) {
+ Entry *entry_ptr = m_buckets[i];
+
+ while (entry_ptr != 0) {
+ Entry *tmp_ptr = entry_ptr->m_next;
+ delete entry_ptr;
+ entry_ptr = tmp_ptr;
+ }
+ m_buckets[i] = 0;
+ }
+ }
+
+ ~CTR_Map() {
+ clear();
+ delete [] m_buckets;
+ }
+
+ void insert(const Key& key, const Value& value) {
+ Entry *entry_ptr = m_buckets[key.hash() % m_num_buckets];
+ while ((entry_ptr != 0) && !(key == entry_ptr->m_key)) {
+ entry_ptr = entry_ptr->m_next;
+ }
+
+ if (entry_ptr != 0) {
+ entry_ptr->m_value = value;
+ }
+ else {
+ Entry **bucket = &m_buckets[key.hash() % m_num_buckets];
+ *bucket = new Entry(*bucket, key, value);
+ }
+ }
+
+ void remove(const Key& key) {
+ Entry **entry_ptr = &m_buckets[key.hash() % m_num_buckets];
+ while ((*entry_ptr != 0) && !(key == (*entry_ptr)->m_key)) {
+ entry_ptr = &(*entry_ptr)->m_next;
+ }
+
+ if (*entry_ptr != 0) {
+ Entry *tmp_ptr = (*entry_ptr)->m_next;
+ delete *entry_ptr;
+ *entry_ptr = tmp_ptr;
+ }
+ }
+
+ Value *operator[](Key key) {
+ Entry *bucket = m_buckets[key.hash() % m_num_buckets];
+ while ((bucket != 0) && !(key == bucket->m_key)) {
+ bucket = bucket->m_next;
+ }
+ return bucket != 0 ? &bucket->m_value : 0;
+ }
+
private:
- int m_num_buckets;
- Entry **m_buckets;
+ int m_num_buckets;
+ Entry **m_buckets;
};
#endif
diff --git a/intern/elbeem/intern/loop_tools.h b/intern/elbeem/intern/loop_tools.h
index 10514251f1e..f06fa7c2861 100644
--- a/intern/elbeem/intern/loop_tools.h
+++ b/intern/elbeem/intern/loop_tools.h
@@ -119,8 +119,8 @@
} \
\
const int Nj = mLevel[mMaxRefine].lSizey; \
- int jstart = 0+( id * (Nj / Nthrds) ); \
- int jend = 0+( (id+1) * (Nj / Nthrds) ); \
+ int jstart = 0+( (id * Nj ) / Nthrds ); \
+ int jend = 0+(((id+1) * Nj ) / Nthrds ); \
if( ((Nj/Nthrds) *Nthrds) != Nj) { \
errMsg("LbmFsgrSolver","Invalid domain size Nj="<<Nj<<" Nthrds="<<Nthrds); \
} \
diff --git a/intern/elbeem/intern/ntl_world.cpp b/intern/elbeem/intern/ntl_world.cpp
index 38b8cc3518c..42ee94b2cf5 100644
--- a/intern/elbeem/intern/ntl_world.cpp
+++ b/intern/elbeem/intern/ntl_world.cpp
@@ -216,7 +216,6 @@ void ntlWorld::finishWorldInit()
}
long stopTime = getTime();
- mSimulationTime += (*mpSims)[mFirstSim]->getStartTime();
debMsgStd("ntlWorld::ntlWorld",DM_MSG,"Time for start-sims:"<< getTimeString(stopTime-startTime) , 1);
#ifndef NOGUI
guiResetSimulationTimeRange( mSimulationTime );
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index d8172902a4c..a23dd22f932 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -25,6 +25,15 @@
#include <libavformat/avformat.h>
+
+
+/* check our ffmpeg is new enough, avoids user complaints */
+#if (LIBAVFORMAT_VERSION_MAJOR < 52) || ((LIBAVFORMAT_VERSION_MAJOR == 52) && (LIBAVFORMAT_VERSION_MINOR <= 64))
+# error "FFmpeg 0.7 or newer is needed, Upgrade you're FFmpeg or disable it"
+#endif
+/* end sanity check */
+
+
#include <libavcodec/avcodec.h>
#include <libavutil/rational.h>
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index bdda0f3382e..e028c4e6912 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -248,9 +248,10 @@ elseif(UNIX)
endif()
elseif(WIN32)
- if(MSVC)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
- endif()
+ ## Warnings as errors, this is too strict!
+ #if(MSVC)
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
+ #endif()
list(APPEND INC_SYS
${WINTAB_INC}
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index f24ab00acd3..dd399a7aa95 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -96,14 +96,14 @@ typedef enum {
} GHOST_TFireTimeConstant;
typedef enum {
- GHOST_kModifierKeyLeftShift = 0,
- GHOST_kModifierKeyRightShift,
- GHOST_kModifierKeyLeftAlt,
- GHOST_kModifierKeyRightAlt,
- GHOST_kModifierKeyLeftControl,
- GHOST_kModifierKeyRightControl,
- GHOST_kModifierKeyOS,
- GHOST_kModifierKeyNumMasks
+ GHOST_kModifierKeyLeftShift = 0,
+ GHOST_kModifierKeyRightShift,
+ GHOST_kModifierKeyLeftAlt,
+ GHOST_kModifierKeyRightAlt,
+ GHOST_kModifierKeyLeftControl,
+ GHOST_kModifierKeyRightControl,
+ GHOST_kModifierKeyOS,
+ GHOST_kModifierKeyNumMasks
} GHOST_TModifierKeyMask;
diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript
index 82f65c1c8ae..39757c873d8 100644
--- a/intern/ghost/SConscript
+++ b/intern/ghost/SConscript
@@ -26,7 +26,7 @@ if env['WITH_GHOST_SDL']:
pass
incs += ' ' + env['BF_SDL_INC']
defs += ['WITH_GHOST_SDL']
-elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'irix6', 'aix4', 'aix5'):
+elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'freebsd9', 'aix4', 'aix5'):
for f in pf:
try:
sources.remove('intern' + os.sep + f + 'Win32.cpp')
@@ -34,7 +34,12 @@ elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'f
sources.remove('intern' + os.sep + f + 'SDL.cpp')
except ValueError:
pass
- defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
+ ## removing because scons does not support system installation
+ ## if this is used for blender.org builds it means our distrobution
+ ## will find any locally installed blender and double up its script path.
+ ## So until this is supported properly as with CMake,
+ ## just dont use the PREFIX.
+ # defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
defs += ['WITH_X11_XINPUT'] # XXX, make an option
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
@@ -100,6 +105,11 @@ if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-v
incs = env['BF_WINTAB_INC'] + ' ' + incs
if window_system in ('win32-vc', 'win64-vc'):
- env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15]) #, cc_compileflags=env['CCFLAGS'].append('/WX') )
+ env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15]) #, cc_compileflags=env['CCFLAGS'].append('/WX') )
+
+elif env['WITH_GHOST_COCOA']: # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet
+ env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15], cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/g++-4.2' )
+ print "GHOST COCOA WILL BE COMPILED WITH APPLE GCC"
+
else:
- env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] )
+ env.BlenderLib ('bf_intern_ghost', sources, Split(incs), defines=defs, libtype=['intern','player'], priority = [40,15] )
diff --git a/intern/ghost/intern/GHOST_Buttons.h b/intern/ghost/intern/GHOST_Buttons.h
index bf5bdb19d7f..d231a254596 100644
--- a/intern/ghost/intern/GHOST_Buttons.h
+++ b/intern/ghost/intern/GHOST_Buttons.h
@@ -44,35 +44,35 @@
* @date May 15, 2001
*/
struct GHOST_Buttons {
- /**
- * Constructor.
- */
- GHOST_Buttons();
+ /**
+ * Constructor.
+ */
+ GHOST_Buttons();
virtual ~GHOST_Buttons();
-
- /**
- * Returns the state of a single button.
- * @param mask. Key button to return.
- * @return The state of the button (pressed == true).
- */
- virtual bool get(GHOST_TButtonMask mask) const;
-
- /**
- * Updates the state of a single button.
- * @param mask. Button state to update.
- * @param down. The new state of the button.
- */
- virtual void set(GHOST_TButtonMask mask, bool down);
-
- /**
- * Sets the state of all buttons to up.
- */
- virtual void clear();
-
- GHOST_TUns8 m_ButtonLeft : 1;
- GHOST_TUns8 m_ButtonMiddle : 1;
- GHOST_TUns8 m_ButtonRight : 1;
+
+ /**
+ * Returns the state of a single button.
+ * @param mask. Key button to return.
+ * @return The state of the button (pressed == true).
+ */
+ virtual bool get(GHOST_TButtonMask mask) const;
+
+ /**
+ * Updates the state of a single button.
+ * @param mask. Button state to update.
+ * @param down. The new state of the button.
+ */
+ virtual void set(GHOST_TButtonMask mask, bool down);
+
+ /**
+ * Sets the state of all buttons to up.
+ */
+ virtual void clear();
+
+ GHOST_TUns8 m_ButtonLeft : 1;
+ GHOST_TUns8 m_ButtonMiddle : 1;
+ GHOST_TUns8 m_ButtonRight : 1;
};
#endif // _GHOST_BUTTONS_H_
diff --git a/intern/ghost/intern/GHOST_DropTargetWin32.h b/intern/ghost/intern/GHOST_DropTargetWin32.h
index 980e9f9fe9b..7179c295a98 100644
--- a/intern/ghost/intern/GHOST_DropTargetWin32.h
+++ b/intern/ghost/intern/GHOST_DropTargetWin32.h
@@ -53,7 +53,7 @@ public:
ULONG __stdcall Release (void);
/* IDropTarget implementation
- + The IDropTarget interface is one of the interfaces you implement to
+ + The IDropTarget interface is one of the interfaces you implement to
provide drag-and-drop operations in your application. It contains methods
used in any application that can be a target for data during a
drag-and-drop operation. A drop-target application is responsible for:
diff --git a/intern/ghost/intern/GHOST_EventManager.h b/intern/ghost/intern/GHOST_EventManager.h
index 9e68a13fd74..3dc751507d6 100644
--- a/intern/ghost/intern/GHOST_EventManager.h
+++ b/intern/ghost/intern/GHOST_EventManager.h
@@ -127,9 +127,9 @@ public:
* Removes all events for a window from the stack.
* @param window The window to remove events for.
*/
- virtual void
- removeWindowEvents(
- GHOST_IWindow* window
+ virtual void
+ removeWindowEvents(
+ GHOST_IWindow* window
);
/**
diff --git a/intern/ghost/intern/GHOST_ModifierKeys.h b/intern/ghost/intern/GHOST_ModifierKeys.h
index 08fe277d55a..0109fe7b7c6 100644
--- a/intern/ghost/intern/GHOST_ModifierKeys.h
+++ b/intern/ghost/intern/GHOST_ModifierKeys.h
@@ -44,10 +44,10 @@
*/
struct GHOST_ModifierKeys
{
- /**
- * Constructor.
- */
- GHOST_ModifierKeys();
+ /**
+ * Constructor.
+ */
+ GHOST_ModifierKeys();
virtual ~GHOST_ModifierKeys();
@@ -58,25 +58,25 @@ struct GHOST_ModifierKeys
*/
static GHOST_TKey getModifierKeyCode(GHOST_TModifierKeyMask mask);
-
- /**
- * Returns the state of a single modifier key.
- * @param mask. Key state to return.
- * @return The state of the key (pressed == true).
- */
- virtual bool get(GHOST_TModifierKeyMask mask) const;
-
- /**
- * Updates the state of a single modifier key.
- * @param mask. Key state to update.
- * @param down. The new state of the key.
- */
- virtual void set(GHOST_TModifierKeyMask mask, bool down);
-
- /**
- * Sets the state of all modifier keys to up.
- */
- virtual void clear();
+
+ /**
+ * Returns the state of a single modifier key.
+ * @param mask. Key state to return.
+ * @return The state of the key (pressed == true).
+ */
+ virtual bool get(GHOST_TModifierKeyMask mask) const;
+
+ /**
+ * Updates the state of a single modifier key.
+ * @param mask. Key state to update.
+ * @param down. The new state of the key.
+ */
+ virtual void set(GHOST_TModifierKeyMask mask, bool down);
+
+ /**
+ * Sets the state of all modifier keys to up.
+ */
+ virtual void clear();
/**
* Determines whether to modifier key states are equal.
@@ -84,21 +84,21 @@ struct GHOST_ModifierKeys
* @return Indication of equality.
*/
virtual bool equals(const GHOST_ModifierKeys& keys) const;
-
- /** Bitfield that stores the appropriate key state. */
- GHOST_TUns8 m_LeftShift : 1;
- /** Bitfield that stores the appropriate key state. */
- GHOST_TUns8 m_RightShift : 1;
- /** Bitfield that stores the appropriate key state. */
- GHOST_TUns8 m_LeftAlt : 1;
- /** Bitfield that stores the appropriate key state. */
- GHOST_TUns8 m_RightAlt : 1;
- /** Bitfield that stores the appropriate key state. */
- GHOST_TUns8 m_LeftControl : 1;
- /** Bitfield that stores the appropriate key state. */
- GHOST_TUns8 m_RightControl : 1;
- /** Bitfield that stores the appropriate key state. */
- GHOST_TUns8 m_OS : 1;
+
+ /** Bitfield that stores the appropriate key state. */
+ GHOST_TUns8 m_LeftShift : 1;
+ /** Bitfield that stores the appropriate key state. */
+ GHOST_TUns8 m_RightShift : 1;
+ /** Bitfield that stores the appropriate key state. */
+ GHOST_TUns8 m_LeftAlt : 1;
+ /** Bitfield that stores the appropriate key state. */
+ GHOST_TUns8 m_RightAlt : 1;
+ /** Bitfield that stores the appropriate key state. */
+ GHOST_TUns8 m_LeftControl : 1;
+ /** Bitfield that stores the appropriate key state. */
+ GHOST_TUns8 m_RightControl : 1;
+ /** Bitfield that stores the appropriate key state. */
+ GHOST_TUns8 m_OS : 1;
};
#endif // _GHOST_MODIFIER_KEYS_H_
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index c1e70916be6..e5ec8681de1 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -250,7 +250,7 @@ public:
virtual inline GHOST_WindowManager* getWindowManager() const;
#ifdef WITH_INPUT_NDOF
- /**
+ /**
* Returns a pointer to our n-degree of freedeom manager.
* @return A pointer to our n-degree of freedeom manager.
*/
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp
index e02e569cc6e..02ff5c0f559 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp
@@ -394,7 +394,7 @@ GHOST_TUns8 GHOST_SystemCarbon::getNumDisplays() const
void GHOST_SystemCarbon::getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const
{
BitMap screenBits;
- Rect bnds = GetQDGlobalsScreenBits(&screenBits)->bounds;
+ Rect bnds = GetQDGlobalsScreenBits(&screenBits)->bounds;
width = bnds.right - bnds.left;
height = bnds.bottom - bnds.top;
}
@@ -413,28 +413,28 @@ GHOST_IWindow* GHOST_SystemCarbon::createWindow(
const GHOST_TEmbedderWindowID parentWindow
)
{
- GHOST_IWindow* window = 0;
+ GHOST_IWindow* window = 0;
window = new GHOST_WindowCarbon (title, left, top, width, height, state, type);
- if (window) {
- if (window->getValid()) {
- // Store the pointer to the window
- GHOST_ASSERT(m_windowManager, "m_windowManager not initialized");
- m_windowManager->addWindow(window);
- m_windowManager->setActiveWindow(window);
- pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window));
- }
- else {
+ if (window) {
+ if (window->getValid()) {
+ // Store the pointer to the window
+ GHOST_ASSERT(m_windowManager, "m_windowManager not initialized");
+ m_windowManager->addWindow(window);
+ m_windowManager->setActiveWindow(window);
+ pushEvent(new GHOST_Event(getMilliSeconds(), GHOST_kEventWindowSize, window));
+ }
+ else {
GHOST_PRINT("GHOST_SystemCarbon::createWindow(): window invalid\n");
- delete window;
- window = 0;
- }
- }
+ delete window;
+ window = 0;
+ }
+ }
else {
GHOST_PRINT("GHOST_SystemCarbon::createWindow(): could not create window\n");
}
- return window;
+ return window;
}
GHOST_TSuccess GHOST_SystemCarbon::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual)
@@ -522,19 +522,19 @@ bool GHOST_SystemCarbon::processEvents(bool waitForEvent)
}
} while (waitForEvent && !anyProcessed);
- return anyProcessed;
+ return anyProcessed;
}
GHOST_TSuccess GHOST_SystemCarbon::getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const
{
- Point mouseLoc;
- // Get the position of the mouse in the active port
- ::GetGlobalMouse(&mouseLoc);
- // Convert the coordinates to screen coordinates
- x = (GHOST_TInt32)mouseLoc.h;
- y = (GHOST_TInt32)mouseLoc.v;
- return GHOST_kSuccess;
+ Point mouseLoc;
+ // Get the position of the mouse in the active port
+ ::GetGlobalMouse(&mouseLoc);
+ // Convert the coordinates to screen coordinates
+ x = (GHOST_TInt32)mouseLoc.h;
+ y = (GHOST_TInt32)mouseLoc.v;
+ return GHOST_kSuccess;
}
@@ -552,29 +552,29 @@ GHOST_TSuccess GHOST_SystemCarbon::setCursorPosition(GHOST_TInt32 x, GHOST_TInt3
// this call below sends event, but empties other events (like shift)
// CGPostMouseEvent(CGPointMake(xf, yf), TRUE, 1, FALSE, 0);
- return GHOST_kSuccess;
+ return GHOST_kSuccess;
}
GHOST_TSuccess GHOST_SystemCarbon::getModifierKeys(GHOST_ModifierKeys& keys) const
{
- UInt32 modifiers = ::GetCurrentKeyModifiers();
+ UInt32 modifiers = ::GetCurrentKeyModifiers();
- keys.set(GHOST_kModifierKeyOS, (modifiers & cmdKey) ? true : false);
- keys.set(GHOST_kModifierKeyLeftAlt, (modifiers & optionKey) ? true : false);
- keys.set(GHOST_kModifierKeyLeftShift, (modifiers & shiftKey) ? true : false);
- keys.set(GHOST_kModifierKeyLeftControl, (modifiers & controlKey) ? true : false);
+ keys.set(GHOST_kModifierKeyOS, (modifiers & cmdKey) ? true : false);
+ keys.set(GHOST_kModifierKeyLeftAlt, (modifiers & optionKey) ? true : false);
+ keys.set(GHOST_kModifierKeyLeftShift, (modifiers & shiftKey) ? true : false);
+ keys.set(GHOST_kModifierKeyLeftControl, (modifiers & controlKey) ? true : false);
- return GHOST_kSuccess;
+ return GHOST_kSuccess;
}
- /* XXX, incorrect for multibutton mice */
+/* XXX, incorrect for multibutton mice */
GHOST_TSuccess GHOST_SystemCarbon::getButtons(GHOST_Buttons& buttons) const
{
- Boolean theOnlyButtonIsDown = ::Button();
- buttons.clear();
- buttons.set(GHOST_kButtonMaskLeft, theOnlyButtonIsDown);
- return GHOST_kSuccess;
+ Boolean theOnlyButtonIsDown = ::Button();
+ buttons.clear();
+ buttons.set(GHOST_kButtonMaskLeft, theOnlyButtonIsDown);
+ return GHOST_kSuccess;
}
#define FIRSTFILEBUFLG 512
@@ -659,35 +659,35 @@ OSErr GHOST_SystemCarbon::sAEHandlerQuit(const AppleEvent *event, AppleEvent *re
GHOST_TSuccess GHOST_SystemCarbon::init()
{
-
- GHOST_TSuccess success = GHOST_System::init();
- if (success) {
+
+ GHOST_TSuccess success = GHOST_System::init();
+ if (success) {
/*
- * Initialize the cursor to the standard arrow shape (so that we can change it later on).
- * This initializes the cursor's visibility counter to 0.
- */
- ::InitCursor();
+ * Initialize the cursor to the standard arrow shape (so that we can change it later on).
+ * This initializes the cursor's visibility counter to 0.
+ */
+ ::InitCursor();
MenuRef windMenu;
::CreateStandardWindowMenu(0, &windMenu);
::InsertMenu(windMenu, 0);
::DrawMenuBar();
- ::InstallApplicationEventHandler(sEventHandlerProc, GetEventTypeCount(kEvents), kEvents, this, &m_handler);
+ ::InstallApplicationEventHandler(sEventHandlerProc, GetEventTypeCount(kEvents), kEvents, this, &m_handler);
::AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, sAEHandlerLaunch, (SInt32) this, false);
::AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, sAEHandlerOpenDocs, (SInt32) this, false);
::AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, sAEHandlerPrintDocs, (SInt32) this, false);
::AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, sAEHandlerQuit, (SInt32) this, false);
- }
- return success;
+ }
+ return success;
}
GHOST_TSuccess GHOST_SystemCarbon::exit()
{
- return GHOST_System::exit();
+ return GHOST_System::exit();
}
@@ -847,11 +847,11 @@ OSStatus GHOST_SystemCarbon::handleMouseEvent(EventRef event)
err = noErr;
}
}
- break;
+ break;
case kEventMouseMoved:
case kEventMouseDragged: {
- Point mousePos;
+ Point mousePos;
if (window) {
//handle any tablet events that may have come with the mouse event (optional)
@@ -860,7 +860,7 @@ OSStatus GHOST_SystemCarbon::handleMouseEvent(EventRef event)
::GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &mousePos);
pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, mousePos.h, mousePos.v));
err = noErr;
- }
+ }
break;
}
case kEventMouseWheelMoved:
@@ -1094,38 +1094,38 @@ bool GHOST_SystemCarbon::handleMenuCommand(GHOST_TInt32 menuResult)
}
::HiliteMenu(0);
- return handled;
+ return handled;
}
OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData)
{
GHOST_SystemCarbon* sys = (GHOST_SystemCarbon*) userData;
- OSStatus err = eventNotHandledErr;
+ OSStatus err = eventNotHandledErr;
GHOST_IWindow* window;
#ifdef WITH_INPUT_NDOF
GHOST_TEventNDOFData data;
#endif
UInt32 kind;
- switch (::GetEventClass(event))
- {
+ switch (::GetEventClass(event))
+ {
case kEventClassAppleEvent:
EventRecord eventrec;
if (ConvertEventRefToEventRecord(event, &eventrec)) {
err = AEProcessAppleEvent(&eventrec);
}
break;
- case kEventClassMouse:
- err = sys->handleMouseEvent(event);
- break;
+ case kEventClassMouse:
+ err = sys->handleMouseEvent(event);
+ break;
case kEventClassWindow:
err = sys->handleWindowEvent(event);
break;
case kEventClassKeyboard:
err = sys->handleKeyEvent(event);
break;
- case kEventClassBlender :
+ case kEventClassBlender :
#ifdef WITH_INPUT_NDOF
window = sys->m_windowManager->getActiveWindow();
sys->m_ndofManager->GHOST_NDOFGetDatas(data);
@@ -1146,11 +1146,11 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even
err = noErr;
break;
default :
- ;
+ ;
break;
- }
+ }
- return err;
+ return err;
}
GHOST_TUns8* GHOST_SystemCarbon::getClipboard(bool selection) const
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.h b/intern/ghost/intern/GHOST_SystemCarbon.h
index b0cf622f709..dd21d033c6f 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.h
+++ b/intern/ghost/intern/GHOST_SystemCarbon.h
@@ -55,16 +55,16 @@ class GHOST_EventWindow;
*/
class GHOST_SystemCarbon : public GHOST_System {
public:
- /**
- * Constructor.
- */
- GHOST_SystemCarbon();
-
- /**
- * Destructor.
- */
- ~GHOST_SystemCarbon();
-
+ /**
+ * Constructor.
+ */
+ GHOST_SystemCarbon();
+
+ /**
+ * Destructor.
+ */
+ ~GHOST_SystemCarbon();
+
/***************************************************************************************
** Time(r) functionality
***************************************************************************************/
@@ -211,54 +211,54 @@ protected:
virtual GHOST_TSuccess exit();
- /**
- * Handles a tablet event.
- * @param event A Mac event.
- * @return Indication whether the event was handled.
- */
- OSStatus handleTabletEvent(EventRef event);
- /**
- * Handles a mouse event.
- * @param event A Mac event.
- * @return Indication whether the event was handled.
- */
- OSStatus handleMouseEvent(EventRef event);
-
- /**
- * Handles a key event.
- * @param event A Mac event.
- * @return Indication whether the event was handled.
- */
- OSStatus handleKeyEvent(EventRef event);
-
- /**
- * Handles a window event.
- * @param event A Mac event.
- * @return Indication whether the event was handled.
- */
- OSStatus handleWindowEvent(EventRef event);
-
- /**
- * Handles all basic Mac application stuff for a mouse down event.
- * @param event A Mac event.
- * @return Indication whether the event was handled.
- */
- bool handleMouseDown(EventRef event);
-
- /**
- * Handles a Mac menu command.
- * @param menuResult A Mac menu/item identifier.
- * @return Indication whether the event was handled.
- */
- bool handleMenuCommand(GHOST_TInt32 menuResult);
-
- /* callback for blender generated events */
-// static OSStatus blendEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData);
-
-
- /**
- * Callback for Carbon when it has events.
- */
+ /**
+ * Handles a tablet event.
+ * @param event A Mac event.
+ * @return Indication whether the event was handled.
+ */
+ OSStatus handleTabletEvent(EventRef event);
+ /**
+ * Handles a mouse event.
+ * @param event A Mac event.
+ * @return Indication whether the event was handled.
+ */
+ OSStatus handleMouseEvent(EventRef event);
+
+ /**
+ * Handles a key event.
+ * @param event A Mac event.
+ * @return Indication whether the event was handled.
+ */
+ OSStatus handleKeyEvent(EventRef event);
+
+ /**
+ * Handles a window event.
+ * @param event A Mac event.
+ * @return Indication whether the event was handled.
+ */
+ OSStatus handleWindowEvent(EventRef event);
+
+ /**
+ * Handles all basic Mac application stuff for a mouse down event.
+ * @param event A Mac event.
+ * @return Indication whether the event was handled.
+ */
+ bool handleMouseDown(EventRef event);
+
+ /**
+ * Handles a Mac menu command.
+ * @param menuResult A Mac menu/item identifier.
+ * @return Indication whether the event was handled.
+ */
+ bool handleMenuCommand(GHOST_TInt32 menuResult);
+
+ /* callback for blender generated events */
+ // static OSStatus blendEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData);
+
+
+ /**
+ * Callback for Carbon when it has events.
+ */
static OSStatus sEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData);
/** Apple Event Handlers */
@@ -267,23 +267,23 @@ protected:
static OSErr sAEHandlerPrintDocs(const AppleEvent *event, AppleEvent *reply, SInt32 refCon);
static OSErr sAEHandlerQuit(const AppleEvent *event, AppleEvent *reply, SInt32 refCon);
- /**
- * Callback for Mac Timer tasks that expire.
- * @param tmTask Pointer to the timer task that expired.
- */
- //static void s_timerCallback(TMTaskPtr tmTask);
-
- /** Event handler reference. */
- EventHandlerRef m_handler;
+ /**
+ * Callback for Mac Timer tasks that expire.
+ * @param tmTask Pointer to the timer task that expired.
+ */
+ //static void s_timerCallback(TMTaskPtr tmTask);
+
+ /** Event handler reference. */
+ EventHandlerRef m_handler;
/** Start time at initialization. */
GHOST_TUns64 m_start_time;
- /** State of the modifiers. */
- UInt32 m_modifierMask;
+ /** State of the modifiers. */
+ UInt32 m_modifierMask;
- /** Ignores window size messages (when window is dragged). */
- bool m_ignoreWindowSizedMessages;
+ /** Ignores window size messages (when window is dragged). */
+ bool m_ignoreWindowSizedMessages;
};
#endif // _GHOST_SYSTEM_CARBON_H_
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index d20aed63f42..fc4f02e3fd6 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -52,16 +52,16 @@ class GHOST_WindowCocoa;
class GHOST_SystemCocoa : public GHOST_System {
public:
- /**
- * Constructor.
- */
- GHOST_SystemCocoa();
-
- /**
- * Destructor.
- */
- ~GHOST_SystemCocoa();
-
+ /**
+ * Constructor.
+ */
+ GHOST_SystemCocoa();
+
+ /**
+ * Destructor.
+ */
+ ~GHOST_SystemCocoa();
+
/***************************************************************************************
** Time(r) functionality
***************************************************************************************/
@@ -92,7 +92,7 @@ public:
/**
* Create a new window.
- * The new window is added to the list of windows managed.
+ * The new window is added to the list of windows managed.
* Never explicitly delete the window, use disposeWindow() instead.
* @param title The name of the window (displayed in the title bar of the window if the OS supports it).
* @param left The coordinate of the left edge of the window.
@@ -107,17 +107,17 @@ public:
* @return The new window (or 0 if creation failed).
*/
virtual GHOST_IWindow* createWindow(
- const STR_String& title,
- GHOST_TInt32 left,
- GHOST_TInt32 top,
- GHOST_TUns32 width,
- GHOST_TUns32 height,
- GHOST_TWindowState state,
- GHOST_TDrawingContextType type,
- const bool stereoVisual = false,
- const GHOST_TUns16 numOfAASamples = 0,
- const GHOST_TEmbedderWindowID parentWindow = 0
- );
+ const STR_String& title,
+ GHOST_TInt32 left,
+ GHOST_TInt32 top,
+ GHOST_TUns32 width,
+ GHOST_TUns32 height,
+ GHOST_TWindowState state,
+ GHOST_TDrawingContextType type,
+ const bool stereoVisual = false,
+ const GHOST_TUns16 numOfAASamples = 0,
+ const GHOST_TEmbedderWindowID parentWindow = 0
+ );
/***************************************************************************************
** Event management functionality
@@ -140,19 +140,19 @@ public:
* Handle Cocoa openFile event
* Display confirmation request panel if changes performed since last save
*/
- bool handleOpenDocumentRequest(void *filepathStr);
+ bool handleOpenDocumentRequest(void *filepathStr);
/**
- * Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass
- * @param eventType The type of drag'n'drop event
+ * Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass
+ * @param eventType The type of drag'n'drop event
* @param draggedObjectType The type object concerned (currently array of file names, string, TIFF image)
* @param mouseX x mouse coordinate (in cocoa base window coordinates)
* @param mouseY y mouse coordinate
* @param window The window on which the event occurred
- * @return Indication whether the event was handled.
- */
+ * @return Indication whether the event was handled.
+ */
GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,
- GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data);
+ GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data);
/***************************************************************************************
** Cursor management functionality
@@ -207,18 +207,18 @@ public:
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
/**
- * Handles a window event. Called by GHOST_WindowCocoa window delegate
- * @param eventType The type of window event
+ * Handles a window event. Called by GHOST_WindowCocoa window delegate
+ * @param eventType The type of window event
* @param window The window on which the event occurred
- * @return Indication whether the event was handled.
- */
- GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window);
+ * @return Indication whether the event was handled.
+ */
+ GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window);
/**
- * Handles the Cocoa event telling the application has become active (again)
- * @return Indication whether the event was handled.
- */
- GHOST_TSuccess handleApplicationBecomeActiveEvent();
+ * Handles the Cocoa event telling the application has become active (again)
+ * @return Indication whether the event was handled.
+ */
+ GHOST_TSuccess handleApplicationBecomeActiveEvent();
/**
* External objects should call this when they send an event outside processEvents.
@@ -239,28 +239,28 @@ protected:
*/
virtual GHOST_TSuccess init();
- /**
- * Handles a tablet event.
- * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
+ /**
+ * Handles a tablet event.
+ * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
* @param eventType The type of the event. It needs to be passed separately as it can be either directly in the event type, or as a subtype if combined with a mouse button event
- * @return Indication whether the event was handled.
- */
- GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType);
-
+ * @return Indication whether the event was handled.
+ */
+ GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType);
+
+ /**
+ * Handles a mouse event.
+ * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
+ * @return Indication whether the event was handled.
+ */
+ GHOST_TSuccess handleMouseEvent(void *eventPtr);
+
/**
- * Handles a mouse event.
- * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
- * @return Indication whether the event was handled.
- */
- GHOST_TSuccess handleMouseEvent(void *eventPtr);
-
- /**
- * Handles a key event.
- * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
- * @return Indication whether the event was handled.
- */
- GHOST_TSuccess handleKeyEvent(void *eventPtr);
-
+ * Handles a key event.
+ * @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
+ * @return Indication whether the event was handled.
+ */
+ GHOST_TSuccess handleKeyEvent(void *eventPtr);
+
/**
* Performs the actual cursor position update (location in screen coordinates).
* @param x The x-coordinate of the cursor.
@@ -281,11 +281,11 @@ protected:
/** Mouse buttons state */
GHOST_TUns32 m_pressedMouseButtons;
- /** State of the modifiers. */
- GHOST_TUns32 m_modifierMask;
+ /** State of the modifiers. */
+ GHOST_TUns32 m_modifierMask;
- /** Ignores window size messages (when window is dragged). */
- bool m_ignoreWindowSizedMessages;
+ /** Ignores window size messages (when window is dragged). */
+ bool m_ignoreWindowSizedMessages;
/** Stores the mouse cursor delta due to setting a new cursor position
* Needed because cocoa event delta cursor move takes setCursorPosition changes too.
diff --git a/intern/ghost/intern/GHOST_SystemPathsCarbon.h b/intern/ghost/intern/GHOST_SystemPathsCarbon.h
index b48ab6c033b..957300f6586 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCarbon.h
+++ b/intern/ghost/intern/GHOST_SystemPathsCarbon.h
@@ -50,16 +50,16 @@
*/
class GHOST_SystemPathsCarbon : public GHOST_SystemPaths {
public:
- /**
- * Constructor.
- */
- GHOST_SystemPathsCarbon();
-
- /**
- * Destructor.
- */
- ~GHOST_SystemPathsCarbon();
-
+ /**
+ * Constructor.
+ */
+ GHOST_SystemPathsCarbon();
+
+ /**
+ * Destructor.
+ */
+ ~GHOST_SystemPathsCarbon();
+
/**
* Determine the base dir in which shared resources are located. It will first try to use
* "unpack and run" path, then look for properly installed path, not including versioning.
@@ -78,12 +78,12 @@ public:
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
- virtual const GHOST_TUns8* getBinaryDir() const;
+ virtual const GHOST_TUns8* getBinaryDir() const;
/**
* Add the file to the operating system most recently used files
*/
- void addToSystemRecentFiles(const char* filename) const;
+ void addToSystemRecentFiles(const char* filename) const;
};
#endif // _GHOST_SYSTEM_CARBON_H_
diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.h b/intern/ghost/intern/GHOST_SystemPathsCocoa.h
index b270896a8ca..bfdf92b4274 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.h
@@ -44,15 +44,15 @@
class GHOST_SystemPathsCocoa : public GHOST_SystemPaths {
public:
- /**
- * Constructor.
- */
- GHOST_SystemPathsCocoa();
-
- /**
- * Destructor.
- */
- ~GHOST_SystemPathsCocoa();
+ /**
+ * Constructor.
+ */
+ GHOST_SystemPathsCocoa();
+
+ /**
+ * Destructor.
+ */
+ ~GHOST_SystemPathsCocoa();
/**
* Determine the base dir in which shared resources are located. It will first try to use
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index d5100e589f2..27a61cf57fc 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -57,16 +57,6 @@
#include <X11/XF86keysym.h>
#endif
-#ifdef __sgi
-
-#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS)
-#include <X11/SGIFastAtom.h>
-#else
-#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how)
-#endif
-
-#endif
-
// For timing
#include <sys/time.h>
@@ -98,16 +88,9 @@ GHOST_SystemX11(
std::cerr << "Unable to open a display" << std::endl;
abort(); //was return before, but this would just mean it will crash later
}
-
-#ifdef __sgi
- m_delete_window_atom
- = XSGIFastInternAtom(m_display,
- "WM_DELETE_WINDOW",
- SGI_XA_WM_DELETE_WINDOW, False);
-#else
+
m_delete_window_atom
= XInternAtom(m_display, "WM_DELETE_WINDOW", True);
-#endif
m_wm_protocols= XInternAtom(m_display, "WM_PROTOCOLS", False);
m_wm_take_focus= XInternAtom(m_display, "WM_TAKE_FOCUS", False);
@@ -630,7 +613,6 @@ GHOST_SystemX11::processEvent(XEvent *xe)
{
XClientMessageEvent & xcme = xe->xclient;
-#ifndef __sgi
if (((Atom)xcme.data.l[0]) == m_delete_window_atom) {
g_event = new
GHOST_Event(
@@ -638,10 +620,8 @@ GHOST_SystemX11::processEvent(XEvent *xe)
GHOST_kEventWindowClose,
window
);
- } else
-#endif
-
- if (((Atom)xcme.data.l[0]) == m_wm_take_focus) {
+ }
+ else if (((Atom)xcme.data.l[0]) == m_wm_take_focus) {
XWindowAttributes attr;
Window fwin;
int revert_to;
@@ -1038,18 +1018,18 @@ convertXKey(KeySym key)
GXMAP(type,XK_bracketright, GHOST_kKeyRightBracket);
GXMAP(type,XK_Pause, GHOST_kKeyPause);
- GXMAP(type,XK_Shift_L, GHOST_kKeyLeftShift);
- GXMAP(type,XK_Shift_R, GHOST_kKeyRightShift);
+ GXMAP(type,XK_Shift_L, GHOST_kKeyLeftShift);
+ GXMAP(type,XK_Shift_R, GHOST_kKeyRightShift);
GXMAP(type,XK_Control_L, GHOST_kKeyLeftControl);
GXMAP(type,XK_Control_R, GHOST_kKeyRightControl);
- GXMAP(type,XK_Alt_L, GHOST_kKeyLeftAlt);
- GXMAP(type,XK_Alt_R, GHOST_kKeyRightAlt);
+ GXMAP(type,XK_Alt_L, GHOST_kKeyLeftAlt);
+ GXMAP(type,XK_Alt_R, GHOST_kKeyRightAlt);
GXMAP(type,XK_Super_L, GHOST_kKeyOS);
GXMAP(type,XK_Super_R, GHOST_kKeyOS);
- GXMAP(type,XK_Insert, GHOST_kKeyInsert);
- GXMAP(type,XK_Delete, GHOST_kKeyDelete);
- GXMAP(type,XK_Home, GHOST_kKeyHome);
+ GXMAP(type,XK_Insert, GHOST_kKeyInsert);
+ GXMAP(type,XK_Delete, GHOST_kKeyDelete);
+ GXMAP(type,XK_Home, GHOST_kKeyHome);
GXMAP(type,XK_End, GHOST_kKeyEnd);
GXMAP(type,XK_Page_Up, GHOST_kKeyUpPage);
GXMAP(type,XK_Page_Down, GHOST_kKeyDownPage);
@@ -1065,27 +1045,27 @@ convertXKey(KeySym key)
/* keypad events */
- GXMAP(type,XK_KP_0, GHOST_kKeyNumpad0);
- GXMAP(type,XK_KP_1, GHOST_kKeyNumpad1);
- GXMAP(type,XK_KP_2, GHOST_kKeyNumpad2);
- GXMAP(type,XK_KP_3, GHOST_kKeyNumpad3);
- GXMAP(type,XK_KP_4, GHOST_kKeyNumpad4);
- GXMAP(type,XK_KP_5, GHOST_kKeyNumpad5);
- GXMAP(type,XK_KP_6, GHOST_kKeyNumpad6);
- GXMAP(type,XK_KP_7, GHOST_kKeyNumpad7);
- GXMAP(type,XK_KP_8, GHOST_kKeyNumpad8);
- GXMAP(type,XK_KP_9, GHOST_kKeyNumpad9);
+ GXMAP(type,XK_KP_0, GHOST_kKeyNumpad0);
+ GXMAP(type,XK_KP_1, GHOST_kKeyNumpad1);
+ GXMAP(type,XK_KP_2, GHOST_kKeyNumpad2);
+ GXMAP(type,XK_KP_3, GHOST_kKeyNumpad3);
+ GXMAP(type,XK_KP_4, GHOST_kKeyNumpad4);
+ GXMAP(type,XK_KP_5, GHOST_kKeyNumpad5);
+ GXMAP(type,XK_KP_6, GHOST_kKeyNumpad6);
+ GXMAP(type,XK_KP_7, GHOST_kKeyNumpad7);
+ GXMAP(type,XK_KP_8, GHOST_kKeyNumpad8);
+ GXMAP(type,XK_KP_9, GHOST_kKeyNumpad9);
GXMAP(type,XK_KP_Decimal, GHOST_kKeyNumpadPeriod);
GXMAP(type,XK_KP_Insert, GHOST_kKeyNumpad0);
- GXMAP(type,XK_KP_End, GHOST_kKeyNumpad1);
- GXMAP(type,XK_KP_Down, GHOST_kKeyNumpad2);
+ GXMAP(type,XK_KP_End, GHOST_kKeyNumpad1);
+ GXMAP(type,XK_KP_Down, GHOST_kKeyNumpad2);
GXMAP(type,XK_KP_Page_Down, GHOST_kKeyNumpad3);
- GXMAP(type,XK_KP_Left, GHOST_kKeyNumpad4);
- GXMAP(type,XK_KP_Begin, GHOST_kKeyNumpad5);
+ GXMAP(type,XK_KP_Left, GHOST_kKeyNumpad4);
+ GXMAP(type,XK_KP_Begin, GHOST_kKeyNumpad5);
GXMAP(type,XK_KP_Right, GHOST_kKeyNumpad6);
- GXMAP(type,XK_KP_Home, GHOST_kKeyNumpad7);
- GXMAP(type,XK_KP_Up, GHOST_kKeyNumpad8);
+ GXMAP(type,XK_KP_Home, GHOST_kKeyNumpad7);
+ GXMAP(type,XK_KP_Up, GHOST_kKeyNumpad8);
GXMAP(type,XK_KP_Page_Up, GHOST_kKeyNumpad9);
GXMAP(type,XK_KP_Delete, GHOST_kKeyNumpadPeriod);
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 845243f92e5..b43d955d156 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -285,7 +285,7 @@ private :
void
processEvent(
XEvent *xe
- );
+ );
Time
lastEventTime(
@@ -294,7 +294,7 @@ private :
bool
generateWindowExposeEvents(
- );
+ );
};
#endif
diff --git a/intern/ghost/intern/GHOST_TaskbarWin32.h b/intern/ghost/intern/GHOST_TaskbarWin32.h
index eddff8bb91b..8f301edce31 100644
--- a/intern/ghost/intern/GHOST_TaskbarWin32.h
+++ b/intern/ghost/intern/GHOST_TaskbarWin32.h
@@ -21,25 +21,25 @@
#define __ITaskbarList_INTERFACE_DEFINED__
extern "C" {const GUID CLSID_TaskbarList = {0x56FDF344, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} };
const GUID IID_ITaskbarList = {0x56FDF342, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} }; }
- class ITaskbarList : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE HrInit (void) = 0;
- virtual HRESULT STDMETHODCALLTYPE AddTab (HWND hwnd) = 0;
- virtual HRESULT STDMETHODCALLTYPE DeleteTab (HWND hwnd) = 0;
- virtual HRESULT STDMETHODCALLTYPE ActivateTab (HWND hwnd) = 0;
- virtual HRESULT STDMETHODCALLTYPE SetActiveAlt (HWND hwnd) = 0;
- };
+ class ITaskbarList : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE HrInit (void) = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddTab (HWND hwnd) = 0;
+ virtual HRESULT STDMETHODCALLTYPE DeleteTab (HWND hwnd) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ActivateTab (HWND hwnd) = 0;
+ virtual HRESULT STDMETHODCALLTYPE SetActiveAlt (HWND hwnd) = 0;
+ };
#endif /* ITaskbarList */
#ifndef __ITaskbarList2_INTERFACE_DEFINED__
#define __ITaskbarList2_INTERFACE_DEFINED__
extern "C" {const GUID IID_ITaskbarList2 = {0x602D4995, 0xB13A, 0x429b, {0xA6, 0x6E, 0x19, 0x35, 0xE4, 0x4F, 0x43, 0x17} }; }
- class ITaskbarList2 : public ITaskbarList
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0;
- };
+ class ITaskbarList2 : public ITaskbarList
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0;
+ };
#endif /* ITaskbarList2 */
#ifndef __ITaskbarList3_INTERFACE_DEFINED__
@@ -51,9 +51,9 @@ typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMA
#define THBN_CLICKED 0x1800
extern "C" {const GUID IID_ITaskList3 = { 0xEA1AFB91, 0x9E28, 0x4B86, {0x90, 0xE9, 0x9E, 0x9F, 0x8A, 0x5E, 0xEF, 0xAF} };}
- class ITaskbarList3 : public ITaskbarList2
- {
- public:
+ class ITaskbarList3 : public ITaskbarList2
+ {
+ public:
virtual HRESULT STDMETHODCALLTYPE SetProgressValue (HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) = 0;
virtual HRESULT STDMETHODCALLTYPE SetProgressState (HWND hwnd, TBPFLAG tbpFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE RegisterTab (HWND hwndTab, HWND hwndMDI) = 0;
@@ -62,11 +62,11 @@ typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMA
virtual HRESULT STDMETHODCALLTYPE SetTabActive (HWND hwndTab, HWND hwndMDI, DWORD dwReserved) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0;
- virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList (HWND hwnd, HIMAGELIST himl) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList (HWND hwnd, HIMAGELIST himl) = 0;
virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon (HWND hwnd, HICON hIcon, LPCWSTR pszDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip (HWND hwnd, LPCWSTR pszTip) = 0;
virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip (HWND hwnd, RECT *prcClip) = 0;
- };
+ };
#endif /* ITaskbarList3 */
#endif /*GHOST_TASKBARWIN32_H_*/
diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h
index 66990abb555..341c1e23463 100644
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@ -339,11 +339,11 @@ protected:
/** Number of samples used in anti-aliasing, set to 0 if no AA **/
GHOST_TUns16 m_numOfAASamples;
-
- /** Full-screen width */
- GHOST_TUns32 m_fullScreenWidth;
- /** Full-screen height */
- GHOST_TUns32 m_fullScreenHeight;
+
+ /** Full-screen width */
+ GHOST_TUns32 m_fullScreenWidth;
+ /** Full-screen height */
+ GHOST_TUns32 m_fullScreenHeight;
};
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.h b/intern/ghost/intern/GHOST_WindowCarbon.h
index 650788d5c70..a4386ce884b 100644
--- a/intern/ghost/intern/GHOST_WindowCarbon.h
+++ b/intern/ghost/intern/GHOST_WindowCarbon.h
@@ -200,12 +200,12 @@ public:
virtual GHOST_TSuccess activateDrawingContext();
virtual void loadCursor(bool visible, GHOST_TStandardCursor cursor) const;
-
- /**
- * Returns the dirty state of the window when in full-screen mode.
- * @return Whether it is dirty.
- */
- virtual bool getFullScreenDirty();
+
+ /**
+ * Returns the dirty state of the window when in full-screen mode.
+ * @return Whether it is dirty.
+ */
+ virtual bool getFullScreenDirty();
/* accessor for fullscreen window */
virtual void setMac_windowState(short value);
@@ -257,24 +257,24 @@ protected:
int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color);
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
-
- /**
- * Converts a string object to a Mac Pascal string.
- * @param in The string object to be converted.
- * @param out The converted string.
- */
- virtual void gen2mac(const STR_String& in, Str255 out) const;
-
- /**
- * Converts a Mac Pascal string to a string object.
- * @param in The string to be converted.
- * @param out The converted string object.
- */
- virtual void mac2gen(const Str255 in, STR_String& out) const;
+
+ /**
+ * Converts a string object to a Mac Pascal string.
+ * @param in The string object to be converted.
+ * @param out The converted string.
+ */
+ virtual void gen2mac(const STR_String& in, Str255 out) const;
+
+ /**
+ * Converts a Mac Pascal string to a string object.
+ * @param in The string to be converted.
+ * @param out The converted string object.
+ */
+ virtual void mac2gen(const Str255 in, STR_String& out) const;
- WindowRef m_windowRef;
- CGrafPtr m_grafPtr;
- AGLContext m_aglCtx;
+ WindowRef m_windowRef;
+ CGrafPtr m_grafPtr;
+ AGLContext m_aglCtx;
/** The first created OpenGL context (for sharing display lists) */
static AGLContext s_firstaglCtx;
@@ -282,9 +282,9 @@ protected:
Cursor* m_customCursor;
GHOST_TabletData m_tablet;
-
- /** When running in full-screen this tells whether to refresh the window. */
- bool m_fullScreenDirty;
+
+ /** When running in full-screen this tells whether to refresh the window. */
+ bool m_fullScreenDirty;
/** specific MacOs X full screen window setting as we use partially system mechanism
values : 0 not maximizable default
@@ -295,17 +295,17 @@ protected:
in order to be unified with GHOST fullscreen/maximised settings
(lukep)
- **/
-
+ **/
+
short mac_windowState;
- /**
- * The width/height of the size rectangle in the lower right corner of a
- * Mac/Carbon window. This is also the height of the gutter area.
- */
+ /**
+ * The width/height of the size rectangle in the lower right corner of a
+ * Mac/Carbon window. This is also the height of the gutter area.
+ */
#ifdef GHOST_DRAW_CARBON_GUTTER
- static const GHOST_TInt32 s_sizeRectSize;
+ static const GHOST_TInt32 s_sizeRectSize;
#endif // GHOST_DRAW_CARBON_GUTTER
};
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h
index ce28f8c4538..a5f195153dd 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.h
+++ b/intern/ghost/intern/GHOST_WindowCocoa.h
@@ -305,13 +305,13 @@ protected:
int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color);
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
-
- /** The window containing the OpenGL view */
- CocoaWindow *m_window;
+
+ /** The window containing the OpenGL view */
+ CocoaWindow *m_window;
/** The openGL view */
CocoaOpenGLView *m_openGLView;
-
+
/** The opgnGL drawing context */
NSOpenGLContext *m_openGLContext;
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 937dffe9fba..faae903827d 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -1009,7 +1009,7 @@ GHOST_TSuccess GHOST_WindowCocoa::installDrawingContext(GHOST_TDrawingContextTyp
switch (type) {
case GHOST_kDrawingContextTypeOpenGL:
if (!getValid()) break;
-
+
pixelFormat = [m_openGLView pixelFormat];
tmpOpenGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat
shareContext:s_firstOpenGLcontext];
@@ -1332,7 +1332,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCustomCursorShape(GHOST_TUns8 *bitmap
cursorImageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil
- pixelsWide:sizex
+ pixelsWide:sizex
pixelsHigh:sizey
bitsPerSample:1
samplesPerPixel:2
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index d9a495ad0f4..fbab3df1351 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -255,7 +255,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
title, // pointer to window name
WS_POPUP | WS_MAXIMIZE, // window style
left, // horizontal position of window
- top, // vertical position of window
+ top, // vertical position of window
width, // window width
height, // window height
HWND_DESKTOP, // handle to parent or owner window
@@ -633,7 +633,7 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
break;
}
SetWindowPos(m_hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); /*Clears window cache for SetWindowLongPtr */
- return ::SetWindowPlacement(m_hWnd, &wp) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
+ return ::SetWindowPlacement(m_hWnd, &wp) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
}
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index de725151607..160980b6331 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -614,7 +614,7 @@ void GHOST_WindowX11::initXInputDevices()
ici = (XAnyClassPtr)(((char *)ici) + ici->length);
}
} else {
- m_xtablet.StylusID= 0;
+ m_xtablet.StylusID= 0;
}
}
else if(m_xtablet.EraserDevice==NULL && is_eraser(device_info[i].name, device_type)) {
@@ -1216,11 +1216,11 @@ activateDrawingContext(
return GHOST_kFailure;
}
- GHOST_TSuccess
+ GHOST_TSuccess
GHOST_WindowX11::
invalidate(
){
-
+
// So the idea of this function is to generate an expose event
// for the window.
// Unfortunately X does not handle expose events for you and
diff --git a/intern/ghost/test/gears/GHOST_C-Test.c b/intern/ghost/test/gears/GHOST_C-Test.c
index c582d205258..190857403bd 100644
--- a/intern/ghost/test/gears/GHOST_C-Test.c
+++ b/intern/ghost/test/gears/GHOST_C-Test.c
@@ -190,16 +190,16 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
static void drawGearGL(int id)
{
- static GLfloat pos[4] = { 5.0f, 5.0f, 10.0f, 1.0f };
- static GLfloat ared[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
- static GLfloat agreen[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
- static GLfloat ablue[4] = { 0.2f, 0.2f, 1.0f, 1.0f };
+ static GLfloat pos[4] = { 5.0f, 5.0f, 10.0f, 1.0f };
+ static GLfloat ared[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
+ static GLfloat agreen[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
+ static GLfloat ablue[4] = { 0.2f, 0.2f, 1.0f, 1.0f };
- glLightfv(GL_LIGHT0, GL_POSITION, pos);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_DEPTH_TEST);
+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glEnable(GL_DEPTH_TEST);
switch (id)
{
@@ -218,40 +218,40 @@ static void drawGearGL(int id)
default:
break;
}
- glEnable(GL_NORMALIZE);
+ glEnable(GL_NORMALIZE);
}
static void drawGL(void)
{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glPushMatrix();
+ glPushMatrix();
- glRotatef(view_rotx, 1.0, 0.0, 0.0);
- glRotatef(view_roty, 0.0, 1.0, 0.0);
- glRotatef(view_rotz, 0.0, 0.0, 1.0);
+ glRotatef(view_rotx, 1.0, 0.0, 0.0);
+ glRotatef(view_roty, 0.0, 1.0, 0.0);
+ glRotatef(view_rotz, 0.0, 0.0, 1.0);
- glPushMatrix();
- glTranslatef(-3.0, -2.0, 0.0);
- glRotatef(fAngle, 0.0, 0.0, 1.0);
- drawGearGL(1);
- glPopMatrix();
+ glPushMatrix();
+ glTranslatef(-3.0, -2.0, 0.0);
+ glRotatef(fAngle, 0.0, 0.0, 1.0);
+ drawGearGL(1);
+ glPopMatrix();
- glPushMatrix();
- glTranslatef(3.1f, -2.0f, 0.0f);
- glRotatef((float)(-2.0*fAngle-9.0), 0.0, 0.0, 1.0);
- drawGearGL(2);
- glPopMatrix();
+ glPushMatrix();
+ glTranslatef(3.1f, -2.0f, 0.0f);
+ glRotatef((float)(-2.0*fAngle-9.0), 0.0, 0.0, 1.0);
+ drawGearGL(2);
+ glPopMatrix();
- glPushMatrix();
- glTranslatef(-3.1f, 2.2f, -1.8f);
- glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
- glRotatef((float)(2.0*fAngle-2.0), 0.0, 0.0, 1.0);
- drawGearGL(3);
- glPopMatrix();
+ glPushMatrix();
+ glTranslatef(-3.1f, 2.2f, -1.8f);
+ glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
+ glRotatef((float)(2.0*fAngle-2.0), 0.0, 0.0, 1.0);
+ drawGearGL(3);
+ glPopMatrix();
- glPopMatrix();
+ glPopMatrix();
}
@@ -260,21 +260,21 @@ static void setViewPortGL(GHOST_WindowHandle hWindow)
GHOST_RectangleHandle hRect = NULL;
GLfloat w, h;
- GHOST_ActivateWindowDrawingContext(hWindow);
- hRect = GHOST_GetClientBounds(hWindow);
+ GHOST_ActivateWindowDrawingContext(hWindow);
+ hRect = GHOST_GetClientBounds(hWindow);
- w = (float)GHOST_GetWidthRectangle(hRect) / (float)GHOST_GetHeightRectangle(hRect);
- h = 1.0;
+ w = (float)GHOST_GetWidthRectangle(hRect) / (float)GHOST_GetHeightRectangle(hRect);
+ h = 1.0;
glViewport(0, 0, GHOST_GetWidthRectangle(hRect), GHOST_GetHeightRectangle(hRect));
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glFrustum(-w, w, -h, h, 5.0, 60.0);
+ glFrustum(-w, w, -h, h, 5.0, 60.0);
/* glOrtho(0, bnds.getWidth(), 0, bnds.getHeight(), -10, 10); */
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glTranslatef(0.0, 0.0, -40.0);
+ glTranslatef(0.0, 0.0, -40.0);
glClearColor(.2f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -541,8 +541,8 @@ int main(int argc, char** argv)
static void gearsTimerProc(GHOST_TimerTaskHandle hTask, GHOST_TUns64 time)
{
GHOST_WindowHandle hWindow = NULL;
- fAngle += 2.0;
- view_roty += 1.0;
+ fAngle += 2.0;
+ view_roty += 1.0;
hWindow = (GHOST_WindowHandle)GHOST_GetTimerTaskUserData(hTask);
if (GHOST_GetFullScreen(shSystem))
{
diff --git a/intern/guardedalloc/MEM_sys_types.h b/intern/guardedalloc/MEM_sys_types.h
index 4debb32b5c4..23c367d765a 100644
--- a/intern/guardedalloc/MEM_sys_types.h
+++ b/intern/guardedalloc/MEM_sys_types.h
@@ -25,6 +25,11 @@
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file MEM_sys_types.h
+ * \ingroup MEM
+ *
* A platform-independent definition of [u]intXX_t
* Plus the accompanying header include for htonl/ntohl
*
@@ -44,10 +49,6 @@
// doxygen would get a conflict
*/
-/** \file MEM_sys_types.h
- * \ingroup MEM
- */
-
#ifndef MEM_SYS_TYPES_H
#define MEM_SYS_TYPES_H
@@ -60,6 +61,7 @@ extern "C" {
/* The __intXX are built-in types of the visual complier! So we don't
* need to include anything else here. */
+
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
@@ -104,11 +106,12 @@ unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
#else
- /* FreeBSD, Irix, Solaris */
+ /* FreeBSD, Solaris */
#include <sys/types.h>
#endif /* ifdef platform for types */
+
#ifdef _WIN32
#ifndef FREE_WINDOWS
#ifndef htonl
@@ -122,7 +125,7 @@ unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
#include <sys/param.h>
#elif defined (__APPLE__)
#include <sys/types.h>
-#else /* irix sun linux */
+#else /* sun linux */
#include <netinet/in.h>
#endif /* ifdef platform for htonl/ntohl */
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index c3ff851f3bc..cedaf53a4bb 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -364,22 +364,9 @@ void *MEM_mapallocN(size_t len, const char *str)
mem_lock_thread();
len = (len + 3 ) & ~3; /* allocate in units of 4 */
-
-#ifdef __sgi
- {
-#include <fcntl.h>
-
- int fd;
- fd = open("/dev/zero", O_RDWR);
- memh= mmap(0, len+sizeof(MemHead)+sizeof(MemTail),
- PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
- close(fd);
- }
-#else
memh= mmap(NULL, len+sizeof(MemHead)+sizeof(MemTail),
PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANON, -1, 0);
-#endif
if(memh!=(MemHead *)-1) {
make_memhead_header(memh, len, str);
@@ -724,6 +711,10 @@ static void rem_memblock(MemHead *memh)
static void MemorY_ErroR(const char *block, const char *error)
{
print_error("Memoryblock %s: %s\n",block, error);
+
+#ifdef WITH_ASSERT_ABORT
+ abort();
+#endif
}
static const char *check_memlist(MemHead *memh)
diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c
index 1bb73553012..ff857e82d8f 100644
--- a/intern/mikktspace/mikktspace.c
+++ b/intern/mikktspace/mikktspace.c
@@ -166,13 +166,13 @@ typedef struct
tbool bOrient;
} STSpace;
-int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
-void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
-void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
-int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn);
-tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
- const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
- const SMikkTSpaceContext * pContext);
+static int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
+static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
+static void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
+static int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn);
+static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
+ const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
+ const SMikkTSpaceContext * pContext);
static int MakeIndex(const int iFace, const int iVert)
{
@@ -216,14 +216,14 @@ static STSpace AvgTSpace(const STSpace * pTS0, const STSpace * pTS1)
-SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index);
-SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index);
-SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index);
+static SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index);
+static SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index);
+static SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index);
// degen triangles
-void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris);
-void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris);
+static void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris);
+static void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris);
tbool genTangSpaceDefault(const SMikkTSpaceContext * pContext)
@@ -450,11 +450,11 @@ NOINLINE int FindGridCell(const float fMin, const float fMax, const float fVal)
return iIndex<g_iCells?iIndex:(g_iCells-1);
}
-void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in);
-void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries);
-void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
+static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in);
+static void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries);
+static void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn);
-void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
+static void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
{
// Generate bounding box
@@ -579,7 +579,7 @@ void GenerateSharedVerticesIndexList(int piTriList_in_and_out[], const SMikkTSpa
free(piHashOffsets);
}
-void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in)
+static void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikkTSpaceContext * pContext, const int iL_in, const int iR_in)
{
// make bbox
int c=0, l=0, channel=0;
@@ -689,7 +689,7 @@ void MergeVertsFast(int piTriList_in_and_out[], STmpVert pTmpVert[], const SMikk
}
}
-void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries)
+static void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int pTable[], const int iEntries)
{
// this can be optimized further using a tree structure or more hashing.
int e=0;
@@ -724,7 +724,7 @@ void MergeVertsSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pCont
}
}
-void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
+static void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
{
int iNumUniqueVerts = 0, t=0, i=0;
for(t=0; t<iNrTrianglesIn; t++)
@@ -767,7 +767,7 @@ void GenerateSharedVerticesIndexListSlow(int piTriList_in_and_out[], const SMikk
}
}
-int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
+static int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
{
int iTSpacesOffs = 0, f=0, t=0;
int iDstTriIndex = 0;
@@ -878,7 +878,7 @@ int GenerateInitialVerticesIndexList(STriInfo pTriInfos[], int piTriList_out[],
return iTSpacesOffs;
}
-SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index)
+static SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index)
{
int iF, iI;
SVec3 res; float pos[3];
@@ -888,7 +888,7 @@ SVec3 GetPosition(const SMikkTSpaceContext * pContext, const int index)
return res;
}
-SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index)
+static SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index)
{
int iF, iI;
SVec3 res; float norm[3];
@@ -898,7 +898,7 @@ SVec3 GetNormal(const SMikkTSpaceContext * pContext, const int index)
return res;
}
-SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index)
+static SVec3 GetTexCoord(const SMikkTSpaceContext * pContext, const int index)
{
int iF, iI;
SVec3 res; float texc[2];
@@ -920,8 +920,8 @@ typedef union
int array[3];
} SEdge;
-void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn);
-void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn);
+static void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn);
+static void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn);
// returns the texture area times 2
static float CalcTexArea(const SMikkTSpaceContext * pContext, const int indices[])
@@ -940,7 +940,7 @@ static float CalcTexArea(const SMikkTSpaceContext * pContext, const int indices[
return fSignedAreaSTx2<0 ? (-fSignedAreaSTx2) : fSignedAreaSTx2;
}
-void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
+static void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn)
{
int f=0, i=0, t=0;
// pTriInfos[f].iFlag is cleared in GenerateInitialVerticesIndexList() which is called before this function.
@@ -1062,10 +1062,10 @@ void InitTriInfo(STriInfo pTriInfos[], const int piTriListIn[], const SMikkTSpac
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
-tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], const int iMyTriIndex, SGroup * pGroup);
-void AddTriToGroup(SGroup * pGroup, const int iTriIndex);
+static tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[], const int iMyTriIndex, SGroup * pGroup);
+static void AddTriToGroup(SGroup * pGroup, const int iTriIndex);
-int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn)
+static int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTrianglesBuffer[], const int piTriListIn[], const int iNrTrianglesIn)
{
const int iNrMaxGroups = iNrTrianglesIn*3;
int iNrActiveGroups = 0;
@@ -1126,13 +1126,13 @@ int Build4RuleGroups(STriInfo pTriInfos[], SGroup pGroups[], int piGroupTriangle
return iNrActiveGroups;
}
-void AddTriToGroup(SGroup * pGroup, const int iTriIndex)
+static void AddTriToGroup(SGroup * pGroup, const int iTriIndex)
{
pGroup->pFaceIndices[pGroup->iNrFaces] = iTriIndex;
++pGroup->iNrFaces;
}
-tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[],
+static tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[],
const int iMyTriIndex, SGroup * pGroup)
{
STriInfo * pMyTriInfo = &psTriInfos[iMyTriIndex];
@@ -1187,13 +1187,13 @@ tbool AssignRecur(const int piTriListIn[], STriInfo psTriInfos[],
/////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
-tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2);
-void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed);
-STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], const SMikkTSpaceContext * pContext, const int iVertexRepresentitive);
+static tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2);
+static void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed);
+static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[], const SMikkTSpaceContext * pContext, const int iVertexRepresentitive);
-tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
- const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
- const SMikkTSpaceContext * pContext)
+static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGroup pGroups[],
+ const int iNrActiveGroups, const int piTriListIn[], const float fThresCos,
+ const SMikkTSpaceContext * pContext)
{
STSpace * pSubGroupTspace = NULL;
SSubGroup * pUniSubGroups = NULL;
@@ -1361,8 +1361,8 @@ tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], const SGro
return TTRUE;
}
-STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[],
- const SMikkTSpaceContext * pContext, const int iVertexRepresentitive)
+static STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[], const STriInfo pTriInfos[],
+ const SMikkTSpaceContext * pContext, const int iVertexRepresentitive)
{
STSpace res;
float fAngleSum = 0;
@@ -1435,7 +1435,7 @@ STSpace EvalTspace(int face_indices[], const int iFaces, const int piTriListIn[]
return res;
}
-tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2)
+static tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2)
{
tbool bStillSame=TTRUE;
int i=0;
@@ -1448,7 +1448,7 @@ tbool CompareSubGroups(const SSubGroup * pg1, const SSubGroup * pg2)
return bStillSame;
}
-void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed)
+static void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed)
{
int iL, iR, n, index, iMid, iTmp;
@@ -1492,10 +1492,10 @@ void QuickSort(int* pSortBuffer, int iLeft, int iRight, unsigned int uSeed)
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
-void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed);
-void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in);
+static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed);
+static void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in);
-void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn)
+static void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriListIn[], const int iNrTrianglesIn)
{
// build array of edges
unsigned int uSeed = INTERNAL_RND_SORT_SEED; // could replace with a random seed?
@@ -1590,7 +1590,7 @@ void BuildNeighborsFast(STriInfo pTriInfos[], SEdge * pEdges, const int piTriLis
}
}
-void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn)
+static void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int iNrTrianglesIn)
{
int f=0, i=0;
for(f=0; f<iNrTrianglesIn; f++)
@@ -1639,7 +1639,7 @@ void BuildNeighborsSlow(STriInfo pTriInfos[], const int piTriListIn[], const int
}
}
-void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed)
+static void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channel, unsigned int uSeed)
{
unsigned int t;
int iL, iR, n, index, iMid;
@@ -1696,7 +1696,7 @@ void QuickSortEdges(SEdge * pSortBuffer, int iLeft, int iRight, const int channe
}
// resolve ordering and edge number
-void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in)
+static void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[], const int i0_in, const int i1_in)
{
*edgenum_out = -1;
@@ -1730,7 +1730,7 @@ void GetEdge(int * i0_out, int * i1_out, int * edgenum_out, const int indices[],
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////// Degenerate triangles ////////////////////////////////////
-void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris)
+static void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrianglesIn, const int iTotTris)
{
int iNextGoodTriangleSearchIndex=-1;
tbool bStillFindingGoodOnes;
@@ -1813,7 +1813,7 @@ void DegenPrologue(STriInfo pTriInfos[], int piTriList_out[], const int iNrTrian
assert(iNrTrianglesIn == t);
}
-void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris)
+static void DegenEpilogue(STSpace psTspace[], STriInfo pTriInfos[], int piTriListIn[], const SMikkTSpaceContext * pContext, const int iNrTrianglesIn, const int iTotTris)
{
int t=0, i=0;
// deal with degenerate triangles
diff --git a/intern/opennl/superlu/superlu_sys_types.h b/intern/opennl/superlu/superlu_sys_types.h
index c154b4c50ac..9bdf3434582 100644
--- a/intern/opennl/superlu/superlu_sys_types.h
+++ b/intern/opennl/superlu/superlu_sys_types.h
@@ -25,6 +25,11 @@
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file superlu_sys_types.h
+ * \ingroup opennl
+ *
* A platform-independent definition of [u]intXX_t
* Plus the accompanying header include for htonl/ntohl
*
@@ -37,10 +42,6 @@
*
*/
-/** \file superlu_sys_types.h
- * \ingroup opennl
- */
-
/*
// DG: original BLO_sys_types.h is in source/blender/blenkernel
@@ -99,29 +100,32 @@ typedef unsigned long uintptr_t;
#include <inttypes.h>
#elif defined(FREE_WINDOWS)
-
+/* define htoln here, there must be a syntax error in winsock2.h in MinGW */
+unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
#include <stdint.h>
#else
- /* FreeBSD, Irix, Solaris */
+ /* FreeBSD, Solaris */
#include <sys/types.h>
#endif /* ifdef platform for types */
#ifdef _WIN32
+#ifndef FREE_WINDOWS
#ifndef htonl
#define htonl(x) correctByteOrder(x)
#endif
#ifndef ntohl
#define ntohl(x) correctByteOrder(x)
#endif
+#endif
#elif defined (__FreeBSD__) || defined (__OpenBSD__)
#include <sys/param.h>
#elif defined (__APPLE__)
#include <sys/types.h>
-#else /* irix sun linux */
+#else /* sun linux */
#include <netinet/in.h>
#endif /* ifdef platform for htonl/ntohl */
diff --git a/intern/smoke/intern/MERSENNETWISTER.h b/intern/smoke/intern/MERSENNETWISTER.h
index e976560bf17..116568c2834 100644
--- a/intern/smoke/intern/MERSENNETWISTER.h
+++ b/intern/smoke/intern/MERSENNETWISTER.h
@@ -132,7 +132,7 @@ protected:
uint32 mixBits( const uint32& u, const uint32& v ) const
{ return hiBit(u) | loBits(v); }
uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const
- { return m ^ (mixBits(s0,s1)>>1) ^ (-loBit(s1) & 0x9908b0dfUL); }
+ { return m ^ (mixBits(s0,s1)>>1) ^ ((~loBit(s1) + 1) & 0x9908b0dfUL); }
static uint32 hash( time_t t, clock_t c );
};
diff --git a/intern/string/STR_HashedString.h b/intern/string/STR_HashedString.h
index bc4ca9e3d73..3565e622977 100644
--- a/intern/string/STR_HashedString.h
+++ b/intern/string/STR_HashedString.h
@@ -79,7 +79,7 @@ static inline dword STR_gHash(dword inDWord)
key ^= (key >> 13);
key += ~(key << 9);
key ^= (key >> 17);
- return key;
+ return key;
}
enum { GOLDEN_RATIO = 0x9e3779b9 }; // arbitrary value to initialize hash funtion, well not so arbitrary
diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h
index 9c687407512..2b5ba449602 100644
--- a/intern/string/STR_String.h
+++ b/intern/string/STR_String.h
@@ -95,11 +95,11 @@ public:
STR_String& Format(const char *fmt, ...); // Set formatted text to string
STR_String& FormatAdd(const char *fmt, ...); // Add formatted text to string
inline void Clear() { Len = pData[0] = 0; }
- inline const STR_String & Reverse()
- {
- for (int i1=0, i2=Len-1; i1<i2; i1++, i2--)
- swap(pData[i1], pData[i2]); return *this;
- }
+ inline const STR_String & Reverse()
+ {
+ for (int i1=0, i2=Len-1; i1<i2; i1++, i2--)
+ swap(pData[i1], pData[i2]); return *this;
+ }
// Properties
bool IsUpper() const;
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4c791dd9369..5a4ba6a9cb2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,5 @@
release/scripts/modules/rna_prop_ui.py
-release/scripts/startup/bl_operators/animsys_update.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_operators/object_align.py
release/scripts/startup/bl_operators/object_quick_effects.py
@@ -193,27 +192,7 @@ source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
-source/blender/makesrna/intern/rna_ID.c
-source/blender/makesrna/intern/rna_action.c
-source/blender/makesrna/intern/rna_color.c
-source/blender/makesrna/intern/rna_constraint.c
-source/blender/makesrna/intern/rna_curve.c
-source/blender/makesrna/intern/rna_fcurve.c
-source/blender/makesrna/intern/rna_material.c
-source/blender/makesrna/intern/rna_mesh.c
-source/blender/makesrna/intern/rna_modifier.c
-source/blender/makesrna/intern/rna_object.c
-source/blender/makesrna/intern/rna_object_force.c
-source/blender/makesrna/intern/rna_particle.c
-source/blender/makesrna/intern/rna_render.c
-source/blender/makesrna/intern/rna_scene.c
-source/blender/makesrna/intern/rna_space.c
-source/blender/makesrna/intern/rna_texture.c
-source/blender/makesrna/intern/rna_ui_api.c
source/blender/makesrna/intern/rna_userdef.c
-source/blender/makesrna/intern/rna_wm.c
-source/blender/makesrna/intern/rna_wm_api.c
-source/blender/makesrna/intern/rna_world.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_operators.c
diff --git a/po/README.txt b/po/README.txt
new file mode 100644
index 00000000000..cadcb7194e8
--- /dev/null
+++ b/po/README.txt
@@ -0,0 +1,81 @@
+Blender translation HOWTO
+=========================
+
+I'll try briefly explain how translation works and how to update translation files.
+
+1. How it works
+---------------
+
+This folder contains source files for translation system. These source files have
+got .po extension and they've got pretty simple syntax:
+
+msgid "some message id"
+msgstr "translation for this message"
+
+This means when string "some message id" is used as operator name, tooltip, menu
+and so it'll be displayed on the screen as "translation for this message".
+Pretty simple.
+
+This source files are pre-compiled into ../release/bin/.blender/locale/<language>/LC_MESSAGES/blender.mo,
+so they aren't getting compiled every time Blender is compiling to save some time and prevent
+failure on systems which don't have needed tools for compiling .po files.
+
+2. How to update translations
+-----------------------------
+
+It's also pretty simple. If you can find string you want to translate in <language>.po
+file as msgid, just write correct msgstr string for it. If msgid is marked as fuzzy,
+i.e.
+
+#, fuzzy
+msgid "some message id"
+msgstr "translation for this message"
+
+it means translation used to exist for this message, but message was changed, so translation
+also have to be updated (it's easier to make new translation based on previous translation).
+When translation was updated, remove line with '#, fuzzy' and it'll work.
+
+If there's no message in .po file you want to translate, probably .po file should be updated.
+Use the following steps for this:
+- With newly compiled blender run:
+ `blender --background --factory-startup --python update_msg.py`
+ to update messages.txt file (this file contains strings collected
+ automatically from RNA system and python UI scripts)
+- Run update_pot.py script which will update blender.pot file. This file contains all
+ strings which should be transated.
+- Run update_po.py script to merge all .po files with blender.pot (so all .po files
+ will contain all msgid-s declared in blender.pot) or update_po.py <language> to
+ update only needed .po file(s) to save time when you're busy with translation.
+ But before commit all .po files better be updated.
+
+When you've finished with translation, you should re-compile .po file into .mo file.
+It's also pretty simple: just run update_mo.py script to recompile all languages or
+just update_mo.py <language> to re-compile only needed language(s).
+
+NOTE: msgfmt, msgmerge and xgettext tools should be available in your PATH.
+
+These steps to update template, translation files and compile them can be made in "batch" mode
+using GNUMakefile:
+
+make -f GNUMakefile translations
+
+NOTE: Blender has to be compiled using GNUMakefile first.
+
+
+3. Note for Windows users
+-------------------------
+You can find compiled builds of gettext in the lib folder under "binaries\gettext\" for both windows and win64.
+In order to run the scripts you will need to replace the location of the GETTEXT_..._EXECUTABLE.
+
+For example in update_pot.py:
+-GETTEXT_XGETTEXT_EXECUTABLE = "xgettext"
++GETTEXT_XGETTEXT_EXECUTABLE = "C:\\Blender\\lib\\\windows\\\binaries\\\gettext\\xgettext.exe"
+
+4. Other scripts
+----------------
+
+- check_po.py: this script checks if all messages declared in blender.pot exists in.po files
+ and that no extra messages are declared in .po files
+- clean_po.py: this script removes all commented messages which aren't required by .pot file anymore.
+- merge_po.py: this script accepts two files as arguments and copies translations from second file
+ into first file.
diff --git a/po/check_po.py b/po/check_po.py
new file mode 100755
index 00000000000..a402c2b592c
--- /dev/null
+++ b/po/check_po.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+
+# $Id$
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+# update the pot file according the POTFILES.in
+
+import os
+import sys
+from codecs import open
+
+CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
+
+FILE_NAME_POT = os.path.join(CURRENT_DIR, "blender.pot")
+
+
+def read_messages(fname):
+ def stripeol(s):
+ return s.rstrip("\n\r")
+
+ messages = {}
+ reading_message = False
+ message = ""
+ with open(fname, 'r', "utf-8") as handle:
+ while True:
+ line = handle.readline()
+
+ if not line:
+ break
+
+ line = stripeol(line)
+ if line.startswith("msgid"):
+ reading_message = True
+ message = line[7:-1]
+ elif line.startswith("msgstr"):
+ reading_message = False
+ messages[message] = True
+ elif reading_message:
+ message += line[1:-1]
+ return messages
+
+
+def main():
+ pot_messages = read_messages(FILE_NAME_POT)
+
+ if len(sys.argv) > 1:
+ for lang in sys.argv[1:]:
+ po = os.path.join(CURRENT_DIR, lang + '.po')
+
+ if os.path.exists(po):
+ po_messages = read_messages(po)
+ for msgid in po_messages:
+ if not pot_messages.get(msgid):
+ print('Unneeded message id \'%s\'' % (msgid))
+
+ for msgid in pot_messages:
+ if not po_messages.get(msgid):
+ print('Missed message id \'%s\'' % (msgid))
+ else:
+ for po in os.listdir(CURRENT_DIR):
+ if po.endswith('.po'):
+ print('Processing %s...' % (po))
+ po_messages = read_messages(po)
+ for msgid in po_messages:
+ if not pot_messages.get(msgid):
+ print(' Unneeded message id \'%s\'' % (msgid))
+
+ for msgid in pot_messages:
+ if not po_messages.get(msgid):
+ print(' Missed message id \'%s\'' % (msgid))
+
+
+if __name__ == "__main__":
+ print("\n\n *** Running %r *** \n" % __file__)
+ main()
diff --git a/po/clean_po.py b/po/clean_po.py
new file mode 100755
index 00000000000..685ec585ffd
--- /dev/null
+++ b/po/clean_po.py
@@ -0,0 +1,190 @@
+#!/usr/bin/env python
+
+# $Id$
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+# update the pot file according the POTFILES.in
+
+import os
+import sys
+import collections
+
+from codecs import open
+
+CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
+
+FILE_NAME_POT = os.path.join(CURRENT_DIR, "blender.pot")
+
+
+def read_messages(fname):
+ def stripeol(s):
+ return s.rstrip("\n\r")
+
+ last_message = None
+
+ if hasattr(collections, 'OrderedDict'):
+ messages = collections.OrderedDict()
+ commented_messages = collections.OrderedDict()
+ else:
+ messages = {}
+ commented_messages = {}
+
+ reading_message = False
+ reading_translation = False
+ commented = False
+ message = ""
+ translation = ""
+ message_lines = []
+ translation_lines = []
+ comment_lines = []
+ with open(fname, 'r', "utf-8") as handle:
+ while True:
+ line = handle.readline()
+
+ if not line:
+ break
+
+ line = stripeol(line)
+ if line.startswith("msgid") or line.startswith("#~ msgid"):
+ if reading_translation:
+ last_message['translation'] = translation
+ translation_lines = []
+
+ reading_message = True
+ reading_translation = False
+
+ if line.startswith('#~'):
+ message = line[10:-1]
+ commented = True
+ else:
+ message = line[7:-1]
+ commented = False
+
+ message_lines.append(message)
+ elif line.startswith("msgstr") or line.startswith("#~ msgstr"):
+ reading_message = False
+ reading_translation = True
+ last_message = {'comment_lines': comment_lines,
+ 'message_lines': message_lines,
+ 'translation_lines': translation_lines}
+
+ if commented:
+ translation = line[11:-1]
+ commented_messages[message] = last_message
+ else:
+ translation = line[8:-1]
+ messages[message] = last_message
+
+ message_lines = []
+ comment_lines = []
+ translation_lines.append(translation)
+ elif not line.startswith('"') and not line.startswith('#~ "'):
+ if reading_translation:
+ last_message['translation'] = translation
+ else:
+ comment_lines.append(line)
+
+ reading_message = False
+ reading_translation = False
+ message_lines = []
+ translation_lines = []
+ elif reading_message:
+ if line.startswith('#~ "'):
+ m = line[4:-1]
+ else:
+ m = line[1:-1]
+
+ message += m
+ message_lines.append(m)
+ elif reading_translation:
+ if line.startswith('#~ "'):
+ t = line[4:-1]
+ else:
+ t = line[1:-1]
+
+ translation += t
+ translation_lines.append(t)
+
+ return (messages, commented_messages)
+
+
+def do_clean(po, pot_messages):
+ po_messages, commented_messages = read_messages(po)
+
+ for msgid in commented_messages:
+ if pot_messages.get(msgid):
+ t = po_messages.get(msgid)
+ if not t:
+ print("Reusing full item from commented "
+ "lines for msgid '%s'" % msgid)
+ po_messages[msgid] = commented_messages[msgid]
+ elif not t['translation']:
+ print("Reusing translation from commented "
+ "lines for msgid '%s'" % msgid)
+ m = commented_messages[msgid]
+ t['translation'] = m['translation']
+ t['translation_lines'] = m['translation_lines']
+
+ with open(po, 'w', 'utf-8') as handle:
+ for msgid in po_messages:
+ item = po_messages[msgid]
+
+ for x in item['comment_lines']:
+ handle.write(x + "\n")
+
+ first = True
+ for x in item['message_lines']:
+ if first:
+ handle.write("msgid \"%s\"\n" % x)
+ else:
+ handle.write("\"%s\"\n" % x)
+ first = False
+
+ first = True
+ for x in item['translation_lines']:
+ if first:
+ handle.write("msgstr \"%s\"\n" % x)
+ else:
+ handle.write("\"%s\"\n" % x)
+ first = False
+
+ handle.write("\n")
+
+
+def main():
+ pot_messages, commented_messages = read_messages(FILE_NAME_POT)
+
+ if len(sys.argv) > 1:
+ for lang in sys.argv[1:]:
+ po = os.path.join(CURRENT_DIR, lang + '.po')
+
+ if os.path.exists(po):
+ do_clean(po, pot_messages)
+ else:
+ for po in os.listdir(CURRENT_DIR):
+ if po.endswith('.po'):
+ print('Processing %s...' % (po))
+ do_clean(po, pot_messages)
+
+
+if __name__ == "__main__":
+ print("\n\n *** Running %r *** \n" % __file__)
+ main()
diff --git a/po/merge_po.py b/po/merge_po.py
new file mode 100755
index 00000000000..b0b29a3ac8e
--- /dev/null
+++ b/po/merge_po.py
@@ -0,0 +1,167 @@
+#!/usr/bin/env python
+
+# $Id$
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+# update the pot file according the POTFILES.in
+
+import sys
+import collections
+
+from codecs import open
+
+
+def read_messages(fname):
+ def stripeol(s):
+ return s.rstrip("\n\r")
+
+ last_message = None
+
+ if hasattr(collections, 'OrderedDict'):
+ messages = collections.OrderedDict()
+ commented_messages = collections.OrderedDict()
+ else:
+ messages = {}
+ commented_messages = {}
+
+ reading_message = False
+ reading_translation = False
+ commented = False
+ message = ""
+ translation = ""
+ message_lines = []
+ translation_lines = []
+ comment_lines = []
+ with open(fname, 'r', "utf-8") as handle:
+ while True:
+ line = handle.readline()
+
+ if not line:
+ break
+
+ line = stripeol(line)
+ if line.startswith("msgid") or line.startswith("#~ msgid"):
+ if reading_translation:
+ last_message['translation'] = translation
+ translation_lines = []
+
+ reading_message = True
+ reading_translation = False
+
+ if line.startswith('#~'):
+ message = line[10:-1]
+ commented = True
+ else:
+ message = line[7:-1]
+ commented = False
+
+ message_lines.append(message)
+ elif line.startswith("msgstr") or line.startswith("#~ msgstr"):
+ reading_message = False
+ reading_translation = True
+ last_message = {'comment_lines': comment_lines,
+ 'message_lines': message_lines,
+ 'translation_lines': translation_lines}
+
+ if commented:
+ translation = line[11:-1]
+ commented_messages[message] = last_message
+ else:
+ translation = line[8:-1]
+ messages[message] = last_message
+
+ message_lines = []
+ comment_lines = []
+ translation_lines.append(translation)
+ elif not line.startswith('"') and not line.startswith('#~ "'):
+ if reading_translation:
+ last_message['translation'] = translation
+ else:
+ comment_lines.append(line)
+
+ reading_message = False
+ reading_translation = False
+ message_lines = []
+ translation_lines = []
+ elif reading_message:
+ if line.startswith('#~ "'):
+ m = line[4:-1]
+ else:
+ m = line[1:-1]
+
+ message += m
+ message_lines.append(m)
+ elif reading_translation:
+ if line.startswith('#~ "'):
+ t = line[4:-1]
+ else:
+ t = line[1:-1]
+
+ translation += t
+ translation_lines.append(t)
+
+ return (messages, commented_messages)
+
+
+def main():
+ if len(sys.argv) == 3:
+ dst_messages, tmp = read_messages(sys.argv[1])
+ from_messages, tmp = read_messages(sys.argv[2])
+
+ for msgid in dst_messages:
+ msg = dst_messages.get(msgid)
+ from_msg = from_messages.get(msgid)
+
+ if from_msg and from_msg['translation']:
+ msg['translation'] = from_msg['translation']
+ msg['translation_lines'] = from_msg['translation_lines']
+
+ with open(sys.argv[1], 'w', 'utf-8') as handle:
+ for msgid in dst_messages:
+ item = dst_messages[msgid]
+
+ for x in item['comment_lines']:
+ handle.write(x + "\n")
+
+ first = True
+ for x in item['message_lines']:
+ if first:
+ handle.write("msgid \"%s\"\n" % x)
+ else:
+ handle.write("\"%s\"\n" % x)
+ first = False
+
+ first = True
+ for x in item['translation_lines']:
+ if first:
+ handle.write("msgstr \"%s\"\n" % x)
+ else:
+ handle.write("\"%s\"\n" % x)
+ first = False
+
+ handle.write("\n")
+ else:
+ print('Usage: %s <destination-po> <source-po>' % (sys.argv[0]))
+
+
+if __name__ == "__main__":
+ print("\n\n *** Running %r *** \n" % __file__)
+ main()
diff --git a/po/messages.txt b/po/messages.txt
deleted file mode 100644
index b491061cdc4..00000000000
--- a/po/messages.txt
+++ /dev/null
@@ -1,5433 +0,0 @@
-The edited object
-Bezier curve point with two handles defining a Keyframe on an F-Curve
-Max Climb
-Media Stop
-System & OpenGL
-Strips Selected
-Active Keying Set
-Action Blending
-Bone is able to be selected
-Defines where the color of the environment light comes from
-Display files as short list
-Build 75% proxy resolution
-Right Mouse
-Cubic Catmull-Rom
-Particle system can be edited in particle mode
-UV editor data for the image editor space
-Editing hair
-Zoom using opposite direction
-Graph Editor space data
-Create obstacle
-Tiles
-Align newly added objects to the world coordinates
-Index of custom color set
-Sample point for F-Curve
-AVI Raw
-Linear Drag
-Color to display the marker with
-Channels Region
-Lower bound of envelope at this control-point
-Fluid
-Regions this area is subdivided in
-Double Click
-Disable simulation of linear motion along the X axis
-Sequencer OpenGL
-Child particles generated by the particle system
-Point in a shape key for curves
-Lock to Bone
-Sun Size
-Set modifier expanded in the user interface
-Multiple Scattering
-ID Name
-Steering
-Animation Visualisation
-Keyed States
-Fixed size vertex indices array
-Normal Size
-Track To
-Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated.)
-Collection of keymaps
-Texture datablocks
-Number of vertical pixels in the screen
-Fluid Simulation
-Zooms in and out like scaling the view, mouse movements relative to center
-Lattice Edit
-Snap onto its self (editmode)
-Only render what's in front of the solid z values
-True when multiple enums
-Backdrop Zoom
-Causes mesh data to be duplicated with the object
-Automatic
-Small Caps
-UV Project
-UV Sync Selection
-Cloth dynamics for hair
-File Browser Main
-Sensitivity
-Amount of rotation around side vector
-Specify how many frames the Map Old will last
-Start Still
-Unique datablock ID name
-Active pose marker for this Action
-Draw Channels
-Smoothens emitted smoke to avoid blockiness
-Tool Settings
-Text Line
-Bone Constraints
-Toggle whether the material is linked to object data or the object block
-Falloff power for transmissivity filter effect (1.0 is linear)
-Only use case sensitive matches of search string
-Screw
-Region Text
-Representation of alpha information in the RGBA pixels
-Edges receive a drag force from surrounding media
-Sequence Transform
-Over Drop
-Domain Settings
-New F-Curve Colors - XYZ to RGB
-Space that owner is evaluated in
-Frame Step
-Enumeration
-Value of the item
-Parent of this pose bone
-B-Bone Z size
-Up Arrow
-For reactor systems, the object that has the target particle system (empty if same object)
-Shift key pressed
-Auto Refresh
-Bone Color Sets
-Positive values make strands rounder, negative makes strands spiky
-Collection of images
-Show actuators of active object
-interpolate a global timestamp using the record date and time written by recording device
-Main Lattices
-Variable from some source/target for driver relationship
-Z Location
-Auto-Clamped handle selected color
-Fixed Alternate
-Game engine sensor to detect events
-Include the frame number in image metadata
-Bone does not deform any geometry
-UV Textures
-Game
-Minimal Spring length * Ball Size
-16384
-Line in which the marker is located
-Offset X
-Rasterized cell height
-Edge Threshold
--Z
-Set audio channels to mono
-Jump Speed
-HuffYUV
-Active Bone
-View3D Fly Modal
-Sets the audio channel count
-Rotation Damping
-Max Air Acceleration
-Snap center onto target
-Spring Damping
-Compact with Milliseconds
-Maintain speed, flight level or wander
-Interpolation type
-Type Info
-SIMD QBVH
-active
-Armature
-Match case
-16 Bit
-XZY Rotation Order. Prone to Gimbal Lock
-Auto handle selected color
-Theme File Browser
-Bake the normals in object space
-Enable color range used for weight visualization in weight painting mode
-Vorticity
-Open window
-Shows sensors for this object in the user interface
-Radius of head of bone (for Envelope deform only)
-Plain diffuse energy (white.)
-Elasticity
-Cache Step
-View Sliders
-Hair
-Filter Movies
-Material datablock used by this material slot
-Smooth Emitter
-Catalan (Català)
-RVO (cells)
-Home
-Action Mouse
-Show Debug Info
-Loads a saved environment map image from disk
-is_baking
-Scene datablocks
-Wire
-Group
-On Land
-Group Objects
-Time Step
-Keep UI
-Bone inherits rotation or scale from parent bone
-Show Selected Object
-Theme settings for the Outliner
-Time of key over the simulation
-Header Text
-Health
-Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead
-Blender Original
-Deliver texture UV pass
-Index number of the vertex
-Stepped Interpolation
-Adds diagonal springs on 4-gons
-Shear
-Tent
-Strength of force field
-Space that target is evaluated in
-F11
-Star
-Library datablocks
-Line Input
-Lighten
-In Range
-Use Blender units for widths instead of pixels
-F17
-Node Socket
-Quad-Buffer
-Sets scaling for the texture's X, Y and Z sizes
-F14
-Motion Path settings for animation visualisation
-Make hairs longer
-Set audio sample format to 32 bit float
-Amount of anti-aliasing samples per pixel
-type
-Use optimized Bullet DBVT tree for view frustum and occlusion culling
-Make this surface a closed loop in the V direction
-Alpha Over
-Media player for video & png/jpeg/sgi image sequences
-Second input for the effect strip
-Space Logic Editor
-Snap during transform
-Edit Methods
-Left Handle
-B-Bone Ease Out
-Cyclic Offset
-Subtype
-Object Base
-Vertex Group Clump
-Letterbox
-Set audio channels to 7.1 surround sound
-V
-Quaternion (WXYZ)
-Image File
-Preset configs for external animation players
-Maximum Value
-Make this nurbs curve or surface act like a Bezier spline in the U direction (Order U must be 3 or 4, Cyclic U must be disabled)
-uk_UA
-3x3 bone matrix
-Vertex Weight
-Display Material
-Use a custom transform orientation
-GLSL Shaders
-Text
-Deliver shadow pass
-From node
-Keyframes
-Main Brushes
-Deliver diffuse pass
-Header
-Level detector, trigger controllers of new states(only applicable upon logic state transition)
-Collision Compound
-Increment
-Trackball
-Active Strip
-Initial Rest Length
-User defined layer of string text values
-Edge Tag Mode
-Invert tilt Axis
-Deliver emission pass
-Face Selected
-Xor
-Voronoi Crackle
-Align the transformation axes to the window
-Line sample
-Default Goal (vertex target position) value, when no Vertex Group used
-Type of raytrace accelerator structure
-Area Spaces
-Project individual elements on the surface of other objects
-Use the angle between two bones
-Aero
-Zmask
-Set audio sample format to 32 bit signed integer
-Scene render size
-Multiplier to convert blender units to physical distance
-Free Image Textures
-Metaball datablocks
-DPI
-Fill in Z values for solid faces in invisible layers, for masking
-Active Action for this datablock
-Use turntable style rotation in the viewport
-Format
-Use a Catmull-Rom filter for anti-aliasing
-Link material to object or the object's data
-Type of participation in the fluid simulation
-face normal
-Enable
-Final 4x4 matrix after constraints and drivers are applied (object space)
-Diameter of widget, in 10 pixel units
-ID Property
-Radius of tail of bone (for Envelope deform only)
-Custom Shape Transform
-Action FCurves
-Envelope Deform Weight
-A
-Renders star shaped lines over halo
-Fade-out Color
-Syntax Built-in
-Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC)
-Camera datablocks
-Bounding Box Center
-Middle Mouse
-Framerate base
-Touch
-Vortex
-Manipulator Size
-F-Curve Colors - XYZ to RGB
-Invert Output
-Calculate heights against unsubdivided low resolution mesh
-Shrinkwrap
-Window Deactivate
-Y position of the sequence strip
-The frame on which this sketch appears
-Snap to increments of grid
-Rest Length
-All
-Serbian (Српском језику)
-Sample Method
-Text Anti-aliasing
-Only allows given density value in emitter area
-Sequencer Preview Shading
-Lower field first
-File Name
-Show timing in seconds not frames
-Display the object as wire edges
-Billboard with Z-axis constraint
-Curves
-Displays clock frequency of fullscreen display
-X Rotation
-Sphere
-Select UVs that share mesh vertex, irrespective if they are in the same location
-8 bit RAW
-0.5 means no distance at all, 1.0 is maximum distance
-Sequencer
-Max Ghost Range
-An object instance in a scene
-User Interface
-Alt
-Vertex group name
-PNG
-Animated Selected
-Blue
-Damping of the spring force, when inside the physics distance area
-Plugin Strip
-Hide
-Pose Matrix
-Guide-free time from particle life's end
-Frame is being edited (painted on)
-Large Cursors
-Limit Rotation
-Draw only faces with the currently displayed image assigned
-Record Run
-Pixel width over which the reconstruction filter combines samples
-Global Scene
-Defines the structure of the header in the UI
-Source List Text Highlight
-User-editable keyframes
-Scaling factor for action
-Inner
-Active Constraint
-Side-by-side
-Right Arrow
-Causes the 1 to 0 keys to act as the numpad (useful for laptops)
-A collection of pose channels, including settings for animating bones
-Lennard-Jones
-Use a maximum radial distance for the field to work
-Location of tail end of the bone relative to armature
-Edit All
-estimate matrix .. split to COM , ROT ,SCALE
-Use Coordinates
-Theme User Preferences
-Show line numbers next to the text
-Minimum speed in air (relative to maximum speed)
-Display keymap datablocks
-,
-Display Summary
-Channel Driver (only set for Driver F-Curves)
-Item
-In/Out Node
-Frame that modifier's influence ends (if Restrict Frame Range is in use)
-Premultiplied
-Number of frames cached
-Description of the Struct's purpose
-Tilt in 3D View
-Show Debug
-Offsets image horizontally from the world origin
-region_data
-Protect layer from further editing and/or frame changes
-File Format
-Retarget roll mode
-IK rot control
-Upper bound of envelope at this control-point
-Interaction Radius
-Syntax String
-Vertex group to control density
-Show Overexposed
-Vertices
-Kerning Style
-IK X Minimum
-Sets the factor by which the flare is larger than the halo
-Absolute ball size or factor if not manual adjusted
-Blend Opacity
-Steps
-Texture
-Settings for the visualisation of motion
-Group of vertices, used for armature deform and other purposes
-Limit Distance
-Minus
-No interpolation, fast but blocky and low quality
-Control
-Full SMPTE timecode. Format is HH:MM:SS:FF
-Open On Mouse Over
-Show sensors of active object
-Frame Server Port
-Noise patterns will remain unchanged, faster and suitable for stills
-Start
-RLE (lossless)
-True when the property is not saved in presets
-Images are rendered in new Window
-Theme Timeline
-If this is set, the header gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is "OBJECT_HT_hello", and bl_idname is not set by the script, then bl_idname = "OBJECT_HT_hello"
-The color that rays with no intersection within the Max Distance take (material color can be best for indoor scenes, sky color for outdoor)
-Show Cursor
-Goal Default
-Shape Key Point
-Object Origin Size
-Orthographic
-Invert y axis
-Unit Scale
-Collection of points for Bezier curves only
-Mouse
-Pivot Point
-UV Layer to control billboard splitting
-Only insert keyframes where they're needed in the relevant F-Curves
-IK Z Minimum
-Distance
-Key rotation quaternion
-Backscattered light
-Texture effector weight
-Volume rendering settings for a Material datablock
-Which output node to use, for node-based textures
-Handle 1 selection status
-Always render a still frame from the voxel data sequence
-Factor
-+Z
-Numpad 4
-Type
-Action Groups
-Styles
-rv
-Recast data for a Game datablock
-Number of frames to show before the current frame (only for 'Around Current Frame' Onion-skinning method)
-Description of the property for tooltips
-Area in a subdivided screen, containing an editor
-IK Z Maximum
-Effect fader position
-Particle System to render as points
-Vertex Group Size Negate
-Simplify Subdivision
-Warp
-3D View center is locked to this bone's position
-Enable cluster collision between soft and rigid body
-04 - Theme Color Set
-Lamps
-Color Picker Type
-Location of the hair key in its internal coordinate system, relative to the emitting face
-Properties Space
-The view mode to use for displaying sequencer output
-Hold
-Prefetch Frames
-Pose Tail Position
-Amount of pixels to extend the baked result with, as post process filter
-Dummy
-Deliver full combined RGBA buffer
-Long Key Selected
-Extension
-Complete Matches Only
-Lines
-The external source data file to use
-The time (in minutes) to wait between automatic temporary saves
-Undo Memory Size
-Type of event mapping
-Animation Data
-Unique node identifier
-Draw white edges
-Show Menus
-W
-Inverse Kinematics
-Number of times a map will be rendered recursively (mirror effects.)
-Face Mask
-Density is calculated as a factor of default density (depends on particle size)
-Soft
-Use a maximum distance for the field to work
-Has IK
-Power of Fresnel for transparency (Ray or ZTransp)
-Name of PoseBone to use as target
-Display files as thumbnails
-Transparency blending mode
-Multiple Engines
-Bits
-Active Boid Rule Index
-Child Of
-Metric
-Proxy size 100%
-Module name
-Visible
-NLA Strip references some Action
-Average screen dimension of stars
-Converter Node
-Mirror
-Method of calculating aerodynamic interaction
-Curl
-Main Objects
-Only include channels relating to selected objects and data
-Set audio mixing buffer size to 256 samples
-Bake normals
-Uses direction of strands as normal for tangent-shading
-Textbox Width
-Pose
-Plasticity
-Object scale factor
-Boid effector weight
-Mass Vertex Group
-Fight
-Adjust the offset to the beginning/end
-Bone Solid
-NLA Strip representing a sound event for speakers
-Maximum contour edge length
-Build free run time code index using Record Date/Time
-End frame displayed in the sequence editor after offsets are applied
-NLA Strip acts as a container for adjacent strips
-Offsets image vertically from the world origin
-Block anything else from using the cursor
-Inverse Lift
-Maximum for slider
-Mode of automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)
-Render Solid faces in this Layer
-Vertex Weight Edit
-Rotation style in the viewport
-Active Vertex Color Index
-Show the active object's smoke cache
-Action Extrapolation
-Resolution X
-Mesh
-Progress Bar Widget Colors
-Lock editing of rotation in the interface
-Draw faces over the image
-Press
-Weight Color Range
-Collection of vertex colors
-Thickness of strokes (in pixels)
-Resolution V
-Particle Target
-Object duplicate transformation matrix
-Luma
-Blend Out
-B
-B-Bone X size
-Anti-Aliasing Level
-Handle Vertex Size
-IK Lin Weight
-Negative
-End Still
-Y Offset
-Edge
-Amount of stickness to surface collision
-Bone Matrix
-Randomizes ring dimension and line location
-Velocity
-Respect the frame rate rather than rendering as many frames as possible
-Distance to the view location
-High res
-Object to take point data from
-Falloff type for proportional editing mode
-Region width
-Border Minimum Y
-Flash Video
-Active Section
-Channel defining pose data for a bone in a Pose
-Smoothed high quality interpolation, but slower
-Sets the audio sample rate
-Deliver raytraced refraction pass
-Land Personal Space
-Curve Splines
-Operating system key pressed
-14 - Theme Color Set
-Grease pencil data for this space
-Child particle interpolated from simulated or edited particles
-Editor header containing UI elements
-Select Head
-Catmull-Rom
-GLSL Nodes
-Make edges 'sail'
-Scattering
-Wire Select
-Unit
-Bezier Points
-Frame on which the simulation starts
-Animation Player
-Sequence Crop
-Autoname
-Dying
-Floor
-True when the property is hidden
-Cache Compression
-Keep Root
-Render Output Directory
-Multiple Caches
-External Shadows
-Points V
-Show Debug Properties
-White Level
-Framing Color
-Line Feed
-Logarithmic dissolve
-Circle
-Show movie files
-Maximum distance for the field to work
-Vertex Group Kink
-Enable anisotropic friction
-Use color management for GLSL rendering
-Exec Screen
-Render Layer
-Validity
-Show sensors of all selected objects
-Tessellation
--
-F-Curve Modifier's effects will be tempered by a default factor
-Paths Type
-Cine-Scope 24fps 2048x858
-Use Mist
-Object Duplicate Matrix
-Repulsion force to apply on cloth when close to colliding
-Marker is temporary
-Collection of screens
-Lock X Axis
-Octree Resolution
-Control how much mist density decreases with height
-Custom Color Set
-Texture Context
-Active Vertex Group
-Disallow movement around the Y axis
-Edge Color
-Datablocks
-Channels of the image to draw
-2D Cursor
-Constant QMC
-Shape Key Curve Point
-Command output
-turbulence_strength
-Color used for active bones
-3D View center is locked to this object's position
-Vertex groups of the object
-Weights for the vertex groups this vertex is member of
-Invert Axes
-Euler Rotation
-Material to override all other materials in this render layer
-Tag Sharp
-Is part of an IK chain
-Output image in JPEG format
-Main Groups
-Slider Min
-Side
-Bone
-Square (HV + S)
-Transforms include effects of parenting/restpose and constraints
-Name of operator to call on input event
-Particle Speed
-Motion Blur
-Nurb V-lines
-Font size to use for displaying the text
-Tools
-Float
-Dynamic
-Scene
-Color curve mapping to use for displaying the image
-Set audio channels to 4 channels
-Free handle color
-16-bit Signed
-Active object for this scene
-Previous Angular Velocity
-Material Link To
-Solid Light
-Property Value
-Worldspace distance over which to blend in the surface normal
-NLA Strip is active
-Mini Axis Size
-Multiply direct lighting with ambient occlusion, darkening the result
-Moving things with a mouse drag confirms when releasing the button
-Show Render
-Camera this timeline sets to active
-Update Automatically
-Inwards component of the vortex force
-Edit texture nodes from Brush
-Current perspective matrix of the 3D region
-Opaque
-Goal (vertex target position) friction
-All rules are averaged
-Grease Pencil Stroke
-Display Object Info
-The maximum distance from which a boid can attack
-Curve interpolation at this point: Bezier or vector
-Both Z
-Textbox Y Offset
-Node group datablocks
-Ogg Theora
-Logic And
-Identifier of operator to call on input event
-Spaces contained in this area, the first being the active space. NOTE: Useful for example to restore a previously used 3d view space in a certain area to get the old view orientation
-Set audio channels to stereo
-Order V
-View & Controls
-Rec Run
-Upward spring force, when inside the physics distance area
-Mesh Texture Face Layer
-Transformation orientation
-Gives a radial field toward the center of object
-layout
-Extend
-Collision margin for soft body. Small value makes the algorithm unstable
-box radius
-Cache Index
-Free
-Inbetween Move
-Packed File
-Capsule
-UV projector used by the UV project modifier
-F-Curve Modifier has invalid settings and will not be evaluated
-Dopesheet
-Only Selected
-Replace Text
-Freq
-Sets maximum Y value for the render border
-Compositing nodes
-Waveform Opacity
-Layers that contain something
-Skip Save
-Same Types
-Include Missing NLA
-Level
-Free Unused Nodes
-Maximum distance to apply repulsion force, must be greater then minimum distance
-Display tooltips
-Hold RMB Open Toolbox Delay
-Random variation of friction
-Proportional Editing Falloff
-Object Modifiers
-Logic Xnor
-Move to center of neighbors and match their velocity
-Stretch or squeeze the viewport to fill the display window
-X
-Show frame numbers of Keyframes on Motion Paths
-Shaded
-Enhance the resolution of smoke by this factor using noise
-Backdrop
-Selected
-Refraction Exclude
-Enable bitmap text on face
-Button4 Mouse
-The direction that the OpenGL light is shining
-Images are rendered without forcing UI changes, optionally showing result
-A circular Hue/Saturation color wheel, with Value slider
-Input 3
-Input 2
-Input 1
-Engine to use for rendering
-Active UV Texture Index
-Include the render time in the stamp image
-Disabled
-Sets the amount mirror reflection for raytrace
-Game Object Settings
-Clear
-Max Physics Steps
-Find All
-3D View far clipping distance
-Activate or deactivate item
-Blobby element in a MetaBall datablock
-Only Render
-Radius of the agent
-Show Navigation Guide
-Default Colors
-Sets the dimension of the sub-flares, dots and circles
-Dynamic Friction
-fi_FI
-Viewpoint Object
-Display the object solid, lit with default OpenGL lights
-Use Global Coordinates
-Use the initial length as spring rest length instead of 2 * particle size
-Priority
-Render polygon transparent, depending on alpha channel of the texture
-Active File
-Manually determine the number of threads
-User Defined
-Vertex group to control clump
-Enable/Disable Constraint
-Object is detected by the Near and Radar sensor
-VBOs
-When false, this (sub)layout is greyed out
-Select Mouse
-The Drivers/Expressions for this datablock
-Individual Centers
-Enables automatic saving of preview images in the .blend file (Windows only)
-Shape key in a shape keys datablock
-Use left Mouse Button for selection
-Pivot around the 3D cursor
-Auto
-Registered
-Flares Sub
-Short List
-Sounds Directory
-Interpolate
-Game engine properties
-Allow drawing multiple strokes at a time with Grease Pencil
-Output image in (old!) SGI IRIS format
-Left Alt
-Sub Level Menu Open Delay
-Number of frames at start of strip to fade in influence
-Keyframe Points
-Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point
-Display error text
-Vertex group for fine control over structural stiffness
-RNA Path (from ID-block) to property used
-Info
-User preferences space data
-C
-Emit Exclude
-Thumbnails
-Collision Sensor, detects static and dynamic objects but not the other collision sensor objects
-Lamp Sky Settings
-3D View center is locked to the cursor's position
-Manoeuvre to avoid collisions with other boids and deflector objects in near future
-Global gravity weight
-Curve or Surface subdivisions per segment
-The nominal number of game frames per second. Physics fixed timestep = 1/fps, independently of actual frame rate
-Back scattering (-1.0) to Forward scattering (1.0) and the range in between
-Library Path
-Calculate shadows while rendering
-Defines the strength of environment light
-Mux packet size (byte)
-Croatian (Hrvatski)
-Separate Colors
-Collider Friction
-Goal minimum, vertex group weights are scaled to match this range
-Gamma Cross
-Driver for the value of a setting based on an external value
-Unit System
-Highlight Line
-Constraint is the one being edited
-Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance
-Keying Set
-UV Local View
-Changing edges seam re-calculates UV unwrap
-View3D Move Modal
-Any Type
-Image Paint
-Set audio mixing buffer size to 16384 samples
-Creates turbulence with a noise field
-Active EditBone
-Brush
-Show only sensors connected to active states
-Disable simulation of angular motion along the Z axis
-3D View Generic
-Shape used as a relative key
-World Stars
-Use Environment Lighting
-X Location
-Auto Save Temporary Files
-Surface subdivisions per segment
-Output image in OpenEXR format
-Center
-Air has normally some thickness which slows falling things down
-Defines if the panel has to be open or collapsed at the time of its creation
-Parameters for the function
-Keep root keys unmodified
-Interpolate new particles from the existing ones
-Include visualization of Node related Animation data
-25%
-Sets the number of simulation substep per physic timestep, higher value give better physics precision
-Space in which transforms are used
-16x
-Sets the number of images of a movie to use
-Callback function defines for built-in Keying Sets
-20 - Theme Color Set
-How much heat effects smoke motion, higher value results in faster rising smoke
-Display when not linked to a visible states controller
-Collection of scenes
-256
-Smooth View
-Choose shading information to bake into the image
-Sets the number of star shaped lines rendered over the halo
-Textures
-Active spline
-Maximum bending stiffness value
-Eye Separation
-Window event timer
-Armature EditBones
-Game engine actuators to act on events
-End frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)
-Quad Split
-Auto handles clamped to not overshoot
-How much the spring has to be stretched/compressed in order to change it's rest length
-Show Brush On Surface
-.
-Defines the structure of the panel in the UI
-Handle 2 selected
-Use lights for GLSL rendering
-Groups
-Textured
-Camera rotation in horizontal axis
-Blender RNA
-Type of ID-block that can be used
-Column number to show right margin at
-Game Soft Body Settings
-Activity Culling
-Local Space
-Sets the layer as active for rendering
-Rotate From Normal
-IK Y Lock
-Amount of influence constraint will have on the final solution
-The window relative horizontal location of the mouse
-Set audio mixing buffer size to 2048 samples
-Lighting Mode
-Object to use as projector transform
-Numpad -
-Location to store the proxy files
-Add directed noise to the density at render-time
-Physics Sub Steps
-Mesh Faces
-Apply on spline
-Armature Sketch
-Render Halos in this Layer (on top of Solid)
-Nla Strips
-Weight used by the Bevel modifier
-Color range used for weight visualization in weight painting mode
-Boid Rules
-Delay between repeated pulses(in logic tics, 0=no delay)
-Billboard Time Index UV
-Game Data
-IK X Limit
-Theora
-Hook
-Collection of materials
-Lifetime mapped as 0.0 - 1.0 intensity
-Property Editor
-Vorbis
-Allow Land
-Tip select mode
-Navigation Mesh
-Limit the texture size to save graphics memory
-Game engine user defined object property
-Sticky vertex selection disabled
-Display an isolated sub-set of objects, apart from the scene visibility
-Straight Alpha
-Wheel Out
-Sequence Proxy
-Text displayed and edited in this space
-Custom Object
-Numpad +
-Menu
-Active Point Cache Index
-Starting frame of the stored range
-Panel Style
-Emphasize position of keyframes on Motion Paths
-Libraries
-Restrict Frame Range
-Quadratic Drag
-Display X Axis
-Copy of the colors associated with the group's color set
-Use a Mitchell-Netravali filter for anti-aliasing
-ID of the item
-Marker selection state
-Good smoothness and speed
-Use Onion Skinning
-Draw type for drawing UV edges
-id
-Result strip replaces the accumulated results by amount specified by influence
-Transform Space
-Speed factor
-Collection of group sockets
-Highlight Keyframes
-Hide files/datablocks that start with a dot(.*)
-Use 3D transform manipulator
-Value of shape key at the current frame
-Python
-Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample)
-Perspective Matrix
-Meta strip stack, last is currently edited meta strip
-Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point
-Auto Keyframe Insert Keying Set
-2D Cursor Location
-Vertex Weight Mix
-Group Index
-Add hairs
-Bake textures
-Crop to Border
-Initial boid health when born
-When rendering animations, save JPG preview images in same directory
-The number of grid lines to display in perspective view
-Worlds
-The distance between 3D View grid lines
-Vector font datablocks
-Tag Bevel
-Negate the effect of the kink vertex group
-Use viscoelastic springs instead of Hooke's springs
-Frameserver Port for Frameserver Rendering
-Shows actuators for this object in the user interface
-Show Info
-Grease Pencil Euclidean Distance
-Pixels moved by mouse per axis when drawing stroke
-Color balance parameters for a sequence strip
-Collision Quality
-Triple Buffer
-Face is used for shadow
-Include visualization of World related Animation data
-Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory
-Regular Widget Colors
-Y
-Bezier Curve Point
-To node
-Puff Mode
-Root
-Deliver Z values pass
-Coordinates of the control point
-Transforms don't include parenting/restpose or constraints
-Keying Set Path
-Friction force if a collision happened. (higher = less movement)
-Theme settings defining draw style and colors in the user interface
-MPEG-4(divx)
-Display reference images behind objects in the 3D View
-Collection of Node Links
-Follow Leader
-Hide objects on these layers when generating the Environment Map
-Line Number
-Fields per Frame
-Harmonic Damping
-Weight hair particles
-Use the Blender internal rendering engine for rendering
-Rotation/Scaling Pivot
-Minimum radial distance for the field's fall-off
-Duration
-Causes curve data to be duplicated with the object
-Absolute
-pt_BR
-Active Layer
-YCbCr (ITU 601)
-Average distance between any two stars
-Multitexture materials
-GLSL
-Current Scene
-How many keys to make new particles with
-Hide element
-Main Meshes
-Text character formatting settings
-Main Material
-Collection of object modifiers
-Maximal resolution used in the fluid domain
-Amount of light that gets emitted by the volume
-Grid
-Use For Growing Hair
-Parent edit bone (in same Armature)
-Use a column layout for toolbox
-Sort by time
-When transforming strips, changes to the animation data are flushed to other views
-Theme settings for widget color sets
-Inner Thickness
-Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)
-Constant Jittered
-Weight to assign in vertex groups
-Bone Armature-Relative Matrix
-Rest length of the harmonic force
-user_preferences
-Gimbal
-Alpha Under
-RNA property definition
-YXZ Euler
-Use shadows for GLSL rendering
-IOR
-Gives the flare extra strength
-Editor menu containing buttons
-Right handle selection status
-Minimum Value
-Action referenced by this strip
-Display and edit the grease pencil freehand annotations overlay
-Path edit mode
-Smooth falloff
-Preferences related to viewing data
-Max Edge Error
-A square showing Hue/Value, with Saturation slider
-D
-Material slot in an object
-Set audio sample format to 8 bit unsigned integer
-User defined integer number value in an integer properties layer
-Output image to a frameserver
-Single Layer
-Radius of boids personal space in air (% of particle size)
-YCbCr (Jpeg)
-Length
-Specular
-Proportional Editing using connected geometry only
-Convex Hull
-Mid-range quality and speed
-Scale of the added turbulent noise
-Only use complete matches of search string
-Show Splash
-Wind
-Repulsion Force
-Method used to convert stroke to bones
-Show Pose Markers
-Frame on which the simulation stops
-Warp Data
-Key angular velocity
-select_start
-Show Linked to Controller
-Struct in which this struct is always nested, and to which it logically belongs
-Include a custom note in image metadata
-Log conversion gamma
-Transform Orientation
-Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)
-Which style to use for font kerning
-Fall-Off
-Render voxels from a Blender smoke simulation
-Draw the points which make up the strokes (for debugging purposes)
-Frames
-Original image height
-Use face for collision and ray-sensor detection
-Around Frame
-Image Strip
-Bounding Box
-Device up/down directly controls your Z position
-The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed
-Original image width
-Show Margin
-Transform Modal Map
-Stiff Quads
-System
-Spherical Panoramic
-Onion Skinning settings for animation visualisation
-KeyMap Items
-Valid
-MP2
-Handle 2 Type
-Italic
-Material Raytrace Mirror
-Object Grouped Active
-Use Frame Rate
-sv_SE
-Samples
-Name
-Material mode to use for rendering
-Cube
-Result color of the volume, after other light has been scattered/absorbed
-Use Min
-Display the center and axis during rotation
-Multiplier for intensity values
-Render Edge-enhance in this Layer (only works for Solid faces)
-Material datablocks
-/
-Arabic (العربية)
-Most compact representation. Uses '+' as separator for sub-second frame numbers, with left and right truncation of the timecode as necessary
-Filter 2D
-Lift
-Lighting for a World datablock
-External
-Collection of metaballs
-Sets the hardness of the halo
-General rotation damping
-Constraint name
-Hardness
-Syntax highlight for scripting
-Parameters and Settings for the Filebrowser
-Edit Path
-Rot Matrix
-Global Time
-Grease Pencil Manhattan Distance
-Grouping Method
-Lock view rotation in side views
-Effector Group
-Collection of armature edit bones
-Flare
-Control Point selected
-Freehand curves defining the sketch on this frame
-Make this nurbs surface act like a Bezier spline in the V direction (Order V must be 3 or 4, Cyclic V must be disabled)
-Operator
-Near
-Use the pinned context
-Display files as a detailed list
-On Selected Bones Only
-Has Reports
-Property
-Collection of related sketches
-Control point mass values
-Chance that the particle will pass through the mesh
-Sticky Selection Mode
-Font
-Key Modifier
-Clip
-Edit texture nodes from Object
-resolution_y
-Storage of an operator being executed, or registered after execution
-Image
-Density Scale
-Active Render Layer
-Space DopeSheet Editor
-Maximal
-Indirect Factor
-Pixel Filter
-Upper field first
-Static
-AVI
-Internal Friction
-Global Hair
-Level height
-Bake Specular colors
-DopeSheet space data
-Registered Optionally
-Causes actions to be duplicated with the object
-Enable collisions with other objects
-Theme settings for the Properties
-Region ID
-Strength
-Use nodes for GLSL rendering
-General Mass value
-Damping Factor
-Show Paint
-Weight of a particle dupliobject in a group
-Shows controllers for this object in the user interface
-Allow the use of colors indicating constraints/keyed status
-Target Object
-Texture Paint
-Defines how AO mixes with material shading
-Driver Variable
-Wrap words if there is not enough horizontal space
-Point in a shape key for Bezier curves
-Directory/name to save animations, # characters defines the position and length of frame numbers
-Follow Path
-Use a cubic filter for anti-aliasing
-Media First
-Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled
-Draw Frames
-Length of rays, defines how far away other faces give occlusion effect
-Lock Scale
-Method of attenuating density by distance from the point
-8-bit Unsigned
-File Paths
-Point Source
-cs_CZ
-Pose Space
-Sort the file list alphabetically
-Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone
-Collision Type
-Collection of node trees
-Occlusion Resolution
-Apply sun effect on sky
-Stamp Note Text
-Traditional Chinese (繁體中文)
-Scene layers included in this render layer
-Weight used by the Bevel modifier 'Only Vertices' option
-IK Y Stiffness
-The default directory to search for texture plugins
-Vertex Group Velocity Negate
-Modifiers
-Invoke Region Window
-Auto Perspective
-Module
-The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions
-Display Camera
-Subdivisions
-Blendfile Data
-Location of custom proxy file
-Solidify
-Do a full redraw each time, slow, only use for reference or when all else fails
-Horizon Spread
-06 - Theme Color Set
-Show a visualization of physics bounds and interactions
-Z
-Quick Cache
-Show Error
-Left
-Property that stores arbitrary, user defined properties
-UV 4
-Resolution %
-Scattering color
-UV 1
-UV 3
-UV 2
-Handle 2
-Display datablocks in visible layers
-Handle 1
-Left handle selection status
-Active Keying Set Index
-SMPTE (Full)
-Use textures to affect material properties
-Draw Modified Edges
-Maximum caused damage on attack per second
-Shape Key
-Enable file compression when saving .blend files
-Script datablocks (DEPRECATED)
-Frame rate for the screencast to be played back
-MPEG-1
-Use Sketching Sessions
-MP3
-Use ObColor instead of vertex colors
-Lock X Rotation Axis
-Envelope Tail Radius
-Causes armature data to be duplicated with the object
-The menu label
-Allow Flight
-Keyed timing
-Free Run (rec date)
-Use a 3D manipulator widget for controlling transforms
-Insert Keyframes - Only Needed
-Show handles of Bezier control points
-Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)
-Inverse Quadratic
-ru_RU
-Use the value from some RNA property (Default)
-Calculate point velocities automatically
-Actions
-Modifiers affecting all the F-Curves in the referenced Action
-Enables automatic saving of preview images in the .blend file
-Animation Player Preset
-16 - Theme Color Set
-Vector handle color
-Proxy render size
-Clip Max X
-Clip Max Y
-Open in thumbnail view for images and movies
-Physics Engine
-Description
-Sort files by size
-Particle Cache
-Action Influence
-Envelope
-View Perspective
-IK X Maximum
-Boid States
-Display datablocks of selected objects
-Full Sample
-Animation data for datablock
-Channel
-Interpolation mode used for first keyframe on newly added F-Curves. Subsequent keyframes take interpolation from preceeding keyframe
-Order U
-Timecode
-Distance moved by mouse when drawing stroke (in pixels) to include
-Calculate radiosity in a pre-process before rendering
-Selected to Active
-For RGB curves, the color that black is mapped to
-Mesh Texture Face
-E
-For Pose-Mode drawing, only draw ghosts for selected bones
-Landing Smoothness
-Grease Pencil Frame
-Shift
-Mouse Move
-Button 3
-Auto-detect
-Space Timeline Editor
-Only Selected Keyframes Handles
-Use smoke density as texture data
-Operator has a set of reports (warnings and errors) from last execution
-Layered
-Object Vertices
-Set audio mixing buffer size to 512 samples
-Duplicate Metaball
-Saves this datablock even if it has no users
-Cine-Scope 48fps 2048x858
-Ad-hoc correction for over-occlusion due to the approximation
-Line Info
-Filtering Group
-Choose the method used to split a quad into 2 triangles for baking
-Menu Item Colors
-Blending factor for Fresnel
-Constant
-Mitchell-Netravali
-Color
-Button 8
-IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC
-Include visualization of Camera related Animation data
-Free Run
-Opacity of the points
-Button 9
-Collection of speakers
-Adaptive QMC
-Layers the object base is on
-NLA Generic
-Sort by size
-Friend
-Velocity Min
-The brightness of the icon
-Show the active object's cloth point cache
-Invoke Default
-Amplification
-Display warnings
-Realtime
-Size of the font used when rendering stamp text
-Refraction
-Third input for the effect strip
-Snap to vertices
-Global child particles percentage
-Faces collide too, can be very slow
-Disable collision for this object
-Disable the time difference between fields
-The default directory to search for loading fonts
-Automatic keyframe insertion in available curves
-Bake the normals in camera space
-Show Header
-layers
-Color for all strokes in this layer
-Top Level Menu Open Delay
-Exec Area
-Auto Render
-Type of periodic offset on the curve
-Key location
-Use scaled and grid-fitted kerning distances
-Stars setting for a World data-block
-Burn
-Set audio sample format to 24 bit signed integer
-Standard
-0
-Tag Crease
-Image Sequence
-Function is registered as callback as part of type registration
-UV Layer to control billboard normals
-Auto-Keying Mode
-Bitrate
-Back scattering weight
-Select where rendered images will be displayed
-The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent
-Gamma Corrected Color
-AutoMerge Keyframes
-Hold the first frame if no previous strips in track, and always hold last frame
-Active PoseChannel constraint
-Scene Bases
-Vertex Colors
-Collection of mesh faces
-string
-Live search filtering string
-Sequencers active strip
-Number of scene samples to take with motion blur
-Vertex Group for pinning of vertices
-Display libraries
-The number of fields per rendered frame (2 fields is 1 image)
-Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)
-Frame of referenced Action to evaluate
-Line Error
-Plus
-Coordinates
-Roll CW
-Envelope Control Point
-Invert roll Axis
-Source List Text
-The file extension used for saving renders
-Last selected element
-Radial falloff power (real gravitational falloff = 2)
-Face Normal
-Fluid Simulation Settings
-Disable or enable the render layer
-Tap
-Active Bone Group
-Show render related properties
-Number of vertical pixels in the rendered image
-Child of this pose bone
-Location of Center of mass
-Show background image in back view
-Max Land Acceleration
-3D View
-Snap to actual frames/seconds (nla-action time)
-Two-side
-Tag
-Enables Anti-aliasing
-Smoke domain settings
-Tab
-Default Closed
-SPH Fluid Settings
-Dome physical configurations
-Theme settings for the User Preferences
-Front-Truncated
-Has the current session been saved to disk as a .blend file
-12 - Theme Color Set
-Box
-Constraint modifying the transformation of objects and bones
-Curve datablocks
-Adjustment Layer
-Velocity Scale
-Field of View of the Dome - it only works in mode Fisheye and Truncated
-Jitter
-Audio Window
-Use Grease Pencil
-Filter Blender
-Start frame displayed in the sequence editor after offsets are applied, setting this is equivalent to moving the handle, not the actual start frame
-Create springs for this number of frames since particles birth (0 is always)
-Label
-Object this base links to
-Apply channel rotation as IK constraint
-PCM
-Percentage
-Render Sky in this Layer
-Red
-pl_PL
-Datablock whose nodes are being edited
-Draw user interface text anti-aliased
-Head
-Subdivide stroke in bones of specific length
-Use the depth under the mouse to improve view pan/rotate/zoom functionality
-Texture to use as force
-RNA type definition
-PIZ (lossless)
-Bit depth per channel
-Billboard Split UV
-Pxr24 (lossy)
-Region height
-Heat
-Particle select and display mode
-Normalized
-Mux Packet Size
-Diameter in Pixels for Object/Lamp origin display
-Distance between subsequent volume depth samples
-Swap the Mouse Wheel zoom direction
-Sequence editor space data
-The context in which the panel belongs to. (TODO: explain the possible combinations bl_context/bl_region_type/bl_space_type)
-Bake from Multires
-Start size of strands in pixels or Blender units
-Shape Key datablocks
-Targa
-Particle Instance
-Bezier V
-Multiplier to bring particle speed within an acceptable range
-Collision Group
-Limit effectors to this Group
-Display datablocks of all objects of same type as selected object
-The constraint is applied relative to the local coordinate system of the object, with the parent transformation added
-Deliver normal pass
-Location of tail end of the bone
-The transformation of the target is evaluated relative to the world coordinate system
-File Path
-O
-FLAC
-UV Layer to control billboard time index (X-Y)
-Blender Units
-Vertex Group Tangent Negate
-Set color of selected color stop
-Pivot center for rotation/scaling
-Set audio sample format to 16 bit signed integer
-Zooms in and out based on horizontal mouse movement
-Invert Zoom
-Alpha Mode
-bl_use_postprocess
-Land Stick Force
-Create empty placeholder files while rendering frames (similar to Unix 'touch')
-Face Collision
-Automatic keyframe insertion for Objects and Bones
-Damp
-Disable simulation of angular motion along the X axis
-RNA Array Index
-Unsigned Number
-Output video in MPEG format
-Dead
-Text Widget Colors
-Auto Save Time
-Freehand curve defining part of a sketch
-Header Text Highlight
-Seed
-True when the Ctrl key is held
-Raytrace Acceleration Structure
-Which direction is used to calculate the effector force
-Addon Key Configuration
-Data point for freehand stroke curve
-Number of cone samples averaged for blurry reflections
-F8
-Filter Sound
-Mass of cloth material
-Matrix
-Action Group that this F-Curve belongs to
-Subdivide stroke adaptively, with more subdivision in curvier parts
-How many steps to draw the path with
-Space Text Editor
-Handle Vertex
-Render face two-sided
-Mist uses inverse quadratic progression
-DV
-Has Maximum
-Skip Quad to Triangles
-Number of times to repeat the action range
-Maximum Distance
-is_baked
-Amount of damping during collision
-F9
-8192
-X Offset
-Image Pin
-Accuracy of attack
-Continuously unwrap the selected UV island while transforming pinned vertices
-Collection of grease pencils
-Gesture Border
-Exclude raytraced reflection pass from combined
-Choose normal space for baking
-Boid state for boid physics
-Occluder for optimizing scene rendering
-Axis Angle
-Field settings for an object in physics simulation
-Rotation Mode
-Active Spline
-Buoyancy
-Element of a curve, either Nurbs, Bezier or Polyline or a character with text objects
-Start player with a visible mouse cursor
-Bars
-Armatures active edit bone
-Breakdown
-Color Mode
-Diffuse
-01 - Theme Color Set
-Start position of the marker in the line
-Consider objects as whole when finding volume center
-Iris
-Save Buffers
-Time Scale
-Split quads predictably (1,2,3) (1,3,0)
-Constraint
-Display Hidden
-Receive shadows from sources outside the volume (temporary)
-Required
-Domain
-Display Speaker
-GLSL Ramps
-Point data to use as renderable point density
-Keyframe insertion only when keyframe needed
-Audio Sample Rate
-Area width
-Time
-Texture datablock used by this texture slot
-Draw Waveform
-DPX
-Expression
-Voxel data settings
-Constraints
-State Colors
-Influence setting is controlled by an F-Curve rather than automatically determined
-Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)
-Set audio sampling rate to 48000 samples per second
-Order of video fields. Select which lines get rendered first, to create smooth motion for TV output
-Surface Diffuse
-Magnetic
-Stamp Background
-Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled
-Show Warn
-When bone has a parent, bone's head is struck to the parent's tail
-Timer 0
-Timer 1
-Timer 2
-Display Y Axis
-Frame player from IRIDAS
-Children
-Zoom To Mouse Position
-Shadows
-Use High Quality Drawing
-Exclude emission pass from combined
-Invert rotation axis
-Plane
-Drivers
-Particle system in an object
-Shader Nodes
-Z-Buffer
-Soft to Soft Body
-Expanded in the user interface
-After Current
-Mix
-Object Color
-Fresnel
-Main Cameras
-Atmosphere Extinction
-Use Indirect Lighting
-Elastic Limit
-Material Slot
-Resolution of raytrace accelerator. Use higher resolutions for larger scenes
-Falloff Power
-Mesh Deform
-Show influence curves on strips
-Tweak timing for physics to control frequency and speed
-IK X Stiffness
-Theme settings for the File Browser
-Images are saved with RGB (color) data
-1
-Textured Fonts
-Data type of the property
-Gain
-Scale X
-Is Perspective
-Metaball
-IK Z Stiffness
-B-Bone Display X Width
-Space Console
-Handle type for handles of new keyframes
-Left Mouse
-Macro
-Average
-Curve
-Sketches for this layer on different frames
-User interface layout in a panel or header
-Error Tolerance
-Axis of mouse movement to zoom in or out on
-Disable auto (de)activation in physics simulation
-Softness
-Inherit Scale
-Graph Editor
-Method of shading, attenuating, and scattering light through the volume
-View
-Position Iterations
-H.264
-Romanian (Român)
-Still Frame Number
-Extension Filter
-Vertex Group Roughness End Negate
-Specular Colors
-Minimal Info
-Face selection mode
-Reflection Color
-Node Editor
-Proportional distance over which the light is diffused
-Use Local Coords
-Zmask Negate
-Property that gives the name of the struct
-Rotation in quaternions (keep normalized)
-On Keyframes
-Pulse False Level
-Animated
-Main Grease Pencils
-Alpha Sort
-Factor for ambient occlusion blending
-Active vertex color index
-Generator
-Author
-Restrict Animation Updates
-Lock editing of four component rotations by components (instead of as Eulers)
-NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled)
-The diffuse color of the OpenGL light
-Do not calculate lighting and shadows
-Max Sample Error
-Cut
-Starting distance of the mist, measured from the camera
-Damping
-Push an undo event (needed for operator redo)
-White
-Sets the strength of the add effect
-Collection of lamps
-Animation
-Parent bone (in same Armature)
-Environment Maps
-Inputs
-Direction
-Max difference in heights of obstacles to enable their interaction
-group
-75%
-Hide this curve in editmode
-Deformed Location
-Include visualization of Lattice related Animation data
-Weighted result of strip is multiplied with the accumulated results
-Cloth Settings
-Sharp edge for the EdgeSplit modifier
-Collection of groups
-window
-Preset
-Theme Outliner
-Fast Navigate
-Draw Smooth Edges
-Collection of curves
-Star Tips
-NLA Evaluation Enabled
-3D Cursor Location
-Spline Bezier Points
-Stereo
-Page Up
-Negate the effect of the field vertex group
-Collide All
-Items Expanded
-Marker for noting points in the timeline
-Z Direction
-Causes lamp data to be duplicated with the object
-Scene Strip
-Boid state name
-Simulation value to be used as a texture
-64-bit Float
-Domain Object
-Right
-Shape of clumping
-XZY Euler
-Group Sockets
-Individual pose bones for the armature
-Min Step
-Manipulator Scale
-Main Armatures
-Die Time
-Number of frames to show after the current frame (only for 'Around Current Frame' Onion-skinning method)
-Placeholders
-name
-Unfitted
-Minimum regions size. Smaller regions will be merged
-Mesh Selection Mode
-Method to draw in the sequencer view
-Mute
-Down Arrow
-Render Strands in this Layer
-Child Particles
-Duplicate Action
-IK Param
-Main Images
-Weight for cloth simulation
-Index number of the vertex group
-Collection of NLA Tracks
-Sequence strip data for a single frame
-Sculpt/Paint Use Unified Strength
-Audio Mixing Buffer
-ID-block that the specific property used can be found from (id_type property must be set first)
-Linear physics
-Use Collision Bounds
-Passes
-Noise algorithm - Original Perlin: Smooth interpolated noise
-Additive
-Handle 2 selection status
-Trigger controllers only for an instant, even while the sensor remains true
-Loose edge
-Edit animation/keyframes displayed as 2D curves
-Sculpt/Paint Use Unified Radius
-Index to the specific property affected by F-Curve if applicable
-Main Window Managers
-Unit to use for displaying/editing rotation values
-Editmode bone in an Armature datablock
-Bending Stiffness Maximum
-Selection state of the curve point
-Enable pinning of cloth vertices to other objects/positions
-Shared
-Zoom = Up/Down
-NLA Strips
-Text to search for with the find tool
-Use a DCI Standard preset for saving jpeg2000
-Blend Mode
-Space Sequence Editor
-Textures Directory
-Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes
-Include the name of the active scene in image metadata
-F-Curve Name Filter
-Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox
-pin_id
-Fluid interaction radius
-NLA Strip 'transitions' between adjacent strips
-Editable
-Emission
-Template armature that will be retargeted to the stroke
-Selection status
-Texture slot defining the mapping and influence of a texture
-Connected
-Key
-Align the transformation axes to world space
-Transform parameters for a sequence strip
-Layer Opacity
-Use the Bullet physics engine
-Method for generating shadow samples (for Raytrace)
-Effect particles' dynamic rotation
-Show options for whether channels related to certain types of data are included
-G
-Collection of group objects
-Make hairs shorter
-Show properties marked for debugging while the game runs
-Invert x axis
-Greek (Ελληνικά)
-Smooth
-Sync view position between side views
-Used Layers
-Active File Text
-F18
-F19
-Force effector weight
-The distance over which the mist effect fades in
-Edge Select
-F12
-F13
-F10
-Display Meshes
-F16
-Options
-Grease Pencil datablocks
-F15
-Output video in AVI JPEG format
-Sky Color
-blend_data
-Temporary Directory
-Current rendering engine is a game engine
-100%
-Vertex Group Roughness 2
-IK Rot Weight
-Handle Type
-Bevel Weight
-F-Curve Modifier Type
-int
-No Sleeping
-Save TIFF with 16 bits per channel
-ID Property Group
-Island selection mode
-Collection of texts
-Edges collide too
-512
-Sets minimum Y value for the render border
-Mouse X Position
-Active screen showing in the window
-Stamp Note
-Number of horizontal tiles to use while rendering
-Tilt
-Child Particle
-Action Start Frame
-Media Last
-Pass in multilayer image
-Back Space
-Outflow
-Active Boid State Index
-Enable cluster collision between soft and soft body
-Instance support leads to effective memory reduction when using duplicates
-Xvid
-Realtime display of a modifier
-Sets the layer as active for display and editing
-Wireframe
-Grease Pencil Eraser Radius
-Accurate, but slow when noise-free results are required
-Syntax Special
-Repeat
-Global undo works by keeping a full copy of the file itself in memory, so takes extra memory
-Strength of noise
-Vertical
-Separate
-Self Friction
-Snap median onto target
-Area
-Falloff
-REC709
-Smooth the normals of the surface or beveled curve
-2D View Minimum Grid Spacing
-Font Style
-Image datablocks
-3D region in this space, in case of quad view the camera region
-Sound datablocks
-Auto Velocity
-Data
-Bake the normals in world space
-Lock Camera and Layers
-Vertex group to control rotation
-Global
-Sun Brightness
-Optional custom node label
-Align to Normal
-Directory displayed in the file browser
-Deliver speed vector pass
-Enabled
-Frame player from Tweak Software
-Weighted result of strip is removed from the accumulated results
-A animation layer containing Actions referenced as NLA strips
-Key configuration that can be extended by addons, and is added to the active configuration when handling events
-Dominant
-Line Output
-Seam edge for UV unwrapping
-Options for this panel type
-Menu Widget Colors
-Main Worlds
-Shadowed
-11
-Atmosphere
-Create representation for obstacle simulation
-Estimated rotation matrix
-16
-Pose
-Sun size
-NodeTree
-RGB
-2048
-Anaglyph
-Active Object
-Collection of curve splines
-Marker highlighting a portion of text in a Text datablock
-DopeSheet
-Magnetic effector weight
-Render face transparent and add color of face
-Previous Rotation
-Display Shapekeys
-Aggression
-en_US
-Color space to use for internal XYZ->RGB color conversion
-Numpad 7
-Sets the maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime
-Keying Sets All
-Boid
-Numpad 6
-Snap Element
-it_IT
-Include the name of the foreground sequence strip in image metadata
-Metaballs
-Active particle system being displayed
-Toggle between moving the viewpoint or moving the scene being viewed
-Use a Gaussian filter for anti-aliasing
-ChannelDriver Variables
-MetaBall
-Combined
-FFmpeg video codec #1
-Use Default Fade
-Numpad 3
-ZXY Rotation Order. Prone to Gimbal Lock
-Index to the specific setting if applicable
-Bake Mirror values
-Use vBVH
-Apply channel size as IK constraint if stretching is enabled
-Invert Zoom Direction
-Numpad 1
-Edge Sharp
-Unit Settings
-Stamp Frame
-Brush datablocks
-use global timestamp written by recording device
-Mapping
-Snap active onto target
-Rigid Body Joint
-Rate control: buffer size (kb)
-Scale factor along the Y for items in this (sub)layout
-RGBA
-Half
-Sets the number of rings rendered over the halo
-Turbulence
-Graph Editor instance has some ghost curves stored
-Halo
-No display
-Stiffness Scaling
-Use a custom falloff curve
-Contents Follow Opening Direction
-Off
-Seam
-Sculpt
-Sequences
-Stiff viscosity is a factor of normal viscosity
-Curve Guide
-Proportional Editing disabled
-Rotate Around Selection
-Key Maps
-Minimum
-Align newly added objects facing the active 3D View direction
-Tool Properties
-Amount of noise for the force strength
-Amount of ray samples. Higher values give smoother results and longer rendering times
-Numpad 8
-]
-Exclude specular pass from combined
-Stamp Scene
-Collection of grease pencil layers
-Choose Collision Type
-Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption)
-Particle system has been edited in particle mode
-Stroke conversion method
-Properties acting as inputs for this driver
-Point Cache
-Window Manager Event
-Collection of brushes
-Don't use a physics engine
-Material Override
-Temperature difference to ambient temperature
-State determining which controllers are displayed
-All Object Origins
-Uses extreme alpha
-Node Tree
-Before Current
-Array
-Collision settings for object in physics simulation
-Stretch To
-F-Curves for controlling the strip's influence and timing
-Field Order
-Hide Dot Files/Datablocks
-Loose
-Use Game Engine
-Onion Skinning (ghosting) settings for visualisation
-Draw dashed black-white edges
-Align handle selected color
-Minimum number of pixels between each gridline in 2D Viewports
-Sky
-Spring Frames
-Location of head end of the bone
-Active key configuration (preset)
-Width
-Action Group is selected
-Collection of Texture Nodes
-Collection of add-ons
-States which are being used by controllers
-Gravity or external force vector
-NLA Track is active
-Ogg
-Roll
-Grless
-Wheel Down
-Amount of friction during particle collision
-Search in all text datablocks, instead of only the active one
-View pivot location
-Draw image with RGB colors and alpha transparency
-Resolution
-Use the scene's active camera and layers in this view, rather than local layers
-Every point is effected by multiple springs
-Vertex
-Include the filename of the .blend file in image metadata
-Maximum distance error from contour to cells
-Output video in H.264 format
-Action displayed and edited in this space
-History
-Local View
-Stamp Text Color
-Translation
-IK Y Maximum
-File Select Parameters
-Shared Vertex
-Safe Margin
-Tip Size
-Edge color
-Negate the effect of the size vertex group
-Game engine controllers to process events, connecting sensor to actuators
-Triangle Mesh
-NLA Strip is played back in reverse order (only when timing is automatically determined)
-Scale Y
-H
-Main Lamps
-Approximate
-Controllers
-Deliver specular pass
-The number of old versions to maintain in the current directory, when manually saving
-Theme settings for the NLA Editor
-Nearest Marker
-Randomize star colors
-Theme settings for the Sequence Editor
-Index of refraction (higher values are denser)
-Local Location
-Default Key Configuration
-Show background image while looking to the right
-The space where the header is going to be used in
-Max number of vertices per polygon
-Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's
-Averaged Value
-Use a box filter for anti-aliasing
-Spin CCW
-Color to use for stamp text
-Wheel Invert Zoom
-Lock Camera to View
-New Interpolation Type
-Main data structure representing a .blend file and all its datablocks
-Calculate bone paths from heads
-Layer of vertex colors in a Mesh datablock
-Is this keymap item user defined (doesn't just replace a builtin item)
-Main Textures
-Enable soft body shape matching goal
-How many self collision iterations should be done. (higher is better quality but slower)
-Collection of scene bases
-Show right margin
-Ambient Occlusion
-Frame this control-point occurs on
-Snap to edges
-Turbulence effector weight
-Build record run time code index
-float
-Use Edges as springs
-Rings
-Color Ramp Elements
-Charge
-Thickness
-Zmask Layers
-The panel label, shows up in the panel header at the right of the triangle used to collapse the panel
-Spread
-Cluster Iterations
-Location
-Weight Paint
-15 - Theme Color Set
-space_data
-Vertex group to control kink
-If this is set, the menu gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is "OBJECT_MT_hello", and bl_idname is not set by the script, then bl_idname = "OBJECT_MT_hello"
-Path is being edited
-ShapeKey Editor
-AC3
-Set audio channels to 5.1 surround sound
-Minimum Size
-Path to a custom animation/frame sequence player
-Smoke inherits it's velocity from the emitter particle
-Display Lists
-Maximum number of frames on either side of the active frame to show (0 = show the 'first' available sketch on either side)
-Compress File
-Bezier U
-Displace
-Velocity Max
-Use Right Mouse Button for selection
-Box Backdrop Colors
-Exec Default
-3
-Path point is selected for editing
-Bone Group
-When calculating Bone Paths, use Head or Tips
-Project Individual Elements
-Parameters for IK solver
-Show the object origin center dot for all (selected and unselected) objects
-BLI BVH
-Realtime Updates
-Shutter
-How strongly the fluid tries to keep from clustering (factor of stiffness)
-Target
-Scrollbar
-Show controllers of all selected objects
-Instead of per brush radius, the radius is shared across brushes
-screen
-Use large mouse cursors when available
-Keymap is defined by the user
-Grease Pencil Stroke Point
-48 kHz
-Use the manipulator for rotation transformations
-Bullet
-Armature Bones
-Directory
-TimeCode Style
-Identifier
-Does full Sky texture render for diffuse energy
-Items in the keymap, linking an operator to an input event
-AvMinMax
-Multiply the current speed of the sequence with this number or remap current frame to this frame
-Apply force only in 2d
-MPEG
-Is this keymap item modified by the user
-Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center
-How smoothly the boids land
-region
-Swedish (Svenska)
-Region in a subdivided screen area
-Add indirect light bouncing of surrounding objects
-Factor Radius
-Obstacle
-Color used for selected bones
-Line Numbers
-Draw edges after modifiers are applied
-Space Info
-Multicam Selector
-Reflection Exclude
-Weight of scale constraint for IK
-Node editor space data
-Link between nodes in a node tree
-Show the entire viewport in the display window, viewing more horizontally or vertically
-Pixel distance around the handles to accept mouse clicks
-Initial State
-Sum Values
-Channel Group
-Tools can use this to tag data, (initial state is undefined)
-The default directory to search for textures
-Lin error
-F-Curve is selected for editing
-Keying Sets
-Release confirms
-64
-Title for the file browser
-Sets the audio sample format
-Invert y Axis
-Include the name of the last marker in image metadata
-Collection of keyframe points
-3D View space data
-Vortex effector weight
-Object adds fluid to the simulation
-Use smoke velocity as texture data
-Maximum Radial Distance
-The axis to display the image on
-Keying set options
-Horizon Brightness
-Render Engine
-Display Particle
-Exclude AO pass from combined
-Lights user to display objects in solid draw mode
-Textbox Height
-Point coordinates
-Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector
-Text Editor
-Use display lists to speed up rendering by keeping geometry on the GPU
-Actuators
-Make this nurbs curve or surface meet the endpoints in the U direction (Cyclic U must be disabled)
-es_ES
-Auto Run Python Scripts
-Subtract
-Screen Editing
-Properties in the struct
-Set audio sampling rate to 96000 samples per second
-Scale to use when converting between blender units and dimensions
-Mouse/Trackpad Zoom
-X Ray
-Maximum distance of reflected rays (reflections further than this range fade to sky color or material color)
-True when this property is an output value from an RNA function
-False when F-Curve could not be evaluated in past, so should be skipped when evaluating
-Fresnel Factor
-Minimum for slider
-Use Goal
-Sets how the texture is extrapolated past its original bounds
-Minimum size of strands in pixels
-Points
-Motion Path
-Emission Color
-Global maximum shadow samples
-Path
-Action
-Sets the number of sub-flares
-Used State
-Update other affected window spaces automatically to reflect changes during interactive operations such as transform
-Filter Script
-Method to interpolate/smooth values between voxel cells
-Gives halo a texture
-Show markers belonging to the active action instead of Scene markers (Action and Shape Key Editors only)
-Divide
-Proportional Editing mode, allows transforms with distance fall-off
-Angular distortion between UV and 3D angles
-Random variation of damping
-Channels Selected
-plugin
-Spline IK
-The frame on which the timeline marker appears
-Snap to 1.0 frame/second intervals
-Handle 1 selected
-Free all image texture from memory after render, to save memory before compositing
-Method used for combining Active Action's result with result of NLA stack
-If enabled, stiffness can be scaled along a weight painted vertex group
-Invert z Axis
-Minimum regions size. Smaller regions will be deleted
-Display Mode
-Text bounding box for layout
-Onion Skinning
-Open
-User Add-Ons
-Output file format
-Size
-Backdrop X offset
-Active Pose Marker Index
-Text Marker
-Number of preprocessing passes to reduce overocclusion
-Modifiers affecting the shape of the F-Curve
-Wheel In
-Mesh Face
-Rotation Angle
-Path to a setting for use in a Keying Set
-Sync Markers with keyframe edits
-Whether to use minimum clipping value
-Main Actions
-Editing context being displayed
-Raytraced refraction settings for a Material datablock
-Enable image painting mode
-Hidden
-When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates
-Only show and edit handles of selected keyframes
-Cinema 48fps 2048x1080
-Max Rate
-Envelope Head Radius
-Use old Octree structure
-Global maximum subdivision level
-Use this object's coordinate system instead of global coordinate system
-Viscosity
-Theme Properties
-Boolean Property
-UV Selection Mode
-Force the curve view to fit a defined boundary
-Objects
-Default (Default)
-Shade Down
-Grease Pencil Layers
-Current Keying Set index
-Shadow Exclude
-Root Size
-Rest Shade Key
-Framerate, expressed in frames per second
-Scrollback
-Overlay Lock
-Duplicate Text
-Russian (Русский)
-10 - Theme Color Set
-Collection of texture slots
-ID Materials
-I
-The distance from which particles are affected fully
-Action Pose Markers
-Clamp velocity to this maximum speed
-English (English)
-JPEG
-L
-Display only files with extensions in the image select window
-Theme Sequence Editor
-ID From
-All Scenes
-Make hairs longer or shorter
-Handle Vertex Select
-With displacement normalize to the distance, with ambient occlusion normalize without using material settings
-Physics
-ID
-Mesh Vertex Color Layer
-Use curve weights to influence the particle influence along the curve
-Cached location on path
-Motion
-Node tree being displayed and edited
-Tangent Shading
-Mesh Vertex Color
-B-Spline
-Based on distance/falloff it adds a portion of the entire path
-Theme settings for the Audio Window
-Displacement
-Coordinates of the second handle
-Rendering settings for a Scene datablock
-Radius of boids personal space on land (% of particle size)
-Live Edit
-The length of the contents of this strip before the handles are applied
-Display Armature
-Length Mode
-Display datablocks of active object
-SDL
-Collection of Nla Strips
-Amount the Active Action contributes to the result of the NLA stack
-Show only actuators connected to active states
-Vertex group for fine control over bending stiffness
-4 Channels
-Bake displacement
-Acceleration
-Angular Velocity
-Boid Rule
-Action Group
-Split quads predictably (0,1,2) (0,2,3)
-Struct definition this is derived from
-Include the current date in image metadata
-Action Group is expanded
-Draw title safe margins in preview
-Output image in DPX format
-Include visualization of Object-level Animation data (mostly Transforms)
-Proxy size 25%
-16 bit color channels
-The default directory to search for sounds
-Log
-Redraw all overlapping regions, minimal memory usage but more redraws
-International Fonts
-5.1 Surround
-Linear
-Settings that should be keyframed together
-Factor Repulsion
-Overlap Flip
-The active face for this mesh
-Turn on SB diagnose console prints
-Dome
-Brazilian Portuguese (Português do Brasil)
-Make hairs stand up
-Uses the vertex normal to specify the dimension of the halo
-Key maps configured as part of this configuration
-Active Space
-4
-Theme Text Editor
-Method to display/shade objects in the 3D View
-Make this nurbs surface meet the endpoints in the V direction (Cyclic V must be disabled)
-Normalized Coordinates
-Glow
-Diffusion
-Enemy
-Co-ordinate system to cache vertices in
-Show state panel
-Show ghosts on keyframes
-Anti-Aliasing
-Zoom Axis
-Reactor Target Particle System
-First input for the effect strip
-Radians
-Free Nodes that are not used while compositing, to save memory
-Transform
-Free handle selected color
-Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled)
-Button 10
-Amplitude
-Show Active States
-Space Nla Editor
-Vertex group to control length
-In text window, paste with middle mouse button instead of panning
-Collection of object constraints
-Transparent RGB pixels are multiplied by the alpha channel
-Calculates environment map at each rendering
-Deform
-Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels
-Tweak Right
-44.1 kHz
-Include visualization of Texture related Animation data
-Set layer Visibility
-Deliver mist factor pass (0.0-1.0)
-Sort files by modification time
-Minimal # solver steps/frame
-Have recent edits been saved to disk
-Keying Set Paths to define settings that get keyframed together
-Pressure of tablet at point when drawing it
-Show background image while looking to the left
-Sharp
-Only include F-Curves with names containing search text
-Number of spaces to display tabs with
-Puff Volume
-Video bitrate(kb/s)
-Linear Stiffness
-Vertex Group Tangent
-Amount of dithering noise added to the rendered image to break up banding
-Absorption
-Find Wrap
-Enable hair dynamics using cloth simulation
-The type of the Sequencer view (sequencer, preview or both)
-Number Widget Colors
-File Extensions
-Theme Node Editor
-Object Duplicate
-Goal Maximum
-Size of element, use of components depends on element type
-Word Wrap
-Any
-More than one rendering engine is available
-Cached positions per frame
-Control key pressed
-Collection of armatures
-Gloss Anisotropy
-Tracking by taking the shortest path
-Spherical falloff
-Objects further than this are not visible to map
-Driver could not be evaluated in past, so should be skipped
-Insert Keyframes - Visual
-Rule Evaluation
-Negate the effect of the velocity vertex group
-The frame number to always use
-ca_AD
-Visibility
-Bone associated with this PoseBone
-Envelope Deform Distance
-Invoke Area
-Theme Info
-Current Keying Set index (negative for 'builtin' and positive for 'absolute')
-Black
-Lock editing of location in the interface
-Interface
-Auto Keying Enable
-Save luminance-chrominance-chrominance channels instead of RGB colors
-Left Ctrl
-Multiplier to adjust velocity passed to smoke
-Font size and resolution for display
-Extreme
-Show Controllers
-Render engine
-Render image to two fields per frame, for interlaced TV output
-To socket
-Activate TRUE level triggering (pulse mode)
-Temp. Diff.
-Expanded
-Target particle system
-Which part to snap onto the target
-local space unit length normal vector for this face
-Keying Set Name
-Python Console
-Show Hidden
-The region relative horizontal location of the mouse
-Nurb active V-lines
-Set position of selected color stop
-Fixed size UV coordinates array
-Reactor Target Object
-Node tree type to display and edit
-Display datablocks in current scene
-Color and Alpha
-Causes texture data to be duplicated with the object
-Item in a Key Map
-3D View region data
-Display face-assigned textures in solid view
-Disable simulation of linear motion along the Z axis
-Point of a curve used for a curve mapping
-Include visualization of Metaball related Animation data
-Structural Stiffness Maximum
-Factor Density
-Simple Deform
-The default color for textures that don't return RGB or when RGB to intensity is enabled
-Name of UV unwrapping layer
-Outputs
-Images
-Message
-Ray
-Theme Bone Color Set
-Redraw all overlapping regions, minimal memory usage but more redraws (for graphics drivers that do flipping)
-IK stiffness around the Y axis
-Edge spring stiffness when shorter than rest length
-Menu Backdrop Colors
-50%
-Heads
-Stereo Mode
-Soft body simulation settings for an object in the game engine
-Show Framerate and Profile
-Right Shift
-Direct conversion of frame numbers to seconds
-Log conversion reference whitepoint
-Radius
-Linear stiffness of the soft body links
-View3D Rotate Modal
-SMPTE
-Add
-Show framerate and profiling information while the game runs
-Degrees
-Gather Method
-Output
-Set audio sampling rate to 192000 samples per second
-End
-Include visualization of Material related Animation data
-Sets the layer as active for cloning
-Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing
-When bone doesn't have a parent, it receives cyclic offset effects
-Enable self collisions
-Property is registered as part of type registration
-Syntax Comment
-Draw Particles
-area
-Basis Matrix
-Active vertex color layer
-Image and UV editor space data
-Set metaball as negative one
-Collection
-JPEG Quality of proxies to build
-Zbuf
-Show the Z axis line in perspective view
-Tails
-Show Active Object
-Defines size of derivative offset used for calculating gradient and curl
-Color Set
-Integer
-Output image in bitmap format
-OpenAL
-Particle Systems
-Display the user preference datablocks
-Size of packed file in bytes
-Ukrainian (Український)
-Mono
-No proxy, full render
-Fullscreen
-Allow scaling of the bone for IK
-Creates viscosity for expanding fluid)
-J
-Blend mode for combining sun sky with world sky
-Global Undo
-Quicktime
-Draw frames rather than seconds
-Bake shading on the surface of selected objects to the active object
-Frame currently being displayed for this layer
-Never None
-alignment
-Bulgarian (Български)
-Light
-Maximal Spring length * Ball Size
-Emulates Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)
-Text datablocks
-Welding
-Heavy
-Quick Sketching
-Method used to determine color of F-Curve in Graph Editor
-Show UV Editor
-Cut hairs
-Expand
-Effect particles' location
-View Matrix
-Allow boids to climb goal objects
-Sequence
-Bone Name
-Seed of the noise
-Motion Path Cache Point
-Use modifier while in the edit mode
-Meshes
-For reactor systems, index of particle system on the target object
-Billboard
-Automatically set based on graphics card and driver
-Macro Operator
-DopeSheet Channel
-Render and combine multiple samples per pixel to prevent jagged edges
-Render Z-Transparent faces in this Layer (On top of Solid and Halos)
-Output image in uncompressed Targa format
-Paths
-Left Arrow
-Collection of spline bezirt points
-Layout
-Show Physics Visualization
-Number of bones in the subdivided stroke
-Vertex Group Clump Negate
-Negate the effect of the tangent vertex group
-Base type for IK solver parameters
-Active camera used in this view (when unlocked from the scene's active camera)
-Re-render and composite changed layer on 3D edits
-ISO 2
-Active Layer Index
-Esc
-Show Frame Number Indicator
-End Offset
-Use active Viewer Node output as backdrop for compositing nodes
-Blender command line animation playback - path to Blender 2.4
-Frequency
-Pivot around the median point of selected objects
-Blend vertex colors across face when vertices are shared
-Game engine logic brick to detect events
-Causes the image to repeat horizontally and vertically
-Bone location is set in local space
-User Preferences
-Show Operator
-Max Logic Steps
-Damping of the harmonic force
-Vertex of a simulated fluid mesh
-Graph Editor Generic
-18 - Theme Color Set
-Average Speed
-Console
-Total number points for the surface on the V direction
-Use the manipulator for scale transformations
-Disable
-5
-13 - Theme Color Set
-Vertex group to control field
-12
-Shared Location
-Transparent pixels are filled with sky color
-Atmosphere Turbidity
-Widget Style
-RNA function definition
-NLA Strip is not evaluated
-Recast Data
-4096
-Right Handle Selected
-Cyclic
-Color Ramp
-Self Collision Quality
-Index of active pose marker
-Vertex Group Density Negate
-Dome Mode
-Image and settings for display in the 3d View background
-Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist
-FPS
-Normals
-SIMD SVBVH
-Minimum distance between collision objects before collision response takes in
-Color balance gamma (midtones)
-Minimum distance for the field's fall-off
-Limit fluid objects to this group
-Load UI
-Factor Stiff Viscosity
-Draw preview using full resolution or different proxy resolutions
-Paint Lock
-Sets the number of samples used by the audio mixing buffer
-Source List
-Around Current Frame
-Scroll Handle
-Add light coming from the environment
-Color of the F-Curve in the Graph Editor
-Exclude indirect pass from combined
-Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC
-Bias
-Text Input
-Pitch
-2D
-Braid
-Modifier name
-Use extra textures like normal or specular maps for GLSL rendering
-Stamp Marker
-ZXY Euler
-Function does not pass its self as an argument (becomes a class method in python)
-Sun Intensity
-Fit
-AO Exclude
-Integer Property
-Tube
-ZYX Rotation Order. Prone to Gimbal Lock
-Default paths for external files
-Solid
-Lock the same rotation/scaling pivot in all 3D Views
-Groups of F-Curves
-Display the object solid, with face-assigned textures
-Quadratic
-ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only)
-Inaccurate, but faster and without noise
-Unique ID for this region
-Lock Y Axis
-Logic Nor
-Gaussian
-Euler
-Settings for filtering the channels shown in Animation Editors
-Invoke Region Channels
-Crop the rendered frame to the defined border size
-Limit Location
-Radius of the brush in pixels
-Automatically select also UVs sharing the same vertex as the ones being selected
-Title
-Histogram
-Display raw datablocks
-Bone deformation distance (for Envelope deform only)
-Forcefield based on the Lennard-Jones potential
-Action Group is locked
-XYZ Euler
-Outline Width
-Upper First
-Subdivide stroke in fixed number of bones
-Action Clip
-Use 16 bit floats instead of 32 bit floats per channel
-Stamp Camera
-Texture Nodes
-Falloff power (real gravitational falloff = 2)
-3D View near clipping distance
-Color Randomization
-Snap Peel Object
-Determine the amount of render threads used
-Amount
-F-Curve
-Zmask scene layers for solid faces
-Bone Group this pose channel belongs to (0=no group)
-Constraint's panel is expanded in UI
-Collection of Color Ramp Elements
-Grease Pencil
-Show controllers of active object
-Instead of per brush strength, the strength is shared across brushes
-Allow boids to move on land
-Negate the effect of the clump vertex group
-`
-Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis
-Highlight the current line
-Simplify Child Particles
-Lattice
-Timeline Markers
-Draw actual particles
-XYZ
-Collection of spaces
-Bake Mode
-Sub
-Enable Stereo environment
-F-Curve defining values of a period of time
-Rules are gone through top to bottom. Only the first rule that effect above fuzziness threshold is evaluated
-Constraint to stay within the image bounds while editing
-Only Selected Curve Keyframes
-Scroll Bar
-Theme settings for Font
-Allow Climbing
-Syntax Highlight
-ASCII
-Properties space data
-Lamp datablocks
-Pivot around bounding box center of selected object(s)
-Max Res
-Mouse Previous X Position
-Simplify the final stroke
-Frame is selected for editing in the DopeSheet
-OS Key
-Function is optionally registered as callback part of type registration
-Ease
-Renders halo as a star
-NLA Channels
-Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC)
-nl_NL
-Alt key pressed
-Limit movement around the Y axis
-Z Scale
-Actuator
-Motion Path for this element
-Slider Widget Colors
-Name of Vertex color layer
-Xnor
-Bone Group this pose channel belongs to
-Quad View Region
-Edge Split
-Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges
-Max Air Angular Velocity
-Use Bone Sketching
-Automatic keyframe insertion using active Keying Set only
-Colors
-Starting frame of range of paths to display/calculate (not for 'Around Current Frame' Onion-skinning method)
-Show script files
-Cloth simulation settings for self collision and collision with other objects
-Object to use as the environment map's viewpoint location
-The interpolation type for this curve element
-Vertically Open
-Show the expanded in the user interface
-Emit Object Location
-Toggle Widget Colors
-Rotation
-Current Transformation orientation
-Total number points for the curve or surface in the U direction
-Active Particle System Index
-Material Physics
-Pull
-List Item Colors
-Show a small rotating 3D axis in the bottom left corner of the 3D View
-Add-Ons
-Render face with texture
-Tilt Interpolation
-K
-Collection of particle systems
-Text editor space data
-Zoom
-Goal minimum, vertex weights are scaled to match this range
-When deforming bone, multiply effects of Vertex Group weights with Envelope influence
-F-Curve Sample
-Radius of eraser 'brush'
-Finnish (Suomi)
-Turbulent noise driven by the global current frame
-Raytraced reflection settings for a Material datablock
-Convert effector force into air flow velocity
-True when the Shift key is held
-Audio Sample Format
-Bold
-Vertex colors for a face in a Mesh
-Cursor
-Mouse/Trackpad Pan
-Display Paths of poses within specified range
-Info space data
-Duplicate Armature
-Settings for Bullet soft body simulation
-Name of the theme
-Collection of scene objects
-B-Bone Display Z Width
-Zoom using up/down on the device (otherwise forward/backward)
-Enter Edit Mode automatically after adding a new object
-Apply gravitation to point movement
-Info on current cache status
-Cone
-Lock Z Rotation Axis
-GLSL Extra Textures
-Starts player in a new fullscreen display
-Named Group
-Samplerate
-Children expanded in the user interface
-Border
-Armatures active bone
-Active Path Index
-Texture Type
-Amount of clumping
-Style
-Collection of render layers
-Show Restriction Columns
-Soft Body
-Drag effector weight
-Layers visible in this 3D View
-Top
-Quality of the simulation in steps per frame. (higher is better quality but slower)
-The constraint is applied in Pose Space, the object transformation is ignored
-View Rotation
-Gravitation
-Cardinal
-Dolly
-8 bit greyscale binary data
-Chroma Vectorscope
-Active bone group for this pose
-Repulsion Factor
-Object Constraints
-Filter Text
-Vertex group to control tangent
-Default builtin key configuration
-Show folders
-Page Down
-Elements
-View3D Zoom Modal
-Show Actuators
-Deletes smoke from simulation
-Filter File Extensions
-Control point selection status
-Left Handle Selected
-Draw Stretch
-Align rotation with the snapping target
-Cloth
-Show the name of the view's direction in each 3D View
-Display Filter
-Object does not restitute collisions, like a ghost
-Particle Velocity
-Relative time of key over hair length
-6
-Threshold for drawing outlines on geometry edges
-Lighting
-MPEG-4
-Delete
-MPEG-2
-Curve Edit
-Distance of the physics area
-Boid Settings
-Pixel resolution of the rendered environment map
-Goal maximum, vertex group weights are scaled to match this range
-Vertex Group Roughness 2 Negate
-Manipulator Rotate
-Limits
-Current Frame
-Project to Self
-Sticky texture coordinate location
-Transition
-Duplicate Texture
-Mask
-Description of the Function's purpose
-Generate voxels from a sequence of image slices
-Theme settings for the Node Editor
-Automatic time snapping settings for transformations
-Banking
-Texture Plugin Directory
-Mass
-Mist settings for a World data-block
-Show column
-Tool Widget Colors
-Clip Alpha
-Retarget
-Drag component proportional to velocity
-Blocking
-Mirror Colors
-Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)
-Bars Selected
-Use a minimum radial distance for the field's fall-off
-Edit Object
-Cineon
-Height
-Texture Factor
-Draw Wire
-Manipulate object centers only
-Custom color set to use
-Negate the effect of the density vertex group
-SL
-Enable Self Collision
-Correction
-Self Minimum Distance
-Keying set paths
-Invoke Region Preview
-Causes material data to be duplicated with the object
-Sample Distance
-Vertex Group Field
-Multiplier to make out-scattered light brighter or darker (non-physically correct)
-Object Selected
-Keyframe Selected
-Pose Bone
-Set sensor expanded in the user interface
-Theme Audio Window
-Strip Time
-Number of frames from start frame for influence to fade out
-Codec
-Speaker
-Image Generic
-3D Region
-Copy Scale
-Duplicate Surface
-Particle key for hair particle system
-Particle Edit
-Number of cone samples averaged for blurry refractions
-Keep from going through other boids
-Output image in DDS format
-Orig Height
-In Air
-Constraint was added in this proxy instance (i.e. did not belong to source Armature)
-OpenGL shading language shaders
-Render the stamp info text in the rendered image
-read only area of the face
-Exec Region Channels
-Smoke collides with every side
-Enable Collision
-The mouse button used for selection
-How strong a force must be to start effecting a boid on land
-Imperial
-Vertex Group Length
-SDL device - simple direct media layer, recommended for sequencer usage
-Pixel Aspect Y
-Shadow
-Show the active object's softbody point cache
-ZIP (lossless)
-Collection of Compositor Nodes
-Viewport Shading
-Mean red/green/blue scattering path length
-Ball inflating pressure
-Snap to nearest marker
-Vertical aspect ratio - for anamorphic or non-square pixel output
-Window Sliders
-Color ramp mapping a scalar value to a color
-Make hairs less puffy
-Active UV texture index
-Location of head end of the bone relative to its parent
-Display Texture
-Group Node
-Collection of meshes
-Continue
-Grease Pencil Smooth Stroke
-Set audio mixing buffer size to 4096 samples
-Transparent RGB and alpha pixels are unmodified
-Nearest Neighbor
-Gives a constant force along the force objects local Z axis
-Emit
-Bake the normals in tangent space
-Active Base
-Active UV texture
-Falloff Curve
-Sun intensity
-Collection of related sketches on a particular frame
-Vector Fonts
-Mesh Edit
-String Property
-Variables
-3D View Space
-Show the active object's particle point cache
-Cinema 24fps 2048x1080
-The default directory for rendering output, for new scenes
-Audio bitrate(kb/s)
-Font Size
-File
-Automatically converts all new tabs into spaces for new and loaded text files
-Search again from the start of the file when reaching the end
-Driver variable type
-Search term for filtering in the UI
-Show UV editing related properties
-Subdivision Surface
-Mipmaps
-Simplified Chinese (简体中文)
-Edge Length Text
-View2D
-Step Size
-All effector's weight
-GOP Size
-Bottom
-Color balance lift (shadows)
-True when this value can't be set to None
-The color of the lights specular highlight
-Free Run (Rec Date)
-How much the spring rest length can change after the elastic limit is crossed
-Nand
-Background Images
-Vertex Group Roughness 1 Negate
-Follow a boid or assigned object
-Collection of Shader Nodes
-Show Brush
-Save Preview Images
-Use Influence
-Add/Replace
-Enable direct editing of modifier control cage
-Overwrite characters when typing rather than inserting them
-Multitexture
-Full
-Modifier affecting the geometry data of an object
-Text to replace selected text with using the replace tool
-Particle Age
-Unique name used in the code and scripting
-Movie Strip
-Python Scripts Directory
-Global user preferences
-Proportional Size
-Location of the hair key in object space
-Window Manager
-Selectable
-Diffuse subsurface scattering settings for a Material datablock
-Air Personal Space
-Which axis to use for offset
-Sound
-Include Animation Data blocks with no NLA data. (NLA Editor only)
-Tree Type
-The index of particle system on the target object
-Noise algorithm - Voronoi F1-F2
-Autosplit Output
-Type of transition used to fade mist
-Logic Nand
-Enable this OpenGL light in solid draw mode
-Explode
-Tilt CW
-ID-Block
-Diffusion factor, the strength of the blurring effect
-Rate control: min rate(kb/s)
-Alter spring length to shrink/blow up (unit %) 0 to disable
-Object is made a particle system to display particles generated by a fluidsim domain object
-Alternate script path, matching the default layout with subdirs: startup, addons & modules (requires restart)
-channels
-Head Select
-Nearest Frame
-WPaint Auto-Normalize
-View3D Gesture Circle
-Active index in render layer array
-True when the Cmd key is held
-When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used
-Poly
-Name of the key map
-Roll bones to face the view
-Cycle the animated time within the action start & end
-Metaball Edit
-Use anti-aliasing for the 3D view (may impact redraw performance)
-Key Configuration
-NLA editor space data
-Sounds
-Noise formula used for turbulence
-Show Thumbnails
-Output video in AVI Raw format
-Shape Keys
-Cloth simulation settings for an object
-Transparency along the width of the strand
-Name of UV layer to override
-Custom animation player executable path
-Spring Vertex Group
-Luma Waveform
-Goal Damping
-French (Française)
-tool_settings
-3D Cursor
-Collection of lattices
-Display
-Center of mass
-The type of radius interpolation for Bezier curves
-Global approximate AA and SSS quality factor
-Type of data to take texture from
-Build
-Logic Xor
-Backdrop zoom factor
-Collection of worlds
-Python addons to be loaded automatically
-Proxy size 50%
-Intensity of the mist effect
-UV Editor
-Opacity
-JPEG 2000
-ID Type
-Wires
-Texture Face
-The default directory to search for sequence plugins
-Physics settings for a Material datablock
-Size of the turbulence
-Plastic
-Viscoelastic Springs
-Keyframe Insert Needed
-Threads Mode
-Exclude environment pass from combined
-Display an additional 'summary' line. (DopeSheet Editors only)
-Blend factor with sky
-BMP
-Obstacle simulation
-Relative friction coefficient in the in the X, Y and Z directions, when anisotropic friction is enabled
-7
-Enable naive vertex ball self collision
-Text Character Format
-Particle System
-Active section of the user preferences shown in the user interface
-Outliner
-Don't use any brush
-Pulldown Widget Colors
-Duplicate Lamp
-Spring rest length (factor of particle radius)
-Softens the edges of halos at intersections with other geometry
-None
-ko_KR
-Only Matching F-Curves
-Active Particle Target
-TIFF
-Keyboard
-Strand settings for a Material datablock
-"
-Material Index
-Targa Raw
-Name that will be used in exported files when format supports such feature
-F-Curve is not evaluated
-Texture Collection Rate
-Blend
-Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy
-rect
-08 - Theme Color Set
-Sharp falloff
-Proxy Local
-Repulsion Distance
-Method used for combining strip's result with accumulated result
-Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity
-Syntax Numbers
-Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)
-Global Space
-Save the z-depth per pixel (32 bit unsigned int z-buffer)
-Curving of the noodle
-View Type
-Children Expanded
-Shape
-Background Image
-Dash
-Pass
-Snap to Pixels
-Engine
-Vertex Select
-Specular Exclude
-Color 2
-Brush strength
-Control point weight values
-Maximum memory usage in megabytes (0 means unlimited)
-Pivot around each object's own origin
-Island
-Softbody goal weight
-Exclude shadow pass from combined
-Method for driving added turbulent noise
-Sampled colors along line
-Offsets the number of the frame to use in the animation
-Maximum angular velocity on land (relative to 180 degrees)
-Start Frame
-Middle Mouse Paste
-Edge Seam
-Display UV coordinates from 0.0 to 1.0 rather than in pixels
-Find Text
-Inverse Gamma
-Smooth hairs
-Graphics driver and operating system settings
-How much density effects smoke motion, higher value results in faster rising smoke
-passes
-Boid rule name
-Maximum number of recently opened files to remember
-Path to property setting
-Level of detail in the added turbulent noise
-Screen
-Billboard Normal UV
-Selects the type of physical representation
-Clip End
-Creates a force along a curve object
-Time delay in 1/10 seconds before automatically opening top level menus
-Autosplit output at 2GB boundary
-Resolution Y
-Artificial buoyancy force in negative gravity direction based on pressure differences inside the fluid
-Gamma
-Light Cache
-Offset
-Voronoi F2-F1
-Hair keys are in global coordinate space
-Structs
-Particle system name
-Don't adjust roll
-Bevel
-UI Layout
-Movie Format
-Fast but not so effective compression
-Use linear workflow - gamma corrected imaging pipeline
-Delta
-Gravity
-Mist uses linear progression
-BSpline
-Type of element to snap to
-Set audio mixing buffer size to 32768 samples
-Show the Y axis line in perspective view
-Action End Frame
-Settings for input devices
-Joystick
-Window manager datablocks
-Left Handle Type
-Points U
-bl_description
-Collection of mesh edges
-Clip objects based on what's visible in other side views
-Object Grouped
-Backscattered Light
-Active grease pencil layer
-Animated Influence
-Atmosphere Inscatter
-Color of emitted light
-Lock Location
-Active Vertex Color Layer
-Spaces
-Properties of particle editing mode
-Area height
-Material nodes
-Collection of armature bones
-Resolution U
-Click
-Filter Files
-Display general information
-Bone Groups
-Overlay
-Muted
-Movie
-Auto Clamped
-Individual Origins
-Overlap
-Custom
-Particles
-Use Max
-Window
-File browser space data
-AVI JPEG
-Friction Coefficients
-Object base selection state
-Bone Pose
-Sequence strip in the sequence editor
-Display Background Images
-Name to use in scripted expressions/functions. (No spaces or dots are allowed. Also, must not start with a symbol or digit)
-User defined layer of floating pointer number values
-96 kHz
-Occlude
-Images are rendered in Image Editor
-States
-Saturation
-Location of this character in the text data (only for text curves)
-Users
-Scene Objects
-Goal Stiffness
-Audio Codec
-Collection of objects
-Type of NLA Strip
-Minimum distance to the camera for stars
-Main Scenes
-Clips to image size and sets exterior pixels as transparent
-Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe
-Radius from the shaded sample to look for points within
-Layer of texture faces in a Mesh datablock
-Tangent
-Stamp Time
-Comb hairs
-24-bit Signed
-Show Handles
-Alpha
-Difference
-The frequency of the offset (1/total length)
-Layer Membership
-Render layer
-ro_RO
-Vector Coordinates
-Spring force
-Flare Boost
-Scopes
-Description of the item's purpose
-Camera Parent Lock
-Invert the axis of mouse movement for zooming
-Socket name
-M
-Enable diffuse subsurface scatting effects in a material
-Color Factor
-Noise algorithm - Cell Noise: Square cell tessallation
-For PoseBone paths, use the bone head location when calculating this path
-Max Land Speed
-Show linked objects to sensor/actuator
-Edit drivers
-F-Curve Modifier is the one being edited
-Channel Matrix
-Has Ghost Curves
-Threshold for adaptive sampling (if a sample contributes less than this amount [as a percentage], sampling is stopped)
-Selects which domain border will be treated as collision object
-Object that defines custom draw type for this bone
-Still Frame Only
-Invert tilt axis
-The name of the active key configuration
-Apply sun effect on atmosphere
-Spacebar
-Limit effectors to this group
-Keep paths from intersecting the emitter
-Input or output socket of a node
-Transform Channel
-Storage of a macro operator being executed, or registered after execution
-Sets the number of points on the star shaped halo
-Display the object's local bounding boxes only
-Goal (vertex target position) spring stiffness
-Boolean
-Cyclic U
-Cinema 24fps 4096x2160
-Images are saved with RGB and Alpha data (if supported)
-Cyclic V
-Indirect
-Show Points
-Speed
-Copy Location
-GLSL Lights
-resolution_x
-All available keying sets
-Specular Color
-Convert to logarithmic color space
-Show keyframes for active Object and/or its selected bones only
-Use Visual keying automatically for constrained objects
-Game Property
-Merged Region Size
-Material Halo
-Flare Seed
-No Gimbal Lock (default)
-Bending Const
-Null device - there will be no audio output
-Main Fonts
-Sensor
-Output image in Cineon format
-Set audio sample format to 64 bit float
-Whether to use maximum clipping value
-Display units in pairs
-Form factor scales the inertia tensor
-Filter Images
-Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard
-Draw UV edges anti-aliased
-Search string is sensitive to uppercase and lowercase letters
-Region Text Titles
-Flow Settings
-Texture Slot
-Enable debug visualization for obstacle simulation
-Wrinkle coefficient. (higher = less smaller but more big wrinkles)
-Action to take for gaps past the Active Action's range (when evaluating with NLA)
-Spring rest length is a factor of 2 * particle size
-Mist uses quadratic progression
-Base
-Enter Edit Mode
-Widget Label Style
-For Zmask, only render what is behind solid z values instead of in front
-Face Angle Text
-8
-Face Dot Size
-Grow
-Strips
-Vertex group to control roughness end
-Texture Slots
-Snap UVs to pixel locations while editing
-Border Minimum X
-Value
-Button5 Mouse
-Roll CCW
-Deprecation Warnings
-Source List Title
-Collection of fonts
-Effector weights for physics simulation
-2
-Input line for the interactive console
-;
-Soft body
-Display Lamp
-Tail Select
-Rotation in Quaternions
-Main MetaBall
-Right Alt
-Waveform Mode
-Audio samplerate(samples/s)
-Random
-Harmonic
-hr_HR
-Themes
-Texture scatting blend factor
-Selected File
-Cache AO results in pixels and interpolate over neighbouring pixels for speedup
-double
-Negate
-Mute this shape key
-Fgon
-RVO (rays)
-External file packed into the .blend file
-Causes text data to be duplicated with the object
-Include visualization of Speaker related Animation data
-Zoom factor
-Tweak Select
-Shape Match
-Spherical forcefield based on the charge of particles, only influences other charge force fields
-Active Boid Rule
-Active index in bone groups array
-IK stiffness around the X axis
-Go to assigned object or loudest assigned signal source
-Wait Timer (ms)
-The region relative vertical location of the mouse
-Mouse/Trackpad Rotate
-02 - Theme Color Set
-Show Control Curves
-Time taken in frames between shutter open and close
-Textured Solid
-Tail
-Lift Force
-The type of event, only applies to some
-Targets
-Main Texts
-Draw Axes
-Space data type
-Subsurface Scattering
-Mesh Vertex
-Max Slope
-Specular Intensity
-Smoke collision settings
-Cubic
-Set all state bits
-Action to take for gaps past the strip extents
-Neutral
-UV mapping, texturing and game engine data for a face
-Minimum value for clipping
-zh_CN
-Wheel Scroll Lines
-Shadow color in grey value
-The constraint is applied relative to the world coordinate system
-Icon File
-Theme Console
-Step Calculation
-Amount the strip contributes to the current result
-Shape Key Bezier Point
-Smoke doesn't collide with top and bottom sides
-Fastest and gives the most noise
-Source of input values for driver variables
-Show Keyframe Numbers
-Image opacity to blend the image against the background color
-Outline
-window_manager
-DDS
-Show key map event and property details in the user interface
-Bake ambient occlusion
-Long List
-Manual
-Kink
-Display Metaball
-View Location
-Radio Widget Colors
-Weights
-Cache of the worldspace positions of an element over a frame range
-Theme settings for the Text Editor
-Number of frames for Blending In/Out is automatically determined from overlapping strips
-Collection of Driver F-Curves
-Use SIMD QBVH
-UV/Image Editor
-Use degrees for measuring rotation
-Resolution of the voxel grid
-Physics Gravity
-bl_idname
-Name of the key configuration
-Agent Radius
-Keyed particles target is valid
-Use force fields when growing hair
-Point in the lattice grid
-The amplitude of the offset
-End Frame
-Lets halo receive light and shadows from external objects
-Pivot
-Maximum walkable slope angle in degrees
-Permeability
-User defined floating point number value in a float properties layer
-Render Result
-Objects nearer than this are not visible to map
-Pivot around active object
-Operator Node
-Local With Parent
-Blender RNA structure definitions
-Radius of bounding sphere and material physics
-Bezier
-Blend Type
-Original Perlin
-Active UV Texture
-Active Object constraint
-Armature-Relative Head
-F-Curve's settings cannot be edited
-7.1 Surround
-Fluid Mesh Vertex
-Long Key
-Do not show any ghosts
-Frame for absolute keys
-Wav
-Preview
-[
-ObData
-Emulate Numpad
-Theme settings for the Timeline
-Cell Size
-Clamp velocity to this minimum speed (except when totally still)
-Specify old mapping value in frames
-Type of texture data to display and edit
-Show ghosts for the specified frame range
-Radius for bevelling
-Maximal # solver steps/frame
-Copy Rotation
-07 - Theme Color Set
-Use object/global coordinates for texture
-If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label)
-Sequence Element
-Use rule when boid is flying
-Simplify Shadow Samples
-Deliver indirect lighting pass
-Particle Key
-Time since last step in seconds
-Properties
-Y Scale
-Minimum Radial Distance
-Sampled Points
-Theme Logic Editor
-Use Stars
-Manipulator Translate
-Brush steps
-Active Pose Marker
-F-Modifier
-N
-True when the Alt/Option key is held
-Decimate
-Use multi-sampled 3D scene motion blur
-Type of active data to display and edit
-Permanent deform
-Onion Skinning Settings
-Mode of automatic keyframe insertion for Objects and Bones
-Theme settings for bone color sets
-Scopes for statistical view of an image
-Push
-Show Seconds
-Logic Or
-Buffer Resolution
-Create a toon outline around the edges of geometry
-Regions
-Damped Track
-Active Bone Group Index
-Automatically select acceleration structure
-Specify a collision bounds type other than the default
-Auto-Clamped handle color
-Vertex Group Roughness End
-Sets the maximum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics
-Control Point
-Particle count
-Turntable
-Use Weight Color Range
-Octree
-Environment Exclude
-Fuzziness while on collision, high values make collision handling faster but less stable
-Tweak
-Marker
-Shadeless
-Align handle color
-Mist
-Scene Render Layer
-Sequence editing data for a Scene datablock
-Structural Stiffness Vertex Group
-Meta Stack
-Duplicate F-Curve
-Show sound files
-Render layer name
-Index of active particle system slot
-Roll bone to original joint plane offset
-Filter Fonts
-Material Subsurface Scattering
-Tip
-Invalid
-Show Cache
-Delay
-Blend factor for SSS colors
-Fluid Group
-Causes F-curve data to be duplicated with the object
-Stationary object
-el_GR
-Compression method to be used
-Speaker datablocks
-B-Bone Ease In
-Relative Paths
-Mesh Int Property Layer
-Enable smoke to disappear over time
-Double Click Timeout
-Cell Noise
-Particle system has multiple point caches
-Human readable name
-The object that has the target particle system (empty if same object)
-Maximum acceleration on land (relative to maximum speed)
-Legacy
-Clip alpha below this threshold in the 3D textured view
-Display a preset button with the operators settings
-Force gets absorbed by collision objects
-9
-Noise method which is used for creating the high resolution
-Manipulator
-Select UVs that are at the same location and share a mesh vertex
-Shadow offset in pixels
-Bake directly from multires object
-Insert
-Wind effector weight
-DopeSheet Editor
-Entire Array
-Use smoke heat as texture data. Values from -2.0 to 2.0 are used
-Sequence Color Balance
-Disallow movement around the X axis
-Scenes
-Active KeyConfig
-Distance between two bones or objects
-Rate control: max rate(kb/s)
-Active file in the file browser
-Limit collisions to this group
-Nurbs weight
-Outline Selected
-Extrapolate the curve or extend it horizontally
-Right Handle
-Collection of mesh vertices
-Smooth the final stroke
-Current Transform Orientation
-F-Curve live filtering string
-Softness of the 'soft' falloff option
-Selection Mode
-Proportional Editing
-Collection of keying set paths
-Build 25% proxy resolution
-DBVT culling
-Armature Edit
-Show Datablock Filters
-A valid edit mode exists
-World Mist
-Default Value
-Full Screen
-Text in the line
-Quality
-A container referencing an existing Action
-Layer name
-Auto Start
-Visualization
-Show text files
-Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)
-Snap Align Rotation
-Angle of Rotation for Axis-Angle rotation representation
-192 kHz
-From socket
-Nurb active U-lines
-Constraints that act on this PoseChannel
-Cyclic Strip Time
-Space Outliner
-Constraint has valid settings and can be evaluated
-Debug
-Pose Bones
-Show image files
-Goal maximum, vertex weights are scaled to match this range
-Puff
-Right Handle Type
-Include the name of the active cameras lens in image metadata
-Sky Color Space
-Include visualization of Armature related Animation data
-Character Index
-Pin (vertex target position) spring stiffness
-Open source frame player: http://djv.sourceforge.net
-Grab Pointer
-Bone is not able to be transformed when in Edit Mode
-Show linked objects to the controller
-Blend Distance
-Edited
-The mode used to apply the texture
-Locked Track
-File Browser
-Vertex weight group, to blend with basis shape
-The type of keyframe (for visual purposes only
-Obstacle Radius
-Drawing method used by the window manager
-Active Particle Target Index
-Front
-Enable starfield generation
-Particle datablocks
-Show an outline highlight around selected objects in non-wireframe views
-Zooms in and out based on vertical mouse movement
-Calculate sub-surface scattering in materials rendering
-Parent this node is attached to
-ar_EG
-Include the render frame as HH:MM:SS.FF in image metadata
-Line of text in a Text datablock
-Detail mesh sample spacing
-Active Theme Area
-Theme Widget Color Set
-Boid height relative to particle size
-Using 1/x
-Scene keying sets
-Show Sliders
-All Z
-Environment Color
-Position
-Buffersize
-Adapt To Speed
-Or
-World datablocks
-Effect Strip
-Group of ID properties
-Proxy size 75%
-Vertex Paint
-Hair Dynamics
-Stroke Points
-NLA Track is locked
-Which mesh elements selection works on
-Weight of rotation constraint for IK
-Always refresh image on frame changes
-Use horizon and zenith color for diffuse energy
-Extra margin around object for collision detection, small amount required for stability
-Collection of vertex groups
-Coordinates of the first handle
-Sky Blend Mode
-Mesh Edge
-Adjust simulation speed
-Bounding box of this object represents the computational domain of the fluid simulation
-Color balance gain (highlights)
-Normal Space
-Layers
-Spin CW
-Mesh Float Property Layer
-Buffer Resolution - decrease it to increase speed
-12 bit color channels
-Space Graph Editor
-Directory Path
-False when this property is an optional argument in an RNA function
-Framing Types
-Display Paths of poses within a fixed number of frames around the current frame
-Last selected point
-Cropping parameters for a sequence strip
-Min Air Speed
-Wavelet
-Color used for the surface of bones
-Window Managers
-Occlude objects with the environment color as they are further away
-Attenuation falloff strength, the higher, the less influence distant objects have
-Driven Selected
-Surface Edit
-Causes metaball data to be duplicated with the object
-Main Curves
-Japanese (日本語)
-Vertex Group Field Negate
-Collection of uv textures
-Enable simplification of scene for quicker preview renders
-String
-Randomized
-Retarget template bone chain to stroke
-Use the manipulator for movement transformations
-Command line prompt language
-How the rules in the list are evaluated
-Color of texture overlay
-Text Box
-Modifier for values of F-Curve
-Specify the number of cluster iterations
-Mass of the object
-React to force field physics settings in materials
-The window relative vertical location of the mouse
-YCbCr (ITU 709)
-Linear viscosity
-8x
-Nothing
-IK Z Limit
-Sensors
-Child Seed
-Tweak Middle
-Object represents a volume of fluid in the simulation
-Property is editable through RNA
-Theme settings for the Console
-Datablock from which the edited datablock is linked
-Particle
-Solo
-Mark controller for execution before all non-marked controllers (good for startup scripts)
-FFMpeg audio codec to use
-ZTransp
-Location (Object Space)
-IK Z Lock
-Display size for normals in the 3D view
-Use a tent filter for anti-aliasing
-Original IK solver
-Use velocities for automagic step sizes
-Multiplier
-Constraint Target
-Draw Repeated
-For RGB curves, the color that white is mapped to
-Noise algorithm - Voronoi F1: Returns distance to the closest feature point
-IK Y Minimum
-Pin Stiffness
-Cache Info
-No Ghosts
-Duplicate Material
-Nurbs order in the V direction (For surfaces only), Higher values let points influence a greater area
-Spanish (Español)
-Sets the dimension of the halo
-Vertex in a Mesh datablock
-Line Numbers Background
-Shadow Size
-Depth
-Rest Density
-Frame Server
-alert
-Meta Element
-Show actuators of all selected objects
-Calculate environment maps while rendering
-Motion Path Settings
-Interlaced
-Space type
-Display the operator log
-Show background image in front view
-Simple
-Storage of a sub operator in a macro after it has been added
-Collision Bounds
-Maximum value for clipping
-Transparency
-Armature-Relative Tail
-Display in the info window and support the redo toolbar panel
-FFMpeg codec to use
-Show frame numbers on Motion Paths
-Maximum allowed number of light inter-refractions
-Use a third buffer for minimal redraws at the cost of more memory
-Game engine logic brick to process events, connecting sensors to actuators
-Layer in multilayer image
-Depth Cutoff
-Mesh Edges
-Max Edge Length
-The number of lines scrolled at a time with the mouse wheel
-Root Texture Coordinates
-Tag Seam
-Visibility status
-Birth Time
-Mini Axis Brightness
-Environment
-Accuracy
-Driven
-Air Damping
-Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering
-Normal
-Keys
-The axis icon's size
-Spring Force
-Brushes
-Drag
-Emulate 3 Button Mouse
-Sculpt/Paint Overlay Color
-Collection of keymap items
-Shadow Y Offset
-Fuzzy
-Comb
-Theme settings for the 3D View
-End frame of the stored range
-Grid Subdivisions
-Layers bone exists in
-Base type for datablocks, defining a unique name, linking from other libraries and garbage collection
-Numpad 5
-face area
-Clip Start
-Numpad 2
-Tweak Action
-Numpad 0
-Use this files path when library linked into another file
-GL Texture Limit
-Only keyframes of selected F-Curves are visible and editable
-Numpad 9
-Crease
-Filter
-Minimum angles for IK Limit
-Scatter contribution factor
-Bones which are children of this bone
-Main Particle Settings
-Collection of particle settings
-Use modifier during rendering
-Numpad /
-Numpad .
-05 - Theme Color Set
-Read Only
-Include visualization of Particle related Animation data
-Numpad *
-Bone is not visible when in Edit Mode
-Width Fade
-Amount of rotation around velocity vector on turns
-Czech (Český)
-Display datablocks in all scenes
-Turbulent noise driven by the particle's age between birth and death
-Aerodynamics Type
-Best quality
-Use effector/global coordinates for turbulence
-Target particle systems
-Min Rate
-Distance to keep particles away from the emitter
-Type of information to display
-Limit movement around the Z axis
-NLA stack is evaluated when evaluating this block
-Apply puff to unselected end-points, (helps maintain hair volume when puffing root)
-Fgon edge
-Perspective
-Bone rotation around head-tail axis
-Pan/Zoom
-Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking
-No Auto-Snap
-Active Texture Face
-Node Backdrop
-Count
-Amount of influence F-Curve Modifier will have when not fading in/out
-Collection of points that make up this poly or nurbs spline
-Enable All Codecs
-Auto Blend In/Out
-Show Python Tooltips
-Show menus in the header
-Action datablocks
-Edit texture nodes from World
-Cross
-Particle target name
-Frame Map Old
-Collection of channel driver Variables
-Lower First
-Stamp Render Time
-Groups of the bones
-Vertex Group Velocity
-Cine-Flat 48fps 1998x1080
-Snap
-Extreme Alpha
-2x
-Group datablocks
-Overall sensitivity of the 3D Mouse
-Images are rendered in full Screen
-Activity culling is enabled
-2D cursor location for this view
-Metaball types
-F
-Show Linked to Actuator
-Square (HS + V)
-Node Groups
-Name Property
-Dither Intensity
-Reconstruction filter used for combining anti-aliasing samples
-Minimal
-Active Face
-Scripts
-Scale factor along the X for items in this (sub)layout
-Image Axis
-Orig Width
-Pose Head Position
-Cursor Y-Value
-Property is optionally registered as part of type registration
-IK stiffness around the Z axis
-NLA Tracks
-Constrain to Image Bounds
-Arrangement of the panels
-Length of second Bezier Handle (for B-Bones only)
-Median
-Indirect Exclude
-AO
-Node in a node tree
-Cast
-Save cache files to disk (.blend file must be saved first)
-Simplify AO and SSS
-Use key times
-de_DE
-Property has been dynamically created at runtime
-Ball Size
-Display sequence datablocks
-Read-only matrix calculated from the roll (armature space)
-Noise algorithm - Improved Perlin: Smooth interpolated noise
-Automatically start game at load time
-Generate point density from a particle system
-How much of effector force gets lost during collision with this object (in percent)
-Deliver AO pass
-Group that included Object should be a member of
-Cell Height
-Shear Stiffness
-Material Volume
-Maximum number of lines to store for the console buffer
-Include visualization of Mesh related Animation data
-Object Non-modal
-Maximum acceleration in air (relative to maximum speed)
-Pin ID
-Radar
-Render color of textured face as color
-Parts Y
-Parts X
-Collection of F-Curve Modifiers
-Verts Per Poly
-Lock to Cursor
-Theme Image Editor
-Graph Editor 2D-Value cursor - Y-Value component
-Automatically merge vertices moved to the same location
-Stencil
-Lock strip so that it can't be transformed
-Vertex Group Rotation
-Djv
-Use a quadratic filter for anti-aliasing
-Calculates environment map only once
-Node Links
-The number of subdivisions between grid lines
-Filter Folder
-use images in the order as they are recorded
-Collection of libraries
-Use selection as the pivot point
-Auto Snap
-The original matrix of this object before it was duplicated
-The unit system to use for button display
-Limit selection to visible (clipped with depth buffer)
-Type of field
-float_array
-Root falloff
-The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)
-Dodge
-Active Vertex Group Index
-Method used for determining what ghosts get drawn
-Proportional Editing Objects
-Parent
-Particle dupliobject name
-Theme Widget State Color
-Tilt CCW
-Mirror Intensity
-Object
-Include visualization of Lamp related Animation data
-Object Location
-select_end
-FrameCycler
-Joint
-Backdrop X
-Backdrop Y
-Use Instances
-Y Rotation
-Nor
-Addon
-Anti-Aliasing Samples
-frames_skipped
-Stamp Lens
-Make hairs more puffy
-Offsets image horizontally from the view center
-Negate the effect of the roughness 2 vertex group
-Invoke Screen
-A square showing Hue/Saturation, with Value slider
-NLA Track
-Outer Thickness
-Format of Time Codes displayed when not displaying timing in terms of frames
-Display Node
-Boid will fight this times stronger enemy
-Custom Color
-P
-Negate the effect of the rotation vertex group
-Select Tail
-Settings for boid physics
-Options for this operator type
-Mouse Y Position
-Input properties of an Operator
-Fixed
-Current windowmanager and data context
-Collection of actions
-Tab Width
-Theme 3D View
-Render
-Auto Keyframe Insert Available
-Grid Scale
-Number of undo steps available (smaller values conserve memory)
-Show background image in bottom view
-Theme Graph Editor
-Surface
-Flash
-Collision
-Grid Lines
-Pre Roll
-Strand
-The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added
-Disables non-planer quads being triangulated
-Particle Brush
-Smoke doesn't collide with any border
-Ghost frames on either side of frame
-Frame
-Select
-ID-Block representing source data, currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil)
-Index
-Functions
-03 - Theme Color Set
-Built-In Function
-Display objects name and frame number in 3D view
-Custom text to appear in the stamp note
-Cameras
-Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point
-Estimated scale matrix
-Overall stiffness of structure
-State
-Camera
-Distance between key frames
-Image Painting
-Object is made a fluid control mesh, which influences the fluid
-Draw image with RGB colors
-Build 100% proxy resolution
-Space Type
-Transformation
-Method of calculating the steps through the volume
-Material slot name
-Number of frames between cached frames
-Repulsion is a factor of stiffness
-Edge spring friction
-Face Area Text
-Frame Map New
-Media Play/Pause
-Mux Rate
-Show background image in all views
-Slider Max
-Every Point
-Stub RNA type used for pointers to unknown or internal data
-Number of indirect diffuse light bounces
-Clip Min X
-Clip Min Y
-Link
-Record animation to fcurves
-Object removes fluid from the simulation
-The number of times this object is repeated with respect to other objects
-Line
-Method used to define which Group-name to use
-Use Material Force Field
-Multi constraint, stateful IK solver
-Texture nodes
-Locked
-Filebrowser Parameter
-Path to an image editor
-Weights for the vertex groups this point is member of
-Insert keyframes based on 'visual transforms'
-Armatures
-Nabla
-Mesh String Property
-Collection of action groups
-Keep path lengths constant
-The type of tilt interpolation for 3D, Bezier curves
-Creates a force that dampens motion
-Disable simulation of linear motion along the Y axis
-Green
-Layer is selected for editing in the DopeSheet
-Voronoi F2
-Voronoi F3
-Active F-Curve Modifier
-Cycles
-Margin
-Voronoi F4
-Theme settings for the Image Editor
-Face Dot Selected
-Damping of cloth velocity. (higher = more smooth, less jiggling)
-GLSL Color Management
-Prompt
-Length of first Bezier Handle (for B-Bones only)
-Theme settings for style sets
-Ctrl
-Show intermediate values for the driver calculations to allow debugging of drivers
-Apply this and all preceding deformation modifiers on splines' points rather than on filled curve/surface
-Vertex indices
-Lens angle (mm) in perspective view
-Back
-German (Deutsch)
-Color of light scattered out of the volume (does not affect transmission)
-Build free run time code index
-Extrapolation
-Theme settings for Info
-Collection of metaball elements
-Use face normal to rotate object, so that it points away from the surface
-Lens
-Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction
-Particle Dupliobject Weight
-Use textures for drawing international fonts
-Use light for face
-The edge flag to tag when selecting the shortest path
-Vinterlace
-Cycle the images in the movie
-Display Z Axis
-Reflectivity
-Window Draw Method
-Set audio sampling rate to 44100 samples per second
-Causes particle systems to be duplicated with the object
-Scripts Window
-The space where the panel is going to be used in
-SMPTE (Compact)
-Automatically merge nearby keyframes
-Fast in high-contrast areas
-YCC
-Deliver object index pass
-Bake shadows
-Continuous Grab
-Alive State
-Input
-Adaptive
-Single texture face materials
-Color Ramp Element
-Hue
-Error tolerance (low values are slower and higher quality)
-Transforms include effects of constraints but not parenting/restpose
-Collision Settings
-Collection of cameras
-Command line prompt
-Cache file path
-Object Space
-Driver
-End size of strands in pixels or Blender units
-Weighted result of strip is added to the accumulated results
-NLA Track is selected
-Quaternion
-DOC BROKEN
-19 - Theme Color Set
-Debug State
-Active Keying Set used to insert/delete keyframes
-Lock Rotations (4D)
-Sets the audio output device
-Channels to display when drawing the histogram
-Displays bit depth of full screen display
-Sky Blend
-Reflection
-Vertex group to control roughness 1
-Bake Emit values (glow)
-Language use for translation
-Atmosphere Distance Factor
-Emit Object Space
-Motion Path Points
-IK Solver
-F-Curves
-Semantic interpretation of the property
-Partial overlay on top of the sequencer
-Unborn
-Effect in full or only positive/negative Z direction
-Format of the source data set to render
-Space UV Editor
-Solid Lights
-F1
-F2
-F3
-F4
-F5
-F6
-F7
-Fonts Directory
-Single ASCII character for this event
-Invert x Axis
-Allow boids to move in air
-Zoom Style
-Library
-Sky related settings for a sun lamp
-Inherit Rotation
-Disable Stereo and Dome environments
-KeyConfigs
-IK Stretch
-Voronoi F1
-Rigid Body
-operator_context
-Rotation Units
-Defines the structure of the menu in the UI
-idp_array
-XYZ velocity mapped to RGB colors
-Editmode
-Particle Location
-Tabs as Spaces
-Region Background
-Render Layers
-Stiff viscosity
-Scale Matrix
-Pinned
-Sequence Editor
-Vertex Normal
-Display current image regardless of object selection
-Display Lattices
-Density
-Exclude raytraced refraction pass from combined
-Charge effector weight
-Limit colliders to this Group
-Square (SV + H)
-Space currently being displayed in this area
-Show frame number beside the current frame indicator line
-Face
-Normalized quaternion rotation
-Proportional Editing enabled
-Vector handle selected color
-Scope region background color
-Show font files
-Wave
-Stickness
-Vertex Groups
-The time to animate the view in milliseconds, zero to disable
-Number of times this datablock is referenced
-Source Path
-Forcefield based on a texture
-Lattices
-Object used as the smoke simulation domain
-Parameters defining which layer, pass and frame of the image is displayed
-Vertex Size
-Italian (Italiano)
-Physics Type
-Ghost
-Audio Device
-Display Scene
-Limit Scale
-Enable Dome environment
-Vertex Group Kink Negate
-Radial Falloff Power
-Value Sliders
-collection
-Meta Elements
-Q
-Display Transforms
-Texture Time Out
-Output image in TIFF format
-Key Map
-Navigation mesh
-Fade effect using the built-in default (usually make transition as long as effect strip)
-Include visualization of ShapeKey related Animation data
-Manual adjust
-Space User Preferences
-NLA Track is not evaluated
-Use rule when boid is on land
-Anisotropic Filter
-Red Green Blue
-Radiance HDR
-Active object base in the scene
-User defined layer of integer number values
-Object Mode
-Maximum height between grid cells the agent can climb
-Texts
-Sort the file list by extension
-Settings for filtering animation data
-Number of horizontal pixels in the screen
-Path to the .blend file
-Converts texture RGB values to intensity (gray) values
-Different styles of displaying the color picker widget
-Initial state when the game starts
-Nurbs order in the U direction (For splines and surfaces), Higher values let points influence a greater area
-Show sliders beside F-Curve channels
-Fisheye
-Show View Name
-Sequencer and Image Preview
-Fake User
-Video Sequence Editor
-Struct Definition
-The directory for storing temporary save files
-Record Animation
-F-Curve Modifier will not be evaluated
-Full Render
-Only one side is rendered, with Z axis pointing in direction of image
-Show ghosts from around the current frame
-Display Channel
-Automatically switch between orthographic and perspective when changing from top/front/side views
-Print debug information for this property
-Update simulation with cache steps
-Relationship Lines
-RNA Path to property affected by F-Curve
-Median Point
-Mesh datablocks
-Sets angular index of refraction for raytraced refraction
-Node Socket type
-Outliner space data
-Shadow X Offset
-Amount of residual error in Blender space unit for constraints that work on position
-Make diffuse shading more similar to shading the surface
-Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)
-Draw white edges with black outline
-UV selection and display mode
-No
-Show linked objects to the actuator
-Key Config
-Pressure
-Render Data
-Quaternion Rotation
-Multiply
-Control point for envelope F-Modifier
-Proportion of original image source pixel lines to sample
-Avoid Collision
-Snap to volume
-Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)
-Automatically determine the number of threads, based on CPUs
-Curve mapping to map color, vector and scalar values to other values using a user defined curve
-Run python while editing
-Selects the collision type
-Active Vert/Edge/Face
-Tessellation level - check the generated mesh in wireframe mode
-Register
-Transform Markers
-Include visualization of Scene related Animation data
-Index number of cache files
-Text Highlight
-Halo particle effect settings for a Material datablock
-MPlayer
-Previous Particle Location
-Recent Files
-Legacy tracking constraint prone to twisting artifacts
-Edges receive a lift force when passing through surrounding media
-Optional region type keymap is associated with
-Output image in JPEG 2000 format
-Self Collision
-Enable bending constraints
-Theme DopeSheet
-Layer
-Drag Threshold
-Factor Rest Length
-Which style to use for viewport scaling
-Data to derive color results from
-3D cursor location for this view (dependent on local view setting)
-Nested
-MultiLayer
-Display Curve
-Disk Cache
-Transform markers as well as strips
-mode
-Target object for multi-target constraints
-Multiplier for the material's density
-FPS Base
-Grease Pencil Simplify Stroke
-Edit all markers of the same group as one
-Harmonic effector weight
-Location of head end of the bone relative to armature
-Texture coordinates from root particle locations
-Stereo Options
-Disallow movement around the Z axis
-Number of vertical tiles to use while rendering
-Random Friction
-Specifies an offset in the flare seed table
-Horizon brightness
-Language
-Sound Clip
-Light used for OpenGL lighting in solid draw mode
-Screen datablocks
-NLA Editor
-Vertex group to control velocity
-input_count
-Only hold last frame
-Elasticity of collisions
-Sky Texture
-Use SIMD SVBVH
-Sort alphabetically
-New Handles Type
-Display only objects which will be rendered
-Noise
-The time (in ms) for a double click
-matrix
-channel_id
-Only render the active layer
-Material
-Standard Modal Map
-No TC in use
-Output image in multilayer OpenEXR format
-Empty
-Always
-Enable filtering of files
-Template
-When the camera is locked to the view and in fly mode, transform the parent rather than the camera
-Show Sensors
-Auto handle color
-Custom Warp Mesh data file
-Audio Channels
-Available as GameObject attributes in the game engine's python API
-Offset Y
-Min Region Size
-Pre-calculate the raytrace accelerator and render raytracing effects
-For multires, show low resolution while navigating the view
-Active curve spline
-Strength of sky shading exponential exposure correction
-Print Performance to Console
-Power of Fresnel for mirror reflection
-Default binary voxel file format
-Copy Transforms
-Draw alpha transparency channel
-4x4 bone matrix relative to armature
-Edge spring stiffness when longer than rest length
-When true the format is a movie
-Read cache from an external location
-Object Index
-Print warnings when using deprecated features in the python API
-Option Widget Colors
-Auto Depth
-Goal Minimum
-Display size for proportional editing circle
-Point
-NLA Strip
-Strokes
-Lock editing of scale in the interface
-Sensor name
-Point in a shape key
-Dutch (Nederlandse taal)
-Only Objects in Group
-The shininess of the reflection (values < 1.0 give diffuse, blurry reflections)
-Default relative path option for the file selector
-Proportional editing object mode
-Sampled animation data
-Output image in PNG format
-Owner Space
-Align the transformation axes to the selected objects' local space
-If this is set, the panel gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is "OBJECT_PT_hello", and bl_idname is not set by the script, then bl_idname = "OBJECT_PT_hello"
-Lock Rotation (4D Angle)
-Overdraw Sketching
-Pause
-Maximum speed in air
-Backdrop Y offset
-Ellipsoid
-Separate Units
-Object is a fixed obstacle
-scene
-Load user interface setup when loading .blend files
-'Viscosity' inside collision target
-Bake everything
-Lamp
-Negate the effect of the length vertex group
-Invert z axis
-Armature datablocks
-Shadow size in pixels (0, 3 and 5 supported)
-Rasterized cell size
-Collection of timeline markers
-Local
-Old style zoom, continues while moving mouse up or down
-Tooltips
-Edge Collision
-Fluid rest density
-Blender Voxel
-Bezier curve point with two handles
-Runtime
-Regular key pressed as a modifier
-UV Layer
-Initial Velocity
-Sources of input data for evaluating this variable
-Timeline
-Game engine related settings for the object
-Hide Recent Locations
-Include the name of the active camera in image metadata
-Colored Constraints
-Particle Hair Key
-Y Location
-Exec Region Window
-Stereographic techniques
-UV editor settings
-General movement damping
-Estimate matrix
-Global Pivot
-IK X Lock
-Keep UV and edit mode mesh selection in sync
-Vector Handle
-Number of frames from start frame for influence to take effect
-int_array
-Key velocity
-Negate the effect of the roughness 1 vertex group
-Output Path
-Image User
-AutoMerge Editing
-Flare Subsize
-Handle 2 Location
-Edge UV Face Select
-Clamp To
-NDOF
-The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored
-Particle systems emitted from the object
-Wheel Up
-Linear falloff
-Show the status of cached frames in the timeline
-R
-Keyframe
-Blender Render
-Noise Basis
-How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)
-Display Grid Floor
-Transmission Color
-Parameters defining how an Image datablock is used by another datablock
-Spline point without handles
-8 bit color channels
-Collapse summary when shown, so all other channels get hidden. (DopeSheet Editors Only)
-Draw Z-buffer associated with image (mapped from camera clip start to end)
-Filter Size
-Density is constant within lookup radius
-Clear Images before baking
-Animation Channels
-Snap closest point onto target
-Cloth Collision Settings
-Sequence Plugin Directory
-Size of widget handles as percentage of widget radius
-Friction
-Main Speakers
-Offset in the random number table, to get a different randomized result
-Keep Lengths
-Vertex Group Element
-Snap to faces
-Case Sensitive Matches Only
-Time delay in 1/10 seconds before automatically opening sub level menus
-RNA structure definition
-F-Curve Modifier is only applied for the specified frame range to help mask off effects in order to chain them
-Collection of pose bone constraints
-Angle
-Gives a spiraling force that twists the force objects local Z axis
-AAC
-The constraint is applied relative to the local coordinate sytem of the object
-Separate color channels in preview
-Absolute Density
-Target Particle System
-When transforming keyframes, changes to the animation data are flushed to other views
-Markers
-Amount of pixels you have to drag before dragging UI items happens
-Manipulator Hotspot
-Nurb U-lines
-Output video in Ogg format
-double_array
-Shape matching threshold
-Drag component proportional to the square of velocity
-Inner Selected
-Show Playback FPS
-Interpolation
-Space File Browser
-Hold LMB Open Toolbox Delay
-Vertex Group Weight
-Timeline editor space data
-Main Screens
-Improved Perlin
-The value this event translates to in a modal keymap
-Theme settings for widget state colors
-Reversed
-Mesh Float Property
-Sky Exposure
-Align each axis to the Euler rotation axis as used for input
-Show Frame Numbers
-Action Editor
-17 - Theme Color Set
-Soft body simulation settings for an object
-Mesh Vertices
-32-bit Float
-Invisible
-Number of horizontal pixels in the rendered image
-=
-Handle types
-Stricky texture coordinate
-Max Land Angular Velocity
-Struct definition used for properties assigned to this item
-RGB to Intensity
-Mapping settings
-Name of Shape Key
-Shadow Alpha
-Radius Interpolation
-Pulse True Level
-Bounces
-Exec Region Preview
-Edge Draw Type
-Color Management
-Raytrace
-Forcefield depends on the speed of the particles
-Mode
-Stiffness
-Radial
-Noise Method
-Number of seconds between each run of the GL texture garbage collector
-Gravitational constant used for physics simulation in the game engine
-Logic Editor
-Text Selected
-Point Caches
-No compression
-Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed
-Edge Crease
-Invert rotation Axis
-Use Ambient Occlusion to add shadowing based on distance between objects
-Frame that modifier's influence starts (if Restrict Frame Range is in use)
-active_strip
-Lock
-Collection of window managers
-Cine-Flat 24fps 1998x1080
-Sort by extension
-All Views
-Enum Item Definition
-Button 4
-Button 5
-Button 6
-Button 7
-Button 1
-Button 2
-Maximum angles for IK Limit
-Render Pass
-Selected Text
-Whether to draw the sound's waveform
-Data Path
-Enum Flag
-Soft Light
-Define forces for vertices to stick to animated position
-Sample every pixel of the image
-Invert roll axis
-Goal
-Dissolve Speed
-Textbox X Offset
-Sky turbidity
-A random rule is selected for each boid
-OpenAL device - supports 3D audio, recommended for game engine usage
-Console Input
-Invert the level(output) of this sensor
-Memory Cache Limit
-Point Cache List
-Motion Path settings for visualisation
-Endpoint V
-The rotation step for numerical pad keys (2 4 6 8)
-Linear and angular physics
-NLA Strip is selected
-The channel number shown in the image preview. 0 is the result of all strips combined
-Shrink
-Limit movement around the X axis
-Draw Action
-Display debug reporting info
-Collection of action fcurves
-Bone inherits scaling from parent bone
-Lock current frame displayed by layer
-Type of stretch to draw
-Friction/damping with self contact
-Undo
-ZYX Euler
-Scaling factor for the background image
-vBVH
-Axis-Angle Rotation
-Bone deformation weight (for Envelope deform only)
-Interaction radius is a factor of 4 * particle size
-Shape key to use the rest spring lengths from
-Use this texture as a blending value on the next texture
-Deliver environment lighting pass
-Show Python references in tooltips
-Theme NLA Editor
-Above-Below
-Transition Strip
-NLA Strips on this NLA-track
-Draw black edges
-Removes the operator from search results
-Light Override
-Only include channels from Objects in the specified Group
-Compositing
-128
-Random Damping
-Effector Weights
-Location of tail of the channel's bone
-Frame Number
-Image displayed and edited in this space
-Vertex group to control roughness 2
-Show background image in camera view
-How incompressible the fluid is
-Point select mode
-Panel containing UI elements
-Stamp Date
-Inverts the values of the texture to reverse its effect
-Smoke flow settings
-Active Particle System
-Channels
-Type of this region
-Intensity
-Audio Strip
-Blending
-Enable this objects as a collider for physics systems
-Tracking along a single axis
-Weight used by the Subsurf modifier for creasing
-Duplicate Mesh
-Keying Set Info
-Map Type
-Use BLI K-Dop BVH.c
-Amount of turbulence/rotation in fluid
-Add light and shadow
-Random falloff
-Script
-Edge selection mode
-Auto Handle
-Collection of bone groups
-Vertex Group Roughness 1
-Sets minimum X value to for the render border
-Coordinates of the left handle (before the control point)
-Source
-Output Node
-Groups of Pose Channels (Bones)
-Hide recent locations in the file selector
-Particle editing brush
-Show the ground plane grid in perspective view
-Snap Target
-Scripted Expression
-Shadow Brightness
-Noise algorithm - Blender original: Smooth interpolated noise
-Rot error
-Amount of damping during particle collision
-Save Versions
-Anti-aliasing
-Endpoint U
-Sub-Target
-Settings
-Use international fonts
-Show Mini Axis
-Previous Particle Velocity
-Edge in a Mesh datablock
-Function Definition
-Physics engine used for physics simulation in the game engine
-Softbody
-Theme settings for the DopeSheet
-Vertex Group Size
-Add the file format extensions to the rendered file name (eg: filename + .jpg)
-Collection of KeyConfigs
-Active Element
-Wipe
-Deliver raytraced reflection pass
-Fade paths and keys further away from current frame
-Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped
-Control point spring strength values
-Extends by repeating edge pixels of the image
-File is Saved
-Region Type
-OpenEXR
-Auto Keying
-S
-Vector
-Texture Mapping
-Cache name
-Smoke
-Boid State
-Space Node Editor
-Multiresolution
-No Preset
-Maximum allowed number of light inter-reflections
-Final key configuration that combines keymaps from the active and addon configurations, and can be edited by the user
-Allow Negative Frames
-Bending
-Group to override all other lights in this render layer
-Position solver iterations
-Exists
-Lock editing of 'angle' component of four-component rotations in the interface
-Deliver shade-less color pass
-Rear-Truncated
-RNA
-Has Minimum
-Strip has no influence past its extents
-Lennard-Jones effector weight
-Screens
-Window Background
-current_character
-Meta
-Theme settings for the Logic Editor
-Floating-Point Property
-Structural Stiffness
-Particle system settings
-Codec settings for OpenEXR
-Axis
-Forces the current Scene to be displayed in all Screens
-Indicates that a keymap is used for translate modal events for an operator
-Environment map created by the renderer and cached for subsequent renders
-Rotational Difference
-Goal Vertex Group
-Use shaders for GLSL rendering
-Multiple Springs
-Emitter Distance
-Edit Bone
-Indicates that a keyconfig was defined by the user
-Include channels from objects/bone that aren't visible
-Align dynamic game objects along the surface normal, when inside the physics distance area
-Frames Per Second
-Set the distance between the eyes - the camera focal length/30 should be fine
-Draw Other Objects
-Mouse Previous Y Position
-Flare Size
-Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)
-Maintain Volume
-Display mode for the file list
-Max Step
-Activate FALSE level triggering (pulse mode)
-Active Render
-Size Y
-Size X
-Display splash screen on startup
-Size Z
-Grease Pencil Layer
-X/Y coordinates of the curve point
-Use a minimum distance for the field's fall-off
-Show 2D cursor
-Frame Locked
-Active
-Horizontal
-Editing
-Factor for how much surrounding objects contribute to light
-Blend In
-Sets the global starting frame of the movie/sequence, assuming first picture has a #1
-bg_BG
-The size of the occlusion buffer in pixel, use higher value for better precision (slower)
-Horizontal aspect ratio - for anamorphic or non-square pixel output
-4x4 matrix, before constraints
-Minimum Distance
-End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)
-Particles generated by the particle system
-Region Text Highlight
-Align
-zh_TW
-Overwrite existing files while rendering
-Cylinder
-How many frames to fade
-Driver type
-World
-Theme settings for user interface elements
-Bending Stiffness
-Draw other selected objects that share the same image
-Show dashed lines indicating parent or constraint relationships
-And
-Bevel Radius
-Extrapolated
-Force
-Active Brush
-Distance will be used to attenuate shadows
-Method used to adjust the roll of bones when retargeting
-Form Factor
-Scopes to visualize image statistics
-Number
-Shade Top
-Number of frames to render ahead during playback
-High quality interpolation, but slower
-Current view matrix of the 3D region
-Handle 1 Location
-Vertex Group Density
-Active Frame
-IK Y Limit
-Blending to inelastic collision
-Enable high resolution (using amplification)
-Simulation starts on this frame
-Properties to set when the operator is called
-Result of rendering, including all layers and passes
-iTaSC
-Mesh String Property Layer
-Tweak Left
-True if this map is ready for use, False if it needs rendering
-X Scale
-Bone in an Armature datablock
-Output image in Targa format
-Stamp Sequence Strip
-F-Curve Modifier's panel is expanded in UI
-Build 50% proxy resolution
-An object duplicate
-Start Offset
-Items
-Fluid simulation settings for an object taking part in the simulation
-Set audio mixing buffer size to 8192 samples
-Material Strand
-Inflow
-Sort
-Relative Key
-Motion Paths
-Return
-Stiffness defines how much of the element to fill
-Detail mesh simplification max sample error
-Meta Strip
-Bake Alpha values (transparency)
-Memory cache limit in sequencer (megabytes)
-Input configuration, including keymaps
-Select the type of Framing you want
-Animation data for this datablock
-Raytracing
-Key Map Item
-Split quads to give the least distortion while baking
-Show overexposed areas with zebra stripes
-1024
-Bias towards faces further away from the object (in blender units)
-Strip time is controlled by an F-Curve rather than automatically determined
-Bake Location
-sr_RS
-Panel
-Main Libraries
-Edit Edit
-Get away from assigned object or loudest assigned signal source
-Darken
-Active index in vertex group array
-Average Separation
-F-Curve Modifiers
-RNA type used for pointers to any possible data
-Space Image Editor
-UV Selected
-Handle 1 Type
-Choke
-Use Simplify
-Maximum
-YZX Euler
-No Self
-Helicopter Mode
-Rotation in Eulers
-On Cage
-Bone that defines the display transform of this custom shape
-Main Node Trees
-Undo Steps
-Cube Map
-Point cache for physics simulations
-Interactive python console
-Use environment map with six cube sides
-Show .blend files
-Kill Particles
-Sets maximum X value for the render border
-Only Seconds
-NLA Tracks (i.e. Animation Layers)
-Timer Property
-Z Rotation
-Ensure all bone-deforming vertex groups add up to 1.0 while weight painting
-Rigid to Soft Body
-Lock to Object
-Threshold
-Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)
-Occlude Geometry
-Causes surface data to be duplicated with the object
-Use the images alpha values clipped with no blending (binary alpha)
-Hold Forward
-Set Controller state index (1 to 30)
-Amount of light that gets scattered out by the volume - the more out-scattering, the shallower the light will penetrate
-Lock Horizon
-Ignore Layers
-Object Matrix
-Pixel Aspect X
-Filename
-Use Ambient Occlusion
-The transformation of the target is evaluated relative to its local coordinate system
-The region where the panel is going to be used in
-BW
-Bake Specular values
-Tool
-Margin Column
-Maximum distance from active object to other object (in blender units
-Final transformation value of object or bone
-Group Name
-Proxy parameters for a sequence strip
-fr_FR
-Kill collided particles
-Disable simulation of angular motion along the Y axis
-Collision Margin
-SMPTE timecode showing minutes, seconds, and frames only. Hours are also shown if necessary, but not by default
-bl_use_preview
-Draw Faces
-Vertex Group Rotation Negate
-\
-New Window
-Turbulent noise driven by particle velocity
-Lock Rotation
-Color Source
-Print state debug info in the game engine
-Location of head of the channel's bone
-Timer
-Output video in Xvid format
-Enable raytraced reflections
-Image Preview
-Optional space type keymap is associated with
-Use ramps for GLSL rendering
-Motion Samples
-Vectorscope Opacity
-Element defining a color at a position in the color ramp
-All Action Keyframes
-Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)
-Align Object To
-Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)
-Limit
-T
-Diffuse Color
-Release
-User defined string text value in a string properties layer
-Histogram for viewing image statistics
-Scroll Widget Colors
-General media friction for point movements
-Lock Y Rotation Axis
-Set audio mixing buffer size to 1024 samples
-Draw the image repeated outside of the main view
-Mesh Int Property
-Noodle curving
-Unknown Type
-Add & Replace
-Border Collisions
-Add children to form a compound collision object
-Influence
-Show high resolution (using amplification)
-Collection of sounds
-Use Bone Heads
-Actuator to apply actions in the game engine
-Mp3
-Go to closest enemy and attack when in range
-Type of range to show for Motion Paths
-Use trackball style rotation in the viewport
-32768
-Overwrite
-Duplicate Particle
-32-bit Signed
-Scale
-Expression to use for Scripted Expression
-Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy
-Parameters
-Material Mode
-Avoid
-Cache is outdated
-File Browser Buttons
-Actor
-Bone Group Index
-Toolbox Column Layout
-Show the frames per second screen refresh rate, while animation is played back
-Image Editor
-Mesh Vertex Sticky Texture Coordinate
-Vertex Weight Proximity
-Average Spring length * Ball Size
-Renders rings over halo
-Offset in the random number table for child particles, to get a different randomized result
-Auto Keying Mode
-B-Bone Segments
-Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox
-Visible Layers
-File format to save the rendered images as
-Enable view navigation within the camera view
-Show background image in top view
-Sun brightness
-Closest
-Make this curve or surface a closed loop in the U direction
-Command history
-XYZ Rotation Order. Prone to Gimbal Lock
-Draw Stretch Type
-Percentage scale for render resolution
-F-Curve and its keyframes are hidden in the Graph Editor graphs
-F-Curve Editor
-Area distortion between UV and 3D faces
-YXZ Rotation Order. Prone to Gimbal Lock
-Effective but slow compression
-Fields
-For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower)
-Process the render result through the compositing pipeline, if compositing nodes are enabled
-Co-ordinate system to cache particles in
-Error Limit
-Curve guide effector weight
-Default
-Black Level
-ISO 1
-Fine tunes texture mapping X, Y and Z locations
-Single Property
-Korean (한국 언어)
-DopeSheet Sub-Channel
-Max Air Speed
-Vertex Group Length Negate
-Key location for a particle over time
-Render a user-defined border region, within the frame size. Note, this disables save_buffers and full_sample
-Range
-Materials
-Show hidden dot files
-Numpad Enter
-Polish (Polski)
-Automatic saving of temporary files in temp directory, uses process ID
-Cubic B-Spline
-Logic editor space data
-Open menu buttons and pulldowns automatically when the mouse is hovering
-Use to check if an operator is a macro
-Display zoom level
-Stamp Filename
-Weight
-Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered)
-Auto XYZ to RGB
-UV
-Audio volume
-Restrict the number of animation updates to the animation FPS. This is better for performance, but can cause issues with smooth playback
-Replace
-Show paint related properties
-Target Space
-Gloss Samples
-UI
-Keep horizon level while flying with 3D Mouse
-Texture Mode
-Shaded + Multiple Scattering
-Lifetime
-Settings for particle fluids physics
-Type of units for this property
-Pointer
-Field Settings
-PoseBone Constraints
-Right Ctrl
-User Key Configuration
-Color 3
-Speakers
-Color 1
-Spline Points
-Color 4
-Gradient
-Rule Fuzziness
-YZX Rotation Order. Prone to Gimbal Lock
-Amount of residual error in radiant for constraints that work on orientation
-GLSL Shadows
-Radius of object representation in obstacle simulation
-Show the entire viewport in the display window, using bar horizontally or vertically
-Dissolve Smoke
-Internal
-Library file the datablock is linked from
-Outer face thickness
-Any modifier keys pressed
-Screen aligned billboard
-Allow moving the mouse outside the view on some manipulations (transform, ui control drag)
-NLA Strips that this strip acts as a container for (if it is of type Meta)
-Pixel Cache
-Texture slot name
-Render Stamp
-bl_label
-Settings for interacting with Blender data
-Ball
-Active Clone
-Editbone Matrix
-ja_JP
-Curve in a curve mapping
-Auto Rainbow
-Maximum angular velocity in air (relative to 180 degrees)
-Operator Properties
-Material Raytrace Transparency
-Child
-Modal Keymap
-Color to use behind stamp text
-Theme settings for the graph editor
-Aligned
-Border Maximum X
-Border Maximum Y
-Type of event
-Set color of the bars
-Collapse Summary
-How many collision iterations should be done. (higher is better quality but slower)
-Consant falloff
-Fields Still
-Main Sounds
-Definition of a choice in an RNA enum property
-Translate Tooltips
-Sync Markers
-Object being duplicated
-Face in a Mesh datablock
-Calculate bone paths from tails
-Display World
-UV Pinned
-No Collision
-Active Channel Group
-Make face invisible
-Number of subdivisions of bone (for B-Bones only)
-Renders halo as a lens flare
-Only Selected Channels
-Minimum height where the agent can still walk
-Stroke data points
-Multiply Vertex Group with Envelope
-Inner face thickness
-Set actuator expanded in the user interface
-Low values are slower and higher quality
-Vertices Cache
-Lattice datablocks
-Current frame number can be manually set to a negative value
-Set controller expanded in the user interface
-Simulation used for obstacle avoidance in the game engine
-Duplicate Curve
-List of background images
-Manipulator Handle Size
-Alive
-Lock Z Axis
-Tex
-A square showing Saturation/Value, with Hue slider
-Deliver material index pass
-XXX todo
-Collection of spline points
-Flock
-Linear Light
-Live Unwrap
-Radiosity
-Turbulence Influence
-Object datablocks
-Left Shift
-The source of this force field is the zero point of a harmonic oscillator
-Driver Target
-CIE
-Show High Resolution
-Pin Cloth
-Soft Body Settings
-Threads
-Negate the effect of the roughness end vertex group
-Gloss Threshold
-World Space
-Game data for a Scene datablock
-Blender 2.4
-Coordinates of the right handle (after the control point)
-View2D Buttons List
-F-Curves in this group
-Point cache list
-3D View Region
-Show the X axis line in perspective view
-Matroska
-Node Generic
-Extinction scattering contribution factor
-Callback function defines for builtin Keying Sets
-Generate point density from an object's vertices
-Coulomb friction coefficient, when inside the physics distance area
-Temporary
-Vertex group to control size
-Time in milliseconds between each frame recorded for screencast
-Low Resolution Mesh
-Maximum structural stiffness value
-Maximum radial distance for the field to work
-Collection of point caches
-Volume
-Asymmetry
-Mux rate (bits/s(!))
-Weight value of a vertex in a vertex group
-Log conversion reference blackpoint
-Point density settings
-Show Mouse
-Name of Action Group to assign setting(s) for this path to
-Rotate
-Multiplier for multiple scattered light energy
-09 - Theme Color Set
-(Min+Max)/2 * Ball Size
-Flow
-Output image in Radiance HDR format
-Show Expanded
-11 - Theme Color Set
-Front scattering weight
-Maximum speed for jumping
-Compositor Nodes
-Particle in a particle system
-Vertex Group
-U
-Bending Stiffness Vertex Group
-Context
-Vertex selection mode
-Use scaled but un-grid-fitted kerning distances
-Gloss Amount
-3D region that defines the quad view settings
-Display groups and their datablocks
-Include visualization of Curve related Animation data
-User Modified
-Statistical view of the levels of color in an image
-Anisotropic Friction
-4x
-Inverse Gain
-Fade Time
-Visual Keying
-Agent Height
-Underline
-Translate Interface
-Property Definition
-Bake Mirror colors
-Animated Strip Time
-Friction Factor
-Space data for a screen area
-Maximum speed on land
-Theme User Interface
-Deflect Emitter
-Use Edges
-The base density of the volume
diff --git a/po/update_mo.py b/po/update_mo.py
index eb4c2840e28..33b7baaed69 100755
--- a/po/update_mo.py
+++ b/po/update_mo.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# $Id:
+# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -25,29 +25,43 @@
import subprocess
import os
+import sys
-CURRENT_DIR = os.path.dirname(__file__)
+GETTEXT_MSGFMT_EXECUTABLE = "msgfmt"
+CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, "..")))
LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "bin", ".blender", "locale")
DOMAIN = "blender"
+def process_po(po):
+ lang = os.path.basename(po)[:-3]
+
+ # show stats
+ cmd = (GETTEXT_MSGFMT_EXECUTABLE,
+ "--statistics",
+ os.path.join(CURRENT_DIR, "%s.po" % lang),
+ "-o",
+ os.path.join(LOCALE_DIR, lang, "LC_MESSAGES", "%s.mo" % DOMAIN),
+ )
+
+ print(" ".join(cmd))
+ process = subprocess.Popen(cmd)
+ process.wait()
+
+
def main():
- for po in os.listdir(CURRENT_DIR):
- if po.endswith(".po"):
- lang = po[:-3]
- # show stats
- cmd = ("msgfmt",
- "--statistics",
- os.path.join(CURRENT_DIR, "%s.po" % lang),
- "-o",
- os.path.join(LOCALE_DIR, lang, "LC_MESSAGES", "%s.mo" % DOMAIN),
- )
-
- print(" ".join(cmd))
- process = subprocess.Popen(cmd)
- process.wait()
+ if len(sys.argv) > 1:
+ for lang in sys.argv[1:]:
+ po = os.path.join(CURRENT_DIR, lang + '.po')
+
+ if os.path.exists(po):
+ process_po(po)
+ else:
+ for po in os.listdir(CURRENT_DIR):
+ if po.endswith(".po"):
+ process_po(po)
if __name__ == "__main__":
print("\n\n *** Running %r *** \n" % __file__)
diff --git a/po/update_msg.py b/po/update_msg.py
index 7bd372cf3ce..5986d96f14b 100644
--- a/po/update_msg.py
+++ b/po/update_msg.py
@@ -1,4 +1,4 @@
-# $Id:
+# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -17,7 +17,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-# <pep8 compliant>
+# <pep8-80 compliant>
# Write out messages.txt from blender
@@ -26,79 +26,341 @@
import os
-CURRENT_DIR = os.path.dirname(__file__)
+CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, "..")))
FILE_NAME_MESSAGES = os.path.join(CURRENT_DIR, "messages.txt")
+COMMENT_PREFIX = "#~ "
-def dump_messages():
+def dump_messages_rna(messages):
import bpy
+ def classBlackList():
+ blacklist_rna_class = [
+ # core classes
+ "Context", "Event", "Function", "UILayout",
+ "BlendData",
+ # registerable classes
+ "Panel", "Menu", "Header", "RenderEngine",
+ "Operator", "OperatorMacro", "Macro",
+ "KeyingSetInfo", "UnknownType",
+ # window classes
+ "WindowManager", "Window"
+ ]
+
+ # ---------------------------------------------------------------------
+ # Collect internal operators
+
+ # extend with all internal operators
+ # note that this uses internal api introspection functions
+ # all possible operator names
+ op_names = list(sorted(set(
+ [cls.bl_rna.identifier for cls in
+ bpy.types.OperatorProperties.__subclasses__()] +
+ [cls.bl_rna.identifier for cls in
+ bpy.types.Operator.__subclasses__()] +
+ [cls.bl_rna.identifier for cls in
+ bpy.types.OperatorMacro.__subclasses__()]
+ )))
+
+ get_inatance = __import__("_bpy").ops.get_instance
+ path_resolve = type(bpy.context).__base__.path_resolve
+ for idname in op_names:
+ op = get_inatance(idname)
+ if 'INTERNAL' in path_resolve(op, "bl_options"):
+ blacklist_rna_class.append(idname)
+
+ # ---------------------------------------------------------------------
+ # Collect builtin classes we dont need to doc
+ blacklist_rna_class.append("Property")
+ blacklist_rna_class.extend(
+ [cls.__name__ for cls in
+ bpy.types.Property.__subclasses__()])
+
+ # ---------------------------------------------------------------------
+ # Collect classes which are attached to collections, these are api
+ # access only.
+ collection_props = set()
+ for cls_id in dir(bpy.types):
+ cls = getattr(bpy.types, cls_id)
+ for prop in cls.bl_rna.properties:
+ if prop.type == 'COLLECTION':
+ prop_cls = prop.srna
+ if prop_cls is not None:
+ collection_props.add(prop_cls.identifier)
+ blacklist_rna_class.extend(sorted(collection_props))
+
+ return blacklist_rna_class
+
+ blacklist_rna_class = classBlackList()
+
+ def filterRNA(bl_rna):
+ id = bl_rna.identifier
+ if id in blacklist_rna_class:
+ print(" skipping", id)
+ return True
+ return False
+
# -------------------------------------------------------------------------
# Function definitions
- def _putMessage(messages, msg):
- if len(msg):
- messages[msg] = True
-
- def _walkProperties(properties, messages):
+ def walkProperties(bl_rna):
import bpy
- for prop in properties:
- _putMessage(messages, prop.name)
- _putMessage(messages, prop.description)
+
+ # get our parents properties not to export them multiple times
+ bl_rna_base = bl_rna.base
+ if bl_rna_base:
+ bl_rna_base_props = bl_rna_base.properties.values()
+ else:
+ bl_rna_base_props = ()
+
+ for prop in bl_rna.properties:
+ # only write this property is our parent hasn't got it.
+ if prop in bl_rna_base_props:
+ continue
+ if prop.identifier == "rna_type":
+ continue
+
+ msgsrc = "bpy.types.%s.%s" % (bl_rna.identifier, prop.identifier)
+ if prop.name and prop.name != prop.identifier:
+ messages.setdefault(prop.name, []).append(msgsrc)
+ if prop.description:
+ messages.setdefault(prop.description, []).append(msgsrc)
if isinstance(prop, bpy.types.EnumProperty):
for item in prop.enum_items:
- _putMessage(messages, item.name)
- _putMessage(messages, item.description)
+ msgsrc = "bpy.types.%s.%s, '%s'" % (bl_rna.identifier,
+ prop.identifier,
+ item.identifier,
+ )
+ # Here identifier and name can be the same!
+ if item.name: # and item.name != item.identifier:
+ messages.setdefault(item.name, []).append(msgsrc)
+ if item.description:
+ messages.setdefault(item.description, []).append(msgsrc)
+
+ def walkRNA(bl_rna):
+
+ if filterRNA(bl_rna):
+ return
+
+ msgsrc = "bpy.types.%s" % bl_rna.identifier
- def _walkRNA(bl_rna, messages):
if bl_rna.name and bl_rna.name != bl_rna.identifier:
- _putMessage(messages, bl_rna.name)
+ messages.setdefault(bl_rna.name, []).append(msgsrc)
if bl_rna.description:
- _putMessage(messages, bl_rna.description)
+ messages.setdefault(bl_rna.description, []).append(msgsrc)
- _walkProperties(bl_rna.properties, messages)
+ if hasattr(bl_rna, 'bl_label') and bl_rna.bl_label:
+ messages.setdefault(bl_rna.bl_label, []).append(msgsrc)
- def _walkClass(cls, messages):
- _walkRNA(cls.bl_rna, messages)
+ walkProperties(bl_rna)
- def _walk_keymap_hierarchy(hier, messages):
+ def walkClass(cls):
+ walkRNA(cls.bl_rna)
+
+ def walk_keymap_hierarchy(hier, msgsrc_prev):
for lvl in hier:
- _putMessage(messages, lvl[0])
+ msgsrc = "%s.%s" % (msgsrc_prev, lvl[1])
+ messages.setdefault(lvl[0], []).append(msgsrc)
if lvl[3]:
- _walk_keymap_hierarchy(lvl[3], messages)
+ walk_keymap_hierarchy(lvl[3], msgsrc)
# -------------------------------------------------------------------------
# Dump Messages
- messages = {}
+ def full_class_id(cls):
+ """ gives us 'ID.Lamp.AreaLamp' which is best for sorting.
+ """
+ cls_id = ""
+ bl_rna = cls.bl_rna
+ while bl_rna:
+ cls_id = "%s.%s" % (bl_rna.identifier, cls_id)
+ bl_rna = bl_rna.base
+ return cls_id
- for cls in type(bpy.context).__base__.__subclasses__():
- _walkClass(cls, messages)
+ cls_list = type(bpy.context).__base__.__subclasses__()
+ cls_list.sort(key=full_class_id)
+ for cls in cls_list:
+ walkClass(cls)
- for cls in bpy.types.Space.__subclasses__():
- _walkClass(cls, messages)
+ cls_list = bpy.types.Space.__subclasses__()
+ cls_list.sort(key=full_class_id)
+ for cls in cls_list:
+ walkClass(cls)
- for cls in bpy.types.Operator.__subclasses__():
- _walkClass(cls, messages)
+ cls_list = bpy.types.Operator.__subclasses__()
+ cls_list.sort(key=full_class_id)
+ for cls in cls_list:
+ walkClass(cls)
- from bl_ui.space_userpref_keymap import KM_HIERARCHY
+ cls_list = bpy.types.OperatorProperties.__subclasses__()
+ cls_list.sort(key=full_class_id)
+ for cls in cls_list:
+ walkClass(cls)
- _walk_keymap_hierarchy(KM_HIERARCHY, messages)
+ cls_list = bpy.types.Menu.__subclasses__()
+ cls_list.sort(key=full_class_id)
+ for cls in cls_list:
+ walkClass(cls)
- message_file = open(FILE_NAME_MESSAGES, 'w')
- message_file.writelines("\n".join(messages))
- message_file.close()
- print("Written %d messages to: %r" % (len(messages), FILE_NAME_MESSAGES))
+ from bpy_extras.keyconfig_utils import KM_HIERARCHY
+
+ walk_keymap_hierarchy(KM_HIERARCHY, "KM_HIERARCHY")
+
+
+def dump_messages_pytext(messages):
+ """ dumps text inlined in the python user interface: eg.
- # XXX. what is this supposed to do, we wrote the file already???
- _walkClass(bpy.types.SpaceDopeSheetEditor, messages)
+ layout.prop("someprop", text="My Name")
+ """
+ import ast
- return {'FINISHED'}
+ # -------------------------------------------------------------------------
+ # Gather function names
+
+ import bpy
+ # key: func_id
+ # val: [(arg_kw, arg_pos), (arg_kw, arg_pos), ...]
+ func_translate_args = {}
+
+ # so far only 'text' keywords, but we may want others translated later
+ translate_kw = ("text", )
+
+ for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
+ # check it has a 'text' argument
+ for (arg_pos, (arg_kw, arg)) in enumerate(func.parameters.items()):
+ if ((arg_kw in translate_kw) and
+ (arg.is_output == False) and
+ (arg.type == 'STRING')):
+
+ func_translate_args.setdefault(func_id, []).append((arg_kw,
+ arg_pos))
+ # print(func_translate_args)
+
+ # -------------------------------------------------------------------------
+ # Function definitions
+
+ def extract_strings(fp_rel, node_container):
+ """ Recursively get strings, needed incase we have "Blah" + "Blah",
+ passed as an argument in that case it wont evaluate to a string.
+ """
+
+ for node in ast.walk(node_container):
+ if type(node) == ast.Str:
+ eval_str = ast.literal_eval(node)
+ if eval_str:
+ # print("%s:%d: %s" % (fp, node.lineno, eval_str))
+ msgsrc = "%s:%s" % (fp_rel, node.lineno)
+ messages.setdefault(eval_str, []).append(msgsrc)
+
+ def extract_strings_from_file(fp):
+ filedata = open(fp, 'r', encoding="utf8")
+ root_node = ast.parse(filedata.read(), fp, 'exec')
+ filedata.close()
+
+ fp_rel = os.path.relpath(fp, SOURCE_DIR)
+
+ for node in ast.walk(root_node):
+ if type(node) == ast.Call:
+ # print("found function at")
+ # print("%s:%d" % (fp, node.lineno))
+
+ # lambda's
+ if type(node.func) == ast.Name:
+ continue
+
+ # getattr(self, con.type)(context, box, con)
+ if not hasattr(node.func, "attr"):
+ continue
+
+ translate_args = func_translate_args.get(node.func.attr, ())
+
+ # do nothing if not found
+ for arg_kw, arg_pos in translate_args:
+ if arg_pos < len(node.args):
+ extract_strings(fp_rel, node.args[arg_pos])
+ else:
+ for kw in node.keywords:
+ if kw.arg == arg_kw:
+ extract_strings(fp_rel, kw.value)
+
+ # -------------------------------------------------------------------------
+ # Dump Messages
+
+ mod_dir = os.path.join(SOURCE_DIR,
+ "release",
+ "scripts",
+ "startup",
+ "bl_ui")
+
+ files = [os.path.join(mod_dir, fn)
+ for fn in sorted(os.listdir(mod_dir))
+ if not fn.startswith("_")
+ if fn.endswith("py")
+ ]
+
+ for fp in files:
+ extract_strings_from_file(fp)
+
+
+def dump_messages():
+
+ def filter_message(msg):
+
+ # check for strings like ": %d"
+ msg_test = msg
+ for ignore in ("%d", "%s", "%r", # string formatting
+ "*", ".", "(", ")", "-", "/", "\\", "+", ":", "#", "%"
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
+ "x", # used on its own eg: 100x200
+ "X", "Y", "Z", # used alone. no need to include
+ ):
+ msg_test = msg_test.replace(ignore, "")
+ msg_test = msg_test.strip()
+ if not msg_test:
+ # print("Skipping: '%s'" % msg)
+ return True
+
+ # we could filter out different strings here
+
+ return False
+
+ if 1:
+ import collections
+ messages = collections.OrderedDict()
+ else:
+ messages = {}
+
+ messages[""] = []
+
+ # get strings from RNA
+ dump_messages_rna(messages)
+
+ # get strings from UI layout definitions text="..." args
+ dump_messages_pytext(messages)
+
+ del messages[""]
+
+ message_file = open(FILE_NAME_MESSAGES, 'w', encoding="utf8")
+ # message_file.writelines("\n".join(sorted(messages)))
+
+ for key, value in messages.items():
+
+ # filter out junk values
+ if filter_message(key):
+ continue
+
+ for msgsrc in value:
+ message_file.write("%s%s\n" % (COMMENT_PREFIX, msgsrc))
+ message_file.write("%s\n" % key)
+
+ message_file.close()
+
+ print("Written %d messages to: %r" % (len(messages), FILE_NAME_MESSAGES))
def main():
diff --git a/po/update_po.py b/po/update_po.py
index d01d6a31613..3dcaa9d8f1b 100755
--- a/po/update_po.py
+++ b/po/update_po.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# $Id:
+# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -25,27 +25,41 @@
import subprocess
import os
+import sys
-CURRENT_DIR = os.path.dirname(__file__)
+GETTEXT_MSGMERGE_EXECUTABLE = "msgmerge"
+CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
DOMAIN = "blender"
+def process_po(po):
+ lang = os.path.basename(po)[:-3]
+
+ # update po file
+ cmd = (GETTEXT_MSGMERGE_EXECUTABLE,
+ "--update",
+ "--backup=none",
+ "--lang=%s" % lang,
+ os.path.join(CURRENT_DIR, "%s.po" % lang),
+ os.path.join(CURRENT_DIR, "%s.pot" % DOMAIN),
+ )
+
+ print(" ".join(cmd))
+ process = subprocess.Popen(cmd)
+ process.wait()
+
+
def main():
- for po in os.listdir(CURRENT_DIR):
- if po.endswith(".po"):
- lang = po[:-3]
-
- # update po file
- cmd = ("msgmerge",
- "--update",
- "--lang=%s" % lang,
- os.path.join(CURRENT_DIR, "%s.po" % lang),
- os.path.join(CURRENT_DIR, "%s.pot" % DOMAIN),
- )
-
- print(" ".join(cmd))
- process = subprocess.Popen(cmd)
- process.wait()
+ if len(sys.argv) > 1:
+ for lang in sys.argv[1:]:
+ po = os.path.join(CURRENT_DIR, lang + '.po')
+
+ if os.path.exists(po):
+ process_po(po)
+ else:
+ for po in os.listdir(CURRENT_DIR):
+ if po.endswith(".po"):
+ process_po(po)
if __name__ == "__main__":
diff --git a/po/update_pot.py b/po/update_pot.py
index b34b75f9740..4e202026444 100755
--- a/po/update_pot.py
+++ b/po/update_pot.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# $Id:
+# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
@@ -25,11 +25,13 @@
import subprocess
import os
+from codecs import open
GETTEXT_XGETTEXT_EXECUTABLE = "xgettext"
-CURRENT_DIR = os.path.dirname(__file__)
+CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, "..")))
DOMAIN = "blender"
+COMMENT_PREFIX = "#~ " # from update_msg.py
FILE_NAME_POT = os.path.join(CURRENT_DIR, "blender.pot")
FILE_NAME_MESSAGES = os.path.join(CURRENT_DIR, "messages.txt")
@@ -55,7 +57,7 @@ def main():
pot_messages = {}
reading_message = False
message = ""
- with open(FILE_NAME_POT, 'r') as handle:
+ with open(FILE_NAME_POT, 'r', "utf-8") as handle:
while True:
line = handle.readline()
@@ -73,8 +75,9 @@ def main():
message += line[1:-1]
# add messages collected automatically from RNA
- with open(FILE_NAME_POT, "a") as pot_handle:
- with open(FILE_NAME_MESSAGES, 'r') as handle:
+ with open(FILE_NAME_POT, "a", "utf-8") as pot_handle:
+ with open(FILE_NAME_MESSAGES, 'r', "utf-8") as handle:
+ msgsrc_ls = []
while True:
line = handle.readline()
@@ -82,13 +85,21 @@ def main():
break
line = stripeol(line)
- line = line.replace("\\", "\\\\")
- line = line.replace("\"", "\\\"")
- if not pot_messages.get(line):
- pot_handle.write("\n#: Automatically collected from RNA\n")
- pot_handle.write("msgid \"%s\"\n" % (line))
- pot_handle.write("msgstr \"\"\n")
+ # COMMENT_PREFIX
+ if line.startswith(COMMENT_PREFIX):
+ msgsrc_ls.append(line[len(COMMENT_PREFIX):].strip())
+ else:
+ line = line.replace("\\", "\\\\")
+ line = line.replace("\"", "\\\"")
+ line = line.replace("\t", "\\t")
+
+ if not pot_messages.get(line):
+ for msgsrc in msgsrc_ls:
+ pot_handle.write("#: %s\n" % msgsrc)
+ pot_handle.write("msgid \"%s\"\n" % line)
+ pot_handle.write("msgstr \"\"\n\n")
+ msgsrc_ls[:] = []
if __name__ == "__main__":
diff --git a/release/bin/.blender/.Blanguages b/release/bin/.blender/.Blanguages
deleted file mode 100644
index 1a83c46039a..00000000000
--- a/release/bin/.blender/.Blanguages
+++ /dev/null
@@ -1,24 +0,0 @@
-English:en_US
-Japanese:ja_JP
-Dutch:nl_NL
-Italian:it_IT
-German:de_DE
-Finnish:fi_FI
-Swedish:sv_SE
-French:fr_FR
-Spanish:es_ES
-Catalan:ca_ES
-Czech:cs_CZ
-Brazilian Portuguese:pt_BR
-Simplified Chinese:zh_CN
-Traditional Chinese:zh_TW
-Russian:ru_RU
-Croatian:hr_HR
-Serbian:sr_RS
-Ukrainian:uk_UA
-Polish:pl_PL
-Romanian:ro_RO
-Arabic:ar_SA
-Bulgarian:bg_BG
-Greek:el_GR
-Korean:ko_KR
diff --git a/release/bin/.blender/fonts/droidsans.ttf.gz b/release/bin/.blender/fonts/droidsans.ttf.gz
index e83aff4e899..a00f35f3a66 100644
--- a/release/bin/.blender/fonts/droidsans.ttf.gz
+++ b/release/bin/.blender/fonts/droidsans.ttf.gz
Binary files differ
diff --git a/release/irix-6.2-mips/extra/blender.icon b/release/irix-6.2-mips/extra/blender.icon
deleted file mode 100644
index 32b8bc3b94a..00000000000
--- a/release/irix-6.2-mips/extra/blender.icon
+++ /dev/null
Binary files differ
diff --git a/release/irix-6.2-mips/specific.sh b/release/irix-6.2-mips/specific.sh
deleted file mode 100755
index 87fc2349e2e..00000000000
--- a/release/irix-6.2-mips/specific.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-#
-# OS specific stuff for the package, only to be executed by ../Makefile
-#
-
-# Add icon to package
-cp -f extra/blender.icon $DISTDIR/
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 0c5ef69e805..ef9a4615ff2 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -33,6 +33,7 @@ import bpy as _bpy
error_duplicates = False
error_encoding = False
+addons_fake_modules = {}
def paths():
diff --git a/release/scripts/modules/animsys_refactor.py b/release/scripts/modules/animsys_refactor.py
index 5336a8b2b35..88097ed3d28 100644
--- a/release/scripts/modules/animsys_refactor.py
+++ b/release/scripts/modules/animsys_refactor.py
@@ -215,6 +215,674 @@ def update_data_paths(rna_update):
print("fcurve (%s): %s -> %s" % (id_data.name, data_path, data_path_new))
+# we could have this data in its own file but no point really
+data_2_56_to_2_59 = (
+ ("ClothCollisionSettings", "min_distance", "distance_min"),
+ ("ClothCollisionSettings", "self_min_distance", "self_distance_min"),
+ ("ClothCollisionSettings", "enable_collision", "use_collision"),
+ ("ClothCollisionSettings", "enable_self_collision", "use_self_collision"),
+ ("ClothSettings", "pin_cloth", "use_pin_cloth"),
+ ("ClothSettings", "stiffness_scaling", "use_stiffness_scale"),
+ ("CollisionSettings", "random_damping", "damping_random"),
+ ("CollisionSettings", "random_friction", "friction_random"),
+ ("CollisionSettings", "inner_thickness", "thickness_inner"),
+ ("CollisionSettings", "outer_thickness", "thickness_outer"),
+ ("CollisionSettings", "kill_particles", "use_particle_kill"),
+ ("Constraint", "proxy_local", "is_proxy_local"),
+ ("ActionConstraint", "maximum", "max"),
+ ("ActionConstraint", "minimum", "min"),
+ ("FollowPathConstraint", "use_fixed_position", "use_fixed_location"),
+ ("KinematicConstraint", "chain_length", "chain_count"),
+ ("KinematicConstraint", "pos_lock_x", "lock_location_x"),
+ ("KinematicConstraint", "pos_lock_y", "lock_location_y"),
+ ("KinematicConstraint", "pos_lock_z", "lock_location_z"),
+ ("KinematicConstraint", "rot_lock_x", "lock_rotation_x"),
+ ("KinematicConstraint", "rot_lock_y", "lock_rotation_y"),
+ ("KinematicConstraint", "rot_lock_z", "lock_rotation_z"),
+ ("KinematicConstraint", "axis_reference", "reference_axis"),
+ ("KinematicConstraint", "use_position", "use_location"),
+ ("LimitLocationConstraint", "maximum_x", "max_x"),
+ ("LimitLocationConstraint", "maximum_y", "max_y"),
+ ("LimitLocationConstraint", "maximum_z", "max_z"),
+ ("LimitLocationConstraint", "minimum_x", "min_x"),
+ ("LimitLocationConstraint", "minimum_y", "min_y"),
+ ("LimitLocationConstraint", "minimum_z", "min_z"),
+ ("LimitLocationConstraint", "use_maximum_x", "use_max_x"),
+ ("LimitLocationConstraint", "use_maximum_y", "use_max_y"),
+ ("LimitLocationConstraint", "use_maximum_z", "use_max_z"),
+ ("LimitLocationConstraint", "use_minimum_x", "use_min_x"),
+ ("LimitLocationConstraint", "use_minimum_y", "use_min_y"),
+ ("LimitLocationConstraint", "use_minimum_z", "use_min_z"),
+ ("LimitLocationConstraint", "limit_transform", "use_transform_limit"),
+ ("LimitRotationConstraint", "maximum_x", "max_x"),
+ ("LimitRotationConstraint", "maximum_y", "max_y"),
+ ("LimitRotationConstraint", "maximum_z", "max_z"),
+ ("LimitRotationConstraint", "minimum_x", "min_x"),
+ ("LimitRotationConstraint", "minimum_y", "min_y"),
+ ("LimitRotationConstraint", "minimum_z", "min_z"),
+ ("LimitRotationConstraint", "limit_transform", "use_transform_limit"),
+ ("LimitScaleConstraint", "maximum_x", "max_x"),
+ ("LimitScaleConstraint", "maximum_y", "max_y"),
+ ("LimitScaleConstraint", "maximum_z", "max_z"),
+ ("LimitScaleConstraint", "minimum_x", "min_x"),
+ ("LimitScaleConstraint", "minimum_y", "min_y"),
+ ("LimitScaleConstraint", "minimum_z", "min_z"),
+ ("LimitScaleConstraint", "use_maximum_x", "use_max_x"),
+ ("LimitScaleConstraint", "use_maximum_y", "use_max_y"),
+ ("LimitScaleConstraint", "use_maximum_z", "use_max_z"),
+ ("LimitScaleConstraint", "use_minimum_x", "use_min_x"),
+ ("LimitScaleConstraint", "use_minimum_y", "use_min_y"),
+ ("LimitScaleConstraint", "use_minimum_z", "use_min_z"),
+ ("LimitScaleConstraint", "limit_transform", "use_transform_limit"),
+ ("PivotConstraint", "enabled_rotation_range", "rotation_range"),
+ ("PivotConstraint", "use_relative_position", "use_relative_location"),
+ ("PythonConstraint", "number_of_targets", "target_count"),
+ ("SplineIKConstraint", "chain_length", "chain_count"),
+ ("SplineIKConstraint", "chain_offset", "use_chain_offset"),
+ ("SplineIKConstraint", "even_divisions", "use_even_divisions"),
+ ("SplineIKConstraint", "y_stretch", "use_y_stretch"),
+ ("SplineIKConstraint", "xz_scaling_mode", "xz_scale_mode"),
+ ("StretchToConstraint", "original_length", "rest_length"),
+ ("TrackToConstraint", "target_z", "use_target_z"),
+ ("TransformConstraint", "extrapolate_motion", "use_motion_extrapolate"),
+ ("FieldSettings", "do_location", "apply_to_location"),
+ ("FieldSettings", "do_rotation", "apply_to_rotation"),
+ ("FieldSettings", "maximum_distance", "distance_max"),
+ ("FieldSettings", "minimum_distance", "distance_min"),
+ ("FieldSettings", "radial_maximum", "radial_max"),
+ ("FieldSettings", "radial_minimum", "radial_min"),
+ ("FieldSettings", "force_2d", "use_2d_force"),
+ ("FieldSettings", "do_absorption", "use_absorption"),
+ ("FieldSettings", "global_coordinates", "use_global_coords"),
+ ("FieldSettings", "guide_path_add", "use_guide_path_add"),
+ ("FieldSettings", "multiple_springs", "use_multiple_springs"),
+ ("FieldSettings", "use_coordinates", "use_object_coords"),
+ ("FieldSettings", "root_coordinates", "use_root_coords"),
+ ("ControlFluidSettings", "reverse_frames", "use_reverse_frames"),
+ ("DomainFluidSettings", "real_world_size", "simulation_scale"),
+ ("DomainFluidSettings", "surface_smoothing", "surface_smooth"),
+ ("DomainFluidSettings", "reverse_frames", "use_reverse_frames"),
+ ("DomainFluidSettings", "generate_speed_vectors", "use_speed_vectors"),
+ ("DomainFluidSettings", "override_time", "use_time_override"),
+ ("FluidFluidSettings", "export_animated_mesh", "use_animated_mesh"),
+ ("InflowFluidSettings", "export_animated_mesh", "use_animated_mesh"),
+ ("InflowFluidSettings", "local_coordinates", "use_local_coords"),
+ ("ObstacleFluidSettings", "export_animated_mesh", "use_animated_mesh"),
+ ("OutflowFluidSettings", "export_animated_mesh", "use_animated_mesh"),
+ ("ParticleFluidSettings", "drops", "use_drops"),
+ ("ParticleFluidSettings", "floats", "use_floats"),
+ ("Armature", "drawtype", "draw_type"),
+ ("Armature", "layer_protection", "layers_protected"),
+ ("Armature", "auto_ik", "use_auto_ik"),
+ ("Armature", "delay_deform", "use_deform_delay"),
+ ("Armature", "deform_envelope", "use_deform_envelopes"),
+ ("Armature", "deform_quaternion", "use_deform_preserve_volume"),
+ ("Armature", "deform_vertexgroups", "use_deform_vertex_groups"),
+ ("Armature", "x_axis_mirror", "use_mirror_x"),
+ ("Curve", "width", "offset"),
+ ("Image", "animation_speed", "fps"),
+ ("Image", "animation_end", "frame_end"),
+ ("Image", "animation_start", "frame_start"),
+ ("Image", "animated", "use_animation"),
+ ("Image", "clamp_x", "use_clamp_x"),
+ ("Image", "clamp_y", "use_clamp_y"),
+ ("Image", "premultiply", "use_premultiply"),
+ ("AreaLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"),
+ ("AreaLamp", "only_shadow", "use_only_shadow"),
+ ("AreaLamp", "shadow_layer", "use_shadow_layer"),
+ ("AreaLamp", "umbra", "use_umbra"),
+ ("PointLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"),
+ ("PointLamp", "only_shadow", "use_only_shadow"),
+ ("PointLamp", "shadow_layer", "use_shadow_layer"),
+ ("PointLamp", "sphere", "use_sphere"),
+ ("SpotLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"),
+ ("SpotLamp", "auto_clip_end", "use_auto_clip_end"),
+ ("SpotLamp", "auto_clip_start", "use_auto_clip_start"),
+ ("SpotLamp", "only_shadow", "use_only_shadow"),
+ ("SpotLamp", "shadow_layer", "use_shadow_layer"),
+ ("SpotLamp", "sphere", "use_sphere"),
+ ("SunLamp", "only_shadow", "use_only_shadow"),
+ ("SunLamp", "shadow_layer", "use_shadow_layer"),
+ ("Material", "z_offset", "offset_z"),
+ ("Material", "shadow_casting_alpha", "shadow_cast_alpha"),
+ ("Material", "cast_approximate", "use_cast_approximate"),
+ ("Material", "cast_buffer_shadows", "use_cast_buffer_shadows"),
+ ("Material", "cast_shadows_only", "use_cast_shadows_only"),
+ ("Material", "face_texture", "use_face_texture"),
+ ("Material", "face_texture_alpha", "use_face_texture_alpha"),
+ ("Material", "full_oversampling", "use_full_oversampling"),
+ ("Material", "light_group_exclusive", "use_light_group_exclusive"),
+ ("Material", "object_color", "use_object_color"),
+ ("Material", "only_shadow", "use_only_shadow"),
+ ("Material", "ray_shadow_bias", "use_ray_shadow_bias"),
+ ("Material", "traceable", "use_raytrace"),
+ ("Material", "shadeless", "use_shadeless"),
+ ("Material", "tangent_shading", "use_tangent_shading"),
+ ("Material", "transparency", "use_transparency"),
+ ("Material", "receive_transparent_shadows", "use_transparent_shadows"),
+ ("Material", "vertex_color_light", "use_vertex_color_light"),
+ ("Material", "vertex_color_paint", "use_vertex_color_paint"),
+ ("Mesh", "autosmooth_angle", "auto_smooth_angle"),
+ ("Mesh", "autosmooth", "use_auto_smooth"),
+ ("Object", "max_draw_type", "draw_type"),
+ ("Object", "use_dupli_verts_rotation", "use_dupli_vertices_rotation"),
+ ("Object", "shape_key_edit_mode", "use_shape_key_edit_mode"),
+ ("Object", "slow_parent", "use_slow_parent"),
+ ("Object", "time_offset_add_parent", "use_time_offset_add_parent"),
+ ("Object", "time_offset_edit", "use_time_offset_edit"),
+ ("Object", "time_offset_parent", "use_time_offset_parent"),
+ ("Object", "time_offset_particle", "use_time_offset_particle"),
+ ("ParticleSettings", "adaptive_pix", "adaptive_pixel"),
+ ("ParticleSettings", "child_effector", "apply_effector_to_children"),
+ ("ParticleSettings", "child_guide", "apply_guide_to_children"),
+ ("ParticleSettings", "billboard_split_offset", "billboard_offset_split"),
+ ("ParticleSettings", "billboard_random_tilt", "billboard_tilt_random"),
+ ("ParticleSettings", "child_length_thres", "child_length_threshold"),
+ ("ParticleSettings", "child_random_size", "child_size_random"),
+ ("ParticleSettings", "clumppow", "clump_shape"),
+ ("ParticleSettings", "damp_factor", "damping"),
+ ("ParticleSettings", "draw_as", "draw_method"),
+ ("ParticleSettings", "random_factor", "factor_random"),
+ ("ParticleSettings", "grid_invert", "invert_grid"),
+ ("ParticleSettings", "random_length", "length_random"),
+ ("ParticleSettings", "random_lifetime", "lifetime_random"),
+ ("ParticleSettings", "billboard_lock", "lock_billboard"),
+ ("ParticleSettings", "boids_2d", "lock_boids_to_surface"),
+ ("ParticleSettings", "object_aligned_factor", "object_align_factor"),
+ ("ParticleSettings", "random_phase_factor", "phase_factor_random"),
+ ("ParticleSettings", "ren_as", "render_type"),
+ ("ParticleSettings", "rendered_child_nbr", "rendered_child_count"),
+ ("ParticleSettings", "random_rotation_factor", "rotation_factor_random"),
+ ("ParticleSettings", "rough1", "roughness_1"),
+ ("ParticleSettings", "rough1_size", "roughness_1_size"),
+ ("ParticleSettings", "rough2", "roughness_2"),
+ ("ParticleSettings", "rough2_size", "roughness_2_size"),
+ ("ParticleSettings", "rough2_thres", "roughness_2_threshold"),
+ ("ParticleSettings", "rough_end_shape", "roughness_end_shape"),
+ ("ParticleSettings", "rough_endpoint", "roughness_endpoint"),
+ ("ParticleSettings", "random_size", "size_random"),
+ ("ParticleSettings", "abs_path_time", "use_absolute_path_time"),
+ ("ParticleSettings", "animate_branching", "use_animate_branching"),
+ ("ParticleSettings", "branching", "use_branching"),
+ ("ParticleSettings", "died", "use_dead"),
+ ("ParticleSettings", "die_on_collision", "use_die_on_collision"),
+ ("ParticleSettings", "rotation_dynamic", "use_dynamic_rotation"),
+ ("ParticleSettings", "even_distribution", "use_even_distribution"),
+ ("ParticleSettings", "rand_group", "use_group_pick_random"),
+ ("ParticleSettings", "hair_bspline", "use_hair_bspline"),
+ ("ParticleSettings", "sizemass", "use_multiply_size_mass"),
+ ("ParticleSettings", "react_multiple", "use_react_multiple"),
+ ("ParticleSettings", "react_start_end", "use_react_start_end"),
+ ("ParticleSettings", "render_adaptive", "use_render_adaptive"),
+ ("ParticleSettings", "self_effect", "use_self_effect"),
+ ("ParticleSettings", "enable_simplify", "use_simplify"),
+ ("ParticleSettings", "size_deflect", "use_size_deflect"),
+ ("ParticleSettings", "render_strand", "use_strand_primitive"),
+ ("ParticleSettings", "symmetric_branching", "use_symmetric_branching"),
+ ("ParticleSettings", "velocity_length", "use_velocity_length"),
+ ("ParticleSettings", "whole_group", "use_whole_group"),
+ ("CloudsTexture", "noise_size", "noise_scale"),
+ ("DistortedNoiseTexture", "noise_size", "noise_scale"),
+ ("EnvironmentMapTexture", "filter_size_minimum", "use_filter_size_min"),
+ ("EnvironmentMapTexture", "mipmap_gauss", "use_mipmap_gauss"),
+ ("ImageTexture", "calculate_alpha", "use_calculate_alpha"),
+ ("ImageTexture", "checker_even", "use_checker_even"),
+ ("ImageTexture", "checker_odd", "use_checker_odd"),
+ ("ImageTexture", "filter_size_minimum", "use_filter_size_min"),
+ ("ImageTexture", "flip_axis", "use_flip_axis"),
+ ("ImageTexture", "mipmap_gauss", "use_mipmap_gauss"),
+ ("ImageTexture", "mirror_x", "use_mirror_x"),
+ ("ImageTexture", "mirror_y", "use_mirror_y"),
+ ("ImageTexture", "normal_map", "use_normal_map"),
+ ("MarbleTexture", "noise_size", "noise_scale"),
+ ("MarbleTexture", "noisebasis2", "noise_basis_2"),
+ ("MarbleTexture", "noisebasis_2", "noise_basis_2"),
+ ("MusgraveTexture", "highest_dimension", "dimension_max"),
+ ("MusgraveTexture", "noise_size", "noise_scale"),
+ ("StucciTexture", "noise_size", "noise_scale"),
+ ("VoronoiTexture", "coloring", "color_mode"),
+ ("VoronoiTexture", "noise_size", "noise_scale"),
+ ("WoodTexture", "noise_size", "noise_scale"),
+ ("WoodTexture", "noisebasis2", "noise_basis_2"),
+ ("WoodTexture", "noisebasis_2", "noise_basis_2"),
+ ("World", "blend_sky", "use_sky_blend"),
+ ("World", "paper_sky", "use_sky_paper"),
+ ("World", "real_sky", "use_sky_real"),
+ ("ImageUser", "auto_refresh", "use_auto_refresh"),
+ ("MaterialHalo", "flares_sub", "flare_subflare_count"),
+ ("MaterialHalo", "flare_subsize", "flare_subflare_size"),
+ ("MaterialHalo", "line_number", "line_count"),
+ ("MaterialHalo", "rings", "ring_count"),
+ ("MaterialHalo", "star_tips", "star_tip_count"),
+ ("MaterialHalo", "xalpha", "use_extreme_alpha"),
+ ("MaterialHalo", "flare_mode", "use_flare_mode"),
+ ("MaterialHalo", "vertex_normal", "use_vertex_normal"),
+ ("MaterialPhysics", "align_to_normal", "use_normal_align"),
+ ("MaterialStrand", "min_size", "size_min"),
+ ("MaterialStrand", "blender_units", "use_blender_units"),
+ ("MaterialStrand", "surface_diffuse", "use_surface_diffuse"),
+ ("MaterialStrand", "tangent_shading", "use_tangent_shading"),
+ ("MaterialSubsurfaceScattering", "error_tolerance", "error_threshold"),
+ ("MaterialVolume", "depth_cutoff", "depth_threshold"),
+ ("MaterialVolume", "lighting_mode", "light_method"),
+ ("MaterialVolume", "step_calculation", "step_method"),
+ ("MaterialVolume", "external_shadows", "use_external_shadows"),
+ ("MaterialVolume", "light_cache", "use_light_cache"),
+ ("ArmatureModifier", "multi_modifier", "use_multi_modifier"),
+ ("ArrayModifier", "constant_offset_displacement", "constant_offset_displace"),
+ ("ArrayModifier", "merge_distance", "merge_threshold"),
+ ("ArrayModifier", "relative_offset_displacement", "relative_offset_displace"),
+ ("ArrayModifier", "constant_offset", "use_constant_offset"),
+ ("ArrayModifier", "merge_adjacent_vertices", "use_merge_vertices"),
+ ("ArrayModifier", "merge_end_vertices", "use_merge_vertices_cap"),
+ ("ArrayModifier", "add_offset_object", "use_object_offset"),
+ ("ArrayModifier", "relative_offset", "use_relative_offset"),
+ ("BevelModifier", "only_vertices", "use_only_vertices"),
+ ("CastModifier", "from_radius", "use_radius_as_size"),
+ ("DisplaceModifier", "midlevel", "mid_level"),
+ ("DisplaceModifier", "texture_coordinates", "texture_coords"),
+ ("EdgeSplitModifier", "use_sharp", "use_edge_sharp"),
+ ("ExplodeModifier", "split_edges", "use_edge_split"),
+ ("MirrorModifier", "merge_limit", "merge_threshold"),
+ ("MirrorModifier", "mirror_u", "use_mirror_u"),
+ ("MirrorModifier", "mirror_v", "use_mirror_v"),
+ ("MirrorModifier", "mirror_vertex_groups", "use_mirror_vertex_groups"),
+ ("ParticleInstanceModifier", "particle_system_number", "particle_system_index"),
+ ("ParticleInstanceModifier", "keep_shape", "use_preserve_shape"),
+ ("ShrinkwrapModifier", "cull_back_faces", "use_cull_back_faces"),
+ ("ShrinkwrapModifier", "cull_front_faces", "use_cull_front_faces"),
+ ("ShrinkwrapModifier", "keep_above_surface", "use_keep_above_surface"),
+ ("SimpleDeformModifier", "lock_x_axis", "lock_x"),
+ ("SimpleDeformModifier", "lock_y_axis", "lock_y"),
+ ("SmokeModifier", "smoke_type", "type"),
+ ("SubsurfModifier", "subsurf_uv", "use_subsurf_uv"),
+ ("UVProjectModifier", "num_projectors", "projector_count"),
+ ("UVProjectModifier", "override_image", "use_image_override"),
+ ("WaveModifier", "texture_coordinates", "texture_coords"),
+ ("WaveModifier", "x_normal", "use_normal_x"),
+ ("WaveModifier", "y_normal", "use_normal_y"),
+ ("WaveModifier", "z_normal", "use_normal_z"),
+ ("NlaStrip", "blending", "blend_type"),
+ ("NlaStrip", "animated_influence", "use_animated_influence"),
+ ("NlaStrip", "animated_time", "use_animated_time"),
+ ("NlaStrip", "animated_time_cyclic", "use_animated_time_cyclic"),
+ ("NlaStrip", "auto_blending", "use_auto_blend"),
+ ("CompositorNodeAlphaOver", "convert_premul", "use_premultiply"),
+ ("CompositorNodeBlur", "sizex", "size_x"),
+ ("CompositorNodeBlur", "sizey", "size_y"),
+ ("CompositorNodeChannelMatte", "algorithm", "limit_method"),
+ ("CompositorNodeChromaMatte", "acceptance", "tolerance"),
+ ("CompositorNodeColorBalance", "correction_formula", "correction_method"),
+ ("CompositorNodeColorSpill", "algorithm", "limit_method"),
+ ("CompositorNodeColorSpill", "unspill", "use_unspill"),
+ ("CompositorNodeCrop", "x2", "max_x"),
+ ("CompositorNodeCrop", "y2", "max_y"),
+ ("CompositorNodeCrop", "x1", "min_x"),
+ ("CompositorNodeCrop", "y1", "min_y"),
+ ("CompositorNodeCrop", "crop_size", "use_crop_size"),
+ ("CompositorNodeDefocus", "max_blur", "blur_max"),
+ ("CompositorNodeDefocus", "gamma_correction", "use_gamma_correction"),
+ ("CompositorNodeGlare", "rotate_45", "use_rotate_45"),
+ ("CompositorNodeImage", "auto_refresh", "use_auto_refresh"),
+ ("CompositorNodeLensdist", "projector", "use_projector"),
+ ("CompositorNodeVecBlur", "max_speed", "speed_max"),
+ ("CompositorNodeVecBlur", "min_speed", "speed_min"),
+ ("ShaderNodeMapping", "maximum", "max"),
+ ("ShaderNodeMapping", "minimum", "min"),
+ ("ShaderNodeMapping", "clamp_maximum", "use_max"),
+ ("ShaderNodeMapping", "clamp_minimum", "use_min"),
+ ("VertexPaint", "all_faces", "use_all_faces"),
+ ("VertexPaint", "spray", "use_spray"),
+ ("ParticleEdit", "add_keys", "default_key_count"),
+ ("ParticleEdit", "selection_mode", "select_mode"),
+ ("ParticleEdit", "auto_velocity", "use_auto_velocity"),
+ ("ParticleEdit", "add_interpolate", "use_default_interpolate"),
+ ("ParticleEdit", "emitter_deflect", "use_emitter_deflect"),
+ ("ParticleEdit", "fade_time", "use_fade_time"),
+ ("ParticleEdit", "keep_lengths", "use_preserve_length"),
+ ("ParticleEdit", "keep_root", "use_preserve_root"),
+ ("ParticleSystem", "vertex_group_clump_negate", "invert_vertex_group_clump"),
+ ("ParticleSystem", "vertex_group_density_negate", "invert_vertex_group_density"),
+ ("ParticleSystem", "vertex_group_field_negate", "invert_vertex_group_field"),
+ ("ParticleSystem", "vertex_group_kink_negate", "invert_vertex_group_kink"),
+ ("ParticleSystem", "vertex_group_length_negate", "invert_vertex_group_length"),
+ ("ParticleSystem", "vertex_group_rotation_negate", "invert_vertex_group_rotation"),
+ ("ParticleSystem", "vertex_group_roughness1_negate", "invert_vertex_group_roughness_1"),
+ ("ParticleSystem", "vertex_group_roughness2_negate", "invert_vertex_group_roughness_2"),
+ ("ParticleSystem", "vertex_group_roughness_end_negate", "invert_vertex_group_roughness_end"),
+ ("ParticleSystem", "vertex_group_size_negate", "invert_vertex_group_size"),
+ ("ParticleSystem", "vertex_group_tangent_negate", "invert_vertex_group_tangent"),
+ ("ParticleSystem", "vertex_group_velocity_negate", "invert_vertex_group_velocity"),
+ ("ParticleSystem", "hair_dynamics", "use_hair_dynamics"),
+ ("ParticleSystem", "keyed_timing", "use_keyed_timing"),
+ ("PointDensity", "falloff_softness", "falloff_soft"),
+ ("PointDensity", "particle_cache", "particle_cache_space"),
+ ("PointDensity", "turbulence_size", "turbulence_scale"),
+ ("PointDensity", "turbulence", "use_turbulence"),
+ ("PointDensity", "vertices_cache", "vertex_cache_space"),
+ ("PoseBone", "ik_lin_weight", "ik_linear_weight"),
+ ("PoseBone", "ik_rot_weight", "ik_rotation_weight"),
+ ("PoseBone", "ik_limit_x", "use_ik_limit_x"),
+ ("PoseBone", "ik_limit_y", "use_ik_limit_y"),
+ ("PoseBone", "ik_limit_z", "use_ik_limit_z"),
+ ("PoseBone", "ik_lin_control", "use_ik_linear_control"),
+ ("PoseBone", "ik_rot_control", "use_ik_rotation_control"),
+ ("Bone", "use_hinge", "use_inherit_rotation"),
+ ("SPHFluidSettings", "spring_k", "spring_force"),
+ ("SPHFluidSettings", "stiffness_k", "stiffness"),
+ ("SPHFluidSettings", "stiffness_knear", "stiffness_near"),
+ ("SceneGameData", "framing_color", "frame_color"),
+ ("SceneGameData", "framing_type", "frame_type"),
+ ("SceneGameData", "eye_separation", "stereo_eye_separation"),
+ ("SceneGameData", "activity_culling", "use_activity_culling"),
+ ("SceneGameData", "auto_start", "use_auto_start"),
+ ("SceneGameData", "glsl_extra_textures", "use_glsl_extra_textures"),
+ ("SceneGameData", "glsl_lights", "use_glsl_lights"),
+ ("SceneGameData", "glsl_nodes", "use_glsl_nodes"),
+ ("SceneGameData", "glsl_ramps", "use_glsl_ramps"),
+ ("SceneGameData", "glsl_shaders", "use_glsl_shaders"),
+ ("SceneGameData", "glsl_shadows", "use_glsl_shadows"),
+ ("Sequence", "blend_opacity", "blend_alpha"),
+ ("Sequence", "blend_mode", "blend_type"),
+ ("Sequence", "frame_final_length", "frame_final_duration"),
+ ("Sequence", "use_effect_default_fade", "use_default_fade"),
+ ("SequenceColorBalance", "inverse_gain", "invert_gain"),
+ ("SequenceColorBalance", "inverse_gamma", "invert_gamma"),
+ ("SequenceColorBalance", "inverse_lift", "invert_lift"),
+ ("EffectSequence", "multiply_colors", "color_multiply"),
+ ("EffectSequence", "de_interlace", "use_deinterlace"),
+ ("EffectSequence", "flip_x", "use_flip_x"),
+ ("EffectSequence", "flip_y", "use_flip_y"),
+ ("EffectSequence", "convert_float", "use_float"),
+ ("EffectSequence", "premultiply", "use_premultiply"),
+ ("EffectSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
+ ("EffectSequence", "proxy_custom_file", "use_proxy_custom_file"),
+ ("EffectSequence", "reverse_frames", "use_reverse_frames"),
+ ("GlowSequence", "blur_distance", "blur_radius"),
+ ("GlowSequence", "only_boost", "use_only_boost"),
+ ("SpeedControlSequence", "curve_compress_y", "use_curve_compress_y"),
+ ("SpeedControlSequence", "curve_velocity", "use_curve_velocity"),
+ ("SpeedControlSequence", "frame_blending", "use_frame_blend"),
+ ("TransformSequence", "uniform_scale", "use_uniform_scale"),
+ ("ImageSequence", "animation_end_offset", "animation_offset_end"),
+ ("ImageSequence", "animation_start_offset", "animation_offset_start"),
+ ("ImageSequence", "multiply_colors", "color_multiply"),
+ ("ImageSequence", "de_interlace", "use_deinterlace"),
+ ("ImageSequence", "flip_x", "use_flip_x"),
+ ("ImageSequence", "flip_y", "use_flip_y"),
+ ("ImageSequence", "convert_float", "use_float"),
+ ("ImageSequence", "premultiply", "use_premultiply"),
+ ("ImageSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
+ ("ImageSequence", "proxy_custom_file", "use_proxy_custom_file"),
+ ("ImageSequence", "reverse_frames", "use_reverse_frames"),
+ ("MetaSequence", "animation_end_offset", "animation_offset_end"),
+ ("MetaSequence", "animation_start_offset", "animation_offset_start"),
+ ("MetaSequence", "multiply_colors", "color_multiply"),
+ ("MetaSequence", "de_interlace", "use_deinterlace"),
+ ("MetaSequence", "flip_x", "use_flip_x"),
+ ("MetaSequence", "flip_y", "use_flip_y"),
+ ("MetaSequence", "convert_float", "use_float"),
+ ("MetaSequence", "premultiply", "use_premultiply"),
+ ("MetaSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
+ ("MetaSequence", "proxy_custom_file", "use_proxy_custom_file"),
+ ("MetaSequence", "reverse_frames", "use_reverse_frames"),
+ ("MovieSequence", "animation_end_offset", "animation_offset_end"),
+ ("MovieSequence", "animation_start_offset", "animation_offset_start"),
+ ("MovieSequence", "multiply_colors", "color_multiply"),
+ ("MovieSequence", "de_interlace", "use_deinterlace"),
+ ("MovieSequence", "flip_x", "use_flip_x"),
+ ("MovieSequence", "flip_y", "use_flip_y"),
+ ("MovieSequence", "convert_float", "use_float"),
+ ("MovieSequence", "premultiply", "use_premultiply"),
+ ("MovieSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
+ ("MovieSequence", "proxy_custom_file", "use_proxy_custom_file"),
+ ("MovieSequence", "reverse_frames", "use_reverse_frames"),
+ ("MulticamSequence", "animation_end_offset", "animation_offset_end"),
+ ("MulticamSequence", "animation_start_offset", "animation_offset_start"),
+ ("MulticamSequence", "multiply_colors", "color_multiply"),
+ ("MulticamSequence", "de_interlace", "use_deinterlace"),
+ ("MulticamSequence", "flip_x", "use_flip_x"),
+ ("MulticamSequence", "flip_y", "use_flip_y"),
+ ("MulticamSequence", "convert_float", "use_float"),
+ ("MulticamSequence", "premultiply", "use_premultiply"),
+ ("MulticamSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
+ ("MulticamSequence", "proxy_custom_file", "use_proxy_custom_file"),
+ ("MulticamSequence", "reverse_frames", "use_reverse_frames"),
+ ("SceneSequence", "animation_end_offset", "animation_offset_end"),
+ ("SceneSequence", "animation_start_offset", "animation_offset_start"),
+ ("SceneSequence", "multiply_colors", "color_multiply"),
+ ("SceneSequence", "de_interlace", "use_deinterlace"),
+ ("SceneSequence", "flip_x", "use_flip_x"),
+ ("SceneSequence", "flip_y", "use_flip_y"),
+ ("SceneSequence", "convert_float", "use_float"),
+ ("SceneSequence", "premultiply", "use_premultiply"),
+ ("SceneSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
+ ("SceneSequence", "proxy_custom_file", "use_proxy_custom_file"),
+ ("SceneSequence", "reverse_frames", "use_reverse_frames"),
+ ("SoundSequence", "animation_end_offset", "animation_offset_end"),
+ ("SoundSequence", "animation_start_offset", "animation_offset_start"),
+ ("SmokeDomainSettings", "smoke_domain_colli", "collision_extents"),
+ ("SmokeDomainSettings", "smoke_cache_high_comp", "point_cache_compress_high_type"),
+ ("SmokeDomainSettings", "smoke_cache_comp", "point_cache_compress_type"),
+ ("SmokeDomainSettings", "maxres", "resolution_max"),
+ ("SmokeDomainSettings", "smoothemitter", "smooth_emitter"),
+ ("SmokeDomainSettings", "dissolve_smoke", "use_dissolve_smoke"),
+ ("SmokeDomainSettings", "dissolve_smoke_log", "use_dissolve_smoke_log"),
+ ("SmokeDomainSettings", "highres", "use_high_resolution"),
+ ("SoftBodySettings", "bending", "bend"),
+ ("SoftBodySettings", "error_limit", "error_threshold"),
+ ("SoftBodySettings", "lcom", "location_mass_center"),
+ ("SoftBodySettings", "lrot", "rotation_estimate"),
+ ("SoftBodySettings", "lscale", "scale_estimate"),
+ ("SoftBodySettings", "maxstep", "step_max"),
+ ("SoftBodySettings", "minstep", "step_min"),
+ ("SoftBodySettings", "diagnose", "use_diagnose"),
+ ("SoftBodySettings", "edge_collision", "use_edge_collision"),
+ ("SoftBodySettings", "estimate_matrix", "use_estimate_matrix"),
+ ("SoftBodySettings", "face_collision", "use_face_collision"),
+ ("SoftBodySettings", "self_collision", "use_self_collision"),
+ ("SoftBodySettings", "stiff_quads", "use_stiff_quads"),
+ ("TexMapping", "maximum", "max"),
+ ("TexMapping", "minimum", "min"),
+ ("TexMapping", "has_maximum", "use_max"),
+ ("TexMapping", "has_minimum", "use_min"),
+ ("TextCharacterFormat", "bold", "use_bold"),
+ ("TextCharacterFormat", "italic", "use_italic"),
+ ("TextCharacterFormat", "underline", "use_underline"),
+ ("TextureSlot", "rgb_to_intensity", "use_rgb_to_intensity"),
+ ("TextureSlot", "stencil", "use_stencil"),
+ ("LampTextureSlot", "texture_coordinates", "texture_coords"),
+ ("LampTextureSlot", "map_color", "use_map_color"),
+ ("LampTextureSlot", "map_shadow", "use_map_shadow"),
+ ("MaterialTextureSlot", "coloremission_factor", "color_emission_factor"),
+ ("MaterialTextureSlot", "colordiff_factor", "diffuse_color_factor"),
+ ("MaterialTextureSlot", "x_mapping", "mapping_x"),
+ ("MaterialTextureSlot", "y_mapping", "mapping_y"),
+ ("MaterialTextureSlot", "z_mapping", "mapping_z"),
+ ("MaterialTextureSlot", "colorreflection_factor", "reflection_color_factor"),
+ ("MaterialTextureSlot", "colorspec_factor", "specular_color_factor"),
+ ("MaterialTextureSlot", "texture_coordinates", "texture_coords"),
+ ("MaterialTextureSlot", "colortransmission_factor", "transmission_color_factor"),
+ ("MaterialTextureSlot", "from_dupli", "use_from_dupli"),
+ ("MaterialTextureSlot", "from_original", "use_from_original"),
+ ("MaterialTextureSlot", "map_alpha", "use_map_alpha"),
+ ("MaterialTextureSlot", "map_ambient", "use_map_ambient"),
+ ("MaterialTextureSlot", "map_colordiff", "use_map_color_diff"),
+ ("MaterialTextureSlot", "map_coloremission", "use_map_color_emission"),
+ ("MaterialTextureSlot", "map_colorreflection", "use_map_color_reflection"),
+ ("MaterialTextureSlot", "map_colorspec", "use_map_color_spec"),
+ ("MaterialTextureSlot", "map_colortransmission", "use_map_color_transmission"),
+ ("MaterialTextureSlot", "map_density", "use_map_density"),
+ ("MaterialTextureSlot", "map_diffuse", "use_map_diffuse"),
+ ("MaterialTextureSlot", "map_displacement", "use_map_displacement"),
+ ("MaterialTextureSlot", "map_emission", "use_map_emission"),
+ ("MaterialTextureSlot", "map_emit", "use_map_emit"),
+ ("MaterialTextureSlot", "map_hardness", "use_map_hardness"),
+ ("MaterialTextureSlot", "map_mirror", "use_map_mirror"),
+ ("MaterialTextureSlot", "map_normal", "use_map_normal"),
+ ("MaterialTextureSlot", "map_raymir", "use_map_raymir"),
+ ("MaterialTextureSlot", "map_reflection", "use_map_reflect"),
+ ("MaterialTextureSlot", "map_scattering", "use_map_scatter"),
+ ("MaterialTextureSlot", "map_specular", "use_map_specular"),
+ ("MaterialTextureSlot", "map_translucency", "use_map_translucency"),
+ ("MaterialTextureSlot", "map_warp", "use_map_warp"),
+ ("WorldTextureSlot", "texture_coordinates", "texture_coords"),
+ ("WorldTextureSlot", "map_blend", "use_map_blend"),
+ ("WorldTextureSlot", "map_horizon", "use_map_horizon"),
+ ("WorldTextureSlot", "map_zenith_down", "use_map_zenith_down"),
+ ("WorldTextureSlot", "map_zenith_up", "use_map_zenith_up"),
+ ("VoxelData", "still_frame_number", "still_frame"),
+ ("WorldLighting", "ao_blend_mode", "ao_blend_type"),
+ ("WorldLighting", "error_tolerance", "error_threshold"),
+ ("WorldLighting", "use_ambient_occlusion", "use_ambient_occlusian"),
+ ("WorldLighting", "pixel_cache", "use_cache"),
+ ("WorldLighting", "use_environment_lighting", "use_environment_light"),
+ ("WorldLighting", "use_indirect_lighting", "use_indirect_light"),
+ ("WorldStarsSettings", "color_randomization", "color_random"),
+ ("WorldStarsSettings", "min_distance", "distance_min"),
+ ("WorldLighting", "falloff", "use_falloff"),
+ ("Constraint", "disabled", "is_valid"),
+ ("ClampToConstraint", "cyclic", "use_cyclic"),
+ ("ImageTexture", "filter", "filter_type"),
+ ("ImageTexture", "interpolation", "use_interpolation"),
+ ("ImageTexture", "mipmap", "use_mipmap"),
+ ("ImageUser", "frames", "frame_duration"),
+ ("ImageUser", "offset", "frame_offset"),
+ ("ImageUser", "cyclic", "use_cyclic"),
+ ("ArmatureModifier", "invert", "invert_vertex_group"),
+ ("ArmatureModifier", "quaternion", "use_deform_preserve_volume"),
+ ("ArrayModifier", "length", "fit_length"),
+ ("BevelModifier", "angle", "angle_limit"),
+ ("BuildModifier", "length", "frame_duration"),
+ ("BuildModifier", "randomize", "use_random_order"),
+ ("CastModifier", "x", "use_x"),
+ ("CastModifier", "y", "use_y"),
+ ("CastModifier", "z", "use_z"),
+ ("ExplodeModifier", "size", "use_size"),
+ ("MaskModifier", "invert", "invert_vertex_group"),
+ ("MeshDeformModifier", "invert", "invert_vertex_group"),
+ ("MeshDeformModifier", "dynamic", "use_dynamic_bind"),
+ ("MirrorModifier", "clip", "use_clip"),
+ ("MirrorModifier", "x", "use_x"),
+ ("MirrorModifier", "y", "use_y"),
+ ("MirrorModifier", "z", "use_z"),
+ ("ParticleInstanceModifier", "children", "use_children"),
+ ("ParticleInstanceModifier", "normal", "use_normal"),
+ ("ParticleInstanceModifier", "size", "use_size"),
+ ("ShrinkwrapModifier", "negative", "use_negative_direction"),
+ ("ShrinkwrapModifier", "positive", "use_positive_direction"),
+ ("ShrinkwrapModifier", "x", "use_project_x"),
+ ("ShrinkwrapModifier", "y", "use_project_y"),
+ ("ShrinkwrapModifier", "z", "use_project_z"),
+ ("ShrinkwrapModifier", "mode", "wrap_method"),
+ ("SimpleDeformModifier", "mode", "deform_method"),
+ ("SimpleDeformModifier", "relative", "use_relative"),
+ ("SmoothModifier", "repeat", "iterations"),
+ ("SmoothModifier", "x", "use_x"),
+ ("SmoothModifier", "y", "use_y"),
+ ("SmoothModifier", "z", "use_z"),
+ ("SolidifyModifier", "invert", "invert_vertex_group"),
+ ("WaveModifier", "cyclic", "use_cyclic"),
+ ("WaveModifier", "normals", "use_normal"),
+ ("WaveModifier", "x", "use_x"),
+ ("WaveModifier", "y", "use_y"),
+ ("DampedTrackConstraint", "track", "track_axis"),
+ ("FloorConstraint", "sticky", "use_sticky"),
+ ("FollowPathConstraint", "forward", "forward_axis"),
+ ("FollowPathConstraint", "up", "up_axis"),
+ ("LockedTrackConstraint", "lock", "lock_axis"),
+ ("LockedTrackConstraint", "track", "track_axis"),
+ ("MaintainVolumeConstraint", "axis", "free_axis"),
+ ("TrackToConstraint", "track", "track_axis"),
+ ("TrackToConstraint", "up", "up_axis"),
+ ("GameProperty", "debug", "show_debug"),
+ ("Image", "tiles", "use_tiles"),
+ ("Lamp", "diffuse", "use_diffuse"),
+ ("Lamp", "negative", "use_negative"),
+ ("Lamp", "layer", "use_own_layer"),
+ ("Lamp", "specular", "use_specular"),
+ ("AreaLamp", "dither", "use_dither"),
+ ("AreaLamp", "jitter", "use_jitter"),
+ ("SpotLamp", "square", "use_square"),
+ ("Material", "cubic", "use_cubic"),
+ ("Material", "shadows", "use_shadows"),
+ ("ParticleSettings", "amount", "count"),
+ ("ParticleSettings", "display", "draw_percentage"),
+ ("ParticleSettings", "velocity", "show_velocity"),
+ ("ParticleSettings", "trand", "use_emit_random"),
+ ("ParticleSettings", "parent", "use_parent_particles"),
+ ("ParticleSettings", "emitter", "use_render_emitter"),
+ ("ParticleSettings", "viewport", "use_simplify_viewport"),
+ ("Texture", "brightness", "intensity"),
+ ("CloudsTexture", "stype", "cloud_type"),
+ ("EnvironmentMapTexture", "filter", "filter_type"),
+ ("EnvironmentMapTexture", "mipmap", "use_mipmap"),
+ ("MarbleTexture", "stype", "marble_type"),
+ ("StucciTexture", "stype", "stucci_type"),
+ ("WoodTexture", "stype", "wood_type"),
+ ("World", "range", "color_range"),
+ ("World", "lighting", "light_settings"),
+ ("World", "mist", "mist_settings"),
+ ("World", "stars", "star_settings"),
+ ("MaterialHalo", "lines", "use_lines"),
+ ("MaterialHalo", "ring", "use_ring"),
+ ("MaterialHalo", "soft", "use_soft"),
+ ("MaterialHalo", "star", "use_star"),
+ ("MaterialHalo", "texture", "use_texture"),
+ ("MaterialPhysics", "damp", "damping"),
+ ("MaterialRaytraceTransparency", "limit", "depth_max"),
+ ("NlaStrip", "reversed", "use_reverse"),
+ ("CompositorNodeBlur", "bokeh", "use_bokeh"),
+ ("CompositorNodeBlur", "gamma", "use_gamma_correction"),
+ ("CompositorNodeBlur", "relative", "use_relative"),
+ ("CompositorNodeChannelMatte", "high", "limit_max"),
+ ("CompositorNodeChannelMatte", "low", "limit_min"),
+ ("CompositorNodeChannelMatte", "channel", "matte_channel"),
+ ("CompositorNodeChromaMatte", "cutoff", "threshold"),
+ ("CompositorNodeColorMatte", "h", "color_hue"),
+ ("CompositorNodeColorMatte", "s", "color_saturation"),
+ ("CompositorNodeColorMatte", "v", "color_value"),
+ ("CompositorNodeDBlur", "wrap", "use_wrap"),
+ ("CompositorNodeDefocus", "preview", "use_preview"),
+ ("CompositorNodeHueSat", "hue", "color_hue"),
+ ("CompositorNodeHueSat", "sat", "color_saturation"),
+ ("CompositorNodeHueSat", "val", "color_value"),
+ ("CompositorNodeImage", "frames", "frame_duration"),
+ ("CompositorNodeImage", "offset", "frame_offset"),
+ ("CompositorNodeImage", "start", "frame_start"),
+ ("CompositorNodeImage", "cyclic", "use_cyclic"),
+ ("CompositorNodeInvert", "alpha", "invert_alpha"),
+ ("CompositorNodeInvert", "rgb", "invert_rgb"),
+ ("CompositorNodeLensdist", "fit", "use_fit"),
+ ("CompositorNodeLensdist", "jitter", "use_jitter"),
+ ("CompositorNodeMixRGB", "alpha", "use_alpha"),
+ ("CompositorNodeRotate", "filter", "filter_type"),
+ ("CompositorNodeTime", "end", "frame_end"),
+ ("CompositorNodeTime", "start", "frame_start"),
+ ("CompositorNodeVecBlur", "curved", "use_curved"),
+ ("ShaderNodeExtendedMaterial", "diffuse", "use_diffuse"),
+ ("ShaderNodeExtendedMaterial", "specular", "use_specular"),
+ ("ShaderNodeMaterial", "diffuse", "use_diffuse"),
+ ("ShaderNodeMaterial", "specular", "use_specular"),
+ ("ShaderNodeMixRGB", "alpha", "use_alpha"),
+ ("TextureNodeCurveTime", "end", "frame_end"),
+ ("TextureNodeCurveTime", "start", "frame_start"),
+ ("TextureNodeMixRGB", "alpha", "use_alpha"),
+ ("TextureSlot", "negate", "invert"),
+ ("TextureSlot", "size", "scale"),
+ ("SoftBodySettings", "damp", "damping"),
+ ("SequenceCrop", "right", "max_x"),
+ ("SequenceCrop", "top", "max_y"),
+ ("SequenceCrop", "bottom", "min_x"),
+ ("SequenceCrop", "left", "min_y"),
+ ("Sequence", "speed_fader", "speed_factor"),
+ ("SpeedControlSequence", "global_speed", "multiply_speed"),
+ ("SpeedControlSequence", "use_curve_velocity", "use_as_speed"),
+ ("SpeedControlSequence", "use_curve_compress_y", "scale_to_length"),
+ ("Key", "keys", "key_blocks"),
+ )
+
+
if __name__ == "__main__":
# Example, should be called externally
diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py
index 64c5a1a5f5f..ba9f6dafd19 100644
--- a/release/scripts/modules/bpy/ops.py
+++ b/release/scripts/modules/bpy/ops.py
@@ -27,6 +27,7 @@ op_poll = ops_module.poll
op_call = ops_module.call
op_as_string = ops_module.as_string
op_get_rna = ops_module.get_rna
+op_get_instance = ops_module.get_instance
class BPyOps(object):
@@ -184,11 +185,13 @@ class BPyOpsSubModOp(object):
return ret
def get_rna(self):
- '''
- currently only used for 'bl_rna'
- '''
+ """Internal function for introspection"""
return op_get_rna(self.idname())
+ def get_instance(self):
+ """Internal function for introspection"""
+ return op_get_instance(self.idname())
+
def __repr__(self): # useful display, repr(op)
import bpy
idname = self.idname()
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index 284fef97795..e6d0fbb99a2 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -40,7 +40,7 @@ import bpy as _bpy
import os as _os
-def abspath(path, start=None):
+def abspath(path, start=None, library=None):
"""
Returns the absolute path relative to the current blend file
using the "//" prefix.
@@ -48,8 +48,13 @@ def abspath(path, start=None):
:arg start: Relative to this path,
when not set the current filename is used.
:type start: string
+ :arg library: The library this path is from. This is only included for
+ convenience, when the library is not None its path replaces *start*.
+ :type library: :class:`bpy.types.Library`
"""
if path.startswith("//"):
+ if library:
+ start = abspath(_os.path.dirname(library.filepath))
return _os.path.join(_os.path.dirname(_bpy.data.filepath)
if start is None else start,
path[2:],
@@ -263,7 +268,7 @@ def module_names(path, recursive=False):
def basename(path):
"""
- Equivalent to os.path.basename, but skips a "//" suffix.
+ Equivalent to os.path.basename, but skips a "//" prefix.
Use for Windows compatibility.
"""
diff --git a/release/scripts/modules/bpy_extras/__init__.py b/release/scripts/modules/bpy_extras/__init__.py
index d853d5fda10..7d74bc32f91 100644
--- a/release/scripts/modules/bpy_extras/__init__.py
+++ b/release/scripts/modules/bpy_extras/__init__.py
@@ -23,9 +23,11 @@ Utility modules assosiated with the bpy module.
"""
__all__ = (
+ "anim_utils",
"object_utils",
"io_utils",
"image_utils",
+ "keyconfig_utils",
"mesh_utils",
"view3d_utils",
)
diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py
new file mode 100644
index 00000000000..9848586a144
--- /dev/null
+++ b/release/scripts/modules/bpy_extras/anim_utils.py
@@ -0,0 +1,247 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
+__all__ = (
+ "bake_action",
+ )
+
+import bpy
+
+
+def bake_action(frame_start,
+ frame_end,
+ frame_step=1,
+ only_selected=False,
+ do_pose=True,
+ do_object=True,
+ do_constraint_clear=False,
+ do_clean=False,
+ action=None,
+ ):
+
+ """
+ Return an image from the file path with options to search multiple paths
+ and return a placeholder if its not found.
+
+ :arg frame_start: First frame to bake.
+ :type frame_start: int
+ :arg frame_end: Last frame to bake.
+ :type frame_end: int
+ :arg frame_step: Frame step.
+ :type frame_step: int
+ :arg only_selected: Only bake selected data.
+ :type only_selected: bool
+ :arg do_pose: Bake pose channels.
+ :type do_pose: bool
+ :arg do_object: Bake objects.
+ :type do_object: bool
+ :arg do_constraint_clear: Remove constraints.
+ :type do_constraint_clear: bool
+ :arg do_clean: Remove redundant keyframes after baking.
+ :type do_clean: bool
+ :arg action: An action to bake the data into, or None for a new action
+ to be created.
+ :type action: :class:`bpy.types.Action` or None
+
+ :return: an action or None
+ :rtype: :class:`bpy.types.Action`
+ """
+
+ # -------------------------------------------------------------------------
+ # Helper Functions
+
+ def pose_frame_info(obj):
+ from mathutils import Matrix
+
+ info = {}
+
+ pose = obj.pose
+
+ pose_items = pose.bones.items()
+
+ for name, pbone in pose_items:
+ binfo = {}
+ bone = pbone.bone
+
+ binfo["parent"] = getattr(bone.parent, "name", None)
+ binfo["bone"] = bone
+ binfo["pbone"] = pbone
+ binfo["matrix_local"] = bone.matrix_local.copy()
+ try:
+ binfo["matrix_local_inv"] = binfo["matrix_local"].inverted()
+ except:
+ binfo["matrix_local_inv"] = Matrix()
+
+ binfo["matrix"] = bone.matrix.copy()
+ binfo["matrix_pose"] = pbone.matrix.copy()
+ try:
+ binfo["matrix_pose_inv"] = binfo["matrix_pose"].inverted()
+ except:
+ binfo["matrix_pose_inv"] = Matrix()
+
+ info[name] = binfo
+
+ for name, pbone in pose_items:
+ binfo = info[name]
+ binfo_parent = binfo.get("parent", None)
+ if binfo_parent:
+ binfo_parent = info[binfo_parent]
+
+ matrix = binfo["matrix_pose"]
+ rest_matrix = binfo["matrix_local"]
+
+ if binfo_parent:
+ matrix = binfo_parent["matrix_pose_inv"] * matrix
+ rest_matrix = binfo_parent["matrix_local_inv"] * rest_matrix
+
+ binfo["matrix_key"] = rest_matrix.inverted() * matrix
+
+ return info
+
+ def obj_frame_info(obj):
+ info = {}
+ # parent = obj.parent
+ info["matrix_key"] = obj.matrix_local.copy()
+ return info
+
+ # -------------------------------------------------------------------------
+ # Setup the Context
+
+ # TODO, pass data rather then grabbing from the context!
+ scene = bpy.context.scene
+ obj = bpy.context.object
+ pose = obj.pose
+ frame_back = scene.frame_current
+
+ if pose is None:
+ do_pose = False
+
+ if do_pose is None and do_object is None:
+ return None
+
+ pose_info = []
+ obj_info = []
+
+ frame_range = range(frame_start, frame_end + 1, frame_step)
+
+ # -------------------------------------------------------------------------
+ # Collect transformations
+
+ # could speed this up by applying steps here too...
+ for f in frame_range:
+ scene.frame_set(f)
+
+ if do_pose:
+ pose_info.append(pose_frame_info(obj))
+ if do_object:
+ obj_info.append(obj_frame_info(obj))
+
+ f += 1
+
+ # -------------------------------------------------------------------------
+ # Create action
+
+ # incase animation data hassnt been created
+ atd = obj.animation_data_create()
+ if action is None:
+ action = bpy.data.actions.new("Action")
+ atd.action = action
+
+ if do_pose:
+ pose_items = pose.bones.items()
+ else:
+ pose_items = [] # skip
+
+ # -------------------------------------------------------------------------
+ # Apply transformations to action
+
+ # pose
+ for name, pbone in (pose_items if do_pose else ()):
+ if only_selected and not pbone.bone.select:
+ continue
+
+ if do_constraint_clear:
+ while pbone.constraints:
+ pbone.constraints.remove(pbone.constraints[0])
+
+ for f in frame_range:
+ f_step = (f - frame_start) // frame_step
+ matrix = pose_info[f_step][name]["matrix_key"]
+
+ # pbone.location = matrix.to_translation()
+ # pbone.rotation_quaternion = matrix.to_quaternion()
+ pbone.matrix_basis = matrix
+
+ pbone.keyframe_insert("location", -1, f, name)
+
+ rotation_mode = pbone.rotation_mode
+
+ if rotation_mode == 'QUATERNION':
+ pbone.keyframe_insert("rotation_quaternion", -1, f, name)
+ elif rotation_mode == 'AXIS_ANGLE':
+ pbone.keyframe_insert("rotation_axis_angle", -1, f, name)
+ else: # euler, XYZ, ZXY etc
+ pbone.keyframe_insert("rotation_euler", -1, f, name)
+
+ pbone.keyframe_insert("scale", -1, f, name)
+
+ # object. TODO. multiple objects
+ if do_object:
+ if do_constraint_clear:
+ while obj.constraints:
+ obj.constraints.remove(obj.constraints[0])
+
+ for f in frame_range:
+ matrix = obj_info[(f - frame_start) // frame_step]["matrix_key"]
+ obj.matrix_local = matrix
+
+ obj.keyframe_insert("location", -1, f)
+
+ rotation_mode = obj.rotation_mode
+
+ if rotation_mode == 'QUATERNION':
+ obj.keyframe_insert("rotation_quaternion", -1, f)
+ elif rotation_mode == 'AXIS_ANGLE':
+ obj.keyframe_insert("rotation_axis_angle", -1, f)
+ else: # euler, XYZ, ZXY etc
+ obj.keyframe_insert("rotation_euler", -1, f)
+
+ obj.keyframe_insert("scale", -1, f)
+
+ scene.frame_set(frame_back)
+
+ # -------------------------------------------------------------------------
+ # Clean
+
+ if do_clean:
+ for fcu in action.fcurves:
+ keyframe_points = fcu.keyframe_points
+ i = 1
+ while i < len(fcu.keyframe_points) - 1:
+ val_prev = keyframe_points[i - 1].co[1]
+ val_next = keyframe_points[i + 1].co[1]
+ val = keyframe_points[i].co[1]
+
+ if abs(val - val_prev) + abs(val - val_next) < 0.0001:
+ keyframe_points.remove(keyframe_points[i])
+ else:
+ i += 1
+
+ return action
diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py
index 91546e02829..5d28ceaa34c 100644
--- a/release/scripts/modules/bpy_extras/io_utils.py
+++ b/release/scripts/modules/bpy_extras/io_utils.py
@@ -350,6 +350,7 @@ def path_reference(filepath,
mode='AUTO',
copy_subdir="",
copy_set=None,
+ library=None,
):
"""
Return a filepath relative to a destination directory, for use with
@@ -372,12 +373,15 @@ def path_reference(filepath,
:arg copy_set: collect from/to pairs when mode='COPY',
pass to *path_reference_copy* when exportign is done.
:type copy_set: set
+ :arg library: The library this path is relative to.
+ :type library: :class:`bpy.types.Library` or None
:return: the new filepath.
:rtype: string
"""
import os
is_relative = filepath.startswith("//")
- filepath_abs = os.path.normpath(bpy.path.abspath(filepath, base_src))
+ filepath_abs = bpy.path.abspath(filepath, base_src, library)
+ filepath_abs = os.path.normpath(filepath_abs)
if mode in {'ABSOLUTE', 'RELATIVE', 'STRIP'}:
pass
@@ -385,13 +389,12 @@ def path_reference(filepath,
mode = 'RELATIVE' if is_relative else 'ABSOLUTE'
elif mode == 'AUTO':
mode = ('RELATIVE'
- if bpy.path.is_subdir(filepath, base_dst)
+ if bpy.path.is_subdir(filepath_abs, base_dst)
else 'ABSOLUTE')
elif mode == 'COPY':
+ subdir_abs = os.path.normpath(base_dst)
if copy_subdir:
- subdir_abs = os.path.join(os.path.normpath(base_dst), copy_subdir)
- else:
- subdir_abs = os.path.normpath(base_dst)
+ subdir_abs = os.path.join(subdir_abs, copy_subdir)
filepath_cpy = os.path.join(subdir_abs, os.path.basename(filepath))
diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py
new file mode 100644
index 00000000000..78f010245a0
--- /dev/null
+++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py
@@ -0,0 +1,305 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+KM_HIERARCHY = [
+ ('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit
+ ('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot
+ ('Screen Editing', 'EMPTY', 'WINDOW', []), # resizing, action corners
+ ]),
+
+ ('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region)
+ ('View2D Buttons List', 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation
+ ('Header', 'EMPTY', 'WINDOW', []), # header stuff (per region)
+ ('Grease Pencil', 'EMPTY', 'WINDOW', []), # grease pencil stuff (per region)
+
+ ('3D View', 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform)
+ ('Object Mode', 'EMPTY', 'WINDOW', []),
+ ('Mesh', 'EMPTY', 'WINDOW', []),
+ ('Curve', 'EMPTY', 'WINDOW', []),
+ ('Armature', 'EMPTY', 'WINDOW', []),
+ ('Metaball', 'EMPTY', 'WINDOW', []),
+ ('Lattice', 'EMPTY', 'WINDOW', []),
+ ('Font', 'EMPTY', 'WINDOW', []),
+
+ ('Pose', 'EMPTY', 'WINDOW', []),
+
+ ('Vertex Paint', 'EMPTY', 'WINDOW', []),
+ ('Weight Paint', 'EMPTY', 'WINDOW', []),
+ ('Face Mask', 'EMPTY', 'WINDOW', []),
+ ('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d
+ ('Sculpt', 'EMPTY', 'WINDOW', []),
+
+ ('Armature Sketch', 'EMPTY', 'WINDOW', []),
+ ('Particle', 'EMPTY', 'WINDOW', []),
+
+ ('Object Non-modal', 'EMPTY', 'WINDOW', []), # mode change
+
+ ('3D View Generic', 'VIEW_3D', 'WINDOW', []) # toolbar and properties
+ ]),
+
+ ('Frames', 'EMPTY', 'WINDOW', []), # frame navigation (per region)
+ ('Markers', 'EMPTY', 'WINDOW', []), # markers (per region)
+ ('Animation', 'EMPTY', 'WINDOW', []), # frame change on click, preview range (per region)
+ ('Animation Channels', 'EMPTY', 'WINDOW', []),
+ ('Graph Editor', 'GRAPH_EDITOR', 'WINDOW', [
+ ('Graph Editor Generic', 'GRAPH_EDITOR', 'WINDOW', [])
+ ]),
+ ('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', []),
+ ('NLA Editor', 'NLA_EDITOR', 'WINDOW', [
+ ('NLA Channels', 'NLA_EDITOR', 'WINDOW', []),
+ ('NLA Generic', 'NLA_EDITOR', 'WINDOW', [])
+ ]),
+
+ ('Image', 'IMAGE_EDITOR', 'WINDOW', [
+ ('UV Editor', 'EMPTY', 'WINDOW', []), # image (reverse order, UVEdit before Image
+ ('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d
+ ('Image Generic', 'IMAGE_EDITOR', 'WINDOW', [])
+ ]),
+
+ ('Timeline', 'TIMELINE', 'WINDOW', []),
+ ('Outliner', 'OUTLINER', 'WINDOW', []),
+
+ ('Node Editor', 'NODE_EDITOR', 'WINDOW', [
+ ('Node Generic', 'NODE_EDITOR', 'WINDOW', [])
+ ]),
+ ('Sequencer', 'SEQUENCE_EDITOR', 'WINDOW', []),
+ ('Logic Editor', 'LOGIC_EDITOR', 'WINDOW', []),
+
+ ('File Browser', 'FILE_BROWSER', 'WINDOW', [
+ ('File Browser Main', 'FILE_BROWSER', 'WINDOW', []),
+ ('File Browser Buttons', 'FILE_BROWSER', 'WINDOW', [])
+ ]),
+
+ ('Property Editor', 'PROPERTIES', 'WINDOW', []), # align context menu
+
+ ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []),
+ ('Text', 'TEXT_EDITOR', 'WINDOW', []),
+ ('Console', 'CONSOLE', 'WINDOW', []),
+
+ ('View3D Gesture Circle', 'EMPTY', 'WINDOW', []),
+ ('Gesture Border', 'EMPTY', 'WINDOW', []),
+ ('Standard Modal Map', 'EMPTY', 'WINDOW', []),
+ ('Transform Modal Map', 'EMPTY', 'WINDOW', []),
+ ('View3D Fly Modal', 'EMPTY', 'WINDOW', []),
+ ('View3D Rotate Modal', 'EMPTY', 'WINDOW', []),
+ ('View3D Move Modal', 'EMPTY', 'WINDOW', []),
+ ('View3D Zoom Modal', 'EMPTY', 'WINDOW', []),
+ ]
+
+
+# -----------------------------------------------------------------------------
+# Utility functions
+
+def km_exists_in(km, export_keymaps):
+ for km2, kc in export_keymaps:
+ if km2.name == km.name:
+ return True
+ return False
+
+
+def keyconfig_merge(kc1, kc2):
+ """ note: kc1 takes priority over kc2
+ """
+ merged_keymaps = [(km, kc1) for km in kc1.keymaps]
+ if kc1 != kc2:
+ merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not km_exists_in(km, merged_keymaps))
+
+ return merged_keymaps
+
+
+def _export_properties(prefix, properties, lines=None):
+ from bpy.types import OperatorProperties
+
+ if lines is None:
+ lines = []
+
+ def string_value(value):
+ if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int):
+ result = repr(value)
+ elif getattr(value, '__len__', False):
+ return repr(list(value))
+ else:
+ print("Export key configuration: can't write ", value)
+
+ return result
+
+ for pname in properties.bl_rna.properties.keys():
+ if pname != "rna_type" and not properties.is_property_hidden(pname):
+ value = getattr(properties, pname)
+ if isinstance(value, OperatorProperties):
+ _export_properties(prefix + "." + pname, value, lines)
+ elif properties.is_property_set(pname):
+ value = string_value(value)
+ if value != "":
+ lines.append("%s.%s = %s\n" % (prefix, pname, value))
+ return lines
+
+
+def keyconfig_export(wm, kc, filepath):
+
+ f = open(filepath, "w")
+
+ f.write("import bpy\n")
+ f.write("import os\n\n")
+ f.write("wm = bpy.context.window_manager\n")
+ f.write("kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])\n\n") # keymap must be created by caller
+
+ # Generate a list of keymaps to export:
+ #
+ # First add all user_modified keymaps (found in keyconfigs.user.keymaps list),
+ # then add all remaining keymaps from the currently active custom keyconfig.
+ #
+ # This will create a final list of keymaps that can be used as a 'diff' against
+ # the default blender keyconfig, recreating the current setup from a fresh blender
+ # without needing to export keymaps which haven't been edited.
+
+ class FakeKeyConfig():
+ keymaps = []
+ edited_kc = FakeKeyConfig()
+ for km in wm.keyconfigs.user.keymaps:
+ if km.is_user_modified:
+ edited_kc.keymaps.append(km)
+ # merge edited keymaps with non-default keyconfig, if it exists
+ if kc != wm.keyconfigs.default:
+ export_keymaps = keyconfig_merge(edited_kc, kc)
+ else:
+ export_keymaps = keyconfig_merge(edited_kc, edited_kc)
+
+ for km, kc_x in export_keymaps:
+
+ km = km.active()
+
+ f.write("# Map %s\n" % km.name)
+ f.write("km = kc.keymaps.new('%s', space_type='%s', region_type='%s', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.is_modal))
+ for kmi in km.keymap_items:
+ if km.is_modal:
+ f.write("kmi = km.keymap_items.new_modal('%s', '%s', '%s'" % (kmi.propvalue, kmi.type, kmi.value))
+ else:
+ f.write("kmi = km.keymap_items.new('%s', '%s', '%s'" % (kmi.idname, kmi.type, kmi.value))
+ if kmi.any:
+ f.write(", any=True")
+ else:
+ if kmi.shift:
+ f.write(", shift=True")
+ if kmi.ctrl:
+ f.write(", ctrl=True")
+ if kmi.alt:
+ f.write(", alt=True")
+ if kmi.oskey:
+ f.write(", oskey=True")
+ if kmi.key_modifier and kmi.key_modifier != 'NONE':
+ f.write(", key_modifier='%s'" % kmi.key_modifier)
+ f.write(")\n")
+
+ props = kmi.properties
+
+ if props is not None:
+ f.write("".join(_export_properties("kmi.properties", props)))
+
+ f.write("\n")
+
+ f.close()
+
+
+def keyconfig_test(kc):
+
+ def testEntry(kc, entry, src=None, parent=None):
+ result = False
+
+ def kmistr(kmi):
+ if km.is_modal:
+ s = ["kmi = km.keymap_items.new_modal(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value)]
+ else:
+ s = ["kmi = km.keymap_items.new(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value)]
+
+ if kmi.any:
+ s.append(", any=True")
+ else:
+ if kmi.shift:
+ s.append(", shift=True")
+ if kmi.ctrl:
+ s.append(", ctrl=True")
+ if kmi.alt:
+ s.append(", alt=True")
+ if kmi.oskey:
+ s.append(", oskey=True")
+ if kmi.key_modifier and kmi.key_modifier != 'NONE':
+ s.append(", key_modifier=\'%s\'" % kmi.key_modifier)
+
+ s.append(")\n")
+
+ props = kmi.properties
+
+ if props is not None:
+ _export_properties("kmi.properties", props, s)
+
+ return "".join(s).strip()
+
+ idname, spaceid, regionid, children = entry
+
+ km = kc.keymaps.find(idname, space_type=spaceid, region_type=regionid)
+
+ if km:
+ km = km.active()
+
+ if src:
+ for item in km.keymap_items:
+ if src.compare(item):
+ print("===========")
+ print(parent.name)
+ print(kmistr(src))
+ print(km.name)
+ print(kmistr(item))
+ result = True
+
+ for child in children:
+ if testEntry(kc, child, src, parent):
+ result = True
+ else:
+ for i in range(len(km.keymap_items)):
+ src = km.keymap_items[i]
+
+ for child in children:
+ if testEntry(kc, child, src, km):
+ result = True
+
+ for j in range(len(km.keymap_items) - i - 1):
+ item = km.keymap_items[j + i + 1]
+ if src.compare(item):
+ print("===========")
+ print(km.name)
+ print(kmistr(src))
+ print(kmistr(item))
+ result = True
+
+ for child in children:
+ if testEntry(kc, child):
+ result = True
+
+ return result
+
+ # -------------------------------------------------------------------------
+ # Function body
+
+ result = False
+ for entry in KM_HIERARCHY:
+ if testEntry(kc, entry):
+ result = True
+ return result
diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py
index d5f7a63366a..c0e83cee9d6 100644
--- a/release/scripts/startup/bl_operators/__init__.py
+++ b/release/scripts/startup/bl_operators/__init__.py
@@ -24,10 +24,10 @@ if "bpy" in locals():
_reload(val)
_modules = (
"add_mesh_torus",
- "animsys_update",
+ "anim",
+ "console",
"image",
"mesh",
- "nla",
"object_align",
"object",
"object_randomize_transform",
@@ -39,6 +39,7 @@ _modules = (
"uvcalc_lightmap",
"uvcalc_smart_project",
"vertexpaint_dirt",
+ "view3d",
"wm",
)
__import__(name=__name__, fromlist=_modules)
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
new file mode 100644
index 00000000000..7d1f3b8f5f0
--- /dev/null
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -0,0 +1,274 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
+if "bpy" in locals():
+ import imp
+ if "anim_utils" in locals():
+ imp.reload(anim_utils)
+
+import bpy
+from bpy.types import Operator
+from bpy.props import (IntProperty,
+ BoolProperty,
+ EnumProperty,
+ StringProperty,
+ )
+
+
+class ANIM_OT_keying_set_export(Operator):
+ "Export Keying Set to a python script"
+ bl_idname = "anim.keying_set_export"
+ bl_label = "Export Keying Set..."
+
+ filepath = StringProperty(
+ name="File Path",
+ )
+ filter_folder = BoolProperty(
+ name="Filter folders",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_text = BoolProperty(
+ name="Filter text",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_python = BoolProperty(
+ name="Filter python",
+ default=True,
+ options={'HIDDEN'},
+ )
+
+ def execute(self, context):
+ if not self.filepath:
+ raise Exception("Filepath not set")
+
+ f = open(self.filepath, "w")
+ if not f:
+ raise Exception("Could not open file")
+
+ scene = context.scene
+ ks = scene.keying_sets.active
+
+ f.write("# Keying Set: %s\n" % ks.name)
+
+ f.write("import bpy\n\n")
+ # XXX, why not current scene?
+ f.write("scene= bpy.data.scenes[0]\n\n")
+
+ # Add KeyingSet and set general settings
+ f.write("# Keying Set Level declarations\n")
+ f.write("ks= scene.keying_sets.new(name=\"%s\")\n" % ks.name)
+
+ if not ks.is_path_absolute:
+ f.write("ks.is_path_absolute = False\n")
+ f.write("\n")
+
+ f.write("ks.bl_options = %r\n" % ks.bl_options)
+ f.write("\n")
+
+ # --------------------------------------------------------
+ # generate and write set of lookups for id's used in paths
+
+ # cache for syncing ID-blocks to bpy paths + shorthands
+ id_to_paths_cache = {}
+
+ for ksp in ks.paths:
+ if ksp.id is None:
+ continue
+ if ksp.id in id_to_paths_cache:
+ continue
+
+ """
+ - idtype_list is used to get the list of id-datablocks from
+ bpy.data.* since this info isn't available elsewhere
+ - id.bl_rna.name gives a name suitable for UI,
+ with a capitalised first letter, but we need
+ the plural form that's all lower case
+ """
+
+ idtype_list = ksp.id.bl_rna.name.lower() + "s"
+ id_bpy_path = "bpy.data.%s[\"%s\"]" % (idtype_list, ksp.id.name)
+
+ # shorthand ID for the ID-block (as used in the script)
+ short_id = "id_%d" % len(id_to_paths_cache)
+
+ # store this in the cache now
+ id_to_paths_cache[ksp.id] = [short_id, id_bpy_path]
+
+ f.write("# ID's that are commonly used\n")
+ for id_pair in id_to_paths_cache.values():
+ f.write("%s = %s\n" % (id_pair[0], id_pair[1]))
+ f.write("\n")
+
+ # write paths
+ f.write("# Path Definitions\n")
+ for ksp in ks.paths:
+ f.write("ksp = ks.paths.add(")
+
+ # id-block + data_path
+ if ksp.id:
+ # find the relevant shorthand from the cache
+ id_bpy_path = id_to_paths_cache[ksp.id][0]
+ else:
+ id_bpy_path = "None" # XXX...
+ f.write("%s, '%s'" % (id_bpy_path, ksp.data_path))
+
+ # array index settings (if applicable)
+ if ksp.use_entire_array:
+ f.write(", index=-1")
+ else:
+ f.write(", index=%d" % ksp.array_index)
+
+ # grouping settings (if applicable)
+ # NOTE: the current default is KEYINGSET, but if this changes,
+ # change this code too
+ if ksp.group_method == 'NAMED':
+ f.write(", group_method='%s', group_name=\"%s\"" %
+ (ksp.group_method, ksp.group))
+ elif ksp.group_method != 'KEYINGSET':
+ f.write(", group_method='%s'" % ksp.group_method)
+
+ # finish off
+ f.write(")\n")
+
+ f.write("\n")
+ f.close()
+
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ wm = context.window_manager
+ wm.fileselect_add(self)
+ return {'RUNNING_MODAL'}
+
+
+class BakeAction(Operator):
+ """Bake animation to an Action"""
+ bl_idname = "nla.bake"
+ bl_label = "Bake Action"
+ bl_options = {'REGISTER', 'UNDO'}
+
+ frame_start = IntProperty(
+ name="Start Frame",
+ description="Start frame for baking",
+ min=0, max=300000,
+ default=1,
+ )
+ frame_end = IntProperty(
+ name="End Frame",
+ description="End frame for baking",
+ min=1, max=300000,
+ default=250,
+ )
+ step = IntProperty(
+ name="Frame Step",
+ description="Frame Step",
+ min=1, max=120,
+ default=1,
+ )
+ only_selected = BoolProperty(
+ name="Only Selected",
+ default=True,
+ )
+ clear_consraints = BoolProperty(
+ name="Clear Constraints",
+ default=False,
+ )
+ bake_types = EnumProperty(
+ name="Bake Data",
+ options={'ENUM_FLAG'},
+ items=(('POSE', "Pose", ""),
+ ('OBJECT', "Object", ""),
+ ),
+ default={'POSE'},
+ )
+
+ def execute(self, context):
+
+ from bpy_extras import anim_utils
+
+ action = anim_utils.bake_action(self.frame_start,
+ self.frame_end,
+ self.step,
+ self.only_selected,
+ 'POSE' in self.bake_types,
+ 'OBJECT' in self.bake_types,
+ self.clear_consraints,
+ True,
+ )
+
+ if action is None:
+ self.report({'INFO'}, "Nothing to bake")
+ return {'CANCELLED'}
+
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ wm = context.window_manager
+ return wm.invoke_props_dialog(self)
+
+
+class ClearUselessActions(Operator):
+ """Mark actions with no F-Curves for deletion after save+reload of """ \
+ """file preserving "action libraries"""
+ bl_idname = "anim.clear_useless_actions"
+ bl_label = "Clear Useless Actions"
+ bl_options = {'REGISTER', 'UNDO'}
+
+ only_unused = BoolProperty(name="Only Unused",
+ description="Only unused (Fake User only) actions get considered",
+ default=True)
+
+ @classmethod
+ def poll(cls, context):
+ return len(bpy.data.actions) != 0
+
+ def execute(self, context):
+ removed = 0
+
+ for action in bpy.data.actions:
+ # if only user is "fake" user...
+ if ((self.only_unused is False) or
+ (action.use_fake_user and action.users == 1)):
+
+ # if it has F-Curves, then it's a "action library"
+ # (i.e. walk, wave, jump, etc.)
+ # and should be left alone as that's what fake users are for!
+ if not action.fcurves:
+ # mark action for deletion
+ action.user_clear()
+ removed += 1
+
+ self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions"
+ % removed)
+ return {'FINISHED'}
+
+
+class UpdateAnimData(Operator):
+ """Update data paths from 2.56 and previous versions, """ \
+ """modifying data paths of drivers and fcurves"""
+ bl_idname = "anim.update_data_paths"
+ bl_label = "Update Animation Data"
+
+ def execute(self, context):
+ import animsys_refactor
+ animsys_refactor.update_data_paths(animsys_refactor.data_2_56_to_2_59)
+ return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/animsys_update.py b/release/scripts/startup/bl_operators/animsys_update.py
deleted file mode 100644
index 23b9cf13f07..00000000000
--- a/release/scripts/startup/bl_operators/animsys_update.py
+++ /dev/null
@@ -1,699 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8 compliant>
-
-data_path_update = [
- ("ClothCollisionSettings", "min_distance", "distance_min"),
- ("ClothCollisionSettings", "self_min_distance", "self_distance_min"),
- ("ClothCollisionSettings", "enable_collision", "use_collision"),
- ("ClothCollisionSettings", "enable_self_collision", "use_self_collision"),
- ("ClothSettings", "pin_cloth", "use_pin_cloth"),
- ("ClothSettings", "stiffness_scaling", "use_stiffness_scale"),
- ("CollisionSettings", "random_damping", "damping_random"),
- ("CollisionSettings", "random_friction", "friction_random"),
- ("CollisionSettings", "inner_thickness", "thickness_inner"),
- ("CollisionSettings", "outer_thickness", "thickness_outer"),
- ("CollisionSettings", "kill_particles", "use_particle_kill"),
- ("Constraint", "proxy_local", "is_proxy_local"),
- ("ActionConstraint", "maximum", "max"),
- ("ActionConstraint", "minimum", "min"),
- ("FollowPathConstraint", "use_fixed_position", "use_fixed_location"),
- ("KinematicConstraint", "chain_length", "chain_count"),
- ("KinematicConstraint", "pos_lock_x", "lock_location_x"),
- ("KinematicConstraint", "pos_lock_y", "lock_location_y"),
- ("KinematicConstraint", "pos_lock_z", "lock_location_z"),
- ("KinematicConstraint", "rot_lock_x", "lock_rotation_x"),
- ("KinematicConstraint", "rot_lock_y", "lock_rotation_y"),
- ("KinematicConstraint", "rot_lock_z", "lock_rotation_z"),
- ("KinematicConstraint", "axis_reference", "reference_axis"),
- ("KinematicConstraint", "use_position", "use_location"),
- ("LimitLocationConstraint", "maximum_x", "max_x"),
- ("LimitLocationConstraint", "maximum_y", "max_y"),
- ("LimitLocationConstraint", "maximum_z", "max_z"),
- ("LimitLocationConstraint", "minimum_x", "min_x"),
- ("LimitLocationConstraint", "minimum_y", "min_y"),
- ("LimitLocationConstraint", "minimum_z", "min_z"),
- ("LimitLocationConstraint", "use_maximum_x", "use_max_x"),
- ("LimitLocationConstraint", "use_maximum_y", "use_max_y"),
- ("LimitLocationConstraint", "use_maximum_z", "use_max_z"),
- ("LimitLocationConstraint", "use_minimum_x", "use_min_x"),
- ("LimitLocationConstraint", "use_minimum_y", "use_min_y"),
- ("LimitLocationConstraint", "use_minimum_z", "use_min_z"),
- ("LimitLocationConstraint", "limit_transform", "use_transform_limit"),
- ("LimitRotationConstraint", "maximum_x", "max_x"),
- ("LimitRotationConstraint", "maximum_y", "max_y"),
- ("LimitRotationConstraint", "maximum_z", "max_z"),
- ("LimitRotationConstraint", "minimum_x", "min_x"),
- ("LimitRotationConstraint", "minimum_y", "min_y"),
- ("LimitRotationConstraint", "minimum_z", "min_z"),
- ("LimitRotationConstraint", "limit_transform", "use_transform_limit"),
- ("LimitScaleConstraint", "maximum_x", "max_x"),
- ("LimitScaleConstraint", "maximum_y", "max_y"),
- ("LimitScaleConstraint", "maximum_z", "max_z"),
- ("LimitScaleConstraint", "minimum_x", "min_x"),
- ("LimitScaleConstraint", "minimum_y", "min_y"),
- ("LimitScaleConstraint", "minimum_z", "min_z"),
- ("LimitScaleConstraint", "use_maximum_x", "use_max_x"),
- ("LimitScaleConstraint", "use_maximum_y", "use_max_y"),
- ("LimitScaleConstraint", "use_maximum_z", "use_max_z"),
- ("LimitScaleConstraint", "use_minimum_x", "use_min_x"),
- ("LimitScaleConstraint", "use_minimum_y", "use_min_y"),
- ("LimitScaleConstraint", "use_minimum_z", "use_min_z"),
- ("LimitScaleConstraint", "limit_transform", "use_transform_limit"),
- ("PivotConstraint", "enabled_rotation_range", "rotation_range"),
- ("PivotConstraint", "use_relative_position", "use_relative_location"),
- ("PythonConstraint", "number_of_targets", "target_count"),
- ("SplineIKConstraint", "chain_length", "chain_count"),
- ("SplineIKConstraint", "chain_offset", "use_chain_offset"),
- ("SplineIKConstraint", "even_divisions", "use_even_divisions"),
- ("SplineIKConstraint", "y_stretch", "use_y_stretch"),
- ("SplineIKConstraint", "xz_scaling_mode", "xz_scale_mode"),
- ("StretchToConstraint", "original_length", "rest_length"),
- ("TrackToConstraint", "target_z", "use_target_z"),
- ("TransformConstraint", "extrapolate_motion", "use_motion_extrapolate"),
- ("FieldSettings", "do_location", "apply_to_location"),
- ("FieldSettings", "do_rotation", "apply_to_rotation"),
- ("FieldSettings", "maximum_distance", "distance_max"),
- ("FieldSettings", "minimum_distance", "distance_min"),
- ("FieldSettings", "radial_maximum", "radial_max"),
- ("FieldSettings", "radial_minimum", "radial_min"),
- ("FieldSettings", "force_2d", "use_2d_force"),
- ("FieldSettings", "do_absorption", "use_absorption"),
- ("FieldSettings", "global_coordinates", "use_global_coords"),
- ("FieldSettings", "guide_path_add", "use_guide_path_add"),
- ("FieldSettings", "multiple_springs", "use_multiple_springs"),
- ("FieldSettings", "use_coordinates", "use_object_coords"),
- ("FieldSettings", "root_coordinates", "use_root_coords"),
- ("ControlFluidSettings", "reverse_frames", "use_reverse_frames"),
- ("DomainFluidSettings", "real_world_size", "simulation_scale"),
- ("DomainFluidSettings", "surface_smoothing", "surface_smooth"),
- ("DomainFluidSettings", "reverse_frames", "use_reverse_frames"),
- ("DomainFluidSettings", "generate_speed_vectors", "use_speed_vectors"),
- ("DomainFluidSettings", "override_time", "use_time_override"),
- ("FluidFluidSettings", "export_animated_mesh", "use_animated_mesh"),
- ("InflowFluidSettings", "export_animated_mesh", "use_animated_mesh"),
- ("InflowFluidSettings", "local_coordinates", "use_local_coords"),
- ("ObstacleFluidSettings", "export_animated_mesh", "use_animated_mesh"),
- ("OutflowFluidSettings", "export_animated_mesh", "use_animated_mesh"),
- ("ParticleFluidSettings", "drops", "use_drops"),
- ("ParticleFluidSettings", "floats", "use_floats"),
- ("Armature", "drawtype", "draw_type"),
- ("Armature", "layer_protection", "layers_protected"),
- ("Armature", "auto_ik", "use_auto_ik"),
- ("Armature", "delay_deform", "use_deform_delay"),
- ("Armature", "deform_envelope", "use_deform_envelopes"),
- ("Armature", "deform_quaternion", "use_deform_preserve_volume"),
- ("Armature", "deform_vertexgroups", "use_deform_vertex_groups"),
- ("Armature", "x_axis_mirror", "use_mirror_x"),
- ("Curve", "width", "offset"),
- ("Image", "animation_speed", "fps"),
- ("Image", "animation_end", "frame_end"),
- ("Image", "animation_start", "frame_start"),
- ("Image", "animated", "use_animation"),
- ("Image", "clamp_x", "use_clamp_x"),
- ("Image", "clamp_y", "use_clamp_y"),
- ("Image", "premultiply", "use_premultiply"),
- ("AreaLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"),
- ("AreaLamp", "only_shadow", "use_only_shadow"),
- ("AreaLamp", "shadow_layer", "use_shadow_layer"),
- ("AreaLamp", "umbra", "use_umbra"),
- ("PointLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"),
- ("PointLamp", "only_shadow", "use_only_shadow"),
- ("PointLamp", "shadow_layer", "use_shadow_layer"),
- ("PointLamp", "sphere", "use_sphere"),
- ("SpotLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"),
- ("SpotLamp", "auto_clip_end", "use_auto_clip_end"),
- ("SpotLamp", "auto_clip_start", "use_auto_clip_start"),
- ("SpotLamp", "only_shadow", "use_only_shadow"),
- ("SpotLamp", "shadow_layer", "use_shadow_layer"),
- ("SpotLamp", "sphere", "use_sphere"),
- ("SunLamp", "only_shadow", "use_only_shadow"),
- ("SunLamp", "shadow_layer", "use_shadow_layer"),
- ("Material", "z_offset", "offset_z"),
- ("Material", "shadow_casting_alpha", "shadow_cast_alpha"),
- ("Material", "cast_approximate", "use_cast_approximate"),
- ("Material", "cast_buffer_shadows", "use_cast_buffer_shadows"),
- ("Material", "cast_shadows_only", "use_cast_shadows_only"),
- ("Material", "face_texture", "use_face_texture"),
- ("Material", "face_texture_alpha", "use_face_texture_alpha"),
- ("Material", "full_oversampling", "use_full_oversampling"),
- ("Material", "light_group_exclusive", "use_light_group_exclusive"),
- ("Material", "object_color", "use_object_color"),
- ("Material", "only_shadow", "use_only_shadow"),
- ("Material", "ray_shadow_bias", "use_ray_shadow_bias"),
- ("Material", "traceable", "use_raytrace"),
- ("Material", "shadeless", "use_shadeless"),
- ("Material", "tangent_shading", "use_tangent_shading"),
- ("Material", "transparency", "use_transparency"),
- ("Material", "receive_transparent_shadows", "use_transparent_shadows"),
- ("Material", "vertex_color_light", "use_vertex_color_light"),
- ("Material", "vertex_color_paint", "use_vertex_color_paint"),
- ("Mesh", "autosmooth_angle", "auto_smooth_angle"),
- ("Mesh", "autosmooth", "use_auto_smooth"),
- ("Object", "max_draw_type", "draw_type"),
- ("Object", "use_dupli_verts_rotation", "use_dupli_vertices_rotation"),
- ("Object", "shape_key_edit_mode", "use_shape_key_edit_mode"),
- ("Object", "slow_parent", "use_slow_parent"),
- ("Object", "time_offset_add_parent", "use_time_offset_add_parent"),
- ("Object", "time_offset_edit", "use_time_offset_edit"),
- ("Object", "time_offset_parent", "use_time_offset_parent"),
- ("Object", "time_offset_particle", "use_time_offset_particle"),
- ("ParticleSettings", "adaptive_pix", "adaptive_pixel"),
- ("ParticleSettings", "child_effector", "apply_effector_to_children"),
- ("ParticleSettings", "child_guide", "apply_guide_to_children"),
- ("ParticleSettings", "billboard_split_offset", "billboard_offset_split"),
- ("ParticleSettings", "billboard_random_tilt", "billboard_tilt_random"),
- ("ParticleSettings", "child_length_thres", "child_length_threshold"),
- ("ParticleSettings", "child_random_size", "child_size_random"),
- ("ParticleSettings", "clumppow", "clump_shape"),
- ("ParticleSettings", "damp_factor", "damping"),
- ("ParticleSettings", "draw_as", "draw_method"),
- ("ParticleSettings", "random_factor", "factor_random"),
- ("ParticleSettings", "grid_invert", "invert_grid"),
- ("ParticleSettings", "random_length", "length_random"),
- ("ParticleSettings", "random_lifetime", "lifetime_random"),
- ("ParticleSettings", "billboard_lock", "lock_billboard"),
- ("ParticleSettings", "boids_2d", "lock_boids_to_surface"),
- ("ParticleSettings", "object_aligned_factor", "object_align_factor"),
- ("ParticleSettings", "random_phase_factor", "phase_factor_random"),
- ("ParticleSettings", "ren_as", "render_type"),
- ("ParticleSettings", "rendered_child_nbr", "rendered_child_count"),
- ("ParticleSettings", "random_rotation_factor", "rotation_factor_random"),
- ("ParticleSettings", "rough1", "roughness_1"),
- ("ParticleSettings", "rough1_size", "roughness_1_size"),
- ("ParticleSettings", "rough2", "roughness_2"),
- ("ParticleSettings", "rough2_size", "roughness_2_size"),
- ("ParticleSettings", "rough2_thres", "roughness_2_threshold"),
- ("ParticleSettings", "rough_end_shape", "roughness_end_shape"),
- ("ParticleSettings", "rough_endpoint", "roughness_endpoint"),
- ("ParticleSettings", "random_size", "size_random"),
- ("ParticleSettings", "abs_path_time", "use_absolute_path_time"),
- ("ParticleSettings", "animate_branching", "use_animate_branching"),
- ("ParticleSettings", "branching", "use_branching"),
- ("ParticleSettings", "died", "use_dead"),
- ("ParticleSettings", "die_on_collision", "use_die_on_collision"),
- ("ParticleSettings", "rotation_dynamic", "use_dynamic_rotation"),
- ("ParticleSettings", "even_distribution", "use_even_distribution"),
- ("ParticleSettings", "rand_group", "use_group_pick_random"),
- ("ParticleSettings", "hair_bspline", "use_hair_bspline"),
- ("ParticleSettings", "sizemass", "use_multiply_size_mass"),
- ("ParticleSettings", "react_multiple", "use_react_multiple"),
- ("ParticleSettings", "react_start_end", "use_react_start_end"),
- ("ParticleSettings", "render_adaptive", "use_render_adaptive"),
- ("ParticleSettings", "self_effect", "use_self_effect"),
- ("ParticleSettings", "enable_simplify", "use_simplify"),
- ("ParticleSettings", "size_deflect", "use_size_deflect"),
- ("ParticleSettings", "render_strand", "use_strand_primitive"),
- ("ParticleSettings", "symmetric_branching", "use_symmetric_branching"),
- ("ParticleSettings", "velocity_length", "use_velocity_length"),
- ("ParticleSettings", "whole_group", "use_whole_group"),
- ("CloudsTexture", "noise_size", "noise_scale"),
- ("DistortedNoiseTexture", "noise_size", "noise_scale"),
- ("EnvironmentMapTexture", "filter_size_minimum", "use_filter_size_min"),
- ("EnvironmentMapTexture", "mipmap_gauss", "use_mipmap_gauss"),
- ("ImageTexture", "calculate_alpha", "use_calculate_alpha"),
- ("ImageTexture", "checker_even", "use_checker_even"),
- ("ImageTexture", "checker_odd", "use_checker_odd"),
- ("ImageTexture", "filter_size_minimum", "use_filter_size_min"),
- ("ImageTexture", "flip_axis", "use_flip_axis"),
- ("ImageTexture", "mipmap_gauss", "use_mipmap_gauss"),
- ("ImageTexture", "mirror_x", "use_mirror_x"),
- ("ImageTexture", "mirror_y", "use_mirror_y"),
- ("ImageTexture", "normal_map", "use_normal_map"),
- ("MarbleTexture", "noise_size", "noise_scale"),
- ("MarbleTexture", "noisebasis2", "noise_basis_2"),
- ("MarbleTexture", "noisebasis_2", "noise_basis_2"),
- ("MusgraveTexture", "highest_dimension", "dimension_max"),
- ("MusgraveTexture", "noise_size", "noise_scale"),
- ("StucciTexture", "noise_size", "noise_scale"),
- ("VoronoiTexture", "coloring", "color_mode"),
- ("VoronoiTexture", "noise_size", "noise_scale"),
- ("WoodTexture", "noise_size", "noise_scale"),
- ("WoodTexture", "noisebasis2", "noise_basis_2"),
- ("WoodTexture", "noisebasis_2", "noise_basis_2"),
- ("World", "blend_sky", "use_sky_blend"),
- ("World", "paper_sky", "use_sky_paper"),
- ("World", "real_sky", "use_sky_real"),
- ("ImageUser", "auto_refresh", "use_auto_refresh"),
- ("MaterialHalo", "flares_sub", "flare_subflare_count"),
- ("MaterialHalo", "flare_subsize", "flare_subflare_size"),
- ("MaterialHalo", "line_number", "line_count"),
- ("MaterialHalo", "rings", "ring_count"),
- ("MaterialHalo", "star_tips", "star_tip_count"),
- ("MaterialHalo", "xalpha", "use_extreme_alpha"),
- ("MaterialHalo", "flare_mode", "use_flare_mode"),
- ("MaterialHalo", "vertex_normal", "use_vertex_normal"),
- ("MaterialPhysics", "align_to_normal", "use_normal_align"),
- ("MaterialStrand", "min_size", "size_min"),
- ("MaterialStrand", "blender_units", "use_blender_units"),
- ("MaterialStrand", "surface_diffuse", "use_surface_diffuse"),
- ("MaterialStrand", "tangent_shading", "use_tangent_shading"),
- ("MaterialSubsurfaceScattering", "error_tolerance", "error_threshold"),
- ("MaterialVolume", "depth_cutoff", "depth_threshold"),
- ("MaterialVolume", "lighting_mode", "light_method"),
- ("MaterialVolume", "step_calculation", "step_method"),
- ("MaterialVolume", "external_shadows", "use_external_shadows"),
- ("MaterialVolume", "light_cache", "use_light_cache"),
- ("ArmatureModifier", "multi_modifier", "use_multi_modifier"),
- ("ArrayModifier", "constant_offset_displacement", "constant_offset_displace"),
- ("ArrayModifier", "merge_distance", "merge_threshold"),
- ("ArrayModifier", "relative_offset_displacement", "relative_offset_displace"),
- ("ArrayModifier", "constant_offset", "use_constant_offset"),
- ("ArrayModifier", "merge_adjacent_vertices", "use_merge_vertices"),
- ("ArrayModifier", "merge_end_vertices", "use_merge_vertices_cap"),
- ("ArrayModifier", "add_offset_object", "use_object_offset"),
- ("ArrayModifier", "relative_offset", "use_relative_offset"),
- ("BevelModifier", "only_vertices", "use_only_vertices"),
- ("CastModifier", "from_radius", "use_radius_as_size"),
- ("DisplaceModifier", "midlevel", "mid_level"),
- ("DisplaceModifier", "texture_coordinates", "texture_coords"),
- ("EdgeSplitModifier", "use_sharp", "use_edge_sharp"),
- ("ExplodeModifier", "split_edges", "use_edge_split"),
- ("MirrorModifier", "merge_limit", "merge_threshold"),
- ("MirrorModifier", "mirror_u", "use_mirror_u"),
- ("MirrorModifier", "mirror_v", "use_mirror_v"),
- ("MirrorModifier", "mirror_vertex_groups", "use_mirror_vertex_groups"),
- ("ParticleInstanceModifier", "particle_system_number", "particle_system_index"),
- ("ParticleInstanceModifier", "keep_shape", "use_preserve_shape"),
- ("ShrinkwrapModifier", "cull_back_faces", "use_cull_back_faces"),
- ("ShrinkwrapModifier", "cull_front_faces", "use_cull_front_faces"),
- ("ShrinkwrapModifier", "keep_above_surface", "use_keep_above_surface"),
- ("SimpleDeformModifier", "lock_x_axis", "lock_x"),
- ("SimpleDeformModifier", "lock_y_axis", "lock_y"),
- ("SmokeModifier", "smoke_type", "type"),
- ("SubsurfModifier", "subsurf_uv", "use_subsurf_uv"),
- ("UVProjectModifier", "num_projectors", "projector_count"),
- ("UVProjectModifier", "override_image", "use_image_override"),
- ("WaveModifier", "texture_coordinates", "texture_coords"),
- ("WaveModifier", "x_normal", "use_normal_x"),
- ("WaveModifier", "y_normal", "use_normal_y"),
- ("WaveModifier", "z_normal", "use_normal_z"),
- ("NlaStrip", "blending", "blend_type"),
- ("NlaStrip", "animated_influence", "use_animated_influence"),
- ("NlaStrip", "animated_time", "use_animated_time"),
- ("NlaStrip", "animated_time_cyclic", "use_animated_time_cyclic"),
- ("NlaStrip", "auto_blending", "use_auto_blend"),
- ("CompositorNodeAlphaOver", "convert_premul", "use_premultiply"),
- ("CompositorNodeBlur", "sizex", "size_x"),
- ("CompositorNodeBlur", "sizey", "size_y"),
- ("CompositorNodeChannelMatte", "algorithm", "limit_method"),
- ("CompositorNodeChromaMatte", "acceptance", "tolerance"),
- ("CompositorNodeColorBalance", "correction_formula", "correction_method"),
- ("CompositorNodeColorSpill", "algorithm", "limit_method"),
- ("CompositorNodeColorSpill", "unspill", "use_unspill"),
- ("CompositorNodeCrop", "x2", "max_x"),
- ("CompositorNodeCrop", "y2", "max_y"),
- ("CompositorNodeCrop", "x1", "min_x"),
- ("CompositorNodeCrop", "y1", "min_y"),
- ("CompositorNodeCrop", "crop_size", "use_crop_size"),
- ("CompositorNodeDefocus", "max_blur", "blur_max"),
- ("CompositorNodeDefocus", "gamma_correction", "use_gamma_correction"),
- ("CompositorNodeGlare", "rotate_45", "use_rotate_45"),
- ("CompositorNodeImage", "auto_refresh", "use_auto_refresh"),
- ("CompositorNodeLensdist", "projector", "use_projector"),
- ("CompositorNodeVecBlur", "max_speed", "speed_max"),
- ("CompositorNodeVecBlur", "min_speed", "speed_min"),
- ("ShaderNodeMapping", "maximum", "max"),
- ("ShaderNodeMapping", "minimum", "min"),
- ("ShaderNodeMapping", "clamp_maximum", "use_max"),
- ("ShaderNodeMapping", "clamp_minimum", "use_min"),
- ("VertexPaint", "all_faces", "use_all_faces"),
- ("VertexPaint", "spray", "use_spray"),
- ("ParticleEdit", "add_keys", "default_key_count"),
- ("ParticleEdit", "selection_mode", "select_mode"),
- ("ParticleEdit", "auto_velocity", "use_auto_velocity"),
- ("ParticleEdit", "add_interpolate", "use_default_interpolate"),
- ("ParticleEdit", "emitter_deflect", "use_emitter_deflect"),
- ("ParticleEdit", "fade_time", "use_fade_time"),
- ("ParticleEdit", "keep_lengths", "use_preserve_length"),
- ("ParticleEdit", "keep_root", "use_preserve_root"),
- ("ParticleSystem", "vertex_group_clump_negate", "invert_vertex_group_clump"),
- ("ParticleSystem", "vertex_group_density_negate", "invert_vertex_group_density"),
- ("ParticleSystem", "vertex_group_field_negate", "invert_vertex_group_field"),
- ("ParticleSystem", "vertex_group_kink_negate", "invert_vertex_group_kink"),
- ("ParticleSystem", "vertex_group_length_negate", "invert_vertex_group_length"),
- ("ParticleSystem", "vertex_group_rotation_negate", "invert_vertex_group_rotation"),
- ("ParticleSystem", "vertex_group_roughness1_negate", "invert_vertex_group_roughness_1"),
- ("ParticleSystem", "vertex_group_roughness2_negate", "invert_vertex_group_roughness_2"),
- ("ParticleSystem", "vertex_group_roughness_end_negate", "invert_vertex_group_roughness_end"),
- ("ParticleSystem", "vertex_group_size_negate", "invert_vertex_group_size"),
- ("ParticleSystem", "vertex_group_tangent_negate", "invert_vertex_group_tangent"),
- ("ParticleSystem", "vertex_group_velocity_negate", "invert_vertex_group_velocity"),
- ("ParticleSystem", "hair_dynamics", "use_hair_dynamics"),
- ("ParticleSystem", "keyed_timing", "use_keyed_timing"),
- ("PointDensity", "falloff_softness", "falloff_soft"),
- ("PointDensity", "particle_cache", "particle_cache_space"),
- ("PointDensity", "turbulence_size", "turbulence_scale"),
- ("PointDensity", "turbulence", "use_turbulence"),
- ("PointDensity", "vertices_cache", "vertex_cache_space"),
- ("PoseBone", "ik_lin_weight", "ik_linear_weight"),
- ("PoseBone", "ik_rot_weight", "ik_rotation_weight"),
- ("PoseBone", "ik_limit_x", "use_ik_limit_x"),
- ("PoseBone", "ik_limit_y", "use_ik_limit_y"),
- ("PoseBone", "ik_limit_z", "use_ik_limit_z"),
- ("PoseBone", "ik_lin_control", "use_ik_linear_control"),
- ("PoseBone", "ik_rot_control", "use_ik_rotation_control"),
- ("Bone", "use_hinge", "use_inherit_rotation"),
- ("SPHFluidSettings", "spring_k", "spring_force"),
- ("SPHFluidSettings", "stiffness_k", "stiffness"),
- ("SPHFluidSettings", "stiffness_knear", "stiffness_near"),
- ("SceneGameData", "framing_color", "frame_color"),
- ("SceneGameData", "framing_type", "frame_type"),
- ("SceneGameData", "eye_separation", "stereo_eye_separation"),
- ("SceneGameData", "activity_culling", "use_activity_culling"),
- ("SceneGameData", "auto_start", "use_auto_start"),
- ("SceneGameData", "glsl_extra_textures", "use_glsl_extra_textures"),
- ("SceneGameData", "glsl_lights", "use_glsl_lights"),
- ("SceneGameData", "glsl_nodes", "use_glsl_nodes"),
- ("SceneGameData", "glsl_ramps", "use_glsl_ramps"),
- ("SceneGameData", "glsl_shaders", "use_glsl_shaders"),
- ("SceneGameData", "glsl_shadows", "use_glsl_shadows"),
- ("Sequence", "blend_opacity", "blend_alpha"),
- ("Sequence", "blend_mode", "blend_type"),
- ("Sequence", "frame_final_length", "frame_final_duration"),
- ("Sequence", "use_effect_default_fade", "use_default_fade"),
- ("SequenceColorBalance", "inverse_gain", "invert_gain"),
- ("SequenceColorBalance", "inverse_gamma", "invert_gamma"),
- ("SequenceColorBalance", "inverse_lift", "invert_lift"),
- ("EffectSequence", "multiply_colors", "color_multiply"),
- ("EffectSequence", "de_interlace", "use_deinterlace"),
- ("EffectSequence", "flip_x", "use_flip_x"),
- ("EffectSequence", "flip_y", "use_flip_y"),
- ("EffectSequence", "convert_float", "use_float"),
- ("EffectSequence", "premultiply", "use_premultiply"),
- ("EffectSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
- ("EffectSequence", "proxy_custom_file", "use_proxy_custom_file"),
- ("EffectSequence", "reverse_frames", "use_reverse_frames"),
- ("GlowSequence", "blur_distance", "blur_radius"),
- ("GlowSequence", "only_boost", "use_only_boost"),
- ("SpeedControlSequence", "curve_compress_y", "use_curve_compress_y"),
- ("SpeedControlSequence", "curve_velocity", "use_curve_velocity"),
- ("SpeedControlSequence", "frame_blending", "use_frame_blend"),
- ("TransformSequence", "uniform_scale", "use_uniform_scale"),
- ("ImageSequence", "animation_end_offset", "animation_offset_end"),
- ("ImageSequence", "animation_start_offset", "animation_offset_start"),
- ("ImageSequence", "multiply_colors", "color_multiply"),
- ("ImageSequence", "de_interlace", "use_deinterlace"),
- ("ImageSequence", "flip_x", "use_flip_x"),
- ("ImageSequence", "flip_y", "use_flip_y"),
- ("ImageSequence", "convert_float", "use_float"),
- ("ImageSequence", "premultiply", "use_premultiply"),
- ("ImageSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
- ("ImageSequence", "proxy_custom_file", "use_proxy_custom_file"),
- ("ImageSequence", "reverse_frames", "use_reverse_frames"),
- ("MetaSequence", "animation_end_offset", "animation_offset_end"),
- ("MetaSequence", "animation_start_offset", "animation_offset_start"),
- ("MetaSequence", "multiply_colors", "color_multiply"),
- ("MetaSequence", "de_interlace", "use_deinterlace"),
- ("MetaSequence", "flip_x", "use_flip_x"),
- ("MetaSequence", "flip_y", "use_flip_y"),
- ("MetaSequence", "convert_float", "use_float"),
- ("MetaSequence", "premultiply", "use_premultiply"),
- ("MetaSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
- ("MetaSequence", "proxy_custom_file", "use_proxy_custom_file"),
- ("MetaSequence", "reverse_frames", "use_reverse_frames"),
- ("MovieSequence", "animation_end_offset", "animation_offset_end"),
- ("MovieSequence", "animation_start_offset", "animation_offset_start"),
- ("MovieSequence", "multiply_colors", "color_multiply"),
- ("MovieSequence", "de_interlace", "use_deinterlace"),
- ("MovieSequence", "flip_x", "use_flip_x"),
- ("MovieSequence", "flip_y", "use_flip_y"),
- ("MovieSequence", "convert_float", "use_float"),
- ("MovieSequence", "premultiply", "use_premultiply"),
- ("MovieSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
- ("MovieSequence", "proxy_custom_file", "use_proxy_custom_file"),
- ("MovieSequence", "reverse_frames", "use_reverse_frames"),
- ("MulticamSequence", "animation_end_offset", "animation_offset_end"),
- ("MulticamSequence", "animation_start_offset", "animation_offset_start"),
- ("MulticamSequence", "multiply_colors", "color_multiply"),
- ("MulticamSequence", "de_interlace", "use_deinterlace"),
- ("MulticamSequence", "flip_x", "use_flip_x"),
- ("MulticamSequence", "flip_y", "use_flip_y"),
- ("MulticamSequence", "convert_float", "use_float"),
- ("MulticamSequence", "premultiply", "use_premultiply"),
- ("MulticamSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
- ("MulticamSequence", "proxy_custom_file", "use_proxy_custom_file"),
- ("MulticamSequence", "reverse_frames", "use_reverse_frames"),
- ("SceneSequence", "animation_end_offset", "animation_offset_end"),
- ("SceneSequence", "animation_start_offset", "animation_offset_start"),
- ("SceneSequence", "multiply_colors", "color_multiply"),
- ("SceneSequence", "de_interlace", "use_deinterlace"),
- ("SceneSequence", "flip_x", "use_flip_x"),
- ("SceneSequence", "flip_y", "use_flip_y"),
- ("SceneSequence", "convert_float", "use_float"),
- ("SceneSequence", "premultiply", "use_premultiply"),
- ("SceneSequence", "proxy_custom_directory", "use_proxy_custom_directory"),
- ("SceneSequence", "proxy_custom_file", "use_proxy_custom_file"),
- ("SceneSequence", "reverse_frames", "use_reverse_frames"),
- ("SoundSequence", "animation_end_offset", "animation_offset_end"),
- ("SoundSequence", "animation_start_offset", "animation_offset_start"),
- ("SmokeDomainSettings", "smoke_domain_colli", "collision_extents"),
- ("SmokeDomainSettings", "smoke_cache_high_comp", "point_cache_compress_high_type"),
- ("SmokeDomainSettings", "smoke_cache_comp", "point_cache_compress_type"),
- ("SmokeDomainSettings", "maxres", "resolution_max"),
- ("SmokeDomainSettings", "smoothemitter", "smooth_emitter"),
- ("SmokeDomainSettings", "dissolve_smoke", "use_dissolve_smoke"),
- ("SmokeDomainSettings", "dissolve_smoke_log", "use_dissolve_smoke_log"),
- ("SmokeDomainSettings", "highres", "use_high_resolution"),
- ("SoftBodySettings", "bending", "bend"),
- ("SoftBodySettings", "error_limit", "error_threshold"),
- ("SoftBodySettings", "lcom", "location_mass_center"),
- ("SoftBodySettings", "lrot", "rotation_estimate"),
- ("SoftBodySettings", "lscale", "scale_estimate"),
- ("SoftBodySettings", "maxstep", "step_max"),
- ("SoftBodySettings", "minstep", "step_min"),
- ("SoftBodySettings", "diagnose", "use_diagnose"),
- ("SoftBodySettings", "edge_collision", "use_edge_collision"),
- ("SoftBodySettings", "estimate_matrix", "use_estimate_matrix"),
- ("SoftBodySettings", "face_collision", "use_face_collision"),
- ("SoftBodySettings", "self_collision", "use_self_collision"),
- ("SoftBodySettings", "stiff_quads", "use_stiff_quads"),
- ("TexMapping", "maximum", "max"),
- ("TexMapping", "minimum", "min"),
- ("TexMapping", "has_maximum", "use_max"),
- ("TexMapping", "has_minimum", "use_min"),
- ("TextCharacterFormat", "bold", "use_bold"),
- ("TextCharacterFormat", "italic", "use_italic"),
- ("TextCharacterFormat", "underline", "use_underline"),
- ("TextureSlot", "rgb_to_intensity", "use_rgb_to_intensity"),
- ("TextureSlot", "stencil", "use_stencil"),
- ("LampTextureSlot", "texture_coordinates", "texture_coords"),
- ("LampTextureSlot", "map_color", "use_map_color"),
- ("LampTextureSlot", "map_shadow", "use_map_shadow"),
- ("MaterialTextureSlot", "coloremission_factor", "color_emission_factor"),
- ("MaterialTextureSlot", "colordiff_factor", "diffuse_color_factor"),
- ("MaterialTextureSlot", "x_mapping", "mapping_x"),
- ("MaterialTextureSlot", "y_mapping", "mapping_y"),
- ("MaterialTextureSlot", "z_mapping", "mapping_z"),
- ("MaterialTextureSlot", "colorreflection_factor", "reflection_color_factor"),
- ("MaterialTextureSlot", "colorspec_factor", "specular_color_factor"),
- ("MaterialTextureSlot", "texture_coordinates", "texture_coords"),
- ("MaterialTextureSlot", "colortransmission_factor", "transmission_color_factor"),
- ("MaterialTextureSlot", "from_dupli", "use_from_dupli"),
- ("MaterialTextureSlot", "from_original", "use_from_original"),
- ("MaterialTextureSlot", "map_alpha", "use_map_alpha"),
- ("MaterialTextureSlot", "map_ambient", "use_map_ambient"),
- ("MaterialTextureSlot", "map_colordiff", "use_map_color_diff"),
- ("MaterialTextureSlot", "map_coloremission", "use_map_color_emission"),
- ("MaterialTextureSlot", "map_colorreflection", "use_map_color_reflection"),
- ("MaterialTextureSlot", "map_colorspec", "use_map_color_spec"),
- ("MaterialTextureSlot", "map_colortransmission", "use_map_color_transmission"),
- ("MaterialTextureSlot", "map_density", "use_map_density"),
- ("MaterialTextureSlot", "map_diffuse", "use_map_diffuse"),
- ("MaterialTextureSlot", "map_displacement", "use_map_displacement"),
- ("MaterialTextureSlot", "map_emission", "use_map_emission"),
- ("MaterialTextureSlot", "map_emit", "use_map_emit"),
- ("MaterialTextureSlot", "map_hardness", "use_map_hardness"),
- ("MaterialTextureSlot", "map_mirror", "use_map_mirror"),
- ("MaterialTextureSlot", "map_normal", "use_map_normal"),
- ("MaterialTextureSlot", "map_raymir", "use_map_raymir"),
- ("MaterialTextureSlot", "map_reflection", "use_map_reflect"),
- ("MaterialTextureSlot", "map_scattering", "use_map_scatter"),
- ("MaterialTextureSlot", "map_specular", "use_map_specular"),
- ("MaterialTextureSlot", "map_translucency", "use_map_translucency"),
- ("MaterialTextureSlot", "map_warp", "use_map_warp"),
- ("WorldTextureSlot", "texture_coordinates", "texture_coords"),
- ("WorldTextureSlot", "map_blend", "use_map_blend"),
- ("WorldTextureSlot", "map_horizon", "use_map_horizon"),
- ("WorldTextureSlot", "map_zenith_down", "use_map_zenith_down"),
- ("WorldTextureSlot", "map_zenith_up", "use_map_zenith_up"),
- ("VoxelData", "still_frame_number", "still_frame"),
- ("WorldLighting", "ao_blend_mode", "ao_blend_type"),
- ("WorldLighting", "error_tolerance", "error_threshold"),
- ("WorldLighting", "use_ambient_occlusion", "use_ambient_occlusian"),
- ("WorldLighting", "pixel_cache", "use_cache"),
- ("WorldLighting", "use_environment_lighting", "use_environment_light"),
- ("WorldLighting", "use_indirect_lighting", "use_indirect_light"),
- ("WorldStarsSettings", "color_randomization", "color_random"),
- ("WorldStarsSettings", "min_distance", "distance_min"),
- ("WorldLighting", "falloff", "use_falloff"),
- ("Constraint", "disabled", "is_valid"),
- ("ClampToConstraint", "cyclic", "use_cyclic"),
- ("ImageTexture", "filter", "filter_type"),
- ("ImageTexture", "interpolation", "use_interpolation"),
- ("ImageTexture", "mipmap", "use_mipmap"),
- ("ImageUser", "frames", "frame_duration"),
- ("ImageUser", "offset", "frame_offset"),
- ("ImageUser", "cyclic", "use_cyclic"),
- ("ArmatureModifier", "invert", "invert_vertex_group"),
- ("ArmatureModifier", "quaternion", "use_deform_preserve_volume"),
- ("ArrayModifier", "length", "fit_length"),
- ("BevelModifier", "angle", "angle_limit"),
- ("BuildModifier", "length", "frame_duration"),
- ("BuildModifier", "randomize", "use_random_order"),
- ("CastModifier", "x", "use_x"),
- ("CastModifier", "y", "use_y"),
- ("CastModifier", "z", "use_z"),
- ("ExplodeModifier", "size", "use_size"),
- ("MaskModifier", "invert", "invert_vertex_group"),
- ("MeshDeformModifier", "invert", "invert_vertex_group"),
- ("MeshDeformModifier", "dynamic", "use_dynamic_bind"),
- ("MirrorModifier", "clip", "use_clip"),
- ("MirrorModifier", "x", "use_x"),
- ("MirrorModifier", "y", "use_y"),
- ("MirrorModifier", "z", "use_z"),
- ("ParticleInstanceModifier", "children", "use_children"),
- ("ParticleInstanceModifier", "normal", "use_normal"),
- ("ParticleInstanceModifier", "size", "use_size"),
- ("ShrinkwrapModifier", "negative", "use_negative_direction"),
- ("ShrinkwrapModifier", "positive", "use_positive_direction"),
- ("ShrinkwrapModifier", "x", "use_project_x"),
- ("ShrinkwrapModifier", "y", "use_project_y"),
- ("ShrinkwrapModifier", "z", "use_project_z"),
- ("ShrinkwrapModifier", "mode", "wrap_method"),
- ("SimpleDeformModifier", "mode", "deform_method"),
- ("SimpleDeformModifier", "relative", "use_relative"),
- ("SmoothModifier", "repeat", "iterations"),
- ("SmoothModifier", "x", "use_x"),
- ("SmoothModifier", "y", "use_y"),
- ("SmoothModifier", "z", "use_z"),
- ("SolidifyModifier", "invert", "invert_vertex_group"),
- ("WaveModifier", "cyclic", "use_cyclic"),
- ("WaveModifier", "normals", "use_normal"),
- ("WaveModifier", "x", "use_x"),
- ("WaveModifier", "y", "use_y"),
- ("DampedTrackConstraint", "track", "track_axis"),
- ("FloorConstraint", "sticky", "use_sticky"),
- ("FollowPathConstraint", "forward", "forward_axis"),
- ("FollowPathConstraint", "up", "up_axis"),
- ("LockedTrackConstraint", "lock", "lock_axis"),
- ("LockedTrackConstraint", "track", "track_axis"),
- ("MaintainVolumeConstraint", "axis", "free_axis"),
- ("TrackToConstraint", "track", "track_axis"),
- ("TrackToConstraint", "up", "up_axis"),
- ("GameProperty", "debug", "show_debug"),
- ("Image", "tiles", "use_tiles"),
- ("Lamp", "diffuse", "use_diffuse"),
- ("Lamp", "negative", "use_negative"),
- ("Lamp", "layer", "use_own_layer"),
- ("Lamp", "specular", "use_specular"),
- ("AreaLamp", "dither", "use_dither"),
- ("AreaLamp", "jitter", "use_jitter"),
- ("SpotLamp", "square", "use_square"),
- ("Material", "cubic", "use_cubic"),
- ("Material", "shadows", "use_shadows"),
- ("ParticleSettings", "amount", "count"),
- ("ParticleSettings", "display", "draw_percentage"),
- ("ParticleSettings", "velocity", "show_velocity"),
- ("ParticleSettings", "trand", "use_emit_random"),
- ("ParticleSettings", "parent", "use_parent_particles"),
- ("ParticleSettings", "emitter", "use_render_emitter"),
- ("ParticleSettings", "viewport", "use_simplify_viewport"),
- ("Texture", "brightness", "intensity"),
- ("CloudsTexture", "stype", "cloud_type"),
- ("EnvironmentMapTexture", "filter", "filter_type"),
- ("EnvironmentMapTexture", "mipmap", "use_mipmap"),
- ("MarbleTexture", "stype", "marble_type"),
- ("StucciTexture", "stype", "stucci_type"),
- ("WoodTexture", "stype", "wood_type"),
- ("World", "range", "color_range"),
- ("World", "lighting", "light_settings"),
- ("World", "mist", "mist_settings"),
- ("World", "stars", "star_settings"),
- ("MaterialHalo", "lines", "use_lines"),
- ("MaterialHalo", "ring", "use_ring"),
- ("MaterialHalo", "soft", "use_soft"),
- ("MaterialHalo", "star", "use_star"),
- ("MaterialHalo", "texture", "use_texture"),
- ("MaterialPhysics", "damp", "damping"),
- ("MaterialRaytraceTransparency", "limit", "depth_max"),
- ("NlaStrip", "reversed", "use_reverse"),
- ("CompositorNodeBlur", "bokeh", "use_bokeh"),
- ("CompositorNodeBlur", "gamma", "use_gamma_correction"),
- ("CompositorNodeBlur", "relative", "use_relative"),
- ("CompositorNodeChannelMatte", "high", "limit_max"),
- ("CompositorNodeChannelMatte", "low", "limit_min"),
- ("CompositorNodeChannelMatte", "channel", "matte_channel"),
- ("CompositorNodeChromaMatte", "cutoff", "threshold"),
- ("CompositorNodeColorMatte", "h", "color_hue"),
- ("CompositorNodeColorMatte", "s", "color_saturation"),
- ("CompositorNodeColorMatte", "v", "color_value"),
- ("CompositorNodeDBlur", "wrap", "use_wrap"),
- ("CompositorNodeDefocus", "preview", "use_preview"),
- ("CompositorNodeHueSat", "hue", "color_hue"),
- ("CompositorNodeHueSat", "sat", "color_saturation"),
- ("CompositorNodeHueSat", "val", "color_value"),
- ("CompositorNodeImage", "frames", "frame_duration"),
- ("CompositorNodeImage", "offset", "frame_offset"),
- ("CompositorNodeImage", "start", "frame_start"),
- ("CompositorNodeImage", "cyclic", "use_cyclic"),
- ("CompositorNodeInvert", "alpha", "invert_alpha"),
- ("CompositorNodeInvert", "rgb", "invert_rgb"),
- ("CompositorNodeLensdist", "fit", "use_fit"),
- ("CompositorNodeLensdist", "jitter", "use_jitter"),
- ("CompositorNodeMixRGB", "alpha", "use_alpha"),
- ("CompositorNodeRotate", "filter", "filter_type"),
- ("CompositorNodeTime", "end", "frame_end"),
- ("CompositorNodeTime", "start", "frame_start"),
- ("CompositorNodeVecBlur", "curved", "use_curved"),
- ("ShaderNodeExtendedMaterial", "diffuse", "use_diffuse"),
- ("ShaderNodeExtendedMaterial", "specular", "use_specular"),
- ("ShaderNodeMaterial", "diffuse", "use_diffuse"),
- ("ShaderNodeMaterial", "specular", "use_specular"),
- ("ShaderNodeMixRGB", "alpha", "use_alpha"),
- ("TextureNodeCurveTime", "end", "frame_end"),
- ("TextureNodeCurveTime", "start", "frame_start"),
- ("TextureNodeMixRGB", "alpha", "use_alpha"),
- ("TextureSlot", "negate", "invert"),
- ("TextureSlot", "size", "scale"),
- ("SoftBodySettings", "damp", "damping"),
- ("SequenceCrop", "right", "max_x"),
- ("SequenceCrop", "top", "max_y"),
- ("SequenceCrop", "bottom", "min_x"),
- ("SequenceCrop", "left", "min_y"),
- ("Sequence", "speed_fader", "speed_factor"),
- ("SpeedControlSequence", "global_speed", "multiply_speed"),
- ("SpeedControlSequence", "use_curve_velocity", "use_as_speed"),
- ("SpeedControlSequence", "use_curve_compress_y", "scale_to_length"),
- ("Key", "keys", "key_blocks"),
- ]
-
-
-from bpy.types import Operator
-
-
-class UpdateAnimData(Operator):
- """Update data paths from 2.56 and previous versions, modifying data paths of drivers and fcurves"""
- bl_idname = "anim.update_data_paths"
- bl_label = "Update Animation Data"
-
- def execute(self, context):
- import animsys_refactor
- animsys_refactor.update_data_paths(data_path_update)
- return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py
new file mode 100644
index 00000000000..109ca758ea8
--- /dev/null
+++ b/release/scripts/startup/bl_operators/console.py
@@ -0,0 +1,109 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
+import bpy
+from bpy.types import Operator
+from bpy.props import StringProperty
+
+
+class ConsoleExec(Operator):
+ '''Execute the current console line as a python expression'''
+ bl_idname = "console.execute"
+ bl_label = "Console Execute"
+
+ def execute(self, context):
+ sc = context.space_data
+
+ module = __import__("console_" + sc.language)
+ execute = getattr(module, "execute", None)
+
+ if execute:
+ return execute(context)
+ else:
+ print("Error: bpy.ops.console.execute_%s - not found" %
+ sc.language)
+ return {'FINISHED'}
+
+
+class ConsoleAutocomplete(Operator):
+ """Evaluate the namespace up until the cursor and give a list of """ \
+ """options or complete the name if there is only one"""
+ bl_idname = "console.autocomplete"
+ bl_label = "Console Autocomplete"
+
+ def execute(self, context):
+ sc = context.space_data
+ module = __import__("console_" + sc.language)
+ autocomplete = getattr(module, "autocomplete", None)
+
+ if autocomplete:
+ return autocomplete(context)
+ else:
+ print("Error: bpy.ops.console.autocomplete_%s - not found" %
+ sc.language)
+ return {'FINISHED'}
+
+
+class ConsoleBanner(Operator):
+ '''Print a message whem the terminal initializes'''
+ bl_idname = "console.banner"
+ bl_label = "Console Banner"
+
+ def execute(self, context):
+ sc = context.space_data
+
+ # default to python
+ if not sc.language:
+ sc.language = 'python'
+
+ module = __import__("console_" + sc.language)
+ banner = getattr(module, "banner", None)
+
+ if banner:
+ return banner(context)
+ else:
+ print("Error: bpy.ops.console.banner_%s - not found" %
+ sc.language)
+ return {'FINISHED'}
+
+
+class ConsoleLanguage(Operator):
+ '''Set the current language for this console'''
+ bl_idname = "console.language"
+ bl_label = "Console Language"
+
+ language = StringProperty(
+ name="Language",
+ maxlen=32,
+ )
+
+ def execute(self, context):
+ sc = context.space_data
+
+ # defailt to python
+ sc.language = self.language
+
+ bpy.ops.console.banner()
+
+ # insert a new blank line
+ bpy.ops.console.history_append(text="", current_character=0,
+ remove_duplicates=True)
+
+ return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py
index 2b190e1aee1..d0778ddafb2 100644
--- a/release/scripts/startup/bl_operators/image.py
+++ b/release/scripts/startup/bl_operators/image.py
@@ -69,8 +69,6 @@ class EditExternally(Operator):
self.report({'ERROR'}, "Image path not set")
return {'CANCELLED'}
- filepath = os.path.normpath(bpy.path.abspath(filepath))
-
if not os.path.exists(filepath):
self.report({'ERROR'},
"Image path %r not found, image may be packed or "
@@ -93,15 +91,16 @@ class EditExternally(Operator):
return {'FINISHED'}
def invoke(self, context, event):
+ import os
try:
- filepath = context.space_data.image.filepath
- except:
- import traceback
- traceback.print_exc()
- self.report({'ERROR'}, "Image not found on disk")
+ image = context.space_data.image
+ except AttributeError:
+ self.report({'ERROR'}, "Context incorrect, image not found")
return {'CANCELLED'}
- self.filepath = filepath
+ filepath = bpy.path.abspath(image.filepath, library=image.library)
+
+ self.filepath = os.path.normpath(filepath)
self.execute(context)
return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py
index 5f6583754e9..bf9fa562ee1 100644
--- a/release/scripts/startup/bl_operators/mesh.py
+++ b/release/scripts/startup/bl_operators/mesh.py
@@ -25,7 +25,7 @@ from bpy.props import EnumProperty
class MeshSelectInteriorFaces(Operator):
- '''Select faces where all edges have more then 2 face users.'''
+ '''Select faces where all edges have more then 2 face users'''
bl_idname = "mesh.faces_select_interior"
bl_label = "Select Interior Faces"
diff --git a/release/scripts/startup/bl_operators/nla.py b/release/scripts/startup/bl_operators/nla.py
deleted file mode 100644
index feb0016b1c7..00000000000
--- a/release/scripts/startup/bl_operators/nla.py
+++ /dev/null
@@ -1,306 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <pep8-80 compliant>
-
-import bpy
-from bpy.types import Operator
-
-
-def pose_frame_info(obj):
- from mathutils import Matrix
-
- info = {}
-
- pose = obj.pose
-
- pose_items = pose.bones.items()
-
- for name, pbone in pose_items:
- binfo = {}
- bone = pbone.bone
-
- binfo["parent"] = getattr(bone.parent, "name", None)
- binfo["bone"] = bone
- binfo["pbone"] = pbone
- binfo["matrix_local"] = bone.matrix_local.copy()
- try:
- binfo["matrix_local_inv"] = binfo["matrix_local"].inverted()
- except:
- binfo["matrix_local_inv"] = Matrix()
-
- binfo["matrix"] = bone.matrix.copy()
- binfo["matrix_pose"] = pbone.matrix.copy()
- try:
- binfo["matrix_pose_inv"] = binfo["matrix_pose"].inverted()
- except:
- binfo["matrix_pose_inv"] = Matrix()
-
- info[name] = binfo
-
- for name, pbone in pose_items:
- binfo = info[name]
- binfo_parent = binfo.get("parent", None)
- if binfo_parent:
- binfo_parent = info[binfo_parent]
-
- matrix = binfo["matrix_pose"]
- rest_matrix = binfo["matrix_local"]
-
- if binfo_parent:
- matrix = binfo_parent["matrix_pose_inv"] * matrix
- rest_matrix = binfo_parent["matrix_local_inv"] * rest_matrix
-
- binfo["matrix_key"] = rest_matrix.inverted() * matrix
-
- return info
-
-
-def obj_frame_info(obj):
- info = {}
- # parent = obj.parent
- info["matrix_key"] = obj.matrix_local.copy()
- return info
-
-
-def bake(frame_start,
- frame_end, step=1,
- only_selected=False,
- do_pose=True,
- do_object=True,
- do_constraint_clear=False,
- action=None):
-
- scene = bpy.context.scene
- obj = bpy.context.object
- pose = obj.pose
- frame_back = scene.frame_current
-
- if pose is None:
- do_pose = False
-
- if do_pose is None and do_object is None:
- return None
-
- pose_info = []
- obj_info = []
-
- frame_range = range(frame_start, frame_end + 1, step)
-
- # -------------------------------------------------------------------------
- # Collect transformations
-
- # could speed this up by applying steps here too...
- for f in frame_range:
- scene.frame_set(f)
-
- if do_pose:
- pose_info.append(pose_frame_info(obj))
- if do_object:
- obj_info.append(obj_frame_info(obj))
-
- f += 1
-
- # -------------------------------------------------------------------------
- # Create action
-
- # incase animation data hassnt been created
- atd = obj.animation_data_create()
- if action is None:
- action = bpy.data.actions.new("Action")
- atd.action = action
-
- if do_pose:
- pose_items = pose.bones.items()
- else:
- pose_items = [] # skip
-
- # -------------------------------------------------------------------------
- # Apply transformations to action
-
- # pose
- for name, pbone in (pose_items if do_pose else ()):
- if only_selected and not pbone.bone.select:
- continue
-
- if do_constraint_clear:
- while pbone.constraints:
- pbone.constraints.remove(pbone.constraints[0])
-
- for f in frame_range:
- matrix = pose_info[(f - frame_start) // step][name]["matrix_key"]
-
- # pbone.location = matrix.to_translation()
- # pbone.rotation_quaternion = matrix.to_quaternion()
- pbone.matrix_basis = matrix
-
- pbone.keyframe_insert("location", -1, f, name)
-
- rotation_mode = pbone.rotation_mode
-
- if rotation_mode == 'QUATERNION':
- pbone.keyframe_insert("rotation_quaternion", -1, f, name)
- elif rotation_mode == 'AXIS_ANGLE':
- pbone.keyframe_insert("rotation_axis_angle", -1, f, name)
- else: # euler, XYZ, ZXY etc
- pbone.keyframe_insert("rotation_euler", -1, f, name)
-
- pbone.keyframe_insert("scale", -1, f, name)
-
- # object. TODO. multiple objects
- if do_object:
- if do_constraint_clear:
- while obj.constraints:
- obj.constraints.remove(obj.constraints[0])
-
- for f in frame_range:
- matrix = obj_info[(f - frame_start) // step]["matrix_key"]
- obj.matrix_local = matrix
-
- obj.keyframe_insert("location", -1, f)
-
- rotation_mode = obj.rotation_mode
-
- if rotation_mode == 'QUATERNION':
- obj.keyframe_insert("rotation_quaternion", -1, f)
- elif rotation_mode == 'AXIS_ANGLE':
- obj.keyframe_insert("rotation_axis_angle", -1, f)
- else: # euler, XYZ, ZXY etc
- obj.keyframe_insert("rotation_euler", -1, f)
-
- obj.keyframe_insert("scale", -1, f)
-
- scene.frame_set(frame_back)
-
- return action
-
-
-from bpy.props import IntProperty, BoolProperty, EnumProperty
-
-
-class BakeAction(Operator):
- '''Bake animation to an Action'''
- bl_idname = "nla.bake"
- bl_label = "Bake Action"
- bl_options = {'REGISTER', 'UNDO'}
-
- frame_start = IntProperty(
- name="Start Frame",
- description="Start frame for baking",
- min=0, max=300000,
- default=1,
- )
- frame_end = IntProperty(
- name="End Frame",
- description="End frame for baking",
- min=1, max=300000,
- default=250,
- )
- step = IntProperty(
- name="Frame Step",
- description="Frame Step",
- min=1, max=120,
- default=1,
- )
- only_selected = BoolProperty(
- name="Only Selected",
- default=True,
- )
- clear_consraints = BoolProperty(
- name="Clear Constraints",
- default=False,
- )
- bake_types = EnumProperty(
- name="Bake Data",
- options={'ENUM_FLAG'},
- items=(('POSE', "Pose", ""),
- ('OBJECT', "Object", ""),
- ),
- default={'POSE'},
- )
-
- def execute(self, context):
-
- action = bake(self.frame_start,
- self.frame_end,
- self.step,
- self.only_selected,
- 'POSE' in self.bake_types,
- 'OBJECT' in self.bake_types,
- self.clear_consraints,
- )
-
- if action is None:
- self.report({'INFO'}, "Nothing to bake")
- return {'CANCELLED'}
-
- # basic cleanup, could move elsewhere
- for fcu in action.fcurves:
- keyframe_points = fcu.keyframe_points
- i = 1
- while i < len(fcu.keyframe_points) - 1:
- val_prev = keyframe_points[i - 1].co[1]
- val_next = keyframe_points[i + 1].co[1]
- val = keyframe_points[i].co[1]
-
- if abs(val - val_prev) + abs(val - val_next) < 0.0001:
- keyframe_points.remove(keyframe_points[i])
- else:
- i += 1
-
- return {'FINISHED'}
-
- def invoke(self, context, event):
- wm = context.window_manager
- return wm.invoke_props_dialog(self)
-
-
-class ClearUselessActions(Operator):
- '''Mark actions with no F-Curves for deletion after save+reload of ''' \
- '''file preserving "action libraries"'''
- bl_idname = "anim.clear_useless_actions"
- bl_label = "Clear Useless Actions"
- bl_options = {'REGISTER', 'UNDO'}
-
- only_unused = BoolProperty(name="Only Unused",
- description="Only unused (Fake User only) actions get considered",
- default=True)
-
- @classmethod
- def poll(cls, context):
- return len(bpy.data.actions) != 0
-
- def execute(self, context):
- removed = 0
-
- for action in bpy.data.actions:
- # if only user is "fake" user...
- if ((self.only_unused is False) or
- (action.use_fake_user and action.users == 1)):
-
- # if it has F-Curves, then it's a "action library"
- # (i.e. walk, wave, jump, etc.)
- # and should be left alone as that's what fake users are for!
- if not action.fcurves:
- # mark action for deletion
- action.user_clear()
- removed += 1
-
- self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions"
- % removed)
- return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py
index 50e9bfb5b98..dd052c36ade 100644
--- a/release/scripts/startup/bl_operators/object_align.py
+++ b/release/scripts/startup/bl_operators/object_align.py
@@ -140,7 +140,7 @@ def align_objects(align_x,
for obj, bb_world in objs:
- if bb_quality:
+ if bb_quality and obj.type == 'MESH':
GBB = GlobalBB_HQ(obj)
else:
GBB = GlobalBB_LQ(bb_world)
@@ -204,7 +204,7 @@ def align_objects(align_x,
matrix_world = obj.matrix_world.copy()
bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
- if bb_quality:
+ if bb_quality and obj.type == 'MESH':
GBB = GlobalBB_HQ(obj)
else:
GBB = GlobalBB_LQ(bb_world)
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index c13a04eb87a..490ee230220 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -462,10 +462,10 @@ class QuickFluid(Operator):
if self.style == 'INFLOW':
mod.settings.type = 'INFLOW'
- mod.settings.inflow_velocity = self.initial_velocity.copy()
+ mod.settings.inflow_velocity = self.initial_velocity
else:
mod.settings.type = 'FLUID'
- mod.settings.initial_velocity = self.initial_velocity.copy()
+ mod.settings.initial_velocity = self.initial_velocity
obj.hide_render = not self.show_flows
if not self.show_flows:
diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index c2a09d6a4ae..3479a3f9e53 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -66,7 +66,7 @@ def guess_player_path(preset):
class PlayRenderedAnim(Operator):
- '''Plays back rendered frames/movies using an external player.'''
+ '''Plays back rendered frames/movies using an external player'''
bl_idname = "render.play_rendered_anim"
bl_label = "Play Rendered Animation"
bl_options = {'REGISTER'}
@@ -136,7 +136,8 @@ class PlayRenderedAnim(Operator):
del process
# -----------------------------------------------------------------
- opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), file]
+ opts = ["-a", "-f", str(rd.fps), str(rd.fps_base),
+ "-j", str(scene.frame_step), file]
cmd.extend(opts)
elif preset == 'DJV':
opts = [file, "-playback_speed", "%d" % int(rd.fps / rd.fps_base)]
@@ -166,9 +167,8 @@ class PlayRenderedAnim(Operator):
print("Executing command:\n %r" % " ".join(cmd))
try:
- process = subprocess.Popen(cmd)
+ subprocess.Popen(cmd)
except Exception as e:
- import traceback
self.report({'ERROR'},
"Couldn't run external animation player with command "
"%r\n%s" % (" ".join(cmd), str(e)))
diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py
index 53654ffbc6f..67b9be59f2a 100644
--- a/release/scripts/startup/bl_operators/sequencer.py
+++ b/release/scripts/startup/bl_operators/sequencer.py
@@ -25,7 +25,7 @@ from bpy.props import IntProperty
class SequencerCrossfadeSounds(Operator):
- '''Do crossfading volume animation of two selected sound strips.'''
+ '''Do crossfading volume animation of two selected sound strips'''
bl_idname = "sequencer.crossfade_sounds"
bl_label = "Crossfade sounds"
@@ -76,7 +76,7 @@ class SequencerCrossfadeSounds(Operator):
class SequencerCutMulticam(Operator):
- '''Cut multicam strip and select camera.'''
+ '''Cut multicam strip and select camera'''
bl_idname = "sequencer.cut_multicam"
bl_label = "Cut multicam"
@@ -118,7 +118,7 @@ class SequencerCutMulticam(Operator):
class SequencerDeinterlaceSelectedMovies(Operator):
- '''Deinterlace all selected movie sources.'''
+ '''Deinterlace all selected movie sources'''
bl_idname = "sequencer.deinterlace_selected_movies"
bl_label = "Deinterlace Movies"
diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
index c4466e6453f..5985a37a0c9 100644
--- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py
+++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
@@ -1105,7 +1105,8 @@ from bpy.props import FloatProperty
class SmartProject(Operator):
- '''This script projection unwraps the selected faces of a mesh. it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces.'''
+ '''This script projection unwraps the selected faces of a mesh. ''' \
+ '''it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces'''
bl_idname = "uv.smart_project"
bl_label = "Smart UV Project"
bl_options = {'REGISTER', 'UNDO'}
diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py
new file mode 100644
index 00000000000..05b53219119
--- /dev/null
+++ b/release/scripts/startup/bl_operators/view3d.py
@@ -0,0 +1,88 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
+import bpy
+from bpy.types import Operator
+
+
+class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator):
+ "Extrude individual elements and move"
+ bl_label = "Extrude Individual and Move"
+ bl_idname = "view3d.edit_mesh_extrude_individual_move"
+
+ def execute(self, context):
+ mesh = context.object.data
+ select_mode = context.tool_settings.mesh_select_mode
+
+ totface = mesh.total_face_sel
+ totedge = mesh.total_edge_sel
+ # totvert = mesh.total_vert_sel
+
+ if select_mode[2] and totface == 1:
+ bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN',
+ TRANSFORM_OT_translate={
+ "constraint_orientation": 'NORMAL',
+ "constraint_axis": (False, False, True)})
+ elif select_mode[2] and totface > 1:
+ bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN')
+ elif select_mode[1] and totedge >= 1:
+ bpy.ops.mesh.extrude_edges_move('INVOKE_REGION_WIN')
+ else:
+ bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN')
+
+ # ignore return from operators above because they are 'RUNNING_MODAL',
+ # and cause this one not to be freed. [#24671]
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ return self.execute(context)
+
+
+class VIEW3D_OT_edit_mesh_extrude_move(Operator):
+ "Extrude and move along normals"
+ bl_label = "Extrude and Move on Normals"
+ bl_idname = "view3d.edit_mesh_extrude_move_normal"
+
+ def execute(self, context):
+ mesh = context.object.data
+
+ totface = mesh.total_face_sel
+ totedge = mesh.total_edge_sel
+ # totvert = mesh.total_vert_sel
+
+ if totface >= 1:
+ bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN',
+ TRANSFORM_OT_translate={
+ "constraint_orientation": 'NORMAL',
+ "constraint_axis": (False, False, True)})
+ elif totedge == 1:
+ bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN',
+ TRANSFORM_OT_translate={
+ "constraint_orientation": 'NORMAL',
+ "constraint_axis": (True, True, False)})
+ else:
+ bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
+
+ # ignore return from operators above because they are 'RUNNING_MODAL',
+ # and cause this one not to be freed. [#24671]
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ return self.execute(context)
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 861255f167f..85e79914ce3 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -172,7 +172,7 @@ class BRUSH_OT_active_index_set(Operator):
class WM_OT_context_set_boolean(Operator):
- '''Set a context value.'''
+ '''Set a context value'''
bl_idname = "wm.context_set_boolean"
bl_label = "Context Set Boolean"
bl_options = {'UNDO', 'INTERNAL'}
@@ -188,7 +188,7 @@ class WM_OT_context_set_boolean(Operator):
class WM_OT_context_set_int(Operator): # same as enum
- '''Set a context value.'''
+ '''Set a context value'''
bl_idname = "wm.context_set_int"
bl_label = "Context Set"
bl_options = {'UNDO', 'INTERNAL'}
@@ -205,7 +205,7 @@ class WM_OT_context_set_int(Operator): # same as enum
class WM_OT_context_scale_int(Operator):
- '''Scale an int context value.'''
+ '''Scale an int context value'''
bl_idname = "wm.context_scale_int"
bl_label = "Context Set"
bl_options = {'UNDO', 'INTERNAL'}
@@ -248,7 +248,7 @@ class WM_OT_context_scale_int(Operator):
class WM_OT_context_set_float(Operator): # same as enum
- '''Set a context value.'''
+ '''Set a context value'''
bl_idname = "wm.context_set_float"
bl_label = "Context Set Float"
bl_options = {'UNDO', 'INTERNAL'}
@@ -265,7 +265,7 @@ class WM_OT_context_set_float(Operator): # same as enum
class WM_OT_context_set_string(Operator): # same as enum
- '''Set a context value.'''
+ '''Set a context value'''
bl_idname = "wm.context_set_string"
bl_label = "Context Set String"
bl_options = {'UNDO', 'INTERNAL'}
@@ -281,7 +281,7 @@ class WM_OT_context_set_string(Operator): # same as enum
class WM_OT_context_set_enum(Operator):
- '''Set a context value.'''
+ '''Set a context value'''
bl_idname = "wm.context_set_enum"
bl_label = "Context Set Enum"
bl_options = {'UNDO', 'INTERNAL'}
@@ -297,7 +297,7 @@ class WM_OT_context_set_enum(Operator):
class WM_OT_context_set_value(Operator):
- '''Set a context value.'''
+ '''Set a context value'''
bl_idname = "wm.context_set_value"
bl_label = "Context Set Value"
bl_options = {'UNDO', 'INTERNAL'}
@@ -318,7 +318,7 @@ class WM_OT_context_set_value(Operator):
class WM_OT_context_toggle(Operator):
- '''Toggle a context value.'''
+ '''Toggle a context value'''
bl_idname = "wm.context_toggle"
bl_label = "Context Toggle"
bl_options = {'UNDO', 'INTERNAL'}
@@ -337,7 +337,7 @@ class WM_OT_context_toggle(Operator):
class WM_OT_context_toggle_enum(Operator):
- '''Toggle a context value.'''
+ '''Toggle a context value'''
bl_idname = "wm.context_toggle_enum"
bl_label = "Context Toggle Values"
bl_options = {'UNDO', 'INTERNAL'}
@@ -371,7 +371,7 @@ class WM_OT_context_toggle_enum(Operator):
class WM_OT_context_cycle_int(Operator):
'''Set a context value. Useful for cycling active material, '''
- '''vertex keys, groups' etc.'''
+ '''vertex keys, groups' etc'''
bl_idname = "wm.context_cycle_int"
bl_label = "Context Int Cycle"
bl_options = {'UNDO', 'INTERNAL'}
@@ -405,7 +405,7 @@ class WM_OT_context_cycle_int(Operator):
class WM_OT_context_cycle_enum(Operator):
- '''Toggle a context value.'''
+ '''Toggle a context value'''
bl_idname = "wm.context_cycle_enum"
bl_label = "Context Enum Cycle"
bl_options = {'UNDO', 'INTERNAL'}
@@ -458,7 +458,7 @@ class WM_OT_context_cycle_enum(Operator):
class WM_OT_context_cycle_array(Operator):
'''Set a context array value.
- Useful for cycling the active mesh edit mode.'''
+ Useful for cycling the active mesh edit mode'''
bl_idname = "wm.context_cycle_array"
bl_label = "Context Array Cycle"
bl_options = {'UNDO', 'INTERNAL'}
@@ -518,7 +518,7 @@ class WM_OT_context_menu_enum(Operator):
class WM_OT_context_set_id(Operator):
- '''Toggle a context value.'''
+ '''Toggle a context value'''
bl_idname = "wm.context_set_id"
bl_label = "Set Library ID"
bl_options = {'UNDO', 'INTERNAL'}
@@ -1179,3 +1179,573 @@ class WM_OT_copy_prev_settings(Operator):
return {'FINISHED'}
return {'CANCELLED'}
+
+
+class WM_OT_keyconfig_test(Operator):
+ "Test keyconfig for conflicts"
+ bl_idname = "wm.keyconfig_test"
+ bl_label = "Test Key Configuration for Conflicts"
+
+ def execute(self, context):
+ from bpy_extras import keyconfig_utils
+
+ wm = context.window_manager
+ kc = wm.keyconfigs.default
+
+ if keyconfig_utils.keyconfig_test(kc):
+ print("CONFLICT")
+
+ return {'FINISHED'}
+
+
+class WM_OT_keyconfig_import(Operator):
+ "Import key configuration from a python script"
+ bl_idname = "wm.keyconfig_import"
+ bl_label = "Import Key Configuration..."
+
+ filepath = StringProperty(
+ name="File Path",
+ description="Filepath to write file to",
+ default="keymap.py",
+ )
+ filter_folder = BoolProperty(
+ name="Filter folders",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_text = BoolProperty(
+ name="Filter text",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_python = BoolProperty(
+ name="Filter python",
+ default=True,
+ options={'HIDDEN'},
+ )
+ keep_original = BoolProperty(
+ name="Keep original",
+ description="Keep original file after copying to configuration folder",
+ default=True,
+ )
+
+ def execute(self, context):
+ import os
+ from os.path import basename
+ import shutil
+
+ if not self.filepath:
+ self.report({'ERROR'}, "Filepath not set")
+ return {'CANCELLED'}
+
+ config_name = basename(self.filepath)
+
+ path = bpy.utils.user_resource('SCRIPTS', os.path.join("presets", "keyconfig"), create=True)
+ path = os.path.join(path, config_name)
+
+ try:
+ if self.keep_original:
+ shutil.copy(self.filepath, path)
+ else:
+ shutil.move(self.filepath, path)
+ except Exception as e:
+ self.report({'ERROR'}, "Installing keymap failed: %s" % e)
+ return {'CANCELLED'}
+
+ # sneaky way to check we're actually running the code.
+ bpy.utils.keyconfig_set(path)
+
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ wm = context.window_manager
+ wm.fileselect_add(self)
+ return {'RUNNING_MODAL'}
+
+# This operator is also used by interaction presets saving - AddPresetBase
+
+
+class WM_OT_keyconfig_export(Operator):
+ "Export key configuration to a python script"
+ bl_idname = "wm.keyconfig_export"
+ bl_label = "Export Key Configuration..."
+
+ filepath = StringProperty(
+ name="File Path",
+ description="Filepath to write file to",
+ default="keymap.py",
+ )
+ filter_folder = BoolProperty(
+ name="Filter folders",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_text = BoolProperty(
+ name="Filter text",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_python = BoolProperty(
+ name="Filter python",
+ default=True,
+ options={'HIDDEN'},
+ )
+
+ def execute(self, context):
+ from bpy_extras import keyconfig_utils
+
+ if not self.filepath:
+ raise Exception("Filepath not set")
+
+ if not self.filepath.endswith('.py'):
+ self.filepath += '.py'
+
+ wm = context.window_manager
+
+ keyconfig_utils.keyconfig_export(wm,
+ wm.keyconfigs.active,
+ self.filepath,
+ )
+
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ wm = context.window_manager
+ wm.fileselect_add(self)
+ return {'RUNNING_MODAL'}
+
+
+class WM_OT_keymap_restore(Operator):
+ "Restore key map(s)"
+ bl_idname = "wm.keymap_restore"
+ bl_label = "Restore Key Map(s)"
+
+ all = BoolProperty(
+ name="All Keymaps",
+ description="Restore all keymaps to default",
+ )
+
+ def execute(self, context):
+ wm = context.window_manager
+
+ if self.all:
+ for km in wm.keyconfigs.user.keymaps:
+ km.restore_to_default()
+ else:
+ km = context.keymap
+ km.restore_to_default()
+
+ return {'FINISHED'}
+
+
+class WM_OT_keyitem_restore(Operator):
+ "Restore key map item"
+ bl_idname = "wm.keyitem_restore"
+ bl_label = "Restore Key Map Item"
+
+ item_id = IntProperty(
+ name="Item Identifier",
+ description="Identifier of the item to remove",
+ )
+
+ @classmethod
+ def poll(cls, context):
+ keymap = getattr(context, "keymap", None)
+ return keymap
+
+ def execute(self, context):
+ km = context.keymap
+ kmi = km.keymap_items.from_id(self.item_id)
+
+ if (not kmi.is_user_defined) and kmi.is_user_modified:
+ km.restore_item_to_default(kmi)
+
+ return {'FINISHED'}
+
+
+class WM_OT_keyitem_add(Operator):
+ "Add key map item"
+ bl_idname = "wm.keyitem_add"
+ bl_label = "Add Key Map Item"
+
+ def execute(self, context):
+ km = context.keymap
+
+ if km.is_modal:
+ km.keymap_items.new_modal("", 'A', 'PRESS') # kmi
+ else:
+ km.keymap_items.new("none", 'A', 'PRESS') # kmi
+
+ # clear filter and expand keymap so we can see the newly added item
+ if context.space_data.filter_text != "":
+ context.space_data.filter_text = ""
+ km.show_expanded_items = True
+ km.show_expanded_children = True
+
+ return {'FINISHED'}
+
+
+class WM_OT_keyitem_remove(Operator):
+ "Remove key map item"
+ bl_idname = "wm.keyitem_remove"
+ bl_label = "Remove Key Map Item"
+
+ item_id = IntProperty(
+ name="Item Identifier",
+ description="Identifier of the item to remove",
+ )
+
+ @classmethod
+ def poll(cls, context):
+ return hasattr(context, "keymap")
+
+ def execute(self, context):
+ km = context.keymap
+ kmi = km.keymap_items.from_id(self.item_id)
+ km.keymap_items.remove(kmi)
+ return {'FINISHED'}
+
+
+class WM_OT_keyconfig_remove(Operator):
+ "Remove key config"
+ bl_idname = "wm.keyconfig_remove"
+ bl_label = "Remove Key Config"
+
+ @classmethod
+ def poll(cls, context):
+ wm = context.window_manager
+ keyconf = wm.keyconfigs.active
+ return keyconf and keyconf.is_user_defined
+
+ def execute(self, context):
+ wm = context.window_manager
+ keyconfig = wm.keyconfigs.active
+ wm.keyconfigs.remove(keyconfig)
+ return {'FINISHED'}
+
+
+class WM_OT_operator_cheat_sheet(Operator):
+ bl_idname = "wm.operator_cheat_sheet"
+ bl_label = "Operator Cheat Sheet"
+
+ def execute(self, context):
+ op_strings = []
+ tot = 0
+ for op_module_name in dir(bpy.ops):
+ op_module = getattr(bpy.ops, op_module_name)
+ for op_submodule_name in dir(op_module):
+ op = getattr(op_module, op_submodule_name)
+ text = repr(op)
+ if text.split("\n")[-1].startswith('bpy.ops.'):
+ op_strings.append(text)
+ tot += 1
+
+ op_strings.append('')
+
+ textblock = bpy.data.texts.new("OperatorList.txt")
+ textblock.write('# %d Operators\n\n' % tot)
+ textblock.write('\n'.join(op_strings))
+ self.report({'INFO'}, "See OperatorList.txt textblock")
+ return {'FINISHED'}
+
+
+class WM_OT_addon_enable(Operator):
+ "Enable an addon"
+ bl_idname = "wm.addon_enable"
+ bl_label = "Enable Add-On"
+
+ module = StringProperty(
+ name="Module",
+ description="Module name of the addon to enable",
+ )
+
+ def execute(self, context):
+ import addon_utils
+
+ mod = addon_utils.enable(self.module)
+
+ if mod:
+ info = addon_utils.module_bl_info(mod)
+
+ info_ver = info.get("blender", (0, 0, 0))
+
+ if info_ver > bpy.app.version:
+ self.report({'WARNING'}, ("This script was written Blender "
+ "version %d.%d.%d and might not "
+ "function (correctly), "
+ "though it is enabled") %
+ info_ver)
+ return {'FINISHED'}
+ else:
+ return {'CANCELLED'}
+
+
+class WM_OT_addon_disable(Operator):
+ "Disable an addon"
+ bl_idname = "wm.addon_disable"
+ bl_label = "Disable Add-On"
+
+ module = StringProperty(
+ name="Module",
+ description="Module name of the addon to disable",
+ )
+
+ def execute(self, context):
+ import addon_utils
+
+ addon_utils.disable(self.module)
+ return {'FINISHED'}
+
+
+class WM_OT_addon_install(Operator):
+ "Install an addon"
+ bl_idname = "wm.addon_install"
+ bl_label = "Install Add-On..."
+
+ overwrite = BoolProperty(
+ name="Overwrite",
+ description="Remove existing addons with the same ID",
+ default=True,
+ )
+ target = EnumProperty(
+ name="Target Path",
+ items=(('DEFAULT', "Default", ""),
+ ('PREFS', "User Prefs", "")),
+ )
+
+ filepath = StringProperty(
+ name="File Path",
+ description="File path to write file to",
+ )
+ filter_folder = BoolProperty(
+ name="Filter folders",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_python = BoolProperty(
+ name="Filter python",
+ default=True,
+ options={'HIDDEN'},
+ )
+ filter_glob = StringProperty(
+ default="*.py;*.zip",
+ options={'HIDDEN'},
+ )
+
+ @staticmethod
+ def _module_remove(path_addons, module):
+ import os
+ module = os.path.splitext(module)[0]
+ for f in os.listdir(path_addons):
+ f_base = os.path.splitext(f)[0]
+ if f_base == module:
+ f_full = os.path.join(path_addons, f)
+
+ if os.path.isdir(f_full):
+ os.rmdir(f_full)
+ else:
+ os.remove(f_full)
+
+ def execute(self, context):
+ import addon_utils
+ import traceback
+ import zipfile
+ import shutil
+ import os
+
+ pyfile = self.filepath
+
+ if self.target == 'DEFAULT':
+ # dont use bpy.utils.script_paths("addons") because we may not be able to write to it.
+ path_addons = bpy.utils.user_resource('SCRIPTS', "addons", create=True)
+ else:
+ path_addons = bpy.context.user_preferences.filepaths.script_directory
+ if path_addons:
+ path_addons = os.path.join(path_addons, "addons")
+
+ if not path_addons:
+ self.report({'ERROR'}, "Failed to get addons path")
+ return {'CANCELLED'}
+
+ # create dir is if missing.
+ if not os.path.exists(path_addons):
+ os.makedirs(path_addons)
+
+ # Check if we are installing from a target path,
+ # doing so causes 2+ addons of same name or when the same from/to
+ # location is used, removal of the file!
+ addon_path = ""
+ pyfile_dir = os.path.dirname(pyfile)
+ for addon_path in addon_utils.paths():
+ if os.path.samefile(pyfile_dir, addon_path):
+ self.report({'ERROR'}, "Source file is in the addon search path: %r" % addon_path)
+ return {'CANCELLED'}
+ del addon_path
+ del pyfile_dir
+ # done checking for exceptional case
+
+ addons_old = {mod.__name__ for mod in addon_utils.modules(addon_utils.addons_fake_modules)}
+
+ #check to see if the file is in compressed format (.zip)
+ if zipfile.is_zipfile(pyfile):
+ try:
+ file_to_extract = zipfile.ZipFile(pyfile, 'r')
+ except:
+ traceback.print_exc()
+ return {'CANCELLED'}
+
+ if self.overwrite:
+ for f in file_to_extract.namelist():
+ WM_OT_addon_install._module_remove(path_addons, f)
+ else:
+ for f in file_to_extract.namelist():
+ path_dest = os.path.join(path_addons, os.path.basename(f))
+ if os.path.exists(path_dest):
+ self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
+ return {'CANCELLED'}
+
+ try: # extract the file to "addons"
+ file_to_extract.extractall(path_addons)
+
+ # zip files can create this dir with metadata, don't need it
+ macosx_dir = os.path.join(path_addons, '__MACOSX')
+ if os.path.isdir(macosx_dir):
+ shutil.rmtree(macosx_dir)
+
+ except:
+ traceback.print_exc()
+ return {'CANCELLED'}
+
+ else:
+ path_dest = os.path.join(path_addons, os.path.basename(pyfile))
+
+ if self.overwrite:
+ WM_OT_addon_install._module_remove(path_addons, os.path.basename(pyfile))
+ elif os.path.exists(path_dest):
+ self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
+ return {'CANCELLED'}
+
+ #if not compressed file just copy into the addon path
+ try:
+ shutil.copyfile(pyfile, path_dest)
+
+ except:
+ traceback.print_exc()
+ return {'CANCELLED'}
+
+ addons_new = {mod.__name__ for mod in addon_utils.modules(addon_utils.addons_fake_modules)} - addons_old
+ addons_new.discard("modules")
+
+ # disable any addons we may have enabled previously and removed.
+ # this is unlikely but do just incase. bug [#23978]
+ for new_addon in addons_new:
+ addon_utils.disable(new_addon)
+
+ # possible the zip contains multiple addons, we could disallow this
+ # but for now just use the first
+ for mod in addon_utils.modules(addon_utils.addons_fake_modules):
+ if mod.__name__ in addons_new:
+ info = addon_utils.module_bl_info(mod)
+
+ # show the newly installed addon.
+ context.window_manager.addon_filter = 'All'
+ context.window_manager.addon_search = info["name"]
+ break
+
+ # incase a new module path was created to install this addon.
+ bpy.utils.refresh_script_paths()
+
+ # TODO, should not be a warning.
+ # self.report({'WARNING'}, "File installed to '%s'\n" % path_dest)
+ return {'FINISHED'}
+
+ def invoke(self, context, event):
+ wm = context.window_manager
+ wm.fileselect_add(self)
+ return {'RUNNING_MODAL'}
+
+
+class WM_OT_addon_remove(Operator):
+ "Disable an addon"
+ bl_idname = "wm.addon_remove"
+ bl_label = "Remove Add-On"
+
+ module = StringProperty(
+ name="Module",
+ description="Module name of the addon to remove",
+ )
+
+ @staticmethod
+ def path_from_addon(module):
+ import os
+ import addon_utils
+
+ for mod in addon_utils.modules(addon_utils.addons_fake_modules):
+ if mod.__name__ == module:
+ filepath = mod.__file__
+ if os.path.exists(filepath):
+ if os.path.splitext(os.path.basename(filepath))[0] == "__init__":
+ return os.path.dirname(filepath), True
+ else:
+ return filepath, False
+ return None, False
+
+ def execute(self, context):
+ import addon_utils
+ import os
+
+ path, isdir = WM_OT_addon_remove.path_from_addon(self.module)
+ if path is None:
+ self.report('WARNING', "Addon path %r could not be found" % path)
+ return {'CANCELLED'}
+
+ # incase its enabled
+ addon_utils.disable(self.module)
+
+ import shutil
+ if isdir:
+ shutil.rmtree(path)
+ else:
+ os.remove(path)
+
+ context.area.tag_redraw()
+ return {'FINISHED'}
+
+ # lame confirmation check
+ def draw(self, context):
+ self.layout.label(text="Remove Addon: %r?" % self.module)
+ path, isdir = WM_OT_addon_remove.path_from_addon(self.module)
+ self.layout.label(text="Path: %r" % path)
+
+ def invoke(self, context, event):
+ wm = context.window_manager
+ return wm.invoke_props_dialog(self, width=600)
+
+
+class WM_OT_addon_expand(Operator):
+ "Display more information on this add-on"
+ bl_idname = "wm.addon_expand"
+ bl_label = ""
+
+ module = StringProperty(
+ name="Module",
+ description="Module name of the addon to expand",
+ )
+
+ def execute(self, context):
+ import addon_utils
+
+ module_name = self.module
+
+ # unlikely to fail, module should have already been imported
+ try:
+ # mod = __import__(module_name)
+ mod = addon_utils.addons_fake_modules.get(module_name)
+ except:
+ import traceback
+ traceback.print_exc()
+ return {'CANCELLED'}
+
+ info = addon_utils.module_bl_info(mod)
+ info["show_expanded"] = not info["show_expanded"]
+ return {'FINISHED'}
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 778571632b2..2e54631afa3 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -96,7 +96,7 @@ def register():
items_unique = set()
- for mod in addon_utils.modules(space_userpref.USERPREF_PT_addons._addons_fake_modules):
+ for mod in addon_utils.modules(addon_utils.addons_fake_modules):
info = addon_utils.module_bl_info(mod)
items_unique.add(info["category"])
diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py
index 499ea4c95d4..3b33a7ccc61 100644
--- a/release/scripts/startup/bl_ui/properties_animviz.py
+++ b/release/scripts/startup/bl_ui/properties_animviz.py
@@ -23,7 +23,7 @@
# NOTE:
# The specialised panel types are derived in their respective UI modules
# dont register these classes since they are only helpers.
-from blf import gettext as _
+
class MotionPathButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -43,23 +43,23 @@ class MotionPathButtonsPanel():
col = split.column()
sub = col.column(align=True)
if (mps.type == 'CURRENT_FRAME'):
- sub.prop(mps, "frame_before", text=_("Before"))
- sub.prop(mps, "frame_after", text=_("After"))
+ sub.prop(mps, "frame_before", text="Before")
+ sub.prop(mps, "frame_after", text="After")
elif (mps.type == 'RANGE'):
- sub.prop(mps, "frame_start", text=_("Start"))
- sub.prop(mps, "frame_end", text=_("End"))
+ sub.prop(mps, "frame_start", text="Start")
+ sub.prop(mps, "frame_end", text="End")
- sub.prop(mps, "frame_step", text=_("Step"))
+ sub.prop(mps, "frame_step", text="Step")
if bones:
col.row().prop(mps, "bake_location", expand=True)
col = split.column()
- col.label(text=_("Display:"))
- col.prop(mps, "show_frame_numbers", text=_("Frame Numbers"))
- col.prop(mps, "show_keyframe_highlight", text=_("Keyframes"))
+ col.label(text="Display:")
+ col.prop(mps, "show_frame_numbers", text="Frame Numbers")
+ col.prop(mps, "show_keyframe_highlight", text="Keyframes")
if bones:
- col.prop(mps, "show_keyframe_action_all", text=_("+ Non-Grouped Keyframes"))
- col.prop(mps, "show_keyframe_numbers", text=_("Keyframe Numbers"))
+ col.prop(mps, "show_keyframe_action_all", text="+ Non-Grouped Keyframes")
+ col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers")
# FIXME: this panel still needs to be ported so that it will work correctly with animviz
@@ -82,16 +82,16 @@ class OnionSkinButtonsPanel():
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':
- sub.prop(arm, "ghost_frame_start", text=_("Start"))
- sub.prop(arm, "ghost_frame_end", text=_("End"))
- sub.prop(arm, "ghost_size", text=_("Step"))
+ sub.prop(arm, "ghost_frame_start", text="Start")
+ sub.prop(arm, "ghost_frame_end", text="End")
+ sub.prop(arm, "ghost_size", text="Step")
elif arm.ghost_type == 'CURRENT_FRAME':
- sub.prop(arm, "ghost_step", text=_("Range"))
- sub.prop(arm, "ghost_size", text=_("Step"))
+ sub.prop(arm, "ghost_step", text="Range")
+ sub.prop(arm, "ghost_size", text="Step")
col = split.column()
- col.label(text=_("Display:"))
- col.prop(arm, "show_only_ghost_selected", text=_("Selected Only"))
+ col.label(text="Display:")
+ col.prop(arm, "show_only_ghost_selected", text="Selected Only")
if __name__ == "__main__": # only for live edit.
import bpy
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index e5729a24b91..e4744fdb04f 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class ArmatureButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -60,19 +60,19 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel):
layout.prop(arm, "pose_position", expand=True)
col = layout.column()
- col.label(text=_("Layers:"))
+ col.label(text="Layers:")
col.prop(arm, "layers", text="")
- col.label(text=_("Protected Layers:"))
+ col.label(text="Protected Layers:")
col.prop(arm, "layers_protected", text="")
layout.label(text="Deform:")
flow = layout.column_flow()
- flow.prop(arm, "use_deform_vertex_groups", text=_("Vertex Groups"))
- flow.prop(arm, "use_deform_envelopes", text=_("Envelopes"))
- flow.prop(arm, "use_deform_preserve_volume", text=_("Quaternion"))
+ flow.prop(arm, "use_deform_vertex_groups", text="Vertex Groups")
+ flow.prop(arm, "use_deform_envelopes", text="Envelopes")
+ flow.prop(arm, "use_deform_preserve_volume", text="Quaternion")
if context.scene.render.engine == "BLENDER_GAME":
- layout.row().prop(arm, "vert_deformer", expand=True)
+ layout.row().prop(arm, "deform_method", expand=True)
class DATA_PT_display(ArmatureButtonsPanel, Panel):
@@ -89,15 +89,15 @@ class DATA_PT_display(ArmatureButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(arm, "show_names", text=_("Names"))
- col.prop(arm, "show_axes", text=_("Axes"))
- col.prop(arm, "show_bone_custom_shapes", text=_("Shapes"))
+ col.prop(arm, "show_names", text="Names")
+ col.prop(arm, "show_axes", text="Axes")
+ col.prop(arm, "show_bone_custom_shapes", text="Shapes")
col = split.column()
- col.prop(arm, "show_group_colors", text=_("Colors"))
+ col.prop(arm, "show_group_colors", text="Colors")
if ob:
- col.prop(ob, "show_x_ray", text=_("X-Ray"))
- col.prop(arm, "use_deform_delay", text=_("Delay Refresh"))
+ col.prop(ob, "show_x_ray", text="X-Ray")
+ col.prop(arm, "use_deform_delay", text="Delay Refresh")
class DATA_PT_bone_group_specials(Menu):
@@ -161,12 +161,12 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
row.active = (ob.proxy is None)
sub = row.row(align=True)
- sub.operator("pose.group_assign", text=_("Assign"))
- sub.operator("pose.group_unassign", text=_("Remove")) # row.operator("pose.bone_group_remove_from", text=_("Remove"))
+ sub.operator("pose.group_assign", text="Assign")
+ sub.operator("pose.group_unassign", text="Remove") # row.operator("pose.bone_group_remove_from", text="Remove")
sub = row.row(align=True)
- sub.operator("pose.group_select", text=_("Select"))
- sub.operator("pose.group_deselect", text=_("Deselect"))
+ sub.operator("pose.group_select", text="Select")
+ sub.operator("pose.group_deselect", text="Deselect")
class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
@@ -230,16 +230,16 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel):
col = split.column(align=True)
if arm.ghost_type == 'RANGE':
- col.prop(arm, "ghost_frame_start", text=_("Start"))
- col.prop(arm, "ghost_frame_end", text=_("End"))
- col.prop(arm, "ghost_size", text=_("Step"))
+ col.prop(arm, "ghost_frame_start", text="Start")
+ col.prop(arm, "ghost_frame_end", text="End")
+ col.prop(arm, "ghost_size", text="Step")
elif arm.ghost_type == 'CURRENT_FRAME':
- col.prop(arm, "ghost_step", text=_("Range"))
- col.prop(arm, "ghost_size", text=_("Step"))
+ col.prop(arm, "ghost_step", text="Range")
+ col.prop(arm, "ghost_size", text="Step")
col = split.column()
- col.label(text=_("Display:"))
- col.prop(arm, "show_only_ghost_selected", text=_("Selected Only"))
+ col.label(text="Display:")
+ col.prop(arm, "show_only_ghost_selected", text="Selected Only")
class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
@@ -263,7 +263,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
layout.prop(itasc, "mode", expand=True)
simulation = (itasc.mode == 'SIMULATION')
if simulation:
- layout.label(text=_("Reiteration:"))
+ layout.label(text="Reiteration:")
layout.prop(itasc, "reiteration_method", expand=True)
row = layout.row()
@@ -275,8 +275,8 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
layout.prop(itasc, "use_auto_step")
row = layout.row()
if itasc.use_auto_step:
- row.prop(itasc, "step_min", text=_("Min"))
- row.prop(itasc, "step_max", text=_("Max"))
+ row.prop(itasc, "step_min", text="Min")
+ row.prop(itasc, "step_max", text="Max")
else:
row.prop(itasc, "step_count")
@@ -286,7 +286,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
layout.prop(itasc, "velocity_max")
if itasc.solver == 'DLS':
row = layout.row()
- row.prop(itasc, "damping_max", text=_("Damp"), slider=True)
+ row.prop(itasc, "damping_max", text="Damp", slider=True)
row.prop(itasc, "damping_epsilon", text="Eps", slider=True)
from bl_ui.properties_animviz import (
@@ -314,8 +314,8 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
layout.separator()
split = layout.split()
- split.operator("pose.paths_calculate", text=_("Calculate Paths"))
- split.operator("pose.paths_clear", text=_("Clear Paths"))
+ split.operator("pose.paths_calculate", text="Calculate Paths")
+ split.operator("pose.paths_clear", text="Clear Paths")
class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from panel when ready
diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py
index 2c9b31fd88d..b3eaf88d5bf 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -21,7 +21,7 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class BoneButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -76,14 +76,14 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
col = row.column()
if pchan.rotation_mode == 'QUATERNION':
- col.prop(pchan, "rotation_quaternion", text=_("Rotation"))
+ col.prop(pchan, "rotation_quaternion", text="Rotation")
elif pchan.rotation_mode == 'AXIS_ANGLE':
- #col.label(text=_("Rotation"))
- #col.prop(pchan, "rotation_angle", text=_("Angle"))
- #col.prop(pchan, "rotation_axis", text=_("Axis"))
- col.prop(pchan, "rotation_axis_angle", text=_("Rotation"))
+ #col.label(text="Rotation")
+ #col.prop(pchan, "rotation_angle", text="Angle")
+ #col.prop(pchan, "rotation_axis", text="Axis")
+ col.prop(pchan, "rotation_axis_angle", text="Rotation")
else:
- col.prop(pchan, "rotation_euler", text=_("Rotation"))
+ col.prop(pchan, "rotation_euler", text="Rotation")
row.column().prop(pchan, "scale")
@@ -97,7 +97,7 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
col = row.column()
sub = col.column(align=True)
- sub.label(text=_("Roll:"))
+ sub.label(text="Roll:")
sub.prop(bone, "roll", text="")
sub.label()
sub.prop(bone, "lock")
@@ -126,12 +126,12 @@ class BONE_PT_transform_locks(BoneButtonsPanel, Panel):
col = row.column()
if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
- col.prop(pchan, "lock_rotations_4d", text=_("Lock Rotation"))
+ col.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
if pchan.lock_rotations_4d:
col.prop(pchan, "lock_rotation_w", text="W")
col.prop(pchan, "lock_rotation", text="")
else:
- col.prop(pchan, "lock_rotation", text=_("Rotation"))
+ col.prop(pchan, "lock_rotation", text="Rotation")
row.column().prop(pchan, "lock_scale")
@@ -155,17 +155,17 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Layers:"))
+ col.label(text="Layers:")
col.prop(bone, "layers", text="")
col.separator()
if ob and pchan:
- col.label(text=_("Bone Group:"))
+ col.label(text="Bone Group:")
col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="")
col = split.column()
- col.label(text=_("Parent:"))
+ col.label(text="Parent:")
if context.bone:
col.prop(bone, "parent", text="")
else:
@@ -174,11 +174,11 @@ class BONE_PT_relations(BoneButtonsPanel, Panel):
sub = col.column()
sub.active = (bone.parent is not None)
sub.prop(bone, "use_connect")
- sub.prop(bone, "use_inherit_rotation", text=_("Inherit Rotation"))
- sub.prop(bone, "use_inherit_scale", text=_("Inherit Scale"))
+ sub.prop(bone, "use_inherit_rotation", text="Inherit Rotation")
+ sub.prop(bone, "use_inherit_scale", text="Inherit Scale")
sub = col.column()
sub.active = (not bone.parent or not bone.use_connect)
- sub.prop(bone, "use_local_location", text=_("Local Location"))
+ sub.prop(bone, "use_local_location", text="Local Location")
class BONE_PT_display(BoneButtonsPanel, Panel):
@@ -206,16 +206,16 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(bone, "show_wire", text=_("Wireframe"))
- col.prop(bone, "hide", text=_("Hide"))
+ col.prop(bone, "show_wire", text="Wireframe")
+ col.prop(bone, "hide", text="Hide")
if pchan:
col = split.column()
- col.label(text=_("Custom Shape:"))
+ col.label(text="Custom Shape:")
col.prop(pchan, "custom_shape", text="")
if pchan.custom_shape:
- col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text=_("At"))
+ col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
@@ -241,13 +241,13 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
split.prop(pchan, "lock_ik_x", icon='LOCKED' if pchan.lock_ik_x else 'UNLOCKED', text="X")
split.active = pchan.is_in_ik_chain
row = split.row()
- row.prop(pchan, "ik_stiffness_x", text=_("Stiffness"), slider=True)
+ row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
row.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
- sub.prop(pchan, "use_ik_limit_x", text=_("Limit"))
+ sub.prop(pchan, "use_ik_limit_x", text="Limit")
sub.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_x", text="")
@@ -258,13 +258,13 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y")
split.active = pchan.is_in_ik_chain
row = split.row()
- row.prop(pchan, "ik_stiffness_y", text=_("Stiffness"), slider=True)
+ row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
row.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
- sub.prop(pchan, "use_ik_limit_y", text=_("Limit"))
+ sub.prop(pchan, "use_ik_limit_y", text="Limit")
sub.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
sub = split.row(align=True)
@@ -276,13 +276,13 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z")
split.active = pchan.is_in_ik_chain
sub = split.row()
- sub.prop(pchan, "ik_stiffness_z", text=_("Stiffness"), slider=True)
+ sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
sub = split.row()
- sub.prop(pchan, "use_ik_limit_z", text=_("Limit"))
+ sub.prop(pchan, "use_ik_limit_z", text="Limit")
sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
sub = split.row(align=True)
sub.prop(pchan, "ik_min_z", text="")
@@ -290,7 +290,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
sub.active = pchan.lock_ik_z == False and pchan.use_ik_limit_z and pchan.is_in_ik_chain
split = layout.split(percentage=0.25)
- split.label(text=_("Stretch:"))
+ split.label(text="Stretch:")
sub = split.row()
sub.prop(pchan, "ik_stretch", text="", slider=True)
sub.active = pchan.is_in_ik_chain
@@ -298,15 +298,15 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
if ob.pose.ik_solver == 'ITASC':
split = layout.split()
col = split.column()
- col.prop(pchan, "use_ik_rotation_control", text=_("Control Rotation"))
+ col.prop(pchan, "use_ik_rotation_control", text="Control Rotation")
col.active = pchan.is_in_ik_chain
col = split.column()
- col.prop(pchan, "ik_rotation_weight", text=_("Weight"), slider=True)
+ col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True)
col.active = pchan.is_in_ik_chain
# not supported yet
#row = layout.row()
- #row.prop(pchan, "use_ik_linear_control", text=_("Joint Size"))
- #row.prop(pchan, "ik_linear_weight", text=_("Weight"), slider=True)
+ #row.prop(pchan, "use_ik_linear_control", text="Joint Size")
+ #row.prop(pchan, "ik_linear_weight", text="Weight", slider=True)
class BONE_PT_deform(BoneButtonsPanel, Panel):
@@ -334,27 +334,27 @@ class BONE_PT_deform(BoneButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Envelope:"))
+ col.label(text="Envelope:")
sub = col.column(align=True)
- sub.prop(bone, "envelope_distance", text=_("Distance"))
- sub.prop(bone, "envelope_weight", text=_("Weight"))
- col.prop(bone, "use_envelope_multiply", text=_("Multiply"))
+ sub.prop(bone, "envelope_distance", text="Distance")
+ sub.prop(bone, "envelope_weight", text="Weight")
+ col.prop(bone, "use_envelope_multiply", text="Multiply")
sub = col.column(align=True)
- sub.label(text=_("Radius:"))
- sub.prop(bone, "head_radius", text=_("Head"))
- sub.prop(bone, "tail_radius", text=_("Tail"))
+ sub.label(text="Radius:")
+ sub.prop(bone, "head_radius", text="Head")
+ sub.prop(bone, "tail_radius", text="Tail")
col = split.column()
- col.label(text=_("Curved Bones:"))
+ col.label(text="Curved Bones:")
sub = col.column(align=True)
- sub.prop(bone, "bbone_segments", text=_("Segments"))
- sub.prop(bone, "bbone_in", text=_("Ease In"))
- sub.prop(bone, "bbone_out", text=_("Ease Out"))
+ sub.prop(bone, "bbone_segments", text="Segments")
+ sub.prop(bone, "bbone_in", text="Ease In")
+ sub.prop(bone, "bbone_out", text="Ease Out")
- col.label(text=_("Offset:"))
+ col.label(text="Offset:")
col.prop(bone, "use_cyclic_offset")
diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py
index 1b135631f3e..77877731777 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class CameraButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -91,14 +91,14 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
split = layout.split()
col = split.column(align=True)
- col.label(text=_("Shift:"))
+ col.label(text="Shift:")
col.prop(cam, "shift_x", text="X")
col.prop(cam, "shift_y", text="Y")
col = split.column(align=True)
- col.label(text=_("Clipping:"))
- col.prop(cam, "clip_start", text=_("Start"))
- col.prop(cam, "clip_end", text=_("End"))
+ col.label(text="Clipping:")
+ col.prop(cam, "clip_start", text="Start")
+ col.prop(cam, "clip_end", text="End")
class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
bl_label = "Depth of Field"
@@ -115,7 +115,7 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
col = split.column()
col.active = cam.dof_object is None
- col.prop(cam, "dof_distance", text=_("Distance"))
+ col.prop(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
bl_label = "Display"
@@ -129,19 +129,19 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
split = layout.split()
col = split.column()
- 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_name", text=_("Name"))
+ 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_name", text="Name")
col.prop_menu_enum(cam, "show_guide")
col = split.column()
- col.prop(cam, "draw_size", text=_("Size"))
+ col.prop(cam, "draw_size", text="Size")
col.separator()
- col.prop(cam, "show_passepartout", text=_("Passepartout"))
+ col.prop(cam, "show_passepartout", text="Passepartout")
sub = col.column()
sub.active = cam.show_passepartout
- sub.prop(cam, "passepartout_alpha", text=_("Alpha"), slider=True)
+ sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index 861359fbed4..2e0b36a7a75 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class CurveButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -67,7 +67,7 @@ class DATA_PT_context_curve(CurveButtonsPanel, Panel):
class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
- bl_label = _("Shape")
+ bl_label = "Shape"
def draw(self, context):
layout = self.layout
@@ -85,17 +85,17 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Resolution:"))
+ col.label(text="Resolution:")
sub = col.column(align=True)
- sub.prop(curve, "resolution_u", text=_("Preview U"))
- sub.prop(curve, "render_resolution_u", text=_("Render U"))
+ sub.prop(curve, "resolution_u", text="Preview U")
+ sub.prop(curve, "render_resolution_u", text="Render U")
if is_curve:
- col.label(text=_("Twisting:"))
+ col.label(text="Twisting:")
col.prop(curve, "twist_mode", text="")
- col.prop(curve, "twist_smooth", text=_("Smooth"))
+ col.prop(curve, "twist_smooth", text="Smooth")
if is_text:
- col.label(text=_("Display:"))
- col.prop(curve, "use_fast_edit", text=_("Fast Editing"))
+ col.label(text="Display:")
+ col.prop(curve, "use_fast_edit", text="Fast Editing")
col = split.column()
@@ -103,15 +103,15 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
sub = col.column()
sub.label(text="")
sub = col.column(align=True)
- sub.prop(curve, "resolution_v", text=_("Preview V"))
- sub.prop(curve, "render_resolution_v", text=_("Render V"))
+ sub.prop(curve, "resolution_v", text="Preview V")
+ sub.prop(curve, "render_resolution_v", text="Render V")
if (is_curve or is_text):
- col.label(text=_("Fill:"))
+ col.label(text="Fill:")
sub = col.column()
sub.active = (curve.dimensions == '2D' or (curve.bevel_object is None and curve.dimensions == '3D'))
sub.prop(curve, "fill_mode", text="")
- col.prop(curve, "use_fill_deform", text=_("Fill Deformed"))
+ col.prop(curve, "use_fill_deform", text="Fill Deformed")
class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
@@ -129,8 +129,8 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel):
row.prop(curve, "use_uv_as_generated")
row = layout.row()
- row.column().prop(curve, "texspace_location", text=_("Location"))
- row.column().prop(curve, "texspace_size", text=_("Size"))
+ row.column().prop(curve, "texspace_location", text="Location")
+ row.column().prop(curve, "texspace_size", text="Size")
class DATA_PT_geometry_curve(CurveButtonsPanel, Panel):
@@ -152,17 +152,17 @@ class DATA_PT_geometry_curve(CurveButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Modification:"))
+ col.label(text="Modification:")
col.prop(curve, "offset")
col.prop(curve, "extrude")
- col.label(text=_("Taper Object:"))
+ col.label(text="Taper Object:")
col.prop(curve, "taper_object", text="")
col = split.column()
- col.label(text=_("Bevel:"))
- col.prop(curve, "bevel_depth", text=_("Depth"))
- col.prop(curve, "bevel_resolution", text=_("Resolution"))
- col.label(text=_("Bevel Object:"))
+ col.label(text="Bevel:")
+ col.prop(curve, "bevel_depth", text="Depth")
+ col.prop(curve, "bevel_resolution", text="Resolution")
+ col.label(text="Bevel Object:")
col.prop(curve, "bevel_object", text="")
@@ -182,7 +182,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
layout.active = curve.use_path
col = layout.column()
- layout.prop(curve, "path_duration", text=_("Frames"))
+ layout.prop(curve, "path_duration", text="Frames")
layout.prop(curve, "eval_time")
split = layout.split()
@@ -194,7 +194,7 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
col = split.column()
col.prop(curve, "use_radius")
- col.prop(curve, "use_time_offset", text=_("Offset Children"))
+ col.prop(curve, "use_time_offset", text="Offset Children")
class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
@@ -215,20 +215,20 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
# These settings are below but its easier to have
# poly's set aside since they use so few settings
col = split.column()
- col.label(text=_("Cyclic:"))
+ col.label(text="Cyclic:")
col.prop(act_spline, "use_smooth")
col = split.column()
col.prop(act_spline, "use_cyclic_u", text="U")
else:
col = split.column()
- col.label(text=_("Cyclic:"))
+ col.label(text="Cyclic:")
if act_spline.type == 'NURBS':
- col.label(text=_("Bezier:"))
- col.label(text=_("Endpoint:"))
- col.label(text=_("Order:"))
+ col.label(text="Bezier:")
+ col.label(text="Endpoint:")
+ col.label(text="Order:")
- col.label(text=_("Resolution:"))
+ col.label(text="Resolution:")
col = split.column()
col.prop(act_spline, "use_cyclic_u", text="U")
@@ -261,9 +261,9 @@ class DATA_PT_active_spline(CurveButtonsPanelActive, Panel):
col = split.column()
col.active = (curve.dimensions == '3D')
- col.label(text=_("Interpolation:"))
- col.prop(act_spline, "tilt_interpolation", text=_("Tilt"))
- col.prop(act_spline, "radius_interpolation", text=_("Radius"))
+ col.label(text="Interpolation:")
+ col.prop(act_spline, "tilt_interpolation", text="Tilt")
+ col.prop(act_spline, "radius_interpolation", text="Radius")
layout.prop(act_spline, "use_smooth")
@@ -282,16 +282,16 @@ class DATA_PT_font(CurveButtonsPanel, Panel):
char = context.curve.edit_format
row = layout.split(percentage=0.25)
- row.label(text=_("Regular"))
+ row.label(text="Regular")
row.template_ID(text, "font", open="font.open", unlink="font.unlink")
row = layout.split(percentage=0.25)
- row.label(text=_("Bold"))
+ row.label(text="Bold")
row.template_ID(text, "font_bold", open="font.open", unlink="font.unlink")
row = layout.split(percentage=0.25)
- row.label(text=_("Italic"))
+ row.label(text="Italic")
row.template_ID(text, "font_italic", open="font.open", unlink="font.unlink")
row = layout.split(percentage=0.25)
- row.label(text=_("Bold & Italic"))
+ row.label(text="Bold & Italic")
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
#layout.prop(text, "font")
@@ -299,36 +299,36 @@ class DATA_PT_font(CurveButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(text, "size", text=_("Size"))
+ col.prop(text, "size", text="Size")
col = split.column()
col.prop(text, "shear")
split = layout.split()
col = split.column()
- col.label(text=_("Object Font:"))
+ col.label(text="Object Font:")
col.prop(text, "family", text="")
col = split.column()
- col.label(text=_("Text on Curve:"))
+ col.label(text="Text on Curve:")
col.prop(text, "follow_curve", text="")
split = layout.split()
col = split.column()
colsub = col.column(align=True)
- colsub.label(text=_("Underline:"))
- colsub.prop(text, "underline_position", text=_("Position"))
- colsub.prop(text, "underline_height", text=_("Thickness"))
+ colsub.label(text="Underline:")
+ colsub.prop(text, "underline_position", text="Position")
+ colsub.prop(text, "underline_height", text="Thickness")
col = split.column()
- col.label(text=_("Character:"))
+ col.label(text="Character:")
col.prop(char, "use_bold")
col.prop(char, "use_italic")
col.prop(char, "use_underline")
row = layout.row()
- row.prop(text, "small_caps_scale", text=_("Small Caps"))
+ row.prop(text, "small_caps_scale", text="Small Caps")
row.prop(char, "use_small_caps")
@@ -344,19 +344,19 @@ class DATA_PT_paragraph(CurveButtonsPanel, Panel):
text = context.curve
- layout.label(text=_("Align:"))
+ layout.label(text="Align:")
layout.prop(text, "align", expand=True)
split = layout.split()
col = split.column(align=True)
- col.label(text=_("Spacing:"))
- col.prop(text, "space_character", text=_("Character"))
- col.prop(text, "space_word", text=_("Word"))
- col.prop(text, "space_line", text=_("Line"))
+ col.label(text="Spacing:")
+ col.prop(text, "space_character", text="Character")
+ col.prop(text, "space_word", text="Word")
+ col.prop(text, "space_line", text="Line")
col = split.column(align=True)
- col.label(text=_("Offset:"))
+ col.label(text="Offset:")
col.prop(text, "offset_x", text="X")
col.prop(text, "offset_y", text="Y")
@@ -388,13 +388,13 @@ class DATA_PT_text_boxes(CurveButtonsPanel, Panel):
col = split.column(align=True)
- col.label(text=_("Dimensions:"))
- col.prop(box, "width", text=_("Width"))
- col.prop(box, "height", text=_("Height"))
+ col.label(text="Dimensions:")
+ col.prop(box, "width", text="Width")
+ col.prop(box, "height", text="Height")
col = split.column(align=True)
- col.label(text=_("Offset:"))
+ col.label(text="Offset:")
col.prop(box, "x", text="X")
col.prop(box, "y", text="Y")
diff --git a/release/scripts/startup/bl_ui/properties_data_empty.py b/release/scripts/startup/bl_ui/properties_data_empty.py
index b6fa6d8e839..c781873e16c 100644
--- a/release/scripts/startup/bl_ui/properties_data_empty.py
+++ b/release/scripts/startup/bl_ui/properties_data_empty.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
+
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -39,17 +39,17 @@ class DATA_PT_empty(DataButtonsPanel, Panel):
ob = context.object
- layout.prop(ob, "empty_draw_type", text=_("Display"))
+ layout.prop(ob, "empty_draw_type", text="Display")
if ob.empty_draw_type == 'IMAGE':
layout.template_ID(ob, "data", open="image.open", unlink="image.unlink")
- layout.prop(ob, "color", text=_("Transparency"), index=3, slider=True)
+ layout.prop(ob, "color", text="Transparency", index=3, slider=True)
row = layout.row(align=True)
- row.prop(ob, "empty_image_offset", text=_("Offset X"), index=0)
- row.prop(ob, "empty_image_offset", text=_("Offset Y"), index=1)
+ row.prop(ob, "empty_image_offset", text="Offset X", index=0)
+ row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
- layout.prop(ob, "empty_draw_size", text=_("Size"))
+ layout.prop(ob, "empty_draw_size", text="Size")
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py
index 93ed8ca369b..4ff180f74fb 100644
--- a/release/scripts/startup/bl_ui/properties_data_lamp.py
+++ b/release/scripts/startup/bl_ui/properties_data_lamp.py
@@ -20,10 +20,10 @@
import bpy
from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class LAMP_MT_sunsky_presets(Menu):
- bl_label = _("Sun & Sky Presets")
+ bl_label = "Sun & Sky Presets"
preset_subdir = "sunsky"
preset_operator = "script.execute_preset"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -93,15 +93,15 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
sub.prop(lamp, "energy")
if lamp.type in {'POINT', 'SPOT'}:
- sub.label(text=_("Falloff:"))
+ sub.label(text="Falloff:")
sub.prop(lamp, "falloff_type", text="")
sub.prop(lamp, "distance")
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
- col.label(text=_("Attenuation Factors:"))
+ col.label(text="Attenuation Factors:")
sub = col.column(align=True)
- sub.prop(lamp, "linear_attenuation", slider=True, text=_("Linear"))
- sub.prop(lamp, "quadratic_attenuation", slider=True, text=_("Quadratic"))
+ sub.prop(lamp, "linear_attenuation", slider=True, text="Linear")
+ sub.prop(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
col.prop(lamp, "use_sphere")
@@ -111,7 +111,7 @@ class DATA_PT_lamp(DataButtonsPanel, Panel):
col = split.column()
col.prop(lamp, "use_negative")
- col.prop(lamp, "use_own_layer", text=_("This Layer Only"))
+ col.prop(lamp, "use_own_layer", text="This Layer Only")
col.prop(lamp, "use_specular")
col.prop(lamp, "use_diffuse")
@@ -139,34 +139,34 @@ class DATA_PT_sunsky(DataButtonsPanel, Panel):
row = layout.row()
row.active = lamp.use_sky or lamp.use_atmosphere
- row.prop(lamp, "atmosphere_turbidity", text=_("Turbidity"))
+ row.prop(lamp, "atmosphere_turbidity", text="Turbidity")
split = layout.split()
col = split.column()
col.active = lamp.use_sky
- col.label(text=_("Blending:"))
+ col.label(text="Blending:")
sub = col.column()
sub.prop(lamp, "sky_blend_type", text="")
- sub.prop(lamp, "sky_blend", text=_("Factor"))
+ sub.prop(lamp, "sky_blend", text="Factor")
- col.label(text=_("Color Space:"))
+ col.label(text="Color Space:")
sub = col.column()
sub.row().prop(lamp, "sky_color_space", expand=True)
- sub.prop(lamp, "sky_exposure", text=_("Exposure"))
+ sub.prop(lamp, "sky_exposure", text="Exposure")
col = split.column()
col.active = lamp.use_sky
- col.label(text=_("Horizon:"))
+ col.label(text="Horizon:")
sub = col.column()
- sub.prop(lamp, "horizon_brightness", text=_("Brightness"))
- sub.prop(lamp, "spread", text=_("Spread"))
+ sub.prop(lamp, "horizon_brightness", text="Brightness")
+ sub.prop(lamp, "spread", text="Spread")
- col.label(text=_("Sun:"))
+ col.label(text="Sun:")
sub = col.column()
- sub.prop(lamp, "sun_brightness", text=_("Brightness"))
- sub.prop(lamp, "sun_size", text=_("Size"))
- sub.prop(lamp, "backscattered_light", slider=True, text=_("Back Light"))
+ sub.prop(lamp, "sun_brightness", text="Brightness")
+ sub.prop(lamp, "sun_size", text="Size")
+ sub.prop(lamp, "backscattered_light", slider=True, text="Back Light")
layout.separator()
@@ -176,16 +176,16 @@ class DATA_PT_sunsky(DataButtonsPanel, Panel):
col = split.column()
col.active = lamp.use_atmosphere
- col.label(text=_("Intensity:"))
- col.prop(lamp, "sun_intensity", text=_("Sun"))
- col.prop(lamp, "atmosphere_distance_factor", text=_("Distance"))
+ col.label(text="Intensity:")
+ col.prop(lamp, "sun_intensity", text="Sun")
+ col.prop(lamp, "atmosphere_distance_factor", text="Distance")
col = split.column()
col.active = lamp.use_atmosphere
- col.label(text=_("Scattering:"))
+ col.label(text="Scattering:")
sub = col.column(align=True)
- sub.prop(lamp, "atmosphere_inscattering", slider=True, text=_("Inscattering"))
- sub.prop(lamp, "atmosphere_extinction", slider=True, text=_("Extinction"))
+ sub.prop(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
+ sub.prop(lamp, "atmosphere_extinction", slider=True, text="Extinction")
class DATA_PT_shadow(DataButtonsPanel, Panel):
@@ -209,15 +209,15 @@ class DATA_PT_shadow(DataButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Form factor sampling:"))
+ col.label(text="Form factor sampling:")
sub = col.row(align=True)
if lamp.shape == 'SQUARE':
- sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples"))
+ sub.prop(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
- sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples X"))
- sub.prop(lamp, "shadow_ray_samples_y", text=_("Samples Y"))
+ sub.prop(lamp, "shadow_ray_samples_x", text="Samples X")
+ sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
if lamp.shadow_method != 'NOSHADOW':
split = layout.split()
@@ -226,34 +226,34 @@ class DATA_PT_shadow(DataButtonsPanel, Panel):
col.prop(lamp, "shadow_color", text="")
col = split.column()
- col.prop(lamp, "use_shadow_layer", text=_("This Layer Only"))
+ col.prop(lamp, "use_shadow_layer", text="This Layer Only")
col.prop(lamp, "use_only_shadow")
if lamp.shadow_method == 'RAY_SHADOW':
split = layout.split()
col = split.column()
- col.label(text=_("Sampling:"))
+ col.label(text="Sampling:")
if lamp.type in {'POINT', 'SUN', 'SPOT'}:
sub = col.row()
- sub.prop(lamp, "shadow_ray_samples", text=_("Samples"))
- sub.prop(lamp, "shadow_soft_size", text=_("Soft Size"))
+ sub.prop(lamp, "shadow_ray_samples", text="Samples")
+ sub.prop(lamp, "shadow_soft_size", text="Soft Size")
elif lamp.type == 'AREA':
sub = col.row(align=True)
if lamp.shape == 'SQUARE':
- sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples"))
+ sub.prop(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
- sub.prop(lamp, "shadow_ray_samples_x", text=_("Samples X"))
- sub.prop(lamp, "shadow_ray_samples_y", text=_("Samples Y"))
+ sub.prop(lamp, "shadow_ray_samples_x", text="Samples X")
+ sub.prop(lamp, "shadow_ray_samples_y", text="Samples Y")
col.row().prop(lamp, "shadow_ray_sample_method", expand=True)
if lamp.shadow_ray_sample_method == 'ADAPTIVE_QMC':
- layout.prop(lamp, "shadow_adaptive_threshold", text=_("Threshold"))
+ layout.prop(lamp, "shadow_adaptive_threshold", text="Threshold")
if lamp.type == 'AREA' and lamp.shadow_ray_sample_method == 'CONSTANT_JITTERED':
row = layout.row()
@@ -263,44 +263,44 @@ class DATA_PT_shadow(DataButtonsPanel, Panel):
elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
- col.label(text=_("Buffer Type:"))
+ col.label(text="Buffer Type:")
col.row().prop(lamp, "shadow_buffer_type", expand=True)
if lamp.shadow_buffer_type in {'REGULAR', 'HALFWAY', 'DEEP'}:
split = layout.split()
col = split.column()
- col.label(text=_("Filter Type:"))
+ col.label(text="Filter Type:")
col.prop(lamp, "shadow_filter_type", text="")
sub = col.column(align=True)
- sub.prop(lamp, "shadow_buffer_soft", text=_("Soft"))
- sub.prop(lamp, "shadow_buffer_bias", text=_("Bias"))
+ sub.prop(lamp, "shadow_buffer_soft", text="Soft")
+ sub.prop(lamp, "shadow_buffer_bias", text="Bias")
col = split.column()
- col.label(text=_("Sample Buffers:"))
+ col.label(text="Sample Buffers:")
col.prop(lamp, "shadow_sample_buffers", text="")
sub = col.column(align=True)
- sub.prop(lamp, "shadow_buffer_size", text=_("Size"))
- sub.prop(lamp, "shadow_buffer_samples", text=_("Samples"))
+ sub.prop(lamp, "shadow_buffer_size", text="Size")
+ sub.prop(lamp, "shadow_buffer_samples", text="Samples")
if lamp.shadow_buffer_type == 'DEEP':
col.prop(lamp, "compression_threshold")
elif lamp.shadow_buffer_type == 'IRREGULAR':
- layout.prop(lamp, "shadow_buffer_bias", text=_("Bias"))
+ layout.prop(lamp, "shadow_buffer_bias", text="Bias")
split = layout.split()
col = split.column()
- col.prop(lamp, "use_auto_clip_start", text=_("Autoclip Start"))
+ col.prop(lamp, "use_auto_clip_start", text="Autoclip Start")
sub = col.column()
sub.active = not lamp.use_auto_clip_start
- sub.prop(lamp, "shadow_buffer_clip_start", text=_("Clip Start"))
+ sub.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
col = split.column()
- col.prop(lamp, "use_auto_clip_end", text=_("Autoclip End"))
+ col.prop(lamp, "use_auto_clip_end", text="Autoclip End")
sub = col.column()
sub.active = not lamp.use_auto_clip_end
- sub.prop(lamp, "shadow_buffer_clip_end", text=_(" Clip End"))
+ sub.prop(lamp, "shadow_buffer_clip_end", text=" Clip End")
class DATA_PT_area(DataButtonsPanel, Panel):
@@ -325,8 +325,8 @@ class DATA_PT_area(DataButtonsPanel, Panel):
if (lamp.shape == 'SQUARE'):
sub.prop(lamp, "size")
elif (lamp.shape == 'RECTANGLE'):
- sub.prop(lamp, "size", text=_("Size X"))
- sub.prop(lamp, "size_y", text=_("Size Y"))
+ sub.prop(lamp, "size", text="Size X")
+ sub.prop(lamp, "size_y", text="Size Y")
class DATA_PT_spot(DataButtonsPanel, Panel):
@@ -348,8 +348,8 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
col = split.column()
sub = col.column()
- sub.prop(lamp, "spot_size", text=_("Size"))
- sub.prop(lamp, "spot_blend", text=_("Blend"), slider=True)
+ sub.prop(lamp, "spot_size", text="Size")
+ sub.prop(lamp, "spot_blend", text="Blend", slider=True)
col.prop(lamp, "use_square")
col.prop(lamp, "show_cone")
@@ -358,9 +358,9 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
col.prop(lamp, "use_halo")
sub = col.column(align=True)
sub.active = lamp.use_halo
- sub.prop(lamp, "halo_intensity", text=_("Intensity"))
+ sub.prop(lamp, "halo_intensity", text="Intensity")
if lamp.shadow_method == 'BUFFER_SHADOW':
- sub.prop(lamp, "halo_step", text=_("Step"))
+ sub.prop(lamp, "halo_step", text="Step")
class DATA_PT_falloff_curve(DataButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 37c91370979..ff19ece8f94 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -20,10 +20,10 @@
import bpy
from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class MESH_MT_vertex_group_specials(Menu):
- bl_label = _("Vertex Group Specials")
+ bl_label = "Vertex Group Specials"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
def draw(self, context):
@@ -34,7 +34,7 @@ class MESH_MT_vertex_group_specials(Menu):
layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA')
layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA')
layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT')
- layout.operator("object.vertex_group_remove", icon='X', text=_("Delete All")).all = True
+ layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all = True
layout.separator()
layout.operator("object.vertex_group_lock", icon='LOCK', text="Lock All").action = 'SELECT'
layout.operator("object.vertex_group_lock", icon='UNLOCK', text="UnLock All").action = 'DESELECT'
@@ -51,7 +51,7 @@ class MESH_MT_shape_key_specials(Menu):
layout.operator("object.shape_key_transfer", icon='COPY_ID') # icon is not ideal
layout.operator("object.join_shapes", icon='COPY_ID') # icon is not ideal
layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
- op = layout.operator("object.shape_key_add", icon='ZOOMIN', text=_("New Shape From Mix"))
+ op = layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix")
op.from_mix = True
@@ -99,7 +99,7 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
col.prop(mesh, "use_auto_smooth")
sub = col.column()
sub.active = mesh.use_auto_smooth
- sub.prop(mesh, "auto_smooth_angle", text=_("Angle"))
+ sub.prop(mesh, "auto_smooth_angle", text="Angle")
split.prop(mesh, "show_double_sided")
@@ -120,8 +120,8 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel):
layout.prop(mesh, "use_auto_texspace")
row = layout.row()
- row.column().prop(mesh, "texspace_location", text=_("Location"))
- row.column().prop(mesh, "texspace_size", text=_("Size"))
+ row.column().prop(mesh, "texspace_location", text="Location")
+ row.column().prop(mesh, "texspace_size", text="Size")
class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
@@ -163,14 +163,14 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
row = layout.row()
sub = row.row(align=True)
- sub.operator("object.vertex_group_assign", text=_("Assign"))
- sub.operator("object.vertex_group_remove_from", text=_("Remove"))
+ sub.operator("object.vertex_group_assign", text="Assign")
+ sub.operator("object.vertex_group_remove_from", text="Remove")
sub = row.row(align=True)
- sub.operator("object.vertex_group_select", text=_("Select"))
- sub.operator("object.vertex_group_deselect", text=_("Deselect"))
+ sub.operator("object.vertex_group_select", text="Select")
+ sub.operator("object.vertex_group_deselect", text="Deselect")
- layout.prop(context.tool_settings, "vertex_group_weight", text=_("Weight"))
+ layout.prop(context.tool_settings, "vertex_group_weight", text="Weight")
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
@@ -250,13 +250,13 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
col = split.column(align=True)
col.active = enable_edit_value
- col.label(text=_("Range:"))
- col.prop(kb, "slider_min", text=_("Min"))
- col.prop(kb, "slider_max", text=_("Max"))
+ col.label(text="Range:")
+ col.prop(kb, "slider_min", text="Min")
+ col.prop(kb, "slider_max", text="Max")
col = split.column(align=True)
col.active = enable_edit_value
- col.label(text=_("Blend:"))
+ col.label(text="Blend:")
col.prop_search(kb, "vertex_group", ob, "vertex_groups", text="")
col.prop_search(kb, "relative_key", key, "key_blocks", text="")
diff --git a/release/scripts/startup/bl_ui/properties_data_metaball.py b/release/scripts/startup/bl_ui/properties_data_metaball.py
index 693cb697544..cd894e60dbb 100644
--- a/release/scripts/startup/bl_ui/properties_data_metaball.py
+++ b/release/scripts/startup/bl_ui/properties_data_metaball.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class DataButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -60,16 +60,16 @@ class DATA_PT_metaball(DataButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Resolution:"))
+ col.label(text="Resolution:")
sub = col.column(align=True)
- sub.prop(mball, "resolution", text=_("View"))
- sub.prop(mball, "render_resolution", text=_("Render"))
+ sub.prop(mball, "resolution", text="View")
+ sub.prop(mball, "render_resolution", text="Render")
col = split.column()
- col.label(text=_("Settings:"))
- col.prop(mball, "threshold", text=_("Threshold"))
+ col.label(text="Settings:")
+ col.prop(mball, "threshold", text="Threshold")
- layout.label(text=_("Update:"))
+ layout.label(text="Update:")
layout.prop(mball, "update_method", expand=True)
@@ -86,8 +86,8 @@ class DATA_PT_mball_texture_space(DataButtonsPanel, Panel):
layout.prop(mball, "use_auto_texspace")
row = layout.row()
- row.column().prop(mball, "texspace_location", text=_("Location"))
- row.column().prop(mball, "texspace_size", text=_("Size"))
+ row.column().prop(mball, "texspace_location", text="Location")
+ row.column().prop(mball, "texspace_size", text="Size")
class DATA_PT_metaball_element(DataButtonsPanel, Panel):
@@ -107,25 +107,25 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel):
split = layout.split()
col = split.column(align=True)
- col.label(text=_("Settings:"))
- col.prop(metaelem, "stiffness", text=_("Stiffness"))
- col.prop(metaelem, "use_negative", text=_("Negative"))
- col.prop(metaelem, "hide", text=_("Hide"))
+ col.label(text="Settings:")
+ col.prop(metaelem, "stiffness", text="Stiffness")
+ col.prop(metaelem, "use_negative", text="Negative")
+ col.prop(metaelem, "hide", text="Hide")
col = split.column(align=True)
if metaelem.type in {'CUBE', 'ELLIPSOID'}:
- col.label(text=_("Size:"))
+ col.label(text="Size:")
col.prop(metaelem, "size_x", text="X")
col.prop(metaelem, "size_y", text="Y")
col.prop(metaelem, "size_z", text="Z")
elif metaelem.type == 'TUBE':
- col.label(text=_("Size:"))
+ col.label(text="Size:")
col.prop(metaelem, "size_x", text="X")
elif metaelem.type == 'PLANE':
- col.label(text=_("Size:"))
+ col.label(text="Size:")
col.prop(metaelem, "size_x", text="X")
col.prop(metaelem, "size_y", text="Y")
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 168a484add2..e4b152834fc 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
+
class ModifierButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -51,14 +51,14 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(md, "object", text="")
col.prop(md, "use_deform_preserve_volume")
col = split.column()
- col.label(text=_("Bind To:"))
- col.prop(md, "use_vertex_groups", text=_("Vertex Groups"))
- col.prop(md, "use_bone_envelopes", text=_("Bone Envelopes"))
+ col.label(text="Bind To:")
+ col.prop(md, "use_vertex_groups", text="Vertex Groups")
+ col.prop(md, "use_bone_envelopes", text="Bone Envelopes")
layout.separator()
@@ -92,11 +92,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.separator()
- col.prop(md, "use_merge_vertices", text=_("Merge"))
+ col.prop(md, "use_merge_vertices", text="Merge")
sub = col.column()
sub.active = md.use_merge_vertices
- sub.prop(md, "use_merge_vertices_cap", text=_("First Last"))
- sub.prop(md, "merge_threshold", text=_("Distance"))
+ sub.prop(md, "use_merge_vertices_cap", text="First Last")
+ sub.prop(md, "merge_threshold", text="Distance")
col = split.column()
col.prop(md, "use_relative_offset")
@@ -122,7 +122,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split.prop(md, "width")
split.prop(md, "use_only_vertices")
- layout.label(text=_("Limit Method:"))
+ layout.label(text="Limit Method:")
layout.row().prop(md, "limit_method", expand=True)
if md.limit_method == 'ANGLE':
layout.prop(md, "angle_limit")
@@ -133,11 +133,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Operation:"))
+ col.label(text="Operation:")
col.prop(md, "operation", text="")
col = split.column()
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(md, "object", text="")
def BUILD(self, layout, ob, md):
@@ -156,7 +156,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def CAST(self, layout, ob, md):
split = layout.split(percentage=0.25)
- split.label(text=_("Cast Type:"))
+ split.label(text="Cast Type:")
split.prop(md, "cast_type", text="")
split = layout.split(percentage=0.25)
@@ -175,52 +175,52 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
col = split.column()
- col.label(text=_("Control Object:"))
+ col.label(text="Control Object:")
col.prop(md, "object", text="")
if md.object:
col.prop(md, "use_transform")
def CLOTH(self, layout, ob, md):
- layout.label(text=_("Settings can be found inside the Physics context"))
+ layout.label(text="Settings can be found inside the Physics context")
def COLLISION(self, layout, ob, md):
- layout.label(text=_("Settings can be found inside the Physics context"))
+ layout.label(text="Settings can be found inside the Physics context")
def CURVE(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(md, "object", text="")
col = split.column()
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
- layout.label(text=_("Deformation Axis:"))
+ layout.label(text="Deformation Axis:")
layout.row().prop(md, "deform_axis", expand=True)
def DECIMATE(self, layout, ob, md):
layout.prop(md, "ratio")
- layout.label(text=_("Face Count")+": %s" % str(md.face_count))
+ layout.label(text="Face Count" + ": %d" % md.face_count)
def DISPLACE(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Texture:"))
+ col.label(text="Texture:")
col.template_ID(md, "texture", new="texture.new")
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
col = split.column()
- col.label(text=_("Direction:"))
+ col.label(text="Direction:")
col.prop(md, "direction", text="")
- col.label(text=_("Texture Coordinates:"))
+ col.label(text="Texture Coordinates:")
col.prop(md, "texture_coords", text="")
if md.texture_coords == 'OBJECT':
- layout.prop(md, "texture_coords_object", text=_("Object"))
+ layout.prop(md, "texture_coords_object", text="Object")
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
@@ -234,23 +234,23 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(md, "use_edge_angle", text=_("Edge Angle"))
+ col.prop(md, "use_edge_angle", text="Edge Angle")
sub = col.column()
sub.active = md.use_edge_angle
sub.prop(md, "split_angle")
- split.prop(md, "use_edge_sharp", text=_("Sharp Edges"))
+ split.prop(md, "use_edge_sharp", text="Sharp Edges")
def EXPLODE(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Vertex group:"))
+ col.label(text="Vertex group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column()
sub.active = bool(md.vertex_group)
sub.prop(md, "protect")
- col.label(text=_("Particle UV"))
+ col.label(text="Particle UV")
col.prop_search(md, "particle_uv", ob.data, "uv_textures", text="")
col = split.column()
@@ -260,22 +260,22 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.prop(md, "show_dead")
col.prop(md, "use_size")
- layout.operator("object.explode_refresh", text=_("Refresh"))
+ layout.operator("object.explode_refresh", text="Refresh")
def FLUID_SIMULATION(self, layout, ob, md):
- layout.label(text=_("Settings can be found inside the Physics context"))
+ layout.label(text="Settings can be found inside the Physics context")
def HOOK(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(md, "object", text="")
if md.object and md.object.type == 'ARMATURE':
- col.label(text=_("Bone:"))
+ col.label(text="Bone:")
col.prop_search(md, "subtarget", md.object.data, "bones", text="")
col = split.column()
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
layout.separator()
@@ -287,38 +287,38 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.prop(md, "force", slider=True)
col = split.column()
- col.operator("object.hook_reset", text=_("Reset"))
- col.operator("object.hook_recenter", text=_("Recenter"))
+ col.operator("object.hook_reset", text="Reset")
+ col.operator("object.hook_recenter", text="Recenter")
if ob.mode == 'EDIT':
layout.separator()
row = layout.row()
- row.operator("object.hook_select", text=_("Select"))
- row.operator("object.hook_assign", text=_("Assign"))
+ row.operator("object.hook_select", text="Select")
+ row.operator("object.hook_assign", text="Assign")
def LATTICE(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(md, "object", text="")
col = split.column()
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
def MASK(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Mode:"))
+ col.label(text="Mode:")
col.prop(md, "mode", text="")
col = split.column()
if md.mode == 'ARMATURE':
- col.label(text=_("Armature:"))
+ col.label(text="Armature:")
col.prop(md, "armature", text="")
elif md.mode == 'VERTEX_GROUP':
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column()
@@ -330,11 +330,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
sub = col.column()
- sub.label(text=_("Object:"))
+ sub.label(text="Object:")
sub.prop(md, "object", text="")
sub.active = not md.is_bound
col = split.column()
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
sub = col.column()
@@ -344,9 +344,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.separator()
if md.is_bound:
- layout.operator("object.meshdeform_bind", text=_("Unbind"))
+ layout.operator("object.meshdeform_bind", text="Unbind")
else:
- layout.operator("object.meshdeform_bind", text=_("Bind"))
+ layout.operator("object.meshdeform_bind", text="Bind")
row = layout.row()
row.prop(md, "precision")
@@ -356,19 +356,19 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split(percentage=0.25)
col = split.column()
- col.label(text=_("Axis:"))
+ col.label(text="Axis:")
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_z")
col = split.column()
- col.label(text=_("Options:"))
- col.prop(md, "use_mirror_merge", text=_("Merge"))
- col.prop(md, "use_clip", text=_("Clipping"))
- col.prop(md, "use_mirror_vertex_groups", text=_("Vertex Groups"))
+ col.label(text="Options:")
+ col.prop(md, "use_mirror_merge", text="Merge")
+ col.prop(md, "use_clip", text="Clipping")
+ col.prop(md, "use_mirror_vertex_groups", text="Vertex Groups")
col = split.column()
- col.label(text=_("Textures:"))
+ col.label(text="Textures:")
col.prop(md, "use_mirror_u", text="U")
col.prop(md, "use_mirror_v", text="V")
@@ -376,29 +376,25 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
if md.use_mirror_merge == True:
col.prop(md, "merge_threshold")
- col.label(text=_("Mirror Object:"))
+ col.label(text="Mirror Object:")
col.prop(md, "mirror_object", text="")
- def NAVMESH(self, layout, ob, md):
- layout.operator("object.assign_navpolygon")
- layout.operator("object.assign_new_navpolygon")
-
def MULTIRES(self, layout, ob, md):
layout.row().prop(md, "subdivision_type", expand=True)
split = layout.split()
col = split.column()
- col.prop(md, "levels", text=_("Preview"))
- col.prop(md, "sculpt_levels", text=_("Sculpt"))
- col.prop(md, "render_levels", text=_("Render"))
+ col.prop(md, "levels", text="Preview")
+ col.prop(md, "sculpt_levels", text="Sculpt")
+ col.prop(md, "render_levels", text="Render")
col = split.column()
col.enabled = ob.mode != 'EDIT'
- col.operator("object.multires_subdivide", text=_("Subdivide"))
- col.operator("object.multires_higher_levels_delete", text=_("Delete Higher"))
- col.operator("object.multires_reshape", text=_("Reshape"))
- col.operator("object.multires_base_apply", text=_("Apply Base"))
+ col.operator("object.multires_subdivide", text="Subdivide")
+ col.operator("object.multires_higher_levels_delete", text="Delete Higher")
+ col.operator("object.multires_reshape", text="Reshape")
+ col.operator("object.multires_base_apply", text="Apply Base")
col.prop(md, "use_subsurf_uv")
col.prop(md, "show_only_control_edges")
@@ -407,34 +403,34 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = layout.column()
row = col.row()
if md.is_external:
- row.operator("object.multires_external_pack", text=_("Pack External"))
+ row.operator("object.multires_external_pack", text="Pack External")
row.label()
row = col.row()
row.prop(md, "filepath", text="")
else:
- row.operator("object.multires_external_save", text=_("Save External..."))
+ row.operator("object.multires_external_save", text="Save External...")
row.label()
def PARTICLE_INSTANCE(self, layout, ob, md):
layout.prop(md, "object")
- layout.prop(md, "particle_system_index", text=_("Particle System"))
+ layout.prop(md, "particle_system_index", text="Particle System")
split = layout.split()
col = split.column()
- col.label(text=_("Create From:"))
+ col.label(text="Create From:")
col.prop(md, "use_normal")
col.prop(md, "use_children")
col.prop(md, "use_size")
col = split.column()
- col.label(text=_("Show Particles When:"))
+ col.label(text="Show Particles When:")
col.prop(md, "show_alive")
col.prop(md, "show_unborn")
col.prop(md, "show_dead")
layout.separator()
- layout.prop(md, "use_path", text=_("Create Along Paths"))
+ layout.prop(md, "use_path", text="Create Along Paths")
split = layout.split()
split.active = md.use_path
@@ -444,17 +440,17 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
col.prop(md, "position", slider=True)
- col.prop(md, "random_position", text=_("Random"), slider=True)
+ col.prop(md, "random_position", text="Random", slider=True)
def PARTICLE_SYSTEM(self, layout, ob, md):
- layout.label(text=_("Settings can be found inside the Particle context"))
+ layout.label(text="Settings can be found inside the Particle context")
def SCREW(self, layout, ob, md):
split = layout.split()
col = split.column()
col.prop(md, "axis")
- col.prop(md, "object", text=_("AxisOb"))
+ col.prop(md, "object", text="AxisOb")
col.prop(md, "angle")
col.prop(md, "steps")
col.prop(md, "render_steps")
@@ -473,10 +469,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def SHRINKWRAP(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Target:"))
+ col.label(text="Target:")
col.prop(md, "target", text="")
col = split.column()
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
split = layout.split()
@@ -486,28 +482,28 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.prop(md, "subsurf_levels")
col = split.column()
- col.label(text=_("Mode:"))
+ col.label(text="Mode:")
col.prop(md, "wrap_method", text="")
if md.wrap_method == 'PROJECT':
split = layout.split(percentage=0.25)
col = split.column()
- col.label(text=_("Axis:"))
+ col.label(text="Axis:")
col.prop(md, "use_project_x")
col.prop(md, "use_project_y")
col.prop(md, "use_project_z")
col = split.column()
- col.label(text=_("Direction:"))
+ col.label(text="Direction:")
col.prop(md, "use_negative_direction")
col.prop(md, "use_positive_direction")
col = split.column()
- col.label(text=_("Cull Faces:"))
+ col.label(text="Cull Faces:")
col.prop(md, "cull_face", expand=True)
- layout.label(text=_("Auxiliary Target:"))
+ layout.label(text="Auxiliary Target:")
layout.prop(md, "auxiliary_target", text="")
elif md.wrap_method == 'NEAREST_SURFACEPOINT':
@@ -517,24 +513,24 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Mode:"))
+ col.label(text="Mode:")
col.prop(md, "deform_method", text="")
col = split.column()
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
split = layout.split()
col = split.column()
- col.label(text=_("Origin:"))
+ col.label(text="Origin:")
col.prop(md, "origin", text="")
sub = col.column()
sub.active = (md.origin is not None)
sub.prop(md, "use_relative")
col = split.column()
- col.label(text=_("Deform:"))
+ col.label(text="Deform:")
col.prop(md, "factor")
col.prop(md, "limits", slider=True)
if md.deform_method in {'TAPER', 'STRETCH'}:
@@ -542,13 +538,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.prop(md, "lock_y")
def SMOKE(self, layout, ob, md):
- layout.label(text=_("Settings can be found inside the Physics context"))
+ layout.label(text="Settings can be found inside the Physics context")
def SMOOTH(self, layout, ob, md):
split = layout.split(percentage=0.25)
col = split.column()
- col.label(text=_("Axis:"))
+ col.label(text="Axis:")
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_z")
@@ -556,11 +552,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
col.prop(md, "factor")
col.prop(md, "iterations")
- col.label(text=_("Vertex Group:"))
+ col.label(text="Vertex Group:")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
def SOFT_BODY(self, layout, ob, md):
- layout.label(text=_("Settings can be found inside the Physics context"))
+ layout.label(text="Settings can be found inside the Physics context")
def SOLIDIFY(self, layout, ob, md):
split = layout.split()
@@ -569,19 +565,19 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col.prop(md, "thickness")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
- col.label(text=_("Crease:"))
- col.prop(md, "edge_crease_inner", text=_("Inner"))
- col.prop(md, "edge_crease_outer", text=_("Outer"))
- col.prop(md, "edge_crease_rim", text=_("Rim"))
- col.label(text=_("Material Index Offset:"))
+ col.label(text="Crease:")
+ col.prop(md, "edge_crease_inner", text="Inner")
+ col.prop(md, "edge_crease_outer", text="Outer")
+ col.prop(md, "edge_crease_rim", text="Rim")
+ col.label(text="Material Index Offset:")
col = split.column()
col.prop(md, "offset")
sub = col.column()
sub.active = bool(md.vertex_group)
- sub.prop(md, "invert_vertex_group", text=_("Invert"))
- sub.prop(md, "thickness_vertex_group", text=_("Factor"))
+ sub.prop(md, "invert_vertex_group", text="Invert")
+ sub.prop(md, "thickness_vertex_group", text="Factor")
col.prop(md, "use_even_offset")
col.prop(md, "use_quality_normals")
@@ -592,64 +588,64 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
row.prop(md, "material_offset", text="")
row = row.row()
row.active = md.use_rim
- row.prop(md, "material_offset_rim", text=_("Rim"))
+ row.prop(md, "material_offset_rim", text="Rim")
def SUBSURF(self, layout, ob, md):
layout.row().prop(md, "subdivision_type", expand=True)
split = layout.split()
col = split.column()
- col.label(text=_("Subdivisions:"))
- col.prop(md, "levels", text=_("View"))
- col.prop(md, "render_levels", text=_("Render"))
+ col.label(text="Subdivisions:")
+ col.prop(md, "levels", text="View")
+ col.prop(md, "render_levels", text="Render")
col = split.column()
- col.label(text=_("Options:"))
+ col.label(text="Options:")
col.prop(md, "use_subsurf_uv")
col.prop(md, "show_only_control_edges")
def SURFACE(self, layout, ob, md):
- layout.label(text=_("Settings can be found inside the Physics context"))
+ layout.label(text="Settings can be found inside the Physics context")
def UV_PROJECT(self, layout, ob, md):
split = layout.split()
col = split.column()
- col.label(text=_("Image:"))
+ col.label(text="Image:")
col.prop(md, "image", text="")
col = split.column()
- col.label(text=_("UV Layer:"))
+ col.label(text="UV Layer:")
col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
split = layout.split()
col = split.column()
col.prop(md, "use_image_override")
- col.prop(md, "projector_count", text=_("Projectors"))
+ col.prop(md, "projector_count", text="Projectors")
for proj in md.projectors:
col.prop(proj, "object", text="")
col = split.column()
sub = col.column(align=True)
- sub.prop(md, "aspect_x", text=_("Aspect X"))
- sub.prop(md, "aspect_y", text=_("Aspect Y"))
+ sub.prop(md, "aspect_x", text="Aspect X")
+ sub.prop(md, "aspect_y", text="Aspect Y")
sub = col.column(align=True)
- sub.prop(md, "scale_x", text=_("Scale X"))
- sub.prop(md, "scale_y", text=_("Scale Y"))
+ sub.prop(md, "scale_x", text="Scale X")
+ sub.prop(md, "scale_y", text="Scale Y")
def WARP(self, layout, ob, md):
use_falloff = (md.falloff_type != 'NONE')
split = layout.split()
col = split.column()
- col.label(text=_("From:"))
+ col.label(text="From:")
col.prop(md, "object_from", text="")
col.prop(md, "use_volume_preserve")
col = split.column()
- col.label(text=_("To:"))
+ col.label(text="To:")
col.prop(md, "object_to", text="")
col.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
@@ -668,15 +664,15 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
# 2 new columns
split = layout.split()
col = split.column()
- col.label(text=_("Texture:"))
+ col.label(text="Texture:")
col.template_ID(md, "texture", new="texture.new")
col = split.column()
- col.label(text=_("Texture Coordinates:"))
+ col.label(text="Texture Coordinates:")
col.prop(md, "texture_coords", text="")
if md.texture_coords == 'OBJECT':
- layout.prop(md, "texture_coords_object", text=_("Object"))
+ layout.prop(md, "texture_coords_object", text="Object")
elif md.texture_coords == 'UV' and ob.type == 'MESH':
layout.prop_search(md, "uv_layer", ob.data, "uv_textures")
@@ -684,7 +680,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Motion:"))
+ col.label(text="Motion:")
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_cyclic")
@@ -700,18 +696,18 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Time:"))
+ col.label(text="Time:")
sub = col.column(align=True)
- sub.prop(md, "time_offset", text=_("Offset"))
- sub.prop(md, "lifetime", text=_("Life"))
- col.prop(md, "damping_time", text=_("Damping"))
+ sub.prop(md, "time_offset", text="Offset")
+ sub.prop(md, "lifetime", text="Life")
+ col.prop(md, "damping_time", text="Damping")
col = split.column()
- col.label(text=_("Position:"))
+ col.label(text="Position:")
sub = col.column(align=True)
sub.prop(md, "start_position_x", text="X")
sub.prop(md, "start_position_y", text="Y")
- col.prop(md, "falloff_radius", text=_("Falloff"))
+ col.prop(md, "falloff_radius", text="Falloff")
layout.separator()
@@ -719,7 +715,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.prop_search(md, "vertex_group", ob, "vertex_groups")
split = layout.split(percentage=0.33)
col = split.column()
- col.label(text=_("Texture"))
+ col.label(text="Texture")
col = split.column()
col.template_ID(md, "texture", new="texture.new")
layout.prop(md, "texture_coords")
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py
index 95ae54c4597..0d104571e4b 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
+
class PhysicsButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -47,14 +47,15 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
layout.prop(game, "physics_type")
layout.separator()
- #if game.physics_type == 'DYNAMIC':
- if game.physics_type in {'DYNAMIC', 'RIGID_BODY'}:
+ physics_type = game.physics_type
+
+ if physics_type in {'DYNAMIC', 'RIGID_BODY'}:
split = layout.split()
col = split.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
- col.prop(ob, "hide_render", text=_("Invisible")) # out of place but useful
+ col.prop(ob, "hide_render", text="Invisible") # out of place but useful
col = split.column()
col.prop(game, "use_material_physics_fh")
@@ -66,7 +67,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Attributes:"))
+ col.label(text="Attributes:")
col.prop(game, "mass")
col.prop(game, "radius")
col.prop(game, "form_factor")
@@ -81,52 +82,52 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Velocity:"))
+ col.label(text="Velocity:")
sub = col.column(align=True)
- sub.prop(game, "velocity_min", text=_("Minimum"))
- sub.prop(game, "velocity_max", text=_("Maximum"))
+ sub.prop(game, "velocity_min", text="Minimum")
+ sub.prop(game, "velocity_max", text="Maximum")
col = split.column()
- col.label(text=_("Damping:"))
+ col.label(text="Damping:")
sub = col.column(align=True)
- sub.prop(game, "damping", text=_("Translation"), slider=True)
- sub.prop(game, "rotation_damping", text=_("Rotation"), slider=True)
+ sub.prop(game, "damping", text="Translation", slider=True)
+ sub.prop(game, "rotation_damping", text="Rotation", slider=True)
layout.separator()
split = layout.split()
col = split.column()
- col.label(text=_("Lock Translation:"))
+ col.label(text="Lock Translation:")
col.prop(game, "lock_location_x", text="X")
col.prop(game, "lock_location_y", text="Y")
col.prop(game, "lock_location_z", text="Z")
col = split.column()
- col.label(text=_("Lock Rotation:"))
+ col.label(text="Lock Rotation:")
col.prop(game, "lock_rotation_x", text="X")
col.prop(game, "lock_rotation_y", text="Y")
col.prop(game, "lock_rotation_z", text="Z")
- elif game.physics_type == 'SOFT_BODY':
+ elif physics_type == 'SOFT_BODY':
col = layout.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
- col.prop(ob, "hide_render", text=_("Invisible"))
+ col.prop(ob, "hide_render", text="Invisible")
layout.separator()
split = layout.split()
col = split.column()
- col.label(text=_("Attributes:"))
+ col.label(text="Attributes:")
col.prop(game, "mass")
col.prop(soft, "weld_threshold")
col.prop(soft, "location_iterations")
col.prop(soft, "linear_stiffness", slider=True)
col.prop(soft, "dynamic_friction", slider=True)
col.prop(soft, "collision_margin", slider=True)
- col.prop(soft, "use_bending_constraints", text=_("Bending Constraints"))
+ col.prop(soft, "use_bending_constraints", text="Bending Constraints")
col = split.column()
col.prop(soft, "use_shape_match")
@@ -136,25 +137,25 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
col.separator()
- col.label(text=_("Cluster Collision:"))
+ col.label(text="Cluster Collision:")
col.prop(soft, "use_cluster_rigid_to_softbody")
col.prop(soft, "use_cluster_soft_to_softbody")
sub = col.column()
sub.active = (soft.use_cluster_rigid_to_softbody or soft.use_cluster_soft_to_softbody)
- sub.prop(soft, "cluster_iterations", text=_("Iterations"))
+ sub.prop(soft, "cluster_iterations", text="Iterations")
- elif game.physics_type == 'STATIC':
+ elif physics_type == 'STATIC':
col = layout.column()
col.prop(game, "use_actor")
col.prop(game, "use_ghost")
- col.prop(ob, "hide_render", text=_("Invisible"))
+ col.prop(ob, "hide_render", text="Invisible")
layout.separator()
split = layout.split()
col = split.column()
- col.label(text=_("Attributes:"))
+ col.label(text="Attributes:")
col.prop(game, "radius")
col = split.column()
@@ -164,8 +165,17 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
subsub.active = game.use_anisotropic_friction
subsub.prop(game, "friction_coefficients", text="", slider=True)
- elif game.physics_type in {'SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
- layout.prop(ob, "hide_render", text=_("Invisible"))
+ elif physics_type in {'SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
+ layout.prop(ob, "hide_render", text="Invisible")
+
+ elif physics_type == 'NAVMESH':
+ layout.operator("mesh.navmesh_face_copy")
+ layout.operator("mesh.navmesh_face_add")
+
+ layout.separator()
+
+ layout.operator("mesh.navmesh_reset")
+ layout.operator("mesh.navmesh_clear")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
@@ -189,11 +199,11 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
game = context.active_object.game
layout.active = game.use_collision_bounds
- layout.prop(game, "collision_bounds_type", text=_("Bounds"))
+ layout.prop(game, "collision_bounds_type", text="Bounds")
row = layout.row()
- row.prop(game, "collision_margin", text=_("Margin"), slider=True)
- row.prop(game, "use_collision_compound", text=_("Compound"))
+ row.prop(game, "collision_margin", text="Margin", slider=True)
+ row.prop(game, "use_collision_compound", text="Compound")
class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel):
@@ -204,19 +214,19 @@ class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel):
def poll(cls, context):
game = context.object.game
rd = context.scene.render
- return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine in cls.COMPAT_ENGINES)
+ return (game.physics_type in {'DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC'}) and (rd.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
game = context.active_object.game
- self.layout.prop(game, "create_obstacle", text="")
+ self.layout.prop(game, "use_obstacle_create", text="")
def draw(self, context):
layout = self.layout
game = context.active_object.game
- layout.active = game.create_obstacle
+ layout.active = game.use_obstacle_create
row = layout.row()
row.prop(game, "obstacle_radius", text="Radius")
@@ -242,7 +252,7 @@ class RENDER_PT_game(RenderButtonsPanel, Panel):
layout = self.layout
row = layout.row()
- row.operator("view3d.game_start", text=_("Start"))
+ row.operator("view3d.game_start", text="Start")
row.label()
@@ -260,20 +270,20 @@ class RENDER_PT_game_player(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Resolution:"))
+ col.label(text="Resolution:")
sub = col.column(align=True)
sub.prop(gs, "resolution_x", slider=False, text="X")
sub.prop(gs, "resolution_y", slider=False, text="Y")
col = split.column()
- col.label(text=_("Quality:"))
+ col.label(text="Quality:")
sub = col.column(align=True)
- sub.prop(gs, "depth", text=_("Bit Depth"), slider=False)
- sub.prop(gs, "frequency", text=_("FPS"), slider=False)
+ sub.prop(gs, "depth", text="Bit Depth", slider=False)
+ sub.prop(gs, "frequency", text="FPS", slider=False)
# framing:
col = layout.column()
- col.label(text=_("Framing:"))
+ col.label(text="Framing:")
col.row().prop(gs, "frame_type", expand=True)
if gs.frame_type == 'LETTERBOX':
col.prop(gs, "frame_color", text="")
@@ -299,7 +309,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
# dome:
elif stereo_mode == 'DOME':
- layout.prop(gs, "dome_mode", text=_("Dome Type"))
+ layout.prop(gs, "dome_mode", text="Dome Type")
dome_type = gs.dome_mode
@@ -310,23 +320,23 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
dome_type == 'TRUNCATED_FRONT':
col = split.column()
- col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True)
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
col.prop(gs, "dome_angle", slider=True)
col = split.column()
- col.prop(gs, "dome_tesselation", text=_("Tesselation"))
+ col.prop(gs, "dome_tesselation", text="Tesselation")
col.prop(gs, "dome_tilt")
elif dome_type == 'PANORAM_SPH':
col = split.column()
- col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True)
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
col = split.column()
- col.prop(gs, "dome_tesselation", text=_("Tesselation"))
+ col.prop(gs, "dome_tesselation", text="Tesselation")
else: # cube map
col = split.column()
- col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True)
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
col = split.column()
@@ -348,15 +358,15 @@ class RENDER_PT_game_shading(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(gs, "use_glsl_lights", text=_("Lights"))
- col.prop(gs, "use_glsl_shaders", text=_("Shaders"))
- col.prop(gs, "use_glsl_shadows", text=_("Shadows"))
- col.prop(gs, "use_glsl_color_management", text=_("Color Management"))
+ col.prop(gs, "use_glsl_lights", text="Lights")
+ col.prop(gs, "use_glsl_shaders", text="Shaders")
+ col.prop(gs, "use_glsl_shadows", text="Shadows")
+ col.prop(gs, "use_glsl_color_management", text="Color Management")
col = split.column()
- col.prop(gs, "use_glsl_ramps", text=_("Ramps"))
- col.prop(gs, "use_glsl_nodes", text=_("Nodes"))
- col.prop(gs, "use_glsl_extra_textures", text=_("Extra Textures"))
+ col.prop(gs, "use_glsl_ramps", text="Ramps")
+ col.prop(gs, "use_glsl_nodes", text="Nodes")
+ col.prop(gs, "use_glsl_extra_textures", text="Extra Textures")
class RENDER_PT_game_performance(RenderButtonsPanel, Panel):
@@ -384,11 +394,11 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel):
gs = context.scene.game_settings
flow = layout.column_flow()
- flow.prop(gs, "show_debug_properties", text=_("Debug Properties"))
- flow.prop(gs, "show_framerate_profile", text=_("Framerate and Profile"))
- flow.prop(gs, "show_physics_visualization", text=_("Physics Visualization"))
+ flow.prop(gs, "show_debug_properties", text="Debug Properties")
+ flow.prop(gs, "show_framerate_profile", text="Framerate and Profile")
+ flow.prop(gs, "show_physics_visualization", text="Physics Visualization")
flow.prop(gs, "use_deprecation_warnings")
- flow.prop(gs, "show_mouse", text=_("Mouse Cursor"))
+ flow.prop(gs, "show_mouse", text="Mouse Cursor")
class SceneButtonsPanel():
@@ -412,7 +422,7 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, bpy.types.Panel):
rd = context.scene.game_settings.recast_data
- layout.operator("object.create_navmesh", text='Build navigation mesh')
+ layout.operator("mesh.navmesh_make", text='Build navigation mesh')
col = layout.column()
col.label(text="Rasterization:")
@@ -429,8 +439,8 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, bpy.types.Panel):
col.prop(rd, "agent_radius", text="Radius")
col = split.column()
- col.prop(rd, "max_slope")
- col.prop(rd, "max_climb")
+ col.prop(rd, "slope_max")
+ col.prop(rd, "climb_max")
col = layout.column()
col.label(text="Region:")
@@ -546,37 +556,37 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
layout.prop(gs, "physics_engine")
if gs.physics_engine != 'NONE':
- layout.prop(gs, "physics_gravity", text=_("Gravity"))
+ layout.prop(gs, "physics_gravity", text="Gravity")
split = layout.split()
col = split.column()
- col.label(text=_("Physics Steps:"))
+ col.label(text="Physics Steps:")
sub = col.column(align=True)
- sub.prop(gs, "physics_step_max", text=_("Max"))
- sub.prop(gs, "physics_step_sub", text=_("Substeps"))
- col.prop(gs, "fps", text=_("FPS"))
+ sub.prop(gs, "physics_step_max", text="Max")
+ sub.prop(gs, "physics_step_sub", text="Substeps")
+ col.prop(gs, "fps", text="FPS")
col = split.column()
- col.label(text=_("Logic Steps:"))
- col.prop(gs, "logic_step_max", text=_("Max"))
+ col.label(text="Logic Steps:")
+ col.prop(gs, "logic_step_max", text="Max")
col = layout.column()
- col.prop(gs, "use_occlusion_culling", text=_("Occlusion Culling"))
+ col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
sub = col.column()
sub.active = gs.use_occlusion_culling
- sub.prop(gs, "occlusion_culling_resolution", text=_("Resolution"))
+ sub.prop(gs, "occlusion_culling_resolution", text="Resolution")
else:
split = layout.split()
col = split.column()
- col.label(text=_("Physics Steps:"))
- col.prop(gs, "fps", text=_("FPS"))
+ col.label(text="Physics Steps:")
+ col.prop(gs, "fps", text="FPS")
col = split.column()
- col.label(text=_("Logic Steps:"))
- col.prop(gs, "logic_step_max", text=_("Max"))
+ col.label(text="Logic Steps:")
+ col.prop(gs, "logic_step_max", text="Max")
class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 7b04c990c6a..5b00402520e 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
@@ -114,9 +114,9 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
if ob.mode == 'EDIT':
row = layout.row(align=True)
- row.operator("object.material_slot_assign", text=_("Assign"))
- row.operator("object.material_slot_select", text=_("Select"))
- row.operator("object.material_slot_deselect", text=_("Deselect"))
+ row.operator("object.material_slot_assign", text="Assign")
+ row.operator("object.material_slot_select", text="Select")
+ row.operator("object.material_slot_deselect", text="Deselect")
split = layout.split(percentage=0.65)
@@ -142,7 +142,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
if mat.active_node_material:
row.prop(mat.active_node_material, "name", text="")
else:
- row.label(text=_("No material node selected"))
+ row.label(text="No material node selected")
class MATERIAL_PT_preview(MaterialButtonsPanel, Panel):
@@ -197,8 +197,8 @@ class MATERIAL_PT_pipeline(MaterialButtonsPanel, Panel):
col = split.column()
col.active = mat_type
- col.prop(mat, "use_cast_shadows_only", text=_("Cast Only"))
- col.prop(mat, "shadow_cast_alpha", text=_("Casting Alpha"))
+ col.prop(mat, "use_cast_shadows_only", text="Cast Only")
+ col.prop(mat, "shadow_cast_alpha", text="Casting Alpha")
col.prop(mat, "use_cast_buffer_shadows")
col.prop(mat, "use_cast_approximate")
col.prop(mat, "pass_index")
@@ -225,12 +225,12 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel):
col.prop(mat, "diffuse_color", text="")
sub = col.column()
sub.active = (not mat.use_shadeless)
- sub.prop(mat, "diffuse_intensity", text=_("Intensity"))
+ sub.prop(mat, "diffuse_intensity", text="Intensity")
col = split.column()
col.active = (not mat.use_shadeless)
col.prop(mat, "diffuse_shader", text="")
- col.prop(mat, "use_diffuse_ramp", text=_("Ramp"))
+ col.prop(mat, "use_diffuse_ramp", text="Ramp")
col = layout.column()
col.active = (not mat.use_shadeless)
@@ -240,12 +240,12 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel):
col.prop(mat, "darkness")
elif mat.diffuse_shader == 'TOON':
row = col.row()
- row.prop(mat, "diffuse_toon_size", text=_("Size"))
- row.prop(mat, "diffuse_toon_smooth", text=_("Smooth"))
+ row.prop(mat, "diffuse_toon_size", text="Size")
+ row.prop(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL':
row = col.row()
- row.prop(mat, "diffuse_fresnel", text=_("Fresnel"))
- row.prop(mat, "diffuse_fresnel_factor", text=_("Factor"))
+ row.prop(mat, "diffuse_fresnel", text="Fresnel")
+ row.prop(mat, "diffuse_fresnel_factor", text="Factor")
if mat.use_diffuse_ramp:
col = layout.column()
@@ -255,10 +255,10 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel, Panel):
col.separator()
row = col.row()
- row.prop(mat, "diffuse_ramp_input", text=_("Input"))
- row.prop(mat, "diffuse_ramp_blend", text=_("Blend"))
+ row.prop(mat, "diffuse_ramp_input", text="Input")
+ row.prop(mat, "diffuse_ramp_blend", text="Blend")
- col.prop(mat, "diffuse_ramp_factor", text=_("Factor"))
+ col.prop(mat, "diffuse_ramp_factor", text="Factor")
class MATERIAL_PT_specular(MaterialButtonsPanel, Panel):
@@ -282,25 +282,25 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, Panel):
col = split.column()
col.prop(mat, "specular_color", text="")
- col.prop(mat, "specular_intensity", text=_("Intensity"))
+ col.prop(mat, "specular_intensity", text="Intensity")
col = split.column()
col.prop(mat, "specular_shader", text="")
- col.prop(mat, "use_specular_ramp", text=_("Ramp"))
+ col.prop(mat, "use_specular_ramp", text="Ramp")
col = layout.column()
if mat.specular_shader in {'COOKTORR', 'PHONG'}:
- col.prop(mat, "specular_hardness", text=_("Hardness"))
+ col.prop(mat, "specular_hardness", text="Hardness")
elif mat.specular_shader == 'BLINN':
row = col.row()
- row.prop(mat, "specular_hardness", text=_("Hardness"))
- row.prop(mat, "specular_ior", text=_("IOR"))
+ row.prop(mat, "specular_hardness", text="Hardness")
+ row.prop(mat, "specular_ior", text="IOR")
elif mat.specular_shader == 'WARDISO':
- col.prop(mat, "specular_slope", text=_("Slope"))
+ col.prop(mat, "specular_slope", text="Slope")
elif mat.specular_shader == 'TOON':
row = col.row()
- row.prop(mat, "specular_toon_size", text=_("Size"))
- row.prop(mat, "specular_toon_smooth", text=_("Smooth"))
+ row.prop(mat, "specular_toon_size", text="Size")
+ row.prop(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
layout.separator()
@@ -308,10 +308,10 @@ class MATERIAL_PT_specular(MaterialButtonsPanel, Panel):
layout.separator()
row = layout.row()
- row.prop(mat, "specular_ramp_input", text=_("Input"))
- row.prop(mat, "specular_ramp_blend", text=_("Blend"))
+ row.prop(mat, "specular_ramp_input", text="Input")
+ row.prop(mat, "specular_ramp_blend", text="Blend")
- layout.prop(mat, "specular_ramp_factor", text=_("Factor"))
+ layout.prop(mat, "specular_ramp_factor", text="Factor")
class MATERIAL_PT_shading(MaterialButtonsPanel, Panel):
@@ -384,14 +384,14 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, Panel):
col.prop(mat, "alpha")
row = col.row()
row.active = (base_mat.transparency_method != 'MASK') and (not mat.use_shadeless)
- row.prop(mat, "specular_alpha", text=_("Specular"))
+ row.prop(mat, "specular_alpha", text="Specular")
col = split.column()
col.active = (not mat.use_shadeless)
col.prop(rayt, "fresnel")
sub = col.column()
sub.active = rayt.fresnel > 0
- sub.prop(rayt, "fresnel_factor", text=_("Blend"))
+ sub.prop(rayt, "fresnel_factor", text="Blend")
if base_mat.transparency_method == 'RAYTRACE':
layout.separator()
@@ -406,12 +406,12 @@ class MATERIAL_PT_transp(MaterialButtonsPanel, Panel):
col.prop(rayt, "depth")
col = split.column()
- col.label(text=_("Gloss:"))
- col.prop(rayt, "gloss_factor", text=_("Amount"))
+ col.label(text="Gloss:")
+ col.prop(rayt, "gloss_factor", text="Amount")
sub = col.column()
sub.active = rayt.gloss_factor < 1.0
- sub.prop(rayt, "gloss_threshold", text=_("Threshold"))
- sub.prop(rayt, "gloss_samples", text=_("Samples"))
+ sub.prop(rayt, "gloss_threshold", text="Threshold")
+ sub.prop(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel):
@@ -448,28 +448,28 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel):
col.prop(raym, "fresnel")
sub = col.column()
sub.active = raym.fresnel > 0
- sub.prop(raym, "fresnel_factor", text=_("Blend"))
+ sub.prop(raym, "fresnel_factor", text="Blend")
split = layout.split()
col = split.column()
col.separator()
col.prop(raym, "depth")
- col.prop(raym, "distance", text=_("Max Dist"))
+ col.prop(raym, "distance", text="Max Dist")
col.separator()
sub = col.split(percentage=0.4)
sub.active = raym.distance > 0.0
- sub.label(text=_("Fade To:"))
+ sub.label(text="Fade To:")
sub.prop(raym, "fade_to", text="")
col = split.column()
- col.label(text=_("Gloss:"))
- col.prop(raym, "gloss_factor", text=_("Amount"))
+ col.label(text="Gloss:")
+ col.prop(raym, "gloss_factor", text="Amount")
sub = col.column()
sub.active = raym.gloss_factor < 1.0
- sub.prop(raym, "gloss_threshold", text=_("Threshold"))
- sub.prop(raym, "gloss_samples", text=_("Samples"))
- sub.prop(raym, "gloss_anisotropic", text=_("Anisotropic"))
+ sub.prop(raym, "gloss_threshold", text="Threshold")
+ sub.prop(raym, "gloss_samples", text="Samples")
+ sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_sss(MaterialButtonsPanel, Panel):
@@ -510,18 +510,18 @@ class MATERIAL_PT_sss(MaterialButtonsPanel, Panel):
col.prop(sss, "ior")
col.prop(sss, "scale")
col.prop(sss, "color", text="")
- col.prop(sss, "radius", text=_("RGB Radius"), expand=True)
+ col.prop(sss, "radius", text="RGB Radius", expand=True)
col = split.column()
sub = col.column(align=True)
- sub.label(text=_("Blend:"))
- sub.prop(sss, "color_factor", text=_("Color"))
- sub.prop(sss, "texture_factor", text=_("Texture"))
- sub.label(text=_("Scattering Weight:"))
+ sub.label(text="Blend:")
+ sub.prop(sss, "color_factor", text="Color")
+ sub.prop(sss, "texture_factor", text="Texture")
+ sub.label(text="Scattering Weight:")
sub.prop(sss, "front")
sub.prop(sss, "back")
col.separator()
- col.prop(sss, "error_threshold", text=_("Error"))
+ col.prop(sss, "error_threshold", text="Error")
class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
@@ -561,7 +561,7 @@ class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
col.prop(halo, "hardness")
col.prop(halo, "add")
- layout.label(text=_("Options:"))
+ layout.label(text="Options:")
split = layout.split()
col = split.column()
@@ -603,13 +603,13 @@ class MATERIAL_PT_flare(MaterialButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(halo, "flare_size", text=_("Size"))
- col.prop(halo, "flare_boost", text=_("Boost"))
- col.prop(halo, "flare_seed", text=_("Seed"))
+ col.prop(halo, "flare_size", text="Size")
+ col.prop(halo, "flare_boost", text="Boost")
+ col.prop(halo, "flare_seed", text="Seed")
col = split.column()
- col.prop(halo, "flare_subflare_count", text=_("Subflares"))
- col.prop(halo, "flare_subflare_size", text=_("Subsize"))
+ col.prop(halo, "flare_subflare_count", text="Subflares")
+ col.prop(halo, "flare_subflare_size", text="Subsize")
class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel):
@@ -618,14 +618,14 @@ class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel):
@classmethod
def poll(cls, context):
- return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES)
+ return context.material and (context.scene.render.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
game = context.material.game_settings # dont use node material
row = layout.row()
- row.prop(game, "back_culling")
+ row.prop(game, "use_backface_culling")
row.prop(game, "invisible")
row.prop(game, "text")
@@ -633,13 +633,14 @@ class MATERIAL_PT_game_settings(MaterialButtonsPanel, bpy.types.Panel):
row.label(text="Alpha Blend:")
row.label(text="Face Orientation:")
row = layout.row()
- row.prop(game,"alpha_blend",text="")
- row.prop(game,"face_orientation",text="")
+ row.prop(game, "alpha_blend", text="")
+ row.prop(game, "face_orientation", text="")
+
class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Physics"
COMPAT_ENGINES = {'BLENDER_GAME'}
-
+
def draw_header(self, context):
game = context.material.game_settings
self.layout.prop(game, "physics", text="")
@@ -660,7 +661,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel):
row.prop(phys, "elasticity", slider=True)
row = layout.row()
- row.label(text=_("Force Field:"))
+ row.label(text="Force Field:")
row = layout.row()
row.prop(phys, "fh_force")
@@ -692,10 +693,10 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel):
col = split.column()
sub = col.column(align=True)
- sub.label(text=_("Size:"))
- sub.prop(tan, "root_size", text=_("Root"))
- sub.prop(tan, "tip_size", text=_("Tip"))
- sub.prop(tan, "size_min", text=_("Minimum"))
+ sub.label(text="Size:")
+ sub.prop(tan, "root_size", text="Root")
+ sub.prop(tan, "tip_size", text="Tip")
+ sub.prop(tan, "size_min", text="Minimum")
sub.prop(tan, "use_blender_units")
sub = col.column()
sub.active = (not mat.use_shadeless)
@@ -703,7 +704,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel):
col.prop(tan, "shape")
col = split.column()
- col.label(text=_("Shading:"))
+ col.label(text="Shading:")
col.prop(tan, "width_fade")
ob = context.object
if ob and ob.type == 'MESH':
@@ -713,9 +714,9 @@ class MATERIAL_PT_strand(MaterialButtonsPanel, Panel):
col.separator()
sub = col.column()
sub.active = (not mat.use_shadeless)
- sub.label(_("Surface diffuse:"))
+ sub.label("Surface diffuse:")
sub = col.column()
- sub.prop(tan, "blend_distance", text=_("Distance"))
+ sub.prop(tan, "blend_distance", text="Distance")
class MATERIAL_PT_options(MaterialButtonsPanel, Panel):
@@ -748,11 +749,11 @@ class MATERIAL_PT_options(MaterialButtonsPanel, Panel):
sub.prop(mat, "offset_z")
sub.active = mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY'
sub = col.column(align=True)
- sub.label(text=_("Light Group:"))
+ sub.label(text="Light Group:")
sub.prop(mat, "light_group", text="")
row = sub.row()
row.active = bool(mat.light_group)
- row.prop(mat, "use_light_group_exclusive", text=_("Exclusive"))
+ row.prop(mat, "use_light_group_exclusive", text="Exclusive")
col = split.column()
col.prop(mat, "use_face_texture")
@@ -787,12 +788,12 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(mat, "use_shadows", text=_("Receive"))
- col.prop(mat, "use_transparent_shadows", text=_("Receive Transparent"))
+ col.prop(mat, "use_shadows", text="Receive")
+ col.prop(mat, "use_transparent_shadows", text="Receive Transparent")
if simple_material(base_mat):
- col.prop(mat, "use_cast_shadows_only", text=_("Cast Only"))
- col.prop(mat, "shadow_cast_alpha", text=_("Casting Alpha"))
- col.prop(mat, "use_only_shadow", text=_("Shadows Only"))
+ col.prop(mat, "use_cast_shadows_only", text="Cast Only")
+ col.prop(mat, "shadow_cast_alpha", text="Casting Alpha")
+ col.prop(mat, "use_only_shadow", text="Shadows Only")
sub = col.column()
sub.active = mat.use_only_shadow
sub.prop(mat, "shadow_only_type", text="")
@@ -802,11 +803,11 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, Panel):
col.prop(mat, "use_cast_buffer_shadows")
sub = col.column()
sub.active = mat.use_cast_buffer_shadows
- sub.prop(mat, "shadow_buffer_bias", text=_("Buffer Bias"))
- col.prop(mat, "use_ray_shadow_bias", text=_("Auto Ray Bias"))
+ sub.prop(mat, "shadow_buffer_bias", text="Buffer Bias")
+ col.prop(mat, "use_ray_shadow_bias", text="Auto Ray Bias")
sub = col.column()
sub.active = (not mat.use_ray_shadow_bias)
- sub.prop(mat, "shadow_ray_bias", text=_("Ray Bias"))
+ sub.prop(mat, "shadow_ray_bias", text="Ray Bias")
if simple_material(base_mat):
col.prop(mat, "use_cast_approximate")
@@ -919,7 +920,7 @@ class MATERIAL_PT_volume_lighting(VolumeButtonsPanel, Panel):
sub = col.column()
sub.enabled = True
sub.active = False
- sub.label(_("Light Cache Enabled"))
+ sub.label("Light Cache Enabled")
col.prop(vol, "cache_resolution")
sub = col.column(align=True)
@@ -958,7 +959,7 @@ class MATERIAL_PT_volume_integration(VolumeButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Step Calculation:"))
+ col.label(text="Step Calculation:")
col.prop(vol, "step_method", text="")
col = col.column(align=True)
col.prop(vol, "step_size")
@@ -993,11 +994,11 @@ class MATERIAL_PT_volume_options(VolumeButtonsPanel, Panel):
col.prop(mat, "use_mist")
col = split.column()
- col.label(text=_("Light Group:"))
+ col.label(text="Light Group:")
col.prop(mat, "light_group", text="")
row = col.row()
row.active = bool(mat.light_group)
- row.prop(mat, "use_light_group_exclusive", text=_("Exclusive"))
+ row.prop(mat, "use_light_group_exclusive", text="Exclusive")
class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index a099189eed6..0779debb102 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class ObjectButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -55,14 +55,14 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
row.column().prop(ob, "location")
if ob.rotation_mode == 'QUATERNION':
- row.column().prop(ob, "rotation_quaternion", text=_("Rotation"))
+ row.column().prop(ob, "rotation_quaternion", text="Rotation")
elif ob.rotation_mode == 'AXIS_ANGLE':
- #row.column().label(text=_("Rotation"))
- #row.column().prop(pchan, "rotation_angle", text=_("Angle"))
- #row.column().prop(pchan, "rotation_axis", text=_("Axis"))
- row.column().prop(ob, "rotation_axis_angle", text=_("Rotation"))
+ #row.column().label(text="Rotation")
+ #row.column().prop(pchan, "rotation_angle", text="Angle")
+ #row.column().prop(pchan, "rotation_axis", text="Axis")
+ row.column().prop(ob, "rotation_axis_angle", text="Rotation")
else:
- row.column().prop(ob, "rotation_euler", text=_("Rotation"))
+ row.column().prop(ob, "rotation_euler", text="Rotation")
row.column().prop(ob, "scale")
@@ -82,15 +82,15 @@ class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
row.column().prop(ob, "delta_location")
if ob.rotation_mode == 'QUATERNION':
- row.column().prop(ob, "delta_rotation_quaternion", text=_("Rotation"))
+ row.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
elif ob.rotation_mode == 'AXIS_ANGLE':
- #row.column().label(text=_("Rotation"))
- #row.column().prop(pchan, "delta_rotation_angle", text=_("Angle"))
- #row.column().prop(pchan, "delta_rotation_axis", text=_("Axis"))
- #row.column().prop(ob, "delta_rotation_axis_angle", text=_("Rotation"))
- row.column().label(text=_("Not for Axis-Angle"))
+ #row.column().label(text="Rotation")
+ #row.column().prop(pchan, "delta_rotation_angle", text="Angle")
+ #row.column().prop(pchan, "delta_rotation_axis", text="Axis")
+ #row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
+ row.column().label(text="Not for Axis-Angle")
else:
- row.column().prop(ob, "delta_rotation_euler", text=_("Rotation"))
+ row.column().prop(ob, "delta_rotation_euler", text="Rotation")
row.column().prop(ob, "delta_scale")
@@ -107,18 +107,18 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel, Panel):
row = layout.row()
col = row.column()
- col.prop(ob, "lock_location", text=_("Location"))
+ col.prop(ob, "lock_location", text="Location")
col = row.column()
if ob.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
- col.prop(ob, "lock_rotations_4d", text=_("Rotation"))
+ col.prop(ob, "lock_rotations_4d", text="Rotation")
if ob.lock_rotations_4d:
col.prop(ob, "lock_rotation_w", text="W")
col.prop(ob, "lock_rotation", text="")
else:
- col.prop(ob, "lock_rotation", text=_("Rotation"))
+ col.prop(ob, "lock_rotation", text="Rotation")
- row.column().prop(ob, "lock_scale", text=_("Scale"))
+ row.column().prop(ob, "lock_scale", text="Scale")
class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
@@ -137,7 +137,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
col.prop(ob, "pass_index")
col = split.column()
- col.label(text=_("Parent:"))
+ col.label(text="Parent:")
col.prop(ob, "parent", text="")
sub = col.column()
@@ -157,7 +157,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
ob = context.object
row = layout.row(align=True)
- row.operator("object.group_link", text=_("Add to Group"))
+ row.operator("object.group_link", text="Add to Group")
row.operator("object.group_add", text="", icon='ZOOMIN')
# XXX, this is bad practice, yes, I wrote it :( - campbell
@@ -176,12 +176,12 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
split = col.box().split()
col = split.column()
- col.prop(group, "layers", text=_("Dupli"))
+ col.prop(group, "layers", text="Dupli")
col = split.column()
col.prop(group, "dupli_offset", text="")
- prop = col.operator("wm.context_set_value", text=_("From Cursor"))
+ prop = col.operator("wm.context_set_value", text="From Cursor")
prop.data_path = "object.users_group[%d].dupli_offset" % index
prop.value = value
index += 1
@@ -197,11 +197,11 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(ob, "draw_type", text=_("Type"))
+ col.prop(ob, "draw_type", text="Type")
col = split.column()
row = col.row()
- row.prop(ob, "show_bounds", text=_("Bounds"))
+ row.prop(ob, "show_bounds", text="Bounds")
sub = row.row()
sub.active = ob.show_bounds
sub.prop(ob, "draw_bounds_type", text="")
@@ -209,16 +209,16 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(ob, "show_name", text=_("Name"))
- col.prop(ob, "show_axis", text=_("Axis"))
- col.prop(ob, "show_wire", text=_("Wire"))
- col.prop(ob, "color", text=_("Object Color"))
+ col.prop(ob, "show_name", text="Name")
+ col.prop(ob, "show_axis", text="Axis")
+ col.prop(ob, "show_wire", text="Wire")
+ col.prop(ob, "color", text="Object Color")
col = split.column()
- col.prop(ob, "show_texture_space", text=_("Texture Space"))
- col.prop(ob, "show_x_ray", text=_("X-Ray"))
+ col.prop(ob, "show_texture_space", text="Texture Space")
+ col.prop(ob, "show_x_ray", text="X-Ray")
if ob.type == 'MESH':
- col.prop(ob, "show_transparent", text=_("Transparency"))
+ col.prop(ob, "show_transparent", text="Transparency")
class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
@@ -235,26 +235,26 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
split = layout.split()
col = split.column(align=True)
- col.prop(ob, "dupli_frames_start", text=_("Start"))
- col.prop(ob, "dupli_frames_end", text=_("End"))
+ col.prop(ob, "dupli_frames_start", text="Start")
+ col.prop(ob, "dupli_frames_end", text="End")
col = split.column(align=True)
- col.prop(ob, "dupli_frames_on", text=_("On"))
- col.prop(ob, "dupli_frames_off", text=_("Off"))
+ col.prop(ob, "dupli_frames_on", text="On")
+ col.prop(ob, "dupli_frames_off", text="Off")
- layout.prop(ob, "use_dupli_frames_speed", text=_("Speed"))
+ layout.prop(ob, "use_dupli_frames_speed", text="Speed")
elif ob.dupli_type == 'VERTS':
- layout.prop(ob, "use_dupli_vertices_rotation", text=_("Rotation"))
+ layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation")
elif ob.dupli_type == 'FACES':
row = layout.row()
- row.prop(ob, "use_dupli_faces_scale", text=_("Scale"))
- row.prop(ob, "dupli_faces_scale", text=_("Inherit Scale"))
+ row.prop(ob, "use_dupli_faces_scale", text="Scale")
+ row.prop(ob, "dupli_faces_scale", text="Inherit Scale")
elif ob.dupli_type == 'GROUP':
- layout.prop(ob, "dupli_group", text=_("Group"))
+ layout.prop(ob, "dupli_group", text="Group")
# XXX: the following options are all quite buggy, ancient hacks that should be dropped
@@ -271,21 +271,21 @@ class OBJECT_PT_animation(ObjectButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Time Offset:"))
- col.prop(ob, "use_time_offset_edit", text=_("Edit"))
+ col.label(text="Time Offset:")
+ col.prop(ob, "use_time_offset_edit", text="Edit")
row = col.row()
- row.prop(ob, "use_time_offset_parent", text=_("Parent"))
+ row.prop(ob, "use_time_offset_parent", text="Parent")
row.active = (ob.parent is not None)
row = col.row()
row.prop(ob, "use_slow_parent")
row.active = (ob.parent is not None)
- col.prop(ob, "time_offset", text=_("Offset"))
+ col.prop(ob, "time_offset", text="Offset")
# XXX: these are still used for a few curve-related tracking features
col = split.column()
- col.label(text=_("Tracking Axes:"))
- col.prop(ob, "track_axis", text=_("Axis"))
- col.prop(ob, "up_axis", text=_("Up Axis"))
+ col.label(text="Tracking Axes:")
+ col.prop(ob, "track_axis", text="Axis")
+ col.prop(ob, "up_axis", text="Up Axis")
from bl_ui.properties_animviz import (
@@ -312,8 +312,8 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
layout.separator()
row = layout.row()
- row.operator("object.paths_calculate", text=_("Calculate Paths"))
- row.operator("object.paths_clear", text=_("Clear Paths"))
+ row.operator("object.paths_calculate", text="Calculate Paths")
+ row.operator("object.paths_clear", text="Clear Paths")
class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from panel when ready
diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py
index e7385d3926b..05fac2026a0 100644
--- a/release/scripts/startup/bl_ui/properties_object_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_object_constraint.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
+
class ConstraintButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -43,7 +43,7 @@ class ConstraintButtonsPanel():
split = layout.split(percentage=0.2)
- split.label(text=_("Space:"))
+ split.label(text="Space:")
row = split.row()
if target:
@@ -60,21 +60,21 @@ class ConstraintButtonsPanel():
if con.target and subtargets:
if con.target.type == 'ARMATURE':
- layout.prop_search(con, "subtarget", con.target.data, "bones", text=_("Bone"))
+ layout.prop_search(con, "subtarget", con.target.data, "bones", text="Bone")
if hasattr(con, "head_tail"):
row = layout.row()
- row.label(text=_("Head/Tail:"))
+ row.label(text="Head/Tail:")
row.prop(con, "head_tail", text="")
elif con.target.type in {'MESH', 'LATTICE'}:
- layout.prop_search(con, "subtarget", con.target, "vertex_groups", text=_("Vertex Group"))
+ layout.prop_search(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
def ik_template(self, layout, con):
# only used for iTaSC
layout.prop(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
- layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text=_("Bone"))
+ layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target:
row = layout.row()
@@ -96,19 +96,19 @@ class ConstraintButtonsPanel():
split = layout.split()
col = split.column()
- col.label(text=_("Location:"))
+ col.label(text="Location:")
col.prop(con, "use_location_x", text="X")
col.prop(con, "use_location_y", text="Y")
col.prop(con, "use_location_z", text="Z")
col = split.column()
- col.label(text=_("Rotation:"))
+ col.label(text="Rotation:")
col.prop(con, "use_rotation_x", text="X")
col.prop(con, "use_rotation_y", text="Y")
col.prop(con, "use_rotation_z", text="Z")
col = split.column()
- col.label(text=_("Scale:"))
+ col.label(text="Scale:")
col.prop(con, "use_scale_x", text="X")
col.prop(con, "use_scale_y", text="Y")
col.prop(con, "use_scale_z", text="Z")
@@ -121,11 +121,11 @@ class ConstraintButtonsPanel():
self.target_template(layout, con)
row = layout.row()
- row.label(text=_("To:"))
+ row.label(text="To:")
row.prop(con, "track_axis", expand=True)
row = layout.row()
- row.prop(con, "up_axis", text=_("Up"))
+ row.prop(con, "up_axis", text="Up")
row.prop(con, "use_target_z")
self.space_template(layout, con)
@@ -140,7 +140,7 @@ class ConstraintButtonsPanel():
layout.prop(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
- layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text=_("Bone"))
+ layout.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target:
row = layout.row()
@@ -152,11 +152,11 @@ class ConstraintButtonsPanel():
col.prop(con, "iterations")
col.prop(con, "chain_count")
- col.label(text=_("Weight:"))
- col.prop(con, "weight", text=_("Position"), slider=True)
+ col.label(text="Weight:")
+ col.prop(con, "weight", text="Position", slider=True)
sub = col.column()
sub.active = con.use_rotation
- sub.prop(con, "orient_weight", text=_("Rotation"), slider=True)
+ sub.prop(con, "orient_weight", text="Rotation", slider=True)
col = split.column()
col.prop(con, "use_tail")
@@ -170,16 +170,16 @@ class ConstraintButtonsPanel():
self.ik_template(layout, con)
row = layout.row()
- row.label(text=_("Axis Ref:"))
+ row.label(text="Axis Ref:")
row.prop(con, "reference_axis", expand=True)
split = layout.split(percentage=0.33)
split.row().prop(con, "use_location")
row = split.row()
- row.prop(con, "weight", text=_("Weight"), slider=True)
+ row.prop(con, "weight", text="Weight", slider=True)
row.active = con.use_location
split = layout.split(percentage=0.33)
row = split.row()
- row.label(text=_("Lock:"))
+ row.label(text="Lock:")
row = split.row()
row.prop(con, "lock_location_x", text="X")
row.prop(con, "lock_location_y", text="Y")
@@ -189,11 +189,11 @@ class ConstraintButtonsPanel():
split = layout.split(percentage=0.33)
split.row().prop(con, "use_rotation")
row = split.row()
- row.prop(con, "orient_weight", text=_("Weight"), slider=True)
+ row.prop(con, "orient_weight", text="Weight", slider=True)
row.active = con.use_rotation
split = layout.split(percentage=0.33)
row = split.row()
- row.label(text=_("Lock:"))
+ row.label(text="Lock:")
row = split.row()
row.prop(con, "lock_rotation_x", text="X")
row.prop(con, "lock_rotation_y", text="Y")
@@ -207,8 +207,8 @@ class ConstraintButtonsPanel():
layout.prop(con, "limit_mode")
row = layout.row()
- row.prop(con, "weight", text=_("Weight"), slider=True)
- row.prop(con, "distance", text=_("Distance"), slider=True)
+ row.prop(con, "weight", text="Weight", slider=True)
+ row.prop(con, "distance", text="Distance", slider=True)
def FOLLOW_PATH(self, context, layout, con):
self.target_template(layout, con)
@@ -222,16 +222,16 @@ class ConstraintButtonsPanel():
col = split.column()
col.prop(con, "use_fixed_location")
if con.use_fixed_location:
- col.prop(con, "offset_factor", text=_("Offset"))
+ col.prop(con, "offset_factor", text="Offset")
else:
col.prop(con, "offset")
row = layout.row()
- row.label(text=_("Forward:"))
+ row.label(text="Forward:")
row.prop(con, "forward_axis", expand=True)
row = layout.row()
- row.prop(con, "up_axis", text=_("Up"))
+ row.prop(con, "up_axis", text="Up")
row.label()
def LIMIT_ROTATION(self, context, layout, con):
@@ -241,27 +241,27 @@ class ConstraintButtonsPanel():
col.prop(con, "use_limit_x")
sub = col.column()
sub.active = con.use_limit_x
- sub.prop(con, "min_x", text=_("Min"))
- sub.prop(con, "max_x", text=_("Max"))
+ sub.prop(con, "min_x", text="Min")
+ sub.prop(con, "max_x", text="Max")
col = split.column(align=True)
col.prop(con, "use_limit_y")
sub = col.column()
sub.active = con.use_limit_y
- sub.prop(con, "min_y", text=_("Min"))
- sub.prop(con, "max_y", text=_("Max"))
+ sub.prop(con, "min_y", text="Min")
+ sub.prop(con, "max_y", text="Max")
col = split.column(align=True)
col.prop(con, "use_limit_z")
sub = col.column()
sub.active = con.use_limit_z
- sub.prop(con, "min_z", text=_("Min"))
- sub.prop(con, "max_z", text=_("Max"))
+ sub.prop(con, "min_z", text="Min")
+ sub.prop(con, "max_z", text="Max")
layout.prop(con, "use_transform_limit")
row = layout.row()
- row.label(text=_("Convert:"))
+ row.label(text="Convert:")
row.prop(con, "owner_space", text="")
def LIMIT_LOCATION(self, context, layout, con):
@@ -302,7 +302,7 @@ class ConstraintButtonsPanel():
row.label()
row = layout.row()
- row.label(text=_("Convert:"))
+ row.label(text="Convert:")
row.prop(con, "owner_space", text="")
def LIMIT_SCALE(self, context, layout, con):
@@ -343,7 +343,7 @@ class ConstraintButtonsPanel():
row.label()
row = layout.row()
- row.label(text=_("Convert:"))
+ row.label(text="Convert:")
row.prop(con, "owner_space", text="")
def COPY_ROTATION(self, context, layout, con):
@@ -355,19 +355,19 @@ class ConstraintButtonsPanel():
col.prop(con, "use_x", text="X")
sub = col.column()
sub.active = con.use_x
- sub.prop(con, "invert_x", text=_("Invert"))
+ sub.prop(con, "invert_x", text="Invert")
col = split.column()
col.prop(con, "use_y", text="Y")
sub = col.column()
sub.active = con.use_y
- sub.prop(con, "invert_y", text=_("Invert"))
+ sub.prop(con, "invert_y", text="Invert")
col = split.column()
col.prop(con, "use_z", text="Z")
sub = col.column()
sub.active = con.use_z
- sub.prop(con, "invert_z", text=_("Invert"))
+ sub.prop(con, "invert_z", text="Invert")
layout.prop(con, "use_offset")
@@ -382,19 +382,19 @@ class ConstraintButtonsPanel():
col.prop(con, "use_x", text="X")
sub = col.column()
sub.active = con.use_x
- sub.prop(con, "invert_x", text=_("Invert"))
+ sub.prop(con, "invert_x", text="Invert")
col = split.column()
col.prop(con, "use_y", text="Y")
sub = col.column()
sub.active = con.use_y
- sub.prop(con, "invert_y", text=_("Invert"))
+ sub.prop(con, "invert_y", text="Invert")
col = split.column()
col.prop(con, "use_z", text="Z")
sub = col.column()
sub.active = con.use_z
- sub.prop(con, "invert_z", text=_("Invert"))
+ sub.prop(con, "invert_z", text="Invert")
layout.prop(con, "use_offset")
@@ -415,7 +415,7 @@ class ConstraintButtonsPanel():
def MAINTAIN_VOLUME(self, context, layout, con):
row = layout.row()
- row.label(text=_("Free:"))
+ row.label(text="Free:")
row.prop(con, "free_axis", expand=True)
layout.prop(con, "volume")
@@ -439,28 +439,28 @@ class ConstraintButtonsPanel():
split = layout.split()
col = split.column(align=True)
- col.label(text=_("Action Length:"))
- col.prop(con, "frame_start", text=_("Start"))
- col.prop(con, "frame_end", text=_("End"))
+ col.label(text="Action Length:")
+ col.prop(con, "frame_start", text="Start")
+ col.prop(con, "frame_end", text="End")
col = split.column(align=True)
- col.label(text=_("Target Range:"))
- col.prop(con, "min", text=_("Min"))
- col.prop(con, "max", text=_("Max"))
+ col.label(text="Target Range:")
+ col.prop(con, "min", text="Min")
+ col.prop(con, "max", text="Max")
row = layout.row()
- row.label(text=_("Convert:"))
+ row.label(text="Convert:")
row.prop(con, "target_space", text="")
def LOCKED_TRACK(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
- row.label(text=_("To:"))
+ row.label(text="To:")
row.prop(con, "track_axis", expand=True)
row = layout.row()
- row.label(text=_("Lock:"))
+ row.label(text="Lock:")
row.prop(con, "lock_axis", expand=True)
def LIMIT_DISTANCE(self, context, layout, con):
@@ -471,7 +471,7 @@ class ConstraintButtonsPanel():
col.operator("constraint.limitdistance_reset")
row = layout.row()
- row.label(text=_("Clamp Region:"))
+ row.label(text="Clamp Region:")
row.prop(con, "limit_mode", text="")
row = layout.row()
@@ -482,16 +482,16 @@ class ConstraintButtonsPanel():
self.target_template(layout, con)
row = layout.row()
- row.prop(con, "rest_length", text=_("Rest Length"))
- row.operator("constraint.stretchto_reset", text=_("Reset"))
+ row.prop(con, "rest_length", text="Rest Length")
+ row.operator("constraint.stretchto_reset", text="Reset")
- layout.prop(con, "bulge", text=_("Volume Variation"))
+ layout.prop(con, "bulge", text="Volume Variation")
row = layout.row()
- row.label(text=_("Volume:"))
+ row.label(text="Volume:")
row.prop(con, "volume", expand=True)
- row.label(text=_("Plane:"))
+ row.label(text="Plane:")
row.prop(con, "keep_axis", expand=True)
def FLOOR(self, context, layout, con):
@@ -504,7 +504,7 @@ class ConstraintButtonsPanel():
layout.prop(con, "offset")
row = layout.row()
- row.label(text=_("Min/Max:"))
+ row.label(text="Min/Max:")
row.prop(con, "floor_location", expand=True)
self.space_template(layout, con)
@@ -516,113 +516,113 @@ class ConstraintButtonsPanel():
layout.prop(con, "child")
row = layout.row()
- row.prop(con, "use_linked_collision", text=_("Linked Collision"))
- row.prop(con, "show_pivot", text=_("Display Pivot"))
+ row.prop(con, "use_linked_collision", text="Linked Collision")
+ row.prop(con, "show_pivot", text="Display Pivot")
split = layout.split()
col = split.column(align=True)
- col.label(text=_("Pivot:"))
+ col.label(text="Pivot:")
col.prop(con, "pivot_x", text="X")
col.prop(con, "pivot_y", text="Y")
col.prop(con, "pivot_z", text="Z")
col = split.column(align=True)
- col.label(text=_("Axis:"))
+ col.label(text="Axis:")
col.prop(con, "axis_x", text="X")
col.prop(con, "axis_y", text="Y")
col.prop(con, "axis_z", text="Z")
if con.pivot_type == 'CONE_TWIST':
- layout.label(text=_("Limits:"))
+ layout.label(text="Limits:")
split = layout.split()
col = split.column()
- col.prop(con, "use_angular_limit_x", text=_("Angle X"))
+ col.prop(con, "use_angular_limit_x", text="Angle X")
sub = col.column()
sub.active = con.use_angular_limit_x
sub.prop(con, "limit_angle_max_x", text="")
col = split.column()
- col.prop(con, "use_angular_limit_y", text=_("Angle Y"))
+ col.prop(con, "use_angular_limit_y", text="Angle Y")
sub = col.column()
sub.active = con.use_angular_limit_y
sub.prop(con, "limit_angle_max_y", text="")
col = split.column()
- col.prop(con, "use_angular_limit_z", text=_("Angle Z"))
+ col.prop(con, "use_angular_limit_z", text="Angle Z")
sub = col.column()
sub.active = con.use_angular_limit_z
sub.prop(con, "limit_angle_max_z", text="")
elif con.pivot_type == 'GENERIC_6_DOF':
- layout.label(text=_("Limits:"))
+ layout.label(text="Limits:")
split = layout.split()
col = split.column(align=True)
col.prop(con, "use_limit_x", text="X")
sub = col.column()
sub.active = con.use_limit_x
- sub.prop(con, "limit_min_x", text=_("Min"))
- sub.prop(con, "limit_max_x", text=_("Max"))
+ sub.prop(con, "limit_min_x", text="Min")
+ sub.prop(con, "limit_max_x", text="Max")
col = split.column(align=True)
col.prop(con, "use_limit_y", text="Y")
sub = col.column()
sub.active = con.use_limit_y
- sub.prop(con, "limit_min_y", text=_("Min"))
- sub.prop(con, "limit_max_y", text=_("Max"))
+ sub.prop(con, "limit_min_y", text="Min")
+ sub.prop(con, "limit_max_y", text="Max")
col = split.column(align=True)
col.prop(con, "use_limit_z", text="Z")
sub = col.column()
sub.active = con.use_limit_z
- sub.prop(con, "limit_min_z", text=_("Min"))
- sub.prop(con, "limit_max_z", text=_("Max"))
+ sub.prop(con, "limit_min_z", text="Min")
+ sub.prop(con, "limit_max_z", text="Max")
split = layout.split()
col = split.column(align=True)
- col.prop(con, "use_angular_limit_x", text=_("Angle X"))
+ col.prop(con, "use_angular_limit_x", text="Angle X")
sub = col.column()
sub.active = con.use_angular_limit_x
- sub.prop(con, "limit_angle_min_x", text=_("Min"))
- sub.prop(con, "limit_angle_max_x", text=_("Max"))
+ sub.prop(con, "limit_angle_min_x", text="Min")
+ sub.prop(con, "limit_angle_max_x", text="Max")
col = split.column(align=True)
- col.prop(con, "use_angular_limit_y", text=_("Angle Y"))
+ col.prop(con, "use_angular_limit_y", text="Angle Y")
sub = col.column()
sub.active = con.use_angular_limit_y
- sub.prop(con, "limit_angle_min_y", text=_("Min"))
- sub.prop(con, "limit_angle_max_y", text=_("Max"))
+ sub.prop(con, "limit_angle_min_y", text="Min")
+ sub.prop(con, "limit_angle_max_y", text="Max")
col = split.column(align=True)
- col.prop(con, "use_angular_limit_z", text=_("Angle Z"))
+ col.prop(con, "use_angular_limit_z", text="Angle Z")
sub = col.column()
sub.active = con.use_angular_limit_z
- sub.prop(con, "limit_angle_min_z", text=_("Min"))
- sub.prop(con, "limit_angle_max_z", text=_("Max"))
+ sub.prop(con, "limit_angle_min_z", text="Min")
+ sub.prop(con, "limit_angle_max_z", text="Max")
elif con.pivot_type == 'HINGE':
- layout.label(text=_("Limits:"))
+ layout.label(text="Limits:")
split = layout.split()
row = split.row(align=True)
col = row.column()
- col.prop(con, "use_angular_limit_x", text=_("Angle X"))
+ col.prop(con, "use_angular_limit_x", text="Angle X")
col = row.column()
col.active = con.use_angular_limit_x
- col.prop(con, "limit_angle_min_x", text=_("Min"))
+ col.prop(con, "limit_angle_min_x", text="Min")
col = row.column()
col.active = con.use_angular_limit_x
- col.prop(con, "limit_angle_max_x", text=_("Max"))
+ col.prop(con, "limit_angle_max_x", text="Max")
def CLAMP_TO(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
- row.label(text=_("Main Axis:"))
+ row.label(text="Main Axis:")
row.prop(con, "main_axis", expand=True)
layout.prop(con, "use_cyclic")
@@ -630,32 +630,32 @@ class ConstraintButtonsPanel():
def TRANSFORM(self, context, layout, con):
self.target_template(layout, con)
- layout.prop(con, "use_motion_extrapolate", text=_("Extrapolate"))
+ layout.prop(con, "use_motion_extrapolate", text="Extrapolate")
col = layout.column()
- col.row().label(text=_("Source:"))
+ col.row().label(text="Source:")
col.row().prop(con, "map_from", expand=True)
split = layout.split()
sub = split.column(align=True)
sub.label(text="X:")
- sub.prop(con, "from_min_x", text=_("Min"))
- sub.prop(con, "from_max_x", text=_("Max"))
+ sub.prop(con, "from_min_x", text="Min")
+ sub.prop(con, "from_max_x", text="Max")
sub = split.column(align=True)
sub.label(text="Y:")
- sub.prop(con, "from_min_y", text=_("Min"))
- sub.prop(con, "from_max_y", text=_("Max"))
+ sub.prop(con, "from_min_y", text="Min")
+ sub.prop(con, "from_max_y", text="Max")
sub = split.column(align=True)
sub.label(text="Z:")
- sub.prop(con, "from_min_z", text=_("Min"))
- sub.prop(con, "from_max_z", text=_("Max"))
+ sub.prop(con, "from_min_z", text="Min")
+ sub.prop(con, "from_max_z", text="Max")
col = layout.column()
row = col.row()
- row.label(text=_("Source to Destination Mapping:"))
+ row.label(text="Source to Destination Mapping:")
# note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't
# open it. Thus we are using the hardcoded value instead.
@@ -674,7 +674,7 @@ class ConstraintButtonsPanel():
split = layout.split()
col = split.column()
- col.label(text=_("Destination:"))
+ col.label(text="Destination:")
col.row().prop(con, "map_to", expand=True)
split = layout.split()
@@ -683,22 +683,22 @@ class ConstraintButtonsPanel():
col.label(text="X:")
sub = col.column(align=True)
- sub.prop(con, "to_min_x", text=_("Min"))
- sub.prop(con, "to_max_x", text=_("Max"))
+ sub.prop(con, "to_min_x", text="Min")
+ sub.prop(con, "to_max_x", text="Max")
col = split.column()
col.label(text="Y:")
sub = col.column(align=True)
- sub.prop(con, "to_min_y", text=_("Min"))
- sub.prop(con, "to_max_y", text=_("Max"))
+ sub.prop(con, "to_min_y", text="Min")
+ sub.prop(con, "to_max_y", text="Max")
col = split.column()
col.label(text="Z:")
sub = col.column(align=True)
- sub.prop(con, "to_min_z", text=_("Min"))
- sub.prop(con, "to_max_z", text=_("Max"))
+ sub.prop(con, "to_min_z", text="Min")
+ sub.prop(con, "to_max_z", text="Max")
self.space_template(layout, con)
@@ -718,20 +718,20 @@ class ConstraintButtonsPanel():
self.target_template(layout, con)
row = layout.row()
- row.label(text=_("To:"))
+ row.label(text="To:")
row.prop(con, "track_axis", expand=True)
def SPLINE_IK(self, context, layout, con):
self.target_template(layout, con)
col = layout.column()
- col.label(text=_("Spline Fitting:"))
+ col.label(text="Spline Fitting:")
col.prop(con, "chain_count")
col.prop(con, "use_even_divisions")
col.prop(con, "use_chain_offset")
col = layout.column()
- col.label(text=_("Chain Scaling:"))
+ col.label(text="Chain Scaling:")
col.prop(con, "use_y_stretch")
col.prop(con, "xz_scale_mode")
col.prop(con, "use_curve_radius")
@@ -741,20 +741,20 @@ class ConstraintButtonsPanel():
if con.target:
col = layout.column()
- col.prop(con, "offset", text=_("Pivot Offset"))
+ col.prop(con, "offset", text="Pivot Offset")
else:
col = layout.column()
col.prop(con, "use_relative_location")
if con.use_relative_location:
- col.prop(con, "offset", text=_("Relative Pivot Point"))
+ col.prop(con, "offset", text="Relative Pivot Point")
else:
- col.prop(con, "offset", text=_("Absolute Pivot Point"))
+ col.prop(con, "offset", text="Absolute Pivot Point")
col = layout.column()
- col.prop(con, "rotation_range", text=_("Pivot When"))
+ col.prop(con, "rotation_range", text="Pivot When")
def SCRIPT(self, context, layout, con):
- layout.label( _("Blender 2.5 has no py-constraints") )
+ layout.label("Blender 2.5 has no py-constraints")
class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel):
@@ -773,7 +773,7 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel):
if ob.mode == 'POSE':
box = layout.box()
box.alert = True
- box.label(icon='INFO', text=_("See Bone Constraints tab to Add Constraints to active bone"))
+ box.label(icon='INFO', text="See Bone Constraints tab to Add Constraints to active bone")
else:
layout.operator_menu_enum("object.constraint_add", "type")
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 4677b9fa702..da4cb05ee8c 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -20,7 +20,6 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
from bl_ui.properties_physics_common import (
point_cache_ui,
@@ -108,17 +107,17 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
layout.template_ID(context.space_data, "pin_id")
if part.is_fluid:
- layout.label(text=_("Settings used for fluid"))
+ layout.label(text="Settings used for fluid")
return
- layout.prop(part, "type", text=_("Type"))
+ layout.prop(part, "type", text="Type")
elif not psys.settings:
split = layout.split(percentage=0.32)
col = split.column()
- col.label(text=_("Name:"))
- col.label(text=_("Settings:"))
+ col.label(text="Name:")
+ col.label(text="Settings:")
col = split.column()
col.prop(psys, "name", text="")
@@ -128,10 +127,10 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
split = layout.split(percentage=0.32)
col = split.column()
- col.label(text=_("Name:"))
+ col.label(text="Name:")
if part.is_fluid == False:
- col.label(text=_("Settings:"))
- col.label(text=_("Type:"))
+ col.label(text="Settings:")
+ col.label(text="Type:")
col = split.column()
col.prop(psys, "name", text="")
@@ -141,8 +140,8 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
row.template_ID(psys, "settings", new="particle.new")
#row = layout.row()
- #row.label(text=_("Viewport"))
- #row.label(text=_("Render"))
+ #row.label(text="Viewport")
+ #row.label(text="Render")
if part.is_fluid:
layout.label(text=str(part.count) + " fluid particles for this frame")
@@ -157,7 +156,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
split = layout.split(percentage=0.65)
if part.type == 'HAIR':
if psys is not None and psys.is_edited:
- split.operator("particle.edited_clear", text=_("Free Edit"))
+ split.operator("particle.edited_clear", text="Free Edit")
else:
row = split.row()
row.enabled = particle_panel_enabled(context, psys)
@@ -174,7 +173,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
elif psys is not None and part.type == 'REACTOR':
split.enabled = particle_panel_enabled(context, psys)
split.prop(psys, "reactor_target_object")
- split.prop(psys, "reactor_target_particle_system", text=_("Particle System"))
+ split.prop(psys, "reactor_target_particle_system", text="Particle System")
class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
@@ -220,7 +219,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
col.prop(part, "lifetime")
col.prop(part, "lifetime_random", slider=True)
- layout.label(text=_("Emit From:"))
+ layout.label(text="Emit From:")
layout.prop(part, "emit_from", expand=True)
row = layout.row()
@@ -238,11 +237,11 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
row = layout.row()
if part.distribution == 'JIT':
- row.prop(part, "userjit", text=_("Particles/Face"))
- row.prop(part, "jitter_factor", text=_("Jittering Amount"), slider=True)
+ row.prop(part, "userjit", text="Particles/Face")
+ row.prop(part, "jitter_factor", text="Jittering Amount", slider=True)
elif part.distribution == 'GRID':
row.prop(part, "grid_resolution")
- row.prop(part, "grid_random", text=_("Random"), slider=True)
+ row.prop(part, "grid_random", text="Random", slider=True)
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
@@ -282,22 +281,22 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Material:"))
+ col.label(text="Material:")
sub = col.column(align=True)
- sub.prop(cloth, "pin_stiffness", text=_("Stiffness"))
+ sub.prop(cloth, "pin_stiffness", text="Stiffness")
sub.prop(cloth, "mass")
- sub.prop(cloth, "bending_stiffness", text=_("Bending"))
+ sub.prop(cloth, "bending_stiffness", text="Bending")
sub.prop(cloth, "internal_friction", slider=True)
sub.prop(cloth, "collider_friction", slider=True)
col = split.column()
- col.label(text=_("Damping:"))
+ col.label(text="Damping:")
sub = col.column(align=True)
- sub.prop(cloth, "spring_damping", text=_("Spring"))
- sub.prop(cloth, "air_damping", text=_("Air"))
+ sub.prop(cloth, "spring_damping", text="Spring")
+ sub.prop(cloth, "air_damping", text="Air")
- col.label(text=_("Quality:"))
- col.prop(cloth, "quality", text=_("Steps"), slider=True)
+ col.label(text="Quality:")
+ col.prop(cloth, "quality", text="Steps", slider=True)
class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
@@ -351,17 +350,17 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Emitter Geometry:"))
+ col.label(text="Emitter Geometry:")
col.prop(part, "normal_factor")
sub = col.column(align=True)
sub.prop(part, "tangent_factor")
sub.prop(part, "tangent_phase", slider=True)
col = split.column()
- col.label(text=_("Emitter Object:"))
+ col.label(text="Emitter Object:")
col.prop(part, "object_align_factor", text="")
- layout.label(text=_("Other:"))
+ layout.label(text="Other:")
row = layout.row()
if part.emit_from == 'PARTICLE':
row.prop(part, "particle_factor")
@@ -401,21 +400,21 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
layout.enabled = particle_panel_enabled(context, psys)
row = layout.row()
- row.label(text=_("Initial Rotation:"))
+ row.label(text="Initial Rotation:")
row.prop(part, "use_dynamic_rotation")
split = layout.split()
col = split.column(align=True)
col.prop(part, "rotation_mode", text="")
- col.prop(part, "rotation_factor_random", slider=True, text=_("Random"))
+ col.prop(part, "rotation_factor_random", slider=True, text="Random")
col = split.column(align=True)
col.prop(part, "phase_factor", slider=True)
- col.prop(part, "phase_factor_random", text=_("Random"), slider=True)
+ col.prop(part, "phase_factor_random", text="Random", slider=True)
col = layout.column()
- col.label(text=_("Angular Velocity:"))
+ col.label(text="Angular Velocity:")
col.row().prop(part, "angular_velocity_mode", expand=True)
if part.angular_velocity_mode != 'NONE':
@@ -455,22 +454,27 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
if part.physics_type != 'NO':
col = row.column(align=True)
col.prop(part, "mass")
- col.prop(part, "use_multiply_size_mass", text=_("Multiply mass with size"))
+ col.prop(part, "use_multiply_size_mass", text="Multiply mass with size")
if part.physics_type in {'NEWTON', 'FLUID'}:
split = layout.split()
col = split.column()
- col.label(text=_("Forces:"))
+ col.label(text="Forces:")
col.prop(part, "brownian_factor")
col.prop(part, "drag_factor", slider=True)
col.prop(part, "damping", slider=True)
col = split.column()
- col.label(text=_("Integration:"))
+ col.label(text="Integration:")
col.prop(part, "integrator", text="")
col.prop(part, "timestep")
- col.prop(part, "subframes")
+ sub = col.row()
+ if part.adaptive_subframes:
+ sub.prop(part, "courant_target", text="Threshold")
+ else:
+ sub.prop(part, "subframes")
+ sub.prop(part, "adaptive_subframes", text="")
row = layout.row()
row.prop(part, "use_size_deflect")
@@ -482,13 +486,13 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Fluid properties:"))
- col.prop(fluid, "stiffness", text=_("Stiffness"))
- col.prop(fluid, "linear_viscosity", text=_("Viscosity"))
- col.prop(fluid, "buoyancy", text=_("Buoancy"), slider=True)
+ col.label(text="Fluid properties:")
+ col.prop(fluid, "stiffness", text="Stiffness")
+ col.prop(fluid, "linear_viscosity", text="Viscosity")
+ col.prop(fluid, "buoyancy", text="Buoancy", slider=True)
col = split.column()
- col.label(text=_("Advanced:"))
+ col.label(text="Advanced:")
sub = col.row()
sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion)
@@ -509,8 +513,8 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Springs:"))
- col.prop(fluid, "spring_force", text=_("Force"))
+ col.label(text="Springs:")
+ col.prop(fluid, "spring_force", text="Force")
col.prop(fluid, "use_viscoelastic_springs")
sub = col.column(align=True)
sub.active = fluid.use_viscoelastic_springs
@@ -518,7 +522,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
sub.prop(fluid, "plasticity", slider=True)
col = split.column()
- col.label(text=_("Advanced:"))
+ col.label(text="Advanced:")
sub = col.row()
sub.prop(fluid, "rest_length", slider=fluid.factor_rest_length)
sub.prop(fluid, "factor_rest_length", text="")
@@ -526,7 +530,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
sub = col.column()
sub.active = fluid.use_viscoelastic_springs
sub.prop(fluid, "use_initial_rest_length")
- sub.prop(fluid, "spring_frames", text=_("Frames"))
+ sub.prop(fluid, "spring_frames", text="Frames")
elif part.physics_type == 'KEYED':
split = layout.split()
@@ -535,11 +539,11 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
row = layout.row()
col = row.column()
col.active = not psys.use_keyed_timing
- col.prop(part, "keyed_loops", text=_("Loops"))
+ col.prop(part, "keyed_loops", text="Loops")
if psys:
- row.prop(psys, "use_keyed_timing", text=_("Use Timing"))
+ row.prop(psys, "use_keyed_timing", text="Use Timing")
- layout.label(text=_("Keys:"))
+ layout.label(text="Keys:")
elif part.physics_type == 'BOIDS':
boids = part.boids
@@ -575,7 +579,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
row = layout.row()
col = row.column(align=True)
- col.label(text=_("Battle:"))
+ col.label(text="Battle:")
col.prop(boids, "health")
col.prop(boids, "strength")
col.prop(boids, "aggression")
@@ -583,16 +587,16 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
col.prop(boids, "range")
col = row.column()
- col.label(text=_("Misc:"))
+ col.label(text="Misc:")
col.prop(boids, "bank", slider=True)
col.prop(boids, "pitch", slider=True)
col.prop(boids, "height", slider=True)
if psys and part.physics_type in {'KEYED', 'BOIDS', 'FLUID'}:
if part.physics_type == 'BOIDS':
- layout.label(text=_("Relations:"))
+ layout.label(text="Relations:")
elif part.physics_type == 'FLUID':
- layout.label(text=_("Fluid interaction:"))
+ layout.label(text="Fluid interaction:")
row = layout.row()
row.template_list(psys, "targets", psys, "active_particle_target_index")
@@ -615,7 +619,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
#doesn't work yet
#col.alert = key.valid
col.prop(key, "object", text="")
- col.prop(key, "system", text=_("System"))
+ col.prop(key, "system", text="System")
col = row.column()
col.active = psys.use_keyed_timing
col.prop(key, "time")
@@ -625,7 +629,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
#doesn't work yet
#sub.alert = key.valid
sub.prop(key, "object", text="")
- sub.prop(key, "system", text=_("System"))
+ sub.prop(key, "system", text="System")
layout.prop(key, "alliance", expand=True)
elif part.physics_type == 'FLUID':
@@ -633,7 +637,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
#doesn't work yet
#sub.alert = key.valid
sub.prop(key, "object", text="")
- sub.prop(key, "system", text=_("System"))
+ sub.prop(key, "system", text="System")
class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
@@ -671,7 +675,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
state = boids.active_boid_state
- #layout.prop(state, "name", text=_("State name"))
+ #layout.prop(state, "name", text="State name")
row = layout.row()
row.prop(state, "ruleset_type")
@@ -714,7 +718,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
row.prop(rule, "use_predict")
row.prop(rule, "fear_factor")
elif rule.type == 'FOLLOW_PATH':
- row.label(text=_("Not yet functional"))
+ row.label(text="Not yet functional")
elif rule.type == 'AVOID_COLLISION':
row.prop(rule, "use_avoid")
row.prop(rule, "use_avoid_collision")
@@ -792,14 +796,14 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
sub.active = (part.use_render_adaptive is True and part.use_strand_primitive is False)
sub.prop(part, "adaptive_pixel")
col.prop(part, "use_hair_bspline")
- col.prop(part, "render_step", text=_("Steps"))
+ col.prop(part, "render_step", text="Steps")
col = split.column()
- col.label(text=_("Timing:"))
+ col.label(text="Timing:")
col.prop(part, "use_absolute_path_time")
- col.prop(part, "path_start", text=_("Start"), slider=not part.use_absolute_path_time)
- col.prop(part, "path_end", text=_("End"), slider=not part.use_absolute_path_time)
- col.prop(part, "length_random", text=_("Random"), slider=True)
+ col.prop(part, "path_start", text="Start", slider=not part.use_absolute_path_time)
+ col.prop(part, "path_end", text="End", slider=not part.use_absolute_path_time)
+ col.prop(part, "length_random", text="Random", slider=True)
row = layout.row()
col = row.column()
@@ -856,30 +860,30 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
elif part.render_type == 'BILLBOARD':
ob = context.object
- col.label(text=_("Align:"))
+ col.label(text="Align:")
row = layout.row()
row.prop(part, "billboard_align", expand=True)
- row.prop(part, "lock_billboard", text=_("Lock"))
+ row.prop(part, "lock_billboard", text="Lock")
row = layout.row()
row.prop(part, "billboard_object")
row = layout.row()
col = row.column(align=True)
- col.label(text=_("Tilt:"))
- col.prop(part, "billboard_tilt", text=_("Angle"), slider=True)
- col.prop(part, "billboard_tilt_random", text=_("Random"), slider=True)
+ col.label(text="Tilt:")
+ col.prop(part, "billboard_tilt", text="Angle", slider=True)
+ col.prop(part, "billboard_tilt_random", text="Random", slider=True)
col = row.column()
col.prop(part, "billboard_offset")
row = layout.row()
col = row.column()
- col.prop(part, "billboard_size", text=_("Scale"))
+ col.prop(part, "billboard_size", text="Scale")
if part.billboard_align == 'VEL':
col = row.column(align=True)
- col.label(_("Velocity Scale:"))
- col.prop(part, "billboard_velocity_head", text=_("Head"))
- col.prop(part, "billboard_velocity_tail", text=_("Tail"))
+ col.label("Velocity Scale:")
+ col.prop(part, "billboard_velocity_head", text="Head")
+ col.prop(part, "billboard_velocity_tail", text="Tail")
if psys:
col = layout.column()
@@ -887,8 +891,8 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_textures")
split = layout.split(percentage=0.33)
- split.label(text=_("Split uv's:"))
- split.prop(part, "billboard_uv_split", text=_("Number of splits"))
+ split.label(text="Split uv's:")
+ split.prop(part, "billboard_uv_split", text="Number of splits")
if psys:
col = layout.column()
@@ -896,9 +900,9 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures")
row = col.row()
- row.label(text=_("Animate:"))
+ row.label(text="Animate:")
row.prop(part, "billboard_animation", text="")
- row.label(text=_("Offset:"))
+ row.label(text="Offset:")
row.prop(part, "billboard_offset_split", text="")
if part.render_type == 'HALO' or part.render_type == 'LINE' or part.render_type == 'BILLBOARD':
@@ -906,10 +910,10 @@ class PARTICLE_PT_render(ParticleButtonsPanel, Panel):
col = row.column()
col.prop(part, "trail_count")
if part.trail_count > 1:
- col.prop(part, "use_absolute_path_time", text=_("Length in frames"))
+ col.prop(part, "use_absolute_path_time", text="Length in frames")
col = row.column()
- col.prop(part, "path_end", text=_("Length"), slider=not part.use_absolute_path_time)
- col.prop(part, "length_random", text=_("Random"), slider=True)
+ col.prop(part, "path_end", text="Length", slider=not part.use_absolute_path_time)
+ col.prop(part, "length_random", text="Random", slider=True)
else:
col = row.column()
col.label(text="")
@@ -956,11 +960,11 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
if part.draw_percentage != 100 and psys is not None:
if part.type == 'HAIR':
if psys.use_hair_dynamics and psys.point_cache.is_baked == False:
- layout.row().label(text=_("Display percentage makes dynamics inaccurate without baking!"))
+ layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
else:
phystype = part.physics_type
if phystype != 'NO' and phystype != 'KEYED' and psys.point_cache.is_baked == False:
- layout.row().label(text=_("Display percentage makes dynamics inaccurate without baking!"))
+ layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")
row = layout.row()
col = row.column()
@@ -971,11 +975,11 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel):
col.prop(part, "show_health")
col = row.column(align=True)
- col.label(text=_("Color:"))
+ col.label(text="Color:")
col.prop(part, "draw_color", text="")
sub = col.row()
- sub.active = part.draw_color in ('VELOCITY', 'ACCELERATION')
- sub.prop(part, "color_maximum", text=_("Max"))
+ sub.active = (part.draw_color in {'VELOCITY', 'ACCELERATION'})
+ sub.prop(part, "color_maximum", text="Max")
if (path):
col.prop(part, "draw_step")
@@ -1003,24 +1007,24 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
row = layout.row()
col = row.column(align=True)
- col.prop(part, "child_nbr", text=_("Display"))
- col.prop(part, "rendered_child_count", text=_("Render"))
+ col.prop(part, "child_nbr", text="Display")
+ col.prop(part, "rendered_child_count", text="Render")
if part.child_type == 'INTERPOLATED':
col = row.column()
if psys:
- col.prop(psys, "child_seed", text=_("Seed"))
+ col.prop(psys, "child_seed", text="Seed")
col.prop(part, "virtual_parents", slider=True)
col.prop(part, "create_long_hair_children")
else:
col = row.column(align=True)
- col.prop(part, "child_size", text=_("Size"))
- col.prop(part, "child_size_random", text=_("Random"))
+ col.prop(part, "child_size", text="Size")
+ col.prop(part, "child_size_random", text="Random")
split = layout.split()
col = split.column()
- col.label(text=_("Effects:"))
+ col.label(text="Effects:")
sub = col.column(align=True)
sub.prop(part, "clump_factor", slider=True)
@@ -1032,38 +1036,38 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
if part.child_type == 'SIMPLE':
sub = col.column(align=True)
- sub.prop(part, "child_radius", text=_("Radius"))
- sub.prop(part, "child_roundness", text=_("Roundness"), slider=True)
+ sub.prop(part, "child_radius", text="Radius")
+ sub.prop(part, "child_roundness", text="Roundness", slider=True)
if psys:
- sub.prop(psys, "child_seed", text=_("Seed"))
+ sub.prop(psys, "child_seed", text="Seed")
elif part.virtual_parents > 0.0:
sub = col.column(align=True)
- sub.label(text=_("Parting not"))
- sub.label(text=_("available with"))
- sub.label(text=_("virtual parents"))
+ sub.label(text="Parting not")
+ sub.label(text="available with")
+ sub.label(text="virtual parents")
else:
sub = col.column(align=True)
- sub.prop(part, "child_parting_factor", text=_("Parting"), slider=True)
- sub.prop(part, "child_parting_min", text=_("Min"))
- sub.prop(part, "child_parting_max", text=_("Max"))
+ sub.prop(part, "child_parting_factor", text="Parting", slider=True)
+ sub.prop(part, "child_parting_min", text="Min")
+ sub.prop(part, "child_parting_max", text="Max")
col = split.column()
- col.label(text=_("Roughness:"))
+ col.label(text="Roughness:")
sub = col.column(align=True)
- sub.prop(part, "roughness_1", text=_("Uniform"))
- sub.prop(part, "roughness_1_size", text=_("Size"))
+ sub.prop(part, "roughness_1", text="Uniform")
+ sub.prop(part, "roughness_1_size", text="Size")
sub = col.column(align=True)
sub.prop(part, "roughness_endpoint", "Endpoint")
sub.prop(part, "roughness_end_shape")
sub = col.column(align=True)
- sub.prop(part, "roughness_2", text=_("Random"))
- sub.prop(part, "roughness_2_size", text=_("Size"))
+ sub.prop(part, "roughness_2", text="Random")
+ sub.prop(part, "roughness_2_size", text="Size")
sub.prop(part, "roughness_2_threshold", slider=True)
- layout.row().label(text=_("Kink:"))
+ layout.row().label(text="Kink:")
layout.row().prop(part, "kink", expand=True)
split = layout.split()
@@ -1072,7 +1076,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
col = split.column()
sub = col.column(align=True)
sub.prop(part, "kink_amplitude")
- sub.prop(part, "kink_amplitude_clump", text=_("Clump"), slider=True)
+ sub.prop(part, "kink_amplitude_clump", text="Clump", slider=True)
col.prop(part, "kink_flat", slider=True)
col = split.column()
sub = col.column(align=True)
@@ -1111,25 +1115,25 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel):
row = layout.row()
row.prop(part, "use_self_effect")
- row.prop(part, "effector_amount", text=_("Amount"))
+ row.prop(part, "effector_amount", text="Amount")
split = layout.split(percentage=0.2)
- split.label(text=_("Type 1:"))
+ split.label(text="Type 1:")
split.prop(part.force_field_1, "type", text="")
basic_force_field_settings_ui(self, context, part.force_field_1)
if part.force_field_1.type != 'NONE':
- layout.label(text=_("Falloff:"))
+ layout.label(text="Falloff:")
basic_force_field_falloff_ui(self, context, part.force_field_1)
if part.force_field_1.type != 'NONE':
layout.label(text="")
split = layout.split(percentage=0.2)
- split.label(text=_("Type 2:"))
+ split.label(text="Type 2:")
split.prop(part.force_field_2, "type", text="")
basic_force_field_settings_ui(self, context, part.force_field_2)
if part.force_field_2.type != 'NONE':
- layout.label(text=_("Falloff:"))
+ layout.label(text="Falloff:")
basic_force_field_falloff_ui(self, context, part.force_field_2)
@@ -1150,56 +1154,56 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):
psys = context.particle_system
row = layout.row()
- row.label(text=_("Vertex Group"))
- row.label(text=_("Negate"))
+ row.label(text="Vertex Group")
+ row.label(text="Negate")
row = layout.row()
- row.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text=_("Density"))
+ row.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
row.prop(psys, "invert_vertex_group_density", text="")
# Commented out vertex groups don't work and are still waiting for better implementation
# row = layout.row()
- # row.prop_search(psys, "vertex_group_velocity", ob, "vertex_groups", text=_("Velocity"))
+ # row.prop_search(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
# row.prop(psys, "invert_vertex_group_velocity", text="")
row = layout.row()
- row.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text=_("Length"))
+ row.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
row.prop(psys, "invert_vertex_group_length", text="")
row = layout.row()
- row.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text=_("Clump"))
+ row.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
row.prop(psys, "invert_vertex_group_clump", text="")
row = layout.row()
- row.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text=_("Kink"))
+ row.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
row.prop(psys, "invert_vertex_group_kink", text="")
row = layout.row()
- row.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text=_("Roughness 1"))
+ row.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text="Roughness 1")
row.prop(psys, "invert_vertex_group_roughness_1", text="")
row = layout.row()
- row.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text=_("Roughness 2"))
+ row.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text="Roughness 2")
row.prop(psys, "invert_vertex_group_roughness_2", text="")
row = layout.row()
- row.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text=_("Roughness End"))
+ row.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
row.prop(psys, "invert_vertex_group_roughness_end", text="")
# row = layout.row()
- # row.prop_search(psys, "vertex_group_size", ob, "vertex_groups", text=_("Size"))
+ # row.prop_search(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
# row.prop(psys, "invert_vertex_group_size", text="")
# row = layout.row()
- # row.prop_search(psys, "vertex_group_tangent", ob, "vertex_groups", text=_("Tangent"))
+ # row.prop_search(psys, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
# row.prop(psys, "invert_vertex_group_tangent", text="")
# row = layout.row()
- # row.prop_search(psys, "vertex_group_rotation", ob, "vertex_groups", text=_("Rotation"))
+ # row.prop_search(psys, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
# row.prop(psys, "invert_vertex_group_rotation", text="")
# row = layout.row()
- # row.prop_search(psys, "vertex_group_field", ob, "vertex_groups", text=_("Field"))
+ # row.prop_search(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
# row.prop(psys, "invert_vertex_group_field", text="")
diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index de74d1473c8..c66a0563754 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Menu, Panel
-from blf import gettext as _
from bl_ui.properties_physics_common import (
point_cache_ui,
@@ -71,50 +70,50 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
col = split.column()
- col.label(text=_("Presets:"))
+ col.label(text="Presets:")
sub = col.row(align=True)
sub.menu("CLOTH_MT_presets", text=bpy.types.CLOTH_MT_presets.bl_label)
sub.operator("cloth.preset_add", text="", icon="ZOOMIN")
sub.operator("cloth.preset_add", text="", icon="ZOOMOUT").remove_active = True
- col.label(text=_("Quality:"))
- col.prop(cloth, "quality", text=_("Steps"), slider=True)
+ col.label(text="Quality:")
+ col.prop(cloth, "quality", text="Steps", slider=True)
- col.label(text=_("Material:"))
+ col.label(text="Material:")
col.prop(cloth, "mass")
- col.prop(cloth, "structural_stiffness", text=_("Structural"))
- col.prop(cloth, "bending_stiffness", text=_("Bending"))
+ col.prop(cloth, "structural_stiffness", text="Structural")
+ col.prop(cloth, "bending_stiffness", text="Bending")
col = split.column()
- col.label(text=_("Damping:"))
- col.prop(cloth, "spring_damping", text=_("Spring"))
- col.prop(cloth, "air_damping", text=_("Air"))
+ col.label(text="Damping:")
+ col.prop(cloth, "spring_damping", text="Spring")
+ col.prop(cloth, "air_damping", text="Air")
- col.prop(cloth, "use_pin_cloth", text=_("Pinning"))
+ col.prop(cloth, "use_pin_cloth", text="Pinning")
sub = col.column()
sub.active = cloth.use_pin_cloth
sub.prop_search(cloth, "vertex_group_mass", ob, "vertex_groups", text="")
- sub.prop(cloth, "pin_stiffness", text=_("Stiffness"))
+ sub.prop(cloth, "pin_stiffness", text="Stiffness")
- col.label(text=_("Pre roll:"))
- col.prop(cloth, "pre_roll", text=_("Frame"))
+ col.label(text="Pre roll:")
+ col.prop(cloth, "pre_roll", text="Frame")
# Disabled for now
"""
if cloth.vertex_group_mass:
- layout.label(text=_("Goal:"))
+ layout.label(text="Goal:")
col = layout.column_flow()
- col.prop(cloth, "goal_default", text=_("Default"))
- col.prop(cloth, "goal_spring", text=_("Stiffness"))
- col.prop(cloth, "goal_friction", text=_("Friction"))
+ col.prop(cloth, "goal_default", text="Default")
+ col.prop(cloth, "goal_spring", text="Stiffness")
+ col.prop(cloth, "goal_friction", text="Friction")
"""
key = ob.data.shape_keys
if key:
- col.label(text=_("Rest Shape Key:"))
+ col.label(text="Rest Shape Key:")
col.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="")
@@ -156,18 +155,18 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(cloth, "collision_quality", slider=True, text=_("Quality"))
- col.prop(cloth, "distance_min", slider=True, text=_("Distance"))
- col.prop(cloth, "repel_force", slider=True, text=_("Repel"))
- col.prop(cloth, "distance_repel", slider=True, text=_("Repel Distance"))
+ col.prop(cloth, "collision_quality", slider=True, text="Quality")
+ col.prop(cloth, "distance_min", slider=True, text="Distance")
+ col.prop(cloth, "repel_force", slider=True, text="Repel")
+ col.prop(cloth, "distance_repel", slider=True, text="Repel Distance")
col.prop(cloth, "friction")
col = split.column()
- col.prop(cloth, "use_self_collision", text=_("Self Collision"))
+ col.prop(cloth, "use_self_collision", text="Self Collision")
sub = col.column()
sub.active = cloth.use_self_collision
- sub.prop(cloth, "self_collision_quality", slider=True, text=_("Quality"))
- sub.prop(cloth, "self_distance_min", slider=True, text=_("Distance"))
+ sub.prop(cloth, "self_collision_quality", slider=True, text="Quality")
+ sub.prop(cloth, "self_distance_min", slider=True, text="Distance")
layout.prop(cloth, "group")
@@ -198,14 +197,14 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Structural Stiffness:"))
+ col.label(text="Structural Stiffness:")
col.prop_search(cloth, "vertex_group_structural_stiffness", ob, "vertex_groups", text="")
- col.prop(cloth, "structural_stiffness_max", text=_("Max"))
+ col.prop(cloth, "structural_stiffness_max", text="Max")
col = split.column()
- col.label(text=_("Bending Stiffness:"))
+ col.label(text="Bending Stiffness:")
col.prop_search(cloth, "vertex_group_bending", ob, "vertex_groups", text="")
- col.prop(cloth, "bending_stiffness_max", text=_("Max"))
+ col.prop(cloth, "bending_stiffness_max", text="Max")
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 20b76ec0a84..204e25d9f01 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -20,7 +20,7 @@
import bpy
from bpy.types import Panel
-from blf import gettext as _
+
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -53,27 +53,27 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
ob = context.object
layout = self.layout
- layout.label(_("Enable physics for:"))
+ layout.label("Enable physics for:")
split = layout.split()
col = split.column()
if(context.object.field.type == 'NONE'):
- col.operator("object.forcefield_toggle", text=_("Force Field"), icon='FORCE_FORCE')
+ col.operator("object.forcefield_toggle", text="Force Field", icon='FORCE_FORCE')
else:
- col.operator("object.forcefield_toggle", text=_("Force Field"), icon='X')
+ col.operator("object.forcefield_toggle", text="Force Field", icon='X')
if(ob.type == 'MESH'):
- physics_add(self, col, context.collision, _("Collision"), 'COLLISION', 'MOD_PHYSICS', False)
- physics_add(self, col, context.cloth, _("Cloth"), 'CLOTH', 'MOD_CLOTH', True)
+ physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False)
+ physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True)
col = split.column()
if(ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE'):
- physics_add(self, col, context.soft_body, _("Soft Body"), 'SOFT_BODY', 'MOD_SOFT', True)
+ physics_add(self, col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True)
if(ob.type == 'MESH'):
- physics_add(self, col, context.fluid, _("Fluid"), 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True)
- physics_add(self, col, context.smoke, _("Smoke"), 'SMOKE', 'MOD_SMOKE', True)
+ physics_add(self, col, context.fluid, "Fluid", 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True)
+ physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True)
#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
@@ -95,11 +95,11 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
if cache.use_external:
split = layout.split(percentage=0.80)
- split.prop(cache, "name", text=_("File Name"))
+ split.prop(cache, "name", text="File Name")
split.prop(cache, "index", text="")
row = layout.row()
- row.label(text=_("File Path:"))
+ row.label(text="File Path:")
row.prop(cache, "use_library_path", "Use Lib Path")
layout.prop(cache, "filepath", text="")
@@ -108,13 +108,13 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
else:
if cachetype == 'SMOKE':
if not bpy.data.is_saved:
- layout.label(text=_("Cache is disabled until the file is saved"))
+ layout.label(text="Cache is disabled until the file is saved")
layout.enabled = False
if cache.use_disk_cache:
- layout.prop(cache, "name", text=_("File Name"))
+ layout.prop(cache, "name", text="File Name")
else:
- layout.prop(cache, "name", text=_("Cache Name"))
+ layout.prop(cache, "name", text="Cache Name")
row = layout.row(align=True)
@@ -142,7 +142,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
row = layout.row()
row.enabled = enabled and bpy.data.is_saved
row.active = cache.use_disk_cache
- row.label(text=_("Compression:"))
+ row.label(text="Compression:")
row.prop(cache, "compression", expand=True)
layout.separator()
@@ -152,22 +152,22 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
col = split.column()
if cache.is_baked == True:
- col.operator("ptcache.free_bake", text=_("Free Bake"))
+ col.operator("ptcache.free_bake", text="Free Bake")
else:
- col.operator("ptcache.bake", text=_("Bake")).bake = True
+ col.operator("ptcache.bake", text="Bake").bake = True
sub = col.row()
sub.enabled = (cache.frames_skipped or cache.is_outdated) and enabled
- sub.operator("ptcache.bake", text=_("Calculate To Frame")).bake = False
+ sub.operator("ptcache.bake", text="Calculate To Frame").bake = False
sub = col.column()
sub.enabled = enabled
- sub.operator("ptcache.bake_from_cache", text=_("Current Cache to Bake"))
+ sub.operator("ptcache.bake_from_cache", text="Current Cache to Bake")
col = split.column()
- col.operator("ptcache.bake_all", text=_("Bake All Dynamics")).bake = True
- col.operator("ptcache.free_bake_all", text=_("Free All Bakes"))
- col.operator("ptcache.bake_all", text=_("Update All To Frame")).bake = False
+ col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
+ col.operator("ptcache.free_bake_all", text="Free All Bakes")
+ col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
def effector_weights_ui(self, context, weights):
@@ -215,7 +215,7 @@ def basic_force_field_settings_ui(self, context, field):
col = split.column()
if field.type == 'DRAG':
- col.prop(field, "linear_drag", text=_("Linear"))
+ col.prop(field, "linear_drag", text="Linear")
else:
col.prop(field, "strength")
@@ -223,12 +223,12 @@ def basic_force_field_settings_ui(self, context, field):
col.prop(field, "size")
col.prop(field, "flow")
elif field.type == 'HARMONIC':
- col.prop(field, "harmonic_damping", text=_("Damping"))
+ col.prop(field, "harmonic_damping", text="Damping")
col.prop(field, "rest_length")
elif field.type == 'VORTEX' and field.shape != 'POINT':
col.prop(field, "inflow")
elif field.type == 'DRAG':
- col.prop(field, "quadratic_drag", text=_("Quadratic"))
+ col.prop(field, "quadratic_drag", text="Quadratic")
else:
col.prop(field, "flow")
@@ -237,19 +237,19 @@ def basic_force_field_settings_ui(self, context, field):
sub.prop(field, "noise")
sub.prop(field, "seed")
if field.type == 'TURBULENCE':
- col.prop(field, "use_global_coords", text=_("Global"))
+ col.prop(field, "use_global_coords", text="Global")
elif field.type == 'HARMONIC':
col.prop(field, "use_multiple_springs")
split = layout.split()
col = split.column()
- col.label(text=_("Effect point:"))
+ col.label(text="Effect point:")
col.prop(field, "apply_to_location")
col.prop(field, "apply_to_rotation")
col = split.column()
- col.label(text=_("Collision:"))
+ col.label(text="Collision:")
col.prop(field, "use_absorption")
@@ -265,7 +265,7 @@ def basic_force_field_falloff_ui(self, context, field):
col.prop(field, "z_direction", text="")
col = split.column()
- col.prop(field, "falloff_power", text=_("Power"))
+ col.prop(field, "falloff_power", text="Power")
split = layout.split()
col = split.column()
@@ -273,14 +273,14 @@ def basic_force_field_falloff_ui(self, context, field):
row.prop(field, "use_min_distance", text="")
sub = row.row()
sub.active = field.use_min_distance
- sub.prop(field, "distance_min", text=_("Minimum"))
+ sub.prop(field, "distance_min", text="Minimum")
col = split.column()
row = col.row(align=True)
row.prop(field, "use_max_distance", text="")
sub = row.row()
sub.active = field.use_max_distance
- sub.prop(field, "distance_max", text=_("Maximum"))
+ sub.prop(field, "distance_max", text="Maximum")
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py
index d698674fd0a..2229b9dc3da 100644
--- a/release/scripts/startup/bl_ui/properties_physics_field.py
+++ b/release/scripts/startup/bl_ui/properties_physics_field.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
from bl_ui.properties_physics_common import (
basic_force_field_settings_ui,
@@ -54,13 +53,13 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
field = ob.field
split = layout.split(percentage=0.2)
- split.label(text=_("Type:"))
+ split.label(text="Type:")
split.prop(field, "type", text="")
if field.type not in {'NONE', 'GUIDE', 'TEXTURE'}:
split = layout.split(percentage=0.2)
- split.label(text=_("Shape:"))
+ split.label(text="Shape:")
split.prop(field, "shape", text="")
elif field.type == 'TEXTURE':
split = layout.split(percentage=0.2)
@@ -80,7 +79,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
col.prop(field, "use_guide_path_weight")
col = split.column()
- col.label(text=_("Clumping:"))
+ col.label(text="Clumping:")
col.prop(field, "guide_clump_amount")
col.prop(field, "guide_clump_shape")
@@ -120,7 +119,7 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
if field.type not in {'NONE', 'GUIDE'}:
- layout.label(text=_("Falloff:"))
+ layout.label(text="Falloff:")
layout.prop(field, "falloff_type", expand=True)
basic_force_field_falloff_ui(self, context, field)
@@ -131,20 +130,20 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
split = layout.split(percentage=0.35)
col = split.column()
- col.label(text=_("Angular:"))
- col.prop(field, "use_radial_min", text=_("Use Minimum"))
- col.prop(field, "use_radial_max", text=_("Use Maximum"))
+ col.label(text="Angular:")
+ col.prop(field, "use_radial_min", text="Use Minimum")
+ col.prop(field, "use_radial_max", text="Use Maximum")
col = split.column()
- col.prop(field, "radial_falloff", text=_("Power"))
+ col.prop(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
- sub.prop(field, "radial_min", text=_("Angle"))
+ sub.prop(field, "radial_min", text="Angle")
sub = col.column()
sub.active = field.use_radial_max
- sub.prop(field, "radial_max", text=_("Angle"))
+ sub.prop(field, "radial_max", text="Angle")
elif field.falloff_type == 'TUBE':
layout.separator()
@@ -152,20 +151,20 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
split = layout.split(percentage=0.35)
col = split.column()
- col.label(text=_("Radial:"))
- col.prop(field, "use_radial_min", text=_("Use Minimum"))
- col.prop(field, "use_radial_max", text=_("Use Maximum"))
+ col.label(text="Radial:")
+ col.prop(field, "use_radial_min", text="Use Minimum")
+ col.prop(field, "use_radial_max", text="Use Maximum")
col = split.column()
- col.prop(field, "radial_falloff", text=_("Power"))
+ col.prop(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
- sub.prop(field, "radial_min", text=_("Distance"))
+ sub.prop(field, "radial_min", text="Distance")
sub = col.column()
sub.active = field.use_radial_max
- sub.prop(field, "radial_max", text=_("Distance"))
+ sub.prop(field, "radial_max", text="Distance")
class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
@@ -195,31 +194,31 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Particle:"))
+ col.label(text="Particle:")
col.prop(settings, "permeability", slider=True)
col.prop(settings, "stickness")
col.prop(settings, "use_particle_kill")
- col.label(text=_("Particle Damping:"))
+ col.label(text="Particle Damping:")
sub = col.column(align=True)
- sub.prop(settings, "damping_factor", text=_("Factor"), slider=True)
- sub.prop(settings, "damping_random", text=_("Random"), slider=True)
+ sub.prop(settings, "damping_factor", text="Factor", slider=True)
+ sub.prop(settings, "damping_random", text="Random", slider=True)
- col.label(text=_("Particle Friction:"))
+ col.label(text="Particle Friction:")
sub = col.column(align=True)
- sub.prop(settings, "friction_factor", text=_("Factor"), slider=True)
- sub.prop(settings, "friction_random", text=_("Random"), slider=True)
+ sub.prop(settings, "friction_factor", text="Factor", slider=True)
+ sub.prop(settings, "friction_random", text="Random", slider=True)
col = split.column()
- col.label(text=_("Soft Body and Cloth:"))
+ col.label(text="Soft Body and Cloth:")
sub = col.column(align=True)
- sub.prop(settings, "thickness_outer", text=_("Outer"), slider=True)
- sub.prop(settings, "thickness_inner", text=_("Inner"), slider=True)
+ sub.prop(settings, "thickness_outer", text="Outer", slider=True)
+ sub.prop(settings, "thickness_inner", text="Inner", slider=True)
- col.label(text=_("Soft Body Damping:"))
- col.prop(settings, "damping", text=_("Factor"), slider=True)
+ col.label(text="Soft Body Damping:")
+ col.prop(settings, "damping", text="Factor", slider=True)
- col.label(text=_("Force Fields:"))
- col.prop(settings, "absorption", text=_("Absorption"))
+ col.label(text="Force Fields:")
+ col.prop(settings, "absorption", text="Absorption")
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index c89d7ec9755..c25b42e298e 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -19,7 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
+
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -46,7 +46,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
row = layout.row()
if fluid is None:
- row.label(_("Built without fluids"))
+ row.label("Built without fluids")
return
row.prop(fluid, "type")
@@ -58,28 +58,28 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
layout.active = fluid.use
if fluid.type == 'DOMAIN':
- layout.operator("fluid.bake", text=_("Bake (Req. Memory:")+" %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM')
+ layout.operator("fluid.bake", text="Bake (Req. Memory:" + " %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM')
split = layout.split()
col = split.column()
- col.label(text=_("Resolution:"))
- col.prop(fluid, "resolution", text=_("Final"))
- col.label(text=_("Render Display:"))
+ col.label(text="Resolution:")
+ col.prop(fluid, "resolution", text="Final")
+ col.label(text="Render Display:")
col.prop(fluid, "render_display_mode", text="")
col = split.column()
col.label()
- col.prop(fluid, "preview_resolution", text=_("Preview"))
- col.label(text=_("Viewport Display:"))
+ col.prop(fluid, "preview_resolution", text="Preview")
+ col.label(text="Viewport Display:")
col.prop(fluid, "viewport_display_mode", text="")
split = layout.split()
col = split.column()
- col.label(text=_("Time:"))
+ col.label(text="Time:")
sub = col.column(align=True)
- sub.prop(fluid, "start_time", text=_("Start"))
- sub.prop(fluid, "end_time", text=_("End"))
+ sub.prop(fluid, "start_time", text="Start")
+ sub.prop(fluid, "end_time", text="End")
col = split.column()
col.label()
@@ -92,36 +92,36 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Volume Initialization:"))
+ col.label(text="Volume Initialization:")
col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "use_animated_mesh")
col = split.column()
- col.label(text=_("Initial Velocity:"))
+ col.label(text="Initial Velocity:")
col.prop(fluid, "initial_velocity", text="")
elif fluid.type == 'OBSTACLE':
split = layout.split()
col = split.column()
- col.label(text=_("Volume Initialization:"))
+ col.label(text="Volume Initialization:")
col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "use_animated_mesh")
col = split.column()
- col.label(text=_("Slip Type:"))
+ col.label(text="Slip Type:")
col.prop(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- col.prop(fluid, "partial_slip_factor", slider=True, text=_("Amount"))
+ col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
- col.label(text=_("Impact:"))
- col.prop(fluid, "impact_factor", text=_("Factor"))
+ col.label(text="Impact:")
+ col.prop(fluid, "impact_factor", text="Factor")
elif fluid.type == 'INFLOW':
split = layout.split()
col = split.column()
- col.label(text=_("Volume Initialization:"))
+ col.label(text="Volume Initialization:")
col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "use_animated_mesh")
row = col.row()
@@ -129,14 +129,14 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
row.prop(fluid, "use_local_coords")
col = split.column()
- col.label(text=_("Inflow Velocity:"))
+ col.label(text="Inflow Velocity:")
col.prop(fluid, "inflow_velocity", text="")
elif fluid.type == 'OUTFLOW':
split = layout.split()
col = split.column()
- col.label(text=_("Volume Initialization:"))
+ col.label(text="Volume Initialization:")
col.prop(fluid, "volume_initialization", text="")
col.prop(fluid, "use_animated_mesh")
@@ -146,12 +146,12 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Influence:"))
- col.prop(fluid, "particle_influence", text=_("Size"))
- col.prop(fluid, "alpha_influence", text=_("Alpha"))
+ col.label(text="Influence:")
+ col.prop(fluid, "particle_influence", text="Size")
+ col.prop(fluid, "alpha_influence", text="Alpha")
col = split.column()
- col.label(text=_("Type:"))
+ col.label(text="Type:")
col.prop(fluid, "use_drops")
col.prop(fluid, "use_floats")
col.prop(fluid, "show_tracer")
@@ -167,24 +167,24 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
col.prop(fluid, "use_reverse_frames")
col = split.column()
- col.label(text=_("Time:"))
+ col.label(text="Time:")
sub = col.column(align=True)
- sub.prop(fluid, "start_time", text=_("Start"))
- sub.prop(fluid, "end_time", text=_("End"))
+ sub.prop(fluid, "start_time", text="Start")
+ sub.prop(fluid, "end_time", text="End")
split = layout.split()
col = split.column()
- col.label(text=_("Attraction Force:"))
+ col.label(text="Attraction Force:")
sub = col.column(align=True)
- sub.prop(fluid, "attraction_strength", text=_("Strength"))
- sub.prop(fluid, "attraction_radius", text=_("Radius"))
+ sub.prop(fluid, "attraction_strength", text="Strength")
+ sub.prop(fluid, "attraction_radius", text="Radius")
col = split.column()
- col.label(text=_("Velocity Force:"))
+ col.label(text="Velocity Force:")
sub = col.column(align=True)
- sub.prop(fluid, "velocity_strength", text=_("Strength"))
- sub.prop(fluid, "velocity_radius", text=_("Radius"))
+ sub.prop(fluid, "velocity_strength", text="Strength")
+ sub.prop(fluid, "velocity_radius", text="Radius")
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
@@ -206,33 +206,33 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
col = split.column()
if scene.use_gravity:
- col.label(text=_("Using Scene Gravity"), icon="SCENE_DATA")
+ col.label(text="Using Scene Gravity", icon="SCENE_DATA")
sub = col.column()
sub.enabled = False
sub.prop(fluid, "gravity", text="")
else:
- col.label(text=_("Gravity:"))
+ col.label(text="Gravity:")
col.prop(fluid, "gravity", text="")
if scene.unit_settings.system != 'NONE':
- col.label(text=_("Using Scene Size Units"), icon="SCENE_DATA")
+ col.label(text="Using Scene Size Units", icon="SCENE_DATA")
sub = col.column()
sub.enabled = False
- sub.prop(fluid, "simulation_scale", text=_("Metres"))
+ sub.prop(fluid, "simulation_scale", text="Metres")
else:
- col.label(text=_("Real World Size:"))
- col.prop(fluid, "simulation_scale", text=_("Metres"))
+ col.label(text="Real World Size:")
+ col.prop(fluid, "simulation_scale", text="Metres")
col = split.column()
- col.label(text=_("Viscosity Presets:"))
+ col.label(text="Viscosity Presets:")
sub = col.column(align=True)
sub.prop(fluid, "viscosity_preset", text="")
if fluid.viscosity_preset == 'MANUAL':
- sub.prop(fluid, "viscosity_base", text=_("Base"))
- sub.prop(fluid, "viscosity_exponent", text=_("Exponent"), slider=True)
+ sub.prop(fluid, "viscosity_base", text="Base")
+ sub.prop(fluid, "viscosity_exponent", text="Exponent", slider=True)
- col.label(text=_("Optimization:"))
+ col.label(text="Optimization:")
col.prop(fluid, "grid_levels", slider=True)
col.prop(fluid, "compressibility", slider=True)
@@ -254,16 +254,16 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Slip Type:"))
+ col.label(text="Slip Type:")
col.prop(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- col.prop(fluid, "partial_slip_factor", slider=True, text=_("Amount"))
+ col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
col.prop(fluid, "surface_noobs")
col = split.column()
- col.label(text=_("Surface:"))
- col.prop(fluid, "surface_smooth", text=_("Smoothing"))
- col.prop(fluid, "surface_subdivisions", text=_("Subdivisions"))
+ col.label(text="Surface:")
+ col.prop(fluid, "surface_smooth", text="Smoothing")
+ col.prop(fluid, "surface_subdivisions", text="Subdivisions")
class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index 61c477b6d49..e270b53d6bb 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
from bl_ui.properties_physics_common import (
point_cache_ui,
@@ -59,23 +58,23 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
split.enabled = not domain.point_cache.is_baked
col = split.column()
- col.label(text=_("Resolution:"))
- col.prop(domain, "resolution_max", text=_("Divisions"))
- col.label(text=_("Time:"))
- col.prop(domain, "time_scale", text=_("Scale"))
- col.label(text=_("Border Collisions:"))
+ col.label(text="Resolution:")
+ col.prop(domain, "resolution_max", text="Divisions")
+ col.label(text="Time:")
+ col.prop(domain, "time_scale", text="Scale")
+ col.label(text="Border Collisions:")
col.prop(domain, "collision_extents", text="")
col = split.column()
- col.label(text=_("Behavior:"))
+ col.label(text="Behavior:")
col.prop(domain, "alpha")
- col.prop(domain, "beta", text=_("Temp. Diff."))
+ col.prop(domain, "beta", text="Temp. Diff.")
col.prop(domain, "vorticity")
- col.prop(domain, "use_dissolve_smoke", text=_("Dissolve"))
+ col.prop(domain, "use_dissolve_smoke", text="Dissolve")
sub = col.column()
sub.active = domain.use_dissolve_smoke
- sub.prop(domain, "dissolve_speed", text=_("Time"))
- sub.prop(domain, "use_dissolve_smoke_log", text_("Slow"))
+ sub.prop(domain, "dissolve_speed", text="Time")
+ sub.prop(domain, "use_dissolve_smoke_log", text="Slow")
elif md.smoke_type == 'FLOW':
@@ -85,20 +84,20 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
col = split.column()
col.prop(flow, "use_outflow")
- col.label(text=_("Particle System:"))
+ col.label(text="Particle System:")
col.prop_search(flow, "particle_system", ob, "particle_systems", text="")
sub = col.column()
sub.active = not md.flow_settings.use_outflow
- sub.prop(flow, "initial_velocity", text=_("Initial Velocity"))
+ sub.prop(flow, "initial_velocity", text="Initial Velocity")
sub = sub.column()
sub.active = flow.initial_velocity
- sub.prop(flow, "velocity_factor", text=_("Multiplier"))
+ sub.prop(flow, "velocity_factor", text="Multiplier")
sub = split.column()
sub.active = not md.flow_settings.use_outflow
- sub.label(text=_("Initial Values:"))
+ sub.label(text="Initial Values:")
sub.prop(flow, "use_absolute")
sub.prop(flow, "density")
sub.prop(flow, "temperature")
@@ -121,14 +120,14 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Flow Group:"))
+ col.label(text="Flow Group:")
col.prop(group, "fluid_group", text="")
- #col.label(text=_("Effector Group:"))
+ #col.label(text="Effector Group:")
#col.prop(group, "effector_group", text="")
col = split.column()
- col.label(text=_("Collision Group:"))
+ col.label(text="Collision Group:")
col.prop(group, "collision_group", text="")
@@ -157,12 +156,12 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
split.enabled = not md.point_cache.is_baked
col = split.column()
- col.label(text=_("Resolution:"))
- col.prop(md, "amplify", text=_("Divisions"))
+ col.label(text="Resolution:")
+ col.prop(md, "amplify", text="Divisions")
col.prop(md, "smooth_emitter")
col = split.column()
- col.label(text=_("Noise Method:"))
+ col.label(text="Noise Method:")
col.row().prop(md, "noise_type", text="")
col.prop(md, "strength")
@@ -184,7 +183,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
md = context.smoke.domain_settings
cache = md.point_cache
- layout.label(text=_("Compression:"))
+ layout.label(text="Compression:")
layout.prop(md, "point_cache_compress_type", expand=True)
point_cache_ui(self, context, cache, (cache.is_baked is False), 'SMOKE')
diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py
index 5449e54c6e6..b9f8910fa59 100644
--- a/release/scripts/startup/bl_ui/properties_physics_softbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
-from blf import gettext as _
from bl_ui.properties_physics_common import (
point_cache_ui,
@@ -62,13 +61,13 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel):
split.enabled = softbody_panel_enabled(md)
col = split.column()
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(softbody, "friction")
col.prop(softbody, "mass")
- col.prop_search(softbody, "vertex_group_mass", ob, "vertex_groups", text=_("Mass:"))
+ col.prop_search(softbody, "vertex_group_mass", ob, "vertex_groups", text="Mass:")
col = split.column()
- col.label(text=_("Simulation:"))
+ col.label(text="Simulation:")
col.prop(softbody, "speed")
@@ -114,18 +113,18 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Goal Strengths:"))
- col.prop(softbody, "goal_default", text=_("Default"))
+ col.label(text="Goal Strengths:")
+ col.prop(softbody, "goal_default", text="Default")
sub = col.column(align=True)
- sub.prop(softbody, "goal_min", text=_("Minimum"))
- sub.prop(softbody, "goal_max", text=_("Maximum"))
+ sub.prop(softbody, "goal_min", text="Minimum")
+ sub.prop(softbody, "goal_max", text="Maximum")
col = split.column()
- col.label(text=_("Goal Settings:"))
- col.prop(softbody, "goal_spring", text=_("Stiffness"))
- col.prop(softbody, "goal_friction", text=_("Damping"))
+ col.label(text="Goal Settings:")
+ col.prop(softbody, "goal_spring", text="Stiffness")
+ col.prop(softbody, "goal_friction", text="Damping")
- layout.prop_search(softbody, "vertex_group_goal", ob, "vertex_groups", text=_("Vertex Group"))
+ layout.prop_search(softbody, "vertex_group_goal", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
@@ -154,14 +153,14 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Springs:"))
+ col.label(text="Springs:")
col.prop(softbody, "pull")
col.prop(softbody, "push")
col.prop(softbody, "damping")
col.prop(softbody, "plastic")
col.prop(softbody, "bend")
- col.prop(softbody, "spring_length", text=_("Length"))
- col.prop_search(softbody, "vertex_group_spring", ob, "vertex_groups", text=_("Springs:"))
+ col.prop(softbody, "spring_length", text="Length")
+ col.prop_search(softbody, "vertex_group_spring", ob, "vertex_groups", text="Springs:")
col = split.column()
col.prop(softbody, "use_stiff_quads")
@@ -169,16 +168,16 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel):
sub.active = softbody.use_stiff_quads
sub.prop(softbody, "shear")
- col.label(text=_("Aerodynamics:"))
+ col.label(text="Aerodynamics:")
col.row().prop(softbody, "aerodynamics_type", expand=True)
- col.prop(softbody, "aero", text=_("Factor"))
+ col.prop(softbody, "aero", text="Factor")
#sub = col.column()
#sub.enabled = softbody.aero > 0
- col.label(text=_("Collision:"))
- col.prop(softbody, "use_edge_collision", text=_("Edge"))
- col.prop(softbody, "use_face_collision", text=_("Face"))
+ col.label(text="Collision:")
+ col.prop(softbody, "use_edge_collision", text="Edge")
+ col.prop(softbody, "use_face_collision", text="Face")
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
@@ -203,14 +202,14 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel):
layout.active = softbody.use_self_collision and softbody_panel_enabled(md)
- layout.label(text=_("Collision Ball Size Calculation:"))
+ layout.label(text="Collision Ball Size Calculation:")
layout.prop(softbody, "collision_type", expand=True)
col = layout.column(align=True)
- col.label(text=_("Ball:"))
- col.prop(softbody, "ball_size", text=_("Size"))
- col.prop(softbody, "ball_stiff", text=_("Stiffness"))
- col.prop(softbody, "ball_damp", text=_("Dampening"))
+ col.label(text="Ball:")
+ col.prop(softbody, "ball_size", text="Size")
+ col.prop(softbody, "ball_stiff", text="Stiffness")
+ col.prop(softbody, "ball_damp", text="Dampening")
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
@@ -233,18 +232,18 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel):
split = layout.split()
col = split.column(align=True)
- col.label(text=_("Step Size:"))
+ col.label(text="Step Size:")
col.prop(softbody, "step_min")
col.prop(softbody, "step_max")
- col.prop(softbody, "use_auto_step", text=_("Auto-Step"))
+ col.prop(softbody, "use_auto_step", text="Auto-Step")
col = split.column()
col.prop(softbody, "error_threshold")
- col.label(text=_("Helpers:"))
+ col.label(text="Helpers:")
col.prop(softbody, "choke")
col.prop(softbody, "fuzzy")
- layout.label(text=_("Diagnostics:"))
+ layout.label(text="Diagnostics:")
layout.prop(softbody, "use_diagnose")
layout.prop(softbody, "use_estimate_matrix")
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 1e9c15eedae..815f0a77570 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Menu, Panel
-from blf import gettext as _
class RENDER_MT_presets(Menu):
@@ -65,10 +64,10 @@ class RENDER_PT_render(RenderButtonsPanel, Panel):
rd = context.scene.render
row = layout.row()
- row.operator("render.render", text=_("Image"), icon='RENDER_STILL')
- row.operator("render.render", text=_("Animation"), icon='RENDER_ANIMATION').animation = True
+ row.operator("render.render", text="Image", icon='RENDER_STILL')
+ row.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True
- layout.prop(rd, "display_mode", text=_("Display"))
+ layout.prop(rd, "display_mode", text="Display")
class RENDER_PT_layers(RenderButtonsPanel, Panel):
@@ -98,25 +97,25 @@ class RENDER_PT_layers(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(scene, "layers", text=_("Scene"))
+ col.prop(scene, "layers", text="Scene")
col.label(text="")
- col.prop(rl, "light_override", text=_("Light"))
- col.prop(rl, "material_override", text=_("Material"))
+ col.prop(rl, "light_override", text="Light")
+ col.prop(rl, "material_override", text="Material")
col = split.column()
- col.prop(rl, "layers", text=_("Layer"))
- col.label(text=_("Mask Layers:"))
+ col.prop(rl, "layers", text="Layer")
+ col.label(text="Mask Layers:")
col.prop(rl, "layers_zmask", text="")
layout.separator()
- layout.label(text=_("Include:"))
+ layout.label(text="Include:")
split = layout.split()
col = split.column()
col.prop(rl, "use_zmask")
row = col.row()
- row.prop(rl, "invert_zmask", text=_("Negate"))
+ row.prop(rl, "invert_zmask", text="Negate")
row.active = rl.use_zmask
col.prop(rl, "use_all_z")
@@ -135,7 +134,7 @@ class RENDER_PT_layers(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Passes:"))
+ col.label(text="Passes:")
col.prop(rl, "use_pass_combined")
col.prop(rl, "use_pass_z")
col.prop(rl, "use_pass_vector")
@@ -194,29 +193,29 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
col = split.column()
sub = col.column(align=True)
- sub.label(text=_("Resolution:"))
+ sub.label(text="Resolution:")
sub.prop(rd, "resolution_x", text="X")
sub.prop(rd, "resolution_y", text="Y")
sub.prop(rd, "resolution_percentage", text="")
- sub.label(text=_("Aspect Ratio:"))
+ sub.label(text="Aspect Ratio:")
sub.prop(rd, "pixel_aspect_x", text="X")
sub.prop(rd, "pixel_aspect_y", text="Y")
row = col.row()
- row.prop(rd, "use_border", text=_("Border"))
+ row.prop(rd, "use_border", text="Border")
sub = row.row()
sub.active = rd.use_border
- sub.prop(rd, "use_crop_to_border", text=_("Crop"))
+ sub.prop(rd, "use_crop_to_border", text="Crop")
col = split.column()
sub = col.column(align=True)
- sub.label(text=_("Frame Range:"))
+ sub.label(text="Frame Range:")
sub.prop(scene, "frame_start")
sub.prop(scene, "frame_end")
sub.prop(scene, "frame_step")
- sub.label(text=_("Frame Rate:"))
+ sub.label(text="Frame Rate:")
if rd.fps_base == 1:
fps_rate = round(rd.fps / rd.fps_base)
else:
@@ -226,7 +225,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
if custom_framerate == True:
- fps_label_text = _("Custom (") + str(fps_rate) + " fps)"
+ fps_label_text = "Custom (" + str(fps_rate) + " fps)"
else:
fps_label_text = str(fps_rate) + " fps"
@@ -236,10 +235,10 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
sub.prop(rd, "fps")
sub.prop(rd, "fps_base", text="/")
subrow = sub.row(align=True)
- subrow.label(text=_("Time Remapping:"))
+ subrow.label(text="Time Remapping:")
subrow = sub.row(align=True)
- subrow.prop(rd, "frame_map_old", text=_("Old"))
- subrow.prop(rd, "frame_map_new", text=_("New"))
+ subrow.prop(rd, "frame_map_old", text="Old")
+ subrow.prop(rd, "frame_map_new", text="New")
class RENDER_PT_antialiasing(RenderButtonsPanel, Panel):
@@ -267,7 +266,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel, Panel):
col = split.column()
col.prop(rd, "pixel_filter_type", text="")
- col.prop(rd, "filter_size", text=_("Size"))
+ col.prop(rd, "filter_size", text="Size")
class RENDER_PT_motion_blur(RenderButtonsPanel, Panel):
@@ -309,15 +308,15 @@ class RENDER_PT_shading(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(rd, "use_textures", text=_("Textures"))
- col.prop(rd, "use_shadows", text=_("Shadows"))
- col.prop(rd, "use_sss", text=_("Subsurface Scattering"))
- col.prop(rd, "use_envmaps", text=_("Environment Map"))
+ col.prop(rd, "use_textures", text="Textures")
+ col.prop(rd, "use_shadows", text="Shadows")
+ col.prop(rd, "use_sss", text="Subsurface Scattering")
+ col.prop(rd, "use_envmaps", text="Environment Map")
col = split.column()
- col.prop(rd, "use_raytrace", text=_("Ray Tracing"))
+ col.prop(rd, "use_raytrace", text="Ray Tracing")
col.prop(rd, "use_color_management")
- col.prop(rd, "alpha_mode", text=_("Alpha"))
+ col.prop(rd, "alpha_mode", text="Alpha")
class RENDER_PT_performance(RenderButtonsPanel, Panel):
@@ -333,18 +332,18 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Threads:"))
+ col.label(text="Threads:")
col.row().prop(rd, "threads_mode", expand=True)
sub = col.column()
sub.enabled = rd.threads_mode == 'FIXED'
sub.prop(rd, "threads")
sub = col.column(align=True)
- sub.label(text=_("Tiles:"))
+ sub.label(text="Tiles:")
sub.prop(rd, "parts_x", text="X")
sub.prop(rd, "parts_y", text="Y")
col = split.column()
- col.label(text=_("Memory:"))
+ col.label(text="Memory:")
sub = col.column()
sub.enabled = not (rd.use_border or rd.use_full_sample)
sub.prop(rd, "use_save_buffers")
@@ -354,13 +353,13 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel):
sub.prop(rd, "use_free_unused_nodes")
sub = col.column()
sub.active = rd.use_raytrace
- sub.label(text=_("Acceleration structure:"))
+ sub.label(text="Acceleration structure:")
sub.prop(rd, "raytrace_method", text="")
if rd.raytrace_method == 'OCTREE':
- sub.prop(rd, "octree_resolution", text=_("Resolution"))
+ sub.prop(rd, "octree_resolution", text="Resolution")
else:
- sub.prop(rd, "use_instances", text=_("Instances"))
- sub.prop(rd, "use_local_coords", text=_("Local Coordinates"))
+ sub.prop(rd, "use_instances", text="Instances")
+ sub.prop(rd, "use_local_coords", text="Local Coordinates")
class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
@@ -379,24 +378,24 @@ class RENDER_PT_post_processing(RenderButtonsPanel, Panel):
col.prop(rd, "use_compositing")
col.prop(rd, "use_sequencer")
- split.prop(rd, "dither_intensity", text=_("Dither"), slider=True)
+ split.prop(rd, "dither_intensity", text="Dither", slider=True)
layout.separator()
split = layout.split()
col = split.column()
- col.prop(rd, "use_fields", text=_("Fields"))
+ col.prop(rd, "use_fields", text="Fields")
sub = col.column()
sub.active = rd.use_fields
sub.row().prop(rd, "field_order", expand=True)
- sub.prop(rd, "use_fields_still", text=_("Still"))
+ sub.prop(rd, "use_fields_still", text="Still")
col = split.column()
col.prop(rd, "use_edge_enhance")
sub = col.column()
sub.active = rd.use_edge_enhance
- sub.prop(rd, "edge_threshold", text=_("Threshold"), slider=True)
+ sub.prop(rd, "edge_threshold", text="Threshold", slider=True)
sub.prop(rd, "edge_color", text="")
@@ -420,26 +419,26 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(rd, "use_stamp_time", text=_("Time"))
- col.prop(rd, "use_stamp_date", text=_("Date"))
- col.prop(rd, "use_stamp_render_time", text=_("RenderTime"))
- col.prop(rd, "use_stamp_frame", text=_("Frame"))
- col.prop(rd, "use_stamp_scene", text=_("Scene"))
- col.prop(rd, "use_stamp_camera", text=_("Camera"))
- col.prop(rd, "use_stamp_lens", text=_("Lens"))
- col.prop(rd, "use_stamp_filename", text=_("Filename"))
- col.prop(rd, "use_stamp_marker", text=_("Marker"))
- col.prop(rd, "use_stamp_sequencer_strip", text=_("Seq. Strip"))
+ col.prop(rd, "use_stamp_time", text="Time")
+ col.prop(rd, "use_stamp_date", text="Date")
+ col.prop(rd, "use_stamp_render_time", text="RenderTime")
+ col.prop(rd, "use_stamp_frame", text="Frame")
+ col.prop(rd, "use_stamp_scene", text="Scene")
+ col.prop(rd, "use_stamp_camera", text="Camera")
+ col.prop(rd, "use_stamp_lens", text="Lens")
+ col.prop(rd, "use_stamp_filename", text="Filename")
+ col.prop(rd, "use_stamp_marker", text="Marker")
+ col.prop(rd, "use_stamp_sequencer_strip", text="Seq. Strip")
col = split.column()
col.active = rd.use_stamp
col.prop(rd, "stamp_foreground", slider=True)
col.prop(rd, "stamp_background", slider=True)
col.separator()
- col.prop(rd, "stamp_font_size", text=_("Font Size"))
+ col.prop(rd, "stamp_font_size", text="Font Size")
row = layout.split(percentage=0.2)
- row.prop(rd, "use_stamp_note", text=_("Note"))
+ row.prop(rd, "use_stamp_note", text="Note")
sub = row.row()
sub.active = rd.use_stamp_note
sub.prop(rd, "stamp_note_text", text="")
@@ -461,7 +460,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
col = split.column()
col.prop(rd, "file_format", text="")
- col.row().prop(rd, "color_mode", text=_("Color"), expand=True)
+ col.row().prop(rd, "color_mode", text="Color", expand=True)
col = split.column()
col.prop(rd, "use_file_extension")
@@ -472,11 +471,11 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
layout.prop(rd, "file_quality", slider=True)
if file_format == 'PNG':
- layout.prop(rd, "file_quality", slider=True, text=_("Compression"))
+ layout.prop(rd, "file_quality", slider=True, text="Compression")
if file_format in {'OPEN_EXR', 'MULTILAYER'}:
row = layout.row()
- row.prop(rd, "exr_codec", text=_("Codec"))
+ row.prop(rd, "exr_codec", text="Codec")
if file_format == 'OPEN_EXR':
row = layout.row()
@@ -487,7 +486,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
elif file_format == 'JPEG2000':
split = layout.split()
col = split.column()
- col.label(text=_("Depth:"))
+ col.label(text="Depth:")
col.row().prop(rd, "jpeg2k_depth", expand=True)
col = split.column()
@@ -500,13 +499,13 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
split.label("FIXME: hard coded Non-Linear, Gamma:1.0")
'''
col = split.column()
- col.prop(rd, "use_cineon_log", text=_("Convert to Log"))
+ col.prop(rd, "use_cineon_log", text="Convert to Log")
col = split.column(align=True)
col.active = rd.use_cineon_log
- col.prop(rd, "cineon_black", text=_("Black"))
- col.prop(rd, "cineon_white", text=_("White"))
- col.prop(rd, "cineon_gamma", text=_("Gamma"))
+ col.prop(rd, "cineon_black", text="Black")
+ col.prop(rd, "cineon_white", text="White")
+ col.prop(rd, "cineon_gamma", text="Gamma")
'''
elif file_format == 'TIFF':
@@ -518,11 +517,11 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
elif file_format == 'QUICKTIME_QTKIT':
split = layout.split()
col = split.column()
- col.prop(rd, "quicktime_codec_type", text=_("Video Codec"))
- col.prop(rd, "quicktime_codec_spatial_quality", text=_("Quality"))
+ col.prop(rd, "quicktime_codec_type", text="Video Codec")
+ col.prop(rd, "quicktime_codec_spatial_quality", text="Quality")
# Audio
- col.prop(rd, "quicktime_audiocodec_type", text=_("Audio Codec"))
+ col.prop(rd, "quicktime_audiocodec_type", text="Audio Codec")
if rd.quicktime_audiocodec_type != 'No audio':
split = layout.split()
if rd.quicktime_audiocodec_type == 'LPCM':
@@ -560,7 +559,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel):
rd = context.scene.render
- layout.menu("RENDER_MT_ffmpeg_presets", text=_("Presets"))
+ layout.menu("RENDER_MT_ffmpeg_presets", text="Presets")
split = layout.split()
split.prop(rd, "ffmpeg_format")
@@ -576,22 +575,22 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Rate:"))
- col.prop(rd, "ffmpeg_minrate", text=_("Minimum"))
- col.prop(rd, "ffmpeg_maxrate", text=_("Maximum"))
- col.prop(rd, "ffmpeg_buffersize", text=_("Buffer"))
+ col.label(text="Rate:")
+ col.prop(rd, "ffmpeg_minrate", text="Minimum")
+ col.prop(rd, "ffmpeg_maxrate", text="Maximum")
+ col.prop(rd, "ffmpeg_buffersize", text="Buffer")
col = split.column()
col.prop(rd, "ffmpeg_autosplit")
- col.label(text=_("Mux:"))
- col.prop(rd, "ffmpeg_muxrate", text=_("Rate"))
- col.prop(rd, "ffmpeg_packetsize", text=_("Packet Size"))
+ col.label(text="Mux:")
+ col.prop(rd, "ffmpeg_muxrate", text="Rate")
+ col.prop(rd, "ffmpeg_packetsize", text="Packet Size")
layout.separator()
# Audio:
if rd.ffmpeg_format not in {'MP3'}:
- layout.prop(rd, "ffmpeg_audio_codec", text=_("Audio Codec"))
+ layout.prop(rd, "ffmpeg_audio_codec", text="Audio Codec")
row = layout.row()
row.prop(rd, "ffmpeg_audio_bitrate")
@@ -633,7 +632,7 @@ class RENDER_PT_bake(RenderButtonsPanel, Panel):
col = split.column()
col.prop(rd, "use_bake_clear")
col.prop(rd, "bake_margin")
- col.prop(rd, "bake_quad_split", text=_("Split"))
+ col.prop(rd, "bake_quad_split", text="Split")
col = split.column()
col.prop(rd, "use_bake_selected_to_active")
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index c82b4ac69dc..167cead9a3b 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -18,9 +18,9 @@
# <pep8 compliant>
import bpy
-from bpy.types import Operator, Panel
+from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
+
class SceneButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -41,7 +41,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
scene = context.scene
layout.prop(scene, "camera")
- layout.prop(scene, "background_set", text=_("Background"))
+ layout.prop(scene, "background_set", text="Background")
class SCENE_PT_audio(SceneButtonsPanel, Panel):
@@ -59,15 +59,15 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(_("Listener:"))
+ col.label("Listener:")
col.prop(scene, "audio_distance_model", text="")
- col.prop(scene, "audio_doppler_speed", text=_("Speed"))
- col.prop(scene, "audio_doppler_factor", text=_("Doppler"))
+ col.prop(scene, "audio_doppler_speed", text="Speed")
+ col.prop(scene, "audio_doppler_factor", text="Doppler")
col = split.column()
- col.label(_("Format:"))
+ col.label("Format:")
col.prop(rd, "ffmpeg_audio_channels", text="")
- col.prop(rd, "ffmpeg_audio_mixrate", text=_("Rate"))
+ col.prop(rd, "ffmpeg_audio_mixrate", text="Rate")
layout.operator("sound.mixdown")
@@ -86,7 +86,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
row = layout.row()
row.active = (unit.system != 'NONE')
- row.prop(unit, "scale_length", text=_("Scale"))
+ row.prop(unit, "scale_length", text="Scale")
row.prop(unit, "use_separate")
@@ -115,11 +115,11 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
subcol = col.column()
subcol.operator_context = 'INVOKE_DEFAULT'
- op = subcol.operator("anim.keying_set_export", text=_("Export to File"))
+ op = subcol.operator("anim.keying_set_export", text="Export to File")
op.filepath = "keyingset.py"
col = row.column()
- col.label(text=_("Keyframing Settings:"))
+ col.label(text="Keyframing Settings:")
col.prop(ks, "bl_options")
@@ -138,7 +138,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
ks = scene.keying_sets.active
row = layout.row()
- row.label(text=_("Paths:"))
+ row.label(text="Paths:")
row = layout.row()
@@ -152,20 +152,20 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
ksp = ks.paths.active
if ksp:
col = layout.column()
- col.label(text=_("Target:"))
+ col.label(text="Target:")
col.template_any_ID(ksp, "id", "id_type")
col.template_path_builder(ksp, "data_path", ksp.id)
row = layout.row()
col = row.column()
- col.label(text=_("Array Target:"))
+ col.label(text="Array Target:")
col.prop(ksp, "use_entire_array")
if ksp.use_entire_array is False:
col.prop(ksp, "array_index")
col = row.column()
- col.label(text=_("F-Curve Grouping:"))
+ col.label(text="F-Curve Grouping:")
col.prop(ksp, "group_method")
if ksp.group_method == 'NAMED':
col.prop(ksp, "group")
@@ -209,14 +209,14 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(rd, "simplify_subdivision", text=_("Subdivision"))
- col.prop(rd, "simplify_child_particles", text=_("Child Particles"))
+ col.prop(rd, "simplify_subdivision", text="Subdivision")
+ col.prop(rd, "simplify_child_particles", text="Child Particles")
col.prop(rd, "use_simplify_triangulate")
col = split.column()
- col.prop(rd, "simplify_shadow_samples", text=_("Shadow Samples"))
- col.prop(rd, "simplify_ao_sss", text=_("AO and SSS"))
+ col.prop(rd, "simplify_shadow_samples", text="Shadow Samples")
+ col.prop(rd, "simplify_ao_sss", text="AO and SSS")
class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
@@ -224,112 +224,5 @@ class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
_context_path = "scene"
_property_type = bpy.types.Scene
-# XXX, move operator to op/ dir
-
-
-class ANIM_OT_keying_set_export(Operator):
- "Export Keying Set to a python script"
- bl_idname = "anim.keying_set_export"
- bl_label = "Export Keying Set..."
-
- filepath = bpy.props.StringProperty(name="File Path", description="Filepath to write file to")
- filter_folder = bpy.props.BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
- filter_text = bpy.props.BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
- filter_python = bpy.props.BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
-
- def execute(self, context):
- if not self.filepath:
- raise Exception("Filepath not set")
-
- f = open(self.filepath, "w")
- if not f:
- raise Exception("Could not open file")
-
- scene = context.scene
- ks = scene.keying_sets.active
-
- f.write("# Keying Set: %s\n" % ks.name)
-
- f.write("import bpy\n\n")
- f.write("scene= bpy.data.scenes[0]\n\n") # XXX, why not use the current scene?
-
- # Add KeyingSet and set general settings
- f.write("# Keying Set Level declarations\n")
- f.write("ks= scene.keying_sets.new(name=\"%s\")\n" % ks.name)
-
- if not ks.is_path_absolute:
- f.write("ks.is_path_absolute = False\n")
- f.write("\n")
-
- f.write("ks.bl_options = %r\n" % ks.bl_options)
- f.write("\n")
-
- # generate and write set of lookups for id's used in paths
- id_to_paths_cache = {} # cache for syncing ID-blocks to bpy paths + shorthands
-
- for ksp in ks.paths:
- if ksp.id is None:
- continue
- if ksp.id in id_to_paths_cache:
- continue
-
- # - idtype_list is used to get the list of id-datablocks from bpy.data.*
- # since this info isn't available elsewhere
- # - id.bl_rna.name gives a name suitable for UI,
- # with a capitalised first letter, but we need
- # the plural form that's all lower case
- idtype_list = ksp.id.bl_rna.name.lower() + "s"
- id_bpy_path = "bpy.data.%s[\"%s\"]" % (idtype_list, ksp.id.name)
-
- # shorthand ID for the ID-block (as used in the script)
- short_id = "id_%d" % len(id_to_paths_cache)
-
- # store this in the cache now
- id_to_paths_cache[ksp.id] = [short_id, id_bpy_path]
-
- f.write("# ID's that are commonly used\n")
- for id_pair in id_to_paths_cache.values():
- f.write("%s = %s\n" % (id_pair[0], id_pair[1]))
- f.write("\n")
-
- # write paths
- f.write("# Path Definitions\n")
- for ksp in ks.paths:
- f.write("ksp = ks.paths.add(")
-
- # id-block + data_path
- if ksp.id:
- # find the relevant shorthand from the cache
- id_bpy_path = id_to_paths_cache[ksp.id][0]
- else:
- id_bpy_path = "None" # XXX...
- f.write("%s, '%s'" % (id_bpy_path, ksp.data_path))
-
- # array index settings (if applicable)
- if ksp.use_entire_array:
- f.write(", index=-1")
- else:
- f.write(", index=%d" % ksp.array_index)
-
- # grouping settings (if applicable)
- # NOTE: the current default is KEYINGSET, but if this changes, change this code too
- if ksp.group_method == 'NAMED':
- f.write(", group_method='%s', group_name=\"%s\"" % (ksp.group_method, ksp.group))
- elif ksp.group_method != 'KEYINGSET':
- f.write(", group_method='%s'" % ksp.group_method)
-
- # finish off
- f.write(")\n")
-
- f.write("\n")
- f.close()
-
- return {'FINISHED'}
-
- def invoke(self, context, event):
- wm = context.window_manager
- wm.fileselect_add(self)
- return {'RUNNING_MODAL'}
-
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 439d51d81a1..38697c569da 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -20,7 +20,6 @@
import bpy
from bpy.types import Menu, Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
class TEXTURE_MT_specials(Menu):
@@ -144,11 +143,11 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
if tex.use_nodes:
if slot:
- split.label(text=_("Output:"))
+ split.label(text="Output:")
split.prop(slot, "output_node", text="")
else:
- split.label(text=_("Type:"))
+ split.label(text="Type:")
split.prop(tex, "type", text="")
@@ -179,21 +178,21 @@ class TEXTURE_PT_colors(TextureButtonsPanel, Panel):
tex = context.texture
- layout.prop(tex, "use_color_ramp", text=_("Ramp"))
+ layout.prop(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp:
layout.template_color_ramp(tex, "color_ramp", expand=True)
split = layout.split()
col = split.column()
- col.label(text=_("RGB Multiply:"))
+ col.label(text="RGB Multiply:")
sub = col.column(align=True)
sub.prop(tex, "factor_red", text="R")
sub.prop(tex, "factor_green", text="G")
sub.prop(tex, "factor_blue", text="B")
col = split.column()
- col.label(text=_("Adjust:"))
+ col.label(text="Adjust:")
col.prop(tex, "intensity")
col.prop(tex, "contrast")
col.prop(tex, "saturation")
@@ -236,17 +235,17 @@ class TEXTURE_PT_clouds(TextureTypePanel, Panel):
tex = context.texture
layout.prop(tex, "cloud_type", expand=True)
- layout.label(text=_("Noise:"))
- layout.prop(tex, "noise_type", text=_("Type"), expand=True)
- layout.prop(tex, "noise_basis", text=_("Basis"))
+ layout.label(text="Noise:")
+ layout.prop(tex, "noise_type", text="Type", expand=True)
+ layout.prop(tex, "noise_basis", text="Basis")
split = layout.split()
col = split.column()
- col.prop(tex, "noise_scale", text=_("Size"))
- col.prop(tex, "noise_depth", text=_("Depth"))
+ col.prop(tex, "noise_scale", text="Size")
+ col.prop(tex, "noise_depth", text="Depth")
- split.prop(tex, "nabla", text=_("Nabla"))
+ split.prop(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureTypePanel, Panel):
@@ -264,15 +263,15 @@ class TEXTURE_PT_wood(TextureTypePanel, Panel):
col = layout.column()
col.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'}
- col.label(text=_("Noise:"))
- col.row().prop(tex, "noise_type", text=_("Type"), expand=True)
- layout.prop(tex, "noise_basis", text=_("Basis"))
+ col.label(text="Noise:")
+ col.row().prop(tex, "noise_type", text="Type", expand=True)
+ layout.prop(tex, "noise_basis", text="Basis")
split = layout.split()
split.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'}
col = split.column()
- col.prop(tex, "noise_scale", text=_("Size"))
+ col.prop(tex, "noise_scale", text="Size")
col.prop(tex, "turbulence")
split.prop(tex, "nabla")
@@ -290,15 +289,15 @@ class TEXTURE_PT_marble(TextureTypePanel, Panel):
layout.prop(tex, "marble_type", expand=True)
layout.prop(tex, "noise_basis_2", expand=True)
- layout.label(text=_("Noise:"))
- layout.prop(tex, "noise_type", text=_("Type"), expand=True)
- layout.prop(tex, "noise_basis", text=_("Basis"))
+ layout.label(text="Noise:")
+ layout.prop(tex, "noise_type", text="Type", expand=True)
+ layout.prop(tex, "noise_basis", text="Basis")
split = layout.split()
col = split.column()
- col.prop(tex, "noise_scale", text=_("Size"))
- col.prop(tex, "noise_depth", text=_("Depth"))
+ col.prop(tex, "noise_scale", text="Size")
+ col.prop(tex, "noise_depth", text="Depth")
col = split.column()
col.prop(tex, "turbulence")
@@ -316,7 +315,7 @@ class TEXTURE_PT_magic(TextureTypePanel, Panel):
tex = context.texture
row = layout.row()
- row.prop(tex, "noise_depth", text=_("Depth"))
+ row.prop(tex, "noise_depth", text="Depth")
row.prop(tex, "turbulence")
@@ -349,12 +348,12 @@ class TEXTURE_PT_stucci(TextureTypePanel, Panel):
tex = context.texture
layout.prop(tex, "stucci_type", expand=True)
- layout.label(text=_("Noise:"))
- layout.prop(tex, "noise_type", text=_("Type"), expand=True)
- layout.prop(tex, "noise_basis", text=_("Basis"))
+ layout.label(text="Noise:")
+ layout.prop(tex, "noise_type", text="Type", expand=True)
+ layout.prop(tex, "noise_basis", text="Basis")
row = layout.row()
- row.prop(tex, "noise_scale", text=_("Size"))
+ row.prop(tex, "noise_scale", text="Size")
row.prop(tex, "turbulence")
@@ -372,13 +371,13 @@ class TEXTURE_PT_image(TextureTypePanel, Panel):
def texture_filter_common(tex, layout):
- layout.label(text=_("Filter:"))
+ layout.label(text="Filter:")
layout.prop(tex, "filter_type", text="")
if tex.use_mipmap and tex.filter_type in {'AREA', 'EWA', 'FELINE'}:
if tex.filter_type == 'FELINE':
- layout.prop(tex, "filter_probes", text=_("Probes"))
+ layout.prop(tex, "filter_probes", text="Probes")
else:
- layout.prop(tex, "filter_eccentricity", text=_("Eccentricity"))
+ layout.prop(tex, "filter_eccentricity", text="Eccentricity")
layout.prop(tex, "filter_size")
layout.prop(tex, "use_filter_size_min")
@@ -400,12 +399,12 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Alpha:"))
- col.prop(tex, "use_alpha", text=_("Use"))
- col.prop(tex, "use_calculate_alpha", text=_("Calculate"))
- col.prop(tex, "invert_alpha", text=_("Invert"))
+ col.label(text="Alpha:")
+ col.prop(tex, "use_alpha", text="Use")
+ col.prop(tex, "use_calculate_alpha", text="Calculate")
+ col.prop(tex, "invert_alpha", text="Invert")
col.separator()
- col.prop(tex, "use_flip_axis", text=_("Flip X/Y Axis"))
+ col.prop(tex, "use_flip_axis", text="Flip X/Y Axis")
col = split.column()
@@ -447,12 +446,12 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
if tex.extension == 'REPEAT':
col = split.column(align=True)
- col.label(text=_("Repeat:"))
+ col.label(text="Repeat:")
col.prop(tex, "repeat_x", text="X")
col.prop(tex, "repeat_y", text="Y")
col = split.column(align=True)
- col.label(text=_("Mirror:"))
+ col.label(text="Mirror:")
row = col.row()
row.prop(tex, "use_mirror_x", text="X")
row.active = (tex.repeat_x > 1)
@@ -464,11 +463,11 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
elif tex.extension == 'CHECKER':
col = split.column(align=True)
row = col.row()
- row.prop(tex, "use_checker_even", text=_("Even"))
- row.prop(tex, "use_checker_odd", text=_("Odd"))
+ row.prop(tex, "use_checker_even", text="Even")
+ row.prop(tex, "use_checker_odd", text="Odd")
col = split.column()
- col.prop(tex, "checker_distance", text=_("Distance"))
+ col.prop(tex, "checker_distance", text="Distance")
layout.separator()
@@ -476,12 +475,12 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
col = split.column(align=True)
#col.prop(tex, "crop_rectangle")
- col.label(text=_("Crop Minimum:"))
+ col.label(text="Crop Minimum:")
col.prop(tex, "crop_min_x", text="X")
col.prop(tex, "crop_min_y", text="Y")
col = split.column(align=True)
- col.label(text=_("Crop Maximum:"))
+ col.label(text="Crop Maximum:")
col.prop(tex, "crop_max_x", text="X")
col.prop(tex, "crop_max_y", text="Y")
@@ -519,9 +518,9 @@ class TEXTURE_PT_envmap(TextureTypePanel, Panel):
col = split.column(align=True)
- col.label(text=_("Clipping:"))
- col.prop(env, "clip_start", text=_("Start"))
- col.prop(env, "clip_end", text=_("End"))
+ col.label(text="Clipping:")
+ col.prop(env, "clip_start", text="Start")
+ col.prop(env, "clip_end", text="End")
class TEXTURE_PT_envmap_sampling(TextureTypePanel, Panel):
@@ -553,7 +552,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel, Panel):
split = layout.split()
col = split.column()
- col.prop(tex, "dimension_max", text=_("Dimension"))
+ col.prop(tex, "dimension_max", text="Dimension")
col.prop(tex, "lacunarity")
col.prop(tex, "octaves")
@@ -562,16 +561,16 @@ class TEXTURE_PT_musgrave(TextureTypePanel, Panel):
if musgrave_type in {'HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}:
col.prop(tex, "offset")
if musgrave_type in {'MULTIFRACTAL', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}:
- col.prop(tex, "noise_intensity", text=_("Intensity"))
+ col.prop(tex, "noise_intensity", text="Intensity")
if musgrave_type in {'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL'}:
col.prop(tex, "gain")
- layout.label(text=_("Noise:"))
+ layout.label(text="Noise:")
- layout.prop(tex, "noise_basis", text=_("Basis"))
+ layout.prop(tex, "noise_basis", text="Basis")
row = layout.row()
- row.prop(tex, "noise_scale", text=_("Size"))
+ row.prop(tex, "noise_scale", text="Size")
row.prop(tex, "nabla")
@@ -588,26 +587,26 @@ class TEXTURE_PT_voronoi(TextureTypePanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Distance Metric:"))
+ col.label(text="Distance Metric:")
col.prop(tex, "distance_metric", text="")
sub = col.column()
sub.active = tex.distance_metric == 'MINKOVSKY'
- sub.prop(tex, "minkovsky_exponent", text=_("Exponent"))
- col.label(text=_("Coloring:"))
+ sub.prop(tex, "minkovsky_exponent", text="Exponent")
+ col.label(text="Coloring:")
col.prop(tex, "color_mode", text="")
- col.prop(tex, "noise_intensity", text=_("Intensity"))
+ col.prop(tex, "noise_intensity", text="Intensity")
col = split.column()
sub = col.column(align=True)
- sub.label(text=_("Feature Weights:"))
+ sub.label(text="Feature Weights:")
sub.prop(tex, "weight_1", text="1", slider=True)
sub.prop(tex, "weight_2", text="2", slider=True)
sub.prop(tex, "weight_3", text="3", slider=True)
sub.prop(tex, "weight_4", text="4", slider=True)
- layout.label(text=_("Noise:"))
+ layout.label(text="Noise:")
row = layout.row()
- row.prop(tex, "noise_scale", text=_("Size"))
+ row.prop(tex, "noise_scale", text="Size")
row.prop(tex, "nabla")
@@ -622,13 +621,13 @@ class TEXTURE_PT_distortednoise(TextureTypePanel, Panel):
tex = context.texture
layout.prop(tex, "noise_distortion")
- layout.prop(tex, "noise_basis", text=_("Basis"))
+ layout.prop(tex, "noise_basis", text="Basis")
split = layout.split()
col = split.column()
- col.prop(tex, "distortion", text=_("Distortion"))
- col.prop(tex, "noise_scale", text=_("Size"))
+ col.prop(tex, "distortion", text="Distortion")
+ col.prop(tex, "noise_scale", text="Size")
split.prop(tex, "nabla")
@@ -695,26 +694,26 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel):
col = split.column()
if pd.point_source == 'PARTICLE_SYSTEM':
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(pd, "object", text="")
sub = col.column()
sub.enabled = bool(pd.object)
if pd.object:
- sub.label(text=_("System:"))
+ sub.label(text="System:")
sub.prop_search(pd, "particle_system", pd.object, "particle_systems", text="")
- sub.label(text=_("Cache:"))
+ sub.label(text="Cache:")
sub.prop(pd, "particle_cache_space", text="")
else:
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.prop(pd, "object", text="")
- col.label(text=_("Cache:"))
+ col.label(text="Cache:")
col.prop(pd, "vertex_cache_space", text="")
col.separator()
if pd.point_source == 'PARTICLE_SYSTEM':
- col.label(text=_("Color Source:"))
+ col.label(text="Color Source:")
col.prop(pd, "color_source", text="")
if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_VELOCITY'}:
col.prop(pd, "speed_scale")
@@ -724,7 +723,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel):
col = split.column()
col.label()
col.prop(pd, "radius")
- col.label(text=_("Falloff:"))
+ col.label(text="Falloff:")
col.prop(pd, "falloff", text="")
if pd.falloff == 'SOFT':
col.prop(pd, "falloff_soft")
@@ -735,7 +734,7 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel, Panel):
if pd.use_falloff_curve:
col = layout.column()
- col.label(text=_("Falloff Curve"))
+ col.label(text="Falloff Curve")
col.template_curve_mapping(pd, "falloff_curve", brush=False)
@@ -764,9 +763,9 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Influence:"))
+ col.label(text="Influence:")
col.prop(pd, "turbulence_influence", text="")
- col.label(text=_("Noise Basis:"))
+ col.label(text="Noise Basis:")
col.prop(pd, "noise_basis", text="")
col = split.column()
@@ -803,7 +802,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
if not isinstance(idblock, bpy.types.Brush):
split = layout.split(percentage=0.3)
col = split.column()
- col.label(text=_("Coordinates:"))
+ col.label(text="Coordinates:")
col = split.column()
col.prop(tex, "texture_coords", text="")
@@ -812,12 +811,12 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
ob = context.object
if ob and ob.type == 'MESH':
split = layout.split(percentage=0.3)
- split.label(text=_("Mesh:"))
+ split.label(text="Mesh:")
split.prop(ob.data, "texco_mesh", text="")
"""
elif tex.texture_coords == 'UV':
split = layout.split(percentage=0.3)
- split.label(text=_("Layer:"))
+ split.label(text="Layer:")
ob = context.object
if ob and ob.type == 'MESH':
split.prop_search(tex, "uv_layer", ob.data, "uv_textures", text="")
@@ -826,12 +825,12 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
elif tex.texture_coords == 'OBJECT':
split = layout.split(percentage=0.3)
- split.label(text=_("Object:"))
+ split.label(text="Object:")
split.prop(tex, "object", text="")
if isinstance(idblock, bpy.types.Brush):
if context.sculpt_object:
- layout.label(text=_("Brush Mapping:"))
+ layout.label(text="Brush Mapping:")
layout.prop(tex, "map_mode", expand=True)
row = layout.row()
@@ -840,7 +839,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
else:
if isinstance(idblock, bpy.types.Material):
split = layout.split(percentage=0.3)
- split.label(text=_("Projection:"))
+ split.label(text="Projection:")
split.prop(tex, "mapping", text="")
split = layout.split()
@@ -902,111 +901,111 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Diffuse:"))
- factor_but(col, "use_map_diffuse", "diffuse_factor", _("Intensity"))
- factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", _("Color"))
- factor_but(col, "use_map_alpha", "alpha_factor", _("Alpha"))
- factor_but(col, "use_map_translucency", "translucency_factor", _("Translucency"))
+ col.label(text="Diffuse:")
+ factor_but(col, "use_map_diffuse", "diffuse_factor", "Intensity")
+ factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", "Color")
+ factor_but(col, "use_map_alpha", "alpha_factor", "Alpha")
+ factor_but(col, "use_map_translucency", "translucency_factor", "Translucency")
- col.label(text=_("Specular:"))
- factor_but(col, "use_map_specular", "specular_factor", _("Intensity"))
- factor_but(col, "use_map_color_spec", "specular_color_factor", _("Color"))
- factor_but(col, "use_map_hardness", "hardness_factor", _("Hardness"))
+ col.label(text="Specular:")
+ factor_but(col, "use_map_specular", "specular_factor", "Intensity")
+ factor_but(col, "use_map_color_spec", "specular_color_factor", "Color")
+ factor_but(col, "use_map_hardness", "hardness_factor", "Hardness")
col = split.column()
- col.label(text=_("Shading:"))
- factor_but(col, "use_map_ambient", "ambient_factor", _("Ambient"))
- factor_but(col, "use_map_emit", "emit_factor", _("Emit"))
- factor_but(col, "use_map_mirror", "mirror_factor", _("Mirror"))
- factor_but(col, "use_map_raymir", "raymir_factor", _("Ray Mirror"))
+ col.label(text="Shading:")
+ factor_but(col, "use_map_ambient", "ambient_factor", "Ambient")
+ factor_but(col, "use_map_emit", "emit_factor", "Emit")
+ factor_but(col, "use_map_mirror", "mirror_factor", "Mirror")
+ factor_but(col, "use_map_raymir", "raymir_factor", "Ray Mirror")
- col.label(text=_("Geometry:"))
+ col.label(text="Geometry:")
# XXX replace 'or' when displacement is fixed to not rely on normal influence value.
- sub_tmp = factor_but(col, "use_map_normal", "normal_factor", _("Normal"))
+ sub_tmp = factor_but(col, "use_map_normal", "normal_factor", "Normal")
sub_tmp.active = (tex.use_map_normal or tex.use_map_displacement)
# END XXX
- factor_but(col, "use_map_warp", "warp_factor", _("Warp"))
- factor_but(col, "use_map_displacement", "displacement_factor", _("Displace"))
+ factor_but(col, "use_map_warp", "warp_factor", "Warp")
+ factor_but(col, "use_map_displacement", "displacement_factor", "Displace")
#sub = col.column()
#sub.active = tex.use_map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
- #sub.prop(tex, "default_value", text=_("Amount"), slider=True)
+ #sub.prop(tex, "default_value", text="Amount", slider=True)
elif idblock.type == 'HALO':
- layout.label(text=_("Halo:"))
+ layout.label(text="Halo:")
split = layout.split()
col = split.column()
- factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", _("Color"))
- factor_but(col, "use_map_alpha", "alpha_factor", _("Alpha"))
+ factor_but(col, "use_map_color_diffuse", "diffuse_color_factor", "Color")
+ factor_but(col, "use_map_alpha", "alpha_factor", "Alpha")
col = split.column()
- factor_but(col, "use_map_raymir", "raymir_factor", _("Size"))
- factor_but(col, "use_map_hardness", "hardness_factor", _("Hardness"))
- factor_but(col, "use_map_translucency", "translucency_factor", _("Add"))
+ factor_but(col, "use_map_raymir", "raymir_factor", "Size")
+ factor_but(col, "use_map_hardness", "hardness_factor", "Hardness")
+ factor_but(col, "use_map_translucency", "translucency_factor", "Add")
elif idblock.type == 'VOLUME':
split = layout.split()
col = split.column()
- factor_but(col, "use_map_density", "density_factor", _("Density"))
- factor_but(col, "use_map_emission", "emission_factor", _("Emission"))
- factor_but(col, "use_map_scatter", "scattering_factor", _("Scattering"))
- factor_but(col, "use_map_reflect", "reflection_factor", _("Reflection"))
+ factor_but(col, "use_map_density", "density_factor", "Density")
+ factor_but(col, "use_map_emission", "emission_factor", "Emission")
+ factor_but(col, "use_map_scatter", "scattering_factor", "Scattering")
+ factor_but(col, "use_map_reflect", "reflection_factor", "Reflection")
col = split.column()
col.label(text=" ")
- factor_but(col, "use_map_color_emission", "emission_color_factor", _("Emission Color"))
- factor_but(col, "use_map_color_transmission", "transmission_color_factor", _("Transmission Color"))
- factor_but(col, "use_map_color_reflection", "reflection_color_factor", _("Reflection Color"))
+ factor_but(col, "use_map_color_emission", "emission_color_factor", "Emission Color")
+ factor_but(col, "use_map_color_transmission", "transmission_color_factor", "Transmission Color")
+ factor_but(col, "use_map_color_reflection", "reflection_color_factor", "Reflection Color")
elif isinstance(idblock, bpy.types.Lamp):
split = layout.split()
col = split.column()
- factor_but(col, "use_map_color", "color_factor", _("Color"))
+ factor_but(col, "use_map_color", "color_factor", "Color")
col = split.column()
- factor_but(col, "use_map_shadow", "shadow_factor", _("Shadow"))
+ factor_but(col, "use_map_shadow", "shadow_factor", "Shadow")
elif isinstance(idblock, bpy.types.World):
split = layout.split()
col = split.column()
- factor_but(col, "use_map_blend", "blend_factor", _("Blend"))
- factor_but(col, "use_map_horizon", "horizon_factor", _("Horizon"))
+ factor_but(col, "use_map_blend", "blend_factor", "Blend")
+ factor_but(col, "use_map_horizon", "horizon_factor", "Horizon")
col = split.column()
- factor_but(col, "use_map_zenith_up", "zenith_up_factor", _("Zenith Up"))
- factor_but(col, "use_map_zenith_down", "zenith_down_factor", _("Zenith Down"))
+ factor_but(col, "use_map_zenith_up", "zenith_up_factor", "Zenith Up")
+ factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
elif isinstance(idblock, bpy.types.ParticleSettings):
split = layout.split()
col = split.column()
- col.label(text=_("General:"))
- factor_but(col, "use_map_time", "time_factor", _("Time"))
- factor_but(col, "use_map_life", "life_factor", _("Lifetime"))
- factor_but(col, "use_map_density", "density_factor", _("Density"))
- factor_but(col, "use_map_size", "size_factor", _("Size"))
+ col.label(text="General:")
+ factor_but(col, "use_map_time", "time_factor", "Time")
+ factor_but(col, "use_map_life", "life_factor", "Lifetime")
+ factor_but(col, "use_map_density", "density_factor", "Density")
+ factor_but(col, "use_map_size", "size_factor", "Size")
col = split.column()
- col.label(text=_("Physics:"))
- factor_but(col, "use_map_velocity", "velocity_factor", _("Velocity"))
- factor_but(col, "use_map_damp", "damp_factor", _("Damp"))
- factor_but(col, "use_map_gravity", "gravity_factor", _("Gravity"))
- factor_but(col, "use_map_field", "field_factor", _("Force Fields"))
+ col.label(text="Physics:")
+ factor_but(col, "use_map_velocity", "velocity_factor", "Velocity")
+ factor_but(col, "use_map_damp", "damp_factor", "Damp")
+ factor_but(col, "use_map_gravity", "gravity_factor", "Gravity")
+ factor_but(col, "use_map_field", "field_factor", "Force Fields")
- layout.label(text=_("Hair:"))
+ layout.label(text="Hair:")
split = layout.split()
col = split.column()
- factor_but(col, "use_map_length", "length_factor", _("Length"))
- factor_but(col, "use_map_clump", "clump_factor", _("Clump"))
+ factor_but(col, "use_map_length", "length_factor", "Length")
+ factor_but(col, "use_map_clump", "clump_factor", "Clump")
col = split.column()
- factor_but(col, "use_map_kink", "kink_factor", _("Kink"))
- factor_but(col, "use_map_rough", "rough_factor", _("Rough"))
+ factor_but(col, "use_map_kink", "kink_factor", "Kink")
+ factor_but(col, "use_map_rough", "rough_factor", "Rough")
layout.separator()
@@ -1014,32 +1013,32 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
split = layout.split()
col = split.column()
- col.prop(tex, "blend_type", text=_("Blend"))
+ col.prop(tex, "blend_type", text="Blend")
col.prop(tex, "use_rgb_to_intensity")
# color is used on grayscale textures even when use_rgb_to_intensity is disabled.
col.prop(tex, "color", text="")
col = split.column()
- col.prop(tex, "invert", text=_("Negative"))
+ col.prop(tex, "invert", text="Negative")
col.prop(tex, "use_stencil")
if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World):
- col.prop(tex, "default_value", text=_("DVar"), slider=True)
+ col.prop(tex, "default_value", text="DVar", slider=True)
if isinstance(idblock, bpy.types.Material):
- layout.label(text=_("Bump Mapping:"))
+ layout.label(text="Bump Mapping:")
# only show bump settings if activated but not for normalmap images
row = layout.row()
sub = row.row()
sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map))
- sub.prop(tex, "bump_method", text=_("Method"))
+ sub.prop(tex, "bump_method", text="Method")
# the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps
sub = row.row()
sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map))
- sub.prop(tex, "bump_objectspace", text=_("Space"))
+ sub.prop(tex, "bump_objectspace", text="Space")
class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py
index 916667ea400..71ee03296a0 100644
--- a/release/scripts/startup/bl_ui/properties_world.py
+++ b/release/scripts/startup/bl_ui/properties_world.py
@@ -20,7 +20,6 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
-from blf import gettext as _
class WorldButtonsPanel():
@@ -116,12 +115,12 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel, Panel):
layout.active = light.use_ambient_occlusion
split = layout.split()
- split.prop(light, "ao_factor", text=_("Factor"))
+ split.prop(light, "ao_factor", text="Factor")
split.prop(light, "ao_blend_type", text="")
class WORLD_PT_environment_lighting(WorldButtonsPanel, Panel):
- bl_label = _("Environment Lighting")
+ bl_label = "Environment Lighting"
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw_header(self, context):
@@ -135,7 +134,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel, Panel):
layout.active = light.use_environment_light
split = layout.split()
- split.prop(light, "environment_energy", text=_("Energy"))
+ split.prop(light, "environment_energy", text="Energy")
split.prop(light, "environment_color", text="")
@@ -154,11 +153,11 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, Panel):
layout.active = light.use_indirect_light and light.gather_method == 'APPROXIMATE'
split = layout.split()
- split.prop(light, "indirect_factor", text=_("Factor"))
- split.prop(light, "indirect_bounces", text=_("Bounces"))
+ split.prop(light, "indirect_factor", text="Factor")
+ split.prop(light, "indirect_bounces", text="Bounces")
if light.gather_method == 'RAYTRACE':
- layout.label(text=_("Only works with Approximate gather method"))
+ layout.label(text="Only works with Approximate gather method")
class WORLD_PT_gather(WorldButtonsPanel, Panel):
@@ -176,18 +175,18 @@ class WORLD_PT_gather(WorldButtonsPanel, Panel):
split = layout.split()
col = split.column()
- col.label(text=_("Attenuation:"))
+ col.label(text="Attenuation:")
if light.gather_method == 'RAYTRACE':
col.prop(light, "distance")
col.prop(light, "use_falloff")
sub = col.row()
sub.active = light.use_falloff
- sub.prop(light, "falloff_strength", text=_("Strength"))
+ sub.prop(light, "falloff_strength", text="Strength")
if light.gather_method == 'RAYTRACE':
col = split.column()
- col.label(text=_("Sampling:"))
+ col.label(text="Sampling:")
col.prop(light, "sample_method", text="")
sub = col.column()
@@ -202,9 +201,9 @@ class WORLD_PT_gather(WorldButtonsPanel, Panel):
if light.gather_method == 'APPROXIMATE':
col = split.column()
- col.label(text=_("Sampling:"))
+ col.label(text="Sampling:")
col.prop(light, "passes")
- col.prop(light, "error_threshold", text=_("Error"))
+ col.prop(light, "error_threshold", text="Error")
col.prop(light, "use_cache")
col.prop(light, "correction")
@@ -258,11 +257,11 @@ class WORLD_PT_stars(WorldButtonsPanel, Panel):
col = split.column()
col.prop(world.star_settings, "size")
- col.prop(world.star_settings, "color_random", text=_("Colors"))
+ col.prop(world.star_settings, "color_random", text="Colors")
col = split.column()
- col.prop(world.star_settings, "distance_min", text=_("Min. Dist"))
- col.prop(world.star_settings, "average_separation", text=_("Separation"))
+ col.prop(world.star_settings, "distance_min", text="Min. Dist")
+ col.prop(world.star_settings, "average_separation", text="Separation")
class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py
index bb0cf6eda2c..a1818c395a2 100644
--- a/release/scripts/startup/bl_ui/space_console.py
+++ b/release/scripts/startup/bl_ui/space_console.py
@@ -18,9 +18,7 @@
# <pep8 compliant>
import bpy
-from bpy.types import Header, Menu, Operator
-from bpy.props import StringProperty
-from blf import gettext as _
+from bpy.types import Header, Menu
class CONSOLE_HT_header(Header):
@@ -34,7 +32,7 @@ class CONSOLE_HT_header(Header):
if context.area.show_menus:
layout.menu("CONSOLE_MT_console")
- layout.operator("console.autocomplete", text=_("Autocomplete"))
+ layout.operator("console.autocomplete", text="Autocomplete")
class CONSOLE_MT_console(Menu):
@@ -80,87 +78,5 @@ def add_scrollback(text, text_type):
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
type=text_type)
-
-class ConsoleExec(Operator):
- '''Execute the current console line as a python expression'''
- bl_idname = "console.execute"
- bl_label = "Console Execute"
-
- def execute(self, context):
- sc = context.space_data
-
- module = __import__("console_" + sc.language)
- execute = getattr(module, "execute", None)
-
- if execute:
- return execute(context)
- else:
- print("Error: bpy.ops.console.execute_" + sc.language + " - not found")
- return {'FINISHED'}
-
-
-class ConsoleAutocomplete(Operator):
- '''Evaluate the namespace up until the cursor and give a list of options or complete the name if there is only one'''
- bl_idname = "console.autocomplete"
- bl_label = "Console Autocomplete"
-
- def execute(self, context):
- sc = context.space_data
- module = __import__("console_" + sc.language)
- autocomplete = getattr(module, "autocomplete", None)
-
- if autocomplete:
- return autocomplete(context)
- else:
- print("Error: bpy.ops.console.autocomplete_" + sc.language + " - not found")
- return {'FINISHED'}
-
-
-class ConsoleBanner(Operator):
- '''Print a message whem the terminal initializes'''
- bl_idname = "console.banner"
- bl_label = "Console Banner"
-
- def execute(self, context):
- sc = context.space_data
-
- # default to python
- if not sc.language:
- sc.language = 'python'
-
- module = __import__("console_" + sc.language)
- banner = getattr(module, "banner", None)
-
- if banner:
- return banner(context)
- else:
- print("Error: bpy.ops.console.banner_" + sc.language + " - not found")
- return {'FINISHED'}
-
-
-class ConsoleLanguage(Operator):
- '''Set the current language for this console'''
- bl_idname = "console.language"
- bl_label = "Console Language"
-
- language = StringProperty(
- name="Language",
- maxlen=32,
- )
-
- def execute(self, context):
- sc = context.space_data
-
- # defailt to python
- sc.language = self.language
-
- bpy.ops.console.banner()
-
- # insert a new blank line
- bpy.ops.console.history_append(text="", current_character=0,
- remove_duplicates=True)
-
- return {'FINISHED'}
-
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 580a4e7f1b6..90dcc99e6d7 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -20,7 +20,6 @@
import bpy
from bpy.types import Header, Menu
-from blf import gettext as _
#######################################
@@ -118,7 +117,7 @@ class DOPESHEET_HT_header(Header):
row.menu("DOPESHEET_MT_gpencil_frame")
layout.prop(st, "mode", text="")
- layout.prop(st.dopesheet, "show_summary", text=_("Summary"))
+ layout.prop(st.dopesheet, "show_summary", text="Summary")
if st.mode == 'DOPESHEET':
dopesheet_filter(layout, context)
@@ -154,9 +153,9 @@ class DOPESHEET_MT_view(Menu):
layout.prop(st, "use_marker_sync")
if st.show_seconds:
- layout.operator("anim.time_toggle", text=_("Show Frames"))
+ layout.operator("anim.time_toggle", text="Show Frames")
else:
- layout.operator("anim.time_toggle", text=_("Show Seconds"))
+ layout.operator("anim.time_toggle", text="Show Seconds")
layout.separator()
layout.operator("anim.previewrange_set")
@@ -181,22 +180,22 @@ class DOPESHEET_MT_select(Menu):
# This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
layout.operator("action.select_all_toggle")
- layout.operator("action.select_all_toggle", text=_("Invert Selection")).invert = True
+ layout.operator("action.select_all_toggle", text="Invert Selection").invert = True
layout.separator()
layout.operator("action.select_border")
- layout.operator("action.select_border", text=_("Border Axis Range")).axis_range = True
+ layout.operator("action.select_border", text="Border Axis Range").axis_range = True
layout.separator()
- layout.operator("action.select_column", text=_("Columns on Selected Keys")).mode = 'KEYS'
- layout.operator("action.select_column", text=_("Column on Current Frame")).mode = 'CFRA'
+ layout.operator("action.select_column", text="Columns on Selected Keys").mode = 'KEYS'
+ layout.operator("action.select_column", text="Column on Current Frame").mode = 'CFRA'
- layout.operator("action.select_column", text=_("Columns on Selected Markers")).mode = 'MARKERS_COLUMN'
- layout.operator("action.select_column", text=_("Between Selected Markers")).mode = 'MARKERS_BETWEEN'
+ layout.operator("action.select_column", text="Columns on Selected Markers").mode = 'MARKERS_COLUMN'
+ layout.operator("action.select_column", text="Between Selected Markers").mode = 'MARKERS_BETWEEN'
layout.separator()
- layout.operator("action.select_leftright", text=_("Before Current Frame")).mode = 'LEFT'
- layout.operator("action.select_leftright", text=_("After Current Frame")).mode = 'RIGHT'
+ layout.operator("action.select_leftright", text="Before Current Frame").mode = 'LEFT'
+ layout.operator("action.select_leftright", text="After Current Frame").mode = 'RIGHT'
# FIXME: grease pencil mode isn't supported for these yet, so skip for that mode only
if context.space_data.mode != 'GPENCIL':
@@ -218,14 +217,14 @@ class DOPESHEET_MT_marker(Menu):
#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.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("marker.rename", text="Rename Marker")
+ layout.operator("marker.move", text="Grab/Move Marker")
if st.mode in {'ACTION', 'SHAPEKEY'} and st.action:
layout.separator()
@@ -255,14 +254,14 @@ class DOPESHEET_MT_channel(Menu):
layout.separator()
layout.operator("anim.channels_editable_toggle")
- layout.operator_menu_enum("action.extrapolation_type", "type", text=_("Extrapolation Mode"))
+ layout.operator_menu_enum("action.extrapolation_type", "type", text="Extrapolation Mode")
layout.separator()
layout.operator("anim.channels_expand")
layout.operator("anim.channels_collapse")
layout.separator()
- layout.operator_menu_enum("anim.channels_move", "direction", text=_("Move..."))
+ layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
layout.separator()
layout.operator("anim.channels_fcurves_enable")
@@ -274,10 +273,10 @@ class DOPESHEET_MT_key(Menu):
def draw(self, context):
layout = self.layout
- layout.menu("DOPESHEET_MT_key_transform", text=_("Transform"))
+ layout.menu("DOPESHEET_MT_key_transform", text="Transform")
- layout.operator_menu_enum("action.snap", "type", text=_("Snap"))
- layout.operator_menu_enum("action.mirror", "type", text=_("Mirror"))
+ layout.operator_menu_enum("action.snap", "type", text="Snap")
+ layout.operator_menu_enum("action.mirror", "type", text="Mirror")
layout.separator()
layout.operator("action.keyframe_insert")
@@ -287,9 +286,9 @@ class DOPESHEET_MT_key(Menu):
layout.operator("action.delete")
layout.separator()
- layout.operator_menu_enum("action.keyframe_type", "type", text=_("Keyframe Type"))
- layout.operator_menu_enum("action.handle_type", "type", text=_("Handle Type"))
- layout.operator_menu_enum("action.interpolation_type", "type", text=_("Interpolation Mode"))
+ layout.operator_menu_enum("action.keyframe_type", "type", text="Keyframe Type")
+ layout.operator_menu_enum("action.handle_type", "type", text="Handle Type")
+ layout.operator_menu_enum("action.interpolation_type", "type", text="Interpolation Mode")
layout.separator()
layout.operator("action.clean")
@@ -306,10 +305,10 @@ class DOPESHEET_MT_key_transform(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("transform.transform", text=_("Grab/Move")).mode = 'TIME_TRANSLATE'
- layout.operator("transform.transform", text=_("Extend")).mode = 'TIME_EXTEND'
- layout.operator("transform.transform", text=_("Slide")).mode = 'TIME_SLIDE'
- layout.operator("transform.transform", text=_("Scale")).mode = 'TIME_SCALE'
+ layout.operator("transform.transform", text="Grab/Move").mode = 'TIME_TRANSLATE'
+ layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
+ layout.operator("transform.transform", text="Slide").mode = 'TIME_SLIDE'
+ layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE'
#######################################
@@ -348,7 +347,7 @@ class DOPESHEET_MT_gpencil_frame(Menu):
def draw(self, context):
layout = self.layout
- layout.menu("DOPESHEET_MT_key_transform", text=_("Transform"))
+ layout.menu("DOPESHEET_MT_key_transform", text="Transform")
#layout.operator_menu_enum("action.snap", "type", text="Snap")
#layout.operator_menu_enum("action.mirror", "type", text="Mirror")
diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py
index fd50d60bd45..d4b8c415a7f 100644
--- a/release/scripts/startup/bl_ui/space_graph.py
+++ b/release/scripts/startup/bl_ui/space_graph.py
@@ -20,7 +20,6 @@
import bpy
from bpy.types import Header, Menu
-from blf import gettext as _
class GRAPH_HT_header(Header):
@@ -83,9 +82,9 @@ class GRAPH_MT_view(Menu):
layout.separator()
if st.show_handles:
- layout.operator("graph.handles_view_toggle", icon='CHECKBOX_HLT', text=_("Show All Handles"))
+ layout.operator("graph.handles_view_toggle", icon='CHECKBOX_HLT', text="Show All Handles")
else:
- layout.operator("graph.handles_view_toggle", icon='CHECKBOX_DEHLT', text=_("Show All Handles"))
+ layout.operator("graph.handles_view_toggle", icon='CHECKBOX_DEHLT', text="Show All Handles")
layout.prop(st, "use_only_selected_curves_handles")
layout.prop(st, "use_only_selected_keyframe_handles")
layout.operator("anim.time_toggle")
@@ -113,23 +112,23 @@ class GRAPH_MT_select(Menu):
# This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
layout.operator("graph.select_all_toggle")
- layout.operator("graph.select_all_toggle", text=_("Invert Selection")).invert = True
+ layout.operator("graph.select_all_toggle", text="Invert Selection").invert = True
layout.separator()
layout.operator("graph.select_border")
- layout.operator("graph.select_border", text=_("Border Axis Range")).axis_range = True
- layout.operator("graph.select_border", text=_("Border (Include Handles)")).include_handles = True
+ layout.operator("graph.select_border", text="Border Axis Range").axis_range = True
+ layout.operator("graph.select_border", text="Border (Include Handles)").include_handles = True
layout.separator()
- layout.operator("graph.select_column", text=_("Columns on Selected Keys")).mode = 'KEYS'
- layout.operator("graph.select_column", text=_("Column on Current Frame")).mode = 'CFRA'
+ layout.operator("graph.select_column", text="Columns on Selected Keys").mode = 'KEYS'
+ layout.operator("graph.select_column", text="Column on Current Frame").mode = 'CFRA'
- layout.operator("graph.select_column", text=_("Columns on Selected Markers")).mode = 'MARKERS_COLUMN'
- layout.operator("graph.select_column", text=_("Between Selected Markers")).mode = 'MARKERS_BETWEEN'
+ layout.operator("graph.select_column", text="Columns on Selected Markers").mode = 'MARKERS_COLUMN'
+ layout.operator("graph.select_column", text="Between Selected Markers").mode = 'MARKERS_BETWEEN'
layout.separator()
- layout.operator("graph.select_leftright", text=_("Before Current Frame")).mode = 'LEFT'
- layout.operator("graph.select_leftright", text=_("After Current Frame")).mode = 'RIGHT'
+ layout.operator("graph.select_leftright", text="Before Current Frame").mode = 'LEFT'
+ layout.operator("graph.select_leftright", text="After Current Frame").mode = 'RIGHT'
layout.separator()
layout.operator("graph.select_more")
@@ -147,14 +146,14 @@ class GRAPH_MT_marker(Menu):
#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.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("marker.rename", text="Rename Marker")
+ layout.operator("marker.move", text="Grab/Move Marker")
# TODO: pose markers for action edit mode only?
@@ -177,14 +176,14 @@ class GRAPH_MT_channel(Menu):
layout.separator()
layout.operator("anim.channels_editable_toggle")
layout.operator("anim.channels_visibility_set")
- layout.operator_menu_enum("graph.extrapolation_type", "type", text=_("Extrapolation Mode"))
+ layout.operator_menu_enum("graph.extrapolation_type", "type", text="Extrapolation Mode")
layout.separator()
layout.operator("anim.channels_expand")
layout.operator("anim.channels_collapse")
layout.separator()
- layout.operator_menu_enum("anim.channels_move", "direction", text=_("Move..."))
+ layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
layout.separator()
layout.operator("anim.channels_fcurves_enable")
@@ -196,10 +195,10 @@ class GRAPH_MT_key(Menu):
def draw(self, context):
layout = self.layout
- layout.menu("GRAPH_MT_key_transform", text=_("Transform"))
+ layout.menu("GRAPH_MT_key_transform", text="Transform")
- layout.operator_menu_enum("graph.snap", "type", text=_("Snap"))
- layout.operator_menu_enum("graph.mirror", "type", text=_("Mirror"))
+ layout.operator_menu_enum("graph.snap", "type", text="Snap")
+ layout.operator_menu_enum("graph.mirror", "type", text="Mirror")
layout.separator()
layout.operator("graph.keyframe_insert")
@@ -211,8 +210,8 @@ class GRAPH_MT_key(Menu):
layout.operator("graph.delete")
layout.separator()
- layout.operator_menu_enum("graph.handle_type", "type", text=_("Handle Type"))
- layout.operator_menu_enum("graph.interpolation_type", "type", text=_("Interpolation Mode"))
+ layout.operator_menu_enum("graph.handle_type", "type", text="Handle Type")
+ layout.operator_menu_enum("graph.interpolation_type", "type", text="Interpolation Mode")
layout.separator()
layout.operator("graph.clean")
@@ -225,7 +224,7 @@ class GRAPH_MT_key(Menu):
layout.operator("graph.paste")
layout.separator()
- layout.operator("graph.euler_filter", text=_("Discontinuity (Euler) Filter"))
+ layout.operator("graph.euler_filter", text="Discontinuity (Euler) Filter")
class GRAPH_MT_key_transform(Menu):
@@ -234,10 +233,10 @@ class GRAPH_MT_key_transform(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("transform.translate", text=_("Grab/Move"))
- layout.operator("transform.transform", text=_("Extend")).mode = 'TIME_EXTEND'
- layout.operator("transform.rotate", text=_("Rotate"))
- layout.operator("transform.resize", text=_("Scale"))
+ layout.operator("transform.translate", text="Grab/Move")
+ layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
+ layout.operator("transform.rotate", text="Rotate")
+ layout.operator("transform.resize", text="Scale")
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index f5be25d14f6..051854a28f1 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
-from blf import gettext as _
class BrushButtonsPanel():
@@ -65,8 +64,7 @@ class IMAGE_MT_view(Menu):
ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]]
for a, b in ratios:
- text = _("Zoom") + " %d:%d" % (a, b)
- layout.operator("image.view_zoom_ratio", text=text).ratio = a / b
+ layout.operator("image.view_zoom_ratio", text="Zoom" + " %d:%d" % (a, b)).ratio = a / b
layout.separator()
@@ -93,7 +91,7 @@ class IMAGE_MT_select(Menu):
layout.separator()
layout.operator("uv.select_all")
- layout.operator("uv.select_all", text=_("Inverse")).action = 'INVERT'
+ layout.operator("uv.select_all", text="Inverse").action = 'INVERT'
layout.operator("uv.unlink_selected")
layout.separator()
@@ -123,12 +121,12 @@ class IMAGE_MT_image(Menu):
layout.operator("image.save")
layout.operator("image.save_as")
- layout.operator("image.save_as", text=_("Save a Copy")).copy = True
+ layout.operator("image.save_as", text="Save a Copy").copy = True
if ima.source == 'SEQUENCE':
layout.operator("image.save_sequence")
- layout.operator("image.external_edit", _("Edit Externally"))
+ layout.operator("image.external_edit", "Edit Externally")
layout.separator()
@@ -146,7 +144,7 @@ class IMAGE_MT_image(Menu):
# this could be done in operator poll too
if ima.is_dirty:
if ima.source in {'FILE', 'GENERATED'} and ima.type != 'MULTILAYER':
- layout.operator("image.pack", text=_("Pack As PNG")).as_png = True
+ layout.operator("image.pack", text="Pack As PNG").as_png = True
layout.separator()
@@ -159,23 +157,23 @@ class IMAGE_MT_image_invert(Menu):
def draw(self, context):
layout = self.layout
- op = layout.operator("image.invert", text=_("Invert Image Colors"))
+ op = layout.operator("image.invert", text="Invert Image Colors")
op.invert_r = True
op.invert_g = True
op.invert_b = True
layout.separator()
- op = layout.operator("image.invert", text=_("Invert Red Channel"))
+ op = layout.operator("image.invert", text="Invert Red Channel")
op.invert_r = True
- op = layout.operator("image.invert", text=_("Invert Green Channel"))
+ op = layout.operator("image.invert", text="Invert Green Channel")
op.invert_g = True
- op = layout.operator("image.invert", text=_("Invert Blue Channel"))
+ op = layout.operator("image.invert", text="Invert Blue Channel")
op.invert_b = True
- op = layout.operator("image.invert", text=_("Invert Alpha Channel"))
+ op = layout.operator("image.invert", text="Invert Alpha Channel")
op.invert_a = True
@@ -186,8 +184,8 @@ class IMAGE_MT_uvs_showhide(Menu):
layout = self.layout
layout.operator("uv.reveal")
- layout.operator("uv.hide", text=_("Hide Selected"))
- layout.operator("uv.hide", text=_("Hide Unselected")).unselected = True
+ layout.operator("uv.hide", text="Hide Selected")
+ layout.operator("uv.hide", text="Hide Unselected").unselected = True
class IMAGE_MT_uvs_transform(Menu):
@@ -212,14 +210,14 @@ class IMAGE_MT_uvs_snap(Menu):
layout = self.layout
layout.operator_context = 'EXEC_REGION_WIN'
- layout.operator("uv.snap_selected", text=_("Selected to Pixels")).target = 'PIXELS'
- layout.operator("uv.snap_selected", text=_("Selected to Cursor")).target = 'CURSOR'
- layout.operator("uv.snap_selected", text=_("Selected to Adjacent Unselected")).target = 'ADJACENT_UNSELECTED'
+ layout.operator("uv.snap_selected", text="Selected to Pixels").target = 'PIXELS'
+ layout.operator("uv.snap_selected", text="Selected to Cursor").target = 'CURSOR'
+ layout.operator("uv.snap_selected", text="Selected to Adjacent Unselected").target = 'ADJACENT_UNSELECTED'
layout.separator()
- layout.operator("uv.snap_cursor", text=_("Cursor to Pixels")).target = 'PIXELS'
- layout.operator("uv.snap_cursor", text=_("Cursor to Selected")).target = 'SELECTED'
+ layout.operator("uv.snap_cursor", text="Cursor to Pixels").target = 'PIXELS'
+ layout.operator("uv.snap_cursor", text="Cursor to Selected").target = 'SELECTED'
class IMAGE_MT_uvs_mirror(Menu):
@@ -229,8 +227,8 @@ class IMAGE_MT_uvs_mirror(Menu):
layout = self.layout
layout.operator_context = 'EXEC_REGION_WIN'
- layout.operator("transform.mirror", text=_("X Axis")).constraint_axis[0] = True
- layout.operator("transform.mirror", text=_("Y Axis")).constraint_axis[1] = True
+ layout.operator("transform.mirror", text="X Axis").constraint_axis[0] = True
+ layout.operator("transform.mirror", text="Y Axis").constraint_axis[1] = True
class IMAGE_MT_uvs_weldalign(Menu):
@@ -260,7 +258,7 @@ class IMAGE_MT_uvs(Menu):
layout.prop(uv, "use_live_unwrap")
layout.operator("uv.unwrap")
- layout.operator("uv.pin", text=_("Unpin")).clear = True
+ layout.operator("uv.pin", text="Unpin").clear = True
layout.operator("uv.pin")
layout.separator()
@@ -300,32 +298,32 @@ class IMAGE_MT_uvs_select_mode(Menu):
# do smart things depending on whether uv_select_sync is on
if toolsettings.use_uv_select_sync:
- prop = layout.operator("wm.context_set_value", text=_("Vertex"), icon='VERTEXSEL')
+ prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
prop.value = "(True, False, False)"
prop.data_path = "tool_settings.mesh_select_mode"
- prop = layout.operator("wm.context_set_value", text=_("Edge"), icon='EDGESEL')
+ prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
prop.value = "(False, True, False)"
prop.data_path = "tool_settings.mesh_select_mode"
- prop = layout.operator("wm.context_set_value", text=_("Face"), icon='FACESEL')
+ prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
prop.value = "(False, False, True)"
prop.data_path = "tool_settings.mesh_select_mode"
else:
- prop = layout.operator("wm.context_set_string", text=_("Vertex"), icon='UV_VERTEXSEL')
+ prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
prop.value = "VERTEX"
prop.data_path = "tool_settings.uv_select_mode"
- prop = layout.operator("wm.context_set_string", text=_("Edge"), icon='UV_EDGESEL')
+ prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
prop.value = "EDGE"
prop.data_path = "tool_settings.uv_select_mode"
- prop = layout.operator("wm.context_set_string", text=_("Face"), icon='UV_FACESEL')
+ prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
prop.value = "FACE"
prop.data_path = "tool_settings.uv_select_mode"
- prop = layout.operator("wm.context_set_string", text=_("Island"), icon='UV_ISLANDSEL')
+ prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
prop.value = "ISLAND"
prop.data_path = "tool_settings.uv_select_mode"
@@ -357,9 +355,9 @@ class IMAGE_HT_header(Header):
sub.menu("IMAGE_MT_select")
if ima and ima.is_dirty:
- sub.menu("IMAGE_MT_image", text=_("Image*"))
+ sub.menu("IMAGE_MT_image", text="Image*")
else:
- sub.menu("IMAGE_MT_image", text=_("Image"))
+ sub.menu("IMAGE_MT_image", text="Image")
if show_uvedit:
sub.menu("IMAGE_MT_uvs")
@@ -597,22 +595,22 @@ class IMAGE_PT_view_properties(Panel):
col = split.column()
if ima:
- col.prop(ima, "display_aspect", text=_("Aspect Ratio"))
+ col.prop(ima, "display_aspect", text="Aspect Ratio")
col = split.column()
- col.label(text=_("Coordinates:"))
- col.prop(sima, "show_repeat", text=_("Repeat"))
+ col.label(text="Coordinates:")
+ col.prop(sima, "show_repeat", text="Repeat")
if show_uvedit:
- col.prop(uvedit, "show_normalized_coords", text=_("Normalized"))
+ col.prop(uvedit, "show_normalized_coords", text="Normalized")
elif show_uvedit:
- col.label(text=_("Coordinates:"))
- col.prop(uvedit, "show_normalized_coords", text=_("Normalized"))
+ col.label(text="Coordinates:")
+ col.prop(uvedit, "show_normalized_coords", text="Normalized")
if show_uvedit:
col = layout.column()
- col.label(_("Cursor Location:"))
+ col.label("Cursor Location:")
col.row().prop(uvedit, "cursor_location", text="")
col.separator()
@@ -624,11 +622,11 @@ class IMAGE_PT_view_properties(Panel):
col = split.column()
col.prop(uvedit, "show_faces")
- col.prop(uvedit, "show_smooth_edges", text=_("Smooth"))
- col.prop(uvedit, "show_modified_edges", text=_("Modified"))
+ col.prop(uvedit, "show_smooth_edges", text="Smooth")
+ col.prop(uvedit, "show_modified_edges", text="Modified")
col = split.column()
- col.prop(uvedit, "show_stretch", text=_("Stretch"))
+ col.prop(uvedit, "show_stretch", text="Stretch")
sub = col.column()
sub.active = uvedit.show_stretch
sub.row().prop(uvedit, "draw_stretch_type", expand=True)
@@ -670,12 +668,12 @@ class IMAGE_PT_paint(Panel):
row.prop(brush, "jitter", slider=True)
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
- col.prop(brush, "blend", text=_("Blend"))
+ col.prop(brush, "blend", text="Blend")
if brush.image_tool == 'CLONE':
col.separator()
- col.prop(brush, "clone_image", text=_("Image"))
- col.prop(brush, "clone_alpha", text=_("Alpha"))
+ col.prop(brush, "clone_image", text="Image")
+ col.prop(brush, "clone_alpha", text="Alpha")
class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
@@ -729,7 +727,7 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
layout.prop(brush, "use_space")
row = layout.row(align=True)
row.active = brush.use_space
- row.prop(brush, "spacing", text=_("Distance"), slider=True)
+ row.prop(brush, "spacing", text="Distance", slider=True)
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
layout.prop(brush, "use_wrap")
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 3e6abaa8ea3..2d22a398624 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -18,8 +18,7 @@
# <pep8 compliant>
import bpy
-from bpy.types import Header, Menu, Operator
-from blf import gettext as _
+from bpy.types import Header, Menu
class INFO_HT_header(Header):
@@ -46,7 +45,7 @@ class INFO_HT_header(Header):
sub.menu("INFO_MT_help")
if window.screen.show_fullscreen:
- layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text=_("Back to Previous"))
+ layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
layout.separator()
else:
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
@@ -74,11 +73,11 @@ class INFO_HT_header(Header):
"""
sinfo = context.space_data
row = layout.row(align=True)
- row.prop(sinfo, "show_report_debug", text=_("Debug"))
- row.prop(sinfo, "show_report_info", text=_("Info"))
- row.prop(sinfo, "show_report_operator", text=_("Operators"))
- row.prop(sinfo, "show_report_warning", text=_("Warnings"))
- row.prop(sinfo, "show_report_error", text=_("Errors"))
+ row.prop(sinfo, "show_report_debug", text="Debug")
+ row.prop(sinfo, "show_report_info", text="Info")
+ row.prop(sinfo, "show_report_operator", text="Operators")
+ row.prop(sinfo, "show_report_warning", text="Warnings")
+ row.prop(sinfo, "show_report_error", text="Errors")
row = layout.row()
row.enabled = sinfo.show_report_operator
@@ -107,25 +106,25 @@ class INFO_MT_file(Menu):
layout = self.layout
layout.operator_context = 'EXEC_AREA'
- layout.operator("wm.read_homefile", text=_("New"), icon='NEW')
+ layout.operator("wm.read_homefile", text="New", icon='NEW')
layout.operator_context = 'INVOKE_AREA'
- layout.operator("wm.open_mainfile", text=_("Open..."), icon='FILE_FOLDER')
+ layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
layout.menu("INFO_MT_file_open_recent")
layout.operator("wm.recover_last_session", icon='RECOVER_LAST')
- layout.operator("wm.recover_auto_save", text=_("Recover Auto Save..."))
+ layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
layout.separator()
layout.operator_context = 'INVOKE_AREA'
- layout.operator("wm.save_mainfile", text=_("Save"), icon='FILE_TICK').check_existing = False
+ layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK').check_existing = False
layout.operator_context = 'INVOKE_AREA'
- layout.operator("wm.save_as_mainfile", text=_("Save As..."))
+ layout.operator("wm.save_as_mainfile", text="Save As...")
layout.operator_context = 'INVOKE_AREA'
- layout.operator("wm.save_as_mainfile", text=_("Save Copy...")).copy = True
+ layout.operator("wm.save_as_mainfile", text="Save Copy...").copy = True
layout.separator()
- layout.operator("screen.userpref_show", text=_("User Preferences..."), icon='PREFERENCES')
+ layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
layout.operator_context = 'EXEC_AREA'
layout.operator("wm.save_homefile")
@@ -134,8 +133,8 @@ class INFO_MT_file(Menu):
layout.separator()
layout.operator_context = 'INVOKE_AREA'
- layout.operator("wm.link_append", text=_("Link"))
- props = layout.operator("wm.link_append", text=_("Append"))
+ layout.operator("wm.link_append", text="Link")
+ props = layout.operator("wm.link_append", text="Append")
props.link = False
props.instance_groups = False
@@ -151,7 +150,7 @@ class INFO_MT_file(Menu):
layout.separator()
layout.operator_context = 'EXEC_AREA'
- layout.operator("wm.quit_blender", text=_("Quit"), icon='QUIT')
+ layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
class INFO_MT_file_import(Menu):
@@ -178,8 +177,8 @@ class INFO_MT_file_external_data(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("file.pack_all", text=_("Pack into .blend file"))
- layout.operator("file.unpack_all", text=_("Unpack into Files"))
+ layout.operator("file.pack_all", text="Pack into .blend file")
+ layout.operator("file.unpack_all", text="Unpack into Files")
layout.separator()
@@ -197,17 +196,17 @@ class INFO_MT_mesh_add(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text=_("Plane"))
- layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text=_("Cube"))
- layout.operator("mesh.primitive_circle_add", icon='MESH_CIRCLE', text=_("Circle"))
- layout.operator("mesh.primitive_uv_sphere_add", icon='MESH_UVSPHERE', text=_("UV Sphere"))
- layout.operator("mesh.primitive_ico_sphere_add", icon='MESH_ICOSPHERE', text=_("Icosphere"))
- layout.operator("mesh.primitive_cylinder_add", icon='MESH_CYLINDER', text=_("Cylinder"))
- layout.operator("mesh.primitive_cone_add", icon='MESH_CONE', text=_("Cone"))
+ layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane")
+ layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube")
+ layout.operator("mesh.primitive_circle_add", icon='MESH_CIRCLE', text="Circle")
+ layout.operator("mesh.primitive_uv_sphere_add", icon='MESH_UVSPHERE', text="UV Sphere")
+ layout.operator("mesh.primitive_ico_sphere_add", icon='MESH_ICOSPHERE', text="Icosphere")
+ layout.operator("mesh.primitive_cylinder_add", icon='MESH_CYLINDER', text="Cylinder")
+ layout.operator("mesh.primitive_cone_add", icon='MESH_CONE', text="Cone")
layout.separator()
- layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text=_("Grid"))
- layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text=_("Monkey"))
- layout.operator("mesh.primitive_torus_add", text=_("Torus"), icon='MESH_TORUS')
+ layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid")
+ layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey")
+ layout.operator("mesh.primitive_torus_add", text="Torus", icon='MESH_TORUS')
class INFO_MT_curve_add(Menu):
@@ -218,11 +217,11 @@ class INFO_MT_curve_add(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text=_("Bezier"))
- layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text=_("Circle"))
- layout.operator("curve.primitive_nurbs_curve_add", icon='CURVE_NCURVE', text=_("Nurbs Curve"))
- layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text=_("Nurbs Circle"))
- layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text=_("Path"))
+ layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
+ layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle")
+ layout.operator("curve.primitive_nurbs_curve_add", icon='CURVE_NCURVE', text="Nurbs Curve")
+ layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
+ layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
class INFO_MT_edit_curve_add(Menu):
@@ -249,12 +248,12 @@ class INFO_MT_surface_add(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text=_("NURBS Curve"))
- layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text=_("NURBS Circle"))
- layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text=_("NURBS Surface"))
- layout.operator("surface.primitive_nurbs_surface_cylinder_add", icon='SURFACE_NCYLINDER', text=_("NURBS Cylinder"))
- layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text=_("NURBS Sphere"))
- layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text=_("NURBS Torus"))
+ layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
+ layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
+ layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text="NURBS Surface")
+ layout.operator("surface.primitive_nurbs_surface_cylinder_add", icon='SURFACE_NCYLINDER', text="NURBS Cylinder")
+ layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
+ layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus")
class INFO_MT_armature_add(Menu):
@@ -265,7 +264,7 @@ class INFO_MT_armature_add(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("object.armature_add", text=_("Single Bone"), icon='BONE_DATA')
+ layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
class INFO_MT_add(Menu):
@@ -276,39 +275,39 @@ class INFO_MT_add(Menu):
layout.operator_context = 'EXEC_SCREEN'
- #layout.operator_menu_enum("object.mesh_add", "type", text=_("Mesh"), icon='OUTLINER_OB_MESH')
+ #layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
- #layout.operator_menu_enum("object.curve_add", "type", text=_("Curve"), icon='OUTLINER_OB_CURVE')
+ #layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
- #layout.operator_menu_enum("object.surface_add", "type", text=_("Surface"), icon='OUTLINER_OB_SURFACE')
+ #layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
- layout.operator_menu_enum("object.metaball_add", "type", text=_("Metaball"), icon='OUTLINER_OB_META')
+ layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("object.text_add", text=_("Text"), icon='OUTLINER_OB_FONT')
+ layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
layout.separator()
layout.menu("INFO_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
- layout.operator("object.add", text=_("Lattice"), icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
- layout.operator("object.add", text=_("Empty"), icon='OUTLINER_OB_EMPTY').type = 'EMPTY'
+ layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
+ layout.operator("object.add", text="Empty", icon='OUTLINER_OB_EMPTY').type = 'EMPTY'
layout.separator()
- layout.operator("object.speaker_add", text=_("Speaker"), icon='OUTLINER_OB_SPEAKER')
+ layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
layout.separator()
- layout.operator("object.camera_add", text=_("Camera"), icon='OUTLINER_OB_CAMERA')
+ layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
layout.operator_context = 'EXEC_SCREEN'
- layout.operator_menu_enum("object.lamp_add", "type", text=_("Lamp"), icon='OUTLINER_OB_LAMP')
+ layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
layout.separator()
- layout.operator_menu_enum("object.effector_add", "type", text=_("Force Field"), icon='OUTLINER_OB_EMPTY')
+ layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY')
layout.separator()
if(len(bpy.data.groups) > 10):
layout.operator_context = 'INVOKE_DEFAULT'
- layout.operator("object.group_instance_add", text=_("Group Instance..."), icon='OUTLINER_OB_EMPTY')
+ layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY')
else:
- layout.operator_menu_enum("object.group_instance_add", "group", text=_("Group Instance"), icon='OUTLINER_OB_EMPTY')
+ layout.operator_menu_enum("object.group_instance_add", "group", text="Group Instance", icon='OUTLINER_OB_EMPTY')
class INFO_MT_game(Menu):
@@ -338,13 +337,13 @@ class INFO_MT_render(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("render.render", text=_("Render Image"), icon='RENDER_STILL')
- layout.operator("render.render", text=_("Render Animation"), icon='RENDER_ANIMATION').animation = True
+ layout.operator("render.render", text="Render Image", icon='RENDER_STILL')
+ layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION').animation = True
layout.separator()
- layout.operator("render.opengl", text=_("OpenGL Render Image"))
- layout.operator("render.opengl", text=_("OpenGL Render Animation")).animation = True
+ layout.operator("render.opengl", text="OpenGL Render Image")
+ layout.operator("render.opengl", text="OpenGL Render Animation").animation = True
layout.separator()
@@ -360,58 +359,30 @@ class INFO_MT_help(Menu):
layout = self.layout
- layout.operator("wm.url_open", text=_("Manual"), icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual'
- layout.operator("wm.url_open", text=_("Release Log"), icon='URL').url = 'http://www.blender.org/development/release-logs/blender-259/'
+ layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:Manual'
+ layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-260/'
layout.separator()
- layout.operator("wm.url_open", text=_("Blender Website"), icon='URL').url = 'http://www.blender.org/'
- layout.operator("wm.url_open", text=_("Blender e-Shop"), icon='URL').url = 'http://www.blender.org/e-shop'
- layout.operator("wm.url_open", text=_("Developer Community"), icon='URL').url = 'http://www.blender.org/community/get-involved/'
- layout.operator("wm.url_open", text=_("User Community"), icon='URL').url = 'http://www.blender.org/community/user-community/'
+ layout.operator("wm.url_open", text="Blender Website", icon='URL').url = 'http://www.blender.org/'
+ layout.operator("wm.url_open", text="Blender e-Shop", icon='URL').url = 'http://www.blender.org/e-shop'
+ layout.operator("wm.url_open", text="Developer Community", icon='URL').url = 'http://www.blender.org/community/get-involved/'
+ layout.operator("wm.url_open", text="User Community", icon='URL').url = 'http://www.blender.org/community/user-community/'
layout.separator()
- layout.operator("wm.url_open", text=_("Report a Bug"), icon='URL').url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
+ layout.operator("wm.url_open", text="Report a Bug", icon='URL').url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
layout.separator()
- layout.operator("wm.url_open", text=_("Python API Reference"), icon='URL').url = bpy.types.WM_OT_doc_view._prefix
- layout.operator("help.operator_cheat_sheet", icon='TEXT')
+ layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = bpy.types.WM_OT_doc_view._prefix
+ layout.operator("wm.operator_cheat_sheet", icon='TEXT')
layout.operator("wm.sysinfo", icon='TEXT')
layout.separator()
if sys.platform[:3] == "win":
layout.operator("wm.console_toggle", icon='CONSOLE')
layout.separator()
- layout.operator("anim.update_data_paths", text=_("FCurve/Driver Version fix"), icon='HELP')
+ layout.operator("anim.update_data_paths", text="FCurve/Driver Version fix", icon='HELP')
layout.operator("logic.texface_convert", text="TexFace to Material Convert", icon='GAME')
layout.separator()
layout.operator("wm.splash", icon='BLENDER')
-
-# Help operators
-
-
-class HELP_OT_operator_cheat_sheet(Operator):
- bl_idname = "help.operator_cheat_sheet"
- bl_label = "Operator Cheat Sheet"
-
- def execute(self, context):
- op_strings = []
- tot = 0
- for op_module_name in dir(bpy.ops):
- op_module = getattr(bpy.ops, op_module_name)
- for op_submodule_name in dir(op_module):
- op = getattr(op_module, op_submodule_name)
- text = repr(op)
- if text.split("\n")[-1].startswith('bpy.ops.'):
- op_strings.append(text)
- tot += 1
-
- op_strings.append('')
-
- textblock = bpy.data.texts.new("OperatorList.txt")
- textblock.write('# %d Operators\n\n' % tot)
- textblock.write('\n'.join(op_strings))
- self.report({'INFO'}, "See OperatorList.txt textblock")
- return {'FINISHED'}
-
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_logic.py b/release/scripts/startup/bl_ui/space_logic.py
index b1149913d17..869a91124d3 100644
--- a/release/scripts/startup/bl_ui/space_logic.py
+++ b/release/scripts/startup/bl_ui/space_logic.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
-from blf import gettext as _
class LOGIC_PT_properties(Panel):
@@ -38,7 +37,7 @@ class LOGIC_PT_properties(Panel):
ob = context.active_object
game = ob.game
- layout.operator("object.game_property_new", text=_("Add Game Property"), icon='ZOOMIN')
+ layout.operator("object.game_property_new", text="Add Game Property", icon='ZOOMIN')
for i, prop in enumerate(game.properties):
@@ -57,9 +56,9 @@ class LOGIC_MT_logicbricks_add(Menu):
def draw(self, context):
layout = self.layout
- layout.operator_menu_enum("logic.sensor_add", "type", text=_("Sensor"))
- layout.operator_menu_enum("logic.controller_add", "type", text=_("Controller"))
- layout.operator_menu_enum("logic.actuator_add", "type", text=_("Actuator"))
+ layout.operator_menu_enum("logic.sensor_add", "type", text="Sensor")
+ layout.operator_menu_enum("logic.controller_add", "type", text="Controller")
+ layout.operator_menu_enum("logic.actuator_add", "type", text="Actuator")
class LOGIC_HT_header(Header):
diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py
index 8a4b0a61291..ffead81c507 100644
--- a/release/scripts/startup/bl_ui/space_nla.py
+++ b/release/scripts/startup/bl_ui/space_nla.py
@@ -20,7 +20,6 @@
import bpy
from bpy.types import Header, Menu
-from blf import gettext as _
class NLA_HT_header(Header):
@@ -63,7 +62,7 @@ class NLA_MT_view(Menu):
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_frame_indicator")
- layout.operator("anim.time_toggle", text=_("Show Frames") if st.show_seconds else _("Show Seconds"))
+ layout.operator("anim.time_toggle", text="Show Frames" if st.show_seconds else "Show Seconds")
layout.prop(st, "show_strip_curves")
@@ -88,33 +87,33 @@ class NLA_MT_select(Menu):
# This is a bit misleading as the operator's default text is "Select All" while it actually *toggles* All/None
layout.operator("nla.select_all_toggle")
- layout.operator("nla.select_all_toggle", text=_("Invert Selection")).invert = True
+ layout.operator("nla.select_all_toggle", text="Invert Selection").invert = True
layout.separator()
layout.operator("nla.select_border")
- layout.operator("nla.select_border", text=_("Border Axis Range")).axis_range = True
+ layout.operator("nla.select_border", text="Border Axis Range").axis_range = True
layout.separator()
- layout.operator("nla.select_leftright", text=_("Before Current Frame")).mode = 'LEFT'
- layout.operator("nla.select_leftright", text=_("After Current Frame")).mode = 'RIGHT'
+ layout.operator("nla.select_leftright", text="Before Current Frame").mode = 'LEFT'
+ layout.operator("nla.select_leftright", text="After Current Frame").mode = 'RIGHT'
class NLA_MT_marker(Menu):
- bl_label = _("Marker")
+ bl_label = "Marker"
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.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("marker.rename", text="Rename Marker")
+ layout.operator("marker.move", text="Grab/Move Marker")
class NLA_MT_edit(Menu):
@@ -125,9 +124,9 @@ class NLA_MT_edit(Menu):
scene = context.scene
- layout.menu("NLA_MT_edit_transform", text=_("Transform"))
+ layout.menu("NLA_MT_edit_transform", text="Transform")
- layout.operator_menu_enum("nla.snap", "type", text=_("Snap"))
+ layout.operator_menu_enum("nla.snap", "type", text="Snap")
layout.separator()
layout.operator("nla.duplicate")
@@ -149,14 +148,14 @@ class NLA_MT_edit(Menu):
# TODO: this really belongs more in a "channel" (or better, "track") menu
layout.separator()
- layout.operator_menu_enum("anim.channels_move", "direction", text=_("Track Ordering..."))
+ layout.operator_menu_enum("anim.channels_move", "direction", text="Track Ordering...")
layout.separator()
# TODO: names of these tools for 'tweakmode' need changing?
if scene.is_nla_tweakmode:
- layout.operator("nla.tweakmode_exit", text=_("Stop Tweaking Strip Actions"))
+ layout.operator("nla.tweakmode_exit", text="Stop Tweaking Strip Actions")
else:
- layout.operator("nla.tweakmode_enter", text=_("Start Tweaking Strip Actions"))
+ layout.operator("nla.tweakmode_enter", text="Start Tweaking Strip Actions")
class NLA_MT_add(Menu):
@@ -175,7 +174,7 @@ class NLA_MT_add(Menu):
layout.separator()
layout.operator("nla.tracks_add")
- layout.operator("nla.tracks_add", text=_("Add Tracks Above Selected")).above_selected = True
+ layout.operator("nla.tracks_add", text="Add Tracks Above Selected").above_selected = True
class NLA_MT_edit_transform(Menu):
@@ -184,9 +183,9 @@ class NLA_MT_edit_transform(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("transform.translate", text=_("Grab/Move"))
- layout.operator("transform.transform", text=_("Extend")).mode = 'TIME_EXTEND'
- layout.operator("transform.transform", text=_("Scale")).mode = 'TIME_SCALE'
+ layout.operator("transform.translate", text="Grab/Move")
+ layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
+ layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE'
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 2cbb75f615b..d46ca25c57d 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
-from blf import gettext as _
class NODE_HT_header(Header):
@@ -65,7 +64,7 @@ class NODE_HT_header(Header):
elif snode.tree_type == 'COMPOSITING':
layout.prop(snode_id, "use_nodes")
- layout.prop(snode_id.render, "use_free_unused_nodes", text=_("Free Unused"))
+ layout.prop(snode_id.render, "use_free_unused_nodes", text="Free Unused")
layout.prop(snode, "show_backdrop")
if snode.show_backdrop:
row = layout.row(align=True)
@@ -96,9 +95,9 @@ class NODE_MT_view(Menu):
if context.space_data.show_backdrop:
layout.separator()
- layout.operator("node.backimage_move", text=_("Backdrop move"))
- layout.operator("node.backimage_zoom", text=_("Backdrop zoom in")).factor = 1.2
- layout.operator("node.backimage_zoom", text=_("Backdrop zoom out")).factor = 0.833
+ layout.operator("node.backimage_move", text="Backdrop move")
+ layout.operator("node.backimage_zoom", text="Backdrop zoom in").factor = 1.2
+ layout.operator("node.backimage_zoom", text="Backdrop zoom out").factor = 0.833
layout.separator()
@@ -141,7 +140,7 @@ class NODE_MT_node(Menu):
layout.separator()
layout.operator("node.link_make")
- layout.operator("node.link_make", text=_("Make and Replace Links")).replace = True
+ layout.operator("node.link_make", text="Make and Replace Links").replace = True
layout.operator("node.links_cut")
layout.separator()
@@ -184,13 +183,13 @@ class NODE_PT_properties(Panel):
snode = context.space_data
layout.active = snode.show_backdrop
layout.prop(snode, "backdrop_channels", text="")
- layout.prop(snode, "backdrop_zoom", text=_("Zoom"))
+ layout.prop(snode, "backdrop_zoom", text="Zoom")
col = layout.column(align=True)
- col.label(text=_("Offset:"))
+ col.label(text="Offset:")
col.prop(snode, "backdrop_x", text="X")
col.prop(snode, "backdrop_y", text="Y")
- col.operator("node.backimage_move", text=_("Move"))
+ col.operator("node.backimage_move", text="Move")
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index a9a5eae3179..b03e7b8c59c 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
-from blf import gettext as _
def act_strip(context):
@@ -65,9 +64,9 @@ class SEQUENCER_HT_header(Header):
elif st.view_type == 'SEQUENCER_PREVIEW':
layout.separator()
layout.operator("sequencer.refresh_all")
- layout.prop(st, "display_channel", text=_("Channel"))
+ layout.prop(st, "display_channel", text="Channel")
else:
- layout.prop(st, "display_channel", text=_("Channel"))
+ layout.prop(st, "display_channel", text="Channel")
ed = context.scene.sequence_editor
if ed:
@@ -102,11 +101,11 @@ class SEQUENCER_MT_view(Menu):
layout.separator()
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
- layout.operator("sequencer.view_all", text=_('View all Sequences'))
+ layout.operator("sequencer.view_all", text="View all Sequences")
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
- layout.operator("sequencer.view_all_preview", text=_('Fit preview in window'))
- layout.operator("sequencer.view_zoom_ratio", text=_('Show preview 1:1')).ratio = 1.0
+ layout.operator("sequencer.view_all_preview", text="Fit preview in window")
+ layout.operator("sequencer.view_zoom_ratio", text="Show preview 1:1").ratio = 1.0
layout.operator_context = 'INVOKE_DEFAULT'
# # XXX, invokes in the header view
@@ -115,9 +114,9 @@ class SEQUENCER_MT_view(Menu):
layout.operator("sequencer.view_selected")
if st.show_frames:
- layout.operator("anim.time_toggle", text=_("Show Seconds"))
+ layout.operator("anim.time_toggle", text="Show Seconds")
else:
- layout.operator("anim.time_toggle", text=_("Show Frames"))
+ layout.operator("anim.time_toggle", text="Show Frames")
layout.prop(st, "show_frame_indicator")
if st.display_mode == 'IMAGE':
@@ -139,13 +138,14 @@ class SEQUENCER_MT_select(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("sequencer.select_active_side", text=_("Strips to the Left")).side = 'LEFT'
- layout.operator("sequencer.select_active_side", text=_("Strips to the Right")).side = 'RIGHT'
+ layout.operator("sequencer.select_active_side", text="Strips to the Left").side = 'LEFT'
+ layout.operator("sequencer.select_active_side", text="Strips to the Right").side = 'RIGHT'
layout.separator()
- layout.operator("sequencer.select_handles", text=_("Surrounding Handles")).side = 'BOTH'
- layout.operator("sequencer.select_handles", text=_("Left Handle")).side = 'LEFT'
- layout.operator("sequencer.select_handles", text=_("Right Handle")).side = 'RIGHT'
+ layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
+ layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
+ layout.operator("sequencer.select_handles", text="Right Handle").side = 'RIGHT'
layout.separator()
+ layout.operator_menu_enum("object.select_grouped", "type", text="Grouped")
layout.operator("sequencer.select_linked")
layout.operator("sequencer.select_all_toggle")
layout.operator("sequencer.select_inverse")
@@ -159,14 +159,14 @@ class SEQUENCER_MT_marker(Menu):
#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.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("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)
@@ -181,7 +181,7 @@ class SEQUENCER_MT_change(Menu):
layout.operator_menu_enum("sequencer.change_effect_input", "swap")
layout.operator_menu_enum("sequencer.change_effect_type", "type")
- layout.operator("sequencer.change_path", text=_("Path/Files"))
+ layout.operator("sequencer.change_path", text="Path/Files")
class SEQUENCER_MT_add(Menu):
@@ -193,13 +193,13 @@ class SEQUENCER_MT_add(Menu):
if len(bpy.data.scenes) > 10:
layout.operator_context = 'INVOKE_DEFAULT'
- layout.operator("sequencer.scene_strip_add", text=_("Scene..."))
+ layout.operator("sequencer.scene_strip_add", text="Scene...")
else:
- layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text=_("Scene..."))
+ layout.operator_menu_enum("sequencer.scene_strip_add", "scene", text="Scene...")
- layout.operator("sequencer.movie_strip_add", text=_("Movie"))
- layout.operator("sequencer.image_strip_add", text=_("Image"))
- layout.operator("sequencer.sound_strip_add", text=_("Sound"))
+ layout.operator("sequencer.movie_strip_add", text="Movie")
+ layout.operator("sequencer.image_strip_add", text="Image")
+ layout.operator("sequencer.sound_strip_add", text="Sound")
layout.menu("SEQUENCER_MT_add_effect")
@@ -211,22 +211,22 @@ class SEQUENCER_MT_add_effect(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("sequencer.effect_strip_add", text=_("Add")).type = 'ADD'
- layout.operator("sequencer.effect_strip_add", text=_("Subtract")).type = 'SUBTRACT'
- layout.operator("sequencer.effect_strip_add", text=_("Alpha Over")).type = 'ALPHA_OVER'
- layout.operator("sequencer.effect_strip_add", text=_("Alpha Under")).type = 'ALPHA_UNDER'
- layout.operator("sequencer.effect_strip_add", text=_("Cross")).type = 'CROSS'
- layout.operator("sequencer.effect_strip_add", text=_("Gamma Cross")).type = 'GAMMA_CROSS'
- layout.operator("sequencer.effect_strip_add", text=_("Multiply")).type = 'MULTIPLY'
- layout.operator("sequencer.effect_strip_add", text=_("Over Drop")).type = 'OVER_DROP'
- layout.operator("sequencer.effect_strip_add", text=_("Plugin")).type = 'PLUGIN'
- layout.operator("sequencer.effect_strip_add", text=_("Wipe")).type = 'WIPE'
- layout.operator("sequencer.effect_strip_add", text=_("Glow")).type = 'GLOW'
- layout.operator("sequencer.effect_strip_add", text=_("Transform")).type = 'TRANSFORM'
- layout.operator("sequencer.effect_strip_add", text=_("Color")).type = 'COLOR'
- layout.operator("sequencer.effect_strip_add", text=_("Speed Control")).type = 'SPEED'
- layout.operator("sequencer.effect_strip_add", text=_("Multicam Selector")).type = 'MULTICAM'
- layout.operator("sequencer.effect_strip_add", text=_("Adjustment Layer")).type = 'ADJUSTMENT'
+ layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD'
+ layout.operator("sequencer.effect_strip_add", text="Subtract").type = 'SUBTRACT'
+ layout.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
+ layout.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
+ layout.operator("sequencer.effect_strip_add", text="Cross").type = 'CROSS'
+ layout.operator("sequencer.effect_strip_add", text="Gamma Cross").type = 'GAMMA_CROSS'
+ layout.operator("sequencer.effect_strip_add", text="Multiply").type = 'MULTIPLY'
+ layout.operator("sequencer.effect_strip_add", text="Over Drop").type = 'OVER_DROP'
+ layout.operator("sequencer.effect_strip_add", text="Plugin").type = 'PLUGIN'
+ layout.operator("sequencer.effect_strip_add", text="Wipe").type = 'WIPE'
+ layout.operator("sequencer.effect_strip_add", text="Glow").type = 'GLOW'
+ layout.operator("sequencer.effect_strip_add", text="Transform").type = 'TRANSFORM'
+ layout.operator("sequencer.effect_strip_add", text="Color").type = 'COLOR'
+ layout.operator("sequencer.effect_strip_add", text="Speed Control").type = 'SPEED'
+ layout.operator("sequencer.effect_strip_add", text="Multicam Selector").type = 'MULTICAM'
+ layout.operator("sequencer.effect_strip_add", text="Adjustment Layer").type = 'ADJUSTMENT'
class SEQUENCER_MT_strip(Menu):
@@ -237,13 +237,13 @@ class SEQUENCER_MT_strip(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("transform.transform", text=_("Grab/Move")).mode = 'TRANSLATION'
- layout.operator("transform.transform", text=_("Grab/Extend from frame")).mode = 'TIME_EXTEND'
+ layout.operator("transform.transform", text="Grab/Move").mode = 'TRANSLATION'
+ layout.operator("transform.transform", text="Grab/Extend from frame").mode = 'TIME_EXTEND'
# uiItemO(layout, NULL, 0, "sequencer.strip_snap"); // TODO - add this operator
layout.separator()
- layout.operator("sequencer.cut", text=_("Cut (hard) at frame")).type = 'HARD'
- layout.operator("sequencer.cut", text=_("Cut (soft) at frame")).type = 'SOFT'
+ layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
+ layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
layout.operator("sequencer.images_separate")
layout.operator("sequencer.offset_clear")
layout.operator("sequencer.deinterlace_selected_movies")
@@ -297,7 +297,7 @@ class SEQUENCER_MT_strip(Menu):
layout.operator("sequencer.mute")
layout.operator("sequencer.unmute")
- layout.operator("sequencer.mute", text=_("Mute Deselected Strips")).unselected = True
+ layout.operator("sequencer.mute", text="Mute Deselected Strips").unselected = True
layout.operator("sequencer.snap")
@@ -345,21 +345,21 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
strip = act_strip(context)
split = layout.split(percentage=0.3)
- split.label(text=_("Name:"))
+ split.label(text="Name:")
split.prop(strip, "name", text="")
split = layout.split(percentage=0.3)
- split.label(text=_("Type:"))
+ split.label(text="Type:")
split.prop(strip, "type", text="")
split = layout.split(percentage=0.3)
- split.label(text=_("Blend:"))
+ split.label(text="Blend:")
split.prop(strip, "blend_type", text="")
row = layout.row(align=True)
sub = row.row()
sub.active = (not strip.mute)
- sub.prop(strip, "blend_alpha", text=_("Opacity"), slider=True)
+ sub.prop(strip, "blend_alpha", text="Opacity", slider=True)
row.prop(strip, "mute", toggle=True, icon='RESTRICT_VIEW_ON' if strip.mute else 'RESTRICT_VIEW_OFF', text="")
row.prop(strip, "lock", toggle=True, icon='LOCKED' if strip.lock else 'UNLOCKED', text="")
@@ -372,13 +372,13 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
col = layout.column(align=True)
row = col.row()
- row.label(text=_("Final Length")+": %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration))
+ row.label(text="Final Length" + ": %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration))
row = col.row()
row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration)
- row.label(text=_("Playhead")+": %d" % (frame_current - strip.frame_start))
+ row.label(text="Playhead" + ": %d" % (frame_current - strip.frame_start))
- col.label(text=_("Frame Offset")+" %d:%d" % (strip.frame_offset_start, strip.frame_offset_end))
- col.label(text=_("Frame Still")+" %d:%d" % (strip.frame_still_start, strip.frame_still_end))
+ col.label(text="Frame Offset" + " %d:%d" % (strip.frame_offset_start, strip.frame_offset_end))
+ col.label(text="Frame Still" + " %d:%d" % (strip.frame_still_start, strip.frame_still_end))
elem = False
@@ -388,9 +388,9 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
elem = strip.elements[0]
if elem and elem.orig_width > 0 and elem.orig_height > 0:
- col.label(text=_("Orig Dim")+": %dx%d" % (elem.orig_width, elem.orig_height))
+ col.label(text="Orig Dim" + ": %dx%d" % (elem.orig_width, elem.orig_height))
else:
- col.label(text=_("Orig Dim: None"))
+ col.label(text="Orig Dim: None")
class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
@@ -430,7 +430,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
col = layout.column()
col.prop(strip, "transition_type")
- col.label(text=_("Direction:"))
+ col.label(text="Direction:")
col.row().prop(strip, "direction", expand=True)
col = layout.column()
@@ -450,13 +450,13 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
row.prop(strip, "use_only_boost")
elif strip.type == 'SPEED':
- layout.prop(strip, "use_default_fade", _("Stretch to input strip length"))
+ layout.prop(strip, "use_default_fade", "Stretch to input strip length")
if not strip.use_default_fade:
layout.prop(strip, "use_as_speed")
if strip.use_as_speed:
layout.prop(strip, "speed_factor")
else:
- layout.prop(strip, "speed_factor", text=_("Frame number"))
+ layout.prop(strip, "speed_factor", text="Frame number")
layout.prop(strip, "scale_to_length")
#doesn't work currently
@@ -474,7 +474,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
sub.operator("screen.animation_play", text="", icon='PAUSE' if context.screen.is_animation_playing else 'PLAY')
- row.label(_("Cut To"))
+ row.label("Cut To")
for i in range(1, strip.channel):
row.operator("sequencer.cut_multicam", text=str(i)).camera = i
@@ -482,17 +482,17 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
if strip.type == 'SPEED':
col.prop(strip, "multiply_speed")
elif strip.type in {'CROSS', 'GAMMA_CROSS', 'PLUGIN', 'WIPE'}:
- col.prop(strip, "use_default_fade", _("Default fade"))
+ col.prop(strip, "use_default_fade", "Default fade")
if not strip.use_default_fade:
- col.prop(strip, "effect_fader", text=_("Effect fader"))
+ col.prop(strip, "effect_fader", text="Effect fader")
- layout.prop(strip, "use_translation", text=_("Image Offset:"))
+ layout.prop(strip, "use_translation", text="Image Offset:")
if strip.use_translation:
col = layout.column(align=True)
col.prop(strip.transform, "offset_x", text="X")
col.prop(strip.transform, "offset_y", text="Y")
- layout.prop(strip, "use_crop", text=_("Image Crop:"))
+ layout.prop(strip, "use_crop", text="Image Crop:")
if strip.use_crop:
col = layout.column(align=True)
col.prop(strip.crop, "max_y")
@@ -507,7 +507,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
col.prop(strip, "interpolation")
col.prop(strip, "translation_unit")
col = layout.column(align=True)
- col.label(text=_("Position:"))
+ col.label(text="Position:")
col.prop(strip, "translate_start_x", text="X")
col.prop(strip, "translate_start_y", text="Y")
@@ -517,18 +517,18 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
col.prop(strip, "use_uniform_scale")
if (strip.use_uniform_scale):
col = layout.column(align=True)
- col.prop(strip, "scale_start_x", text=_("Scale"))
+ col.prop(strip, "scale_start_x", text="Scale")
else:
col = layout.column(align=True)
- col.label(text=_("Scale:"))
+ col.label(text="Scale:")
col.prop(strip, "scale_start_x", text="X")
col.prop(strip, "scale_start_y", text="Y")
layout.separator()
col = layout.column(align=True)
- col.label(text=_("Rotation:"))
- col.prop(strip, "rotation_start", text=_("Rotation"))
+ col.label(text="Rotation:")
+ col.prop(strip, "rotation_start", text="Rotation")
class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
@@ -547,7 +547,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
'CROSS', 'GAMMA_CROSS', 'MULTIPLY', 'OVER_DROP',
'PLUGIN',
- 'WIPE', 'GLOW', 'TRANSFORM', 'COLOR',
+ 'WIPE', 'GLOW', 'TRANSFORM',
'MULTICAM', 'SPEED', 'ADJUSTMENT'}
def draw(self, context):
@@ -561,7 +561,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
if seq_type == 'IMAGE':
split = layout.split(percentage=0.2)
col = split.column()
- col.label(text=_("Path:"))
+ col.label(text="Path:")
col = split.column()
col.prop(strip, "directory", text="")
@@ -571,7 +571,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
if elem:
split = layout.split(percentage=0.2)
col = split.column()
- col.label(text=_("File:"))
+ col.label(text="File:")
col = split.column()
col.prop(elem, "filename", text="") # strip.elements[0] could be a fallback
@@ -581,22 +581,22 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
elif seq_type == 'MOVIE':
split = layout.split(percentage=0.2)
col = split.column()
- col.label(text=_("Path:"))
+ col.label(text="Path:")
col = split.column()
col.prop(strip, "filepath", text="")
- col.prop(strip, "mpeg_preseek", text=_("MPEG Preseek"))
- col.prop(strip, "streamindex", text=_("Stream Index"))
+ col.prop(strip, "mpeg_preseek", text="MPEG Preseek")
+ col.prop(strip, "stream_index", text="Stream Index")
# TODO, sound???
# end drawing filename
- layout.prop(strip, "use_translation", text=_("Image Offset:"))
+ layout.prop(strip, "use_translation", text="Image Offset:")
if strip.use_translation:
col = layout.column(align=True)
col.prop(strip.transform, "offset_x", text="X")
col.prop(strip.transform, "offset_y", text="Y")
- layout.prop(strip, "use_crop", text=_("Image Crop:"))
+ layout.prop(strip, "use_crop", text="Image Crop:")
if strip.use_crop:
col = layout.column(align=True)
col.prop(strip.crop, "max_y")
@@ -606,14 +606,14 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
if not isinstance(strip, bpy.types.EffectSequence):
col = layout.column(align=True)
- col.label(text=_("Trim Duration (hard):"))
- col.prop(strip, "animation_offset_start", text=_("Start"))
- col.prop(strip, "animation_offset_end", text=_("End"))
+ col.label(text="Trim Duration (hard):")
+ col.prop(strip, "animation_offset_start", text="Start")
+ col.prop(strip, "animation_offset_end", text="End")
col = layout.column(align=True)
- col.label(text=_("Trim Duration (soft):"))
- col.prop(strip, "frame_offset_start", text=_("Start"))
- col.prop(strip, "frame_offset_end", text=_("End"))
+ col.label(text="Trim Duration (soft):")
+ col.prop(strip, "frame_offset_start", text="Start")
+ col.prop(strip, "frame_offset_end", text="End")
class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
@@ -642,9 +642,9 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
row = layout.row()
if strip.sound.packed_file:
- row.operator("sound.unpack", icon='PACKAGE', text=_("Unpack"))
+ row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
else:
- row.operator("sound.pack", icon='UGLYPACKAGE', text=_("Pack"))
+ row.operator("sound.pack", icon='UGLYPACKAGE', text="Pack")
row.prop(strip.sound, "use_memory_cache")
@@ -655,8 +655,8 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
col = layout.column(align=True)
col.label(text="Trim Duration:")
- col.prop(strip, "animation_offset_start", text=_("Start"))
- col.prop(strip, "animation_offset_end", text=_("End"))
+ col.prop(strip, "animation_offset_start", text="Start")
+ col.prop(strip, "animation_offset_end", text="End")
class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
@@ -684,13 +684,13 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
if scene:
layout.prop(scene.render, "use_sequencer")
- layout.label(text=_("Camera Override"))
+ layout.label(text="Camera Override")
layout.template_ID(strip, "scene_camera")
if scene:
sta = scene.frame_start
end = scene.frame_end
- layout.label(text=_("Original frame range")+": %d-%d (%d)" % (sta, end, end - sta + 1))
+ layout.label(text="Original frame range" + ": %d-%d (%d)" % (sta, end, end - sta + 1))
class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
@@ -718,22 +718,22 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
strip = act_strip(context)
col = layout.column()
- col.label(text=_("Video:"))
+ col.label(text="Video:")
col.prop(strip, "strobe")
row = layout.row()
- row.label(text=_("Flip:"))
+ row.label(text="Flip:")
row.prop(strip, "use_flip_x", text="X")
row.prop(strip, "use_flip_y", text="Y")
col = layout.column()
- col.prop(strip, "use_reverse_frames", text=_("Backwards"))
+ col.prop(strip, "use_reverse_frames", text="Backwards")
col.prop(strip, "use_deinterlace")
col = layout.column()
- col.label(text=_("Colors:"))
- col.prop(strip, "color_saturation", text=_("Saturation"))
- col.prop(strip, "color_multiply", text=_("Multiply"))
+ col.label(text="Colors:")
+ col.prop(strip, "color_saturation", text="Saturation")
+ col.prop(strip, "color_multiply", text="Multiply")
col.prop(strip, "use_premultiply")
col.prop(strip, "use_float")
@@ -744,15 +744,15 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
col = row.column()
col.template_color_wheel(strip.color_balance, "lift", value_slider=False, cubic=True)
col.row().prop(strip.color_balance, "lift")
- col.prop(strip.color_balance, "invert_lift", text=_("Inverse"))
+ col.prop(strip.color_balance, "invert_lift", text="Inverse")
col = row.column()
col.template_color_wheel(strip.color_balance, "gamma", value_slider=False, lock_luminosity=True, cubic=True)
col.row().prop(strip.color_balance, "gamma")
- col.prop(strip.color_balance, "invert_gamma", text=_("Inverse"))
+ col.prop(strip.color_balance, "invert_gamma", text="Inverse")
col = row.column()
col.template_color_wheel(strip.color_balance, "gain", value_slider=False, lock_luminosity=True, cubic=True)
col.row().prop(strip.color_balance, "gain")
- col.prop(strip.color_balance, "invert_gain", text=_("Inverse"))
+ col.prop(strip.color_balance, "invert_gain", text="Inverse")
class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
@@ -795,18 +795,18 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
row.prop(strip.proxy, "build_100")
col = layout.column()
- col.label(text=_("Build JPEG quality"))
+ col.label(text="Build JPEG quality")
col.prop(strip.proxy, "quality")
if strip.type == "MOVIE":
col = layout.column()
- col.label(text=_("Use timecode index:"))
+ col.label(text="Use timecode index:")
col.prop(strip.proxy, "timecode")
class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
- bl_label = _("Scene Preview/Render")
+ bl_label = "Scene Preview/Render"
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
@@ -816,7 +816,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
col = layout.column()
col.active = False # Currently only opengl preview works!
- col.prop(render, "use_sequencer_gl_preview", text=_("Open GL Preview"))
+ col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
col = layout.column()
#col.active = render.use_sequencer_gl_preview
col.prop(render, "sequencer_gl_preview", text="")
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index cd72d42857b..c3b2e30cb12 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -19,7 +19,6 @@
# <pep8-80 compliant>
import bpy
from bpy.types import Header, Menu, Panel
-from blf import gettext as _
class TEXT_HT_header(Header):
@@ -67,13 +66,15 @@ class TEXT_HT_header(Header):
row = layout.row()
if text.filepath:
if text.is_dirty:
- row.label(text=_("File")+": *%r " % text.filepath+_("(unsaved)"))
+ row.label(text="File" + ": *%r " %
+ text.filepath + "(unsaved)")
else:
- row.label(text=_("File")+": %r" % text.filepath)
+ row.label(text="File" + ": %r" %
+ text.filepath)
else:
- row.label(text=_("Text: External")
+ row.label(text="Text: External"
if text.library
- else _("Text: Internal"))
+ else "Text: Internal")
class TEXT_PT_properties(Panel):
@@ -137,8 +138,8 @@ class TEXT_PT_find(Panel):
# settings
layout.prop(st, "use_match_case")
row = layout.row()
- row.prop(st, "use_find_wrap", text=_("Wrap"))
- row.prop(st, "use_find_all", text=_("All"))
+ row.prop(st, "use_find_wrap", text="Wrap")
+ row.prop(st, "use_find_all", text="All")
class TEXT_MT_view(Menu):
@@ -157,10 +158,10 @@ class TEXT_MT_view(Menu):
layout.separator()
layout.operator("text.move",
- text=_("Top of File"),
+ text="Top of File",
).type = 'FILE_TOP'
layout.operator("text.move",
- text=_("Bottom of File"),
+ text="Bottom of File",
).type = 'FILE_BOTTOM'
@@ -249,10 +250,10 @@ class TEXT_MT_edit_to3d(Menu):
layout = self.layout
layout.operator("text.to_3d_object",
- text=_("One Object"),
+ text="One Object",
).split_lines = False
layout.operator("text.to_3d_object",
- text=_("One Object Per Line"),
+ text="One Object Per Line",
).split_lines = True
@@ -283,7 +284,7 @@ class TEXT_MT_edit(Menu):
layout.separator()
layout.operator("text.jump")
- layout.operator("text.properties", text=_("Find..."))
+ layout.operator("text.properties", text="Find...")
layout.separator()
diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index d654c1e4d8b..db009fe43c2 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu
-from blf import gettext as _
class TIME_HT_header(Header):
@@ -44,11 +43,11 @@ class TIME_HT_header(Header):
row = layout.row(align=True)
if not scene.use_preview_range:
- row.prop(scene, "frame_start", text=_("Start"))
- row.prop(scene, "frame_end", text=_("End"))
+ row.prop(scene, "frame_start", text="Start")
+ row.prop(scene, "frame_end", text="End")
else:
- row.prop(scene, "frame_preview_start", text=_("Start"))
- row.prop(scene, "frame_preview_end", text=_("End"))
+ row.prop(scene, "frame_preview_start", text="Start")
+ row.prop(scene, "frame_preview_end", text="End")
layout.prop(scene, "frame_current", text="")
@@ -143,14 +142,14 @@ 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.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.operator("marker.rename", text="Rename Marker")
+ layout.operator("marker.move", text="Grab/Move Marker")
layout.separator()
@@ -182,8 +181,8 @@ class TIME_MT_playback(Menu):
layout.separator()
- layout.prop(scene, "use_frame_drop", text=_("Frame Dropping"))
- layout.prop(scene, "use_audio_sync", text=_("AV-sync"), icon='SPEAKER')
+ layout.prop(scene, "use_frame_drop", text="Frame Dropping")
+ layout.prop(scene, "use_audio_sync", text="AV-sync", icon='SPEAKER')
layout.prop(scene, "use_audio")
layout.prop(scene, "use_audio_scrub")
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index d0e7ae5e609..1ec6cc39164 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -18,13 +18,10 @@
# <pep8 compliant>
import bpy
-from bpy.types import Header, Menu, Operator, Panel
+from bpy.types import Header, Menu, Panel
import os
import addon_utils
-from bpy.props import StringProperty, BoolProperty, EnumProperty
-from blf import gettext as _
-
def ui_items_general(col, context):
""" General UI Theme Settings (User Interface)
@@ -66,10 +63,10 @@ def opengl_lamp_buttons(column, lamp):
col = split.column()
col.active = lamp.use
row = col.row()
- row.label(text=_("Diffuse:"))
+ row.label(text="Diffuse:")
row.prop(lamp, "diffuse_color", text="")
row = col.row()
- row.label(text=_("Specular:"))
+ row.label(text="Specular:")
row.prop(lamp, "specular_color", text="")
col = split.column()
@@ -87,7 +84,7 @@ class USERPREF_HT_header(Header):
userpref = context.user_preferences
layout.operator_context = 'EXEC_AREA'
- layout.operator("wm.save_homefile", text=_("Save As Default"))
+ layout.operator("wm.save_homefile", text="Save As Default")
layout.operator_context = 'INVOKE_DEFAULT'
@@ -128,7 +125,7 @@ class USERPREF_MT_appconfigs(Menu):
preset_operator = "wm.appconfig_activate"
def draw(self, context):
- self.layout.operator("wm.appconfig_default", text=_("Blender (default)"))
+ self.layout.operator("wm.appconfig_default", text="Blender (default)")
# now draw the presets
Menu.draw_preset(self, context)
@@ -143,12 +140,12 @@ class USERPREF_MT_splash(Menu):
row = split.row()
row.label("")
row = split.row()
- row.label(_("Interaction:"))
+ row.label("Interaction:")
# XXX, no redraws
# text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
# if not text:
# text = "Blender (default)"
- row.menu("USERPREF_MT_appconfigs", text=_("Preset"))
+ row.menu("USERPREF_MT_appconfigs", text="Preset")
class USERPREF_PT_interface(Panel):
@@ -171,13 +168,13 @@ class USERPREF_PT_interface(Panel):
row = layout.row()
col = row.column()
- col.label(text=_("Display:"))
+ col.label(text="Display:")
col.prop(view, "show_tooltips")
col.prop(view, "show_tooltips_python")
- col.prop(view, "show_object_info", text=_("Object Info"))
+ col.prop(view, "show_object_info", text="Object Info")
col.prop(view, "show_large_cursors")
- col.prop(view, "show_view_name", text=_("View Name"))
- col.prop(view, "show_playback_fps", text=_("Playback FPS"))
+ col.prop(view, "show_view_name", text="View Name")
+ col.prop(view, "show_playback_fps", text="Playback FPS")
col.prop(view, "use_global_scene")
col.prop(view, "object_origin_size")
@@ -185,18 +182,18 @@ class USERPREF_PT_interface(Panel):
col.separator()
col.separator()
- col.prop(view, "show_mini_axis", text=_("Display Mini Axis"))
+ col.prop(view, "show_mini_axis", text="Display Mini Axis")
sub = col.column()
sub.active = view.show_mini_axis
- sub.prop(view, "mini_axis_size", text=_("Size"))
- sub.prop(view, "mini_axis_brightness", text=_("Brightness"))
+ sub.prop(view, "mini_axis_size", text="Size")
+ sub.prop(view, "mini_axis_brightness", text="Brightness")
col.separator()
row.separator()
row.separator()
col = row.column()
- col.label(text=_("View Manipulation:"))
+ col.label(text="View Manipulation:")
col.prop(view, "use_mouse_auto_depth")
col.prop(view, "use_zoom_to_mouse")
col.prop(view, "use_rotate_around_active")
@@ -212,8 +209,8 @@ class USERPREF_PT_interface(Panel):
col.separator()
col.separator()
- col.label(text=_("2D Viewports:"))
- col.prop(view, "view2d_grid_spacing_min", text=_("Minimum Grid Spacing"))
+ col.label(text="2D Viewports:")
+ col.prop(view, "view2d_grid_spacing_min", text="Minimum Grid Spacing")
col.prop(view, "timecode_style")
row.separator()
@@ -229,19 +226,19 @@ class USERPREF_PT_interface(Panel):
col.prop(view, "show_manipulator")
sub = col.column()
sub.active = view.show_manipulator
- sub.prop(view, "manipulator_size", text=_("Size"))
- sub.prop(view, "manipulator_handle_size", text=_("Handle Size"))
- sub.prop(view, "manipulator_hotspot", text=_("Hotspot"))
+ sub.prop(view, "manipulator_size", text="Size")
+ sub.prop(view, "manipulator_handle_size", text="Handle Size")
+ sub.prop(view, "manipulator_hotspot", text="Hotspot")
col.separator()
col.separator()
col.separator()
- col.label(text=_("Menus:"))
+ col.label(text="Menus:")
col.prop(view, "use_mouse_over_open")
- col.label(text=_("Menu Open Delay:"))
- col.prop(view, "open_toplevel_delay", text=_("Top Level"))
- col.prop(view, "open_sublevel_delay", text=_("Sub Level"))
+ col.label(text="Menu Open Delay:")
+ col.prop(view, "open_toplevel_delay", text="Top Level")
+ col.prop(view, "open_sublevel_delay", text="Sub Level")
col.separator()
@@ -268,97 +265,97 @@ class USERPREF_PT_edit(Panel):
row = layout.row()
col = row.column()
- col.label(text=_("Link Materials To:"))
+ col.label(text="Link Materials To:")
col.prop(edit, "material_link", text="")
col.separator()
col.separator()
col.separator()
- col.label(text=_("New Objects:"))
+ col.label(text="New Objects:")
col.prop(edit, "use_enter_edit_mode")
- col.label(text=_("Align To:"))
+ col.label(text="Align To:")
col.prop(edit, "object_align", text="")
col.separator()
col.separator()
col.separator()
- col.label(text=_("Undo:"))
+ col.label(text="Undo:")
col.prop(edit, "use_global_undo")
- col.prop(edit, "undo_steps", text=_("Steps"))
- col.prop(edit, "undo_memory_limit", text=_("Memory Limit"))
+ col.prop(edit, "undo_steps", text="Steps")
+ col.prop(edit, "undo_memory_limit", text="Memory Limit")
row.separator()
row.separator()
col = row.column()
- col.label(text=_("Grease Pencil:"))
- col.prop(edit, "grease_pencil_manhattan_distance", text=_("Manhattan Distance"))
- col.prop(edit, "grease_pencil_euclidean_distance", text=_("Euclidean Distance"))
+ col.label(text="Grease Pencil:")
+ col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
+ col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
#col.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke")
- col.prop(edit, "grease_pencil_eraser_radius", text=_("Eraser Radius"))
- col.prop(edit, "use_grease_pencil_smooth_stroke", text=_("Smooth Stroke"))
+ col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
+ col.prop(edit, "use_grease_pencil_smooth_stroke", text="Smooth Stroke")
col.separator()
col.separator()
col.separator()
- col.label(text=_("Playback:"))
+ col.label(text="Playback:")
col.prop(edit, "use_negative_frames")
row.separator()
row.separator()
col = row.column()
- col.label(text=_("Keyframing:"))
+ col.label(text="Keyframing:")
col.prop(edit, "use_visual_keying")
- col.prop(edit, "use_keyframe_insert_needed", text=_("Only Insert Needed"))
+ col.prop(edit, "use_keyframe_insert_needed", text="Only Insert Needed")
col.separator()
- col.prop(edit, "use_auto_keying", text=_("Auto Keyframing:"))
+ col.prop(edit, "use_auto_keying", text="Auto Keyframing:")
sub = col.column()
# sub.active = edit.use_keyframe_insert_auto # incorrect, timeline can enable
- sub.prop(edit, "use_keyframe_insert_available", text=_("Only Insert Available"))
+ sub.prop(edit, "use_keyframe_insert_available", text="Only Insert Available")
col.separator()
- col.label(text=_("New F-Curve Defaults:"))
- col.prop(edit, "keyframe_new_interpolation_type", text=_("Interpolation"))
- col.prop(edit, "keyframe_new_handle_type", text=_("Handles"))
- col.prop(edit, "use_insertkey_xyz_to_rgb", text=_("XYZ to RGB"))
+ col.label(text="New F-Curve Defaults:")
+ col.prop(edit, "keyframe_new_interpolation_type", text="Interpolation")
+ col.prop(edit, "keyframe_new_handle_type", text="Handles")
+ col.prop(edit, "use_insertkey_xyz_to_rgb", text="XYZ to RGB")
col.separator()
col.separator()
col.separator()
- col.label(text=_("Transform:"))
+ col.label(text="Transform:")
col.prop(edit, "use_drag_immediately")
row.separator()
row.separator()
col = row.column()
- col.prop(edit, "sculpt_paint_overlay_color", text=_("Sculpt Overlay Color"))
+ col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color")
col.separator()
col.separator()
col.separator()
- col.label(text=_("Duplicate Data:"))
- col.prop(edit, "use_duplicate_mesh", text=_("Mesh"))
- col.prop(edit, "use_duplicate_surface", text=_("Surface"))
- col.prop(edit, "use_duplicate_curve", text=_("Curve"))
- col.prop(edit, "use_duplicate_text", text=_("Text"))
- col.prop(edit, "use_duplicate_metaball", text=_("Metaball"))
- col.prop(edit, "use_duplicate_armature", text=_("Armature"))
- col.prop(edit, "use_duplicate_lamp", text=_("Lamp"))
- col.prop(edit, "use_duplicate_material", text=_("Material"))
- col.prop(edit, "use_duplicate_texture", text=_("Texture"))
- #col.prop(edit, "use_duplicate_fcurve", text=_("F-Curve"))
- col.prop(edit, "use_duplicate_action", text=_("Action"))
- col.prop(edit, "use_duplicate_particle", text=_("Particle"))
+ col.label(text="Duplicate Data:")
+ col.prop(edit, "use_duplicate_mesh", text="Mesh")
+ col.prop(edit, "use_duplicate_surface", text="Surface")
+ col.prop(edit, "use_duplicate_curve", text="Curve")
+ col.prop(edit, "use_duplicate_text", text="Text")
+ col.prop(edit, "use_duplicate_metaball", text="Metaball")
+ col.prop(edit, "use_duplicate_armature", text="Armature")
+ col.prop(edit, "use_duplicate_lamp", text="Lamp")
+ col.prop(edit, "use_duplicate_material", text="Material")
+ col.prop(edit, "use_duplicate_texture", text="Texture")
+ #col.prop(edit, "use_duplicate_fcurve", text="F-Curve")
+ col.prop(edit, "use_duplicate_action", text="Action")
+ col.prop(edit, "use_duplicate_particle", text="Particle")
class USERPREF_PT_system(Panel):
@@ -385,11 +382,11 @@ class USERPREF_PT_system(Panel):
colsplit = column.split(percentage=0.85)
col = colsplit.column()
- col.label(text=_("General:"))
+ col.label(text="General:")
col.prop(system, "dpi")
col.prop(system, "frame_server_port")
- col.prop(system, "scrollback", text=_("Console Scrollback"))
- col.prop(system, "author", text=_("Author"))
+ col.prop(system, "scrollback", text="Console Scrollback")
+ col.prop(system, "author", text="Author")
col.prop(system, "use_scripts_auto_execute")
col.prop(system, "use_tabs_as_spaces")
@@ -397,21 +394,21 @@ class USERPREF_PT_system(Panel):
col.separator()
col.separator()
- col.label(text=_("Sound:"))
+ col.label(text="Sound:")
col.row().prop(system, "audio_device", expand=True)
sub = col.column()
sub.active = system.audio_device != 'NONE'
#sub.prop(system, "use_preview_images")
- sub.prop(system, "audio_channels", text=_("Channels"))
- sub.prop(system, "audio_mixing_buffer", text=_("Mixing Buffer"))
- sub.prop(system, "audio_sample_rate", text=_("Sample Rate"))
- sub.prop(system, "audio_sample_format", text=_("Sample Format"))
+ sub.prop(system, "audio_channels", text="Channels")
+ sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer")
+ sub.prop(system, "audio_sample_rate", text="Sample Rate")
+ sub.prop(system, "audio_sample_format", text="Sample Format")
col.separator()
col.separator()
col.separator()
- col.label(text=_("Screencast:"))
+ col.label(text="Screencast:")
col.prop(system, "screencast_fps")
col.prop(system, "screencast_wait_time")
col.separator()
@@ -423,40 +420,40 @@ class USERPREF_PT_system(Panel):
colsplit = column.split(percentage=0.85)
col = colsplit.column()
- col.label(text=_("OpenGL:"))
+ col.label(text="OpenGL:")
col.prop(system, "gl_clip_alpha", slider=True)
col.prop(system, "use_mipmaps")
- col.label(text=_("Anisotropic Filtering"))
+ col.label(text="Anisotropic Filtering")
col.prop(system, "anisotropic_filter", text="")
col.prop(system, "use_vertex_buffer_objects")
#Anti-aliasing is disabled as it breaks broder/lasso select
#col.prop(system, "use_antialiasing")
- col.label(text=_("Window Draw Method:"))
+ col.label(text="Window Draw Method:")
col.prop(system, "window_draw_method", text="")
- col.label(text=_("Text Draw Options:"))
+ col.label(text="Text Draw Options:")
col.prop(system, "use_text_antialiasing")
- col.label(text=_("Textures:"))
- col.prop(system, "gl_texture_limit", text=_("Limit Size"))
- col.prop(system, "texture_time_out", text=_("Time Out"))
- col.prop(system, "texture_collection_rate", text=_("Collection Rate"))
+ col.label(text="Textures:")
+ col.prop(system, "gl_texture_limit", text="Limit Size")
+ col.prop(system, "texture_time_out", text="Time Out")
+ col.prop(system, "texture_collection_rate", text="Collection Rate")
col.separator()
col.separator()
col.separator()
- col.label(text=_("Sequencer:"))
+ col.label(text="Sequencer:")
col.prop(system, "prefetch_frames")
col.prop(system, "memory_cache_limit")
# 3. Column
column = split.column()
- column.label(text=_("Solid OpenGL lights:"))
+ column.label(text="Solid OpenGL lights:")
split = column.split(percentage=0.1)
split.label()
- split.label(text=_("Colors:"))
- split.label(text=_("Direction:"))
+ split.label(text="Colors:")
+ split.label(text="Direction:")
lamp = system.solid_lights[0]
opengl_lamp_buttons(column, lamp)
@@ -469,12 +466,12 @@ class USERPREF_PT_system(Panel):
column.separator()
- column.label(text=_("Color Picker Type:"))
+ column.label(text="Color Picker Type:")
column.row().prop(system, "color_picker_type", text="")
column.separator()
- column.prop(system, "use_weight_color_range", text=_("Custom Weight Paint Range"))
+ column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range")
sub = column.column()
sub.active = system.use_weight_color_range
sub.template_color_ramp(system, "weight_color_range", expand=True)
@@ -550,71 +547,71 @@ class USERPREF_PT_theme(Panel):
col = split.column()
ui = theme.user_interface.wcol_regular
- col.label(text=_("Regular:"))
+ col.label(text="Regular:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_tool
- col.label(text=_("Tool:"))
+ col.label(text="Tool:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_radio
- col.label(text=_("Radio Buttons:"))
+ col.label(text="Radio Buttons:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_text
- col.label(text=_("Text:"))
+ col.label(text="Text:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_option
- col.label(text=_("Option:"))
+ col.label(text="Option:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_toggle
- col.label(text=_("Toggle:"))
+ col.label(text="Toggle:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_num
- col.label(text=_("Number Field:"))
+ col.label(text="Number Field:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_numslider
- col.label(text=_("Value Slider:"))
+ col.label(text="Value Slider:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_box
- col.label(text=_("Box:"))
+ col.label(text="Box:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_menu
- col.label(text=_("Menu:"))
+ col.label(text="Menu:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_pulldown
- col.label(text=_("Pulldown:"))
+ col.label(text="Pulldown:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_menu_back
- col.label(text=_("Menu Back:"))
+ col.label(text="Menu Back:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_menu_item
- col.label(text=_("Menu Item:"))
+ col.label(text="Menu Item:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_scroll
- col.label(text=_("Scroll Bar:"))
+ col.label(text="Scroll Bar:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_progress
- col.label(text=_("Progress Bar:"))
+ col.label(text="Progress Bar:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_list_item
- col.label(text=_("List Item:"))
+ col.label(text="List Item:")
ui_items_general(col, ui)
ui = theme.user_interface.wcol_state
- col.label(text=_("State:"))
+ col.label(text="State:")
row = col.row()
@@ -650,7 +647,7 @@ class USERPREF_PT_theme(Panel):
col = split.column()
for i, ui in enumerate(theme.bone_color_sets):
- col.label(text=_("Color Set")+" %d:" % (i + 1)) # i starts from 0
+ col.label(text="Color Set" + " %d:" % (i + 1)) # i starts from 0
row = col.row()
@@ -693,22 +690,22 @@ class USERPREF_PT_file(Panel):
split = layout.split(percentage=0.7)
col = split.column()
- col.label(text=_("File Paths:"))
+ col.label(text="File Paths:")
colsplit = col.split(percentage=0.95)
col1 = colsplit.split(percentage=0.3)
sub = col1.column()
- sub.label(text=_("Fonts:"))
- sub.label(text=_("Textures:"))
- sub.label(text=_("Texture Plugins:"))
- sub.label(text=_("Sequence Plugins:"))
- sub.label(text=_("Render Output:"))
- sub.label(text=_("Scripts:"))
- sub.label(text=_("Sounds:"))
- sub.label(text=_("Temp:"))
- sub.label(text=_("Image Editor:"))
- sub.label(text=_("Animation Player:"))
+ sub.label(text="Fonts:")
+ sub.label(text="Textures:")
+ sub.label(text="Texture Plugins:")
+ sub.label(text="Sequence Plugins:")
+ sub.label(text="Render Output:")
+ sub.label(text="Scripts:")
+ sub.label(text="Sounds:")
+ sub.label(text="Temp:")
+ sub.label(text="Image Editor:")
+ sub.label(text="Animation Player:")
sub = col1.column()
sub.prop(paths, "font_directory", text="")
@@ -725,7 +722,7 @@ class USERPREF_PT_file(Panel):
subsplit.prop(paths, "animation_player", text="")
col = split.column()
- col.label(text=_("Save & Load:"))
+ col.label(text="Save & Load:")
col.prop(paths, "use_relative_paths")
col.prop(paths, "use_file_compression")
col.prop(paths, "use_load_ui")
@@ -740,11 +737,11 @@ class USERPREF_PT_file(Panel):
col.prop(paths, "save_version")
col.prop(paths, "recent_files")
col.prop(paths, "use_save_preview_images")
- col.label(text=_("Auto Save:"))
+ col.label(text="Auto Save:")
col.prop(paths, "use_auto_save_temporary_files")
sub = col.column()
sub.active = paths.use_auto_save_temporary_files
- sub.prop(paths, "auto_save_time", text=_("Timer (mins)"))
+ sub.prop(paths, "auto_save_time", text="Timer (mins)")
from bl_ui.space_userpref_keymap import InputKeyMapPanel
@@ -800,7 +797,7 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
col = row.column()
sub = col.column()
- sub.label(text=_("Presets:"))
+ sub.label(text="Presets:")
subrow = sub.row(align=True)
subrow.menu("USERPREF_MT_interaction_presets", text=bpy.types.USERPREF_MT_interaction_presets.bl_label)
@@ -808,19 +805,19 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
subrow.operator("wm.interaction_preset_add", text="", icon='ZOOMOUT').remove_active = True
sub.separator()
- sub.label(text=_("Mouse:"))
+ sub.label(text="Mouse:")
sub1 = sub.column()
sub1.active = (inputs.select_mouse == 'RIGHT')
sub1.prop(inputs, "use_mouse_emulate_3_button")
sub.prop(inputs, "use_mouse_continuous")
sub.prop(inputs, "drag_threshold")
- sub.label(text=_("Select With:"))
+ sub.label(text="Select With:")
sub.row().prop(inputs, "select_mouse", expand=True)
sub = col.column()
- sub.label(text=_("Double Click:"))
- sub.prop(inputs, "mouse_double_click_time", text=_("Speed"))
+ sub.label(text="Double Click:")
+ sub.prop(inputs, "mouse_double_click_time", text="Speed")
sub.separator()
@@ -828,10 +825,10 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
sub.separator()
- sub.label(text=_("Orbit Style:"))
+ sub.label(text="Orbit Style:")
sub.row().prop(inputs, "view_rotate_method", expand=True)
- sub.label(text=_("Zoom Style:"))
+ sub.label(text="Zoom Style:")
sub.row().prop(inputs, "view_zoom_method", text="")
if inputs.view_zoom_method in {'DOLLY', 'CONTINUE'}:
sub.row().prop(inputs, "view_zoom_axis", expand=True)
@@ -842,8 +839,8 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
#col.separator()
sub = col.column()
- sub.label(text=_("Mouse Wheel:"))
- sub.prop(inputs, "invert_zoom_wheel", text=_("Invert Wheel Zoom Direction"))
+ sub.label(text="Mouse Wheel:")
+ sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
#sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
col.separator()
@@ -881,9 +878,9 @@ class USERPREF_MT_addons_dev_guides(Menu):
# menu to open webpages with addons development guides
def draw(self, context):
layout = self.layout
- layout.operator('wm.url_open', text=_('API Concepts'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro'
- layout.operator('wm.url_open', text=_('Addon Guidelines'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons'
- layout.operator('wm.url_open', text=_('How to share your addon'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing'
+ layout.operator("wm.url_open", text="API Concepts", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro"
+ layout.operator("wm.url_open", text="Addon Guidelines", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons"
+ layout.operator("wm.url_open", text="How to share your addon", icon='URL').url = "http://wiki.blender.org/index.php/Dev:Py/Sharing"
class USERPREF_PT_addons(Panel):
@@ -892,18 +889,12 @@ class USERPREF_PT_addons(Panel):
bl_region_type = 'WINDOW'
bl_options = {'HIDE_HEADER'}
- _addons_fake_modules = {}
-
@classmethod
def poll(cls, context):
userpref = context.user_preferences
return (userpref.active_section == 'ADDONS')
@staticmethod
- def module_get(mod_name):
- return USERPREF_PT_addons._addons_fake_modules[mod_name]
-
- @staticmethod
def is_user_addon(mod, user_addon_paths):
if not user_addon_paths:
user_script_path = bpy.utils.user_script_path()
@@ -933,15 +924,15 @@ class USERPREF_PT_addons(Panel):
used_ext = {ext.module for ext in userpref.addons}
# collect the categories that can be filtered on
- addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)]
+ addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(addon_utils.addons_fake_modules)]
split = layout.split(percentage=0.2)
col = split.column()
col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM')
- col.label(text=_("Categories"))
+ col.label(text="Categories")
col.prop(context.window_manager, "addon_filter", expand=True)
- col.label(text=_("Supported Level"))
+ col.label(text="Supported Level")
col.prop(context.window_manager, "addon_support", expand=True)
col = split.column()
@@ -1018,23 +1009,23 @@ class USERPREF_PT_addons(Panel):
if info["show_expanded"]:
if info["description"]:
split = colsub.row().split(percentage=0.15)
- split.label(text=_('Description:'))
+ split.label(text="Description:")
split.label(text=info["description"])
if info["location"]:
split = colsub.row().split(percentage=0.15)
- split.label(text=_('Location:'))
+ split.label(text="Location:")
split.label(text=info["location"])
if info["author"]:
split = colsub.row().split(percentage=0.15)
- split.label(text=_('Author:'))
+ split.label(text="Author:")
split.label(text=info["author"])
if info["version"]:
split = colsub.row().split(percentage=0.15)
- split.label(text=_('Version:'))
+ split.label(text="Version:")
split.label(text='.'.join(str(x) for x in info["version"]))
if info["warning"]:
split = colsub.row().split(percentage=0.15)
- split.label(text=_("Warning:"))
+ split.label(text="Warning:")
split.label(text=' ' + info["warning"], icon='ERROR')
user_addon = USERPREF_PT_addons.is_user_addon(mod, user_addon_paths)
@@ -1042,13 +1033,13 @@ class USERPREF_PT_addons(Panel):
if tot_row:
split = colsub.row().split(percentage=0.15)
- split.label(text=_("Internet:"))
+ split.label(text="Internet:")
if info["wiki_url"]:
- split.operator("wm.url_open", text=_("Link to the Wiki"), icon='HELP').url = info["wiki_url"]
+ split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"]
if info["tracker_url"]:
- split.operator("wm.url_open", text=_("Report a Bug"), icon='URL').url = info["tracker_url"]
+ split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"]
if user_addon:
- split.operator("wm.addon_remove", text=_("Remove"), icon='CANCEL').module = mod.__name__
+ split.operator("wm.addon_remove", text="Remove", icon='CANCEL').module = mod.__name__
for i in range(4 - tot_row):
split.separator()
@@ -1060,7 +1051,7 @@ class USERPREF_PT_addons(Panel):
if missing_modules and filter in {"All", "Enabled"}:
col.column().separator()
- col.column().label(text=_("Missing script files"))
+ col.column().label(text="Missing script files")
module_names = {mod.__name__ for mod, info in addons}
for module_name in sorted(missing_modules):
@@ -1075,292 +1066,5 @@ class USERPREF_PT_addons(Panel):
if is_enabled:
row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name
-
-class WM_OT_addon_enable(Operator):
- "Enable an addon"
- bl_idname = "wm.addon_enable"
- bl_label = "Enable Add-On"
-
- module = StringProperty(
- name="Module",
- description="Module name of the addon to enable",
- )
-
- def execute(self, context):
- mod = addon_utils.enable(self.module)
-
- if mod:
- info = addon_utils.module_bl_info(mod)
-
- info_ver = info.get("blender", (0, 0, 0))
-
- if info_ver > bpy.app.version:
- self.report({'WARNING'}, ("This script was written Blender "
- "version %d.%d.%d and might not "
- "function (correctly), "
- "though it is enabled") %
- info_ver)
- return {'FINISHED'}
- else:
- return {'CANCELLED'}
-
-
-class WM_OT_addon_disable(Operator):
- "Disable an addon"
- bl_idname = "wm.addon_disable"
- bl_label = "Disable Add-On"
-
- module = StringProperty(
- name="Module",
- description="Module name of the addon to disable",
- )
-
- def execute(self, context):
- addon_utils.disable(self.module)
- return {'FINISHED'}
-
-
-class WM_OT_addon_install(Operator):
- "Install an addon"
- bl_idname = "wm.addon_install"
- bl_label = "Install Add-On..."
-
- overwrite = BoolProperty(
- name="Overwrite",
- description="Remove existing addons with the same ID",
- default=True,
- )
- target = EnumProperty(
- name="Target Path",
- items=(('DEFAULT', "Default", ""),
- ('PREFS', "User Prefs", "")),
- )
-
- filepath = StringProperty(
- name="File Path",
- description="File path to write file to",
- )
- filter_folder = BoolProperty(
- name="Filter folders",
- default=True,
- options={'HIDDEN'},
- )
- filter_python = BoolProperty(
- name="Filter python",
- default=True,
- options={'HIDDEN'},
- )
- filter_glob = StringProperty(
- default="*.py;*.zip",
- options={'HIDDEN'},
- )
-
- @staticmethod
- def _module_remove(path_addons, module):
- module = os.path.splitext(module)[0]
- for f in os.listdir(path_addons):
- f_base = os.path.splitext(f)[0]
- if f_base == module:
- f_full = os.path.join(path_addons, f)
-
- if os.path.isdir(f_full):
- os.rmdir(f_full)
- else:
- os.remove(f_full)
-
- def execute(self, context):
- import traceback
- import zipfile
- import shutil
-
- pyfile = self.filepath
-
- if self.target == 'DEFAULT':
- # dont use bpy.utils.script_paths("addons") because we may not be able to write to it.
- path_addons = bpy.utils.user_resource('SCRIPTS', "addons", create=True)
- else:
- path_addons = bpy.context.user_preferences.filepaths.script_directory
- if path_addons:
- path_addons = os.path.join(path_addons, "addons")
-
- if not path_addons:
- self.report({'ERROR'}, "Failed to get addons path")
- return {'CANCELLED'}
-
- # create dir is if missing.
- if not os.path.exists(path_addons):
- os.makedirs(path_addons)
-
- # Check if we are installing from a target path,
- # doing so causes 2+ addons of same name or when the same from/to
- # location is used, removal of the file!
- addon_path = ""
- pyfile_dir = os.path.dirname(pyfile)
- for addon_path in addon_utils.paths():
- if os.path.samefile(pyfile_dir, addon_path):
- self.report({'ERROR'}, "Source file is in the addon search path: %r" % addon_path)
- return {'CANCELLED'}
- del addon_path
- del pyfile_dir
- # done checking for exceptional case
-
- addons_old = {mod.__name__ for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)}
-
- #check to see if the file is in compressed format (.zip)
- if zipfile.is_zipfile(pyfile):
- try:
- file_to_extract = zipfile.ZipFile(pyfile, 'r')
- except:
- traceback.print_exc()
- return {'CANCELLED'}
-
- if self.overwrite:
- for f in file_to_extract.namelist():
- WM_OT_addon_install._module_remove(path_addons, f)
- else:
- for f in file_to_extract.namelist():
- path_dest = os.path.join(path_addons, os.path.basename(f))
- if os.path.exists(path_dest):
- self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
- return {'CANCELLED'}
-
- try: # extract the file to "addons"
- file_to_extract.extractall(path_addons)
-
- # zip files can create this dir with metadata, don't need it
- macosx_dir = os.path.join(path_addons, '__MACOSX')
- if os.path.isdir(macosx_dir):
- shutil.rmtree(macosx_dir)
-
- except:
- traceback.print_exc()
- return {'CANCELLED'}
-
- else:
- path_dest = os.path.join(path_addons, os.path.basename(pyfile))
-
- if self.overwrite:
- WM_OT_addon_install._module_remove(path_addons, os.path.basename(pyfile))
- elif os.path.exists(path_dest):
- self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
- return {'CANCELLED'}
-
- #if not compressed file just copy into the addon path
- try:
- shutil.copyfile(pyfile, path_dest)
-
- except:
- traceback.print_exc()
- return {'CANCELLED'}
-
- addons_new = {mod.__name__ for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)} - addons_old
- addons_new.discard("modules")
-
- # disable any addons we may have enabled previously and removed.
- # this is unlikely but do just incase. bug [#23978]
- for new_addon in addons_new:
- addon_utils.disable(new_addon)
-
- # possible the zip contains multiple addons, we could disallow this
- # but for now just use the first
- for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules):
- if mod.__name__ in addons_new:
- info = addon_utils.module_bl_info(mod)
-
- # show the newly installed addon.
- context.window_manager.addon_filter = 'All'
- context.window_manager.addon_search = info["name"]
- break
-
- # incase a new module path was created to install this addon.
- bpy.utils.refresh_script_paths()
-
- # TODO, should not be a warning.
- # self.report({'WARNING'}, "File installed to '%s'\n" % path_dest)
- return {'FINISHED'}
-
- def invoke(self, context, event):
- wm = context.window_manager
- wm.fileselect_add(self)
- return {'RUNNING_MODAL'}
-
-
-class WM_OT_addon_remove(Operator):
- "Disable an addon"
- bl_idname = "wm.addon_remove"
- bl_label = "Remove Add-On"
-
- module = StringProperty(
- name="Module",
- description="Module name of the addon to remove",
- )
-
- @staticmethod
- def path_from_addon(module):
- for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules):
- if mod.__name__ == module:
- filepath = mod.__file__
- if os.path.exists(filepath):
- if os.path.splitext(os.path.basename(filepath))[0] == "__init__":
- return os.path.dirname(filepath), True
- else:
- return filepath, False
- return None, False
-
- def execute(self, context):
- path, isdir = WM_OT_addon_remove.path_from_addon(self.module)
- if path is None:
- self.report('WARNING', "Addon path %r could not be found" % path)
- return {'CANCELLED'}
-
- # incase its enabled
- addon_utils.disable(self.module)
-
- import shutil
- if isdir:
- shutil.rmtree(path)
- else:
- os.remove(path)
-
- context.area.tag_redraw()
- return {'FINISHED'}
-
- # lame confirmation check
- def draw(self, context):
- self.layout.label(text="Remove Addon: %r?" % self.module)
- path, isdir = WM_OT_addon_remove.path_from_addon(self.module)
- self.layout.label(text="Path: %r" % path)
-
- def invoke(self, context, event):
- wm = context.window_manager
- return wm.invoke_props_dialog(self, width=600)
-
-
-class WM_OT_addon_expand(Operator):
- "Display more information on this add-on"
- bl_idname = "wm.addon_expand"
- bl_label = ""
-
- module = StringProperty(
- name="Module",
- description="Module name of the addon to expand",
- )
-
- def execute(self, context):
- module_name = self.module
-
- # unlikely to fail, module should have already been imported
- try:
- # mod = __import__(module_name)
- mod = USERPREF_PT_addons.module_get(module_name)
- except:
- import traceback
- traceback.print_exc()
- return {'CANCELLED'}
-
- info = addon_utils.module_bl_info(mod)
- info["show_expanded"] = not info["show_expanded"]
- return {'FINISHED'}
-
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py
index f8d77a1604b..c2e3a145f36 100644
--- a/release/scripts/startup/bl_ui/space_userpref_keymap.py
+++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py
@@ -18,112 +18,7 @@
# <pep8 compliant>
import bpy
-from bpy.types import Menu, Operator, OperatorProperties
-import os
-from blf import gettext as _
-
-
-KM_HIERARCHY = [
- ('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit
- ('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot
- ('Screen Editing', 'EMPTY', 'WINDOW', []), # resizing, action corners
- ]),
-
- ('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region)
- ('View2D Buttons List', 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation
- ('Header', 'EMPTY', 'WINDOW', []), # header stuff (per region)
- ('Grease Pencil', 'EMPTY', 'WINDOW', []), # grease pencil stuff (per region)
-
- ('3D View', 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform)
- ('Object Mode', 'EMPTY', 'WINDOW', []),
- ('Mesh', 'EMPTY', 'WINDOW', []),
- ('Curve', 'EMPTY', 'WINDOW', []),
- ('Armature', 'EMPTY', 'WINDOW', []),
- ('Metaball', 'EMPTY', 'WINDOW', []),
- ('Lattice', 'EMPTY', 'WINDOW', []),
- ('Font', 'EMPTY', 'WINDOW', []),
-
- ('Pose', 'EMPTY', 'WINDOW', []),
-
- ('Vertex Paint', 'EMPTY', 'WINDOW', []),
- ('Weight Paint', 'EMPTY', 'WINDOW', []),
- ('Face Mask', 'EMPTY', 'WINDOW', []),
- ('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d
- ('Sculpt', 'EMPTY', 'WINDOW', []),
-
- ('Armature Sketch', 'EMPTY', 'WINDOW', []),
- ('Particle', 'EMPTY', 'WINDOW', []),
-
- ('Object Non-modal', 'EMPTY', 'WINDOW', []), # mode change
-
- ('3D View Generic', 'VIEW_3D', 'WINDOW', []) # toolbar and properties
- ]),
-
- ('Frames', 'EMPTY', 'WINDOW', []), # frame navigation (per region)
- ('Markers', 'EMPTY', 'WINDOW', []), # markers (per region)
- ('Animation', 'EMPTY', 'WINDOW', []), # frame change on click, preview range (per region)
- ('Animation Channels', 'EMPTY', 'WINDOW', []),
- ('Graph Editor', 'GRAPH_EDITOR', 'WINDOW', [
- ('Graph Editor Generic', 'GRAPH_EDITOR', 'WINDOW', [])
- ]),
- ('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', []),
- ('NLA Editor', 'NLA_EDITOR', 'WINDOW', [
- ('NLA Channels', 'NLA_EDITOR', 'WINDOW', []),
- ('NLA Generic', 'NLA_EDITOR', 'WINDOW', [])
- ]),
-
- ('Image', 'IMAGE_EDITOR', 'WINDOW', [
- ('UV Editor', 'EMPTY', 'WINDOW', []), # image (reverse order, UVEdit before Image
- ('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d
- ('Image Generic', 'IMAGE_EDITOR', 'WINDOW', [])
- ]),
-
- ('Timeline', 'TIMELINE', 'WINDOW', []),
- ('Outliner', 'OUTLINER', 'WINDOW', []),
-
- ('Node Editor', 'NODE_EDITOR', 'WINDOW', [
- ('Node Generic', 'NODE_EDITOR', 'WINDOW', [])
- ]),
- ('Sequencer', 'SEQUENCE_EDITOR', 'WINDOW', []),
- ('Logic Editor', 'LOGIC_EDITOR', 'WINDOW', []),
-
- ('File Browser', 'FILE_BROWSER', 'WINDOW', [
- ('File Browser Main', 'FILE_BROWSER', 'WINDOW', []),
- ('File Browser Buttons', 'FILE_BROWSER', 'WINDOW', [])
- ]),
-
- ('Property Editor', 'PROPERTIES', 'WINDOW', []), # align context menu
-
- ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []),
- ('Text', 'TEXT_EDITOR', 'WINDOW', []),
- ('Console', 'CONSOLE', 'WINDOW', []),
-
- ('View3D Gesture Circle', 'EMPTY', 'WINDOW', []),
- ('Gesture Border', 'EMPTY', 'WINDOW', []),
- ('Standard Modal Map', 'EMPTY', 'WINDOW', []),
- ('Transform Modal Map', 'EMPTY', 'WINDOW', []),
- ('View3D Fly Modal', 'EMPTY', 'WINDOW', []),
- ('View3D Rotate Modal', 'EMPTY', 'WINDOW', []),
- ('View3D Move Modal', 'EMPTY', 'WINDOW', []),
- ('View3D Zoom Modal', 'EMPTY', 'WINDOW', []),
- ]
-
-
-def _km_exists_in(km, export_keymaps):
- for km2, kc in export_keymaps:
- if km2.name == km.name:
- return True
- return False
-
-
-def _merge_keymaps(kc1, kc2):
- """ note: kc1 takes priority over kc2
- """
- merged_keymaps = [(km, kc1) for km in kc1.keymaps]
- if kc1 != kc2:
- merged_keymaps.extend((km, kc2) for km in kc2.keymaps if not _km_exists_in(km, merged_keymaps))
-
- return merged_keymaps
+from bpy.types import Menu, OperatorProperties
class USERPREF_MT_keyconfigs(Menu):
@@ -132,7 +27,7 @@ class USERPREF_MT_keyconfigs(Menu):
preset_operator = "wm.keyconfig_activate"
def draw(self, context):
- props = self.layout.operator("wm.context_set_value", text=_("Blender (default)"))
+ props = self.layout.operator("wm.context_set_value", text="Blender (default)")
props.data_path = "window_manager.keyconfigs.active"
props.value = "context.window_manager.keyconfigs.default"
@@ -183,7 +78,7 @@ class InputKeyMapPanel:
row = col.row()
row.prop(km, "show_expanded_children", text="", emboss=False)
- row.label(text=_(km.name))
+ row.label(text=km.name)
row.label()
row.label()
@@ -191,7 +86,7 @@ class InputKeyMapPanel:
if km.is_modal:
row.label(text="", icon='LINKED')
if km.is_user_modified:
- row.operator("wm.keymap_restore", text=_("Restore"))
+ row.operator("wm.keymap_restore", text="Restore")
else:
row.label()
@@ -202,7 +97,7 @@ class InputKeyMapPanel:
subcol = self.indented_layout(col, level + 1)
subrow = subcol.row()
subrow.prop(km, "show_expanded_items", text="", emboss=False)
- subrow.label(text="%s " % _(km.name) + _("(Global)") )
+ subrow.label(text="%s " % km.name + "(Global)")
else:
km.show_expanded_items = True
@@ -214,7 +109,7 @@ class InputKeyMapPanel:
# "Add New" at end of keymap item list
col = self.indented_layout(col, level + 1)
subcol = col.split(percentage=0.2).column()
- subcol.operator("wm.keyitem_add", text=_("Add New"), icon='ZOOMIN')
+ subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
col.separator()
@@ -226,19 +121,6 @@ class InputKeyMapPanel:
for entry in children:
self.draw_entry(display_keymaps, entry, col, level + 1)
- @staticmethod
- def draw_kmi_properties(box, properties, title=None):
- box.separator()
- if title:
- box.label(text=title)
- flow = box.column_flow(columns=2)
- for pname, value in properties.bl_rna.properties.items():
- if pname != "rna_type" and not properties.is_property_hidden(pname):
- if isinstance(value, OperatorProperties):
- InputKeyMapPanel.draw_kmi_properties(box, value, title=pname)
- else:
- flow.prop(properties, pname)
-
def draw_kmi(self, display_keymaps, kc, km, kmi, layout, level):
map_type = kmi.map_type
@@ -262,7 +144,7 @@ class InputKeyMapPanel:
if km.is_modal:
row.prop(kmi, "propvalue", text="")
else:
- row.label(text=_(kmi.name))
+ row.label(text=kmi.name)
row = split.row()
row.prop(kmi, "map_type", text="")
@@ -323,9 +205,7 @@ class InputKeyMapPanel:
subrow.prop(kmi, "key_modifier", text="", event=True)
# Operator properties
- props = kmi.properties
- if props is not None:
- InputKeyMapPanel.draw_kmi_properties(box, props)
+ box.template_keymap_item_properties(kmi)
# Modal key maps attached to this operator
if not km.is_modal:
@@ -351,7 +231,7 @@ class InputKeyMapPanel:
row.label()
if km.is_user_modified:
- row.operator("wm.keymap_restore", text=_("Restore"))
+ row.operator("wm.keymap_restore", text="Restore")
else:
row.label()
@@ -361,13 +241,16 @@ class InputKeyMapPanel:
# "Add New" at end of keymap item list
col = self.indented_layout(layout, 1)
subcol = col.split(percentage=0.2).column()
- subcol.operator("wm.keyitem_add", text=_("Add New"), icon='ZOOMIN')
+ subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
def draw_hierarchy(self, display_keymaps, layout):
- for entry in KM_HIERARCHY:
+ from bpy_extras import keyconfig_utils
+ for entry in keyconfig_utils.KM_HIERARCHY:
self.draw_entry(display_keymaps, entry, layout)
def draw_keymaps(self, context, layout):
+ from bpy_extras import keyconfig_utils
+
wm = context.window_manager
kc = wm.keyconfigs.user
@@ -382,7 +265,7 @@ class InputKeyMapPanel:
#row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:")
text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
if not text:
- text = _("Blender (default)")
+ text = "Blender (default)"
row.menu("USERPREF_MT_keyconfigs", text=text)
row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMIN")
row.operator("wm.keyconfig_preset_add", text="", icon="ZOOMOUT").remove_active = True
@@ -394,7 +277,7 @@ class InputKeyMapPanel:
col.separator()
- display_keymaps = _merge_keymaps(kc, kc)
+ display_keymaps = keyconfig_utils.keyconfig_merge(kc, kc)
if context.space_data.filter_text != "":
filter_text = context.space_data.filter_text.lower()
self.draw_filtered(display_keymaps, filter_text, col)
@@ -402,415 +285,5 @@ class InputKeyMapPanel:
self.draw_hierarchy(display_keymaps, col)
-from bpy.props import StringProperty, BoolProperty, IntProperty
-
-
-def export_properties(prefix, properties, lines=None):
- if lines is None:
- lines = []
-
- for pname in properties.bl_rna.properties.keys():
- if pname != "rna_type" and not properties.is_property_hidden(pname):
- value = getattr(properties, pname)
- if isinstance(value, OperatorProperties):
- export_properties(prefix + "." + pname, value, lines)
- elif properties.is_property_set(pname):
- value = _string_value(value)
- if value != "":
- lines.append("%s.%s = %s\n" % (prefix, pname, value))
- return lines
-
-
-class WM_OT_keyconfig_test(Operator):
- "Test keyconfig for conflicts"
- bl_idname = "wm.keyconfig_test"
- bl_label = _("Test Key Configuration for Conflicts")
-
- def testEntry(self, kc, entry, src=None, parent=None):
- result = False
-
- def kmistr(kmi):
- if km.is_modal:
- s = ["kmi = km.keymap_items.new_modal(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value)]
- else:
- s = ["kmi = km.keymap_items.new(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value)]
-
- if kmi.any:
- s.append(", any=True")
- else:
- if kmi.shift:
- s.append(", shift=True")
- if kmi.ctrl:
- s.append(", ctrl=True")
- if kmi.alt:
- s.append(", alt=True")
- if kmi.oskey:
- s.append(", oskey=True")
- if kmi.key_modifier and kmi.key_modifier != 'NONE':
- s.append(", key_modifier=\'%s\'" % kmi.key_modifier)
-
- s.append(")\n")
-
- props = kmi.properties
-
- if props is not None:
- export_properties("kmi.properties", props, s)
-
- return "".join(s).strip()
-
- idname, spaceid, regionid, children = entry
-
- km = kc.keymaps.find(idname, space_type=spaceid, region_type=regionid)
-
- if km:
- km = km.active()
-
- if src:
- for item in km.keymap_items:
- if src.compare(item):
- print("===========")
- print(parent.name)
- print(kmistr(src))
- print(km.name)
- print(kmistr(item))
- result = True
-
- for child in children:
- if self.testEntry(kc, child, src, parent):
- result = True
- else:
- for i in range(len(km.keymap_items)):
- src = km.keymap_items[i]
-
- for child in children:
- if self.testEntry(kc, child, src, km):
- result = True
-
- for j in range(len(km.keymap_items) - i - 1):
- item = km.keymap_items[j + i + 1]
- if src.compare(item):
- print("===========")
- print(km.name)
- print(kmistr(src))
- print(kmistr(item))
- result = True
-
- for child in children:
- if self.testEntry(kc, child):
- result = True
-
- return result
-
- def testConfig(self, kc):
- result = False
- for entry in KM_HIERARCHY:
- if self.testEntry(kc, entry):
- result = True
- return result
-
- def execute(self, context):
- wm = context.window_manager
- kc = wm.keyconfigs.default
-
- if self.testConfig(kc):
- print("CONFLICT")
-
- return {'FINISHED'}
-
-
-def _string_value(value):
- if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int):
- result = repr(value)
- elif getattr(value, '__len__', False):
- return repr(list(value))
- else:
- print("Export key configuration: can't write ", value)
-
- return result
-
-
-class WM_OT_keyconfig_import(Operator):
- "Import key configuration from a python script"
- bl_idname = "wm.keyconfig_import"
- bl_label = "Import Key Configuration..."
-
- filepath = StringProperty(
- name="File Path",
- description="Filepath to write file to",
- default="keymap.py",
- )
- filter_folder = BoolProperty(
- name="Filter folders",
- default=True,
- options={'HIDDEN'},
- )
- filter_text = BoolProperty(
- name="Filter text",
- default=True,
- options={'HIDDEN'},
- )
- filter_python = BoolProperty(
- name="Filter python",
- default=True,
- options={'HIDDEN'},
- )
- keep_original = BoolProperty(
- name="Keep original",
- description="Keep original file after copying to configuration folder",
- default=True,
- )
-
- def execute(self, context):
- from os.path import basename
- import shutil
-
- if not self.filepath:
- self.report({'ERROR'}, "Filepath not set")
- return {'CANCELLED'}
-
- config_name = basename(self.filepath)
-
- path = bpy.utils.user_resource('SCRIPTS', os.path.join("presets", "keyconfig"), create=True)
- path = os.path.join(path, config_name)
-
- try:
- if self.keep_original:
- shutil.copy(self.filepath, path)
- else:
- shutil.move(self.filepath, path)
- except Exception as e:
- self.report({'ERROR'}, "Installing keymap failed: %s" % e)
- return {'CANCELLED'}
-
- # sneaky way to check we're actually running the code.
- bpy.utils.keyconfig_set(path)
-
- return {'FINISHED'}
-
- def invoke(self, context, event):
- wm = context.window_manager
- wm.fileselect_add(self)
- return {'RUNNING_MODAL'}
-
-# This operator is also used by interaction presets saving - AddPresetBase
-
-
-class WM_OT_keyconfig_export(Operator):
- "Export key configuration to a python script"
- bl_idname = "wm.keyconfig_export"
- bl_label = _("Export Key Configuration...")
-
- filepath = StringProperty(
- name="File Path",
- description="Filepath to write file to",
- default="keymap.py",
- )
- filter_folder = BoolProperty(
- name="Filter folders",
- default=True,
- options={'HIDDEN'},
- )
- filter_text = BoolProperty(
- name="Filter text",
- default=True,
- options={'HIDDEN'},
- )
- filter_python = BoolProperty(
- name="Filter python",
- default=True,
- options={'HIDDEN'},
- )
-
- def execute(self, context):
- if not self.filepath:
- raise Exception("Filepath not set")
-
- if not self.filepath.endswith('.py'):
- self.filepath += '.py'
-
- f = open(self.filepath, "w")
- if not f:
- raise Exception("Could not open file")
-
- wm = context.window_manager
- kc = wm.keyconfigs.active
-
- f.write("import bpy\n")
- f.write("import os\n\n")
- f.write("wm = bpy.context.window_manager\n")
- f.write("kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])\n\n") # keymap must be created by caller
-
- # Generate a list of keymaps to export:
- #
- # First add all user_modified keymaps (found in keyconfigs.user.keymaps list),
- # then add all remaining keymaps from the currently active custom keyconfig.
- #
- # This will create a final list of keymaps that can be used as a 'diff' against
- # the default blender keyconfig, recreating the current setup from a fresh blender
- # without needing to export keymaps which haven't been edited.
-
- class FakeKeyConfig():
- keymaps = []
- edited_kc = FakeKeyConfig()
- for km in wm.keyconfigs.user.keymaps:
- if km.is_user_modified:
- edited_kc.keymaps.append(km)
- # merge edited keymaps with non-default keyconfig, if it exists
- if kc != wm.keyconfigs.default:
- export_keymaps = _merge_keymaps(edited_kc, kc)
- else:
- export_keymaps = _merge_keymaps(edited_kc, edited_kc)
-
- for km, kc_x in export_keymaps:
-
- km = km.active()
-
- f.write("# Map %s\n" % km.name)
- f.write("km = kc.keymaps.new('%s', space_type='%s', region_type='%s', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.is_modal))
- for kmi in km.keymap_items:
- if km.is_modal:
- f.write("kmi = km.keymap_items.new_modal('%s', '%s', '%s'" % (kmi.propvalue, kmi.type, kmi.value))
- else:
- f.write("kmi = km.keymap_items.new('%s', '%s', '%s'" % (kmi.idname, kmi.type, kmi.value))
- if kmi.any:
- f.write(", any=True")
- else:
- if kmi.shift:
- f.write(", shift=True")
- if kmi.ctrl:
- f.write(", ctrl=True")
- if kmi.alt:
- f.write(", alt=True")
- if kmi.oskey:
- f.write(", oskey=True")
- if kmi.key_modifier and kmi.key_modifier != 'NONE':
- f.write(", key_modifier='%s'" % kmi.key_modifier)
- f.write(")\n")
-
- props = kmi.properties
-
- if props is not None:
- f.write("".join(export_properties("kmi.properties", props)))
-
- f.write("\n")
-
- f.close()
-
- return {'FINISHED'}
-
- def invoke(self, context, event):
- wm = context.window_manager
- wm.fileselect_add(self)
- return {'RUNNING_MODAL'}
-
-
-class WM_OT_keymap_restore(Operator):
- "Restore key map(s)"
- bl_idname = "wm.keymap_restore"
- bl_label = "Restore Key Map(s)"
-
- all = BoolProperty(
- name="All Keymaps",
- description="Restore all keymaps to default",
- )
-
- def execute(self, context):
- wm = context.window_manager
-
- if self.all:
- for km in wm.keyconfigs.user.keymaps:
- km.restore_to_default()
- else:
- km = context.keymap
- km.restore_to_default()
-
- return {'FINISHED'}
-
-
-class WM_OT_keyitem_restore(Operator):
- "Restore key map item"
- bl_idname = "wm.keyitem_restore"
- bl_label = "Restore Key Map Item"
-
- item_id = IntProperty(
- name="Item Identifier",
- description="Identifier of the item to remove",
- )
-
- @classmethod
- def poll(cls, context):
- keymap = getattr(context, "keymap", None)
- return keymap
-
- def execute(self, context):
- km = context.keymap
- kmi = km.keymap_items.from_id(self.item_id)
-
- if (not kmi.is_user_defined) and kmi.is_user_modified:
- km.restore_item_to_default(kmi)
-
- return {'FINISHED'}
-
-
-class WM_OT_keyitem_add(Operator):
- "Add key map item"
- bl_idname = "wm.keyitem_add"
- bl_label = "Add Key Map Item"
-
- def execute(self, context):
- km = context.keymap
-
- if km.is_modal:
- km.keymap_items.new_modal("", 'A', 'PRESS') # kmi
- else:
- km.keymap_items.new("none", 'A', 'PRESS') # kmi
-
- # clear filter and expand keymap so we can see the newly added item
- if context.space_data.filter_text != "":
- context.space_data.filter_text = ""
- km.show_expanded_items = True
- km.show_expanded_children = True
-
- return {'FINISHED'}
-
-
-class WM_OT_keyitem_remove(Operator):
- "Remove key map item"
- bl_idname = "wm.keyitem_remove"
- bl_label = "Remove Key Map Item"
-
- item_id = IntProperty(
- name="Item Identifier",
- description="Identifier of the item to remove",
- )
-
- @classmethod
- def poll(cls, context):
- return hasattr(context, "keymap")
-
- def execute(self, context):
- km = context.keymap
- kmi = km.keymap_items.from_id(self.item_id)
- km.keymap_items.remove(kmi)
- return {'FINISHED'}
-
-
-class WM_OT_keyconfig_remove(Operator):
- "Remove key config"
- bl_idname = "wm.keyconfig_remove"
- bl_label = "Remove Key Config"
-
- @classmethod
- def poll(cls, context):
- wm = context.window_manager
- keyconf = wm.keyconfigs.active
- return keyconf and keyconf.is_user_defined
-
- def execute(self, context):
- wm = context.window_manager
- keyconfig = wm.keyconfigs.active
- wm.keyconfigs.remove(keyconfig)
- return {'FINISHED'}
-
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 658289c7f7b..c35b765c795 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -18,8 +18,7 @@
# <pep8 compliant>
import bpy
-from bpy.types import Header, Menu, Operator, Panel
-from blf import gettext as _
+from bpy.types import Header, Menu, Panel
class VIEW3D_HT_header(Header):
@@ -125,9 +124,9 @@ class ShowHideMenu():
def draw(self, context):
layout = self.layout
- layout.operator("%s.reveal" % self._operator_name, text=_("Show Hidden"))
- layout.operator("%s.hide" % self._operator_name, text=_("Hide Selected"))
- layout.operator("%s.hide" % self._operator_name, text=_("Hide Unselected")).unselected = True
+ layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
+ layout.operator("%s.hide" % self._operator_name, text="Hide Selected")
+ layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
class VIEW3D_MT_transform(Menu):
@@ -146,35 +145,35 @@ class VIEW3D_MT_transform(Menu):
layout.separator()
- layout.operator("transform.tosphere", text=_("To Sphere"))
- layout.operator("transform.shear", text=_("Shear"))
- layout.operator("transform.warp", text=_("Warp"))
- layout.operator("transform.push_pull", text=_("Push/Pull"))
+ layout.operator("transform.tosphere", text="To Sphere")
+ layout.operator("transform.shear", text="Shear")
+ layout.operator("transform.warp", text="Warp")
+ layout.operator("transform.push_pull", text="Push/Pull")
layout.separator()
- layout.operator("transform.translate", text=_("Move Texture Space")).texture_space = True
- layout.operator("transform.resize", text=_("Scale Texture Space")).texture_space = True
+ layout.operator("transform.translate", text="Move Texture Space").texture_space = True
+ layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
layout.separator()
obj = context.object
if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'} and obj.data.draw_type in {'BBONE', 'ENVELOPE'}:
- layout.operator("transform.transform", text=_("Scale Envelope/BBone")).mode = 'BONE_SIZE'
+ layout.operator("transform.transform", text="Scale Envelope/BBone").mode = 'BONE_SIZE'
if context.edit_object and context.edit_object.type == 'ARMATURE':
layout.operator("armature.align")
else:
layout.operator_context = 'EXEC_REGION_WIN'
- layout.operator("transform.transform", text=_("Align to Transform Orientation")).mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
+ layout.operator("transform.transform", text="Align to Transform Orientation").mode = 'ALIGN' # XXX see alignmenu() in edit.c of b2.4x to get this working
layout.separator()
layout.operator_context = 'EXEC_AREA'
- layout.operator("object.origin_set", text=_("Geometry to Origin")).type = 'GEOMETRY_ORIGIN'
- layout.operator("object.origin_set", text=_("Origin to Geometry")).type = 'ORIGIN_GEOMETRY'
- layout.operator("object.origin_set", text=_("Origin to 3D Cursor")).type = 'ORIGIN_CURSOR'
+ layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
+ layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
+ layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
layout.separator()
@@ -192,32 +191,32 @@ class VIEW3D_MT_mirror(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("transform.mirror", text=_("Interactive Mirror"))
+ layout.operator("transform.mirror", text="Interactive Mirror")
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
- props = layout.operator("transform.mirror", text=_("X Global"))
+ props = layout.operator("transform.mirror", text="X Global")
props.constraint_axis = (True, False, False)
props.constraint_orientation = 'GLOBAL'
- props = layout.operator("transform.mirror", text=_("Y Global"))
+ props = layout.operator("transform.mirror", text="Y Global")
props.constraint_axis = (False, True, False)
props.constraint_orientation = 'GLOBAL'
- props = layout.operator("transform.mirror", text=_("Z Global"))
+ props = layout.operator("transform.mirror", text="Z Global")
props.constraint_axis = (False, False, True)
props.constraint_orientation = 'GLOBAL'
if context.edit_object:
layout.separator()
- props = layout.operator("transform.mirror", text=_("X Local"))
+ props = layout.operator("transform.mirror", text="X Local")
props.constraint_axis = (True, False, False)
props.constraint_orientation = 'LOCAL'
- props = layout.operator("transform.mirror", text=_("Y Local"))
+ props = layout.operator("transform.mirror", text="Y Local")
props.constraint_axis = (False, True, False)
props.constraint_orientation = 'LOCAL'
- props = layout.operator("transform.mirror", text=_("Z Local"))
+ props = layout.operator("transform.mirror", text="Z Local")
props.constraint_axis = (False, False, True)
props.constraint_orientation = 'LOCAL'
@@ -230,15 +229,15 @@ class VIEW3D_MT_snap(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("view3d.snap_selected_to_grid", text=_("Selection to Grid"))
- layout.operator("view3d.snap_selected_to_cursor", text=_("Selection to Cursor"))
+ layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
+ layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
layout.separator()
- layout.operator("view3d.snap_cursor_to_selected", text=_("Cursor to Selected"))
- layout.operator("view3d.snap_cursor_to_center", text=_("Cursor to Center"))
- layout.operator("view3d.snap_cursor_to_grid", text=_("Cursor to Grid"))
- layout.operator("view3d.snap_cursor_to_active", text=_("Cursor to Active"))
+ layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
+ layout.operator("view3d.snap_cursor_to_center", text="Cursor to Center")
+ layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
+ layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
class VIEW3D_MT_uv_map(Menu):
@@ -264,7 +263,7 @@ class VIEW3D_MT_uv_map(Menu):
layout.separator()
layout.operator("uv.project_from_view")
- layout.operator("uv.project_from_view", text=_("Project from View (Bounds)")).scale_to_bounds = True
+ layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
layout.separator()
@@ -286,15 +285,15 @@ class VIEW3D_MT_view(Menu):
layout.separator()
- layout.operator("view3d.viewnumpad", text=_("Camera")).type = 'CAMERA'
- layout.operator("view3d.viewnumpad", text=_("Top")).type = 'TOP'
- layout.operator("view3d.viewnumpad", text=_("Bottom")).type = 'BOTTOM'
- layout.operator("view3d.viewnumpad", text=_("Front")).type = 'FRONT'
- layout.operator("view3d.viewnumpad", text=_("Back")).type = 'BACK'
- layout.operator("view3d.viewnumpad", text=_("Right")).type = 'RIGHT'
- layout.operator("view3d.viewnumpad", text=_("Left")).type = 'LEFT'
+ layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA'
+ layout.operator("view3d.viewnumpad", text="Top").type = 'TOP'
+ layout.operator("view3d.viewnumpad", text="Bottom").type = 'BOTTOM'
+ layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT'
+ layout.operator("view3d.viewnumpad", text="Back").type = 'BACK'
+ layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT'
+ layout.operator("view3d.viewnumpad", text="Left").type = 'LEFT'
- layout.menu("VIEW3D_MT_view_cameras", text=_("Cameras"))
+ layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
layout.separator()
@@ -309,22 +308,22 @@ class VIEW3D_MT_view(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("view3d.clip_border", text=_("Clipping Border..."))
- layout.operator("view3d.zoom_border", text=_("Zoom Border..."))
+ layout.operator("view3d.clip_border", text="Clipping Border...")
+ layout.operator("view3d.zoom_border", text="Zoom Border...")
layout.separator()
- layout.operator("view3d.layers", text=_("Show All Layers")).nr = 0
+ layout.operator("view3d.layers", text="Show All Layers").nr = 0
layout.separator()
- layout.operator("view3d.localview", text=_("View Global/Local"))
+ layout.operator("view3d.localview", text="View Global/Local")
layout.operator("view3d.view_selected")
layout.operator("view3d.view_all")
layout.separator()
- layout.operator("screen.animation_play", text=_("Playback Animation"))
+ layout.operator("screen.animation_play", text="Playback Animation")
layout.separator()
@@ -347,9 +346,9 @@ class VIEW3D_MT_view_navigation(Menu):
layout.separator()
- layout.operator("view3d.zoom", text=_("Zoom In")).delta = 1
- layout.operator("view3d.zoom", text=_("Zoom Out")).delta = -1
- layout.operator("view3d.zoom_camera_1_to_1", text=_("Zoom Camera 1:1"))
+ layout.operator("view3d.zoom", text="Zoom In").delta = 1
+ layout.operator("view3d.zoom", text="Zoom Out").delta = -1
+ layout.operator("view3d.zoom_camera_1_to_1", text="Zoom Camera 1:1")
layout.separator()
@@ -366,8 +365,8 @@ class VIEW3D_MT_view_align(Menu):
layout.separator()
- layout.operator("view3d.view_all", text=_("Center Cursor and View All")).center = True
- layout.operator("view3d.camera_to_view", text=_("Align Active Camera to View"))
+ layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
+ layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
layout.operator("view3d.view_selected")
layout.operator("view3d.view_center_cursor")
@@ -378,22 +377,22 @@ class VIEW3D_MT_view_align_selected(Menu):
def draw(self, context):
layout = self.layout
- props = layout.operator("view3d.viewnumpad", text=_("Top"))
+ props = layout.operator("view3d.viewnumpad", text="Top")
props.align_active = True
props.type = 'TOP'
- props = layout.operator("view3d.viewnumpad", text=_("Bottom"))
+ props = layout.operator("view3d.viewnumpad", text="Bottom")
props.align_active = True
props.type = 'BOTTOM'
- props = layout.operator("view3d.viewnumpad", text=_("Front"))
+ props = layout.operator("view3d.viewnumpad", text="Front")
props.align_active = True
props.type = 'FRONT'
- props = layout.operator("view3d.viewnumpad", text=_("Back"))
+ props = layout.operator("view3d.viewnumpad", text="Back")
props.align_active = True
props.type = 'BACK'
- props = layout.operator("view3d.viewnumpad", text=_("Right"))
+ props = layout.operator("view3d.viewnumpad", text="Right")
props.align_active = True
props.type = 'RIGHT'
- props = layout.operator("view3d.viewnumpad", text=_("Left"))
+ props = layout.operator("view3d.viewnumpad", text="Left")
props.align_active = True
props.type = 'LEFT'
@@ -405,7 +404,7 @@ class VIEW3D_MT_view_cameras(Menu):
layout = self.layout
layout.operator("view3d.object_as_camera")
- layout.operator("view3d.viewnumpad", text=_("Active Camera")).type = 'CAMERA'
+ layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA'
# ********** Select menus, suffix from context.mode **********
@@ -421,19 +420,19 @@ class VIEW3D_MT_select_object(Menu):
layout.separator()
- layout.operator("object.select_all", text=_("Select/Deselect All"))
- layout.operator("object.select_inverse", text=_("Inverse"))
- layout.operator("object.select_random", text=_("Random"))
- layout.operator("object.select_mirror", text=_("Mirror"))
- layout.operator("object.select_by_layer", text=_("Select All by Layer"))
- layout.operator_menu_enum("object.select_by_type", "type", text=_("Select All by Type..."))
- layout.operator("object.select_camera", text=_("Select Camera"))
+ layout.operator("object.select_all", text="Select/Deselect All")
+ layout.operator("object.select_inverse", text="Inverse")
+ layout.operator("object.select_random", text="Random")
+ layout.operator("object.select_mirror", text="Mirror")
+ layout.operator("object.select_by_layer", text="Select All by Layer")
+ layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
+ layout.operator("object.select_camera", text="Select Camera")
layout.separator()
- layout.operator_menu_enum("object.select_grouped", "type", text=_("Grouped"))
- layout.operator_menu_enum("object.select_linked", "type", text=_("Linked"))
- layout.operator("object.select_pattern", text=_("Select Pattern..."))
+ layout.operator_menu_enum("object.select_grouped", "type", text="Grouped")
+ layout.operator_menu_enum("object.select_linked", "type", text="Linked")
+ layout.operator("object.select_pattern", text="Select Pattern...")
class VIEW3D_MT_select_pose(Menu):
@@ -446,31 +445,31 @@ class VIEW3D_MT_select_pose(Menu):
layout.separator()
- layout.operator("pose.select_all", text=_("Select/Deselect All"))
- layout.operator("pose.select_inverse", text=_("Inverse"))
- layout.operator("pose.select_flip_active", text=_("Flip Active"))
- layout.operator("pose.select_constraint_target", text=_("Constraint Target"))
- layout.operator("pose.select_linked", text=_("Linked"))
+ layout.operator("pose.select_all", text="Select/Deselect All")
+ layout.operator("pose.select_inverse", text="Inverse")
+ layout.operator("pose.select_flip_active", text="Flip Active")
+ layout.operator("pose.select_constraint_target", text="Constraint Target")
+ layout.operator("pose.select_linked", text="Linked")
layout.separator()
- layout.operator("pose.select_hierarchy", text=_("Parent")).direction = 'PARENT'
- layout.operator("pose.select_hierarchy", text=_("Child")).direction = 'CHILD'
+ layout.operator("pose.select_hierarchy", text="Parent").direction = 'PARENT'
+ layout.operator("pose.select_hierarchy", text="Child").direction = 'CHILD'
layout.separator()
- props = layout.operator("pose.select_hierarchy", text=_("Extend Parent"))
+ props = layout.operator("pose.select_hierarchy", text="Extend Parent")
props.extend = True
props.direction = 'PARENT'
- props = layout.operator("pose.select_hierarchy", text=_("Extend Child"))
+ props = layout.operator("pose.select_hierarchy", text="Extend Child")
props.extend = True
props.direction = 'CHILD'
layout.separator()
- layout.operator_menu_enum("pose.select_grouped", "type", text=_("Grouped"))
- layout.operator("object.select_pattern", text=_("Select Pattern..."))
+ layout.operator_menu_enum("pose.select_grouped", "type", text="Grouped")
+ layout.operator("object.select_pattern", text="Select Pattern...")
class VIEW3D_MT_select_particle(Menu):
@@ -483,7 +482,7 @@ class VIEW3D_MT_select_particle(Menu):
layout.separator()
- layout.operator("particle.select_all", text=_("Select/Deselect All"))
+ layout.operator("particle.select_all", text="Select/Deselect All")
layout.operator("particle.select_linked")
layout.operator("particle.select_inverse")
@@ -494,8 +493,8 @@ class VIEW3D_MT_select_particle(Menu):
layout.separator()
- layout.operator("particle.select_roots", text=_("Roots"))
- layout.operator("particle.select_tips", text=_("Tips"))
+ layout.operator("particle.select_roots", text="Roots")
+ layout.operator("particle.select_tips", text="Tips")
class VIEW3D_MT_select_edit_mesh(Menu):
@@ -509,40 +508,40 @@ class VIEW3D_MT_select_edit_mesh(Menu):
layout.separator()
- layout.operator("mesh.select_all", text=_("Select/Deselect All"))
- layout.operator("mesh.select_inverse", text=_("Inverse"))
+ layout.operator("mesh.select_all", text="Select/Deselect All")
+ layout.operator("mesh.select_inverse", text="Inverse")
layout.separator()
- layout.operator("mesh.select_random", text=_("Random"))
- layout.operator("mesh.select_nth", text=_("Every N Number of Verts"))
- layout.operator("mesh.edges_select_sharp", text=_("Sharp Edges"))
- layout.operator("mesh.faces_select_linked_flat", text=_("Linked Flat Faces"))
- layout.operator("mesh.faces_select_interior", text=_("Interior Faces"))
- layout.operator("mesh.select_axis", text=_("Side of Active"))
+ layout.operator("mesh.select_random", text="Random")
+ layout.operator("mesh.select_nth", text="Every N Number of Verts")
+ layout.operator("mesh.edges_select_sharp", text="Sharp Edges")
+ layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
+ layout.operator("mesh.faces_select_interior", text="Interior Faces")
+ layout.operator("mesh.select_axis", text="Side of Active")
layout.separator()
- layout.operator("mesh.select_by_number_vertices", text=_("Triangles")).type = 'TRIANGLES'
- layout.operator("mesh.select_by_number_vertices", text=_("Quads")).type = 'QUADS'
+ layout.operator("mesh.select_by_number_vertices", text="Triangles").type = 'TRIANGLES'
+ layout.operator("mesh.select_by_number_vertices", text="Quads").type = 'QUADS'
if context.scene.tool_settings.mesh_select_mode[2] == False:
- layout.operator("mesh.select_non_manifold", text=_("Non Manifold"))
- layout.operator("mesh.select_by_number_vertices", text=_("Loose Verts/Edges")).type = 'OTHER'
- layout.operator("mesh.select_similar", text=_("Similar"))
+ layout.operator("mesh.select_non_manifold", text="Non Manifold")
+ layout.operator("mesh.select_by_number_vertices", text="Loose Verts/Edges").type = 'OTHER'
+ layout.operator("mesh.select_similar", text="Similar")
layout.separator()
- layout.operator("mesh.select_less", text=_("Less"))
- layout.operator("mesh.select_more", text=_("More"))
+ layout.operator("mesh.select_less", text="Less")
+ layout.operator("mesh.select_more", text="More")
layout.separator()
- layout.operator("mesh.select_mirror", text=_("Mirror"))
+ layout.operator("mesh.select_mirror", text="Mirror")
- layout.operator("mesh.select_linked", text=_("Linked"))
- layout.operator("mesh.select_vertex_path", text=_("Vertex Path"))
- layout.operator("mesh.loop_multi_select", text=_("Edge Loop"))
- layout.operator("mesh.loop_multi_select", text=_("Edge Ring")).ring = True
+ layout.operator("mesh.select_linked", text="Linked")
+ layout.operator("mesh.select_vertex_path", text="Vertex Path")
+ layout.operator("mesh.loop_multi_select", text="Edge Loop")
+ layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
layout.separator()
@@ -561,10 +560,10 @@ class VIEW3D_MT_select_edit_curve(Menu):
layout.separator()
- layout.operator("curve.select_all", text=_("Select/Deselect All"))
+ layout.operator("curve.select_all", text="Select/Deselect All")
layout.operator("curve.select_inverse")
layout.operator("curve.select_random")
- layout.operator("curve.select_nth", text=_("Every Nth Number of Points"))
+ layout.operator("curve.select_nth", text="Every Nth Number of Points")
layout.separator()
@@ -590,10 +589,10 @@ class VIEW3D_MT_select_edit_surface(Menu):
layout.separator()
- layout.operator("curve.select_all", text=_("Select/Deselect All"))
+ layout.operator("curve.select_all", text="Select/Deselect All")
layout.operator("curve.select_inverse")
layout.operator("curve.select_random")
- layout.operator("curve.select_nth", text=_("Every Nth Number of Points"))
+ layout.operator("curve.select_nth", text="Every Nth Number of Points")
layout.separator()
@@ -633,7 +632,7 @@ class VIEW3D_MT_select_edit_lattice(Menu):
layout.separator()
- layout.operator("lattice.select_all", text=_("Select/Deselect All"))
+ layout.operator("lattice.select_all", text="Select/Deselect All")
class VIEW3D_MT_select_edit_armature(Menu):
@@ -646,25 +645,25 @@ class VIEW3D_MT_select_edit_armature(Menu):
layout.separator()
- layout.operator("armature.select_all", text=_("Select/Deselect All"))
- layout.operator("armature.select_inverse", text=_("Inverse"))
+ layout.operator("armature.select_all", text="Select/Deselect All")
+ layout.operator("armature.select_inverse", text="Inverse")
layout.separator()
- layout.operator("armature.select_hierarchy", text=_("Parent")).direction = 'PARENT'
- layout.operator("armature.select_hierarchy", text=_("Child")).direction = 'CHILD'
+ layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
+ layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
layout.separator()
- props = layout.operator("armature.select_hierarchy", text=_("Extend Parent"))
+ props = layout.operator("armature.select_hierarchy", text="Extend Parent")
props.extend = True
props.direction = 'PARENT'
- props = layout.operator("armature.select_hierarchy", text=_("Extend Child"))
+ props = layout.operator("armature.select_hierarchy", text="Extend Child")
props.extend = True
props.direction = 'CHILD'
- layout.operator("object.select_pattern", text=_("Select Pattern..."))
+ layout.operator("object.select_pattern", text="Select Pattern...")
class VIEW3D_MT_select_face(Menu): # XXX no matching enum
@@ -707,11 +706,11 @@ class VIEW3D_MT_object(Menu):
layout.operator("object.duplicate_move")
layout.operator("object.duplicate_move_linked")
- layout.operator("object.delete", text=_("Delete..."))
- layout.operator("object.proxy_make", text=_("Make Proxy..."))
- layout.menu("VIEW3D_MT_make_links", text=_("Make Links..."))
+ layout.operator("object.delete", text="Delete...")
+ layout.operator("object.proxy_make", text="Make Proxy...")
+ layout.menu("VIEW3D_MT_make_links", text="Make Links...")
layout.operator("object.make_dupli_face")
- layout.operator_menu_enum("object.make_local", "type", text=_("Make Local..."))
+ layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
layout.menu("VIEW3D_MT_make_single_user")
layout.separator()
@@ -723,16 +722,19 @@ class VIEW3D_MT_object(Menu):
layout.separator()
+ layout.menu("VIEW3D_MT_object_quick_effects")
+
+ layout.separator()
+
layout.menu("VIEW3D_MT_object_game")
layout.separator()
- layout.operator("object.join_uvs")
layout.operator("object.join")
layout.separator()
- layout.operator("object.move_to_layer", text=_("Move to Layer..."))
+ layout.operator("object.move_to_layer", text="Move to Layer...")
layout.menu("VIEW3D_MT_object_showhide")
layout.operator_menu_enum("object.convert", "target")
@@ -744,9 +746,9 @@ class VIEW3D_MT_object_animation(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("anim.keyframe_insert_menu", text=_("Insert Keyframe..."))
- layout.operator("anim.keyframe_delete_v3d", text=_("Delete Keyframe..."))
- layout.operator("anim.keying_set_active_set", text=_("Change Keying Set..."))
+ layout.operator("anim.keyframe_insert_menu", text="Insert Keyframe...")
+ layout.operator("anim.keyframe_delete_v3d", text="Delete Keyframe...")
+ layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
class VIEW3D_MT_object_clear(Menu):
@@ -755,10 +757,10 @@ class VIEW3D_MT_object_clear(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("object.location_clear", text=_("Location"))
- layout.operator("object.rotation_clear", text=_("Rotation"))
- layout.operator("object.scale_clear", text=_("Scale"))
- layout.operator("object.origin_clear", text=_("Origin"))
+ layout.operator("object.location_clear", text="Location")
+ layout.operator("object.rotation_clear", text="Rotation")
+ layout.operator("object.scale_clear", text="Scale")
+ layout.operator("object.origin_clear", text="Origin")
class VIEW3D_MT_object_specials(Menu):
@@ -777,19 +779,19 @@ class VIEW3D_MT_object_specials(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
if obj.data.type == 'PERSP':
- props = layout.operator("wm.context_modal_mouse", text=_("Camera Lens Angle"))
+ props = layout.operator("wm.context_modal_mouse", text="Camera Lens Angle")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.lens"
props.input_scale = 0.1
else:
- props = layout.operator("wm.context_modal_mouse", text=_("Camera Lens Scale"))
+ props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.ortho_scale"
props.input_scale = 0.01
if not obj.data.dof_object:
#layout.label(text="Test Has DOF obj");
- props = layout.operator("wm.context_modal_mouse", text=_("DOF Distance"))
+ props = layout.operator("wm.context_modal_mouse", text="DOF Distance")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.dof_distance"
props.input_scale = 0.02
@@ -797,12 +799,12 @@ class VIEW3D_MT_object_specials(Menu):
if obj.type in {'CURVE', 'FONT'}:
layout.operator_context = 'INVOKE_REGION_WIN'
- props = layout.operator("wm.context_modal_mouse", text=_("Extrude Size"))
+ props = layout.operator("wm.context_modal_mouse", text="Extrude Size")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.extrude"
props.input_scale = 0.01
- props = layout.operator("wm.context_modal_mouse", text=_("Width Size"))
+ props = layout.operator("wm.context_modal_mouse", text="Width Size")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.offset"
props.input_scale = 0.01
@@ -810,7 +812,7 @@ class VIEW3D_MT_object_specials(Menu):
if obj.type == 'EMPTY':
layout.operator_context = 'INVOKE_REGION_WIN'
- props = layout.operator("wm.context_modal_mouse", text=_("Empty Draw Size"))
+ props = layout.operator("wm.context_modal_mouse", text="Empty Draw Size")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "empty_draw_size"
props.input_scale = 0.01
@@ -818,34 +820,34 @@ class VIEW3D_MT_object_specials(Menu):
if obj.type == 'LAMP':
layout.operator_context = 'INVOKE_REGION_WIN'
- props = layout.operator("wm.context_modal_mouse", text=_("Energy"))
+ props = layout.operator("wm.context_modal_mouse", text="Energy")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.energy"
if obj.data.type in {'SPOT', 'AREA', 'POINT'}:
- props = layout.operator("wm.context_modal_mouse", text=_("Falloff Distance"))
+ props = layout.operator("wm.context_modal_mouse", text="Falloff Distance")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.distance"
props.input_scale = 0.1
if obj.data.type == 'SPOT':
layout.separator()
- props = layout.operator("wm.context_modal_mouse", text=_("Spot Size"))
+ props = layout.operator("wm.context_modal_mouse", text="Spot Size")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.spot_size"
props.input_scale = 0.01
- props = layout.operator("wm.context_modal_mouse", text=_("Spot Blend"))
+ props = layout.operator("wm.context_modal_mouse", text="Spot Blend")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.spot_blend"
props.input_scale = -0.01
- props = layout.operator("wm.context_modal_mouse", text=_("Clip Start"))
+ props = layout.operator("wm.context_modal_mouse", text="Clip Start")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.shadow_buffer_clip_start"
props.input_scale = 0.05
- props = layout.operator("wm.context_modal_mouse", text=_("Clip End"))
+ props = layout.operator("wm.context_modal_mouse", text="Clip End")
props.data_path_iter = "selected_editable_objects"
props.data_path_item = "data.shadow_buffer_clip_end"
props.input_scale = 0.05
@@ -862,16 +864,16 @@ class VIEW3D_MT_object_apply(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("object.transform_apply", text=_("Location")).location = True
- layout.operator("object.transform_apply", text=_("Rotation")).rotation = True
- layout.operator("object.transform_apply", text=_("Scale")).scale = True
- props = layout.operator("object.transform_apply", text=_("Rotation & Scale"))
+ layout.operator("object.transform_apply", text="Location").location = True
+ layout.operator("object.transform_apply", text="Rotation").rotation = True
+ layout.operator("object.transform_apply", text="Scale").scale = True
+ props = layout.operator("object.transform_apply", text="Rotation & Scale")
props.scale = True
props.rotation = True
layout.separator()
- layout.operator("object.visual_transform_apply", text=_("Visual Transform"))
+ layout.operator("object.visual_transform_apply", text="Visual Transform")
layout.operator("object.duplicates_make_real")
@@ -881,8 +883,8 @@ class VIEW3D_MT_object_parent(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("object.parent_set", text=_("Set"))
- layout.operator("object.parent_clear", text=_("Clear"))
+ layout.operator_menu_enum("object.parent_set", "type", text="Set")
+ layout.operator_menu_enum("object.parent_clear", "type", text="Clear")
class VIEW3D_MT_object_track(Menu):
@@ -891,8 +893,8 @@ class VIEW3D_MT_object_track(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("object.track_set", text=_("Set"))
- layout.operator("object.track_clear", text=_("Clear"))
+ layout.operator_menu_enum("object.track_set", "type", text="Set")
+ layout.operator_menu_enum("object.track_clear", "type", text="Clear")
class VIEW3D_MT_object_group(Menu):
@@ -921,15 +923,27 @@ class VIEW3D_MT_object_constraints(Menu):
layout.operator("object.constraints_clear")
+class VIEW3D_MT_object_quick_effects(Menu):
+ bl_label = "Quick Effects"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator("object.quick_fur")
+ layout.operator("object.quick_explode")
+ layout.operator("object.quick_smoke")
+ layout.operator("object.quick_fluid")
+
+
class VIEW3D_MT_object_showhide(Menu):
bl_label = "Show/Hide"
def draw(self, context):
layout = self.layout
- layout.operator("object.hide_view_clear", text=_("Show Hidden"))
- layout.operator("object.hide_view_set", text=_("Hide Selected"))
- layout.operator("object.hide_view_set", text=_("Hide Unselected")).unselected = True
+ layout.operator("object.hide_view_clear", text="Show Hidden")
+ layout.operator("object.hide_view_set", text="Hide Selected")
+ layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
class VIEW3D_MT_make_single_user(Menu):
@@ -938,19 +952,19 @@ class VIEW3D_MT_make_single_user(Menu):
def draw(self, context):
layout = self.layout
- props = layout.operator("object.make_single_user", text=_("Object"))
+ props = layout.operator("object.make_single_user", text="Object")
props.object = True
- props = layout.operator("object.make_single_user", text=_("Object & Data"))
+ props = layout.operator("object.make_single_user", text="Object & Data")
props.object = props.obdata = True
- props = layout.operator("object.make_single_user", text=_("Object & Data & Materials+Tex"))
+ props = layout.operator("object.make_single_user", text="Object & Data & Materials+Tex")
props.object = props.obdata = props.material = props.texture = True
- props = layout.operator("object.make_single_user", text=_("Materials+Tex"))
+ props = layout.operator("object.make_single_user", text="Materials+Tex")
props.material = props.texture = True
- props = layout.operator("object.make_single_user", text=_("Object Animation"))
+ props = layout.operator("object.make_single_user", text="Object Animation")
props.animation = True
@@ -962,14 +976,15 @@ 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')
+ 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_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
+ layout.operator("object.join_uvs") # stupid place to add this!
class VIEW3D_MT_object_game(Menu):
bl_label = "Game"
@@ -977,13 +992,13 @@ class VIEW3D_MT_object_game(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("object.logic_bricks_copy", text=_("Copy Logic Bricks"))
+ layout.operator("object.logic_bricks_copy", text="Copy Logic Bricks")
layout.separator()
- layout.operator("object.game_property_copy", text=_("Replace Properties")).operation = 'REPLACE'
- layout.operator("object.game_property_copy", text=_("Merge Properties")).operation = 'MERGE'
- layout.operator_menu_enum("object.game_property_copy", "property", text=_("Copy Properties..."))
+ layout.operator("object.game_property_copy", text="Replace Properties").operation = 'REPLACE'
+ layout.operator("object.game_property_copy", text="Merge Properties").operation = 'MERGE'
+ layout.operator_menu_enum("object.game_property_copy", "property", text="Copy Properties...")
layout.separator()
@@ -1033,21 +1048,21 @@ class VIEW3D_MT_vertex_group(Menu):
def draw(self, context):
layout = self.layout
layout.operator_context = 'EXEC_AREA'
- layout.operator("object.vertex_group_assign", text=_("Assign to New Group")).new = True
+ layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True
ob = context.active_object
if ob.mode == 'EDIT':
if ob.vertex_groups.active:
layout.separator()
- layout.operator("object.vertex_group_assign", text=_("Assign to Active Group"))
- layout.operator("object.vertex_group_remove_from", text=_("Remove from Active Group"))
- layout.operator("object.vertex_group_remove_from", text=_("Remove from All")).all = True
+ layout.operator("object.vertex_group_assign", text="Assign to Active Group")
+ layout.operator("object.vertex_group_remove_from", text="Remove from Active Group")
+ layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
layout.separator()
if ob.vertex_groups.active:
- layout.operator_menu_enum("object.vertex_group_set_active", "group", text=_("Set Active Group"))
- layout.operator("object.vertex_group_remove", text=_("Remove Active Group"))
- layout.operator("object.vertex_group_remove", text=_("Remove All Groups")).all = True
+ layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
+ layout.operator("object.vertex_group_remove", text="Remove Active Group")
+ layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
# ********** Weight paint menu **********
@@ -1064,16 +1079,16 @@ class VIEW3D_MT_paint_weight(Menu):
layout.separator()
- layout.operator("paint.weight_from_bones", text=_("Assign Automatic From Bones")).type = 'AUTOMATIC'
- layout.operator("paint.weight_from_bones", text=_("Assign From Bone Envelopes")).type = 'ENVELOPES'
+ layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
+ layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
layout.separator()
- layout.operator("object.vertex_group_normalize_all", text=_("Normalize All"))
- layout.operator("object.vertex_group_normalize", text=_("Normalize"))
- layout.operator("object.vertex_group_invert", text=_("Invert"))
- layout.operator("object.vertex_group_clean", text=_("Clean"))
- layout.operator("object.vertex_group_levels", text=_("Levels"))
+ layout.operator("object.vertex_group_normalize_all", text="Normalize All")
+ layout.operator("object.vertex_group_normalize", text="Normalize")
+ layout.operator("object.vertex_group_invert", text="Invert")
+ layout.operator("object.vertex_group_clean", text="Clean")
+ layout.operator("object.vertex_group_levels", text="Levels")
layout.operator("object.vertex_group_fix", text="Fix Deforms")
layout.separator()
@@ -1123,12 +1138,12 @@ class VIEW3D_MT_sculpt(Menu):
layout.operator("sculpt.set_persistent_base")
layout.separator()
- layout.prop(sculpt, "use_threaded", text=_("Threaded Sculpt"))
+ layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
layout.prop(sculpt, "show_brush")
# TODO, make availabel from paint menu!
- layout.prop(tool_settings, "sculpt_paint_use_unified_size", text=_("Unify Size"))
- layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text=_("Unify Strength"))
+ layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Unify Size")
+ layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Unify Strength")
# ********** Particle menu **********
@@ -1221,7 +1236,7 @@ class VIEW3D_MT_pose(Menu):
layout.operator("pose.copy")
layout.operator("pose.paste")
- layout.operator("pose.paste", text=_("Paste X-Flipped Pose")).flipped = True
+ layout.operator("pose.paste", text="Paste X-Flipped Pose").flipped = True
layout.separator()
@@ -1238,9 +1253,9 @@ class VIEW3D_MT_pose(Menu):
layout.separator()
layout.operator_context = 'EXEC_AREA'
- layout.operator("pose.autoside_names", text=_("AutoName Left/Right")).axis = 'XAXIS'
- layout.operator("pose.autoside_names", text=_("AutoName Front/Back")).axis = 'YAXIS'
- layout.operator("pose.autoside_names", text=_("AutoName Top/Bottom")).axis = 'ZAXIS'
+ layout.operator("pose.autoside_names", text="AutoName Left/Right").axis = 'XAXIS'
+ layout.operator("pose.autoside_names", text="AutoName Front/Back").axis = 'YAXIS'
+ layout.operator("pose.autoside_names", text="AutoName Top/Bottom").axis = 'ZAXIS'
layout.operator("pose.flip_names")
@@ -1249,13 +1264,13 @@ class VIEW3D_MT_pose(Menu):
layout.separator()
layout.operator_context = 'INVOKE_AREA'
- layout.operator("pose.armature_layers", text=_("Change Armature Layers..."))
- layout.operator("pose.bone_layers", text=_("Change Bone Layers..."))
+ layout.operator("pose.armature_layers", text="Change Armature Layers...")
+ layout.operator("pose.bone_layers", text="Change Bone Layers...")
layout.separator()
layout.menu("VIEW3D_MT_pose_showhide")
- layout.menu("VIEW3D_MT_bone_options_toggle", text=_("Bone Settings"))
+ layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
class VIEW3D_MT_pose_transform(Menu):
@@ -1264,17 +1279,17 @@ class VIEW3D_MT_pose_transform(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("pose.transforms_clear", text=_("All"))
+ layout.operator("pose.transforms_clear", text="All")
layout.separator()
- layout.operator("pose.loc_clear", text=_("Location"))
- layout.operator("pose.rot_clear", text=_("Rotation"))
- layout.operator("pose.scale_clear", text=_("Scale"))
+ layout.operator("pose.loc_clear", text="Location")
+ layout.operator("pose.rot_clear", text="Rotation")
+ layout.operator("pose.scale_clear", text="Scale")
layout.separator()
- layout.operator("pose.user_transforms_clear", text=_("Reset unkeyed"))
+ layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
class VIEW3D_MT_pose_slide(Menu):
@@ -1298,12 +1313,12 @@ class VIEW3D_MT_pose_propagate(Menu):
layout.separator()
- layout.operator("pose.propagate", text=_("To Next Keyframe")).mode = 'NEXT_KEY'
- layout.operator("pose.propagate", text=_("To Last Keyframe (Make Cyclic)")).mode = 'LAST_KEY'
+ layout.operator("pose.propagate", text="To Next Keyframe").mode = 'NEXT_KEY'
+ layout.operator("pose.propagate", text="To Last Keyframe (Make Cyclic)").mode = 'LAST_KEY'
layout.separator()
- layout.operator("pose.propagate", text=_("On Selected Markers")).mode = 'SELECTED_MARKERS'
+ layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
class VIEW3D_MT_pose_library(Menu):
@@ -1312,13 +1327,13 @@ class VIEW3D_MT_pose_library(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("poselib.browse_interactive", text=_("Browse Poses..."))
+ layout.operator("poselib.browse_interactive", text="Browse Poses...")
layout.separator()
- layout.operator("poselib.pose_add", text=_("Add Pose..."))
- layout.operator("poselib.pose_rename", text=_("Rename Pose..."))
- layout.operator("poselib.pose_remove", text=_("Remove Pose..."))
+ layout.operator("poselib.pose_add", text="Add Pose...")
+ layout.operator("poselib.pose_rename", text="Rename Pose...")
+ layout.operator("poselib.pose_remove", text="Remove Pose...")
class VIEW3D_MT_pose_motion(Menu):
@@ -1327,8 +1342,8 @@ class VIEW3D_MT_pose_motion(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("pose.paths_calculate", text=_("Calculate"))
- layout.operator("pose.paths_clear", text=_("Clear"))
+ layout.operator("pose.paths_calculate", text="Calculate")
+ layout.operator("pose.paths_clear", text="Clear")
class VIEW3D_MT_pose_group(Menu):
@@ -1361,7 +1376,7 @@ class VIEW3D_MT_pose_constraints(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("pose.constraint_add_with_targets", text=_("Add (With Targets)..."))
+ layout.operator("pose.constraint_add_with_targets", text="Add (With Targets)...")
layout.operator("pose.constraints_copy")
layout.operator("pose.constraints_clear")
@@ -1371,7 +1386,7 @@ class VIEW3D_MT_pose_showhide(ShowHideMenu, Menu):
class VIEW3D_MT_pose_apply(Menu):
- bl_label = _("Apply")
+ bl_label = "Apply"
def draw(self, context):
layout = self.layout
@@ -1446,14 +1461,14 @@ class VIEW3D_MT_edit_mesh(Menu):
layout.separator()
- layout.menu("VIEW3D_MT_uv_map", text=_("UV Unwrap..."))
+ layout.menu("VIEW3D_MT_uv_map", text="UV Unwrap...")
layout.separator()
- layout.operator("view3d.edit_mesh_extrude_move_normal", text=_("Extrude Region"))
- layout.operator("view3d.edit_mesh_extrude_individual_move", text=_("Extrude Individual"))
+ layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
+ layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
layout.operator("mesh.duplicate_move")
- layout.operator("mesh.delete", text=_("Delete..."))
+ layout.operator("mesh.delete", text="Delete...")
layout.separator()
@@ -1481,15 +1496,15 @@ class VIEW3D_MT_edit_mesh_specials(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("mesh.subdivide", text=_("Subdivide"))
- layout.operator("mesh.subdivide", text=_("Subdivide Smooth")).smoothness = 1.0
- layout.operator("mesh.merge", text=_("Merge..."))
+ layout.operator("mesh.subdivide", text="Subdivide")
+ layout.operator("mesh.subdivide", text="Subdivide Smooth").smoothness = 1.0
+ layout.operator("mesh.merge", text="Merge...")
layout.operator("mesh.remove_doubles")
- layout.operator("mesh.hide", text=_("Hide"))
- layout.operator("mesh.reveal", text=_("Reveal"))
+ layout.operator("mesh.hide", text="Hide")
+ layout.operator("mesh.reveal", text="Reveal")
layout.operator("mesh.select_inverse")
layout.operator("mesh.flip_normals")
- layout.operator("mesh.vertices_smooth", text=_("Smooth"))
+ layout.operator("mesh.vertices_smooth", text="Smooth")
# layout.operator("mesh.bevel", text="Bevel")
layout.operator("mesh.faces_shade_smooth")
layout.operator("mesh.faces_shade_flat")
@@ -1506,15 +1521,15 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
- prop = layout.operator("wm.context_set_value", text=_("Vertex"), icon='VERTEXSEL')
+ prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
prop.value = "(True, False, False)"
prop.data_path = "tool_settings.mesh_select_mode"
- prop = layout.operator("wm.context_set_value", text=_("Edge"), icon='EDGESEL')
+ prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
prop.value = "(False, True, False)"
prop.data_path = "tool_settings.mesh_select_mode"
- prop = layout.operator("wm.context_set_value", text=_("Face"), icon='FACESEL')
+ prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
prop.value = "(False, False, True)"
prop.data_path = "tool_settings.mesh_select_mode"
@@ -1523,10 +1538,10 @@ class VIEW3D_MT_edit_mesh_extrude(Menu):
bl_label = "Extrude"
_extrude_funcs = { \
- "VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text=_("Vertices Only")),
- "EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text=_("Edges Only")),
- "FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text=_("Individual Faces")),
- "REGION": lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text=_("Region")),
+ "VERT": lambda layout: layout.operator("mesh.extrude_vertices_move", text="Vertices Only"),
+ "EDGE": lambda layout: layout.operator("mesh.extrude_edges_move", text="Edges Only"),
+ "FACE": lambda layout: layout.operator("mesh.extrude_faces_move", text="Individual Faces"),
+ "REGION": lambda layout: layout.operator("view3d.edit_mesh_extrude_move_normal", text="Region"),
}
@staticmethod
@@ -1553,61 +1568,6 @@ class VIEW3D_MT_edit_mesh_extrude(Menu):
self._extrude_funcs[menu_id](layout)
-class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator):
- "Extrude individual elements and move"
- bl_label = "Extrude Individual and Move"
- bl_idname = "view3d.edit_mesh_extrude_individual_move"
-
- def execute(self, context):
- mesh = context.object.data
- select_mode = context.tool_settings.mesh_select_mode
-
- totface = mesh.total_face_sel
- totedge = mesh.total_edge_sel
- # totvert = mesh.total_vert_sel
-
- if select_mode[2] and totface == 1:
- bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
- elif select_mode[2] and totface > 1:
- bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN')
- elif select_mode[1] and totedge >= 1:
- bpy.ops.mesh.extrude_edges_move('INVOKE_REGION_WIN')
- else:
- bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN')
-
- # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
- return {'FINISHED'}
-
- def invoke(self, context, event):
- return self.execute(context)
-
-
-class VIEW3D_OT_edit_mesh_extrude_move(Operator):
- "Extrude and move along normals"
- bl_label = "Extrude and Move on Normals"
- bl_idname = "view3d.edit_mesh_extrude_move_normal"
-
- def execute(self, context):
- mesh = context.object.data
-
- totface = mesh.total_face_sel
- totedge = mesh.total_edge_sel
- # totvert = mesh.total_vert_sel
-
- if totface >= 1:
- bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
- elif totedge == 1:
- bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (True, True, False)})
- else:
- bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
-
- # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
- return {'FINISHED'}
-
- def invoke(self, context, event):
- return self.execute(context)
-
-
class VIEW3D_MT_edit_mesh_vertices(Menu):
bl_label = "Vertices"
@@ -1653,28 +1613,28 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
layout.separator()
layout.operator("mesh.mark_seam")
- layout.operator("mesh.mark_seam", text=_("Clear Seam")).clear = True
+ layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
layout.separator()
layout.operator("mesh.mark_sharp")
- layout.operator("mesh.mark_sharp", text=_("Clear Sharp")).clear = True
+ layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
layout.separator()
- layout.operator("mesh.edge_rotate", text=_("Rotate Edge CW")).direction = 'CW'
- layout.operator("mesh.edge_rotate", text=_("Rotate Edge CCW")).direction = 'CCW'
+ layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
+ layout.operator("mesh.edge_rotate", text="Rotate Edge CCW").direction = 'CCW'
layout.separator()
layout.operator("TRANSFORM_OT_edge_slide")
layout.operator("TRANSFORM_OT_edge_crease")
- layout.operator("mesh.loop_multi_select", text=_("Edge Loop"))
+ layout.operator("mesh.loop_multi_select", text="Edge Loop")
# uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
# uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0);
- layout.operator("mesh.loop_multi_select", text=_("Edge Ring")).ring = True
+ layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
layout.operator("mesh.loop_to_region")
layout.operator("mesh.region_to_loop")
@@ -1718,7 +1678,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
# uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1);
# uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
- layout.operator("mesh.edge_rotate", text=_("Rotate Edge CW")).direction = 'CW'
+ layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
layout.separator()
@@ -1734,8 +1694,8 @@ class VIEW3D_MT_edit_mesh_normals(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("mesh.normals_make_consistent", text=_("Recalculate Outside"))
- layout.operator("mesh.normals_make_consistent", text=_("Recalculate Inside")).inside = True
+ layout.operator("mesh.normals_make_consistent", text="Recalculate Outside")
+ layout.operator("mesh.normals_make_consistent", text="Recalculate Inside").inside = True
layout.separator()
@@ -1765,7 +1725,7 @@ def draw_curve(self, context):
layout.operator("curve.separate")
layout.operator("curve.make_segment")
layout.operator("curve.cyclic_toggle")
- layout.operator("curve.delete", text=_("Delete..."))
+ layout.operator("curve.delete", text="Delete...")
layout.separator()
@@ -1797,7 +1757,7 @@ class VIEW3D_MT_edit_curve_ctrlpoints(Menu):
edit_object = context.edit_object
if edit_object.type == 'CURVE':
- layout.operator("transform.transform", text=_("Tilt")).mode = 'TILT'
+ layout.operator("transform.transform", text="Tilt").mode = 'TILT'
layout.operator("curve.tilt_clear")
layout.operator("curve.separate")
@@ -1858,10 +1818,10 @@ class VIEW3D_MT_edit_font(Menu):
layout.separator()
- layout.operator("font.style_toggle", text=_("Toggle Bold")).style = 'BOLD'
- layout.operator("font.style_toggle", text=_("Toggle Italic")).style = 'ITALIC'
- layout.operator("font.style_toggle", text=_("Toggle Underline")).style = 'UNDERLINE'
- layout.operator("font.style_toggle", text=_("Toggle Small Caps")).style = 'SMALL_CAPS'
+ layout.operator("font.style_toggle", text="Toggle Bold").style = 'BOLD'
+ layout.operator("font.style_toggle", text="Toggle Italic").style = 'ITALIC'
+ layout.operator("font.style_toggle", text="Toggle Underline").style = 'UNDERLINE'
+ layout.operator("font.style_toggle", text="Toggle Small Caps").style = 'SMALL_CAPS'
class VIEW3D_MT_edit_text_chars(Menu):
@@ -1918,7 +1878,7 @@ class VIEW3D_MT_edit_meta(Menu):
layout.separator()
- layout.operator("mball.delete_metaelems", text=_("Delete..."))
+ layout.operator("mball.delete_metaelems", text="Delete...")
layout.operator("mball.duplicate_metaelems")
layout.separator()
@@ -1937,9 +1897,9 @@ class VIEW3D_MT_edit_meta_showhide(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("mball.reveal_metaelems", text=_("Show Hidden"))
- layout.operator("mball.hide_metaelems", text=_("Hide Selected"))
- layout.operator("mball.hide_metaelems", text=_("Hide Unselected")).unselected = True
+ layout.operator("mball.reveal_metaelems", text="Show Hidden")
+ layout.operator("mball.hide_metaelems", text="Hide Selected")
+ layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
class VIEW3D_MT_edit_lattice(Menu):
@@ -1993,15 +1953,15 @@ class VIEW3D_MT_edit_armature(Menu):
layout.separator()
- layout.operator("armature.subdivide", text=_("Subdivide"))
- layout.operator("armature.switch_direction", text=_("Switch Direction"))
+ layout.operator("armature.subdivide", text="Subdivide")
+ layout.operator("armature.switch_direction", text="Switch Direction")
layout.separator()
layout.operator_context = 'EXEC_AREA'
- layout.operator("armature.autoside_names", text=_("AutoName Left/Right")).type = 'XAXIS'
- layout.operator("armature.autoside_names", text=_("AutoName Front/Back")).type = 'YAXIS'
- layout.operator("armature.autoside_names", text=_("AutoName Top/Bottom")).type = 'ZAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
layout.operator("armature.flip_names")
layout.separator()
@@ -2016,7 +1976,7 @@ class VIEW3D_MT_edit_armature(Menu):
layout.separator()
- layout.menu("VIEW3D_MT_bone_options_toggle", text=_("Bone Settings"))
+ layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
class VIEW3D_MT_armature_specials(Menu):
@@ -2027,16 +1987,16 @@ class VIEW3D_MT_armature_specials(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
- layout.operator("armature.subdivide", text=_("Subdivide"))
- layout.operator("armature.switch_direction", text=_("Switch Direction"))
+ layout.operator("armature.subdivide", text="Subdivide")
+ layout.operator("armature.switch_direction", text="Switch Direction")
layout.separator()
layout.operator_context = 'EXEC_REGION_WIN'
- layout.operator("armature.autoside_names", text=_("AutoName Left/Right")).type = 'XAXIS'
- layout.operator("armature.autoside_names", text=_("AutoName Front/Back")).type = 'YAXIS'
- layout.operator("armature.autoside_names", text=_("AutoName Top/Bottom")).type = 'ZAXIS'
- layout.operator("armature.flip_names", text=_("Flip Names"))
+ layout.operator("armature.autoside_names", text="AutoName Left/Right").type = 'XAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Front/Back").type = 'YAXIS'
+ layout.operator("armature.autoside_names", text="AutoName Top/Bottom").type = 'ZAXIS'
+ layout.operator("armature.flip_names", text="Flip Names")
class VIEW3D_MT_edit_armature_parent(Menu):
@@ -2045,8 +2005,8 @@ class VIEW3D_MT_edit_armature_parent(Menu):
def draw(self, context):
layout = self.layout
- layout.operator("armature.parent_set", text=_("Make"))
- layout.operator("armature.parent_clear", text=_("Clear"))
+ layout.operator("armature.parent_set", text="Make")
+ layout.operator("armature.parent_clear", text="Clear")
class VIEW3D_MT_edit_armature_roll(Menu):
@@ -2059,7 +2019,7 @@ class VIEW3D_MT_edit_armature_roll(Menu):
layout.separator()
- layout.operator("transform.transform", text=_("Set Roll")).mode = 'BONE_ROLL'
+ layout.operator("transform.transform", text="Set Roll").mode = 'BONE_ROLL'
# ********** Panel **********
@@ -2082,26 +2042,26 @@ class VIEW3D_PT_view3d_properties(Panel):
col = layout.column()
col.active = view.region_3d.view_perspective != 'CAMERA'
col.prop(view, "lens")
- col.label(text=_("Lock to Object:"))
+ col.label(text="Lock to Object:")
col.prop(view, "lock_object", text="")
lock_object = view.lock_object
if lock_object:
if lock_object.type == 'ARMATURE':
col.prop_search(view, "lock_bone", lock_object.data, "edit_bones" if lock_object.mode == 'EDIT' else "bones", text="")
else:
- col.prop(view, "lock_cursor", text=_("Lock to Cursor"))
+ col.prop(view, "lock_cursor", text="Lock to Cursor")
col = layout.column()
col.prop(view, "lock_camera")
col = layout.column(align=True)
- col.label(text=_("Clip:"))
- col.prop(view, "clip_start", text=_("Start"))
- col.prop(view, "clip_end", text=_("End"))
+ col.label(text="Clip:")
+ col.prop(view, "clip_start", text="Start")
+ col.prop(view, "clip_end", text="End")
subcol = col.column()
subcol.enabled = not view.lock_camera_and_layers
- subcol.label(text=_("Local Camera:"))
+ subcol.label(text="Local Camera:")
subcol.prop(view, "camera", text="")
layout.column().prop(view, "cursor_location")
@@ -2167,7 +2127,7 @@ class VIEW3D_PT_view3d_display(Panel):
col = layout.column()
col.active = display_all
split = col.split(percentage=0.55)
- split.prop(view, "show_floor", text=_("Grid Floor"))
+ split.prop(view, "show_floor", text="Grid Floor")
row = split.row(align=True)
row.prop(view, "show_axis_x", text="X", toggle=True)
@@ -2176,21 +2136,21 @@ class VIEW3D_PT_view3d_display(Panel):
sub = col.column(align=True)
sub.active = (display_all and view.show_floor)
- sub.prop(view, "grid_lines", text=_("Lines"))
- sub.prop(view, "grid_scale", text=_("Scale"))
+ sub.prop(view, "grid_lines", text="Lines")
+ sub.prop(view, "grid_scale", text="Scale")
subsub = sub.column(align=True)
subsub.active = scene.unit_settings.system == 'NONE'
- subsub.prop(view, "grid_subdivisions", text=_("Subdivisions"))
+ subsub.prop(view, "grid_subdivisions", text="Subdivisions")
col = layout.column()
- col.label(text=_("Shading:"))
+ col.label(text="Shading:")
col.prop(gs, "material_mode", text="")
layout.separator()
region = view.region_quadview
- layout.operator("screen.region_quadview", text=_("Toggle Quad View"))
+ layout.operator("screen.region_quadview", text="Toggle Quad View")
if region:
col = layout.column()
@@ -2219,22 +2179,22 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
mesh = context.active_object.data
col = layout.column()
- col.label(text=_("Overlays:"))
- col.prop(mesh, "show_edges", text=_("Edges"))
- col.prop(mesh, "show_faces", text=_("Faces"))
- col.prop(mesh, "show_edge_crease", text=_("Creases"))
- col.prop(mesh, "show_edge_bevel_weight", text=_("Bevel Weights"))
- col.prop(mesh, "show_edge_seams", text=_("Seams"))
- col.prop(mesh, "show_edge_sharp", text=_("Sharp"))
+ col.label(text="Overlays:")
+ col.prop(mesh, "show_edges", text="Edges")
+ col.prop(mesh, "show_faces", text="Faces")
+ col.prop(mesh, "show_edge_crease", text="Creases")
+ col.prop(mesh, "show_edge_bevel_weight", text="Bevel Weights")
+ col.prop(mesh, "show_edge_seams", text="Seams")
+ col.prop(mesh, "show_edge_sharp", text="Sharp")
col.separator()
- col.label(text=_("Normals:"))
- col.prop(mesh, "show_normal_face", text=_("Face"))
- col.prop(mesh, "show_normal_vertex", text=_("Vertex"))
- col.prop(context.scene.tool_settings, "normal_size", text=_("Normal Size"))
+ col.label(text="Normals:")
+ col.prop(mesh, "show_normal_face", text="Face")
+ col.prop(mesh, "show_normal_vertex", text="Vertex")
+ col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
col.separator()
- col.label(text=_("Numerics:"))
+ col.label(text="Numerics:")
col.prop(mesh, "show_extra_edge_length")
col.prop(mesh, "show_extra_face_angle")
col.prop(mesh, "show_extra_face_area")
@@ -2256,10 +2216,10 @@ class VIEW3D_PT_view3d_curvedisplay(Panel):
curve = context.active_object.data
col = layout.column()
- col.label(text=_("Overlays:"))
- col.prop(curve, "show_handles", text=_("Handles"))
- col.prop(curve, "show_normal_face", text=_("Normals"))
- col.prop(context.scene.tool_settings, "normal_size", text=_("Normal Size"))
+ col.label(text="Overlays:")
+ col.prop(curve, "show_handles", text="Handles")
+ col.prop(curve, "show_normal_face", text="Normals")
+ col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
class VIEW3D_PT_background_image(Panel):
@@ -2286,7 +2246,7 @@ class VIEW3D_PT_background_image(Panel):
view = context.space_data
col = layout.column()
- col.operator("view3d.background_image_add", text=_("Add Image"))
+ col.operator("view3d.background_image_add", text="Add Image")
for i, bg in enumerate(view.background_images):
layout.active = view.show_background_images
@@ -2296,10 +2256,10 @@ class VIEW3D_PT_background_image(Panel):
if bg.image:
row.prop(bg.image, "name", text="", emboss=False)
else:
- row.label(text=_("Not Set"))
+ row.label(text="Not Set")
row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
- box.prop(bg, "view_axis", text=_("Axis"))
+ box.prop(bg, "view_axis", text="Axis")
if bg.show_expanded:
row = box.row()
@@ -2334,13 +2294,13 @@ class VIEW3D_PT_transform_orientations(Panel):
col = layout.column()
col.prop(view, "transform_orientation")
- col.operator("transform.create_orientation", text=_("Create"))
+ col.operator("transform.create_orientation", text="Create")
orientation = view.current_orientation
if orientation:
col.prop(orientation, "name")
- col.operator("transform.delete_orientation", text=_("Delete"))
+ col.operator("transform.delete_orientation", text="Delete")
class VIEW3D_PT_etch_a_ton(Panel):
@@ -2385,7 +2345,7 @@ class VIEW3D_PT_etch_a_ton(Panel):
col.prop(toolsettings, "etch_number")
col.prop(toolsettings, "etch_side")
- col.operator("sketch.convert", text=_("Convert"))
+ col.operator("sketch.convert", text="Convert")
class VIEW3D_PT_context_properties(Panel):
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 6bd2168dab9..e322a6dcd13 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Menu, Panel
-from blf import gettext as _
class View3DPanel():
@@ -32,33 +31,33 @@ class View3DPanel():
# History/Repeat tools
def draw_repeat_tools(context, layout):
col = layout.column(align=True)
- col.label(text=_("Repeat:"))
+ col.label(text="Repeat:")
col.operator("screen.repeat_last")
- col.operator("screen.repeat_history", text=_("History..."))
+ col.operator("screen.repeat_history", text="History...")
# Keyframing tools
def draw_keyframing_tools(context, layout):
col = layout.column(align=True)
- col.label(text=_("Keyframes:"))
+ col.label(text="Keyframes:")
row = col.row()
- row.operator("anim.keyframe_insert_menu", text=_("Insert"))
- row.operator("anim.keyframe_delete_v3d", text=_("Remove"))
+ row.operator("anim.keyframe_insert_menu", text="Insert")
+ row.operator("anim.keyframe_delete_v3d", text="Remove")
# Grease Pencil tools
def draw_gpencil_tools(context, layout):
col = layout.column(align=True)
- col.label(text=_("Grease Pencil:"))
+ col.label(text="Grease Pencil:")
row = col.row()
- row.operator("gpencil.draw", text=_("Draw")).mode = 'DRAW'
- row.operator("gpencil.draw", text=_("Line")).mode = 'DRAW_STRAIGHT'
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row = col.row()
- row.operator("gpencil.draw", text=_("Poly")).mode = 'DRAW_POLY'
- row.operator("gpencil.draw", text=_("Erase")).mode = 'ERASER'
+ row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
row = col.row()
row.prop(context.tool_settings, "use_grease_pencil_sessions")
@@ -74,16 +73,16 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
layout = self.layout
col = layout.column(align=True)
- col.label(text=_("Transform:"))
+ col.label(text="Transform:")
col.operator("transform.translate")
col.operator("transform.rotate")
- col.operator("transform.resize", text=_("Scale"))
+ col.operator("transform.resize", text="Scale")
col = layout.column(align=True)
- col.operator("object.origin_set", text=_("Origin"))
+ col.operator("object.origin_set", text="Origin")
col = layout.column(align=True)
- col.label(text=_("Object:"))
+ col.label(text="Object:")
col.operator("object.duplicate_move")
col.operator("object.delete")
col.operator("object.join")
@@ -92,17 +91,17 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
if active_object and active_object.type == 'MESH':
col = layout.column(align=True)
- col.label(text=_("Shading:"))
+ col.label(text="Shading:")
row = col.row(align=True)
- row.operator("object.shade_smooth", text=_("Smooth"))
- row.operator("object.shade_flat", text=_("Flat"))
+ row.operator("object.shade_smooth", text="Smooth")
+ row.operator("object.shade_flat", text="Flat")
draw_keyframing_tools(context, layout)
col = layout.column(align=True)
- col.label(text=_("Motion Paths:"))
- col.operator("object.paths_calculate", text=_("Calculate Paths"))
- col.operator("object.paths_clear", text=_("Clear Paths"))
+ col.label(text="Motion Paths:")
+ col.operator("object.paths_calculate", text="Calculate Paths")
+ col.operator("object.paths_clear", text="Clear Paths")
draw_repeat_tools(context, layout)
@@ -123,8 +122,8 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel):
col.operator("transform.translate")
col.operator("transform.rotate")
col.operator("transform.resize", text="Scale")
- col.operator("transform.shrink_fatten", text=_("Shrink/Fatten"))
- col.operator("transform.push_pull", text=_("Push/Pull"))
+ col.operator("transform.shrink_fatten", text="Shrink/Fatten")
+ col.operator("transform.push_pull", text="Push/Pull")
col = layout.column(align=True)
col.label(text="Deform:")
@@ -1017,7 +1016,7 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel):
brush = settings.brush
if brush is None: # unlikely but can happen
- layout.label(text=_("Brush Unset"))
+ layout.label(text="Brush Unset")
return
col = layout.column()
diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py
index 6b12c95e072..c7922a0dfa1 100644
--- a/release/scripts/startup/keyingsets_builtins.py
+++ b/release/scripts/startup/keyingsets_builtins.py
@@ -353,14 +353,26 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
# custom properties
def doCustomProps(ksi, ks, bone):
+
+ prop_type_compat = {bpy.types.BooleanProperty,
+ bpy.types.IntProperty,
+ bpy.types.FloatProperty}
+
# go over all custom properties for bone
- for prop, val in bone.items():
+ for prop in bone.keys():
# ignore special "_RNA_UI" used for UI editing
if prop == "_RNA_UI":
continue
# for now, just add all of 'em
- ksi.addProp(ks, bone, '["%s"]' % (prop))
+ prop_rna = type(bone).bl_rna.properties.get(prop, None)
+ if prop_rna is None:
+ prop_path = '["%s"]' % prop
+ if bone.path_resolve(prop_path, False).rna_type in prop_type_compat:
+ ksi.addProp(ks, bone, prop_path)
+ elif prop_rna.is_animatable:
+ ksi.addProp(ks, bone, prop)
+
###############################
diff --git a/release/text/readme.html b/release/text/readme.html
index 95094b9c0cb..e0bef8a50e1 100644
--- a/release/text/readme.html
+++ b/release/text/readme.html
@@ -12,22 +12,18 @@
</style>
</head>
<body>
-<p class="title"><b>Blender 2.59</b></p>
+<p class="title"><b>Blender 2.60</b></p>
<p><br></p>
<p class="header"><b>About</b></p>
<p class="body">Welcome to Blender, the free, open source 3D application for modeling, animation, rendering, compositing, video editing and game creation. Blender is available for Linux, Mac OS X, Windows, Solaris and FreeBSD and has a large world-wide community.</p>
<p class="body">Blender can be used freely for any purpose, including commercial use and distribution. It's free and open-source software, released under the GNU GPL licence. The entire source code is available on our website.</p>
<p class="body">For more information, visit <a href="http://www.blender.org">blender.org</a>.</p>
<p><br></p>
-<p class="header"><b>2.59</b></p>
-<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.59. This release is the third official stable release of the Blender 2.5 series, and represents the culmination of many years of redesign and development work. <a href="http://www.blender.org/development/release-logs/blender-259/">More information about this release</a>.</p>
-<p class="body">What to Expect:</p>
-<p class="body"> • Big improvements - This is our most exciting version to date, already a significant improvement in many ways over 2.49</p>
-<p class="body"> • Missing/Incomplete Features - Although most of it is there, not all functionality from pre-2.5 versions has been restored yet. Some functionality may be re-implemented a different way.</p>
-<p class="body"> • Changes - If you're used to the old Blenders, Blender 2.5 may seem quite different at first, but it won't be long before it grows on you even more than before.</p>
+<p class="header"><b>2.60</b></p>
+<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.60. This release is the first official stable release of the Blender 2.6 series, in which we will refine the 2.5 series and add exciting new features again.<a href="http://www.blender.org/development/release-logs/blender-260/">More information about this release</a>.</p>
<p><br></p>
<p class="header"><b>Bugs</b></p>
-<p class="body">Although Blender 2.59 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender 2.59. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
+<p class="body">Although Blender 2.60 is considered a stable release, you may encounter a bug. If you do, please help us by posting it in the bug tracker or using Help → Report a Bug from inside Blender. If it wasn’t reported yet, please log in (or register) and fill in detailed information about the error. Please post detailed instructions on how to reproduce it or post a .blend file showcasing the bug.</p>
<p><br></p>
<p class="header"><b>Package Contents</b></p>
<p class="body">The downloaded Blender package includes:</p>
@@ -43,7 +39,7 @@
<p class="body"><b>Installing Add-ons (all systems)</b> Add-ons can be installed from the user preferences addons section, download an addon as a .py or .zip file, then press the "Install Add-on" button and select the file to install it.</p>
<p><br></p>
<p class="header"><b>Getting Started</b></p>
-<p class="body">When opening Blender, you’ll see large 3D view in the center, a Toolbar on the left, a Properties area on the right and a Timeline at the bottom.</p>
+<p class="body">When opening Blender, you’ll see large 3D view in the center, a Toolbar on the left, a Properties area and an Outliner area on the right and a Timeline at the bottom.</p>
<p class="body">Orbit around in the 3D view by holding the middle mouse button and dragging. Alternatively, hold the alt key and drag the left mouse button. Additionally, hold Shift to pan the view and Ctrl to zoom.</p>
<p class="body">Select objects using the right mouse button. With the object selected, perform actions by clicking any of the tool buttons on the left, or make changes to its properties by altering any of the setting on the right.</p>
<p class="body">For more information on how to use Blender, <a href="http://www.blender.org/education-help/">watch tutorials</a> or <a href="http://wiki.blender.org/index.php/Doc:Manual">read the manual</a>.</p>
@@ -51,7 +47,7 @@
<p class="header"><b>Links</b></p>
<p class="body">Users:</p>
<p class="body"> General information <a href="http://www.blender.org">www.blender.org</a> <br>
- Full release log <a href="http://www.blender.org/development/release-logs/blender-259/">www.blender.org/development/release-logs/blender-259/</a><br>
+ Full release log <a href="http://www.blender.org/development/release-logs/blender-260/">www.blender.org/development/release-logs/blender-260/</a><br>
Tutorials <a href="http://www.blender.org/education-help/">www.blender.org/education-help/</a> <br>
Manual <a href="http://wiki.blender.org/index.php/Doc:Manual">wiki.blender.org/index.php/Doc:Manual</a><br>
User Forum <a href="http://www.blenderartists.org">www.blenderartists.org</a><br>
diff --git a/source/blender/avi/intern/avirgb.c b/source/blender/avi/intern/avirgb.c
index 7050aec9bf6..c7d47b9da0d 100644
--- a/source/blender/avi/intern/avirgb.c
+++ b/source/blender/avi/intern/avirgb.c
@@ -44,7 +44,8 @@
/* implementation */
-void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
+void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size)
+{
int x, y,i, rowstride;
unsigned char *buf;
AviBitmapInfoHeader *bi;
@@ -116,7 +117,8 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
}
}
-void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
+void *avi_converter_to_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size)
+{
int y, x, i, rowstride;
unsigned char *buf;
diff --git a/source/blender/avi/intern/options.c b/source/blender/avi/intern/options.c
index 96c62843436..8993c1ef96a 100644
--- a/source/blender/avi/intern/options.c
+++ b/source/blender/avi/intern/options.c
@@ -46,6 +46,7 @@
AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream, AviOption option, void *opt_data) {
int i;
+ int useconds;
(void)stream; /* unused */
@@ -100,8 +101,9 @@ AviError AVI_set_compress_option (AviMovie *movie, int option_type, int stream,
break;
case AVI_OPTION_FRAMERATE:
- if (1000000/(*((double *) opt_data)))
- movie->header->MicroSecPerFrame = 1000000/(*((double *) opt_data));
+ useconds = (int)(1000000/(*((double *) opt_data)));
+ if (useconds)
+ movie->header->MicroSecPerFrame = useconds;
for (i=0; i < movie->header->Streams; i++) {
if (avi_get_format_type(movie->streams[i].format) == FCC("vids")) {
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 1bb61d02b78..038f0c433c7 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -47,6 +47,8 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size);
int BLF_load_unique(const char *name);
int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size);
+void BLF_unload(const char *name);
+
/* Attach a file with metrics information from memory. */
void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size);
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index 4377d391354..1c36f3e1504 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -37,7 +37,7 @@
/* blf_translation.c */
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
unsigned char *BLF_get_unifont(int *unifont_size);
void BLF_free_unifont(void);
#endif
diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt
index b87a3b88f07..49323ec658f 100644
--- a/source/blender/blenfont/CMakeLists.txt
+++ b/source/blender/blenfont/CMakeLists.txt
@@ -53,9 +53,9 @@ set(SRC
if(WITH_INTERNATIONAL)
list(APPEND INC_SYS
- ${GETTEXT_INC}
+ ${GETTEXT_INCLUDE_DIRS}
)
- add_definitions(-DINTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
endif()
blender_add_lib(bf_blenfont "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript
index 45a55793856..1a86d0ad671 100644
--- a/source/blender/blenfont/SConscript
+++ b/source/blender/blenfont/SConscript
@@ -15,6 +15,6 @@ if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross':
defs.append('_WIN32')
if env['WITH_BF_INTERNATIONAL']:
- defs.append('INTERNATIONAL')
+ defs.append('WITH_INTERNATIONAL')
env.BlenderLib ( 'bf_blenfont', sources, Split(incs), Split(defs), libtype=['core','player'], priority=[210,210] )
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index cccecd00bf7..ec0605236dd 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -61,10 +61,7 @@
#define BLF_MAX_FONT 16
/* Font array. */
-static FontBLF *global_font[BLF_MAX_FONT];
-
-/* Number of font. */
-static int global_font_num= 0;
+static FontBLF *global_font[BLF_MAX_FONT] = {0};
/* Default size and dpi, for BLF_draw_default. */
static int global_font_default= -1;
@@ -99,10 +96,12 @@ void BLF_exit(void)
FontBLF *font;
int i;
- for (i= 0; i < global_font_num; i++) {
+ for (i= 0; i < BLF_MAX_FONT; i++) {
font= global_font[i];
- if (font)
+ if (font) {
blf_font_free(font);
+ global_font[i]= NULL;
+ }
}
blf_font_exit();
@@ -113,7 +112,7 @@ void BLF_cache_clear(void)
FontBLF *font;
int i;
- for (i= 0; i < global_font_num; i++) {
+ for (i= 0; i < BLF_MAX_FONT; i++) {
font= global_font[i];
if (font)
blf_glyph_cache_clear(font);
@@ -130,6 +129,18 @@ static int blf_search(const char *name)
if (font && (!strcmp(font->name, name)))
return i;
}
+
+ return -1;
+}
+
+static int blf_search_available(void)
+{
+ int i;
+
+ for (i= 0; i < BLF_MAX_FONT; i++)
+ if(!global_font[i])
+ return i;
+
return -1;
}
@@ -149,7 +160,8 @@ int BLF_load(const char *name)
return i;
}
- if (global_font_num+1 >= BLF_MAX_FONT) {
+ i = blf_search_available();
+ if (i == -1) {
printf("Too many fonts!!!\n");
return -1;
}
@@ -168,9 +180,7 @@ int BLF_load(const char *name)
return -1;
}
- global_font[global_font_num]= font;
- i= global_font_num;
- global_font_num++;
+ global_font[i]= font;
return i;
}
@@ -186,7 +196,8 @@ int BLF_load_unique(const char *name)
/* Don't search in the cache!! make a new
* object font, this is for keep fonts threads safe.
*/
- if (global_font_num+1 >= BLF_MAX_FONT) {
+ i = blf_search_available();
+ if (i == -1) {
printf("Too many fonts!!!\n");
return -1;
}
@@ -205,9 +216,7 @@ int BLF_load_unique(const char *name)
return -1;
}
- global_font[global_font_num]= font;
- i= global_font_num;
- global_font_num++;
+ global_font[i]= font;
return i;
}
@@ -234,7 +243,8 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
return i;
}
- if (global_font_num+1 >= BLF_MAX_FONT) {
+ i = blf_search_available();
+ if (i == -1) {
printf("Too many fonts!!!\n");
return -1;
}
@@ -250,9 +260,7 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
return -1;
}
- global_font[global_font_num]= font;
- i= global_font_num;
- global_font_num++;
+ global_font[i]= font;
return i;
}
@@ -268,7 +276,8 @@ int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size)
* Don't search in the cache, make a new object font!
* this is to keep the font thread safe.
*/
- if (global_font_num+1 >= BLF_MAX_FONT) {
+ i = blf_search_available();
+ if (i == -1) {
printf("Too many fonts!!!\n");
return -1;
}
@@ -284,12 +293,25 @@ int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size)
return -1;
}
- global_font[global_font_num]= font;
- i= global_font_num;
- global_font_num++;
+ global_font[i]= font;
return i;
}
+void BLF_unload(const char *name)
+{
+ FontBLF *font;
+ int i;
+
+ for (i= 0; i < BLF_MAX_FONT; i++) {
+ font= global_font[i];
+
+ if (font && (!strcmp(font->name, name))) {
+ blf_font_free(font);
+ global_font[i]= NULL;
+ }
+ }
+}
+
void BLF_enable(int fontid, int option)
{
FontBLF *font= BLF_get(fontid);
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 26af3a3fd4f..851c6542de0 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -529,6 +529,9 @@ FontBLF *blf_font_new(const char *name, const char *filename)
mfile= blf_dir_metrics_search(filename);
if (mfile) {
err= FT_Attach_File(font->face, mfile);
+ if(err) {
+ fprintf(stderr, "FT_Attach_File failed to load '%s' with error %d\n", filename, (int)err);
+ }
MEM_freeN(mfile);
}
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 8f745180b8b..ec9501c06a6 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -36,7 +36,7 @@
#include "BLF_api.h"
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
#include <locale.h>
@@ -81,8 +81,8 @@ static const char *locales[] = {
"catalan", "ca_AD",
"czech", "cs_CZ",
"ptb", "pt_BR",
- "chs", "zh_CN",
- "cht", "zh_TW",
+ "Chinese (Simplified)_China.1252", "zh_CN",
+ "Chinese (Traditional)_China.1252", "zh_TW",
"russian", "ru_RU",
"croatian", "hr_HR",
"serbian", "sr_RS",
@@ -94,6 +94,7 @@ static const char *locales[] = {
"greek", "el_GR",
"korean", "ko_KR",
"nepali", "ne_NP",
+ "persian", "fa_PE",
};
void BLF_lang_init(void)
@@ -115,7 +116,7 @@ void BLF_lang_set(const char *str)
char *locreturn;
const char *short_locale;
int ok= 1;
-#if defined (_WIN32)
+#if defined (_WIN32) && !defined(FREE_WINDOWS)
char *long_locale = locales[ 2 * U.language];
#endif
@@ -127,7 +128,7 @@ void BLF_lang_set(const char *str)
else
short_locale = locales[ 2 * U.language + 1];
-#if defined (_WIN32)
+#if defined (_WIN32) && !defined(FREE_WINDOWS)
if(short_locale) {
char *envStr;
@@ -158,7 +159,7 @@ void BLF_lang_set(const char *str)
char *s;
/* store defaul locale */
- strncpy(default_locale, env_language, sizeof(default_locale));
+ BLI_strncpy(default_locale, env_language, sizeof(default_locale));
/* use first language as default */
s= strchr(default_locale, ':');
@@ -209,7 +210,7 @@ void BLF_lang_encoding(const char *str)
/* bind_textdomain_codeset(DOMAIN_NAME, encoding_name); */
}
-#else /* ! INTERNATIONAL */
+#else /* ! WITH_INTERNATIONAL */
void BLF_lang_init(void)
{
@@ -228,4 +229,4 @@ void BLF_lang_set(const char *str)
return;
}
-#endif /* INTERNATIONAL */
+#endif /* WITH_INTERNATIONAL */
diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
index b53f4cf7609..8c0a26df4c2 100644
--- a/source/blender/blenfont/intern/blf_translation.c
+++ b/source/blender/blenfont/intern/blf_translation.c
@@ -32,7 +32,7 @@
#include <stdlib.h>
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
#include <libintl.h>
#endif
@@ -45,7 +45,7 @@
#include "BLF_translation.h"
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
const char unifont_filename[]="droidsans.ttf.gz";
static unsigned char *unifont_ttf= NULL;
static int unifont_size= 0;
@@ -76,7 +76,7 @@ void BLF_free_unifont(void)
const char* BLF_gettext(const char *msgid)
{
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
if( msgid[0] )
return gettext( msgid );
return "";
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 14198a9a139..7f27981b69c 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -257,7 +257,7 @@ struct DerivedMesh {
*/
void (*drawFacesTex)(DerivedMesh *dm,
int (*setDrawOptions)(struct MTFace *tface,
- struct MCol *mcol, int matnr));
+ int has_mcol, int matnr));
/* Draw all faces with GLSL materials
* o setMaterial is called for every different material nr
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 67efb7752ea..7d3de68c005 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h
index 44aebdf6205..da389c6f1d0 100644
--- a/source/blender/blenkernel/BKE_anim.h
+++ b/source/blender/blenkernel/BKE_anim.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index 98f9ee14c7e..bf619d76e68 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 8836999bc9b..a0660490baf 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index a09e475c9a3..f6910fede8e 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -44,7 +44,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 259
-#define BLENDER_SUBVERSION 3
+#define BLENDER_SUBVERSION 4
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
@@ -53,7 +53,7 @@ extern "C" {
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR
/* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE beta
+#define BLENDER_VERSION_CYCLE rc
struct ListBase;
struct MemFile;
diff --git a/source/blender/blenkernel/BKE_bullet.h b/source/blender/blenkernel/BKE_bullet.h
index 76358c4485b..2756ded3a08 100644
--- a/source/blender/blenkernel/BKE_bullet.h
+++ b/source/blender/blenkernel/BKE_bullet.h
@@ -1,5 +1,4 @@
/*
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h
index 1edec2b69d9..07158f5f3fa 100644
--- a/source/blender/blenkernel/BKE_cdderivedmesh.h
+++ b/source/blender/blenkernel/BKE_cdderivedmesh.h
@@ -1,31 +1,31 @@
/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2006 Blender Foundation.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): Ben Batt <benbatt@gmail.com>
-*
-* ***** END GPL LICENSE BLOCK *****
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Ben Batt <benbatt@gmail.com>
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
/** \file BKE_cdderivedmesh.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h
index 5b40fa5d758..758789683d5 100644
--- a/source/blender/blenkernel/BKE_colortools.h
+++ b/source/blender/blenkernel/BKE_colortools.h
@@ -41,8 +41,6 @@ struct rctf;
#if defined _WIN32
# define DO_INLINE __inline
-#elif defined (__sgi)
-# define DO_INLINE
#elif defined (__sun) || defined (__sun__)
# define DO_INLINE
#else
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index c30100ea55a..4eb8e5a8d96 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -1,31 +1,31 @@
/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2006 Blender Foundation.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): Ben Batt <benbatt@gmail.com>
-*
-* ***** END GPL LICENSE BLOCK *****
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Ben Batt <benbatt@gmail.com>
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
/** \file BKE_customdata.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h
index b00db53a199..1eed0aaca00 100644
--- a/source/blender/blenkernel/BKE_displist.h
+++ b/source/blender/blenkernel/BKE_displist.h
@@ -1,5 +1,5 @@
/*
- $Id$
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index 244fda33a52..08798a6ddf0 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -231,7 +231,7 @@ short fcurve_is_keyframable(struct FCurve *fcu);
/* -------- Curve Sanity -------- */
void calchandles_fcurve(struct FCurve *fcu);
-void testhandles_fcurve(struct FCurve *fcu);
+void testhandles_fcurve(struct FCurve *fcu, const short use_handle);
void sort_time_fcurve(struct FCurve *fcu);
short test_time_fcurve(struct FCurve *fcu);
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h
index 2195b370a5f..e4e8805164a 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -46,6 +46,7 @@ struct Curve;
struct objfnt;
struct TmpFont;
struct CharInfo;
+struct Main;
struct chartrans {
float xof, yof;
@@ -77,10 +78,10 @@ void BKE_font_register_builtin(void *mem, int size);
void free_vfont(struct VFont *sc);
void free_ttfont(void);
struct VFont *get_builtin_font(void);
-struct VFont *load_vfont(const char *name);
+struct VFont *load_vfont(struct Main *bmain, const char *name);
struct TmpFont *vfont_find_tmpfont(struct VFont *vfont);
-struct chartrans *BKE_text_to_curve(struct Scene *scene, struct Object *ob, int mode);
+struct chartrans *BKE_text_to_curve(struct Main *bmain, struct Scene *scene, struct Object *ob, int mode);
int BKE_font_getselection(struct Object *ob, int *start, int *end);
diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h
index 3c12a5d615d..9f7d4aeb0d3 100644
--- a/source/blender/blenkernel/BKE_icons.h
+++ b/source/blender/blenkernel/BKE_icons.h
@@ -1,32 +1,31 @@
/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2006-2007 Blender Foundation.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): none yet.
-*
-* ***** END GPL LICENSE BLOCK *****
-*
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006-2007 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
#ifndef BKE_ICONS_H
#define BKE_ICONS_H
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index cb6a0b9ab37..0e0348e78e9 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -71,6 +71,7 @@ short *give_totcolp_id(struct ID *id);
struct Material *give_current_material(struct Object *ob, short act);
struct ID *material_from(struct Object *ob, short act);
+void assign_material_id(struct ID *id, struct Material *ma, short act);
void assign_material(struct Object *ob, struct Material *ma, short act);
void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 95490b1aff6..347263bb290 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -1,6 +1,4 @@
/*
- * blenlib/BKE_mesh.h (mar-2001 nzc)
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -24,7 +22,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): (mar-2001 nzc)
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -161,6 +159,8 @@ int BKE_mesh_validate_dm(struct DerivedMesh *dm);
void BKE_mesh_calc_edges(struct Mesh *mesh, int update);
+void BKE_mesh_ensure_navmesh(struct Mesh *me);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_navmesh_conversion.h b/source/blender/blenkernel/BKE_navmesh_conversion.h
index 01d32321c81..1880e1e6728 100644
--- a/source/blender/blenkernel/BKE_navmesh_conversion.h
+++ b/source/blender/blenkernel/BKE_navmesh_conversion.h
@@ -1,31 +1,31 @@
-/**
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): none yet.
-*
-* ***** END GPL LICENSE BLOCK *****
-*/
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
#ifndef BKE_NAVMESH_CONVERSION_H
#define BKE_NAVMESH_CONVERSION_H
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 773c5ced1cb..49c1f8acd24 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 7e39461a032..b1943fdf97c 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -146,6 +146,11 @@ void object_camera_matrix(
float winmat[][4], struct rctf *viewplane, float *clipsta, float *clipend, float *lens, 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],
+ float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]);
+
+void camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]);
+
void object_relink(struct Object *ob);
#ifdef __cplusplus
diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h
index 541c581e762..556ff26e621 100644
--- a/source/blender/blenkernel/BKE_packedFile.h
+++ b/source/blender/blenkernel/BKE_packedFile.h
@@ -45,7 +45,7 @@ struct ReportList;
struct VFont;
/* pack */
-struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename);
+struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename, const char *relabase);
struct PackedFile *newPackedFileMemory(void *mem, int memlen);
void packAll(struct Main *bmain, struct ReportList *reports);
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 2578a90808a..f8463bab55f 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 5b565223ece..c417b1efe4f 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -80,6 +80,10 @@ typedef struct ParticleSimulationData {
struct ParticleSystem *psys;
struct ParticleSystemModifierData *psmd;
struct ListBase *colliders;
+ /* Courant number. This is used to implement an adaptive time step. Only the
+ maximum value per time step is important. Only sph_integrate makes use of
+ this at the moment. Other solvers could, too. */
+ float courant_num;
} ParticleSimulationData;
typedef struct ParticleTexture{
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 346368a5958..fcfa6ccf9f4 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -1,30 +1,31 @@
/*
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2006 Blender Foundation.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): Campbell Barton <ideasman42@gmail.com>
-*
-* ***** END GPL LICENSE BLOCK *****
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Campbell Barton <ideasman42@gmail.com>
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
#ifndef BKE_POINTCACHE_H
#define BKE_POINTCACHE_H
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h
index d1fef8b0ce1..9deb71a3474 100644
--- a/source/blender/blenkernel/BKE_shrinkwrap.h
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index a400c1e27b9..30142c12601 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -1,4 +1,5 @@
-/* $Id$
+/*
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/blenkernel/BKE_suggestions.h b/source/blender/blenkernel/BKE_suggestions.h
index e215cabd70f..c684271cbbf 100644
--- a/source/blender/blenkernel/BKE_suggestions.h
+++ b/source/blender/blenkernel/BKE_suggestions.h
@@ -1,4 +1,4 @@
-/*
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h
index 0a3e56c8cba..269941597b0 100644
--- a/source/blender/blenkernel/BKE_unit.h
+++ b/source/blender/blenkernel/BKE_unit.h
@@ -1,4 +1,5 @@
/*
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h
index 2b10f1b246c..8345f0f5d2e 100644
--- a/source/blender/blenkernel/BKE_writeffmpeg.h
+++ b/source/blender/blenkernel/BKE_writeffmpeg.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/BKE_writeframeserver.h b/source/blender/blenkernel/BKE_writeframeserver.h
index 2117a23b938..8b2022076bb 100644
--- a/source/blender/blenkernel/BKE_writeframeserver.h
+++ b/source/blender/blenkernel/BKE_writeframeserver.h
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 93ab29c5f49..bfadff06400 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -353,16 +353,19 @@ endif()
if(WITH_GAMEENGINE)
list(APPEND INC_SYS
- ../../../extern/recastnavigation
+ ../../../extern/recastnavigation
)
list(APPEND SRC
intern/navmesh_conversion.c
BKE_navmesh_conversion.h
)
-endif()
-if(MSVC)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
+ add_definitions(-DWITH_GAMEENGINE)
endif()
+## Warnings as errors, this is too strict!
+#if(MSVC)
+# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
+#endif()
+
blender_add_lib(bf_blenkernel "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/blenkernel/intern/BME_conversions.c b/source/blender/blenkernel/intern/BME_conversions.c
index 4f83d25409a..9a3c9462934 100644
--- a/source/blender/blenkernel/intern/BME_conversions.c
+++ b/source/blender/blenkernel/intern/BME_conversions.c
@@ -353,7 +353,7 @@ void BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td, EditMesh *em) {
BME_TransData *vtd;
- EditVert *eve1, *eve2, *eve3, *eve4, **evlist;
+ EditVert *eve1, /* *eve2, *eve3, *eve4, */ /* UNUSED */ **evlist;
EditEdge *eed;
EditFace *efa;
@@ -410,14 +410,14 @@ void BME_bmesh_to_editmesh(BME_Mesh *bm, BME_TransData_Head *td, EditMesh *em) {
len = BME_cycle_length(f->loopbase);
if (len==3 || len==4) {
eve1= evlist[f->loopbase->v->tflag1];
- eve2= evlist[f->loopbase->next->v->tflag1];
- eve3= evlist[f->loopbase->next->next->v->tflag1];
- if (len == 4) {
+ /* eve2= evlist[f->loopbase->next->v->tflag1]; */ /* UNUSED */
+ /* eve3= evlist[f->loopbase->next->next->v->tflag1]; */ /* UNUSED */
+ /* if (len == 4) {
eve4= evlist[f->loopbase->prev->v->tflag1];
}
else {
eve4= NULL;
- }
+ } */ /* UNUSED */
efa = NULL; //XXX addfacelist(eve1, eve2, eve3, eve4, NULL, NULL);
efa->mat_nr = (unsigned char)f->mat_nr;
@@ -539,7 +539,7 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm)
MEdge *medge, *me;
MVert *mvert, *mv;
int *origindex;
- int totface,totedge,totvert,i,bmeshok,len, numTex, numCol;
+ int totface, totedge, totvert, i, /* bmeshok, */ /* UNUSED */ len, numTex, numCol;
BME_Vert *v1=NULL;
BME_Edge *e=NULL, *oe=NULL;
@@ -567,7 +567,7 @@ DerivedMesh *BME_bmesh_to_derivedmesh(BME_Mesh *bm, DerivedMesh *dm)
/*count quads and tris*/
totface = 0;
- bmeshok = 1;
+ /* bmeshok = 1; */ /* UNUSED */
for(f=bm->polys.first;f;f=f->next){
len = BME_cycle_length(f->loopbase);
if(len == 3 || len == 4) totface++;
diff --git a/source/blender/blenkernel/intern/BME_structure.c b/source/blender/blenkernel/intern/BME_structure.c
index 1b6c499a9fa..bd5241adb6b 100644
--- a/source/blender/blenkernel/intern/BME_structure.c
+++ b/source/blender/blenkernel/intern/BME_structure.c
@@ -503,16 +503,16 @@ void BME_disk_remove_edge(BME_Edge *e, BME_Vert *v)
BME_Edge *BME_disk_next_edgeflag(BME_Edge *e, BME_Vert *v, int eflag, int tflag){
- BME_CycleNode *diskbase;
+ /* BME_CycleNode *diskbase; */ /* UNUSED */
BME_Edge *curedge;
- int len, ok;
+ int /* len, */ /* UNUSED */ ok;
if(eflag && tflag) return NULL;
ok = BME_vert_in_edge(e,v);
if(ok){
- diskbase = BME_disk_getpointer(e, v);
- len = BME_cycle_length(diskbase);
+ /* diskbase = BME_disk_getpointer(e, v); */ /* UNUSED */
+ /* len = BME_cycle_length(diskbase); */ /* UNUSED */
curedge = BME_disk_nextedge(e,v);
while(curedge != e){
if(tflag){
diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c
index 99b6e7f9095..a95d149f058 100644
--- a/source/blender/blenkernel/intern/BME_tools.c
+++ b/source/blender/blenkernel/intern/BME_tools.c
@@ -393,19 +393,19 @@ static float BME_bevel_project_vec(float *vec1, float *vec2, float *up_vec, int
* and transform properties, and set the max limits.
* Finally, return the split vert. */
static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, BME_Loop *l, float *up_vec, float value, BME_TransData_Head *td) {
- BME_TransData *vtd, *vtd1, *vtd2;
- BME_Vert *sv, *v2, *v3, *ov;
+ BME_TransData *vtd, *vtd1 /* , *vtd2 */ /* UNUSED */;
+ BME_Vert *sv, *v2, *v3 /* , *ov */ /* UNUSED */;
BME_Loop *lv1, *lv2;
BME_Edge *ne, *e1, *e2;
float maxfactor, scale, len, dis, vec1[3], vec2[3], t_up_vec[3];
- int is_edge, forward, is_split_vert;
+ int is_edge, forward /* , is_split_vert */ /* UNUSED */;
if (l == NULL) {
/* what you call operator overloading in C :)
* I wanted to use the same function for both wire edges and poly loops
* so... here we walk around edges to find the needed verts */
forward = 1;
- is_split_vert = 0;
+ /* is_split_vert = 0; */ /* UNUSED */
if (v->edge == NULL) {
//printf("We can't split a loose vert's edge!\n");
return NULL;
@@ -428,7 +428,7 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
else {
e1 = e2;
}
- ov = BME_edge_getothervert(e1,v);
+ /* ov = BME_edge_getothervert(e1,v); */ /* UNUSED */
sv = BME_split_edge(bm,v,e1,&ne,0);
//BME_data_interp_from_verts(bm, v, ov, sv, 0.25); /*this is technically wrong...*/
//BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25);
@@ -464,14 +464,14 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
}
if (BME_bevel_is_split_vert(lv1)) {
- is_split_vert = 1;
+ /* is_split_vert = 1; */ /* UNUSED */
sv = v1;
if (forward) v1 = l->next->next->v;
else v1 = l->prev->v;
}
else {
- is_split_vert = 0;
- ov = BME_edge_getothervert(l->e,v);
+ /* is_split_vert = 0; */ /* UNUSED */
+ /* ov = BME_edge_getothervert(l->e,v); */ /* UNUSED */
sv = BME_split_edge(bm,v,l->e,&ne,0);
//BME_data_interp_from_verts(bm, v, ov, sv, 0.25); /*this is technically wrong...*/
//BME_data_interp_from_faceverts(bm, v, ov, sv, 0.25);
@@ -494,7 +494,7 @@ static BME_Vert *BME_bevel_split_edge(BME_Mesh *bm, BME_Vert *v, BME_Vert *v1, B
vtd = BME_get_transdata(td, sv);
vtd1 = BME_get_transdata(td, v);
- vtd2 = BME_get_transdata(td,v1);
+ /* vtd2 = BME_get_transdata(td,v1); */ /* UNUSED */
if (vtd1->loc == NULL) {
/* this is a vert with data only for calculating initial weights */
@@ -717,7 +717,7 @@ static BME_Loop *BME_bevel_edge(BME_Mesh *bm, BME_Loop *l, float value, int UNUS
static BME_Loop *BME_bevel_vert(BME_Mesh *bm, BME_Loop *l, float value, int UNUSED(options), float *up_vec, BME_TransData_Head *td) {
BME_Vert *v1, *v2;
- BME_Poly *f;
+ /* BME_Poly *f; */ /* UNUSED */
/* get/make the first vert to be used in SFME */
/* may need to split the previous edge */
@@ -730,7 +730,7 @@ static BME_Loop *BME_bevel_vert(BME_Mesh *bm, BME_Loop *l, float value, int UNUS
l = l->next->next;
/* "cut off" this corner */
- f = BME_split_face(bm,l->f,v2,v1,NULL,l->e);
+ /* f = */ /* UNUSED */ BME_split_face(bm,l->f,v2,v1,NULL,l->e);
return l;
}
@@ -929,16 +929,16 @@ static BME_Mesh *BME_bevel_initialize(BME_Mesh *bm, int options, int UNUSED(defg
BME_Vert *v;
BME_Edge *e;
BME_Poly *f;
- BME_TransData *vtd;
- MDeformVert *dvert;
- MDeformWeight *dw;
+ /* BME_TransData *vtd; */ /* UNUSED */
+ /* MDeformVert *dvert; */ /* UNUSED */
+ /* MDeformWeight *dw; */ /* UNUSED */
int len;
float weight, threshold;
/* vert pass */
for (v=bm->verts.first; v; v=v->next) {
- dvert = NULL;
- dw = NULL;
+ /* dvert = NULL; */ /* UNUSED */
+ /* dw = NULL; */ /* UNUSED */
v->tflag1 = BME_BEVEL_ORIG;
/* originally coded, a vertex gets tagged with BME_BEVEL_BEVEL in this pass if
* the vert is manifold (or is shared by only two edges - wire bevel)
@@ -962,7 +962,7 @@ static BME_Mesh *BME_bevel_initialize(BME_Mesh *bm, int options, int UNUSED(defg
else {
len = BME_cycle_length(BME_disk_getpointer(v->edge,v));
/* we'll assign a default transform data to every vert (except the loose ones) */
- vtd = BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 0, -1, -1, NULL);
+ /* vtd = */ /* UNUSED */ BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 0, -1, -1, NULL);
}
/* check for non-manifold vert */
@@ -990,11 +990,11 @@ static BME_Mesh *BME_bevel_initialize(BME_Mesh *bm, int options, int UNUSED(defg
//~ }
//~ if (!dw || dw->weight == 0.0) continue;
if (v->bweight == 0.0) continue;
- vtd = BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 1.0, v->bweight, -1, NULL);
+ /* vtd = */ /* UNUSED */ BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 1.0, v->bweight, -1, NULL);
v->tflag1 |= BME_BEVEL_BEVEL;
}
else {
- vtd = BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 1.0, 1.0, -1, NULL);
+ /* vtd = */ /* UNUSED */ BME_assign_transdata(td, bm, v, v->co, v->co, NULL, NULL, 1.0, 1.0, -1, NULL);
v->tflag1 |= BME_BEVEL_BEVEL;
}
}
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index a311ca15e5e..bf9acb224d5 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -1,7 +1,8 @@
+/* $Id$ */
+
/** \file blender/blenkernel/intern/CCGSubSurf.c
* \ingroup bke
*/
-/* $Id$ */
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.h b/source/blender/blenkernel/intern/CCGSubSurf.h
index 363d1e01f98..1835e63727d 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.h
+++ b/source/blender/blenkernel/intern/CCGSubSurf.h
@@ -1,7 +1,8 @@
+/* $Id$ */
+
/** \file blender/blenkernel/intern/CCGSubSurf.h
* \ingroup bke
*/
-/* $Id$ */
typedef void* CCGMeshHDL;
typedef void* CCGVertHDL;
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 2215c0d6bb4..705ef82fe24 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -62,6 +62,11 @@
#include "BKE_multires.h"
#include "BKE_armature.h"
+#ifdef WITH_GAMEENGINE
+#include "BKE_navmesh_conversion.h"
+static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm);
+#endif
+
#include "BLO_sys_types.h" // for intptr_t support
#include "GL/glew.h"
@@ -691,9 +696,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
else {
const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT;
if (shade_type != shade_prev) {
- glShadeModel((shade_prev= shade_type));
+ if(poly_prev != GL_ZERO) glEnd();
+ glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */
+ glBegin((poly_prev= poly_type));
}
- if(poly_type != poly_prev) {
+ else if(poly_type != poly_prev) {
if(poly_prev != GL_ZERO) glEnd();
glBegin((poly_prev= poly_type));
}
@@ -756,9 +763,11 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
else {
const GLenum shade_type= drawSmooth ? GL_SMOOTH : GL_FLAT;
if (shade_type != shade_prev) {
- glShadeModel((shade_prev= shade_type));
+ if(poly_prev != GL_ZERO) glEnd();
+ glShadeModel((shade_prev= shade_type)); /* same as below but switch shading */
+ glBegin((poly_prev= poly_type));
}
- if(poly_type != poly_prev) {
+ else if(poly_type != poly_prev) {
if(poly_prev != GL_ZERO) glEnd();
glBegin((poly_prev= poly_type));
}
@@ -799,7 +808,7 @@ static void emDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
}
static void emDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
+ int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
void *userData)
{
@@ -827,7 +836,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
int flag;
if(drawParams)
- flag= drawParams(tf, mcol, efa->mat_nr);
+ flag= drawParams(tf, (mcol != NULL), efa->mat_nr);
else if(drawParamsMapped)
flag= drawParamsMapped(userData, i);
else
@@ -900,7 +909,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
int flag;
if(drawParams)
- flag= drawParams(tf, mcol, efa->mat_nr);
+ flag= drawParams(tf, (mcol != NULL), efa->mat_nr);
else if(drawParamsMapped)
flag= drawParamsMapped(userData, i);
else
@@ -966,7 +975,7 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
}
}
-static void emDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, MCol *mcol, int matnr))
+static void emDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr))
{
emDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL);
}
@@ -2240,6 +2249,18 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
add_orco_dm(ob, NULL, *deform_r, NULL, CD_ORCO);
}
+#ifdef WITH_GAMEENGINE
+ /* NavMesh - this is a hack but saves having a NavMesh modifier */
+ if ((ob->gameflag & OB_NAVMESH) && (finaldm->type == DM_TYPE_CDDM)) {
+ DerivedMesh *tdm;
+ tdm= navmesh_dm_createNavMeshForVisualization(finaldm);
+ if (finaldm != tdm) {
+ finaldm->release(finaldm);
+ finaldm= tdm;
+ }
+ }
+#endif /* WITH_GAMEENGINE */
+
*final_r = finaldm;
if(orcodm)
@@ -3074,3 +3095,170 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm)
boundbox_set_from_min_max(ob->bb, min, max);
}
+
+/* --- NAVMESH (begin) --- */
+#ifdef WITH_GAMEENGINE
+
+BM_INLINE int navmesh_bit(int a, int b)
+{
+ return (a & (1 << b)) >> b;
+}
+
+BM_INLINE void navmesh_intToCol(int i, float col[3])
+{
+ int r = navmesh_bit(i, 0) + navmesh_bit(i, 3) * 2 + 1;
+ int g = navmesh_bit(i, 1) + navmesh_bit(i, 4) * 2 + 1;
+ int b = navmesh_bit(i, 2) + navmesh_bit(i, 5) * 2 + 1;
+ col[0] = 1 - r*63.0f/255.0f;
+ col[1] = 1 - g*63.0f/255.0f;
+ col[2] = 1 - b*63.0f/255.0f;
+}
+
+static void navmesh_drawColored(DerivedMesh *dm)
+{
+ int a, glmode;
+ MVert *mvert = (MVert *)CustomData_get_layer(&dm->vertData, CD_MVERT);
+ MFace *mface = (MFace *)CustomData_get_layer(&dm->faceData, CD_MFACE);
+ int *polygonIdx = (int *)CustomData_get_layer(&dm->faceData, CD_RECAST);
+ float col[3];
+
+ if (!polygonIdx)
+ return;
+
+ /*
+ //UI_ThemeColor(TH_WIRE);
+ glDisable(GL_LIGHTING);
+ glLineWidth(2.0);
+ dm->drawEdges(dm, 0, 1);
+ glLineWidth(1.0);
+ glEnable(GL_LIGHTING);*/
+
+ glDisable(GL_LIGHTING);
+ /* if(GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */
+ DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" );
+ //glShadeModel(GL_SMOOTH);
+ glBegin(glmode = GL_QUADS);
+ for(a = 0; a < dm->numFaceData; a++, mface++) {
+ int new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES;
+ int pi = polygonIdx[a];
+ if (pi <= 0) {
+ zero_v3(col);
+ }
+ else {
+ navmesh_intToCol(pi, col);
+ }
+
+ if(new_glmode != glmode) {
+ glEnd();
+ glBegin(glmode = new_glmode);
+ }
+ glColor3fv(col);
+ glVertex3fv(mvert[mface->v1].co);
+ glVertex3fv(mvert[mface->v2].co);
+ glVertex3fv(mvert[mface->v3].co);
+ if(mface->v4) {
+ glVertex3fv(mvert[mface->v4].co);
+ }
+ }
+ glEnd();
+ }
+ glEnable(GL_LIGHTING);
+}
+
+static void navmesh_DM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr))
+{
+ (void) setDrawOptions;
+
+ navmesh_drawColored(dm);
+}
+
+static void navmesh_DM_drawFacesSolid(DerivedMesh *dm,
+ float (*partial_redraw_planes)[4],
+ int UNUSED(fast), int (*setMaterial)(int, void *attribs))
+{
+ (void) partial_redraw_planes;
+ (void) setMaterial;
+
+ //drawFacesSolid_original(dm, partial_redraw_planes, fast, setMaterial);
+ navmesh_drawColored(dm);
+}
+
+static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm)
+{
+ DerivedMesh *result;
+ int maxFaces = dm->getNumFaces(dm);
+ int *recastData;
+ int vertsPerPoly=0, nverts=0, ndtris=0, npolys=0;
+ float* verts=NULL;
+ unsigned short *dtris=NULL, *dmeshes=NULL, *polys=NULL;
+ int *dtrisToPolysMap=NULL, *dtrisToTrisMap=NULL, *trisToFacesMap=NULL;
+ int res;
+
+ result = CDDM_copy(dm);
+ if (!CustomData_has_layer(&result->faceData, CD_RECAST)) {
+ int *sourceRecastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST);
+ if (sourceRecastData) {
+ CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE,
+ sourceRecastData, maxFaces, "recastData");
+ }
+ }
+ recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST);
+
+ /* note: This is not good design! - really should not be doing this */
+ result->drawFacesTex = navmesh_DM_drawFacesTex;
+ result->drawFacesSolid = navmesh_DM_drawFacesSolid;
+
+
+ /* process mesh */
+ res = buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nverts, &verts, &ndtris, &dtris,
+ &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap,
+ &trisToFacesMap);
+ if (res) {
+ size_t polyIdx;
+
+ /* invalidate concave polygon */
+ for (polyIdx=0; polyIdx<(size_t)npolys; polyIdx++) {
+ unsigned short* poly = &polys[polyIdx*2*vertsPerPoly];
+ if (!polyIsConvex(poly, vertsPerPoly, verts)) {
+ /* set negative polygon idx to all faces */
+ unsigned short *dmesh = &dmeshes[4*polyIdx];
+ unsigned short tbase = dmesh[2];
+ unsigned short tnum = dmesh[3];
+ unsigned short ti;
+
+ for (ti=0; ti<tnum; ti++) {
+ unsigned short triidx = dtrisToTrisMap[tbase+ti];
+ unsigned short faceidx = trisToFacesMap[triidx];
+ if (recastData[faceidx] > 0) {
+ recastData[faceidx] = -recastData[faceidx];
+ }
+ }
+ }
+ }
+ }
+ else {
+ printf("Error during creation polygon infos\n");
+ }
+
+ /* clean up */
+ if (verts!=NULL)
+ MEM_freeN(verts);
+ if (dtris!=NULL)
+ MEM_freeN(dtris);
+ if (dmeshes!=NULL)
+ MEM_freeN(dmeshes);
+ if (polys!=NULL)
+ MEM_freeN(polys);
+ if (dtrisToPolysMap!=NULL)
+ MEM_freeN(dtrisToPolysMap);
+ if (dtrisToTrisMap!=NULL)
+ MEM_freeN(dtrisToTrisMap);
+ if (trisToFacesMap!=NULL)
+ MEM_freeN(trisToFacesMap);
+
+ return result;
+}
+
+#endif /* WITH_GAMEENGINE */
+
+/* --- NAVMESH (end) --- */
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 73ddcbecf94..8b9f5ac98d3 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -270,7 +272,7 @@ bActionGroup *action_groups_add_new (bAction *act, const char name[])
/* make it selected, with default name */
agrp->flag = AGRP_SELECTED;
- strncpy(agrp->name, name[0] ? name : "Group", sizeof(agrp->name));
+ BLI_strncpy(agrp->name, name[0] ? name : "Group", sizeof(agrp->name));
/* add to action, and validate */
BLI_addtail(&act->groups, agrp);
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 824bbb8f70d..cd2c272a1c2 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -1,4 +1,6 @@
-/*
+/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -1514,7 +1516,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i
/* in par the family name is stored, use this to find the other objects */
- chartransdata= BKE_text_to_curve(scene, par, FO_DUPLI);
+ chartransdata= BKE_text_to_curve(G.main, scene, par, FO_DUPLI);
if(chartransdata==NULL) return;
cu= par->data;
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index eff07a1b8c7..c21cb2b012e 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -1162,6 +1164,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
return 0;
}
+ /* RNA property update disabled for now - [#28525] [#28690] [#28774] [#28777] */
+#if 0
/* buffer property update for later flushing */
if (RNA_property_update_check(prop)) {
short skip_updates_hack = 0;
@@ -1178,6 +1182,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
if (skip_updates_hack == 0)
RNA_property_update_cache_add(&new_ptr, prop);
}
+#endif
}
/* successful */
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 1149d8eee25..fbbce58414e 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 218b83fc52a..5358a26e660 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -1,7 +1,4 @@
-/* blender.c jan 94 MIXED MODEL
- *
- * common help functions and data
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -318,6 +315,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
set_scene_bg(G.main, CTX_data_scene(C));
MEM_freeN(bfd);
+
+ (void)curscene; /* quiet warning */
}
static int handle_subversion_warning(Main *main, ReportList *reports)
@@ -516,7 +515,7 @@ void BKE_write_undo(bContext *C, const char *name)
/* make new */
curundo= uel= MEM_callocN(sizeof(UndoElem), "undo file");
- strncpy(uel->name, name, MAXUNDONAME-1);
+ BLI_strncpy(uel->name, name, sizeof(uel->name));
BLI_addtail(&undobase, uel);
/* and limit amount to the maximum */
diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c
index 6b1f313d88d..d73d7509644 100644
--- a/source/blender/blenkernel/intern/bmfont.c
+++ b/source/blender/blenkernel/intern/bmfont.c
@@ -1,8 +1,4 @@
/*
- * bmfont.c
- *
- * 04-10-2000 frank
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -26,7 +22,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): 04-10-2000 frank.
*
* ***** END GPL LICENSE BLOCK *****
*
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index 3966caa1fa9..2a478d4ffe2 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -1,6 +1,4 @@
-/* boids.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -908,7 +906,8 @@ static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val,
else
return 0;
}
-static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa) {
+static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa)
+{
BoidState *state = boids->states.first;
BoidParticle *bpa = pa->boid;
diff --git a/source/blender/blenkernel/intern/bullet.c b/source/blender/blenkernel/intern/bullet.c
index 72f5e907800..e4a02434cba 100644
--- a/source/blender/blenkernel/intern/bullet.c
+++ b/source/blender/blenkernel/intern/bullet.c
@@ -1,5 +1,4 @@
-/*
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index c3aeb440938..2ce6b92922d 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -1,5 +1,4 @@
/*
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index ac92d0b6895..1ed263475d8 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1,41 +1,41 @@
/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2006 Blender Foundation.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): Ben Batt <benbatt@gmail.com>
-*
-* ***** END GPL LICENSE BLOCK *****
-*
-* Implementation of CDDerivedMesh.
-*
-* BKE_cdderivedmesh.h contains the function prototypes for this file.
-*
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Ben Batt <benbatt@gmail.com>
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ * Implementation of CDDerivedMesh.
+ *
+ * BKE_cdderivedmesh.h contains the function prototypes for this file.
+ *
+ */
/** \file blender/blenkernel/intern/cdderivedmesh.c
* \ingroup bke
*/
-
+
#include "GL/glew.h"
#include "BLI_blenlib.h"
@@ -647,7 +647,7 @@ static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned cha
}
static void cdDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
+ int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
void *userData)
{
@@ -673,7 +673,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
unsigned char *cp = NULL;
if(drawParams) {
- flag = drawParams(tf? &tf[i]: NULL, mcol? &mcol[i*4]: NULL, mf->mat_nr);
+ flag = drawParams(tf? &tf[i]: NULL, (mcol != NULL), mf->mat_nr);
}
else {
if(index) {
@@ -756,9 +756,10 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
unsigned char *colors = MEM_mallocN(dm->getNumFaces(dm)*4*3*sizeof(unsigned char), "cdDM_drawFacesTex_common");
for( i=0; i < dm->getNumFaces(dm); i++ ) {
for( j=0; j < 4; j++ ) {
- colors[i*12+j*3] = col[i*4+j].r;
+ /* bgr -> rgb is intentional (and stupid), but how its stored internally */
+ colors[i*12+j*3] = col[i*4+j].b;
colors[i*12+j*3+1] = col[i*4+j].g;
- colors[i*12+j*3+2] = col[i*4+j].b;
+ colors[i*12+j*3+2] = col[i*4+j].r;
}
}
GPU_color3_upload(dm,colors);
@@ -792,7 +793,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
int flag = 1;
if(drawParams) {
- flag = drawParams(tf? &tf[actualFace]: NULL, mcol? &mcol[actualFace*4]: NULL, mf[actualFace].mat_nr);
+ flag = drawParams(tf? &tf[actualFace]: NULL, (mcol != NULL), mf[actualFace].mat_nr);
}
else {
if(index) {
@@ -835,7 +836,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
}
}
-static void cdDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, MCol *mcol, int matnr))
+static void cdDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr))
{
cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL);
}
@@ -981,9 +982,13 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
if(!flush && compareDrawOptions) {
int next_orig= (index==NULL) ? next_actualFace : index[next_actualFace];
- /* also compare draw options and flush buffer if they're different
- need for face selection highlight in edit mode */
- flush|= compareDrawOptions(userData, orig, next_orig) == 0;
+ if(orig==ORIGINDEX_NONE || next_orig==ORIGINDEX_NONE) {
+ flush= 1;
+ } else {
+ /* also compare draw options and flush buffer if they're different
+ need for face selection highlight in edit mode */
+ flush|= compareDrawOptions(userData, orig, next_orig) == 0;
+ }
}
if(flush) {
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 3a86389dba7..1ec573c853a 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -741,7 +741,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
MDeformVert *dvert = NULL;
Cloth *clothObj = NULL;
int numverts;
- float goalfac = 0;
+ /* float goalfac = 0; */ /* UNUSED */
ClothVertex *verts = NULL;
if (!clmd || !dm) return;
@@ -764,7 +764,7 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm )
if (( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_mass-1)) && (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL ))
{
verts->goal = dvert->dw [j].weight;
- goalfac= 1.0f;
+ /* goalfac= 1.0f; */ /* UNUSED */
/*
// Kicking goal factor to simplify things...who uses that anyway?
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index d8b51973948..26ee62e035b 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -1374,7 +1374,8 @@ static CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTree
return collpair;
}
-static void machine_epsilon_offset(Cloth *cloth) {
+static void machine_epsilon_offset(Cloth *cloth)
+{
ClothVertex *cv;
int i, j;
@@ -2363,7 +2364,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
{
Cloth *cloth= clmd->clothObject;
BVHTree *cloth_bvh= cloth->bvhtree;
- unsigned int i=0, numfaces = 0, numverts = 0, k, l, j;
+ unsigned int i=0, /* numfaces = 0, */ /* UNUSED */ numverts = 0, k, l, j;
int rounds = 0; // result counts applied collisions; ic is for debug output;
ClothVertex *verts = NULL;
int ret = 0, ret2 = 0;
@@ -2374,7 +2375,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
return 0;
verts = cloth->verts;
- numfaces = cloth->numfaces;
+ /* numfaces = cloth->numfaces; */ /* UNUSED */
numverts = cloth->numverts;
////////////////////////////////////////////////////////////
@@ -2476,7 +2477,7 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
// collisions = 1;
verts = cloth->verts; // needed for openMP
- numfaces = cloth->numfaces;
+ /* numfaces = cloth->numfaces; */ /* UNUSED */
numverts = cloth->numverts;
verts = cloth->verts;
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 61e9daf4138..83003809a37 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1,4 +1,4 @@
-/*
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -361,72 +361,68 @@ void curvemap_sethandle(CurveMap *cuma, int type)
static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *next, int UNUSED(mode))
{
float *p1,*p2,*p3,pt[3];
- float dx1,dy1, dx,dy, vx,vy, len,len1,len2;
-
- if(bezt->h1==0 && bezt->h2==0) return;
+ float len,len_a, len_b;
+ float dvec_a[2], dvec_b[2];
+
+ if(bezt->h1==0 && bezt->h2==0) {
+ return;
+ }
p2= bezt->vec[1];
if(prev==NULL) {
p3= next->vec[1];
- pt[0]= 2*p2[0]- p3[0];
- pt[1]= 2*p2[1]- p3[1];
+ pt[0]= 2.0f*p2[0] - p3[0];
+ pt[1]= 2.0f*p2[1] - p3[1];
p1= pt;
}
- else p1= prev->vec[1];
+ else {
+ p1= prev->vec[1];
+ }
if(next==NULL) {
p1= prev->vec[1];
- pt[0]= 2*p2[0]- p1[0];
- pt[1]= 2*p2[1]- p1[1];
+ pt[0]= 2.0f*p2[0] - p1[0];
+ pt[1]= 2.0f*p2[1] - p1[1];
p3= pt;
}
- else p3= next->vec[1];
-
- dx= p2[0]- p1[0];
- dy= p2[1]- p1[1];
+ else {
+ p3= next->vec[1];
+ }
- len1= (float)sqrt(dx*dx+dy*dy);
-
- dx1= p3[0]- p2[0];
- dy1= p3[1]- p2[1];
+ sub_v2_v2v2(dvec_a, p2, p1);
+ sub_v2_v2v2(dvec_b, p3, p2);
- len2= (float)sqrt(dx1*dx1+dy1*dy1);
-
- if(len1==0.0f) len1=1.0f;
- if(len2==0.0f) len2=1.0f;
-
- if(bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */
- vx= dx1/len2 + dx/len1;
- vy= dy1/len2 + dy/len1;
-
- len= 2.5614f*(float)sqrt(vx*vx + vy*vy);
+ len_a= len_v2(dvec_a);
+ len_b= len_v2(dvec_b);
+
+ if(len_a==0.0f) len_a=1.0f;
+ if(len_b==0.0f) len_b=1.0f;
+
+ if(bezt->h1==HD_AUTO || bezt->h2==HD_AUTO) { /* auto */
+ float tvec[2];
+ tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a;
+ tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a;
+
+ len= len_v2(tvec) * 2.5614f;
if(len!=0.0f) {
if(bezt->h1==HD_AUTO) {
- len1/=len;
- *(p2-3)= *p2-vx*len1;
- *(p2-2)= *(p2+1)-vy*len1;
+ len_a/=len;
+ madd_v2_v2v2fl(p2-3, p2, tvec, -len_a);
}
if(bezt->h2==HD_AUTO) {
- len2/=len;
- *(p2+3)= *p2+vx*len2;
- *(p2+4)= *(p2+1)+vy*len2;
+ len_b/=len;
+ madd_v2_v2v2fl(p2+3, p2, tvec, len_b);
}
}
}
if(bezt->h1==HD_VECT) { /* vector */
- dx/=3.0f;
- dy/=3.0f;
- *(p2-3)= *p2-dx;
- *(p2-2)= *(p2+1)-dy;
+ madd_v2_v2v2fl(p2-3, p2, dvec_a, -1.0f/3.0f);
}
if(bezt->h2==HD_VECT) {
- dx1/=3.0f;
- dy1/=3.0f;
- *(p2+3)= *p2+dx1;
- *(p2+4)= *(p2+1)+dy1;
+ madd_v2_v2v2fl(p2+3, p2, dvec_b, 1.0f/3.0f);
}
}
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index a59092784dd..591e0b6a8d2 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -3937,7 +3939,8 @@ static bConstraintTypeInfo *constraintsTypeInfo[NUM_CONSTRAINT_TYPES];
static short CTI_INIT= 1; /* when non-zero, the list needs to be updated */
/* This function only gets called when CTI_INIT is non-zero */
-static void constraints_init_typeinfo (void) {
+static void constraints_init_typeinfo (void)
+{
constraintsTypeInfo[0]= NULL; /* 'Null' Constraint */
constraintsTypeInfo[1]= &CTI_CHILDOF; /* ChildOf Constraint */
constraintsTypeInfo[2]= &CTI_TRACKTO; /* TrackTo Constraint */
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 794006e6f39..2e9ad11c6ca 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -1,7 +1,4 @@
-
-/* curve.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -2457,72 +2454,77 @@ void makeBevelList(Object *ob)
void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
{
float *p1,*p2,*p3, pt[3];
- float dx1,dy1,dz1,dx,dy,dz,vx,vy,vz,len,len1,len2;
+ float dvec_a[3], dvec_b[3];
+ float len, len_a, len_b;
const float eps= 1e-5;
- if(bezt->h1==0 && bezt->h2==0) return;
+ if(bezt->h1==0 && bezt->h2==0) {
+ return;
+ }
p2= bezt->vec[1];
if(prev==NULL) {
p3= next->vec[1];
- pt[0]= 2*p2[0]- p3[0];
- pt[1]= 2*p2[1]- p3[1];
- pt[2]= 2*p2[2]- p3[2];
+ pt[0]= 2.0f*p2[0] - p3[0];
+ pt[1]= 2.0f*p2[1] - p3[1];
+ pt[2]= 2.0f*p2[2] - p3[2];
p1= pt;
}
- else p1= prev->vec[1];
+ else {
+ p1= prev->vec[1];
+ }
if(next==NULL) {
- pt[0]= 2*p2[0]- p1[0];
- pt[1]= 2*p2[1]- p1[1];
- pt[2]= 2*p2[2]- p1[2];
+ pt[0]= 2.0f*p2[0] - p1[0];
+ pt[1]= 2.0f*p2[1] - p1[1];
+ pt[2]= 2.0f*p2[2] - p1[2];
p3= pt;
}
- else p3= next->vec[1];
+ else {
+ p3= next->vec[1];
+ }
- dx= p2[0]- p1[0];
- dy= p2[1]- p1[1];
- dz= p2[2]- p1[2];
-
- if(mode) len1= dx;
- else len1= (float)sqrt(dx*dx+dy*dy+dz*dz);
-
- dx1= p3[0]- p2[0];
- dy1= p3[1]- p2[1];
- dz1= p3[2]- p2[2];
-
- if(mode) len2= dx1;
- else len2= (float)sqrt(dx1*dx1+dy1*dy1+dz1*dz1);
+ sub_v3_v3v3(dvec_a, p2, p1);
+ sub_v3_v3v3(dvec_b, p3, p2);
- if(len1==0.0f) len1=1.0f;
- if(len2==0.0f) len2=1.0f;
+ if (mode != 0) {
+ len_a= dvec_a[0];
+ len_b= dvec_b[0];
+ }
+ else {
+ len_a= len_v3(dvec_a);
+ len_b= len_v3(dvec_b);
+ }
+
+ if(len_a==0.0f) len_a=1.0f;
+ if(len_b==0.0f) len_b=1.0f;
if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM) || ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) { /* auto */
- vx= dx1/len2 + dx/len1;
- vy= dy1/len2 + dy/len1;
- vz= dz1/len2 + dz/len1;
- len= 2.5614f*(float)sqrt(vx*vx + vy*vy + vz*vz);
+ float tvec[3];
+ tvec[0]= dvec_b[0]/len_b + dvec_a[0]/len_a;
+ tvec[1]= dvec_b[1]/len_b + dvec_a[1]/len_a;
+ tvec[2]= dvec_b[2]/len_b + dvec_a[2]/len_a;
+ len= len_v3(tvec) * 2.5614f;
+
if(len!=0.0f) {
int leftviolate=0, rightviolate=0; /* for mode==2 */
- if(len1>5.0f*len2) len1= 5.0f*len2;
- if(len2>5.0f*len1) len2= 5.0f*len1;
+ if(len_a>5.0f*len_b) len_a= 5.0f*len_b;
+ if(len_b>5.0f*len_a) len_b= 5.0f*len_a;
if(ELEM(bezt->h1,HD_AUTO,HD_AUTO_ANIM)) {
- len1/=len;
- *(p2-3)= *p2-vx*len1;
- *(p2-2)= *(p2+1)-vy*len1;
- *(p2-1)= *(p2+2)-vz*len1;
+ len_a/=len;
+ madd_v3_v3v3fl(p2-3, p2, tvec, -len_a);
- if((bezt->h1==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema
+ if((bezt->h1==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */
float ydiff1= prev->vec[1][1] - bezt->vec[1][1];
float ydiff2= next->vec[1][1] - bezt->vec[1][1];
if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) {
bezt->vec[0][1]= bezt->vec[1][1];
}
- else { // handles should not be beyond y coord of two others
+ else { /* handles should not be beyond y coord of two others */
if(ydiff1 <= 0.0f) {
if(prev->vec[1][1] > bezt->vec[0][1]) {
bezt->vec[0][1]= prev->vec[1][1];
@@ -2539,18 +2541,16 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
}
if(ELEM(bezt->h2,HD_AUTO,HD_AUTO_ANIM)) {
- len2/=len;
- *(p2+3)= *p2+vx*len2;
- *(p2+4)= *(p2+1)+vy*len2;
- *(p2+5)= *(p2+2)+vz*len2;
+ len_b/=len;
+ madd_v3_v3v3fl(p2+3, p2, tvec, len_b);
- if((bezt->h2==HD_AUTO_ANIM) && next && prev) { // keep horizontal if extrema
+ if((bezt->h2==HD_AUTO_ANIM) && next && prev) { /* keep horizontal if extrema */
float ydiff1= prev->vec[1][1] - bezt->vec[1][1];
float ydiff2= next->vec[1][1] - bezt->vec[1][1];
if( (ydiff1 <= 0.0f && ydiff2 <= 0.0f) || (ydiff1 >= 0.0f && ydiff2 >= 0.0f) ) {
bezt->vec[2][1]= bezt->vec[1][1];
}
- else { // handles should not be beyond y coord of two others
+ else { /* andles should not be beyond y coord of two others */
if(ydiff1 <= 0.0f) {
if(next->vec[1][1] < bezt->vec[2][1]) {
bezt->vec[2][1]= next->vec[1][1];
@@ -2566,25 +2566,25 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
}
}
- if(leftviolate || rightviolate) { /* align left handle */
+ if(leftviolate || rightviolate) { /* align left handle */
float h1[3], h2[3];
+ float dot;
sub_v3_v3v3(h1, p2-3, p2);
sub_v3_v3v3(h2, p2, p2+3);
- len1= normalize_v3(h1);
- len2= normalize_v3(h2);
- vz= dot_v3v3(h1, h2);
+ len_a= normalize_v3(h1);
+ len_b= normalize_v3(h2);
+
+ dot= dot_v3v3(h1, h2);
if(leftviolate) {
- *(p2+3)= *(p2) - vz*len2*h1[0];
- *(p2+4)= *(p2+1) - vz*len2*h1[1];
- *(p2+5)= *(p2+2) - vz*len2*h1[2];
+ mul_v3_fl(h1, dot * len_b);
+ sub_v3_v3v3(p2+3, p2, h1);
}
else {
- *(p2-3)= *(p2) + vz*len1*h2[0];
- *(p2-2)= *(p2+1) + vz*len1*h2[1];
- *(p2-1)= *(p2+2) + vz*len1*h2[2];
+ mul_v3_fl(h2, dot * len_a);
+ add_v3_v3v3(p2-3, p2, h2);
}
}
@@ -2592,60 +2592,50 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
}
if(bezt->h1==HD_VECT) { /* vector */
- dx/=3.0f;
- dy/=3.0f;
- dz/=3.0f;
- *(p2-3)= *p2-dx;
- *(p2-2)= *(p2+1)-dy;
- *(p2-1)= *(p2+2)-dz;
+ madd_v3_v3v3fl(p2-3, p2, dvec_a, -1.0f/3.0f);
}
if(bezt->h2==HD_VECT) {
- dx1/=3.0f;
- dy1/=3.0f;
- dz1/=3.0f;
- *(p2+3)= *p2+dx1;
- *(p2+4)= *(p2+1)+dy1;
- *(p2+5)= *(p2+2)+dz1;
+ madd_v3_v3v3fl(p2+3, p2, dvec_b, 1.0f/3.0f);
}
- len2= len_v3v3(p2, p2+3);
- len1= len_v3v3(p2, p2-3);
- if(len1==0.0f) len1= 1.0f;
- if(len2==0.0f) len2= 1.0f;
+ len_b= len_v3v3(p2, p2+3);
+ len_a= len_v3v3(p2, p2-3);
+ if(len_a==0.0f) len_a= 1.0f;
+ if(len_b==0.0f) len_b= 1.0f;
if(bezt->f1 & SELECT) { /* order of calculation */
- if(bezt->h2==HD_ALIGN) { /* aligned */
- if(len1>eps) {
- len= len2/len1;
- p2[3]= p2[0]+len*(p2[0]-p2[-3]);
- p2[4]= p2[1]+len*(p2[1]-p2[-2]);
- p2[5]= p2[2]+len*(p2[2]-p2[-1]);
+ if(bezt->h2==HD_ALIGN) { /* aligned */
+ if(len_a>eps) {
+ len= len_b/len_a;
+ p2[3]= p2[0]+len*(p2[0] - p2[-3]);
+ p2[4]= p2[1]+len*(p2[1] - p2[-2]);
+ p2[5]= p2[2]+len*(p2[2] - p2[-1]);
}
}
if(bezt->h1==HD_ALIGN) {
- if(len2>eps) {
- len= len1/len2;
- p2[-3]= p2[0]+len*(p2[0]-p2[3]);
- p2[-2]= p2[1]+len*(p2[1]-p2[4]);
- p2[-1]= p2[2]+len*(p2[2]-p2[5]);
+ if(len_b>eps) {
+ len= len_a/len_b;
+ p2[-3]= p2[0]+len*(p2[0] - p2[3]);
+ p2[-2]= p2[1]+len*(p2[1] - p2[4]);
+ p2[-1]= p2[2]+len*(p2[2] - p2[5]);
}
}
}
else {
if(bezt->h1==HD_ALIGN) {
- if(len2>eps) {
- len= len1/len2;
- p2[-3]= p2[0]+len*(p2[0]-p2[3]);
- p2[-2]= p2[1]+len*(p2[1]-p2[4]);
- p2[-1]= p2[2]+len*(p2[2]-p2[5]);
+ if(len_b>eps) {
+ len= len_a/len_b;
+ p2[-3]= p2[0]+len*(p2[0] - p2[3]);
+ p2[-2]= p2[1]+len*(p2[1] - p2[4]);
+ p2[-1]= p2[2]+len*(p2[2] - p2[5]);
}
}
if(bezt->h2==HD_ALIGN) { /* aligned */
- if(len1>eps) {
- len= len2/len1;
- p2[3]= p2[0]+len*(p2[0]-p2[-3]);
- p2[4]= p2[1]+len*(p2[1]-p2[-2]);
- p2[5]= p2[2]+len*(p2[2]-p2[-1]);
+ if(len_a>eps) {
+ len= len_b/len_a;
+ p2[3]= p2[0]+len*(p2[0] - p2[-3]);
+ p2[4]= p2[1]+len*(p2[1] - p2[-2]);
+ p2[5]= p2[2]+len*(p2[2] - p2[-1]);
}
}
}
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 30da2e01011..7d98119610b 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1,36 +1,36 @@
/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2006 Blender Foundation.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): Ben Batt <benbatt@gmail.com>
-*
-* ***** END GPL LICENSE BLOCK *****
-*
-* Implementation of CustomData.
-*
-* BKE_customdata.h contains the function prototypes for this file.
-*
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Ben Batt <benbatt@gmail.com>
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ * Implementation of CustomData.
+ *
+ * BKE_customdata.h contains the function prototypes for this file.
+ *
+ */
/** \file blender/blenkernel/intern/customdata.c
* \ingroup bke
@@ -2383,10 +2383,8 @@ int CustomData_verify_versions(struct CustomData *data, int index)
static void customdata_external_filename(char filename[FILE_MAX], ID *id, CustomDataExternal *external)
{
- char *path = (id->lib)? id->lib->filepath: G.main->name;
-
BLI_strncpy(filename, external->filename, FILE_MAX);
- BLI_path_abs(filename, path);
+ BLI_path_abs(filename, ID_BLEND_PATH(G.main, id));
}
void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask mask, int totelem)
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 11a0a5884ee..f18f533d460 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -1,9 +1,4 @@
-/* deform.c June 2001
- *
- * support for deformation groups
- *
- * Reevan McKay
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -27,7 +22,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Reevan McKay
*
* ***** END GPL LICENSE BLOCK *****
*/
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index ee4c7162251..79269e300f7 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2051,17 +2051,27 @@ static int object_modifiers_use_time(Object *ob)
/* check whether any modifiers are animated */
if (ob->adt) {
AnimData *adt = ob->adt;
+ FCurve *fcu;
/* action - check for F-Curves with paths containing 'modifiers[' */
if (adt->action) {
- FCurve *fcu;
-
for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) {
if (fcu->rna_path && strstr(fcu->rna_path, "modifiers["))
return 1;
}
}
+ /* This here allows modifier properties to get driven and still update properly
+ *
+ * Workaround to get [#26764] (e.g. subsurf levels not updating when animated/driven)
+ * working, without the updating problems ([#28525] [#28690] [#28774] [#28777]) caused
+ * by the RNA updates cache introduced in r.38649
+ */
+ for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
+ if (fcu->rna_path && strstr(fcu->rna_path, "modifiers["))
+ return 1;
+ }
+
// XXX: also, should check NLA strips, though for now assume that nobody uses
// that and we can omit that for performance reasons...
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index b19ea93a1b8..fb67c07cfe9 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1,6 +1,4 @@
-/* displist.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -1207,7 +1205,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
if(cu->path) free_path(cu->path);
cu->path= NULL;
- if(ob->type==OB_FONT) BKE_text_to_curve(scene, ob, 0);
+ if(ob->type==OB_FONT) BKE_text_to_curve(G.main, scene, ob, 0);
if(!forOrco) curve_calc_modifiers_pre(scene, ob, forRender, &originalVerts, &deformedVerts, &numVerts);
@@ -1406,7 +1404,8 @@ void makeDispListCurveTypes_forOrco(struct Scene *scene, struct Object *ob, stru
}
/* add Orco layer to the displist object which has got derived mesh and return orco */
-float *makeOrcoDispList(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender) {
+float *makeOrcoDispList(Scene *scene, Object *ob, DerivedMesh *derivedFinal, int forRender)
+{
float *orco;
if (derivedFinal == NULL)
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 7fb9f96e0cf..5ce7b82a45f 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -1,6 +1,4 @@
-/* effect.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 3916d0ca701..e2326b005c1 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -818,7 +820,7 @@ void calchandles_fcurve (FCurve *fcu)
* -> Vector handles: become 'nothing' when (one half selected AND other not)
* - PHASE 2: recalculate handles
*/
-void testhandles_fcurve (FCurve *fcu)
+void testhandles_fcurve (FCurve *fcu, const short use_handle)
{
BezTriple *bezt;
unsigned int a;
@@ -834,9 +836,16 @@ void testhandles_fcurve (FCurve *fcu)
/* flag is initialised as selection status
* of beztriple control-points (labelled 0,1,2)
*/
- if (bezt->f1 & SELECT) flag |= (1<<0); // == 1
if (bezt->f2 & SELECT) flag |= (1<<1); // == 2
- if (bezt->f3 & SELECT) flag |= (1<<2); // == 4
+ if(use_handle == FALSE) {
+ if(flag & 2) {
+ flag |= (1<<0) | (1<<2);
+ }
+ }
+ else {
+ if (bezt->f1 & SELECT) flag |= (1<<0); // == 1
+ if (bezt->f3 & SELECT) flag |= (1<<2); // == 4
+ }
/* one or two handles selected only */
if (ELEM(flag, 0, 7)==0) {
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 95c0aa60991..d5c54893128 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 6898615c753..4c8d0cf998d 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -1,6 +1,4 @@
-/* font.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -284,7 +282,7 @@ struct TmpFont *vfont_find_tmpfont(VFont *vfont)
return tmpfnt;
}
-static VFontData *vfont_get_data(VFont *vfont)
+static VFontData *vfont_get_data(Main *bmain, VFont *vfont)
{
struct TmpFont *tmpfnt = NULL;
PackedFile *tpf;
@@ -319,11 +317,11 @@ static VFontData *vfont_get_data(VFont *vfont)
BLI_addtail(&ttfdata, tmpfnt);
}
} else {
- pf= newPackedFile(NULL, vfont->name);
+ pf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
if(!tmpfnt)
{
- tpf= newPackedFile(NULL, vfont->name);
+ tpf= newPackedFile(NULL, vfont->name, ID_BLEND_PATH(bmain, &vfont->id));
// Add temporary packed file to globals
tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font");
@@ -351,7 +349,7 @@ static VFontData *vfont_get_data(VFont *vfont)
return vfont->data;
}
-VFont *load_vfont(const char *name)
+VFont *load_vfont(Main *bmain, const char *name)
{
char filename[FILE_MAXFILE];
VFont *vfont= NULL;
@@ -371,8 +369,8 @@ VFont *load_vfont(const char *name)
BLI_strncpy(dir, name, sizeof(dir));
BLI_splitdirstring(dir, filename);
- pf= newPackedFile(NULL, name);
- tpf= newPackedFile(NULL, name);
+ pf= newPackedFile(NULL, name, bmain->name);
+ tpf= newPackedFile(NULL, name, bmain->name);
is_builtin= 0;
}
@@ -382,7 +380,7 @@ VFont *load_vfont(const char *name)
vfd= BLI_vfontdata_from_freetypefont(pf);
if (vfd) {
- vfont = alloc_libblock(&G.main->vfont, ID_VF, filename);
+ vfont = alloc_libblock(&bmain->vfont, ID_VF, filename);
vfont->data = vfd;
/* if there's a font name, use it for the ID name */
@@ -439,7 +437,7 @@ VFont *get_builtin_font(void)
if (strcmp(vf->name, FO_BUILTIN_NAME)==0)
return vf;
- return load_vfont(FO_BUILTIN_NAME);
+ return load_vfont(G.main, FO_BUILTIN_NAME);
}
static VChar *find_vfont_char(VFontData *vfd, intptr_t character)
@@ -500,7 +498,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i
}
-static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx)
+static void buildchar(Main *bmain, Curve *cu, unsigned long character, CharInfo *info, float ofsx, float ofsy, float rot, int charidx)
{
BezTriple *bezt1, *bezt2;
Nurb *nu1 = NULL, *nu2 = NULL;
@@ -509,7 +507,7 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float
VChar *che = NULL;
int i;
- vfd= vfont_get_data(which_vfont(cu, info));
+ vfd= vfont_get_data(bmain, which_vfont(cu, info));
if (!vfd) return;
/*
@@ -662,7 +660,7 @@ static float char_width(Curve *cu, VChar *che, CharInfo *info)
}
}
-struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
+struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int mode)
{
VFont *vfont, *oldvfont;
VFontData *vfd= NULL;
@@ -714,7 +712,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
if (cu->tb==NULL)
cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "TextBox compat");
- vfd= vfont_get_data(vfont);
+ vfd= vfont_get_data(bmain, vfont);
/* The VFont Data can not be found */
if(!vfd) {
@@ -792,7 +790,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
}
if (vfont != oldvfont) {
- vfd= vfont_get_data(vfont);
+ vfd= vfont_get_data(bmain, vfont);
oldvfont = vfont;
}
@@ -1157,7 +1155,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode)
}
// We do not want to see any character for \n or \r
if(cha != '\n' && cha != '\r')
- buildchar(cu, cha, info, ct->xof, ct->yof, ct->rot, i);
+ buildchar(bmain, cu, cha, info, ct->xof, ct->yof, ct->rot, i);
if ((info->flag & CU_CHINFO_UNDERLINE) && (cu->textoncurve == NULL) && (cha != '\n') && (cha != '\r')) {
float ulwidth, uloverlap= 0.0f;
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index c2e94cc97db..06ca7b7b509 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -182,7 +184,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd)
gpl->thickness = 3;
/* auto-name */
- sprintf(gpl->info, "GP_Layer");
+ strcpy(gpl->info, "GP_Layer");
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), sizeof(gpl->info));
/* make this one the active one */
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 9effd25c142..07bb4666134 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -1,32 +1,32 @@
/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2006-2007 Blender Foundation.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): none yet.
-*
-* ***** END GPL LICENSE BLOCK *****
-*
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006-2007 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ */
/** \file blender/blenkernel/intern/icons.c
* \ingroup bke
diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c
index e84a2a04ded..063b5e961e0 100644
--- a/source/blender/blenkernel/intern/idcode.c
+++ b/source/blender/blenkernel/intern/idcode.c
@@ -109,7 +109,8 @@ int BKE_idcode_is_valid(int code)
return idtype_from_code(code)?1:0;
}
-int BKE_idcode_is_linkable(int code) {
+int BKE_idcode_is_linkable(int code)
+{
IDType *idt= idtype_from_code(code);
return idt?(idt->flags&IDTYPE_FLAGS_ISLINKABLE):0;
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index d764826cd47..cf8f96c143a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1,5 +1,4 @@
-/* image.c
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -1480,7 +1479,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
/* try to repack file */
if(ima->packedfile) {
PackedFile *pf;
- pf = newPackedFile(NULL, ima->name);
+ pf = newPackedFile(NULL, ima->name, ID_BLEND_PATH(G.main, &ima->id));
if (pf) {
freePackedFile(ima->packedfile);
ima->packedfile = pf;
@@ -1653,10 +1652,7 @@ static ImBuf *image_load_sequence_file(Image *ima, ImageUser *iuser, int frame)
BLI_stringdec(name, head, tail, &numlen);
BLI_stringenc(name, head, tail, numlen, frame);
- if(ima->id.lib)
- BLI_path_abs(name, ima->id.lib->filepath);
- else
- BLI_path_abs(name, G.main->name);
+ BLI_path_abs(name, ID_BLEND_PATH(G.main, &ima->id));
flag= IB_rect|IB_multilayer;
if(ima->flag & IMA_DO_PREMUL)
@@ -1768,11 +1764,8 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame)
char str[FILE_MAX];
BLI_strncpy(str, ima->name, FILE_MAX);
- if(ima->id.lib)
- BLI_path_abs(str, ima->id.lib->filepath);
- else
- BLI_path_abs(str, G.main->name);
-
+ BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id));
+
/* FIXME: make several stream accessible in image editor, too*/
ima->anim = openanim(str, IB_rect, 0);
@@ -1834,10 +1827,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
/* get the right string */
BLI_strncpy(str, ima->name, sizeof(str));
- if(ima->id.lib)
- BLI_path_abs(str, ima->id.lib->filepath);
- else
- BLI_path_abs(str, G.main->name);
+ BLI_path_abs(str, ID_BLEND_PATH(G.main, &ima->id));
/* read ibuf */
ibuf = IMB_loadiffname(str, flag);
@@ -1860,7 +1850,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
/* make packed file for autopack */
if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK))
- ima->packedfile = newPackedFile(NULL, str);
+ ima->packedfile = newPackedFile(NULL, str, ID_BLEND_PATH(G.main, &ima->id));
}
}
else
diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c
index 5b237665290..f4d1ff4241d 100644
--- a/source/blender/blenkernel/intern/image_gen.c
+++ b/source/blender/blenkernel/intern/image_gen.c
@@ -1,5 +1,4 @@
-/* image_gen.c
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index 099661f7914..cef3eee8c5e 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -913,7 +913,7 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
{
// Solves for unknown X in equation AX=B
unsigned int conjgrad_loopcount=0, conjgrad_looplimit=100;
- float conjgrad_epsilon=0.0001f, conjgrad_lasterror=0;
+ float conjgrad_epsilon=0.0001f /* , conjgrad_lasterror=0 */ /* UNUSED */;
lfVector *q, *d, *tmp, *r;
float s, starget, a, s_prev;
unsigned int numverts = lA[0].vcount;
@@ -964,7 +964,7 @@ static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z
conjgrad_loopcount++;
}
- conjgrad_lasterror = s;
+ /* conjgrad_lasterror = s; */ /* UNUSED */
del_lfvector(q);
del_lfvector(d);
@@ -1777,7 +1777,7 @@ int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float
steps = 55;
for (i=0; i<steps; i++) {
for (node=cloth->springs; node; node=node->next) {
- ClothVertex *cv1, *cv2;
+ /* ClothVertex *cv1, *cv2; */ /* UNUSED */
int v1, v2;
float len, c, l, vec[3];
@@ -1786,8 +1786,8 @@ int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float
continue;
v1 = spring->ij; v2 = spring->kl;
- cv1 = cloth->verts + v1;
- cv2 = cloth->verts + v2;
+ /* cv1 = cloth->verts + v1; */ /* UNUSED */
+ /* cv2 = cloth->verts + v2; */ /* UNUSED */
len = len_v3v3(cos[v1], cos[v2]);
sub_v3_v3v3(vec, cos[v1], cos[v2]);
@@ -1827,7 +1827,7 @@ int cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData * clmd, float
return 1;
}
int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase *effectors)
-{
+{
unsigned int i=0;
float step=0.0f, tf=clmd->sim_parms->timescale;
Cloth *cloth = clmd->clothObject;
@@ -1981,7 +1981,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
}
void implicit_set_positions (ClothModifierData *clmd)
-{
+{
Cloth *cloth = clmd->clothObject;
ClothVertex *verts = cloth->verts;
unsigned int numverts = cloth->numverts, i;
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 5acd6c169a0..91f3c7a22ba 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1,4 +1,6 @@
-/*
+/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -317,7 +319,7 @@ static const char *constraint_adrcodes_to_paths (int adrcode, int *array_index)
/* ShapeKey types
* NOTE: as we don't have access to the keyblock where the data comes from (for now),
- * we'll just use numerical indices for now...
+ * we'll just use numerical indices for now...
*/
static char *shapekey_adrcodes_to_paths (int adrcode, int *UNUSED(array_index))
{
@@ -1103,7 +1105,7 @@ static void fcurve_add_to_list (ListBase *groups, ListBase *list, FCurve *fcu, c
agrp->flag = AGRP_SELECTED;
if (muteipo) agrp->flag |= AGRP_MUTED;
- strncpy(agrp->name, grpname, sizeof(agrp->name));
+ BLI_strncpy(agrp->name, grpname, sizeof(agrp->name));
BLI_addtail(&tmp_act.groups, agrp);
BLI_uniquename(&tmp_act.groups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name));
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 2aef5b39c71..9e48e691b87 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -1,7 +1,4 @@
-
-/* key.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -807,7 +804,7 @@ static void do_key(const int start, int end, const int tot, char *poin, Key *key
int a, ofs[32], *ofsp;
int flagdo= 15, flagflo=0, elemsize, poinsize=0;
char *k1, *k2, *k3, *k4, *freek1, *freek2, *freek3, *freek4;
- char *cp, elemstr[8];;
+ char *cp, elemstr[8];
/* currently always 0, in future key_pointer_size may assign */
ofs[1]= 0;
@@ -1445,10 +1442,10 @@ KeyBlock *add_keyblock(Key *key, const char *name)
tot= BLI_countlist(&key->block);
if(name) {
- strncpy(kb->name, name, sizeof(kb->name));
+ BLI_strncpy(kb->name, name, sizeof(kb->name));
} else {
- if(tot==1) strcpy(kb->name, "Basis");
- else sprintf(kb->name, "Key %d", tot-1);
+ if(tot==1) BLI_strncpy(kb->name, "Basis", sizeof(kb->name));
+ else BLI_snprintf(kb->name, sizeof(kb->name), "Key %d", tot-1);
}
BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name));
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 094214858f9..cbff9c2337e 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -1,7 +1,4 @@
/*
- * lattice.c
- *
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 677a2922666..1dc53811fc0 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -941,9 +941,9 @@ static void get_flags_for_id(ID *id, char *buf)
isnode= ((Tex *)id)->use_nodes;
if (id->us<0)
- sprintf(buf, "-1W ");
+ strcpy(buf, "-1W ");
else if (!id->lib && !isfake && id->us && !isnode)
- sprintf(buf, " ");
+ strcpy(buf, " ");
else if(isnode)
sprintf(buf, "%c%cN%c ", id->lib?'L':' ', isfake?'F':' ', (id->us==0)?'O':' ');
else
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index f5df6efd622..ed9be989dbd 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1,7 +1,4 @@
-
-/* material.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -193,7 +190,7 @@ void init_material(Material *ma)
ma->vol.ms_diff = 1.f;
ma->vol.ms_intensity = 1.f;
- ma->game.flag=0;
+ ma->game.flag = GEMAT_BACKCULL;
ma->game.alpha_blend=0;
ma->game.face_orientation=0;
@@ -723,6 +720,48 @@ void test_object_materials(ID *id)
}
}
+void assign_material_id(ID *id, Material *ma, short act)
+{
+ Material *mao, **matar, ***matarar;
+ short *totcolp;
+
+ if(act>MAXMAT) return;
+ if(act<1) act= 1;
+
+ /* prevent crashing when using accidentally */
+ BLI_assert(id->lib == NULL);
+ if(id->lib) return;
+
+ /* test arraylens */
+
+ totcolp= give_totcolp_id(id);
+ matarar= give_matarar_id(id);
+
+ if(totcolp==NULL || matarar==NULL) return;
+
+ if(act > *totcolp) {
+ matar= MEM_callocN(sizeof(void *)*act, "matarray1");
+
+ if(*totcolp) {
+ memcpy(matar, *matarar, sizeof(void *)*(*totcolp));
+ MEM_freeN(*matarar);
+ }
+
+ *matarar= matar;
+ *totcolp= act;
+ }
+
+ /* in data */
+ mao= (*matarar)[act-1];
+ if(mao) mao->id.us--;
+ (*matarar)[act-1]= ma;
+
+ if(ma)
+ id_us_plus((ID *)ma);
+
+ test_object_materials(id);
+}
+
void assign_material(Object *ob, Material *ma, short act)
{
Material *mao, **matar, ***matarar;
@@ -1283,7 +1322,7 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, const float c
*g=1.0f;
else
*g = tmp;
-
+
tmp = facm + fac*col[2];
if(tmp <= 0.0f)
*b = 0.0f;
@@ -1772,7 +1811,7 @@ int do_version_tface(Main *main, int fileload)
int flag;
int index;
- /* sometimes mesh has no materials but will need a new one. In those
+ /* sometimes mesh has no materials but will need a new one. In those
* cases we need to ignore the mf->mat_nr and only look at the face
* mode because it can be zero as uninitialized or the 1st created material
*/
@@ -1953,6 +1992,11 @@ int do_version_tface(Main *main, int fileload)
}
}
}
+ /* material is not used by faces with texface
+ * set the default flag - do it only once */
+ else
+ if (fileload)
+ ma->game.flag = GEMAT_BACKCULL;
}
return nowarning;
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 555d35726bc..05d07ddf918 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -1,11 +1,4 @@
-/* mball.c
- *
- * MetaBalls are created from a single Object (with a name without number in it),
- * here the DispList and BoundBox also is located.
- * All objects with the same name (but with a number in it) are added to this.
- *
- * texture coordinates are patched within the displist
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -30,13 +23,18 @@
* Contributor(s): Jiri Hnidek <jiri.hnidek@vslib.cz>.
*
* ***** END GPL LICENSE BLOCK *****
+ *
+ * MetaBalls are created from a single Object (with a name without number in it),
+ * here the DispList and BoundBox also is located.
+ * All objects with the same name (but with a number in it) are added to this.
+ *
+ * texture coordinates are patched within the displist
*/
/** \file blender/blenkernel/intern/mball.c
* \ingroup bke
*/
-
#include <stdio.h>
#include <string.h>
#include <math.h>
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 4fb6ca00b50..f263699c44d 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1,8 +1,4 @@
-
-/* mesh.c
- *
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -1605,3 +1601,19 @@ void mesh_translate(Mesh *me, float offset[3], int do_keys)
}
}
}
+
+
+void BKE_mesh_ensure_navmesh(Mesh *me)
+{
+ if (!CustomData_has_layer(&me->fdata, CD_RECAST)) {
+ int i;
+ int numFaces = me->totface;
+ int* recastData;
+ CustomData_add_layer_named(&me->fdata, CD_RECAST, CD_CALLOC, NULL, numFaces, "recastData");
+ recastData = (int*)CustomData_get_layer(&me->fdata, CD_RECAST);
+ for (i=0; i<numFaces; i++) {
+ recastData[i] = i+1;
+ }
+ CustomData_add_layer_named(&me->fdata, CD_RECAST, CD_REFERENCE, recastData, numFaces, "recastData");
+ }
+}
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index fe26c0ccd2d..9de75a49998 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -1,38 +1,38 @@
/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2005 by the Blender Foundation.
-* All rights reserved.
-*
-* Contributor(s): Daniel Dunbar
-* Ton Roosendaal,
-* Ben Batt,
-* Brecht Van Lommel,
-* Campbell Barton
-*
-* ***** END GPL LICENSE BLOCK *****
-*
-* Modifier stack implementation.
-*
-* BKE_modifier.h contains the function prototypes for this file.
-*
-*/
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2005 by the Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Daniel Dunbar
+ * Ton Roosendaal,
+ * Ben Batt,
+ * Brecht Van Lommel,
+ * Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ * Modifier stack implementation.
+ *
+ * BKE_modifier.h contains the function prototypes for this file.
+ *
+ */
/** \file blender/blenkernel/intern/modifier.c
* \ingroup bke
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index e621e800520..749930d4278 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -1029,7 +1029,7 @@ static void old_mdisps_convert(MFace *mface, MDisps *mdisp)
int nvert = (mface->v4)? 4: 3;
int newtotdisp = multires_grid_tot[newlvl]*nvert;
int x, y, S;
- float (*disps)[3], (*out)[3], u, v;
+ float (*disps)[3], (*out)[3], u = 0.0f, v = 0.0f; /* Quite gcc barking. */
disps = MEM_callocN(sizeof(float) * 3 * newtotdisp, "multires disps");
@@ -1408,7 +1408,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
}
/* Interior face verts */
- lvl = lvl1->next->next;
+ /* lvl = lvl1->next->next; */ /* UNUSED */
dst = 0;
for(j = 0; j < lvl1->totface; ++j) {
int sides = lvl1->faces[j].v[3] ? 4 : 3;
diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c
index 8a2ec1e5169..f670486484b 100644
--- a/source/blender/blenkernel/intern/navmesh_conversion.c
+++ b/source/blender/blenkernel/intern/navmesh_conversion.c
@@ -1,31 +1,35 @@
-/**
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): none yet.
-*
-* ***** END GPL LICENSE BLOCK *****
-*/
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenkernel/intern/navmesh_conversion.c
+ * \ingroup bke
+ */
#include <math.h>
#include <stdlib.h>
@@ -328,14 +332,10 @@ struct SortContext
const int* trisToFacesMap;
};
-/* XXX: not thread-safe, but it's called only from modifiers stack
- which isn't threaded. Anyway, better to avoid this in the future */
-static struct SortContext *_qsort_context;
-
-static int compareByData(const void * a, const void * b)
+static int compareByData(void *ctx, const void * a, const void * b)
{
- return ( _qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)a]] -
- _qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)b]] );
+ return (((struct SortContext *)ctx)->recastData[((struct SortContext *)ctx)->trisToFacesMap[*(int*)a]] -
+ ((struct SortContext *)ctx)->recastData[((struct SortContext *)ctx)->trisToFacesMap[*(int*)b]] );
}
int buildNavMeshData(const int nverts, const float* verts,
@@ -367,8 +367,7 @@ int buildNavMeshData(const int nverts, const float* verts,
trisMapping[i]=i;
context.recastData = recastData;
context.trisToFacesMap = trisToFacesMap;
- _qsort_context = &context;
- qsort(trisMapping, ntris, sizeof(int), compareByData);
+ recast_qsort(trisMapping, ntris, sizeof(int), &context, compareByData);
//search first valid triangle - triangle of convex polygon
validTriStart = -1;
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 6ce80342dd6..97347d85deb 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1,4 +1,6 @@
/*
+ * $Id$
+ *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -1284,16 +1286,16 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip)
if (strip->name[0]==0) {
switch (strip->type) {
case NLASTRIP_TYPE_CLIP: /* act-clip */
- sprintf(strip->name, "%s", (strip->act)?(strip->act->id.name+2):("<No Action>"));
+ BLI_strncpy(strip->name, (strip->act)?(strip->act->id.name+2):("<No Action>"), sizeof(strip->name));
break;
case NLASTRIP_TYPE_TRANSITION: /* transition */
- sprintf(strip->name, "Transition");
+ BLI_strncpy(strip->name, "Transition", sizeof(strip->name));
break;
case NLASTRIP_TYPE_META: /* meta */
- sprintf(strip->name, "Meta");
+ BLI_strncpy(strip->name, "Meta", sizeof(strip->name));
break;
default:
- sprintf(strip->name, "NLA Strip");
+ BLI_strncpy(strip->name, "NLA Strip", sizeof(strip->name));
break;
}
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 3c4c3d32452..d7744852c25 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1686,7 +1686,7 @@ void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwid
void node_type_storage(bNodeType *ntype, const char *storagename, void (*freestoragefunc)(struct bNode *), void (*copystoragefunc)(struct bNode *, struct bNode *))
{
if (storagename)
- strncpy(ntype->storagename, storagename, sizeof(ntype->storagename));
+ BLI_strncpy(ntype->storagename, storagename, sizeof(ntype->storagename));
else
ntype->storagename[0] = '\0';
ntype->copystoragefunc = copystoragefunc;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index a96e52bbd0a..b0c0b8ed1fe 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1,6 +1,4 @@
-/* object.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -1662,7 +1660,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
if(ob->matbits) MEM_freeN(ob->matbits);
ob->mat = NULL;
ob->matbits= NULL;
- if ((target->totcol) && (target->mat) && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) { //XXX OB_SUPPORT_MATERIAL
+ if ((target->totcol) && (target->mat) && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
int i;
ob->colbits = target->colbits;
@@ -2842,7 +2840,8 @@ void object_sculpt_modifiers_changed(Object *ob)
}
}
-float give_timeoffset(Object *ob) {
+float give_timeoffset(Object *ob)
+{
if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) {
return ob->sf + give_timeoffset(ob->parent);
} else {
@@ -2850,7 +2849,8 @@ float give_timeoffset(Object *ob) {
}
}
-int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot) {
+int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot)
+{
if (ob->data==NULL)
return 0;
@@ -3068,6 +3068,79 @@ void object_camera_matrix(
}
+void camera_view_frame_ex(Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3],
+ float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3])
+{
+ float facx, facy;
+ float depth;
+
+ /* aspect correcton */
+ if (scene) {
+ float aspx= (float) scene->r.xsch*scene->r.xasp;
+ float aspy= (float) scene->r.ysch*scene->r.yasp;
+
+ 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 {
+ r_asp[0]= 1.0f;
+ r_asp[1]= 1.0f;
+ }
+
+ if(camera->type==CAM_ORTHO) {
+ facx= 0.5f * camera->ortho_scale * r_asp[0] * scale[0];
+ facy= 0.5f * camera->ortho_scale * r_asp[1] * scale[1];
+ r_shift[0]= camera->shiftx * camera->ortho_scale * scale[0];
+ r_shift[1]= camera->shifty * camera->ortho_scale * scale[1];
+ depth= do_clip ? -((camera->clipsta * scale[2]) + 0.1f) : - drawsize * camera->ortho_scale * scale[2];
+
+ *r_drawsize= 0.5f * camera->ortho_scale;
+ }
+ else {
+ /* that way it's always visible - clipsta+0.1 */
+ float fac;
+ *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]);
+ }
+ else {
+ /* fixed size, variable depth (stays a reasonable size in the 3D view) */
+ depth= *r_drawsize * camera->lens/-16.0f * scale[2];
+ fac= *r_drawsize;
+ }
+
+ facx= fac * r_asp[0] * scale[0];
+ facy= fac * r_asp[1] * scale[1];
+ r_shift[0]= camera->shiftx*fac*2 * scale[0];
+ r_shift[1]= camera->shifty*fac*2 * scale[1];
+ }
+
+ r_vec[0][0]= r_shift[0] + facx; r_vec[0][1]= r_shift[1] + facy; r_vec[0][2]= depth;
+ r_vec[1][0]= r_shift[0] + facx; r_vec[1][1]= r_shift[1] - facy; r_vec[1][2]= depth;
+ r_vec[2][0]= r_shift[0] - facx; r_vec[2][1]= r_shift[1] - facy; r_vec[2][2]= depth;
+ r_vec[3][0]= r_shift[0] - facx; r_vec[3][1]= r_shift[1] + facy; r_vec[3][2]= depth;
+}
+
+void camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3])
+{
+ float dummy_asp[2];
+ float dummy_shift[2];
+ float dummy_drawsize;
+ const float dummy_scale[3]= {1.0f, 1.0f, 1.0f};
+
+ camera_view_frame_ex(scene, camera, FALSE, 1.0, dummy_scale,
+ dummy_asp, dummy_shift, &dummy_drawsize, r_vec);
+}
+
#if 0
static int pc_findindex(ListBase *listbase, int index)
{
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index ed729d819b7..2c8975e9cb4 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -1,6 +1,4 @@
/*
- * blenkernel/packedFile.c - (cleaned up mar-01 nzc)
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -168,7 +166,7 @@ PackedFile *newPackedFileMemory(void *mem, int memlen)
return pf;
}
-PackedFile *newPackedFile(ReportList *reports, const char *filename)
+PackedFile *newPackedFile(ReportList *reports, const char *filename, const char *basepath)
{
PackedFile *pf = NULL;
int file, filelen;
@@ -185,7 +183,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename)
// convert relative filenames to absolute filenames
strcpy(name, filename);
- BLI_path_abs(name, G.main->name);
+ BLI_path_abs(name, basepath);
// open the file
// and create a PackedFile structure
@@ -224,7 +222,7 @@ void packAll(Main *bmain, ReportList *reports)
for(ima=bmain->image.first; ima; ima=ima->id.next) {
if(ima->packedfile == NULL && ima->id.lib==NULL) {
if(ima->source==IMA_SRC_FILE) {
- ima->packedfile = newPackedFile(reports, ima->name);
+ ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
}
else if(ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported.", ima->id.name+2);
@@ -234,11 +232,11 @@ void packAll(Main *bmain, ReportList *reports)
for(vf=bmain->vfont.first; vf; vf=vf->id.next)
if(vf->packedfile == NULL && vf->id.lib==NULL && strcmp(vf->name, FO_BUILTIN_NAME) != 0)
- vf->packedfile = newPackedFile(reports, vf->name);
+ vf->packedfile = newPackedFile(reports, vf->name, bmain->name);
for(sound=bmain->sound.first; sound; sound=sound->id.next)
if(sound->packedfile == NULL && sound->id.lib==NULL)
- sound->packedfile = newPackedFile(reports, sound->name);
+ sound->packedfile = newPackedFile(reports, sound->name, bmain->name);
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 82a2436a010..806a7871948 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1,6 +1,4 @@
-/* particle.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -3488,6 +3486,7 @@ static void default_particle_settings(ParticleSettings *part)
part->totpart= 1000;
part->grid_res= 10;
part->timetweak= 1.0;
+ part->courant_target = 0.2;
part->integrator= PART_INT_MIDPOINT;
part->phystype= PART_PHYS_NEWTON;
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index e1ea6e419d3..6b601ed4b1a 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -1,6 +1,4 @@
-/* particle_system.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -26,6 +24,9 @@
*
* Contributor(s): Raul Fernandez Hernandez (Farsthary), Stephen Swhitehorn.
*
+ * Adaptive time step
+ * Copyright 2011 AutoCRC
+ *
* ***** END GPL LICENSE BLOCK *****
*/
@@ -2321,6 +2322,10 @@ typedef struct SPHRangeData
float massfac;
int use_size;
+
+ /* Same as SPHData::element_size */
+ float element_size;
+ float flow[3];
} SPHRangeData;
typedef struct SPHData {
ParticleSystem *psys[10];
@@ -2328,12 +2333,17 @@ typedef struct SPHData {
float mass;
EdgeHash *eh;
float *gravity;
+ /* Average distance to neighbours (other particles in the support domain),
+ for calculating the Courant number (adaptive time step). */
+ float element_size;
+ float flow[3];
}SPHData;
static void sph_density_accum_cb(void *userdata, int index, float squared_dist)
{
SPHRangeData *pfr = (SPHRangeData *)userdata;
ParticleData *npa = pfr->npsys->particles + index;
float q;
+ float dist;
if(npa == pfr->pa || squared_dist < FLT_EPSILON)
return;
@@ -2344,12 +2354,16 @@ static void sph_density_accum_cb(void *userdata, int index, float squared_dist)
*/
if(pfr->tot_neighbors >= 128)
return;
-
+
pfr->neighbors[pfr->tot_neighbors].index = index;
pfr->neighbors[pfr->tot_neighbors].psys = pfr->npsys;
pfr->tot_neighbors++;
- q = (1.f - sqrtf(squared_dist)/pfr->h) * pfr->massfac;
+ dist = sqrtf(squared_dist);
+ q = (1.f - dist/pfr->h) * pfr->massfac;
+
+ add_v3_v3(pfr->flow, npa->state.vel);
+ pfr->element_size += dist;
if(pfr->use_size)
q *= npa->size;
@@ -2397,6 +2411,8 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
pfr.density = pfr.near_density = 0.f;
pfr.h = h;
pfr.pa = pa;
+ pfr.element_size = fluid->radius;
+ pfr.flow[0] = pfr.flow[1] = pfr.flow[2] = 0.0f;
for(i=0; i<10 && psys[i]; i++) {
pfr.npsys = psys[i];
@@ -2405,6 +2421,14 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
BLI_bvhtree_range_query(psys[i]->bvhtree, state->co, h, sph_density_accum_cb, &pfr);
}
+ if (pfr.tot_neighbors > 0) {
+ pfr.element_size /= pfr.tot_neighbors;
+ mul_v3_fl(pfr.flow, 1.0f / pfr.tot_neighbors);
+ } else {
+ pfr.element_size = MAXFLOAT;
+ }
+ sphdata->element_size = pfr.element_size;
+ VECCOPY(sphdata->flow, pfr.flow);
pressure = stiffness * (pfr.density - rest_density);
near_pressure = stiffness_near_fac * pfr.near_density;
@@ -2471,7 +2495,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
madd_v3_v3fl(force, gravity, fluid->buoyancy * (pfr.density-rest_density));
}
-static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float dfra, float *gravity, EdgeHash *springhash){
+static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float dfra, float *gravity, EdgeHash *springhash, float *element_size, float flow[3]) {
ParticleTarget *pt;
int i;
@@ -2491,6 +2515,7 @@ static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float d
sphdata.gravity = gravity;
sphdata.mass = pa_mass;
sphdata.eh = springhash;
+ //sphdata.element_size and sphdata.flow are set in the callback.
/* restore previous state and treat gravity & effectors as external acceleration*/
sub_v3_v3v3(effector_acceleration, pa->state.vel, pa->prev_state.vel);
@@ -2499,6 +2524,8 @@ static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float d
copy_particle_key(&pa->state, &pa->prev_state, 0);
integrate_particle(part, pa, dtime, effector_acceleration, sph_force_cb, &sphdata);
+ *element_size = sphdata.element_size;
+ VECCOPY(flow, sphdata.flow);
}
/************************************************/
@@ -3582,6 +3609,49 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra)){
root->co[0] = root->co[1] = root->co[2] = 0.0f;
}
}
+
+/* Code for an adaptive time step based on the Courant-Friedrichs-Lewy
+ condition. */
+#define MIN_TIMESTEP 1.0f / 101.0f
+/* Tolerance of 1.5 means the last subframe neither favours growing nor
+ shrinking (e.g if it were 1.3, the last subframe would tend to be too
+ small). */
+#define TIMESTEP_EXPANSION_TOLERANCE 1.5f
+
+/* Calculate the speed of the particle relative to the local scale of the
+ simulation. This should be called once per particle during a simulation
+ step, after the velocity has been updated. element_size defines the scale of
+ the simulation, and is typically the distance to neighbourning particles. */
+void update_courant_num(ParticleSimulationData *sim, ParticleData *pa,
+ float dtime, float element_size, float flow[3])
+{
+ float relative_vel[3];
+ float speed;
+
+ sub_v3_v3v3(relative_vel, pa->state.vel, flow);
+ speed = len_v3(relative_vel);
+ if (sim->courant_num < speed * dtime / element_size)
+ sim->courant_num = speed * dtime / element_size;
+}
+/* Update time step size to suit current conditions. */
+float update_timestep(ParticleSystem *psys, ParticleSimulationData *sim,
+ float t_frac)
+{
+ if (sim->courant_num == 0.0f)
+ psys->dt_frac = 1.0f;
+ else
+ psys->dt_frac *= (psys->part->courant_target / sim->courant_num);
+ CLAMP(psys->dt_frac, MIN_TIMESTEP, 1.0f);
+
+ /* Sync with frame end if it's close. */
+ if (t_frac == 1.0f)
+ return psys->dt_frac;
+ else if (t_frac + (psys->dt_frac * TIMESTEP_EXPANSION_TOLERANCE) >= 1.0f)
+ return 1.0f - t_frac;
+ else
+ return psys->dt_frac;
+}
+
/************************************************/
/* System Core */
/************************************************/
@@ -3597,7 +3667,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
/* frame & time changes */
float dfra, dtime;
float birthtime, dietime;
-
+
/* where have we gone in time since last time */
dfra= cfra - psys->cfra;
@@ -3735,6 +3805,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
{
EdgeHash *springhash = sph_springhash_build(psys);
float *gravity = NULL;
+ float element_size, flow[3];
if(psys_uses_gravity(sim))
gravity = sim->scene->physics_settings.gravity;
@@ -3744,13 +3815,17 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
basic_integrate(sim, p, pa->state.time, cfra);
/* actual fluids calculations */
- sph_integrate(sim, pa, pa->state.time, gravity, springhash);
+ sph_integrate(sim, pa, pa->state.time, gravity, springhash,
+ &element_size, flow);
if(sim->colliders)
collision_check(sim, p, pa->state.time, cfra);
/* SPH particles are not physical particles, just interpolation particles, thus rotation has not a direct sense for them */
basic_rotate(part, pa, pa->state.time, timestep);
+
+ if (part->time_flag & PART_TIME_AUTOSF)
+ update_courant_num(sim, pa, dtime, element_size, flow);
}
sph_springs_modify(psys, timestep);
@@ -3952,6 +4027,7 @@ static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNU
return totpart - oldtotpart;
}
+
/* Calculates the next state for all particles of the system
* In particles code most fra-ending are frames, time-ending are fra*timestep (seconds)
* 1. Emit particles
@@ -4057,23 +4133,39 @@ static void system_step(ParticleSimulationData *sim, float cfra)
}
if(psys->totpart) {
- int dframe, subframe = 0, totframesback = 0, totsubframe = part->subframes+1;
- float fraction;
-
+ int dframe, totframesback = 0;
+ float t_frac, dt_frac;
+
/* handle negative frame start at the first frame by doing
* all the steps before the first frame */
if((int)cfra == startframe && part->sta < startframe)
totframesback = (startframe - (int)part->sta);
-
+
+ if (!(part->time_flag & PART_TIME_AUTOSF)) {
+ /* Constant time step */
+ psys->dt_frac = 1.0f / (float) (part->subframes + 1);
+ } else if ((int)cfra == startframe) {
+ /* Variable time step; use a very conservative value at the start.
+ * If it doesn't need to be so small, it will quickly grow. */
+ psys->dt_frac = 1.0;
+ } else if (psys->dt_frac < MIN_TIMESTEP) {
+ psys->dt_frac = MIN_TIMESTEP;
+ }
+
for(dframe=-totframesback; dframe<=0; dframe++) {
- /* ok now we're all set so let's go */
- for (subframe = 1; subframe <= totsubframe; subframe++) {
- fraction = (float)subframe/(float)totsubframe;
- dynamics_step(sim, cfra+dframe+fraction - 1.f);
- psys->cfra = cfra+dframe+fraction - 1.f;
+ /* simulate each subframe */
+ dt_frac = psys->dt_frac;
+ for (t_frac = dt_frac; t_frac <= 1.0f; t_frac += dt_frac) {
+ sim->courant_num = 0.0f;
+ dynamics_step(sim, cfra+dframe+t_frac - 1.f);
+ psys->cfra = cfra+dframe+t_frac - 1.f;
+#if 0
+ printf("%f,%f,%f,%f\n", cfra+dframe+t_frac - 1.f, t_frac, dt_frac, sim->courant_num);
+#endif
+ if (part->time_flag & PART_TIME_AUTOSF)
+ dt_frac = update_timestep(psys, sim, t_frac);
}
}
-
}
/* 4. only write cache starting from second frame */
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index a56010a5ccf..fb69db17b97 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2544,7 +2544,8 @@ static void ptcache_dt_to_str(char *str, double dtime)
sprintf(str, "%is", ((int)dtime) % 60);
}
-static void *ptcache_bake_thread(void *ptr) {
+static void *ptcache_bake_thread(void *ptr)
+{
int usetimer = 0, sfra, efra;
double stime, ptime, ctime, fetd;
char run[32], cur[32], etd[32];
diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c
index d0e4832889b..cdf2e39a4dd 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -1,7 +1,4 @@
-
-/* property.c june 2000
- *
- * ton roosendaal
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -25,7 +22,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): ton roosendaal
*
* ***** END GPL LICENSE BLOCK *****
*/
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c
index d529a6d94c9..a75a075dfc1 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -641,6 +641,8 @@ void sca_remove_ob_poin(Object *obt, Object *ob)
bMessageActuator *ma;
bParentActuator *para;
bArmatureActuator *aa;
+ bSteeringActuator *sta;
+
sens= obt->sensors.first;
while(sens) {
@@ -688,6 +690,10 @@ void sca_remove_ob_poin(Object *obt, Object *ob)
if (aa->target == ob) aa->target = NULL;
if (aa->subtarget == ob) aa->subtarget = NULL;
break;
+ case ACT_STEERING:
+ sta = act->data;
+ if (sta->navmesh == ob) sta->navmesh = NULL;
+ if (sta->target == ob) sta->target = NULL;
}
act= act->next;
}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 742f2708a3f..7dc5a222814 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1,6 +1,4 @@
-/* scene.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -56,6 +54,7 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLI_callbacks.h"
#include "BKE_anim.h"
#include "BKE_animsys.h"
@@ -428,7 +427,7 @@ Scene *add_scene(const char *name)
sce->toolsettings->skgen_resolution = 100;
sce->toolsettings->skgen_threshold_internal = 0.01f;
sce->toolsettings->skgen_threshold_external = 0.01f;
- sce->toolsettings->skgen_angle_limit = 45.0f;
+ sce->toolsettings->skgen_angle_limit = 45.0f;
sce->toolsettings->skgen_length_ratio = 1.3f;
sce->toolsettings->skgen_length_limit = 1.5f;
sce->toolsettings->skgen_correlation_limit = 0.98f;
@@ -525,7 +524,7 @@ Scene *add_scene(const char *name)
sce->gm.recastData.agentradius = 0.6f;
sce->gm.recastData.edgemaxlen = 12.0f;
sce->gm.recastData.edgemaxerror = 1.3f;
- sce->gm.recastData.regionminsize = 50.f;
+ sce->gm.recastData.regionminsize = 8.f;
sce->gm.recastData.regionmergesize = 20.f;
sce->gm.recastData.vertsperpoly = 6;
sce->gm.recastData.detailsampledist = 6.0f;
@@ -1029,6 +1028,9 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
float ctime = BKE_curframe(sce);
Scene *sce_iter;
+ /* keep this first */
+ BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_PRE);
+
sound_set_cfra(sce->r.cfra);
/* clear animation overrides */
@@ -1055,6 +1057,9 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
/* object_handle_update() on all objects, groups and sets */
scene_update_tagged_recursive(bmain, sce, sce);
+
+ /* keep this last */
+ BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_POST);
}
/* return default layer, also used to patch old files */
diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c
index 77153fc37ba..77a79a6c8a4 100644
--- a/source/blender/blenkernel/intern/script.c
+++ b/source/blender/blenkernel/intern/script.c
@@ -1,10 +1,6 @@
-/* blenkernel/script.c
- *
- *
+/*
* $Id$
*
- * Function(s) related to struct script management.
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c
index 00f88fb6202..88e9d9209d4 100644
--- a/source/blender/blenkernel/intern/seqcache.c
+++ b/source/blender/blenkernel/intern/seqcache.c
@@ -1,5 +1,5 @@
/*
-* $Id$
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index e5d74177c91..d8d6ed6ea6d 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -41,6 +41,7 @@
#include "BLI_math.h" /* windows needs for M_PI */
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
@@ -177,7 +178,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname)
MEM_freeN(info);
cp= BLI_dynlib_find_symbol(pis->handle, "seqname");
- if(cp) strncpy(cp, seqname, 21);
+ if(cp) BLI_strncpy(cp, seqname, 21);
} else {
printf ("Plugin returned unrecognized version number\n");
return;
@@ -203,7 +204,7 @@ static PluginSeq *add_plugin_seq(const char *str, const char *seqname)
pis= MEM_callocN(sizeof(PluginSeq), "PluginSeq");
- strncpy(pis->name, str, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_strncpy(pis->name, str, FILE_MAX);
open_plugin_seq(pis, seqname);
if(pis->doit==NULL) {
@@ -1638,8 +1639,6 @@ float hyp3,hyp4,b4,b5
if(wipezone->flip) x = xo - x;
angle = wipezone->angle;
- posy = facf0 * yo;
-
if(wipe->forward){
posx = facf0 * xo;
posy = facf0 * yo;
@@ -2319,7 +2318,7 @@ static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height,
/* Swap buffers */
- swap=temp;temp=map;map=swap;
+ swap=temp;temp=map; /* map=swap; */ /* UNUSED */
/* Tidy up */
MEM_freeN (filter);
@@ -2489,7 +2488,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
/* Swap buffers */
- swap=temp;temp=map;map=swap;
+ swap=temp;temp=map; /* map=swap; */ /* UNUSED */
/* Tidy up */
MEM_freeN (filter);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index a3237da6234..5a2c53f5b9b 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1,5 +1,5 @@
/*
-* $Id$
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -2852,7 +2852,8 @@ void update_changed_seq_and_deps(Scene *scene, Sequence *changed_seq, int len_ch
left and right are the bounds at which the sequence is rendered,
start and end are from the start and fixed length of the sequence.
*/
-int seq_tx_get_start(Sequence *seq) {
+int seq_tx_get_start(Sequence *seq)
+{
return seq->start;
}
int seq_tx_get_end(Sequence *seq)
@@ -3653,7 +3654,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
calc_sequence_disp(scene, seq);
/* last active name */
- strncpy(ed->act_sounddir, strip->dir, FILE_MAXDIR-1);
+ BLI_strncpy(ed->act_sounddir, strip->dir, FILE_MAXDIR);
seq_load_apply(scene, seq, seq_load);
diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c
index 432dc9ec609..a5afc0afda1 100644
--- a/source/blender/blenkernel/intern/sketch.c
+++ b/source/blender/blenkernel/intern/sketch.c
@@ -1,5 +1,4 @@
/*
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 6ab1574ca80..85140841f15 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1,6 +1,4 @@
/*
- * smoke.c
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 2960d8a41e5..88f72c33802 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -1,5 +1,4 @@
-/* softbody.c
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -1744,12 +1743,12 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
GHash *hash;
GHashIterator *ihash;
float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3],d_nvect[3], dv1[3],ve[3],avel[3]={0.0,0.0,0.0},
- vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
- outerforceaccu[3],innerforceaccu[3],
- facedist,n_mag,force_mag_norm,minx,miny,minz,maxx,maxy,maxz,
- innerfacethickness = -0.5f, outerfacethickness = 0.2f,
- ee = 5.0f, ff = 0.1f, fa=1;
- int a, deflected=0, cavel=0,ci=0;
+ vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
+ outerforceaccu[3], innerforceaccu[3],
+ facedist, /* n_mag, */ /* UNUSED */ force_mag_norm, minx, miny, minz, maxx, maxy, maxz,
+ innerfacethickness = -0.5f, outerfacethickness = 0.2f,
+ ee = 5.0f, ff = 0.1f, fa=1;
+ int a, deflected=0, cavel=0, ci=0;
/* init */
*intrusion = 0.0f;
hash = vertexowner->soft->scratch->colliderhash;
@@ -1869,7 +1868,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
cross_v3_v3v3(d_nvect, edge2, edge1);
- n_mag = normalize_v3(d_nvect);
+ /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
facedist = dot_v3v3(dv1,d_nvect);
// so rules are
//
@@ -1906,7 +1905,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
cross_v3_v3v3(d_nvect, edge2, edge1);
- n_mag = normalize_v3(d_nvect);
+ /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
facedist = dot_v3v3(dv1,d_nvect);
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 73d0d70778f..f2d92154c66 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -340,20 +340,13 @@ void sound_load(struct Main *bmain, struct bSound* sound)
#endif
{
char fullpath[FILE_MAX];
- char *path;
/* load sound */
PackedFile* pf = sound->packedfile;
/* dont modify soundact->sound->name, only change a copy */
BLI_strncpy(fullpath, sound->name, sizeof(fullpath));
-
- if(sound->id.lib)
- path = sound->id.lib->filepath;
- else
- path = bmain->name;
-
- BLI_path_abs(fullpath, path);
+ BLI_path_abs(fullpath, ID_BLEND_PATH(bmain, &sound->id));
/* but we need a packed file then */
if (pf)
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index 200dbd41899..ae29230423f 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -1,6 +1,4 @@
-/* speaker.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 9e290d0be6d..fd9e6b6f801 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1732,7 +1732,7 @@ static void ccgDM_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), uns
}
static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
+ int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
void *userData)
{
@@ -1768,7 +1768,7 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
}
if(drawParams)
- flag = drawParams(tf, mcol, mat_nr);
+ flag = drawParams(tf, (mcol != NULL), mat_nr);
else if (index != ORIGINDEX_NONE)
flag= (drawParamsMapped)? drawParamsMapped(userData, index): 1;
else
@@ -1871,7 +1871,7 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
}
}
-static void ccgDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, MCol *mcol, int matnr))
+static void ccgDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr))
{
ccgDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL);
}
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 2c507370288..b5fc76a8551 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -1,6 +1,4 @@
-/* text.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -2792,7 +2790,8 @@ int setcurr_tab_spaces (Text *text, int space)
/*********************************/
/* Creates and adds a marker to the list maintaining sorted order */
-void txt_add_marker(Text *text, TextLine *line, int start, int end, const unsigned char color[4], int group, int flags) {
+void txt_add_marker(Text *text, TextLine *line, int start, int end, const unsigned char color[4], int group, int flags)
+{
TextMarker *tmp, *marker;
marker= MEM_mallocN(sizeof(TextMarker), "text_marker");
@@ -2841,7 +2840,8 @@ TextMarker *txt_find_marker_region(Text *text, TextLine *line, int start, int en
/* Clears all markers on the specified line between two points. If the group or
flags fields are non-zero the returned flag must be in the specified group
and have at least the specified flags set. */
-short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags) {
+short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, int group, int flags)
+{
TextMarker *marker, *next;
int lineno= txt_get_span(text->lines.first, line);
short cleared= 0;
@@ -2866,7 +2866,8 @@ short txt_clear_marker_region(Text *text, TextLine *line, int start, int end, in
/* Clears all markers in the specified group (if given) with at least the
specified flags set. Useful for clearing temporary markers (group=0,
flags=TMARK_TEMP) */
-short txt_clear_markers(Text *text, int group, int flags) {
+short txt_clear_markers(Text *text, int group, int flags)
+{
TextMarker *marker, *next;
short cleared= 0;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 38165182d83..d344f79bb6c 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -1,6 +1,4 @@
-/* texture.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -640,7 +638,11 @@ void default_mtex(MTex *mtex)
mtex->size[1]= 1.0;
mtex->size[2]= 1.0;
mtex->tex= NULL;
- mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE;
+
+ /* MTEX_BUMP_FLIPPED is temporary before 2.61 release to prevent flipping normals
+ when creating file in 2.60, opening it in 2.59, saving and opening in 2.60 again */
+ mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE | MTEX_BUMP_FLIPPED;
+
mtex->colormodel= 0;
mtex->r= 1.0;
mtex->g= 0.0;
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 7e2ed426e0a..d683e980232 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -1,7 +1,4 @@
-
-/* world.c
- *
- *
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index 769a3f9b11e..b989d44c391 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -1,7 +1,4 @@
/*
- * Functions for writing avi-format files.
- * Added interface for generic movie support (ton)
- *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -28,7 +25,9 @@
* Contributor(s): Robert Wenzlaff
*
* ***** END GPL LICENSE BLOCK *****
- *
+ *
+ * Functions for writing avi-format files.
+ * Added interface for generic movie support (ton)
*/
/** \file blender/blenkernel/intern/writeavi.c
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 13875ff19f7..58a2f45e876 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1,6 +1,3 @@
-/** \file blender/blenkernel/intern/writeffmpeg.c
- * \ingroup bke
- */
/*
* $Id$
*
@@ -20,6 +17,10 @@
*
*/
+/** \file blender/blenkernel/intern/writeffmpeg.c
+ * \ingroup bke
+ */
+
#ifdef WITH_FFMPEG
#include <string.h>
#include <stdio.h>
@@ -489,6 +490,12 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
c->qmax=51;
}
+ // Keep lossless encodes in the RGB domain.
+ if (codec_id == CODEC_ID_HUFFYUV || codec_id == CODEC_ID_FFV1) {
+ /* HUFFYUV was PIX_FMT_YUV422P before */
+ c->pix_fmt = PIX_FMT_RGB32;
+ }
+
if ((of->oformat->flags & AVFMT_GLOBALHEADER)
// || !strcmp(of->oformat->name, "mp4")
// || !strcmp(of->oformat->name, "mov")
@@ -518,8 +525,8 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
return NULL;
}
- video_buffersize = 2000000;
- video_buffer = (uint8_t*)MEM_mallocN(video_buffersize,
+ video_buffersize = avpicture_get_size(c->pix_fmt, c->width, c->height);
+ video_buffer = (uint8_t*)MEM_mallocN(video_buffersize*sizeof(uint8_t),
"FFMPEG video buffer");
current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
@@ -565,6 +572,11 @@ static AVStream* alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
return NULL;
}
+ /* need to prevent floating point exception when using vorbis audio codec,
+ initialize this value in the same way as it's done in FFmpeg iteslf (sergey) */
+ st->codec->time_base.num= 1;
+ st->codec->time_base.den= st->codec->sample_rate;
+
audio_outbuf_size = FF_MIN_BUFFER_SIZE;
if((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
@@ -737,7 +749,11 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
}
}
- av_write_header(of);
+ if (av_write_header(of) < 0) {
+ BKE_report(reports, RPT_ERROR, "Could not initialize streams. Probably unsupported codec combination.");
+ return 0;
+ }
+
outfile = of;
av_dump_format(of, 0, name, 1);
@@ -808,7 +824,8 @@ void flush_ffmpeg(void)
********************************************************************** */
/* Get the output filename-- similar to the other output formats */
-void filepath_ffmpeg(char* string, RenderData* rd) {
+void filepath_ffmpeg(char* string, RenderData* rd)
+{
char autosplit[20];
const char ** exts = get_file_extensions(rd->ffcodecdata.type);
diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c
index d13d15d1269..d42b952617f 100644
--- a/source/blender/blenkernel/intern/writeframeserver.c
+++ b/source/blender/blenkernel/intern/writeframeserver.c
@@ -1,6 +1,3 @@
-/** \file blender/blenkernel/intern/writeframeserver.c
- * \ingroup bke
- */
/*
* $Id$
*
@@ -22,6 +19,10 @@
*
*/
+/** \file blender/blenkernel/intern/writeframeserver.c
+ * \ingroup bke
+ */
+
#ifdef WITH_FRAMESERVER
#include <string.h>
@@ -257,7 +258,11 @@ int frameserver_loop(RenderData *rd, ReportList *UNUSED(reports))
struct timeval tv;
struct sockaddr_in addr;
int len, rval;
+#ifdef FREE_WINDOWS
+ int socklen;
+#else
unsigned int socklen;
+#endif
char buf[4096];
if (connsock != -1) {
diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h
index f20cef9c3ea..b490317fdac 100644
--- a/source/blender/blenlib/BLI_callbacks.h
+++ b/source/blender/blenlib/BLI_callbacks.h
@@ -40,6 +40,8 @@ struct Main;
struct ID;
typedef enum {
+ BLI_CB_EVT_FRAME_CHANGE_PRE,
+ BLI_CB_EVT_FRAME_CHANGE_POST,
BLI_CB_EVT_RENDER_PRE,
BLI_CB_EVT_RENDER_POST,
BLI_CB_EVT_RENDER_STATS,
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index 5f31565d65b..cf3605a80ff 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -76,7 +76,8 @@ struct bArgs {
int *passes;
};
-static unsigned int case_strhash(const void *ptr) {
+static unsigned int case_strhash(const void *ptr)
+{
const char *s= ptr;
unsigned int i= 0;
unsigned char c;
diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c
index 7587a5195a2..e877e985d94 100644
--- a/source/blender/blenlib/intern/BLI_dynstr.c
+++ b/source/blender/blenlib/intern/BLI_dynstr.c
@@ -70,7 +70,8 @@ struct DynStr {
/***/
-DynStr *BLI_dynstr_new(void) {
+DynStr *BLI_dynstr_new(void)
+{
DynStr *ds= MEM_mallocN(sizeof(*ds), "DynStr");
ds->elems= ds->last= NULL;
ds->curlen= 0;
@@ -78,7 +79,8 @@ DynStr *BLI_dynstr_new(void) {
return ds;
}
-void BLI_dynstr_append(DynStr *ds, const char *cstr) {
+void BLI_dynstr_append(DynStr *ds, const char *cstr)
+{
DynStrElem *dse= malloc(sizeof(*dse));
int cstrlen= strlen(cstr);
@@ -220,7 +222,8 @@ void BLI_dynstr_appendf(DynStr *ds, const char *format, ...)
}
}
-int BLI_dynstr_get_len(DynStr *ds) {
+int BLI_dynstr_get_len(DynStr *ds)
+{
return ds->curlen;
}
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index eae4f918a67..8e68d42456f 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -350,7 +350,8 @@ static void sort_along_axis(BVHTree *tree, int start, int end, int axis)
//after a call to this function you can expect one of:
// every node to left of a[n] are smaller or equal to it
// every node to the right of a[n] are greater or equal to it
-static int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis){
+static int partition_nth_element(BVHNode **a, int _begin, int _end, int n, int axis)
+{
int begin = _begin, end = _end, cut;
while(end-begin > 3)
{
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 654ade8955f..485b8137a02 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -644,7 +644,8 @@ void BLI_bpathIterator_step(struct BPathIterator *bpi)
}
}
-int BLI_bpathIterator_isDone( struct BPathIterator *bpi) {
+int BLI_bpathIterator_isDone( struct BPathIterator *bpi)
+{
return bpi->type==BPATH_DONE;
}
@@ -699,7 +700,8 @@ static void bpath_as_report(struct BPathIterator *bpi, const char *message, Repo
}
/* high level function */
-void checkMissingFiles(Main *bmain, ReportList *reports) {
+void checkMissingFiles(Main *bmain, ReportList *reports)
+{
struct BPathIterator *bpi;
/* be sure there is low chance of the path being too short */
@@ -718,7 +720,8 @@ void checkMissingFiles(Main *bmain, ReportList *reports) {
}
/* dont log any errors at the moment, should probably do this */
-void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) {
+void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports)
+{
int tot= 0, changed= 0, failed= 0, linked= 0;
struct BPathIterator *bpi;
char filepath[FILE_MAX];
@@ -886,7 +889,8 @@ static int findFileRecursive(char *filename_new, const char *dirname, const char
}
/* high level function - call from fileselector */
-void findMissingFiles(Main *bmain, const char *str) {
+void findMissingFiles(Main *bmain, const char *str)
+{
struct BPathIterator *bpi;
/* be sure there is low chance of the path being too short */
diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c
index 8ad93495f6d..3e18517f3e5 100644
--- a/source/blender/blenlib/intern/math_base.c
+++ b/source/blender/blenlib/intern/math_base.c
@@ -64,7 +64,8 @@ double round(double x);
/* from python 3.1 floatobject.c
* ndigits must be between 0 and 21 */
-double double_round(double x, int ndigits) {
+double double_round(double x, int ndigits)
+{
double pow1, pow2, y, z;
if (ndigits >= 0) {
pow1 = pow(10.0, (double)ndigits);
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index f89283178ec..b206e275d9a 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -785,7 +785,8 @@ void BLI_getlastdir(const char* dir, char *last, const size_t maxlen)
/* This is now only used to really get the user's default document folder */
/* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
as default location to save documents */
-const char *BLI_getDefaultDocumentFolder(void) {
+const char *BLI_getDefaultDocumentFolder(void)
+{
#if !defined(WIN32)
return getenv("HOME");
@@ -1155,8 +1156,8 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check)
void BLI_setenv(const char *env, const char*val)
{
- /* SGI or free windows */
-#if (defined(__sgi) || ((defined(WIN32) || defined(WIN64)) && defined(FREE_WINDOWS)))
+ /* free windows */
+#if (defined(WIN32) || defined(WIN64)) && defined(FREE_WINDOWS)
char *envstr= MEM_mallocN(sizeof(char) * (strlen(env) + strlen(val) + 2), "envstr"); /* one for = another for \0 */
sprintf(envstr, "%s=%s", env, val);
@@ -1206,7 +1207,8 @@ void BLI_char_switch(char *string, char from, char to)
}
}
-void BLI_make_exist(char *dir) {
+void BLI_make_exist(char *dir)
+{
int a;
BLI_char_switch(dir, ALTSEP, SEP);
@@ -1431,16 +1433,16 @@ void BLI_split_dirfile(const char *string, char *dir, char *file)
void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file)
{
int sl_dir;
-
+
if(string != dir) /* compare pointers */
- BLI_strncpy(string, dir, maxlen);
+ BLI_strncpy(string, dir, maxlen -(file ? 1 : 0));
if (!file)
return;
-
+
sl_dir= BLI_add_slash(string);
- if (sl_dir <FILE_MAX) {
+ if (sl_dir < maxlen) {
BLI_strncpy(string + sl_dir, file, maxlen - sl_dir);
}
}
@@ -1550,7 +1552,8 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
return 1;
}
-char *BLI_first_slash(char *string) {
+char *BLI_first_slash(char *string)
+{
char *ffslash, *fbslash;
ffslash= strchr(string, '/');
@@ -1563,7 +1566,8 @@ char *BLI_first_slash(char *string) {
else return fbslash;
}
-char *BLI_last_slash(const char *string) {
+char *BLI_last_slash(const char *string)
+{
char *lfslash, *lbslash;
lfslash= strrchr(string, '/');
@@ -1577,33 +1581,23 @@ char *BLI_last_slash(const char *string) {
}
/* adds a slash if there isnt one there already */
-int BLI_add_slash(char *string) {
+int BLI_add_slash(char *string)
+{
int len = strlen(string);
-#ifdef WIN32
- if (len==0 || string[len-1]!='\\') {
- string[len] = '\\';
+ if (len==0 || string[len-1] != SEP) {
+ string[len] = SEP;
string[len+1] = '\0';
return len+1;
}
-#else
- if (len==0 || string[len-1]!='/') {
- string[len] = '/';
- string[len+1] = '\0';
- return len+1;
- }
-#endif
return len;
}
/* removes a slash if there is one */
-void BLI_del_slash(char *string) {
+void BLI_del_slash(char *string)
+{
int len = strlen(string);
while (len) {
-#ifdef WIN32
- if (string[len-1]=='\\') {
-#else
- if (string[len-1]=='/') {
-#endif
+ if (string[len-1] == SEP) {
string[len-1] = '\0';
len--;
} else {
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 0613765b868..57008af1812 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -346,7 +346,7 @@ static int map_insert_vert(PBVH *bvh, GHash *map,
if(!BLI_ghash_haskey(map, key)) {
if(BLI_bitmap_get(bvh->vert_bitmap, vertex)) {
- value = SET_INT_IN_POINTER(-(*face_verts) - 1);
+ value = SET_INT_IN_POINTER(~(*face_verts));
++(*face_verts);
}
else {
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 67e27063fd0..e336b914ffa 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -45,7 +45,7 @@
#include <time.h>
#include <sys/stat.h>
-#if defined (__sun__) || defined (__sun) || defined (__sgi) || defined (__NetBSD__)
+#if defined (__sun__) || defined (__sun) || defined (__NetBSD__)
#include <sys/statvfs.h> /* Other modern unix os's should probably use this also */
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
#include <sys/statfs.h>
@@ -165,7 +165,7 @@ double BLI_diskfree(const char *dir)
return (double) (freec*bytesps*sectorspc);
#else
-#if defined (__sun__) || defined (__sun) || defined (__sgi) || defined (__NetBSD__)
+#if defined (__sun__) || defined (__sun) || defined (__NetBSD__)
struct statvfs disk;
#else
struct statfs disk;
@@ -187,7 +187,7 @@ double BLI_diskfree(const char *dir)
if (statfs(name, &disk)) return(-1);
#endif
-#if defined (__sun__) || defined (__sun) || defined (__sgi) || defined (__NetBSD__)
+#if defined (__sun__) || defined (__sun) || defined (__NetBSD__)
if (statvfs(name, &disk)) return(-1);
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
/* WARNING - This may not be supported by geeneric unix os's - Campbell */
@@ -469,7 +469,8 @@ int BLI_exist(const char *name)
}
/* would be better in fileops.c except that it needs stat.h so add here */
-int BLI_is_dir(const char *file) {
+int BLI_is_dir(const char *file)
+{
return S_ISDIR(BLI_exist(file));
}
@@ -478,17 +479,17 @@ LinkNode *BLI_read_file_as_lines(const char *name)
FILE *fp= fopen(name, "r");
LinkNode *lines= NULL;
char *buf;
- int64_t size;
+ size_t size;
if (!fp) return NULL;
fseek(fp, 0, SEEK_END);
- size= ftell(fp);
+ size= (size_t)ftell(fp);
fseek(fp, 0, SEEK_SET);
buf= MEM_mallocN(size, "file_as_lines");
if (buf) {
- int i, last= 0;
+ size_t i, last= 0;
/*
* size = because on win32 reading
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 8315161aeda..db5d4dc99eb 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -43,14 +43,16 @@
#include "BLI_dynstr.h"
#include "BLI_string.h"
-char *BLI_strdupn(const char *str, const size_t len) {
+char *BLI_strdupn(const char *str, const size_t len)
+{
char *n= MEM_mallocN(len+1, "strdup");
memcpy(n, str, len);
n[len]= '\0';
return n;
}
-char *BLI_strdup(const char *str) {
+char *BLI_strdup(const char *str)
+{
return BLI_strdupn(str, strlen(str));
}
@@ -67,7 +69,8 @@ char *BLI_strdupcat(const char *str1, const char *str2)
return n;
}
-char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy) {
+char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy)
+{
size_t srclen= strlen(src);
size_t cpylen= (srclen>(maxncpy-1))?(maxncpy-1):srclen;
@@ -87,7 +90,8 @@ size_t BLI_snprintf(char *buffer, size_t count, const char *format, ...)
if (n != -1 && n < count) {
buffer[n] = '\0';
- } else {
+ }
+ else {
buffer[count-1] = '\0';
}
@@ -280,7 +284,8 @@ char *BLI_strcasestr(const char *s, const char *find)
}
-int BLI_strcasecmp(const char *s1, const char *s2) {
+int BLI_strcasecmp(const char *s1, const char *s2)
+{
int i;
for (i=0; ; i++) {
@@ -299,7 +304,8 @@ int BLI_strcasecmp(const char *s1, const char *s2) {
return 0;
}
-int BLI_strncasecmp(const char *s1, const char *s2, size_t len) {
+int BLI_strncasecmp(const char *s1, const char *s2, size_t len)
+{
int i;
for (i=0; i<len; i++) {
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c
index 7b59a7905aa..097ad2bcd74 100644
--- a/source/blender/blenlib/intern/threads.c
+++ b/source/blender/blenlib/intern/threads.c
@@ -218,7 +218,8 @@ static void *tslot_thread_start(void *tslot_p)
return tslot->do_thread(tslot->callerdata);
}
-int BLI_thread_is_main(void) {
+int BLI_thread_is_main(void)
+{
return pthread_equal(pthread_self(), mainid);
}
@@ -318,8 +319,6 @@ int BLI_system_thread_count( void )
mib[1] = HW_NCPU;
len = sizeof(t);
sysctl(mib, 2, &t, &len, NULL, 0);
-# elif defined(__sgi)
- t = sysconf(_SC_NPROC_ONLN);
# else
t = (int)sysconf(_SC_NPROCESSORS_ONLN);
# endif
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index 66080ed2a85..3b14abb0bee 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -109,7 +109,7 @@ void RegisterBlendExtension(void) {
lresult = RegCreateKeyEx(root, "blendfile", 0,
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
if (lresult == ERROR_SUCCESS) {
- sprintf(buffer,"%s","Blender File");
+ strcpy(buffer,"Blender File");
lresult = RegSetValueEx(hkey, NULL, 0, REG_SZ, (BYTE*)buffer, strlen(buffer) + 1);
RegCloseKey(hkey);
}
@@ -301,7 +301,7 @@ char* dirname(char *path)
{
char *p;
if( path == NULL || *path == '\0' )
- return ".";
+ return ".";
p = path + strlen(path) - 1;
while( *p == '/' ) {
if( p == path )
@@ -309,11 +309,11 @@ char* dirname(char *path)
*p-- = '\0';
}
while( p >= path && *p != '/' )
- p--;
+ p--;
return
- p < path ? "." :
- p == path ? "/" :
- (*p = '\0', path);
+ p < path ? "." :
+ p == path ? "/" :
+ (*p = '\0', path);
}
/* End of copied part */
diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h
index 4b3902dca43..8c0996528c6 100644
--- a/source/blender/blenloader/BLO_sys_types.h
+++ b/source/blender/blenloader/BLO_sys_types.h
@@ -99,7 +99,7 @@ unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
#else
- /* FreeBSD, Irix, Solaris */
+ /* FreeBSD, Solaris */
#include <sys/types.h>
#endif /* ifdef platform for types */
@@ -118,7 +118,7 @@ unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
#include <sys/param.h>
#elif defined (__APPLE__)
#include <sys/types.h>
-#else /* irix sun linux */
+#else /* sun linux */
#include <netinet/in.h>
#endif /* ifdef platform for htonl/ntohl */
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 31b3724e9f6..0e93e5fa8c0 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -240,7 +240,8 @@ LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh)
return names;
}
-void BLO_blendhandle_close(BlendHandle *bh) {
+void BLO_blendhandle_close(BlendHandle *bh)
+{
FileData *fd= (FileData*) bh;
blo_freefiledata(fd);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d6fa12cfaa0..2d3d21c5c7f 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -518,7 +518,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
BLI_addtail(mainlist, m);
lib= alloc_libblock(&m->library, ID_LI, "lib");
- strncpy(lib->name, filepath, sizeof(lib->name)-1);
+ BLI_strncpy(lib->name, filepath, sizeof(lib->name));
BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));
m->curlib= lib;
@@ -3071,6 +3071,9 @@ static void direct_link_texture(FileData *fd, Tex *tex)
if(tex->vd) {
tex->vd->dataset = NULL;
tex->vd->ok = 0;
+ } else {
+ if(tex->type == TEX_VOXELDATA)
+ tex->vd= MEM_callocN(sizeof(VoxelData), "direct_link_texture VoxelData");
}
tex->nodetree= newdataadr(fd, tex->nodetree);
@@ -4553,7 +4556,9 @@ static void lib_link_scene(FileData *fd, Main *main)
seq->scene_sound = NULL;
if(seq->scene) {
seq->scene= newlibadr(fd, sce->id.lib, seq->scene);
- seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+ if(seq->scene) {
+ seq->scene_sound = sound_scene_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
+ }
}
if(seq->scene_camera) seq->scene_camera= newlibadr(fd, sce->id.lib, seq->scene_camera);
if(seq->sound) {
@@ -5693,7 +5698,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
* link into an unsaved blend file. See [#27405].
* The remap relative option will make it relative again on save - campbell */
if (strncmp(lib->name, "//", 2)==0) {
- strncpy(lib->name, lib->filepath, sizeof(lib->name));
+ BLI_strncpy(lib->name, lib->filepath, sizeof(lib->name));
}
}
}
@@ -5702,7 +5707,7 @@ static void fix_relpaths_library(const char *basepath, Main *main)
/* Libraries store both relative and abs paths, recreate relative paths,
* relative to the blend file since indirectly linked libs will be relative to their direct linked library */
if (strncmp(lib->name, "//", 2)==0) { /* if this is relative to begin with? */
- strncpy(lib->name, lib->filepath, sizeof(lib->name));
+ BLI_strncpy(lib->name, lib->filepath, sizeof(lib->name));
BLI_path_rel(lib->name, basepath);
}
}
@@ -7164,7 +7169,7 @@ void convert_tface_mt(FileData *fd, Main *main)
G.main = main;
if(!(do_version_tface(main, 1))) {
- BKE_report(fd->reports, RPT_ERROR, "Texface conversion problem. Error in console");
+ BKE_report(fd->reports, RPT_WARNING, "Texface conversion problem. Error in console");
}
//XXX hack, material.c uses G.main allover the place, instead of main
@@ -10091,7 +10096,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->toolsettings->skgen_resolution = 250;
sce->toolsettings->skgen_threshold_internal = 0.1f;
sce->toolsettings->skgen_threshold_external = 0.1f;
- sce->toolsettings->skgen_angle_limit = 30.0f;
+ sce->toolsettings->skgen_angle_limit = 30.0f;
sce->toolsettings->skgen_length_ratio = 1.3f;
sce->toolsettings->skgen_length_limit = 1.5f;
sce->toolsettings->skgen_correlation_limit = 0.98f;
@@ -10490,7 +10495,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ma->mode |= MA_TRANSP;
}
else {
- ma->mode |= MA_ZTRANSP;
+ /* ma->mode |= MA_ZTRANSP; */ /* leave ztransp as is even if its not used [#28113] */
ma->mode &= ~MA_TRANSP;
}
@@ -11861,7 +11866,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if(!mat->mtex[tex_nr]) continue;
if(mat->mtex[tex_nr]->mapto & MAP_ALPHA) transp_tex= 1;
}
-
+
+ /* weak! material alpha could be animated */
if(mat->alpha < 1.0f || mat->fresnel_tra > 0.0f || transp_tex){
mat->mode |= MA_TRANSP;
mat->mode &= ~(MA_ZTRANSP|MA_RAYTRANSP);
@@ -12187,49 +12193,87 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
- /* put compatibility code here until next subversion bump */
+ if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 4)){
+ {
+ /* Adaptive time step for particle systems */
+ ParticleSettings *part;
+ for (part = main->particle.first; part; part = part->id.next) {
+ part->courant_target = 0.2f;
+ part->time_flag &= ~PART_TIME_AUTOSF;
+ }
+ }
- {
+ {
+ /* set defaults for obstacle avoidance, recast data */
+ Scene *sce;
+ for(sce = main->scene.first; sce; sce = sce->id.next)
+ {
+ if (sce->gm.levelHeight == 0.f)
+ sce->gm.levelHeight = 2.f;
+
+ if(sce->gm.recastData.cellsize == 0.0f)
+ sce->gm.recastData.cellsize = 0.3f;
+ if(sce->gm.recastData.cellheight == 0.0f)
+ sce->gm.recastData.cellheight = 0.2f;
+ if(sce->gm.recastData.agentmaxslope == 0.0f)
+ sce->gm.recastData.agentmaxslope = (float)M_PI/4;
+ if(sce->gm.recastData.agentmaxclimb == 0.0f)
+ sce->gm.recastData.agentmaxclimb = 0.9f;
+ if(sce->gm.recastData.agentheight == 0.0f)
+ sce->gm.recastData.agentheight = 2.0f;
+ if(sce->gm.recastData.agentradius == 0.0f)
+ sce->gm.recastData.agentradius = 0.6f;
+ if(sce->gm.recastData.edgemaxlen == 0.0f)
+ sce->gm.recastData.edgemaxlen = 12.0f;
+ if(sce->gm.recastData.edgemaxerror == 0.0f)
+ sce->gm.recastData.edgemaxerror = 1.3f;
+ if(sce->gm.recastData.regionminsize == 0.0f)
+ sce->gm.recastData.regionminsize = 8.f;
+ if(sce->gm.recastData.regionmergesize == 0.0f)
+ sce->gm.recastData.regionmergesize = 20.f;
+ if(sce->gm.recastData.vertsperpoly<3)
+ sce->gm.recastData.vertsperpoly = 6;
+ if(sce->gm.recastData.detailsampledist == 0.0f)
+ sce->gm.recastData.detailsampledist = 6.0f;
+ if(sce->gm.recastData.detailsamplemaxerror == 0.0f)
+ sce->gm.recastData.detailsamplemaxerror = 1.0f;
+ }
+ }
+
+ {
+ /* flip normals */
+ Material *ma= main->mat.first;
+ while(ma) {
+ int a;
+ for(a= 0; a<MAX_MTEX; a++) {
+ MTex *mtex= ma->mtex[a];
+
+ if(mtex) {
+ if((mtex->texflag&MTEX_BUMP_FLIPPED)==0) {
+ if((mtex->mapto&MAP_DISPLACE)==0) {
+ if((mtex->mapto&MAP_NORM) && mtex->texflag&(MTEX_COMPAT_BUMP|MTEX_3TAP_BUMP|MTEX_5TAP_BUMP)) {
+ Tex *tex= newlibadr(fd, lib, mtex->tex);
+
+ if(!tex || (tex->imaflag&TEX_NORMALMAP)==0) {
+ mtex->norfac= -mtex->norfac;
+ mtex->texflag|= MTEX_BUMP_FLIPPED;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ma= ma->id.next;
+ }
+ }
}
- //set defaults for obstacle avoidance, recast data
+ /* put compatibility code here until next subversion bump */
{
- Scene *sce;
- for(sce = main->scene.first; sce; sce = sce->id.next)
- {
- if (sce->gm.levelHeight == 0.f)
- sce->gm.levelHeight = 2.f;
-
- if(sce->gm.recastData.cellsize == 0.0f)
- sce->gm.recastData.cellsize = 0.3f;
- if(sce->gm.recastData.cellheight == 0.0f)
- sce->gm.recastData.cellheight = 0.2f;
- if(sce->gm.recastData.agentmaxslope == 0.0f)
- sce->gm.recastData.agentmaxslope = M_PI/4;
- if(sce->gm.recastData.agentmaxclimb == 0.0f)
- sce->gm.recastData.agentmaxclimb = 0.9f;
- if(sce->gm.recastData.agentheight == 0.0f)
- sce->gm.recastData.agentheight = 2.0f;
- if(sce->gm.recastData.agentradius == 0.0f)
- sce->gm.recastData.agentradius = 0.6f;
- if(sce->gm.recastData.edgemaxlen == 0.0f)
- sce->gm.recastData.edgemaxlen = 12.0f;
- if(sce->gm.recastData.edgemaxerror == 0.0f)
- sce->gm.recastData.edgemaxerror = 1.3f;
- if(sce->gm.recastData.regionminsize == 0.0f)
- sce->gm.recastData.regionminsize = 50.f;
- if(sce->gm.recastData.regionmergesize == 0.0f)
- sce->gm.recastData.regionmergesize = 20.f;
- if(sce->gm.recastData.vertsperpoly<3)
- sce->gm.recastData.vertsperpoly = 6;
- if(sce->gm.recastData.detailsampledist == 0.0f)
- sce->gm.recastData.detailsampledist = 6.0f;
- if(sce->gm.recastData.detailsamplemaxerror == 0.0f)
- sce->gm.recastData.detailsamplemaxerror = 1.0f;
- }
}
-
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
@@ -12357,7 +12401,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
bfd->main->versionfile= fd->fileversion;
bfd->type= BLENFILETYPE_BLEND;
- strncpy(bfd->main->name, filepath, sizeof(bfd->main->name)-1);
+ BLI_strncpy(bfd->main->name, filepath, sizeof(bfd->main->name));
while(bhead) {
switch(bhead->code) {
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index b0974b7f86f..2ac6d1aed94 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1787,7 +1787,7 @@ static void write_textures(WriteData *wd, ListBase *idbase)
if(tex->pd->coba) writestruct(wd, DATA, "ColorBand", 1, tex->pd->coba);
if(tex->pd->falloff_curve) write_curvemapping(wd, tex->pd->falloff_curve);
}
- if(tex->type == TEX_VOXELDATA && tex->vd) writestruct(wd, DATA, "VoxelData", 1, tex->vd);
+ if(tex->type == TEX_VOXELDATA) writestruct(wd, DATA, "VoxelData", 1, tex->vd);
/* nodetree is integral part of texture, no libdata */
if(tex->nodetree) {
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index a176b6eb4cd..61f1b1dfa08 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -426,7 +426,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act)
//sets the rna_path and array index to curve
-void AnimationImporter::modify_fcurve(std::vector<FCurve*>* curves , char* rna_path , int array_index )
+void AnimationImporter::modify_fcurve(std::vector<FCurve*>* curves , const char* rna_path , int array_index )
{
std::vector<FCurve*>::iterator it;
int i;
@@ -603,7 +603,7 @@ void AnimationImporter:: Assign_color_animations(const COLLADAFW::UniqueId& list
for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
FCurve * fcu = *iter;
BLI_addtail(AnimCurves, fcu);
- }
+ }
}
@@ -621,16 +621,16 @@ void AnimationImporter:: Assign_float_animations(const COLLADAFW::UniqueId& list
//all the curves belonging to the current binding
std::vector<FCurve*> animcurves;
for (unsigned int j = 0; j < bindings.getCount(); j++) {
- animcurves = curve_map[bindings[j].animation];
-
- BLI_strncpy(rna_path, anim_type , sizeof(rna_path));
- modify_fcurve(&animcurves, rna_path, 0 );
- std::vector<FCurve*>::iterator iter;
- //Add the curves of the current animation to the object
- for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
- FCurve * fcu = *iter;
- BLI_addtail(AnimCurves, fcu);
- }
+ animcurves = curve_map[bindings[j].animation];
+
+ BLI_strncpy(rna_path, anim_type , sizeof(rna_path));
+ modify_fcurve(&animcurves, rna_path, 0 );
+ std::vector<FCurve*>::iterator iter;
+ //Add the curves of the current animation to the object
+ for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
+ FCurve * fcu = *iter;
+ BLI_addtail(AnimCurves, fcu);
+ }
}
}
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index 9e8f7b42069..77587114374 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -164,7 +164,7 @@ public:
int setAnimType ( const COLLADAFW::Animatable * prop , int type, int addition);
- void modify_fcurve(std::vector<FCurve*>* curves , char* rna_path , int array_index );
+ void modify_fcurve(std::vector<FCurve*>* curves , const char* rna_path , int array_index );
// prerequisites:
// animlist_map - map animlist id -> animlist
// curve_map - map anim id -> curve(s)
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 2387c9a1465..e98f551a097 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -816,7 +816,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 = angle_to_lens(DEG2RADF(xfov));
}
break;
}
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 2f5d9e54e50..a6757329ea1 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -466,7 +466,7 @@ void MeshImporter::read_faces(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris) //T
if (has_normals && mp->getPositionIndices().getCount() != mp->getNormalIndices().getCount()) {
fprintf(stderr, "Warning: Number of normals is different from the number of vertcies, skipping normals\n");
- has_normals = false;
+ has_normals = false;
}
unsigned int j, k;
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 373d351fb6c..e8af5a8f290 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3051,7 +3051,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
/* Draw a widget for some setting */
static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChannelType *acf, uiBlock *block, int xpos, int ypos, int setting)
{
- short negflag, ptrsize, enabled, butType;
+ short negflag, ptrsize /* , enabled */ /* UNUSED */, butType;
int flag, icon;
void *ptr;
const char *tooltip;
@@ -3060,7 +3060,7 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan
/* get the flag and the pointer to that flag */
flag= acf->setting_flag(ac, setting, &negflag);
ptr= acf->setting_ptr(ale, setting, &ptrsize);
- enabled= ANIM_channel_setting_get(ac, ale, setting);
+ /* enabled= ANIM_channel_setting_get(ac, ale, setting); */ /* UNUSED */
/* get the base icon for the setting */
switch (setting) {
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index d58d51c8e08..7f05a7c2b1a 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -366,7 +366,7 @@ void ANIM_deselect_anim_channels (bAnimContext *ac, void *data, short datatype,
/* Flush visibility (for Graph Editor) changes up/down hierarchy for changes in the given setting
* - anim_data: list of the all the anim channels that can be chosen
* -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too,
- * then the channels under closed expanders get ignored...
+ * then the channels under closed expanders get ignored...
* - ale_setting: the anim channel (not in the anim_data list directly, though occuring there)
* with the new state of the setting that we want flushed up/down the hierarchy
* - setting: type of setting to set
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index d2b1fcc4abd..2774bd2cda4 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -71,12 +71,12 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short
if (timecodes) {
int hours=0, minutes=0, seconds=0, frames=0;
float raw_seconds= cfra;
- char neg[2]= "";
+ char neg[2]= {'\0'};
/* get cframes */
if (cfra < 0) {
/* correction for negative cfraues */
- sprintf(neg, "-");
+ neg[0]= '-';
cfra = -cfra;
}
if (cfra >= 3600) {
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index bd5935c893c..c982a1d7f86 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -343,6 +343,13 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
* channel can be kept around). No need to clear channels-flag in order to
* keep expander channels with no sub-data out, as those cases should get
* dealt with by the recursive detection idiom in place.
+ *
+ * Implementation Note:
+ * YES the _doSubChannels variable is NOT read anywhere. BUT, this is NOT an excuse
+ * to go steamrolling the logic into a single-line expression as from experience,
+ * those are notoriously difficult to read + debug when extending later on. The code
+ * below is purposefully laid out so that each case noted above corresponds clearly to
+ * one case below.
*/
#define BEGIN_ANIMFILTER_SUBCHANNELS(expanded_check) \
{ \
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index 9c43671cdf4..383e0bac796 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -63,9 +63,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
return icon;
else if ELEM3(NULL, id, fcu, fcu->rna_path) {
if (fcu == NULL)
- sprintf(name, "<invalid>");
+ strcpy(name, "<invalid>");
else if (fcu->rna_path == NULL)
- sprintf(name, "<no path>");
+ strcpy(name, "<no path>");
else /* id == NULL */
BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index);
}
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 77c67fc4af0..d329874e1ba 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -112,7 +112,7 @@ static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v)
static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, short width)
{
FMod_Generator *data= (FMod_Generator *)fcm->data;
- uiLayout *col, *row;
+ uiLayout /* *col, */ /* UNUSED */ *row;
uiBlock *block;
uiBut *but;
PointerRNA ptr;
@@ -121,7 +121,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
RNA_pointer_create(id, &RNA_FModifierFunctionGenerator, fcm, &ptr);
/* basic settings (backdrop + mode selector + some padding) */
- col= uiLayoutColumn(layout, 1);
+ /* col= uiLayoutColumn(layout, 1); */ /* UNUSED */
block= uiLayoutGetBlock(layout);
uiBlockBeginAlign(block);
but= uiDefButR(block, MENU, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "mode", -1, 0, 0, -1, -1, NULL);
@@ -521,7 +521,7 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
/* draw settings for limits modifier */
static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, short UNUSED(width))
{
- uiLayout *split, *col, *row;
+ uiLayout *split, *col /* , *row */ /* UNUSED */;
PointerRNA ptr;
/* init the RNA-pointer */
@@ -529,7 +529,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* row 1: minimum */
{
- row= uiLayoutRow(layout, 0);
+ /* row= uiLayoutRow(layout, 0); */ /* UNUSED */
/* split into 2 columns */
split= uiLayoutSplit(layout, 0.5f, 0);
@@ -547,7 +547,7 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* row 2: maximum */
{
- row= uiLayoutRow(layout, 0);
+ /* row= uiLayoutRow(layout, 0); */ /* UNUSED */
/* split into 2 columns */
split= uiLayoutSplit(layout, 0.5f, 0);
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index fa619e4cf44..af78fe739cc 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -51,6 +51,7 @@
#include "DNA_node_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
+#include "DNA_space_types.h"
#include "DNA_world_types.h"
#include "BKE_fcurve.h"
@@ -386,6 +387,9 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac)
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
+ /* when not in graph view, don't use handles */
+ SpaceIpo *sipo= (ac->spacetype == SPACE_IPO) ? (SpaceIpo *)ac->sl : NULL;
+ const short use_handle = sipo ? !(sipo->flag & SIPO_NOHANDLES) : FALSE;
/* filter animation data */
filter= ANIMFILTER_DATA_VISIBLE;
@@ -397,7 +401,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac)
/* make sure keyframes in F-Curve are all in order, and handles are in valid positions */
sort_time_fcurve(fcu);
- testhandles_fcurve(fcu);
+ testhandles_fcurve(fcu, use_handle);
}
/* free temp data */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 58e1549c0ed..fb34245d338 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -540,8 +540,8 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
/* get first constraint and determine type of keyframe constraints to check for
* - constraints can be on either Objects or PoseChannels, so we only check if the
- * ptr->type is RNA_Object or RNA_PoseBone, which are the RNA wrapping-info for
- * those structs, allowing us to identify the owner of the data
+ * ptr->type is RNA_Object or RNA_PoseBone, which are the RNA wrapping-info for
+ * those structs, allowing us to identify the owner of the data
*/
if (ptr->type == &RNA_Object) {
/* Object */
@@ -1748,3 +1748,56 @@ short id_frame_has_keyframe (ID *id, float frame, short filter)
}
/* ************************************************** */
+
+int ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks)
+{
+ /* auto keyframing */
+ if (autokeyframe_cfra_can_key(scene, &ob->id)) {
+ ListBase dsources = {NULL, NULL};
+
+ /* now insert the keyframe(s) using the Keying Set
+ * 1) add datasource override for the Object
+ * 2) insert keyframes
+ * 3) free the extra info
+ */
+ ANIM_relative_keyingset_add_source(&dsources, &ob->id, NULL, NULL);
+ ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
+ BLI_freelistN(&dsources);
+
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+int ED_autokeyframe_pchan(bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks)
+{
+ if (autokeyframe_cfra_can_key(scene, &ob->id)) {
+ ListBase dsources = {NULL, NULL};
+
+ /* now insert the keyframe(s) using the Keying Set
+ * 1) add datasource override for the PoseChannel
+ * 2) insert keyframes
+ * 3) free the extra info
+ */
+ ANIM_relative_keyingset_add_source(&dsources, &ob->id, &RNA_PoseBone, pchan);
+ ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
+ BLI_freelistN(&dsources);
+
+ /* clear any unkeyed tags */
+ if (pchan->bone) {
+ pchan->bone->flag &= ~BONE_UNKEYED;
+ }
+
+ return TRUE;
+ }
+ else {
+ /* add unkeyed tags */
+ if (pchan->bone) {
+ pchan->bone->flag |= BONE_UNKEYED;
+ }
+
+ return FALSE;
+ }
+}
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index 81ece9ddc9a..d559aef6fe2 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -173,6 +173,7 @@ void ED_operatormacros_armature(void)
ot= WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
+ ot->description= "Make copies of the selected bones within the same armature and move them";
WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", 0);
@@ -180,6 +181,7 @@ void ED_operatormacros_armature(void)
ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
+ ot->description= "Create new bones from the selected joints and move them";
otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
RNA_boolean_set(otmacro->ptr, "forked", 0);
otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
@@ -190,6 +192,7 @@ void ED_operatormacros_armature(void)
// that would require fixing a properties bug 19733
ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
+ ot->description= "Create new bones from the selected joints and move them";
otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
RNA_boolean_set(otmacro->ptr, "forked", 1);
otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 566ff09c366..20368bbf57b 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -4298,7 +4298,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
* note, special exception for armature mode so we can do multi-select
* we could check for multi-select explicitly but think its fine to
* always give pradictable behavior in weight paint mode - campbell */
- if (!(extend) || ((ob_act && ob_act->mode & OB_MODE_WEIGHT_PAINT) == 0)) {
+ if (!extend || ((ob_act && (ob_act != ob) && (ob_act->mode & OB_MODE_WEIGHT_PAINT)==0))) {
ED_pose_deselectall(ob, 0);
nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
arm->act_bone= nearBone;
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index b750bd5ef1c..14891826260 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -1889,7 +1889,7 @@ static RetargetMode detectArcRetargetMode(RigArc *iarc)
RigEdge *edge;
int large_angle = 0;
float avg_angle = 0;
- float avg_length = 0;
+ /* float avg_length = 0; */ /* UNUSED */
int nb_edges = 0;
@@ -1901,7 +1901,7 @@ static RetargetMode detectArcRetargetMode(RigArc *iarc)
avg_angle /= nb_edges - 1; /* -1 because last edge doesn't have an angle */
- avg_length = iarc->length / nb_edges;
+ /* avg_length = iarc->length / nb_edges; */ /* UNUSED */
if (nb_edges > 2)
@@ -2202,7 +2202,9 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc,
float angle_weight = 1.0; // GET FROM CONTEXT
float length_weight = 1.0;
float distance_weight = 1.0;
+#ifndef USE_THREADS
float min_cost = FLT_MAX;
+#endif
float *vec0, *vec1;
int *best_positions;
int nb_edges = BLI_countlist(&iarc->edges);
@@ -2245,7 +2247,9 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc,
int nb_positions = earc->bcount;
int nb_memo_nodes = nb_positions * nb_positions * (nb_joints + 1);
MemoNode *table = MEM_callocN(nb_memo_nodes * sizeof(MemoNode), "memoization table");
+#ifndef USE_THREADS
MemoNode *result;
+#endif
float **positions_cache = MEM_callocN(sizeof(float*) * (nb_positions + 2), "positions cache");
int i;
@@ -2260,11 +2264,15 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc,
positions_cache[i] = bucket->p;
}
+#ifndef USE_THREADS
result = solveJoints(table, iter, positions_cache, nb_joints, earc->bcount, 0, 0, iarc->edges.first, nb_joints, angle_weight, length_weight, distance_weight);
-
min_cost = result->weight;
+#else
+ solveJoints(table, iter, positions_cache, nb_joints, earc->bcount, 0, 0, iarc->edges.first, nb_joints, angle_weight, length_weight, distance_weight);
+#endif
+
copyMemoPositions(best_positions, table, earc->bcount, nb_joints);
-
+
MEM_freeN(table);
MEM_freeN(positions_cache);
}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 8a7d837d2a8..bf2e17c4e87 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -993,7 +993,7 @@ static void poselib_preview_apply (bContext *C, wmOperator *op)
memcpy(&tempstr[index+1], &pld->searchstr[index], 64-index);
}
else {
- strncpy(tempstr, pld->searchstr, 64);
+ BLI_strncpy(tempstr, pld->searchstr, sizeof(tempstr));
}
/* get marker name */
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 4405f395843..61935aa72ca 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -1149,7 +1149,10 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
bPoseChannel *chan;
int flip= RNA_boolean_get(op->ptr, "flipped");
int selOnly= RNA_boolean_get(op->ptr, "selected_mask");
-
+
+ /* get KeyingSet to use */
+ KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "LocRotScale");
+
/* sanity checks */
if ELEM(NULL, ob, ob->pose)
return OPERATOR_CANCELLED;
@@ -1166,7 +1169,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
if (CTX_DATA_COUNT(C, selected_pose_bones) == 0)
selOnly = 0;
}
-
+
/* Safely merge all of the channels in the buffer pose into any existing pose */
for (chan= g_posebuf->chanbase.first; chan; chan=chan->next) {
if (chan->flag & POSE_KEY) {
@@ -1175,30 +1178,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
if (pchan) {
/* keyframing tagging for successful paste */
- if (autokeyframe_cfra_can_key(scene, &ob->id)) {
- ListBase dsources = {NULL, NULL};
-
- /* get KeyingSet to use */
- KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "LocRotScale");
-
- /* now insert the keyframe(s) using the Keying Set
- * 1) add datasource override for the PoseChannel
- * 2) insert keyframes
- * 3) free the extra info
- */
- ANIM_relative_keyingset_add_source(&dsources, &ob->id, &RNA_PoseBone, pchan);
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
- BLI_freelistN(&dsources);
-
- /* clear any unkeyed tags */
- if (chan->bone)
- chan->bone->flag &= ~BONE_UNKEYED;
- }
- else {
- /* add unkeyed tags */
- if (chan->bone)
- chan->bone->flag |= BONE_UNKEYED;
- }
+ ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
}
}
}
@@ -1227,8 +1207,8 @@ void POSE_OT_paste (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "flipped", 0, "Flipped on X-Axis", "Paste the stored pose flipped on to current pose");
- RNA_def_boolean(ot->srna, "selected_mask", 1, "On Selected Only", "Only paste the stored pose on to selected bones in the current pose");
+ RNA_def_boolean(ot->srna, "flipped", FALSE, "Flipped on X-Axis", "Paste the stored pose flipped on to current pose");
+ RNA_def_boolean(ot->srna, "selected_mask", FALSE, "On Selected Only", "Only paste the stored pose on to selected bones in the current pose");
}
/* ********************************************** */
@@ -2194,29 +2174,8 @@ static int pose_flip_quats_exec (bContext *C, wmOperator *UNUSED(op))
if (pchan->rotmode == ROT_MODE_QUAT) {
/* quaternions have 720 degree range */
negate_v4(pchan->quat);
-
- /* tagging */
- if (autokeyframe_cfra_can_key(scene, &ob->id)) {
- ListBase dsources = {NULL, NULL};
-
- /* now insert the keyframe(s) using the Keying Set
- * 1) add datasource override for the PoseChannel
- * 2) insert keyframes
- * 3) free the extra info
- */
- ANIM_relative_keyingset_add_source(&dsources, &ob->id, &RNA_PoseBone, pchan);
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
- BLI_freelistN(&dsources);
-
- /* clear any unkeyed tags */
- if (pchan->bone)
- pchan->bone->flag &= ~BONE_UNKEYED;
- }
- else {
- /* add unkeyed tags */
- if (pchan->bone)
- pchan->bone->flag |= BONE_UNKEYED;
- }
+
+ ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
}
}
CTX_DATA_END;
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c
index 04501243acb..78c9e601d87 100644
--- a/source/blender/editors/armature/reeb.c
+++ b/source/blender/editors/armature/reeb.c
@@ -1353,11 +1353,11 @@ static int joinSubgraphsEnds(ReebGraph *rg, float threshold, int nb_subgraphs)
if (end_node && start_node)
{
- ReebArc *start_arc, *end_arc;
+ ReebArc *start_arc /* , *end_arc */ /* UNUSED */;
int merging = 0;
start_arc = start_node->arcs[0];
- end_arc = end_node->arcs[0];
+ /* end_arc = end_node->arcs[0]; */ /* UNUSED */
if (start_arc->tail == start_node)
{
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 84df77bb120..0a05086a3a4 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -2376,7 +2376,7 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
BezTriple *bezt;
BPoint *bp;
int a;
- short lastsel= 0, sel=0;
+ short lastsel= 0;
if(next==0) return;
@@ -2388,13 +2388,12 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
if(next < 0) bezt= (nu->bezt + (a-1));
while(a--) {
if(a-abs(next) < 0) break;
- sel= 0;
if((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & SELECT) || (selstatus==0))) {
bezt+=next;
if(!(bezt->f2 & SELECT) || (selstatus==0)) {
- sel= select_beztriple(bezt, selstatus, 1, VISIBLE);
+ short sel= select_beztriple(bezt, selstatus, 1, VISIBLE);
if((sel==1) && (cont==0)) lastsel= 1;
- }
+ }
}
else {
bezt+=next;
@@ -2410,11 +2409,10 @@ static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short
if(next < 0) bp= (nu->bp + (a-1));
while(a--) {
if(a-abs(next) < 0) break;
- sel=0;
if((lastsel==0) && (bp->hide==0) && ((bp->f1 & SELECT) || (selstatus==0))) {
bp+=next;
if(!(bp->f1 & SELECT) || (selstatus==0)) {
- sel= select_bpoint(bp, selstatus, 1, VISIBLE);
+ short sel= select_bpoint(bp, selstatus, 1, VISIBLE);
if((sel==1) && (cont==0)) lastsel= 1;
}
}
@@ -2443,7 +2441,6 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu
BezTriple *bezt;
Curve *cu;
int a;
- short sel;
if(obedit==NULL) return;
@@ -2451,7 +2448,6 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu
cu->lastsel= NULL;
for(nu= editnurb->first; nu; nu= nu->next) {
- sel= 0;
if(nu->type == CU_BEZIER) {
a= nu->pntsu;
@@ -2464,6 +2460,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu
}
while(a--) {
+ short sel;
if(doswap) sel= swap_selection_beztriple(bezt);
else sel= select_beztriple(bezt, selstatus, 1, VISIBLE);
@@ -2483,6 +2480,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu
while(a--) {
if (bp->hide == 0) {
+ short sel;
if(doswap) sel= swap_selection_bpoint(bp);
else sel= select_bpoint(bp, selstatus, 1, VISIBLE);
@@ -5779,6 +5777,7 @@ static int delete_exec(bContext *C, wmOperator *op)
clamp_nurb_order_u(nu);
}*/
}
+ clamp_nurb_order_u(nu);
nurbs_knot_calc_u(nu);
}
nu= next;
@@ -5927,7 +5926,14 @@ static int delete_exec(bContext *C, wmOperator *op)
MEM_freeN(nu1->bp);
nu1->bp= bp;
nu1->pntsu= a;
+ nu1->knotsu= NULL;
nu->pntsu= cut+1;
+
+ clamp_nurb_order_u(nu);
+ nurbs_knot_calc_u(nu);
+
+ clamp_nurb_order_u(nu1);
+ nurbs_knot_calc_u(nu1);
}
}
}
@@ -6531,8 +6537,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
return nu;
}
-static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) {
-
+static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
+{
Object *obedit= CTX_data_edit_object(C);
ListBase *editnurb;
Nurb *nu;
@@ -6601,11 +6607,13 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
return OPERATOR_FINISHED;
}
-static int curve_prim_add(bContext *C, wmOperator *op, int type) {
+static int curve_prim_add(bContext *C, wmOperator *op, int type)
+{
return curvesurf_prim_add(C, op, type, 0);
}
-static int surf_prim_add(bContext *C, wmOperator *op, int type) {
+static int surf_prim_add(bContext *C, wmOperator *op, int type)
+{
return curvesurf_prim_add(C, op, type, 1);
}
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index fcac070f84e..d8257c524c1 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -259,6 +259,7 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c)
static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int recalc, int mode)
{
+ struct Main *bmain= CTX_data_main(C);
Curve *cu= obedit->data;
EditFont *ef= cu->editfont;
cu->curinfo = ef->textbufinfo[cu->pos?cu->pos-1:0];
@@ -269,7 +270,7 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re
if(mode == FO_EDIT)
update_string(cu);
- BKE_text_to_curve(scene, obedit, mode);
+ BKE_text_to_curve(bmain, scene, obedit, mode);
if(recalc)
DAG_id_tag_update(obedit->data, 0);
@@ -928,9 +929,10 @@ static int move_cursor(bContext *C, int type, int select)
if(select == 0) {
if(cu->selstart) {
+ struct Main *bmain= CTX_data_main(C);
cu->selstart = cu->selend = 0;
update_string(cu);
- BKE_text_to_curve(scene, obedit, FO_SELCHANGE);
+ BKE_text_to_curve(bmain, scene, obedit, FO_SELCHANGE);
}
}
@@ -1644,13 +1646,14 @@ static int open_cancel(bContext *UNUSED(C), wmOperator *op)
static int open_exec(bContext *C, wmOperator *op)
{
+ struct Main *bmain= CTX_data_main(C);
VFont *font;
PropertyPointerRNA *pprop;
PointerRNA idptr;
char filepath[FILE_MAX];
RNA_string_get(op->ptr, "filepath", filepath);
- font= load_vfont(filepath);
+ font= load_vfont(bmain, filepath);
if(!font) {
if(op->customdata) MEM_freeN(op->customdata);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 842ab92ae31..1bab362fe55 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1478,7 +1478,7 @@ static void gpencil_draw_apply (wmOperator *op, tGPsdata *p)
/* start a new stroke, starting from previous point */
gp_stroke_addpoint(p, p->mvalo, p->opressure);
- ok= gp_stroke_addpoint(p, p->mval, p->pressure);
+ gp_stroke_addpoint(p, p->mval, p->pressure);
}
else if (ok == GP_STROKEADD_INVALID) {
/* the painting operation cannot continue... */
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index b730913a368..3c810f7da2d 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -426,7 +426,7 @@ void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting,
/* Flush visibility (for Graph Editor) changes up/down hierarchy for changes in the given setting
* - anim_data: list of the all the anim channels that can be chosen
* -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too,
- * then the channels under closed expanders get ignored...
+ * then the channels under closed expanders get ignored...
* - ale_setting: the anim channel (not in the anim_data list directly, though occuring there)
* with the new state of the setting that we want flushed up/down the hierarchy
* - setting: type of setting to set
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index cda3c4f3e71..8dd543d8f63 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -313,6 +313,11 @@ typedef enum eAnimFilterFlags {
ANIMFILTER_KEYS_NOSKEY = (1<<10), /* don't include shape keys (for geometry) */
} eAnimFilterFlags;
+/* utility funcs for auto keyframe */
+int ED_autokeyframe_object(struct bContext *C, struct Scene *scene, struct Object *ob, struct KeyingSet *ks);
+int ED_autokeyframe_pchan(struct bContext *C, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, struct KeyingSet *ks);
+
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index b6c0db40f2d..0fbbb3b268e 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -34,6 +34,7 @@
#ifndef UI_INTERFACE_H
#define UI_INTERFACE_H
+#include "BLO_sys_types.h" /* size_t */
#include "RNA_types.h"
#include "DNA_userdef_types.h"
@@ -581,7 +582,7 @@ void uiButSetFocusOnEnter (struct wmWindow *win, uiBut *but);
typedef struct AutoComplete AutoComplete;
-AutoComplete *autocomplete_begin(const char *startname, int maxlen);
+AutoComplete *autocomplete_begin(const char *startname, size_t maxlen);
void autocomplete_do_name(AutoComplete *autocpl, const char *name);
void autocomplete_end(AutoComplete *autocpl, char *autoname);
@@ -616,6 +617,7 @@ void UI_remove_popup_handlers(struct ListBase *handlers, uiPopupBlockHandle *pop
void UI_init(void);
void UI_init_userdef(void);
+void UI_reinit_font(void);
void UI_exit(void);
/* Layout
@@ -753,6 +755,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C);
void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C);
void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);
void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
+void uiTemplateKeymapItemProperties(uiLayout *layout, struct PointerRNA *ptr);
void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, int rows, int maxrows, int type);
void uiTemplateNodeLink(uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input);
@@ -795,6 +798,7 @@ void UI_buttons_operatortypes(void);
/* Helpers for Operators */
void uiContextActiveProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index);
+void uiContextActivePropertyHandle(struct bContext *C);
void uiContextAnimUpdate(const struct bContext *C);
void uiFileBrowseContextProperty(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop);
void uiIDContextProperty(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop);
diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index b6837a4b3c9..54400accbc2 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -50,8 +50,8 @@ typedef struct IconFile {
#define ICON_DEFAULT_HEIGHT 16
#define ICON_DEFAULT_WIDTH 16
-#define ICON_DEFAULT_HEIGHT_SCALE (UI_UNIT_Y * 0.8f)
-#define ICON_DEFAULT_WIDTH_SCALE (UI_UNIT_X * 0.8f)
+#define ICON_DEFAULT_HEIGHT_SCALE ((int)(UI_UNIT_Y * 0.8f))
+#define ICON_DEFAULT_WIDTH_SCALE ((int)(UI_UNIT_X * 0.8f))
#define PREVIEW_DEFAULT_HEIGHT 96
diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt
index 43d15339275..265238c67b4 100644
--- a/source/blender/editors/interface/CMakeLists.txt
+++ b/source/blender/editors/interface/CMakeLists.txt
@@ -61,7 +61,7 @@ set(SRC
)
if(WITH_INTERNATIONAL)
- add_definitions(-DINTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_HEADLESS)
diff --git a/source/blender/editors/interface/SConscript b/source/blender/editors/interface/SConscript
index 5998d4d2953..ec5ae99755d 100644
--- a/source/blender/editors/interface/SConscript
+++ b/source/blender/editors/interface/SConscript
@@ -14,7 +14,7 @@ incs += ' ../../python/' # python button eval
defs = []
if env['WITH_BF_INTERNATIONAL']:
- defs.append('INTERNATIONAL')
+ defs.append('WITH_INTERNATIONAL')
if env['WITH_BF_PYTHON']:
defs.append('WITH_PYTHON')
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 2ff77d255c6..a816c1612a1 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -96,7 +96,7 @@ static void ui_free_but(const bContext *C, uiBut *but);
int UI_translate_iface(void)
{
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE);
#else
return 0;
@@ -105,7 +105,7 @@ int UI_translate_iface(void)
int UI_translate_tooltips(void)
{
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS);
#else
return 0;
@@ -114,7 +114,7 @@ int UI_translate_tooltips(void)
const char *UI_translate_do_iface(const char *msgid)
{
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
if(UI_translate_iface())
return BLF_gettext(msgid);
else
@@ -126,7 +126,7 @@ const char *UI_translate_do_iface(const char *msgid)
const char *UI_translate_do_tooltip(const char *msgid)
{
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
if(UI_translate_tooltips())
return BLF_gettext(msgid);
else
@@ -678,6 +678,11 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
SWAP(void *, oldbut->func_argN, but->func_argN)
}
+ /* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
+ when scrolling without moving mouse (see [#28432]) */
+ if(ELEM(oldbut->type, ROW, LISTROW))
+ oldbut->hardmax= but->hardmax;
+
ui_but_update_linklines(block, oldbut, but);
BLI_remlink(&block->buttons, but);
@@ -746,7 +751,7 @@ static int ui_but_is_rna_undo(uiBut *but)
* unforseen conciquences, so best check for ID's we _know_ are not
* handled by undo - campbell */
ID *id= but->rnapoin.id.data;
- if(ELEM(GS(id->name), ID_SCR, ID_WM)) {
+ if(ID_CHECK_UNDO(id) == FALSE) {
return FALSE;
}
else {
@@ -1528,7 +1533,7 @@ static double ui_get_but_scale_unit(uiBut *but, double value)
}
/* str will be overwritten */
-void ui_convert_to_unit_alt_name(uiBut *but, char *str, int maxlen)
+void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen)
{
if(ui_is_but_unit(but)) {
UnitSettings *unit= but->block->unit;
@@ -1576,7 +1581,7 @@ static float ui_get_but_step_unit(uiBut *but, float step_default)
}
-void ui_get_but_string(uiBut *but, char *str, int maxlen)
+void ui_get_but_string(uiBut *but, char *str, size_t maxlen)
{
if(but->rnaprop && ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) {
PropertyType type;
@@ -1935,6 +1940,9 @@ void uiFreeBlock(const bContext *C, uiBlock *block)
ui_free_but(C, but);
}
+ if(block->unit)
+ MEM_freeN(block->unit);
+
if(block->func_argN)
MEM_freeN(block->func_argN);
@@ -2010,10 +2018,15 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
block->active= 1;
block->dt= dt;
block->evil_C= (void*)C; // XXX
+
if (scn) {
block->color_profile= (scn->r.color_mgt_flag & R_COLOR_MANAGEMENT);
- block->unit= &scn->unit;
+
+ /* copy to avoid crash when scene gets deleted with ui still open */
+ block->unit= MEM_mallocN(sizeof(scn->unit), "UI UnitSettings");
+ memcpy(block->unit, &scn->unit, sizeof(scn->unit));
}
+
BLI_strncpy(block->name, name, sizeof(block->name));
if(region)
@@ -2036,7 +2049,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor
wm_subwindow_getsize(window, window->screen->mainwin, &getsizex, &getsizey);
block->aspect= 2.0/fabs(getsizex*block->winmat[0][0]);
- block->auto_open= 2;
+ block->auto_open= TRUE;
block->flag |= UI_BLOCK_LOOP; /* tag as menu */
}
@@ -2135,8 +2148,8 @@ void ui_check_but(uiBut *but)
UI_GET_BUT_VALUE_INIT(but, value)
if(ui_is_but_float(but)) {
- if(value == (double) FLT_MAX) sprintf(but->drawstr, "%sinf", but->str);
- else if(value == (double) -FLT_MAX) sprintf(but->drawstr, "%s-inf", but->str);
+ if(value == (double) FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str);
+ else if(value == (double) -FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s-inf", but->str);
/* support length type buttons */
else if(ui_is_but_unit(but)) {
char new_str[sizeof(but->drawstr)];
@@ -2149,7 +2162,7 @@ void ui_check_but(uiBut *but)
}
}
else {
- sprintf(but->drawstr, "%s%d", but->str, (int)value);
+ BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%d", but->str, (int)value);
}
if(but->rnaprop) {
@@ -2168,7 +2181,7 @@ void ui_check_but(uiBut *but)
BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value);
}
else {
- strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
}
break;
@@ -2186,7 +2199,7 @@ void ui_check_but(uiBut *but)
break;
case KEYEVT:
- strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
if (but->flag & UI_SELECT) {
strcat(but->drawstr, "Press a key");
}
@@ -2218,15 +2231,15 @@ void ui_check_but(uiBut *but)
strcat(but->drawstr, "Press a key ");
}
else
- strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
break;
case BUT_TOGDUAL:
/* trying to get the dual-icon to left of text... not very nice */
if(but->str[0]) {
- strncpy(but->drawstr, " ", UI_MAX_DRAW_STR);
- strncpy(but->drawstr+2, but->str, UI_MAX_DRAW_STR-2);
+ BLI_strncpy(but->drawstr, " ", UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr+2, but->str, UI_MAX_DRAW_STR-2);
}
break;
@@ -2234,13 +2247,13 @@ void ui_check_but(uiBut *but)
case HSVCIRCLE:
break;
default:
- strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
}
/* if we are doing text editing, this will override the drawstr */
if(but->editstr)
- strncpy(but->drawstr, but->editstr, UI_MAX_DRAW_STR);
+ BLI_strncpy(but->drawstr, but->editstr, UI_MAX_DRAW_STR);
/* text clipping moved to widget drawing code itself */
}
@@ -2278,7 +2291,7 @@ int ui_but_can_align(uiBut *but)
return !ELEM3(but->type, LABEL, OPTION, OPTIONN);
}
-static void ui_block_do_align_but(uiBut *first, int nr)
+static void ui_block_do_align_but(uiBut *first, short nr)
{
uiBut *prev, *but=NULL, *next;
int flag= 0, cols=0, rows=0;
@@ -2415,7 +2428,7 @@ static void ui_block_do_align_but(uiBut *first, int nr)
void ui_block_do_align(uiBlock *block)
{
uiBut *but;
- int nr;
+ short nr;
/* align buttons with same align nr */
for(but=block->buttons.first; but;) {
@@ -2459,7 +2472,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
but->pointype= type & BUTPOIN;
but->bit= type & BIT;
but->bitnr= type & 31;
- but->icon = 0;
+ but->icon = ICON_NONE;
but->iconadd=0;
but->retval= retval;
@@ -2506,7 +2519,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
but->pos= -1; /* cursor invisible */
if(ELEM4(but->type, NUM, NUMABS, NUMSLI, HSVSLI)) { /* add a space to name */
- slen= strlen(but->str);
+ /* slen remains unchanged from previous assignment, ensure this stays true */
if(slen>0 && slen<UI_MAX_NAME_STR-2) {
if(but->str[slen-1]!=' ') {
but->str[slen]= ' ';
@@ -2733,7 +2746,7 @@ static uiBut *ui_def_but_operator(uiBlock *block, int type, const char *opname,
if ((!tip || tip[0]=='\0') && ot && ot->description) {
tip= ot->description;
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
if(UI_translate_tooltips())
tip= BLF_gettext(tip);
#endif
@@ -2796,7 +2809,8 @@ uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, int x1, i
* otherwise return -1.
* (1<<findBitIndex(x))==x for powers of two.
*/
-static int findBitIndex(unsigned int x) {
+static int findBitIndex(unsigned int x)
+{
if (!x || (x&(x-1))!=0) { /* x&(x-1) strips lowest bit */
return -1;
} else {
@@ -2814,12 +2828,12 @@ static int findBitIndex(unsigned int x) {
/* autocomplete helper functions */
struct AutoComplete {
- int maxlen;
+ size_t maxlen;
char *truncate;
const char *startname;
};
-AutoComplete *autocomplete_begin(const char *startname, int maxlen)
+AutoComplete *autocomplete_begin(const char *startname, size_t maxlen)
{
AutoComplete *autocpl;
@@ -3552,6 +3566,11 @@ void UI_init_userdef(void)
uiStyleInit();
}
+void UI_reinit_font()
+{
+ uiStyleInit();
+}
+
void UI_exit(void)
{
ui_resources_free();
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 1113f90a652..c35996701ee 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -83,7 +83,7 @@ void ui_but_anim_flag(uiBut *but, float cfra)
}
}
-int ui_but_anim_expression_get(uiBut *but, char *str, int maxlen)
+int ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen)
{
FCurve *fcu;
ChannelDriver *driver;
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index a1275e237c1..a40900fb39b 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -39,6 +39,7 @@
#include "BLI_math.h"
#include "BLI_rect.h"
+#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_colortools.h"
@@ -465,6 +466,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
{
#ifdef WITH_HEADLESS
(void)rect;
+ (void)but;
#else
ImBuf *ibuf= (ImBuf *)but->poin;
//GLint scissor[4];
@@ -500,7 +502,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(w
}
#if 0
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
static void ui_draw_but_CHARTAB(uiBut *but)
{
/* XXX 2.50 bad global access */
@@ -670,7 +672,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
}
}
-#endif // INTERNATIONAL
+#endif // WITH_INTERNATIONAL
#endif
static void draw_scope_end(rctf *rect, GLint *scissor)
@@ -835,7 +837,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
/* draw grid lines here */
for (i=0; i<6; i++) {
char str[4];
- sprintf(str,"%-3d",i*20);
+ BLI_snprintf(str, sizeof(str), "%-3d",i*20);
str[3]='\0';
fdrawline(rect.xmin+22, yofs+(i/5.f)*h, rect.xmax+1, yofs+(i/5.f)*h);
BLF_draw_default(rect.xmin+1, yofs-5+(i/5.f)*h, 0, str, sizeof(str)-1);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 125928c136b..9af9b2f55ad 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -631,7 +631,7 @@ static void ui_apply_but_IDPOIN(bContext *C, uiBut *but, uiHandleButtonData *dat
data->applied= 1;
}
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *data)
{
ui_apply_but_func(C, but);
@@ -1023,7 +1023,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
case IDPOIN:
ui_apply_but_IDPOIN(C, but, data);
break;
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
case CHARTAB:
ui_apply_but_CHARTAB(C, but, data);
break;
@@ -1113,9 +1113,9 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
if(but->poin==NULL && but->rnapoin.data==NULL);
else if(mode=='c') {
if(ui_is_but_float(but))
- sprintf(buf, "%f", ui_get_but_val(but));
+ BLI_snprintf(buf, sizeof(buf), "%f", ui_get_but_val(but));
else
- sprintf(buf, "%d", (int)ui_get_but_val(but));
+ BLI_snprintf(buf, sizeof(buf), "%d", (int)ui_get_but_val(but));
WM_clipboard_text_set(buf, 0);
}
@@ -1136,7 +1136,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
else if(mode=='c') {
ui_get_but_vectorf(but, rgb);
- sprintf(buf, "[%f, %f, %f]", rgb[0], rgb[1], rgb[2]);
+ BLI_snprintf(buf, sizeof(buf), "[%f, %f, %f]", rgb[0], rgb[1], rgb[2]);
WM_clipboard_text_set(buf, 0);
}
@@ -1307,12 +1307,12 @@ static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, sho
}
/* mouse inside the widget */
else if (x >= startx) {
- float aspect= (but->block->aspect);
+ const float aspect_sqrt= sqrtf(but->block->aspect);
but->pos= strlen(origstr)-but->ofs;
/* XXX does not take zoom level into account */
- while (startx + aspect*BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) {
+ while (startx + aspect_sqrt * BLF_width(fstyle->uifont_id, origstr+but->ofs) > x) {
if (but->pos <= 0) break;
but->pos--;
origstr[but->pos+but->ofs] = 0;
@@ -1368,144 +1368,125 @@ static int ui_textedit_type_ascii(uiBut *but, uiHandleButtonData *data, char asc
return changed;
}
-static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump)
+static void ui_textedit_move(uiBut *but, uiHandleButtonData *data, int direction, int select, int jump, int jump_all)
{
- char *str;
- int len;
-
- str= data->str;
- len= strlen(str);
+ const char *str= data->str;
+ const int len= strlen(str);
+ const int pos_prev= but->pos;
+ const int has_sel= (but->selend - but->selsta) > 0;
- if(direction) { /* right*/
- /* if there's a selection */
- if ((but->selend - but->selsta) > 0) {
- /* extend the selection based on the first direction taken */
- if(select) {
- if (!data->selextend) {
- data->selextend = EXTEND_RIGHT;
- }
- if (data->selextend == EXTEND_RIGHT) {
- but->selend++;
- if (but->selend > len) but->selend = len;
- } else if (data->selextend == EXTEND_LEFT) {
- but->selsta++;
- /* if the selection start has gone past the end,
- * flip them so they're in sync again */
- if (but->selsta == but->selend) {
- but->pos = but->selsta;
- data->selextend = EXTEND_RIGHT;
- }
- }
- } else {
+ /* special case, quit selection and set cursor */
+ if (has_sel && !select) {
+ if (jump_all) {
+ but->selsta = but->selend= but->pos = direction ? len : 0;
+ }
+ else {
+ if (direction) {
but->selsta = but->pos = but->selend;
- data->selextend = 0;
}
- } else {
- if(select) {
- /* make a selection, starting from the cursor position */
- int tlen;
- but->selsta = but->pos;
-
- but->pos++;
- if(but->pos > (tlen= strlen(str))) but->pos= tlen;
-
- but->selend = but->pos;
- } else if(jump) {
- /* jump betweenn special characters (/,\,_,-, etc.),
+ else {
+ but->pos = but->selend = but->selsta;
+ }
+ }
+ data->selextend = 0;
+ }
+ else {
+ if(direction) { /* right*/
+ if(jump) {
+ /* jump between special characters (/,\,_,-, etc.),
* look at function test_special_char() for complete
* list of special character, ctr -> */
while(but->pos < len) {
but->pos++;
- if(test_special_char(str[but->pos])) break;
+ if(!jump_all && test_special_char(str[but->pos])) break;
}
- } else {
- int tlen;
+ }
+ else {
but->pos++;
- if(but->pos > (tlen= strlen(str))) but->pos= tlen;
+ if(but->pos > len) but->pos= len;
}
}
- }
- else { /* left */
- /* if there's a selection */
- if ((but->selend - but->selsta) > 0) {
- /* extend the selection based on the first direction taken */
- if(select) {
- if (!data->selextend) {
- data->selextend = EXTEND_LEFT;
- }
- if (data->selextend == EXTEND_LEFT) {
- but->selsta--;
- if (but->selsta < 0) but->selsta = 0;
- } else if (data->selextend == EXTEND_RIGHT) {
- but->selend--;
- /* if the selection start has gone past the end,
- * flip them so they're in sync again */
- if (but->selsta == but->selend) {
- but->pos = but->selsta;
- data->selextend = EXTEND_LEFT;
- }
+ else { /* left */
+ if(jump) {
+
+ /* left only: compensate for index/change in direction */
+ if(but->pos > 0) {
+ but->pos--;
}
- } else {
- but->pos = but->selend = but->selsta;
- data->selextend = 0;
- }
- } else {
- if(select) {
- /* make a selection, starting from the cursor position */
- but->selend = but->pos;
-
- but->pos--;
- if(but->pos<0) but->pos= 0;
-
- but->selsta = but->pos;
- } else if(jump) {
- /* jump betweenn special characters (/,\,_,-, etc.),
+
+ /* jump between special characters (/,\,_,-, etc.),
* look at function test_special_char() for complete
* list of special character, ctr -> */
while(but->pos > 0){
but->pos--;
- if(test_special_char(str[but->pos])) break;
+ if(!jump_all && test_special_char(str[but->pos])) break;
+ }
+
+ /* left only: compensate for index/change in direction */
+ if((but->pos != 0) && ABS(pos_prev - but->pos) > 1) {
+ but->pos++;
}
- } else {
+
+ }
+ else {
if(but->pos>0) but->pos--;
}
}
- }
-}
-static void ui_textedit_move_end(uiBut *but, uiHandleButtonData *data, int direction, int select)
-{
- char *str;
-
- str= data->str;
- if(direction) { /* right */
- if(select) {
- but->selsta = but->pos;
- but->selend = strlen(str);
- data->selextend = EXTEND_RIGHT;
- } else {
- but->selsta = but->selend = but->pos= strlen(str);
- }
- }
- else { /* left */
if(select) {
- but->selend = but->pos;
- but->selsta = 0;
- data->selextend = EXTEND_LEFT;
- } else {
- but->selsta = but->selend = but->pos= 0;
+ /* existing selection */
+ if (has_sel) {
+
+ if(data->selextend == 0) {
+ data->selextend= EXTEND_RIGHT;
+ }
+
+ if (direction) {
+ if (data->selextend == EXTEND_RIGHT) {
+ but->selend= but->pos;
+ }
+ else {
+ but->selsta= but->pos;
+ }
+ }
+ else {
+ if (data->selextend == EXTEND_LEFT) {
+ but->selsta= but->pos;
+ }
+ else {
+ but->selend= but->pos;
+ }
+ }
+
+ if (but->selend < but->selsta) {
+ SWAP(short, but->selsta, but->selend);
+ data->selextend= (data->selextend == EXTEND_RIGHT) ? EXTEND_LEFT : EXTEND_RIGHT;
+ }
+
+ } /* new selection */
+ else {
+ if (direction) {
+ data->selextend= EXTEND_RIGHT;
+ but->selend= but->pos;
+ but->selsta= pos_prev;
+ }
+ else {
+ data->selextend= EXTEND_LEFT;
+ but->selend= pos_prev;
+ but->selsta= but->pos;
+ }
+ }
}
}
}
-static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, int all)
+static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int direction, const int all, const int jump)
{
- char *str;
- int len, x, changed= 0;
+ char *str= data->str;
+ const int len= strlen(str);
- str= data->str;
- len= strlen(str);
+ int x, changed= 0;
if(all) {
if(len) changed=1;
@@ -1517,9 +1498,24 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
changed= ui_textedit_delete_selection(but, data);
}
else if(but->pos>=0 && but->pos<len) {
+ int step;
+
+ if (jump) {
+ x = but->pos;
+ step= 0;
+ while(x < len) {
+ x++;
+ step++;
+ if(test_special_char(str[x])) break;
+ }
+ }
+ else {
+ step= 1;
+ }
+
for(x=but->pos; x<len; x++)
- str[x]= str[x+1];
- str[len-1]='\0';
+ str[x]= str[x+step];
+ str[len-step]='\0';
changed= 1;
}
}
@@ -1529,11 +1525,26 @@ static int ui_textedit_delete(uiBut *but, uiHandleButtonData *data, int directio
changed= ui_textedit_delete_selection(but, data);
}
else if(but->pos>0) {
+ int step;
+
+ if (jump) {
+ x = but->pos;
+ step= 0;
+ while(x > 0) {
+ x--;
+ step++;
+ if((step > 1) && test_special_char(str[x])) break;
+ }
+ }
+ else {
+ step= 1;
+ }
+
for(x=but->pos; x<len; x++)
- str[x-1]= str[x];
- str[len-1]='\0';
+ str[x-step]= str[x];
+ str[len-step]='\0';
- but->pos--;
+ but->pos -= step;
changed= 1;
}
}
@@ -1684,7 +1695,7 @@ static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data)
/* not a file?, strip non utf-8 chars */
if(strip) {
/* wont happen often so isnt that annoying to keep it here for a while */
- printf("invalid utf8 - stripped chars %d\n", strip);
+ printf("%s: invalid utf8 - stripped chars %d\n", __func__, strip);
}
}
@@ -1831,11 +1842,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
break;
case RIGHTARROWKEY:
- ui_textedit_move(but, data, 1, event->shift, event->ctrl);
+ ui_textedit_move(but, data, 1, event->shift, event->ctrl, FALSE);
retval= WM_UI_HANDLER_BREAK;
break;
case LEFTARROWKEY:
- ui_textedit_move(but, data, 0, event->shift, event->ctrl);
+ ui_textedit_move(but, data, 0, event->shift, event->ctrl, FALSE);
retval= WM_UI_HANDLER_BREAK;
break;
case DOWNARROWKEY:
@@ -1845,7 +1856,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case ENDKEY:
- ui_textedit_move_end(but, data, 1, event->shift);
+ ui_textedit_move(but, data, 1, event->shift, TRUE, TRUE);
retval= WM_UI_HANDLER_BREAK;
break;
case UPARROWKEY:
@@ -1855,7 +1866,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
}
/* pass on purposedly */
case HOMEKEY:
- ui_textedit_move_end(but, data, 0, event->shift);
+ ui_textedit_move(but, data, 0, event->shift, TRUE, TRUE);
retval= WM_UI_HANDLER_BREAK;
break;
case PADENTER:
@@ -1864,12 +1875,12 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
retval= WM_UI_HANDLER_BREAK;
break;
case DELKEY:
- changed= ui_textedit_delete(but, data, 1, 0);
+ changed= ui_textedit_delete(but, data, 1, 0, event->ctrl);
retval= WM_UI_HANDLER_BREAK;
break;
case BACKSPACEKEY:
- changed= ui_textedit_delete(but, data, 0, event->shift);
+ changed= ui_textedit_delete(but, data, 0, event->shift, event->ctrl);
retval= WM_UI_HANDLER_BREAK;
break;
@@ -3924,7 +3935,7 @@ static int ui_do_but_VECTORSCOPE(bContext *C, uiBlock *block, uiBut *but, uiHand
return WM_UI_HANDLER_CONTINUE;
}
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
static int ui_do_but_CHARTAB(bContext *UNUSED(C), uiBlock *UNUSED(block), uiBut *UNUSED(but), uiHandleButtonData *UNUSED(data), wmEvent *UNUSED(event))
{
/* XXX 2.50 bad global and state access */
@@ -4367,7 +4378,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
PointerRNA ptr_props;
if(but->rnapoin.data && but->rnaprop) {
- sprintf(buf, "%s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
+ BLI_snprintf(buf, sizeof(buf), "%s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
WM_operator_properties_create(&ptr_props, "WM_OT_doc_view");
RNA_string_set(&ptr_props, "doc_id", buf);
@@ -4418,7 +4429,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
/* check prevval because of modal operators [#24016],
* modifier check is to allow Ctrl+C for copy.
* if this causes other problems, remove this check and suffer the bug :) - campbell */
- (event->prevval != KM_PRESS || ISKEYMODIFIER(event->prevtype))
+ ((event->prevval != KM_PRESS) || (ISKEYMODIFIER(event->prevtype)) || (event->type == EVT_DROP))
) {
/* handle copy-paste */
if(ELEM(event->type, CKEY, VKEY) && event->val==KM_PRESS && (event->ctrl || event->oskey)) {
@@ -4584,7 +4595,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
case HSVCIRCLE:
retval= ui_do_but_HSVCIRCLE(C, block, but, data, event);
break;
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
case CHARTAB:
retval= ui_do_but_CHARTAB(C, block, but, data, event);
break;
@@ -4681,7 +4692,7 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y)
/* check if the mouse is in the region */
if(!BLI_in_rcti(&ar->winrct, x, y)) {
for(block=ar->uiblocks.first; block; block=block->next)
- block->auto_open= 0;
+ block->auto_open= FALSE;
return 0;
}
@@ -4868,8 +4879,8 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
if(data->used_mouse && !data->autoopentimer) {
int time;
- if(but->block->auto_open==2) time= 1; // test for toolbox
- else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open) time= 5*U.menuthreshold2;
+ if(but->block->auto_open==TRUE) time= 1; // test for toolbox
+ else if((but->block->flag & UI_BLOCK_LOOP && but->type != BLOCK) || but->block->auto_open==TRUE) time= 5*U.menuthreshold2;
else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1;
else time= -1;
@@ -4967,9 +4978,9 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA
/* we disable auto_open in the block after a threshold, because we still
* want to allow auto opening adjacent menus even if no button is activated
* in between going over to the other button, but only for a short while */
- if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open)
+ if(type == BUTTON_ACTIVATE_OVER && but->block->auto_open==TRUE)
if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer())
- but->block->auto_open= 0;
+ but->block->auto_open= FALSE;
if(type == BUTTON_ACTIVATE_OVER) {
data->used_mouse= 1;
@@ -5089,19 +5100,16 @@ void ui_button_active_free(const bContext *C, uiBut *but)
}
}
-/* helper function for insert keyframe, reset to default, etc operators */
-void uiContextActiveProperty(const bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index)
+static uiBut *ui_context_rna_button_active(const bContext *C)
{
- ARegion *ar= CTX_wm_region(C);
+ uiBut *rnabut= NULL;
- memset(ptr, 0, sizeof(*ptr));
- *prop= NULL;
- *index= 0;
+ ARegion *ar= CTX_wm_region(C);
while(ar) {
uiBlock *block;
uiBut *but, *activebut= NULL;
-
+
/* find active button */
for(block=ar->uiblocks.first; block; block=block->next) {
for(but=block->buttons.first; but; but= but->next) {
@@ -5115,22 +5123,53 @@ void uiContextActiveProperty(const bContext *C, struct PointerRNA *ptr, struct P
if(activebut && activebut->rnapoin.data) {
uiHandleButtonData *data= activebut->active;
- /* found RNA button */
- *ptr= activebut->rnapoin;
- *prop= activebut->rnaprop;
- *index= activebut->rnaindex;
+ rnabut= activebut;
/* recurse into opened menu, like colorpicker case */
if(data && data->menu && (ar != data->menu->region)) {
ar = data->menu->region;
}
else {
- return;
+ return rnabut;
}
}
else {
/* no active button */
- return;
+ return rnabut;
+ }
+ }
+
+ return rnabut;
+}
+
+/* helper function for insert keyframe, reset to default, etc operators */
+void uiContextActiveProperty(const bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index)
+{
+ uiBut *activebut= ui_context_rna_button_active(C);
+
+ memset(ptr, 0, sizeof(*ptr));
+
+ if(activebut && activebut->rnapoin.data) {
+ *ptr= activebut->rnapoin;
+ *prop= activebut->rnaprop;
+ *index= activebut->rnaindex;
+ }
+ else {
+ *prop= NULL;
+ *index= 0;
+ }
+}
+
+void uiContextActivePropertyHandle(bContext *C)
+{
+ uiBut *activebut= ui_context_rna_button_active(C);
+ if(activebut) {
+ /* TODO, look into a better way to handle the button change
+ * currently this is mainly so reset defaults works for the
+ * operator redo panel - campbell */
+ uiBlock *block= activebut->block;
+ if (block->handle_func) {
+ block->handle_func(C, block->handle_func_arg, 0);
}
}
}
@@ -5914,7 +5953,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
ui_handle_button_activate(C, ar, but, BUTTON_ACTIVATE);
}
else {
- printf("Error, but->menu_key type: %d\n", but->type);
+ printf("%s: error, but->menu_key type: %d\n", __func__, but->type);
}
break;
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 8c8c6ab20a8..f0700c0d79f 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -752,7 +752,7 @@ int UI_icon_get_width(int icon_id)
if (icon==NULL) {
if (G.f & G_DEBUG)
- printf("UI_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id);
+ printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
return 0;
}
@@ -777,7 +777,7 @@ int UI_icon_get_height(int icon_id)
if (icon==NULL) {
if (G.f & G_DEBUG)
- printf("UI_icon_get_height: Internal error, no icon for icon ID: %d\n", icon_id);
+ printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
return 0;
}
@@ -825,7 +825,7 @@ static void icon_create_rect(struct PreviewImage* prv_img, enum eIconSizes size)
if (!prv_img) {
if (G.f & G_DEBUG)
- printf("Error: requested preview image does not exist");
+ printf("%s, error: requested preview image does not exist", __func__);
}
if (!prv_img->rect[size]) {
prv_img->w[size] = render_size;
@@ -842,7 +842,7 @@ static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, enum eIco
{
if (!prv_img) {
if (G.f & G_DEBUG)
- printf("No preview image for this ID: %s\n", id->name);
+ printf("%s: no preview image for this ID: %s\n", __func__, id->name);
return;
}
@@ -858,7 +858,7 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect),
/* sanity check */
if(w<=0 || h<=0 || w>2000 || h>2000) {
- printf("icon_draw_rect: icons are %i x %i pixels?\n", w, h);
+ printf("%s: icons are %i x %i pixels?\n", __func__, w, h);
BLI_assert(!"invalid icon size");
return;
}
@@ -948,12 +948,12 @@ static int get_draw_size(enum eIconSizes size)
return 0;
}
-static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, enum eIconSizes size, int draw_size, int UNUSED(nocreate), int is_preview)
+static void icon_draw_size(float x, float y, int icon_id, float aspect, float alpha, float *rgb, enum eIconSizes size, int draw_size, int UNUSED(nocreate), short is_preview)
{
Icon *icon = NULL;
DrawInfo *di = NULL;
IconImage *iimg;
- float fdraw_size= UI_DPI_ICON_FAC*draw_size;
+ float fdraw_size= is_preview ? draw_size : (draw_size * UI_DPI_ICON_FAC);
int w, h;
icon = BKE_icon_get(icon_id);
@@ -961,7 +961,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
if (icon==NULL) {
if (G.f & G_DEBUG)
- printf("icon_draw_mipmap: Internal error, no icon for icon ID: %d\n", icon_id);
+ printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
return;
}
@@ -1019,9 +1019,9 @@ static void ui_id_icon_render(bContext *C, ID *id, int big)
{
/* create the rect if necessary */
- icon_set_image(C, id, pi, 0); /* icon size */
+ icon_set_image(C, id, pi, ICON_SIZE_ICON); /* icon size */
if (big)
- icon_set_image(C, id, pi, 1); /* bigger preview size */
+ icon_set_image(C, id, pi, ICON_SIZE_PREVIEW); /* bigger preview size */
pi->changed[0] = 0;
}
@@ -1031,7 +1031,7 @@ static void ui_id_icon_render(bContext *C, ID *id, int big)
static void ui_id_brush_render(bContext *C, ID *id)
{
PreviewImage *pi = BKE_previewimg_get(id);
- int i;
+ enum eIconSizes i;
if(!pi)
return;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index c53c44acd9f..2127685d74c 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -137,19 +137,10 @@ typedef enum {
/* for scope resize zone */
#define SCOPE_RESIZE_PAD 9
-typedef struct {
- short xim, yim;
- unsigned int *rect;
- short xofs, yofs;
-} uiIconImage;
-
-
typedef struct uiLinkLine { /* only for draw/edit */
struct uiLinkLine *next, *prev;
-
+ struct uiBut *from, *to;
short flag, pad;
-
- struct uiBut *from, *to;
} uiLinkLine;
typedef struct {
@@ -165,10 +156,10 @@ typedef struct {
struct uiBut {
struct uiBut *next, *prev;
- short type, pointype, bit, bitnr, retval, strwidth, ofs, pos, selsta, selend;
- short alignnr;
int flag;
-
+ short type, pointype, bit, bitnr, retval, strwidth, ofs, pos, selsta, selend, alignnr;
+ short pad1;
+
char *str;
char strdata[UI_MAX_NAME_STR];
char drawstr[UI_MAX_DRAW_STR];
@@ -283,7 +274,7 @@ struct uiBlock {
float minx, miny, maxx, maxy;
float aspect;
- short alignnr;
+ int puphash; // popup menu hash for memory
uiButHandleFunc func;
void *func_arg1;
@@ -307,9 +298,12 @@ struct uiBlock {
void *drawextra_arg2;
int flag;
+ short alignnr;
+
char direction;
char dt; /* drawtype: UI_EMBOSS, UI_EMBOSSN ... etc, copied to buttons */
- short auto_open;
+ char auto_open;
+ char _pad[7];
double auto_open_last;
const char *lockstr;
@@ -327,15 +321,12 @@ struct uiBlock {
ListBase saferct; // uiSafetyRct list
uiPopupBlockHandle *handle; // handle
-
- int puphash; // popup menu hash for memory
void *evil_C; // XXX hack for dynamic operator enums
+ struct UnitSettings *unit; // unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time.
float _hsv[3]; // XXX, only access via ui_block_hsv_get()
char color_profile; // color profile for correcting linear colors for display
- struct UnitSettings *unit; // unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time.
-
};
typedef struct uiSafetyRct {
@@ -365,8 +356,8 @@ extern void ui_set_but_vectorf(uiBut *but, float *vec);
extern void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my);
-extern void ui_get_but_string(uiBut *but, char *str, int maxlen);
-extern void ui_convert_to_unit_alt_name(uiBut *but, char *str, int maxlen);
+extern void ui_get_but_string(uiBut *but, char *str, size_t maxlen);
+extern void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen);
extern int ui_set_but_string(struct bContext *C, uiBut *but, const char *str);
extern int ui_get_but_string_max_length(uiBut *but);
@@ -401,9 +392,9 @@ struct uiPopupBlockHandle {
/* for operator popups */
struct wmOperatorType *optype;
- int opcontext;
ScrArea *ctx_area;
ARegion *ctx_region;
+ int opcontext;
/* return values */
int butretval;
@@ -518,7 +509,7 @@ void ui_but_anim_copy_driver(struct bContext *C);
void ui_but_anim_paste_driver(struct bContext *C);
void ui_but_anim_add_keyingset(struct bContext *C);
void ui_but_anim_remove_keyingset(struct bContext *C);
-int ui_but_anim_expression_get(uiBut *but, char *str, int maxlen);
+int ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen);
int ui_but_anim_expression_set(uiBut *but, const char *str);
int ui_but_anim_expression_create(uiBut *but, const char *str);
void ui_but_anim_autokey(struct bContext *C, uiBut *but, struct Scene *scene, float cfra);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 3c02f7d4bd2..ba612fc8727 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -639,7 +639,7 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i
if(!name) {
name= ot->name;
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
name= UI_translate_do_iface(name);
#endif
}
@@ -768,7 +768,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
if(properties) {
PointerRNA tptr;
- WM_operator_properties_create(&tptr, opname);
+ WM_operator_properties_create_ptr(&tptr, ot);
if(tptr.data) {
IDP_FreeProperty(tptr.data);
MEM_freeN(tptr.data);
@@ -1219,7 +1219,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s
#if 0 /* this name is used for a string comparison and can't be modified, TODO */
name_uiprefix_id(name_ui, id);
#else
- strcpy(name_ui, id->name+2);
+ BLI_strncpy(name_ui, id->name+2, sizeof(name_ui));
#endif
name= BLI_strdup(name_ui);
iconid= ui_id_icon_get((bContext*)C, id, 1);
@@ -1432,7 +1432,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const
if(!name) {
name= mt->label;
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
name= UI_translate_do_iface(name);
#endif
}
@@ -2432,7 +2432,7 @@ static void ui_item_estimate(uiItem *item)
}
}
-static void ui_item_align(uiLayout *litem, int nr)
+static void ui_item_align(uiLayout *litem, short nr)
{
uiItem *item;
uiButtonItem *bitem;
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index fd9386dc5ab..081b528d153 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -295,10 +295,28 @@ static int reset_default_button_exec(bContext *C, wmOperator *op)
if(RNA_property_reset(&ptr, prop, (all)? -1: index)) {
/* perform updates required for this property */
RNA_property_update(C, &ptr, prop);
+
+ /* as if we pressed the button */
+ uiContextActivePropertyHandle(C);
+
success= 1;
}
}
-
+
+ /* Since we dont want to undo _all_ edits to settings, eg window
+ * edits on the screen or on operator settings.
+ * it might be better to move undo's inline - campbell */
+ if(success) {
+ ID *id= ptr.id.data;
+ if(id && ID_CHECK_UNDO(id)) {
+ /* do nothing, go ahead with undo */
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
+ }
+ /* end hack */
+
return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
}
@@ -314,7 +332,7 @@ static void UI_OT_reset_default_button(wmOperatorType *ot)
ot->exec= reset_default_button_exec;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag= OPTYPE_UNDO;
/* properties */
RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array");
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 9232fc94340..0823646ebc7 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -444,7 +444,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r
int pnl_icons;
const char *activename= panel->drawname[0]?panel->drawname:panel->panelname;
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
activename= UI_translate_do_iface(activename);
#endif
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 4221f7c30ff..622d50752fa 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -84,7 +84,7 @@ typedef struct MenuEntry {
} MenuEntry;
typedef struct MenuData {
- char *instr;
+ const char *instr;
const char *title;
int titleicon;
@@ -92,7 +92,7 @@ typedef struct MenuData {
int nitems, itemssize;
} MenuData;
-static MenuData *menudata_new(char *instr)
+static MenuData *menudata_new(const char *instr)
{
MenuData *md= MEM_mallocN(sizeof(*md), "MenuData");
@@ -137,7 +137,7 @@ static void menudata_add_item(MenuData *md, const char *str, int retval, int ico
static void menudata_free(MenuData *md)
{
- MEM_freeN(md->instr);
+ MEM_freeN((void *)md->instr);
if (md->items)
MEM_freeN(md->items);
MEM_freeN(md);
@@ -156,7 +156,7 @@ static void menudata_free(MenuData *md)
* @param str String to be parsed.
* @retval new menudata structure, free with menudata_free()
*/
-static MenuData *decompose_menu_string(char *str)
+static MenuData *decompose_menu_string(const char *str)
{
char *instr= BLI_strdup(str);
MenuData *md= menudata_new(instr);
@@ -174,7 +174,7 @@ static MenuData *decompose_menu_string(char *str)
*s= '\0';
s++;
} else if (s[1]=='t') {
- nitem_is_title= 1;
+ nitem_is_title= (s != instr); /* check for empty title */
*s= '\0';
s++;
@@ -213,11 +213,13 @@ static MenuData *decompose_menu_string(char *str)
nicon= 0;
}
- if (c=='\0')
+ if (c=='\0') {
break;
- } else if (!nitem)
+ }
+ } else if (!nitem) {
nitem= s;
-
+ }
+
s++;
}
@@ -230,9 +232,12 @@ void ui_set_name_menu(uiBut *but, int value)
int i;
md= decompose_menu_string(but->str);
- for (i=0; i<md->nitems; i++)
- if (md->items[i].retval==value)
- strcpy(but->drawstr, md->items[i].str);
+ for (i=0; i<md->nitems; i++) {
+ if (md->items[i].retval==value) {
+ BLI_strncpy(but->drawstr, md->items[i].str, sizeof(but->drawstr));
+ break;
+ }
+ }
menudata_free(md);
}
@@ -1611,7 +1616,7 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
uiBut *bt;
MenuData *md;
MenuEntry *entry;
- char *instr= arg_str;
+ const char *instr= arg_str;
int columns, rows, a, b;
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
@@ -1645,11 +1650,12 @@ static void ui_block_func_MENUSTR(bContext *UNUSED(C), uiLayout *layout, void *a
}
/* inconsistent, but menus with labels do not look good flipped */
- for(a=0, b=0; a<md->nitems; a++, b++) {
- entry= &md->items[a];
-
- if(entry->sepr && entry->str[0])
+ entry= md->items;
+ for(a=0; a<md->nitems; a++, entry++) {
+ if(entry->sepr && entry->str[0]) {
block->flag |= UI_BLOCK_NO_FLIP;
+ break;
+ }
}
/* create items */
@@ -1798,7 +1804,7 @@ static void ui_update_block_buts_rgb(uiBlock *block, float *rgb)
if (rgb_gamma[1] > 1.0f) rgb_gamma[1] = modf(rgb_gamma[1], &intpart);
if (rgb_gamma[2] > 1.0f) rgb_gamma[2] = modf(rgb_gamma[2], &intpart);
- sprintf(col, "%02X%02X%02X", FTOCHAR(rgb_gamma[0]), FTOCHAR(rgb_gamma[1]), FTOCHAR(rgb_gamma[2]));
+ BLI_snprintf(col, sizeof(col), "%02X%02X%02X", FTOCHAR(rgb_gamma[0]), FTOCHAR(rgb_gamma[1]), FTOCHAR(rgb_gamma[2]));
strcpy(bt->poin, col);
}
@@ -1986,10 +1992,10 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
/* existence of profile means storage is in linear color space, with display correction */
if (block->color_profile == BLI_PR_NONE) {
- sprintf(tip, "Value in Display Color Space");
+ BLI_strncpy(tip, "Value in Display Color Space", sizeof(tip));
copy_v3_v3(rgb_gamma, rgb);
} else {
- sprintf(tip, "Value in Linear RGB Color Space");
+ BLI_strncpy(tip, "Value in Linear RGB Color Space", sizeof(tip));
/* make an sRGB version, for Hex code */
linearrgb_to_srgb_v3_v3(rgb_gamma, rgb);
}
@@ -2058,7 +2064,7 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR
rgb[3]= 1.0f;
}
- sprintf(hexcol, "%02X%02X%02X", FTOCHAR(rgb_gamma[0]), FTOCHAR(rgb_gamma[1]), FTOCHAR(rgb_gamma[2]));
+ BLI_snprintf(hexcol, sizeof(hexcol), "%02X%02X%02X", FTOCHAR(rgb_gamma[0]), FTOCHAR(rgb_gamma[1]), FTOCHAR(rgb_gamma[2]));
bt= uiDefBut(block, TEX, 0, "Hex: ", 0, -60, butwidth, UI_UNIT_Y, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)");
uiButSetFunc(bt, do_hex_rna_cb, bt, hexcol);
@@ -2152,7 +2158,7 @@ static int ui_popup_string_hash(char *str)
return hash;
}
-static int ui_popup_menu_hash(char *str)
+static int ui_popup_menu_hash(const char *str)
{
return BLI_ghashutil_strhash(str);
}
@@ -2202,8 +2208,6 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
{
uiBlock *block;
uiBut *bt;
- ScrArea *sa;
- ARegion *ar;
uiPopupMenu *pup= arg_pup;
int offset[2], direction, minwidth, width, height, flip;
@@ -2275,10 +2279,9 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
else {
/* for a header menu we set the direction automatic */
if(!pup->slideout && flip) {
- sa= CTX_wm_area(C);
- ar= CTX_wm_region(C);
-
+ ScrArea *sa= CTX_wm_area(C);
if(sa && sa->headertype==HEADERDOWN) {
+ ARegion *ar= CTX_wm_region(C);
if(ar && ar->regiontype == RGN_TYPE_HEADER) {
uiBlockSetDirection(block, UI_TOP);
uiBlockFlipOrder(block);
@@ -2305,7 +2308,6 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
uiStyle *style= UI_GetStyle();
uiPopupBlockHandle *handle;
uiPopupMenu *pup;
-
pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy");
pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP);
pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style);
@@ -2320,6 +2322,19 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
pup->popup= 1;
pup->block->flag |= UI_BLOCK_NO_FLIP;
}
+ /* some enums reversing is strange, currently we have no good way to
+ * reverse some enum's but not others, so reverse all so the first menu
+ * items are always close to the mouse cursor */
+#if 0
+ else {
+ /* if this is an rna button then we can assume its an enum
+ * flipping enums is generally not good since the order can be
+ * important [#28786] */
+ if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_ENUM) {
+ pup->block->flag |= UI_BLOCK_NO_FLIP;
+ }
+ }
+#endif
if(str) {
/* menu is created from a string */
@@ -2369,7 +2384,7 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
char titlestr[256];
if(icon) {
- sprintf(titlestr, " %s", title);
+ BLI_snprintf(titlestr, sizeof(titlestr), " %s", title);
uiDefIconTextBut(pup->block, LABEL, 0, icon, titlestr, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
}
else {
@@ -2467,7 +2482,7 @@ void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...)
va_list ap;
char titlestr[256];
- sprintf(titlestr, "OK? %%i%d", ICON_QUESTION);
+ BLI_snprintf(titlestr, sizeof(titlestr), "OK? %%i%d", ICON_QUESTION);
va_start(ap, str);
vconfirm_opname(C, opname, titlestr, str, ap);
@@ -2507,9 +2522,9 @@ void uiPupMenuError(bContext *C, const char *str, ...)
char nfmt[256];
char titlestr[256];
- sprintf(titlestr, "Error %%i%d", ICON_ERROR);
+ BLI_snprintf(titlestr, sizeof(titlestr), "Error %%i%d", ICON_ERROR);
- sprintf(nfmt, "%s", str);
+ BLI_strncpy(nfmt, str, sizeof(nfmt));
va_start(ap, str);
vconfirm_opname(C, NULL, titlestr, nfmt, ap);
@@ -2556,7 +2571,7 @@ void uiPupMenuInvoke(bContext *C, const char *idname)
MenuType *mt= WM_menutype_find(idname, TRUE);
if(mt==NULL) {
- printf("uiPupMenuInvoke: named menu \"%s\" not found\n", idname);
+ printf("%s: named menu \"%s\" not found\n", __func__, idname);
return;
}
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 6bd38d222d0..f74f2be12bc 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -42,6 +42,7 @@
#include "BLI_listbase.h"
#include "BLI_rect.h"
#include "BLI_string.h"
+#include "BLI_utildefines.h"
#include "BKE_global.h"
@@ -315,21 +316,36 @@ void uiStyleInit(void)
font= MEM_callocN(sizeof(uiFont), "ui font");
BLI_addtail(&U.uifonts, font);
- strcpy(font->filename, "default");
+ BLI_strncpy(font->filename, "default", sizeof(font->filename));
font->uifont_id= UIFONT_DEFAULT;
}
for(font= U.uifonts.first; font; font= font->next) {
if(font->uifont_id==UIFONT_DEFAULT) {
-#ifdef INTERNATIONAL
- int unifont_size;
- unsigned char *unifont_ttf= BLF_get_unifont(&unifont_size);
-
- if(unifont_ttf)
- font->blf_id= BLF_load_mem_unique("default", unifont_ttf, unifont_size);
- else
- font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+#ifdef WITH_INTERNATIONAL
+ int font_size= datatoc_bfont_ttf_size;
+ unsigned char *font_ttf= (unsigned char*)datatoc_bfont_ttf;
+ static int last_font_size = 0;
+
+ /* use unicode font for translation */
+ if(U.transopts & USER_DOTRANSLATE) {
+ font_ttf= BLF_get_unifont(&font_size);
+
+ if(!font_ttf) {
+ /* fall back if not found */
+ font_size= datatoc_bfont_ttf_size;
+ font_ttf= (unsigned char*)datatoc_bfont_ttf;
+ }
+ }
+
+ /* relload only if needed */
+ if(last_font_size != font_size) {
+ BLF_unload("default");
+ last_font_size = font_size;
+ }
+
+ font->blf_id= BLF_load_mem("default", font_ttf, font_size);
#else
font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
#endif
@@ -342,7 +358,7 @@ void uiStyleInit(void)
if (font->blf_id == -1) {
if (G.f & G_DEBUG)
- printf("uiStyleInit error, no fonts available\n");
+ printf("%s: error, no fonts available\n", __func__);
}
else {
/* ? just for speed to initialize?
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 3a3ea4cf0eb..dcbd56c9a27 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -412,10 +412,10 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
if(id->us > 1) {
char str[32];
- sprintf(str, "%d", id->us);
+ BLI_snprintf(str, sizeof(str), "%d", id->us);
but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0,
- UI_translate_do_tooltip(_("Displays number of users of this data. Click to make a single-user copy")));
+ UI_translate_do_tooltip(_("Display number of users of this data (click to make a single-user copy)")));
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable)
@@ -729,7 +729,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
block= uiLayoutGetBlock(row);
/* VIRTUAL MODIFIER */
// XXX this is not used now, since these cannot be accessed via RNA
- sprintf(str, "%s parent deform", md->name);
+ BLI_snprintf(str, sizeof(str), "%s parent deform", md->name);
uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name");
but = uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Make Real")), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0,
@@ -964,13 +964,10 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
cti= constraint_get_typeinfo(con);
if (cti == NULL) {
/* exception for 'Null' constraint - it doesn't have constraint typeinfo! */
- if (con->type == CONSTRAINT_TYPE_NULL)
- strcpy(typestr, "Null");
- else
- strcpy(typestr, "Unknown");
+ BLI_strncpy(typestr, (con->type == CONSTRAINT_TYPE_NULL) ? "Null" : "Unknown", sizeof(typestr));
}
else
- strcpy(typestr, cti->name);
+ BLI_strncpy(typestr, cti->name, sizeof(typestr));
/* determine whether constraint is proxy protected or not */
if (proxylocked_constraints_owner(ob, pchan))
@@ -1048,7 +1045,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
/* enabled */
uiBlockSetEmboss(block, UI_EMBOSSN);
- uiItemR(row, &ptr, "mute", 0, "", (con->flag & CONSTRAINT_OFF) ? ICON_MUTE_IPO_ON : ICON_MUTE_IPO_OFF);
+ uiItemR(row, &ptr, "mute", 0, "", (con->flag & CONSTRAINT_OFF) ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF);
uiBlockSetEmboss(block, UI_EMBOSS);
uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT);
@@ -2117,7 +2114,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
manode= give_node_material(ma);
if(manode) {
char str[MAX_ID_NAME + 12];
- sprintf(str, "Node %s", manode->id.name+2);
+ BLI_snprintf(str, sizeof(str), "Node %s", manode->id.name+2);
uiItemL(sub, str, ui_id_icon_get(C, &manode->id, 1));
}
else if(ma->use_nodes) {
@@ -2286,7 +2283,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
uiItemL(row, "", ICON_NONE);
/* next/prev button */
- sprintf(str, "%d :", i);
+ BLI_snprintf(str, sizeof(str), "%d :", i);
but= uiDefIconTextButR_prop(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, "");
if(i == 0)
uiButSetFlag(but, UI_BUT_DISABLED);
@@ -2493,7 +2490,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
uiLayout *ui_abs;
uiBlock *block;
uiBut *but;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
int width;
int icon=0;
@@ -2553,3 +2550,61 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
uiTemplateNodeView(NULL, NULL, NULL, NULL, NULL);
}
+/********************************* Keymap *************************************/
+
+static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused))
+{
+ wmKeyMapItem *kmi= (wmKeyMapItem*)kmi_p;
+ WM_keyconfig_update_tag(NULL, kmi);
+}
+
+static void template_keymap_item_properties(uiLayout *layout, const char *title, PointerRNA *ptr)
+{
+ uiLayout *flow;
+
+ uiItemS(layout);
+
+ if(title)
+ uiItemL(layout, title, ICON_NONE);
+
+ flow= uiLayoutColumnFlow(layout, 2, 0);
+
+ RNA_STRUCT_BEGIN(ptr, prop) {
+ int flag= RNA_property_flag(prop);
+
+ if(flag & PROP_HIDDEN)
+ continue;
+
+ /* recurse for nested properties */
+ if(RNA_property_type(prop) == PROP_POINTER) {
+ PointerRNA propptr= RNA_property_pointer_get(ptr, prop);
+ const char *name= RNA_property_ui_name(prop);
+
+ if(propptr.data && RNA_struct_is_a(propptr.type, &RNA_OperatorProperties)) {
+ template_keymap_item_properties(layout, name, &propptr);
+ continue;
+ }
+ }
+
+ /* add property */
+ uiItemR(flow, ptr, RNA_property_identifier(prop), 0, NULL, ICON_NONE);
+ }
+ RNA_STRUCT_END;
+}
+
+void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
+{
+ PointerRNA propptr= RNA_pointer_get(ptr, "properties");
+
+ if(propptr.data) {
+ uiBut *but= uiLayoutGetBlock(layout)->buttons.last;
+
+ template_keymap_item_properties(layout, NULL, &propptr);
+
+ /* attach callbacks to compensate for missing properties update,
+ we don't know which keymap (item) is being modified there */
+ for(; but; but=but->next)
+ uiButSetFunc(but, keymap_item_modified, ptr->data, NULL);
+ }
+}
+
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index a49060eaca2..206ecbad1d0 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -36,6 +36,7 @@
#include "DNA_object_types.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BLF_translation.h"
@@ -116,7 +117,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
}
case PROP_COLLECTION: {
char text[256];
- sprintf(text, UI_translate_do_iface(N_("%d items")), RNA_property_collection_length(ptr, prop));
+ BLI_snprintf(text, sizeof(text), UI_translate_do_iface(N_("%d items")), RNA_property_collection_length(ptr, prop));
but= uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL);
uiButSetFlag(but, UI_BUT_DISABLED);
break;
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index fb924960324..a9fcf767adb 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -574,7 +574,7 @@ static void widget_check_trias(uiWidgetTrias *tria, rcti *rect)
/* prepares shade colors */
-static void shadecolors4(char *coltop, char *coldown, const char *color, short shadetop, short shadedown)
+static void shadecolors4(char coltop[4], char *coldown, const char *color, short shadetop, short shadedown)
{
coltop[0]= CLAMPIS(color[0]+shadetop, 0, 255);
@@ -889,7 +889,7 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, rcti *rect
UI_icon_draw_aspect(xs, ys, icon, aspect, alpha);
}
- if(but->flag & UI_ICON_SUBMENU) {
+ if((but->flag & UI_ICON_SUBMENU) && (but->dt == UI_EMBOSSP)) {
xs= rect->xmax-17;
ys= (rect->ymin+rect->ymax- height)/2;
@@ -1500,7 +1500,7 @@ void ui_widget_color_init(ThemeUI *tui)
/* ************ button callbacks, state ***************** */
-static void widget_state_blend(char *cp, const char *cpstate, const float fac)
+static void widget_state_blend(char cp[3], const char cpstate[3], const float fac)
{
if(fac != 0.0f) {
cp[0]= (int)((1.0f-fac)*cp[0] + fac*cpstate[0]);
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 0aaf6fe3bc6..30ae69b71b8 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -785,7 +785,7 @@ static void VIEW2D_OT_zoom_out(wmOperatorType *ot)
}
/* ********************************************************* */
-/* DRAG-ZOOM OPERATOR */
+/* DRAG-ZOOM OPERATOR */
/* MMB Drag - allows non-uniform scaling by dragging mouse
*
diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt
index 02a25a2a122..f45f706b892 100644
--- a/source/blender/editors/mesh/CMakeLists.txt
+++ b/source/blender/editors/mesh/CMakeLists.txt
@@ -52,4 +52,16 @@ set(SRC
mesh_intern.h
)
+if(WITH_GAMEENGINE)
+ add_definitions(-DWITH_GAMEENGINE)
+
+ list(APPEND INC
+ ../../../../extern/recastnavigation
+ )
+
+ list(APPEND SRC
+ mesh_navmesh.c
+ )
+endif()
+
blender_add_lib(bf_editor_mesh "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/mesh/SConscript b/source/blender/editors/mesh/SConscript
index b992ae5f04c..6546a44adeb 100644
--- a/source/blender/editors/mesh/SConscript
+++ b/source/blender/editors/mesh/SConscript
@@ -3,6 +3,8 @@ Import ('env')
sources = env.Glob('*.c')
+defs = []
+
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../gpu ../../blenloader'
@@ -15,4 +17,10 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
-env.BlenderLib ( 'bf_editors_mesh', sources, Split(incs), [], libtype=['core'], priority=[45] )
+if env['WITH_BF_GAMEENGINE']:
+ incs += ' #/extern/recastnavigation'
+ defs.append('WITH_GAMEENGINE')
+else:
+ sources.remove('mesh_navmesh.c')
+
+env.BlenderLib ( 'bf_editors_mesh', sources, Split(incs), defs, libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index 0c819cd7649..98cca08fd7a 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -1472,6 +1472,8 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_circle_add(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Add Circle";
ot->description= "Construct a circle mesh";
@@ -1487,7 +1489,8 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "vertices", 32, 3, INT_MAX, "Vertices", "", 3, 500);
- RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
+ prop = RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
RNA_def_boolean(ot->srna, "fill", 0, "Fill", "");
ED_object_add_generic_props(ot, TRUE);
@@ -1513,6 +1516,8 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Add Cylinder";
ot->description= "Construct a cylinder mesh";
@@ -1528,8 +1533,10 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "vertices", 32, 2, INT_MAX, "Vertices", "", 2, 500);
- RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
- RNA_def_float(ot->srna, "depth", 2.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
+ prop = RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
+ prop = RNA_def_float(ot->srna, "depth", 2.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
RNA_def_boolean(ot->srna, "cap_ends", 1, "Cap Ends", "");
ED_object_add_generic_props(ot, TRUE);
@@ -1554,6 +1561,8 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_cone_add(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Add Cone";
ot->description= "Construct a conic mesh (ends filled)";
@@ -1569,8 +1578,10 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "vertices", 32, 2, INT_MAX, "Vertices", "", 2, 500);
- RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
- RNA_def_float(ot->srna, "depth", 2.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
+ prop = RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
+ prop = RNA_def_float(ot->srna, "depth", 2.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
RNA_def_boolean(ot->srna, "cap_end", 1, "Cap End", "");
ED_object_add_generic_props(ot, TRUE);
@@ -1595,6 +1606,8 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_grid_add(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Add Grid";
ot->description= "Construct a grid mesh";
@@ -1611,7 +1624,8 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "x_subdivisions", 10, 3, INT_MAX, "X Subdivisions", "", 3, 1000);
RNA_def_int(ot->srna, "y_subdivisions", 10, 3, INT_MAX, "Y Subdivisions", "", 3, 1000);
- RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, FLT_MAX);
+ prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, FLT_MAX);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
ED_object_add_generic_props(ot, TRUE);
}
@@ -1668,6 +1682,8 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Add UV Sphere";
ot->description= "Construct a UV sphere mesh";
@@ -1684,7 +1700,8 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "segments", 32, 3, INT_MAX, "Segments", "", 3, 500);
RNA_def_int(ot->srna, "ring_count", 16, 3, INT_MAX, "Rings", "", 3, 500);
- RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, 100.00);
+ prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0, FLT_MAX, "Size", "", 0.001, 100.00);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
ED_object_add_generic_props(ot, TRUE);
}
@@ -1707,6 +1724,8 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
/* identifiers */
ot->name= "Add Ico Sphere";
ot->description= "Construct an Icosphere mesh";
@@ -1722,7 +1741,8 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot)
/* props */
RNA_def_int(ot->srna, "subdivisions", 2, 1, INT_MAX, "Subdivisions", "", 1, 8);
- RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00);
+ prop = RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00);
+ RNA_def_property_subtype(prop, PROP_DISTANCE);
ED_object_add_generic_props(ot, TRUE);
}
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 8c035ca46fd..3f9d793cd70 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -137,7 +137,7 @@ static void EM_select_mirrored(Object *obedit, EditMesh *em, int extend)
void EM_automerge(Scene *scene, Object *obedit, int update)
{
Mesh *me= obedit ? obedit->data : NULL; /* can be NULL */
- int len;
+ /* int len; */ /* UNUSED */
if ((scene->toolsettings->automerge) &&
(obedit && obedit->type==OB_MESH && (obedit->mode & OB_MODE_EDIT))
@@ -145,7 +145,7 @@ void EM_automerge(Scene *scene, Object *obedit, int update)
EditMesh *em= me->edit_mesh;
int totvert= em->totvert, totedge= em->totedge, totface= em->totface;
- len = removedoublesflag(em, 1, 1, scene->toolsettings->doublimit);
+ /* len = */ /* UNUSED */ removedoublesflag(em, 1, 1, scene->toolsettings->doublimit);
if (totvert != em->totvert || totedge != em->totedge || totface != em->totface) {
if (update) {
DAG_id_tag_update(&me->id, 0);
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index c8e3075ac60..40d3ccb015c 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -1591,7 +1591,7 @@ static void fill_quad_single(EditMesh *em, EditFace *efa, struct GHash *gh, int
EditEdge *cedge=NULL;
EditVert *v[4], **verts;
EditFace *hold;
- short start=0, end, left, right, vertsize,i;
+ short start=0, /* end, */ /* UNUSED */ left, right, vertsize,i;
v[0] = efa->v1;
v[1] = efa->v2;
@@ -1613,7 +1613,7 @@ static void fill_quad_single(EditMesh *em, EditFace *efa, struct GHash *gh, int
// the array to the correct direction
if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);}
- end = (start+1)%4;
+ /* end = (start+1)%4; */ /* UNUSED */
left = (start+2)%4;
right = (start+3)%4;
@@ -1677,7 +1677,7 @@ static void fill_tri_single(EditMesh *em, EditFace *efa, struct GHash *gh, int n
EditEdge *cedge=NULL;
EditVert *v[3], **verts;
EditFace *hold;
- short start=0, end, op, vertsize,i;
+ short start=0, /* end, */ /* UNUSED */ op, vertsize,i;
v[0] = efa->v1;
v[1] = efa->v2;
@@ -1697,8 +1697,8 @@ static void fill_tri_single(EditMesh *em, EditFace *efa, struct GHash *gh, int n
// the array to the correct direction
if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);}
- end = (start+1)%3;
- op = (start+2)%3;
+ /* end = (start+1)%3; */ /* UNUSED */
+ op = (start+2)%3;
/*
We should have something like this now
@@ -1888,7 +1888,7 @@ static void fill_quad_double_adj_fan(EditMesh *em, EditFace *efa, struct GHash *
EditEdge *cedge[2]={NULL, NULL};
EditVert *v[4], *op=NULL, **verts[2];
EditFace *hold;
- short start=0, start2=0, vertsize,i;
+ short start=0, start2=0, /* vertsize, */ /* UNUSED */ i;
v[0] = efa->v1;
v[1] = efa->v2;
@@ -1905,7 +1905,7 @@ static void fill_quad_double_adj_fan(EditMesh *em, EditFace *efa, struct GHash *
verts[0] = BLI_ghash_lookup(gh, cedge[0]);
verts[1] = BLI_ghash_lookup(gh, cedge[1]);
//This is the index size of the verts array
- vertsize = numcuts+2;
+ /* vertsize = numcuts+2; */ /* UNUSED */
// Is the original v1 the same as the first vert on the selected edge?
// if not, the edge is running the opposite direction in this face so flip
@@ -1952,7 +1952,7 @@ static void fill_quad_double_adj_inner(EditMesh *em, EditFace *efa, struct GHash
EditEdge *cedge[2]={NULL, NULL};
EditVert *v[4], *op=NULL, **verts[2],**inner;
EditFace *hold;
- short start=0, start2=0, vertsize,i;
+ short start=0, start2=0, /* vertsize, */ /* UNUSED */ i;
float co[3];
v[0] = efa->v1;
@@ -1970,7 +1970,7 @@ static void fill_quad_double_adj_inner(EditMesh *em, EditFace *efa, struct GHash
verts[0] = BLI_ghash_lookup(gh, cedge[0]);
verts[1] = BLI_ghash_lookup(gh, cedge[1]);
//This is the index size of the verts array
- vertsize = numcuts+2;
+ /* vertsize = numcuts+2; */ /* UNUSED */
// Is the original v1 the same as the first vert on the selected edge?
// if not, the edge is running the opposite direction in this face so flip
@@ -2297,7 +2297,7 @@ static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, i
EditVert **verts[4], ***innerverts;
EditFace *hold;
EditEdge temp;
- short vertsize, i, j;
+ short /* vertsize, */ /* UNUSED */ i, j;
// Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1]
verts[0] = BLI_ghash_lookup(gh, efa->e1);
@@ -2306,7 +2306,7 @@ static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, i
verts[3] = BLI_ghash_lookup(gh, efa->e4);
//This is the index size of the verts array
- vertsize = numcuts+2;
+ /* vertsize = numcuts+2; */ /* UNUSED */
// Is the original v1 the same as the first vert on the selected edge?
// if not, the edge is running the opposite direction in this face so flip
@@ -2392,7 +2392,7 @@ static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, i
static void fill_tri_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts, float smooth, float fractal, int beauty)
{
EditVert **verts[3], ***innerverts;
- short vertsize, i, j;
+ short /* vertsize, */ /* UNUSED */ i, j;
EditFace *hold;
EditEdge temp;
@@ -2402,7 +2402,7 @@ static void fill_tri_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int n
verts[2] = BLI_ghash_lookup(gh, efa->e3);
//This is the index size of the verts array
- vertsize = numcuts+2;
+ /* vertsize = numcuts+2; */ /* UNUSED */
// Is the original v1 the same as the first vert on the selected edge?
// if not, the edge is running the opposite direction in this face so flip
@@ -2547,7 +2547,7 @@ static void fill_quad_singlevert(EditMesh *em, EditFace *efa, struct GHash *gh)
EditEdge *cedge=NULL;
EditVert *v[4], **verts;
EditFace *hold;
- short start=0, end, left, right, vertsize;
+ short start=0, end, left, right /* , vertsize */ /* UNUSED */;
v[0] = efa->v1;
v[1] = efa->v2;
@@ -2562,7 +2562,7 @@ static void fill_quad_singlevert(EditMesh *em, EditFace *efa, struct GHash *gh)
// Point verts to the array of new verts for cedge
verts = BLI_ghash_lookup(gh, cedge);
//This is the index size of the verts array
- vertsize = 3;
+ /* vertsize = 3; */ /* UNUSED */
// Is the original v1 the same as the first vert on the selected edge?
// if not, the edge is running the opposite direction in this face so flip
@@ -3629,7 +3629,7 @@ static const EnumPropertyItem axis_items_xy[]= {
static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir)
{
EditVert **verts[2];
- EditFace *face[2], *efa, *newFace[2];
+ EditFace *face[2], *efa /* , *newFace[2] */ /* UNUSED */;
EditEdge **edges[2], **hiddenedges, *srchedge;
int facecount, p1, p2, p3, p4, fac1, fac2, i, j;
int numhidden, numshared, p[2][4];
@@ -3720,16 +3720,16 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir)
if(fac1 == 3 && fac2 == 3) {
/* no need of reverse setup */
- newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1);
- newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1);
+ /* newFace[0]= */ /* UNUSED */EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1);
+ /* newFace[1]= */ /* UNUSED */EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1);
}
else if(fac1 == 4 && fac2 == 3) {
if(dir == DIRECTION_CCW) {
- newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]);
- newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1);
+ /* newFace[0]= */ /* UNUSED */EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]);
+ /* newFace[1]= */ /* UNUSED */EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1);
} else if (dir == DIRECTION_CW) {
- newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][2], 4+p[1][1], p[0][0], p[0][1]);
- newFace[1]= EM_face_from_faces(em, face[1], face[0], 4+p[0][2], p[1][0], p[1][1], -1);
+ /* newFace[0]= */ /* UNUSED */EM_face_from_faces(em, face[0], face[1], p[0][2], 4+p[1][1], p[0][0], p[0][1]);
+ /* newFace[1]= */ /* UNUSED */EM_face_from_faces(em, face[1], face[0], 4+p[0][2], p[1][0], p[1][1], -1);
verts[0][p[0][2]]->f |= SELECT;
verts[1][p[1][1]]->f |= SELECT;
@@ -3737,11 +3737,11 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir)
}
else if(fac1 == 3 && fac2 == 4) {
if(dir == DIRECTION_CCW) {
- newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1);
- newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]);
+ /* newFace[0]= */ /* UNUSED */EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1);
+ /* newFace[1]= */ /* UNUSED */EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]);
} else if (dir == DIRECTION_CW) {
- newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][0], p[0][1], 4+p[1][2], -1);
- newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], 4+p[0][2]);
+ /* newFace[0]= */ /* UNUSED */EM_face_from_faces(em, face[0], face[1], p[0][0], p[0][1], 4+p[1][2], -1);
+ /* newFace[1]= */ /* UNUSED */EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], 4+p[0][2]);
verts[0][p[0][1]]->f |= SELECT;
verts[1][p[1][2]]->f |= SELECT;
@@ -3750,11 +3750,11 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir)
}
else if(fac1 == 4 && fac2 == 4) {
if(dir == DIRECTION_CCW) {
- newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]);
- newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]);
+ /* newFace[0]= */ /* UNUSED */EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]);
+ /* newFace[1]= */ /* UNUSED */EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]);
} else if (dir == DIRECTION_CW) {
- newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][2], p[0][3], 4+p[1][1], 4+p[1][2]);
- newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][2], p[1][3], 4+p[0][1], 4+p[0][2]);
+ /* newFace[0]= */ /* UNUSED */EM_face_from_faces(em, face[0], face[1], p[0][2], p[0][3], 4+p[1][1], 4+p[1][2]);
+ /* newFace[1]= */ /* UNUSED */EM_face_from_faces(em, face[1], face[0], p[1][2], p[1][3], 4+p[0][1], 4+p[0][2]);
verts[0][p[0][2]]->f |= SELECT;
verts[1][p[1][2]]->f |= SELECT;
diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h
index 4d620424b0a..9e6b4e84e54 100644
--- a/source/blender/editors/mesh/mesh_intern.h
+++ b/source/blender/editors/mesh/mesh_intern.h
@@ -40,6 +40,7 @@
struct bContext;
struct wmOperatorType;
struct wmOperator;
+struct ViewContext;
/* ******************** editface.c */
@@ -64,7 +65,7 @@ extern struct EditEdge *addedgelist(EditMesh *em, struct EditVert *v1, struct Ed
extern struct EditFace *addfacelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges);
extern struct EditEdge *findedgelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2);
-void em_setup_viewcontext(struct bContext *C, ViewContext *vc);
+void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc);
void MESH_OT_separate(struct wmOperatorType *ot);
@@ -169,7 +170,7 @@ void MESH_OT_solidify(struct wmOperatorType *ot);
void MESH_OT_select_nth(struct wmOperatorType *ot);
-extern EditEdge *findnearestedge(ViewContext *vc, int *dist);
+extern EditEdge *findnearestedge(struct ViewContext *vc, int *dist);
void editmesh_select_by_material(EditMesh *em, int index);
void EM_recalc_normal_direction(EditMesh *em, int inside, int select); /* makes faces righthand turning */
void EM_select_more(EditMesh *em);
@@ -185,7 +186,7 @@ void faceloop_select(EditMesh *em, EditEdge *startedge, int select);
* if 0, unselected vertice are given the bias
* strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased
*/
-extern EditVert *findnearestvert(ViewContext *vc, int *dist, short sel, short strict);
+extern EditVert *findnearestvert(struct ViewContext *vc, int *dist, short sel, short strict);
/* ******************* editmesh_tools.c */
@@ -256,5 +257,12 @@ void MESH_OT_drop_named_image(struct wmOperatorType *ot);
void MESH_OT_edgering_select(struct wmOperatorType *ot);
void MESH_OT_loopcut(struct wmOperatorType *ot);
+/* ******************* mesh_navmesh.c */
+void MESH_OT_navmesh_make(struct wmOperatorType *ot);
+void MESH_OT_navmesh_face_copy(struct wmOperatorType *ot);
+void MESH_OT_navmesh_face_add(struct wmOperatorType *ot);
+void MESH_OT_navmesh_reset(struct wmOperatorType *ot);
+void MESH_OT_navmesh_clear(struct wmOperatorType *ot);
+
#endif // MESH_INTERN_H
diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c
new file mode 100644
index 00000000000..b8ace26991e
--- /dev/null
+++ b/source/blender/editors/mesh/mesh_navmesh.c
@@ -0,0 +1,692 @@
+/**
+* $Id$
+*
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+* The Original Code is Copyright (C) 2011 by Blender Foundation
+* All rights reserved.
+*
+* The Original Code is: all of this file.
+*
+* Contributor(s): Benoit Bolsee,
+* Nick Samarin
+*
+* ***** END GPL LICENSE BLOCK *****
+*/
+
+#include <math.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
+#include "DNA_ID.h"
+
+#include "BKE_library.h"
+#include "BKE_depsgraph.h"
+#include "BKE_context.h"
+#include "BKE_main.h"
+#include "BKE_mesh.h"
+#include "BKE_modifier.h"
+#include "BKE_scene.h"
+#include "BKE_DerivedMesh.h"
+#include "BKE_cdderivedmesh.h"
+#include "BKE_report.h"
+
+#include "BLI_editVert.h"
+#include "BLI_listbase.h"
+#include "BLI_utildefines.h"
+#include "BLI_math_vector.h"
+
+#include "ED_object.h"
+#include "ED_mesh.h"
+#include "ED_screen.h"
+
+#include "RNA_access.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "mesh_intern.h"
+#include "recast-capi.h"
+
+static void createVertsTrisData(bContext *C, LinkNode* obs, int *nverts_r, float **verts_r, int *ntris_r, int **tris_r)
+{
+ MVert *mvert;
+ int nfaces= 0, *tri, i, curnverts, basenverts, curnfaces;
+ MFace *mface;
+ float co[3], wco[3];
+ Object *ob;
+ LinkNode *oblink, *dmlink;
+ DerivedMesh *dm;
+ Scene* scene= CTX_data_scene(C);
+ LinkNode* dms= NULL;
+
+ int nverts, ntris, *tris;
+ float *verts;
+
+ nverts= 0;
+ ntris= 0;
+
+ /* calculate number of verts and tris */
+ for(oblink= obs; oblink; oblink= oblink->next) {
+ ob= (Object*) oblink->link;
+ dm= mesh_create_derived_no_virtual(scene, ob, NULL, CD_MASK_MESH);
+ BLI_linklist_append(&dms, (void*)dm);
+
+ nverts+= dm->getNumVerts(dm);
+ nfaces= dm->getNumFaces(dm);
+ ntris+= nfaces;
+
+ /* resolve quad faces */
+ mface= dm->getFaceArray(dm);
+ for(i= 0; i<nfaces; i++) {
+ MFace* mf= &mface[i];
+ if(mf->v4)
+ ntris+=1;
+ }
+ }
+
+ /* create data */
+ verts= MEM_mallocN(sizeof(float)*3*nverts, "createVertsTrisData verts");
+ tris= MEM_mallocN(sizeof(int)*3*ntris, "createVertsTrisData faces");
+
+ basenverts= 0;
+ tri= tris;
+ for(oblink= obs, dmlink= dms; oblink && dmlink;
+ oblink= oblink->next, dmlink= dmlink->next) {
+ ob= (Object*) oblink->link;
+ dm= (DerivedMesh*) dmlink->link;
+
+ curnverts= dm->getNumVerts(dm);
+ mvert= dm->getVertArray(dm);
+
+ /* copy verts */
+ for(i= 0; i<curnverts; i++) {
+ MVert *v= &mvert[i];
+
+ copy_v3_v3(co, v->co);
+ mul_v3_m4v3(wco, ob->obmat, co);
+
+ verts[3*(basenverts+i)+0]= wco[0];
+ verts[3*(basenverts+i)+1]= wco[2];
+ verts[3*(basenverts+i)+2]= wco[1];
+ }
+
+ /* create tris */
+ curnfaces= dm->getNumFaces(dm);
+ mface= dm->getFaceArray(dm);
+
+ for(i= 0; i<curnfaces; i++) {
+ MFace* mf= &mface[i];
+
+ tri[0]= basenverts + mf->v1;
+ tri[1]= basenverts + mf->v3;
+ tri[2]= basenverts + mf->v2;
+ tri += 3;
+
+ if(mf->v4) {
+ tri[0]= basenverts + mf->v1;
+ tri[1]= basenverts + mf->v4;
+ tri[2]= basenverts + mf->v3;
+ tri += 3;
+ }
+ }
+
+ basenverts+= curnverts;
+ }
+
+ /* release derived mesh */
+ for(dmlink= dms; dmlink; dmlink= dmlink->next) {
+ dm= (DerivedMesh*) dmlink->link;
+ dm->release(dm);
+ }
+
+ BLI_linklist_free(dms, NULL);
+
+ *nverts_r= nverts;
+ *verts_r= verts;
+ *ntris_r= ntris;
+ *tris_r= tris;
+}
+
+static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts, int ntris, int *tris,
+ struct recast_polyMesh **pmesh, struct recast_polyMeshDetail **dmesh)
+{
+ float bmin[3], bmax[3];
+ struct recast_heightfield *solid;
+ unsigned char *triflags;
+ struct recast_compactHeightfield* chf;
+ struct recast_contourSet *cset;
+ int width, height, walkableHeight, walkableClimb, walkableRadius;
+ int minRegionArea, mergeRegionArea, maxEdgeLen;
+ float detailSampleDist, detailSampleMaxError;
+
+ recast_calcBounds(verts, nverts, bmin, bmax);
+
+ /* ** Step 1. Initialize build config ** */
+ walkableHeight= (int)ceilf(recastParams->agentheight/ recastParams->cellheight);
+ walkableClimb= (int)floorf(recastParams->agentmaxclimb / recastParams->cellheight);
+ walkableRadius= (int)ceilf(recastParams->agentradius / recastParams->cellsize);
+ minRegionArea= (int)(recastParams->regionminsize * recastParams->regionminsize);
+ mergeRegionArea= (int)(recastParams->regionmergesize * recastParams->regionmergesize);
+ maxEdgeLen= (int)(recastParams->edgemaxlen/recastParams->cellsize);
+ detailSampleDist= recastParams->detailsampledist< 0.9f ? 0 :
+ recastParams->cellsize * recastParams->detailsampledist;
+ detailSampleMaxError= recastParams->cellheight * recastParams->detailsamplemaxerror;
+
+ /* Set the area where the navigation will be build. */
+ recast_calcGridSize(bmin, bmax, recastParams->cellsize, &width, &height);
+
+ /* ** Step 2: Rasterize input polygon soup ** */
+ /* Allocate voxel heightfield where we rasterize our input data to */
+ solid= recast_newHeightfield();
+
+ if(!recast_createHeightfield(solid, width, height, bmin, bmax, recastParams->cellsize, recastParams->cellheight)) {
+ recast_destroyHeightfield(solid);
+
+ return 0;
+ }
+
+ /* Allocate array that can hold triangle flags */
+ triflags= MEM_callocN(sizeof(unsigned char)*ntris, "buildNavMesh triflags");
+
+ /* Find triangles which are walkable based on their slope and rasterize them */
+ recast_markWalkableTriangles(RAD2DEG(recastParams->agentmaxslope), verts, nverts, tris, ntris, triflags);
+ recast_rasterizeTriangles(verts, nverts, tris, triflags, ntris, solid);
+ MEM_freeN(triflags);
+
+ /* ** Step 3: Filter walkables surfaces ** */
+ recast_filterLowHangingWalkableObstacles(walkableClimb, solid);
+ recast_filterLedgeSpans(walkableHeight, walkableClimb, solid);
+ recast_filterWalkableLowHeightSpans(walkableHeight, solid);
+
+ /* ** Step 4: Partition walkable surface to simple regions ** */
+
+ chf= recast_newCompactHeightfield();
+ if(!recast_buildCompactHeightfield(walkableHeight, walkableClimb, solid, chf)) {
+ recast_destroyHeightfield(solid);
+ recast_destroyCompactHeightfield(chf);
+
+ return 0;
+ }
+
+ recast_destroyHeightfield(solid);
+ solid = NULL;
+
+ if (!recast_erodeWalkableArea(walkableRadius, chf)) {
+ recast_destroyCompactHeightfield(chf);
+
+ return 0;
+ }
+
+ /* Prepare for region partitioning, by calculating distance field along the walkable surface */
+ if(!recast_buildDistanceField(chf)) {
+ recast_destroyCompactHeightfield(chf);
+
+ return 0;
+ }
+
+ /* Partition the walkable surface into simple regions without holes */
+ if(!recast_buildRegions(chf, 0, minRegionArea, mergeRegionArea)) {
+ recast_destroyCompactHeightfield(chf);
+
+ return 0;
+ }
+
+ /* ** Step 5: Trace and simplify region contours ** */
+ /* Create contours */
+ cset= recast_newContourSet();
+
+ if(!recast_buildContours(chf, recastParams->edgemaxerror, maxEdgeLen, cset)) {
+ recast_destroyCompactHeightfield(chf);
+ recast_destroyContourSet(cset);
+
+ return 0;
+ }
+
+ /* ** Step 6: Build polygons mesh from contours ** */
+ *pmesh= recast_newPolyMesh();
+ if(!recast_buildPolyMesh(cset, recastParams->vertsperpoly, *pmesh)) {
+ recast_destroyCompactHeightfield(chf);
+ recast_destroyContourSet(cset);
+ recast_destroyPolyMesh(*pmesh);
+
+ return 0;
+ }
+
+
+ /* ** Step 7: Create detail mesh which allows to access approximate height on each polygon ** */
+
+ *dmesh= recast_newPolyMeshDetail();
+ if(!recast_buildPolyMeshDetail(*pmesh, chf, detailSampleDist, detailSampleMaxError, *dmesh)) {
+ recast_destroyCompactHeightfield(chf);
+ recast_destroyContourSet(cset);
+ recast_destroyPolyMesh(*pmesh);
+ recast_destroyPolyMeshDetail(*dmesh);
+
+ return 0;
+ }
+
+ recast_destroyCompactHeightfield(chf);
+ recast_destroyContourSet(cset);
+
+ return 1;
+}
+
+static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh, Base* base)
+{
+ float co[3], rot[3];
+ EditMesh *em;
+ int i,j, k;
+ unsigned short* v;
+ int face[3];
+ Scene *scene= CTX_data_scene(C);
+ Object* obedit;
+ int createob= base==NULL;
+ int nverts, nmeshes, nvp;
+ unsigned short *verts, *polys;
+ unsigned int *meshes;
+ float bmin[3], cs, ch, *dverts;
+ unsigned char *tris;
+
+ zero_v3(co);
+ zero_v3(rot);
+
+ if(createob) {
+ /* create new object */
+ obedit= ED_object_add_type(C, OB_MESH, co, rot, FALSE, 1);
+ }
+ else {
+ obedit= base->object;
+ scene_select_base(scene, base);
+ copy_v3_v3(obedit->loc, co);
+ copy_v3_v3(obedit->rot, rot);
+ }
+
+ ED_object_enter_editmode(C, EM_DO_UNDO|EM_IGNORE_LAYER);
+ em= BKE_mesh_get_editmesh(((Mesh *)obedit->data));
+
+ if(!createob) {
+ /* clear */
+ if(em->verts.first) free_vertlist(em, &em->verts);
+ if(em->edges.first) free_edgelist(em, &em->edges);
+ if(em->faces.first) free_facelist(em, &em->faces);
+ if(em->selected.first) BLI_freelistN(&(em->selected));
+ }
+
+ /* create verts for polygon mesh */
+ verts= recast_polyMeshGetVerts(pmesh, &nverts);
+ recast_polyMeshGetBoundbox(pmesh, bmin, NULL);
+ recast_polyMeshGetCell(pmesh, &cs, &ch);
+
+ for(i= 0; i<nverts; i++) {
+ v= &verts[3*i];
+ co[0]= bmin[0] + v[0]*cs;
+ co[1]= bmin[1] + v[1]*ch;
+ co[2]= bmin[2] + v[2]*cs;
+ SWAP(float, co[1], co[2]);
+ addvertlist(em, co, NULL);
+ }
+
+ /* create custom data layer to save polygon idx */
+ CustomData_add_layer_named(&em->fdata, CD_RECAST, CD_CALLOC, NULL, 0, "createRepresentation recastData");
+
+ /* create verts and faces for detailed mesh */
+ meshes= recast_polyMeshDetailGetMeshes(dmesh, &nmeshes);
+ polys= recast_polyMeshGetPolys(pmesh, NULL, &nvp);
+ dverts= recast_polyMeshDetailGetVerts(dmesh, NULL);
+ tris= recast_polyMeshDetailGetTris(dmesh, NULL);
+
+ for(i= 0; i<nmeshes; i++) {
+ int uniquevbase= em->totvert;
+ unsigned int vbase= meshes[4*i+0];
+ unsigned short ndv= meshes[4*i+1];
+ unsigned short tribase= meshes[4*i+2];
+ unsigned short trinum= meshes[4*i+3];
+ const unsigned short* p= &polys[i*nvp*2];
+ int nv= 0;
+
+ for(j= 0; j < nvp; ++j) {
+ if(p[j]==0xffff) break;
+ nv++;
+ }
+
+ /* create unique verts */
+ for(j= nv; j<ndv; j++) {
+ copy_v3_v3(co, &dverts[3*(vbase + j)]);
+ SWAP(float, co[1], co[2]);
+ addvertlist(em, co, NULL);
+ }
+
+ EM_init_index_arrays(em, 1, 0, 0);
+
+ /* create faces */
+ for(j= 0; j<trinum; j++) {
+ unsigned char* tri= &tris[4*(tribase+j)];
+ EditFace* newFace;
+ int* polygonIdx;
+
+ for(k= 0; k<3; k++) {
+ if(tri[k]<nv)
+ face[k]= p[tri[k]]; /* shared vertex */
+ else
+ face[k]= uniquevbase+tri[k]-nv; /* unique vertex */
+ }
+ newFace= addfacelist(em, EM_get_vert_for_index(face[0]), EM_get_vert_for_index(face[2]),
+ EM_get_vert_for_index(face[1]), NULL, NULL, NULL);
+
+ /* set navigation polygon idx to the custom layer */
+ polygonIdx= (int*)CustomData_em_get(&em->fdata, newFace->data, CD_RECAST);
+ *polygonIdx= i+1; /* add 1 to avoid zero idx */
+ }
+
+ EM_free_index_arrays();
+ }
+
+ recast_destroyPolyMesh(pmesh);
+ recast_destroyPolyMeshDetail(dmesh);
+
+ BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
+
+ DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+
+
+ ED_object_exit_editmode(C, EM_FREEDATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
+
+ if(createob) {
+ obedit->gameflag&= ~OB_COLLISION;
+ obedit->gameflag|= OB_NAVMESH;
+ obedit->body_type= OB_BODY_TYPE_NAVMESH;
+ rename_id((ID *)obedit, "Navmesh");
+ }
+
+ BKE_mesh_ensure_navmesh(obedit->data);
+
+ return obedit;
+}
+
+static int create_navmesh_exec(bContext *C, wmOperator *op)
+{
+ Scene* scene= CTX_data_scene(C);
+ LinkNode* obs= NULL;
+ Base* navmeshBase= NULL;
+
+ CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
+ if (base->object->type == OB_MESH) {
+ if (base->object->body_type==OB_BODY_TYPE_NAVMESH) {
+ if (!navmeshBase || base == scene->basact) {
+ navmeshBase= base;
+ }
+ }
+ else {
+ BLI_linklist_append(&obs, (void*)base->object);
+ }
+ }
+ }
+ CTX_DATA_END;
+
+ if (obs) {
+ struct recast_polyMesh *pmesh= NULL;
+ struct recast_polyMeshDetail *dmesh= NULL;
+
+ int nverts= 0, ntris= 0;
+ int *tris= 0;
+ float *verts= NULL;
+
+ createVertsTrisData(C, obs, &nverts, &verts, &ntris, &tris);
+ BLI_linklist_free(obs, NULL);
+ buildNavMesh(&scene->gm.recastData, nverts, verts, ntris, tris, &pmesh, &dmesh);
+ createRepresentation(C, pmesh, dmesh, navmeshBase);
+
+ MEM_freeN(verts);
+ MEM_freeN(tris);
+
+ return OPERATOR_FINISHED;
+ }
+ else {
+ BKE_report(op->reports, RPT_ERROR, "No mesh objects found");
+
+ return OPERATOR_CANCELLED;
+ }
+}
+
+void MESH_OT_navmesh_make(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Create navigation mesh";
+ ot->description= "Create navigation mesh for selected objects";
+ ot->idname= "MESH_OT_navmesh_make";
+
+ /* api callbacks */
+ ot->exec= create_navmesh_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
+{
+ Object *obedit= CTX_data_edit_object(C);
+ EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
+
+ /* do work here */
+ EditFace *efa_act= EM_get_actFace(em, 0);
+
+ if(efa_act) {
+ if(CustomData_has_layer(&em->fdata, CD_RECAST)) {
+ EditFace *efa;
+ int targetPolyIdx= *(int*)CustomData_em_get(&em->fdata, efa_act->data, CD_RECAST);
+ targetPolyIdx= targetPolyIdx>=0? targetPolyIdx : -targetPolyIdx;
+
+ if(targetPolyIdx > 0) {
+ /* set target poly idx to other selected faces */
+ for (efa= (EditFace *)em->faces.first; efa; efa= efa->next) {
+ if((efa->f & SELECT) && efa != efa_act) {
+ int* recastDataBlock= (int*)CustomData_em_get(&em->fdata, efa->data, CD_RECAST);
+ *recastDataBlock= targetPolyIdx;
+ }
+ }
+ }
+ else {
+ BKE_report(op->reports, RPT_ERROR, "Active face has no index set");
+ }
+ }
+ }
+
+ DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+
+ BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
+
+ return OPERATOR_FINISHED;
+}
+
+void MESH_OT_navmesh_face_copy(struct wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "NavMesh Copy Face Index";
+ ot->description= "Copy the index from the active face";
+ ot->idname= "MESH_OT_navmesh_face_copy";
+
+ /* api callbacks */
+ ot->poll= ED_operator_editmesh;
+ ot->exec= navmesh_face_copy_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int compare(const void * a, const void * b){
+ return ( *(int*)a - *(int*)b );
+}
+
+static int findFreeNavPolyIndex(EditMesh* em)
+{
+ /* construct vector of indices */
+ int numfaces= em->totface;
+ int* indices= MEM_callocN(sizeof(int)*numfaces, "findFreeNavPolyIndex(indices)");
+ EditFace* ef= (EditFace*)em->faces.last;
+ int i, idx= 0, freeIdx= 1;
+
+ while(ef) {
+ int polyIdx= *(int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
+ indices[idx]= polyIdx;
+ idx++;
+ ef= ef->prev;
+ }
+
+ qsort(indices, numfaces, sizeof(int), compare);
+
+ /* search first free index */
+ freeIdx= 1;
+ for(i= 0; i<numfaces; i++) {
+ if(indices[i]==freeIdx)
+ freeIdx++;
+ else if(indices[i]>freeIdx)
+ break;
+ }
+
+ MEM_freeN(indices);
+
+ return freeIdx;
+}
+
+static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Object *obedit= CTX_data_edit_object(C);
+ EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
+ EditFace *ef;
+
+ if(CustomData_has_layer(&em->fdata, CD_RECAST)) {
+ int targetPolyIdx= findFreeNavPolyIndex(em);
+
+ if(targetPolyIdx>0) {
+ /* set target poly idx to selected faces */
+ ef= (EditFace*)em->faces.last;
+ while(ef) {
+ if(ef->f & SELECT) {
+ int *recastDataBlock= (int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
+ *recastDataBlock= targetPolyIdx;
+ }
+ ef= ef->prev;
+ }
+ }
+ }
+
+ DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+
+ BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
+ return OPERATOR_FINISHED;
+}
+
+void MESH_OT_navmesh_face_add(struct wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "NavMesh New Face Index";
+ ot->description= "Add a new index and assign it to selected faces";
+ ot->idname= "MESH_OT_navmesh_face_add";
+
+ /* api callbacks */
+ ot->poll= ED_operator_editmesh;
+ ot->exec= navmesh_face_add_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int navmesh_obmode_data_poll(bContext *C)
+{
+ Object *ob = ED_object_active_context(C);
+ if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {
+ Mesh *me= ob->data;
+ return CustomData_has_layer(&me->fdata, CD_RECAST);
+ }
+ return FALSE;
+}
+
+static int navmesh_obmode_poll(bContext *C)
+{
+ Object *ob = ED_object_active_context(C);
+ if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static int navmesh_reset_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Object *ob = ED_object_active_context(C);
+ Mesh *me= ob->data;
+
+ CustomData_free_layers(&me->fdata, CD_RECAST, me->totface);
+
+ BKE_mesh_ensure_navmesh(me);
+
+ DAG_id_tag_update(&me->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, &me->id);
+
+ return OPERATOR_FINISHED;
+}
+
+void MESH_OT_navmesh_reset(struct wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "NavMesh Reset Index Values";
+ ot->description= "Assign a new index to every face";
+ ot->idname= "MESH_OT_navmesh_reset";
+
+ /* api callbacks */
+ ot->poll= navmesh_obmode_poll;
+ ot->exec= navmesh_reset_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int navmesh_clear_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Object *ob = ED_object_active_context(C);
+ Mesh *me= ob->data;
+
+ CustomData_free_layers(&me->fdata, CD_RECAST, me->totface);
+
+ DAG_id_tag_update(&me->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, &me->id);
+
+ return OPERATOR_FINISHED;
+}
+
+void MESH_OT_navmesh_clear(struct wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "NavMesh Clear Data";
+ ot->description= "Remove navmesh data from this mesh";
+ ot->idname= "MESH_OT_navmesh_clear";
+
+ /* api callbacks */
+ ot->poll= navmesh_obmode_data_poll;
+ ot->exec= navmesh_clear_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index 282eeef906f..b1f0daeaddc 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -151,6 +151,14 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_solidify);
WM_operatortype_append(MESH_OT_select_nth);
+
+#ifdef WITH_GAMEENGINE
+ WM_operatortype_append(MESH_OT_navmesh_make);
+ WM_operatortype_append(MESH_OT_navmesh_face_copy);
+ WM_operatortype_append(MESH_OT_navmesh_face_add);
+ WM_operatortype_append(MESH_OT_navmesh_reset);
+ WM_operatortype_append(MESH_OT_navmesh_clear);
+#endif
}
#if 0 /* UNUSED, remove? */
diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt
index b9b8ddc6305..c78c9fddbe8 100644
--- a/source/blender/editors/object/CMakeLists.txt
+++ b/source/blender/editors/object/CMakeLists.txt
@@ -58,16 +58,6 @@ set(SRC
object_intern.h
)
-if(WITH_GAMEENGINE)
- list(APPEND INC
- ../../../../extern/recastnavigation/Recast/Include
- )
-
- list(APPEND SRC
- object_navmesh.cpp
- )
-endif()
-
if(WITH_PYTHON)
add_definitions(-DWITH_PYTHON)
endif()
diff --git a/source/blender/editors/object/SConscript b/source/blender/editors/object/SConscript
index cdda16582ef..d4739236ba1 100644
--- a/source/blender/editors/object/SConscript
+++ b/source/blender/editors/object/SConscript
@@ -1,13 +1,13 @@
#!/usr/bin/python
Import ('env')
-sources = env.Glob('*.c') + env.Glob('*.cpp')
+sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc ../../blenloader'
incs += ' ../../makesrna ../../python ../../ikplugin'
incs += ' ../../render/extern/include ../../gpu' # for object_bake.c
-incs += ' #extern/recastnavigation/Recast/Include'
+incs += ' #extern/recastnavigation'
defs = []
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index e4c0a03f1ed..8e3776e438e 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -176,12 +176,18 @@ float ED_object_new_primitive_matrix(bContext *C, Object *obedit, float *loc, fl
/********************* Add Object Operator ********************/
+void view_align_update(struct Main *UNUSED(main), struct Scene *UNUSED(scene), struct PointerRNA *ptr)
+{
+ RNA_struct_idprops_unset(ptr, "rotation");
+}
+
void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
{
PropertyRNA *prop;
/* note: this property gets hidden for add-camera operator */
- RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
+ prop= RNA_def_boolean(ot->srna, "view_align", 0, "Align to View", "Align the new object to the view");
+ RNA_def_property_update_runtime(prop, view_align_update);
if(do_editmode) {
prop= RNA_def_boolean(ot->srna, "enter_editmode", 0, "Enter Editmode", "Enter editmode when adding this object");
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 07c006a7995..446c359b9f2 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -883,7 +883,8 @@ static void multiresbake_start(MultiresBakeRender *bkr)
finish_images(bkr);
}
-static int multiresbake_check(bContext *C, wmOperator *op) {
+static int multiresbake_check(bContext *C, wmOperator *op)
+{
Scene *scene= CTX_data_scene(C);
Object *ob;
Mesh *me;
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index dbd74d8b6c8..fa0c75a0707 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -800,7 +800,7 @@ static void UNUSED_FUNCTION(special_editmenu)(Scene *scene, View3D *v3d)
Object *par= modifiers_isDeformedByArmature(ob);
if(par && (par->mode & OB_MODE_POSE)) {
- nr= pupmenu("Specials%t|Apply Bone Envelopes to Vertex Groups %x1|Apply Bone Heat Weights to Vertex Groups %x2");
+// XXX nr= pupmenu("Specials%t|Apply Bone Envelopes to Vertex Groups %x1|Apply Bone Heat Weights to Vertex Groups %x2");
// XXX if(nr==1 || nr==2)
// XXX pose_adds_vgroups(ob, (nr == 2));
@@ -1223,7 +1223,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
cu1->vfontbi= cu->vfontbi;
id_us_plus((ID *)cu1->vfontbi);
- BKE_text_to_curve(scene, base->object, 0); /* needed? */
+ BKE_text_to_curve(bmain, scene, base->object, 0); /* needed? */
BLI_strncpy(cu1->family, cu->family, sizeof(cu1->family));
@@ -1370,7 +1370,7 @@ static void UNUSED_FUNCTION(copy_attr_menu)(Main *bmain, Scene *scene, View3D *v
strcat (str, "|Object Constraints%x22");
strcat (str, "|NLA Strips%x26");
-// XXX if (OB_SUPPORT_MATERIAL(ob)) {
+// XXX if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
// strcat(str, "|Texture Space%x17");
// }
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 434111c1227..7bb98f4aeb1 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -225,10 +225,5 @@ void OBJECT_OT_group_remove(struct wmOperatorType *ot);
/* object_bake.c */
void OBJECT_OT_bake_image(wmOperatorType *ot);
-/* object_navmesh.cpp */
-void OBJECT_OT_create_navmesh(struct wmOperatorType *ot);
-void OBJECT_OT_assign_navpolygon(struct wmOperatorType *ot);
-void OBJECT_OT_assign_new_navpolygon(struct wmOperatorType *ot);
-
#endif /* ED_OBJECT_INTERN_H */
diff --git a/source/blender/editors/object/object_navmesh.cpp b/source/blender/editors/object/object_navmesh.cpp
deleted file mode 100644
index ae97b40eb49..00000000000
--- a/source/blender/editors/object/object_navmesh.cpp
+++ /dev/null
@@ -1,628 +0,0 @@
-/**
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2004 by Blender Foundation
-* All rights reserved.
-*
-* The Original Code is: all of this file.
-*
-* Contributor(s): none yet.
-*
-* ***** END GPL LICENSE BLOCK *****
-*/
-
-#include <math.h>
-#include "Recast.h"
-
-extern "C"
-{
-#include "MEM_guardedalloc.h"
-
-#include "DNA_scene_types.h"
-#include "DNA_object_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_ID.h"
-
-#include "BKE_library.h"
-#include "BKE_depsgraph.h"
-#include "BKE_context.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_scene.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_cdderivedmesh.h"
-#include "BLI_editVert.h"
-#include "BLI_listbase.h"
-#include "BLI_utildefines.h"
-#include "ED_object.h"
-#include "BLI_math_vector.h"
-
-#include "RNA_access.h"
-
-#include "ED_mesh.h"
-
-/*mesh/mesh_intern.h */
-extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example);
-extern struct EditFace *addfacelist(EditMesh *em, struct EditVert *v1, struct EditVert *v2, struct EditVert *v3, struct EditVert *v4, struct EditFace *example, struct EditFace *exampleEdges);
-extern void free_vertlist(EditMesh *em, ListBase *edve);
-extern void free_edgelist(EditMesh *em, ListBase *lb);
-extern void free_facelist(EditMesh *em, ListBase *lb);
-
-#include "WM_api.h"
-#include "WM_types.h"
-
-static void createVertsTrisData(bContext *C, LinkNode* obs, int& nverts, float*& verts, int &ntris, int*& tris)
-{
- MVert *mvert;
- int nfaces = 0, *tri, i, curnverts, basenverts, curnfaces;
- MFace *mface;
- float co[3], wco[3];
- Object *ob;
- LinkNode *oblink, *dmlink;
- DerivedMesh *dm;
- Scene* scene = CTX_data_scene(C);
- LinkNode* dms = NULL;
-
- nverts = 0;
- ntris = 0;
- //calculate number of verts and tris
- for (oblink = obs; oblink; oblink = oblink->next)
- {
- ob = (Object*) oblink->link;
- DerivedMesh *dm = mesh_create_derived_no_virtual(scene, ob, NULL, CD_MASK_MESH);
- BLI_linklist_append(&dms, (void*)dm);
-
- nverts += dm->getNumVerts(dm);
- nfaces = dm->getNumFaces(dm);
- ntris += nfaces;
-
- //resolve quad faces
- mface = dm->getFaceArray(dm);
- for (i=0; i<nfaces; i++)
- {
- MFace* mf = &mface[i];
- if (mf->v4)
- ntris+=1;
- }
- }
-
- //create data
- verts = (float*) MEM_mallocN(sizeof(float)*3*nverts, "verts");
- tris = (int*) MEM_mallocN(sizeof(int)*3*ntris, "faces");
-
- basenverts = 0;
- tri = tris;
- for (oblink = obs, dmlink = dms; oblink && dmlink;
- oblink = oblink->next, dmlink = dmlink->next)
- {
- ob = (Object*) oblink->link;
- dm = (DerivedMesh*) dmlink->link;
-
- curnverts = dm->getNumVerts(dm);
- mvert = dm->getVertArray(dm);
- //copy verts
- for (i=0; i<curnverts; i++)
- {
- MVert *v = &mvert[i];
- copy_v3_v3(co, v->co);
- mul_v3_m4v3(wco, ob->obmat, co);
- verts[3*(basenverts+i)+0] = wco[0];
- verts[3*(basenverts+i)+1] = wco[2];
- verts[3*(basenverts+i)+2] = wco[1];
- }
-
- //create tris
- curnfaces = dm->getNumFaces(dm);
- mface = dm->getFaceArray(dm);
- for (i=0; i<curnfaces; i++)
- {
- MFace* mf = &mface[i];
- tri[0]= basenverts + mf->v1; tri[1]= basenverts + mf->v3; tri[2]= basenverts + mf->v2;
- tri += 3;
- if (mf->v4)
- {
- tri[0]= basenverts + mf->v1; tri[1]= basenverts + mf->v4; tri[2]= basenverts + mf->v3;
- tri += 3;
- }
- }
- basenverts += curnverts;
- }
-
- //release derived mesh
- for (dmlink = dms; dmlink; dmlink = dmlink->next)
- {
- dm = (DerivedMesh*) dmlink->link;
- dm->release(dm);
- }
- BLI_linklist_free(dms, NULL);
-}
-
-static bool buildNavMesh(const RecastData& recastParams, int nverts, float* verts, int ntris, int* tris,
- rcPolyMesh*& pmesh, rcPolyMeshDetail*& dmesh)
-{
- float bmin[3], bmax[3];
- rcHeightfield* solid;
- unsigned char *triflags;
- rcCompactHeightfield* chf;
- rcContourSet *cset;
-
- rcCalcBounds(verts, nverts, bmin, bmax);
-
- //
- // Step 1. Initialize build config.
- //
- rcConfig cfg;
- memset(&cfg, 0, sizeof(cfg));
- {
-/*
- float cellsize = 0.3f;
- float cellheight = 0.2f;
- float agentmaxslope = M_PI/4;
- float agentmaxclimb = 0.9f;
- float agentheight = 2.0f;
- float agentradius = 0.6f;
- float edgemaxlen = 12.0f;
- float edgemaxerror = 1.3f;
- float regionminsize = 50.f;
- float regionmergesize = 20.f;
- int vertsperpoly = 6;
- float detailsampledist = 6.0f;
- float detailsamplemaxerror = 1.0f;
- cfg.cs = cellsize;
- cfg.ch = cellheight;
- cfg.walkableSlopeAngle = agentmaxslope/M_PI*180.f;
- cfg.walkableHeight = (int)ceilf(agentheight/ cfg.ch);
- cfg.walkableClimb = (int)floorf(agentmaxclimb / cfg.ch);
- cfg.walkableRadius = (int)ceilf(agentradius / cfg.cs);
- cfg.maxEdgeLen = (int)(edgemaxlen/cellsize);
- cfg.maxSimplificationError = edgemaxerror;
- cfg.minRegionSize = (int)rcSqr(regionminsize);
- cfg.mergeRegionSize = (int)rcSqr(regionmergesize);
- cfg.maxVertsPerPoly = vertsperpoly;
- cfg.detailSampleDist = detailsampledist< 0.9f ? 0 : cellsize * detailsampledist;
- cfg.detailSampleMaxError = cellheight * detailsamplemaxerror;
-*/
- cfg.cs = recastParams.cellsize;
- cfg.ch = recastParams.cellheight;
- cfg.walkableSlopeAngle = recastParams.agentmaxslope/((float)M_PI)*180.f;
- cfg.walkableHeight = (int)ceilf(recastParams.agentheight/ cfg.ch);
- cfg.walkableClimb = (int)floorf(recastParams.agentmaxclimb / cfg.ch);
- cfg.walkableRadius = (int)ceilf(recastParams.agentradius / cfg.cs);
- cfg.maxEdgeLen = (int)(recastParams.edgemaxlen/recastParams.cellsize);
- cfg.maxSimplificationError = recastParams.edgemaxerror;
- cfg.minRegionSize = (int)rcSqr(recastParams.regionminsize);
- cfg.mergeRegionSize = (int)rcSqr(recastParams.regionmergesize);
- cfg.maxVertsPerPoly = recastParams.vertsperpoly;
- cfg.detailSampleDist = recastParams.detailsampledist< 0.9f ? 0 :
- recastParams.cellsize * recastParams.detailsampledist;
- cfg.detailSampleMaxError = recastParams.cellheight * recastParams.detailsamplemaxerror;
-
- }
-
- // Set the area where the navigation will be build.
- vcopy(cfg.bmin, bmin);
- vcopy(cfg.bmax, bmax);
- rcCalcGridSize(cfg.bmin, cfg.bmax, cfg.cs, &cfg.width, &cfg.height);
-
- //
- // Step 2. Rasterize input polygon soup.
- //
- // Allocate voxel heightfield where we rasterize our input data to.
- solid = new rcHeightfield;
- if (!solid)
- return false;
-
- if (!rcCreateHeightfield(*solid, cfg.width, cfg.height, cfg.bmin, cfg.bmax, cfg.cs, cfg.ch))
- return false;
-
- // Allocate array that can hold triangle flags.
- triflags = (unsigned char*) MEM_mallocN(sizeof(unsigned char)*ntris, "triflags");
- if (!triflags)
- return false;
- // Find triangles which are walkable based on their slope and rasterize them.
- memset(triflags, 0, ntris*sizeof(unsigned char));
- rcMarkWalkableTriangles(cfg.walkableSlopeAngle, verts, nverts, tris, ntris, triflags);
- rcRasterizeTriangles(verts, nverts, tris, triflags, ntris, *solid);
- MEM_freeN(triflags);
- MEM_freeN(verts);
- MEM_freeN(tris);
-
- //
- // Step 3. Filter walkables surfaces.
- //
- rcFilterLedgeSpans(cfg.walkableHeight, cfg.walkableClimb, *solid);
- rcFilterWalkableLowHeightSpans(cfg.walkableHeight, *solid);
-
- //
- // Step 4. Partition walkable surface to simple regions.
- //
-
- chf = new rcCompactHeightfield;
- if (!chf)
- return false;
- if (!rcBuildCompactHeightfield(cfg.walkableHeight, cfg.walkableClimb, RC_WALKABLE, *solid, *chf))
- return false;
-
- delete solid;
-
- // Prepare for region partitioning, by calculating distance field along the walkable surface.
- if (!rcBuildDistanceField(*chf))
- return false;
-
- // Partition the walkable surface into simple regions without holes.
- if (!rcBuildRegions(*chf, cfg.walkableRadius, cfg.borderSize, cfg.minRegionSize, cfg.mergeRegionSize))
- return false;
-
- //
- // Step 5. Trace and simplify region contours.
- //
- // Create contours.
- cset = new rcContourSet;
- if (!cset)
- return false;
-
- if (!rcBuildContours(*chf, cfg.maxSimplificationError, cfg.maxEdgeLen, *cset))
- return false;
-
- //
- // Step 6. Build polygons mesh from contours.
- //
- pmesh = new rcPolyMesh;
- if (!pmesh)
- return false;
- if (!rcBuildPolyMesh(*cset, cfg.maxVertsPerPoly, *pmesh))
- return false;
-
-
- //
- // Step 7. Create detail mesh which allows to access approximate height on each polygon.
- //
-
- dmesh = new rcPolyMeshDetail;
- if (!dmesh)
- return false;
-
- if (!rcBuildPolyMeshDetail(*pmesh, *chf, cfg.detailSampleDist, cfg.detailSampleMaxError, *dmesh))
- return false;
-
- delete chf;
- delete cset;
-
- return true;
-}
-
-static Object* createRepresentation(bContext *C, rcPolyMesh*& pmesh, rcPolyMeshDetail*& dmesh, Base* base)
-{
- float co[3], rot[3];
- EditMesh *em;
- int i,j, k;
- unsigned short* v;
- int face[3];
- Main *bmain = CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
- Object* obedit;
- int createob = base==NULL;
- zero_v3(co);
- zero_v3(rot);
- if (createob)
- {
- //create new object
- obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, 1);
- }
- else
- {
- obedit = base->object;
- scene_select_base(scene, base);
- copy_v3_v3(obedit->loc, co);
- copy_v3_v3(obedit->rot, rot);
- }
-
- ED_object_enter_editmode(C, EM_DO_UNDO|EM_IGNORE_LAYER);
- em = BKE_mesh_get_editmesh(((Mesh *)obedit->data));
-
- if (!createob)
- {
- //clear
- if(em->verts.first) free_vertlist(em, &em->verts);
- if(em->edges.first) free_edgelist(em, &em->edges);
- if(em->faces.first) free_facelist(em, &em->faces);
- if(em->selected.first) BLI_freelistN(&(em->selected));
- }
-
- //create verts for polygon mesh
- for(i = 0; i < pmesh->nverts; i++) {
- v = &pmesh->verts[3*i];
- co[0] = pmesh->bmin[0] + v[0]*pmesh->cs;
- co[1] = pmesh->bmin[1] + v[1]*pmesh->ch;
- co[2] = pmesh->bmin[2] + v[2]*pmesh->cs;
- SWAP(float, co[1], co[2]);
- addvertlist(em, co, NULL);
- }
-
- //create custom data layer to save polygon idx
- CustomData_add_layer_named(&em->fdata, CD_RECAST, CD_CALLOC, NULL, 0, "recastData");
-
- //create verts and faces for detailed mesh
- for (i=0; i<dmesh->nmeshes; i++)
- {
- int uniquevbase = em->totvert;
- unsigned short vbase = dmesh->meshes[4*i+0];
- unsigned short ndv = dmesh->meshes[4*i+1];
- unsigned short tribase = dmesh->meshes[4*i+2];
- unsigned short trinum = dmesh->meshes[4*i+3];
- const unsigned short* p = &pmesh->polys[i*pmesh->nvp*2];
- int nv = 0;
- for (j = 0; j < pmesh->nvp; ++j)
- {
- if (p[j] == 0xffff) break;
- nv++;
- }
- //create unique verts
- for (j=nv; j<ndv; j++)
- {
- copy_v3_v3(co, &dmesh->verts[3*(vbase + j)]);
- SWAP(float, co[1], co[2]);
- addvertlist(em, co, NULL);
- }
-
- EM_init_index_arrays(em, 1, 0, 0);
-
- //create faces
- for (j=0; j<trinum; j++)
- {
- unsigned char* tri = &dmesh->tris[4*(tribase+j)];
- EditFace* newFace;
- for (k=0; k<3; k++)
- {
- if (tri[k]<nv)
- face[k] = p[tri[k]]; //shared vertex
- else
- face[k] = uniquevbase+tri[k]-nv; //unique vertex
- }
- newFace = addfacelist(em, EM_get_vert_for_index(face[0]), EM_get_vert_for_index(face[2]),
- EM_get_vert_for_index(face[1]), NULL, NULL, NULL);
-
- //set navigation polygon idx to the custom layer
- int* polygonIdx = (int*)CustomData_em_get(&em->fdata, newFace->data, CD_RECAST);
- *polygonIdx = i+1; //add 1 to avoid zero idx
- }
-
- EM_free_index_arrays();
- }
-
- delete pmesh; pmesh = NULL;
- delete dmesh; dmesh = NULL;
-
- BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
-
- DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
-
- ED_object_exit_editmode(C, EM_FREEDATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit);
-
- if (createob)
- {
- obedit->gameflag &= ~OB_COLLISION;
- obedit->gameflag |= OB_NAVMESH;
- obedit->body_type = OB_BODY_TYPE_NAVMESH;
- rename_id((ID *)obedit, "Navmesh");
- }
-
- ModifierData *md= modifiers_findByType(obedit, eModifierType_NavMesh);
- if (!md)
- {
- ED_object_modifier_add(NULL, bmain, scene, obedit, NULL, eModifierType_NavMesh);
- }
-
- return obedit;
-}
-
-static int create_navmesh_exec(bContext *C, wmOperator *op)
-{
- Scene* scene = CTX_data_scene(C);
- int nverts, ntris;
- float* verts;
- int* tris;
- rcPolyMesh* pmesh;
- rcPolyMeshDetail* dmesh;
- LinkNode* obs = NULL;
- Base* navmeshBase = NULL;
- //CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) //expand macros to avoid error in convertion from void*
- {
- ListBase ctx_data_list;
- CollectionPointerLink *ctx_link;
- CTX_data_selected_editable_bases(C, &ctx_data_list);
- for(ctx_link = (CollectionPointerLink *)ctx_data_list.first;
- ctx_link; ctx_link = (CollectionPointerLink *)ctx_link->next) {
- Base* base= (Base*)ctx_link->ptr.data;
- {
- if (base->object->body_type==OB_BODY_TYPE_NAVMESH)
- {
- if (!navmeshBase || base==CTX_data_active_base(C))
- navmeshBase = base;
- }
- else
- BLI_linklist_append(&obs, (void*)base->object);
- }
- CTX_DATA_END;
- createVertsTrisData(C, obs, nverts, verts, ntris, tris);
- BLI_linklist_free(obs, NULL);
- buildNavMesh(scene->gm.recastData, nverts, verts, ntris, tris, pmesh, dmesh);
- createRepresentation(C, pmesh, dmesh, navmeshBase);
-
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_create_navmesh(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Create navigation mesh";
- ot->description= "Create navigation mesh for selected objects";
- ot->idname= "OBJECT_OT_create_navmesh";
-
- /* api callbacks */
- ot->exec= create_navmesh_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int assign_navpolygon_poll(bContext *C)
-{
- Object *ob= (Object *)CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
- if (!ob || !ob->data)
- return 0;
- return (((Mesh*)ob->data)->edit_mesh != NULL);
-}
-
-static int assign_navpolygon_exec(bContext *C, wmOperator *op)
-{
- Object *obedit= CTX_data_edit_object(C);
- EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
-
- //do work here
- int targetPolyIdx = -1;
- EditFace *ef, *efa;
- efa = EM_get_actFace(em, 0);
- if (efa)
- {
- if (CustomData_has_layer(&em->fdata, CD_RECAST))
- {
- targetPolyIdx = *(int*)CustomData_em_get(&em->fdata, efa->data, CD_RECAST);
- targetPolyIdx = targetPolyIdx>=0? targetPolyIdx : -targetPolyIdx;
- if (targetPolyIdx>0)
- {
- //set target poly idx to other selected faces
- ef = (EditFace*)em->faces.last;
- while(ef)
- {
- if((ef->f & SELECT )&& ef!=efa)
- {
- int* recastDataBlock = (int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
- *recastDataBlock = targetPolyIdx;
- }
- ef = ef->prev;
- }
- }
- }
- }
-
- DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
- BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_assign_navpolygon(struct wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Assign polygon index";
- ot->description= "Assign polygon index to face by active face";
- ot->idname= "OBJECT_OT_assign_navpolygon";
-
- /* api callbacks */
- ot->poll = assign_navpolygon_poll;
- ot->exec= assign_navpolygon_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int compare(const void * a, const void * b){
- return ( *(int*)a - *(int*)b );
-}
-static int findFreeNavPolyIndex(EditMesh* em)
-{
- //construct vector of indices
- int numfaces = em->totface;
- int* indices = new int[numfaces];
- EditFace* ef = (EditFace*)em->faces.last;
- int idx = 0;
- while(ef)
- {
- int polyIdx = *(int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
- indices[idx] = polyIdx;
- idx++;
- ef = ef->prev;
- }
- qsort(indices, numfaces, sizeof(int), compare);
- //search first free index
- int freeIdx = 1;
- for (int i=0; i<numfaces; i++)
- {
- if (indices[i]==freeIdx)
- freeIdx++;
- else if (indices[i]>freeIdx)
- break;
- }
- delete [] indices;
- return freeIdx;
-}
-
-static int assign_new_navpolygon_exec(bContext *C, wmOperator *op)
-{
- Object *obedit= CTX_data_edit_object(C);
- EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
-
- EditFace *ef;
- if (CustomData_has_layer(&em->fdata, CD_RECAST))
- {
- int targetPolyIdx = findFreeNavPolyIndex(em);
- if (targetPolyIdx>0)
- {
- //set target poly idx to selected faces
- ef = (EditFace*)em->faces.last;
- while(ef)
- {
- if(ef->f & SELECT )
- {
- int* recastDataBlock = (int*)CustomData_em_get(&em->fdata, ef->data, CD_RECAST);
- *recastDataBlock = targetPolyIdx;
- }
- ef = ef->prev;
- }
- }
- }
-
- DAG_id_tag_update((ID*)obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
-
- BKE_mesh_end_editmesh((Mesh*)obedit->data, em);
- return OPERATOR_FINISHED;
-}
-
-void OBJECT_OT_assign_new_navpolygon(struct wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Assign new polygon index";
- ot->description= "Assign new polygon index to face";
- ot->idname= "OBJECT_OT_assign_new_navpolygon";
-
- /* api callbacks */
- ot->poll = assign_navpolygon_poll;
- ot->exec= assign_new_navpolygon_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-}
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 452d1aded51..5a2437b1911 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -214,12 +214,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_bake_image);
WM_operatortype_append(OBJECT_OT_drop_named_material);
-
-#ifdef WITH_GAMEENGINE
- WM_operatortype_append(OBJECT_OT_create_navmesh);
- WM_operatortype_append(OBJECT_OT_assign_navpolygon);
- WM_operatortype_append(OBJECT_OT_assign_new_navpolygon);
-#endif
}
@@ -230,6 +224,7 @@ void ED_operatormacros_object(void)
ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
+ ot->description = "Duplicate selected objects and move them";
WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF);
@@ -238,6 +233,7 @@ void ED_operatormacros_object(void)
/* grr, should be able to pass options on... */
ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
+ ot->description = "Duplicate selected objects and move them";
otmacro= WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
RNA_boolean_set(otmacro->ptr, "linked", 1);
otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
@@ -247,6 +243,7 @@ void ED_operatormacros_object(void)
/* XXX */
ot= WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
+ ot->description = "Add named object at cursor";
RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add");
WM_operatortype_macro_define(ot, "VIEW3D_OT_cursor3d");
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index ec5aa19d3c0..389c0941cc2 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1243,9 +1243,11 @@ static int allow_make_links_data(int ev, Object *ob, Object *obt)
return 1;
break;
case MAKE_LINKS_MATERIALS:
- if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL) &&
- ELEM5(obt->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_MBALL))
+ if (OB_TYPE_SUPPORT_MATERIAL(ob->type) &&
+ OB_TYPE_SUPPORT_MATERIAL(obt->type))
+ {
return 1;
+ }
break;
case MAKE_LINKS_ANIMDATA:
case MAKE_LINKS_DUPLIGROUP:
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 4c29490b0f0..4ca7d272503 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -230,21 +230,9 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op,
if (!(ob->mode & OB_MODE_WEIGHT_PAINT)) {
/* run provided clearing function */
clear_func(ob);
-
- /* auto keyframing */
- if (autokeyframe_cfra_can_key(scene, &ob->id)) {
- ListBase dsources = {NULL, NULL};
-
- /* now insert the keyframe(s) using the Keying Set
- * 1) add datasource override for the Object
- * 2) insert keyframes
- * 3) free the extra info
- */
- ANIM_relative_keyingset_add_source(&dsources, &ob->id, NULL, NULL);
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
- BLI_freelistN(&dsources);
- }
-
+
+ ED_autokeyframe_object(C, scene, ob, ks);
+
/* tag for updates */
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 797cf428969..7b4db347315 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -756,7 +756,8 @@ static void vgroup_normalize(Object *ob)
It returns the number that it added (0-2)
It relies on verts having -1 for unassigned indices
*/
-static int tryToAddVerts(int *verts, int length, int a, int b) {
+static int tryToAddVerts(int *verts, int length, int a, int b)
+{
char containsA = FALSE;
char containsB = FALSE;
int added = 0;
@@ -786,7 +787,8 @@ and returns an array of indices of size count
count is an int passed by reference so it can be assigned the value of the length here.
*/
-static int* getSurroundingVerts(Mesh *me, int vert, int *count) {
+static int* getSurroundingVerts(Mesh *me, int vert, int *count)
+{
int length = 0;
int *tverts;
int *verts = NULL;
@@ -848,7 +850,8 @@ static int* getSurroundingVerts(Mesh *me, int vert, int *count) {
/* get a single point in space by averaging a point cloud (vectors of size 3)
coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud
*/
-static void getSingleCoordinate(MVert *points, int count, float coord[3]) {
+static void getSingleCoordinate(MVert *points, int count, float coord[3])
+{
int i;
zero_v3(coord);
for(i = 0; i < count; i++) {
@@ -875,7 +878,8 @@ static void getNearestPointOnPlane(const float norm[3], const float coord[3], co
}
/* distance of two vectors a and b of size length */
-static float distance(float* a, float *b, int length) {
+static float distance(float* a, float *b, int length)
+{
int i;
float sum = 0;
for(i = 0; i < length; i++) {
@@ -888,7 +892,9 @@ static float distance(float* a, float *b, int length) {
compute the amount of vertical distance relative to the plane and store it in dists,
then get the horizontal and vertical change and store them in changes
*/
-static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, float *start, float distToStart, float *end, float (*changes)[2], float *dists, int index) {
+static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, float *start, float distToStart,
+ float *end, float (*changes)[2], float *dists, int index)
+{
// A=Q-((Q-P).N)N
// D = (a*x0 + b*y0 +c*z0 +d)
float projA[3] = {0}, projB[3] = {0};
@@ -906,7 +912,8 @@ static void getVerticalAndHorizontalChange(float *norm, float d, float *coord, f
}
// I need the derived mesh to be forgotten so the positions are recalculated with weight changes (see dm_deform_recalc)
-static void dm_deform_clear(DerivedMesh *dm, Object *ob) {
+static void dm_deform_clear(DerivedMesh *dm, Object *ob)
+{
if(ob->derivedDeform && (ob->derivedDeform)==dm) {
ob->derivedDeform->needsFree = 1;
ob->derivedDeform->release(ob->derivedDeform);
@@ -919,19 +926,23 @@ static void dm_deform_clear(DerivedMesh *dm, Object *ob) {
}
// recalculate the deformation
-static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob) {
+static DerivedMesh* dm_deform_recalc(Scene *scene, Object *ob)
+{
return mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
}
-/* by changing nonzero weights, try to move a vertex in me->mverts with index 'index' to distToBe distance away from the provided plane
-strength can change distToBe so that it moves towards distToBe by that percentage
-cp changes how much the weights are adjusted to check the distance
+/* by changing nonzero weights, try to move a vertex in me->mverts with index 'index' to
+distToBe distance away from the provided plane strength can change distToBe so that it moves
+towards distToBe by that percentage cp changes how much the weights are adjusted
+to check the distance
index is the index of the vertex being moved
norm and d are the plane's properties for the equation: ax + by + cz + d = 0
coord is a point on the plane
*/
-static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3], float coord[3], float d, float distToBe, float strength, float cp) {
+static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, int index, float norm[3],
+ float coord[3], float d, float distToBe, float strength, float cp)
+{
DerivedMesh *dm;
MDeformWeight *dw;
MVert m;
@@ -939,7 +950,7 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
int totweight = dvert->totweight;
float oldw = 0;
float oldPos[3] = {0};
- float vc, hc, dist;
+ float vc, hc, dist = 0.0f /* Not necessary, but quites down gcc warnings! */;
int i, k;
float (*changes)[2] = MEM_mallocN(sizeof(float *)*totweight*2, "vertHorzChange");
float *dists = MEM_mallocN(sizeof(float)*totweight, "distance");
@@ -955,10 +966,8 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
wasChange = FALSE;
dm = dm_deform_recalc(scene, ob);
dm->getVert(dm, index, &m);
- oldPos[0] = m.co[0];
- oldPos[1] = m.co[1];
- oldPos[2] = m.co[2];
- distToStart = norm[0]*oldPos[0] + norm[1]*oldPos[1] + norm[2]*oldPos[2] + d;
+ copy_v3_v3(oldPos, m.co);
+ distToStart = dot_v3v3(norm, oldPos) + d;
if(distToBe == originalDistToBe) {
distToBe += distToStart - distToStart*strength;
@@ -1088,7 +1097,8 @@ static void moveCloserToDistanceFromPlane(Scene *scene, Object *ob, Mesh *me, in
dm_deform_clear(dm, ob); dm = NULL;
}
}
- }while(wasChange && (distToStart-distToBe)/fabs(distToStart-distToBe) == (dists[bestIndex]-distToBe)/fabs(dists[bestIndex]-distToBe));
+ } while(wasChange && (distToStart-distToBe)/fabs(distToStart-distToBe) ==
+ (dists[bestIndex]-distToBe)/fabs(dists[bestIndex]-distToBe));
MEM_freeN(upDown);
MEM_freeN(changes);
MEM_freeN(dists);
@@ -1123,18 +1133,14 @@ static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength,
if(count >= 3) {
float d /*, dist */ /* UNUSED */, mag;
- float coord[3] = {0};
- float norm[3] = {0};
+ float coord[3];
+ float norm[3];
getSingleCoordinate(p, count, coord);
dm->getVert(dm, i, &m);
- norm[0] = m.co[0]-coord[0];
- norm[1] = m.co[1]-coord[1];
- norm[2] = m.co[2]-coord[2];
- mag = sqrt(norm[0]*norm[0] + norm[1]*norm[1] + norm[2]*norm[2]);
- if(mag) {// zeros fix
- mul_v3_fl(norm, 1.0f/mag);
-
- d = -norm[0]*coord[0] -norm[1]*coord[1] -norm[2]*coord[2];
+ sub_v3_v3v3(norm, m.co, coord);
+ mag= normalize_v3(norm);
+ if(mag) { /* zeros fix */
+ d = -dot_v3v3(norm, coord);
/* dist = (norm[0]*m.co[0] + norm[1]*m.co[1] + norm[2]*m.co[2] + d); */ /* UNUSED */
moveCloserToDistanceFromPlane(scene, ob, me, i, norm, coord, d, distToBe, strength, cp);
}
@@ -2317,7 +2323,8 @@ void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others");
+ RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active",
+ "Keep the values of the active group while normalizing others");
}
static int vertex_group_fix_exec(bContext *C, wmOperator *op)
@@ -2355,7 +2362,8 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
/* identifiers */
ot->name= "Fix Vertex Group Deform";
ot->idname= "OBJECT_OT_vertex_group_fix";
- ot->description= "Modify the position of selected vertices by changing only their respective groups' weights (this tool may be slow for many vertices).";
+ ot->description= "Modify the position of selected vertices by changing only their respective "
+ "groups' weights (this tool may be slow for many vertices)";
/* api callbacks */
ot->poll= vertex_group_poll;
@@ -2363,9 +2371,11 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_float(ot->srna, "dist", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "The distance to move to.", -10.0f, 10.0f);
- RNA_def_float(ot->srna, "strength", 1.f, -2.0f, FLT_MAX, "Strength", "The distance moved can be changed by this multiplier.", -2.0f, 2.0f);
- RNA_def_float(ot->srna, "accuracy", 1.0f, 0.05f, FLT_MAX, "Change Sensitivity", "Changes the amount weights are altered with each iteration: lower values are slower.", 0.05f, 1.f);
+ RNA_def_float(ot->srna, "dist", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "The distance to move to", -10.0f, 10.0f);
+ RNA_def_float(ot->srna, "strength", 1.f, -2.0f, FLT_MAX, "Strength",
+ "The distance moved can be changed by this multiplier", -2.0f, 2.0f);
+ RNA_def_float(ot->srna, "accuracy", 1.0f, 0.05f, FLT_MAX, "Change Sensitivity",
+ "Change the amount weights are altered with each iteration: lower values are slower", 0.05f, 1.f);
}
@@ -2423,8 +2433,10 @@ void OBJECT_OT_vertex_group_invert(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights", "Add verts from groups that have zero weight before inverting");
- RNA_def_boolean(ot->srna, "auto_remove", TRUE, "Remove Weights", "Remove verts from groups that have zero weight after inverting");
+ RNA_def_boolean(ot->srna, "auto_assign", TRUE, "Add Weights",
+ "Add verts from groups that have zero weight before inverting");
+ RNA_def_boolean(ot->srna, "auto_remove", TRUE, "Remove Weights",
+ "Remove verts from groups that have zero weight after inverting");
}
@@ -2513,7 +2525,8 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot)
/* identifiers */
ot->name= "Mirror Vertex Group";
ot->idname= "OBJECT_OT_vertex_group_mirror";
- ot->description= "Mirror all vertex groups, flip weights and/or names, editing only selected vertices, flipping when both sides are selected otherwise copy from unselected";
+ ot->description= "Mirror all vertex groups, flip weights and/or names, editing only selected vertices, "
+ "flipping when both sides are selected otherwise copy from unselected";
/* api callbacks */
ot->poll= vertex_group_poll_edit;
@@ -2585,7 +2598,9 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
if((change == 0 && fail == 0) || fail) {
- BKE_reportf(op->reports, RPT_ERROR, "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indicies", change, fail);
+ BKE_reportf(op->reports, RPT_ERROR,
+ "Copy to VGroups to Selected warning done %d, failed %d, object data must have matching indicies",
+ change, fail);
}
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 74e91cf32ea..019d6df9b73 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -3918,7 +3918,7 @@ void PE_undo_push(Scene *scene, const char *str)
/* make new */
edit->curundo= undo= MEM_callocN(sizeof(PTCacheUndo), "particle undo file");
- strncpy(undo->name, str, 64-1);
+ BLI_strncpy(undo->name, str, sizeof(undo->name));
BLI_addtail(&edit->undo, undo);
/* and limit amount to the maximum */
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 11796d01620..918adcac138 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -844,7 +844,7 @@ static void fluidsim_delete_until_lastframe(FluidsimSettings *fss)
return;
}
-static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
+static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, short do_job)
{
Scene *scene= CTX_data_scene(C);
int i;
@@ -871,12 +871,10 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
ListBase *fobjects = MEM_callocN(sizeof(ListBase), "fluid objects");
FluidsimModifierData *fluidmd = NULL;
Mesh *mesh = NULL;
-
- wmJob *steve;
+
FluidBakeJob *fb;
elbeemSimulationSettings *fsset= MEM_callocN(sizeof(elbeemSimulationSettings), "Fluid sim settings");
-
- steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Fluid Simulation", WM_JOB_PROGRESS);
+
fb= MEM_callocN(sizeof(FluidBakeJob), "fluid bake job");
if(getenv(strEnvName)) {
@@ -1083,12 +1081,25 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
/* custom data for fluid bake job */
fb->settings = fsset;
- /* setup job */
- WM_jobs_customdata(steve, fb, fluidbake_free);
- WM_jobs_timer(steve, 0.1, NC_SCENE|ND_FRAME, NC_SCENE|ND_FRAME);
- WM_jobs_callbacks(steve, fluidbake_startjob, NULL, NULL, fluidbake_endjob);
-
- WM_jobs_start(CTX_wm_manager(C), steve);
+ if(do_job) {
+ wmJob *steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), scene, "Fluid Simulation", WM_JOB_PROGRESS);
+
+ /* setup job */
+ WM_jobs_customdata(steve, fb, fluidbake_free);
+ WM_jobs_timer(steve, 0.1, NC_SCENE|ND_FRAME, NC_SCENE|ND_FRAME);
+ WM_jobs_callbacks(steve, fluidbake_startjob, NULL, NULL, fluidbake_endjob);
+
+ WM_jobs_start(CTX_wm_manager(C), steve);
+ }
+ else {
+ short dummy_stop, dummy_do_update;
+ float dummy_progress;
+
+ /* blocking, use with exec() */
+ fluidbake_startjob((void *)fb, &dummy_stop, &dummy_do_update, &dummy_progress);
+ fluidbake_endjob((void *)fb);
+ fluidbake_free((void *)fb);
+ }
/* ******** free stored animation data ******** */
fluidbake_free_data(channels, fobjects, NULL, NULL);
@@ -1121,7 +1132,7 @@ FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *UNUSED(fss))
}
/* only compile dummy functions */
-static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object *UNUSED(ob))
+static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object *UNUSED(ob), short UNUSED(do_job))
{
return 0;
}
@@ -1130,13 +1141,21 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object
/***************************** Operators ******************************/
-static int fluid_bake_exec(bContext *C, wmOperator *op)
+static int fluid_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
/* only one bake job at a time */
if(WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C)))
- return 0;
+ return OPERATOR_CANCELLED;
- if(!fluidsimBake(C, op->reports, CTX_data_active_object(C)))
+ if(!fluidsimBake(C, op->reports, CTX_data_active_object(C), TRUE))
+ return OPERATOR_CANCELLED;
+
+ return OPERATOR_FINISHED;
+}
+
+static int fluid_bake_exec(bContext *C, wmOperator *op)
+{
+ if(!fluidsimBake(C, op->reports, CTX_data_active_object(C), FALSE))
return OPERATOR_CANCELLED;
return OPERATOR_FINISHED;
@@ -1150,6 +1169,7 @@ void FLUID_OT_bake(wmOperatorType *ot)
ot->idname= "FLUID_OT_bake";
/* api callbacks */
+ ot->invoke= fluid_bake_invoke;
ot->exec= fluid_bake_exec;
ot->poll= ED_operator_object_active_editable;
}
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index cf886452aa8..638f62435f7 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -345,7 +345,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
/* copy over object color, in case material uses it */
copy_v4_v4(base->object->col, sp->col);
- if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) {
+ if(OB_TYPE_SUPPORT_MATERIAL(base->object->type)) {
/* don't use assign_material, it changed mat->id.us, which shows in the UI */
Material ***matar= give_matarar(base->object);
int actcol= MAX2(base->object->actcol > 0, 1) - 1;
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index dd577e3fb2d..304f167a61f 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -725,6 +725,9 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
prefsizex= ar->sizex?ar->sizex:ar->type->prefsizex;
if(ar->regiontype==RGN_TYPE_HEADER)
prefsizey= ar->type->prefsizey;
+ else if(ar->regiontype==RGN_TYPE_UI && sa->spacetype == SPACE_FILE) {
+ prefsizey= UI_UNIT_Y * 2 + (UI_UNIT_Y/2);
+ }
else
prefsizey= ar->sizey?ar->sizey:ar->type->prefsizey;
@@ -1269,9 +1272,9 @@ static const char *editortype_pup(void)
"|Outliner %x3"
"|User Preferences %x19"
"|Info%x7"
-
+
"|%l"
-
+
"|File Browser %x5"
"|%l"
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index f56ae17d366..827c14b1c0d 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -279,18 +279,7 @@ void setlinestyle(int nr)
void set_inverted_drawing(int enable)
{
glLogicOp(enable?GL_INVERT:GL_COPY);
-
- /* Use GL_BLEND_EQUATION_EXT on sgi (if we have it),
- * apparently GL_COLOR_LOGIC_OP doesn't work on O2?
- * Is this an sgi bug or our bug?
- */
-#if defined(__sgi) && defined(GL_BLEND_EQUATION_EXT)
- glBlendEquationEXT(enable?GL_LOGIC_OP:GL_FUNC_ADD_EXT);
- glToggle(GL_BLEND, enable);
-#else
glToggle(GL_COLOR_LOGIC_OP, enable);
-#endif
-
glToggle(GL_DITHER, !enable);
}
@@ -375,7 +364,8 @@ void fdrawXORcirc(float xofs, float yofs, float rad)
set_inverted_drawing(0);
}
-void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments) {
+void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments)
+{
int i;
glBegin(GL_TRIANGLE_FAN);
@@ -389,7 +379,8 @@ void glutil_draw_filled_arc(float start, float angle, float radius, int nsegment
glEnd();
}
-void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments) {
+void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments)
+{
int i;
glBegin(GL_LINE_STRIP);
@@ -808,7 +799,8 @@ void bglBegin(int mode)
}
}
-int bglPointHack(void) {
+int bglPointHack(void)
+{
float value[4];
int pointhack_px;
glGetFloatv(GL_POINT_SIZE_RANGE, value);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 9dbede754f3..c0ced572515 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -358,9 +358,13 @@ typedef struct UndoImageTile {
struct UndoImageTile *next, *prev;
char idname[MAX_ID_NAME]; /* name instead of pointer*/
+ char ibufname[IB_FILENAME_SIZE];
void *rect;
int x, y;
+
+ short source;
+ char gen_type;
} UndoImageTile;
static ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0};
@@ -391,8 +395,9 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
int allocsize;
for(tile=lb->first; tile; tile=tile->next)
- if(tile->x == x_tile && tile->y == y_tile && strcmp(tile->idname, ima->id.name)==0)
- return tile->rect;
+ if(tile->x == x_tile && tile->y == y_tile && ima->gen_type == tile->gen_type && ima->source == tile->source)
+ if(strcmp(tile->idname, ima->id.name)==0 && strcmp(tile->ibufname, ibuf->name)==0)
+ return tile->rect;
if (*tmpibuf==NULL)
*tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect);
@@ -406,6 +411,11 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char);
tile->rect= MEM_mapallocN(allocsize, "UndeImageTile.rect");
+ strcpy(tile->ibufname, ibuf->name);
+
+ tile->gen_type= ima->gen_type;
+ tile->source= ima->source;
+
undo_copy_tile(tile, *tmpibuf, ibuf, 0);
undo_paint_push_count_alloc(UNDO_PAINT_IMAGE, allocsize);
@@ -426,18 +436,30 @@ static void image_undo_restore(bContext *C, ListBase *lb)
for(tile=lb->first; tile; tile=tile->next) {
/* find image based on name, pointer becomes invalid with global undo */
- if(ima && strcmp(tile->idname, ima->id.name)==0);
+ if(ima && strcmp(tile->idname, ima->id.name)==0) {
+ /* ima is valid */
+ }
else {
- for(ima=bmain->image.first; ima; ima=ima->id.next)
- if(strcmp(tile->idname, ima->id.name)==0)
- break;
+ ima= BLI_findstring(&bmain->image, tile->idname, offsetof(ID, name));
}
ibuf= BKE_image_get_ibuf(ima, NULL);
+ if(ima && ibuf && strcmp(tile->ibufname, ibuf->name)!=0) {
+ /* current ImBuf filename was changed, probably current frame
+ was changed when paiting on image sequence, rather than storing
+ full image user (which isn't so obvious, btw) try to find ImBuf with
+ matched file name in list of already loaded images */
+
+ ibuf= BLI_findstring(&ima->ibufs, tile->ibufname, offsetof(ImBuf, name));
+ }
+
if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float))
continue;
+ if (ima->gen_type != tile->gen_type || ima->source != tile->source)
+ continue;
+
undo_copy_tile(tile, tmpibuf, ibuf, 1);
GPU_free_image(ima); /* force OpenGL reload */
@@ -1900,11 +1922,13 @@ static int IsectPT2Df_limit(float pt[2], float v1[2], float v2[2], float v3[2],
/* Clip the face by a bucket and set the uv-space bucket_bounds_uv
* so we have the clipped UV's to do pixel intersection tests with
* */
-static int float_z_sort_flip(const void *p1, const void *p2) {
+static int float_z_sort_flip(const void *p1, const void *p2)
+{
return (((float *)p1)[2] < ((float *)p2)[2] ? 1:-1);
}
-static int float_z_sort(const void *p1, const void *p2) {
+static int float_z_sort(const void *p1, const void *p2)
+{
return (((float *)p1)[2] < ((float *)p2)[2] ?-1:1);
}
@@ -2706,9 +2730,7 @@ static void project_bucket_init(const ProjPaintState *ps, const int thread_index
tpage = project_paint_face_image(ps, face_index);
if (tpage_last != tpage) {
tpage_last = tpage;
-
- image_index = -1; /* sanity check */
-
+
for (image_index=0; image_index < ps->image_tot; image_index++) {
if (ps->projImages[image_index].ima == tpage_last) {
ibuf = ps->projImages[image_index].ibuf;
@@ -3728,7 +3750,8 @@ static void do_projectpaint_draw(ProjPaintState *ps, ProjPixel *projPixel, float
}
}
-static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, int use_color_correction) {
+static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, int use_color_correction)
+{
if (ps->is_texbrush) {
/* rgba already holds a texture result here from higher level function */
float rgba_br[3];
@@ -3744,7 +3767,7 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, flo
if(use_color_correction){
srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb);
}
- else {
+ else {
VECCOPY(rgba, ps->brush->rgb);
}
rgba[3] = 1.0;
@@ -4917,7 +4940,6 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
time= PIL_check_seconds_timer();
tablet= 0;
- pressure= 0;
pop->s.blend= pop->s.brush->blend;
if(event->custom == EVT_DATA_TABLET) {
@@ -4928,8 +4950,9 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event)
if(wmtab->Active == EVT_TABLET_ERASER)
pop->s.blend= IMB_BLEND_ERASE_ALPHA;
}
- else /* otherwise airbrush becomes 1.0 pressure instantly */
+ else { /* otherwise airbrush becomes 1.0 pressure instantly */
pressure= pop->prev_pressure ? pop->prev_pressure : 1.0f;
+ }
if(pop->first) {
pop->prevmouse[0]= event->mval[0];
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c
index ba0c2c8be92..345cda63f5a 100644
--- a/source/blender/editors/sculpt_paint/paint_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_undo.c
@@ -34,6 +34,7 @@
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "DNA_userdef_types.h"
@@ -106,7 +107,7 @@ static void undo_stack_push_begin(UndoStack *stack, const char *name, UndoRestor
BLI_addtail(&stack->elems, uel);
/* name can be a dynamic string */
- strncpy(uel->name, name, MAXUNDONAME-1);
+ BLI_strncpy(uel->name, name, sizeof(uel->name));
/* limit amount to the maximum amount*/
nr= 0;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 11a46bb373b..cf90c43f3e1 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -290,7 +290,7 @@ static void make_vertexcol(Object *ob) /* single ob */
}
/* mirror_vgroup is set to -1 when invalid */
-static void wpaint_mirror_vgroup_ensure(Object *ob, int *vgroup_mirror)
+static int wpaint_mirror_vgroup_ensure(Object *ob)
{
bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef - 1);
@@ -317,13 +317,12 @@ static void wpaint_mirror_vgroup_ensure(Object *ob, int *vgroup_mirror)
/* curdef should never be NULL unless this is
* a lamp and ED_vgroup_add_name fails */
if(curdef) {
- *vgroup_mirror= mirrdef;
- return;
+ return mirrdef;
}
}
}
- *vgroup_mirror= -1;
+ return -1;
}
static void copy_vpaint_prev(VPaint *vp, unsigned int *mcol, int tot)
@@ -424,9 +423,9 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
vgroup= ob->actdef-1;
- /* if mirror painting, find the other group */
+ /* if mirror painting, find the other group */
if(me->editflag & ME_EDIT_MIRROR_X) {
- wpaint_mirror_vgroup_ensure(ob, &vgroup_mirror);
+ vgroup_mirror= wpaint_mirror_vgroup_ensure(ob);
}
copy_wpaint_prev(wp, me->dvert, me->totvert);
@@ -1114,31 +1113,33 @@ static void do_weight_paint_auto_normalize(MDeformVert *dvert,
#endif
/* the active group should be involved in auto normalize */
-static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, char *map, char do_auto_normalize)
+static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, const char *vgroup_validmap, char do_auto_normalize)
{
-// MDeformWeight *dw = dvert->dw;
- float sum=0.0f, fac=0.0f;
- int i, tot=0;
-
- if (do_auto_normalize == FALSE)
+ if (do_auto_normalize == FALSE) {
return;
+ }
+ else {
+ float sum= 0.0f, fac;
+ unsigned int i, tot=0;
+ MDeformWeight *dw;
+
+ for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ if (vgroup_validmap[dw->def_nr]) {
+ tot++;
+ sum += dw->weight;
+ }
+ }
- for (i=0; i<dvert->totweight; i++) {
- if (map[dvert->dw[i].def_nr]) {
- tot += 1;
- sum += dvert->dw[i].weight;
+ if ((tot == 0) || (sum == 1.0f) || (sum == 0.0f)) {
+ return;
}
- }
-
- if (!tot || sum == 1.0f)
- return;
- fac = sum;
- fac = fac==0.0f ? 1.0f : 1.0f / fac;
+ fac= 1.0f / sum;
- for (i=0; i<dvert->totweight; i++) {
- if (map[dvert->dw[i].def_nr]) {
- dvert->dw[i].weight *= fac;
+ for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ if (vgroup_validmap[dw->def_nr]) {
+ dw->weight *= fac;
+ }
}
}
}
@@ -1580,43 +1581,49 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
)
{
Mesh *me= ob->data;
+ MDeformVert *dv= &me->dvert[index];
MDeformWeight *dw, *uw;
int vgroup= ob->actdef-1;
if(wp->flag & VP_ONLYVGROUP) {
- dw= defvert_find_index(&me->dvert[index], vgroup);
+ dw= defvert_find_index(dv, vgroup);
uw= defvert_find_index(wp->wpaint_prev+index, vgroup);
}
else {
- dw= defvert_verify_index(&me->dvert[index], vgroup);
+ dw= defvert_verify_index(dv, vgroup);
uw= defvert_verify_index(wp->wpaint_prev+index, vgroup);
}
- if(dw==NULL || uw==NULL)
+
+ if(dw==NULL || uw==NULL) {
return;
+ }
/* TODO: De-duplicate the simple weight paint - jason */
/* ... or not, since its <10 SLOC - campbell */
/* If there are no locks or multipaint,
* then there is no need to run the more complicated checks */
- if( (wpi->do_multipaint == FALSE || wpi->defbase_tot_sel <= 1) &&
- (wpi->lock_flags == NULL || has_locked_group(&me->dvert[index], wpi->lock_flags) == FALSE))
+ if( (wpi->do_multipaint == FALSE || wpi->defbase_tot_sel <= 1) &&
+ (wpi->lock_flags == NULL || has_locked_group(dv, wpi->lock_flags) == FALSE))
{
wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, FALSE);
- do_weight_paint_auto_normalize_all_groups(&me->dvert[index], wpi->vgroup_validmap, wpi->do_auto_normalize);
if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
- int j= mesh_get_x_mirror_vert(ob, index);
- if(j>=0) {
+ int index_mirr= mesh_get_x_mirror_vert(ob, index);
+ if(index_mirr != -1) {
+ MDeformVert *dv_mirr= &me->dvert[index_mirr];
/* copy, not paint again */
- uw= defvert_verify_index(me->dvert+j, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup);
-
+ uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup);
uw->weight= dw->weight;
-
- do_weight_paint_auto_normalize_all_groups(me->dvert+j, wpi->vgroup_validmap, wpi->do_auto_normalize);
}
}
+
+ /* important to normalize after mirror, otherwise mirror gets wight
+ * which has already been scaled down in relation to other weights,
+ * then scales a second time [#26193]. Tricky multi-paint code doesn't
+ * suffer from this problem - campbell */
+ do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize);
}
else {
/* use locks and/or multipaint */
@@ -1627,7 +1634,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
float oldChange = 0;
int i;
MDeformWeight *tdw = NULL, *tuw;
- MDeformVert dv= {NULL};
+ MDeformVert dv_copy= {NULL};
oldw = dw->weight;
wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, wpi->do_multipaint && wpi->defbase_tot_sel >1);
@@ -1636,17 +1643,17 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
/* setup multi-paint */
if(wpi->defbase_tot_sel > 1 && wpi->do_multipaint) {
- dv.dw= MEM_dupallocN(me->dvert[index].dw);
- dv.flag = me->dvert[index].flag;
- dv.totweight = me->dvert[index].totweight;
+ dv_copy.dw= MEM_dupallocN(dv->dw);
+ dv_copy.flag = dv->flag;
+ dv_copy.totweight = dv->totweight;
tdw = dw;
tuw = uw;
change = get_mp_change(wp->wpaint_prev+index, wpi->defbase_sel, neww - oldw);
if(change) {
if(!tdw->weight) {
- i = get_first_selected_nonzero_weight(&me->dvert[index], wpi->defbase_sel);
+ i = get_first_selected_nonzero_weight(dv, wpi->defbase_sel);
if(i>=0) {
- tdw = &(me->dvert[index].dw[i]);
+ tdw = &(dv->dw[i]);
tuw = defvert_verify_index(wp->wpaint_prev+index, tdw->def_nr);
}
else {
@@ -1660,7 +1667,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
if( testw > tuw->weight ) {
if(change > oldChange) {
/* reset the weights and use the new change */
- reset_to_prev(wp->wpaint_prev+index, &me->dvert[index]);
+ reset_to_prev(wp->wpaint_prev+index, dv);
}
else {
/* the old change was more significant, so set
@@ -1670,7 +1677,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
}
else {
if(change < oldChange) {
- reset_to_prev(wp->wpaint_prev+index, &me->dvert[index]);
+ reset_to_prev(wp->wpaint_prev+index, dv);
}
else {
change = 0;
@@ -1685,25 +1692,24 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
}
if(apply_mp_locks_normalize(me, wpi, index, dw, tdw, change, oldChange, oldw, neww)) {
- reset_to_prev(&dv, &me->dvert[index]);
+ reset_to_prev(&dv_copy, dv);
change = 0;
oldChange = 0;
}
- if(dv.dw) {
- MEM_freeN(dv.dw);
+ if(dv_copy.dw) {
+ MEM_freeN(dv_copy.dw);
}
- /* dvert may have been altered greatly */
- dw = defvert_find_index(&me->dvert[index], vgroup);
+ /* dv may have been altered greatly */
+ dw = defvert_find_index(dv, vgroup);
if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
- int j= mesh_get_x_mirror_vert(ob, index);
- if(j>=0) {
+ int index_mirr= mesh_get_x_mirror_vert(ob, index);
+ if(index_mirr != -1) {
+ MDeformVert *dv_mirr= &me->dvert[index_mirr];
/* copy, not paint again */
- uw= defvert_verify_index(me->dvert+j, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup);
-
+ uw= defvert_verify_index(dv_mirr, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup);
//uw->weight= dw->weight;
-
- apply_mp_locks_normalize(me, wpi, j, uw, tdw, change, oldChange, oldw, neww);
+ apply_mp_locks_normalize(me, wpi, index_mirr, uw, tdw, change, oldChange, oldw, neww);
}
}
}
@@ -1799,7 +1805,6 @@ struct WPaintData {
float wpimat[3][3];
/*variables for auto normalize*/
- int auto_normalize;
char *vgroup_validmap; /*stores if vgroups tie to deforming bones or not*/
char *lock_flags;
int defbase_tot;
@@ -1810,26 +1815,26 @@ static char *wpaint_make_validmap(Object *ob)
bDeformGroup *dg;
ModifierData *md;
char *vgroup_validmap;
- GHash *gh = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh");
- int i = 0, step1=1;
+ GHash *gh;
+ int i, step1=1;
- /*add all names to a hash table*/
- for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) {
- BLI_ghash_insert(gh, dg->name, NULL);
+ if(ob->defbase.first == NULL) {
+ return NULL;
}
- if (!i)
- return NULL;
+ gh= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh");
- vgroup_validmap= MEM_callocN(i, "wpaint valid map");
+ /*add all names to a hash table*/
+ for (dg=ob->defbase.first; dg; dg=dg->next) {
+ BLI_ghash_insert(gh, dg->name, NULL);
+ }
/*now loop through the armature modifiers and identify deform bones*/
for (md = ob->modifiers.first; md; md= !md->next && step1 ? (step1=0), modifiers_getVirtualModifierList(ob) : md->next) {
if (!(md->mode & (eModifierMode_Realtime|eModifierMode_Virtual)))
continue;
- if (md->type == eModifierType_Armature)
- {
+ if (md->type == eModifierType_Armature) {
ArmatureModifierData *amd= (ArmatureModifierData*) md;
if(amd->object && amd->object->pose) {
@@ -1848,12 +1853,12 @@ static char *wpaint_make_validmap(Object *ob)
}
}
}
-
+
+ vgroup_validmap= MEM_mallocN(BLI_ghash_size(gh), "wpaint valid map");
+
/*add all names to a hash table*/
for (dg=ob->defbase.first, i=0; dg; dg=dg->next, i++) {
- if (BLI_ghash_lookup(gh, dg->name) != NULL) {
- vgroup_validmap[i] = TRUE;
- }
+ vgroup_validmap[i]= (BLI_ghash_lookup(gh, dg->name) != NULL);
}
BLI_ghash_free(gh, NULL, NULL);
@@ -1891,21 +1896,12 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
/*set up auto-normalize, and generate map for detecting which
vgroups affect deform bones*/
- wpd->auto_normalize = ts->auto_normalize;
wpd->defbase_tot = BLI_countlist(&ob->defbase);
wpd->lock_flags = gen_lock_flags(ob, wpd->defbase_tot);
- if (wpd->auto_normalize || ts->multipaint || wpd->lock_flags)
+ if (ts->auto_normalize || ts->multipaint || wpd->lock_flags) {
wpd->vgroup_validmap = wpaint_make_validmap(ob);
-
- // if(qual & LR_CTRLKEY) {
- // sample_wpaint(scene, ar, v3d, 0);
- // return;
- // }
- // if(qual & LR_SHIFTKEY) {
- // sample_wpaint(scene, ar, v3d, 1);
- // return;
- // }
-
+ }
+
/* ALLOCATIONS! no return after this line */
/* painting on subsurfs should give correct points too, this returns me->totvert amount */
wpd->vertexcosnos= mesh_get_mapped_verts_nors(scene, ob);
@@ -1933,9 +1929,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
if(ob->defbase.first==NULL) {
ED_vgroup_add(ob);
}
-
- // if(ob->lay & v3d->lay); else error("Active object is not in this layer");
-
+
/* imat for normals */
mul_m4_m4m4(mat, ob->obmat, wpd->vc.rv3d->viewmat);
invert_m4_m4(imat, mat);
@@ -1943,7 +1937,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
/* if mirror painting, find the other group */
if(me->editflag & ME_EDIT_MIRROR_X) {
- wpaint_mirror_vgroup_ensure(ob, &wpd->vgroup_mirror);
+ wpd->vgroup_mirror= wpaint_mirror_vgroup_ensure(ob);
}
return 1;
@@ -2006,7 +2000,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
wpi.vgroup_validmap= wpd->vgroup_validmap;
wpi.do_flip= RNA_boolean_get(itemptr, "pen_flip");
wpi.do_multipaint= (ts->multipaint != 0);
- wpi.do_auto_normalize= (ts->auto_normalize != 0);
+ wpi.do_auto_normalize= ((ts->auto_normalize != 0) && (wpi.vgroup_validmap != NULL));
/* *** done setting up WeightPaintInfo *** */
@@ -2108,7 +2102,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
if(indexar[index] && indexar[index]<=me->totface) {
MFace *mf= me->mface + (indexar[index]-1);
- unsigned int fidx= mf->v4 ? 3:2;;
+ unsigned int fidx= mf->v4 ? 3:2;
do {
unsigned int vidx= *(&mf->v1 + fidx);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 0bdb027a903..5a888e6f595 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -154,7 +154,7 @@ static int sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
if(mmd) return 0;
- /* non-locked shaoe keys could be handled in the same way as deformed mesh */
+ /* non-locked shape keys could be handled in the same way as deformed mesh */
if((ob->shapeflag&OB_SHAPE_LOCK)==0 && me->key && ob->shapenr)
return 1;
@@ -484,13 +484,11 @@ static float integrate_overlap(Brush* br)
int i;
int m= 10;
float g = 1.0f/m;
- float overlap;
float max;
- overlap= 0;
max= 0;
for(i= 0; i < m; i++) {
- overlap = overlapped_curve(br, i*g);
+ float overlap= overlapped_curve(br, i*g);
if (overlap > max)
max = overlap;
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index 5b72e87f95a..d03c2b19300 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -519,6 +519,7 @@ static int sound_poll(bContext *C)
static int pack_exec(bContext *C, wmOperator *op)
{
+ Main *bmain= CTX_data_main(C);
Editing* ed = CTX_data_scene(C)->ed;
bSound* sound;
@@ -530,7 +531,7 @@ static int pack_exec(bContext *C, wmOperator *op)
if(!sound || sound->packedfile)
return OPERATOR_CANCELLED;
- sound->packedfile= newPackedFile(op->reports, sound->name);
+ sound->packedfile= newPackedFile(op->reports, sound->name, ID_BLEND_PATH(bmain, &sound->id));
sound_load(CTX_data_main(C), sound);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index f541423e69d..619e76e9e50 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -189,7 +189,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
/* if in NLA there's a strip active, map the view */
if (ac->datatype == ANIMCONT_ACTION) {
- adt= ANIM_nla_mapping_get(ac, NULL);
+ /* adt= ANIM_nla_mapping_get(ac, NULL); */ /* UNUSED */
/* start and end of action itself */
calc_action_range(ac->data, &act_start, &act_end, 0);
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 60662334e20..a05053a2d9d 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -233,7 +233,8 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, cons
/* get data to filter, from Action or Dopesheet */
// XXX: what is sel doing here?!
- filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
+ // Commented it, was breaking things (eg. the "auto preview range" tool).
+ filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_SEL *//*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* set large values to try to override */
@@ -458,6 +459,8 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op)
/* copy keyframes */
if (ac.datatype == ANIMCONT_GPENCIL) {
// FIXME...
+ BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode");
+ return OPERATOR_CANCELLED;
}
else {
if (copy_action_keys(&ac)) {
@@ -496,13 +499,15 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if(ac.reports==NULL) {
+ if (ac.reports==NULL) {
ac.reports= op->reports;
}
/* paste keyframes */
if (ac.datatype == ANIMCONT_GPENCIL) {
// FIXME...
+ BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode");
+ return OPERATOR_CANCELLED;
}
else {
if (paste_action_keys(&ac, offset_mode, merge_mode)) {
@@ -679,12 +684,13 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
duplicate_action_keys(&ac);
/* validate keyframes after editing */
- ANIM_editkeyframes_refresh(&ac);
+ if (ac.datatype != ANIMCONT_GPENCIL)
+ ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- return OPERATOR_FINISHED; // xxx - start transform
+ return OPERATOR_FINISHED;
}
static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
@@ -708,9 +714,6 @@ void ACTION_OT_duplicate (wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* to give to transform */
- RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
}
/* ******************** Delete Keyframes Operator ************************* */
@@ -763,7 +766,8 @@ static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
delete_action_keys(&ac);
/* validate keyframes after editing */
- ANIM_editkeyframes_refresh(&ac);
+ if (ac.datatype != ANIMCONT_GPENCIL)
+ ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
@@ -1380,6 +1384,10 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
+ // XXX...
+ if (ac.datatype == ANIMCONT_GPENCIL)
+ return OPERATOR_PASS_THROUGH;
+
/* get snapping mode */
mode= RNA_enum_get(op->ptr, "type");
@@ -1490,6 +1498,10 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
+ // XXX...
+ if (ac.datatype == ANIMCONT_GPENCIL)
+ return OPERATOR_PASS_THROUGH;
+
/* get mirroring mode */
mode= RNA_enum_get(op->ptr, "type");
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index 491d436741e..c3af3521918 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -94,6 +94,7 @@ void ED_operatormacros_action(void)
ot= WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
if (ot) {
+ ot->description= "Make a copy of all selected keyframes and move them";
WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index f61885e9f8e..4f00a5aeeb9 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -226,7 +226,7 @@ static int buttons_context_path_material(ButsContextPath *path, int for_texture)
else if(buttons_context_path_object(path)) {
ob= path->ptr[path->len-1].data;
- if(ob && ob->type && (ob->type<OB_LAMP)) {
+ if(ob && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
ma= give_current_material(ob, ob->actcol);
RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
path->len++;
@@ -759,8 +759,12 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
if(ptr) {
Object *ob= ptr->data;
- if(ob && ob->type && (ob->type<OB_LAMP) && ob->totcol)
- CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, ob->mat+ob->actcol-1);
+ if(ob && OB_TYPE_SUPPORT_MATERIAL(ob->type) && ob->totcol) {
+ /* a valid actcol isn't ensured [#27526] */
+ int matnr= ob->actcol-1;
+ if(matnr < 0) matnr= 0;
+ CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, &ob->mat[matnr]);
+ }
}
return 1;
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 5a965fc076b..1b9e3fdfb4a 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -138,7 +138,7 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar)
wmKeyMap *keymap;
ListBase *lb;
- const int prev_y_min= ar->v2d.cur.ymin; /* so resizing keeps the cursor visible */
+ const float prev_y_min= ar->v2d.cur.ymin; /* so resizing keeps the cursor visible */
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index b2b734159ff..611bf79603e 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -111,8 +111,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
{
/* Button layout. */
const int max_x = ar->winx - 10;
- const int line1_y = IMASEL_BUTTONS_HEIGHT/2 + IMASEL_BUTTONS_MARGIN*2;
- const int line2_y = IMASEL_BUTTONS_MARGIN;
+ const int line1_y = ar->winy - (IMASEL_BUTTONS_HEIGHT/2 + IMASEL_BUTTONS_MARGIN);
+ const int line2_y = line1_y - (IMASEL_BUTTONS_HEIGHT/2 + IMASEL_BUTTONS_MARGIN);
const int input_minw = 20;
const int btn_h = UI_UNIT_Y;
const int btn_fn_w = UI_UNIT_X;
@@ -520,7 +520,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
file_draw_preview(block, file, sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE));
} else {
- file_draw_icon(block, file->path, sx, sy-(UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_WIDTH_SCALE);
+ file_draw_icon(block, file->path, sx, sy-(UI_UNIT_Y / 6), get_file_icon(file), ICON_DEFAULT_WIDTH_SCALE, ICON_DEFAULT_HEIGHT_SCALE);
sx += ICON_DEFAULT_WIDTH_SCALE + 4;
}
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index e61d7693d19..0955d264ca8 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -749,7 +749,9 @@ int file_exec(bContext *C, wmOperator *exec_op)
file_sfile_to_operator(op, sfile, filepath);
- fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir,0, 1);
+ if (BLI_exist(sfile->params->dir))
+ fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir, 0, 1);
+
BLI_make_file_string(G.main->name, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu_get(), filepath);
WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC);
@@ -1174,7 +1176,9 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused))
* until this is properly supported just disable it. */
static int file_directory_poll(bContext *C)
{
- return ED_operator_file_active(C) && filelist_lib(CTX_wm_space_file(C)->files) == NULL;
+ /* sfile->files can be NULL on file load */
+ SpaceFile *sfile= CTX_wm_space_file(C);
+ return ED_operator_file_active(C) && (sfile->files==NULL || filelist_lib(sfile->files)==NULL);
}
void FILE_OT_directory(struct wmOperatorType *ot)
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index c7ada4a5801..c2e45c5ad8a 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -244,7 +244,8 @@ static int compare_size(const void *a1, const void *a2)
else return BLI_natstrcmp(entry1->relname,entry2->relname);
}
-static int compare_extension(const void *a1, const void *a2) {
+static int compare_extension(const void *a1, const void *a2)
+{
const struct direntry *entry1=a1, *entry2=a2;
const char *sufix1, *sufix2;
const char *nil="";
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 1e113abfcd2..e3571886cf4 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -246,6 +246,11 @@ short ED_fileselect_set_params(SpaceFile *sfile)
sfile->folders_prev = folderlist_new();
folderlist_pushdir(sfile->folders_prev, sfile->params->dir);
+ /* switching thumbnails needs to recalc layout [#28809] */
+ if (sfile->layout) {
+ sfile->layout->dirty= TRUE;
+ }
+
return 1;
}
@@ -466,12 +471,13 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
int maxlen = 0;
int numfiles;
int textheight;
+
if (sfile->layout == NULL) {
sfile->layout = MEM_callocN(sizeof(struct FileLayout), "file_layout");
- sfile->layout->dirty = 1;
- }
-
- if (!sfile->layout->dirty) return;
+ sfile->layout->dirty = TRUE;
+ } else if (sfile->layout->dirty == FALSE) {
+ return;
+ }
numfiles = filelist_numfiles(sfile->files);
textheight = (int)file_font_pointsize();
@@ -538,7 +544,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
layout->width = sfile->layout->columns * (layout->tile_w + 2*layout->tile_border_x) + layout->tile_border_x*2;
layout->flag = FILE_LAYOUT_HOR;
}
- layout->dirty= 0;
+ layout->dirty= FALSE;
}
FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar)
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 18270bfaa26..7a70ed9c0a0 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -154,7 +154,7 @@ static void file_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
//printf("file_init\n");
- if(sfile->layout) sfile->layout->dirty= 1;
+ if(sfile->layout) sfile->layout->dirty= TRUE;
}
@@ -242,7 +242,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
BLI_strncpy(sfile->params->renameedit, sfile->params->renamefile, sizeof(sfile->params->renameedit));
params->renamefile[0] = '\0';
}
- if (sfile->layout) sfile->layout->dirty= 1;
+ if (sfile->layout) sfile->layout->dirty= TRUE;
}
@@ -520,9 +520,14 @@ static void file_ui_area_draw(const bContext *C, ARegion *ar)
glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT);
+ /* scrolling here is just annoying, disable it */
+ ar->v2d.cur.ymax= ar->v2d.cur.ymax - ar->v2d.cur.ymin;
+ ar->v2d.cur.ymin= 0;
+
/* set view2d view matrix for scrolling (without scrollers) */
UI_view2d_view_ortho(&ar->v2d);
+
file_draw_buttons(C, ar);
UI_view2d_view_restore(C);
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 28fd1cd3304..f1593105d5b 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -245,13 +245,15 @@ static short get_active_fcurve_keyframe_edit(FCurve *fcu, BezTriple **bezt, BezT
}
/* update callback for active keyframe properties - base updates stuff */
-static void graphedit_activekey_update_cb(bContext *UNUSED(C), void *fcu_ptr, void *UNUSED(bezt_ptr))
+static void graphedit_activekey_update_cb(bContext *C, void *fcu_ptr, void *UNUSED(bezt_ptr))
{
+ SpaceIpo *sipo= CTX_wm_space_graph(C);
+ const short use_handle = !(sipo->flag & SIPO_NOHANDLES);
FCurve *fcu = (FCurve *)fcu_ptr;
/* make sure F-Curve and its handles are still valid after this editing */
sort_time_fcurve(fcu);
- testhandles_fcurve(fcu);
+ testhandles_fcurve(fcu, use_handle);
}
/* update callback for active keyframe properties - handle-editing wrapper */
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 46918407447..fb148a73ed2 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -277,6 +277,7 @@ void ED_operatormacros_graph(void)
ot= WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
if (ot) {
+ ot->description= "Make a copy of all selected keyframes and move them";
WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 45bd1d58a53..33c3ae45a58 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1567,6 +1567,7 @@ static int pack_test(bContext *C, wmOperator *op)
static int pack_exec(bContext *C, wmOperator *op)
{
+ struct Main *bmain= CTX_data_main(C);
Image *ima= CTX_data_edit_image(C);
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
int as_png= RNA_boolean_get(op->ptr, "as_png");
@@ -1582,7 +1583,7 @@ static int pack_exec(bContext *C, wmOperator *op)
if(as_png)
BKE_image_memorypack(ima);
else
- ima->packedfile= newPackedFile(op->reports, ima->name);
+ ima->packedfile= newPackedFile(op->reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index 3121ddaa3b4..126d75e76cb 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -87,7 +87,7 @@ static void info_report_color(unsigned char *fg, unsigned char *bg, Report *repo
if (bool) { bg[0]=220; bg[1]=128; bg[2]=96; }
else { bg[0]=214; bg[1]=122; bg[2]=90; }
}
-#if 0 // XXX: this looks like the selected colour, so don't use this
+#if 0 // XXX: this looks like the selected color, so don't use this
else if (report->type & RPT_OPERATOR_ALL) {
if (bool) { bg[0]=96; bg[1]=128; bg[2]=255; }
else { bg[0]=90; bg[1]=122; bg[2]=249; }
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 75e13b24ede..9157df6960f 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -290,7 +290,7 @@ static void recent_files_menu_register(void)
mt= MEM_callocN(sizeof(MenuType), "spacetype info menu recent files");
strcpy(mt->idname, "INFO_MT_file_open_recent");
- strcpy(mt->label, "Open Recent...");
+ strcpy(mt->label, _("Open Recent..."));
mt->draw= recent_files_menu_draw;
WM_menutype_add(mt);
}
diff --git a/source/blender/editors/space_logic/CMakeLists.txt b/source/blender/editors/space_logic/CMakeLists.txt
index f4bb255e11f..c4f9f49c9a1 100644
--- a/source/blender/editors/space_logic/CMakeLists.txt
+++ b/source/blender/editors/space_logic/CMakeLists.txt
@@ -21,11 +21,11 @@
set(INC
../include
+ ../interface
../../blenfont
../../blenkernel
../../blenlib
../../blenloader
- ../../editors/interface
../../makesdna
../../makesrna
../../windowmanager
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 3a4371e8bb9..eec8bfb469b 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1747,6 +1747,7 @@ static int get_col_actuator(int type)
case ACT_CONSTRAINT: return TH_PANEL;
case ACT_STATE: return TH_PANEL;
case ACT_ARMATURE: return TH_PANEL;
+ case ACT_STEERING: return TH_PANEL;
default: return TH_PANEL;
}
}
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 0472408e95c..2f15cc9130b 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -137,7 +137,7 @@ static uiBlock *socket_component_menu(bContext *C, ARegion *ar, void *args_v)
block= uiBeginBlock(C, ar, "socket menu", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
- layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, U.uistyles.first), 0);
+ layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, UI_GetStyle()), 0);
uiItemR(layout, &args->ptr, "default_value", UI_ITEM_R_EXPAND, "", ICON_NONE);
@@ -796,7 +796,7 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_ThemeColor(TH_TEXT_HI);
layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin+15), (short)(rect.ymax+group_header),
- MIN2((int)(rect.xmax - rect.xmin-18.0f), node_group_frame+20), group_header, U.uistyles.first);
+ MIN2((int)(rect.xmax - rect.xmin-18.0f), node_group_frame+20), group_header, UI_GetStyle());
RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr);
uiTemplateIDBrowse(layout, (bContext*)C, &ptr, "node_tree", NULL, NULL, NULL);
uiBlockLayoutResolve(gnode->block, NULL, NULL);
@@ -1679,6 +1679,7 @@ static void node_composit_buts_map_uv(uiLayout *layout, bContext *UNUSED(C), Poi
static void node_composit_buts_id_mask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "index", 0, NULL, ICON_NONE);
+ uiItemR(layout, ptr, "use_smooth_mask", 0, NULL, ICON_NONE);
}
static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
@@ -2079,7 +2080,7 @@ static void node_texture_buts_output(uiLayout *layout, bContext *UNUSED(C), Poin
/* only once called */
static void node_texture_set_butfunc(bNodeType *ntype)
{
- ntype->uifuncbut = NULL;
+ ntype->uifuncbut = NULL;
if( ntype->type >= TEX_NODE_PROC && ntype->type < TEX_NODE_PROC_MAX ) {
ntype->uifunc = node_texture_buts_proc;
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 430ae0a2cc3..c7744263f04 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1867,7 +1867,7 @@ void NODE_OT_link_viewer(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Link to Viewer Node";
- ot->description = "Link to Viewer Node";
+ ot->description = "Link to viewer node";
ot->idname= "NODE_OT_link_viewer";
/* api callbacks */
@@ -2337,7 +2337,7 @@ void NODE_OT_duplicate(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Duplicate Nodes";
- ot->description = "Duplicate the nodes";
+ ot->description = "Duplicate selected nodes";
ot->idname= "NODE_OT_duplicate";
/* api callbacks */
@@ -2965,12 +2965,13 @@ static int node_read_fullsamplelayers_exec(bContext *C, wmOperator *UNUSED(op))
Render *re= RE_NewRender(curscene->id.name);
WM_cursor_wait(1);
-
RE_MergeFullSample(re, bmain, curscene, snode->nodetree);
- snode_notify(C, snode);
- snode_dag_update(C, snode);
-
WM_cursor_wait(0);
+
+ /* note we are careful to send the right notifier, as otherwise the
+ compositor would reexecute and overwrite the full sample result */
+ WM_event_add_notifier(C, NC_SCENE|ND_COMPO_RESULT, NULL);
+
return OPERATOR_FINISHED;
}
@@ -3327,7 +3328,8 @@ void NODE_OT_delete(wmOperatorType *ot)
}
/* ****************** Delete with reconnect ******************* */
-static int is_connected_to_input_socket(bNode* node, bNodeLink* link) {
+static int is_connected_to_input_socket(bNode* node, bNodeLink* link)
+{
bNodeSocket *sock;
if (link->tonode == node) {
for(sock= node->inputs.first; sock; sock= sock->next) {
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c
index c51eec4085d..084570d905d 100644
--- a/source/blender/editors/space_node/node_header.c
+++ b/source/blender/editors/space_node/node_header.c
@@ -94,7 +94,7 @@ static void do_node_add(bContext *C, bNodeTemplate *ntemp)
else node->flag &= ~NODE_TEST;
}
- node= node_add_node(snode, bmain, scene, ntemp, snode->mx, snode->my);
+ /* node= */ node_add_node(snode, bmain, scene, ntemp, snode->mx, snode->my);
/* select previous selection before autoconnect */
for(node= snode->edittree->nodes.first; node; node= node->next) {
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index 2f29976d4bb..67e6f517c64 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -33,6 +33,7 @@
#ifndef ED_NODE_INTERN_H
#define ED_NODE_INTERN_H
+#include <stddef.h> /* for size_t */
#include "UI_interface.h"
/* internal exports only */
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index f1a8b4b13f8..17319b2bcf6 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -108,19 +108,22 @@ void ED_operatormacros_node(void)
wmOperatorTypeMacro *mot;
ot= WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot->description = "Duplicate selected nodes and move them";
WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
/* modified operator call for duplicating with input links */
ot= WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
+ ot->description = "Duplicate selected nodes keeping input links and move them";
mot = WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
RNA_boolean_set(mot->ptr, "keep_inputs", 1);
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
ot= WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", OPTYPE_UNDO);
+ ot->description = "Select node and link it to a viewer node";
WM_operatortype_macro_define(ot, "NODE_OT_select");
WM_operatortype_macro_define(ot, "NODE_OT_link_viewer");
- }
+}
void node_keymap(struct wmKeyConfig *keyconf)
{
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 73b95fbd936..dc3ef9f5a76 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -180,6 +180,9 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
case ND_FRAME:
ED_area_tag_refresh(sa);
break;
+ case ND_COMPO_RESULT:
+ ED_area_tag_redraw(sa);
+ break;
case ND_TRANSFORM_DONE:
if(type==NTREE_COMPOSIT) {
if(snode->flag & SNODE_AUTO_RENDER) {
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 65ce2e71d8d..10ca482ae0e 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1248,7 +1248,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
if ( (SEARCHING_OUTLINER(soops) || (soops->outlinevis==SO_DATABLOCKS && soops->search_string[0]!=0)) &&
(tselem->flag & TSE_SEARCHMATCH))
{
- /* TODO - add search highlight colour to theme? */
+ /* TODO - add search highlight color to theme? */
glColor4f(0.2f, 0.5f, 0.2f, 0.3f);
glRecti(startx, *starty+1, ar->v2d.cur.xmax, *starty+UI_UNIT_Y-1);
}
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 9fe0ed0543f..dda103b971b 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1544,8 +1544,9 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
while(seq) {
op= need_add_seq_dup(seq);
- if(op==1)
- ten= outliner_add_element(soops, &soops->tree, (void*)seq, NULL, TSE_SEQUENCE, 0);
+ if(op==1) {
+ /* ten= */ outliner_add_element(soops, &soops->tree, (void*)seq, NULL, TSE_SEQUENCE, 0);
+ }
else if(op==0) {
ten= outliner_add_element(soops, &soops->tree, (void*)seq, NULL, TSE_SEQUENCE_DUP, 0);
outliner_add_seq_dup(soops, seq, ten, 0);
@@ -1582,7 +1583,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops)
wmKeyMap *km;
for(km= wm->defaultconf->keymaps.first; km; km= km->next) {
- ten= outliner_add_element(soops, &soops->tree, (void*)km, NULL, TSE_KEYMAP, 0);
+ /* ten= */ outliner_add_element(soops, &soops->tree, (void*)km, NULL, TSE_KEYMAP, 0);
}
}
else {
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 49d8b6b5da4..673ddaebc5f 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -182,6 +182,10 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_NLA_ACTCHANGE:
ED_region_tag_redraw(ar);
break;
+ case ND_ANIMCHAN:
+ if(wmn->action==NA_SELECTED)
+ ED_region_tag_redraw(ar);
+ break;
}
break;
}
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 89e9a22c9a1..a0999c9a03b 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -134,7 +134,7 @@ void SEQUENCER_OT_select_handles(struct wmOperatorType *ot);
void SEQUENCER_OT_select_active_side(struct wmOperatorType *ot);
void SEQUENCER_OT_select_border(struct wmOperatorType *ot);
void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot);
-
+void SEQUENCER_OT_select_grouped(struct wmOperatorType *ot);
/* sequencer_select.c */
void SEQUENCER_OT_scene_strip_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index 5c13b57cca8..b53284136de 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -103,7 +103,8 @@ void sequencer_operatortypes(void)
WM_operatortype_append(SEQUENCER_OT_select_handles);
WM_operatortype_append(SEQUENCER_OT_select_active_side);
WM_operatortype_append(SEQUENCER_OT_select_border);
-
+ WM_operatortype_append(SEQUENCER_OT_select_grouped);
+
/* sequencer_add.c */
WM_operatortype_append(SEQUENCER_OT_scene_strip_add);
WM_operatortype_append(SEQUENCER_OT_movie_strip_add);
@@ -165,7 +166,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_toggle", TABKEY, KM_PRESS, 0, 0);
- WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_make", GKEY, KM_PRESS, KM_SHIFT, 0);
+ WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_make", GKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_meta_separate", GKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
@@ -247,6 +248,8 @@ void sequencer_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "SEQUENCER_OT_select_border", BKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "SEQUENCER_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
+
WM_keymap_add_menu(keymap, "SEQUENCER_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_menu(keymap, "SEQUENCER_MT_change", CKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index a6cc65017bb..7e718dc176a 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -47,6 +47,7 @@
#include "DNA_scene_types.h"
#include "BKE_context.h"
+#include "BKE_report.h"
#include "BKE_sequencer.h"
#include "WM_api.h"
@@ -169,11 +170,11 @@ static void UNUSED_FUNCTION(select_single_seq)(Scene *scene, Sequence *seq, int
if((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) {
if(seq->strip)
- strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1);
+ BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
}
else if(seq->type==SEQ_SOUND) {
if(seq->strip)
- strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1);
+ BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
}
seq->flag|= SELECT;
recurs_sel_seq(seq);
@@ -389,12 +390,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
if(seq->strip) {
- strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1);
+ BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
}
} else
if (seq->type == SEQ_SOUND) {
if(seq->strip) {
- strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1);
+ BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
}
}
@@ -530,7 +531,8 @@ void SEQUENCER_OT_select(wmOperatorType *ot)
/* run recursivly to select linked */
-static int select_more_less_seq__internal(Scene *scene, int sel, int linked) {
+static int select_more_less_seq__internal(Scene *scene, int sel, int linked)
+{
Editing *ed= seq_give_editing(scene, FALSE);
Sequence *seq, *neighbor;
int change=0;
@@ -881,3 +883,270 @@ void SEQUENCER_OT_select_border(wmOperatorType *ot)
/* rna */
WM_operator_properties_gesture_border(ot, FALSE);
}
+
+/* ****** Selected Grouped ****** */
+
+static EnumPropertyItem sequencer_prop_select_grouped_types[] = {
+ {1, "TYPE", 0, "Type", "Shared strip type"},
+ {2, "TYPE_BASIC", 0, "Global Type", "All strips of same basic type (Graphical or Sound)"},
+ {3, "TYPE_EFFECT", 0, "Effect Type",
+ "Shared strip effect type (if active strip is not an effect one, select all non-effect strips)"},
+ {4, "DATA", 0, "Data", "Shared data (scene, image, sound, etc.)"},
+ {5, "EFFECT", 0, "Effect", "Shared effects"},
+ {6, "EFFECT_LINK", 0, "Effect/Linked",
+ "Other strips affected by the active one (sharing some time, and below or effect-assigned)"},
+ {7, "OVERLAP", 0, "Overlap", "Overlapping time"},
+ {0, NULL, 0, NULL, NULL}
+};
+
+#define SEQ_IS_SOUND(_seq) ((_seq->type & SEQ_SOUND) && !(_seq->type & SEQ_EFFECT))
+
+#define SEQ_IS_EFFECT(_seq) (_seq->type & SEQ_EFFECT)
+
+#define SEQ_USE_DATA(_seq) (_seq->type == SEQ_SCENE || SEQ_HAS_PATH(_seq))
+
+static short select_grouped_type(Editing *ed, Sequence *actseq)
+{
+ Sequence *seq;
+ short changed = FALSE;
+
+ SEQP_BEGIN(ed, seq) {
+ if (seq->type == actseq->type) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+
+ return changed;
+}
+
+static short select_grouped_type_basic(Editing *ed, Sequence *actseq)
+{
+ Sequence *seq;
+ short changed = FALSE;
+ short is_sound = SEQ_IS_SOUND(actseq);
+
+ SEQP_BEGIN(ed, seq) {
+ if (is_sound ? SEQ_IS_SOUND(seq) : !SEQ_IS_SOUND(seq)) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+
+ return changed;
+}
+
+static short select_grouped_type_effect(Editing *ed, Sequence *actseq)
+{
+ Sequence *seq;
+ short changed = FALSE;
+ short is_effect = SEQ_IS_EFFECT(actseq);
+
+ SEQP_BEGIN(ed, seq) {
+ if (is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq)) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+
+ return changed;
+}
+
+static short select_grouped_data(Editing *ed, Sequence *actseq)
+{
+ Sequence *seq;
+ short changed = FALSE;
+ Scene *sce = actseq->scene;
+ char *dir = actseq->strip ? actseq->strip->dir : NULL;
+
+ if (!SEQ_USE_DATA(actseq))
+ return changed;
+
+ if (SEQ_HAS_PATH(actseq) && dir) {
+ SEQP_BEGIN(ed, seq) {
+ if (SEQ_HAS_PATH(seq) && seq->strip && strcmp(seq->strip->dir, dir) == 0) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+ }
+ else {
+ SEQP_BEGIN(ed, seq) {
+ if (seq->type == SEQ_SCENE && seq->scene == sce) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+ }
+
+ return changed;
+}
+
+static short select_grouped_effect(Editing *ed, Sequence *actseq)
+{
+ Sequence *seq;
+ short changed = FALSE;
+ short effects[SEQ_EFFECT_MAX+1];
+ int i;
+
+ for (i = 0; i <= SEQ_EFFECT_MAX; i++)
+ effects[i] = FALSE;
+
+ SEQP_BEGIN(ed, seq) {
+ if (ELEM3(actseq, seq->seq1, seq->seq2, seq->seq3)) {
+ effects[seq->type] = TRUE;
+ }
+ }
+ SEQ_END;
+
+ SEQP_BEGIN(ed, seq) {
+ if (effects[seq->type]) {
+ if(seq->seq1) seq->seq1->flag |= SELECT;
+ if(seq->seq2) seq->seq2->flag |= SELECT;
+ if(seq->seq3) seq->seq3->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+
+ return changed;
+}
+
+static short select_grouped_time_overlap(Editing *ed, Sequence *actseq)
+{
+ Sequence *seq;
+ short changed = FALSE;
+
+ SEQP_BEGIN(ed, seq) {
+ if (!((seq->startdisp >= actseq->enddisp) || (seq->enddisp < actseq->startdisp))) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ SEQ_END;
+
+ return changed;
+}
+
+static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
+{
+ Sequence *seq = NULL;
+ short changed = FALSE;
+ short is_audio = ((actseq->type == SEQ_META) || SEQ_IS_SOUND(actseq));
+ int startdisp = actseq->startdisp;
+ int enddisp = actseq->enddisp;
+ int machine = actseq->machine;
+ SeqIterator iter;
+
+ SEQP_BEGIN(ed, seq) {
+ seq->tmp= NULL;
+ }
+ SEQ_END;
+
+ actseq->tmp= SET_INT_IN_POINTER(TRUE);
+
+ for(seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) {
+ seq = iter.seq;
+
+ /* Ignore all seqs already selected! */
+ /* Ignore all seqs not sharing some time with active one. */
+ /* Ignore all seqs of incompatible types (audio vs video). */
+ if ((seq->flag & SELECT) || (seq->startdisp >= enddisp) || (seq->enddisp < startdisp)
+ || (!is_audio && SEQ_IS_SOUND(seq))
+ || (is_audio && !((seq->type == SEQ_META) || SEQ_IS_SOUND(seq))))
+ continue;
+
+ /* If the seq is an effect one, we need extra cheking! */
+ if (SEQ_IS_EFFECT(seq) && ((seq->seq1 && seq->seq1->tmp) ||
+ (seq->seq2 && seq->seq2->tmp) ||
+ (seq->seq3 && seq->seq3->tmp)))
+ {
+ if (startdisp > seq->startdisp) startdisp = seq->startdisp;
+ if (enddisp < seq->enddisp) enddisp = seq->enddisp;
+ if (machine < seq->machine) machine = seq->machine;
+
+ seq->tmp= SET_INT_IN_POINTER(TRUE);
+
+ seq->flag |= SELECT;
+ changed = TRUE;
+
+ /* Unfortunately, we must restart checks from the begining. */
+ seq_end(&iter);
+ seq_begin(ed, &iter, 1);
+ }
+
+ /* Video strips bellow active one, or any strip for audio (order do no matters here!). */
+ else if (seq->machine < machine || is_audio) {
+ seq->flag |= SELECT;
+ changed = TRUE;
+ }
+ }
+ seq_end(&iter);
+
+ return changed;
+}
+
+static int sequencer_select_grouped_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = seq_give_editing(scene, 0);
+ Sequence *seq, *actseq = seq_active_get(scene);
+ int type = RNA_enum_get(op->ptr, "type");
+ short changed = 0, extend;
+
+ extend = RNA_boolean_get(op->ptr, "extend");
+
+ if (actseq == NULL) {
+ BKE_report(op->reports, RPT_ERROR, "No Active Sequence!");
+ return OPERATOR_CANCELLED;
+ }
+
+ if (extend == 0) {
+ SEQP_BEGIN(ed, seq) {
+ seq->flag &= ~SELECT;
+ changed = TRUE;
+ }
+ SEQ_END;
+ }
+
+ if(type==1) changed |= select_grouped_type(ed, actseq);
+ else if(type==2) changed |= select_grouped_type_basic(ed, actseq);
+ else if(type==3) changed |= select_grouped_type_effect(ed, actseq);
+ else if(type==4) changed |= select_grouped_data(ed, actseq);
+ else if(type==5) changed |= select_grouped_effect(ed, actseq);
+ else if(type==6) changed |= select_grouped_effect_link(ed, actseq);
+ else if(type==7) changed |= select_grouped_time_overlap(ed, actseq);
+
+ if (changed) {
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
+ return OPERATOR_FINISHED;
+ }
+
+ return OPERATOR_CANCELLED;
+}
+
+void SEQUENCER_OT_select_grouped(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Select Grouped";
+ ot->description = "Select all strips grouped by various properties";
+ ot->idname = "SEQUENCER_OT_select_grouped";
+
+ /* api callbacks */
+ ot->invoke = WM_menu_invoke;
+ ot->exec = sequencer_select_grouped_exec;
+ ot->poll = sequencer_edit_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
+ ot->prop = RNA_def_enum(ot->srna, "type", sequencer_prop_select_grouped_types, 0, "Type", "");
+}
+
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 685b15aed50..10d355bd0c3 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -508,7 +508,7 @@ void wrap_offset(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int *
{
Text *text;
TextLine *linep;
- int i, j, start, end, chars, max, chop;
+ int i, j, start, end, max, chop;
char ch;
*offl= *offc= 0;
@@ -546,9 +546,9 @@ void wrap_offset(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int *
start= 0;
end= max;
chop= 1;
- chars= 0;
*offc= 0;
for(i=0, j=0; linep->line[j]!='\0'; j++) {
+ int chars;
/* Mimic replacement of tabs */
ch= linep->line[j];
@@ -557,8 +557,9 @@ void wrap_offset(SpaceText *st, ARegion *ar, TextLine *linein, int cursin, int *
if(linep==linein && i<cursin) cursin += chars-1;
ch= ' ';
}
- else
+ else {
chars= 1;
+ }
while(chars--) {
if(i-start>=max) {
@@ -1420,8 +1421,7 @@ static void draw_suggestion_list(SpaceText *st, ARegion *ar)
y -= st->lheight;
- strncpy(str, item->name, SUGG_LIST_WIDTH);
- str[SUGG_LIST_WIDTH] = '\0';
+ BLI_strncpy(str, item->name, SUGG_LIST_WIDTH);
w = text_font_width(st, str);
diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c
index 51b4b838171..08008f455e6 100644
--- a/source/blender/editors/space_text/text_python.c
+++ b/source/blender/editors/space_text/text_python.c
@@ -51,7 +51,7 @@
int text_do_suggest_select(SpaceText *st, ARegion *ar)
{
- SuggItem *item, *first, *last, *sel;
+ SuggItem *item, *first, *last /* , *sel */ /* UNUSED */;
TextLine *tmp;
int l, x, y, w, h, i;
int tgti, *top;
@@ -62,7 +62,7 @@ int text_do_suggest_select(SpaceText *st, ARegion *ar)
first = texttool_suggest_first();
last = texttool_suggest_last();
- sel = texttool_suggest_selected();
+ /* sel = texttool_suggest_selected(); */ /* UNUSED */
top = texttool_suggest_top();
if(!last || !first)
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index fc35ab93f70..83a695ba72a 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -146,7 +146,7 @@ static void cp_shade_color3ub (unsigned char cp[3], const int offset)
}
/* This function sets the gl-color for coloring a certain bone (based on bcolor) */
-static short set_pchan_glColor (short colCode, int boneflag, int constflag)
+static short set_pchan_glColor (short colCode, int boneflag, short constflag)
{
switch (colCode) {
case PCHAN_COLOR_NORMAL:
@@ -438,39 +438,39 @@ static void draw_bonevert_solid(void)
}
static float bone_octahedral_verts[6][3]= {
- { 0.0f, 0.0f, 0.0f},
- { 0.1f, 0.1f, 0.1f},
- { 0.1f, 0.1f, -0.1f},
- {-0.1f, 0.1f, -0.1f},
- {-0.1f, 0.1f, 0.1f},
- { 0.0f, 1.0f, 0.0f}
+ { 0.0f, 0.0f, 0.0f},
+ { 0.1f, 0.1f, 0.1f},
+ { 0.1f, 0.1f, -0.1f},
+ {-0.1f, 0.1f, -0.1f},
+ {-0.1f, 0.1f, 0.1f},
+ { 0.0f, 1.0f, 0.0f}
};
static unsigned int bone_octahedral_wire_sides[8]= {0, 1, 5, 3, 0, 4, 5, 2};
static unsigned int bone_octahedral_wire_square[8]= {1, 2, 3, 4, 1};
static unsigned int bone_octahedral_solid_tris[8][3]= {
- {2, 1, 0}, /* bottom */
- {3, 2, 0},
- {4, 3, 0},
- {1, 4, 0},
-
- {5, 1, 2}, /* top */
- {5, 2, 3},
- {5, 3, 4},
- {5, 4, 1}
+ {2, 1, 0}, /* bottom */
+ {3, 2, 0},
+ {4, 3, 0},
+ {1, 4, 0},
+
+ {5, 1, 2}, /* top */
+ {5, 2, 3},
+ {5, 3, 4},
+ {5, 4, 1}
};
/* aligned with bone_octahedral_solid_tris */
static float bone_octahedral_solid_normals[8][3]= {
- { 0.70710683f, -0.70710683f, 0.00000000f},
- {-0.00000000f, -0.70710683f, -0.70710683f},
- {-0.70710683f, -0.70710683f, 0.00000000f},
- { 0.00000000f, -0.70710683f, 0.70710683f},
- { 0.99388373f, 0.11043154f, -0.00000000f},
- { 0.00000000f, 0.11043154f, -0.99388373f},
- {-0.99388373f, 0.11043154f, 0.00000000f},
- { 0.00000000f, 0.11043154f, 0.99388373f}
+ { 0.70710683f, -0.70710683f, 0.00000000f},
+ {-0.00000000f, -0.70710683f, -0.70710683f},
+ {-0.70710683f, -0.70710683f, 0.00000000f},
+ { 0.00000000f, -0.70710683f, 0.70710683f},
+ { 0.99388373f, 0.11043154f, -0.00000000f},
+ { 0.00000000f, 0.11043154f, -0.99388373f},
+ {-0.99388373f, 0.11043154f, 0.00000000f},
+ { 0.00000000f, 0.11043154f, 0.99388373f}
};
static void draw_bone_octahedral(void)
@@ -697,13 +697,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
vec[0]= - *(si+a) * dirvec[0] + *(co+a) * norvec[0];
vec[1]= - *(si+a) * dirvec[1] + *(co+a) * norvec[1];
vec[2]= - *(si+a) * dirvec[2] + *(co+a) * norvec[2];
-
- vec1[0]= headvec[0] + head*vec[0];
- vec1[1]= headvec[1] + head*vec[1];
- vec1[2]= headvec[2] + head*vec[2];
- vec2[0]= headvec[0] + (head+dist)*vec[0];
- vec2[1]= headvec[1] + (head+dist)*vec[1];
- vec2[2]= headvec[2] + (head+dist)*vec[2];
+
+ madd_v3_v3v3fl(vec1, headvec, vec, head);
+ madd_v3_v3v3fl(vec2, headvec, vec, head + dist);
glColor4ub(255, 255, 255, 50);
glVertex3fv(vec1);
@@ -715,13 +711,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
vec[0]= *(si+a) * dirvec[0] + *(co+a) * norvec[0];
vec[1]= *(si+a) * dirvec[1] + *(co+a) * norvec[1];
vec[2]= *(si+a) * dirvec[2] + *(co+a) * norvec[2];
-
- vec1[0]= tailvec[0] + tail*vec[0];
- vec1[1]= tailvec[1] + tail*vec[1];
- vec1[2]= tailvec[2] + tail*vec[2];
- vec2[0]= tailvec[0] + (tail+dist)*vec[0];
- vec2[1]= tailvec[1] + (tail+dist)*vec[1];
- vec2[2]= tailvec[2] + (tail+dist)*vec[2];
+
+ madd_v3_v3v3fl(vec1, tailvec, vec, tail);
+ madd_v3_v3v3fl(vec2, tailvec, vec, tail + dist);
//glColor4ub(255, 255, 255, 50);
glVertex3fv(vec1);
@@ -733,14 +725,10 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
vec[0]= - *(si) * dirvec[0] + *(co) * norvec[0];
vec[1]= - *(si) * dirvec[1] + *(co) * norvec[1];
vec[2]= - *(si) * dirvec[2] + *(co) * norvec[2];
-
- vec1[0]= headvec[0] + head*vec[0];
- vec1[1]= headvec[1] + head*vec[1];
- vec1[2]= headvec[2] + head*vec[2];
- vec2[0]= headvec[0] + (head+dist)*vec[0];
- vec2[1]= headvec[1] + (head+dist)*vec[1];
- vec2[2]= headvec[2] + (head+dist)*vec[2];
-
+
+ madd_v3_v3v3fl(vec1, headvec, vec, head);
+ madd_v3_v3v3fl(vec2, headvec, vec, head + dist);
+
//glColor4ub(255, 255, 255, 50);
glVertex3fv(vec1);
//glColor4ub(255, 255, 255, 0);
@@ -752,7 +740,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
/* smat, imat = mat & imat to draw screenaligned */
-static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
+static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, int boneflag, short constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
{
float head, tail /*, length*/;
float *headvec, *tailvec, dirvec[3];
@@ -839,21 +827,17 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag,
glLoadName(id | BONESEL_BONE);
glBegin(GL_LINES);
- vec[0]= headvec[0] + norvech[0];
- vec[1]= headvec[1] + norvech[1];
- vec[2]= headvec[2] + norvech[2];
+
+ add_v3_v3v3(vec, headvec, norvech);
glVertex3fv(vec);
- vec[0]= tailvec[0] + norvect[0];
- vec[1]= tailvec[1] + norvect[1];
- vec[2]= tailvec[2] + norvect[2];
+
+ add_v3_v3v3(vec, tailvec, norvect);
glVertex3fv(vec);
- vec[0]= headvec[0] - norvech[0];
- vec[1]= headvec[1] - norvech[1];
- vec[2]= headvec[2] - norvech[2];
+
+ sub_v3_v3v3(vec, headvec, norvech);
glVertex3fv(vec);
- vec[0]= tailvec[0] - norvect[0];
- vec[1]= tailvec[1] - norvect[1];
- vec[2]= tailvec[2] - norvect[2];
+
+ sub_v3_v3v3(vec, tailvec, norvect);
glVertex3fv(vec);
glEnd();
@@ -861,7 +845,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag,
}
/* does wire only for outline selecting */
-static void draw_sphere_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
+static void draw_sphere_bone(int dt, int armflag, int boneflag, short constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
{
GLUquadricObj *qobj;
float head, tail, length;
@@ -991,7 +975,7 @@ static GLubyte bm_dot5[]= {0x0, 0x0, 0x10, 0x38, 0x7c, 0x38, 0x10, 0x0};
static GLubyte bm_dot7[]= {0x0, 0x38, 0x7C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38};
-static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
+static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
{
float length;
@@ -1125,7 +1109,7 @@ static void draw_b_bone_boxes(int dt, bPoseChannel *pchan, float xwidth, float l
}
}
-static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
+static void draw_b_bone(int dt, int armflag, int boneflag, short constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
{
float xwidth, length, zwidth;
@@ -1238,7 +1222,7 @@ static void draw_wire_bone_segments(bPoseChannel *pchan, Mat4 *bbones, float len
}
}
-static void draw_wire_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
+static void draw_wire_bone(int dt, int armflag, int boneflag, short constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone)
{
Mat4 *bbones = NULL;
int segments = 0;
@@ -1288,7 +1272,7 @@ static void draw_wire_bone(int dt, int armflag, int boneflag, int constflag, uns
draw_wire_bone_segments(pchan, bbones, length, segments);
}
-static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, float length)
+static void draw_bone(int dt, int armflag, int boneflag, short constflag, unsigned int id, float length)
{
/* Draw a 3d octahedral bone, we use normalized space based on length,
@@ -1659,7 +1643,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
float smat[4][4], imat[4][4], bmat[4][4];
int index= -1;
short do_dashed= 3, draw_wire= 0;
- short flag, constflag;
+ int flag;
/* being set below */
arm->layer_used= 0;
@@ -1880,6 +1864,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
((G.f & G_PICKSEL)==0 || (bone->flag & BONE_UNSELECTABLE)==0) )
{
if (bone->layer & arm->layer) {
+ const short constflag= pchan->constflag;
if ((do_dashed & 1) && (pchan->parent)) {
/* Draw a line from our root to the parent's tip
* - only if V3D_HIDE_HELPLINES is enabled...
@@ -1901,16 +1886,16 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
* - only if temporary chain (i.e. "autoik")
*/
if (arm->flag & ARM_POSEMODE) {
- if (pchan->constflag & PCHAN_HAS_IK) {
+ if (constflag & PCHAN_HAS_IK) {
if (bone->flag & BONE_SELECTED) {
- if (pchan->constflag & PCHAN_HAS_TARGET) glColor3ub(200, 120, 0);
+ if (constflag & PCHAN_HAS_TARGET) glColor3ub(200, 120, 0);
else glColor3ub(200, 200, 50); // add theme!
glLoadName(index & 0xFFFF);
pchan_draw_IK_root_lines(pchan, !(do_dashed & 2));
}
}
- else if (pchan->constflag & PCHAN_HAS_SPLINEIK) {
+ else if (constflag & PCHAN_HAS_SPLINEIK) {
if (bone->flag & BONE_SELECTED) {
glColor3ub(150, 200, 50); // add theme!
@@ -1935,7 +1920,6 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
flag |= BONE_DRAW_ACTIVE;
/* extra draw service for pose mode */
- constflag= pchan->constflag;
/* set color-set to use */
set_pchan_colorset(ob, pchan);
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index c8c4e6b0a37..b749538b742 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -315,16 +315,24 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m
static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob)
{
unsigned char obcol[4];
- int istex, solidtex= 0;
+ int istex, solidtex;
// XXX scene->obedit warning
- if(v3d->drawtype==OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype!=OB_TEXTURE)) {
+
+ /* texture draw is abused for mask selection mode, do this so wire draw
+ * with face selection in weight paint is not lit. */
+ if((v3d->drawtype <= OB_WIRE) && (ob->mode & OB_MODE_WEIGHT_PAINT)) {
+ solidtex= FALSE;
+ Gtexdraw.islit= 0;
+ }
+ else if(v3d->drawtype==OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype!=OB_TEXTURE)) {
/* draw with default lights in solid draw mode and edit mode */
- solidtex= 1;
+ solidtex= TRUE;
Gtexdraw.islit= -1;
}
else {
/* draw with lights in the scene otherwise */
+ solidtex= FALSE;
Gtexdraw.islit= GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp);
}
@@ -368,7 +376,7 @@ static void draw_textured_end(void)
glPopMatrix();
}
-static int draw_tface__set_draw_legacy(MTFace *tface, MCol *mcol, int matnr)
+static int draw_tface__set_draw_legacy(MTFace *tface, int has_mcol, int matnr)
{
Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
int validtexture=0;
@@ -383,7 +391,7 @@ static int draw_tface__set_draw_legacy(MTFace *tface, MCol *mcol, int matnr)
} else if (ma && ma->shade_flag&MA_OBCOLOR) {
glColor3ubv(Gtexdraw.obcol);
return 2; /* Don't set color */
- } else if (!mcol) {
+ } else if (!has_mcol) {
if (tface) glColor3f(1.0, 1.0, 1.0);
else {
if(ma) {
@@ -400,7 +408,7 @@ static int draw_tface__set_draw_legacy(MTFace *tface, MCol *mcol, int matnr)
return 1; /* Set color from mcol */
}
}
-static int draw_tface__set_draw(MTFace *tface, MCol *mcol, int matnr)
+static int draw_tface__set_draw(MTFace *tface, int has_mcol, int matnr)
{
Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
@@ -410,7 +418,7 @@ static int draw_tface__set_draw(MTFace *tface, MCol *mcol, int matnr)
return 2; /* Don't set color */
} else if (tface && tface->mode&TF_OBCOL) {
return 2; /* Don't set color */
- } else if (!mcol) {
+ } else if (!has_mcol) {
return 1; /* Don't set color */
} else {
return 1; /* Set color from mcol */
@@ -448,9 +456,9 @@ static void add_tface_color_layer(DerivedMesh *dm)
}
} else if (tface && tface->mode&TF_OBCOL) {
for(j=0;j<4;j++) {
- finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[0]);
+ finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[0]);
finalCol[i*4+j].g = FTOCHAR(Gtexdraw.obcol[1]);
- finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[2]);
+ finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[2]);
}
} else if (!mcol) {
if (tface) {
@@ -469,9 +477,9 @@ static void add_tface_color_layer(DerivedMesh *dm)
else copy_v3_v3(col, &ma->r);
for(j=0;j<4;j++) {
- finalCol[i*4+j].b = FTOCHAR(col[2]);
+ finalCol[i*4+j].b = FTOCHAR(col[0]);
finalCol[i*4+j].g = FTOCHAR(col[1]);
- finalCol[i*4+j].r = FTOCHAR(col[0]);
+ finalCol[i*4+j].r = FTOCHAR(col[2]);
}
}
else
@@ -483,9 +491,9 @@ static void add_tface_color_layer(DerivedMesh *dm)
}
} else {
for(j=0;j<4;j++) {
- finalCol[i*4+j].b = mcol[i*4+j].r;
+ finalCol[i*4+j].r = mcol[i*4+j].r;
finalCol[i*4+j].g = mcol[i*4+j].g;
- finalCol[i*4+j].r = mcol[i*4+j].b;
+ finalCol[i*4+j].b = mcol[i*4+j].b;
}
}
}
@@ -497,38 +505,34 @@ static int draw_tface_mapped__set_draw(void *userData, int index)
Mesh *me = (Mesh*)userData;
MTFace *tface = (me->mtface)? &me->mtface[index]: NULL;
MFace *mface = &me->mface[index];
- MCol *mcol = (me->mcol)? &me->mcol[index]: NULL;
const int matnr = mface->mat_nr;
if (mface->flag & ME_HIDE) return 0;
- return draw_tface__set_draw(tface, mcol, matnr);
+ return draw_tface__set_draw(tface, (me->mcol != NULL), matnr);
}
static int draw_em_tf_mapped__set_draw(void *userData, int index)
{
- EditMesh *em = userData;
+ struct {EditMesh *em; short has_mcol; short has_mtface;} *data = userData;
+ EditMesh *em = data->em;
EditFace *efa= EM_get_face_for_index(index);
MTFace *tface;
- MCol *mcol;
int matnr;
if (efa->h)
return 0;
- tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
- mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
+ tface = data->has_mtface ? CustomData_em_get(&em->fdata, efa->data, CD_MTFACE) : NULL;
matnr = efa->mat_nr;
- return draw_tface__set_draw_legacy(tface, mcol, matnr);
+ return draw_tface__set_draw_legacy(tface, data->has_mcol, matnr);
}
static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)
{
Mesh *me = (Mesh*)userData;
- if (me->mface) {
- short matnr= me->mface[index].mat_nr;
- Material *ma= me->mat[matnr];
-
+ if (me->mat && me->mface) {
+ Material *ma= me->mat[me->mface[index].mat_nr];
if (ma && (ma->game.flag & GEMAT_INVISIBLE)) {
return 0;
}
@@ -638,7 +642,13 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
glColor4f(1.0f,1.0f,1.0f,1.0f);
if(ob->mode & OB_MODE_EDIT) {
- dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, me->edit_mesh);
+ struct {EditMesh *em; short has_mcol; short has_mtface;} data;
+
+ data.em= me->edit_mesh;
+ data.has_mcol= CustomData_has_layer(&me->edit_mesh->fdata, CD_MCOL);
+ data.has_mtface= CustomData_has_layer(&me->edit_mesh->fdata, CD_MTFACE);
+
+ dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, &data);
}
else if(faceselect) {
if(ob->mode & OB_MODE_WEIGHT_PAINT)
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 82f72569f95..09ddfd7dc2c 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1369,15 +1369,12 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
{
/* a standing up pyramid with (0,0,0) as top */
Camera *cam;
- float vec[8][4], facx, facy, depth, aspx, aspy, caspx, caspy, shx, shy;
+ float tvec[3];
+ float vec[4][3], asp[2], shift[2], scale[3];
int i;
float drawsize;
const short is_view= (rv3d->persp==RV3D_CAMOB && ob==v3d->camera);
- const float scax= 1.0f / len_v3(ob->obmat[0]);
- const float scay= 1.0f / len_v3(ob->obmat[1]);
- const float scaz= 1.0f / len_v3(ob->obmat[2]);
-
#ifdef VIEW3D_CAMERA_BORDER_HACK
if(is_view && !(G.f & G_PICKSEL)) {
glGetFloatv(GL_CURRENT_COLOR, view3d_camera_border_hack_col);
@@ -1387,82 +1384,43 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
#endif
cam= ob->data;
- aspx= (float) scene->r.xsch*scene->r.xasp;
- aspy= (float) scene->r.ysch*scene->r.yasp;
- if(aspx < aspy) {
- caspx= aspx / aspy;
- caspy= 1.0;
- }
- else {
- caspx= 1.0;
- caspy= aspy / aspx;
- }
-
- glDisable(GL_LIGHTING);
- glDisable(GL_CULL_FACE);
-
- if(cam->type==CAM_ORTHO) {
- facx= 0.5f * cam->ortho_scale * caspx * scax;
- facy= 0.5f * cam->ortho_scale * caspy * scay;
- shx= cam->shiftx * cam->ortho_scale * scax;
- shy= cam->shifty * cam->ortho_scale * scay;
- depth= is_view ? -((cam->clipsta * scaz) + 0.1f) : - cam->drawsize * cam->ortho_scale * scaz;
-
- drawsize= 0.5f * cam->ortho_scale;
- }
- else {
- /* that way it's always visible - clipsta+0.1 */
- float fac;
- drawsize= cam->drawsize / ((scax + scay + scaz) / 3.0f);
+ scale[0]= 1.0f / len_v3(ob->obmat[0]);
+ scale[1]= 1.0f / len_v3(ob->obmat[1]);
+ scale[2]= 1.0f / len_v3(ob->obmat[2]);
- if(is_view) {
- /* fixed depth, variable size (avoids exceeding clipping range) */
- depth = -(cam->clipsta + 0.1f);
- fac = depth / (cam->lens/-16.0f * scaz);
- }
- else {
- /* fixed size, variable depth (stays a reasonable size in the 3D view) */
- depth= drawsize * cam->lens/-16.0f * scaz;
- fac= drawsize;
- }
+ camera_view_frame_ex(scene, cam, cam->drawsize, is_view, scale,
+ asp, shift, &drawsize, vec);
- facx= fac * caspx * scax;
- facy= fac * caspy * scay;
- shx= cam->shiftx*fac*2 * scax;
- shy= cam->shifty*fac*2 * scay;
- }
-
- vec[0][0]= 0.0; vec[0][1]= 0.0; vec[0][2]= 0.0;
- vec[1][0]= shx + facx; vec[1][1]= shy + facy; vec[1][2]= depth;
- vec[2][0]= shx + facx; vec[2][1]= shy - facy; vec[2][2]= depth;
- vec[3][0]= shx - facx; vec[3][1]= shy - facy; vec[3][2]= depth;
- vec[4][0]= shx - facx; vec[4][1]= shy + facy; vec[4][2]= depth;
+ glDisable(GL_LIGHTING);
+ glDisable(GL_CULL_FACE);
/* camera frame */
glBegin(GL_LINE_LOOP);
- glVertex3fv(vec[1]);
- glVertex3fv(vec[2]);
- glVertex3fv(vec[3]);
- glVertex3fv(vec[4]);
+ glVertex3fv(vec[0]);
+ glVertex3fv(vec[1]);
+ glVertex3fv(vec[2]);
+ glVertex3fv(vec[3]);
glEnd();
if(is_view)
return;
+ zero_v3(tvec);
+
/* center point to camera frame */
glBegin(GL_LINE_STRIP);
- glVertex3fv(vec[2]);
- glVertex3fv(vec[0]);
- glVertex3fv(vec[1]);
- glVertex3fv(vec[4]);
- glVertex3fv(vec[0]);
- glVertex3fv(vec[3]);
+ glVertex3fv(vec[1]);
+ glVertex3fv(tvec);
+ glVertex3fv(vec[0]);
+ glVertex3fv(vec[3]);
+ glVertex3fv(tvec);
+ glVertex3fv(vec[2]);
glEnd();
/* arrow on top */
- vec[0][2]= depth;
+ tvec[2]= vec[1][2]; /* copy the depth */
/* draw an outline arrow for inactive cameras and filled
@@ -1473,16 +1431,16 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
else if (i==1 && (ob == v3d->camera)) glBegin(GL_TRIANGLES);
else break;
- vec[0][0]= shx + ((-0.7f * drawsize) * scax);
- vec[0][1]= shy + ((drawsize * (caspy + 0.1f)) * scay);
- glVertex3fv(vec[0]); /* left */
+ tvec[0]= shift[0] + ((-0.7f * drawsize) * scale[0]);
+ tvec[1]= shift[1] + ((drawsize * (asp[1] + 0.1f)) * scale[1]);
+ glVertex3fv(tvec); /* left */
- vec[0][0]= shx + ((0.7f * drawsize) * scax);
- glVertex3fv(vec[0]); /* right */
+ tvec[0]= shift[0] + ((0.7f * drawsize) * scale[0]);
+ glVertex3fv(tvec); /* right */
- vec[0][0]= shx;
- vec[0][1]= shy + ((1.1f * drawsize * (caspy + 0.7f)) * scay);
- glVertex3fv(vec[0]); /* top */
+ tvec[0]= shift[0];
+ tvec[1]= shift[1] + ((1.1f * drawsize * (asp[1] + 0.7f)) * scale[1]);
+ glVertex3fv(tvec); /* top */
glEnd();
}
@@ -1756,7 +1714,8 @@ static void drawSelectedVertices__mapFunc(void *userData, int index, float *co,
}
}
-static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) {
+static void drawSelectedVertices(DerivedMesh *dm, Mesh *me)
+{
glBegin(GL_POINTS);
dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, me->mvert);
glEnd();
@@ -1815,7 +1774,9 @@ static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *ce
if (efa && efa->h==0 && efa->fgonf!=EM_FGON) {
view3d_project_short_clip(data->vc.ar, cent, s, 1);
- data->func(data->userData, efa, s[0], s[1], index);
+ if (s[0] != IS_CLIPPED) {
+ data->func(data->userData, efa, s[0], s[1], index);
+ }
}
}
@@ -5110,6 +5071,7 @@ static void drawspiral(const float cent[3], float rad, float tmat[][4], int star
const float tot_inv= (1.0f / (float)CIRCLE_RESOL);
int a;
char inverse= FALSE;
+ float x, y, fac;
if (start < 0) {
inverse = TRUE;
@@ -5119,38 +5081,54 @@ static void drawspiral(const float cent[3], float rad, float tmat[][4], int star
mul_v3_v3fl(vx, tmat[0], rad);
mul_v3_v3fl(vy, tmat[1], rad);
- copy_v3_v3(vec, cent);
+ glBegin(GL_LINE_STRIP);
if (inverse==0) {
+ copy_v3_v3(vec, cent);
+ glVertex3fv(vec);
+
for(a=0; a<CIRCLE_RESOL; a++) {
- if (a+start>31)
+ if (a+start>=CIRCLE_RESOL)
start=-a + 1;
- glBegin(GL_LINES);
- glVertex3fv(vec);
- vec[0]= cent[0] + sinval[a+start] * (vx[0] * (float)a * tot_inv) + cosval[a+start] * (vy[0] * (float)a * tot_inv);
- vec[1]= cent[1] + sinval[a+start] * (vx[1] * (float)a * tot_inv) + cosval[a+start] * (vy[1] * (float)a * tot_inv);
- vec[2]= cent[2] + sinval[a+start] * (vx[2] * (float)a * tot_inv) + cosval[a+start] * (vy[2] * (float)a * tot_inv);
+
+ fac= (float)a * tot_inv;
+ x= sinval[a+start] * fac;
+ y= cosval[a+start] * fac;
+
+ vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
+ vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
+ vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
+
glVertex3fv(vec);
- glEnd();
}
}
else {
- a=0;
- vec[0]= cent[0] + sinval[a+start] * (vx[0] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[0] * (float)(-a+31) * tot_inv);
- vec[1]= cent[1] + sinval[a+start] * (vx[1] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[1] * (float)(-a+31) * tot_inv);
- vec[2]= cent[2] + sinval[a+start] * (vx[2] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[2] * (float)(-a+31) * tot_inv);
+ fac= (float)(CIRCLE_RESOL-1) * tot_inv;
+ x= sinval[start] * fac;
+ y= cosval[start] * fac;
+
+ vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
+ vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
+ vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
+
+ glVertex3fv(vec);
+
for(a=0; a<CIRCLE_RESOL; a++) {
- if (a+start>31)
+ if (a+start>=CIRCLE_RESOL)
start=-a + 1;
- glBegin(GL_LINES);
- glVertex3fv(vec);
- vec[0]= cent[0] + sinval[a+start] * (vx[0] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[0] * (float)(-a+31) * tot_inv);
- vec[1]= cent[1] + sinval[a+start] * (vx[1] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[1] * (float)(-a+31) * tot_inv);
- vec[2]= cent[2] + sinval[a+start] * (vx[2] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[2] * (float)(-a+31) * tot_inv);
+
+ fac= (float)(-a+(CIRCLE_RESOL-1)) * tot_inv;
+ x= sinval[a+start] * fac;
+ y= cosval[a+start] * fac;
+
+ vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
+ vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
+ vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
glVertex3fv(vec);
- glEnd();
}
}
+
+ glEnd();
}
/* draws a circle on x-z plane given the scaling of the circle, assuming that
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 6c69e816b30..0ad36657196 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -126,7 +126,7 @@ typedef struct {
float ob_scale[3]; // need temp space due to linked values
float ob_dims[3];
short link_scale;
- float ve_median[6];
+ float ve_median[7];
int curdef;
float *defweightp;
} TransformProperties;
@@ -138,11 +138,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL;
MDeformVert *dvert=NULL;
TransformProperties *tfp;
- float median[6], ve_median[6];
+ float median[7], ve_median[7];
int tot, totw, totweight, totedge, totradius;
char defstr[320];
-
- median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= 0.0;
+
+ median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= median[6]= 0.0;
tot= totw= totweight= totedge= totradius= 0;
defstr[0]= 0;
@@ -171,6 +171,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
if((eed->f & SELECT)) {
totedge++;
median[3]+= eed->crease;
+ median[6]+= eed->bweight;
}
eed= eed->next;
}
@@ -284,7 +285,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
median[0] /= (float)tot;
median[1] /= (float)tot;
median[2] /= (float)tot;
- if(totedge) median[3] /= (float)totedge;
+ if (totedge) {
+ median[3] /= (float)totedge;
+ median[6] /= (float)totedge;
+ }
else if(totw) median[3] /= (float)totw;
if(totweight) median[4] /= (float)totweight;
if(totradius) median[5] /= (float)totradius;
@@ -299,78 +303,82 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
uiBlockBeginAlign(block);
if(tot==1) {
- uiDefBut(block, LABEL, 0, "Vertex:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "Vertex:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
+ but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 90, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
+ but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 70, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
+ but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
if(totw==1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 50, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
+ uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
+ uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
uiBlockEndAlign(block);
if(totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 0, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "");
+ 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, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
+ 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, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
+ uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
+ uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
uiBlockEndAlign(block);
if(totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "");
+ 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, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs");
+ 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 {
- uiDefBut(block, LABEL, 0, "Median:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "Median:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
+ but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 90, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
+ but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 70, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
+ but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
if(totw==tot) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 50, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 25, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
+ uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
+ uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
uiBlockEndAlign(block);
if(totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 0, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal");
if(totradius)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs");
uiBlockEndAlign(block);
}
else {
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 45, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
+ uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
+ uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
uiBlockEndAlign(block);
if(totweight)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal");
if(totradius)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 0, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
uiBlockEndAlign(block);
}
}
-
- if(totedge==1)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease:", 0, 20, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
- else if(totedge>1)
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Crease:", 0, 20, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
-
+
+ if(totedge==1){
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, "");
+ }
+ else if(totedge>1){
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, "");
+ }
+
}
else { // apply
memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median));
@@ -384,6 +392,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
median[3]= ve_median[3]-median[3];
median[4]= ve_median[4]-median[4];
median[5]= ve_median[5]-median[5];
+ median[6]= ve_median[6]-median[6];
if(ob->type==OB_MESH) {
Mesh *me= ob->data;
@@ -405,7 +414,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
if(median[3] != 0.0f) {
EditEdge *eed;
const float fixed_crease= (ve_median[3] <= 0.0f ? 0.0f : (ve_median[3] >= 1.0f ? 1.0f : FLT_MAX));
-
+
if(fixed_crease != FLT_MAX) {
/* simple case */
@@ -449,6 +458,52 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
+ if (median[6] != 0.0f) {
+ EditEdge *eed;
+ const float fixed_bweight= (ve_median[6] <= 0.0f ? 0.0f : (ve_median[6] >= 1.0f ? 1.0f : FLT_MAX));
+
+ if(fixed_bweight != FLT_MAX) {
+ /* simple case */
+
+ for(eed= em->edges.first; eed; eed= eed->next) {
+ if(eed->f & SELECT) {
+ eed->bweight= fixed_bweight;
+ }
+ }
+ }
+ else {
+ /* scale crease to target median */
+ float median_new= ve_median[6];
+ float median_orig= ve_median[6] - median[6]; /* previous median value */
+
+ /* incase of floating point error */
+ CLAMP(median_orig, 0.0f, 1.0f);
+ CLAMP(median_new, 0.0f, 1.0f);
+
+ if(median_new < median_orig) {
+ /* scale down */
+ const float sca= median_new / median_orig;
+
+ for(eed= em->edges.first; eed; eed= eed->next) {
+ if(eed->f & SELECT) {
+ eed->bweight *= sca;
+ CLAMP(eed->bweight, 0.0f, 1.0f);
+ }
+ }
+ }
+ else {
+ /* scale up */
+ const float sca= (1.0f - median_new) / (1.0f - median_orig);
+
+ for(eed= em->edges.first; eed; eed= eed->next) {
+ if(eed->f & SELECT) {
+ eed->bweight = 1.0f - ((1.0f - eed->bweight) * sca);
+ CLAMP(eed->bweight, 0.0f, 1.0f);
+ }
+ }
+ }
+ }
+ }
BKE_mesh_end_editmesh(me, em);
}
else if(ob->type==OB_CURVE || ob->type==OB_SURF) {
@@ -840,8 +895,11 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
if (ptr->type == &RNA_Object) {
Object *ob = ptr->data;
- if (ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL))
+ /* dimensions and material support just happen to be the same checks
+ * later we may want to add dimensions for lattice, armature etc too */
+ if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
uiItemR(layout, ptr, "dimensions", 0, "Dimensions", ICON_NONE);
+ }
}
}
@@ -986,6 +1044,7 @@ static void v3d_editarmature_buts(uiLayout *layout, Object *ob)
uiItemR(col, &eboneptr, "tail_radius", 0, "Radius", ICON_NONE);
uiItemR(col, &eboneptr, "roll", 0, "Roll", ICON_NONE);
+ uiItemR(col, &eboneptr, "envelope_distance", 0, "Envelope", ICON_NONE);
}
static void v3d_editmetaball_buts(uiLayout *layout, Object *ob)
@@ -1223,7 +1282,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
Object *ob= OBACT;
// TransformProperties *tfp; // UNUSED
PointerRNA obptr;
- uiLayout *col, *row;
+ uiLayout *col /* , *row */ /* UNUSED */;
float lim;
if(ob==NULL) return;
@@ -1251,7 +1310,7 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
col= uiLayoutColumn(pa->layout, 0);
- row= uiLayoutRow(col, 0);
+ /* row= uiLayoutRow(col, 0); */ /* UNUSED */
RNA_id_pointer_create(&ob->id, &obptr);
if(ob==obedit) {
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index 30d1a508888..02a6cee5140 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -35,6 +35,7 @@
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
+#include "DNA_camera_types.h"
#include "MEM_guardedalloc.h"
@@ -62,49 +63,57 @@
#include "view3d_intern.h" // own include
/* NOTE: these defines are saved in keymap files, do not change values but just add new ones */
-#define FLY_MODAL_CANCEL 1
-#define FLY_MODAL_CONFIRM 2
-#define FLY_MODAL_ACCELERATE 3
-#define FLY_MODAL_DECELERATE 4
-#define FLY_MODAL_PAN_ENABLE 5
-#define FLY_MODAL_PAN_DISABLE 6
-#define FLY_MODAL_DIR_FORWARD 7
-#define FLY_MODAL_DIR_BACKWARD 8
-#define FLY_MODAL_DIR_LEFT 9
-#define FLY_MODAL_DIR_RIGHT 10
-#define FLY_MODAL_DIR_UP 11
-#define FLY_MODAL_DIR_DOWN 12
-#define FLY_MODAL_AXIS_LOCK_X 13
-#define FLY_MODAL_AXIS_LOCK_Z 14
-#define FLY_MODAL_PRECISION_ENABLE 15
-#define FLY_MODAL_PRECISION_DISABLE 16
+enum {
+ FLY_MODAL_CANCEL= 1,
+ FLY_MODAL_CONFIRM,
+ FLY_MODAL_ACCELERATE,
+ FLY_MODAL_DECELERATE,
+ FLY_MODAL_PAN_ENABLE,
+ FLY_MODAL_PAN_DISABLE,
+ FLY_MODAL_DIR_FORWARD,
+ FLY_MODAL_DIR_BACKWARD,
+ FLY_MODAL_DIR_LEFT,
+ FLY_MODAL_DIR_RIGHT,
+ FLY_MODAL_DIR_UP,
+ FLY_MODAL_DIR_DOWN,
+ FLY_MODAL_AXIS_LOCK_X,
+ FLY_MODAL_AXIS_LOCK_Z,
+ FLY_MODAL_PRECISION_ENABLE,
+ FLY_MODAL_PRECISION_DISABLE,
+ FLY_MODAL_FREELOOK_ENABLE,
+ FLY_MODAL_FREELOOK_DISABLE
+
+};
/* called in transform_ops.c, on each regeneration of keymaps */
void fly_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {FLY_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {FLY_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {FLY_MODAL_ACCELERATE, "ACCELERATE", 0, "Accelerate", ""},
- {FLY_MODAL_DECELERATE, "DECELERATE", 0, "Decelerate", ""},
+ {FLY_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
+ {FLY_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
+ {FLY_MODAL_ACCELERATE, "ACCELERATE", 0, "Accelerate", ""},
+ {FLY_MODAL_DECELERATE, "DECELERATE", 0, "Decelerate", ""},
- {FLY_MODAL_PAN_ENABLE, "PAN_ENABLE", 0, "Pan Enable", ""},
- {FLY_MODAL_PAN_DISABLE, "PAN_DISABLE", 0, "Pan Disable", ""},
+ {FLY_MODAL_PAN_ENABLE, "PAN_ENABLE", 0, "Pan Enable", ""},
+ {FLY_MODAL_PAN_DISABLE, "PAN_DISABLE", 0, "Pan Disable", ""},
- {FLY_MODAL_DIR_FORWARD, "FORWARD", 0, "Fly Forward", ""},
- {FLY_MODAL_DIR_BACKWARD,"BACKWARD", 0, "Fly Backward", ""},
- {FLY_MODAL_DIR_LEFT, "LEFT", 0, "Fly Left", ""},
- {FLY_MODAL_DIR_RIGHT, "RIGHT", 0, "Fly Right", ""},
- {FLY_MODAL_DIR_UP, "UP", 0, "Fly Up", ""},
- {FLY_MODAL_DIR_DOWN, "DOWN", 0, "Fly Down", ""},
+ {FLY_MODAL_DIR_FORWARD, "FORWARD", 0, "Fly Forward", ""},
+ {FLY_MODAL_DIR_BACKWARD,"BACKWARD", 0, "Fly Backward", ""},
+ {FLY_MODAL_DIR_LEFT, "LEFT", 0, "Fly Left", ""},
+ {FLY_MODAL_DIR_RIGHT, "RIGHT", 0, "Fly Right", ""},
+ {FLY_MODAL_DIR_UP, "UP", 0, "Fly Up", ""},
+ {FLY_MODAL_DIR_DOWN, "DOWN", 0, "Fly Down", ""},
- {FLY_MODAL_AXIS_LOCK_X, "AXIS_LOCK_X", 0, "X Axis Correction", "X axis correction (toggle)"},
- {FLY_MODAL_AXIS_LOCK_Z, "AXIS_LOCK_Z", 0, "X Axis Correction", "Z axis correction (toggle)"},
+ {FLY_MODAL_AXIS_LOCK_X, "AXIS_LOCK_X", 0, "X Axis Correction", "X axis correction (toggle)"},
+ {FLY_MODAL_AXIS_LOCK_Z, "AXIS_LOCK_Z", 0, "X Axis Correction", "Z axis correction (toggle)"},
- {FLY_MODAL_PRECISION_ENABLE, "PRECISION_ENABLE", 0, "Precision Enable", ""},
- {FLY_MODAL_PRECISION_DISABLE, "PRECISION_DISABLE", 0, "Precision Disable", ""},
+ {FLY_MODAL_PRECISION_ENABLE, "PRECISION_ENABLE", 0, "Precision Enable", ""},
+ {FLY_MODAL_PRECISION_DISABLE, "PRECISION_DISABLE", 0, "Precision Disable", ""},
- {0, NULL, 0, NULL, NULL}};
+ {FLY_MODAL_FREELOOK_ENABLE, "FREELOOK_ENABLE", 0, "Rotation Enable", ""},
+ {FLY_MODAL_FREELOOK_DISABLE, "FREELOOK_DISABLE", 0, "Rotation Disable", ""},
+
+ {0, NULL, 0, NULL, NULL}};
wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Fly Modal");
@@ -122,10 +131,10 @@ void fly_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, SPACEKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_CONFIRM);
WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, FLY_MODAL_CONFIRM);
- WM_modalkeymap_add_item(keymap, PADPLUSKEY, KM_PRESS, 0, 0, FLY_MODAL_ACCELERATE);
- WM_modalkeymap_add_item(keymap, PADMINUS, KM_PRESS, 0, 0, FLY_MODAL_DECELERATE);
- WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, 0, 0, FLY_MODAL_ACCELERATE);
- WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, 0, 0, FLY_MODAL_DECELERATE);
+ WM_modalkeymap_add_item(keymap, PADPLUSKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_ACCELERATE);
+ WM_modalkeymap_add_item(keymap, PADMINUS, KM_PRESS, KM_ANY, 0, FLY_MODAL_DECELERATE);
+ WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, KM_ANY, 0, FLY_MODAL_ACCELERATE);
+ WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, KM_ANY, 0, FLY_MODAL_DECELERATE);
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_PRESS, KM_ANY, 0, FLY_MODAL_PAN_ENABLE);
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, FLY_MODAL_PAN_DISABLE); /* XXX - Bug in the event system, middle mouse release doesnt work */
@@ -144,6 +153,9 @@ void fly_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_PRECISION_ENABLE);
WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, 0, FLY_MODAL_PRECISION_DISABLE);
+ WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_FREELOOK_ENABLE);
+ WM_modalkeymap_add_item(keymap, LEFTCTRLKEY, KM_RELEASE, KM_ANY, 0, FLY_MODAL_FREELOOK_DISABLE);
+
/* assign map to operators */
WM_modalkeymap_assign(keymap, "VIEW3D_OT_fly");
}
@@ -158,8 +170,9 @@ typedef struct FlyInfo {
wmTimer *timer; /* needed for redraws */
short state;
- short use_precision;
short redraw;
+ unsigned char use_precision;
+ unsigned char use_freelook; /* if the user presses shift they can look about without movinf the direction there looking */
int mval[2]; /* latest 2D mouse values */
wmNDOFMotionData* ndof; /* latest 3D mouse values */
@@ -187,6 +200,10 @@ typedef struct FlyInfo {
float rot_backup[4]; /* backup the views quat incase the user cancels flying in non camera mode. (quat for view, eul for camera) */
short persp_backup; /* remember if were ortho or not, only used for restoring the view if it was a ortho view */
+ short is_ortho_cam; /* are we flying an ortho camera in perspective view,
+ * which was originall in ortho view?
+ * could probably figure it out but better be explicit */
+
void *obtfm; /* backup the objects transform */
/* compare between last state */
@@ -289,7 +306,8 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
fly->xlock_momentum=0.0f;
fly->zlock_momentum=0.0f;
fly->grid= 1.0f;
- fly->use_precision= 0;
+ fly->use_precision= FALSE;
+ fly->use_freelook= FALSE;
#ifdef NDOF_FLY_DRAW_TOOMUCH
fly->redraw= 1;
@@ -317,6 +335,17 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
fly->persp_backup= fly->rv3d->persp;
fly->dist_backup= fly->rv3d->dist;
+
+ /* check for flying ortho camera - which we cant support well
+ * we _could_ also check for an ortho camera but this is easier */
+ if( (fly->rv3d->persp == RV3D_CAMOB) &&
+ (fly->v3d->camera != NULL) &&
+ (fly->rv3d->is_persp == FALSE))
+ {
+ ((Camera *)fly->v3d->camera->data)->type= CAM_PERSP;
+ fly->is_ortho_cam= TRUE;
+ }
+
if (fly->rv3d->persp==RV3D_CAMOB) {
Object *ob_back;
if ((U.uiflag & USER_CAM_LOCK_NO_PARENT)==0 && (fly->root_parent=fly->v3d->camera->parent)) {
@@ -420,6 +449,10 @@ static int flyEnd(bContext *C, FlyInfo *fly)
/*Done with correcting for the dist */
}
+ if(fly->is_ortho_cam) {
+ ((Camera *)fly->v3d->camera->data)->type= CAM_ORTHO;
+ }
+
rv3d->rflag &= ~RV3D_NAVIGATING;
//XXX2.5 BIF_view3d_previewrender_signal(fly->sa, PR_DBASE|PR_DISPRECT); /* not working at the moment not sure why */
@@ -516,10 +549,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
fly->speed= 0.0f;
}
else {
- if (event->shift)
- fly->speed += fly->grid*time_wheel * 0.1f;
- else
- fly->speed += fly->grid*time_wheel;
+ fly->speed += fly->grid*time_wheel * (fly->use_precision ? 0.1f : 1.0f);
}
break;
}
@@ -537,10 +567,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
fly->speed=0;
}
else {
- if (event->shift)
- fly->speed-= fly->grid*time_wheel * 0.1f;
- else
- fly->speed-= fly->grid*time_wheel;
+ fly->speed-= fly->grid*time_wheel * (fly->use_precision ? 0.1f : 1.0f);
}
break;
}
@@ -605,6 +632,13 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
case FLY_MODAL_PRECISION_DISABLE:
fly->use_precision= FALSE;
break;
+
+ case FLY_MODAL_FREELOOK_ENABLE:
+ fly->use_freelook= TRUE;
+ break;
+ case FLY_MODAL_FREELOOK_DISABLE:
+ fly->use_freelook= FALSE;
+ break;
}
}
}
@@ -704,8 +738,6 @@ static int flyApply(bContext *C, FlyInfo *fly)
// cent_orig[2], /* view center */
//XXX- can avoid using // cent[2], /* view center modified */
xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */
- unsigned char
- apply_rotation= 1; /* if the user presses shift they can look about without movinf the direction there looking*/
#ifdef NDOF_FLY_DEBUG
static unsigned int iteration = 1;
@@ -888,7 +920,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
}
- if (apply_rotation) {
+ if (!fly->use_freelook) {
/* Normal operation */
/* define dvec, view direction vector */
dvec_tmp[0]= dvec_tmp[1]= dvec_tmp[2]= 0.0f;
@@ -896,9 +928,15 @@ static int flyApply(bContext *C, FlyInfo *fly)
dvec_tmp[fly->axis]= 1.0f;
mul_m3_v3(mat, dvec_tmp);
-
- mul_v3_fl(dvec_tmp, fly->speed * time_redraw * 0.25f);
}
+ else {
+ normalize_v3_v3(dvec_tmp, fly->dvec_prev);
+ if(fly->speed < 0.0f) {
+ negate_v3(dvec_tmp);
+ }
+ }
+
+ mul_v3_fl(dvec_tmp, fly->speed * time_redraw * 0.25f);
}
/* impose a directional lag */
@@ -967,11 +1005,9 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly)
float speed = 10.f; /* blender units per second */
/* ^^ this is ok for default cube scene, but should scale with.. something */
- float trans[3] = {
- lateral_sensitivity * ndof->tvec[0],
- vertical_sensitivity * ndof->tvec[1],
- forward_sensitivity * ndof->tvec[2]
- };
+ float trans[3] = {lateral_sensitivity * ndof->tvec[0],
+ vertical_sensitivity * ndof->tvec[1],
+ forward_sensitivity * ndof->tvec[2]};
if (fly->use_precision)
speed *= 0.2f;
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 0776ca752a9..fd27dc65a0e 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -285,14 +285,14 @@ static char *view3d_modeselect_pup(Scene *scene)
{
Object *ob= OBACT;
static char string[256];
- const char *title= N_("Mode: %%t");
+ const char *title= N_("Mode: %t");
char *str = string;
if(U.transopts&USER_TR_IFACE)
title= BLF_gettext(title);
- sprintf(str, title);
-
+ BLI_strncpy(str, title, sizeof(string));
+
str += modeselect_addmode(str, N_("Object Mode"), OB_MODE_OBJECT, ICON_OBJECT_DATA);
if(ob==NULL || ob->data==NULL) return string;
@@ -530,7 +530,12 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
row= uiLayoutRow(layout, 1);
uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
- uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+
+ /* pose/object only however we want to allow in weight paint mode too
+ * so dont be totally strict and just check not-editmode for now */
+ if (obedit == NULL) {
+ uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ }
/* Transform widget / manipulators */
row= uiLayoutRow(layout, 1);
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 1c98397c7f6..4f5e98a24ce 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1946,7 +1946,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot)
/* much like facesel_face_pick()*/
/* returns 0 if not found, otherwise 1 */
-static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, short rect)
+static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], unsigned int *index, int size)
{
ViewContext vc;
view3d_set_viewcontext(C, &vc);
@@ -1954,12 +1954,12 @@ static int vertsel_vert_pick(struct bContext *C, Mesh *me, const int mval[2], un
if (!me || me->totvert==0)
return 0;
- if (rect) {
+ if (size > 0) {
/* sample rect to increase changes of selecting, so that when clicking
on an face in the backbuf, we can still select a vert */
int dist;
- *index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totvert+1, &dist,0,NULL, NULL);
+ *index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totvert+1, &dist,0,NULL, NULL);
}
else {
/* sample only on the exact position */
@@ -1981,7 +1981,8 @@ static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], shor
Mesh* me= obact->data; /* already checked for NULL */
unsigned int index = 0;
MVert *mv;
- if(vertsel_vert_pick(C, me, mval, &index, 1)) {
+
+ if(vertsel_vert_pick(C, me, mval, &index, 50)) {
mv = me->mvert+index;
if(extend) {
mv->flag ^= SELECT;
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 1ed65f7875f..fa3007d2fb7 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -65,6 +65,7 @@
#include "ED_armature.h"
#include "ED_mesh.h"
+#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_curve.h" /* for curve_editnurbs */
@@ -494,6 +495,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
}
else {
+ struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "Location");
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
if(ob->mode & OB_MODE_POSE) {
@@ -522,6 +524,9 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
pchan->loc[0]= vecN[1];
if ((pchan->protectflag & OB_LOCK_LOCZ)==0)
pchan->loc[0]= vecN[2];
+
+ /* auto-keyframing */
+ ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
}
/* if the bone has a parent and is connected to the parent,
* don't do anything - will break chain unless we do auto-ik.
@@ -531,8 +536,6 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
}
ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
- /* auto-keyframing */
-// XXX autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
@@ -556,7 +559,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
ob->loc[2]+= vec[2];
/* auto-keyframing */
-// XXX autokeyframe_ob_cb_func(ob, TFM_TRANSLATION);
+ ED_autokeyframe_object(C, scene, ob, ks);
}
}
CTX_DATA_END;
@@ -622,6 +625,8 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
}
else {
+ struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, "Location");
+
CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) {
if(ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
@@ -648,6 +653,9 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
pchan->loc[1]= curspn[1];
if ((pchan->protectflag & OB_LOCK_LOCZ)==0)
pchan->loc[2]= curspn[2];
+
+ /* auto-keyframing */
+ ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
}
/* if the bone has a parent and is connected to the parent,
* don't do anything - will break chain unless we do auto-ik.
@@ -657,8 +665,6 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
}
ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
- /* auto-keyframing */
-// XXX autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
@@ -680,9 +686,9 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
ob->loc[1]+= vec[1];
if ((ob->protectflag & OB_LOCK_LOCZ)==0)
ob->loc[2]+= vec[2];
-
+
/* auto-keyframing */
-// XXX autokeyframe_ob_cb_func(ob, TFM_TRANSLATION);
+ ED_autokeyframe_object(C, scene, ob, ks);
}
}
CTX_DATA_END;
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 8227ba87021..bec1206a983 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -713,7 +713,7 @@ void view3d_unproject(bglMats *mats, float out[3], const short x, const short y,
}
#endif
-/* use above call to get projecting mat */
+/* use view3d_get_object_project_mat to get projecting mat */
void ED_view3d_project_float(ARegion *ar, const float vec[3], float adr[2], float mat[4][4])
{
float vec4[4];
@@ -732,6 +732,26 @@ void ED_view3d_project_float(ARegion *ar, const float vec[3], float adr[2], floa
}
}
+/* use view3d_get_object_project_mat to get projecting mat */
+void ED_view3d_project_float_v3(ARegion *ar, float *vec, float *adr, float mat[4][4])
+{
+ float vec4[4];
+
+ copy_v3_v3(vec4, vec);
+ vec4[3]= 1.0;
+ adr[0]= IS_CLIPPED;
+
+ mul_m4_v4(mat, vec4);
+
+ if( vec4[3]>FLT_EPSILON ) {
+ adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3];
+ adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3];
+ adr[2] = vec4[2]/vec4[3];
+ } else {
+ adr[0] = adr[1] = adr[2] = 0.0f;
+ }
+}
+
int ED_view3d_boundbox_clip(RegionView3D *rv3d, float obmat[][4], BoundBox *bb)
{
/* return 1: draw */
@@ -803,9 +823,9 @@ void project_int(ARegion *ar, const float vec[3], int adr[2])
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
- adr[0]= (int)2140000000.0f;
copy_v3_v3(vec4, vec);
vec4[3]= 1.0;
+ adr[0]= (int)2140000000.0f;
mul_m4_v4(rv3d->persmat, vec4);
@@ -851,9 +871,9 @@ void project_short_noclip(ARegion *ar, const float vec[3], short adr[2])
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
- adr[0]= IS_CLIPPED;
copy_v3_v3(vec4, vec);
vec4[3]= 1.0;
+ adr[0]= IS_CLIPPED;
mul_m4_v4(rv3d->persmat, vec4);
@@ -877,9 +897,9 @@ void project_float(ARegion *ar, const float vec[3], float adr[2])
RegionView3D *rv3d= ar->regiondata;
float vec4[4];
- adr[0]= IS_CLIPPED;
copy_v3_v3(vec4, vec);
vec4[3]= 1.0;
+ adr[0]= IS_CLIPPED;
mul_m4_v4(rv3d->persmat, vec4);
@@ -1769,7 +1789,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
{
#ifdef WITH_GAMEENGINE
Scene *startscene = CTX_data_scene(C);
- ScrArea *sa, *prevsa= CTX_wm_area(C);
+ ScrArea /* *sa, */ /* UNUSED */ *prevsa= CTX_wm_area(C);
ARegion *ar, *prevar= CTX_wm_region(C);
wmWindow *prevwin= CTX_wm_window(C);
RegionView3D *rv3d;
@@ -1782,7 +1802,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
rv3d= CTX_wm_region_view3d(C);
- sa= CTX_wm_area(C);
+ /* sa= CTX_wm_area(C); */ /* UNUSED */
ar= CTX_wm_region(C);
view3d_operator_needs_opengl(C);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index f6b4f32adef..73acd1f9000 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1358,6 +1358,11 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
int proportional = 0;
PropertyRNA *prop;
+ // Save back mode in case we're in the generic operator
+ if ((prop= RNA_struct_find_property(op->ptr, "mode"))) {
+ RNA_property_enum_set(op->ptr, prop, t->mode);
+ }
+
if ((prop= RNA_struct_find_property(op->ptr, "value"))) {
float *values= (t->flag & T_AUTOVALUES) ? t->auto_values : t->values;
if (RNA_property_array_check(prop)) {
@@ -2601,27 +2606,18 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
}
/* local constraint shouldn't alter center */
- if (t->around == V3D_LOCAL) {
- if (t->flag & T_OBJECT) {
- copy_v3_v3(center, td->center);
- }
- else if (t->flag & T_EDIT) {
-
- if(t->around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) {
- copy_v3_v3(center, td->center);
- }
- else {
- copy_v3_v3(center, t->center);
- }
- }
- else {
- copy_v3_v3(center, t->center);
- }
+ if ((t->around == V3D_LOCAL) &&
+ ( (t->flag & (T_OBJECT|T_POSE)) ||
+ ((t->flag & T_EDIT) && (t->settings->selectmode & SCE_SELECT_FACE)) ||
+ (t->obedit && t->obedit->type == OB_ARMATURE))
+ )
+ {
+ copy_v3_v3(center, td->center);
}
else {
copy_v3_v3(center, t->center);
}
-
+
if (td->ext) {
float fsize[3];
@@ -2894,19 +2890,17 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
float vec[3], totmat[3][3], smat[3][3];
float eul[3], fmat[3][3], quat[4];
float *center = t->center;
-
+
/* local constraint shouldn't alter center */
if (around == V3D_LOCAL) {
- if (t->flag & (T_OBJECT|T_POSE)) {
+ if ( (t->flag & (T_OBJECT|T_POSE)) ||
+ (t->settings->selectmode & SCE_SELECT_FACE) ||
+ (t->obedit && t->obedit->type == OB_ARMATURE))
+ {
center = td->center;
}
- else {
- if(around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) {
- center = td->center;
- }
- }
}
-
+
if (t->flag & T_POINTS) {
mul_m3_m3m3(totmat, mat, td->mtx);
mul_m3_m3m3(smat, td->smtx, totmat);
@@ -3296,6 +3290,11 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
void initTranslation(TransInfo *t)
{
+ if (t->spacetype == SPACE_ACTION) {
+ /* this space uses time translate */
+ t->state = TRANS_CANCEL;
+ }
+
t->mode = TFM_TRANSLATION;
t->transform = Translation;
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 485344875d4..2f177239f44 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -425,8 +425,8 @@ typedef struct TransInfo {
#define TD_BEZTRIPLE (1 << 12) /* if this is a bez triple, we need to restore the handles, if this is set transdata->misc.hdata needs freeing */
#define TD_NO_LOC (1 << 13) /* when this is set, don't apply translation changes to this element */
#define TD_NOTIMESNAP (1 << 14) /* for Graph Editor autosnap, indicates that point should not undergo autosnapping */
-#define TD_INTVALUES (1 << 15) /* for Graph Editor - curves that can only have int-values need their keyframes tagged with this */
-#define TD_MIRROR_EDGE (1 << 16) /* For editmode mirror, clamp to x = 0 */
+#define TD_INTVALUES (1 << 15) /* for Graph Editor - curves that can only have int-values need their keyframes tagged with this */
+#define TD_MIRROR_EDGE (1 << 16) /* For editmode mirror, clamp to x = 0 */
#define TD_MOVEHANDLE1 (1 << 17) /* For fcurve handles, move them along with their keyframes */
#define TD_MOVEHANDLE2 (1 << 18)
#define TD_PBONE_LOCAL_MTX_P (1 << 19) /* exceptional case with pose bone rotating when a parent bone has 'Local Location' option enabled and rotating also transforms it. */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 77d2e6e7ff0..c4295b15858 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1194,7 +1194,7 @@ static void createTransArmatureVerts(TransInfo *t)
if (ebo->flag & BONE_TIPSEL)
{
copy_v3_v3(td->iloc, ebo->tail);
- copy_v3_v3(td->center, td->iloc);
+ copy_v3_v3(td->center, (t->around==V3D_LOCAL) ? ebo->head : td->iloc);
td->loc= ebo->tail;
td->flag= TD_SELECTED;
if (ebo->flag & BONE_EDITMODE_LOCKED)
@@ -1807,7 +1807,7 @@ void flushTransParticles(TransInfo *t)
/* ********************* mesh ****************** */
/* proportional distance based on connectivity */
-#define THRESHOLD 0.0001f
+#define THRESHOLDFACTOR (1.0f-0.0001f)
static int connectivity_edge(float mtx[][3], EditVert *v1, EditVert *v2)
{
@@ -1828,10 +1828,10 @@ static int connectivity_edge(float mtx[][3], EditVert *v1, EditVert *v2)
if (v1->f2) {
if (v2->f2) {
- if (v2->tmp.fp + edge_len + THRESHOLD < v1->tmp.fp) {
+ if (v2->tmp.fp + edge_len < THRESHOLDFACTOR * v1->tmp.fp) {
v1->tmp.fp = v2->tmp.fp + edge_len;
done = 1;
- } else if (v1->tmp.fp + edge_len + THRESHOLD < v2->tmp.fp) {
+ } else if (v1->tmp.fp + edge_len < THRESHOLDFACTOR * v2->tmp.fp) {
v2->tmp.fp = v1->tmp.fp + edge_len;
done = 1;
}
@@ -2193,6 +2193,12 @@ void flushTransNodes(TransInfo *t)
}
/* *** SEQUENCE EDITOR *** */
+
+/* commented _only_ because the meta may have animaion data which
+ * needs moving too [#28158] */
+
+#define SEQ_TX_NESTED_METAS
+
void flushTransSeq(TransInfo *t)
{
ListBase *seqbasep= seq_give_editing(t->scene, FALSE)->seqbasep; /* Editing null check already done */
@@ -2218,9 +2224,13 @@ void flushTransSeq(TransInfo *t)
switch (tdsq->sel_flag) {
case SELECT:
+#ifdef SEQ_TX_NESTED_METAS
+ if ((seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */
+ seq->start= new_frame - tdsq->start_offset;
+#else
if (seq->type != SEQ_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */
seq->start= new_frame - tdsq->start_offset;
-
+#endif
if (seq->depth==0) {
seq->machine= (int)floor(td2d->loc[1] + 0.5f);
CLAMP(seq->machine, 1, MAXSEQ);
@@ -2275,7 +2285,7 @@ void flushTransSeq(TransInfo *t)
seq_prev= seq;
}
- if (t->mode == TFM_TIME_TRANSLATE) { /* originally TFM_TIME_EXTEND, transform changes */
+ if (t->mode == TFM_SEQ_SLIDE) { /* originally TFM_TIME_EXTEND, transform changes */
/* Special annoying case here, need to calc metas with TFM_TIME_EXTEND only */
seq= seqbasep->first;
@@ -2775,7 +2785,7 @@ static void posttrans_gpd_clean (bGPdata *gpd)
/* Called during special_aftertrans_update to make sure selected keyframes replace
* any other keyframes which may reside on that frame (that is not selected).
*/
-static void posttrans_fcurve_clean (FCurve *fcu)
+static void posttrans_fcurve_clean (FCurve *fcu, const short use_handle)
{
float *selcache; /* cache for frame numbers of selected frames (fcu->totvert*sizeof(float)) */
int len, index, i; /* number of frames in cache, item index */
@@ -2824,7 +2834,7 @@ static void posttrans_fcurve_clean (FCurve *fcu)
}
}
- testhandles_fcurve(fcu);
+ testhandles_fcurve(fcu, use_handle);
}
/* free cache */
@@ -2855,11 +2865,11 @@ static void posttrans_action_clean (bAnimContext *ac, bAction *act)
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
- posttrans_fcurve_clean(ale->key_data);
+ posttrans_fcurve_clean(ale->key_data, FALSE); /* only use handles in graph editor */
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);
}
else
- posttrans_fcurve_clean(ale->key_data);
+ posttrans_fcurve_clean(ale->key_data, FALSE); /* only use handles in graph editor */
}
/* free temp data */
@@ -2880,12 +2890,11 @@ static int count_fcurve_keys(FCurve *fcu, char side, float cfra)
/* only include points that occur on the right side of cfra */
for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {
if (bezt->f2 & SELECT) {
- /* fully select the other two keys */
- bezt->f1 |= SELECT;
- bezt->f3 |= SELECT;
-
- if (FrameOnMouseSide(side, bezt->vec[1][0], cfra))
+ /* no need to adjust the handle selection since they are assumed
+ * selected (like graph editor with SIPO_NOHANDLES) */
+ if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) {
count += 1;
+ }
}
}
@@ -3310,9 +3319,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
/* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse */
for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) {
if (FrameOnMouseSide(t->frame_side, bezt->vec[1][0], cfra)) {
- const char sel1= use_handle ? bezt->f1 & SELECT : 0;
const char sel2= bezt->f2 & SELECT;
- const char sel3= use_handle ? bezt->f3 & SELECT : 0;
+ const char sel1= use_handle ? bezt->f1 & SELECT : sel2;
+ const char sel3= use_handle ? bezt->f3 & SELECT : sel2;
if (ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE)) {
/* for 'normal' pivots - just include anything that is selected.
@@ -3403,9 +3412,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
/* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */
for (i=0, bezt= fcu->bezt; i < fcu->totvert; i++, bezt++) {
if (FrameOnMouseSide(t->frame_side, bezt->vec[1][0], cfra)) {
- const char sel1= use_handle ? bezt->f1 & SELECT : 0;
const char sel2= bezt->f2 & SELECT;
- const char sel3= use_handle ? bezt->f3 & SELECT : 0;
+ const char sel1= use_handle ? bezt->f1 & SELECT : sel2;
+ const char sel3= use_handle ? bezt->f3 & SELECT : sel2;
TransDataCurveHandleFlags *hdata = NULL;
/* short h1=1, h2=1; */ /* UNUSED */
@@ -3465,7 +3474,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
}
/* Sets handles based on the selection */
- testhandles_fcurve(fcu);
+ testhandles_fcurve(fcu, use_handle);
}
/* cleanup temp list */
@@ -3669,7 +3678,7 @@ void remake_graph_transdata (TransInfo *t, ListBase *anim_data)
sort_time_fcurve(fcu);
/* make sure handles are all set correctly */
- testhandles_fcurve(fcu);
+ testhandles_fcurve(fcu, use_handle);
}
}
}
@@ -3827,6 +3836,11 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
else {
/* Nested, different rules apply */
+#ifdef SEQ_TX_NESTED_METAS
+ *flag= (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL);
+ *count= 1; /* ignore the selection for nested */
+ *recursive = (seq->type == SEQ_META );
+#else
if (seq->type == SEQ_META) {
/* Meta's can only directly be moved between channels since they
* dont have their start and length set directly (children affect that)
@@ -3841,6 +3855,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
*count= 1; /* ignore the selection for nested */
*recursive = 0;
}
+#endif
}
}
}
@@ -4765,10 +4780,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
if(t->mode == TFM_SEQ_SLIDE) {
if(t->frame_side == 'B')
- ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_TRANSLATE, t->vec[0], t->frame_side);
+ ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_TRANSLATE, t->values[0], t->frame_side);
}
else if (ELEM(t->frame_side, 'L', 'R')) {
- ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_EXTEND, t->vec[0], t->frame_side);
+ ED_markers_post_apply_transform(&t->scene->markers, t->scene, TFM_TIME_EXTEND, t->values[0], t->frame_side);
}
}
@@ -4816,11 +4831,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
- posttrans_fcurve_clean(fcu);
+ posttrans_fcurve_clean(fcu, FALSE); /* only use handles in graph editor */
ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1);
}
else
- posttrans_fcurve_clean(fcu);
+ posttrans_fcurve_clean(fcu, FALSE); /* only use handles in graph editor */
}
}
@@ -4877,16 +4892,16 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
#if 0
if (ELEM(t->frame_side, 'L', 'R')) { /* TFM_TIME_EXTEND */
/* same as below */
- ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->vec[0], t->frame_side);
+ ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side);
}
else /* TFM_TIME_TRANSLATE */
#endif
{
- ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->vec[0], t->frame_side);
+ ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side);
}
}
else if (t->mode == TFM_TIME_SCALE) {
- ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->vec[0], t->frame_side);
+ ED_markers_post_apply_transform(ED_context_get_markers(C), t->scene, t->mode, t->values[0], t->frame_side);
}
}
@@ -4900,6 +4915,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
else if (t->spacetype == SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
bAnimContext ac;
+ const short use_handle = !(sipo->flag & SIPO_NOHANDLES);
/* initialise relevant anim-context 'context' data */
if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -4928,11 +4944,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
{
if (adt) {
ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0);
- posttrans_fcurve_clean(fcu);
+ posttrans_fcurve_clean(fcu, use_handle);
ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 0);
}
else
- posttrans_fcurve_clean(fcu);
+ posttrans_fcurve_clean(fcu, use_handle);
}
}
@@ -5227,6 +5243,11 @@ static void createTransNodeData(bContext *C, TransInfo *t)
SpaceNode *snode= t->sa->spacedata.first;
bNode *node;
+ if(!snode->edittree) {
+ t->total= 0;
+ return;
+ }
+
/* set transform flags on nodes */
for (node=snode->edittree->nodes.first; node; node=node->next) {
if ((node->flag & NODE_SELECT) || (node->parent && (node->parent->flag & NODE_TRANSFORM)))
@@ -5314,7 +5335,7 @@ void createTransData(bContext *C, TransInfo *t)
t->ext = NULL;
if (t->obedit->type == OB_MESH) {
createTransEditVerts(C, t);
- }
+ }
else if ELEM(t->obedit->type, OB_CURVE, OB_SURF) {
createTransCurveVerts(C, t);
}
@@ -5327,7 +5348,7 @@ void createTransData(bContext *C, TransInfo *t)
else if (t->obedit->type==OB_ARMATURE) {
t->flag &= ~T_PROP_EDIT;
createTransArmatureVerts(t);
- }
+ }
else {
printf("edit type not implemented!\n");
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 38776b51c62..b5f622b747b 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1187,6 +1187,12 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->options |= CTX_NO_PET;
}
+ // Mirror is not supported with PET, turn it off.
+ if (t->flag & T_PROP_EDIT)
+ {
+ t->flag &= ~T_MIRROR;
+ }
+
setTransformViewMatrices(t);
initNumInput(&t->num);
@@ -1270,7 +1276,8 @@ void applyTransObjects(TransInfo *t)
recalcData(t);
}
-static void restoreElement(TransData *td) {
+static void restoreElement(TransData *td)
+{
/* TransData for crease has no loc */
if (td->loc) {
copy_v3_v3(td->loc, td->iloc);
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index b3608305a7a..a1e1c0e0b1d 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -118,7 +118,8 @@ static void InputTrackBall(TransInfo *UNUSED(t), MouseInput *mi, const int mval[
output[1] *= mi->factor;
}
-static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
+static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
+{
float x, pad;
pad = t->ar->winx / 10;
@@ -135,7 +136,8 @@ static void InputHorizontalRatio(TransInfo *t, MouseInput *mi, const int mval[2]
output[0] = (x - pad) / (t->ar->winx - 2 * pad);
}
-static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
+static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
+{
float vec[3];
InputVector(t, mi, mval, vec);
@@ -144,7 +146,8 @@ static void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, const int mval
output[0] = dot_v3v3(t->viewinv[0], vec) * 2.0f;
}
-static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
+static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
+{
float y, pad;
pad = t->ar->winy / 10;
@@ -160,7 +163,8 @@ static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const int mval[2],
output[0] = (y - pad) / (t->ar->winy - 2 * pad);
}
-static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3]) {
+static void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, const int mval[2], float output[3])
+{
float vec[3];
InputVector(t, mi, mval, vec);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 17fd7517d71..4342d0de751 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -1584,7 +1584,8 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo
return retval;
}
-static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mval[2], int *dist, float *loc, float *no, SnapMode mode) {
+static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mval[2], int *dist, float *loc, float *no, SnapMode mode)
+{
Base *base;
float depth = FLT_MAX;
int retval = 0;
@@ -1914,7 +1915,8 @@ int peelObjectsContext(bContext *C, ListBase *depth_peels, float mval[2])
static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], GearsType action);
-void snapGridAction(TransInfo *t, float *val, GearsType action) {
+void snapGridAction(TransInfo *t, float *val, GearsType action)
+{
float fac[3];
fac[NO_GEARS] = t->snap[0];
@@ -1925,7 +1927,8 @@ void snapGridAction(TransInfo *t, float *val, GearsType action) {
}
-void snapGrid(TransInfo *t, float *val) {
+void snapGrid(TransInfo *t, float *val)
+{
GearsType action;
// Only do something if using Snap to Grid
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 3dd7514429e..d46f4b0ed30 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -171,7 +171,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE);
layout= uiPupMenuLayout(pup);
- sprintf(line, "Remove Pack");
+ strcpy(line, "Remove Pack");
props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
RNA_enum_set(&props_ptr, "method", PF_REMOVE);
RNA_string_set(&props_ptr, "id", id_name);
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index bcbc134d06d..f38ae136f71 100644
--- a/source/blender/editors/util/editmode_undo.c
+++ b/source/blender/editors/util/editmode_undo.c
@@ -142,7 +142,7 @@ void undo_editmode_push(bContext *C, const char *name,
/* make new */
curundo= uel= MEM_callocN(sizeof(UndoElem), "undo editmode");
- strncpy(uel->name, name, MAXUNDONAME-1);
+ BLI_strncpy(uel->name, name, sizeof(uel->name));
BLI_addtail(&undobase, uel);
uel->getdata= getdata;
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index c1aca61f795..55fda84874d 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -471,7 +471,7 @@ static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
if(totitem > 0) {
uiPopupMenu *pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
uiLayout *layout= uiPupMenuLayout(pup);
- uiLayout *split= uiLayoutSplit(layout, 0, 0), *column;
+ uiLayout *split= uiLayoutSplit(layout, 0, 0), *column = NULL;
int i, c;
for(c=0, i=totitem-1; i >= 0; i--, c++) {
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 17f9382b083..e80b63b4eea 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -1117,7 +1117,7 @@ static void weld_align_uv(bContext *C, int tool)
int itmpl, jtmpl;
EditVert *eve;
int pass; /* first 2 passes find endpoints, 3rd pass moves middle points, 4th pass is fail-on-face-selected */
- EditFace *startefa, *endefa;
+ EditFace *startefa, *endefa= NULL; /* endefa shouldnt need to be initialized but just incase */
/* pass 3 variables */
float startx, starty, firstm, firstb, midx, midy;
@@ -3232,7 +3232,7 @@ static void UV_OT_cursor_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in 0.0-1.0 coordinates", -10.0f, 10.0f);
+ RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in normalised (0.0-1.0) coordinates", -10.0f, 10.0f);
}
/********************** set tile operator **********************/
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 846b05c1287..1b117a15516 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -2624,7 +2624,7 @@ static PBool p_chart_abf_solve(PChart *chart)
PEdge *e, *e1, *e2, *e3;
PAbfSystem sys;
int i;
- float lastnorm, limit = (chart->nfaces > 100)? 1.0f: 0.001f;
+ float /* lastnorm, */ /* UNUSED */ limit = (chart->nfaces > 100)? 1.0f: 0.001f;
/* setup id's */
sys.ninterior = sys.nfaces = sys.nangles = 0;
@@ -2703,12 +2703,12 @@ static PBool p_chart_abf_solve(PChart *chart)
p_abf_compute_sines(&sys);
/* iteration */
- lastnorm = 1e10;
+ /* lastnorm = 1e10; */ /* UNUSED */
for (i = 0; i < ABF_MAX_ITER; i++) {
float norm = p_abf_compute_gradient(&sys, chart);
- lastnorm = norm;
+ /* lastnorm = norm; */ /* UNUSED */
if (norm < limit)
break;
@@ -3609,7 +3609,7 @@ static SmoothNode *p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, f
{
SmoothNode *node = BLI_memarena_alloc(arena, sizeof *node);
int axis, i, t1size = 0, t2size = 0;
- float split, mi, mx;
+ float split, /* mi, */ /* UNUSED */ mx;
SmoothTriangle **t1, **t2, *t;
node->tri = tri;
@@ -3650,7 +3650,7 @@ static SmoothNode *p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, f
node->axis = axis;
node->split = split;
- mi = bmin[axis];
+ /* mi = bmin[axis]; */ /* UNUSED */
mx = bmax[axis];
bmax[axis] = split;
node->c1 = p_node_new(arena, t1, t1size, bmin, bmax, depth+1);
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 2003b88e9f7..0285d4736b8 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -820,7 +820,7 @@ static void correct_uv_aspect(EditMesh *em)
static void uv_map_clip_correct_properties(wmOperatorType *ot)
{
RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect",
- "Map UV's taking image aspect ratio into account");
+ "Map UVs taking image aspect ratio into account");
RNA_def_boolean(ot->srna, "clip_to_bounds", 0, "Clip to Bounds",
"Clip UV coordinates to bounds after unwrapping");
RNA_def_boolean(ot->srna, "scale_to_bounds", 0, "Scale to Bounds",
@@ -982,11 +982,11 @@ void UV_OT_unwrap(wmOperatorType *ot)
/* properties */
RNA_def_enum(ot->srna, "method", method_items, 0, "Method",
- "Unwrapping method. Angle Based usually gives better results than Conformal, while being somewhat slower");
+ "Unwrapping method (Angle Based usually gives better results than Conformal, while being somewhat slower)");
RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes",
"Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry");
RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect",
- "Map UV's taking image aspect ratio into account");
+ "Map UVs taking image aspect ratio into account");
}
/**************** Project From View operator **************/
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index ce3a378ea00..2bf62b73424 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -629,7 +629,7 @@ static void GPU_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, i
if(smoothnormal) {
/* copy vertex normal */
normal_short_to_float_v3(&varray[start], mvert[f->v1].no);
- normal_short_to_float_v3(&varray[start+3], mvert[f->v2].no);
+ normal_short_to_float_v3(&varray[start+3], mvert[f->v2].no);
normal_short_to_float_v3(&varray[start+6], mvert[f->v3].no);
if(f->v4) {
@@ -1058,7 +1058,8 @@ void GPU_uvedge_setup(DerivedMesh *dm)
GLStates |= GPU_BUFFER_VERTEX_STATE;
}
-static int GPU_typesize(int type) {
+static int GPU_typesize(int type)
+{
switch(type) {
case GL_FLOAT:
return sizeof(float);
@@ -1075,7 +1076,8 @@ static int GPU_typesize(int type) {
}
}
-int GPU_attrib_element_size(GPUAttrib data[], int numdata) {
+int GPU_attrib_element_size(GPUAttrib data[], int numdata)
+{
int i, elementsize = 0;
for(i = 0; i < numdata; i++) {
@@ -1086,7 +1088,8 @@ int GPU_attrib_element_size(GPUAttrib data[], int numdata) {
return elementsize;
}
-void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numdata) {
+void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numdata)
+{
int i;
int elementsize;
intptr_t offset = 0;
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 4219183b318..b06af5bc193 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -717,7 +717,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h, int mipmap)
}
else {
/* Do partial drawing. 'buffer' holds only the changed part. Needed for color corrected result */
- float *buffer = (float *)MEM_mallocN(w*h*sizeof(float)*4, "temp_texpaint_float_buf");
+ float *buffer = (float *)MEM_mallocN(w*h*sizeof(float)*4, "temp_texpaint_float_buf");
IMB_partial_rect_from_float(ibuf, buffer, x, y, w, h);
glBindTexture(GL_TEXTURE_2D, ima->bindcode);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA,
@@ -1138,6 +1138,9 @@ int GPU_enable_material(int nr, void *attribs)
GMS.lastretval = !GMS.lastretval;
if(GMS.lastretval) {
+ /* for alpha pass, use alpha blend */
+ alphablend = (GMS.alphapass)? GPU_BLEND_ALPHA: GPU_BLEND_SOLID;
+
if(gattribs && GMS.gmatbuf[nr]) {
/* bind glsl material and get attributes */
Material *mat = GMS.gmatbuf[nr];
@@ -1147,7 +1150,11 @@ int GPU_enable_material(int nr, void *attribs)
GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT));
GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col);
GMS.gboundmat= mat;
- alphablend= mat->game.alpha_blend;
+
+ /* for glsl use alpha blend mode, unless it's set to solid and
+ we are already drawing in an alpha pass */
+ if(mat->game.alpha_blend != GPU_BLEND_SOLID)
+ alphablend= mat->game.alpha_blend;
if(GMS.alphapass) glDepthMask(1);
}
@@ -1156,11 +1163,9 @@ int GPU_enable_material(int nr, void *attribs)
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, GMS.matbuf[nr].diff);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, GMS.matbuf[nr].spec);
glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, GMS.matbuf[nr].hard);
- alphablend= GPU_BLEND_SOLID;
}
/* set (alpha) blending mode */
- if(!GMS.alphapass) alphablend= GPU_BLEND_SOLID;
GPU_set_material_alpha_blend(alphablend);
}
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 9362b1b27de..05525d6a491 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -909,7 +909,7 @@ static void do_material_tex(GPUShadeInput *shi)
/*char *lastuvname = NULL;*/ /*UNUSED*/
float one = 1.0f, norfac, ofs[3];
int tex_nr, rgbnor, talpha;
- int init_done = 0, iBumpSpacePrev;
+ int init_done = 0, iBumpSpacePrev = 0; /* Not necessary, quiting gcc warning. */
GPUNodeLink *vNorg, *vNacc, *fPrevMagnitude;
int iFirstTimeNMap=1;
int found_deriv_map = 0;
@@ -1097,6 +1097,9 @@ static void do_material_tex(GPUShadeInput *shi)
float ima_x, ima_y;
float hScale = 0.1f; // compatibility adjustment factor for all bumpspace types
float hScaleTex = 13.0f; // factor for scaling texspace bumps
+
+ float imag_tspace_dimension_x = 1024.0f; // only used for texture space variant
+ float aspect = 1.0f;
GPUNodeLink *surf_pos = GPU_builtin(GPU_VIEW_POSITION);
GPUNodeLink *vR1, *vR2;
@@ -1104,7 +1107,12 @@ static void do_material_tex(GPUShadeInput *shi)
if( mtex->texflag & MTEX_BUMP_TEXTURESPACE )
hScale = hScaleTex;
- norfac = hScale * mtex->norfac;
+
+ // The negate on norfac is done because the
+ // normal in the renderer points inward which corresponds
+ // to inverting the bump map. Should this ever change
+ // this negate must be removed.
+ norfac = -hScale * mtex->norfac;
tnorfac = GPU_uniform(&norfac);
if(GPU_link_changed(stencil))
@@ -1160,6 +1168,7 @@ static void do_material_tex(GPUShadeInput *shi)
if(ibuf) {
ima_x= ibuf->x;
ima_y= ibuf->y;
+ aspect = ((float) ima_y) / ima_x;
}
}
@@ -1180,10 +1189,11 @@ static void do_material_tex(GPUShadeInput *shi)
if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
-
+ float imag_tspace_dimension_y = aspect*imag_tspace_dimension_x;
GPU_link( mat, "mtex_bump_apply_texspace",
fDet, dBs, dBt, vR1, vR2,
- GPU_image(tex->ima, &tex->iuser), texco, GPU_uniform(&ima_x), GPU_uniform(&ima_y), vNacc,
+ GPU_image(tex->ima, &tex->iuser), texco,
+ GPU_uniform(&imag_tspace_dimension_x), GPU_uniform(&imag_tspace_dimension_y), vNacc,
&vNacc, &shi->vn );
} else
GPU_link( mat, "mtex_bump_apply",
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index c4fe1523e90..b9500c2f798 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -114,109 +114,6 @@
#endif
#endif
-/****/
-
-#ifdef __sgi
-
-#include <dmedia/moviefile.h>
-
-static void movie_printerror(char * str) {
- const char * errstr = mvGetErrorStr(mvGetErrno());
-
- if (str) {
- if (errstr) printf("%s: %s\n", str, errstr);
- else printf("%s: returned error\n", str);
- } else printf("%s\n", errstr);
-}
-
-static int startmovie(struct anim * anim) {
- if (anim == 0) return(-1);
-
- if ( mvOpenFile (anim->name, O_BINARY|O_RDONLY, &anim->movie ) != DM_SUCCESS ) {
- printf("Can't open movie: %s\n", anim->name);
- return(-1);
- }
- if ( mvFindTrackByMedium (anim->movie, DM_IMAGE, &anim->track) != DM_SUCCESS ) {
- printf("No image track in movie: %s\n", anim->name);
- mvClose(anim->movie);
- return(-1);
- }
-
- anim->duration = mvGetTrackLength (anim->track);
- anim->params = mvGetParams( anim->track );
-
- anim->x = dmParamsGetInt( anim->params, DM_IMAGE_WIDTH);
- anim->y = dmParamsGetInt( anim->params, DM_IMAGE_HEIGHT);
- anim->interlacing = dmParamsGetEnum (anim->params, DM_IMAGE_INTERLACING);
- anim->orientation = dmParamsGetEnum (anim->params, DM_IMAGE_ORIENTATION);
- anim->framesize = dmImageFrameSize(anim->params);
-
- anim->curposition = 0;
- anim->preseek = 0;
-
- /*printf("x:%d y:%d size:%d interl:%d dur:%d\n", anim->x, anim->y, anim->framesize, anim->interlacing, anim->duration);*/
- return (0);
-}
-
-static ImBuf * movie_fetchibuf(struct anim * anim, int position) {
- ImBuf * ibuf;
-/* extern rectcpy(); */
- int size;
- unsigned int *rect1, *rect2;
-
- if (anim == 0) return (0);
-
- ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect);
-
- if ( mvReadFrames(anim->track, position, 1, ibuf->x * ibuf->y *
- sizeof(int), ibuf->rect ) != DM_SUCCESS ) {
- movie_printerror("mvReadFrames");
- IMB_freeImBuf(ibuf);
- return(0);
- }
-
-/*
- if (anim->interlacing == DM_IMAGE_INTERLACED_EVEN) {
- rect1 = ibuf->rect + (ibuf->x * ibuf->y) - 1;
- rect2 = rect1 - ibuf->x;
-
- for (size = ibuf->x * (ibuf->y - 1); size > 0; size--){
- *rect1-- = *rect2--;
- }
- }
-*/
-
- if (anim->interlacing == DM_IMAGE_INTERLACED_EVEN)
- {
- rect1 = ibuf->rect;
- rect2 = rect1 + ibuf->x;
-
- for (size = ibuf->x * (ibuf->y - 1); size > 0; size--){
- *rect1++ = *rect2++;
- }
- }
- /*if (anim->orientation == DM_TOP_TO_BOTTOM) IMB_flipy(ibuf);*/
-
-
- return(ibuf);
-}
-
-static void free_anim_movie(struct anim * anim) {
- if (anim == NULL) return;
-
- if (anim->movie) {
- mvClose(anim->movie);
- anim->movie = NULL;
- }
- anim->duration = 0;
-}
-
-int ismovie(char *name) {
- return (mvIsMovieFile(name) == DM_TRUE);
-}
-
-#else
-
int ismovie(const char *UNUSED(name)) {
return 0;
}
@@ -226,7 +123,6 @@ static int startmovie(struct anim *UNUSED(anim)) { return 1; }
static ImBuf * movie_fetchibuf(struct anim *UNUSED(anim), int UNUSED(position)) { return NULL; }
static void free_anim_movie(struct anim *UNUSED(anim)) { ; }
-#endif
#if defined(_WIN32)
# define PATHSEPERATOR '\\'
@@ -1004,8 +900,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position,
long long st_time;
struct anim_index * tc_index = 0;
AVStream * v_st;
- int new_frame_index;
- int old_frame_index;
+ int new_frame_index = 0; /* To quite gcc barking... */
+ int old_frame_index = 0; /* To quite gcc barking... */
if (anim == 0) return (0);
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index d79acc88a80..bfec60245b8 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -101,8 +101,8 @@ static int checkbmp(unsigned char *mem)
return(ret_val);
}
-int imb_is_a_bmp(unsigned char *buf) {
-
+int imb_is_a_bmp(unsigned char *buf)
+{
return checkbmp(buf);
}
@@ -200,8 +200,8 @@ static int putShortLSB(unsigned short us,FILE *ofile) {
}
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
-int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) {
-
+int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags)
+{
BMPINFOHEADER infoheader;
int bytesize, extrabytes, x, y, t, ptr;
uchar *data;
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index 1ac4e4e06cb..49f81edd4b2 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -111,7 +111,8 @@ static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float **
*/
/* function assumes out to be zero'ed, only does RGBA */
-static float P(float k){
+static float P(float k)
+{
float p1, p2, p3, p4;
p1 = MAX2(k+2.0f,0);
p2 = MAX2(k+1.0f,0);
@@ -123,7 +124,8 @@ static float P(float k){
#if 0
/* older, slower function, works the same as above */
-static float P(float k){
+static float P(float k)
+{
return (float)(1.0f/6.0f)*( pow( MAX2(k+2.0f,0) , 3.0f ) - 4.0f * pow( MAX2(k+1.0f,0) , 3.0f ) + 6.0f * pow( MAX2(k,0) , 3.0f ) - 4.0f * pow( MAX2(k-1.0f,0) , 3.0f));
}
#endif
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 2e45c0eb07a..d79e881e5a2 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -183,9 +183,9 @@ struct anim_index * IMB_indexer_open(const char * name)
BLI_strncpy(idx->name, name, sizeof(idx->name));
- fseek(fp, 0, SEEK_END);
+ fseek(fp, 0, SEEK_END);
- idx->num_entries = (ftell(fp) - 12)
+ idx->num_entries = (ftell(fp) - 12)
/ (sizeof(int) // framepos
+ sizeof(unsigned long long) // seek_pos
+ sizeof(unsigned long long) // seek_pos_dts
diff --git a/source/blender/imbuf/intern/indexer_dv.c b/source/blender/imbuf/intern/indexer_dv.c
index d1202136d56..aa258a6b9ee 100644
--- a/source/blender/imbuf/intern/indexer_dv.c
+++ b/source/blender/imbuf/intern/indexer_dv.c
@@ -56,7 +56,8 @@ static unsigned long bitstream_get_bits(indexer_dv_bitstream * This, int num)
return rval;
}
-static int parse_num(indexer_dv_bitstream * b, int numbits) {
+static int parse_num(indexer_dv_bitstream * b, int numbits)
+{
return bitstream_get_bits(b, numbits);
}
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 0759d97e69f..53d4a403190 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -84,8 +84,8 @@ type 3 is unsupported as of jul 05 2000 Frank.
static int jpeg_default_quality;
static int ibuf_ftype;
-int imb_is_a_jpeg(unsigned char *mem) {
-
+int imb_is_a_jpeg(unsigned char *mem)
+{
if ((mem[0]== 0xFF) && (mem[1] == 0xD8))return 1;
return 0;
}
@@ -255,12 +255,12 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t
static boolean
handle_app1 (j_decompress_ptr cinfo)
{
- INT32 length, i;
+ INT32 length; /* initialized by the macro */
+ INT32 i;
char neogeo[128];
INPUT_VARS(cinfo);
-
- length = 0;
+
INPUT_2BYTES(cinfo, length, return FALSE);
length -= 2;
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 88f6508d356..e064d7f760d 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -98,7 +98,7 @@ class Mem_IStream: public IStream
public:
Mem_IStream (unsigned char *exrbuf, size_t exrsize):
- IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; }
+ IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; }
virtual bool read (char c[], int n);
virtual Int64 tellg ();
@@ -107,8 +107,8 @@ public:
//virtual ~Mem_IStream() {}; // unused
private:
-
- Int64 _exrpos;
+
+ Int64 _exrpos;
Int64 _exrsize;
unsigned char *_exrbuf;
};
@@ -116,11 +116,11 @@ private:
bool Mem_IStream::read (char c[], int n)
{
if (n + _exrpos <= _exrsize)
- {
+ {
memcpy(c, (void *)(&_exrbuf[_exrpos]), n);
_exrpos += n;
return true;
- }
+ }
else
return false;
}
@@ -308,7 +308,7 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags
delete [] pixels;
}
catch (const std::exception &exc)
- {
+ {
printf("OpenEXR-save: ERROR: %s\n", exc.what());
if (ibuf) IMB_freeImBuf(ibuf);
@@ -365,7 +365,7 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag
delete file;
}
catch (const std::exception &exc)
- {
+ {
printf("OpenEXR-save: ERROR: %s\n", exc.what());
if (ibuf) IMB_freeImBuf(ibuf);
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index ec00b15c079..c757b435d90 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -338,7 +338,8 @@ static int checktarga(TARGA *tga, unsigned char *mem)
return(1);
}
-int imb_is_a_targa(unsigned char *buf) {
+int imb_is_a_targa(unsigned char *buf)
+{
TARGA tga;
return checktarga(&tga, buf);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 59e5bc72f2b..2d3fcb1023c 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -125,7 +125,7 @@ typedef struct Library {
enum eIconSizes {
ICON_SIZE_ICON,
- ICON_SIZE_PREVIEW,
+ ICON_SIZE_PREVIEW
};
#define NUM_ICON_SIZES (ICON_SIZE_PREVIEW + 1)
@@ -204,6 +204,10 @@ typedef struct PreviewImage {
#define ID_REAL_USERS(id) (((ID *)id)->us - ((((ID *)id)->flag & LIB_FAKEUSER) ? 1:0))
+#define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM))
+
+#define ID_BLEND_PATH(_bmain, _id) ((_id)->lib ? (_id)->lib->filepath : (_bmain)->name)
+
#ifdef GS
#undef GS
#endif
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index b7a8f21d724..128f19b504b 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -93,7 +93,7 @@ typedef struct ClothCollSettings
{
struct LinkNode *collision_list; /* e.g. pointer to temp memory for collisions */
float epsilon; /* min distance for collisions. */
- float self_friction; /* Fiction/damping with self contact. */
+ float self_friction; /* Fiction/damping with self contact. */
float friction; /* Friction/damping applied on contact with other object.*/
float selfepsilon; /* for selfcollision */
float repel_force, distance_repel;
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 1be2c811a1b..e04bdd4ec45 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -344,7 +344,7 @@ typedef struct bPivotConstraint {
* Either target object + offset, or just offset is used
*/
struct Object *tar; /* target object (optional) */
- char subtarget[32]; /* subtarget name (optional) */
+ char subtarget[32]; /* subtarget name (optional) */
float offset[3]; /* offset from the target to use, regardless of whether it exists */
/* Rotation-driven activation:
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index 43a4b99bc33..8fe8b3bcf70 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -56,7 +56,7 @@ typedef struct IpoDriver {
short blocktype, adrcode; /* sub-channel to use */
short type, flag; /* driver settings */
- char name[128]; /* bone, or python expression here */
+ char name[128]; /* bone, or python expression here */
} IpoDriver;
/* --- IPO Curve --- */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index e9e78ab25d3..0344e6da0ff 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -74,7 +74,7 @@ typedef enum ModifierType {
eModifierType_WeightVGEdit,
eModifierType_WeightVGMix,
eModifierType_WeightVGProximity,
- eModifierType_NavMesh,
+ eModifierType_EmptySlot, /* keep so DynamicPaint keep loading, can re-use later */
eModifierType_DynamicPaint, /* reserve slot */
NUM_MODIFIER_TYPES
} ModifierType;
@@ -751,10 +751,6 @@ typedef struct ScrewModifierData {
#define MOD_SCREW_OBJECT_OFFSET (1<<2)
// #define MOD_SCREW_OBJECT_ANGLE (1<<4)
-typedef struct NavMeshModifierData {
- ModifierData modifier;
-} NavMeshModifierData;
-
typedef struct WarpModifierData {
ModifierData modifier;
@@ -808,7 +804,7 @@ typedef struct WeightVGEditModifierData {
/* Mapping stuff. */
struct CurveMapping *cmap_curve; /* The custom mapping curve! */
- /* The add/remove vertices weight thresholds. */
+ /* The add/remove vertices weight thresholds. */
float add_threshold, rem_threshold;
/* Masking options. */
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 2e679f6b506..9463a445ba9 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -321,6 +321,9 @@ typedef struct DupliObject {
/* 23 and 24 are for life and sector (old file compat.) */
#define OB_ARMATURE 25
+/* check if the object type supports materials */
+#define OB_TYPE_SUPPORT_MATERIAL(_type) ((_type) >= OB_MESH && (_type) <= OB_MBALL)
+
/* partype: first 4 bits: type */
#define PARTYPE 15
#define PAROBJECT 0
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 69ee530c0b6..9fec5207dbb 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -179,10 +179,12 @@ typedef struct ParticleSettings {
float simplify_rate, simplify_transition;
float simplify_viewport;
- /* general values */
+ /* time and emission */
float sta, end, lifetime, randlife;
- float timetweak, jitfac, eff_hair, grid_rand;
+ float timetweak, courant_target;
+ float jitfac, eff_hair, grid_rand, ps_offset[1];
int totpart, userjit, grid_res, effector_amount;
+ short time_flag, time_pad[3];
/* initial velocity factors */
float normfac, obfac, randfac, partfac, tanfac, tanphase, reactfac;
@@ -288,6 +290,9 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
struct ParticleDrawData *pdd;
float *frand; /* array of 1024 random floats for fast lookups */
+
+ float dt_frac; /* current time step, as a fraction of a frame */
+ float _pad; /* spare capacity */
}ParticleSystem;
/* part->type */
@@ -402,6 +407,9 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in
#define PART_SIMPLIFY_ENABLE 1
#define PART_SIMPLIFY_VIEWPORT 2
+/* part->time_flag */
+#define PART_TIME_AUTOSF 1 /* Automatic subframes */
+
/* part->bb_align */
#define PART_BB_X 0
#define PART_BB_Y 1
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 9f176a22848..cb70a8274bd 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -236,8 +236,8 @@ typedef struct RenderData {
short stereomode; /* standalone player stereo settings */ // XXX deprecated since 2.5
short dimensionspreset; /* for the dimensions presets menu */
-
- short filtertype; /* filter is box, tent, gauss, mitch, etc */
+
+ short filtertype; /* filter is box, tent, gauss, mitch, etc */
short size, maximsize; /* size in %, max in Kb */
/* from buttons: */
@@ -426,8 +426,7 @@ typedef struct GameFraming {
#define SCE_GAMEFRAMING_EXTEND 1
#define SCE_GAMEFRAMING_SCALE 2
-typedef struct RecastData
-{
+typedef struct RecastData {
float cellsize;
float cellheight;
float agentmaxslope;
@@ -441,6 +440,7 @@ typedef struct RecastData
int vertsperpoly;
float detailsampledist;
float detailsamplemaxerror;
+ short pad1, pad2;
} RecastData;
typedef struct GameData {
@@ -453,8 +453,7 @@ typedef struct GameData {
/* stereo/dome mode */
struct GameDome dome;
short stereoflag, stereomode;
- short pad2, pad3;
- float eyeseparation, pad1;
+ float eyeseparation;
RecastData recastData;
@@ -470,17 +469,19 @@ typedef struct GameData {
* bit 3: (gameengine): Activity culling is enabled.
* bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
*/
- short mode, flag, matmode, pad[2];
+ int flag;
+ short mode, matmode;
short occlusionRes; /* resolution of occlusion Z buffer in pixel */
short physicsEngine;
+ short pad[2];
short ticrate, maxlogicstep, physubstep, maxphystep;
- short obstacleSimulation;
+ short obstacleSimulation, pad1;
float levelHeight;
} GameData;
#define STEREO_NOSTEREO 1
-#define STEREO_ENABLED 2
-#define STEREO_DOME 3
+#define STEREO_ENABLED 2
+#define STEREO_DOME 3
//#define STEREO_NOSTEREO 1
#define STEREO_QUADBUFFERED 2
@@ -520,9 +521,9 @@ typedef struct GameData {
#define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12)
#define GAME_ENABLE_ANIMATION_RECORD (1 << 13)
#define GAME_SHOW_MOUSE (1 << 14)
-#define GAME_SHOW_OBSTACLE_SIMULATION (1 << 15)
#define GAME_GLSL_NO_COLOR_MANAGEMENT (1 << 15)
-/* Note: GameData.flag is a short (max 16 flags). To add more flags, GameData.flag needs to be an int */
+#define GAME_SHOW_OBSTACLE_SIMULATION (1 << 16)
+/* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */
/* GameData.matmode */
#define GAME_MAT_TEXFACE 0
@@ -838,7 +839,7 @@ typedef struct Scene {
void *sound_scrub_handle;
void *speaker_handles;
- void *fps_info; /* (runtime) info/cache used for presenting playback framerate info to the user */
+ void *fps_info; /* (runtime) info/cache used for presenting playback framerate info to the user */
/* none of the dependancy graph vars is mean to be saved */
struct DagForest *theDag;
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index 6e850a07d94..d878a759d22 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -466,6 +466,7 @@ typedef struct TexMapping {
#define MTEX_5TAP_BUMP 512
#define MTEX_BUMP_OBJECTSPACE 1024
#define MTEX_BUMP_TEXTURESPACE 2048
+#define MTEX_BUMP_FLIPPED 4096 /* temp flag for 2.59/2.60 */
/* blendtype */
#define MTEX_BLEND 0
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 47ebf111eba..9e94ebfb6e8 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -295,6 +295,7 @@ typedef struct wmKeyConfig {
/* wmKeyConfig.flag */
#define KEYCONF_USER (1 << 1)
+#define KEYCONF_INIT_DEFAULT (1 << 2)
/* this one is the operator itself, stored in files for macros etc */
/* operator + operatortype should be able to redo entirely, but for different contextes */
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt
index 5edebfe3903..e9fd2b2baa2 100644
--- a/source/blender/makesdna/intern/CMakeLists.txt
+++ b/source/blender/makesdna/intern/CMakeLists.txt
@@ -27,7 +27,7 @@
# message(STATUS "Configuring makesdna")
-# add_definitions(-DWITH_DNA_GHASH)
+add_definitions(-DWITH_DNA_GHASH)
blender_include_dirs(
../../../../intern/guardedalloc
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 170a8e202b1..1f45fe2646f 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -350,7 +350,7 @@ extern StructRNA RNA_OperatorFileListElement;
extern StructRNA RNA_OperatorMousePath;
extern StructRNA RNA_OperatorProperties;
extern StructRNA RNA_OperatorStrokeElement;
-extern StructRNA RNA_OperatorTypeMacro;
+extern StructRNA RNA_OperatorMacro;
extern StructRNA RNA_OrController;
extern StructRNA RNA_OutflowFluidSettings;
extern StructRNA RNA_PackedFile;
@@ -778,6 +778,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop);
int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *t_ptr);
int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr);
int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr);
+int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr);
int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr);
/* efficient functions to set properties for arrays */
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index ac2a89161d9..9b87bbc2f4e 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -86,6 +86,7 @@ PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont, const char *identifier, c
PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
+PropertyRNA *RNA_def_string_translate(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description);
PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description);
PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description);
@@ -172,7 +173,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item);
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set);
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef, const char *poll);
-void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring);
+void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint);
void RNA_def_property_srna(PropertyRNA *prop, const char *type);
void RNA_def_py_data(PropertyRNA *prop, void *py_data);
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 4a18518dde9..4e1177996ef 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -110,6 +110,7 @@ typedef enum PropertySubType {
PROP_FILEPATH = 1,
PROP_DIRPATH = 2,
PROP_FILENAME = 3,
+ PROP_TRANSLATE = 4, /* a string which should be translated */
/* numbers */
PROP_UNSIGNED = 13,
@@ -229,8 +230,8 @@ typedef struct CollectionPropertyIterator {
int level;
/* external */
- int valid;
PointerRNA ptr;
+ int valid;
} CollectionPropertyIterator;
typedef struct CollectionPointerLink {
@@ -273,13 +274,13 @@ typedef struct ParameterList {
/* storage for parameters */
void *data;
+ /* function passed at creation time */
+ struct FunctionRNA *func;
+
/* store the parameter size */
int alloc_size;
int arg_count, ret_count;
-
- /* function passed at creation time */
- struct FunctionRNA *func;
} ParameterList;
typedef struct ParameterIterator {
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript
index d0002eda30b..da186a57c8b 100644
--- a/source/blender/makesrna/SConscript
+++ b/source/blender/makesrna/SConscript
@@ -63,6 +63,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:
- defs.append('INTERNATIONAL')
+ defs.append('WITH_INTERNATIONAL')
env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] )
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 966bc8f100c..5a0a3388c85 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -95,6 +95,7 @@ set(APISRC
rna_actuator_api.c
rna_animation_api.c
rna_armature_api.c
+ rna_camera_api.c
rna_controller_api.c
rna_fcurve_api.c
rna_image_api.c
@@ -220,7 +221,7 @@ if(WITH_OPENCOLLADA)
endif()
if(WITH_INTERNATIONAL)
- add_definitions(-DINTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
endif()
# Build makesrna executable
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index ef05875fe86..d710dd06a17 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -99,7 +99,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
if env['WITH_BF_INTERNATIONAL']:
- defs.append('INTERNATIONAL')
+ defs.append('WITH_INTERNATIONAL')
makesrna_tool.Append(CPPDEFINES=defs)
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index c12e61eefeb..5914809c279 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1815,6 +1815,7 @@ static const char *rna_property_subtypename(PropertySubType type)
case PROP_FILEPATH: return "PROP_FILEPATH";
case PROP_FILENAME: return "PROP_FILENAME";
case PROP_DIRPATH: return "PROP_DIRPATH";
+ case PROP_TRANSLATE: return "PROP_TRANSLATE";
case PROP_UNSIGNED: return "PROP_UNSIGNED";
case PROP_PERCENTAGE: return "PROP_PERCENTAGE";
case PROP_FACTOR: return "PROP_FACTOR";
@@ -2278,7 +2279,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr
}
case PROP_COLLECTION: {
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
- fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring));
+ fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring), rna_function_string(cprop->assignint));
if(cprop->item_type) fprintf(f, "&RNA_%s\n", (char*)cprop->item_type);
else fprintf(f, "NULL\n");
break;
@@ -2431,7 +2432,7 @@ static RNAProcessItem PROCESS_ITEMS[]= {
{"rna_armature.c", "rna_armature_api.c", RNA_def_armature},
{"rna_boid.c", NULL, RNA_def_boid},
{"rna_brush.c", NULL, RNA_def_brush},
- {"rna_camera.c", NULL, RNA_def_camera},
+ {"rna_camera.c", "rna_camera_api.c", RNA_def_camera},
{"rna_cloth.c", NULL, RNA_def_cloth},
{"rna_color.c", NULL, RNA_def_color},
{"rna_constraint.c", NULL, RNA_def_constraint},
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 32132a49532..24e7594e784 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -314,6 +314,20 @@ static int rna_IDPArray_length(PointerRNA *ptr)
return prop->len;
}
+int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr)
+{
+ ID *id= ptr->id.data;
+ short *totcol= give_totcolp_id(id);
+ Material *mat_id= assign_ptr->id.data;
+ if(totcol && (key >= 0 && key < *totcol)) {
+ assign_material_id(id, mat_id, key + 1);
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
#else
static void rna_def_ID_properties(BlenderRNA *brna)
@@ -367,7 +381,7 @@ static void rna_def_ID_properties(BlenderRNA *brna)
prop= RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "PropertyGroup");
- RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL);
+ RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL);
RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY);
// never tested, maybe its useful to have this?
@@ -460,13 +474,13 @@ static void rna_def_ID(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER);
- RNA_def_property_ui_text(prop, "Fake User", "Saves this datablock even if it has no users");
+ RNA_def_property_ui_text(prop, "Fake User", "Save this datablock even if it has no users");
RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set");
prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT);
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data, (initial state is undefined)");
+ RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data (initial state is undefined)");
prop= RNA_def_property(srna, "recalc", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC);
@@ -490,8 +504,8 @@ static void rna_def_ID(BlenderRNA *brna)
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "user_clear", "rna_ID_user_clear");
- RNA_def_function_ui_description(func, "Clears the user count of a datablock so its not saved, "
- "on reload the data will be removed");
+ RNA_def_function_ui_description(func, "Clear the user count of a datablock so its not saved, "
+ "on reload the data will be removed");
func= RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata");
RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this");
@@ -503,7 +517,7 @@ static void rna_def_ID(BlenderRNA *brna)
func= RNA_def_function(srna, "update_tag", "rna_ID_update_tag");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Tag the id to update its display data");
+ RNA_def_function_ui_description(func, "Tag the ID to update its display data");
RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform");
}
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 681cd79a98a..e64c5fd670d 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -470,7 +470,7 @@ static const char *rna_ensure_property_description(PropertyRNA *prop)
description= ((IDProperty*)prop)->name; /* XXX - not correct */
}
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_TOOLTIPS))
description= BLF_gettext(description);
#endif
@@ -487,7 +487,7 @@ static const char *rna_ensure_property_name(PropertyRNA *prop)
else
name= ((IDProperty*)prop)->name;
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE))
name= BLF_gettext(name);
#endif
@@ -1095,6 +1095,7 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
if(cprop->item_type)
return cprop->item_type;
}
+ /* ignore other types, RNA_struct_find_nested calls with unchecked props */
return &RNA_UnknownType;
}
@@ -1111,7 +1112,7 @@ int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *va
return 1;
}
- printf("RNA_property_pointer_poll %s: is not a pointer property.\n", prop->identifier);
+ printf("%s %s: is not a pointer property.\n", __func__, prop->identifier);
return 0;
}
@@ -1160,7 +1161,7 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA
{
RNA_property_enum_items(C, ptr, prop, item, totitem, free);
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE)) {
int i;
EnumPropertyItem *nitem;
@@ -2511,7 +2512,7 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, (char*)prop->identifier));
}
else
- printf("RNA_property_pointer_add %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
+ printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);
}
void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
@@ -2530,7 +2531,7 @@ void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
}
}
else
- printf("RNA_property_pointer_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);
+ printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);
}
static void rna_property_collection_get_idp(CollectionPropertyIterator *iter)
@@ -2663,7 +2664,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
}
}
/*else
- printf("RNA_property_collection_add %s.%s: not implemented for this property.\n", ptr->type->identifier, prop->identifier);*/
+ printf("%s %s.%s: not implemented for this property.\n", __func__, ptr->type->identifier, prop->identifier);*/
#endif
if(r_ptr) {
@@ -2722,7 +2723,7 @@ int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
return 0;
}
/*else
- printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);*/
+ printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier);*/
#endif
return 0;
}
@@ -2864,6 +2865,21 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co
}
}
+/* zero return is an assignment error */
+int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr)
+{
+ CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(prop);
+
+ BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
+
+ if(cprop->assignint) {
+ /* we have a callback defined, use it */
+ return cprop->assignint(ptr, key, assign_ptr);
+ }
+
+ return 0;
+}
+
int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
{
BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
@@ -3999,7 +4015,7 @@ int RNA_boolean_get(PointerRNA *ptr, const char *name)
return RNA_property_boolean_get(ptr, prop);
}
else {
- printf("RNA_boolean_get: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return 0;
}
}
@@ -4011,7 +4027,7 @@ void RNA_boolean_set(PointerRNA *ptr, const char *name, int value)
if(prop)
RNA_property_boolean_set(ptr, prop, value);
else
- printf("RNA_boolean_set: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values)
@@ -4021,7 +4037,7 @@ void RNA_boolean_get_array(PointerRNA *ptr, const char *name, int *values)
if(prop)
RNA_property_boolean_get_array(ptr, prop, values);
else
- printf("RNA_boolean_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values)
@@ -4031,7 +4047,7 @@ void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const int *values)
if(prop)
RNA_property_boolean_set_array(ptr, prop, values);
else
- printf("RNA_boolean_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
int RNA_int_get(PointerRNA *ptr, const char *name)
@@ -4042,7 +4058,7 @@ int RNA_int_get(PointerRNA *ptr, const char *name)
return RNA_property_int_get(ptr, prop);
}
else {
- printf("RNA_int_get: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return 0;
}
}
@@ -4054,7 +4070,7 @@ void RNA_int_set(PointerRNA *ptr, const char *name, int value)
if(prop)
RNA_property_int_set(ptr, prop, value);
else
- printf("RNA_int_set: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
@@ -4064,7 +4080,7 @@ void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
if(prop)
RNA_property_int_get_array(ptr, prop, values);
else
- printf("RNA_int_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
@@ -4074,7 +4090,7 @@ void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
if(prop)
RNA_property_int_set_array(ptr, prop, values);
else
- printf("RNA_int_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
float RNA_float_get(PointerRNA *ptr, const char *name)
@@ -4085,7 +4101,7 @@ float RNA_float_get(PointerRNA *ptr, const char *name)
return RNA_property_float_get(ptr, prop);
}
else {
- printf("RNA_float_get: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return 0;
}
}
@@ -4097,7 +4113,7 @@ void RNA_float_set(PointerRNA *ptr, const char *name, float value)
if(prop)
RNA_property_float_set(ptr, prop, value);
else
- printf("RNA_float_set: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
@@ -4107,7 +4123,7 @@ void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
if(prop)
RNA_property_float_get_array(ptr, prop, values);
else
- printf("RNA_float_get_array: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
@@ -4117,7 +4133,7 @@ void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
if(prop)
RNA_property_float_set_array(ptr, prop, values);
else
- printf("RNA_float_set_array: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
int RNA_enum_get(PointerRNA *ptr, const char *name)
@@ -4128,7 +4144,7 @@ int RNA_enum_get(PointerRNA *ptr, const char *name)
return RNA_property_enum_get(ptr, prop);
}
else {
- printf("RNA_enum_get: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return 0;
}
}
@@ -4140,7 +4156,7 @@ void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
if(prop)
RNA_property_enum_set(ptr, prop, value);
else
- printf("RNA_enum_set: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id)
@@ -4152,9 +4168,11 @@ void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id)
if(RNA_property_enum_value(NULL, ptr, prop, id, &value))
RNA_property_enum_set(ptr, prop, value);
else
- printf("RNA_enum_set_identifier: %s.%s has no enum id '%s'.\n", ptr->type->identifier, name, id);
- } else
- printf("RNA_enum_set_identifier: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s has no enum id '%s'.\n", __func__, ptr->type->identifier, name, id);
+ }
+ else {
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
+ }
}
int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname)
@@ -4173,11 +4191,11 @@ int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char
if(free)
MEM_freeN(item);
- printf("RNA_enum_is_equal: %s.%s item %s not found.\n", ptr->type->identifier, name, enumname);
+ printf("%s: %s.%s item %s not found.\n", __func__, ptr->type->identifier, name, enumname);
return 0;
}
else {
- printf("RNA_enum_is_equal: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return 0;
}
}
@@ -4226,7 +4244,7 @@ void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
RNA_property_string_get(ptr, prop, value);
}
else {
- printf("RNA_string_get: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
value[0]= '\0';
}
}
@@ -4239,7 +4257,7 @@ char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, in
return RNA_property_string_get_alloc(ptr, prop, fixedbuf, fixedlen);
}
else {
- printf("RNA_string_get_alloc: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return NULL;
}
}
@@ -4252,7 +4270,7 @@ int RNA_string_length(PointerRNA *ptr, const char *name)
return RNA_property_string_length(ptr, prop);
}
else {
- printf("RNA_string_length: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return 0;
}
}
@@ -4264,7 +4282,7 @@ void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
if(prop)
RNA_property_string_set(ptr, prop, value);
else
- printf("RNA_string_set: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
@@ -4275,7 +4293,7 @@ PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
return RNA_property_pointer_get(ptr, prop);
}
else {
- printf("RNA_pointer_get: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return PointerRNA_NULL;
}
@@ -4289,7 +4307,7 @@ void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
RNA_property_pointer_set(ptr, prop, ptr_value);
}
else {
- printf("RNA_pointer_set: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
}
@@ -4300,7 +4318,7 @@ void RNA_pointer_add(PointerRNA *ptr, const char *name)
if(prop)
RNA_property_pointer_add(ptr, prop);
else
- printf("RNA_pointer_set: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter)
@@ -4310,7 +4328,7 @@ void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyI
if(prop)
RNA_property_collection_begin(ptr, prop, iter);
else
- printf("RNA_collection_begin: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
@@ -4320,7 +4338,7 @@ void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
if(prop)
RNA_property_collection_add(ptr, prop, r_value);
else
- printf("RNA_collection_add: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
void RNA_collection_clear(PointerRNA *ptr, const char *name)
@@ -4330,7 +4348,7 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name)
if(prop)
RNA_property_collection_clear(ptr, prop);
else
- printf("RNA_collection_clear: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
}
int RNA_collection_length(PointerRNA *ptr, const char *name)
@@ -4341,7 +4359,7 @@ int RNA_collection_length(PointerRNA *ptr, const char *name)
return RNA_property_collection_length(ptr, prop);
}
else {
- printf("RNA_collection_length: %s.%s not found.\n", ptr->type->identifier, name);
+ printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name);
return 0;
}
}
@@ -4358,7 +4376,7 @@ int RNA_property_is_set(PointerRNA *ptr, const char *name)
}
else {
/* python raises an error */
- /* printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name); */
+ /* printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name); */
return 0;
}
}
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 6c193a66490..44c37f93b5e 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -98,13 +98,13 @@ static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const ch
if(group && group[0]=='\0') group= NULL;
if(data_path[0] == '\0') {
- BKE_report(reports, RPT_ERROR, "FCurve data path empty, invalid argument");
+ BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument");
return NULL;
}
/* annoying, check if this exists */
if(verify_fcurve(act, group, data_path, index, 0)) {
- BKE_reportf(reports, RPT_ERROR, "FCurve '%s[%d]' already exists in action '%s'", data_path, index, act->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "F-Curve '%s[%d]' already exists in action '%s'", data_path, index, act->id.name+2);
return NULL;
}
return verify_fcurve(act, group, data_path, index, 1);
@@ -114,7 +114,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
{
if (fcu->grp) {
if (BLI_findindex(&act->groups, fcu->grp) == -1) {
- BKE_reportf(reports, RPT_ERROR, "FCurve's ActionGroup '%s' not found in action '%s'", fcu->grp->name, act->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "F-Curve's ActionGroup '%s' not found in action '%s'", fcu->grp->name, act->id.name+2);
return;
}
@@ -123,7 +123,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *
}
else {
if (BLI_findindex(&act->curves, fcu) == -1) {
- BKE_reportf(reports, RPT_ERROR, "FCurve not found in action '%s'", act->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "F-Curve not found in action '%s'", act->id.name+2);
return;
}
@@ -309,20 +309,20 @@ static void rna_def_dopesheet(BlenderRNA *brna)
/* NLA Specific Settings */
prop= RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NLA_NOACT);
- RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data. (NLA Editor only)");
+ RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data (NLA Editor only)");
RNA_def_property_ui_icon(prop, ICON_ACTION, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Summary Settings (DopeSheet editors only) */
prop= RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY);
- RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line. (DopeSheet Editors only)");
+ RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line (DopeSheet Editors only)");
RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0);
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED);
- RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden. (DopeSheet Editors Only)");
+ RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden (DopeSheet Editors Only)");
RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
@@ -451,7 +451,7 @@ static void rna_def_action_group(BlenderRNA *brna)
prop= RNA_def_property(srna, "channels", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "channels", NULL);
RNA_def_property_struct_type(prop, "FCurve");
- RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", 0, 0, 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, 0, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group");
prop= RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
@@ -514,24 +514,24 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_srna(cprop, "ActionFCurves");
srna= RNA_def_struct(brna, "ActionFCurves", NULL);
RNA_def_struct_sdna(srna, "bAction");
- RNA_def_struct_ui_text(srna, "Action FCurves", "Collection of action fcurves");
+ RNA_def_struct_ui_text(srna, "Action F-Curves", "Collection of action F-Curves");
func= RNA_def_function(srna, "new", "rna_Action_fcurve_new");
- RNA_def_function_ui_description(func, "Add a keyframe to the curve");
+ RNA_def_function_ui_description(func, "Add a keyframe to the F-Curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_string(func, "data_path", "", 0, "Data Path", "FCurve data path to use");
+ parm= RNA_def_string(func, "data_path", "", 0, "Data Path", "F-Curve data path to use");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Array index", 0, INT_MAX);
- RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this fcurve into");
+ RNA_def_string(func, "action_group", "", 0, "Action Group", "Acton group to add this F-Curve into");
- parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created fcurve");
+ parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created F-Curve");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Action_fcurve_remove");
RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "FCurve to remove");
+ parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -605,7 +605,7 @@ static void rna_def_action(BlenderRNA *brna)
rna_def_action_pose_markers(brna, prop);
/* properties */
- prop= RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all fcurves within this action" , 0 , 0);
+ prop= RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all F-Curves within this action" , 0 , 0);
RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get" , NULL, NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -613,7 +613,7 @@ static void rna_def_action(BlenderRNA *brna)
prop= RNA_def_property(srna, "id_root", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "idroot");
RNA_def_property_enum_items(prop, id_type_items);
- RNA_def_property_ui_text(prop, "ID Root Type", "Type of ID-block that action can be used on. DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING");
+ RNA_def_property_ui_text(prop, "ID Root Type", "Type of ID-block that action can be used on - DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING");
/* API calls */
RNA_api_action(srna);
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 43cf1fae931..d828139a6d5 100644
--- a/source/blender/makesrna/intern/rna_actuator.c
+++ b/source/blender/makesrna/intern/rna_actuator.c
@@ -861,7 +861,7 @@ static void rna_def_camera_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "CameraActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Camera Actuator", "Actuator to...");
+ RNA_def_struct_ui_text(srna, "Camera Actuator", "");
RNA_def_struct_sdna_from(srna, "bCameraActuator", "data");
prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
@@ -1387,7 +1387,7 @@ static void rna_def_scene_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "SceneActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Scene Actuator", "Actuator to...");
+ RNA_def_struct_ui_text(srna, "Scene Actuator", "");
RNA_def_struct_sdna_from(srna, "bSceneActuator", "data");
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
@@ -1445,7 +1445,7 @@ static void rna_def_random_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RandomActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Random Actuator", "Actuator to...");
+ RNA_def_struct_ui_text(srna, "Random Actuator", "");
RNA_def_struct_sdna_from(srna, "bRandomActuator", "data");
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
@@ -1562,7 +1562,7 @@ static void rna_def_message_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MessageActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Message Actuator", "Actuator to...");
+ RNA_def_struct_ui_text(srna, "Message Actuator", "");
RNA_def_struct_sdna_from(srna, "bMessageActuator", "data");
prop= RNA_def_property(srna, "to_property", PROP_STRING, PROP_NONE);
@@ -1877,7 +1877,7 @@ static void rna_def_armature_actuator(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ArmatureActuator", "Actuator");
- RNA_def_struct_ui_text(srna, "Armature Actuator", "Actuator to...");
+ RNA_def_struct_ui_text(srna, "Armature Actuator", "");
RNA_def_struct_sdna_from(srna, "bArmatureActuator", "data");
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 702529fde53..ebf8990adf3 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -272,7 +272,7 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value)
if (ksp->rna_path)
MEM_freeN(ksp->rna_path);
- if (strlen(value))
+ if (value[0])
ksp->rna_path= BLI_strdup(value);
else
ksp->rna_path= NULL;
@@ -489,7 +489,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
/* Name */
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index ec928415876..e67ab012dc9 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -448,7 +448,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED);
if(editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is struck to the parent's tail");
+ RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is stuck to the parent's tail");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
prop= RNA_def_property(srna, "use_inherit_rotation", PROP_BOOLEAN, PROP_NONE);
@@ -458,7 +458,8 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
prop= RNA_def_property(srna, "use_envelope_multiply", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV);
- RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence");
+ RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope",
+ "When deforming bone, multiply effects of Vertex Group weights with Envelope influence");
RNA_def_property_update(prop, 0, "rna_Armature_update_data");
prop= RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE);
@@ -478,7 +479,9 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE);
- RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes");
+ RNA_def_property_ui_text(prop, "Draw Wire",
+ "Bone is always drawn as Wireframe regardless of viewport draw mode "
+ "(useful for non-obstructive custom bone shapes)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
prop= RNA_def_property(srna, "use_cyclic_offset", PROP_BOOLEAN, PROP_NONE);
@@ -752,7 +755,7 @@ static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_pointer_sdna(prop, NULL, "act_bone");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Active Bone", "Armatures active bone");
+ RNA_def_property_ui_text(prop, "Active Bone", "Armature's active bone");
RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL);
/* todo, redraw */
@@ -821,7 +824,8 @@ static void rna_def_armature(BlenderRNA *brna)
{ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Uses vertex deformation code optimized for the BGE"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_ghost_type_items[] = {
- {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"},
+ {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame",
+ "Display Ghosts of poses within a fixed number of frames around the current frame"},
{ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"},
{ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes"},
{0, NULL, 0, NULL, NULL}};
@@ -831,7 +835,8 @@ static void rna_def_armature(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Armature", "ID");
- RNA_def_struct_ui_text(srna, "Armature", "Armature datablock containing a hierarchy of bones, usually used for rigging characters");
+ RNA_def_struct_ui_text(srna, "Armature",
+ "Armature datablock containing a hierarchy of bones, usually used for rigging characters");
RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA);
RNA_def_struct_sdna(srna, "bArmature");
@@ -841,7 +846,7 @@ static void rna_def_armature(BlenderRNA *brna)
/* Collections */
prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL);
- RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", 0, 0, 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", NULL, NULL, NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "Bone");
RNA_def_property_ui_text(prop, "Bones", "");
rna_def_armature_bones(brna, prop);
@@ -867,7 +872,7 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
- prop= RNA_def_property(srna, "vert_deformer", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "gevertdeformer");
RNA_def_property_enum_items(prop, prop_vdeformer);
RNA_def_property_ui_text(prop, "Vertex Deformer", "");
@@ -897,7 +902,8 @@ static void rna_def_armature(BlenderRNA *brna)
prop= RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER);
RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1);
RNA_def_property_array(prop, 32);
- RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo");
+ RNA_def_property_ui_text(prop, "Layer Proxy Protection",
+ "Protected layers in Proxy Instances are restored to Proxy settings on file reload and undo");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* flag */
@@ -975,28 +981,34 @@ static void rna_def_armature(BlenderRNA *brna)
prop= RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghostep");
RNA_def_property_range(prop, 0, 30);
- RNA_def_property_ui_text(prop, "Ghosting Step", "Number of frame steps on either side of current frame to show as ghosts (only for 'Around Current Frame' Onion-skinning method)");
+ RNA_def_property_ui_text(prop, "Ghosting Step",
+ "Number of frame steps on either side of current frame to show as ghosts "
+ "(only for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
prop= RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ghostsize");
RNA_def_property_range(prop, 1, 20);
- RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)");
+ RNA_def_property_ui_text(prop, "Ghosting Frame Step",
+ "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
prop= RNA_def_property(srna, "ghost_frame_start", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghostsf");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL);
- RNA_def_property_ui_text(prop, "Ghosting Start Frame", "Starting frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
+ RNA_def_property_ui_text(prop, "Ghosting Start Frame",
+ "Starting frame of range of Ghosts to display (not for "
+ "'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
prop= RNA_def_property(srna, "ghost_frame_end", PROP_INT, PROP_TIME);
RNA_def_property_int_sdna(prop, NULL, "ghostef");
RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL);
- RNA_def_property_ui_text(prop, "Ghosting End Frame", "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
+ RNA_def_property_ui_text(prop, "Ghosting End Frame",
+ "End frame of range of Ghosts to display (not for 'Around Current Frame' Onion-skinning method)");
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
// XXX depreceated ....... old animviz for armatures only
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index c9d261e8143..357f613f65f 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -554,7 +554,7 @@ static void rna_def_boid_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 100.0);
- RNA_def_property_ui_text(prop, "Range", "The maximum distance from which a boid can attack");
+ RNA_def_property_ui_text(prop, "Range", "Maximum distance from which a boid can attack");
RNA_def_property_update(prop, 0, "rna_Boids_reset");
/* physical properties */
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 37912f810fc..9954fdfd88d 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -209,6 +209,9 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+
+ /* Camera API */
+ RNA_api_camera(srna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_camera_api.c b/source/blender/makesrna/intern/rna_camera_api.c
new file mode 100644
index 00000000000..39478713663
--- /dev/null
+++ b/source/blender/makesrna/intern/rna_camera_api.c
@@ -0,0 +1,88 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/makesrna/intern/rna_camera_api.c
+ * \ingroup RNA
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+
+#include "RNA_define.h"
+#include "BKE_utildefines.h"
+
+#ifdef RNA_RUNTIME
+
+#include "DNA_scene_types.h"
+#include "BKE_context.h"
+#include "BKE_object.h"
+
+void rna_camera_view_frame(struct Camera *camera, struct Scene *scene,
+ float vec1_r[3], float vec2_r[3], float vec3_r[3], float vec4_r[3])
+{
+ float vec[4][3];
+
+ camera_view_frame(scene, camera, vec);
+
+ copy_v3_v3(vec1_r, vec[0]);
+ copy_v3_v3(vec2_r, vec[1]);
+ copy_v3_v3(vec3_r, vec[2]);
+ copy_v3_v3(vec4_r, vec[3]);
+}
+
+#else
+
+void RNA_api_camera(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "view_frame", "rna_camera_view_frame");
+ RNA_def_function_ui_description(func, "Return 4 points for the cameras frame (before object transformation)");
+
+ RNA_def_pointer(func, "scene", "Scene", "", "Scene to use for aspect calculation, when omitted 1:1 aspect is used");
+
+ /* return location and normal */
+ parm= RNA_def_float_vector(func, "result_1", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
+
+ parm= RNA_def_float_vector(func, "result_2", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
+
+ parm= RNA_def_float_vector(func, "result_3", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
+
+ parm= RNA_def_float_vector(func, "result_4", 3, NULL, -FLT_MAX, FLT_MAX, "Result", NULL, -1e4, 1e4);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
+}
+
+#endif
+
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 1b2396a4215..934a42cfcef 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -271,7 +271,8 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set");
+ RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length",
+ "rna_ClothSettings_mass_vgroup_set");
RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices");
RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed");
@@ -305,21 +306,23 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame");
RNA_def_property_range(prop, 4, 80);
- RNA_def_property_ui_text(prop, "Quality", "Quality of the simulation in steps per frame. (higher is better quality but slower)");
+ RNA_def_property_ui_text(prop, "Quality",
+ "Quality of the simulation in steps per frame (higher is better quality but slower)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
/* springs */
prop= RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING);
- RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group");
+ RNA_def_property_ui_text(prop, "Stiffness Scaling",
+ "If enabled, stiffness can be scaled along a weight painted vertex group");
RNA_def_property_update(prop, 0, "rna_cloth_update");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "Cdis");
RNA_def_property_range(prop, 0.0f, 50.0f);
- RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity. (higher = more smooth, less jiggling)");
+ RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity (higher = more smooth, less jiggling)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE);
@@ -336,14 +339,16 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "vertex_group_structural_stiffness", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", "rna_ClothSettings_struct_vgroup_set");
- RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", "Vertex group for fine control over structural stiffness");
+ RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length",
+ "rna_ClothSettings_struct_vgroup_set");
+ RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group",
+ "Vertex group for fine control over structural stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bending");
RNA_def_property_range(prop, 0.0f, 10000.0f);
- RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient. (higher = less smaller but more big wrinkles)");
+ RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient (higher = less smaller but more big wrinkles)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE);
@@ -354,7 +359,8 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "vertex_group_bending", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", "rna_ClothSettings_bend_vgroup_set");
+ RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length",
+ "rna_ClothSettings_bend_vgroup_set");
RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness");
RNA_def_property_update(prop, 0, "rna_cloth_update");
@@ -372,8 +378,9 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "ShapeKey");
- RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", "rna_ClothSettings_rest_shape_key_set", NULL, NULL);
- RNA_def_property_ui_text(prop, "Rest Shade Key", "Shape key to use the rest spring lengths from");
+ RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get",
+ "rna_ClothSettings_rest_shape_key_set", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Rest Shape Key", "Shape key to use the rest spring lengths from");
RNA_def_property_update(prop, 0, "rna_cloth_update");
/* unused */
@@ -420,7 +427,8 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "ClothCollisionSettings", NULL);
- RNA_def_struct_ui_text(srna, "Cloth Collision Settings", "Cloth simulation settings for self collision and collision with other objects");
+ RNA_def_struct_ui_text(srna, "Cloth Collision Settings",
+ "Cloth simulation settings for self collision and collision with other objects");
RNA_def_struct_sdna(srna, "ClothCollSettings");
RNA_def_struct_path_func(srna, "rna_ClothCollisionSettings_path");
@@ -442,24 +450,27 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "distance_repel");
RNA_def_property_range(prop, 0.001f, 10.0f);
RNA_def_property_float_default(prop, 0.005f);
- RNA_def_property_ui_text(prop, "Repulsion Distance", "Maximum distance to apply repulsion force, must be greater then minimum distance");
+ RNA_def_property_ui_text(prop, "Repulsion Distance",
+ "Maximum distance to apply repulsion force, must be greater than minimum distance");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "epsilon");
RNA_def_property_range(prop, 0.001f, 1.0f);
- RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in");
+ RNA_def_property_ui_text(prop, "Minimum Distance",
+ "Minimum distance between collision objects before collision response takes in");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 80.0f);
- RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened. (higher = less movement)");
+ RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (higher = less movement)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "loop_count");
RNA_def_property_range(prop, 1, 20);
- RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)");
+ RNA_def_property_ui_text(prop, "Collision Quality",
+ "How many collision iterations should be done. (higher is better quality but slower)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
/* self collision */
@@ -483,7 +494,8 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "self_loop_count");
RNA_def_property_range(prop, 1, 10);
- RNA_def_property_ui_text(prop, "Self Collision Quality", "How many self collision iterations should be done. (higher is better quality but slower)");
+ RNA_def_property_ui_text(prop, "Self Collision Quality",
+ "How many self collision iterations should be done (higher is better quality but slower)");
RNA_def_property_update(prop, 0, "rna_cloth_update");
prop= RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 4ef6e9f4af7..65745ca2afd 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -405,7 +405,7 @@ static void rna_def_curvemapping(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range");
prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "CurveMap");
RNA_def_property_ui_text(prop, "Curves", "");
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 5d0c1db572d..edae977f3f6 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -1262,7 +1262,7 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL);
#else
/* this way we get editmode nurbs too, keyframe in editmode */
- RNA_def_property_collection_funcs(prop, "rna_Curve_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Curve_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
#endif
RNA_def_property_struct_type(prop, "Spline");
RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object");
@@ -1428,7 +1428,8 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "");
- RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
+ RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
+ RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
}
static void rna_def_curve_nurb(BlenderRNA *brna)
@@ -1450,7 +1451,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "bp", NULL);
RNA_def_property_struct_type(prop, "SplinePoint");
- RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_BPoint_array_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_Nurb_length", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Points", "Collection of points that make up this poly or nurbs spline");
rna_def_curve_spline_points(brna, prop);
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 758ddc9ac6a..ab469c19e15 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -58,6 +58,21 @@ BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
#define MAX2(x,y) ((x)>(y)? (x): (y))
#endif
+/* pedantic check for '.', do this since its a hassle for translators */
+#ifndef NDEBUG
+# define DESCR_CHECK(description, id1, id2) \
+ if(description && (description)[0]) { \
+ int i = strlen(description); \
+ if((description)[i - 1] == '.') { \
+ fprintf(stderr, "%s: '%s' '%s' description ends with a '.' !\n", \
+ __func__, id1 ? id1 : "", id2 ? id2 : ""); \
+ } \
+ } \
+
+#else
+# define DESCR_CHECK(description, id1, id2)
+#endif
+
void rna_addtail(ListBase *listbase, void *vlink)
{
Link *link= vlink;
@@ -119,7 +134,7 @@ StructDefRNA *rna_find_struct_def(StructRNA *srna)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_struct_def: only at preprocess time.\n");
+ fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
@@ -138,7 +153,7 @@ PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_struct_property_def: only at preprocess time.\n");
+ fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
@@ -166,7 +181,7 @@ static PropertyDefRNA *rna_find_property_def(PropertyRNA *prop)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_property_def: only at preprocess time.\n");
+ fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
@@ -189,7 +204,7 @@ FunctionDefRNA *rna_find_function_def(FunctionRNA *func)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_function_def: only at preprocess time.\n");
+ fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
@@ -218,7 +233,7 @@ PropertyDefRNA *rna_find_parameter_def(PropertyRNA *parm)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_parameter_def: only at preprocess time.\n");
+ fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
@@ -252,7 +267,7 @@ static ContainerDefRNA *rna_find_container_def(ContainerRNA *cont)
if(!DefRNA.preprocess) {
/* we should never get here */
- fprintf(stderr, "rna_find_container_def: only at preprocess time.\n");
+ fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return NULL;
}
@@ -498,7 +513,7 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
/*
if(srna->flag & STRUCT_RUNTIME) {
if(RNA_struct_py_type_get(srna)) {
- fprintf(stderr, "RNA_struct_free '%s' freed while holding a python reference\n", srna->identifier);
+ fprintf(stderr, "%s '%s' freed while holding a python reference\n", __func__, srna->identifier);
}
} */
@@ -602,7 +617,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
char error[512];
if (rna_validate_identifier(identifier, error, 0) == 0) {
- fprintf(stderr, "RNA_def_struct: struct identifier \"%s\" error - %s\n", identifier, error);
+ fprintf(stderr, "%s: struct identifier \"%s\" error - %s\n", __func__, identifier, error);
DefRNA.error= 1;
}
}
@@ -614,7 +629,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
break;
if(!srnafrom) {
- fprintf(stderr, "RNA_def_struct: struct %s not found to define %s.\n", from, identifier);
+ fprintf(stderr, "%s: struct %s not found to define %s.\n", __func__, from, identifier);
DefRNA.error= 1;
}
}
@@ -674,7 +689,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *
if(DefRNA.preprocess) {
RNA_def_property_struct_type(prop, "Property");
- RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", NULL, NULL, "rna_builtin_properties_lookup_string");
+ RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", NULL, NULL, "rna_builtin_properties_lookup_string", NULL);
}
else {
#ifdef RNA_RUNTIME
@@ -711,7 +726,7 @@ void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
StructDefRNA *ds;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -719,7 +734,7 @@ void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
if(!DNA_struct_find_nr(DefRNA.sdna, structname)) {
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_struct_sdna: %s not found.\n", structname);
+ fprintf(stderr, "%s: %s not found.\n", __func__, structname);
DefRNA.error= 1;
}
return;
@@ -733,20 +748,20 @@ void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const cha
StructDefRNA *ds;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_sdna_from: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
ds= rna_find_def_struct(srna);
if(!ds->dnaname) {
- fprintf(stderr, "RNA_def_struct_sdna_from: %s base struct must know DNA already.\n", structname);
+ fprintf(stderr, "%s: %s base struct must know DNA already.\n", __func__, structname);
return;
}
if(!DNA_struct_find_nr(DefRNA.sdna, structname)) {
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_struct_sdna_from: %s not found.\n", structname);
+ fprintf(stderr, "%s: %s not found.\n", __func__, structname);
DefRNA.error= 1;
}
return;
@@ -759,7 +774,7 @@ void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const cha
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
{
if(prop->type != PROP_STRING) {
- fprintf(stderr, "RNA_def_struct_name_property: \"%s.%s\", must be a string property.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", must be a string property.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
else
@@ -776,7 +791,7 @@ void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *struct
break;
if(!srnafrom) {
- fprintf(stderr, "RNA_def_struct_nested: struct %s not found for %s.\n", structname, srna->identifier);
+ fprintf(stderr, "%s: struct %s not found for %s.\n", __func__, structname, srna->identifier);
DefRNA.error= 1;
}
@@ -796,7 +811,7 @@ void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_refine_func: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -806,7 +821,7 @@ void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_idprops_func: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -816,7 +831,7 @@ void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg, const char *instance)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_register_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -828,7 +843,7 @@ void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_path_func: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -838,7 +853,7 @@ void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_struct_identifier(StructRNA *srna, const char *identifier)
{
if(DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_struct_name_runtime: only at runtime.\n");
+ fprintf(stderr, "%s: only at runtime.\n", __func__);
return;
}
@@ -847,6 +862,8 @@ void RNA_def_struct_identifier(StructRNA *srna, const char *identifier)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
{
+ DESCR_CHECK(description, srna->identifier, NULL);
+
srna->name= name;
srna->description= description;
}
@@ -870,7 +887,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
char error[512];
if (rna_validate_identifier(identifier, error, 1) == 0) {
- fprintf(stderr, "RNA_def_property: property identifier \"%s.%s\" - %s\n", CONTAINER_RNA_ID(cont), identifier, error);
+ fprintf(stderr, "%s: property identifier \"%s.%s\" - %s\n", __func__, CONTAINER_RNA_ID(cont), identifier, error);
DefRNA.error= 1;
}
@@ -878,7 +895,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
/* XXX - toto, detect supertype collisions */
if(rna_findlink(&dcont->properties, identifier)) {
- fprintf(stderr, "RNA_def_property: duplicate identifier \"%s.%s\"\n", CONTAINER_RNA_ID(cont), identifier);
+ fprintf(stderr, "%s: duplicate identifier \"%s.%s\"\n", __func__, CONTAINER_RNA_ID(cont), identifier);
DefRNA.error= 1;
}
@@ -936,7 +953,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
case PROP_COLLECTION:
break;
default:
- fprintf(stderr, "RNA_def_property: \"%s.%s\", invalid property type.\n", CONTAINER_RNA_ID(cont), identifier);
+ fprintf(stderr, "%s: \"%s.%s\", invalid property type.\n", __func__, CONTAINER_RNA_ID(cont), identifier);
DefRNA.error= 1;
return NULL;
}
@@ -1037,19 +1054,19 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
StructRNA *srna= DefRNA.laststruct;
if(length<0) {
- fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array length must be zero of greater.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", array length must be zero of greater.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
if(length>RNA_MAX_ARRAY_LENGTH) {
- fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array length must be smaller than %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH);
+ fprintf(stderr, "%s: \"%s.%s\", array length must be smaller than %d.\n", __func__, srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH);
DefRNA.error= 1;
return;
}
if(prop->arraydimension > 1) {
- fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array dimensions has been set to %u but would be overwritten as 1.\n", srna->identifier, prop->identifier, prop->arraydimension);
+ fprintf(stderr, "%s: \"%s.%s\", array dimensions has been set to %u but would be overwritten as 1.\n", __func__, srna->identifier, prop->identifier, prop->arraydimension);
DefRNA.error= 1;
return;
}
@@ -1063,7 +1080,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length)
prop->arraydimension= 1;
break;
default:
- fprintf(stderr, "RNA_def_property_array: \"%s.%s\", only boolean/int/float can be array.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", only boolean/int/float can be array.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1075,7 +1092,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le
int i;
if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) {
- fprintf(stderr, "RNA_def_property_multi_array: \"%s.%s\", array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION);
+ fprintf(stderr, "%s: \"%s.%s\", array dimension must be between 1 and %d.\n", __func__, srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION);
DefRNA.error= 1;
return;
}
@@ -1086,7 +1103,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le
case PROP_FLOAT:
break;
default:
- fprintf(stderr, "RNA_def_property_multi_array: \"%s.%s\", only boolean/int/float can be array.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", only boolean/int/float can be array.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1109,6 +1126,8 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
{
+ DESCR_CHECK(description, prop->identifier, NULL);
+
prop->name= name;
prop->description= description;
}
@@ -1141,7 +1160,7 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double
break;
}
default:
- fprintf(stderr, "RNA_def_property_ui_range: \"%s.%s\", invalid type for ui range.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for ui range.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1169,7 +1188,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max)
break;
}
default:
- fprintf(stderr, "RNA_def_property_range: \"%s.%s\", invalid type for range.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for range.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1180,7 +1199,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_struct_type \"%s.%s\": only during preprocessing.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s \"%s.%s\": only during preprocessing.\n", __func__, srna->identifier, prop->identifier);
return;
}
@@ -1196,7 +1215,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
break;
}
default:
- fprintf(stderr, "RNA_def_property_struct_type: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1207,7 +1226,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
StructRNA *srna= DefRNA.laststruct;
if(DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_struct_runtime: only at runtime.\n");
+ fprintf(stderr, "%s: only at runtime.\n", __func__);
return;
}
@@ -1227,7 +1246,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
break;
}
default:
- fprintf(stderr, "RNA_def_property_struct_runtime: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1262,7 +1281,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item
break;
}
default:
- fprintf(stderr, "RNA_def_property_enum_items: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", invalid type for struct type.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1279,7 +1298,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
break;
}
default:
- fprintf(stderr, "RNA_def_property_string_maxlength: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1296,7 +1315,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_boolean_default: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1313,7 +1332,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array)
break;
}
default:
- fprintf(stderr, "RNA_def_property_boolean_default: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1330,7 +1349,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_int_default: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1347,7 +1366,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
break;
}
default:
- fprintf(stderr, "RNA_def_property_int_default: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1364,7 +1383,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_float_default: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1381,7 +1400,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
break;
}
default:
- fprintf(stderr, "RNA_def_property_float_default: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1398,7 +1417,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_string_default: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1424,7 +1443,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
}
if(eprop->defaultvalue & ~totflag) {
- fprintf(stderr, "RNA_def_property_enum_default: \"%s.%s\", default includes unused bits (%d).\n", srna->identifier, prop->identifier, eprop->defaultvalue & ~totflag);
+ fprintf(stderr, "%s: \"%s.%s\", default includes unused bits (%d).\n", __func__, srna->identifier, prop->identifier, eprop->defaultvalue & ~totflag);
DefRNA.error= 1;
}
}
@@ -1439,7 +1458,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
eprop->defaultvalue= eprop->item[0].value;
}
else {
- fprintf(stderr, "RNA_def_property_enum_default: \"%s.%s\", default is not in items.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", default is not in items.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
}
}
@@ -1448,7 +1467,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value)
break;
}
default:
- fprintf(stderr, "RNA_def_property_enum_default: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not enum.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1487,7 +1506,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru
return dp;
}
else {
- fprintf(stderr, "rna_def_property_sdna: \"%s.%s\" not found.\n", structname, propname);
+ fprintf(stderr, "%s: \"%s.%s\" not found.\n", __func__, structname, propname);
DefRNA.error= 1;
return NULL;
}
@@ -1520,12 +1539,12 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, co
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if(prop->type != PROP_BOOLEAN) {
- fprintf(stderr, "RNA_def_property_boolean_sdna: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1535,7 +1554,7 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, co
if(DefRNA.silent == 0) {
/* error check to ensure floats are not wrapped as ints/bools */
if(dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
- fprintf(stderr, "RNA_def_property_boolean_sdna: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
+ fprintf(stderr, "%s: %s.%s is a '%s' but wrapped as type '%s'.\n", __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
DefRNA.error= 1;
return;
}
@@ -1564,12 +1583,12 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if(prop->type != PROP_INT) {
- fprintf(stderr, "RNA_def_property_int_sdna: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1579,7 +1598,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const
/* error check to ensure floats are not wrapped as ints/bools */
if(DefRNA.silent == 0) {
if(dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) {
- fprintf(stderr, "RNA_def_property_int_sdna: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
+ fprintf(stderr, "%s: %s.%s is a '%s' but wrapped as type '%s'.\n", __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
DefRNA.error= 1;
return;
}
@@ -1613,12 +1632,12 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if(prop->type != PROP_FLOAT) {
- fprintf(stderr, "RNA_def_property_float_sdna: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1628,7 +1647,7 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons
if(DefRNA.silent == 0) {
if(dp->dnatype && *dp->dnatype && IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) {
if(prop->subtype != PROP_COLOR_GAMMA) { /* colors are an exception. these get translated */
- fprintf(stderr, "RNA_def_property_float_sdna: %s.%s is a '%s' but wrapped as type '%s'.\n", srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
+ fprintf(stderr, "%s: %s.%s is a '%s' but wrapped as type '%s'.\n", __func__, srna->identifier, prop->identifier, dp->dnatype, RNA_property_typename(prop->type));
DefRNA.error= 1;
return;
}
@@ -1645,12 +1664,12 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if(prop->type != PROP_ENUM) {
- fprintf(stderr, "RNA_def_property_enum_sdna: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not enum.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1661,7 +1680,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const
prop->totarraylength= 0;
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_enum_sdna: \"%s.%s\", array not supported for enum type.\n", structname, propname);
+ fprintf(stderr, "%s: \"%s.%s\", array not supported for enum type.\n", __func__, structname, propname);
DefRNA.error= 1;
}
}
@@ -1687,12 +1706,12 @@ void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, con
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if(prop->type != PROP_STRING) {
- fprintf(stderr, "RNA_def_property_string_sdna: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1712,12 +1731,12 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if(prop->type != PROP_POINTER) {
- fprintf(stderr, "RNA_def_property_pointer_sdna: \"%s.%s\", type is not pointer.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not pointer.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1728,7 +1747,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co
prop->totarraylength= 0;
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_pointer_sdna: \"%s.%s\", array not supported for pointer type.\n", structname, propname);
+ fprintf(stderr, "%s: \"%s.%s\", array not supported for pointer type.\n", __func__, structname, propname);
DefRNA.error= 1;
}
}
@@ -1742,12 +1761,12 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_sdna: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if(prop->type != PROP_COLLECTION) {
- fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\", type is not collection.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not collection.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
return;
}
@@ -1758,7 +1777,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
prop->totarraylength= 0;
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\", array of collections not supported.\n", structname, propname);
+ fprintf(stderr, "%s: \"%s.%s\", array of collections not supported.\n", __func__, structname, propname);
DefRNA.error= 1;
}
}
@@ -1799,7 +1818,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
}
else {
if(!DefRNA.silent) {
- fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\" not found.\n", structname, lengthpropname);
+ fprintf(stderr, "%s: \"%s.%s\" not found.\n", __func__, structname, lengthpropname);
DefRNA.error= 1;
}
}
@@ -1811,7 +1830,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname,
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_editable_func: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1821,7 +1840,7 @@ void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_def_property_editable_array_func(PropertyRNA *prop, const char *editable)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_editable_array_func: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1831,7 +1850,7 @@ void RNA_def_property_editable_array_func(PropertyRNA *prop, const char *editabl
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_update: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1847,12 +1866,12 @@ void RNA_def_property_update_runtime(PropertyRNA *prop, void *func)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
{
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
if (!(prop->flag & PROP_DYNAMIC)) {
- fprintf(stderr, "RNA_def_property_dynamic_array_funcs: property is a not dynamic array.\n");
+ fprintf(stderr, "%s: property is a not dynamic array.\n", __func__);
DefRNA.error= 1;
return;
}
@@ -1865,7 +1884,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1884,7 +1903,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch
break;
}
default:
- fprintf(stderr, "RNA_def_property_boolean_funcs: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not boolean.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1895,7 +1914,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1915,7 +1934,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *
break;
}
default:
- fprintf(stderr, "RNA_def_property_int_funcs: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not int.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1926,7 +1945,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1946,7 +1965,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char
break;
}
default:
- fprintf(stderr, "RNA_def_property_float_funcs: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not float.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1957,7 +1976,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1971,7 +1990,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char
break;
}
default:
- fprintf(stderr, "RNA_def_property_enum_funcs: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not enum.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -1982,7 +2001,7 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const cha
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -1996,7 +2015,7 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const cha
break;
}
default:
- fprintf(stderr, "RNA_def_property_string_funcs: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not string.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -2007,7 +2026,7 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -2022,18 +2041,18 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch
break;
}
default:
- fprintf(stderr, "RNA_def_property_pointer_funcs: \"%s.%s\", type is not pointer.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not pointer.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
}
-void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring)
+void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
{
StructRNA *srna= DefRNA.laststruct;
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n");
+ fprintf(stderr, "%s: only during preprocessing.\n", __func__);
return;
}
@@ -2048,10 +2067,11 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con
if(length) cprop->length= (PropCollectionLengthFunc)length;
if(lookupint) cprop->lookupint= (PropCollectionLookupIntFunc)lookupint;
if(lookupstring) cprop->lookupstring= (PropCollectionLookupStringFunc)lookupstring;
+ if(assignint) cprop->assignint= (PropCollectionAssignIntFunc)assignint;
break;
}
default:
- fprintf(stderr, "RNA_def_property_collection_funcs: \"%s.%s\", type is not collection.\n", srna->identifier, prop->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", type is not collection.\n", __func__, srna->identifier, prop->identifier);
DefRNA.error= 1;
break;
}
@@ -2240,6 +2260,20 @@ PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *id
return prop;
}
+PropertyRNA *RNA_def_string_translate(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen,
+ const char *ui_name, const char *ui_description)
+{
+ ContainerRNA *cont= cont_;
+ PropertyRNA *prop;
+
+ prop= RNA_def_property(cont, identifier, PROP_STRING, PROP_TRANSLATE);
+ if(maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
+ if(default_value) RNA_def_property_string_default(prop, default_value);
+ RNA_def_property_ui_text(prop, ui_name, ui_description);
+
+ return prop;
+}
+
PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value,
const char *ui_name, const char *ui_description)
{
@@ -2247,7 +2281,7 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co
PropertyRNA *prop;
if(!items) {
- printf("RNA_def_enum: items not allowed to be NULL.\n");
+ printf("%s: items not allowed to be NULL.\n", __func__);
return NULL;
}
@@ -2267,7 +2301,7 @@ PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifie
PropertyRNA *prop;
if(!items) {
- printf("RNA_def_enum_flag: items not allowed to be NULL.\n");
+ printf("%s: items not allowed to be NULL.\n", __func__);
return NULL;
}
@@ -2497,7 +2531,7 @@ static FunctionRNA *rna_def_function(StructRNA *srna, const char *identifier)
char error[512];
if (rna_validate_identifier(identifier, error, 0) == 0) {
- fprintf(stderr, "RNA_def_function: function identifier \"%s\" - %s\n", identifier, error);
+ fprintf(stderr, "%s: function identifier \"%s\" - %s\n", __func__, identifier, error);
DefRNA.error= 1;
}
}
@@ -2528,7 +2562,7 @@ FunctionRNA *RNA_def_function(StructRNA *srna, const char *identifier, const cha
func= rna_def_function(srna, identifier);
if(!DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_function: only at preprocess time.\n");
+ fprintf(stderr, "%s: only at preprocess time.\n", __func__);
return func;
}
@@ -2545,7 +2579,7 @@ FunctionRNA *RNA_def_function_runtime(StructRNA *srna, const char *identifier, C
func= rna_def_function(srna, identifier);
if(DefRNA.preprocess) {
- fprintf(stderr, "RNA_def_function_call_runtime: only at runtime.\n");
+ fprintf(stderr, "%s: only at runtime.\n", __func__);
return func;
}
@@ -2559,11 +2593,11 @@ FunctionRNA *RNA_def_function_runtime(StructRNA *srna, const char *identifier, C
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
{
if (ret->flag & PROP_DYNAMIC) {
- fprintf(stderr, "RNA_def_function_return: \"%s.%s\", dynamic values are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", dynamic values are not allowed as strict returns, use RNA_def_function_output instead.\n", __func__, func->identifier, ret->identifier);
return;
}
else if (ret->arraydimension) {
- fprintf(stderr, "RNA_def_function_return: \"%s.%s\", arrays are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier);
+ fprintf(stderr, "%s: \"%s.%s\", arrays are not allowed as strict returns, use RNA_def_function_output instead.\n", __func__, func->identifier, ret->identifier);
return;
}
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 11eec6a0a47..43812ad4a01 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -236,7 +236,7 @@ static void rna_DriverTarget_RnaPath_set(PointerRNA *ptr, const char *value)
if (dtar->rna_path)
MEM_freeN(dtar->rna_path);
- if (strlen(value))
+ if (value[0])
dtar->rna_path= BLI_strdup(value);
else
dtar->rna_path= NULL;
@@ -329,7 +329,7 @@ static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value)
if (fcu->rna_path)
MEM_freeN(fcu->rna_path);
- if (strlen(value)) {
+ if (value[0]) {
fcu->rna_path= BLI_strdup(value);
fcu->flag &= ~FCURVE_DISABLED;
}
@@ -643,7 +643,9 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
/* define common props */
prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
- RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them");
+ RNA_def_property_ui_text(prop, "Additive",
+ "Values generated by this modifier are applied on top of "
+ "the existing values instead of overwriting them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
// XXX this has a special validation func
@@ -656,7 +658,8 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
/* order of the polynomial */
// XXX this has a special validation func
prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE);
- RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)");
+ RNA_def_property_ui_text(prop, "Polynomial Order",
+ "The highest power of 'x' for this polynomial. (number of coefficients - 1)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* coefficients array */
@@ -664,7 +667,8 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
RNA_def_property_array(prop, 32);
RNA_def_property_flag(prop, PROP_DYNAMIC);
RNA_def_property_dynamic_array_funcs(prop, "rna_FModifierGenerator_coefficients_get_length");
- RNA_def_property_float_funcs(prop, "rna_FModifierGenerator_coefficients_get", "rna_FModifierGenerator_coefficients_set", NULL);
+ RNA_def_property_float_funcs(prop, "rna_FModifierGenerator_coefficients_get",
+ "rna_FModifierGenerator_coefficients_set", NULL);
RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power of x^0)");
}
@@ -708,7 +712,9 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
/* flags */
prop= RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
- RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them");
+ RNA_def_property_ui_text(prop, "Additive",
+ "Values generated by this modifier are applied on top of "
+ "the existing values instead of overwriting them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE);
@@ -795,8 +801,10 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
static EnumPropertyItem prop_type_items[] = {
{FCM_EXTRAPOLATE_NONE, "NONE", 0, "No Cycles", "Don't do anything"},
{FCM_EXTRAPOLATE_CYCLIC, "REPEAT", 0, "Repeat Motion", "Repeat keyframe range as-is"},
- {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset", "Repeat keyframe range, but with offset based on gradient between values"},
- {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"},
+ {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset",
+ "Repeat keyframe range, but with offset based on gradient between values"},
+ {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored",
+ "Alternate between forward and reverse playback of keyframe range"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FModifierCycles", "FModifier");
@@ -950,7 +958,8 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna)
PropertyRNA *prop;
srna= RNA_def_struct(brna, "FModifierStepped", "FModifier");
- RNA_def_struct_ui_text(srna, "Stepped Interpolation F-Modifier", "Holds each interpolated value from the F-Curve for several frames without changing the timing");
+ RNA_def_struct_ui_text(srna, "Stepped Interpolation F-Modifier",
+ "Hold each interpolated value from the F-Curve for several frames without changing the timing");
RNA_def_struct_sdna_from(srna, "FMod_Stepped", "data");
/* properties */
@@ -961,7 +970,9 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna)
prop= RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
- RNA_def_property_ui_text(prop, "Offset", "Reference number of frames before frames get held. Use to get hold for '1-3' vs '5-7' holding patterns");
+ RNA_def_property_ui_text(prop, "Offset",
+ "Reference number of frames before frames get held "
+ "(use to get hold for '1-3' vs '5-7' holding patterns)");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE);
@@ -1042,7 +1053,9 @@ static void rna_def_fmodifier(BlenderRNA *brna)
/* restricted range */
prop= RNA_def_property(srna, "use_restricted_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_RANGERESTRICT);
- RNA_def_property_ui_text(prop, "Restrict Frame Range", "F-Curve Modifier is only applied for the specified frame range to help mask off effects in order to chain them");
+ RNA_def_property_ui_text(prop, "Restrict Frame Range",
+ "F-Curve Modifier is only applied for the specified frame range to help "
+ "mask off effects in order to chain them");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); // XXX: depends on UI implementation
@@ -1106,8 +1119,10 @@ static void rna_def_drivertarget(BlenderRNA *brna)
static EnumPropertyItem prop_local_space_items[] = {
{0, "WORLD_SPACE", 0, "World Space", "Transforms include effects of parenting/restpose and constraints"},
- {DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space", "Transforms don't include parenting/restpose or constraints"},
- {DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space", "Transforms include effects of constraints but not parenting/restpose"},
+ {DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space",
+ "Transforms don't include parenting/restpose or constraints"},
+ {DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space",
+ "Transforms include effects of constraints but not parenting/restpose"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "DriverTarget", NULL);
@@ -1120,7 +1135,8 @@ static void rna_def_drivertarget(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable");
/* note: custom set function is ONLY to avoid rna setting a user for this. */
RNA_def_property_pointer_funcs(prop, NULL, "rna_DriverTarget_id_set", "rna_DriverTarget_id_typef", NULL);
- RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from (id_type property must be set first)");
+ RNA_def_property_ui_text(prop, "ID",
+ "ID-block that the specific property used can be found from (id_type property must be set first)");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
@@ -1134,7 +1150,8 @@ static void rna_def_drivertarget(BlenderRNA *brna)
/* Target Properties - Property to Drive */
prop= RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length", "rna_DriverTarget_RnaPath_set");
+ RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length",
+ "rna_DriverTarget_RnaPath_set");
RNA_def_property_ui_text(prop, "Data Path", "RNA Path (from ID-block) to property used");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data");
@@ -1176,7 +1193,9 @@ static void rna_def_drivervar(BlenderRNA *brna)
/* Variable Name */
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_ui_text(prop, "Name", "Name to use in scripted expressions/functions. (No spaces or dots are allowed. Also, must not start with a symbol or digit)");
+ RNA_def_property_ui_text(prop, "Name",
+ "Name to use in scripted expressions/functions (no spaces or dots are allowed, "
+ "and must start with a letter)");
RNA_def_property_update(prop, 0, "rna_DriverTarget_update_name"); // XXX
/* Enums */
@@ -1265,7 +1284,8 @@ static void rna_def_channeldriver(BlenderRNA *brna)
/* Settings */
prop= RNA_def_property(srna, "show_debug_info", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", DRIVER_FLAG_SHOWDEBUG);
- RNA_def_property_ui_text(prop, "Show Debug Info", "Show intermediate values for the driver calculations to allow debugging of drivers");
+ RNA_def_property_ui_text(prop, "Show Debug Info",
+ "Show intermediate values for the driver calculations to allow debugging of drivers");
/* State Info (for Debugging) */
prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
@@ -1347,7 +1367,8 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ipo");
RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
- RNA_def_property_ui_text(prop, "Interpolation", "Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe");
+ RNA_def_property_ui_text(prop, "Interpolation",
+ "Interpolation method to use for segment of the curve from this Keyframe until the next Keyframe");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
@@ -1547,7 +1568,8 @@ static void rna_def_fcurve(BlenderRNA *brna)
/* State Info (for Debugging) */
prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_DISABLED);
- RNA_def_property_ui_text(prop, "Valid", "False when F-Curve could not be evaluated in past, so should be skipped when evaluating");
+ RNA_def_property_ui_text(prop, "Valid",
+ "False when F-Curve could not be evaluated in past, so should be skipped when evaluating");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
/* Collections */
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index ccb24d7dd9b..ba90aca47a3 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -141,12 +141,12 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
psys->part= part;
psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
psys->flag |= PSYS_ENABLED;
- sprintf(psys->name, "FluidParticles");
+ BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name));
BLI_addtail(&ob->particlesystem,psys);
/* add modifier */
psmd= (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem);
- sprintf(psmd->modifier.name, "FluidParticleSystem" );
+ BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name));
psmd->psys= psys;
BLI_addtail(&ob->modifiers, psmd);
modifier_unique_name(&ob->modifiers, (ModifierData *)psmd);
@@ -412,7 +412,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
prop= RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FluidMeshVertex");
RNA_def_property_ui_text(prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation");
- RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", NULL, NULL, NULL);
rna_def_fluid_mesh_vertices(brna);
}
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index 597f05ed9f6..0a66ff9fa99 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -132,7 +132,7 @@ void RNA_def_group(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects");
- RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Group_objects_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_Group_objects_get", NULL, NULL, NULL, NULL);
rna_def_group_objects(brna, prop);
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index b7827989a94..50ce816d7a1 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -142,7 +142,7 @@ static void rna_Image_pack(Image *image, ReportList *reports, int as_png)
BKE_image_memorypack(image);
}
else {
- image->packedfile= newPackedFile(reports, image->name);
+ image->packedfile= newPackedFile(reports, image->name, ID_BLEND_PATH(G.main, &image->id));
}
}
}
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 78b8c67d92c..4cd4a2f11f9 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -234,6 +234,7 @@ char *rna_TextureSlot_path(struct PointerRNA *ptr);
void RNA_api_action(StructRNA *srna);
void RNA_api_armature_edit_bone(StructRNA *srna);
void RNA_api_bone(StructRNA *srna);
+void RNA_api_camera(StructRNA *srna);
void RNA_api_drivers(StructRNA *srna);
void RNA_api_image(struct StructRNA *srna);
void RNA_api_operator(struct StructRNA *srna);
@@ -381,6 +382,9 @@ struct MTex *rna_mtex_texture_slots_add(struct ID *self, struct bContext *C, str
struct MTex *rna_mtex_texture_slots_create(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct ReportList *reports, int index);
+
+int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr);
+
#endif /* RNA_INTERNAL_H */
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 249833ae94b..50790a0077f 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -102,6 +102,7 @@ typedef PointerRNA (*PropCollectionGetFunc)(struct CollectionPropertyIterator *i
typedef int (*PropCollectionLengthFunc)(struct PointerRNA *ptr);
typedef int (*PropCollectionLookupIntFunc)(struct PointerRNA *ptr, int key, struct PointerRNA *r_ptr);
typedef int (*PropCollectionLookupStringFunc)(struct PointerRNA *ptr, const char *key, struct PointerRNA *r_ptr);
+typedef int (*PropCollectionAssignIntFunc)(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr);
/* Container - generic abstracted container of RNA properties */
typedef struct ContainerRNA {
@@ -285,6 +286,7 @@ typedef struct CollectionPropertyRNA {
PropCollectionLengthFunc length; /* optional */
PropCollectionLookupIntFunc lookupint; /* optional */
PropCollectionLookupStringFunc lookupstring; /* optional */
+ PropCollectionAssignIntFunc assignint; /* optional */
struct StructRNA *item_type; /* the type of this item */
} CollectionPropertyRNA;
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index ad6f67cddaf..353da196e89 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -581,7 +581,7 @@ static void rna_def_keyblock(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "data", "totelem");
RNA_def_property_struct_type(prop, "UnknownType");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", 0, 0, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", NULL, NULL, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", NULL, NULL, NULL);
}
static void rna_def_key(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index 8387b3286d6..2a81c4f0a2c 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -237,7 +237,7 @@ static void rna_def_latticepoint(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Lattice_update_data");
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "VertexGroupElement");
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of");
}
@@ -317,7 +317,7 @@ static void rna_def_lattice(BlenderRNA *brna)
prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "LatticePoint");
- RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Points", "Points of the lattice");
/* pointers */
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 352aaa890a5..0b44f7c98d0 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -337,7 +337,7 @@ void RNA_def_main(BlenderRNA *brna)
{
prop= RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, lists[i].type);
- RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, lists[i].iter_begin, "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, lists[i].name, lists[i].description);
/* collection functions */
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 395d3cba412..cfcbdb162cc 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -345,12 +345,12 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall
mb->id.name+2, ID_REAL_USERS(mb));
}
-VFont *rna_Main_fonts_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath)
+VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath)
{
VFont *font;
errno= 0;
- font= load_vfont(filepath);
+ font= load_vfont(bmain, filepath);
if(!font)
BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
@@ -678,7 +678,7 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_srna(cprop, "BlendDataMaterials");
srna= RNA_def_struct(brna, "BlendDataMaterials", NULL);
RNA_def_struct_sdna(srna, "Main");
- RNA_def_struct_ui_text(srna, "Main Material", "Collection of materials");
+ RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
func= RNA_def_function(srna, "new", "rna_Main_materials_new");
RNA_def_function_ui_description(func, "Add a new material to the main database");
@@ -957,7 +957,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_srna(cprop, "BlendDataMetaBalls");
srna= RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
RNA_def_struct_sdna(srna, "Main");
- RNA_def_struct_ui_text(srna, "Main MetaBall", "Collection of metaballs");
+ RNA_def_struct_ui_text(srna, "Main MetaBalls", "Collection of metaballs");
func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
RNA_def_function_ui_description(func, "Add a new metaball to the main database");
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 22ae6b6ba7e..16b9371916f 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -377,10 +377,10 @@ static void rna_def_material_mtex(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_mapping_items[] = {
- {MTEX_FLAT, "FLAT", 0, "Flat", "Maps X and Y coordinates directly"},
- {MTEX_CUBE, "CUBE", 0, "Cube", "Maps using the normal vector"},
- {MTEX_TUBE, "TUBE", 0, "Tube", "Maps with Z as central axis"},
- {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Maps with Z as central axis"},
+ {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"},
+ {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
+ {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
+ {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_x_mapping_items[] = {
@@ -456,7 +456,7 @@ static void rna_def_material_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_from_original", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_OB_DUPLI_ORIG);
RNA_def_property_ui_text(prop, "From Original",
- "Dupli's derive their object coordinates from the original objects transformation");
+ "Dupli's derive their object coordinates from the original object's transformation");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE);
@@ -555,7 +555,7 @@ static void rna_def_material_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "normal_map_space", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "normapspace");
RNA_def_property_enum_items(prop, prop_normal_map_space_items);
- RNA_def_property_ui_text(prop, "Normal Map Space", "Sets space of normal map image");
+ RNA_def_property_ui_text(prop, "Normal Map Space", "Set space of normal map image");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE);
@@ -767,9 +767,9 @@ static void rna_def_material_gamesettings(BlenderRNA *brna)
RNA_def_struct_nested(brna, srna, "Material");
RNA_def_struct_ui_text(srna, "Material Game Settings", "Game Engine settings for a Material datablock");
- prop= RNA_def_property(srna, "back_culling", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_BACKCULL); /* use bitflags */
- RNA_def_property_ui_text(prop, "Back Culling", "Hide Back of the face in Game Engine ");
+ RNA_def_property_ui_text(prop, "Backface Culling", "Hide Back of the face in Game Engine ");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE);
@@ -871,7 +871,7 @@ static void rna_def_material_colors(StructRNA *srna)
prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec");
RNA_def_property_enum_items(prop, ramp_blend_items);
- RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "Blending method of the ramp and the specular color");
+ RNA_def_property_ui_text(prop, "Specular Ramp Blend", "Blending method of the ramp and the specular color");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE);
@@ -981,7 +981,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace");
+ RNA_def_property_ui_text(prop, "Reflectivity", "Amount of mirror reflection for raytrace");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
@@ -1060,7 +1060,7 @@ static void rna_def_material_raytra(BlenderRNA *brna)
prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "ang");
RNA_def_property_range(prop, 0.25f, 4.0f);
- RNA_def_property_ui_text(prop, "IOR", "Sets angular index of refraction for raytraced refraction");
+ RNA_def_property_ui_text(prop, "IOR", "Angular index of refraction for raytraced refraction");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
@@ -1233,7 +1233,7 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3);
RNA_def_property_ui_text(prop, "Scattering",
"Amount of light that gets scattered out by the volume - "
- "the more out-scattering, the shallower the light will penetrate ");
+ "the more out-scattering, the shallower the light will penetrate");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR);
@@ -1292,118 +1292,118 @@ static void rna_def_material_halo(BlenderRNA *brna)
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "hasize");
RNA_def_property_range(prop, 0.0f, 100.0f);
- RNA_def_property_ui_text(prop, "Size", "Sets the dimension of the halo");
+ RNA_def_property_ui_text(prop, "Size", "Dimension of the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "har");
RNA_def_property_range(prop, 0, 127);
- RNA_def_property_ui_text(prop, "Hardness", "Sets the hardness of the halo");
+ RNA_def_property_ui_text(prop, "Hardness", "Hardness of the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "add");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Add", "Sets the strength of the add effect");
+ RNA_def_property_ui_text(prop, "Add", "Strength of the add effect");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ring_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ringc");
RNA_def_property_range(prop, 0, 24);
- RNA_def_property_ui_text(prop, "Rings", "Sets the number of rings rendered over the halo");
+ RNA_def_property_ui_text(prop, "Rings", "Number of rings rendered over the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "line_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "linec");
RNA_def_property_range(prop, 0, 250);
- RNA_def_property_ui_text(prop, "Line Number", "Sets the number of star shaped lines rendered over the halo");
+ RNA_def_property_ui_text(prop, "Line Number", "Number of star shaped lines rendered over the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "star_tip_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "starc");
RNA_def_property_range(prop, 3, 50);
- RNA_def_property_ui_text(prop, "Star Tips", "Sets the number of points on the star shaped halo");
+ RNA_def_property_ui_text(prop, "Star Tips", "Number of points on the star shaped halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed1");
RNA_def_property_range(prop, 0, 255);
- RNA_def_property_ui_text(prop, "Seed", "Randomizes ring dimension and line location");
+ RNA_def_property_ui_text(prop, "Seed", "Randomize ring dimension and line location");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_flare_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_FLARE); /* use bitflags */
- RNA_def_property_ui_text(prop, "Flare", "Renders halo as a lens flare");
+ RNA_def_property_ui_text(prop, "Flare", "Render halo as a lens flare");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flaresize");
RNA_def_property_range(prop, 0.1f, 25.0f);
- RNA_def_property_ui_text(prop, "Flare Size", "Sets the factor by which the flare is larger than the halo");
+ RNA_def_property_ui_text(prop, "Flare Size", "Factor by which the flare is larger than the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_subflare_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "subsize");
RNA_def_property_range(prop, 0.1f, 25.0f);
- RNA_def_property_ui_text(prop, "Flare Subsize", "Sets the dimension of the sub-flares, dots and circles");
+ RNA_def_property_ui_text(prop, "Flare Subsize", "Dimension of the sub-flares, dots and circles");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "flareboost");
RNA_def_property_range(prop, 0.1f, 10.0f);
- RNA_def_property_ui_text(prop, "Flare Boost", "Gives the flare extra strength");
+ RNA_def_property_ui_text(prop, "Flare Boost", "Give the flare extra strength");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed2");
RNA_def_property_range(prop, 0, 255);
- RNA_def_property_ui_text(prop, "Flare Seed", "Specifies an offset in the flare seed table");
+ RNA_def_property_ui_text(prop, "Flare Seed", "Offset in the flare seed table");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "flare_subflare_count", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "flarec");
RNA_def_property_range(prop, 1, 32);
- RNA_def_property_ui_text(prop, "Flares Sub", "Sets the number of sub-flares");
+ RNA_def_property_ui_text(prop, "Flares Sub", "Number of sub-flares");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_ring", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_RINGS);
- RNA_def_property_ui_text(prop, "Rings", "Renders rings over halo");
+ RNA_def_property_ui_text(prop, "Rings", "Render rings over halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_lines", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_LINES);
- RNA_def_property_ui_text(prop, "Lines", "Renders star shaped lines over halo");
+ RNA_def_property_ui_text(prop, "Lines", "Render star shaped lines over halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_star", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STAR);
- RNA_def_property_ui_text(prop, "Star", "Renders halo as a star");
+ RNA_def_property_ui_text(prop, "Star", "Render halo as a star");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX);
- RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture");
+ RNA_def_property_ui_text(prop, "Texture", "Give halo a texture");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO);
- RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo");
+ RNA_def_property_ui_text(prop, "Vertex Normal", "Use the vertex normal to specify the dimension of the halo");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_extreme_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_XALPHA);
- RNA_def_property_ui_text(prop, "Extreme Alpha", "Uses extreme alpha");
+ RNA_def_property_ui_text(prop, "Extreme Alpha", "Use extreme alpha");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_shaded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SHADE);
- RNA_def_property_ui_text(prop, "Shaded", "Lets halo receive light and shadows from external objects");
+ RNA_def_property_ui_text(prop, "Shaded", "Let halo receive light and shadows from external objects");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_soft", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SOFT);
- RNA_def_property_ui_text(prop, "Soft", "Softens the edges of halos at intersections with other geometry");
+ RNA_def_property_ui_text(prop, "Soft", "Soften the edges of halos at intersections with other geometry");
RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -1457,7 +1457,7 @@ static void rna_def_material_sss(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "sss_texfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Texture Factor", "Texture scatting blend factor");
+ RNA_def_property_ui_text(prop, "Texture Factor", "Texture scattering blend factor");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "front", PROP_FLOAT, PROP_NONE);
@@ -1594,7 +1594,7 @@ static void rna_def_material_strand(BlenderRNA *brna)
prop= RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strand_ease");
RNA_def_property_range(prop, -0.9, 0.9);
- RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative makes strands spiky");
+ RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative ones make strands spiky");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE);
@@ -1659,7 +1659,7 @@ void RNA_def_material(BlenderRNA *brna)
static EnumPropertyItem prop_type_items[] = {
{MA_TYPE_SURFACE, "SURFACE", 0, "Surface", "Render object as a surface"},
- {MA_TYPE_WIRE, "WIRE", 0, "Wire", "Render the edges of faces as wires (not supported in ray tracing)"},
+ {MA_TYPE_WIRE, "WIRE", 0, "Wire", "Render the edges of faces as wires (not supported in raytracing)"},
{MA_TYPE_VOLUME, "VOLUME", 0, "Volume", "Render object as a volume"},
{MA_TYPE_HALO, "HALO", 0, "Halo", "Render object as halo particles"},
{0, NULL, 0, NULL, NULL}};
@@ -1688,7 +1688,7 @@ void RNA_def_material(BlenderRNA *brna)
srna= RNA_def_struct(brna, "Material", "ID");
RNA_def_struct_ui_text(srna, "Material",
- "Material datablock to defined the appearance of geometric objects for rendering");
+ "Material datablock to define the appearance of geometric objects for rendering");
RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
@@ -1785,17 +1785,17 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE);
RNA_def_property_ui_text(prop, "Traceable",
- "Include this material and geometry that uses it in ray tracing calculations");
+ "Include this material and geometry that uses it in raytracing calculations");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW);
- RNA_def_property_ui_text(prop, "Shadows", "Allows this material to receive shadows");
+ RNA_def_property_ui_text(prop, "Shadows", "Allow this material to receive shadows");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_shadeless", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHLESS);
- RNA_def_property_ui_text(prop, "Shadeless", "Makes this material insensitive to light or shadow");
+ RNA_def_property_ui_text(prop, "Shadeless", "Make this material insensitive to light or shadow");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "use_vertex_color_light", PROP_BOOLEAN, PROP_NONE);
@@ -1806,30 +1806,30 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_vertex_color_paint", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOLP);
RNA_def_property_ui_text(prop, "Vertex Color Paint",
- "Replaces object base color with vertex colors (multiplies with "
+ "Replace object base color with vertex colors (multiply with "
"'texture face' face assigned textures)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZINV);
- RNA_def_property_ui_text(prop, "Invert Z Depth", "Renders material's faces with an inverted Z buffer (scanline only)");
+ RNA_def_property_ui_text(prop, "Invert Z Depth", "Render material's faces with an inverted Z buffer (scanline only)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "offset_z", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "zoffs");
- RNA_def_property_ui_text(prop, "Z Offset", "Gives faces an artificial offset in the Z buffer for Z transparency");
+ RNA_def_property_ui_text(prop, "Z Offset", "Give faces an artificial offset in the Z buffer for Z transparency");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV);
RNA_def_property_ui_text(prop, "Sky",
- "Renders this material with zero alpha, with sky background in place (scanline only)");
+ "Render this material with zero alpha, with sky background in place (scanline only)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW);
RNA_def_property_ui_text(prop, "Only Shadow",
- "Renders shadows as the material's alpha value, making materials "
+ "Render shadows as the material's alpha value, making the material "
"transparent except for shadowed areas");
RNA_def_property_update(prop, 0, "rna_Material_update");
@@ -1842,19 +1842,19 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_face_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE);
RNA_def_property_ui_text(prop, "Face Textures",
- "Replaces the object's base color with color from face assigned image textures");
+ "Replace the object's base color with color from face assigned image textures");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_face_texture_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA);
RNA_def_property_ui_text(prop, "Face Textures Alpha",
- "Replaces the object's base alpha value with alpha from face assigned image textures");
+ "Replace the object's base alpha value with alpha from face assigned image textures");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_cast_shadows_only", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST);
RNA_def_property_ui_text(prop, "Cast Shadows Only",
- "Makes objects with this material appear invisible, only casting shadows (not rendered)");
+ "Make objects with this material appear invisible (not rendered), only casting shadows");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
@@ -1871,7 +1871,7 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_ray_shadow_bias", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS);
RNA_def_property_ui_text(prop, "Ray Shadow Bias",
- "Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)");
+ "Prevent raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_full_oversampling", PROP_BOOLEAN, PROP_NONE);
@@ -2040,8 +2040,7 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin,
/* mtex */
prop= RNA_def_property(srna, "texture_slots", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, structname);
- RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end",
- "rna_iterator_array_dereference_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Textures", "Texture slots defining the mapping and influence of textures");
rna_def_texture_slots(brna, prop, structname, structname_slots);
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 1bbdc7cc853..d35b7ad38fb 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -166,7 +166,8 @@ static void rna_MeshFace_normal_get(PointerRNA *ptr, float *values)
MFace *mface= (MFace*)ptr->data;
if(mface->v4)
- normal_quad_v3( values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co, me->mvert[mface->v4].co);
+ normal_quad_v3(values,me->mvert[mface->v1].co, me->mvert[mface->v2].co,
+ me->mvert[mface->v3].co, me->mvert[mface->v4].co);
else
normal_tri_v3( values,me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co);
}
@@ -1226,7 +1227,8 @@ static void rna_def_mvert(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "VertexGroupElement");
RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of");
@@ -1348,12 +1350,12 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_range(prop, -1.0f, 1.0f);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_MeshFace_normal_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "face normal", "local space unit length normal vector for this face");
+ RNA_def_property_ui_text(prop, "Face normal", "Local space unit length normal vector for this face");
prop= RNA_def_property(srna, "area", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_MeshFace_area_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "face area", "read only area of the face");
+ RNA_def_property_ui_text(prop, "Face area", "Read only area of the face");
prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -1365,12 +1367,6 @@ static void rna_def_mtface(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- static const EnumPropertyItem transp_items[]= {
- {TF_SOLID, "OPAQUE", 0, "Opaque", "Render color of textured face as color"},
- {TF_ADD, "ADD", 0, "Add", "Render face transparent and add color of face"},
- {TF_ALPHA, "ALPHA", 0, "Alpha", "Render polygon transparent, depending on alpha channel of the texture"},
- {TF_CLIP, "CLIPALPHA", 0, "Clip Alpha", "Use the images alpha values clipped with no blending (binary alpha)"},
- {0, NULL, 0, NULL, NULL}};
const int uv_dim[]= {4, 2};
srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
@@ -1392,7 +1388,8 @@ static void rna_def_mtface(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0);
- RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get", "rna_MeshTextureFaceLayer_active_render_set");
+ RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get",
+ "rna_MeshTextureFaceLayer_active_render_set");
RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
@@ -1405,7 +1402,9 @@ static void rna_def_mtface(BlenderRNA *brna)
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshTextureFace");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTextureFaceLayer_data_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL);
srna= RNA_def_struct(brna, "MeshTextureFace", NULL);
RNA_def_struct_sdna(srna, "MTFace");
@@ -1420,78 +1419,6 @@ static void rna_def_mtface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Image", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
- //XXX to be deleted soon -- left for now in case we need it for debug
- //XXX it should be out before Blender 2.6 (after texface to material patch)
-
- prop= RNA_def_property(srna, "use_image", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX);
- RNA_def_property_ui_text(prop, "Tex", "Render face with texture");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_light", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_LIGHT);
- RNA_def_property_ui_text(prop, "Light", "Use light for face");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_INVISIBLE);
- RNA_def_property_ui_text(prop, "Invisible", "Make face invisible");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_collision", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_DYNAMIC);
- RNA_def_property_ui_text(prop, "Collision", "Use face for collision and ray-sensor detection");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_blend_shared", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHAREDCOL);
- RNA_def_property_ui_text(prop, "Shared", "Blend vertex colors across face when vertices are shared");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_twoside", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TWOSIDE);
- RNA_def_property_ui_text(prop, "Two-side", "Render face two-sided");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_object_color", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_OBCOL);
- RNA_def_property_ui_text(prop, "Object Color", "Use ObColor instead of vertex colors");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD);
- RNA_def_property_ui_text(prop, "Halo", "Screen aligned billboard");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_billboard", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD2);
- RNA_def_property_ui_text(prop, "Billboard", "Billboard with Z-axis constraint");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_shadow_cast", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHADOW);
- RNA_def_property_ui_text(prop, "Shadow", "Face is used for shadow");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_bitmap_text", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BMFONT);
- RNA_def_property_ui_text(prop, "Text", "Enable bitmap text on face");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "use_alpha_sort", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_ALPHASORT);
- RNA_def_property_ui_text(prop, "Alpha Sort", "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_sdna(prop, NULL, "transp");
- RNA_def_property_enum_items(prop, transp_items);
- RNA_def_property_ui_text(prop, "Transparency", "Transparency blending mode");
- RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
-
- //XXX to be deleted soon -- left for now in case we need it for debug
- //XXX it should be out before Blender 2.6 (after texface to material patch)
-
prop= RNA_def_property(srna, "select_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1);
RNA_def_property_array(prop, 4);
@@ -1589,7 +1516,9 @@ static void rna_def_mcol(BlenderRNA *brna)
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshColor");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshColorLayer_data_length", NULL, NULL, NULL);
srna= RNA_def_struct(brna, "MeshColor", NULL);
RNA_def_struct_sdna(srna, "MCol");
@@ -1644,7 +1573,9 @@ static void rna_def_mproperties(BlenderRNA *brna)
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshFloatProperty");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshFloatPropertyLayer_data_length", NULL, NULL, NULL);
srna= RNA_def_struct(brna, "MeshFloatProperty", NULL);
RNA_def_struct_sdna(srna, "MFloatProperty");
@@ -1670,7 +1601,9 @@ static void rna_def_mproperties(BlenderRNA *brna)
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshIntProperty");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshIntPropertyLayer_data_length", NULL, NULL, NULL);
srna= RNA_def_struct(brna, "MeshIntProperty", NULL);
RNA_def_struct_sdna(srna, "MIntProperty");
@@ -1696,7 +1629,9 @@ static void rna_def_mproperties(BlenderRNA *brna)
prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "MeshStringProperty");
RNA_def_property_ui_text(prop, "Data", "");
- RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next",
+ "rna_iterator_array_end", "rna_iterator_array_get",
+ "rna_MeshStringPropertyLayer_data_length", NULL, NULL, NULL);
srna= RNA_def_struct(brna, "MeshStringProperty", NULL);
RNA_def_struct_sdna(srna, "MStringProperty");
@@ -1853,7 +1788,8 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get", "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range");
+ RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get",
+ "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range");
RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
}
@@ -1899,7 +1835,7 @@ static void rna_def_mesh(BlenderRNA *brna)
/* UV textures */
prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", NULL, NULL, NULL, "rna_Mesh_uv_textures_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshTextureFaceLayer");
RNA_def_property_ui_text(prop, "UV Textures", "");
rna_def_uv_textures(brna, prop);
@@ -1911,7 +1847,8 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Clone UV Texture", "UV texture to be used as cloning source");
prop= RNA_def_property(srna, "uv_texture_clone_index", PROP_INT, PROP_UNSIGNED);
- RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_clone_index_get", "rna_Mesh_uv_texture_clone_index_set", "rna_Mesh_active_uv_texture_index_range");
+ RNA_def_property_int_funcs(prop, "rna_Mesh_uv_texture_clone_index_get",
+ "rna_Mesh_uv_texture_clone_index_set", "rna_Mesh_active_uv_texture_index_range");
RNA_def_property_ui_text(prop, "Clone UV Texture Index", "Clone UV texture index");
prop= RNA_def_property(srna, "uv_texture_stencil", PROP_POINTER, PROP_UNSIGNED);
@@ -1928,32 +1865,34 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", 0, 0, 0, "rna_Mesh_vertex_colors_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", NULL, NULL, NULL, "rna_Mesh_vertex_colors_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshColorLayer");
RNA_def_property_ui_text(prop, "Vertex Colors", "");
rna_def_vertex_colors(brna, prop);
prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", NULL, NULL, NULL, "rna_Mesh_float_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer");
RNA_def_property_ui_text(prop, "Float Property Layers", "");
prop= RNA_def_property(srna, "layers_int", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", NULL, NULL, NULL, "rna_Mesh_int_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshIntPropertyLayer");
RNA_def_property_ui_text(prop, "Int Property Layers", "");
prop= RNA_def_property(srna, "layers_string", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer");
- RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", NULL, NULL, NULL, "rna_Mesh_string_layers_length", NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "MeshStringPropertyLayer");
RNA_def_property_ui_text(prop, "String Property Layers", "");
prop= RNA_def_property(srna, "use_auto_smooth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH);
- RNA_def_property_ui_text(prop, "Auto Smooth", "Treats all set-smoothed faces with angles less than the specified angle as 'smooth' during render");
+ RNA_def_property_ui_text(prop, "Auto Smooth",
+ "Treat all set-smoothed faces with angles less than the "
+ "specified angle as 'smooth' during render");
#if 1 /* expose as radians */
prop= RNA_def_property(srna, "auto_smooth_angle", PROP_FLOAT, PROP_ANGLE);
@@ -1964,7 +1903,8 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "smoothresh");
RNA_def_property_range(prop, 1, 80);
#endif
- RNA_def_property_ui_text(prop, "Auto Smooth Angle", "Defines maximum angle between face normals that 'Auto Smooth' will operate on");
+ RNA_def_property_ui_text(prop, "Auto Smooth Angle",
+ "Maximum angle between face normals that 'Auto Smooth' will operate on");
prop= RNA_def_property(srna, "show_double_sided", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED);
@@ -1983,7 +1923,8 @@ static void rna_def_mesh(BlenderRNA *brna)
/* texture space */
prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", AUTOSPACE);
- RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjusts active object's texture space automatically when transforming object");
+ RNA_def_property_ui_text(prop, "Auto Texture Space",
+ "Adjust active object's texture space automatically when transforming object");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Mesh_texspace_set");
prop= RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
@@ -2013,67 +1954,72 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "");
RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
+ RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
/* Mesh Draw Options for Edit Mode*/
prop= RNA_def_property(srna, "show_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES);
- RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using highlights in the 3D view and UV editor");
+ RNA_def_property_ui_text(prop, "Draw Edges", "Display selected edges using highlights in the 3D view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
- RNA_def_property_ui_text(prop, "All Edges", "Displays all edges for wireframe in all view modes in the 3D view");
+ RNA_def_property_ui_text(prop, "All Edges", "Display all edges for wireframe in all view modes in the 3D view");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
- RNA_def_property_ui_text(prop, "Draw Faces", "Displays all faces as shades in the 3D view and UV editor");
+ RNA_def_property_ui_text(prop, "Draw Faces", "Display all faces as shades in the 3D view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS);
- RNA_def_property_ui_text(prop, "Draw Normals", "Displays face normals as lines");
+ RNA_def_property_ui_text(prop, "Draw Normals", "Display face normals as lines");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_normal_vertex", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS);
- RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Displays vertex normals as lines");
+ RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Display vertex normals as lines");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES);
- RNA_def_property_ui_text(prop, "Draw Creases", "Displays creases created for subsurf weighting");
+ RNA_def_property_ui_text(prop, "Draw Creases", "Display creases created for subsurf weighting");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_edge_bevel_weight", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS);
- RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Displays weights created for the Bevel modifier");
+ RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Display weights created for the Bevel modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_edge_seams", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS);
- RNA_def_property_ui_text(prop, "Draw Seams", "Displays UV unwrapping seams");
+ RNA_def_property_ui_text(prop, "Draw Seams", "Display UV unwrapping seams");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_edge_sharp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP);
- RNA_def_property_ui_text(prop, "Draw Sharp", "Displays sharp edges, used with the EdgeSplit modifier");
+ RNA_def_property_ui_text(prop, "Draw Sharp", "Display sharp edges, used with the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_EDGELEN);
- RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths, Using global values when set in the transform panel");
+ RNA_def_property_ui_text(prop, "Edge Length",
+ "Display selected edge lengths, using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_extra_face_angle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEANG);
- RNA_def_property_ui_text(prop, "Faces Angles", "Displays the angles in the selected edges in degrees, Using global values when set in the transform panel");
+ RNA_def_property_ui_text(prop, "Faces Angles",
+ "Display the angles between the selected edges in degrees, using "
+ "global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop= RNA_def_property(srna, "show_extra_face_area", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_FACEAREA);
- RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces, Using global values when set in the transform panel");
+ RNA_def_property_ui_text(prop, "Face Area",
+ "Display the area of selected faces, using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
/* editflag */
@@ -2093,7 +2039,8 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_mirror_topology", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_TOPO);
- RNA_def_property_ui_text(prop, "Topology Mirror", "Use topology based mirroring. For when both sides of mesh have matching, unique topology");
+ RNA_def_property_ui_text(prop, "Topology Mirror",
+ "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
prop= RNA_def_property(srna, "use_paint_mask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index 5e5cf0be0ae..1c7359cc195 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -330,7 +330,8 @@ static void rna_def_metaball(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_ui_text(prop, "Materials", "");
- RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
+ RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
+ RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
/* anim */
rna_def_animdata_common(srna);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 33f5e41b2cc..fbf54a76cd9 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -91,7 +91,6 @@ EnumPropertyItem modifier_type_items[] ={
{eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""},
{eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""},
{eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""},
- {eModifierType_NavMesh, "NAVMESH", ICON_MOD_PHYSICS, "Navigation mesh", ""},
{eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
{eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
{eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""},
@@ -189,8 +188,6 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
return &RNA_ScrewModifier;
case eModifierType_Warp:
return &RNA_WarpModifier;
- case eModifierType_NavMesh:
- return &RNA_NavMeshModifier;
case eModifierType_WeightVGEdit:
return &RNA_VertexWeightEditModifier;
case eModifierType_WeightVGMix:
@@ -275,7 +272,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
part->end = 250.0f;
part->ren_as = PART_DRAW_NOT;
part->draw_as = PART_DRAW_DOT;
- sprintf(psys->name, "SmokeParticles");
+ BLI_strncpy(psys->name, "SmokeParticles", sizeof(psys->name));
psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
}
@@ -805,7 +802,7 @@ static void rna_def_modifier_warp(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Falloff Type", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED);
+ prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED | PROP_DISTANCE);
RNA_def_property_ui_text(prop, "Radius", "Radius to apply");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -1564,7 +1561,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna)
prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "UVProjector");
- RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Projectors", "");
prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
@@ -2490,17 +2487,6 @@ static void rna_def_modifier_screw(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Modifier_update");*/
}
-static void rna_def_modifier_navmesh(BlenderRNA *brna)
-{
- StructRNA *srna;
- /* PropertyRNA *prop; */ /* UNUSED */
-
- srna= RNA_def_struct(brna, "NavMeshModifier", "Modifier");
- RNA_def_struct_ui_text(srna, "NavMesh Modifier", "NavMesh modifier");
- RNA_def_struct_sdna(srna, "NavMeshModifierData");
- RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM);
-}
-
static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna)
{
static EnumPropertyItem weightvg_mask_tex_map_items[] = {
@@ -2775,13 +2761,13 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
- prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
RNA_def_property_ui_text(prop, "Lowest Dist", "Distance mapping to weight 0.0 (or weight 1.0 if above Highest Dist)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "max_dist", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_range(prop, 0.0, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1000.0, 10, 0);
RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0 (or weight 0.0 if below Lowest Dist)");
@@ -2893,7 +2879,6 @@ void RNA_def_modifier(BlenderRNA *brna)
rna_def_modifier_smoke(brna);
rna_def_modifier_solidify(brna);
rna_def_modifier_screw(brna);
- rna_def_modifier_navmesh(brna);
rna_def_modifier_weightvgedit(brna);
rna_def_modifier_weightvgmix(brna);
rna_def_modifier_weightvgproximity(brna);
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index e22436a44b9..4cbb1c7deea 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -2242,6 +2242,11 @@ static void def_cmp_id_mask(StructRNA *srna)
RNA_def_property_range(prop, 0, 10000);
RNA_def_property_ui_text(prop, "Index", "Pass index number to convert to alpha");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "use_smooth_mask", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "custom2", 0);
+ RNA_def_property_ui_text(prop, "Smooth Mask", "Apply an anti-aliasing filter to the mask");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
}
static void def_cmp_map_uv(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index e8f81fe8353..6b2ea77f270 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -250,16 +250,20 @@ void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
DAG_id_tag_update(ptr->id.data, OB_RECALC_OB);
- DAG_scene_sort(bmain, scene);
+ if (scene) {
+ DAG_scene_sort(bmain, scene);
+ }
WM_main_add_notifier(NC_OBJECT|ND_PARENT, ptr->id.data);
}
/* when changing the selection flag the scene needs updating */
static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
- Object *ob= (Object*)ptr->id.data;
- short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT;
- ED_base_object_select(object_in_scene(ob, scene), mode);
+ if (scene) {
+ Object *ob= (Object*)ptr->id.data;
+ short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT;
+ ED_base_object_select(object_in_scene(ob, scene), mode);
+ }
}
static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
@@ -389,7 +393,8 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value)
ED_object_parent(ob, ob->parent, value, ob->parsubstr);
}
-static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *free)
{
Object *ob= (Object*)ptr->data;
EnumPropertyItem *item= NULL;
@@ -420,7 +425,8 @@ static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), Point
return item;
}
-static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *free)
{
Object *ob= (Object*)ptr->data;
EnumPropertyItem *item= NULL;
@@ -886,12 +892,14 @@ static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr)
static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
{
Object *ob= (Object*)ptr->id.data;
+ const int was_navmesh= (ob->gameflag & OB_NAVMESH);
ob->body_type= value;
switch (ob->body_type) {
case OB_BODY_TYPE_SENSOR:
ob->gameflag |= OB_SENSOR|OB_COLLISION|OB_GHOST;
- ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE|OB_NAVMESH);
+ ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION
+ |OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE|OB_NAVMESH);
break;
case OB_BODY_TYPE_OCCLUDER:
ob->gameflag |= OB_OCCLUDER;
@@ -900,6 +908,12 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
case OB_BODY_TYPE_NAVMESH:
ob->gameflag |= OB_NAVMESH;
ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_DYNAMIC|OB_OCCLUDER);
+
+ if (ob->type == OB_MESH) {
+ /* could be moved into mesh UI but for now ensure mesh data layer */
+ BKE_mesh_ensure_navmesh(ob->data);
+ }
+
break;
case OB_BODY_TYPE_NO_COLLISION:
ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_OCCLUDER|OB_DYNAMIC|OB_NAVMESH);
@@ -931,6 +945,15 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
ob->bsoft = bsbNew();
break;
}
+
+ if (was_navmesh != (ob->gameflag & OB_NAVMESH)) {
+ 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);
+ }
+ }
+
}
static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr)
@@ -1174,7 +1197,8 @@ static void rna_Object_vgroup_remove(Object *ob, bDeformGroup *defgroup)
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
}
-static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *reports, int index_len, int *index, float weight, int assignmode)
+static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *reports, int index_len,
+ int *index, float weight, int assignmode)
{
Object *ob = (Object *)id;
@@ -1355,7 +1379,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
{OB_BODY_TYPE_RIGID, "RIGID_BODY", 0, "Rigid Body", "Linear and angular physics"},
{OB_BODY_TYPE_SOFT, "SOFT_BODY", 0, "Soft Body", "Soft body"},
{OB_BODY_TYPE_OCCLUDER, "OCCLUDE", 0, "Occlude", "Occluder for optimizing scene rendering"},
- {OB_BODY_TYPE_SENSOR, "SENSOR", 0, "Sensor", "Collision Sensor, detects static and dynamic objects but not the other collision sensor objects"},
+ {OB_BODY_TYPE_SENSOR, "SENSOR", 0, "Sensor",
+ "Collision Sensor, detects static and dynamic objects but not the other collision sensor objects"},
{OB_BODY_TYPE_NAVMESH, "NAVMESH", 0, "Navigation Mesh", "Navigation mesh"},
{0, NULL, 0, NULL, NULL}};
@@ -1373,7 +1398,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "controllers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Controller");
- RNA_def_property_ui_text(prop, "Controllers", "Game engine controllers to process events, connecting sensor to actuators");
+ RNA_def_property_ui_text(prop, "Controllers",
+ "Game engine controllers to process events, connecting sensor to actuators");
prop= RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "Actuator");
@@ -1477,7 +1503,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
/* is this used anywhere ? */
prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflag2", OB_NEVER_DO_ACTIVITY_CULLING);
- RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
+ RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis");
prop= RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE);
@@ -1486,7 +1512,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_rotate_from_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);
- RNA_def_property_ui_text(prop, "Rotate From Normal", "Use face normal to rotate object, so that it points away from the surface");
+ RNA_def_property_ui_text(prop, "Rotate From Normal",
+ "Use face normal to rotate object, so that it points away from the surface");
prop= RNA_def_property(srna, "form_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "formfactor");
@@ -1500,7 +1527,9 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_ui_text(prop, "Friction Coefficients", "Relative friction coefficient in the in the X, Y and Z directions, when anisotropic friction is enabled");
+ RNA_def_property_ui_text(prop, "Friction Coefficients",
+ "Relative friction coefficient in the in the X, Y and Z directions, "
+ "when anisotropic friction is enabled");
prop= RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS);
@@ -1520,13 +1549,14 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "margin");
RNA_def_property_range(prop, 0.0, 1.0);
- RNA_def_property_ui_text(prop, "Collision Margin", "Extra margin around object for collision detection, small amount required for stability");
+ RNA_def_property_ui_text(prop, "Collision Margin",
+ "Extra margin around object for collision detection, small amount required for stability");
prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "bsoft");
RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for Bullet soft body simulation");
- prop= RNA_def_property(srna, "create_obstacle", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_obstacle_create", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_HASOBSTACLE);
RNA_def_property_ui_text(prop, "Create obstacle", "Create representation for obstacle simulation");
@@ -1680,7 +1710,9 @@ static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range");
+ RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get",
+ "rna_Object_active_particle_system_index_set",
+ "rna_Object_active_particle_system_index_range");
RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update");
}
@@ -1703,14 +1735,16 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "VertexGroup");
- RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get",
+ "rna_Object_active_vertex_group_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data");
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "actdef");
- RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range");
+ RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set",
+ "rna_Object_active_vertex_group_index_range");
RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array");
RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data");
@@ -1762,8 +1796,8 @@ static void rna_def_object(BlenderRNA *brna)
static EnumPropertyItem drawtype_items[] = {
{OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounding box of the object"},
{OB_WIRE, "WIRE", 0, "Wire", "Draw the object as a wireframe"},
- {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (If solid drawing is enabled in the viewport)"},
- {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (If textures are enabled in the viewport)"},
+ {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (if solid drawing is enabled in the viewport)"},
+ {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (if textures are enabled in the viewport)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem boundtype_items[] = {
@@ -1786,13 +1820,14 @@ static void rna_def_object(BlenderRNA *brna)
// XXX: this RNA enum define is currently duplicated for objects, since there is some text here which is not applicable
static EnumPropertyItem prop_rotmode_items[] = {
{ROT_MODE_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock"},
- {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock. (Default)"},
- {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"},
- {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ). Defines a rotation around some axis defined by 3D-Vector"},
+ {ROT_MODE_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order - prone to Gimbal Lock (default)"},
+ {ROT_MODE_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order - prone to Gimbal Lock"},
+ {ROT_MODE_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order - prone to Gimbal Lock"},
+ {ROT_MODE_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order - prone to Gimbal Lock"},
+ {ROT_MODE_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order - prone to Gimbal Lock"},
+ {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order - prone to Gimbal Lock"},
+ {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle",
+ "Axis Angle (W+XYZ), defines a rotation around some axis defined by 3D-Vector"},
{0, NULL, 0, NULL, NULL}};
static float default_quat[4] = {1,0,0,0}; /* default quaternion values */
@@ -1842,8 +1877,8 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_multi_array(prop, 2, boundbox_dimsize);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Bound Box",
- "Objects bound box in object-space coordinates, all values are -1.0 when not available");
+ RNA_def_property_ui_text(prop, "Bounding Box",
+ "Object's bounding box in object-space coordinates, all values are -1.0 when not available");
/* parent */
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
@@ -1862,7 +1897,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "par1");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in cases of a vertex parenting relation");
+ RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in case of a vertex parenting relation");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
@@ -1876,13 +1911,17 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "trackflag");
RNA_def_property_enum_items(prop, track_items);
- RNA_def_property_ui_text(prop, "Track Axis", "Axis that points in 'forward' direction (applies to DupliFrame when parent 'Follow' is enabled)");
+ RNA_def_property_ui_text(prop, "Track Axis",
+ "Axis that points in 'forward' direction (applies to DupliFrame when "
+ "parent 'Follow' is enabled)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "upflag");
RNA_def_property_enum_items(prop, up_items);
- RNA_def_property_ui_text(prop, "Up Axis", "Axis that points in the upward direction (applies to DupliFrame when parent 'Follow' is enabled)");
+ RNA_def_property_ui_text(prop, "Up Axis",
+ "Axis that points in the upward direction (applies to DupliFrame when "
+ "parent 'Follow' is enabled)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update");
/* proxy */
@@ -1896,7 +1935,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "MaterialSlot");
- RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL); /* don't dereference pointer! */
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL); /* don't dereference pointer! */
RNA_def_property_ui_text(prop, "Material Slots", "Material slots in the object");
prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
@@ -1909,7 +1948,8 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "actcol");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", "rna_Object_active_material_index_range");
+ RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set",
+ "rna_Object_active_material_index_range");
RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot");
RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
@@ -1976,20 +2016,23 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER);
RNA_def_property_float_sdna(prop, NULL, "drot");
- RNA_def_property_ui_text(prop, "Delta Rotation (Euler)", "Extra rotation added to the rotation of the object (when using Euler rotations)");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Euler)",
+ "Extra rotation added to the rotation of the object (when using Euler rotations)");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
prop= RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION);
RNA_def_property_float_sdna(prop, NULL, "dquat");
RNA_def_property_float_array_default(prop, default_quat);
- RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra rotation added to the rotation of the object (when using Quaternion rotations)");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)",
+ "Extra rotation added to the rotation of the object (when using Quaternion rotations)");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
#if 0 // XXX not supported well yet...
prop= RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_float_sdna(prop, NULL, "dquat"); // FIXME: this is not a single field any more! (drotAxis and drotAngle)
RNA_def_property_float_array_default(prop, default_axisAngle);
- RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)", "Extra rotation added to the rotation of the object (when using Axis-Angle rotations)");
+ RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)",
+ "Extra rotation added to the rotation of the object (when using Axis-Angle rotations)");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
#endif
@@ -2017,11 +2060,13 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW);
RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
- RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface");
+ RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)",
+ "Lock editing of 'angle' component of four-component rotations in the interface");
// XXX this needs a better name
prop= RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D);
- RNA_def_property_ui_text(prop, "Lock Rotations (4D)", "Lock editing of four component rotations by components (instead of as Eulers)");
+ RNA_def_property_ui_text(prop, "Lock Rotations (4D)",
+ "Lock editing of four component rotations by components (instead of as Eulers)");
prop= RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_XYZ);
RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX);
@@ -2124,13 +2169,13 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "FieldSettings");
RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL, NULL);
- RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation");
+ RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the object as a field in physics simulation");
prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "pd");
RNA_def_property_struct_type(prop, "CollisionSettings");
RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL, NULL);
- RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation");
+ RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the object as a collider in physics simulation");
prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "soft");
@@ -2253,11 +2298,12 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_time_offset_edit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_OB);
- RNA_def_property_ui_text(prop, "Time Offset Edit", "Use time offset when inserting keys and display time offset for F-Curve and action views");
+ RNA_def_property_ui_text(prop, "Time Offset Edit",
+ "Use time offset when inserting keys and display time offset for F-Curve and action views");
prop= RNA_def_property(srna, "use_time_offset_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENT);
- RNA_def_property_ui_text(prop, "Time Offset Parent", "Apply the time offset to this objects parent relationship");
+ RNA_def_property_ui_text(prop, "Time Offset Parent", "Apply the time offset to this object's parent relationship");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
prop= RNA_def_property(srna, "use_time_offset_particle", PROP_BOOLEAN, PROP_NONE);
@@ -2267,7 +2313,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_time_offset_add_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ipoflag", OB_OFFS_PARENTADD);
- RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parents time offset value");
+ RNA_def_property_ui_text(prop, "Time Offset Add Parent", "Add the parent's time offset value");
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
/* drawing */
@@ -2279,7 +2325,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX);
- RNA_def_property_ui_text(prop, "Draw Bounds", "Displays the object's bounds");
+ RNA_def_property_ui_text(prop, "Draw Bounds", "Display the object's bounds");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE);
@@ -2290,32 +2336,33 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME);
- RNA_def_property_ui_text(prop, "Draw Name", "Displays the object's name");
+ RNA_def_property_ui_text(prop, "Draw Name", "Display the object's name");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS);
- RNA_def_property_ui_text(prop, "Draw Axis", "Displays the object's origin and axis");
+ RNA_def_property_ui_text(prop, "Draw Axes", "Display the object's origin and axes");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE);
- RNA_def_property_ui_text(prop, "Draw Texture Space", "Displays the object's texture space");
+ RNA_def_property_ui_text(prop, "Draw Texture Space", "Display the object's texture space");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE);
- RNA_def_property_ui_text(prop, "Draw Wire", "Adds the object's wireframe over solid drawing");
+ RNA_def_property_ui_text(prop, "Draw Wire", "Add the object's wireframe over solid drawing");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP);
- RNA_def_property_ui_text(prop, "Draw Transparent", "Displays material transparency in the object (unsupported for duplicator drawing)");
+ RNA_def_property_ui_text(prop, "Draw Transparent",
+ "Display material transparency in the object (unsupported for duplicator drawing)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY);
- RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others (unsupported for duplicator drawing)");
+ RNA_def_property_ui_text(prop, "X-Ray", "Make the object draw in front of others (unsupported for duplicator drawing)");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
/* Grease Pencil */
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index cc086bca6d8..a6e0e9f3331 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -827,8 +827,7 @@ static void rna_def_pointcache(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change");
prop= RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next",
- "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list");
rna_def_ptcache_point_caches(brna, prop);
@@ -1049,18 +1048,21 @@ static void rna_def_field(BlenderRNA *brna)
static EnumPropertyItem field_type_items[] = {
{0, "NONE", 0, "None", ""},
- {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", "Gives a radial field toward the center of object"},
- {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", "Gives a constant force along the force objects local Z axis"},
- {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", "Gives a spiraling force that twists the force objects local Z axis"},
+ {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", "Radial field toward the center of object"},
+ {PFIELD_WIND, "WIND", ICON_FORCE_WIND, "Wind", "Constant force along the force object's local Z axis"},
+ {PFIELD_VORTEX, "VORTEX", ICON_FORCE_VORTEX, "Vortex", "Spiraling force that twists the force object's local Z axis"},
{PFIELD_MAGNET, "MAGNET", ICON_FORCE_MAGNETIC, "Magnetic", "Forcefield depends on the speed of the particles"},
- {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic", "The source of this force field is the zero point of a harmonic oscillator"},
- {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge", "Spherical forcefield based on the charge of particles, only influences other charge force fields"},
- {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones", "Forcefield based on the Lennard-Jones potential"},
+ {PFIELD_HARMONIC, "HARMONIC", ICON_FORCE_HARMONIC, "Harmonic",
+ "The source of this force field is the zero point of a harmonic oscillator"},
+ {PFIELD_CHARGE, "CHARGE", ICON_FORCE_CHARGE, "Charge",
+ "Spherical forcefield based on the charge of particles, only influences other charge force fields"},
+ {PFIELD_LENNARDJ, "LENNARDJ", ICON_FORCE_LENNARDJONES, "Lennard-Jones",
+ "Forcefield based on the Lennard-Jones potential"},
{PFIELD_TEXTURE, "TEXTURE", ICON_FORCE_TEXTURE, "Texture", "Forcefield based on a texture"},
- {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", "Creates a force along a curve object"},
+ {PFIELD_GUIDE, "GUIDE", ICON_FORCE_CURVE, "Curve Guide", "Create a force along a curve object"},
{PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""},
- {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", "Creates turbulence with a noise field"},
- {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", "Creates a force that dampens motion"},
+ {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", "Create turbulence with a noise field"},
+ {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", "Create a force that dampens motion"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem falloff_items[] = {
@@ -1677,7 +1679,7 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_estimate_matrix", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_ESTIMATEIPO);
- RNA_def_property_ui_text(prop, "Estimate matrix", "estimate matrix .. split to COM , ROT ,SCALE ");
+ RNA_def_property_ui_text(prop, "Estimate matrix", "Estimate matrix... split to COM, ROT, SCALE");
/***********************************************************************************/
@@ -1719,7 +1721,7 @@ static void rna_def_softbody(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_stiff_quads", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons");
+ RNA_def_property_ui_text(prop, "Stiff Quads", "Add diagonal springs on 4-gons");
RNA_def_property_update(prop, 0, "rna_softbody_update");
prop= RNA_def_property(srna, "use_edge_collision", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 77fa975761f..f0f782fede2 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -19,6 +19,9 @@
*
* Contributor(s): Blender Foundation (2008).
*
+ * Adaptive time step
+ * Copyright 2011 AutoCRC
+ *
* ***** END GPL LICENSE BLOCK *****
*/
@@ -145,33 +148,38 @@ static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSy
*psmd_pt= NULL;
*pa_pt= NULL;
- /* weak, what about multiple particle systems? */
- for (md = ob->modifiers.first; md; md=md->next) {
- if (md->type == eModifierType_ParticleSystem)
- psmd= (ParticleSystemModifierData*) md;
- }
-
- if (!psmd || !psmd->dm || !psmd->psys) {
- return;
- }
-
- psys= psmd->psys;
-
- /* not a very efficient way of getting hair key location data,
- * but it's the best we've got at the present */
-
- /* find the particle that corresponds with this HairKey */
- for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++) {
-
- /* hairkeys are stored sequentially in memory, so we can find if
- * it's the same particle by comparing pointers, without having
- * to iterate over them all */
- if ((hkey >= pa->hair) && (hkey < pa->hair + pa->totkey))
- break;
+ /* given the pointer HairKey *hkey, we iterate over all particles in all
+ * particle systems in the object "ob" in order to find
+ *- the ParticleSystemData to which the HairKey (and hence the particle)
+ * belongs (will be stored in psmd_pt)
+ *- the ParticleData to which the HairKey belongs (will be stored in pa_pt)
+ *
+ * not a very efficient way of getting hair key location data,
+ * but it's the best we've got at the present
+ *
+ * IDEAS: include additional information in pointerRNA beforehand,
+ * for example a pointer to the ParticleStstemModifierData to which the
+ * hairkey belongs.
+ */
+
+ for (md= ob->modifiers.first; md; md=md->next) {
+ if (md->type == eModifierType_ParticleSystem) {
+ psmd= (ParticleSystemModifierData *) md;
+ if (psmd && psmd->dm && psmd->psys) {
+ psys = psmd->psys;
+ for(i= 0, pa= psys->particles; i < psys->totpart; i++, pa++) {
+ /* hairkeys are stored sequentially in memory, so we can
+ * find if it's the same particle by comparing pointers,
+ * without having to iterate over them all */
+ if ((hkey >= pa->hair) && (hkey < pa->hair + pa->totkey)) {
+ *psmd_pt = psmd;
+ *pa_pt = pa;
+ return;
+ }
+ }
+ }
+ }
}
-
- *psmd_pt= psmd;
- *pa_pt= pa;
}
static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *values)
@@ -683,14 +691,13 @@ static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int
}
}
+static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str);
+
static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
{
- ParticleDupliWeight *dw= ptr->data;
-
- if(dw->ob)
- return strlen(dw->ob->id.name+2) + 7;
- else
- return 9 + 7;
+ char tstr[32];
+ rna_ParticleDupliWeight_name_get(ptr, tstr);
+ return strlen(tstr);
}
static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
@@ -2044,12 +2051,23 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, "rna_PartSettings_timestep_get", "rna_PartSetings_timestep_set", NULL);
RNA_def_property_range(prop, 0.0001, 100.0);
RNA_def_property_ui_range(prop, 0.01, 10, 1, 3);
- RNA_def_property_ui_text(prop, "Timestep", "The simulation timestep per frame (in seconds)");
+ RNA_def_property_ui_text(prop, "Timestep", "The simulation timestep per frame (seconds per frame)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
-
+
+ prop= RNA_def_property(srna, "adaptive_subframes", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "time_flag", PART_TIME_AUTOSF);
+ RNA_def_property_ui_text(prop, "Automatic Subframes", "Automatically set the number of subframes");
+ RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
prop= RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
- RNA_def_property_ui_text(prop, "Subframes", "Subframes to simulate for improved stability and finer granularity simulations");
+ RNA_def_property_ui_text(prop, "Subframes", "Subframes to simulate for improved stability and finer granularity simulations (dt = timestep / (subframes + 1))");
+ RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
+ prop= RNA_def_property(srna, "courant_target", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 0.01, 10);
+ RNA_def_property_float_default(prop, 0.2);
+ RNA_def_property_ui_text(prop, "Adaptive Subframe Threshold", "The relative distance a particle can move before requiring more subframes (target Courant number); 0.1-0.3 is the recommended range");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE);
@@ -2857,6 +2875,13 @@ static void rna_def_particle_system(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode");
+ /* Read-only: this is calculated internally. Changing it would only affect
+ * the next time-step. The user should change ParticlSettings.subframes or
+ * ParticleSettings.courant_target instead. */
+ prop= RNA_def_property(srna, "dt_frac", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_range(prop, 1.0f/101.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Timestep", "The current simulation time step size, as a fraction of a frame");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_path_func(srna, "rna_ParticleSystem_path");
}
@@ -2877,4 +2902,3 @@ void RNA_def_particle(BlenderRNA *brna)
}
#endif
-
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 338073fde00..b61495edc94 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -1240,7 +1240,7 @@ static void rna_def_pose(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL);
RNA_def_property_struct_type(prop, "PoseBone");
RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature");
- RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string"); /* can be removed, only for fast lookup */
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL); /* can be removed, only for fast lookup */
/* bone groups */
prop= RNA_def_property(srna, "bone_groups", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "agroups", NULL);
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index 884b4cc76df..460d7ce1c45 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -392,7 +392,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_flag(prop, PROP_REGISTER);
@@ -435,8 +435,7 @@ static void rna_def_render_result(BlenderRNA *brna)
parm= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(parm, "RenderLayer");
- RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next",
- "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_define_verify_sdna(1);
}
@@ -467,8 +466,7 @@ static void rna_def_render_layer(BlenderRNA *brna)
prop= RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderPass");
- RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next",
- "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
RNA_def_property_flag(prop, PROP_DYNAMIC);
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 7f85a2fa1d7..376b0c529d0 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -53,6 +53,7 @@ EnumPropertyItem property_subtype_items[] = {
{PROP_FILEPATH, "FILEPATH", 0, "File Path", ""},
{PROP_DIRPATH, "DIRPATH", 0, "Directory Path", ""},
{PROP_FILENAME, "FILENAME", 0, "File Name", ""},
+ {PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
/* numbers */
{PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""},
@@ -505,6 +506,13 @@ static int rna_Property_readonly_get(PointerRNA *ptr)
return prop->flag & PROP_EDITABLE ? 0:1;
}
+static int rna_Property_animatable_get(PointerRNA *ptr)
+{
+ PropertyRNA *prop= (PropertyRNA*)ptr->data;
+
+ return (prop->flag & PROP_ANIMATABLE) != 0;
+}
+
static int rna_Property_use_output_get(PointerRNA *ptr)
{
PropertyRNA *prop= (PropertyRNA*)ptr->data;
@@ -978,13 +986,13 @@ static void rna_def_struct(BlenderRNA *brna)
prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Property");
- RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Properties", "Properties in the struct");
prop= RNA_def_property(srna, "functions", PROP_COLLECTION, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "Function");
- RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Functions", "");
}
@@ -1065,6 +1073,11 @@ static void rna_def_property(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_Property_readonly_get", NULL);
RNA_def_property_ui_text(prop, "Read Only", "Property is editable through RNA");
+ prop= RNA_def_property(srna, "is_animatable", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_Property_animatable_get", NULL);
+ RNA_def_property_ui_text(prop, "Animatable", "Property is animatable through RNA");
+
prop= RNA_def_property(srna, "is_required", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Property_is_required_get", NULL);
@@ -1134,7 +1147,7 @@ static void rna_def_function(BlenderRNA *brna)
prop= RNA_def_property(srna, "parameters", PROP_COLLECTION, PROP_NONE);
/*RNA_def_property_clear_flag(prop, PROP_EDITABLE);*/
RNA_def_property_struct_type(prop, "Property");
- RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Parameters", "Parameters for the function");
prop= RNA_def_property(srna, "is_registered", PROP_BOOLEAN, PROP_NONE);
@@ -1285,7 +1298,7 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
prop= RNA_def_property(srna, "enum_items", PROP_COLLECTION, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "EnumPropertyItem");
- RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Items", "Possible values for the property");
srna= RNA_def_struct(brna, "EnumPropertyItem", NULL);
@@ -1388,9 +1401,9 @@ void RNA_def_rna(BlenderRNA *brna)
RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get",
/* included for speed, can be removed */
#if 0
- 0,0,0);
+ 0,0,0,0);
#else
- "rna_BlenderRNA_structs_length", "rna_BlenderRNA_structs_lookup_int", "rna_BlenderRNA_structs_lookup_string");
+ "rna_BlenderRNA_structs_length", "rna_BlenderRNA_structs_lookup_int", "rna_BlenderRNA_structs_lookup_string", NULL);
#endif
RNA_def_property_ui_text(prop, "Structs", "");
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 55311df7162..c7a5d2c8f65 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -631,7 +631,8 @@ static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, in
rd->qtcodecsettings.codecType = quicktime_videocodecType_from_rnatmpvalue(value);
}
-static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bContext *C, PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *free)
{
EnumPropertyItem *item= NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
@@ -672,7 +673,8 @@ static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *pt
rd->qtcodecsettings.audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
}
-static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(bContext *C, PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *free)
{
EnumPropertyItem *item= NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
@@ -743,7 +745,8 @@ static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value)
BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine));
}
-static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_RenderSettings_engine_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
+ PropertyRNA *UNUSED(prop), int *free)
{
RenderEngineType *type;
EnumPropertyItem *item= NULL;
@@ -1120,7 +1123,8 @@ static void rna_def_tool_settings(BlenderRNA *brna)
static EnumPropertyItem sketch_convert_items[] = {
{SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"},
{SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"},
- {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive", "Subdivide stroke adaptively, with more subdivision in curvier parts"},
+ {SK_CONVERT_CUT_ADAPTATIVE, "ADAPTIVE", 0, "Adaptive",
+ "Subdivide stroke adaptively, with more subdivision in curvier parts"},
{SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke"},
{0, NULL, 0, NULL, NULL}};
@@ -1173,7 +1177,8 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "proportional");
RNA_def_property_enum_items(prop, proportional_editing_items);
- RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional Editing mode, allows transforms with distance fall-off");
+ RNA_def_property_ui_text(prop, "Proportional Editing",
+ "Proportional Editing mode, allows transforms with distance fall-off");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE);
@@ -1236,13 +1241,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT);
- RNA_def_property_ui_text(prop, "Project Individual Elements", "Project individual elements on the surface of other objects");
+ RNA_def_property_ui_text(prop, "Project Individual Elements",
+ "Project individual elements on the surface of other objects");
RNA_def_property_ui_icon(prop, ICON_RETOPO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
prop= RNA_def_property(srna, "use_snap_self", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "snap_flag", SCE_SNAP_NO_SELF);
- RNA_def_property_ui_text(prop, "Project to Self", "Snap onto its self (editmode)");
+ RNA_def_property_ui_text(prop, "Project to Self", "Snap onto itself (editmode)");
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
@@ -1265,11 +1271,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
- RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking");
+ RNA_def_property_ui_text(prop, "Layered",
+ "Add a new NLA Track + Strip for every loop/pass made over the animation "
+ "to allow non-destructive tweaking");
prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
- RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only");
+ RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set",
+ "Automatic keyframe insertion using active Keying Set only");
RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0);
/* UV */
@@ -1380,11 +1389,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "sculpt_paint_use_unified_size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_SIZE);
- RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius", "Instead of per brush radius, the radius is shared across brushes");
+ RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Radius",
+ "Instead of per brush radius, the radius is shared across brushes");
prop= RNA_def_property(srna, "sculpt_paint_use_unified_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "sculpt_paint_settings", SCULPT_PAINT_USE_UNIFIED_ALPHA);
- RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength", "Instead of per brush strength, the strength is shared across brushes");
+ RNA_def_property_ui_text(prop, "Sculpt/Paint Use Unified Strength",
+ "Instead of per brush strength, the strength is shared across brushes");
}
@@ -1400,7 +1411,7 @@ static void rna_def_unit_settings(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem rotation_units[] = {
- {0, "DEGREES", 0, "Degrees", "Use degrees for measuring rotation"},
+ {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"},
{USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""},
{0, NULL, 0, NULL, NULL}};
@@ -1514,7 +1525,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
prop= RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
- RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
+ RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (on top of Solid and Halos)");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -1736,13 +1747,13 @@ static void rna_def_scene_game_recast_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Agent Radius", "Radius of the agent");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "max_climb", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(srna, "climb_max", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "agentmaxclimb");
RNA_def_property_ui_range(prop, 0.1, 5, 1, 2);
RNA_def_property_ui_text(prop, "Max Climb", "Maximum height between grid cells the agent can climb");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "max_slope", PROP_FLOAT, PROP_ANGLE);
+ prop= RNA_def_property(srna, "slope_max", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "agentmaxslope");
RNA_def_property_range(prop, 0, M_PI/2);
RNA_def_property_ui_text(prop, "Max Slope", "Maximum walkable slope angle in degrees");
@@ -1798,8 +1809,10 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem framing_types_items[] ={
- {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"},
- {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"},
+ {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox",
+ "Show the entire viewport in the display window, using bar horizontally or vertically"},
+ {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend",
+ "Show the entire viewport in the display window, viewing more horizontally or vertically"},
{SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"},
{0, NULL, 0, NULL, NULL}};
@@ -1867,19 +1880,19 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_range(prop, 8, 32);
- RNA_def_property_ui_text(prop, "Bits", "Displays bit depth of full screen display");
+ RNA_def_property_ui_text(prop, "Bits", "Display bit depth of full screen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
// Do we need it here ? (since we already have it in World
prop= RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "freqplay");
RNA_def_property_range(prop, 4, 2000);
- RNA_def_property_ui_text(prop, "Freq", "Displays clock frequency of fullscreen display");
+ RNA_def_property_ui_text(prop, "Freq", "Display clock frequency of fullscreen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "fullscreen", 1.0);
- RNA_def_property_ui_text(prop, "Fullscreen", "Starts player in a new fullscreen display");
+ RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Framing */
@@ -1912,7 +1925,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "stereo_eye_separation", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
RNA_def_property_range(prop, 0.01, 5.0);
- RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal length/30 should be fine");
+ RNA_def_property_ui_text(prop, "Eye Separation",
+ "Set the distance between the eyes - the camera focal length/30 should be fine");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Dome */
@@ -1970,35 +1984,44 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "occlusion_culling_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "occlusionRes");
RNA_def_property_range(prop, 128.0, 1024.0);
- RNA_def_property_ui_text(prop, "Occlusion Resolution", "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
+ RNA_def_property_ui_text(prop, "Occlusion Resolution",
+ "The size of the occlusion buffer in pixel, use higher value for better precision (slower)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ticrate");
RNA_def_property_ui_range(prop, 1, 60, 1, 1);
RNA_def_property_range(prop, 1, 250);
- RNA_def_property_ui_text(prop, "Frames Per Second", "The nominal number of game frames per second. Physics fixed timestep = 1/fps, independently of actual frame rate");
+ RNA_def_property_ui_text(prop, "Frames Per Second",
+ "The nominal number of game frames per second "
+ "(physics fixed timestep = 1/fps, independently of actual frame rate)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
- RNA_def_property_ui_text(prop, "Max Logic Steps", "Sets the maximum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics");
+ RNA_def_property_ui_text(prop, "Max Logic Steps",
+ "Sets the maximum number of logic frame per game frame if graphics slows down the game, "
+ "higher value allows better synchronization with physics");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxphystep");
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
- RNA_def_property_ui_text(prop, "Max Physics Steps", "Sets the maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime");
+ RNA_def_property_ui_text(prop, "Max Physics Steps",
+ "Sets the maximum number of physics step per game frame if graphics slows down the game, "
+ "higher value allows physics to keep up with realtime");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "physics_step_sub", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "physubstep");
RNA_def_property_ui_range(prop, 1, 5, 1, 1);
RNA_def_property_range(prop, 1, 5);
- RNA_def_property_ui_text(prop, "Physics Sub Steps", "Sets the number of simulation substep per physic timestep, higher value give better physics precision");
+ RNA_def_property_ui_text(prop, "Physics Sub Steps",
+ "Sets the number of simulation substep per physic timestep, "
+ "higher value give better physics precision");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* mode */
@@ -2015,7 +2038,9 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "activity_culling_box_radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "activityBoxRadius");
RNA_def_property_range(prop, 0.0, 1000.0);
- RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
+ RNA_def_property_ui_text(prop, "box radius",
+ "Radius of the activity bubble, in Manhattan length "
+ "(objects outside the box are activity-culled)");
/* booleans */
prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE);
@@ -2024,7 +2049,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE);
- RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs");
+ RNA_def_property_ui_text(prop, "Show Framerate and Profile",
+ "Show framerate and profiling information while the game runs");
prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS);
@@ -2157,13 +2183,15 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop)
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "actlay");
- RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range");
+ RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set",
+ "rna_RenderSettings_active_layer_index_range");
RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
RNA_def_property_struct_type(prop, "SceneRenderLayer");
- RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", "rna_RenderSettings_active_layer_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get",
+ "rna_RenderSettings_active_layer_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Active Render Layer", "Active Render Layer");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2388,7 +2416,9 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes");
RNA_def_property_enum_items(prop, image_color_mode_items);
- RNA_def_property_ui_text(prop, "Color Mode", "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels");
+ RNA_def_property_ui_text(prop, "Color Mode",
+ "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, "
+ "and RGBA for saving red, green, blue and alpha channels");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
@@ -2439,7 +2469,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "file_quality", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "quality");
RNA_def_property_range(prop, 0, 100); /* 0 is needed for compression. */
- RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, Compression for PNG's");
+ RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies, compression for PNG's");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* Tiff */
@@ -2598,19 +2628,19 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate");
RNA_def_property_range(prop, 1, 14000);
- RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)");
+ RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate (kb/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate");
RNA_def_property_range(prop, 0, 9000);
- RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)");
+ RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate (kb/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate");
RNA_def_property_range(prop, 1, 14000);
- RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)");
+ RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate (kb/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE);
@@ -2654,7 +2684,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 32, 384);
- RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)");
+ RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate (kb/s)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "ffmpeg_audio_volume", PROP_FLOAT, PROP_NONE);
@@ -2677,7 +2707,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "ffcodecdata.audio_channels");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, audio_channel_items);
- RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
+ RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "frs_sec");
@@ -2698,21 +2728,22 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "framapto");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 900);
- RNA_def_property_ui_text(prop, "Frame Map Old", "Specify old mapping value in frames");
+ RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
prop= RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "images");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 1, 900);
- RNA_def_property_ui_text(prop, "Frame Map New", "Specify how many frames the Map Old will last");
+ RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_framelen_update");
prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dither_intensity");
RNA_def_property_range(prop, 0.0f, 2.0f);
- RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding");
+ RNA_def_property_ui_text(prop, "Dither Intensity",
+ "Amount of dithering noise added to the rendered image to break up banding");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE);
@@ -2736,7 +2767,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "ocres");
RNA_def_property_enum_items(prop, octree_resolution_items);
- RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes");
+ RNA_def_property_ui_text(prop, "Octree Resolution",
+ "Resolution of raytrace accelerator, use higher resolutions for larger scenes");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "raytrace_method", PROP_ENUM, PROP_NONE);
@@ -2747,12 +2779,15 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES);
- RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates");
+ RNA_def_property_ui_text(prop, "Use Instances",
+ "Instance support leads to effective memory reduction when using duplicates");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS);
- RNA_def_property_ui_text(prop, "Use Local Coords", "Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed");
+ RNA_def_property_ui_text(prop, "Use Local Coords",
+ "Vertex coordinates are stored localy on each primitive "
+ "(increases memory usage, but may have impact on speed)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
@@ -2774,7 +2809,9 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, field_order_items);
- RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines get rendered first, to create smooth motion for TV output");
+ RNA_def_property_ui_text(prop, "Field Order",
+ "Order of video fields (select which lines get rendered first, "
+ "to create smooth motion for TV output)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE);
@@ -2835,7 +2872,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "threads");
RNA_def_property_range(prop, 1, BLENDER_MAX_THREADS);
RNA_def_property_int_funcs(prop, "rna_RenderSettings_threads_get", NULL, NULL);
- RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
+ RNA_def_property_ui_text(prop, "Threads",
+ "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE);
@@ -2866,31 +2904,33 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
/* border */
prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
- RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size. Note, this disables save_buffers and full_sample");
+ RNA_def_property_ui_text(prop, "Border",
+ "Render a user-defined border region, within the frame size "
+ "(note that this disables save_buffers and full_sample)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.xmin");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Border Minimum X", "Sets minimum X value to for the render border");
+ RNA_def_property_ui_text(prop, "Border Minimum X", "Minimum X value to for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "border_min_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.ymin");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Border Minimum Y", "Sets minimum Y value for the render border");
+ RNA_def_property_ui_text(prop, "Border Minimum Y", "Minimum Y value for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "border_max_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.xmax");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Border Maximum X", "Sets maximum X value for the render border");
+ RNA_def_property_ui_text(prop, "Border Maximum X", "Maximum X value for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "border_max_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "border.ymax");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Border Maximum Y", "Sets maximum Y value for the render border");
+ RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE);
@@ -2900,7 +2940,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH);
- RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
+ RNA_def_property_ui_text(prop, "Placeholders",
+ "Create empty placeholder files while rendering frames (similar to Unix 'touch')");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
@@ -2910,12 +2951,15 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP);
- RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if compositing nodes are enabled");
+ RNA_def_property_ui_text(prop, "Compositing",
+ "Process the render result through the compositing pipeline, if compositing nodes are enabled");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ);
- RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist");
+ RNA_def_property_ui_text(prop, "Sequencer",
+ "Process the render (and composited) result through the video sequence "
+ "editor pipeline, if sequencer strips exist");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_color_management", PROP_BOOLEAN, PROP_NONE);
@@ -2926,7 +2970,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
- RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
+ RNA_def_property_ui_text(prop, "File Extensions",
+ "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE);
@@ -2948,7 +2993,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_free_image_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
- RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing");
+ RNA_def_property_ui_text(prop, "Free Image Textures",
+ "Free all image texture from memory after render, to save memory before compositing");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
@@ -2959,13 +3005,17 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_save_buffers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_save_buffers_get", NULL);
- RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample)");
+ RNA_def_property_ui_text(prop, "Save Buffers",
+ "Save tiles for all RenderLayers and SceneNodes to files in the temp directory "
+ "(saves memory, required for Full Sample)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_full_sample_get", NULL);
- RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing");
+ RNA_def_property_ui_text(prop, "Full Sample",
+ "Save for every anti-aliasing sample the entire RenderLayer results "
+ "(this solves anti-aliasing issues with compositing)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
@@ -2976,7 +3026,9 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "pic");
- RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers");
+ RNA_def_property_ui_text(prop, "Output Path",
+ "Directory/name to save animations, # characters defines the position "
+ "and length of frame numbers");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* Bake */
@@ -3002,11 +3054,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_bake_selected_to_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE);
- RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object");
+ RNA_def_property_ui_text(prop, "Selected to Active",
+ "Bake shading on the surface of selected objects to the active object");
prop= RNA_def_property(srna, "use_bake_normalize", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE);
- RNA_def_property_ui_text(prop, "Normalized", "With displacement normalize to the distance, with ambient occlusion normalize without using material settings");
+ RNA_def_property_ui_text(prop, "Normalized",
+ "With displacement normalize to the distance, with ambient occlusion "
+ "normalize without using material settings");
prop= RNA_def_property(srna, "use_bake_clear", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR);
@@ -3024,7 +3079,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bake_maxdist");
RNA_def_property_range(prop, 0.0, 1000.0);
- RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units");
+ RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units)");
prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bake_biasdist");
@@ -3043,7 +3098,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
- RNA_def_property_ui_text(prop, "Stamp Time", "Include the render frame as HH:MM:SS.FF in image metadata");
+ RNA_def_property_ui_text(prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE);
@@ -3063,7 +3118,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_stamp_lens", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERALENS);
- RNA_def_property_ui_text(prop, "Stamp Lens", "Include the name of the active cameras lens in image metadata");
+ RNA_def_property_ui_text(prop, "Stamp Lens", "Include the active camera's lens in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE);
@@ -3083,17 +3138,18 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME);
- RNA_def_property_ui_text(prop, "Stamp Filename", "Include the filename of the .blend file in image metadata");
+ RNA_def_property_ui_text(prop, "Stamp Filename", "Include the .blend filename in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP);
- RNA_def_property_ui_text(prop, "Stamp Sequence Strip", "Include the name of the foreground sequence strip in image metadata");
+ RNA_def_property_ui_text(prop, "Stamp Sequence Strip",
+ "Include the name of the foreground sequence strip in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "use_stamp_render_time", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME);
- RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in the stamp image");
+ RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE);
@@ -3148,14 +3204,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
/* layers */
-
prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
RNA_def_property_struct_type(prop, "SceneRenderLayer");
RNA_def_property_ui_text(prop, "Render Layers", "");
rna_def_render_layers(brna, prop);
-
+
prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer");
@@ -3165,7 +3220,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
/* engine */
prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, engine_items);
- RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set", "rna_RenderSettings_engine_itemf");
+ RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set",
+ "rna_RenderSettings_engine_itemf");
RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
@@ -3204,7 +3260,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "simplify_ao_sss", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "simplify_aosss");
- RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor");
+ RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AO and SSS quality factor");
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
@@ -3340,7 +3396,8 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
- RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
+ RNA_def_property_ui_text(prop, "Active Keying Set Index",
+ "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
}
@@ -3366,7 +3423,8 @@ static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop)
prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "active_keyingset");
RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL);
- RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
+ RNA_def_property_ui_text(prop, "Active Keying Set Index",
+ "Current Keying Set index (negative for 'builtin' and positive for 'absolute')");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
}
@@ -3394,7 +3452,8 @@ void RNA_def_scene(BlenderRNA *brna)
/* Struct definition */
srna= RNA_def_struct(brna, "Scene", "ID");
- RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings");
+ RNA_def_struct_ui_text(srna, "Scene",
+ "Scene data block, consisting in objects and defining time and render related settings");
RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA);
RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
@@ -3402,7 +3461,7 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
- RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene");
+ RNA_def_property_ui_text(prop, "Camera", "Active camera, used for rendering the scene");
RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update");
prop= RNA_def_property(srna, "background_set", PROP_POINTER, PROP_NONE);
@@ -3429,14 +3488,14 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
RNA_def_property_struct_type(prop, "ObjectBase");
RNA_def_property_ui_text(prop, "Bases", "");
- RNA_def_property_collection_funcs(prop, 0, 0, 0, 0, 0, 0, "rna_Scene_object_bases_lookup_string");
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_Scene_object_bases_lookup_string", NULL);
rna_def_scene_bases(brna, prop);
prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "base", NULL);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_ui_text(prop, "Objects", "");
- RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_Scene_objects_get", NULL, NULL, NULL, NULL);
rna_def_scene_objects(brna, prop);
/* Layers */
@@ -3491,7 +3550,8 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "r.flag", SCER_PRV_RANGE);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_preview_range_set");
- RNA_def_property_ui_text(prop, "Use Preview Range", "Use an alternative start/end frame for UI playback, rather than the scene start/end frame");
+ RNA_def_property_ui_text(prop, "Use Preview Range",
+ "Use an alternative start/end frame for UI playback, rather than the scene start/end frame");
RNA_def_property_update(prop, NC_SCENE|ND_FRAME, NULL);
RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0);
@@ -3512,7 +3572,7 @@ void RNA_def_scene(BlenderRNA *brna)
/* Stamp */
prop= RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
- RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping");
+ RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* Animation Data (for Scene) */
@@ -3522,7 +3582,8 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON);
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* DO NOT MAKE THIS EDITABLE, OR NLA EDITOR BREAKS */
- RNA_def_property_ui_text(prop, "NLA TweakMode", "Indicates whether there is any action referenced by NLA being edited. Strictly read-only");
+ RNA_def_property_ui_text(prop, "NLA TweakMode",
+ "Whether there is any action referenced by NLA being edited (strictly read-only)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* Frame dropping flag for playback and sync enum */
@@ -3564,9 +3625,10 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_scene_keying_sets(brna, prop);
prop= RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
RNA_def_property_struct_type(prop, "KeyingSet");
- RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
+ RNA_def_property_ui_text(prop, "All Keying Sets",
+ "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)");
RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL);
rna_def_scene_keying_sets_all(brna, prop);
@@ -3619,7 +3681,8 @@ void RNA_def_scene(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_audio_sync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "audio.flag", AUDIO_SYNC);
- RNA_def_property_ui_text(prop, "Audio Sync", "Play back and sync with audio clock, dropping frames if frame display is too slow");
+ RNA_def_property_ui_text(prop, "Audio Sync",
+ "Play back and sync with audio clock, dropping frames if frame display is too slow");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop= RNA_def_property(srna, "use_audio_scrub", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 686c8dffcd1..840a24c23f4 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -148,9 +148,9 @@ static void rna_def_area(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL);
RNA_def_property_struct_type(prop, "Space");
RNA_def_property_ui_text(prop, "Spaces",
- "Spaces contained in this area, the first being the active space. "
- "NOTE: Useful for example to restore a previously used 3d view space "
- "in a certain area to get the old view orientation");
+ "Spaces contained in this area, the first being the active space "
+ "(NOTE: Useful for example to restore a previously used 3D view space "
+ "in a certain area to get the old view orientation)");
rna_def_area_spaces(brna, prop);
prop= RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 86682af189c..a75166c3e99 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -463,10 +463,8 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value)
{
Sequence *seq= (Sequence*)(ptr->data);
- char path[FILE_MAX];
- BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
- BLI_strncpy(value, path, strlen(path)+1);
+ BLI_join_dirfile(value, FILE_MAX, seq->strip->dir, seq->strip->stripdata->name);
}
static int rna_Sequence_filepath_length(PointerRNA *ptr)
@@ -475,7 +473,7 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr)
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name);
- return strlen(path)+1;
+ return strlen(path);
}
static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
@@ -491,10 +489,8 @@ static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value)
static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value)
{
StripProxy *proxy= (StripProxy*)(ptr->data);
- char path[FILE_MAX];
- BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file);
- BLI_strncpy(value, path, strlen(path)+1);
+ BLI_join_dirfile(value, FILE_MAX, proxy->dir, proxy->file);
}
static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
@@ -503,7 +499,7 @@ static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr)
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file);
- return strlen(path)+1;
+ return strlen(path);
}
static void rna_Sequence_volume_set(PointerRNA *ptr, float value)
@@ -563,7 +559,8 @@ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p
{
Editing *ed= seq_give_editing(scene, FALSE);
- free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE);
+ if(ed)
+ free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE);
}
static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
@@ -824,16 +821,14 @@ static void rna_def_strip_proxy(BlenderRNA *brna)
PropertyRNA *prop;
static const EnumPropertyItem seq_tc_items[]= {
- {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""},
+ {SEQ_PROXY_TC_NONE, "NONE", 0, "No TC in use", ""},
{SEQ_PROXY_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run",
- "use images in the order as they are recorded"},
- {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run",
- "use global timestamp written by recording device"},
- {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE",
- 0, "Free Run (rec date)",
- "interpolate a global timestamp using the "
- "record date and time written by recording "
- "device"},
+ "Use images in the order as they are recorded"},
+ {SEQ_PROXY_TC_FREE_RUN, "FREE_RUN", 0, "Free Run",
+ "Use global timestamp written by recording device"},
+ {SEQ_PROXY_TC_INTERP_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)",
+ "Interpolate a global timestamp using the "
+ "record date and time written by recording device"},
{0, NULL, 0, NULL, NULL}};
srna = RNA_def_struct(brna, "SequenceProxy", NULL);
@@ -1179,13 +1174,13 @@ static void rna_def_editor(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "seqbase", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Sequences", "");
- RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", 0, 0, 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_sequences_all_begin", "rna_SequenceEditor_sequences_all_next", NULL, NULL, NULL, NULL, NULL, NULL);
prop= RNA_def_property(srna, "meta_stack", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL);
RNA_def_property_struct_type(prop, "Sequence");
RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip");
- RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEditor_meta_stack_get", 0, 0, 0);
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get", NULL, NULL, NULL, NULL);
prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "act_seq");
@@ -1355,7 +1350,7 @@ static void rna_def_image(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
- RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", NULL, NULL, NULL);
rna_def_filter_video(srna);
rna_def_proxy(srna);
@@ -1421,7 +1416,7 @@ static void rna_def_movie(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "MPEG Preseek", "For MPEG movies, preseek this many frames");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
- prop= RNA_def_property(srna, "streamindex", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "stream_index", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "streamindex");
RNA_def_property_range(prop, 0, 20);
RNA_def_property_ui_text(prop, "Streamindex", "For files with several movie streams, use the stream with the given index");
@@ -1431,7 +1426,7 @@ static void rna_def_movie(BlenderRNA *brna)
RNA_def_property_collection_sdna(prop, NULL, "strip->stripdata", NULL);
RNA_def_property_struct_type(prop, "SequenceElement");
RNA_def_property_ui_text(prop, "Elements", "");
- RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_SequenceEditor_elements_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_SequenceEditor_elements_length", NULL, NULL, NULL);
prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_ui_text(prop, "File", "");
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 8ea00530c2f..217d68860f2 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -255,7 +255,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
- RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness");
+ RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
@@ -305,11 +305,11 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
- RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
+ RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation");
prop= RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
- RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area");
+ RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area");
prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c
index a6c1f400ade..a656e6d56df 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -94,7 +94,7 @@ static void rna_def_sound(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM");
RNA_def_property_update(prop, 0, "rna_Sound_caching_update");
- prop= RNA_def_property(srna, "mono", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_mono", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", SOUND_FLAGS_MONO);
RNA_def_property_ui_text(prop, "Mono", "If the file contains multiple audio channels they are rendered to a single one");
RNA_def_property_update(prop, 0, "rna_Sound_update");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 90ceca121ae..b4bda045a70 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -81,14 +81,16 @@ static EnumPropertyItem draw_channels_items[] = {
{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
{SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
{SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
- {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
+ {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer",
+ "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem transform_orientation_items[] = {
{V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"},
{V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"},
{V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
- {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
+ {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal",
+ "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"},
{V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"},
{V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
{0, NULL, 0, NULL, NULL}};
@@ -223,7 +225,8 @@ static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
if (v3d->twmode < V3D_MANIP_CUSTOM)
return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
else
- return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
+ return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation,
+ BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
}
EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
@@ -519,7 +522,8 @@ static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data);
}
-static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *free)
{
SpaceImage *sima= (SpaceImage*)ptr->data;
EnumPropertyItem *item= NULL;
@@ -773,14 +777,16 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu
if (act->idroot == ID_OB)
saction->action = act;
else
- printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n", act->id.name+2);
+ printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n",
+ act->id.name+2);
}
else if (saction->mode == SACTCONT_SHAPEKEY) {
/* as the name says, "shapekey-level" only... */
if (act->idroot == ID_KE)
saction->action = act;
else
- printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n", act->id.name+2);
+ printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n",
+ act->id.name+2);
}
else {
printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n");
@@ -908,7 +914,8 @@ static void rna_SpaceNodeEditor_node_tree_update(Main *bmain, Scene *scene, Poin
ED_node_tree_update(snode, scene);
}
-static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, PointerRNA *UNUSED(ptr),
+ PropertyRNA *UNUSED(prop), int *free)
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
@@ -987,8 +994,10 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
static EnumPropertyItem sticky_mode_items[] = {
{SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled"},
- {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location", "Select UVs that are at the same location and share a mesh vertex"},
- {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex", "Select UVs that share mesh vertex, irrespective if they are in the same location"},
+ {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location",
+ "Select UVs that are at the same location and share a mesh vertex"},
+ {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex",
+ "Select UVs that share mesh vertex, irrespective if they are in the same location"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem dt_uv_items[] = {
@@ -1018,7 +1027,8 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "sticky");
RNA_def_property_enum_items(prop, sticky_mode_items);
- RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected");
+ RNA_def_property_ui_text(prop, "Sticky Selection Mode",
+ "Automatically select also UVs sharing the same vertex as the ones being selected");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
/* drawing */
@@ -1035,7 +1045,9 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
- RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)");
+ RNA_def_property_ui_text(prop, "Draw Stretch",
+ "Draw faces colored according to the difference in shape between UVs and "
+ "their 3D coordinates (blue for low distortion, red for high distortion)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
@@ -1066,7 +1078,8 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
- RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL);
+ RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get",
+ "rna_SpaceImageEditor_cursor_location_set", NULL);
RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
@@ -1084,7 +1097,8 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
- RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices");
+ RNA_def_property_ui_text(prop, "Live Unwrap",
+ "Continuously unwrap the selected UV island while transforming pinned vertices");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
@@ -1187,12 +1201,12 @@ static void rna_def_background_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
- RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the world origin");
+ RNA_def_property_ui_text(prop, "X Offset", "Offset image horizontally from the world origin");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
- RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the world origin");
+ RNA_def_property_ui_text(prop, "Y Offset", "Offset image vertically from the world origin");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
@@ -1228,7 +1242,8 @@ static void rna_def_space_view3d(BlenderRNA *brna)
const int matrix_dimsize[]= {4, 4};
static EnumPropertyItem pivot_items[] = {
- {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", "Pivot around bounding box center of selected object(s)"},
+ {V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
+ "Pivot around bounding box center of selected object(s)"},
{V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
{V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", "Pivot around each object's own origin"},
{V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", "Pivot around the median point of selected objects"},
@@ -1305,19 +1320,19 @@ static void rna_def_space_view3d(BlenderRNA *brna)
prop= RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "grid");
- RNA_def_property_ui_text(prop, "Grid Scale", "The distance between 3D View grid lines");
+ RNA_def_property_ui_text(prop, "Grid Scale", "Distance between 3D View grid lines");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gridlines");
- RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view");
+ RNA_def_property_ui_text(prop, "Grid Lines", "Number of grid lines to display in perspective view");
RNA_def_property_range(prop, 0, 1024);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gridsubdiv");
- RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines");
+ RNA_def_property_ui_text(prop, "Grid Subdivisions", "Number of subdivisions between grid lines");
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -1343,12 +1358,14 @@ static void rna_def_space_view3d(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE);
- RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views");
+ RNA_def_property_ui_text(prop, "Outline Selected",
+ "Show an outline highlight around selected objects in non-wireframe views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS);
- RNA_def_property_ui_text(prop, "All Object Origins", "Show the object origin center dot for all (selected and unselected) objects");
+ RNA_def_property_ui_text(prop, "All Object Origins",
+ "Show the object origin center dot for all (selected and unselected) objects");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
@@ -1391,7 +1408,7 @@ static void rna_def_space_view3d(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
- RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only");
+ RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object and pose mode only)");
RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
@@ -1429,12 +1446,13 @@ static void rna_def_space_view3d(BlenderRNA *brna)
prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "TransformOrientation");
RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL);
- RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation");
+ RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current transformation orientation");
prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1);
RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set");
- RNA_def_property_ui_text(prop, "Lock Camera and Layers", "Use the scene's active camera and layers in this view, rather than local layers");
+ RNA_def_property_ui_text(prop, "Lock Camera and Layers",
+ "Use the scene's active camera and layers in this view, rather than local layers");
RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
@@ -1705,7 +1723,9 @@ static void rna_def_space_image(BlenderRNA *brna)
/* update */
prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
- RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform");
+ RNA_def_property_ui_text(prop, "Update Automatically",
+ "Update other affected window spaces automatically to reflect changes "
+ "during interactive operations such as transform");
/* state */
prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
@@ -1762,14 +1782,14 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "view");
RNA_def_property_enum_items(prop, view_type_items);
- RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer view (sequencer, preview or both)");
+ RNA_def_property_ui_text(prop, "View Type", "Type of the Sequencer view (sequencer, preview or both)");
RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update");
/* display type, fairly important */
prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mainb");
RNA_def_property_enum_items(prop, display_mode_items);
- RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output");
+ RNA_def_property_ui_text(prop, "Display Mode", "View mode to use for displaying sequencer output");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
/* flag's */
@@ -1785,7 +1805,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
- RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips");
+ RNA_def_property_ui_text(prop, "Sync Markers", "Transform markers as well as strips");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
@@ -1800,7 +1820,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
- RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
+ RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
/* grease pencil */
@@ -1812,7 +1832,8 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "chanshown");
- RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined");
+ RNA_def_property_ui_text(prop, "Display Channel",
+ "The channel number shown in the image preview. 0 is the result of all strips combined");
RNA_def_property_range(prop, -5, MAXSEQ);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
@@ -1832,12 +1853,12 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
/* not sure we need rna access to these but adding anyway */
prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "xof");
- RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
+ RNA_def_property_ui_text(prop, "X Offset", "Offset image horizontally from the view center");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "yof");
- RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
+ RNA_def_property_ui_text(prop, "Y Offset", "Offset image vertically from the view center");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
@@ -1999,7 +2020,9 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_pose_markers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_POSEMARKERS_SHOW);
- RNA_def_property_ui_text(prop, "Show Pose Markers", "Show markers belonging to the active action instead of Scene markers (Action and Shape Key Editors only)");
+ RNA_def_property_ui_text(prop, "Show Pose Markers",
+ "Show markers belonging to the active action instead of Scene markers "
+ "(Action and Shape Key Editors only)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
/* editing */
@@ -2010,7 +2033,8 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
- RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
+ RNA_def_property_ui_text(prop, "Realtime Updates",
+ "When transforming keyframes, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
@@ -2086,7 +2110,8 @@ static void rna_def_space_graph(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
- RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable");
+ RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes",
+ "Only keyframes of selected F-Curves are visible and editable");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
@@ -2096,7 +2121,8 @@ static void rna_def_space_graph(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_beauty_drawing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_BEAUTYDRAW_OFF);
- RNA_def_property_ui_text(prop, "Use High Quality Drawing", "Draw F-Curves using Anti-Aliasing and other fancy effects. Disable for better performance");
+ RNA_def_property_ui_text(prop, "Use High Quality Drawing",
+ "Draw F-Curves using Anti-Aliasing and other fancy effects (disable for better performance)");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* editing */
@@ -2107,7 +2133,8 @@ static void rna_def_space_graph(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
- RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
+ RNA_def_property_ui_text(prop, "Realtime Updates",
+ "When transforming keyframes, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
/* cursor */
@@ -2171,13 +2198,14 @@ static void rna_def_space_nla(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
- RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips");
+ RNA_def_property_ui_text(prop, "Show Control F-Curves", "Show influence F-Curves on strips");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
/* editing */
prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
- RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming strips, changes to the animation data are flushed to other views");
+ RNA_def_property_ui_text(prop, "Realtime Updates",
+ "When transforming strips, changes to the animation data are flushed to other views");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
/* dopesheet */
@@ -2206,7 +2234,7 @@ static void rna_def_space_time(BlenderRNA *brna)
/* view settings */
prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
- RNA_def_property_ui_text(prop, "Only Selected Channels", "Show keyframes for active Object and/or its selected bones only");
+ RNA_def_property_ui_text(prop, "Only Selected Channels", "Show keyframes for active Object and/or its selected bones only");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL);
prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
@@ -2503,7 +2531,8 @@ static void rna_def_space_node(BlenderRNA *brna)
static EnumPropertyItem backdrop_channels_items[] = {
{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
- {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
+ {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
+ "Draw image with RGB colors and alpha transparency"},
{SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
{0, NULL, 0, NULL, NULL}};
@@ -2552,7 +2581,7 @@ static void rna_def_space_node(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_auto_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_AUTO_RENDER);
- RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layer on 3D edits");
+ RNA_def_property_ui_text(prop, "Auto Render", "Re-render and composite changed layers on 3D edits");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL);
prop= RNA_def_property(srna, "backdrop_zoom", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 6a1e93fce41..4e23fb6b095 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -69,7 +69,7 @@ static void rna_Text_filename_set(PointerRNA *ptr, const char *value)
if(text->name)
MEM_freeN(text->name);
- if(strlen(value))
+ if(value[0])
text->name= BLI_strdup(value);
else
text->name= NULL;
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index e2beabf789d..b5e8acb76e5 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -57,20 +57,23 @@ EnumPropertyItem texture_filter_items[] = {
EnumPropertyItem texture_type_items[] = {
{0, "NONE", 0, "None", ""},
- {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - Creates a ramp texture"},
- {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - Creates a cloud-like fractal noise texture"},
- {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", "Procedural - Noise texture distorted by two noise algorithms"},
- {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, "Environment Map", "Creates a render of the environment mapped to a texture"},
- {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allows for images or movies to be used as textures"},
+ {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - create a ramp texture"},
+ {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - create a cloud-like fractal noise texture"},
+ {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE,
+ "Distorted Noise", "Procedural - Noise texture distorted by two noise algorithms"},
+ {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA,
+ "Environment Map", "Create a render of the environment mapped to a texture"},
+ {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allow for images or movies to be used as textures"},
{TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - Color texture based on trigonometric functions"},
{TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - Marble-like noise texture with wave generated bands"},
{TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - Highly flexible fractal noise texture"},
- {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", "Procedural - Random noise, gives a different result every time, for every frame, for every pixel"},
+ {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise",
+ "Procedural - Random noise, gives a different result every time, for every frame, for every pixel"},
//{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */
{TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""},
- {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - Creates a fractal noise texture"},
- {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Creates cell-like patterns based on Worley noise"},
- {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Creates a 3d texture based on volumetric data"},
+ {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - Create a fractal noise texture"},
+ {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - Create cell-like patterns based on Worley noise"},
+ {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"},
{TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - Wave generated bands or rings, with optional noise"},
{0, NULL, 0, NULL, NULL}};
@@ -493,25 +496,26 @@ static void rna_def_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "ofs");
RNA_def_property_ui_range(prop, -10, 10, 10, 2);
- RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations");
+ RNA_def_property_ui_text(prop, "Offset", "Fine tune of the texture mapping X, Y and Z locations");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
- RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes");
+ RNA_def_property_ui_text(prop, "Size", "Set scaling for the texture's X, Y and Z sizes");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Color", "The default color for textures that don't return RGB or when RGB to intensity is enabled");
+ RNA_def_property_ui_text(prop, "Color",
+ "Default color for textures that don't return RGB or when RGB to intensity is enabled");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "blendtype");
RNA_def_property_enum_items(prop, prop_blend_type_items);
- RNA_def_property_ui_text(prop, "Blend Type", "The mode used to apply the texture");
+ RNA_def_property_ui_text(prop, "Blend Type", "Mode used to apply the texture");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "use_stencil", PROP_BOOLEAN, PROP_NONE);
@@ -521,12 +525,12 @@ static void rna_def_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE);
- RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect");
+ RNA_def_property_ui_text(prop, "Negate", "Invert the values of the texture to reverse its effect");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "use_rgb_to_intensity", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT);
- RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values");
+ RNA_def_property_ui_text(prop, "RGB to Intensity", "Convert texture RGB values to intensity (gray) values");
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
@@ -555,7 +559,7 @@ static void rna_def_filter_common(StructRNA *srna)
prop= RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
- RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Uses Gauss filter to sample down MIP maps");
+ RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Use Gauss filter to sample down MIP maps");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
@@ -567,13 +571,15 @@ static void rna_def_filter_common(StructRNA *srna)
prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
- RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower");
+ RNA_def_property_ui_text(prop, "Filter Probes",
+ "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "afmax");
RNA_def_property_range(prop, 1, 256);
- RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower");
+ RNA_def_property_ui_text(prop, "Filter Eccentricity",
+ "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE);
@@ -585,7 +591,7 @@ static void rna_def_filter_common(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "filtersize");
RNA_def_property_range(prop, 0.1, 50.0);
RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2);
- RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation");
+ RNA_def_property_ui_text(prop, "Filter Size", "Multiply the filter size used by MIP Map and Interpolation");
RNA_def_property_update(prop, 0, "rna_Texture_update");
}
@@ -595,9 +601,9 @@ static void rna_def_environment_map(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_source_items[] = {
- {ENV_STATIC, "STATIC", 0, "Static", "Calculates environment map only once"},
- {ENV_ANIM, "ANIMATED", 0, "Animated", "Calculates environment map at each rendering"},
- {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Loads a saved environment map image from disk"},
+ {ENV_STATIC, "STATIC", 0, "Static", "Calculate environment map only once"},
+ {ENV_ANIM, "ANIMATED", 0, "Animated", "Calculate environment map at each rendering"},
+ {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Load a saved environment map image from disk"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_mapping_items[] = {
@@ -662,7 +668,7 @@ static void rna_def_environment_map(BlenderRNA *brna)
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_range(prop, 0, 5);
- RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)");
+ RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects)");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0);
@@ -926,13 +932,13 @@ static void rna_def_texture_blend(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_blend_progression[] = {
- {TEX_LIN, "LINEAR", 0, "Linear", "Creates a linear progression"},
- {TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"},
- {TEX_EASE, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"},
- {TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Creates a diagonal progression"},
- {TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Creates a spherical progression"},
- {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"},
- {TEX_RAD, "RADIAL", 0, "Radial", "Creates a radial progression"},
+ {TEX_LIN, "LINEAR", 0, "Linear", "Create a linear progression"},
+ {TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Create a quadratic progression"},
+ {TEX_EASE, "EASING", 0, "Easing", "Create a progression easing from one step to the next"},
+ {TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Create a diagonal progression"},
+ {TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Create a spherical progression"},
+ {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Create a quadratic progression in the shape of a sphere"},
+ {TEX_RAD, "RADIAL", 0, "Radial", "Create a radial progression"},
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem prop_flip_axis_items[]= {
@@ -1021,11 +1027,12 @@ static void rna_def_texture_image(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_image_extension[] = {
- {TEX_EXTEND, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"},
- {TEX_CLIP, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"},
- {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"},
- {TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
- {TEX_CHECKER, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
+ {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"},
+ {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and sets exterior pixels as transparent"},
+ {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube",
+ "Clip to cubic-shaped area around the image and sets exterior pixels as transparent"},
+ {TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"},
+ {TEX_CHECKER, "CHECKER", 0, "Checker", "Cause the image to repeat in checker board pattern"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ImageTexture", "Texture");
@@ -1219,11 +1226,15 @@ static void rna_def_texture_musgrave(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_musgrave_type[] = {
- {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", "Fractal noise algorithm. Multifractal: Uses Perlin noise as a basis"},
- {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", "Fractal noise algorithm. Ridged Multifractal: Uses Perlin noise with inflection as a basis"},
- {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", "Fractal noise algorithm.Hybrid Multifractal: Uses Perlin noise as a basis, with extended controls"},
+ {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal",
+ "Fractal noise algorithm. Multifractal: Uses Perlin noise as a basis"},
+ {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal",
+ "Fractal noise algorithm. Ridged Multifractal: Uses Perlin noise with inflection as a basis"},
+ {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal",
+ "Fractal noise algorithm.Hybrid Multifractal: Uses Perlin noise as a basis, with extended controls"},
{TEX_FBM, "FBM", 0, "fBM", "Fractal noise algorithm. Fractal Brownian Motion: Uses Brownian noise as a basis"},
- {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Fractal noise algorithm. Hetero Terrain: similar to multifractal"},
+ {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain",
+ "Fractal noise algorithm. Hetero Terrain: similar to multifractal"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "MusgraveTexture", "Texture");
@@ -1298,13 +1309,28 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_distance_metric_items[] = {
- {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", "Algorithm used to calculate distance of sample points to feature points. Actual Distance: sqrt(x*x+y*y+z*z)"},
- {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", "Algorithm used to calculate distance of sample points to feature points. Distance squared: (x*x+y*y+z*z)"},
- {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", "Algorithm used to calculate distance of sample points to feature points. Manhattan: The length of the distance in axial directions"},
- {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", "Algorithm used to calculate distance of sample points to feature points. Chebychev: The length of the longest Axial journey"},
- {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", "Algorithm used to calculate distance of sample points to feature points. Minovsky 1/2: Sets Minkovsky variable to 0.5"},
- {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", "Algorithm used to calculate distance of sample points to feature points. Minkovsky 4: Sets Minkovsky variable to 4"},
- {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", "Algorithm used to calculate distance of sample points to feature points. Minkovsky: Uses the Minkowsky function to calculate distance. Exponent value determines the shape of the boundaries"},
+ {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance",
+ "Algorithm used to calculate distance of sample points to feature points; "
+ "Actual Distance: sqrt(x*x+y*y+z*z)"},
+ {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared",
+ "Algorithm used to calculate distance of sample points to feature points; "
+ "Distance squared: (x*x+y*y+z*z)"},
+ {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan",
+ "Algorithm used to calculate distance of sample points to feature points; "
+ "Manhattan: The length of the distance in axial directions"},
+ {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev",
+ "Algorithm used to calculate distance of sample points to feature points; "
+ "Chebychev: The length of the longest Axial journey"},
+ {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2",
+ "Algorithm used to calculate distance of sample points to feature points; "
+ "Minovsky 1/2: Sets Minkovsky variable to 0.5"},
+ {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4",
+ "Algorithm used to calculate distance of sample points to feature points; "
+ "Minkovsky 4: Sets Minkovsky variable to 4"},
+ {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky",
+ "Algorithm used to calculate distance of sample points to feature points; "
+ "Minkovsky: Uses the Minkowsky function to calculate distance "
+ "(exponent value determines the shape of the boundaries)"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_coloring_items[] = {
@@ -1312,7 +1338,8 @@ static void rna_def_texture_voronoi(BlenderRNA *brna)
{TEX_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"},
{TEX_COL1, "POSITION", 0, "Position", "Color cells by position"},
{TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F.1"},
- {TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", "Multiply position and outline by intensity"},
+ {TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity",
+ "Multiply position and outline by intensity"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "VoronoiTexture", "Texture");
@@ -1458,14 +1485,16 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna)
static EnumPropertyItem color_source_items[] = {
{TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""},
{TEX_PD_COLOR_PARTAGE, "PARTICLE_AGE", 0, "Particle Age", "Lifetime mapped as 0.0 - 1.0 intensity"},
- {TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed", "Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"},
+ {TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed",
+ "Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"},
{TEX_PD_COLOR_PARTVEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "XYZ velocity mapped to RGB colors"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem turbulence_influence_items[] = {
{TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"},
{TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "Turbulent noise driven by particle velocity"},
- {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", "Turbulent noise driven by the particle's age between birth and death"},
+ {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age",
+ "Turbulent noise driven by the particle's age between birth and death"},
{TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"},
{0, NULL, 0, NULL, NULL}};
@@ -1760,17 +1789,17 @@ static void rna_def_texture(BlenderRNA *brna)
prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "bright");
RNA_def_property_range(prop, 0, 2);
- RNA_def_property_ui_text(prop, "Brightness", "Adjusts the brightness of the texture");
+ RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5);
- RNA_def_property_ui_text(prop, "Contrast", "Adjusts the contrast of the texture");
+ RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0, 2);
- RNA_def_property_ui_text(prop, "Saturation", "Adjusts the saturation of colors in the texture");
+ RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture");
RNA_def_property_update(prop, 0, "rna_Texture_update");
/* RGB Factor */
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 52c359d79dd..2c2bc4704bf 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -719,7 +719,7 @@ static void rna_def_header(BlenderRNA *brna)
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "layout");
RNA_def_property_struct_type(prop, "UILayout");
- RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the header in the UI");
+ RNA_def_property_ui_text(prop, "Layout", "Structure of the header in the UI");
/* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
@@ -727,7 +727,7 @@ static void rna_def_header(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name",
"If this is set, the header gets a custom ID, otherwise it takes the "
- "name of the class used to define the panel. For example, if the "
+ "name of the class used to define the panel; for example, if the "
"class name is \"OBJECT_HT_hello\", and bl_idname is not set by the "
"script, then bl_idname = \"OBJECT_HT_hello\"");
@@ -781,9 +781,9 @@ static void rna_def_menu(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_property_ui_text(prop, "ID Name",
"If this is set, the menu gets a custom ID, otherwise it takes the "
- "name of the class used to define the panel. For example, if the "
+ "name of the class used to define the menu (for example, if the "
"class name is \"OBJECT_MT_hello\", and bl_idname is not set by the "
- "script, then bl_idname = \"OBJECT_MT_hello\"");
+ "script, then bl_idname = \"OBJECT_MT_hello\")");
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index 53bf9f10f87..b3978fd9ef9 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -84,7 +84,7 @@ static void api_ui_item_common(FunctionRNA *func)
{
PropertyRNA *prop;
- RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item");
+ RNA_def_string_translate(func, "text", "", 0, "", "Override automatic text of the item");
prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, icon_items);
@@ -309,7 +309,7 @@ void RNA_api_ui_layout(StructRNA *srna)
parm= RNA_def_string(func, "type_property", "", 0, "",
"Identifier of property in data giving the type of the ID-blocks to use");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI");
+ RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
func= RNA_def_function(srna, "template_path_builder", "uiTemplatePathBuilder");
parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
@@ -318,7 +318,7 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
- RNA_def_string(func, "text", "", 0, "", "Custom label to display in UI");
+ RNA_def_string_translate(func, "text", "", 0, "", "Custom label to display in UI");
func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
@@ -448,6 +448,10 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "template_texture_user", "uiTemplateTextureUser");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ func= RNA_def_function(srna, "template_keymap_item_properties", "uiTemplateKeymapItemProperties");
+ parm= RNA_def_pointer(func, "item", "KeyMapItem", "", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
+
func= RNA_def_function(srna, "introspect", "uiLayoutIntrospect");
parm= RNA_def_string(func, "string", "", 1024*1024, "Descr", "DESCR");
RNA_def_function_return(func, parm);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index b9a53acd6f4..11157e67741 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -65,6 +65,8 @@
#include "MEM_guardedalloc.h"
#include "MEM_CacheLimiterC-Api.h"
+#include "UI_interface.h"
+
static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
{
WM_main_add_notifier(NC_WINDOW, NULL);
@@ -79,7 +81,9 @@ static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
{
+ BLF_cache_clear();
BLF_lang_set(NULL);
+ UI_reinit_font();
}
static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -1999,10 +2003,16 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna)
static void rna_def_userdef_view(BlenderRNA *brna)
{
static EnumPropertyItem timecode_styles[] = {
- {USER_TIMECODE_MINIMAL, "MINIMAL", 0, "Minimal Info", "Most compact representation. Uses '+' as separator for sub-second frame numbers, with left and right truncation of the timecode as necessary"},
- {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode. Format is HH:MM:SS:FF"},
- {USER_TIMECODE_SMPTE_MSF, "SMPTE_COMPACT", 0, "SMPTE (Compact)", "SMPTE timecode showing minutes, seconds, and frames only. Hours are also shown if necessary, but not by default"},
- {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", "Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead"},
+ {USER_TIMECODE_MINIMAL, "MINIMAL", 0, "Minimal Info",
+ "Most compact representation, uses '+' as separator for sub-second frame numbers, "
+ "with left and right truncation of the timecode as necessary"},
+ {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode (format is HH:MM:SS:FF)"},
+ {USER_TIMECODE_SMPTE_MSF, "SMPTE_COMPACT", 0, "SMPTE (Compact)",
+ "SMPTE timecode showing minutes, seconds, and frames only - "
+ "hours are also shown if necessary, but not by default"},
+ {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds",
+ "Similar to SMPTE (Compact), except that instead of frames, "
+ "milliseconds are shown instead"},
{USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
{0, NULL, 0, NULL, NULL}};
@@ -2032,7 +2042,7 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
- RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens");
+ RNA_def_property_ui_text(prop, "Global Scene", "Force the current Scene to be displayed in all Screens");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
@@ -2051,34 +2061,40 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
- RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back");
+ RNA_def_property_ui_text(prop, "Show Playback FPS",
+ "Show the frames per second screen refresh rate, while animation is played back");
RNA_def_property_update(prop, 0, "rna_userdef_update");
/* menus */
prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
- RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering");
+ RNA_def_property_ui_text(prop, "Open On Mouse Over",
+ "Open menu buttons and pulldowns automatically when the mouse is hovering");
prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
RNA_def_property_range(prop, 1, 40);
- RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening top level menus");
+ RNA_def_property_ui_text(prop, "Top Level Menu Open Delay",
+ "Time delay in 1/10 seconds before automatically opening top level menus");
prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
RNA_def_property_range(prop, 1, 40);
- RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening sub level menus");
+ RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay",
+ "Time delay in 1/10 seconds before automatically opening sub level menus");
/* Toolbox click-hold delay */
prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
RNA_def_property_range(prop, 1, 40);
- RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
+ RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay",
+ "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
RNA_def_property_range(prop, 1, 40);
- RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
+ RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay",
+ "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
@@ -2086,7 +2102,8 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
- RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction");
+ RNA_def_property_ui_text(prop, "Contents Follow Opening Direction",
+ "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction");
prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
@@ -2098,17 +2115,22 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
- RNA_def_property_ui_text(prop, "Camera Parent Lock", "When the camera is locked to the view and in fly mode, transform the parent rather than the camera");
+ RNA_def_property_ui_text(prop, "Camera Parent Lock",
+ "When the camera is locked to the view and in fly mode, "
+ "transform the parent rather than the camera");
/* view zoom */
prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
- RNA_def_property_ui_text(prop, "Zoom To Mouse Position", "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
+ RNA_def_property_ui_text(prop, "Zoom To Mouse Position",
+ "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
/* view rotation */
prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
- RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views");
+ RNA_def_property_ui_text(prop, "Auto Perspective",
+ "Automatically switch between orthographic and perspective when changing "
+ "from top/front/side views");
prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
@@ -2117,30 +2139,30 @@ static void rna_def_userdef_view(BlenderRNA *brna)
/* mini axis */
prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
- RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View");
+ RNA_def_property_ui_text(prop, "Show Mini Axes", "Show a small rotating 3D axes in the bottom left corner of the 3D View");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvisize");
RNA_def_property_range(prop, 10, 64);
- RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size");
+ RNA_def_property_ui_text(prop, "Mini Axes Size", "The axes icon's size");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rvibright");
RNA_def_property_range(prop, 0, 10);
- RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon");
+ RNA_def_property_ui_text(prop, "Mini Axes Brightness", "Brightness of the icon");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
RNA_def_property_range(prop, 0, 1000);
- RNA_def_property_ui_text(prop, "Smooth View", "The time to animate the view in milliseconds, zero to disable");
+ RNA_def_property_ui_text(prop, "Smooth View", "Time to animate the view in milliseconds, zero to disable");
prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
RNA_def_property_range(prop, 0, 90);
- RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)");
+ RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)");
/* 3D transform widget */
prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
@@ -2178,7 +2200,8 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
- RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports");
+ RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing",
+ "Minimum number of pixels between each gridline in 2D Viewports");
RNA_def_property_update(prop, 0, "rna_userdef_update");
// TODO: add a setter for this, so that we can bump up the minimum size as necessary...
@@ -2186,7 +2209,8 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_enum_items(prop, timecode_styles);
RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
- RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
+ RNA_def_property_ui_text(prop, "TimeCode Style",
+ "Format of Time Codes displayed when not displaying timing in terms of frames");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -2206,7 +2230,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static const EnumPropertyItem object_align_items[]= {
- {0, "WORLD", 0, "World", "Align newly added objects to the world coordinates"},
+ {0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"},
{USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
{0, NULL, 0, NULL, NULL}};
@@ -2220,12 +2244,14 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, material_link_items);
- RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
+ RNA_def_property_ui_text(prop, "Material Link To",
+ "Toggle whether the material is linked to object data or the object block");
prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, object_align_items);
- RNA_def_property_ui_text(prop, "Align Object To", "When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates");
+ RNA_def_property_ui_text(prop, "Align Object To",
+ "When adding objects from a 3D View menu, either align them with that view or with the world");
prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
@@ -2248,22 +2274,26 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
- RNA_def_property_ui_text(prop, "Global Undo", "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
+ RNA_def_property_ui_text(prop, "Global Undo",
+ "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
/* auto keyframing */
prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
- RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)");
+ RNA_def_property_ui_text(prop, "Auto Keying Enable",
+ "Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)");
RNA_def_property_ui_icon(prop, ICON_REC, 0);
prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, auto_key_modes);
RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
- RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)");
+ RNA_def_property_ui_text(prop, "Auto Keying Mode",
+ "Mode of automatic keyframe insertion for Objects and Bones "
+ "(default setting used for new Scenes)");
prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
- RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves");
+ RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available F-Curves");
/* keyframing settings */
prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
@@ -2276,12 +2306,16 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
- RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis");
+ RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB",
+ "Color for newly added transformation F-Curves (Location, Rotation, Scale) "
+ "and also Color is based on the transform axis");
prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
- RNA_def_property_ui_text(prop, "New Interpolation Type", "Interpolation mode used for first keyframe on newly added F-Curves. Subsequent keyframes take interpolation from preceeding keyframe");
+ RNA_def_property_ui_text(prop, "New Interpolation Type",
+ "Interpolation mode used for first keyframe on newly added F-Curves "
+ "(subsequent keyframes take interpolation from preceeding keyframe)");
prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, keyframe_handle_type_items);
@@ -2302,7 +2336,8 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
RNA_def_property_range(prop, 0, 100);
- RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include");
+ RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance",
+ "Distance moved by mouse when drawing stroke (in pixels) to include");
prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
@@ -2455,10 +2490,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
static EnumPropertyItem draw_method_items[] = {
{USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
- {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory"},
+ {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer",
+ "Use a third buffer for minimal redraws at the cost of more memory"},
{USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
- {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip", "Redraw all overlapping regions, minimal memory usage but more redraws (for graphics drivers that do flipping)"},
- {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails"},
+ {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip",
+ "Redraw all overlapping regions, minimal memory usage but more redraws "
+ "(for graphics drivers that do flipping)"},
+ {USER_DRAW_FULL, "FULL", 0, "Full",
+ "Do a full redraw each time, slow, only use for reference or when everything else fails"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem color_picker_types[] = {
@@ -2493,11 +2532,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{18, "UKRAINIAN", 0, N_("Ukrainian (Український)"), "uk_UA"},
{19, "POLISH", 0, N_("Polish (Polski)"), "pl_PL"},
{20, "ROMANIAN", 0, N_("Romanian (Român)"), "ro_RO"},
- {21, "ARABIC", 0, N_("Arabic (العربية)"), "ar_EG"},
+ /* using the utf8 flipped form of Arabic (العربية) */
+ {21, "ARABIC", 0, N_("Arabic (ﺔﻴﺑﺮﻌﻟﺍ)"), "ar_EG"},
{22, "BULGARIAN", 0, N_("Bulgarian (Български)"), "bg_BG"},
{23, "GREEK", 0, N_("Greek (Ελληνικά)"), "el_GR"},
{24, "KOREAN", 0, N_("Korean (한국 언어)"), "ko_KR"},
- /*{25, "Nepali", 0, N_("Nepali (नेपाली)"), "ne_NP"},*/
+ /*{25, "NEPALI", 0, N_("Nepali (नेपाली)"), "ne_NP"},*/
+ /* using the utf8 flipped form of Persian (فارسی) */
+ {26, "PERSIAN", 0, N_("Persian (ﺱﺭﺎﻓ)"), "fa_PE"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
@@ -2532,7 +2574,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, language_items);
- RNA_def_property_ui_text(prop, "Language", "Language use for translation");
+ RNA_def_property_ui_text(prop, "Language", "Language used for translation");
RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
@@ -2559,7 +2601,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
- RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode");
+ RNA_def_property_ui_text(prop, "Use Weight Color Range",
+ "Enable color range used for weight visualization in weight painting mode");
RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
@@ -2576,16 +2619,20 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
- RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)");
+ RNA_def_property_ui_text(prop, "Enable All Codecs",
+ "Allow user to choose any codec (Windows only, might generate instability)");
prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
- RNA_def_property_ui_text(prop, "Auto Run Python Scripts", "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)");
+ RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
+ "Allow any .blend file to run scripts automatically "
+ "(unsafe with blend files from an untrusted source)");
RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
- RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces for new and loaded text files");
+ RNA_def_property_ui_text(prop, "Tabs as Spaces",
+ "Automatically convert all new tabs into spaces for new and loaded text files");
prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
@@ -2611,12 +2658,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
- RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
+ RNA_def_property_ui_text(prop, "Mipmaps",
+ "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
+ RNA_def_property_update(prop, NC_WINDOW, NULL); /* this isnt essential but nice to check if VBO draws any differently */
prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
@@ -2626,7 +2675,8 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
RNA_def_property_enum_items(prop, anisotropic_items);
RNA_def_property_enum_default(prop, 1);
- RNA_def_property_ui_text(prop, "Anisotropic Filter", "The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
+ RNA_def_property_ui_text(prop, "Anisotropic Filter",
+ "Quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update");
prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
@@ -2638,12 +2688,15 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "textimeout");
RNA_def_property_range(prop, 0, 3600);
- RNA_def_property_ui_text(prop, "Texture Time Out", "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated.)");
+ RNA_def_property_ui_text(prop, "Texture Time Out",
+ "Time since last access of a GL texture in seconds after which it is freed "
+ "(set to 0 to keep textures allocated)");
prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
RNA_def_property_range(prop, 1, 3600);
- RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector");
+ RNA_def_property_ui_text(prop, "Texture Collection Rate",
+ "Number of seconds between each run of the GL texture garbage collector");
prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
@@ -2654,31 +2707,31 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
RNA_def_property_enum_items(prop, audio_mixing_samples_items);
- RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer");
+ RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
RNA_def_property_enum_items(prop, audio_device_items);
- RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device");
+ RNA_def_property_ui_text(prop, "Audio Device", "Audio output device");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audiorate");
RNA_def_property_enum_items(prop, audio_rate_items);
- RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate");
+ RNA_def_property_ui_text(prop, "Audio Sample Rate", "Audio sample rate");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audioformat");
RNA_def_property_enum_items(prop, audio_format_items);
- RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format");
+ RNA_def_property_ui_text(prop, "Audio Sample Format", "Audio sample format");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
RNA_def_property_enum_items(prop, audio_channel_items);
- RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
+ RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
@@ -2699,11 +2752,11 @@ static void rna_def_userdef_system(BlenderRNA *brna)
#if 0
prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "versemaster");
- RNA_def_property_ui_text(prop, "Verse Master", "The Verse Master-server IP");
+ RNA_def_property_ui_text(prop, "Verse Master", "Verse Master-server IP");
prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "verseuser");
- RNA_def_property_ui_text(prop, "Verse Username", "The Verse user name");
+ RNA_def_property_ui_text(prop, "Verse Username", "Verse user name");
#endif
}
@@ -2724,13 +2777,13 @@ static void rna_def_userdef_input(BlenderRNA *brna)
static EnumPropertyItem view_zoom_styles[] = {
{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
- {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement"},
- {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center"},
+ {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"},
+ {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zoom in and out like scaling the view, mouse movements relative to center"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem view_zoom_axes[] = {
- {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"},
- {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"},
+ {0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"},
+ {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zoom in and out based on horizontal mouse movement"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
@@ -2742,7 +2795,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
RNA_def_property_enum_items(prop, select_mouse_items);
RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
- RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection");
+ RNA_def_property_ui_text(prop, "Select Mouse", "Mouse button used for selection");
prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
@@ -2765,7 +2818,8 @@ static void rna_def_userdef_input(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
- RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
+ RNA_def_property_ui_text(prop, "Continuous Grab",
+ "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
/* tweak tablet & mouse preset */
prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
@@ -2773,7 +2827,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_range(prop, 3, 40);
RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
- /* 3D mouse settings */
+ /* 3D mouse settings */
/* global options */
prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.25f, 4.0f);
@@ -2842,15 +2896,16 @@ static void rna_def_userdef_input(BlenderRNA *brna)
prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
RNA_def_property_range(prop, 1, 1000);
- RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click");
+ RNA_def_property_ui_text(prop, "Double Click Timeout", "Time/delay (in ms) for a double click");
prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
- RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)");
+ RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse",
+ "Emulate Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)");
prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
- RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
+ RNA_def_property_ui_text(prop, "Emulate Numpad", "Main 1 to 0 keys act as the numpad ones (useful for laptops)");
/* middle mouse button */
prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
@@ -2864,7 +2919,7 @@ static void rna_def_userdef_input(BlenderRNA *brna)
prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
RNA_def_property_range(prop, 0, 32);
- RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
+ RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel");
prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
@@ -2893,7 +2948,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
- RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
+ RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot (.*)");
prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
@@ -2941,7 +2996,9 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
RNA_def_property_string_sdna(prop, NULL, "pythondir");
- RNA_def_property_ui_text(prop, "Python Scripts Directory", "Alternate script path, matching the default layout with subdirs: startup, addons & modules (requires restart)");
+ RNA_def_property_ui_text(prop, "Python Scripts Directory",
+ "Alternate script path, matching the default layout with subdirs: "
+ "startup, addons & modules (requires restart)");
/* TODO, editing should reset sys.path! */
prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
@@ -2972,11 +3029,13 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "versions");
RNA_def_property_range(prop, 0, 32);
- RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving");
+ RNA_def_property_ui_text(prop, "Save Versions",
+ "The number of old versions to maintain in the current directory, when manually saving");
prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
- RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files in temp directory, uses process ID");
+ RNA_def_property_ui_text(prop, "Auto Save Temporary Files",
+ "Automatic saving of temporary files in temp directory, uses process ID");
RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
@@ -3002,7 +3061,7 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_srna(cprop, "Addons");
srna= RNA_def_struct(brna, "Addons", NULL);
- RNA_def_struct_ui_text(srna, "User Add-Ons", "Collection of add-ons");
+ RNA_def_struct_ui_text(srna, "User Addons", "Collection of addons");
func= RNA_def_function(srna, "new", "rna_userdef_addon_new");
RNA_def_function_flag(func, FUNC_NO_SELF);
@@ -3027,7 +3086,7 @@ void RNA_def_userdef(BlenderRNA *brna)
{USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
{USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
{USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
- {USER_SECTION_ADDONS, "ADDONS", 0, "Add-Ons", ""},
+ {USER_SECTION_ADDONS, "ADDONS", 0, "Addons", ""},
{USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
{USER_SECTION_FILE, "FILES", 0, "File", ""},
{USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 606355c4fb6..e9df79acd4a 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -451,7 +451,7 @@ static PointerRNA rna_Operator_properties_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, op->type->srna, op->properties);
}
-static PointerRNA rna_OperatorTypeMacro_properties_get(PointerRNA *ptr)
+static PointerRNA rna_OperatorMacro_properties_get(PointerRNA *ptr)
{
wmOperatorTypeMacro *otmacro= (wmOperatorTypeMacro*)ptr->data;
wmOperatorType *ot = WM_operatortype_find(otmacro->idname, TRUE);
@@ -1195,7 +1195,7 @@ static void rna_def_operator(BlenderRNA *brna)
// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
@@ -1249,14 +1249,14 @@ static void rna_def_macro_operator(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
- prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
+ prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_description_set");
@@ -1277,8 +1277,8 @@ static void rna_def_operator_type_macro(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna= RNA_def_struct(brna, "OperatorTypeMacro", NULL);
- RNA_def_struct_ui_text(srna, "OperatorTypeMacro", "Storage of a sub operator in a macro after it has been added");
+ srna= RNA_def_struct(brna, "OperatorMacro", NULL);
+ RNA_def_struct_ui_text(srna, "Operator Macro", "Storage of a sub operator in a macro after it has been added");
RNA_def_struct_sdna(srna, "wmOperatorTypeMacro");
// prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
@@ -1291,7 +1291,7 @@ static void rna_def_operator_type_macro(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "OperatorProperties");
RNA_def_property_ui_text(prop, "Properties", "");
- RNA_def_property_pointer_funcs(prop, "rna_OperatorTypeMacro_properties_get", NULL, NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_OperatorMacro_properties_get", NULL, NULL, NULL);
}
static void rna_def_operator_utils(BlenderRNA *brna)
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index fb4aa4ca4a5..7e06ef1d017 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -65,7 +65,6 @@ set(SRC
intern/MOD_meshdeform.c
intern/MOD_mirror.c
intern/MOD_multires.c
- intern/MOD_navmesh.c
intern/MOD_none.c
intern/MOD_particleinstance.c
intern/MOD_particlesystem.c
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c
index 0b46d950950..0ef85a49899 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -42,6 +42,7 @@
#include "DNA_mesh_types.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_cdderivedmesh.h"
@@ -70,7 +71,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tamd->object = amd->object;
tamd->deformflag = amd->deformflag;
tamd->multi = amd->multi;
- strncpy(tamd->defgrp_name, amd->defgrp_name, 32);
+ BLI_strncpy(tamd->defgrp_name, amd->defgrp_name, 32);
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md))
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index 277f404f64d..197e6a24342 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -72,7 +72,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tbmd->lim_flags = bmd->lim_flags;
tbmd->e_flags = bmd->e_flags;
tbmd->bevel_angle = bmd->bevel_angle;
- strncpy(tbmd->defgrp_name, bmd->defgrp_name, 32);
+ BLI_strncpy(tbmd->defgrp_name, bmd->defgrp_name, 32);
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c
index 4061128b5ad..b0e001f0978 100644
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@ -40,6 +40,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_deform.h"
@@ -77,7 +78,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tcmd->flag = cmd->flag;
tcmd->type = cmd->type;
tcmd->object = cmd->object;
- strncpy(tcmd->defgrp_name, cmd->defgrp_name, 32);
+ BLI_strncpy(tcmd->defgrp_name, cmd->defgrp_name, 32);
}
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c
index d928c239eac..b732158358d 100644
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@ -41,6 +41,7 @@
#include "DNA_object_types.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_cdderivedmesh.h"
@@ -65,7 +66,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tcmd->defaxis = cmd->defaxis;
tcmd->object = cmd->object;
- strncpy(tcmd->name, cmd->name, 32);
+ BLI_strncpy(tcmd->name, cmd->name, 32);
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index fb7aeacecc8..b0d9892a8df 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -40,6 +40,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_cdderivedmesh.h"
@@ -75,11 +76,11 @@ static void copyData(ModifierData *md, ModifierData *target)
tdmd->texture = dmd->texture;
tdmd->strength = dmd->strength;
tdmd->direction = dmd->direction;
- strncpy(tdmd->defgrp_name, dmd->defgrp_name, 32);
+ BLI_strncpy(tdmd->defgrp_name, dmd->defgrp_name, 32);
tdmd->midlevel = dmd->midlevel;
tdmd->texmapping = dmd->texmapping;
tdmd->map_object = dmd->map_object;
- strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32);
+ BLI_strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32);
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index 3d01661bc79..0f3822f8cb6 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -543,7 +543,8 @@ static void remap_uvs_23(DerivedMesh *dm, DerivedMesh *split, int numlayer, int
}
}
-static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm){
+static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
+{
DerivedMesh *splitdm;
MFace *mf=NULL,*df1=NULL;
MFace *mface=dm->getFaceArray(dm);
@@ -557,7 +558,9 @@ static DerivedMesh * cutEdges(ExplodeModifierData *emd, DerivedMesh *dm){
int *vertpa = MEM_callocN(sizeof(int)*totvert,"explode_vertpa2");
int *facepa = emd->facepa;
int *fs, totesplit=0,totfsplit=0,curdupface=0;
- int i,j,v1,v2,v3,v4,esplit, v[4], uv[4];
+ int i,j,v1,v2,v3,v4,esplit,
+ v[4] = {0, 0, 0, 0}, /* To quite gcc barking... */
+ uv[4] = {0, 0, 0, 0}; /* To quite gcc barking... */
int numlayer;
edgehash= BLI_edgehash_new();
diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index 785abc7d4d1..ad97ee82ee2 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -41,6 +41,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_action.h"
#include "BKE_cdderivedmesh.h"
@@ -72,8 +73,8 @@ static void copyData(ModifierData *md, ModifierData *target)
thmd->totindex = hmd->totindex;
thmd->indexar = MEM_dupallocN(hmd->indexar);
memcpy(thmd->parentinv, hmd->parentinv, sizeof(hmd->parentinv));
- strncpy(thmd->name, hmd->name, 32);
- strncpy(thmd->subtarget, hmd->subtarget, 32);
+ BLI_strncpy(thmd->name, hmd->name, 32);
+ BLI_strncpy(thmd->subtarget, hmd->subtarget, 32);
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c
index 31c17fb7376..4ff92e3c86d 100644
--- a/source/blender/modifiers/intern/MOD_lattice.c
+++ b/source/blender/modifiers/intern/MOD_lattice.c
@@ -40,6 +40,7 @@
#include "DNA_object_types.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_cdderivedmesh.h"
@@ -57,7 +58,7 @@ static void copyData(ModifierData *md, ModifierData *target)
LatticeModifierData *tlmd = (LatticeModifierData*) target;
tlmd->object = lmd->object;
- strncpy(tlmd->name, lmd->name, 32);
+ BLI_strncpy(tlmd->name, lmd->name, 32);
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_navmesh.c b/source/blender/modifiers/intern/MOD_navmesh.c
deleted file mode 100644
index cf4e01ad516..00000000000
--- a/source/blender/modifiers/intern/MOD_navmesh.c
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
-* $Id$
-*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2005 by the Blender Foundation.
-* All rights reserved.
-*
-* Contributor(s):
-*
-* ***** END GPL LICENSE BLOCK *****
-*
-*/
-#include <math.h>
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-
-#ifdef WITH_GAMEENGINE
-# include "recast-capi.h"
-# include "BKE_navmesh_conversion.h"
-# include "GL/glew.h"
-# include "GPU_buffers.h"
-# include "GPU_draw.h"
-#endif
-
-#include "BLI_math.h"
-#include "BLI_utildefines.h"
-
-#include "BKE_cdderivedmesh.h"
-#include "BKE_mesh.h"
-#include "BKE_modifier.h"
-#include "BKE_particle.h"
-#include "BKE_customdata.h"
-#include "MEM_guardedalloc.h"
-
-BM_INLINE int bit(int a, int b)
-{
- return (a & (1 << b)) >> b;
-}
-
-BM_INLINE void intToCol(int i, float* col)
-{
- int r = bit(i, 0) + bit(i, 3) * 2 + 1;
- int g = bit(i, 1) + bit(i, 4) * 2 + 1;
- int b = bit(i, 2) + bit(i, 5) * 2 + 1;
- col[0] = 1 - r*63.0f/255.0f;
- col[1] = 1 - g*63.0f/255.0f;
- col[2] = 1 - b*63.0f/255.0f;
-}
-
-
-static void initData(ModifierData *UNUSED(md))
-{
- /* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */ /* UNUSED */
-}
-
-static void copyData(ModifierData *UNUSED(md), ModifierData *UNUSED(target))
-{
- /* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */
- /* NavMeshModifierData *tnmmd = (NavMeshModifierData*) target; */
-
- //.todo - deep copy
-}
-
-/*
-static void (*drawFacesSolid_original)(DerivedMesh *dm, float (*partial_redraw_planes)[4],
- int fast, int (*setMaterial)(int, void *attribs)) = NULL;*/
-
-#ifdef WITH_GAMEENGINE
-
-static void drawNavMeshColored(DerivedMesh *dm)
-{
- int a, glmode;
- MVert *mvert = (MVert *)CustomData_get_layer(&dm->vertData, CD_MVERT);
- MFace *mface = (MFace *)CustomData_get_layer(&dm->faceData, CD_MFACE);
- int* polygonIdx = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST);
- const float BLACK_COLOR[3] = {0.f, 0.f, 0.f};
- float col[3];
-
- if (!polygonIdx)
- return;
-
- /*
- //UI_ThemeColor(TH_WIRE);
- glDisable(GL_LIGHTING);
- glLineWidth(2.0);
- dm->drawEdges(dm, 0, 1);
- glLineWidth(1.0);
- glEnable(GL_LIGHTING);*/
-
- glDisable(GL_LIGHTING);
- if(GPU_buffer_legacy(dm) ) {
- DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" );
- //glShadeModel(GL_SMOOTH);
- glBegin(glmode = GL_QUADS);
- for(a = 0; a < dm->numFaceData; a++, mface++) {
- int new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES;
- int polygonIdx = *(int*)CustomData_get(&dm->faceData, a, CD_RECAST);
- if (polygonIdx<=0)
- memcpy(col, BLACK_COLOR, 3*sizeof(float));
- else
- intToCol(polygonIdx, col);
-
- if(new_glmode != glmode) {
- glEnd();
- glBegin(glmode = new_glmode);
- }
- glColor3fv(col);
- glVertex3fv(mvert[mface->v1].co);
- glVertex3fv(mvert[mface->v2].co);
- glVertex3fv(mvert[mface->v3].co);
- if(mface->v4) {
- glVertex3fv(mvert[mface->v4].co);
- }
- }
- glEnd();
- }
- glEnable(GL_LIGHTING);
-}
-
-static void navDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, MCol *mcol, int matnr))
-{
- (void) setDrawOptions;
-
- drawNavMeshColored(dm);
-}
-
-static void navDM_drawFacesSolid(DerivedMesh *dm,
- float (*partial_redraw_planes)[4],
- int UNUSED(fast), int (*setMaterial)(int, void *attribs))
-{
- (void) partial_redraw_planes;
- (void) setMaterial;
-
- //drawFacesSolid_original(dm, partial_redraw_planes, fast, setMaterial);
- drawNavMeshColored(dm);
-}
-#endif /* WITH_GAMEENGINE */
-
-static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *UNUSED(mmd), DerivedMesh *dm)
-{
-#ifdef WITH_GAMEENGINE
- DerivedMesh *result;
- int maxFaces = dm->getNumFaces(dm);
- int *recastData;
- int vertsPerPoly=0, nverts=0, ndtris=0, npolys=0;
- float* verts=NULL;
- unsigned short *dtris=NULL, *dmeshes=NULL, *polys=NULL;
- int *dtrisToPolysMap=NULL, *dtrisToTrisMap=NULL, *trisToFacesMap=NULL;
- int res;
-
- result = CDDM_copy(dm);
- if (!CustomData_has_layer(&result->faceData, CD_RECAST))
- {
- int *sourceRecastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST);
- CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE,
- sourceRecastData, maxFaces, "recastData");
- }
- recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST);
- result->drawFacesTex = navDM_drawFacesTex;
- result->drawFacesSolid = navDM_drawFacesSolid;
-
-
- //process mesh
- res = buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nverts, &verts, &ndtris, &dtris,
- &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap,
- &trisToFacesMap);
- if (res)
- {
- size_t polyIdx;
-
- //invalidate concave polygon
- for (polyIdx=0; polyIdx<(size_t)npolys; polyIdx++)
- {
- unsigned short* poly = &polys[polyIdx*2*vertsPerPoly];
- if (!polyIsConvex(poly, vertsPerPoly, verts))
- {
- //set negative polygon idx to all faces
- unsigned short *dmesh = &dmeshes[4*polyIdx];
- unsigned short tbase = dmesh[2];
- unsigned short tnum = dmesh[3];
- unsigned short ti;
-
- for (ti=0; ti<tnum; ti++)
- {
- unsigned short triidx = dtrisToTrisMap[tbase+ti];
- unsigned short faceidx = trisToFacesMap[triidx];
- if (recastData[faceidx]>0)
- recastData[faceidx] = -recastData[faceidx];
- }
- }
- }
-
- }
- else
- {
- printf("Error during creation polygon infos\n");
- }
-
- //clean up
- if (verts!=NULL)
- MEM_freeN(verts);
- if (dtris!=NULL)
- MEM_freeN(dtris);
- if (dmeshes!=NULL)
- MEM_freeN(dmeshes);
- if (polys!=NULL)
- MEM_freeN(polys);
- if (dtrisToPolysMap!=NULL)
- MEM_freeN(dtrisToPolysMap);
- if (dtrisToTrisMap!=NULL)
- MEM_freeN(dtrisToTrisMap);
- if (trisToFacesMap!=NULL)
- MEM_freeN(trisToFacesMap);
-
- return result;
-#else // WITH_GAMEENGINE
- return dm;
-#endif // WITH_GAMEENGINE
-}
-
-/*
-static int isDisabled(ModifierData *md, int useRenderParams)
-{
- NavMeshModifierData *amd = (NavMeshModifierData*) md;
- return false;
-}*/
-
-
-
-static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
- int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
-{
- DerivedMesh *result = NULL;
- NavMeshModifierData *nmmd = (NavMeshModifierData*) md;
- int hasRecastData = CustomData_has_layer(&derivedData->faceData, CD_RECAST)>0;
- if (ob->body_type!=OB_BODY_TYPE_NAVMESH || !hasRecastData )
- {
- //convert to nav mesh object:
- //1)set physics type
- ob->gameflag &= ~OB_COLLISION;
- ob->gameflag |= OB_NAVMESH;
- ob->body_type = OB_BODY_TYPE_NAVMESH;
- //2)add and init recast data layer
- if (!hasRecastData)
- {
- Mesh* obmesh = (Mesh *)ob->data;
- if (obmesh)
- {
- int i;
- int numFaces = obmesh->totface;
- int* recastData;
- CustomData_add_layer_named(&obmesh->fdata, CD_RECAST, CD_CALLOC, NULL, numFaces, "recastData");
- recastData = (int*)CustomData_get_layer(&obmesh->fdata, CD_RECAST);
- for (i=0; i<numFaces; i++)
- {
- recastData[i] = i+1;
- }
- CustomData_add_layer_named(&derivedData->faceData, CD_RECAST, CD_REFERENCE, recastData, numFaces, "recastData");
- }
- }
- }
-
- result = createNavMeshForVisualization(nmmd, derivedData);
-
- return result;
-}
-
-
-ModifierTypeInfo modifierType_NavMesh = {
- /* name */ "NavMesh",
- /* structName */ "NavMeshModifierData",
- /* structSize */ sizeof(NavMeshModifierData),
- /* type */ eModifierTypeType_Constructive,
- /* flags */ (ModifierTypeFlag) (eModifierTypeFlag_AcceptsMesh
- | eModifierTypeFlag_Single),
- /* copyData */ copyData,
- /* deformVerts */ 0,
- /* deformMatrices */ 0,
- /* deformVertsEM */ 0,
- /* deformMatricesEM */ 0,
- /* applyModifier */ applyModifier,
- /* applyModifierEM */ 0,
- /* initData */ initData,
- /* requiredDataMask */ 0,
- /* freeData */ 0,
- /* isDisabled */ 0,
- /* updateDepgraph */ 0,
- /* dependsOnTime */ 0,
- /* foreachObjectLink */ 0,
- /* foreachIDLink */ 0,
-};
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index 16898a80b53..5e13b8a6d3c 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -39,6 +39,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_particle.h"
@@ -69,7 +70,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tsmd->fac = smd->fac;
tsmd->repeat = smd->repeat;
tsmd->flag = smd->flag;
- strncpy(tsmd->defgrp_name, smd->defgrp_name, 32);
+ BLI_strncpy(tsmd->defgrp_name, smd->defgrp_name, 32);
}
static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index afe6da8b38a..757da28e4b5 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -524,7 +524,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
if(smd->flag & MOD_SOLIDIFY_RIM) {
-
+ int *origindex;
/* bugger, need to re-calculate the normals for the new edge faces.
* This could be done in many ways, but probably the quickest way is to calculate the average normals for side faces only.
@@ -551,18 +551,22 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
{0, 3, 3, 0}};
/* add faces & edges */
+ origindex= result->getEdgeDataArray(result, CD_ORIGINDEX);
ed= medge + (numEdges * 2);
for(i=0; i<newEdges; i++, ed++) {
ed->v1= new_vert_arr[i];
ed->v2= new_vert_arr[i] + numVerts;
ed->flag |= ME_EDGEDRAW;
+ origindex[numEdges * 2 + i]= ORIGINDEX_NONE;
+
if(crease_rim)
ed->crease= crease_rim;
}
/* faces */
mf= mface + (numFaces * 2);
+ origindex= result->getFaceDataArray(result, CD_ORIGINDEX);
for(i=0; i<newFaces; i++, mf++) {
int eidx= new_edge_arr[i];
int fidx= edge_users[eidx];
@@ -623,6 +627,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
add_v3_v3(edge_vert_nos[ed->v1], nor);
add_v3_v3(edge_vert_nos[ed->v2], nor);
#endif
+ origindex[numFaces * 2 + i]= ORIGINDEX_NONE;
}
#ifdef SOLIDIFY_SIDE_NORMALS
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index a2fe947a523..26e9d48cd0a 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -295,7 +295,6 @@ void modifier_type_init(ModifierTypeInfo *types[])
INIT_TYPE(Solidify);
INIT_TYPE(Screw);
INIT_TYPE(Warp);
- INIT_TYPE(NavMesh);
INIT_TYPE(WeightVGEdit);
INIT_TYPE(WeightVGMix);
INIT_TYPE(WeightVGProximity);
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index 0defc69b000..68afa71dbdd 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -23,12 +23,17 @@
*
*/
+/** \file blender/modifiers/intern/MOD_warp.c
+ * \ingroup modifiers
+ */
+
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_modifier.h"
@@ -69,13 +74,13 @@ static void copyData(ModifierData *md, ModifierData *target)
twmd->strength = wmd->strength;
twmd->falloff_radius = wmd->falloff_radius;
twmd->falloff_type = wmd->falloff_type;
- strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name));
+ BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, sizeof(twmd->defgrp_name));
twmd->curfalloff = curvemapping_copy(wmd->curfalloff);
/* map info */
twmd->texture = wmd->texture;
twmd->map_object = wmd->map_object;
- strncpy(twmd->uvlayer_name, wmd->uvlayer_name, sizeof(twmd->uvlayer_name));
+ BLI_strncpy(twmd->uvlayer_name, wmd->uvlayer_name, sizeof(twmd->uvlayer_name));
twmd->texmapping= wmd->texmapping;
}
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index 4b5769ff603..820c7e16f53 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -42,6 +42,7 @@
#include "DNA_object_types.h"
#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "BKE_DerivedMesh.h"
@@ -98,7 +99,7 @@ static void copyData(ModifierData *md, ModifierData *target)
twmd->texture = wmd->texture;
twmd->map_object = wmd->map_object;
twmd->texmapping = wmd->texmapping;
- strncpy(twmd->defgrp_name, wmd->defgrp_name, 32);
+ BLI_strncpy(twmd->defgrp_name, wmd->defgrp_name, 32);
}
static int dependsOnTime(ModifierData *UNUSED(md))
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c
index 128e888ca90..dcdb6b4dde8 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.c
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.c
@@ -26,11 +26,8 @@
*
*/
-/*
- * XXX I'd like to make modified weights visible in WeightPaint mode,
- * but couldn't figure a way to do this...
- * Maybe this will need changes in mesh_calc_modifiers (DerivedMesh.c)?
- * Or the WeightPaint mode code itself?
+/** \file blender/modifiers/intern/MOD_weightvg_util.c
+ * \ingroup modifiers
*/
#include "BLI_math.h"
@@ -228,7 +225,8 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne
}
/* Adds the given vertex to the specified vertex group, with given weight. */
-static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float weight) {
+static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float weight)
+{
/* TODO, move into deform.c as a generic function. This assumes the vertex
* groups have already been checked, so this has to remain low level. */
MDeformWeight *newdw;
@@ -247,7 +245,8 @@ static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float we
/* Removes the given vertex from the vertex group, specified either by its defgrp_idx,
* or directly by its MDeformWeight pointer, if dw is not NULL.
* WARNING: This function frees the given MDeformWeight, do not use it afterward! */
-static void defvert_remove_from_group(MDeformVert *dv, int defgrp_idx, MDeformWeight *dw) {
+static void defvert_remove_from_group(MDeformVert *dv, int defgrp_idx, MDeformWeight *dw)
+{
/* TODO, move this into deform.c as a generic function. */
MDeformWeight *newdw;
int i;
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h
index a327bdf969b..ed558e412c5 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.h
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.h
@@ -26,7 +26,7 @@
*
*/
-/** \file blender/modifiers/intern/MOD_util.h
+/** \file blender/modifiers/intern/MOD_weightvg_util.h
* \ingroup modifiers
*/
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index 233ad8baf0b..42d628cad09 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -26,11 +26,8 @@
*
*/
-/*
- * XXX I'd like to make modified weights visible in WeightPaint mode,
- * but couldn't figure a way to do this...
- * Maybe this will need changes in mesh_calc_modifiers (DerivedMesh.c)?
- * Or the WeightPaint mode code itself?
+/** \file blender/modifiers/intern/MOD_weightvgedit.c
+ * \ingroup modifiers
*/
#include "BLI_utildefines.h"
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c
index 283e812e11c..e3499829371 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -26,11 +26,8 @@
*
*/
-/*
- * XXX I'd like to make modified weights visible in WeightPaint mode,
- * but couldn't figure a way to do this...
- * Maybe this will need changes in mesh_calc_modifiers (DerivedMesh.c)?
- * Or the WeightPaint mode code itself?
+/** \file blender/modifiers/intern/MOD_weightvgmix.c
+ * \ingroup modifiers
*/
#include "BLI_utildefines.h"
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index 76be25a2b10..109d16f229f 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -26,11 +26,8 @@
*
*/
-/*
- * XXX I'd like to make modified weights visible in WeightPaint mode,
- * but couldn't figure a way to do this...
- * Maybe this will need changes in mesh_calc_modifiers (DerivedMesh.c)?
- * Or the WeightPaint mode code itself?
+/** \file blender/modifiers/intern/MOD_weightvgproximity.c
+ * \ingroup modifiers
*/
#include "BLI_editVert.h"
diff --git a/source/blender/nodes/composite/nodes/node_composite_common.c b/source/blender/nodes/composite/nodes/node_composite_common.c
index d5ae442c25f..ed85d1c2fb8 100644
--- a/source/blender/nodes/composite/nodes/node_composite_common.c
+++ b/source/blender/nodes/composite/nodes/node_composite_common.c
@@ -174,7 +174,8 @@ static void group_move_outputs(bNode *node, bNodeStack **out, bNodeStack *gstack
}
/* Free internal buffers */
-static void group_free_internal(bNodeTreeExec *gexec) {
+static void group_free_internal(bNodeTreeExec *gexec)
+{
bNodeStack *ns;
int i;
diff --git a/source/blender/nodes/composite/nodes/node_composite_idMask.c b/source/blender/nodes/composite/nodes/node_composite_idMask.c
index 43f78a90add..ddab415b3be 100644
--- a/source/blender/nodes/composite/nodes/node_composite_idMask.c
+++ b/source/blender/nodes/composite/nodes/node_composite_idMask.c
@@ -99,7 +99,7 @@ static void node_composit_exec_idmask(void *data, bNode *node, bNodeStack **in,
stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */;
- if(rd->scemode & R_FULL_SAMPLE)
+ if((rd->scemode & R_FULL_SAMPLE) || node->custom2 == 0)
do_idmask_fsa(stackbuf, cbuf, (float)node->custom1);
else
do_idmask(stackbuf, cbuf, (float)node->custom1);
diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c
index 6149947233e..c18a35fdd98 100644
--- a/source/blender/nodes/composite/nodes/node_composite_image.c
+++ b/source/blender/nodes/composite/nodes/node_composite_image.c
@@ -74,7 +74,7 @@ static CompBuf *node_composit_get_image(RenderData *rd, Image *ima, ImageUser *i
ibuf= BKE_image_get_ibuf(ima, iuser);
if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) {
- return NULL;
+ return NULL;
}
if (ibuf->rect_float == NULL) {
diff --git a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
index cac2a386801..f7028fbeafd 100644
--- a/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_lummaMatte.c
@@ -52,8 +52,6 @@ static void do_luma_matte(bNode *node, float *out, float *in)
NodeChroma *c=(NodeChroma *)node->storage;
float alpha;
- alpha=0.0;
-
/* test range*/
if(in[0]>c->t1) {
alpha=1.0;
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index 35f2dbf7b32..fa5a3c727c2 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -551,8 +551,8 @@ int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
}
/* delete the group instance. this also removes old input links! */
- nodeFreeNode(ntree, gnode);
-
+ nodeFreeNode(ntree, gnode);
+
/* free the group tree (takes care of user count) */
free_libblock(&G.main->nodetree, wgroup);
@@ -567,7 +567,7 @@ bNodeSocket *node_group_add_socket(bNodeTree *ngroup, const char *name, int type
bNodeSocketType *stype = ntreeGetSocketType(type);
bNodeSocket *gsock = MEM_callocN(sizeof(bNodeSocket), "bNodeSocket");
- strncpy(gsock->name, name, sizeof(gsock->name));
+ BLI_strncpy(gsock->name, name, sizeof(gsock->name));
gsock->type = type;
/* group sockets are dynamically added */
gsock->flag |= SOCK_DYNAMIC;
diff --git a/source/blender/nodes/intern/node_util.h b/source/blender/nodes/intern/node_util.h
index 8d38d57f577..885c48599f8 100644
--- a/source/blender/nodes/intern/node_util.h
+++ b/source/blender/nodes/intern/node_util.h
@@ -66,8 +66,6 @@ const char *node_filter_label(struct bNode *node);
// this is needed for inlining behaviour
#if defined _WIN32
# define DO_INLINE __inline
-#elif defined (__sgi)
-# define DO_INLINE
#elif defined (__sun) || defined (__sun__)
# define DO_INLINE
#else
diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript
index 5cc3f3bedc4..3f47038687a 100644
--- a/source/blender/python/SConscript
+++ b/source/blender/python/SConscript
@@ -17,9 +17,6 @@ defs = []
if is_debug:
defs.append('_DEBUG')
-if env['WITH_BF_INTERNATIONAL']:
- defs.append('INTERNATIONAL')
-
sources = env.Glob('generic/*.c')
env.BlenderLib( libname = 'bf_python_ext', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [363,165]) # ketsji is 360
@@ -43,5 +40,8 @@ if env['WITH_BF_PYTHON_SAFETY']:
if env['BF_BUILDINFO']:
defs.append('BUILD_DATE')
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('WITH_INTERNATIONAL')
+
sources = env.Glob('intern/*.c')
env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361])
diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt
index 0a49036c15d..847a0d19a7f 100644
--- a/source/blender/python/generic/CMakeLists.txt
+++ b/source/blender/python/generic/CMakeLists.txt
@@ -48,8 +48,4 @@ set(SRC
py_capi_utils.h
)
-if(WITH_INTERNATIONAL)
- add_definitions(-DINTERNATIONAL)
-endif()
-
blender_add_lib(bf_python_ext "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c
index 2543d34f58c..e6883eb30af 100644
--- a/source/blender/python/generic/IDProp.c
+++ b/source/blender/python/generic/IDProp.c
@@ -269,7 +269,7 @@ static int idp_sequence_type(PyObject *seq)
PyObject *item;
int type= IDP_INT;
- int i, len = PySequence_Size(seq);
+ Py_ssize_t i, len = PySequence_Size(seq);
for (i=0; i < len; i++) {
item = PySequence_GetItem(seq, i);
if (PyFloat_Check(item)) {
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index 44d42a479ec..35c211d5424 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -286,8 +286,8 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject
Buffer *buffer;
int dimensions[MAX_DIMENSIONS];
- int i, type;
- int ndimensions = 0;
+ int type;
+ Py_ssize_t i, ndimensions = 0;
if(kwds && PyDict_Size(kwds)) {
PyErr_SetString(PyExc_TypeError,
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index 87e4a301eff..b16efdf5a3d 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -31,15 +31,9 @@
#include "blf_py_api.h"
#include "../../blenfont/BLF_api.h"
-#include "../../blenfont/BLF_translation.h"
#include "BLI_utildefines.h"
-#ifdef INTERNATIONAL
-#include "DNA_userdef_types.h" /* is it bad level? */
-#endif
-
-
PyDoc_STRVAR(py_blf_position_doc,
".. function:: position(fontid, x, y, z)\n"
"\n"
@@ -371,33 +365,24 @@ static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args)
return PyLong_FromLong(BLF_load(filename));
}
-PyDoc_STRVAR(py_blf_gettext_doc,
-".. function:: gettext(msgid)\n"
+PyDoc_STRVAR(py_blf_unload_doc,
+".. function:: unload(filename)\n"
"\n"
-" Get a msg in local language.\n"
+" Unload an existing font.\n"
"\n"
-" :arg msgid: the source string.\n"
-" :type msgid: string\n"
-" :return: the localized string.\n"
-" :rtype: string\n"
+" :arg filename: the filename of the font.\n"
+" :type filename: string\n"
);
-static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *value)
+static PyObject *py_blf_unload(PyObject *UNUSED(self), PyObject *args)
{
-#ifdef INTERNATIONAL
- if ((U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE)) {
- const char *msgid= _PyUnicode_AsString(value);
- if(msgid == NULL) {
- PyErr_SetString(PyExc_TypeError, "blf.gettext expects a single string argument");
- return NULL;
- }
-
- return PyUnicode_FromString(BLF_gettext(msgid));
- }
- else
-#endif /* INTERNATIONAL */
- {
- return Py_INCREF(value), value;
- }
+ char* filename;
+
+ if (!PyArg_ParseTuple(args, "s:blf.unload", &filename))
+ return NULL;
+
+ BLF_unload(filename);
+
+ Py_RETURN_NONE;
}
/*----------------------------MODULE INIT-------------------------*/
@@ -415,7 +400,7 @@ static PyMethodDef BLF_methods[] = {
{"shadow_offset", (PyCFunction) py_blf_shadow_offset, METH_VARARGS, py_blf_shadow_offset_doc},
{"size", (PyCFunction) py_blf_size, METH_VARARGS, py_blf_size_doc},
{"load", (PyCFunction) py_blf_load, METH_VARARGS, py_blf_load_doc},
- {"gettext", (PyCFunction) py_blf_gettext, METH_O, py_blf_gettext_doc},
+ {"unload", (PyCFunction) py_blf_unload, METH_VARARGS, py_blf_unload_doc},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 67ed90c79eb..d29bc798399 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -93,7 +93,7 @@ void bpy_import_main_set(struct Main *maggie)
/* returns a dummy filename for a textblock so we can tell what file a text block comes from */
void bpy_text_filename_get(char *fn, size_t fn_len, Text *text)
{
- BLI_snprintf(fn, fn_len, "%s%c%s", text->id.lib ? text->id.lib->filepath : bpy_import_main->name, SEP, text->id.name+2);
+ BLI_snprintf(fn, fn_len, "%s%c%s", ID_BLEND_PATH(bpy_import_main, &text->id), SEP, text->id.name+2);
}
PyObject *bpy_text_import(Text *text)
@@ -120,7 +120,7 @@ PyObject *bpy_text_import(Text *text)
}
len= strlen(text->id.name+2);
- strncpy(modulename, text->id.name+2, len);
+ BLI_strncpy(modulename, text->id.name+2, len);
modulename[len - 3]= '\0'; /* remove .py */
return PyImport_ExecCodeModule(modulename, text->compiled);
}
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index d5bd44fc288..bf14102bb0d 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -107,7 +107,8 @@ int PyC_AsArray(void *array, PyObject *value, const int length, const PyTypeObje
/* for debugging */
-void PyC_ObSpit(const char *name, PyObject *var) {
+void PyC_ObSpit(const char *name, PyObject *var)
+{
fprintf(stderr, "<%s> : ", name);
if (var==NULL) {
fprintf(stderr, "<NIL>");
@@ -126,7 +127,8 @@ void PyC_ObSpit(const char *name, PyObject *var) {
fprintf(stderr, "\n");
}
-void PyC_LineSpit(void) {
+void PyC_LineSpit(void)
+{
const char *filename;
int lineno;
@@ -363,12 +365,15 @@ const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
* chars since blender doesnt limit this */
return result;
}
- else if(PyBytes_Check(py_str)) {
- PyErr_Clear();
- return PyBytes_AS_STRING(py_str);
- }
else {
- return PyBytes_AS_STRING((*coerce= PyUnicode_EncodeFSDefault(py_str)));
+ PyErr_Clear();
+
+ if(PyBytes_Check(py_str)) {
+ return PyBytes_AS_STRING(py_str);
+ }
+ else {
+ return PyBytes_AS_STRING((*coerce= PyUnicode_EncodeFSDefault(py_str)));
+ }
}
}
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index 807074b92ce..9a214718e73 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -99,4 +99,8 @@ if(WITH_CYCLES)
add_definitions(-DWITH_CYCLES)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
+endif()
+
blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c
index b909a0d5f55..cd3d78410f2 100644
--- a/source/blender/python/intern/bpy_app_handlers.c
+++ b/source/blender/python/intern/bpy_app_handlers.c
@@ -40,6 +40,8 @@ void bpy_app_generic_callback(struct Main *main, struct ID *id, void *arg);
static PyTypeObject BlenderAppCbType;
static PyStructSequence_Field app_cb_info_fields[]= {
+ {(char *)"frame_change_pre", NULL},
+ {(char *)"frame_change_post", NULL},
{(char *)"render_pre", NULL},
{(char *)"render_post", NULL},
{(char *)"render_stats", NULL},
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index f3ef55d29c4..319790340ca 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -41,6 +41,9 @@
#include "bpy_driver.h"
+extern void BPY_update_rna_module(void);
+
+
/* for pydrivers (drivers using one-line Python expressions to express relationships between targets) */
PyObject *bpy_pydriver_Dict= NULL;
@@ -164,6 +167,10 @@ float BPY_driver_exec(ChannelDriver *driver)
if(use_gil)
gilstate= PyGILState_Ensure();
+ /* needed since drivers are updated directly after undo where 'main' is
+ * re-allocated [#28807] */
+ BPY_update_rna_module();
+
/* init global dictionary for py-driver evaluation settings */
if (!bpy_pydriver_Dict) {
if (bpy_pydriver_create_dict() != 0) {
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 7327679cc7e..dedc5df1f1c 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -408,12 +408,51 @@ static PyObject *pyop_getrna(PyObject *UNUSED(self), PyObject *value)
return (PyObject *)pyrna;
}
+static PyObject *pyop_getinstance(PyObject *UNUSED(self), PyObject *value)
+{
+ wmOperatorType *ot;
+ wmOperator *op;
+ PointerRNA ptr;
+ char *opname= _PyUnicode_AsString(value);
+ BPy_StructRNA *pyrna= NULL;
+
+ if(opname==NULL) {
+ PyErr_SetString(PyExc_TypeError, "_bpy.ops.get_instance() expects a string argument");
+ return NULL;
+ }
+ ot= WM_operatortype_find(opname, TRUE);
+ if(ot==NULL) {
+ PyErr_Format(PyExc_KeyError, "_bpy.ops.get_instance(\"%s\") not found", opname);
+ return NULL;
+ }
+
+#ifdef PYRNA_FREE_SUPPORT
+ op= MEM_callocN(sizeof(wmOperator), __func__);
+#else
+ op= PyMem_MALLOC(sizeof(wmOperator));
+ memset(op, 0, sizeof(wmOperator));
+#endif
+ BLI_strncpy(op->idname, op->idname, sizeof(op->idname)); /* incase its needed */
+ op->type= ot;
+
+ RNA_pointer_create(NULL, &RNA_Operator, op, &ptr);
+
+ pyrna= (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr);
+#ifdef PYRNA_FREE_SUPPORT
+ pyrna->freeptr= TRUE;
+#endif
+ op->ptr= &pyrna->ptr;
+
+ return (PyObject *)pyrna;
+}
+
static struct PyMethodDef bpy_ops_methods[]= {
{"poll", (PyCFunction) pyop_poll, METH_VARARGS, NULL},
{"call", (PyCFunction) pyop_call, METH_VARARGS, NULL},
{"as_string", (PyCFunction) pyop_as_string, METH_VARARGS, NULL},
{"dir", (PyCFunction) pyop_dir, METH_NOARGS, NULL},
- {"get_rna", (PyCFunction) pyop_getrna, METH_O, NULL},
+ {"get_rna", (PyCFunction) pyop_getrna, METH_O, NULL}, /* only for introspection, leaks memory */
+ {"get_instance", (PyCFunction) pyop_getinstance, METH_O, NULL}, /* only for introspection, leaks memory */
{"macro_define", (PyCFunction) PYOP_wrap_macro_define, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index de29cb2aeac..b5ded8b3a65 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -125,7 +125,7 @@ PyObject *PYOP_wrap_macro_define(PyObject *UNUSED(self), PyObject *args)
otmacro= WM_operatortype_macro_define(ot, opname);
- RNA_pointer_create(NULL, &RNA_OperatorTypeMacro, otmacro, &ptr_otmacro);
+ RNA_pointer_create(NULL, &RNA_OperatorMacro, otmacro, &ptr_otmacro);
return pyrna_struct_CreatePyObject(&ptr_otmacro);
}
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 5da142aeea7..5c668590dff 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -56,13 +56,13 @@ extern BPy_StructRNA *bpy_context_module;
static EnumPropertyItem property_flag_items[]= {
{PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""},
- {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""},
+ {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""},
{PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem property_flag_enum_items[]= {
{PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""},
- {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""},
+ {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""},
{PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""},
{PROP_ENUM_FLAG, "ENUM_FLAG", 0, "Enum Flag", ""},
{0, NULL, 0, NULL, NULL}};
@@ -72,6 +72,7 @@ static EnumPropertyItem property_subtype_string_items[]= {
{PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""},
{PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""},
{PROP_FILENAME, "FILENAME", 0, "Filename", ""},
+ {PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
{PROP_NONE, "NONE", 0, "None", ""},
{0, NULL, 0, NULL, NULL}};
@@ -266,6 +267,18 @@ static int bpy_prop_callback_assign(struct PropertyRNA *prop, PyObject *update_c
return 0;
}
+/* utility function we need for parsing int's in an if statement */
+static int py_long_as_int(PyObject *py_long, int *r_int)
+{
+ if(PyLong_CheckExact(py_long)) {
+ *r_int= (int)PyLong_AS_LONG(py_long);
+ return 0;
+ }
+ else {
+ return -1;
+ }
+}
+
/* this define runs at the start of each function and deals with
* returning a deferred property (to be registered later) */
#define BPY_PROPDEF_HEAD(_func) \
@@ -913,6 +926,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
for(i=0; i<seq_len; i++) {
EnumPropertyItem tmp= {0, "", 0, "", ""};
+ Py_ssize_t item_size;
Py_ssize_t id_str_size;
Py_ssize_t name_str_size;
Py_ssize_t desc_str_size;
@@ -920,13 +934,17 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
item= PySequence_Fast_GET_ITEM(seq_fast, i);
if( (PyTuple_CheckExact(item)) &&
- (PyTuple_GET_SIZE(item) == 3) &&
+ (item_size= PyTuple_GET_SIZE(item)) &&
+ (item_size == 3 || item_size == 4) &&
(tmp.identifier= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
(tmp.name= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
- (tmp.description= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size))
+ (tmp.description= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
+ (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1) /* TODO, number isnt ensured to be unique from the script author */
) {
if(is_enum_flag) {
- tmp.value= 1<<i;
+ if(item_size < 4) {
+ tmp.value= 1<<i;
+ }
if(def && PySet_Contains(def, PyTuple_GET_ITEM(item, 0))) {
*defvalue |= tmp.value;
@@ -934,7 +952,9 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
}
}
else {
- tmp.value= i;
+ if(item_size < 4) {
+ tmp.value= i;
+ }
if(def && def_used == 0 && strcmp(def_cmp, tmp.identifier)==0) {
*defvalue= tmp.value;
@@ -949,7 +969,10 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
}
else {
MEM_freeN(items);
- PyErr_SetString(PyExc_TypeError, "EnumProperty(...): expected an tuple containing (identifier, name description)");
+ PyErr_SetString(PyExc_TypeError,
+ "EnumProperty(...): expected an tuple containing "
+ "(identifier, name description) and optionally a "
+ "unique number");
return NULL;
}
@@ -972,7 +995,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
PyErr_Format(PyExc_TypeError,
"EnumProperty(..., default=\'%s\'): not found in enum members",
- def);
+ def_cmp);
return NULL;
}
}
@@ -1080,8 +1103,9 @@ BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE', 'ENUM_FLAG'].\n"
" :type options: set\n"
" :arg items: sequence of enum items formatted:\n"
-" [(identifier, name, description), ...] where the identifier is used\n"
+" [(identifier, name, description, number), ...] where the identifier is used\n"
" for python access and other values are used for the interface.\n"
+" Note the item is optional.\n"
" For dynamic values a callback can be passed which returns a list in\n"
" the same format as the static list.\n"
" This function must take 2 arguments (self, context)\n"
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index a63cee4e505..ba7e2d41e69 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -73,6 +73,10 @@
#include "../generic/IDProp.h" /* for IDprop lookups */
#include "../generic/py_capi_utils.h"
+#ifdef WITH_INTERNATIONAL
+#include "UI_interface.h" /* bad level call into editors */
+#endif
+
#define USE_PEDANTIC_WRITE
#define USE_MATHUTILS
#define USE_STRING_COERCE
@@ -80,6 +84,11 @@
static PyObject* pyrna_struct_Subtype(PointerRNA *ptr);
static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self);
+#define BPY_DOC_ID_PROP_TYPE_NOTE \
+" .. note:: Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and \n" \
+" :class:`bpy.types.PoseBone` classes support custom properties.\n"
+
+
int pyrna_struct_validity_check(BPy_StructRNA *pysrna)
{
if(pysrna->ptr.type)
@@ -366,7 +375,7 @@ static int mathutils_rna_generic_check(BaseMathObject *bmo)
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
return self->prop ? 0 : -1;
}
@@ -375,7 +384,7 @@ static int mathutils_rna_vector_get(BaseMathObject *bmo, int subtype)
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
if(self->prop==NULL)
return -1;
@@ -397,7 +406,7 @@ static int mathutils_rna_vector_set(BaseMathObject *bmo, int subtype)
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
float min, max;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
if(self->prop==NULL)
return -1;
@@ -448,7 +457,7 @@ static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int UNUSED(subtyp
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
if(self->prop==NULL)
return -1;
@@ -461,7 +470,7 @@ static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int UNUSED(subtyp
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
if(self->prop==NULL)
return -1;
@@ -505,7 +514,7 @@ static int mathutils_rna_matrix_get(BaseMathObject *bmo, int UNUSED(subtype))
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
if(self->prop==NULL)
return -1;
@@ -518,7 +527,7 @@ static int mathutils_rna_matrix_set(BaseMathObject *bmo, int UNUSED(subtype))
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
if(self->prop==NULL)
return -1;
@@ -859,7 +868,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
char type_fmt[64]= "";
int type;
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
type= RNA_property_type(self->prop);
@@ -922,7 +931,7 @@ static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self)
PyObject *ret;
const char *path;
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
if(id == NULL)
return pyrna_prop_str(self); /* fallback */
@@ -1519,6 +1528,12 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
}
else {
param= _PyUnicode_AsString(value);
+#ifdef WITH_INTERNATIONAL
+ if(subtype == PROP_TRANSLATE) {
+ param= UI_translate_do_iface(param);
+ }
+#endif // WITH_INTERNATIONAL
+
}
#else // USE_STRING_COERCE
param= _PyUnicode_AsString(value);
@@ -1708,7 +1723,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
}
case PROP_COLLECTION:
{
- int seq_len, i;
+ Py_ssize_t seq_len, i;
PyObject *item;
PointerRNA itemptr;
ListBase *lb;
@@ -1726,7 +1741,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
}
seq_len= PySequence_Size(value);
- for(i=0; i<seq_len; i++) {
+ for(i=0; i < seq_len; i++) {
item= PySequence_GetItem(value, i);
if(item==NULL) {
@@ -1795,7 +1810,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
static PyObject *pyrna_prop_array_to_py_index(BPy_PropertyArrayRNA *self, int index)
{
- PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self)
+ PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self);
return pyrna_py_from_array_index(self, &self->ptr, self->prop, index);
}
@@ -1874,7 +1889,7 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P
//---------------sequence-------------------------------------------
static Py_ssize_t pyrna_prop_array_length(BPy_PropertyArrayRNA *self)
{
- PYRNA_PROP_CHECK_INT((BPy_PropertyRNA *)self)
+ PYRNA_PROP_CHECK_INT((BPy_PropertyRNA *)self);
if (RNA_property_array_dimension(&self->ptr, self->prop, NULL) > 1)
return RNA_property_multi_array_length(&self->ptr, self->prop, self->arraydim);
@@ -1884,7 +1899,7 @@ static Py_ssize_t pyrna_prop_array_length(BPy_PropertyArrayRNA *self)
static Py_ssize_t pyrna_prop_collection_length(BPy_PropertyRNA *self)
{
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
return RNA_property_collection_length(&self->ptr, self->prop);
}
@@ -1893,7 +1908,7 @@ static Py_ssize_t pyrna_prop_collection_length(BPy_PropertyRNA *self)
* of 1000's of items in a linked list for eg. */
static int pyrna_prop_array_bool(BPy_PropertyRNA *self)
{
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
return RNA_property_array_length(&self->ptr, self->prop) ? 1 : 0;
}
@@ -1904,7 +1919,7 @@ static int pyrna_prop_collection_bool(BPy_PropertyRNA *self)
CollectionPropertyIterator iter;
int test;
- PYRNA_PROP_CHECK_INT(self)
+ PYRNA_PROP_CHECK_INT(self);
RNA_property_collection_begin(&self->ptr, self->prop, &iter);
test= iter.valid;
@@ -1912,25 +1927,30 @@ static int pyrna_prop_collection_bool(BPy_PropertyRNA *self)
return test;
}
+
+/* notice getting the length of the collection is avoided unless negative
+ * index is used or to detect internal error with a valid index.
+ * This is done for faster lookups. */
+#define PYRNA_PROP_COLLECTION_ABS_INDEX(ret_err) \
+ if(keynum < 0) { \
+ keynum_abs += RNA_property_collection_length(&self->ptr, self->prop); \
+ if(keynum_abs < 0) { \
+ PyErr_Format(PyExc_IndexError, \
+ "bpy_prop_collection[%d]: out of range.", keynum); \
+ return ret_err; \
+ } \
+ } \
+
+
/* internal use only */
static PyObject *pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_ssize_t keynum)
{
PointerRNA newptr;
Py_ssize_t keynum_abs= keynum;
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
- /* notice getting the length of the collection is avoided unless negative index is used
- * or to detect internal error with a valid index.
- * This is done for faster lookups. */
- if(keynum < 0) {
- keynum_abs += RNA_property_collection_length(&self->ptr, self->prop);
-
- if(keynum_abs < 0) {
- PyErr_Format(PyExc_IndexError, "bpy_prop_collection[%d]: out of range.", keynum);
- return NULL;
- }
- }
+ PYRNA_PROP_COLLECTION_ABS_INDEX(NULL);
if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum_abs, &newptr)) {
return pyrna_struct_CreatePyObject(&newptr);
@@ -1953,11 +1973,40 @@ static PyObject *pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_s
}
}
+/* values type must have been already checked */
+static int pyrna_prop_collection_ass_subscript_int(BPy_PropertyRNA *self, Py_ssize_t keynum, PyObject *value)
+{
+ Py_ssize_t keynum_abs= keynum;
+ const PointerRNA *ptr= (value == Py_None) ? (&PointerRNA_NULL) : &((BPy_StructRNA *)value)->ptr;
+
+ PYRNA_PROP_CHECK_INT(self);
+
+ PYRNA_PROP_COLLECTION_ABS_INDEX(-1);
+
+ if(RNA_property_collection_assign_int(&self->ptr, self->prop, keynum_abs, ptr) == 0) {
+ const int len= RNA_property_collection_length(&self->ptr, self->prop);
+ if(keynum_abs >= len) {
+ PyErr_Format(PyExc_IndexError,
+ "bpy_prop_collection[index] = value: "
+ "index %d out of range, size %d", keynum, len);
+ }
+ else {
+
+ PyErr_Format(PyExc_IndexError,
+ "bpy_prop_collection[index] = value: "
+ "failed assignment (unknown reason)", keynum);
+ }
+ return -1;
+ }
+
+ return 0;
+}
+
static PyObject *pyrna_prop_array_subscript_int(BPy_PropertyArrayRNA *self, int keynum)
{
int len;
- PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self)
+ PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self);
len= pyrna_prop_array_length(self);
@@ -1974,7 +2023,7 @@ static PyObject *pyrna_prop_collection_subscript_str(BPy_PropertyRNA *self, cons
{
PointerRNA newptr;
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
if(RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr))
return pyrna_struct_CreatePyObject(&newptr);
@@ -1992,7 +2041,7 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py
PyObject *list;
PyObject *item;
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
list= PyList_New(0);
@@ -2031,11 +2080,11 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
int count, totdim;
PyObject *tuple;
- PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self)
+ PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self);
tuple= PyTuple_New(stop - start);
- /* PYRNA_PROP_CHECK_OBJ(self) isn't needed, internal use only */
+ /* PYRNA_PROP_CHECK_OBJ(self); isn't needed, internal use only */
totdim= RNA_property_array_dimension(ptr, prop, NULL);
@@ -2106,7 +2155,7 @@ static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, Po
static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject *key)
{
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
if (PyUnicode_Check(key)) {
return pyrna_prop_collection_subscript_str(self, _PyUnicode_AsString(key));
@@ -2163,9 +2212,131 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject
}
}
+/* generic check to see if a PyObject is compatible with a collection
+ * -1 on failier, 0 on success, sets the error */
+static int pyrna_prop_collection_type_check(BPy_PropertyRNA *self, PyObject *value)
+{
+ StructRNA *prop_srna;
+
+ if(value == Py_None) {
+ if (RNA_property_flag(self->prop) & PROP_NEVER_NULL) {
+ PyErr_Format(PyExc_TypeError,
+ "bpy_prop_collection[key] = value: invalid, "
+ "this collection doesnt support None assignment");
+ return -1;
+ }
+ else {
+ return 0; /* None is OK */
+ }
+ }
+ else if (BPy_StructRNA_Check(value) == 0) {
+ PyErr_Format(PyExc_TypeError,
+ "bpy_prop_collection[key] = value: invalid, "
+ "expected a StructRNA type or None, not a %.200s",
+ Py_TYPE(value)->tp_name);
+ return -1;
+ }
+ else if((prop_srna= RNA_property_pointer_type(&self->ptr, self->prop))) {
+ StructRNA *value_srna= ((BPy_StructRNA *)value)->ptr.type;
+ if (RNA_struct_is_a(value_srna, prop_srna) == 0) {
+ PyErr_Format(PyExc_TypeError,
+ "bpy_prop_collection[key] = value: invalid, "
+ "expected a '%.200s' type or None, not a '%.200s'",
+ RNA_struct_identifier(prop_srna),
+ RNA_struct_identifier(value_srna)
+ );
+ return -1;
+ }
+ else {
+ return 0; /* OK, this is the correct type!*/
+ }
+ }
+
+ PyErr_Format(PyExc_TypeError,
+ "bpy_prop_collection[key] = value: internal error, "
+ "failed to get the collection type");
+ return -1;
+}
+
+/* note: currently this is a copy of 'pyrna_prop_collection_subscript' with
+ * large blocks commented, we may support slice/key indicies later */
+static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *key, PyObject *value)
+{
+ PYRNA_PROP_CHECK_INT(self);
+
+ /* validate the assigned value */
+ if(value == NULL) {
+ PyErr_SetString(PyExc_TypeError,
+ "del bpy_prop_collection[key]: not supported");
+ return -1;
+ }
+ else if (pyrna_prop_collection_type_check(self, value) == -1) {
+ return -1; /* exception is set */
+ }
+
+#if 0
+ if (PyUnicode_Check(key)) {
+ return pyrna_prop_collection_subscript_str(self, _PyUnicode_AsString(key));
+ }
+ else
+#endif
+ if (PyIndex_Check(key)) {
+ Py_ssize_t i= PyNumber_AsSsize_t(key, PyExc_IndexError);
+ if (i == -1 && PyErr_Occurred())
+ return -1;
+
+ return pyrna_prop_collection_ass_subscript_int(self, i, value);
+ }
+#if 0 /* TODO, fake slice assignment */
+ else if (PySlice_Check(key)) {
+ PySliceObject *key_slice= (PySliceObject *)key;
+ Py_ssize_t step= 1;
+
+ if(key_slice->step != Py_None && !_PyEval_SliceIndex(key, &step)) {
+ return NULL;
+ }
+ else if (step != 1) {
+ PyErr_SetString(PyExc_TypeError, "bpy_prop_collection[slice]: slice steps not supported");
+ return NULL;
+ }
+ else if(key_slice->start == Py_None && key_slice->stop == Py_None) {
+ return pyrna_prop_collection_subscript_slice(self, 0, PY_SSIZE_T_MAX);
+ }
+ else {
+ Py_ssize_t start= 0, stop= PY_SSIZE_T_MAX;
+
+ /* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */
+ if(key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) return NULL;
+ if(key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) return NULL;
+
+ if(start < 0 || stop < 0) {
+ /* only get the length for negative values */
+ Py_ssize_t len= (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop);
+ if(start < 0) start += len;
+ if(stop < 0) start += len;
+ }
+
+ if (stop - start <= 0) {
+ return PyList_New(0);
+ }
+ else {
+ return pyrna_prop_collection_subscript_slice(self, start, stop);
+ }
+ }
+ }
+#endif
+ else {
+ PyErr_Format(PyExc_TypeError,
+ "bpy_prop_collection[key]: invalid key, "
+ "must be a string or an int, not %.200s",
+ Py_TYPE(key)->tp_name);
+ return -1;
+ }
+}
+
static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject *key)
{
- PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self)
+ PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self);
/*if (PyUnicode_Check(key)) {
return pyrna_prop_array_subscript_str(self, _PyUnicode_AsString(key));
@@ -2321,7 +2492,7 @@ static int prop_subscript_ass_array_int(BPy_PropertyArrayRNA *self, Py_ssize_t k
{
int len;
- PYRNA_PROP_CHECK_INT((BPy_PropertyRNA *)self)
+ PYRNA_PROP_CHECK_INT((BPy_PropertyRNA *)self);
len= pyrna_prop_array_length(self);
@@ -2399,7 +2570,7 @@ static PyMappingMethods pyrna_prop_array_as_mapping= {
static PyMappingMethods pyrna_prop_collection_as_mapping= {
(lenfunc) pyrna_prop_collection_length, /* mp_length */
(binaryfunc) pyrna_prop_collection_subscript, /* mp_subscript */
- (objobjargproc) NULL, /* mp_ass_subscript */
+ (objobjargproc) pyrna_prop_collection_ass_subscript, /* mp_ass_subscript */
};
/* only for fast bool's, large structs, assign nb_bool on init */
@@ -2456,7 +2627,7 @@ static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value)
IDProperty *group;
const char *name= _PyUnicode_AsString(value);
- PYRNA_STRUCT_CHECK_INT(self)
+ PYRNA_STRUCT_CHECK_INT(self);
if (!name) {
PyErr_SetString(PyExc_TypeError, "bpy_struct.__contains__: expected a string");
@@ -2495,7 +2666,7 @@ static PySequenceMethods pyrna_prop_collection_as_sequence= {
NULL, /* sq_repeat */
(ssizeargfunc)pyrna_prop_collection_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
NULL, /* *was* sq_slice */
- NULL, /* sq_ass_item */
+ (ssizeobjargproc)/* pyrna_prop_collection_ass_subscript_int */ NULL /* let mapping take this one */, /* sq_ass_item */
NULL, /* *was* sq_ass_slice */
(objobjproc)pyrna_prop_collection_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
@@ -2521,7 +2692,7 @@ static PyObject *pyrna_struct_subscript(BPy_StructRNA *self, PyObject *key)
IDProperty *group, *idprop;
const char *name= _PyUnicode_AsString(key);
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if(RNA_struct_idprops_check(self->ptr.type)==0) {
PyErr_SetString(PyExc_TypeError, "this type doesn't support IDProperties");
@@ -2554,7 +2725,7 @@ static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObje
{
IDProperty *group;
- PYRNA_STRUCT_CHECK_INT(self)
+ PYRNA_STRUCT_CHECK_INT(self);
group= RNA_struct_idprops(&self->ptr, 1);
@@ -2587,8 +2758,7 @@ PyDoc_STRVAR(pyrna_struct_keys_doc,
" :return: custom property keys.\n"
" :rtype: list of strings\n"
"\n"
-" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone` classes\n"
-" support custom properties.\n"
+BPY_DOC_ID_PROP_TYPE_NOTE
);
static PyObject *pyrna_struct_keys(BPy_PropertyRNA *self)
{
@@ -2616,8 +2786,7 @@ PyDoc_STRVAR(pyrna_struct_items_doc,
" :return: custom property key, value pairs.\n"
" :rtype: list of key, value tuples\n"
"\n"
-" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n"
-" classes support custom properties.\n"
+BPY_DOC_ID_PROP_TYPE_NOTE
);
static PyObject *pyrna_struct_items(BPy_PropertyRNA *self)
{
@@ -2645,8 +2814,7 @@ PyDoc_STRVAR(pyrna_struct_values_doc,
" :return: custom property values.\n"
" :rtype: list\n"
"\n"
-" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n"
-" classes support custom properties.\n"
+BPY_DOC_ID_PROP_TYPE_NOTE
);
static PyObject *pyrna_struct_values(BPy_PropertyRNA *self)
{
@@ -2680,7 +2848,7 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg
const char *name;
int ret;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s:is_property_set", &name))
return NULL;
@@ -2723,7 +2891,7 @@ static PyObject *pyrna_struct_is_property_hidden(BPy_StructRNA *self, PyObject *
PropertyRNA *prop;
const char *name;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s:is_property_hidden", &name))
return NULL;
@@ -2757,7 +2925,7 @@ static PyObject *pyrna_struct_path_resolve(BPy_StructRNA *self, PyObject *args)
PropertyRNA *r_prop;
int index= -1;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s|O!:path_resolve", &path, &PyBool_Type, &coerce))
return NULL;
@@ -2815,7 +2983,7 @@ static PyObject *pyrna_struct_path_from_id(BPy_StructRNA *self, PyObject *args)
PropertyRNA *prop;
PyObject *ret;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "|s:path_from_id", &name))
return NULL;
@@ -2897,7 +3065,7 @@ static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self)
{
PointerRNA r_ptr;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
RNA_pointer_recast(&self->ptr, &r_ptr);
return pyrna_struct_CreatePyObject(&r_ptr);
@@ -2978,7 +3146,7 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA *self)
PyObject *ret;
PyObject *pystring;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
/* Include this incase this instance is a subtype of a python class
* In these instances we may want to return a function or variable provided by the subtype
@@ -3025,7 +3193,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
PropertyRNA *prop;
FunctionRNA *func;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if(name == NULL) {
PyErr_SetString(PyExc_AttributeError, "bpy_struct: __getattr__ must be a string");
@@ -3246,7 +3414,7 @@ static int pyrna_struct_setattro(BPy_StructRNA *self, PyObject *pyname, PyObject
const char *name= _PyUnicode_AsString(pyname);
PropertyRNA *prop= NULL;
- PYRNA_STRUCT_CHECK_INT(self)
+ PYRNA_STRUCT_CHECK_INT(self);
#ifdef USE_PEDANTIC_WRITE
if(rna_disallow_writes && rna_id_write_error(&self->ptr, pyname)) {
@@ -3496,18 +3664,28 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self)
Py_RETURN_NONE;
}
+static PyObject *pyrna_struct_get_rna_type(BPy_PropertyRNA *self)
+{
+ PointerRNA tptr;
+ RNA_pointer_create(NULL, &RNA_Property, self->prop, &tptr);
+ return pyrna_struct_Subtype(&tptr);
+}
+
+
+
/*****************************************************************************/
/* Python attributes get/set structure: */
/*****************************************************************************/
static PyGetSetDef pyrna_prop_getseters[]= {
- {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL},
+ {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL},
+ {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)"The property type for introspection", NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef pyrna_struct_getseters[]= {
- {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL},
+ {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)", NULL},
{NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -3614,8 +3792,7 @@ PyDoc_STRVAR(pyrna_struct_get_doc,
" *key* is not found.\n"
" :type default: Undefined\n"
"\n"
-" .. note:: Only :class:`ID`, :class:`Bone` and :class:`PoseBone`\n"
-" classes support custom properties.\n"
+BPY_DOC_ID_PROP_TYPE_NOTE
);
static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
{
@@ -3624,7 +3801,7 @@ static PyObject *pyrna_struct_get(BPy_StructRNA *self, PyObject *args)
const char *key;
PyObject* def= Py_None;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
return NULL;
@@ -3681,7 +3858,7 @@ static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args
const char *key;
PyObject* def= Py_None;
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s|O:get", &key, &def))
return NULL;
@@ -3954,7 +4131,7 @@ PyDoc_STRVAR(pyrna_prop_collection_foreach_get_doc,
);
static PyObject *pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObject *args)
{
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
return foreach_getset(self, args, 0);
}
@@ -3974,7 +4151,7 @@ PyDoc_STRVAR(pyrna_prop_collection_foreach_set_doc,
);
static PyObject *pyrna_prop_collection_foreach_set(BPy_PropertyRNA *self, PyObject *args)
{
- PYRNA_PROP_CHECK_OBJ(self)
+ PYRNA_PROP_CHECK_OBJ(self);
return foreach_getset(self, args, 1);
}
@@ -3988,7 +4165,7 @@ static PyObject *pyrna_prop_array_iter(BPy_PropertyArrayRNA *self)
PyObject *iter= NULL;
int len;
- PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self)
+ PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self);
len= pyrna_prop_array_length(self);
ret= pyrna_prop_array_subscript_slice(self, &self->ptr, self->prop, 0, len, len);
@@ -4130,8 +4307,8 @@ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *
/* only needed for subtyping, so a new class gets a valid BPy_StructRNA
* todo - also accept useful args */
-static PyObject *pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) {
-
+static PyObject *pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
+{
BPy_PropertyRNA *base;
if (!PyArg_ParseTuple(args, "O!:bpy_prop.__new__", &pyrna_prop_Type, &base))
@@ -4696,7 +4873,11 @@ PyTypeObject pyrna_struct_meta_idprop_Type= {
NULL, /* struct PyMethodDef *tp_methods; */
NULL, /* struct PyMemberDef *tp_members; */
NULL, /* struct PyGetSetDef *tp_getset; */
- NULL, /* struct _typeobject *tp_base; */
+#if defined(_MSC_VER) || defined(FREE_WINDOWS)
+ NULL, /* defer assignment */
+#else
+ &PyType_Type, /* struct _typeobject *tp_base; */
+#endif
NULL, /* PyObject *tp_dict; */
NULL, /* descrgetfunc tp_descr_get; */
NULL, /* descrsetfunc tp_descr_set; */
@@ -5267,7 +5448,11 @@ PyTypeObject pyrna_prop_collection_iter_Type= {
NULL, /* reprfunc tp_str; */
/* will only use these if this is a subtype of a py class */
+#if defined(_MSC_VER) || defined(FREE_WINDOWS)
+ NULL, /* defer assignment */
+#else
PyObject_GenericGetAttr, /* getattrofunc tp_getattro; */
+#endif
NULL, /* setattrofunc tp_setattro; */
/* Functions to access object as input/output buffer */
@@ -5296,7 +5481,11 @@ PyTypeObject pyrna_prop_collection_iter_Type= {
#endif
/*** Added in release 2.2 ***/
/* Iterators */
+#if defined(_MSC_VER) || defined(FREE_WINDOWS)
+ NULL, /* defer assignment */
+#else
PyObject_SelfIter, /* getiterfunc tp_iter; */
+#endif
(iternextfunc) pyrna_prop_collection_iter_next, /* iternextfunc tp_iternext; */
/*** Attribute descriptor and subclassing stuff ***/
@@ -5682,8 +5871,15 @@ void BPY_rna_init(void)
mathutils_rna_matrix_cb_index= Mathutils_RegisterCallback(&mathutils_rna_matrix_cb);
#endif
- /* metaclass */
+ /* for some reason MSVC complains of these */
+#if defined(_MSC_VER) || defined(FREE_WINDOWS)
pyrna_struct_meta_idprop_Type.tp_base= &PyType_Type;
+
+ pyrna_prop_collection_iter_Type.tp_iter= PyObject_SelfIter;
+ pyrna_prop_collection_iter_Type.tp_getattro= PyObject_GenericGetAttr;
+#endif
+
+ /* metaclass */
if(PyType_Ready(&pyrna_struct_meta_idprop_Type) < 0)
return;
@@ -5728,7 +5924,11 @@ PyObject *BPY_rna_module(void)
void BPY_update_rna_module(void)
{
+#if 0
RNA_main_pointer_create(G.main, rna_module_ptr);
+#else
+ rna_module_ptr->data= G.main; /* just set data is enough */
+#endif
}
#if 0
@@ -6228,7 +6428,11 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
ParameterIterator iter;
PointerRNA funcptr;
int err= 0, i, flag, ret_len=0;
- int is_static= RNA_function_flag(func) & FUNC_NO_SELF;
+ const char is_static= (RNA_function_flag(func) & FUNC_NO_SELF) != 0;
+
+ /* annoying!, need to check if the screen gets set to NULL which is a
+ * hint that the file was actually re-loaded. */
+ char is_valid_wm;
PropertyRNA *pret_single= NULL;
void *retdata_single= NULL;
@@ -6255,6 +6459,8 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
if(C==NULL)
C= BPy_GetContext();
+ is_valid_wm= (CTX_wm_manager(C) != NULL);
+
bpy_context_set(C, &gilstate);
if (!is_static) {
@@ -6488,7 +6694,11 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
if(err != 0) {
ReportList *reports;
/* alert the user, else they wont know unless they see the console. */
- if (!is_static && ptr->data && RNA_struct_is_a(ptr->type, &RNA_Operator)) {
+ if ( (!is_static) &&
+ (ptr->data) &&
+ (RNA_struct_is_a(ptr->type, &RNA_Operator)) &&
+ (is_valid_wm == (CTX_wm_manager(C) != NULL)))
+ {
wmOperator *op= ptr->data;
reports= op->reports;
}
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index 30f6c02115a..502fa25c872 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -44,9 +44,6 @@
/* support for inter references, currently only needed for corner case */
#define USE_PYRNA_STRUCT_REFERENCE
-/* use real collection iterators rather than faking with a list */
-#define USE_PYRNA_ITER
-
#else /* WITH_PYTHON_SAFETY */
/* default, no defines! */
@@ -67,6 +64,11 @@
* so prefer the leak to the memory bloat for now. */
// #define PYRNA_FREE_SUPPORT
+/* use real collection iterators rather than faking with a list
+ * this is needed so enums can be iterated over without crashing,
+ * since finishing the iteration frees temp allocated enums */
+#define USE_PYRNA_ITER
+
/* --- end bpy build options --- */
struct ID;
diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c
index 8bde1db96ca..c87a141f5bd 100644
--- a/source/blender/python/intern/bpy_rna_anim.c
+++ b/source/blender/python/intern/bpy_rna_anim.c
@@ -189,7 +189,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
float cfra= FLT_MAX;
const char *group_name= NULL;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if(pyrna_struct_keyframe_parse(&self->ptr, args, kw,
"s|ifs:bpy_struct.keyframe_insert()", "bpy_struct.keyframe_insert()",
@@ -237,7 +237,7 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb
float cfra= FLT_MAX;
const char *group_name= NULL;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if(pyrna_struct_keyframe_parse(&self->ptr, args, kw,
"s|ifs:bpy_struct.keyframe_delete()",
@@ -273,14 +273,14 @@ char pyrna_struct_driver_add_doc[] =
" :arg index: array index of the property drive. Defaults to -1 for all indices or a single channel if the property is not an array.\n"
" :type index: int\n"
" :return: The driver(s) added.\n"
-" :rtype: :class:`FCurve` or list if index is -1 with an array property.\n"
+" :rtype: :class:`bpy.types.FCurve` or list if index is -1 with an array property.\n"
;
PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args)
{
const char *path, *path_full;
int index= -1;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s|i:driver_add", &path, &index))
return NULL;
@@ -356,7 +356,7 @@ PyObject *pyrna_struct_driver_remove(BPy_StructRNA *self, PyObject *args)
const char *path, *path_full;
int index= -1;
- PYRNA_STRUCT_CHECK_OBJ(self)
+ PYRNA_STRUCT_CHECK_OBJ(self);
if (!PyArg_ParseTuple(args, "s|i:driver_remove", &path, &index))
return NULL;
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c
index e50ce233671..cab57724d6d 100644
--- a/source/blender/python/intern/bpy_rna_array.c
+++ b/source/blender/python/intern/bpy_rna_array.c
@@ -61,12 +61,12 @@ typedef void (*RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *)
static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[],
ItemTypeCheckFunc check_item_type, const char *item_type_str, const char *error_prefix)
{
- int i;
+ Py_ssize_t i;
/* not the last dimension */
if (dim + 1 < totdim) {
/* check that a sequence contains dimsize[dim] items */
- const int seq_size= PySequence_Size(seq);
+ const Py_ssize_t seq_size= PySequence_Size(seq);
if(seq_size == -1) {
PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not '%s'",
error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
@@ -147,8 +147,8 @@ static int count_items(PyObject *seq, int dim)
int totitem= 0;
if(dim > 1) {
- const int seq_size= PySequence_Size(seq);
- int i;
+ const Py_ssize_t seq_size= PySequence_Size(seq);
+ Py_ssize_t i;
for (i= 0; i < seq_size; i++) {
PyObject *item= PySequence_GetItem(seq, i);
if(item) {
@@ -281,9 +281,9 @@ static char *copy_value_single(PyObject *item, PointerRNA *ptr, PropertyRNA *pro
static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int dim, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index)
{
- unsigned int i;
int totdim= RNA_property_array_dimension(ptr, prop, NULL);
- const int seq_size= PySequence_Size(seq);
+ const Py_ssize_t seq_size= PySequence_Size(seq);
+ Py_ssize_t i;
/* Regarding PySequence_GetItem() failing.
*
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index 50b75b09cb2..9adeae9dc29 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -94,11 +94,11 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *
#if 1 /* approx 6x speedup for mathutils types */
int size;
- if( (VectorObject_Check(value) && (size= ((VectorObject *)value)->size)) ||
- (EulerObject_Check(value) && (size= 3)) ||
- (QuaternionObject_Check(value) && (size= 4)) ||
- (ColorObject_Check(value) && (size= 3))
- ) {
+ if( (size= VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) ||
+ (size= EulerObject_Check(value) ? 3 : 0) ||
+ (size= QuaternionObject_Check(value) ? 4 : 0) ||
+ (size= ColorObject_Check(value) ? 3 : 0))
+ {
if(BaseMath_ReadCallback((BaseMathObject *)value) == -1) {
return -1;
}
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index 947e4425d3f..9d1cfb1948a 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -193,7 +193,7 @@ static PyObject *Quaternion_dot(QuaternionObject *self, PyObject *value)
}
PyDoc_STRVAR(Quaternion_rotation_difference_doc,
-".. function:: difference(other)\n"
+".. function:: rotation_difference(other)\n"
"\n"
" Returns a quaternion representing the rotational difference.\n"
"\n"
diff --git a/source/blender/quicktime/SConscript b/source/blender/quicktime/SConscript
index 24dfab13fd9..a128ded965c 100644
--- a/source/blender/quicktime/SConscript
+++ b/source/blender/quicktime/SConscript
@@ -35,5 +35,6 @@ defs=['WITH_QUICKTIME']
if env['WITH_GHOST_COCOA']:
defs.append('GHOST_COCOA')
-
-env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities)
+ env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities, cc_compilerchange='/usr/bin/gcc-4.2', cxx_compilerchange='/usr/bin/g++-4.2') # always use Apple-gcc-4.2 for objC language, for gnu-compilers do not support it fully yet
+else:
+ env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=defs, libtype=types, priority=priorities)
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 0b339d285ce..6d27c7707f0 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -485,7 +485,6 @@ typedef struct VolPrecachePart
int res[3];
float bbmin[3];
float voxel[3];
- int working, done;
struct Render *re;
} VolPrecachePart;
diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h
index f9486b5d5c0..7f804c9311d 100644
--- a/source/blender/render/intern/include/rendercore.h
+++ b/source/blender/render/intern/include/rendercore.h
@@ -76,12 +76,12 @@ typedef struct PixStrMain
void calc_view_vector(float *view, float x, float y);
-float mistfactor(float zcor, float *co); /* dist and height, return alpha */
+float mistfactor(float zcor, const float co[3]); /* dist and height, return alpha */
-void renderspothalo(struct ShadeInput *shi, float *col, float alpha);
+void renderspothalo(struct ShadeInput *shi, float col[4], float alpha);
void add_halo_flare(Render *re);
-void calc_renderco_zbuf(float co[3], float *view, int z);
+void calc_renderco_zbuf(float co[3], const float view[3], int z);
void calc_renderco_ortho(float co[3], float x, float y, int z);
int count_mask(unsigned short mask);
@@ -103,9 +103,9 @@ extern void freeraytree(Render *re);
extern void makeraytree(Render *re);
struct RayObject* makeraytree_object(Render *re, ObjectInstanceRen *obi);
-extern void ray_shadow(ShadeInput *, LampRen *, float *);
-extern void ray_trace(ShadeInput *, ShadeResult *);
-extern void ray_ao(ShadeInput *, float *, float *);
+extern void ray_shadow(ShadeInput *shi, LampRen *lar, float shadfac[4]);
+extern void ray_trace(ShadeInput *shi, ShadeResult *);
+extern void ray_ao(ShadeInput *shi, float ao[3], float env[3]);
extern void init_jitter_plane(LampRen *lar);
extern void init_ao_sphere(struct World *wrld);
extern void init_render_qmcsampler(Render *re);
diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h
index 91507ef3f98..df5578dad7a 100644
--- a/source/blender/render/intern/include/shading.h
+++ b/source/blender/render/intern/include/shading.h
@@ -96,8 +96,8 @@ void ambient_occlusion(struct ShadeInput *shi);
void environment_lighting_apply(struct ShadeInput *shi, struct ShadeResult *shr);
ListBase *get_lights(struct ShadeInput *shi);
-float lamp_get_visibility(struct LampRen *lar, const float co[3], float *lv, float *dist);
-void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float *shadfac, int do_real);
+float lamp_get_visibility(struct LampRen *lar, const float co[3], float lv[3], float *dist);
+void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float shadfac[4], int do_real);
float fresnel_fac(float *view, float *vn, float fresnel, float fac);
diff --git a/source/blender/render/intern/raytrace/rayobject.cpp b/source/blender/render/intern/raytrace/rayobject.cpp
index dfff35ba51a..550652560be 100644
--- a/source/blender/render/intern/raytrace/rayobject.cpp
+++ b/source/blender/render/intern/raytrace/rayobject.cpp
@@ -441,7 +441,7 @@ int RE_rayobject_intersect(RayObject *r, Isect *i)
}
else {
assert(0);
- return 0;
+ return 0;
}
}
diff --git a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
index 331358f727b..8fc3c938427 100644
--- a/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_qbvh.cpp
@@ -116,8 +116,8 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *min, float *max)
{
//TODO renable hint support
{
- hint->size = 0;
- hint->stack[hint->size++] = (RayObject*)tree->root;
+ hint->size = 0;
+ hint->stack[hint->size++] = (RayObject*)tree->root;
}
}
/* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
diff --git a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
index a99c57ab233..0d1526fba6f 100644
--- a/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_svbvh.cpp
@@ -152,8 +152,8 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *min, float *max)
{
//TODO renable hint support
{
- hint->size = 0;
- hint->stack[hint->size++] = (RayObject*)tree->root;
+ hint->size = 0;
+ hint->stack[hint->size++] = (RayObject*)tree->root;
}
}
/* the cast to pointer function is needed to workarround gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407 */
diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
index 25eada43a4a..620477f1e70 100644
--- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
@@ -154,8 +154,8 @@ void bvh_hint_bb(Tree *tree, LCTSHint *hint, float *min, float *max)
{
//TODO renable hint support
{
- hint->size = 0;
- hint->stack[hint->size++] = (RayObject*)tree->root;
+ hint->size = 0;
+ hint->stack[hint->size++] = (RayObject*)tree->root;
}
}
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index a15662f86f4..0ea0725d05d 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -1349,7 +1349,7 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl
int totsplit = bb->uv_split * bb->uv_split;
int tile, x, y;
/* Tile offsets */
- float uvx = 0.0f, uvy = 0.0f, uvdx = 1.0f, uvdy = 1.0f, time = 0.0f;
+ float uvx = 0.0f, uvy = 0.0f, uvdx = 1.0f, uvdy = 1.0f, time = 0.0f;
vlr= RE_findOrAddVlak(obr, obr->totvlak++);
vlr->v1= RE_findOrAddVert(obr, obr->totvert++);
@@ -4359,9 +4359,9 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset)
/* Database */
/* ------------------------------------------------------------------------- */
-static int render_object_type(int type)
+static int render_object_type(short type)
{
- return ELEM5(type, OB_FONT, OB_CURVE, OB_SURF, OB_MESH, OB_MBALL);
+ return OB_TYPE_SUPPORT_MATERIAL(type);
}
static void find_dupli_instances(Render *re, ObjectRen *obr)
@@ -4852,8 +4852,13 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
* NULL is just for init */
set_dupli_tex_mat(NULL, NULL, NULL);
- for(SETLOOPER(re->scene, sce_iter, base)) {
- ob= base->object;
+ /* loop over all objects rather then using SETLOOPER because we may
+ * reference an mtex-mapped object which isnt rendered or is an
+ * empty in a dupli group. We could scan all render material/lamp/world
+ * mtex's for mapto objects but its easier just to set the
+ * 'imat' / 'imat_ren' on all and unlikely to be a performance hit
+ * See bug: [#28744] - campbell */
+ for(ob= re->main->object.first; ob; ob= ob->id.next) {
/* imat objects has to be done here, since displace can have texture using Object map-input */
mul_m4_m4m4(mat, ob->obmat, re->viewmat);
invert_m4_m4(ob->imat_ren, mat);
@@ -5021,7 +5026,7 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l
/* per second, per object, stats print this */
re->i.infostr= "Preparing Scene data";
re->i.cfra= scene->r.cfra;
- strncpy(re->i.scenename, scene->id.name+2, 20);
+ BLI_strncpy(re->i.scenename, scene->id.name+2, sizeof(re->i.scenename));
/* XXX add test if dbase was filled already? */
@@ -5304,11 +5309,13 @@ static void calculate_speedvector(const float vectors[2], int step, float winsq,
static float *calculate_strandsurface_speedvectors(Render *re, ObjectInstanceRen *obi, StrandSurface *mesh)
{
- float winsq= (float)re->winx*(float)re->winy, winroot= sqrt(winsq), (*winspeed)[4]; /* int's can wrap on large images */
- float ho[4], prevho[4], nextho[4], winmat[4][4], vec[2];
- int a;
-
if(mesh->co && mesh->prevco && mesh->nextco) {
+ float winsq= (float)re->winx*(float)re->winy; /* int's can wrap on large images */
+ float winroot= sqrt(winsq);
+ float (*winspeed)[4];
+ float ho[4], prevho[4], nextho[4], winmat[4][4], vec[2];
+ int a;
+
if(obi->flag & R_TRANSFORMED)
mul_m4_m4m4(winmat, obi->mat, re->winmat);
else
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index e2b3b23b9c9..25895b81dd7 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -689,9 +689,9 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
env->ima= tex->ima;
if(env->ima && env->ima->ok) {
if(env->cube[1]==NULL) {
- ImBuf *ibuf= BKE_image_get_ibuf(env->ima, NULL);
- if(ibuf)
- envmap_split_ima(env, ibuf);
+ ImBuf *ibuf_ima= BKE_image_get_ibuf(env->ima, NULL);
+ if(ibuf_ima)
+ envmap_split_ima(env, ibuf_ima);
else
env->ok= 0;
}
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 234ef821390..e9107c700e8 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -1209,7 +1209,7 @@ Render *RE_NewRender(const char *name)
/* new render data struct */
re= MEM_callocN(sizeof(Render), "new render");
BLI_addtail(&RenderGlobal.renderlist, re);
- strncpy(re->name, name, RE_MAXNAME);
+ BLI_strncpy(re->name, name, RE_MAXNAME);
BLI_rw_mutex_init(&re->resultmutex);
}
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index 5c5162d268b..93038984115 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -226,8 +226,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
}
/* shadow */
- if(i> -0.41f) { /* heuristic valua! */
- shadfac= 1.0;
+ if(i> -0.41f) { /* heuristic valua! */
if(lar->shb) {
shadfac = testshadowbuf(&R, lar->shb, rco, dco, dco, inp, 0.0f);
if(shadfac==0.0f) continue;
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index e82e969d502..8fa90a51442 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -334,7 +334,6 @@ static void makeraytree_single(Render *re)
for(obi=re->instancetable.first; obi; obi=obi->next)
if(is_raytraceable(re, obi))
{
- int v;
ObjectRen *obr = obi->obr;
obs++;
@@ -344,6 +343,7 @@ static void makeraytree_single(Render *re)
}
else
{
+ int v;
for(v=0;v<obr->totvlak;v++)
{
VlakRen *vlr = obr->vlaknodes[v>>8].vlak + (v&255);
@@ -539,7 +539,7 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
VlakRen *vlr= (VlakRen*)is->hit.face;
/* set up view vector */
- VECCOPY(shi->view, is->dir);
+ copy_v3_v3(shi->view, is->dir);
/* render co */
shi->co[0]= is->start[0]+is->dist*(shi->view[0]);
@@ -594,16 +594,16 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
}
/* raytrace likes to separate the spec color */
- VECSUB(shr->diff, shr->combined, shr->spec);
+ sub_v3_v3v3(shr->diff, shr->combined, shr->spec);
}
}
-static int refraction(float *refract, float *n, float *view, float index)
+static int refraction(float refract[3], const float n[3], const float view[3], float index)
{
float dot, fac;
- VECCOPY(refract, view);
+ copy_v3_v3(refract, view);
dot= view[0]*n[0] + view[1]*n[1] + view[2]*n[2];
@@ -626,26 +626,26 @@ static int refraction(float *refract, float *n, float *view, float index)
return 1;
}
+static void reflection_simple(float ref[3], float n[3], const float view[3])
+{
+ const float f1= -2.0f * dot_v3v3(n, view);
+ madd_v3_v3v3fl(ref, view, n, f1);
+}
+
/* orn = original face normal */
-static void reflection(float *ref, float *n, float *view, float *orn)
+static void reflection(float ref[3], float n[3], const float view[3], const float orn[3])
{
float f1;
-
- f1= -2.0f*(n[0]*view[0]+ n[1]*view[1]+ n[2]*view[2]);
-
- ref[0]= (view[0]+f1*n[0]);
- ref[1]= (view[1]+f1*n[1]);
- ref[2]= (view[2]+f1*n[2]);
- if(orn) {
- /* test phong normals, then we should prevent vector going to the back */
- f1= ref[0]*orn[0]+ ref[1]*orn[1]+ ref[2]*orn[2];
- if(f1>0.0f) {
- f1+= .01f;
- ref[0]-= f1*orn[0];
- ref[1]-= f1*orn[1];
- ref[2]-= f1*orn[2];
- }
+ reflection_simple(ref, n, view);
+
+ /* test phong normals, then we should prevent vector going to the back */
+ f1= dot_v3v3(ref, orn);
+ if(f1>0.0f) {
+ f1+= 0.01f;
+ ref[0]-= f1*orn[0];
+ ref[1]-= f1*orn[1];
+ ref[2]-= f1*orn[2];
}
}
@@ -672,8 +672,7 @@ static void color_combine(float *result, float fac1, float fac2, float *col1, fl
static float shade_by_transmission(Isect *is, ShadeInput *shi, ShadeResult *shr)
{
- float dx, dy, dz, d, p;
-
+ float d;
if (0 == (shi->mat->mode & MA_TRANSP))
return -1;
@@ -681,10 +680,12 @@ static float shade_by_transmission(Isect *is, ShadeInput *shi, ShadeResult *shr)
d= 1.0f;
}
else {
+ float p;
+
/* shi.co[] calculated by shade_ray() */
- dx= shi->co[0] - is->start[0];
- dy= shi->co[1] - is->start[1];
- dz= shi->co[2] - is->start[2];
+ const float dx= shi->co[0] - is->start[0];
+ const float dy= shi->co[1] - is->start[1];
+ const float dz= shi->co[2] - is->start[2];
d= sqrt(dx*dx+dy*dy+dz*dz);
if (d > shi->mat->tx_limit)
d= shi->mat->tx_limit;
@@ -701,13 +702,13 @@ static float shade_by_transmission(Isect *is, ShadeInput *shi, ShadeResult *shr)
return d;
}
-static void ray_fadeout_endcolor(float *col, ShadeInput *origshi, ShadeInput *shi, ShadeResult *shr, Isect *isec, float *vec)
+static void ray_fadeout_endcolor(float col[3], ShadeInput *origshi, ShadeInput *shi, ShadeResult *shr, Isect *isec, const float vec[3])
{
/* un-intersected rays get either rendered material color or sky color */
if (origshi->mat->fadeto_mir == MA_RAYMIR_FADETOMAT) {
- VECCOPY(col, shr->combined);
+ copy_v3_v3(col, shr->combined);
} else if (origshi->mat->fadeto_mir == MA_RAYMIR_FADETOSKY) {
- VECCOPY(shi->view, vec);
+ copy_v3_v3(shi->view, vec);
normalize_v3(shi->view);
shadeSkyView(col, isec->start, shi->view, NULL, shi->thread);
@@ -715,7 +716,7 @@ static void ray_fadeout_endcolor(float *col, ShadeInput *origshi, ShadeInput *sh
}
}
-static void ray_fadeout(Isect *is, ShadeInput *shi, float *col, float *blendcol, float dist_mir)
+static void ray_fadeout(Isect *is, ShadeInput *shi, float col[3], const float blendcol[3], float dist_mir)
{
/* if fading out, linear blend against fade color */
float blendfac;
@@ -729,14 +730,14 @@ static void ray_fadeout(Isect *is, ShadeInput *shi, float *col, float *blendcol,
/* the main recursive tracer itself
* note: 'col' must be initialized */
-static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, float *start, float *dir, float *col, ObjectInstanceRen *obi, VlakRen *vlr, int traflag)
+static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, const float start[3], const float dir[3], float col[4], ObjectInstanceRen *obi, VlakRen *vlr, int traflag)
{
ShadeInput shi= {0};
Isect isec;
float dist_mir = origshi->mat->dist_mir;
- VECCOPY(isec.start, start);
- VECCOPY(isec.dir, dir );
+ copy_v3_v3(isec.start, start);
+ copy_v3_v3(isec.dir, dir );
isec.dist = dist_mir > 0 ? dist_mir : RE_RAYTRACE_MAXDIST;
isec.mode= RE_RAY_MIRROR;
isec.check = RE_CHECK_VLR_RENDER;
@@ -752,8 +753,8 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo
float d= 1.0f;
/* for as long we don't have proper dx/dy transform for rays we copy over original */
- VECCOPY(shi.dxco, origshi->dxco);
- VECCOPY(shi.dyco, origshi->dyco);
+ copy_v3_v3(shi.dxco, origshi->dxco);
+ copy_v3_v3(shi.dyco, origshi->dyco);
shi.mask= origshi->mask;
shi.osatex= origshi->osatex;
@@ -845,7 +846,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo
float mircol[4];
float ref[3];
- reflection(ref, shi.vn, shi.view, NULL);
+ reflection_simple(ref, shi.vn, shi.view);
traceray(origshi, origshr, depth-1, shi.co, ref, mircol, shi.obi, shi.vlr, 0);
f1= 1.0f-f;
@@ -896,7 +897,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo
/* calc distributed planar energy */
-static void DP_energy(float *table, float *vec, int tot, float xsize, float ysize)
+static void DP_energy(float *table, float vec[2], int tot, float xsize, float ysize)
{
int x, y, a;
float *fp, force[3], result[3];
@@ -950,7 +951,7 @@ static void jitter_plane_offset(float *jitter1, float *jitter2, int tot, float s
void init_jitter_plane(LampRen *lar)
{
float *fp;
- int x, iter=12, tot= lar->ray_totsamp;
+ int x, tot= lar->ray_totsamp;
/* test if already initialized */
if(lar->jitter) return;
@@ -962,7 +963,8 @@ void init_jitter_plane(LampRen *lar)
/* if 1 sample, we leave table to be zero's */
if(tot>1) {
-
+ int iter=12;
+
/* set per-lamp fixed seed */
BLI_srandom(tot);
@@ -1125,7 +1127,7 @@ static void QMC_getSample(double *s, QMCSampler *qsa, int thread, int num)
}
/* phong weighted disc using 'blur' for exponent, centred on 0,0 */
-static void QMC_samplePhong(float *vec, QMCSampler *qsa, int thread, int num, float blur)
+static void QMC_samplePhong(float vec[3], QMCSampler *qsa, int thread, int num, float blur)
{
double s[2];
float phi, pz, sqr;
@@ -1142,7 +1144,7 @@ static void QMC_samplePhong(float *vec, QMCSampler *qsa, int thread, int num, fl
}
/* rect of edge lengths sizex, sizey, centred on 0.0,0.0 i.e. ranging from -sizex/2 to +sizey/2 */
-static void QMC_sampleRect(float *vec, QMCSampler *qsa, int thread, int num, float sizex, float sizey)
+static void QMC_sampleRect(float vec[3], QMCSampler *qsa, int thread, int num, float sizex, float sizey)
{
double s[2];
@@ -1154,7 +1156,7 @@ static void QMC_sampleRect(float *vec, QMCSampler *qsa, int thread, int num, flo
}
/* disc of radius 'radius', centred on 0,0 */
-static void QMC_sampleDisc(float *vec, QMCSampler *qsa, int thread, int num, float radius)
+static void QMC_sampleDisc(float vec[3], QMCSampler *qsa, int thread, int num, float radius)
{
double s[2];
float phi, sqr;
@@ -1170,7 +1172,7 @@ static void QMC_sampleDisc(float *vec, QMCSampler *qsa, int thread, int num, flo
}
/* uniform hemisphere sampling */
-static void QMC_sampleHemi(float *vec, QMCSampler *qsa, int thread, int num)
+static void QMC_sampleHemi(float vec[3], QMCSampler *qsa, int thread, int num)
{
double s[2];
float phi, sqr;
@@ -1187,7 +1189,7 @@ static void QMC_sampleHemi(float *vec, QMCSampler *qsa, int thread, int num)
#if 0 /* currently not used */
/* cosine weighted hemisphere sampling */
-static void QMC_sampleHemiCosine(float *vec, QMCSampler *qsa, int thread, int num)
+static void QMC_sampleHemiCosine(float vec[3], QMCSampler *qsa, int thread, int num)
{
double s[2];
float phi, sqr;
@@ -1238,10 +1240,9 @@ static void release_thread_qmcsampler(Render *UNUSED(re), int UNUSED(thread), QM
void free_render_qmcsampler(Render *re)
{
- QMCSampler *qsa, *next;
- int a;
-
if(re->qmcsamplers) {
+ QMCSampler *qsa, *next;
+ int a;
for(a=0; a<BLENDER_MAX_THREADS; a++) {
for(qsa=re->qmcsamplers[a].first; qsa; qsa=next) {
next= qsa->next;
@@ -1256,7 +1257,7 @@ void free_render_qmcsampler(Render *re)
}
}
-static int adaptive_sample_variance(int samples, float *col, float *colsq, float thresh)
+static int adaptive_sample_variance(int samples, const float col[3], const float colsq[3], float thresh)
{
float var[3], mean[3];
@@ -1306,7 +1307,7 @@ static float get_avg_speed(ShadeInput *shi)
/* ***************** main calls ************** */
-static void trace_refract(float *col, ShadeInput *shi, ShadeResult *shr)
+static void trace_refract(float col[4], ShadeInput *shi, ShadeResult *shr)
{
QMCSampler *qsa=NULL;
int samp_type;
@@ -1345,7 +1346,7 @@ static void trace_refract(float *col, ShadeInput *shi, ShadeResult *shr)
if((shi->vlr->flag & R_SMOOTH))
reflection(v_refract, shi->vn, shi->view, shi->facenor);
else
- reflection(v_refract, shi->vn, shi->view, NULL);
+ reflection_simple(v_refract, shi->vn, shi->view);
/* can't blur total external reflection */
max_samples = 1;
@@ -1366,7 +1367,7 @@ static void trace_refract(float *col, ShadeInput *shi, ShadeResult *shr)
normalize_v3(v_refract_new);
} else {
/* no blurriness, use the original normal */
- VECCOPY(v_refract_new, v_refract);
+ copy_v3_v3(v_refract_new, v_refract);
}
sampcol[0]= sampcol[1]= sampcol[2]= sampcol[3]= 0.0f;
@@ -1406,7 +1407,7 @@ static void trace_refract(float *col, ShadeInput *shi, ShadeResult *shr)
release_thread_qmcsampler(&R, shi->thread, qsa);
}
-static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float fresnelfac)
+static void trace_reflect(float col[3], ShadeInput *shi, ShadeResult *shr, float fresnelfac)
{
QMCSampler *qsa=NULL;
int samp_type;
@@ -1445,7 +1446,7 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f
* if tangent shading enabled */
if (shi->mat->mode & (MA_TANGENT_V)) {
cross_v3_v3v3(orthx, shi->vn, shi->tang); // bitangent
- VECCOPY(orthy, shi->tang);
+ copy_v3_v3(orthy, shi->tang);
mul_v3_fl(orthx, samp3d[0]);
mul_v3_fl(orthy, samp3d[1]*aniso);
} else {
@@ -1460,13 +1461,13 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f
normalize_v3(v_nor_new);
} else {
/* no blurriness, use the original normal */
- VECCOPY(v_nor_new, shi->vn);
+ copy_v3_v3(v_nor_new, shi->vn);
}
if((shi->vlr->flag & R_SMOOTH))
reflection(v_reflect, v_nor_new, shi->view, shi->facenor);
else
- reflection(v_reflect, v_nor_new, shi->view, NULL);
+ reflection_simple(v_reflect, v_nor_new, shi->view);
sampcol[0]= sampcol[1]= sampcol[2]= sampcol[3]= 0.0f;
@@ -1517,7 +1518,7 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f
/* extern call from render loop */
void ray_trace(ShadeInput *shi, ShadeResult *shr)
{
- float i, f, f1, fr, fg, fb;
+ float f1, fr, fg, fb;
float mircol[4], tracol[4];
float diff[3];
int do_tra, do_mir;
@@ -1527,12 +1528,12 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
/* raytrace mirror amd refract like to separate the spec color */
if(shi->combinedflag & SCE_PASS_SPEC)
- VECSUB(diff, shr->combined, shr->spec) /* no ; */
+ sub_v3_v3v3(diff, shr->combined, shr->spec);
else
- VECCOPY(diff, shr->combined);
+ copy_v3_v3(diff, shr->combined);
if(do_tra) {
- float olddiff[3];
+ float olddiff[3], f;
trace_refract(tracol, shi, shr);
@@ -1542,24 +1543,23 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
fb= 1.0f+ shi->mat->filter*(shi->b-1.0f);
/* for refract pass */
- VECCOPY(olddiff, diff);
+ copy_v3_v3(olddiff, diff);
diff[0]= f*diff[0] + f1*fr*tracol[0];
diff[1]= f*diff[1] + f1*fg*tracol[1];
diff[2]= f*diff[2] + f1*fb*tracol[2];
if(shi->passflag & SCE_PASS_REFRACT)
- VECSUB(shr->refr, diff, olddiff);
+ sub_v3_v3v3(shr->refr, diff, olddiff);
if(!(shi->combinedflag & SCE_PASS_REFRACT))
- VECSUB(diff, diff, shr->refr);
+ sub_v3_v3v3(diff, diff, shr->refr);
shr->alpha= MIN2(1.0f, tracol[3]);
}
if(do_mir) {
-
- i= shi->ray_mirror*fresnel_fac(shi->view, shi->vn, shi->mat->fresnel_mir_i, shi->mat->fresnel_mir);
+ const float i= shi->ray_mirror*fresnel_fac(shi->view, shi->vn, shi->mat->fresnel_mir_i, shi->mat->fresnel_mir);
if(i!=0.0f) {
trace_reflect(mircol, shi, shr, i);
@@ -1597,12 +1597,12 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr)
if(shi->combinedflag & SCE_PASS_SPEC)
VECADD(shr->combined, diff, shr->spec) /* no ; */
else
- VECCOPY(shr->combined, diff);
+ copy_v3_v3(shr->combined, diff);
}
/* color 'shadfac' passes through 'col' with alpha and filter */
/* filter is only applied on alpha defined transparent part */
-static void addAlphaLight(float *shadfac, float *col, float alpha, float filter)
+static void addAlphaLight(float shadfac[4], const float col[3], float alpha, float filter)
{
float fr, fg, fb;
@@ -1621,19 +1621,20 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int
{
/* ray to lamp, find first face that intersects, check alpha properties,
if it has col[3]>0.0f continue. so exit when alpha is full */
- ShadeInput shi;
- ShadeResult shr;
- float initial_dist = is->dist;
-
+ const float initial_dist = is->dist;
+
if(RE_rayobject_raycast(R.raytree, is)) {
- float d= 1.0f;
- /* we got a face */
-
- /* Warning, This is not that nice, and possibly a bit slow for every ray,
- however some variables were not initialized properly in, unless using shade_input_initialize(...), we need to do a memset */
- memset(&shi, 0, sizeof(ShadeInput));
+ /* Warning regarding initializing to zero's, This is not that nice,
+ * and possibly a bit slow for every ray, however some variables were
+ * not initialized properly in, unless using
+ * shade_input_initialize(...), we need to zero them. */
+ ShadeInput shi= {NULL};
/* end warning! - Campbell */
-
+
+ ShadeResult shr;
+
+ /* we got a face */
+
shi.depth= origshi->depth + 1; /* only used to indicate tracing */
shi.mask= origshi->mask;
shi.thread= origshi->thread;
@@ -1647,9 +1648,9 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int
shade_ray(is, &shi, &shr);
if (shi.mat->material_type == MA_TYPE_SURFACE) {
- if (traflag & RAY_TRA)
- d= shade_by_transmission(is, &shi, &shr);
-
+ const float d= (traflag & RAY_TRA) ?
+ shade_by_transmission(is, &shi, &shr) :
+ 1.0f;
/* mix colors based on shadfac (rgb + amount of light factor) */
addAlphaLight(col, shr.diff, shr.alpha, d*shi.mat->filter);
} else if (shi.mat->material_type == MA_TYPE_VOLUME) {
@@ -1665,7 +1666,7 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int
if(depth>0 && col[3]>0.0f) {
/* adapt isect struct */
- VECCOPY(is->start, shi.co);
+ copy_v3_v3(is->start, shi.co);
is->dist = initial_dist-is->dist;
is->orig.ob = shi.obi;
is->orig.face = shi.vlr;
@@ -1702,7 +1703,7 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
isec.orig.face = ship->vlr;
isec.hint = 0;
- VECCOPY(isec.start, ship->co);
+ copy_v3_v3(isec.start, ship->co);
RE_RC_INIT(isec, shi);
@@ -1710,14 +1711,14 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
counter+=3;
counter %= 768;
- VECCOPY(vec, hashvectf+counter);
+ copy_v3_v3(vec, hashvectf+counter);
if(ship->vn[0]*vec[0]+ship->vn[1]*vec[1]+ship->vn[2]*vec[2]>0.0f) {
vec[0]-= vec[0];
vec[1]-= vec[1];
vec[2]-= vec[2];
}
- VECCOPY(isec.dir, vec );
+ copy_v3_v3(isec.dir, vec );
isec.dist = RE_RAYTRACE_MAXDIST;
if(RE_rayobject_raycast(R.raytree, &isec)) {
@@ -1751,7 +1752,7 @@ static int UNUSED_FUNCTION(ray_trace_shadow_rad)(ShadeInput *ship, ShadeResult *
}
/* aolight: function to create random unit sphere vectors for total random sampling */
-static void RandomSpherical(float *v)
+static void RandomSpherical(float v[3])
{
float r;
v[2] = 2.f*BLI_frand()-1.f;
@@ -1765,7 +1766,7 @@ static void RandomSpherical(float *v)
}
/* calc distributed spherical energy */
-static void DS_energy(float *sphere, int tot, float *vec)
+static void DS_energy(float *sphere, int tot, float vec[3])
{
float *fp, fac, force[3], res[3];
int a;
@@ -1863,13 +1864,15 @@ static float *sphere_sampler(int type, int resol, int thread, int xs, int ys, in
}
else {
float *sphere;
- float cosfi, sinfi, cost, sint;
- float ang, *vec1;
- int a;
+ float *vec1;
// returns table if xs and ys were equal to last call, and not resetting
sphere= (reset)? NULL: threadsafe_table_sphere(1, thread, xs, ys, tot);
if(sphere==NULL) {
+ float cosfi, sinfi, cost, sint;
+ float ang;
+ int a;
+
sphere= threadsafe_table_sphere(0, thread, xs, ys, tot);
// random rotation
@@ -1890,7 +1893,7 @@ static float *sphere_sampler(int type, int resol, int thread, int xs, int ys, in
}
}
-static void ray_ao_qmc(ShadeInput *shi, float *ao, float *env)
+static void ray_ao_qmc(ShadeInput *shi, float ao[3], float env[3])
{
Isect isec;
RayHint point_hint;
@@ -1924,7 +1927,7 @@ static void ray_ao_qmc(ShadeInput *shi, float *ao, float *env)
isec.mode= (R.wrld.aomode & WO_AODIST)?RE_RAY_SHADOW_TRA:RE_RAY_SHADOW;
isec.lay= -1;
- VECCOPY(isec.start, shi->co);
+ copy_v3_v3(isec.start, shi->co);
RE_rayobject_hint_bb( R.raytree, &point_hint, isec.start, isec.start );
isec.hint = &point_hint;
@@ -1943,10 +1946,10 @@ static void ray_ao_qmc(ShadeInput *shi, float *ao, float *env)
}
if(shi->vlr->flag & R_SMOOTH) {
- VECCOPY(nrm, shi->vn);
+ copy_v3_v3(nrm, shi->vn);
}
else {
- VECCOPY(nrm, shi->facenor);
+ copy_v3_v3(nrm, shi->facenor);
}
ortho_basis_v3v3_v3( up, side,nrm);
@@ -1990,7 +1993,7 @@ static void ray_ao_qmc(ShadeInput *shi, float *ao, float *env)
}
else if(envcolor!=WO_AOPLAIN) {
float skycol[4];
- float skyfac, view[3];
+ float view[3];
view[0]= -dir[0];
view[1]= -dir[1];
@@ -1998,7 +2001,7 @@ static void ray_ao_qmc(ShadeInput *shi, float *ao, float *env)
normalize_v3(view);
if(envcolor==WO_AOSKYCOL) {
- skyfac= 0.5f*(1.0f+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]);
+ const float skyfac= 0.5f*(1.0f+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]);
env[0]+= (1.0f-skyfac)*R.wrld.horr + skyfac*R.wrld.zenr;
env[1]+= (1.0f-skyfac)*R.wrld.horg + skyfac*R.wrld.zeng;
env[2]+= (1.0f-skyfac)*R.wrld.horb + skyfac*R.wrld.zenb;
@@ -2039,7 +2042,7 @@ static void ray_ao_qmc(ShadeInput *shi, float *ao, float *env)
}
/* extern call from shade_lamp_loop, ambient occlusion calculus */
-static void ray_ao_spheresamp(ShadeInput *shi, float *ao, float *env)
+static void ray_ao_spheresamp(ShadeInput *shi, float ao[3], float env[3])
{
Isect isec;
RayHint point_hint;
@@ -2063,7 +2066,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float *ao, float *env)
isec.mode= (R.wrld.aomode & WO_AODIST)?RE_RAY_SHADOW_TRA:RE_RAY_SHADOW;
isec.lay= -1;
- VECCOPY(isec.start, shi->co);
+ copy_v3_v3(isec.start, shi->co);
RE_rayobject_hint_bb( R.raytree, &point_hint, isec.start, isec.start );
isec.hint = &point_hint;
@@ -2128,7 +2131,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float *ao, float *env)
}
else if(envcolor!=WO_AOPLAIN) {
float skycol[4];
- float fac, view[3];
+ float view[3];
view[0]= -vec[0];
view[1]= -vec[1];
@@ -2136,7 +2139,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float *ao, float *env)
normalize_v3(view);
if(envcolor==WO_AOSKYCOL) {
- fac= 0.5f*(1.0f+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]);
+ const float fac= 0.5f*(1.0f+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]);
env[0]+= (1.0f-fac)*R.wrld.horr + fac*R.wrld.zenr;
env[1]+= (1.0f-fac)*R.wrld.horg + fac*R.wrld.zeng;
env[2]+= (1.0f-fac)*R.wrld.horb + fac*R.wrld.zenb;
@@ -2167,7 +2170,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float *ao, float *env)
copy_v3_v3(env, ao);
}
-void ray_ao(ShadeInput *shi, float *ao, float *env)
+void ray_ao(ShadeInput *shi, float ao[3], float env[3])
{
/* Unfortunately, the unusual way that the sphere sampler calculates roughly twice as many
* samples as are actually traced, and skips them based on bias and OSA settings makes it very difficult
@@ -2214,12 +2217,12 @@ static void ray_shadow_jittered_coords(ShadeInput *shi, int max, float jitco[RE_
*totjitco= tot;
}
else {
- VECCOPY(jitco[0], shi->co);
+ copy_v3_v3(jitco[0], shi->co);
*totjitco= 1;
}
}
-static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *shadfac, Isect *isec)
+static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3], float shadfac[4], Isect *isec)
{
QMCSampler *qsa=NULL;
int samples=0;
@@ -2276,7 +2279,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
isec->hint = &bb_hint;
isec->check = RE_CHECK_VLR_RENDER;
isec->skip = RE_SKIP_VLR_NEIGHBOUR;
- VECCOPY(vec, lampco);
+ copy_v3_v3(vec, lampco);
while (samples < max_samples) {
@@ -2294,9 +2297,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
float ru[3], rv[3], v[3], s[3];
/* calc tangent plane vectors */
- v[0] = co[0] - lampco[0];
- v[1] = co[1] - lampco[1];
- v[2] = co[2] - lampco[2];
+ sub_v3_v3v3(v, co, lampco);
normalize_v3(v);
ortho_basis_v3v3_v3( ru, rv,v);
@@ -2308,7 +2309,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
s[1] = samp3d[0]*ru[1] + samp3d[1]*rv[1];
s[2] = samp3d[0]*ru[2] + samp3d[1]*rv[2];
- VECCOPY(samp3d, s);
+ copy_v3_v3(samp3d, s);
}
else {
/* sampling, returns quasi-random vector in [sizex,sizey]^2 plane */
@@ -2321,7 +2322,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
end[1] = vec[1]+samp3d[1];
end[2] = vec[2]+samp3d[2];
} else {
- VECCOPY(end, vec);
+ copy_v3_v3(end, vec);
}
if(shi->strand) {
@@ -2329,7 +2330,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
float jitbias= 0.5f*(len_v3(shi->dxco) + len_v3(shi->dyco));
float v[3];
- VECSUB(v, co, end);
+ sub_v3_v3v3(v, co, end);
normalize_v3(v);
co[0] -= jitbias*v[0];
@@ -2337,7 +2338,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
co[2] -= jitbias*v[2];
}
- VECCOPY(isec->start, co);
+ copy_v3_v3(isec->start, co);
isec->dir[0] = end[0]-isec->start[0];
isec->dir[1] = end[1]-isec->start[1];
isec->dir[2] = end[2]-isec->start[2];
@@ -2393,7 +2394,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
release_thread_qmcsampler(&R, shi->thread, qsa);
}
-static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, float *lampco, float *shadfac, Isect *isec)
+static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[3], float shadfac[4], Isect *isec)
{
/* area soft shadow */
float *jitlamp;
@@ -2416,7 +2417,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, float *lampco, floa
if(a==4) mask |= (mask>>4)|(mask>>8);
else if(a==9) mask |= (mask>>9);
- VECCOPY(isec->start, shi->co);
+ copy_v3_v3(isec->start, shi->co);
isec->orig.ob = shi->obi;
isec->orig.face = shi->vlr;
RE_rayobject_hint_bb( R.raytree, &point_hint, isec->start, isec->start );
@@ -2477,7 +2478,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, float *lampco, floa
}
}
/* extern call from shade_lamp_loop */
-void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac)
+void ray_shadow(ShadeInput *shi, LampRen *lar, float shadfac[4])
{
Isect isec;
float lampco[3];
@@ -2520,7 +2521,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac)
lampco[2]= shi->co[2] - R.maxdist*lar->vec[2];
}
else {
- VECCOPY(lampco, lar->co);
+ copy_v3_v3(lampco, lar->co);
}
if (ELEM(lar->ray_samp_method, LA_SAMP_HALTON, LA_SAMP_HAMMERSLEY)) {
@@ -2536,8 +2537,8 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac)
shadfac[3]= 1.0f; // 1.0=full light
/* set up isec.dir */
- VECCOPY(isec.start, shi->co);
- VECSUB(isec.dir, lampco, isec.start);
+ copy_v3_v3(isec.start, shi->co);
+ sub_v3_v3v3(isec.dir, lampco, isec.start);
isec.dist = normalize_v3(isec.dir);
if(isec.mode==RE_RAY_SHADOW_TRA) {
@@ -2545,7 +2546,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac)
float col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
ray_trace_shadow_tra(&isec, shi, DEPTH_SHADOW_TRA, 0, col);
- QUATCOPY(shadfac, col);
+ copy_v4_v4(shadfac, col);
}
else if(RE_rayobject_raycast(R.raytree, &isec))
shadfac[3]= 0.0f;
@@ -2584,15 +2585,15 @@ static void ray_translucent(ShadeInput *shi, LampRen *lar, float *distfac, float
lampco[2]= shi->co[2] - RE_RAYTRACE_MAXDIST*lar->vec[2];
}
else {
- VECCOPY(lampco, lar->co);
+ copy_v3_v3(lampco, lar->co);
}
isec.orig.ob = shi->obi;
isec.orig.face = shi->vlr;
/* set up isec.dir */
- VECCOPY(isec.start, shi->co);
- VECCOPY(isec.end, lampco);
+ copy_v3_v3(isec.start, shi->co);
+ copy_v3_v3(isec.end, lampco);
if(RE_rayobject_raycast(R.raytree, &isec)) {
/* we got a face */
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 7d965a6d2b9..9fdfd085111 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -747,7 +747,7 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex
{
PluginTex *pit;
int rgbnor=0;
- float result[ 8 ];
+ float result[8]= {0.0f};
texres->tin= 0.0;
@@ -1748,7 +1748,7 @@ static int compatible_bump_compute(CompatibleBump *compat_bump, ShadeInput *shi,
TexResult ttexr = {0, 0, 0, 0, 0, texres->talpha, NULL}; // temp TexResult
float tco[3], texv[3], cd, ud, vd, du, dv, idu, idv;
const int fromrgb = ((tex->type == TEX_IMAGE) || ((tex->flag & TEX_COLORBAND)!=0));
- const float bf = 0.04f*Tnor*mtex->norfac;
+ const float bf = -0.04f*Tnor*mtex->norfac;
int rgbnor;
// disable internal bump eval
float* nvec = texres->nor;
@@ -1904,8 +1904,17 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
TexResult ttexr = {0, 0, 0, 0, 0, texres->talpha, NULL}; // temp TexResult
const int fromrgb = ((tex->type == TEX_IMAGE) || ((tex->flag & TEX_COLORBAND)!=0));
- float Hscale = Tnor*mtex->norfac;
+
+ // The negate on Hscale is done because the
+ // normal in the renderer points inward which corresponds
+ // to inverting the bump map. The normals are generated
+ // this way in calc_vertexnormals(). Should this ever change
+ // this negate must be removed.
+ float Hscale = -Tnor*mtex->norfac;
+
int dimx=512, dimy=512;
+ const int imag_tspace_dimension_x = 1024; // only used for texture space variant
+ float aspect = 1.0f;
// 2 channels for 2D texture and 3 for 3D textures.
const int nr_channels = (mtex->texco == TEXCO_UV)? 2 : 3;
@@ -1938,6 +1947,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
if (ibuf) {
dimx = ibuf->x;
dimy = ibuf->y;
+ aspect = ((float) dimy) / dimx;
}
}
@@ -2111,12 +2121,13 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
if(tex->ima) {
// crazy hack solution that gives results similar to normal mapping - part 2
float vec[2];
+ const float imag_tspace_dimension_y = aspect*imag_tspace_dimension_x;
- vec[0] = dimx*dxt[0];
- vec[1] = dimy*dxt[1];
+ vec[0] = imag_tspace_dimension_x*dxt[0];
+ vec[1] = imag_tspace_dimension_y*dxt[1];
dHdx *= 1.0f/len_v2(vec);
- vec[0] = dimx*dyt[0];
- vec[1] = dimy*dyt[1];
+ vec[0] = imag_tspace_dimension_x*dyt[0];
+ vec[1] = imag_tspace_dimension_y*dyt[1];
dHdy *= 1.0f/len_v2(vec);
}
}
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index bc5e7f23e21..fd824cee8a4 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -142,7 +142,7 @@ void calc_renderco_ortho(float co[3], float x, float y, int z)
co[2]= R.winmat[3][2]/( R.winmat[2][3]*zco - R.winmat[2][2] );
}
-void calc_renderco_zbuf(float co[3], float *view, int z)
+void calc_renderco_zbuf(float co[3], const float view[3], int z)
{
float fac, zco;
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index d8231c7e7d4..5963c4c8ffd 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -1355,20 +1355,18 @@ void shade_sample_initialize(ShadeSample *ssamp, RenderPart *pa, RenderLayer *rl
/* Do AO or (future) GI */
void shade_samples_do_AO(ShadeSample *ssamp)
{
- ShadeInput *shi;
- int sample;
-
if(!(R.r.mode & R_SHADOW))
return;
if(!(R.r.mode & R_RAYTRACE) && !(R.wrld.ao_gather_method == WO_AOGATHER_APPROX))
return;
if(R.wrld.mode & (WO_AMB_OCC|WO_ENV_LIGHT|WO_INDIRECT_LIGHT)) {
- shi= &ssamp->shi[0];
+ ShadeInput *shi= &ssamp->shi[0];
+ int sample;
if(((shi->passflag & SCE_PASS_COMBINED) && (shi->combinedflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT)))
|| (shi->passflag & (SCE_PASS_AO|SCE_PASS_ENVIRONMENT|SCE_PASS_INDIRECT)))
- for(sample=0, shi= ssamp->shi; sample<ssamp->tot; shi++, sample++)
+ for(sample=0; sample<ssamp->tot; shi++, sample++)
if(!(shi->mode & MA_SHLESS))
ambient_occlusion(shi); /* stores in shi->ao[] */
}
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 41d12c6065e..66ae219a80a 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -119,7 +119,7 @@ static void fogcolor(float *colf, float *rco, float *view)
#endif
/* zcor is distance, co the 3d coordinate in eye space, return alpha */
-float mistfactor(float zcor, float *co)
+float mistfactor(float zcor, float const co[3])
{
float fac, hi;
@@ -162,8 +162,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
double t0, t1 = 0.0f, t2= 0.0f, t3;
float p1[3], p2[3], ladist, maxz = 0.0f, maxy = 0.0f, haint;
int snijp, doclip=1, use_yco=0;
- int ok1=0, ok2=0;
-
+
*intens= 0.0f;
haint= lar->haint;
@@ -243,6 +242,8 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
}
}
if(snijp==2) {
+ int ok1=0, ok2=0;
+
/* sort */
if(t1>t2) {
a= t1; t1= t2; t2= a;
@@ -345,7 +346,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
}
}
-void renderspothalo(ShadeInput *shi, float *col, float alpha)
+void renderspothalo(ShadeInput *shi, float col[4], float alpha)
{
ListBase *lights;
GroupObject *go;
@@ -726,7 +727,7 @@ static float Toon_Diff( float *n, float *l, float *UNUSED(v), float size, float
/* in latter case, only last multiplication uses 'nl' */
static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough )
{
- float i/*, nh*/, nv, vh, realnl, h[3];
+ float i/*, nh*/, nv /*, vh */, realnl, h[3];
float a, b, t, A, B;
float Lit_A, View_A, Lit_B[3], View_B[3];
@@ -745,8 +746,8 @@ static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough
if(realnl<=0.0f) return 0.0f;
if(nl<0.0f) return 0.0f; /* value from area light */
- vh= v[0]*h[0]+v[1]*h[1]+v[2]*h[2]; /* Dot product between view vector and halfway vector */
- if(vh<=0.0f) vh= 0.0f;
+ /* vh= v[0]*h[0]+v[1]*h[1]+v[2]*h[2]; */ /* Dot product between view vector and halfway vector */
+ /* if(vh<=0.0f) vh= 0.0f; */
Lit_A = saacos(realnl);
View_A = saacos( nv );
@@ -891,12 +892,11 @@ void shade_color(ShadeInput *shi, ShadeResult *shr)
static void ramp_diffuse_result(float *diff, ShadeInput *shi)
{
Material *ma= shi->mat;
- float col[4], fac=0;
+ float col[4];
if(ma->ramp_col) {
if(ma->rampin_col==MA_RAMP_IN_RESULT) {
-
- fac= 0.3f*diff[0] + 0.58f*diff[1] + 0.12f*diff[2];
+ float fac= 0.3f*diff[0] + 0.58f*diff[1] + 0.12f*diff[2];
do_colorband(ma->ramp_col, fac, col);
/* blending method */
@@ -911,8 +911,7 @@ static void ramp_diffuse_result(float *diff, ShadeInput *shi)
static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, float g, float b)
{
Material *ma= shi->mat;
- float col[4], colt[3], fac=0;
-
+
if(ma->ramp_col && (ma->mode & MA_RAMP_COL)) {
/* MA_RAMP_IN_RESULT is exceptional */
@@ -923,6 +922,9 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa
diff[2] += b * shi->b;
}
else {
+ float colt[3], col[4];
+ float fac;
+
/* input */
switch(ma->rampin_col) {
case MA_RAMP_IN_ENERGY:
@@ -934,6 +936,9 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa
case MA_RAMP_IN_NOR:
fac= shi->view[0]*shi->vn[0] + shi->view[1]*shi->vn[1] + shi->view[2]*shi->vn[2];
break;
+ default:
+ fac= 0.0f;
+ break;
}
do_colorband(ma->ramp_col, fac, col);
@@ -962,11 +967,11 @@ static void add_to_diffuse(float *diff, ShadeInput *shi, float is, float r, floa
static void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi)
{
Material *ma= shi->mat;
- float col[4];
- float fac;
-
+
if(ma->ramp_spec && (ma->rampin_spec==MA_RAMP_IN_RESULT)) {
- fac= 0.3f*(*specr) + 0.58f*(*specg) + 0.12f*(*specb);
+ float col[4];
+ float fac= 0.3f*(*specr) + 0.58f*(*specg) + 0.12f*(*specb);
+
do_colorband(ma->ramp_spec, fac, col);
/* blending method */
@@ -978,19 +983,19 @@ static void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInpu
}
/* is = dot product shade, t = spec energy */
-static void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec)
+static void do_specular_ramp(ShadeInput *shi, float is, float t, float spec[3])
{
Material *ma= shi->mat;
- float col[4];
- float fac=0.0f;
-
+
spec[0]= shi->specr;
spec[1]= shi->specg;
spec[2]= shi->specb;
/* MA_RAMP_IN_RESULT is exception */
if(ma->ramp_spec && (ma->rampin_spec!=MA_RAMP_IN_RESULT)) {
-
+ float fac;
+ float col[4];
+
/* input */
switch(ma->rampin_spec) {
case MA_RAMP_IN_ENERGY:
@@ -1002,6 +1007,9 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec)
case MA_RAMP_IN_NOR:
fac= shi->view[0]*shi->vn[0] + shi->view[1]*shi->vn[1] + shi->view[2]*shi->vn[2];
break;
+ default:
+ fac= 0.0f;
+ break;
}
do_colorband(ma->ramp_spec, fac, col);
@@ -1086,7 +1094,7 @@ static void indirect_lighting_apply(ShadeInput *shi, ShadeResult *shr)
}
/* result written in shadfac */
-void lamp_get_shadow(LampRen *lar, ShadeInput *shi, float inp, float *shadfac, int do_real)
+void lamp_get_shadow(LampRen *lar, ShadeInput *shi, float inp, float shadfac[4], int do_real)
{
LampShadowSubSample *lss= &(lar->shadsamp[shi->thread].s[shi->sample]);
@@ -1115,7 +1123,7 @@ void lamp_get_shadow(LampRen *lar, ShadeInput *shi, float inp, float *shadfac, i
}
/* lampdistance and spot angle, writes in lv and dist */
-float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist)
+float lamp_get_visibility(LampRen *lar, const float co[3], float lv[3], float *dist)
{
if(lar->type==LA_SUN || lar->type==LA_HEMI) {
*dist= 1.0f;
@@ -1621,7 +1629,7 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
}
/* let's map negative light as if it mirrors positive light, otherwise negative values disappear */
-static void wrld_exposure_correct(float *diff)
+static void wrld_exposure_correct(float diff[3])
{
diff[0]= R.wrld.linfac*(1.0f-exp( diff[0]*R.wrld.logfac) );
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index 840e5444ff0..15226493977 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -92,7 +92,7 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
Material *ma;
StrandBuffer *strandbuf;
float *simplify;
- float p[4][3], data[4], cross[3], crosslen, w, dx, dy, t;
+ float p[4][3], data[4], cross[3], w, dx, dy, t;
int type;
strandbuf= sseg->buffer;
@@ -164,7 +164,7 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
if(w > 0.0f) {
if(strandbuf->flag & R_STRAND_B_UNITS) {
- crosslen= len_v3(cross);
+ const float crosslen= len_v3(cross);
w= 2.0f*crosslen*strandbuf->minwidth/w;
if(spoint->width < w) {
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 18132c4a7f3..d6cfcee4ac9 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -477,6 +477,11 @@ static void *vol_precache_part_test(void *data)
}
#endif
+typedef struct VolPrecacheQueue {
+ ThreadQueue *work;
+ ThreadQueue *done;
+} VolPrecacheQueue;
+
/* Iterate over the 3d voxel grid, and fill the voxels with scattering information
*
* It's stored in memory as 3 big float grids next to each other, one for each RGB channel.
@@ -485,58 +490,65 @@ static void *vol_precache_part_test(void *data)
*/
static void *vol_precache_part(void *data)
{
- VolPrecachePart *pa = (VolPrecachePart *)data;
- ObjectInstanceRen *obi = pa->obi;
- RayObject *tree = pa->tree;
- ShadeInput *shi = pa->shi;
- float scatter_col[3] = {0.f, 0.f, 0.f};
- float co[3], cco[3], view[3];
- int x, y, z, i;
- int res[3];
-
- res[0]= pa->res[0];
- res[1]= pa->res[1];
- res[2]= pa->res[2];
-
- for (z= pa->minz; z < pa->maxz; z++) {
- co[2] = pa->bbmin[2] + (pa->voxel[2] * (z + 0.5f));
-
- for (y= pa->miny; y < pa->maxy; y++) {
- co[1] = pa->bbmin[1] + (pa->voxel[1] * (y + 0.5f));
+ VolPrecacheQueue *queue = (VolPrecacheQueue*)data;
+ VolPrecachePart *pa;
+
+ while ((pa = BLI_thread_queue_pop(queue->work))) {
+ ObjectInstanceRen *obi = pa->obi;
+ RayObject *tree = pa->tree;
+ ShadeInput *shi = pa->shi;
+ float scatter_col[3] = {0.f, 0.f, 0.f};
+ float co[3], cco[3], view[3];
+ int x, y, z, i;
+ int res[3];
+
+ if (pa->re->test_break && pa->re->test_break(pa->re->tbh))
+ break;
+
+ res[0]= pa->res[0];
+ res[1]= pa->res[1];
+ res[2]= pa->res[2];
+
+ for (z= pa->minz; z < pa->maxz; z++) {
+ co[2] = pa->bbmin[2] + (pa->voxel[2] * (z + 0.5f));
- for (x=pa->minx; x < pa->maxx; x++) {
- co[0] = pa->bbmin[0] + (pa->voxel[0] * (x + 0.5f));
-
- if (pa->re->test_break && pa->re->test_break(pa->re->tbh))
- break;
+ for (y= pa->miny; y < pa->maxy; y++) {
+ co[1] = pa->bbmin[1] + (pa->voxel[1] * (y + 0.5f));
- /* convert from world->camera space for shading */
- mul_v3_m4v3(cco, pa->viewmat, co);
-
- i= V_I(x, y, z, res);
+ for (x=pa->minx; x < pa->maxx; x++) {
+ co[0] = pa->bbmin[0] + (pa->voxel[0] * (x + 0.5f));
+
+ if (pa->re->test_break && pa->re->test_break(pa->re->tbh))
+ break;
+
+ /* convert from world->camera space for shading */
+ mul_v3_m4v3(cco, pa->viewmat, co);
+
+ i= V_I(x, y, z, res);
+
+ // don't bother if the point is not inside the volume mesh
+ if (!point_inside_obi(tree, obi, cco)) {
+ obi->volume_precache->data_r[i] = -1.0f;
+ obi->volume_precache->data_g[i] = -1.0f;
+ obi->volume_precache->data_b[i] = -1.0f;
+ continue;
+ }
+
+ copy_v3_v3(view, cco);
+ normalize_v3(view);
+ vol_get_scattering(shi, scatter_col, cco, view);
- // don't bother if the point is not inside the volume mesh
- if (!point_inside_obi(tree, obi, cco)) {
- obi->volume_precache->data_r[i] = -1.0f;
- obi->volume_precache->data_g[i] = -1.0f;
- obi->volume_precache->data_b[i] = -1.0f;
- continue;
+ obi->volume_precache->data_r[i] = scatter_col[0];
+ obi->volume_precache->data_g[i] = scatter_col[1];
+ obi->volume_precache->data_b[i] = scatter_col[2];
+
}
-
- copy_v3_v3(view, cco);
- normalize_v3(view);
- vol_get_scattering(shi, scatter_col, cco, view);
-
- obi->volume_precache->data_r[i] = scatter_col[0];
- obi->volume_precache->data_g[i] = scatter_col[1];
- obi->volume_precache->data_b[i] = scatter_col[2];
-
}
}
+
+ BLI_thread_queue_push(queue->done, pa);
}
- pa->done = 1;
-
return NULL;
}
@@ -602,9 +614,6 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob
minz = z * sizez;
maxz = minz + sizez;
maxz = (maxz>res[2])?res[2]:maxz;
-
- pa->done = 0;
- pa->working = 0;
pa->re = re;
pa->num = i;
@@ -630,21 +639,6 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob
}
}
-static VolPrecachePart *precache_get_new_part(Render *re)
-{
- VolPrecachePart *pa, *nextpa=NULL;
-
- for (pa = re->volume_precache_parts.first; pa; pa=pa->next)
- {
- if (pa->done==0 && pa->working==0) {
- nextpa = pa;
- break;
- }
- }
-
- return nextpa;
-}
-
/* calculate resolution from bounding box in world space */
static int precache_resolution(Render *re, VolumePrecache *vp, ObjectInstanceRen *obi, int res)
{
@@ -678,14 +672,15 @@ static int precache_resolution(Render *re, VolumePrecache *vp, ObjectInstanceRen
static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma)
{
VolumePrecache *vp;
- VolPrecachePart *nextpa, *pa;
+ VolPrecachePart *pa;
RayObject *tree;
ShadeInput shi;
ListBase threads;
+ VolPrecacheQueue queue;
int parts[3] = {1, 1, 1}, totparts;
- int caching=1, counter=0;
- int totthread = re->r.threads;
+ int counter=0;
+ int totthread = re->r.threads, thread;
double time, lasttime= PIL_check_seconds_timer();
@@ -718,34 +713,29 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o
precache_init_parts(re, tree, &shi, obi, totthread, parts);
totparts = parts[0] * parts[1] * parts[2];
+
+ /* setup work and done queues */
+ queue.work = BLI_thread_queue_init();
+ queue.done = BLI_thread_queue_init();
+ BLI_thread_queue_nowait(queue.work);
+
+ for(pa= re->volume_precache_parts.first; pa; pa= pa->next)
+ BLI_thread_queue_push(queue.work, pa);
+ /* launch threads */
BLI_init_threads(&threads, vol_precache_part, totthread);
+
+ for(thread= 0; thread<totthread; thread++)
+ BLI_insert_thread(&threads, &queue);
- while(caching) {
+ /* loop waiting for work to be done */
+ while(counter < totparts) {
+ if(re->test_break && re->test_break(re->tbh))
+ break;
- if(BLI_available_threads(&threads) && !(re->test_break(re->tbh))) {
- nextpa = precache_get_new_part(re);
- if (nextpa) {
- nextpa->working = 1;
- BLI_insert_thread(&threads, nextpa);
- }
- }
- else PIL_sleep_ms(50);
+ if(BLI_thread_queue_pop_timeout(queue.done, 50))
+ counter++;
- caching=0;
- counter=0;
- for(pa= re->volume_precache_parts.first; pa; pa= pa->next) {
-
- if(pa->done) {
- counter++;
- BLI_remove_thread(&threads, pa);
- } else
- caching = 1;
- }
-
- if (re->test_break(re->tbh) && BLI_available_threads(&threads)==totthread)
- caching=0;
-
time= PIL_check_seconds_timer();
if(time-lasttime>1.0) {
char str[64];
@@ -757,7 +747,10 @@ static void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *o
}
}
+ /* free */
BLI_end_threads(&threads);
+ BLI_thread_queue_free(queue.work);
+ BLI_thread_queue_free(queue.done);
BLI_freelistN(&re->volume_precache_parts);
if(tree) {
@@ -788,13 +781,22 @@ void volume_precache(Render *re)
ObjectInstanceRen *obi;
VolumeOb *vo;
+ re->i.infostr= "Volume preprocessing";
+ re->stats_draw(re->sdh, &re->i);
+
for(vo= re->volumes.first; vo; vo= vo->next) {
if (using_lightcache(vo->ma)) {
for(obi= re->instancetable.first; obi; obi= obi->next) {
if (obi->obr == vo->obr) {
vol_precache_objectinstance_threads(re, obi, vo->ma);
+
+ if(re->test_break && re->test_break(re->tbh))
+ break;
}
}
+
+ if(re->test_break && re->test_break(re->tbh))
+ break;
}
}
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index b63ece80119..464cbf72326 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -389,7 +389,7 @@ int voxeldatatex(struct Tex *tex, const float texvec[3], struct TexResult *texre
VoxelData *vd = tex->vd;
float co[3], offset[3] = {0.5, 0.5, 0.5};
- if ((!vd) || (vd->dataset==NULL)) {
+ if (vd->dataset==NULL) {
texres->tin = 0.0f;
return 0;
}
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index f36994e0969..62a54a51102 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -1747,13 +1747,14 @@ static void zbuf_project_cache_clear(ZbufProjectCache *cache, int size)
static int zbuf_shadow_project(ZbufProjectCache *cache, int index, float winmat[][4], float *co, float *ho)
{
- int clipflag, cindex= index & 255;
+ int cindex= index & 255;
if(cache[cindex].index == index) {
QUATCOPY(ho, cache[cindex].ho);
return cache[cindex].clip;
}
else {
+ int clipflag;
projectvert(co, winmat, ho);
clipflag= testclip(ho);
@@ -1775,14 +1776,16 @@ static void zbuffer_part_bounds(int winx, int winy, RenderPart *pa, float *bound
static int zbuf_part_project(ZbufProjectCache *cache, int index, float winmat[][4], float *bounds, float *co, float *ho)
{
- float vec[3], wco;
- int clipflag= 0, cindex= index & 255;
+ float vec[3];
+ int cindex= index & 255;
if(cache[cindex].index == index) {
QUATCOPY(ho, cache[cindex].ho);
return cache[cindex].clip;
}
else {
+ float wco;
+ int clipflag= 0;
VECCOPY(vec, co)
projectvert(co, winmat, ho);
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt
index 7c34c086b2e..7da2e17ad89 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -82,7 +82,7 @@ set(SRC
add_definitions(-DGLEW_STATIC)
if(WITH_INTERNATIONAL)
- add_definitions(-DINTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
endif()
if(WITH_OPENCOLLADA)
diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript
index c60752b85f8..ef6ddd18bb1 100644
--- a/source/blender/windowmanager/SConscript
+++ b/source/blender/windowmanager/SConscript
@@ -40,6 +40,6 @@ if env['BF_BUILDINFO']:
defs.append('WITH_BUILDINFO')
if env['WITH_BF_INTERNATIONAL']:
- defs.append('INTERNATIONAL')
+ defs.append('WITH_INTERNATIONAL')
env.BlenderLib ( 'bf_windowmanager', sources, Split(incs), defines=defs, libtype=['core'], priority=[5] )
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index cc3ae3ab753..fec59e97194 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -464,8 +464,6 @@ typedef struct wmOperatorType {
/* struct wmOperatorTypeMacro */
ListBase macro;
- short flag;
-
/* pointer to modal keymap, do not free! */
struct wmKeyMap *modalkeymap;
@@ -476,6 +474,10 @@ typedef struct wmOperatorType {
/* RNA integration */
ExtensionRNA ext;
+
+ /* Flag last for padding */
+ short flag;
+
} wmOperatorType;
/* **************** Paint Cursor ******************* */
@@ -540,11 +542,12 @@ typedef struct wmDropBox {
/* if poll survives, operator is called */
wmOperatorType *ot; /* not saved in file, so can be pointer */
- short opcontext; /* default invoke */
-
- struct IDProperty *properties; /* operator properties, assigned to ptr->data and can be written to a file */
+
+ struct IDProperty *properties; /* operator properties, assigned to ptr->data and can be written to a file */
struct PointerRNA *ptr; /* rna pointer to access properties */
+ short opcontext; /* default invoke */
+
} wmDropBox;
/* *************** migrated stuff, clean later? ************** */
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 9299b50103c..5beb07a1ed0 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -230,6 +230,7 @@ void WM_keymap_init(bContext *C)
{
wmWindowManager *wm= CTX_wm_manager(C);
+ /* create standard key configs */
if(!wm->defaultconf)
wm->defaultconf= WM_keyconfig_new(wm, "Blender");
if(!wm->addonconf)
@@ -237,10 +238,17 @@ void WM_keymap_init(bContext *C)
if(!wm->userconf)
wm->userconf= WM_keyconfig_new(wm, "Blender User");
+ /* initialize only after python init is done, for keymaps that
+ use python operators */
if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
- /* create default key config */
- wm_window_keymap(wm->defaultconf);
- ED_spacetypes_keymap(wm->defaultconf);
+ /* create default key config, only initialize once,
+ it's persistent across sessions */
+ if(!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
+ wm_window_keymap(wm->defaultconf);
+ ED_spacetypes_keymap(wm->defaultconf);
+
+ wm->defaultconf->flag |= KEYCONF_INIT_DEFAULT;
+ }
WM_keyconfig_update_tag(NULL, NULL);
WM_keyconfig_update(wm);
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 32a4648c7f8..8939ffd85a9 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -317,8 +317,8 @@ are for */
#define BEGIN_CURSOR_BLOCK {
#define END_CURSOR_BLOCK }
-void wm_init_cursor_data(void){
-
+void wm_init_cursor_data(void)
+{
/********************** NW_ARROW Cursor **************************/
BEGIN_CURSOR_BLOCK
static char nw_sbm[]={
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 3a5132c2dc7..d5a5e93eadf 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1229,41 +1229,47 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
retval= ot->modal(C, op, event);
OPERATOR_RETVAL_CHECK(retval);
- if(ot->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
- wm->op_undo_depth--;
+ /* when this is _not_ the case the modal modifier may have loaded
+ * a new blend file (demo mode does this), so we have to assume
+ * the event, operator etc have all been freed. - campbell */
+ if(CTX_wm_manager(C) == wm) {
- /* putting back screen context, reval can pass trough after modal failures! */
- if((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) {
- CTX_wm_area_set(C, area);
- CTX_wm_region_set(C, region);
- }
- else {
- /* this special cases is for areas and regions that get removed */
- CTX_wm_area_set(C, NULL);
- CTX_wm_region_set(C, NULL);
- }
+ if(ot->flag & OPTYPE_UNDO)
+ wm->op_undo_depth--;
- if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED))
- wm_operator_reports(C, op, retval, 0);
-
- if(retval & OPERATOR_FINISHED) {
- wm_operator_finished(C, op, 0);
- handler->op= NULL;
- }
- else if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
- WM_operator_free(op);
- handler->op= NULL;
- }
-
- /* remove modal handler, operator itself should have been cancelled and freed */
- if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
- WM_cursor_ungrab(CTX_wm_window(C));
+ /* putting back screen context, reval can pass trough after modal failures! */
+ if((retval & OPERATOR_PASS_THROUGH) || wm_event_always_pass(event)) {
+ CTX_wm_area_set(C, area);
+ CTX_wm_region_set(C, region);
+ }
+ else {
+ /* this special cases is for areas and regions that get removed */
+ CTX_wm_area_set(C, NULL);
+ CTX_wm_region_set(C, NULL);
+ }
- BLI_remlink(handlers, handler);
- wm_event_free_handler(handler);
-
- /* prevent silly errors from operator users */
- //retval &= ~OPERATOR_PASS_THROUGH;
+ if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED))
+ wm_operator_reports(C, op, retval, 0);
+
+ if(retval & OPERATOR_FINISHED) {
+ wm_operator_finished(C, op, 0);
+ handler->op= NULL;
+ }
+ else if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
+ WM_operator_free(op);
+ handler->op= NULL;
+ }
+
+ /* remove modal handler, operator itself should have been cancelled and freed */
+ if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
+ WM_cursor_ungrab(CTX_wm_window(C));
+
+ BLI_remlink(handlers, handler);
+ wm_event_free_handler(handler);
+
+ /* prevent silly errors from operator users */
+ //retval &= ~OPERATOR_PASS_THROUGH;
+ }
}
}
@@ -1276,6 +1282,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
if(ot)
retval= wm_operator_invoke(C, ot, event, properties, NULL, FALSE);
}
+ /* Finished and pass through flag as handled */
/* Finished and pass through flag as handled */
if(retval == (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH))
@@ -1923,7 +1930,7 @@ void wm_event_do_handlers(bContext *C)
/* store last event for this window */
/* mousemove and timer events don't overwrite last type */
- if (event->type != MOUSEMOVE && !ISTIMER(event->type)) {
+ if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ISTIMER(event->type)) {
if (wm_action_not_handled(action)) {
if (win->eventstate->prevtype == event->type) {
/* set click time on first click (press -> release) */
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index f862af6173a..bf5b60d691f 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -226,13 +226,16 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
oldwm= oldwmlist->first;
wm= G.main->wm.first;
- /* move addon key configuration to new wm, to preserve their keymaps */
- if(oldwm->addonconf) {
- wm->addonconf= oldwm->addonconf;
- BLI_remlink(&oldwm->keyconfigs, oldwm->addonconf);
- oldwm->addonconf= NULL;
- BLI_addtail(&wm->keyconfigs, wm->addonconf);
- }
+ /* preserve key configurations in new wm, to preserve their keymaps */
+ wm->keyconfigs= oldwm->keyconfigs;
+ wm->addonconf= oldwm->addonconf;
+ wm->defaultconf= oldwm->defaultconf;
+ wm->userconf= oldwm->userconf;
+
+ oldwm->keyconfigs.first= oldwm->keyconfigs.last= NULL;
+ oldwm->addonconf= NULL;
+ oldwm->defaultconf= NULL;
+ oldwm->userconf= NULL;
/* ensure making new keymaps and set space types */
wm->initialized= 0;
@@ -286,7 +289,8 @@ static void wm_init_userdef(bContext *C)
if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC;
else G.f &= ~G_SCRIPT_AUTOEXEC;
}
- if(U.tempdir[0]) BLI_where_is_temp(btempdir, FILE_MAX, 1);
+ /* update tempdir from user preferences */
+ BLI_where_is_temp(btempdir, FILE_MAX, 1);
}
@@ -408,6 +412,10 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
BPY_app_handlers_reset();
BPY_modules_load_user(C);
#endif
+
+ /* important to do before NULL'ing the context */
+ BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
+
CTX_wm_window_set(C, NULL); /* exits queues */
#if 0 /* gives popups on windows but not linux, bug in report API but disable for now to stop users getting annoyed */
@@ -425,8 +433,6 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
// XXX undo_editmode_clear();
BKE_reset_undo();
BKE_write_undo(C, "original"); /* save current state */
-
- BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
}
else if(retval == BKE_READ_EXOTIC_OK_OTHER)
BKE_write_undo(C, "Import file");
@@ -850,14 +856,14 @@ void wm_autosave_location(char *filepath)
* BLI_make_file_string will create string that has it most likely on C:\
* through get_default_root().
* If there is no C:\tmp autosave fails. */
- if (!BLI_exists(U.tempdir)) {
+ if (!BLI_exists(btempdir)) {
savedir = BLI_get_folder_create(BLENDER_USER_AUTOSAVE, NULL);
BLI_make_file_string("/", filepath, savedir, pidstr);
return;
}
#endif
-
- BLI_make_file_string("/", filepath, U.tempdir, pidstr);
+
+ BLI_make_file_string("/", filepath, btempdir, pidstr);
}
void WM_autosave_init(wmWindowManager *wm)
@@ -915,7 +921,7 @@ void wm_autosave_delete(void)
if(BLI_exists(filename)) {
char str[FILE_MAXDIR+FILE_MAXFILE];
- BLI_make_file_string("/", str, U.tempdir, "quit.blend");
+ BLI_make_file_string("/", str, btempdir, "quit.blend");
/* if global undo; remove tempsave, otherwise rename */
if(U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, 0, 0);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index b57d3218484..f35499e27d6 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -404,7 +404,7 @@ void WM_exit_ext(bContext *C, const short do_python)
BLF_exit();
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
BLF_free_unifont();
#endif
@@ -428,6 +428,8 @@ void WM_exit_ext(bContext *C, const short do_python)
* the pyDriver bug can be fixed if it happens again we can deal with it then */
BPY_python_end();
}
+#else
+ (void)do_python;
#endif
GPU_global_buffer_pool_free();
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 320dc2ecdda..eda85f112df 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -863,7 +863,8 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
RNA_def_boolean(ot->srna, "relative_path", (U.flag & USER_RELPATHS) ? 1:0, "Relative Path", "Select the file relative to the blend file");
}
-void WM_operator_properties_select_all(wmOperatorType *ot) {
+void WM_operator_properties_select_all(wmOperatorType *ot)
+{
static EnumPropertyItem select_all_actions[] = {
{SEL_TOGGLE, "TOGGLE", 0, N_("Toggle"), "Toggle selection for all elements"},
{SEL_SELECT, "SELECT", 0, N_("Select"), "Select all elements"},
@@ -1207,9 +1208,6 @@ static int wm_resource_check_prev(void)
static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(arg))
{
- extern char datatoc_splash_png[];
- extern int datatoc_splash_png_size;
-
uiBlock *block;
uiBut *but;
uiLayout *layout, *split, *col;
@@ -1218,9 +1216,17 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
int i;
MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE);
char url[96];
- /* hardcoded to splash, loading and freeing every draw, eek! */
+
+#ifndef WITH_HEADLESS
+ extern char datatoc_splash_png[];
+ extern int datatoc_splash_png_size;
+
ImBuf *ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
-
+#else
+ ImBuf *ibuf= NULL;
+#endif
+
+
#ifdef WITH_BUILDINFO
int ver_width, rev_width;
char *version_str = NULL;
@@ -1274,7 +1280,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
uiItemL(col, "Links", ICON_NONE);
uiItemStringO(col, UI_translate_do_iface(N_("Donations")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment");
uiItemStringO(col, UI_translate_do_iface(N_("Credits")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits");
- uiItemStringO(col, UI_translate_do_iface(N_("Release Log")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259");
+ uiItemStringO(col, UI_translate_do_iface(N_("Release Log")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-260");
uiItemStringO(col, UI_translate_do_iface(N_("Manual")), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual");
uiItemStringO(col, UI_translate_do_iface(N_("Blender Website")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org");
uiItemStringO(col, UI_translate_do_iface(N_("User Community")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community");
@@ -1620,7 +1626,15 @@ static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
}
else {
/* XXX TODO solve where to get last linked library from */
- RNA_string_set(op->ptr, "filepath", G.lib);
+ if(G.lib[0] != '\0') {
+ RNA_string_set(op->ptr, "filepath", G.lib);
+ }
+ else if(G.relbase_valid) {
+ char path[FILE_MAX];
+ BLI_strncpy(path, G.main->name, sizeof(G.main->name));
+ BLI_parent_dir(path);
+ RNA_string_set(op->ptr, "filepath", path);
+ }
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
}
@@ -1962,7 +1976,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot)
WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file");
RNA_def_boolean(ot->srna, "relative_remap", 1, "Remap Relative", "Remap relative paths when saving in a different directory");
- RNA_def_boolean(ot->srna, "copy", 0, "Save Copy", "Save a copy of the actual working state but does not make saved file active.");
+ RNA_def_boolean(ot->srna, "copy", 0, "Save Copy", "Save a copy of the actual working state but does not make saved file active");
}
/* *************** save file directly ******** */
@@ -3279,12 +3293,12 @@ static void WM_OT_radial_control(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* all paths relative to the context */
- RNA_def_string(ot->srna, "data_path", "", 0, "Data Path", "Path of property to be set by the radial control.");
- RNA_def_string(ot->srna, "rotation_path", "", 0, "Rotation Path", "Path of property used to rotate the texture display.");
- RNA_def_string(ot->srna, "color_path", "", 0, "Color Path", "Path of property used to set the color of the control.");
- RNA_def_string(ot->srna, "fill_color_path", "", 0, "Fill Color Path", "Path of property used to set the fill color of the control.");
- RNA_def_string(ot->srna, "zoom_path", "", 0, "Zoom Path", "Path of property used to set the zoom level for the control.");
- RNA_def_string(ot->srna, "image_id", "", 0, "Image ID", "Path of ID that is used to generate an image for the control.");
+ RNA_def_string(ot->srna, "data_path", "", 0, "Data Path", "Path of property to be set by the radial control");
+ RNA_def_string(ot->srna, "rotation_path", "", 0, "Rotation Path", "Path of property used to rotate the texture display");
+ RNA_def_string(ot->srna, "color_path", "", 0, "Color Path", "Path of property used to set the color of the control");
+ RNA_def_string(ot->srna, "fill_color_path", "", 0, "Fill Color Path", "Path of property used to set the fill color of the control");
+ RNA_def_string(ot->srna, "zoom_path", "", 0, "Zoom Path", "Path of property used to set the zoom level for the control");
+ RNA_def_string(ot->srna, "image_id", "", 0, "Image ID", "Path of ID that is used to generate an image for the control");
}
/* ************************** timer for testing ***************** */
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index d9ca275c819..405960d0795 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -111,14 +111,12 @@ static void wm_window_check_position(rcti *rect)
#endif
if(rect->xmin < 0) {
- d= rect->xmin;
- rect->xmax -= d;
- rect->xmin -= d;
+ rect->xmax -= rect->xmin;
+ rect->xmin = 0;
}
if(rect->ymin < 0) {
- d= rect->ymin;
- rect->ymax -= d;
- rect->ymin -= d;
+ rect->ymax -= rect->ymin;
+ rect->ymin = 0;
}
if(rect->xmax > width) {
d= rect->xmax - width;
diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt
index c8bf3b002f1..82847cb8079 100644
--- a/source/blenderplayer/CMakeLists.txt
+++ b/source/blenderplayer/CMakeLists.txt
@@ -63,6 +63,18 @@ if(WIN32 AND NOT UNIX)
endif()
add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
+
+elseif(APPLE)
+ add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
+ # setup Info.plist
+ execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
+ set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
+ set_target_properties(blenderplayer PROPERTIES
+ MACOSX_BUNDLE_INFO_PLIST ${PLAYER_SOURCEINFO}
+ MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
+ MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
+
else()
add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
endif()
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 665c1fa1b58..31e76d31f75 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -342,6 +342,7 @@ void uiItemS(struct uiLayout *layout){}
void uiItemFullR(struct uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, char *name, int icon){}
void uiLayoutSetContextPointer(struct uiLayout *layout, char *name, struct PointerRNA *ptr){}
char *uiLayoutIntrospect(struct uiLayout *layout){return (char *)NULL;}
+void UI_reinit_font() {}
/* rna template */
void uiTemplateAnyID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *text){}
@@ -373,6 +374,7 @@ void uiTemplateNodeLink(struct uiLayout *layout, struct bNodeTree *ntree, struct
void uiTemplateNodeView(struct uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input) {}
void uiTemplateTextureUser(struct uiLayout *layout, struct bContext *C) {}
void uiTemplateTextureShow(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop) {}
+void uiTemplateKeymapItemProperties(struct uiLayout *layout, struct PointerRNA *ptr){}
/* rna render */
struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;}
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index eef21bd480d..c1ba7ebbb67 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -125,7 +125,7 @@ if(WIN32 AND NOT UNIX)
-DBLEN_VER_RC_4=0
)
endif()
-
+
list(APPEND SRC
../icons/winblender.rc
@@ -198,16 +198,16 @@ if(WITH_PYTHON_MODULE)
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows
)
-
+
if(WIN32)
# python modules use this
set_target_properties(
blender
PROPERTIES
SUFFIX ".pyd"
- )
+ )
endif()
-
+
else()
add_executable(blender ${EXETYPE} ${SRC})
endif()
@@ -351,11 +351,6 @@ if(UNIX AND NOT APPLE)
if(WITH_INTERNATIONAL)
install(
- FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
- DESTINATION ${TARGETDIR_VER}
- )
-
- install(
DIRECTORY
${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
@@ -428,10 +423,6 @@ elseif(WIN32)
if(WITH_INTERNATIONAL) # same as linux!, deduplicate
install(
- FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
- DESTINATION ${TARGETDIR_VER}
- )
- install(
DIRECTORY
${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
@@ -591,12 +582,12 @@ elseif(WIN32)
FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
DESTINATION ${TARGETDIR}
)
- else()
- install(
- FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
- DESTINATION ${TARGETDIR}
- )
endif()
+
+ install( # x86 builds can run on x64 Windows, so this is required at all times
+ FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
+ DESTINATION ${TARGETDIR}
+ )
if(WITH_OPENIMAGEIO)
install(
@@ -672,11 +663,6 @@ elseif(APPLE)
# localization
if(WITH_INTERNATIONAL)
install(
- FILES ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages
- DESTINATION ${TARGETDIR_VER}/datafiles
- )
-
- install(
DIRECTORY
${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
@@ -695,14 +681,14 @@ elseif(APPLE)
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python)
set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
-
+
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
-
+
add_dependencies(blender extractpyzip)
# copy extracted python files
@@ -717,6 +703,48 @@ elseif(APPLE)
\${TARGETDIR_VER}
)
endif()
+
+ # install blenderplayer bundle - copy of blender.app above. re-using macros et al
+ # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
+ if(WITH_GAMEENGINE AND WITH_PLAYER)
+ set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
+ set(PLAYER_SOURCEINFO ${PLAYER_SOURCEDIR}/Contents/Info.plist)
+ set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
+
+
+ # important to make a clean install each time else old scripts get loaded.
+ install(
+ CODE
+ "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
+ )
+
+ install(
+ FILES ${PLAYER_SOURCEDIR}/Contents/PkgInfo
+ DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
+ )
+
+ install_dir(
+ ${PLAYER_SOURCEDIR}/Contents/Resources
+ \${TARGETDIR}/blenderplayer.app/Contents/
+ )
+
+ # python
+ if(WITH_PYTHON)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
+ COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
+ COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
+ COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
+ DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
+
+ # copy extracted python files
+ install_dir(
+ ${CMAKE_CURRENT_BINARY_DIR}/python
+ \${PLAYER_TARGETDIR_VER}
+ )
+ endif()
+
+ endif()
endif()
# install more files XXX pass target dir
@@ -905,12 +933,12 @@ endif()
message(STATUS "Blender Skipping: (${REM_MSG})")
endif()
target_link_libraries(blender ${BLENDER_SORTED_LIBS})
-
+
unset(SEARCHLIB)
unset(SORTLIB)
unset(REMLIB)
unset(REM_MSG)
-
+
#else()
# target_link_libraries(blender ${BLENDER_LINK_LIBS})
#endif()
diff --git a/source/creator/creator.c b/source/creator/creator.c
index abb993e4cb1..64f8cf463da 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -46,12 +46,6 @@
#include <stddef.h>
#include <string.h>
-/* for setuid / getuid */
-#ifdef __sgi
-#include <sys/types.h>
-#include <unistd.h>
-#endif
-
/* This little block needed for linking to Blender... */
#include "MEM_guardedalloc.h"
@@ -157,7 +151,7 @@ char btempdir[FILE_MAX];
static void setCallbacks(void);
/* set breakpoints here when running in debug mode, useful to catch floating point errors */
-#if defined(__sgi) || defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
+#if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
static void fpe_handler(int UNUSED(sig))
{
// printf("SIGFPE trapped\n");
@@ -366,7 +360,7 @@ static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
static int set_fpe(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
{
-#if defined(__sgi) || defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
+#if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
/* zealous but makes float issues a heck of a lot easier to find!
* set breakpoints on fpe_handler */
signal(SIGFPE, fpe_handler);
@@ -490,7 +484,7 @@ static int no_joystick(int UNUSED(argc), const char **UNUSED(argv), void *data)
SYS_SystemHandle *syshandle = data;
/**
- don't initialize joysticks if user doesn't want to use joysticks
+ don't initialize joysticks if user doesn't want to use joysticks
failed joystick initialization delays over 5 seconds, before game engine start
*/
SYS_WriteCommandLineInt(*syshandle, "nojoystick",1);
@@ -527,8 +521,8 @@ static int set_output(int argc, const char **argv, void *data)
{
bContext *C = data;
if (argc >= 1){
- if (CTX_data_scene(C)) {
- Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
BLI_strncpy(scene->r.pic, argv[1], sizeof(scene->r.pic));
} else {
printf("\nError: no blend loaded. cannot use '-o / --render-output'.\n");
@@ -553,17 +547,17 @@ static int set_engine(int argc, const char **argv, void *data)
exit(0);
}
else {
- if (CTX_data_scene(C)==NULL) {
- printf("\nError: no blend loaded. order the arguments so '-E / --engine ' is after a blend is loaded.\n");
- }
- else {
- Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
RenderData *rd = &scene->r;
if(BLI_findstring(&R_engines, argv[1], offsetof(RenderEngineType, idname))) {
BLI_strncpy_utf8(rd->engine, argv[1], sizeof(rd->engine));
}
}
+ else {
+ printf("\nError: no blend loaded. order the arguments so '-E / --engine ' is after a blend is loaded.\n");
+ }
}
return 1;
@@ -580,10 +574,8 @@ static int set_image_type(int argc, const char **argv, void *data)
bContext *C = data;
if (argc >= 1){
const char *imtype = argv[1];
- if (CTX_data_scene(C)==NULL) {
- printf("\nError: no blend loaded. order the arguments so '-F / --render-format' is after the blend is loaded.\n");
- } else {
- Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
if (!strcmp(imtype,"TGA")) scene->r.imtype = R_TARGA;
else if (!strcmp(imtype,"IRIS")) scene->r.imtype = R_IRIS;
#ifdef WITH_DDS
@@ -619,6 +611,9 @@ static int set_image_type(int argc, const char **argv, void *data)
#endif
else printf("\nError: Format from '-F / --render-format' not known or not compiled in this release.\n");
}
+ else {
+ printf("\nError: no blend loaded. order the arguments so '-F / --render-format' is after the blend is loaded.\n");
+ }
return 1;
} else {
printf("\nError: you must specify a format after '-F / --render-foramt'.\n");
@@ -645,8 +640,8 @@ static int set_extension(int argc, const char **argv, void *data)
{
bContext *C = data;
if (argc >= 1) {
- if (CTX_data_scene(C)) {
- Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
if (argv[1][0] == '0') {
scene->r.scemode &= ~R_EXTENSION;
} else if (argv[1][0] == '1') {
@@ -728,9 +723,9 @@ example:
static int render_frame(int argc, const char **argv, void *data)
{
bContext *C = data;
- if (CTX_data_scene(C)) {
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
if (argc > 1) {
Render *re = RE_NewRender(scene->id.name);
@@ -770,9 +765,9 @@ static int render_frame(int argc, const char **argv, void *data)
static int render_animation(int UNUSED(argc), const char **UNUSED(argv), void *data)
{
bContext *C = data;
- if (CTX_data_scene(C)) {
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
Render *re= RE_NewRender(scene->id.name);
ReportList reports;
BKE_reports_init(&reports, RPT_PRINT);
@@ -789,9 +784,9 @@ static int set_scene(int argc, const char **argv, void *data)
{
if(argc > 1) {
bContext *C= data;
- Scene *sce= set_scene_name(CTX_data_main(C), argv[1]);
- if(sce) {
- CTX_data_scene_set(C, sce);
+ Scene *scene= set_scene_name(CTX_data_main(C), argv[1]);
+ if(scene) {
+ CTX_data_scene_set(C, scene);
}
return 1;
} else {
@@ -803,8 +798,8 @@ static int set_scene(int argc, const char **argv, void *data)
static int set_start_frame(int argc, const char **argv, void *data)
{
bContext *C = data;
- if (CTX_data_scene(C)) {
- Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
if (argc > 1) {
int frame = atoi(argv[1]);
(scene->r.sfra) = CLAMPIS(frame, MINFRAME, MAXFRAME);
@@ -822,8 +817,8 @@ static int set_start_frame(int argc, const char **argv, void *data)
static int set_end_frame(int argc, const char **argv, void *data)
{
bContext *C = data;
- if (CTX_data_scene(C)) {
- Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
if (argc > 1) {
int frame = atoi(argv[1]);
(scene->r.efra) = CLAMPIS(frame, MINFRAME, MAXFRAME);
@@ -841,8 +836,8 @@ static int set_end_frame(int argc, const char **argv, void *data)
static int set_skip_frame(int argc, const char **argv, void *data)
{
bContext *C = data;
- if (CTX_data_scene(C)) {
- Scene *scene= CTX_data_scene(C);
+ Scene *scene= CTX_data_scene(C);
+ if (scene) {
if (argc > 1) {
int frame = atoi(argv[1]);
(scene->r.frame_step) = CLAMPIS(frame, 1, MAXFRAME);
@@ -1194,10 +1189,6 @@ int main(int argc, const char **argv)
BLI_argsParse(ba, 1, NULL, NULL);
-#ifdef __sgi
- setuid(getuid()); /* end superuser */
-#endif
-
#if defined(WITH_PYTHON_MODULE) || defined(WITH_HEADLESS)
G.background= 1; /* python module mode ALWAYS runs in background mode (for now) */
#else
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index 895def17e8e..557b4aa7f11 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -226,10 +226,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
break;
}
- // Continue only really makes sense for play stop and flipper. All other modes go until they are complete.
- if (m_flag & ACT_FLAG_CONTINUE &&
- (m_playtype == ACT_ACTION_LOOP_STOP ||
- m_playtype == ACT_ACTION_FLIPPER))
+ if (m_flag & ACT_FLAG_CONTINUE)
bUseContinue = true;
@@ -244,12 +241,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
if (m_flag & ACT_FLAG_ATTEMPT_PLAY)
SetLocalTime(curtime);
- if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE))
- {
- m_localtime = obj->GetActionFrame(m_layer);
- ResetStartTime(curtime);
- }
-
// Handle a frame property if it's defined
if ((m_flag & ACT_FLAG_ACTIVE) && m_framepropname[0] != 0)
{
@@ -264,22 +255,25 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
}
// Handle a finished animation
- if ((m_flag & ACT_FLAG_PLAY_END) && obj->IsActionDone(m_layer))
+ if ((m_flag & ACT_FLAG_PLAY_END) && (m_flag & ACT_FLAG_ACTIVE) && obj->IsActionDone(m_layer))
{
m_flag &= ~ACT_FLAG_ACTIVE;
m_flag &= ~ACT_FLAG_ATTEMPT_PLAY;
- obj->StopAction(m_layer);
return false;
}
// If a different action is playing, we've been overruled and are no longer active
- if (obj->GetCurrentAction(m_layer) != m_action)
+ if (obj->GetCurrentAction(m_layer) != m_action && !obj->IsActionDone(m_layer))
m_flag &= ~ACT_FLAG_ACTIVE;
if (bPositiveEvent || (m_flag & ACT_FLAG_ATTEMPT_PLAY && !(m_flag & ACT_FLAG_ACTIVE)))
{
if (bPositiveEvent)
+ {
+ if (obj->IsActionDone(m_layer))
+ m_localtime = start;
ResetStartTime(curtime);
+ }
if (obj->PlayAction(m_action->id.name+2, start, end, m_layer, m_priority, m_blendin, playtype, m_layer_weight, m_ipo_flags))
{
@@ -307,11 +301,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
return false;
}
-
- m_localtime = obj->GetActionFrame(m_layer);
- if (m_localtime < min(m_startframe, m_endframe) || m_localtime > max(m_startframe, m_endframe))
- m_localtime = m_startframe;
-
switch(m_playtype)
{
case ACT_ACTION_LOOP_STOP:
@@ -340,6 +329,12 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
break;
}
}
+
+ if (bUseContinue && (m_flag & ACT_FLAG_ACTIVE))
+ {
+ m_localtime = obj->GetActionFrame(m_layer);
+ ResetStartTime(curtime);
+ }
return true;
}
diff --git a/source/gameengine/Converter/BL_ArmatureChannel.cpp b/source/gameengine/Converter/BL_ArmatureChannel.cpp
index df3a575850b..5442878d6c5 100644
--- a/source/gameengine/Converter/BL_ArmatureChannel.cpp
+++ b/source/gameengine/Converter/BL_ArmatureChannel.cpp
@@ -279,19 +279,19 @@ PyObject* BL_ArmatureChannel::py_attr_get_joint_rotation(void *self_v, const str
if (sa > FLT_EPSILON) {
norm = atan2(sa,ca)/sa;
} else {
- if (ca < 0.0) {
- norm = M_PI;
- mul_v3_fl(joints,0.f);
- if (joint_mat[0][0] > 0.f) {
- joints[0] = 1.0f;
- } else if (joint_mat[1][1] > 0.f) {
- joints[1] = 1.0f;
- } else {
- joints[2] = 1.0f;
- }
- } else {
- norm = 0.0;
- }
+ if (ca < 0.0) {
+ norm = M_PI;
+ mul_v3_fl(joints,0.f);
+ if (joint_mat[0][0] > 0.f) {
+ joints[0] = 1.0f;
+ } else if (joint_mat[1][1] > 0.f) {
+ joints[1] = 1.0f;
+ } else {
+ joints[2] = 1.0f;
+ }
+ } else {
+ norm = 0.0;
+ }
}
mul_v3_fl(joints,norm);
break;
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 2c2fd052b5d..8633a14de03 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -642,7 +642,7 @@ bool ConvertMaterial(
if(validmat && (mat->mode & MA_TRANSP) && (mat->mode & MA_ZTRANSP) && (material->alphablend == GEMAT_SOLID))
material->alphablend = GEMAT_ALPHA;
- // always zsort alpha + add
+ // always zsort alpha + add
if((ELEM3(material->alphablend, GEMAT_ALPHA, GEMAT_ALPHA_SORT, GEMAT_ADD) || texalpha) && (material->alphablend != GEMAT_CLIP )) {
material->ras_mode |= ALPHA;
material->ras_mode |= (mat && (mat->game.alpha_blend & GEMAT_ALPHA_SORT))? ZSORT: 0;
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
index ac377cdb7ca..c81ff107a98 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
@@ -32,11 +32,7 @@
*/
-#if defined (__sgi)
-#include <math.h>
-#else
#include <cmath>
-#endif
#include "SCA_LogicManager.h"
#include "BL_ShapeActionActuator.h"
diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h
index e7b8784a076..45737bd41bc 100644
--- a/source/gameengine/Converter/BlenderWorldInfo.h
+++ b/source/gameengine/Converter/BlenderWorldInfo.h
@@ -54,22 +54,22 @@ public:
~BlenderWorldInfo();
bool hasWorld();
- bool hasMist();
- float getBackColorRed();
- float getBackColorGreen();
- float getBackColorBlue();
+ bool hasMist();
+ float getBackColorRed();
+ float getBackColorGreen();
+ float getBackColorBlue();
float getAmbientColorRed();
float getAmbientColorGreen();
float getAmbientColorBlue();
- float getMistStart();
- float getMistDistance();
- float getMistColorRed();
- float getMistColorGreen();
- float getMistColorBlue();
+ float getMistStart();
+ float getMistDistance();
+ float getMistColorRed();
+ float getMistColorGreen();
+ float getMistColorBlue();
- void
+ void
setBackColor(
float r,
float g,
diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp
index b13dbe324f5..4ea77e4349d 100644
--- a/source/gameengine/Converter/KX_IpoConvert.cpp
+++ b/source/gameengine/Converter/KX_IpoConvert.cpp
@@ -102,7 +102,7 @@ SG_Controller *BL_CreateIPO(struct bAction *action, KX_GameObject* gameobj, KX_B
rotmode = "rotation_axis_angle";
drotmode = "delta_rotation_axis_angle";
break;
- case ROT_MODE_QUAT:
+ case ROT_MODE_QUAT: /* XXX, this isnt working, currently only eulers are supported [#28853] */
rotmode = "rotation_quaternion";
drotmode = "delta_rotation_quaternion";
break;
diff --git a/source/gameengine/Expressions/KX_HashedPtr.cpp b/source/gameengine/Expressions/KX_HashedPtr.cpp
index f3233732ee3..f6cd5814e22 100644
--- a/source/gameengine/Expressions/KX_HashedPtr.cpp
+++ b/source/gameengine/Expressions/KX_HashedPtr.cpp
@@ -48,7 +48,7 @@ unsigned int KX_Hash(void * inDWord)
key += ~(key << 9);
key ^= (key >> 17);
- return (unsigned int)(key & 0xffffffff);
+ return (unsigned int)(key & 0xffffffff);
}
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index 934f2a8dd87..ade54f6d924 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -487,12 +487,12 @@ static int listvalue_buffer_contains(PyObject *self_v, PyObject *value)
static PySequenceMethods listvalue_as_sequence = {
listvalue_bufferlen,//(inquiry)buffer_length, /*sq_length*/
listvalue_buffer_concat, /*sq_concat*/
- NULL, /*sq_repeat*/
+ NULL, /*sq_repeat*/
listvalue_buffer_item, /*sq_item*/
// TODO, slicing in py3
NULL, // listvalue_buffer_slice, /*sq_slice*/
- NULL, /*sq_ass_item*/
- NULL, /*sq_ass_slice*/
+ NULL, /*sq_ass_item*/
+ NULL, /*sq_ass_slice*/
(objobjproc)listvalue_buffer_contains, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
@@ -515,12 +515,12 @@ PyTypeObject CListValue::Type = {
sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/
0, /*tp_itemsize*/
/* methods */
- py_base_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ py_base_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare*/
- py_base_repr, /*tp_repr*/
+ 0, /*tp_compare*/
+ py_base_repr, /*tp_repr*/
0, /*tp_as_number*/
&listvalue_as_sequence, /*tp_as_sequence*/
&instance_as_mapping, /*tp_as_mapping*/
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 080e7196d5a..dd4c9a880fd 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -215,7 +215,7 @@ typedef struct PyObjectPlus_Proxy {
if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \
return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \
}; \
- static const char method_name##_doc[]; \
+ static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \
PyObject* Py##method_name(PyObject* args); \
@@ -223,7 +223,7 @@ typedef struct PyObjectPlus_Proxy {
if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \
return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \
}; \
- static const char method_name##_doc[]; \
+ static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_O(class_name, method_name) \
PyObject* Py##method_name(PyObject* value); \
@@ -231,7 +231,7 @@ typedef struct PyObjectPlus_Proxy {
if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \
return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \
}; \
- static const char method_name##_doc[]; \
+ static const char method_name##_doc[]; \
#define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \
PyObject* Py##method_name(); \
@@ -239,7 +239,7 @@ typedef struct PyObjectPlus_Proxy {
if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_RuntimeError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \
return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \
}; \
- static const char method_name##_doc[]; \
+ static const char method_name##_doc[]; \
/* The line above should remain empty */
@@ -563,7 +563,7 @@ public:
/** enable/disable display of deprecation warnings */
static void SetDeprecationWarnings(bool ignoreDeprecationWarnings);
- /** Shows a deprecation warning */
+ /** Shows a deprecation warning */
static void ShowDeprecationWarning_func(const char* method,const char* prop);
static void ClearDeprecationWarning();
diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
index 7c1824cd4eb..33d7ec5b4fc 100644
--- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
@@ -134,7 +134,7 @@ PyTypeObject SCA_2DFilterActuator::Type = {
PyMethodDef SCA_2DFilterActuator::Methods[] = {
/* add python functions to deal with m_msg... */
- {NULL,NULL}
+ {NULL,NULL}
};
PyAttributeDef SCA_2DFilterActuator::Attributes[] = {
diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h
index 82c82ac3be5..01396839291 100644
--- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h
+++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h
@@ -38,7 +38,7 @@
class SCA_2DFilterActuator : public SCA_IActuator
{
- Py_Header;
+ Py_Header;
private:
vector<STR_String> m_propNames;
diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.cpp b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
index 19633c2e09d..b61e4f4edca 100644
--- a/source/gameengine/GameLogic/SCA_JoystickManager.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickManager.cpp
@@ -83,8 +83,8 @@ void SCA_JoystickManager::NextFrame(double curtime,double deltatime)
SCA_Joystick *SCA_JoystickManager::GetJoystickDevice( short int joyindex)
{
- /*
- *Return the instance of SCA_Joystick for use
- */
+ /*
+ *Return the instance of SCA_Joystick for use
+ */
return m_joystick[joyindex];
}
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index b452bb97cde..479cf3fd7cc 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -79,7 +79,7 @@ if(WITH_CODEC_FFMPEG)
endif()
if(WITH_INTERNATIONAL)
- add_definitions(-DINTERNATIONAL)
+ add_definitions(-DWITH_INTERNATIONAL)
endif()
blender_add_lib_nolist(ge_player_ghost "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 726a1d4119a..f5bd3a91c26 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -999,7 +999,7 @@ int main(int argc, char** argv)
RNA_exit();
BLF_exit();
-#ifdef INTERNATIONAL
+#ifdef WITH_INTERNATIONAL
BLF_free_unifont();
#endif
diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript
index 57c1122c2cd..9fb0f053ed8 100644
--- a/source/gameengine/GamePlayer/ghost/SConscript
+++ b/source/gameengine/GamePlayer/ghost/SConscript
@@ -52,6 +52,6 @@ if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
if env['WITH_BF_INTERNATIONAL']:
- defs.append('INTERNATIONAL')
+ defs.append('WITH_INTERNATIONAL')
env.BlenderLib (libname='ge_player_ghost', sources=source_files, includes = incs, defines = defs, libtype=['player'],priority=[0], cxx_compileflags=env['BGE_CXXFLAGS'])
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index ebb291b2284..7df08b83d49 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -253,7 +253,7 @@ bool KX_CameraActuator::Update(double curtime, bool frame)
/* ... set up some parameters ... */
/* missing here: the 'floorloc' of the actor's shadow */
- mindistsq= m_minHeight*m_minHeight;
+ mindistsq= m_minHeight*m_minHeight;
maxdistsq= m_maxHeight*m_maxHeight;
/* C1: not checked... is a future option */
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index f0ea6f15ffe..48ad99ae37b 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -231,26 +231,12 @@ void KX_Dome::CalculateImageSize(void)
- reduce the buffer for better performace
- create a power of 2 texture bigger than the buffer
*/
-/*
-Blender handles Canvas size differently when in fullscreen mode.
-We are manually checking for that. Although it's a hack, it works.
-
-Bug reported here: #18655 - Inconsistency of pixels in canvas dimensions when in maximized mode (affecting BGE Dome)
-http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125
-*/
-
canvaswidth = m_canvas->GetWidth();
canvasheight = m_canvas->GetHeight();
- bool fullscreen(false); //XXX HACK
- fullscreen = (canvaswidth != m_viewport.GetWidth());
-
m_buffersize = (canvaswidth > canvasheight?canvasheight:canvaswidth);
m_buffersize = (int)(m_buffersize*m_resbuffer); //reduce buffer size for better performance
- if (fullscreen) //XXX HACK
- m_buffersize --;
-
int i = 0;
while ((1 << i) <= m_buffersize)
i++;
@@ -266,10 +252,6 @@ http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125
warp.bufferwidth = canvaswidth;
warp.bufferheight = canvasheight;
}
-
- //XXX HACK
- canvaswidth = m_viewport.GetWidth();
- canvasheight = m_viewport.GetHeight();
}
bool KX_Dome::CreateDL(){
diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h
index 844f40f0578..009fb0b92ea 100644
--- a/source/gameengine/Ketsji/KX_Dome.h
+++ b/source/gameengine/Ketsji/KX_Dome.h
@@ -57,22 +57,21 @@ class KX_Dome
{
public:
/// constructor
- KX_Dome (
- RAS_ICanvas* m_canvas,
- /// rasterizer
- RAS_IRasterizer* m_rasterizer,
- /// render tools
- RAS_IRenderTools* m_rendertools,
- /// engine
- KX_KetsjiEngine* m_engine,
-
- short res,
- short mode,
- short angle,
- float resbuf,
- short tilt,
- struct Text* warptext
- );
+ KX_Dome (RAS_ICanvas* m_canvas,
+ /// rasterizer
+ RAS_IRasterizer* m_rasterizer,
+ /// render tools
+ RAS_IRenderTools* m_rendertools,
+ /// engine
+ KX_KetsjiEngine* m_engine,
+
+ short res,
+ short mode,
+ short angle,
+ float resbuf,
+ short tilt,
+ struct Text* warptext
+ );
/// destructor
virtual ~KX_Dome (void);
@@ -180,14 +179,14 @@ protected:
/// rendered scene
KX_Scene * m_scene;
- /// canvas
- RAS_ICanvas* m_canvas;
- /// rasterizer
- RAS_IRasterizer* m_rasterizer;
- /// render tools
- RAS_IRenderTools* m_rendertools;
- /// engine
- KX_KetsjiEngine* m_engine;
+ /// canvas
+ RAS_ICanvas* m_canvas;
+ /// rasterizer
+ RAS_IRasterizer* m_rasterizer;
+ /// render tools
+ RAS_IRenderTools* m_rendertools;
+ /// engine
+ KX_KetsjiEngine* m_engine;
#ifdef WITH_CXX_GUARDEDALLOC
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 853b36b54f7..e5e9c3330e5 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -110,9 +110,9 @@ KX_GameObject::KX_GameObject(
m_pGraphicController(NULL),
m_xray(false),
m_pHitObject(NULL),
+ m_pObstacleSimulation(NULL),
m_actionManager(NULL),
- m_isDeformable(false),
- m_pObstacleSimulation(NULL)
+ m_isDeformable(false)
#ifdef WITH_PYTHON
, m_attr_dict(NULL)
#endif
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp
index aed6c666404..cc5a8ecc727 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.cpp
+++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp
@@ -33,12 +33,7 @@
* \ingroup ketsji
*/
-
-#if defined (__sgi)
-#include <math.h>
-#else
#include <cmath>
-#endif
#include "KX_IpoActuator.h"
#include "KX_GameObject.h"
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index acd25ace04a..8e6126bb173 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -765,12 +765,12 @@ else
m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true);
SG_SetActiveStage(SG_STAGE_ACTUATOR);
scene->UpdateParents(m_clockTime);
-
- scene->setSuspendedTime(0.0);
+
+ scene->setSuspendedTime(0.0);
} // suspended
- else
- if(scene->getSuspendedTime()==0.0)
- scene->setSuspendedTime(m_clockTime);
+ else
+ if(scene->getSuspendedTime()==0.0)
+ scene->setSuspendedTime(m_clockTime);
m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(), true);
}
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
index 73c5d94e4a5..07787665b1d 100644
--- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h
+++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h
@@ -140,7 +140,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
*/
bool m_positive_event;
- /**
+ /**
* Tests whether the object is in mouse focus for this camera
*/
bool ParentObjectHasFocusCamera(KX_Camera *cam);
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
index 5747d8641d0..0ee1ca20234 100644
--- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp
+++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
@@ -518,7 +518,7 @@ void KX_NavMeshObject::DrawNavMesh(NavMeshRenderMode renderMode)
else
v = m_navMesh->getDetailVertex(pd->vbase+(t[k]-p->nv));
float pos[3];
- vcopy(pos, v);
+ rcVcopy(pos, v);
flipAxes(pos);
tri[k].setValue(pos);
}
diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp
index 913a1adac55..eca4d45e9c6 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.cpp
+++ b/source/gameengine/Ketsji/KX_NearSensor.cpp
@@ -49,8 +49,8 @@ KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr,
float resetmargin,
bool bFindMaterial,
const STR_String& touchedpropname,
- PHY_IPhysicsController* ctrl)
- :KX_TouchSensor(eventmgr,
+ PHY_IPhysicsController* ctrl)
+ :KX_TouchSensor(eventmgr,
gameobj,
bFindMaterial,
false,
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h
index 0737535b84c..3ba257b4f05 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.h
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.h
@@ -100,7 +100,7 @@ class KX_ObjectActuator : public SCA_IActuator
// used in servo control
MT_Vector3 m_previous_error;
MT_Vector3 m_error_accumulator;
- KX_LocalFlags m_bitLocalFlag;
+ KX_LocalFlags m_bitLocalFlag;
KX_GameObject* m_reference;
// A hack bool -- oh no sorry everyone
// This bool is used to check if we have informed
diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
index 5f78d9a3722..c2b53fb71ba 100644
--- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
+++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
@@ -633,7 +633,7 @@ static void processSamples(KX_Obstacle* activeObst, KX_NavMeshObject* activeNavM
const float ivmax = 1.0f / vmax;
- float adir[2], adist;
+ float adir[2] /*, adist */;
vcpy(adir, activeObst->pvel);
if (vlen(adir) > 0.01f)
vnorm(adir);
@@ -641,7 +641,7 @@ static void processSamples(KX_Obstacle* activeObst, KX_NavMeshObject* activeNavM
vset(adir,0,0);
float activeObstPos[2];
vset(activeObstPos, activeObst->m_pos.x(), activeObst->m_pos.y());
- adist = vdot(adir, activeObstPos);
+ /* adist = vdot(adir, activeObstPos); */
float minPenalty = FLT_MAX;
diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h
index 2ae7b00cb86..8bbe888f74f 100644
--- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h
+++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h
@@ -41,12 +41,12 @@ class KX_IScalarInterpolator;
class KX_OrientationInterpolator : public KX_IInterpolator {
public:
- KX_OrientationInterpolator(MT_Matrix3x3& target,
- KX_IScalarInterpolator **ipos)
- : m_target(target)
- {
- m_ipos[0] = ipos[0];
- m_ipos[1] = ipos[1];
+ KX_OrientationInterpolator(MT_Matrix3x3& target,
+ KX_IScalarInterpolator **ipos)
+ : m_target(target)
+ {
+ m_ipos[0] = ipos[0];
+ m_ipos[1] = ipos[1];
m_ipos[2] = ipos[2];
}
diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h
index a850cc72eb9..6984465623d 100644
--- a/source/gameengine/Ketsji/KX_ParentActuator.h
+++ b/source/gameengine/Ketsji/KX_ParentActuator.h
@@ -56,8 +56,8 @@ class KX_ParentActuator : public SCA_IActuator
- public:
- enum KX_PARENTACT_MODE
+public:
+ enum KX_PARENTACT_MODE
{
KX_PARENT_NODEF = 0,
KX_PARENT_SET,
@@ -65,7 +65,7 @@ class KX_ParentActuator : public SCA_IActuator
KX_PARENT_MAX
};
-
+
KX_ParentActuator(class SCA_IObject* gameobj,
int mode,
bool addToCompound,
diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp
index 04a53fbb493..729376f0a24 100644
--- a/source/gameengine/Ketsji/KX_PythonSeq.cpp
+++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp
@@ -375,9 +375,9 @@ static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self)
return (PyObject *)self;
} else {
return KX_PythonSeq_CreatePyObject(self->base, self->type);
- }
- }
-
+ }
+}
+
/*
* Return next KX_PythonSeq iter.
diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
index 04b2c00f4c1..ecae0eba6cd 100644
--- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
@@ -50,10 +50,10 @@ class KX_SCA_DynamicActuator : public SCA_IActuator
float m_setmass;
public:
KX_SCA_DynamicActuator(
- SCA_IObject* gameobj,
- short dyn_operation,
- float setmass
- );
+ SCA_IObject* gameobj,
+ short dyn_operation,
+ float setmass
+ );
~KX_SCA_DynamicActuator(
);
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index a0a2e148c1e..f998da18f83 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -46,38 +46,38 @@
/* ------------------------------------------------------------------------- */
KX_SteeringActuator::KX_SteeringActuator(SCA_IObject *gameobj,
- int mode,
- KX_GameObject *target,
- KX_GameObject *navmesh,
- float distance,
- float velocity,
- float acceleration,
- float turnspeed,
- bool isSelfTerminated,
- int pathUpdatePeriod,
- KX_ObstacleSimulation* simulation,
- short facingmode,
- bool normalup,
- bool enableVisualization) :
- SCA_IActuator(gameobj, KX_ACT_STEERING),
- m_mode(mode),
- m_target(target),
- m_distance(distance),
- m_velocity(velocity),
- m_acceleration(acceleration),
- m_turnspeed(turnspeed),
- m_isSelfTerminated(isSelfTerminated),
- m_pathUpdatePeriod(pathUpdatePeriod),
- m_updateTime(0),
- m_isActive(false),
- m_simulation(simulation),
- m_enableVisualization(enableVisualization),
- m_facingMode(facingmode),
- m_normalUp(normalup),
- m_obstacle(NULL),
- m_pathLen(0),
- m_wayPointIdx(-1),
- m_steerVec(MT_Vector3(0, 0, 0))
+ int mode,
+ KX_GameObject *target,
+ KX_GameObject *navmesh,
+ float distance,
+ float velocity,
+ float acceleration,
+ float turnspeed,
+ bool isSelfTerminated,
+ int pathUpdatePeriod,
+ KX_ObstacleSimulation* simulation,
+ short facingmode,
+ bool normalup,
+ bool enableVisualization)
+ : SCA_IActuator(gameobj, KX_ACT_STEERING),
+ m_target(target),
+ m_mode(mode),
+ m_distance(distance),
+ m_velocity(velocity),
+ m_acceleration(acceleration),
+ m_turnspeed(turnspeed),
+ m_simulation(simulation),
+ m_updateTime(0),
+ m_obstacle(NULL),
+ m_isActive(false),
+ m_isSelfTerminated(isSelfTerminated),
+ m_enableVisualization(enableVisualization),
+ m_facingMode(facingmode),
+ m_normalUp(normalup),
+ m_pathLen(0),
+ m_pathUpdatePeriod(pathUpdatePeriod),
+ m_wayPointIdx(-1),
+ m_steerVec(MT_Vector3(0, 0, 0))
{
m_navmesh = static_cast<KX_NavMeshObject*>(navmesh);
if (m_navmesh)
@@ -325,9 +325,9 @@ inline float vdot2(const float* a, const float* b)
static bool barDistSqPointToTri(const float* p, const float* a, const float* b, const float* c)
{
float v0[3], v1[3], v2[3];
- vsub(v0, c,a);
- vsub(v1, b,a);
- vsub(v2, p,a);
+ rcVsub(v0, c,a);
+ rcVsub(v1, b,a);
+ rcVsub(v2, p,a);
const float dot00 = vdot2(v0, v0);
const float dot01 = vdot2(v0, v1);
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.h b/source/gameengine/Ketsji/KX_SteeringActuator.h
index 4f8303107f7..d337799976b 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.h
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.h
@@ -56,12 +56,12 @@ class KX_SteeringActuator : public SCA_IActuator
int m_mode;
float m_distance;
float m_velocity;
- float m_acceleration;
+ float m_acceleration;
float m_turnspeed;
KX_ObstacleSimulation* m_simulation;
- KX_Obstacle* m_obstacle;
double m_updateTime;
+ KX_Obstacle* m_obstacle;
bool m_isActive;
bool m_isSelfTerminated;
bool m_enableVisualization;
diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp
index 5589d35f44a..e92351ad110 100644
--- a/source/gameengine/Ketsji/KX_VertexProxy.cpp
+++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp
@@ -436,10 +436,14 @@ KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex)
: m_vertex(vertex),
m_mesh(mesh)
{
+ /* see bug [#27071] */
+ Py_INCREF(m_mesh->GetProxy());
}
KX_VertexProxy::~KX_VertexProxy()
{
+ /* see bug [#27071] */
+ Py_DECREF(m_mesh->GetProxy());
}
diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h
index 0163e18fde7..0b3918773e2 100644
--- a/source/gameengine/Network/NG_NetworkMessage.h
+++ b/source/gameengine/Network/NG_NetworkMessage.h
@@ -72,7 +72,7 @@ public:
{
if (! --m_refcount)
{
- delete this;
+ delete this;
}
}
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index c34a00513bf..1eed0665564 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -66,7 +66,7 @@ protected:
btIDebugDraw* m_debugDrawer;
class btDefaultCollisionConfiguration* m_collisionConfiguration;
- class btBroadphaseInterface* m_broadphase; // broadphase for dynamic world
+ class btBroadphaseInterface* m_broadphase; // broadphase for dynamic world
// for culling only
btOverlappingPairCache* m_cullingCache;
struct btDbvtBroadphase* m_cullingTree; // broadphase for culling
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 2988aa4effb..478aa0ab03c 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -207,7 +207,7 @@ public:
* @return true if stereo mode is enabled.
*/
virtual bool Stereo()=0;
- virtual StereoMode GetStereoMode()=0;
+ virtual StereoMode GetStereoMode()=0;
virtual bool InterlacedStereo()=0;
/**
* Sets which eye buffer subsequent primitives will be rendered to.
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h
index 422d6dfa1b3..baf3d9c1166 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h
@@ -39,7 +39,7 @@ void main(void)
{
vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
float gray = dot(texcolor.rgb, vec3(0.299, 0.587, 0.114));
- gl_FragColor = vec4(gray, gray, gray, texcolor.a);
+ gl_FragColor = vec4(gray, gray, gray, texcolor.a);
}
);
#endif
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h
index 475f3506c2c..7df271c15e4 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h
@@ -37,9 +37,9 @@ uniform sampler2D bgl_RenderedTexture;
void main(void)
{
- vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
+ vec4 texcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
gl_FragColor.rgb = 1.0 - texcolor.rgb;
- gl_FragColor.a = texcolor.a;
+ gl_FragColor.a = texcolor.a;
}
);
#endif
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 28a72f4bc02..24c5b22e20f 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -830,7 +830,7 @@ static int CheckTexfaceDM(void *mcol, int index)
}
*/
-static int CheckTexDM(MTFace *tface, MCol *mcol, int matnr)
+static int CheckTexDM(MTFace *tface, int has_mcol, int matnr)
{
// index is the original face index, retrieve the polygon
@@ -845,7 +845,7 @@ static int CheckTexDM(MTFace *tface, MCol *mcol, int matnr)
// don't use mcol
return 2;
}
- if (!mcol) {
+ if (!has_mcol) {
// we have to set the color from the material
unsigned char rgba[4];
current_polymat->GetMaterialRGBAColor(rgba);
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index cbfa49510a5..c28db2fd91c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -149,7 +149,7 @@ public:
virtual void SetRenderArea();
virtual void SetStereoMode(const StereoMode stereomode);
- virtual RAS_IRasterizer::StereoMode GetStereoMode();
+ virtual RAS_IRasterizer::StereoMode GetStereoMode();
virtual bool Stereo();
virtual bool InterlacedStereo();
virtual void SetEye(const StereoEye eye);
diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h
index 9e7e514b27a..3fb4eb7b55b 100644
--- a/source/gameengine/SceneGraph/SG_DList.h
+++ b/source/gameengine/SceneGraph/SG_DList.h
@@ -245,10 +245,10 @@ public:
}
}
virtual ~SG_DListHead() {}
- T* Remove()
- {
+ T* Remove()
+ {
return static_cast<T*>(SG_DList::Remove());
- }
+ }
};
diff --git a/source/gameengine/SceneGraph/SG_Node.cpp b/source/gameengine/SceneGraph/SG_Node.cpp
index 01ada4ea473..c39904bf742 100644
--- a/source/gameengine/SceneGraph/SG_Node.cpp
+++ b/source/gameengine/SceneGraph/SG_Node.cpp
@@ -128,9 +128,9 @@ Destruct()
// We'll delete m_parent_relation now anyway.
delete(m_parent_relation);
- m_parent_relation = NULL;
+ m_parent_relation = NULL;
- if (m_children.begin() != m_children.end())
+ if (m_children.begin() != m_children.end())
{
NodeList::iterator childit;
for (childit = m_children.begin();childit!=m_children.end();++childit)
diff --git a/source/gameengine/VideoTexture/ImageRender.h b/source/gameengine/VideoTexture/ImageRender.h
index 1101fbbc2d4..4dfd701ac3d 100644
--- a/source/gameengine/VideoTexture/ImageRender.h
+++ b/source/gameengine/VideoTexture/ImageRender.h
@@ -52,42 +52,42 @@ public:
virtual ~ImageRender (void);
/// get background color
- int getBackground (int idx) { return (idx < 0 || idx > 3) ? 0 : int(m_background[idx]*255.f); }
+ int getBackground (int idx) { return (idx < 0 || idx > 3) ? 0 : int(m_background[idx]*255.f); }
/// set background color
void setBackground (int red, int green, int blue, int alpha);
/// clipping distance
float getClip (void) { return m_clip; }
/// set whole buffer use
- void setClip (float clip) { m_clip = clip; }
+ void setClip (float clip) { m_clip = clip; }
protected:
- /// true if ready to render
- bool m_render;
+ /// true if ready to render
+ bool m_render;
/// rendered scene
KX_Scene * m_scene;
/// camera for render
KX_Camera * m_camera;
- /// do we own the camera?
- bool m_owncamera;
- /// for mirror operation
- KX_GameObject * m_observer;
- KX_GameObject * m_mirror;
+ /// do we own the camera?
+ bool m_owncamera;
+ /// for mirror operation
+ KX_GameObject * m_observer;
+ KX_GameObject * m_mirror;
float m_clip; // clipping distance
- float m_mirrorHalfWidth; // mirror width in mirror space
- float m_mirrorHalfHeight; // mirror height in mirror space
- MT_Point3 m_mirrorPos; // mirror center position in local space
- MT_Vector3 m_mirrorZ; // mirror Z axis in local space
- MT_Vector3 m_mirrorY; // mirror Y axis in local space
- MT_Vector3 m_mirrorX; // mirror X axis in local space
- /// canvas
- RAS_ICanvas* m_canvas;
- /// rasterizer
- RAS_IRasterizer* m_rasterizer;
- /// render tools
- RAS_IRenderTools* m_rendertools;
- /// engine
- KX_KetsjiEngine* m_engine;
+ float m_mirrorHalfWidth; // mirror width in mirror space
+ float m_mirrorHalfHeight; // mirror height in mirror space
+ MT_Point3 m_mirrorPos; // mirror center position in local space
+ MT_Vector3 m_mirrorZ; // mirror Z axis in local space
+ MT_Vector3 m_mirrorY; // mirror Y axis in local space
+ MT_Vector3 m_mirrorX; // mirror X axis in local space
+ /// canvas
+ RAS_ICanvas* m_canvas;
+ /// rasterizer
+ RAS_IRasterizer* m_rasterizer;
+ /// render tools
+ RAS_IRenderTools* m_rendertools;
+ /// engine
+ KX_KetsjiEngine* m_engine;
/// background color
float m_background[4];
diff --git a/source/gameengine/VideoTexture/ImageViewport.h b/source/gameengine/VideoTexture/ImageViewport.h
index 1b415fc58be..70c52b0781c 100644
--- a/source/gameengine/VideoTexture/ImageViewport.h
+++ b/source/gameengine/VideoTexture/ImageViewport.h
@@ -51,7 +51,7 @@ public:
/// is alpha channel used
bool getAlpha (void) { return m_alpha; }
/// set whole buffer use
- void setAlpha (bool alpha) { m_alpha = alpha; }
+ void setAlpha (bool alpha) { m_alpha = alpha; }
/// get capture size in viewport
short * getCaptureSize (void) { return m_capSize; }
@@ -71,8 +71,8 @@ protected:
short m_capSize[2];
/// use whole viewport
bool m_whole;
- /// use alpha channel
- bool m_alpha;
+ /// use alpha channel
+ bool m_alpha;
/// position of capture rectangle in viewport
GLint m_position[2];
diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt
index 3f802642d33..c5a6831a4cb 100644
--- a/source/tests/CMakeLists.txt
+++ b/source/tests/CMakeLists.txt
@@ -138,8 +138,30 @@ add_test(import_ply_small_holes ${TEST_BLENDER_EXE}
--write-blend=${TEST_OUT_DIR}/import_ply_small_holes.blend
)
-# PLY Export tests (TODO)
+# PLY Export
+add_test(export_ply_cube_all_data ${TEST_BLENDER_EXE}
+ ${TEST_SRC_DIR}/io_tests/blend_geometry/cube_all_data.blend
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
+ --run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/export_ply_cube_all_data.ply'\)
+ --md5_source=${TEST_OUT_DIR}/export_ply_cube_all_data.ply
+ --md5=6adc3748ceae8298496f99d0e7e76c15 --md5_method=FILE
+)
+add_test(export_ply_suzanne_all_data ${TEST_BLENDER_EXE}
+ ${TEST_SRC_DIR}/io_tests/blend_geometry/suzanne_all_data.blend
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
+ --run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/export_ply_suzanne_all_data.ply'\)
+ --md5_source=${TEST_OUT_DIR}/export_ply_suzanne_all_data.ply
+ --md5=68ba23f02efd6511bfd093f45f703221 --md5_method=FILE
+)
+
+add_test(export_ply_vertices ${TEST_BLENDER_EXE} # lame, add a better one
+ ${TEST_SRC_DIR}/io_tests/blend_geometry/vertices.blend
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
+ --run={'FINISHED'}&bpy.ops.export_mesh.ply\(filepath='${TEST_OUT_DIR}/export_ply_vertices.ply'\)
+ --md5_source=${TEST_OUT_DIR}/export_ply_vertices.ply
+ --md5=37faba0aa2014451b27f951afa92f870 --md5_method=FILE
+)
# STL Import tests
@@ -164,8 +186,30 @@ add_test(import_stl_knot_max_simplified ${TEST_BLENDER_EXE}
--write-blend=${TEST_OUT_DIR}/import_stl_knot_max_simplified.blend
)
-# STL Export tests (TODO)
+# STL Export
+add_test(export_stl_cube_all_data ${TEST_BLENDER_EXE}
+ ${TEST_SRC_DIR}/io_tests/blend_geometry/cube_all_data.blend
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
+ --run={'FINISHED'}&bpy.ops.export_mesh.stl\(filepath='${TEST_OUT_DIR}/export_stl_cube_all_data.stl'\)
+ --md5_source=${TEST_OUT_DIR}/export_stl_cube_all_data.stl
+ --md5=64cb97c0cabb015e1c3f76369835075a --md5_method=FILE
+)
+add_test(export_stl_suzanne_all_data ${TEST_BLENDER_EXE}
+ ${TEST_SRC_DIR}/io_tests/blend_geometry/suzanne_all_data.blend
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
+ --run={'FINISHED'}&bpy.ops.export_mesh.stl\(filepath='${TEST_OUT_DIR}/export_stl_suzanne_all_data.stl'\)
+ --md5_source=${TEST_OUT_DIR}/export_stl_suzanne_all_data.stl
+ --md5=e9b23c97c139ad64961c635105bb9192 --md5_method=FILE
+)
+
+add_test(export_stl_vertices ${TEST_BLENDER_EXE} # lame, add a better one
+ ${TEST_SRC_DIR}/io_tests/blend_geometry/vertices.blend
+ --python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
+ --run={'FINISHED'}&bpy.ops.export_mesh.stl\(filepath='${TEST_OUT_DIR}/export_stl_vertices.stl'\)
+ --md5_source=${TEST_OUT_DIR}/export_stl_vertices.stl
+ --md5=3fd3c877e573beeebc782532cc005820 --md5_method=FILE
+)
# X3D Import
@@ -196,7 +240,7 @@ add_test(export_x3d_cube ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_cube.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_cube.x3d
- --md5=2621d8cc2cc1d34f6711c54519907dac --md5_method=FILE
+ --md5=05312d278fe41da33560fdfb9bdb268f --md5_method=FILE
)
add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
@@ -204,7 +248,7 @@ add_test(export_x3d_nurbs ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_nurbs.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_nurbs.x3d
- --md5=d56b3736bab063d101d42079bd276f01 --md5_method=FILE
+ --md5=4286d4a2aa507ef78b22ddcbdcc88481 --md5_method=FILE
)
add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
@@ -212,7 +256,7 @@ add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d
- --md5=0914c9a7fcdbfc5741c1269497e9068b --md5_method=FILE
+ --md5=f5f9fa4c5619a0eeab66685aafd2f7f0 --md5_method=FILE
)
@@ -245,7 +289,7 @@ add_test(export_3ds_cube ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.autodesk_3ds\(filepath='${TEST_OUT_DIR}/export_3ds_cube.3ds',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_3ds_cube.3ds
- --md5=0df6cfb130052d01e31ef77d391d4cc0 --md5_method=FILE
+ --md5=a31f5071b6c6dc7445b9099cdc7f63b3 --md5_method=FILE
)
add_test(export_3ds_nurbs ${TEST_BLENDER_EXE}
@@ -253,7 +297,7 @@ add_test(export_3ds_nurbs ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.autodesk_3ds\(filepath='${TEST_OUT_DIR}/export_3ds_nurbs.3ds',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_3ds_nurbs.3ds
- --md5=ba1a6d43346fee3bcadc7e30e3c95935 --md5_method=FILE
+ --md5=5bdd21be3c80d814fbc83cb25edb08c2 --md5_method=FILE
)
add_test(export_3ds_all_objects ${TEST_BLENDER_EXE}
@@ -261,7 +305,7 @@ add_test(export_3ds_all_objects ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.autodesk_3ds\(filepath='${TEST_OUT_DIR}/export_3ds_all_objects.3ds',use_selection=False\)
--md5_source=${TEST_OUT_DIR}/export_3ds_all_objects.3ds
- --md5=0940ea889498cd437d503670738639ae --md5_method=FILE
+ --md5=68447761ab0ca38e1e22e7c177ed48a8 --md5_method=FILE
)
@@ -273,7 +317,7 @@ add_test(export_fbx_cube ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_cube.fbx',use_selection=False,use_metadata=False\)
--md5_source=${TEST_OUT_DIR}/export_fbx_cube.fbx
- --md5=86da2495dffd7c270e682f599be6b3d1 --md5_method=FILE
+ --md5=59a35577462f95f9a0b4e6035226ce9b --md5_method=FILE
)
add_test(export_fbx_nurbs ${TEST_BLENDER_EXE}
@@ -281,7 +325,7 @@ add_test(export_fbx_nurbs ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_nurbs.fbx',use_selection=False,use_metadata=False\)
--md5_source=${TEST_OUT_DIR}/export_fbx_nurbs.fbx
- --md5=88a263ddb5181e6522dc214debb92ced --md5_method=FILE
+ --md5=d31875f18f613fa0c3b16e978f87f6f8 --md5_method=FILE
)
add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
@@ -289,5 +333,5 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
--run={'FINISHED'}&bpy.ops.export_scene.fbx\(filepath='${TEST_OUT_DIR}/export_fbx_all_objects.fbx',use_selection=False,use_metadata=False\)
--md5_source=${TEST_OUT_DIR}/export_fbx_all_objects.fbx
- --md5=e6f75fe7de9aa366896456e13eafc76a --md5_method=FILE
+ --md5=b35eb2a9d0e73762ecae2278c25a38ac --md5_method=FILE
)
diff --git a/source/tests/bl_load_py_modules.py b/source/tests/bl_load_py_modules.py
index a88edd5f1fe..619cad67cb8 100644
--- a/source/tests/bl_load_py_modules.py
+++ b/source/tests/bl_load_py_modules.py
@@ -25,7 +25,6 @@ import addon_utils
import sys
import os
-import imp
def source_list(path, filename_check=None):