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
path: root/source
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-09-21 01:22:15 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-09-21 01:22:15 +0400
commit9c42afb1c02cafa21632bd2e19b47c012a230368 (patch)
tree90d7e190e9ba59437f1e3e31337984a2200aa764 /source
parent5582d9fac13123397297db54a0478a63a1b75194 (diff)
parent8f5112f191e24aac86da7b70f461a50825e764da (diff)
Merged changes in the trunk up to revision 40413.
Conflicts resolved: source/blender/makesrna/intern/rna_scene.c
Diffstat (limited to 'source')
-rw-r--r--source/blender/avi/intern/avirgb.c17
-rw-r--r--source/blender/avi/intern/endian.c16
-rw-r--r--source/blender/blenfont/BLF_api.h16
-rw-r--r--source/blender/blenfont/BLF_translation.h66
-rw-r--r--source/blender/blenfont/CMakeLists.txt6
-rw-r--r--source/blender/blenfont/SConscript1
-rw-r--r--source/blender/blenfont/intern/blf.c268
-rw-r--r--source/blender/blenfont/intern/blf_dir.c30
-rw-r--r--source/blender/blenfont/intern/blf_font.c286
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c47
-rw-r--r--source/blender/blenfont/intern/blf_lang.c135
-rw-r--r--source/blender/blenfont/intern/blf_translation.c86
-rw-r--r--source/blender/blenfont/intern/blf_util.c8
-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_endian.h50
-rw-r--r--source/blender/blenkernel/BKE_global.h11
-rw-r--r--source/blender/blenkernel/BKE_image.h3
-rw-r--r--source/blender/blenkernel/BKE_material.h18
-rw-r--r--source/blender/blenkernel/BKE_mesh.h2
-rw-r--r--source/blender/blenkernel/BKE_navmesh_conversion.h39
-rw-r--r--source/blender/blenkernel/BKE_paint.h1
-rw-r--r--source/blender/blenkernel/BKE_utildefines.h26
-rw-r--r--source/blender/blenkernel/CMakeLists.txt5
-rw-r--r--source/blender/blenkernel/SConscript6
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c112
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c4
-rw-r--r--source/blender/blenkernel/intern/armature.c30
-rw-r--r--source/blender/blenkernel/intern/blender.c10
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c54
-rw-r--r--source/blender/blenkernel/intern/customdata.c2
-rw-r--r--source/blender/blenkernel/intern/image.c17
-rw-r--r--source/blender/blenkernel/intern/material.c508
-rw-r--r--source/blender/blenkernel/intern/mesh.c6
-rw-r--r--source/blender/blenkernel/intern/navmesh_conversion.c (renamed from source/blender/blenkernel/intern/navmesh_conversion.cpp)263
-rw-r--r--source/blender/blenkernel/intern/node.c10
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/paint.c4
-rw-r--r--source/blender/blenkernel/intern/sound.c34
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c22
-rw-r--r--source/blender/blenlib/BLI_fileops.h1
-rw-r--r--source/blender/blenlib/BLI_math_rotation.h2
-rw-r--r--source/blender/blenlib/BLI_utildefines.h6
-rw-r--r--source/blender/blenlib/intern/fileops.c45
-rw-r--r--source/blender/blenlib/intern/math_rotation.c46
-rw-r--r--source/blender/blenloader/intern/readfile.c35
-rw-r--r--source/blender/collada/GeometryExporter.cpp2
-rw-r--r--source/blender/collada/GeometryExporter.h2
-rw-r--r--source/blender/collada/MeshImporter.cpp2
-rw-r--r--source/blender/collada/MeshImporter.h2
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c14
-rw-r--r--source/blender/editors/animation/drivers.c6
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c2
-rw-r--r--source/blender/editors/animation/keyframes_general.c2
-rw-r--r--source/blender/editors/animation/keyframing.c8
-rw-r--r--source/blender/editors/animation/keyingsets.c2
-rw-r--r--source/blender/editors/armature/CMakeLists.txt1
-rw-r--r--source/blender/editors/armature/SConscript2
-rw-r--r--source/blender/editors/armature/editarmature.c36
-rw-r--r--source/blender/editors/armature/meshlaplacian.c37
-rw-r--r--source/blender/editors/armature/poseSlide.c6
-rw-r--r--source/blender/editors/armature/poselib.c8
-rw-r--r--source/blender/editors/armature/poseobject.c6
-rw-r--r--source/blender/editors/curve/editcurve.c18
-rw-r--r--source/blender/editors/curve/editfont.c30
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/include/ED_mesh.h2
-rw-r--r--source/blender/editors/include/ED_view3d.h1
-rw-r--r--source/blender/editors/include/UI_interface.h8
-rw-r--r--source/blender/editors/interface/interface.c62
-rw-r--r--source/blender/editors/interface/interface_draw.c10
-rw-r--r--source/blender/editors/interface/interface_handlers.c6
-rw-r--r--source/blender/editors/interface/interface_intern.h4
-rw-r--r--source/blender/editors/interface/interface_layout.c40
-rw-r--r--source/blender/editors/interface/interface_ops.c4
-rw-r--r--source/blender/editors/interface/interface_panel.c14
-rw-r--r--source/blender/editors/interface/interface_regions.c33
-rw-r--r--source/blender/editors/interface/interface_style.c35
-rw-r--r--source/blender/editors/interface/interface_templates.c214
-rw-r--r--source/blender/editors/interface/interface_utils.c4
-rw-r--r--source/blender/editors/interface/view2d.c10
-rw-r--r--source/blender/editors/interface/view2d_ops.c7
-rw-r--r--source/blender/editors/mesh/editmesh.c100
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c32
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c38
-rw-r--r--source/blender/editors/mesh/mesh_data.c15
-rw-r--r--source/blender/editors/mesh/meshtools.c8
-rw-r--r--source/blender/editors/metaball/mball_edit.c4
-rw-r--r--source/blender/editors/object/object_constraint.c22
-rw-r--r--source/blender/editors/object/object_edit.c6
-rw-r--r--source/blender/editors/object/object_hook.c25
-rw-r--r--source/blender/editors/object/object_intern.h2
-rw-r--r--source/blender/editors/object/object_modifier.c16
-rw-r--r--source/blender/editors/object/object_ops.c4
-rw-r--r--source/blender/editors/object/object_relations.c12
-rw-r--r--source/blender/editors/object/object_select.c18
-rw-r--r--source/blender/editors/object/object_shapekey.c2
-rw-r--r--source/blender/editors/object/object_transform.c10
-rw-r--r--source/blender/editors/object/object_vgroup.c594
-rw-r--r--source/blender/editors/physics/particle_edit.c8
-rw-r--r--source/blender/editors/physics/physics_fluid.c12
-rw-r--r--source/blender/editors/render/render_internal.c4
-rw-r--r--source/blender/editors/render/render_opengl.c6
-rw-r--r--source/blender/editors/render/render_shading.c4
-rw-r--r--source/blender/editors/screen/area.c13
-rw-r--r--source/blender/editors/screen/screen_ops.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c29
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h5
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c15
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c76
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c867
-rw-r--r--source/blender/editors/sound/sound_ops.c20
-rw-r--r--source/blender/editors/space_action/action_select.c4
-rw-r--r--source/blender/editors/space_buttons/CMakeLists.txt1
-rw-r--r--source/blender/editors/space_buttons/SConscript2
-rw-r--r--source/blender/editors/space_buttons/buttons_header.c30
-rw-r--r--source/blender/editors/space_console/console_ops.c44
-rw-r--r--source/blender/editors/space_console/space_console.c9
-rw-r--r--source/blender/editors/space_file/file_draw.c15
-rw-r--r--source/blender/editors/space_file/file_ops.c14
-rw-r--r--source/blender/editors/space_file/file_panels.c4
-rw-r--r--source/blender/editors/space_file/filesel.c10
-rw-r--r--source/blender/editors/space_graph/CMakeLists.txt1
-rw-r--r--source/blender/editors/space_graph/SConscript2
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c7
-rw-r--r--source/blender/editors/space_graph/graph_edit.c10
-rw-r--r--source/blender/editors/space_image/image_buttons.c6
-rw-r--r--source/blender/editors/space_image/image_ops.c54
-rw-r--r--source/blender/editors/space_image/space_image.c2
-rw-r--r--source/blender/editors/space_info/info_ops.c8
-rw-r--r--source/blender/editors/space_info/info_report.c2
-rw-r--r--source/blender/editors/space_info/space_info.c4
-rw-r--r--source/blender/editors/space_logic/CMakeLists.txt1
-rw-r--r--source/blender/editors/space_logic/logic_ops.c37
-rw-r--r--source/blender/editors/space_logic/logic_window.c62
-rw-r--r--source/blender/editors/space_nla/CMakeLists.txt1
-rw-r--r--source/blender/editors/space_nla/SConscript2
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c5
-rw-r--r--source/blender/editors/space_nla/nla_channels.c2
-rw-r--r--source/blender/editors/space_nla/nla_edit.c22
-rw-r--r--source/blender/editors/space_nla/nla_select.c10
-rw-r--r--source/blender/editors/space_node/drawnode.c6
-rw-r--r--source/blender/editors/space_node/node_draw.c2
-rw-r--r--source/blender/editors/space_node/node_edit.c17
-rw-r--r--source/blender/editors/space_node/node_header.c58
-rw-r--r--source/blender/editors/space_node/node_select.c12
-rw-r--r--source/blender/editors/space_node/node_state.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c10
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c24
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c10
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c10
-rw-r--r--source/blender/editors/space_text/text_draw.c4
-rw-r--r--source/blender/editors/space_text/text_ops.c28
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c133
-rw-r--r--source/blender/editors/space_view3d/drawobject.c110
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c5
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c64
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c206
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c4
-rw-r--r--source/blender/editors/transform/CMakeLists.txt1
-rw-r--r--source/blender/editors/transform/SConscript2
-rw-r--r--source/blender/editors/transform/transform.c6
-rw-r--r--source/blender/editors/transform/transform_conversions.c22
-rw-r--r--source/blender/editors/transform/transform_manipulator.c4
-rw-r--r--source/blender/editors/transform/transform_ops.c10
-rw-r--r--source/blender/editors/transform/transform_orientations.c14
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c40
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c8
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c52
-rw-r--r--source/blender/gpu/GPU_draw.h6
-rw-r--r--source/blender/gpu/GPU_material.h5
-rw-r--r--source/blender/gpu/intern/gpu_draw.c80
-rw-r--r--source/blender/gpu/intern/gpu_material.c2
-rw-r--r--source/blender/imbuf/CMakeLists.txt14
-rw-r--r--source/blender/imbuf/SConscript7
-rw-r--r--source/blender/imbuf/intern/IMB_anim.h65
-rw-r--r--source/blender/imbuf/intern/IMB_indexer.h2
-rw-r--r--source/blender/imbuf/intern/imbuf.h27
-rw-r--r--source/blender/imbuf/intern/jp2.c5
-rw-r--r--source/blender/imbuf/intern/md5.c6
-rw-r--r--source/blender/imbuf/intern/radiance_hdr.c7
-rw-r--r--source/blender/imbuf/intern/tiff.c4
-rw-r--r--source/blender/makesdna/DNA_ID.h18
-rw-r--r--source/blender/makesdna/DNA_material_types.h40
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h2
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h2
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h1
-rw-r--r--source/blender/makesdna/DNA_object_types.h5
-rw-r--r--source/blender/makesdna/DNA_scene_types.h5
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h4
-rw-r--r--source/blender/makesrna/RNA_access.h10
-rw-r--r--source/blender/makesrna/SConscript3
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt4
-rw-r--r--source/blender/makesrna/intern/SConscript3
-rw-r--r--source/blender/makesrna/intern/rna_ID.c31
-rw-r--r--source/blender/makesrna/intern/rna_access.c82
-rw-r--r--source/blender/makesrna/intern/rna_action.c28
-rw-r--r--source/blender/makesrna/intern/rna_actuator.c10
-rw-r--r--source/blender/makesrna/intern/rna_actuator_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_animation.c38
-rw-r--r--source/blender/makesrna/intern/rna_armature.c8
-rw-r--r--source/blender/makesrna/intern/rna_armature_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_color.c4
-rw-r--r--source/blender/makesrna/intern/rna_controller_api.c12
-rw-r--r--source/blender/makesrna/intern/rna_curve.c56
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c40
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c10
-rw-r--r--source/blender/makesrna/intern/rna_group.c8
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c53
-rw-r--r--source/blender/makesrna/intern/rna_main.c56
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c255
-rw-r--r--source/blender/makesrna/intern/rna_material.c218
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c58
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c11
-rw-r--r--source/blender/makesrna/intern/rna_meta.c10
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c71
-rw-r--r--source/blender/makesrna/intern/rna_nla.c16
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c48
-rw-r--r--source/blender/makesrna/intern/rna_object.c66
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c70
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c5
-rw-r--r--source/blender/makesrna/intern/rna_pose.c13
-rw-r--r--source/blender/makesrna/intern/rna_pose_api.c5
-rw-r--r--source/blender/makesrna/intern/rna_render.c27
-rw-r--r--source/blender/makesrna/intern/rna_scene.c66
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c20
-rw-r--r--source/blender/makesrna/intern/rna_screen.c7
-rw-r--r--source/blender/makesrna/intern/rna_sensor_api.c8
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer_api.c5
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c10
-rw-r--r--source/blender/makesrna/intern/rna_sound.c2
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/makesrna/intern/rna_speaker.c30
-rw-r--r--source/blender/makesrna/intern/rna_text_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_texture.c29
-rw-r--r--source/blender/makesrna/intern/rna_texture_api.c11
-rw-r--r--source/blender/makesrna/intern/rna_ui.c85
-rw-r--r--source/blender/makesrna/intern/rna_ui_api.c201
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c78
-rw-r--r--source/blender/makesrna/intern/rna_wm.c10
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c64
-rw-r--r--source/blender/modifiers/CMakeLists.txt6
-rw-r--r--source/blender/modifiers/SConscript4
-rw-r--r--source/blender/modifiers/intern/MOD_navmesh.c (renamed from source/blender/modifiers/intern/MOD_navmesh.cpp)87
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c1
-rw-r--r--source/blender/nodes/composite/node_composite_util.h4
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorSpill.c4
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_diffMatte.c4
-rw-r--r--source/blender/nodes/intern/node_common.c8
-rw-r--r--source/blender/python/SConscript3
-rw-r--r--source/blender/python/generic/CMakeLists.txt3
-rw-r--r--source/blender/python/generic/bgl.c12
-rw-r--r--source/blender/python/generic/blf_py_api.c34
-rw-r--r--source/blender/python/intern/CMakeLists.txt1
-rw-r--r--source/blender/python/intern/bpy.h4
-rw-r--r--source/blender/python/intern/bpy_interface.c6
-rw-r--r--source/blender/python/intern/bpy_interface_atexit.c94
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c16
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c115
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c12
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c87
-rw-r--r--source/blender/render/intern/source/convertblender.c11
-rw-r--r--source/blender/render/intern/source/pixelshading.c4
-rw-r--r--source/blender/render/intern/source/pointdensity.c6
-rw-r--r--source/blender/render/intern/source/render_texture.c4
-rw-r--r--source/blender/render/intern/source/rendercore.c8
-rw-r--r--source/blender/render/intern/source/shadbuf.c18
-rw-r--r--source/blender/render/intern/source/shadeoutput.c4
-rw-r--r--source/blender/render/intern/source/zbuf.c3
-rw-r--r--source/blender/windowmanager/SConscript3
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files.c11
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c4
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c39
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c130
-rw-r--r--source/blender/windowmanager/intern/wm_window.c10
-rw-r--r--source/creator/CMakeLists.txt23
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp183
-rw-r--r--source/gameengine/GamePlayer/ghost/CMakeLists.txt4
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp11
-rw-r--r--source/gameengine/GamePlayer/ghost/SConscript3
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.cpp8
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.h4
-rw-r--r--source/gameengine/Ketsji/BL_Material.cpp3
-rw-r--r--source/gameengine/Ketsji/BL_Material.h9
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.cpp87
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h3
-rw-r--r--source/gameengine/Ketsji/KX_NavMeshObject.cpp19
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.cpp26
-rw-r--r--source/gameengine/Ketsji/KX_PolygonMaterial.h4
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp49
-rw-r--r--source/gameengine/Rasterizer/RAS_IPolygonMaterial.h25
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h14
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp36
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h4
-rw-r--r--source/tests/bl_load_py_modules.py1
306 files changed, 6662 insertions, 3156 deletions
diff --git a/source/blender/avi/intern/avirgb.c b/source/blender/avi/intern/avirgb.c
index b7f6a58b6d7..7050aec9bf6 100644
--- a/source/blender/avi/intern/avirgb.c
+++ b/source/blender/avi/intern/avirgb.c
@@ -42,11 +42,6 @@
#include "MEM_guardedalloc.h"
#include "avirgb.h"
-#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
-#define WORDS_BIGENDIAN
-#endif
-
-
/* implementation */
void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
@@ -63,9 +58,9 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
if (bits==16) {
unsigned short *pxl;
unsigned char *to;
- #ifdef WORDS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
unsigned char *pxla;
- #endif
+#endif
buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromavirgbbuf");
@@ -75,19 +70,19 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
while (y--) {
pxl= (unsigned short *) (buffer + y * movie->header->Width * 2);
- #ifdef WORDS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
pxla= (unsigned char *)pxl;
- #endif
+#endif
x= movie->header->Width;
while (x--) {
- #ifdef WORDS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
i= pxla[0];
pxla[0]= pxla[1];
pxla[1]= i;
pxla+=2;
- #endif
+#endif
*(to++)= ((*pxl>>10)&0x1f)*8;
*(to++)= ((*pxl>>5)&0x1f)*8;
diff --git a/source/blender/avi/intern/endian.c b/source/blender/avi/intern/endian.c
index a985e8c3d5e..50ec2330beb 100644
--- a/source/blender/avi/intern/endian.c
+++ b/source/blender/avi/intern/endian.c
@@ -43,11 +43,7 @@
#include "endian.h"
#include "avi_intern.h"
-#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
-#define WORDS_BIGENDIAN
-#endif
-
-#ifdef WORDS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
static void invert (int *num) {
int new=0,i,j;
@@ -79,7 +75,7 @@ static void Ichunk (AviChunk *chunk) {
}
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
static void Ilist (AviList *list){
invert (&list->fcc);
invert (&list->size);
@@ -159,10 +155,10 @@ static void Iindexe (AviIndexEntry *indexe) {
invert (&indexe->Offset);
invert (&indexe->Size);
}
-#endif /* WORDS_BIGENDIAN */
+#endif /* __BIG_ENDIAN__ */
void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int type) {
-#ifdef WORDS_BIGENDIAN
+#ifdef __BIG_ENDIAN__
void *data;
data = MEM_mallocN (size, "avi endian");
@@ -209,9 +205,9 @@ void awrite (AviMovie *movie, void *datain, int block, int size, FILE *fp, int t
}
MEM_freeN (data);
-#else /* WORDS_BIGENDIAN */
+#else /* __BIG_ENDIAN__ */
(void)movie; /* unused */
(void)type; /* unused */
fwrite (datain, block, size, fp);
-#endif /* WORDS_BIGENDIAN */
+#endif /* __BIG_ENDIAN__ */
}
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 57f8c83eda6..1bb61d02b78 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -66,7 +66,7 @@ void BLF_size(int fontid, int size, int dpi);
| m[3] m[7] m[11] m[15] |
*/
-void BLF_matrix(int fontid, double *m);
+void BLF_matrix(int fontid, const double m[16]);
/* Draw the string using the default font, size and dpi. */
void BLF_draw_default(float x, float y, float z, const char *str, size_t len);
@@ -178,20 +178,6 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a);
*/
void BLF_draw_buffer(int fontid, const char *str);
-/*
- * Search the path directory to the locale files, this try all
- * the case for Linux, Win and Mac.
- */
-void BLF_lang_init(void);
-
-/* Set the current locale. */
-void BLF_lang_set(const char *);
-
-/* Set the current encoding name. */
-void BLF_lang_encoding_name(const char *str);
-
-void BLF_lang_encoding(const char *str);
-
/* Add a path to the font dir paths. */
void BLF_dir_add(const char *path);
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
new file mode 100644
index 00000000000..4377d391354
--- /dev/null
+++ b/source/blender/blenfont/BLF_translation.h
@@ -0,0 +1,66 @@
+/*
+ * $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 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * Contributor(s): Blender Foundation,
+ * Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenfont/BLF_translation.h
+ * \ingroup blf
+ */
+
+
+#ifndef BLF_TRANSLATION_H
+#define BLF_TRANSLATION_H
+
+/* blf_translation.c */
+
+#ifdef INTERNATIONAL
+unsigned char *BLF_get_unifont(int *unifont_size);
+void BLF_free_unifont(void);
+#endif
+
+const char* BLF_gettext(const char *msgid);
+
+/* blf_lang.c */
+
+/*
+ * Search the path directory to the locale files, this try all
+ * the case for Linux, Win and Mac.
+ */
+void BLF_lang_init(void);
+
+/* Set the current locale. */
+void BLF_lang_set(const char *);
+
+/* Set the current encoding name. */
+void BLF_lang_encoding_name(const char *str);
+
+void BLF_lang_encoding(const char *str);
+
+#define _(msgid) BLF_gettext(msgid)
+#define N_(msgid) msgid
+
+#endif /* BLF_TRANSLATION_H */
diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt
index 82099d4f125..b87a3b88f07 100644
--- a/source/blender/blenfont/CMakeLists.txt
+++ b/source/blender/blenfont/CMakeLists.txt
@@ -42,9 +42,11 @@ set(SRC
intern/blf_font.c
intern/blf_glyph.c
intern/blf_lang.c
+ intern/blf_translation.c
intern/blf_util.c
BLF_api.h
+ BLF_translation.h
intern/blf_internal.h
intern/blf_internal_types.h
)
@@ -56,9 +58,5 @@ if(WITH_INTERNATIONAL)
add_definitions(-DINTERNATIONAL)
endif()
-if(WIN32 AND NOT UNIX)
- add_definitions(-DUSE_GETTEXT_DLL)
-endif()
-
blender_add_lib(bf_blenfont "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript
index 2763bea0da0..45a55793856 100644
--- a/source/blender/blenfont/SConscript
+++ b/source/blender/blenfont/SConscript
@@ -13,7 +13,6 @@ defs = []
if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross':
defs.append('_WIN32')
- defs.append('USE_GETTEXT_DLL')
if env['WITH_BF_INTERNATIONAL']:
defs.append('INTERNATIONAL')
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 577697de594..cccecd00bf7 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -6,7 +6,7 @@
* 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.
+ * 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
@@ -20,7 +20,7 @@
* The Original Code is Copyright (C) 2009 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
@@ -78,8 +78,8 @@ int blf_mono_font_render= -1;
static FontBLF *BLF_get(int fontid)
{
if (fontid >= 0 && fontid < BLF_MAX_FONT)
- return(global_font[fontid]);
- return(NULL);
+ return global_font[fontid];
+ return NULL;
}
int BLF_init(int points, int dpi)
@@ -91,7 +91,7 @@ int BLF_init(int points, int dpi)
global_font_points= points;
global_font_dpi= dpi;
- return(blf_font_init());
+ return blf_font_init();
}
void BLF_exit(void)
@@ -128,9 +128,9 @@ static int blf_search(const char *name)
for (i= 0; i < BLF_MAX_FONT; i++) {
font= global_font[i];
if (font && (!strcmp(font->name, name)))
- return(i);
+ return i;
}
- return(-1);
+ return -1;
}
int BLF_load(const char *name)
@@ -140,24 +140,24 @@ int BLF_load(const char *name)
int i;
if (!name)
- return(-1);
+ return -1;
/* check if we already load this font. */
i= blf_search(name);
if (i >= 0) {
/*font= global_font[i];*/ /*UNUSED*/
- return(i);
+ return i;
}
if (global_font_num+1 >= BLF_MAX_FONT) {
printf("Too many fonts!!!\n");
- return(-1);
+ return -1;
}
filename= blf_dir_search(name);
if (!filename) {
printf("Can't find font: %s\n", name);
- return(-1);
+ return -1;
}
font= blf_font_new(name, filename);
@@ -165,13 +165,13 @@ int BLF_load(const char *name)
if (!font) {
printf("Can't load font: %s\n", name);
- return(-1);
+ return -1;
}
global_font[global_font_num]= font;
i= global_font_num;
global_font_num++;
- return(i);
+ return i;
}
int BLF_load_unique(const char *name)
@@ -181,20 +181,20 @@ int BLF_load_unique(const char *name)
int i;
if (!name)
- return(-1);
+ return -1;
/* 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) {
printf("Too many fonts!!!\n");
- return(-1);
+ return -1;
}
filename= blf_dir_search(name);
if (!filename) {
printf("Can't find font: %s\n", name);
- return(-1);
+ return -1;
}
font= blf_font_new(name, filename);
@@ -202,22 +202,22 @@ int BLF_load_unique(const char *name)
if (!font) {
printf("Can't load font: %s\n", name);
- return(-1);
+ return -1;
}
global_font[global_font_num]= font;
i= global_font_num;
global_font_num++;
- return(i);
+ return i;
}
void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font) {
blf_font_attach_from_mem(font, mem, mem_size);
+ }
}
int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
@@ -226,34 +226,34 @@ int BLF_load_mem(const char *name, unsigned char *mem, int mem_size)
int i;
if (!name)
- return(-1);
+ return -1;
i= blf_search(name);
if (i >= 0) {
/*font= global_font[i];*/ /*UNUSED*/
- return(i);
+ return i;
}
if (global_font_num+1 >= BLF_MAX_FONT) {
printf("Too many fonts!!!\n");
- return(-1);
+ return -1;
}
if (!mem || !mem_size) {
printf("Can't load font: %s from memory!!\n", name);
- return(-1);
+ return -1;
}
font= blf_font_new_from_mem(name, mem, mem_size);
if (!font) {
printf("Can't load font: %s from memory!!\n", name);
- return(-1);
+ return -1;
}
global_font[global_font_num]= font;
i= global_font_num;
global_font_num++;
- return(i);
+ return i;
}
int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size)
@@ -262,7 +262,7 @@ int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size)
int i;
if (!name)
- return(-1);
+ return -1;
/*
* Don't search in the cache, make a new object font!
@@ -270,67 +270,66 @@ int BLF_load_mem_unique(const char *name, unsigned char *mem, int mem_size)
*/
if (global_font_num+1 >= BLF_MAX_FONT) {
printf("Too many fonts!!!\n");
- return(-1);
+ return -1;
}
if (!mem || !mem_size) {
printf("Can't load font: %s from memory!!\n", name);
- return(-1);
+ return -1;
}
font= blf_font_new_from_mem(name, mem, mem_size);
if (!font) {
printf("Can't load font: %s from memory!!\n", name);
- return(-1);
+ return -1;
}
global_font[global_font_num]= font;
i= global_font_num;
global_font_num++;
- return(i);
+ return i;
}
void BLF_enable(int fontid, int option)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font) {
font->flags |= option;
+ }
}
void BLF_disable(int fontid, int option)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font) {
font->flags &= ~option;
+ }
}
void BLF_enable_default(int option)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(global_font_default);
- font= BLF_get(global_font_default);
- if (font)
+ if (font) {
font->flags |= option;
+ }
}
void BLF_disable_default(int option)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(global_font_default);
- font= BLF_get(global_font_default);
- if (font)
+ if (font) {
font->flags &= ~option;
+ }
}
void BLF_aspect(int fontid, float x, float y, float z)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
font->aspect[0]= x;
font->aspect[1]= y;
@@ -338,26 +337,23 @@ void BLF_aspect(int fontid, float x, float y, float z)
}
}
-void BLF_matrix(int fontid, double *m)
+void BLF_matrix(int fontid, const double m[16])
{
- FontBLF *font;
- int i;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
- for (i= 0; i < 16; i++)
- font->m[i]= m[i];
+ memcpy(font->m, m, sizeof(font->m));
}
}
void BLF_position(int fontid, float x, float y, float z)
{
- FontBLF *font;
- float remainder;
- float xa, ya, za;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
+ float xa, ya, za;
+ float remainder;
+
if (font->flags & BLF_ASPECT) {
xa= font->aspect[0];
ya= font->aspect[1];
@@ -401,20 +397,20 @@ void BLF_position(int fontid, float x, float y, float z)
void BLF_size(int fontid, int size, int dpi)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font) {
blf_font_size(font, size, dpi);
+ }
}
void BLF_blur(int fontid, int size)
{
- FontBLF *font;
-
- font= BLF_get(fontid);
- if (font)
+ FontBLF *font= BLF_get(fontid);
+
+ if (font) {
font->blur= size;
+ }
}
void BLF_draw_default(float x, float y, float z, const char *str, size_t len)
@@ -456,11 +452,11 @@ void BLF_draw_default_ascii(float x, float y, float z, const char *str, size_t l
void BLF_rotation_default(float angle)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(global_font_default);
- font= BLF_get(global_font_default);
- if (font)
+ if (font) {
font->angle= angle;
+ }
}
static void blf_draw__start(FontBLF *font)
@@ -505,7 +501,8 @@ static void blf_draw__end(void)
void BLF_draw(int fontid, const char *str, size_t len)
{
FontBLF *font= BLF_get(fontid);
- if (font) {
+
+ if (font && font->glyph_cache) {
blf_draw__start(font);
blf_font_draw(font, str, len);
blf_draw__end();
@@ -515,7 +512,8 @@ void BLF_draw(int fontid, const char *str, size_t len)
void BLF_draw_ascii(int fontid, const char *str, size_t len)
{
FontBLF *font= BLF_get(fontid);
- if (font) {
+
+ if (font && font->glyph_cache) {
blf_draw__start(font);
blf_font_draw_ascii(font, str, len);
blf_draw__end();
@@ -524,148 +522,141 @@ void BLF_draw_ascii(int fontid, const char *str, size_t len)
void BLF_boundbox(int fontid, const char *str, rctf *box)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font) {
blf_font_boundbox(font, str, box);
+ }
}
void BLF_width_and_height(int fontid, const char *str, float *width, float *height)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font && font->glyph_cache) {
blf_font_width_and_height(font, str, width, height);
+ }
}
float BLF_width(int fontid, const char *str)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
+
+ if (font && font->glyph_cache) {
+ return blf_font_width(font, str);
+ }
- font= BLF_get(fontid);
- if (font)
- return(blf_font_width(font, str));
- return(0.0f);
+ return 0.0f;
}
float BLF_fixed_width(int fontid)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
- return(blf_font_fixed_width(font));
- return(0.0f);
+ if (font && font->glyph_cache) {
+ return blf_font_fixed_width(font);
+ }
+
+ return 0.0f;
}
float BLF_width_default(const char *str)
{
- float width;
-
if (global_font_default == -1)
global_font_default= blf_search("default");
if (global_font_default == -1) {
printf("Error: Can't found default font!!\n");
- return(0.0f);
+ return 0.0f;
}
BLF_size(global_font_default, global_font_points, global_font_dpi);
- width= BLF_width(global_font_default, str);
- return(width);
+ return BLF_width(global_font_default, str);
}
float BLF_height(int fontid, const char *str)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
+
+ if (font && font->glyph_cache) {
+ return blf_font_height(font, str);
+ }
- font= BLF_get(fontid);
- if (font)
- return(blf_font_height(font, str));
- return(0.0f);
+ return 0.0f;
}
float BLF_height_max(int fontid)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font) {
- if(font->glyph_cache)
- return(font->glyph_cache->max_glyph_height);
+ if (font && font->glyph_cache) {
+ return font->glyph_cache->max_glyph_height;
}
- return(0.0f);
+
+ return 0.0f;
}
float BLF_width_max(int fontid)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font) {
- if(font->glyph_cache)
- return(font->glyph_cache->max_glyph_width);
+ if (font && font->glyph_cache) {
+ return font->glyph_cache->max_glyph_width;
}
- return(0.0f);
+
+ return 0.0f;
}
float BLF_descender(int fontid)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font) {
- if(font->glyph_cache)
- return(font->glyph_cache->descender);
+ if (font && font->glyph_cache) {
+ return font->glyph_cache->descender;
}
- return(0.0f);
+
+ return 0.0f;
}
float BLF_ascender(int fontid)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font) {
- if(font->glyph_cache)
- return(font->glyph_cache->ascender);
+ if (font && font->glyph_cache) {
+ return font->glyph_cache->ascender;
}
- return(0.0f);
+
+ return 0.0f;
}
float BLF_height_default(const char *str)
{
- float height;
-
if (global_font_default == -1)
global_font_default= blf_search("default");
if (global_font_default == -1) {
printf("Error: Can't found default font!!\n");
- return(0.0f);
+ return 0.0f;
}
BLF_size(global_font_default, global_font_points, global_font_dpi);
- height= BLF_height(global_font_default, str);
- return(height);
+
+ return BLF_height(global_font_default, str);
}
void BLF_rotation(int fontid, float angle)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font) {
font->angle= angle;
+ }
}
void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
font->clip_rec.xmin= xmin;
font->clip_rec.ymin= ymin;
@@ -676,9 +667,8 @@ void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax)
void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(global_font_default);
- font= BLF_get(global_font_default);
if (font) {
font->clip_rec.xmin= xmin;
font->clip_rec.ymin= ymin;
@@ -689,9 +679,8 @@ void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax)
void BLF_shadow(int fontid, int level, float r, float g, float b, float a)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
font->shadow= level;
font->shadow_col[0]= r;
@@ -703,9 +692,8 @@ void BLF_shadow(int fontid, int level, float r, float g, float b, float a)
void BLF_shadow_offset(int fontid, int x, int y)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
font->shadow_x= x;
font->shadow_y= y;
@@ -714,9 +702,8 @@ void BLF_shadow_offset(int fontid, int x, int y)
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
font->b_fbuf= fbuf;
font->b_cbuf= cbuf;
@@ -728,9 +715,8 @@ void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int
void BLF_buffer_col(int fontid, float r, float g, float b, float a)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
if (font) {
font->b_col[0]= r;
font->b_col[1]= g;
@@ -741,9 +727,9 @@ void BLF_buffer_col(int fontid, float r, float g, float b, float a)
void BLF_draw_buffer(int fontid, const char *str)
{
- FontBLF *font;
+ FontBLF *font= BLF_get(fontid);
- font= BLF_get(fontid);
- if (font)
+ if (font && font->glyph_cache && (font->b_fbuf || font->b_cbuf)) {
blf_font_buffer(font, str);
+ }
}
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index fd874d991ea..46be49b37e9 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -62,10 +62,10 @@ static DirBLF *blf_dir_find(const char *path)
p= global_font_dir.first;
while (p) {
if (BLI_path_cmp(p->path, path) == 0)
- return(p);
+ return p;
p= p->next;
}
- return(NULL);
+ return NULL;
}
void BLF_dir_add(const char *path)
@@ -76,7 +76,7 @@ void BLF_dir_add(const char *path)
if (dir) /* already in the list ? just return. */
return;
- dir= (DirBLF *)MEM_mallocN(sizeof(DirBLF), "BLF_dir_add");
+ dir= (DirBLF *)MEM_callocN(sizeof(DirBLF), "BLF_dir_add");
dir->path= BLI_strdup(path);
BLI_addhead(&global_font_dir, dir);
}
@@ -102,9 +102,9 @@ char **BLF_dir_get(int *ndir)
count= BLI_countlist(&global_font_dir);
if (!count)
- return(NULL);
+ return NULL;
- dirs= (char **)MEM_mallocN(sizeof(char *) * count, "BLF_dir_get");
+ dirs= (char **)MEM_callocN(sizeof(char *) * count, "BLF_dir_get");
p= global_font_dir.first;
i= 0;
while (p) {
@@ -113,7 +113,7 @@ char **BLF_dir_get(int *ndir)
p= p->next;
}
*ndir= i;
- return(dirs);
+ return dirs;
}
void BLF_dir_free(char **dirs, int count)
@@ -147,8 +147,8 @@ char *blf_dir_search(const char *file)
if (BLI_exist(file))
s= BLI_strdup(file);
}
-
- return(s);
+
+ return s;
}
#if 0 // UNUSED
@@ -171,9 +171,9 @@ int blf_dir_split(const char *str, char *file, int *size)
file[i+4]= '\0';
s++;
*size= atoi(s);
- return(1);
+ return 1;
}
- return(0);
+ return 0;
}
#endif
@@ -188,9 +188,9 @@ char *blf_dir_metrics_search(const char *filename)
mfile= BLI_strdup(filename);
s= strrchr(mfile, '.');
if (s) {
- if (strlen(s) < 4) {
+ if (BLI_strnlen(s, 4) < 4) {
MEM_freeN(mfile);
- return(NULL);
+ return NULL;
}
s++;
s[0]= 'a';
@@ -199,14 +199,14 @@ char *blf_dir_metrics_search(const char *filename)
/* first check .afm */
if (BLI_exist(s))
- return(s);
+ return s;
/* and now check .pfm */
s[0]= 'p';
if (BLI_exist(s))
- return(s);
+ return s;
}
MEM_freeN(mfile);
- return(NULL);
+ return NULL;
}
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index 3bec7dd2626..26af3a3fd4f 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -62,7 +62,7 @@ static FT_Library ft_lib;
int blf_font_init(void)
{
- return(FT_Init_FreeType(&ft_lib));
+ return FT_Init_FreeType(&ft_lib);
}
void blf_font_exit(void)
@@ -136,26 +136,33 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
} \
+#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \
+ const short has_kerning= FT_HAS_KERNING((_font)->face); \
+ const FT_UInt kern_mode= (has_kerning == 0) ? 0 : \
+ (((_font)->flags & BLF_KERNING_DEFAULT) ? \
+ ft_kerning_default : FT_KERNING_UNFITTED) \
+ \
+
+
+#define BLF_KERNING_STEP(_font, kern_mode, g_prev, g, delta, pen_x) \
+{ \
+ if (g_prev) { \
+ delta.x= delta.y= 0; \
+ if (FT_Get_Kerning((_font)->face, g_prev->idx, g->idx, kern_mode, &delta) == 0) \
+ pen_x += delta.x >> 6; \
+ } \
+} \
void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
{
unsigned int c;
- GlyphBLF *g, *g_prev;
+ GlyphBLF *g, *g_prev= NULL;
FT_Vector delta;
- int pen_x, pen_y;
- int has_kerning, st;
- unsigned int i;
- GlyphBLF **glyph_ascii_table;
-
- if (!font->glyph_cache)
- return;
- glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+ int pen_x= 0, pen_y= 0;
+ unsigned int i= 0;
+ GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
- i= 0;
- pen_x= 0;
- pen_y= 0;
- has_kerning= FT_HAS_KERNING(font->face);
- g_prev= NULL;
+ BLF_KERNING_VARS(font, has_kerning, kern_mode);
blf_font_ensure_ascii_table(font);
@@ -163,25 +170,9 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
- if (c == 0)
- break;
-
- /* if we don't found a glyph, skip it. */
- if (!g)
- continue;
-
- if (has_kerning && g_prev) {
- delta.x= 0;
- delta.y= 0;
-
- if (font->flags & BLF_KERNING_DEFAULT)
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
- else
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
-
- if (st == 0)
- pen_x += delta.x >> 6;
- }
+ if (c == 0) break;
+ if (g == NULL) continue;
+ if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
/* do not return this loop if clipped, we want every character tested */
blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
@@ -194,43 +185,19 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
/* faster version of blf_font_draw, ascii only for view dimensions */
void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len)
{
- char c;
- GlyphBLF *g, *g_prev;
+ unsigned char c;
+ GlyphBLF *g, *g_prev= NULL;
FT_Vector delta;
- int pen_x, pen_y;
- int has_kerning, st;
- GlyphBLF **glyph_ascii_table;
-
- if (!font->glyph_cache)
- return;
- glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+ int pen_x= 0, pen_y= 0;
+ GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
- pen_x= 0;
- pen_y= 0;
- has_kerning= FT_HAS_KERNING(font->face);
- g_prev= NULL;
+ BLF_KERNING_VARS(font, has_kerning, kern_mode);
blf_font_ensure_ascii_table(font);
while ((c= *(str++)) && len--) {
- g= glyph_ascii_table[c];
-
- /* if we don't found a glyph, skip it. */
- if (!g)
- continue;
-
- if (has_kerning && g_prev) {
- delta.x= 0;
- delta.y= 0;
-
- if (font->flags & BLF_KERNING_DEFAULT)
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
- else
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
-
- if (st == 0)
- pen_x += delta.x >> 6;
- }
+ if ((g= glyph_ascii_table[c]) == NULL) continue;
+ if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
/* do not return this loop if clipped, we want every character tested */
blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
@@ -240,59 +207,37 @@ void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len)
}
}
+/* Sanity checks are done by BLF_draw_buffer() */
void blf_font_buffer(FontBLF *font, const char *str)
{
- unsigned char *cbuf;
unsigned int c;
- unsigned char b_col_char[4];
- GlyphBLF *g, *g_prev;
+ GlyphBLF *g, *g_prev= NULL;
FT_Vector delta;
+ int pen_x= (int)font->pos[0], pen_y= 0;
+ unsigned int i= 0;
+ GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+
+ /* buffer spesific vars*/
+ const unsigned char b_col_char[4]= {font->b_col[0] * 255,
+ font->b_col[1] * 255,
+ font->b_col[2] * 255,
+ font->b_col[3] * 255};
+ unsigned char *cbuf;
+ int chx, chy;
+ int y, x;
float a, *fbuf;
- int pen_x, y, x;
- int has_kerning, st, chx, chy;
- unsigned int i;
- GlyphBLF **glyph_ascii_table;
- if (!font->glyph_cache || (!font->b_fbuf && !font->b_cbuf))
- return;
- glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
-
- i= 0;
- pen_x= (int)font->pos[0];
- has_kerning= FT_HAS_KERNING(font->face);
- g_prev= NULL;
-
- b_col_char[0]= font->b_col[0] * 255;
- b_col_char[1]= font->b_col[1] * 255;
- b_col_char[2]= font->b_col[2] * 255;
- b_col_char[3]= font->b_col[3] * 255;
+ BLF_KERNING_VARS(font, has_kerning, kern_mode);
blf_font_ensure_ascii_table(font);
while (str[i]) {
- int pen_y;
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
- if (c == 0)
- break;
-
- /* if we don't found a glyph, skip it. */
- if (!g)
- continue;
-
- if (has_kerning && g_prev) {
- delta.x= 0;
- delta.y= 0;
-
- if (font->flags & BLF_KERNING_DEFAULT)
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
- else
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
-
- if (st == 0)
- pen_x += delta.x >> 6;
- }
+ if (c == 0) break;
+ if (g == NULL) continue;
+ if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
chx= pen_x + ((int)g->pos_x);
chy= (int)font->pos[1] + g->height;
@@ -392,69 +337,41 @@ void blf_font_buffer(FontBLF *font, const char *str)
void blf_font_boundbox(FontBLF *font, const char *str, rctf *box)
{
unsigned int c;
- GlyphBLF *g, *g_prev;
+ GlyphBLF *g, *g_prev= NULL;
FT_Vector delta;
+ int pen_x= 0, pen_y= 0;
+ unsigned int i= 0;
+ GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
+
rctf gbox;
- int pen_x, pen_y;
- int has_kerning, st;
- unsigned int i;
- GlyphBLF **glyph_ascii_table;
- if (!font->glyph_cache)
- return;
+ BLF_KERNING_VARS(font, has_kerning, kern_mode);
box->xmin= 32000.0f;
box->xmax= -32000.0f;
box->ymin= 32000.0f;
box->ymax= -32000.0f;
- i= 0;
- pen_x= 0;
- pen_y= 0;
- has_kerning= FT_HAS_KERNING(font->face);
- g_prev= NULL;
-
blf_font_ensure_ascii_table(font);
- glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
while (str[i]) {
BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
- if (c == 0)
- break;
-
- /* if we don't found a glyph, skip it. */
- if (!g)
- continue;
-
- if (has_kerning && g_prev) {
- delta.x= 0;
- delta.y= 0;
-
- if (font->flags & BLF_KERNING_DEFAULT)
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta);
- else
- st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta);
-
- if (st == 0)
- pen_x += delta.x >> 6;
- }
+ if (c == 0) break;
+ if (g == NULL) continue;
+ if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
gbox.xmin= pen_x;
gbox.xmax= pen_x + g->advance;
gbox.ymin= g->box.ymin + pen_y;
gbox.ymax= g->box.ymax + pen_y;
- if (gbox.xmin < box->xmin)
- box->xmin= gbox.xmin;
- if (gbox.ymin < box->ymin)
- box->ymin= gbox.ymin;
+ if (gbox.xmin < box->xmin) box->xmin= gbox.xmin;
+ if (gbox.ymin < box->ymin) box->ymin= gbox.ymin;
- if (gbox.xmax > box->xmax)
- box->xmax= gbox.xmax;
- if (gbox.ymax > box->ymax)
- box->ymax= gbox.ymax;
+ if (gbox.xmax > box->xmax) box->xmax= gbox.xmax;
+ if (gbox.ymax > box->ymax) box->ymax= gbox.ymax;
pen_x += g->advance;
g_prev= g;
@@ -473,20 +390,18 @@ void blf_font_width_and_height(FontBLF *font, const char *str, float *width, flo
float xa, ya;
rctf box;
- if (font->glyph_cache) {
- if (font->flags & BLF_ASPECT) {
- xa= font->aspect[0];
- ya= font->aspect[1];
- }
- else {
- xa= 1.0f;
- ya= 1.0f;
- }
-
- blf_font_boundbox(font, str, &box);
- *width= ((box.xmax - box.xmin) * xa);
- *height= ((box.ymax - box.ymin) * ya);
+ if (font->flags & BLF_ASPECT) {
+ xa= font->aspect[0];
+ ya= font->aspect[1];
+ }
+ else {
+ xa= 1.0f;
+ ya= 1.0f;
}
+
+ blf_font_boundbox(font, str, &box);
+ *width= ((box.xmax - box.xmin) * xa);
+ *height= ((box.ymax - box.ymin) * ya);
}
float blf_font_width(FontBLF *font, const char *str)
@@ -494,16 +409,13 @@ float blf_font_width(FontBLF *font, const char *str)
float xa;
rctf box;
- if (!font->glyph_cache)
- return(0.0f);
-
if (font->flags & BLF_ASPECT)
xa= font->aspect[0];
else
xa= 1.0f;
blf_font_boundbox(font, str, &box);
- return((box.xmax - box.xmin) * xa);
+ return (box.xmax - box.xmin) * xa;
}
float blf_font_height(FontBLF *font, const char *str)
@@ -511,36 +423,28 @@ float blf_font_height(FontBLF *font, const char *str)
float ya;
rctf box;
- if (!font->glyph_cache)
- return(0.0f);
-
if (font->flags & BLF_ASPECT)
ya= font->aspect[1];
else
ya= 1.0f;
blf_font_boundbox(font, str, &box);
- return((box.ymax - box.ymin) * ya);
+ return (box.ymax - box.ymin) * ya;
}
float blf_font_fixed_width(FontBLF *font)
{
- GlyphBLF *g;
- FT_UInt glyph_index;
- unsigned int c = ' ';
-
- if (!font->glyph_cache)
- return 0.0f;
-
- glyph_index= FT_Get_Char_Index(font->face, c);
- g= blf_glyph_search(font->glyph_cache, c);
- if (!g)
- g= blf_glyph_add(font, glyph_index, c);
-
- /* if we don't find the glyph. */
- if (!g)
- return 0.0f;
-
+ const unsigned int c = ' ';
+ GlyphBLF *g= blf_glyph_search(font->glyph_cache, c);
+ if (!g) {
+ g= blf_glyph_add(font, FT_Get_Char_Index(font->face, c), c);
+
+ /* if we don't find the glyph. */
+ if (!g) {
+ return 0.0f;
+ }
+ }
+
return g->advance;
}
@@ -607,11 +511,11 @@ FontBLF *blf_font_new(const char *name, const char *filename)
FT_Error err;
char *mfile;
- font= (FontBLF *)MEM_mallocN(sizeof(FontBLF), "blf_font_new");
+ font= (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new");
err= FT_New_Face(ft_lib, filename, 0, &font->face);
if (err) {
MEM_freeN(font);
- return(NULL);
+ return NULL;
}
err= FT_Select_Charmap(font->face, ft_encoding_unicode);
@@ -619,7 +523,7 @@ FontBLF *blf_font_new(const char *name, const char *filename)
printf("Can't set the unicode character map!\n");
FT_Done_Face(font->face);
MEM_freeN(font);
- return(NULL);
+ return NULL;
}
mfile= blf_dir_metrics_search(filename);
@@ -631,7 +535,7 @@ FontBLF *blf_font_new(const char *name, const char *filename)
font->name= BLI_strdup(name);
font->filename= BLI_strdup(filename);
blf_font_fill(font);
- return(font);
+ return font;
}
void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_size)
@@ -649,11 +553,11 @@ FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_siz
FontBLF *font;
FT_Error err;
- font= (FontBLF *)MEM_mallocN(sizeof(FontBLF), "blf_font_new_from_mem");
+ font= (FontBLF *)MEM_callocN(sizeof(FontBLF), "blf_font_new_from_mem");
err= FT_New_Memory_Face(ft_lib, mem, mem_size, 0, &font->face);
if (err) {
MEM_freeN(font);
- return(NULL);
+ return NULL;
}
err= FT_Select_Charmap(font->face, ft_encoding_unicode);
@@ -661,11 +565,11 @@ FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_siz
printf("Can't set the unicode character map!\n");
FT_Done_Face(font->face);
MEM_freeN(font);
- return(NULL);
+ return NULL;
}
font->name= BLI_strdup(name);
font->filename= NULL;
blf_font_fill(font);
- return(font);
+ return font;
}
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 7a1fa8c80b0..99d41cd7abd 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -64,10 +64,10 @@ GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi)
p= (GlyphCacheBLF *)font->cache.first;
while (p) {
if (p->size == size && p->dpi == dpi)
- return(p);
+ return p;
p= p->next;
}
- return(NULL);
+ return NULL;
}
/* Create a new glyph cache for the current size and dpi. */
@@ -75,7 +75,7 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
{
GlyphCacheBLF *gc;
- gc= (GlyphCacheBLF *)MEM_mallocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new");
+ gc= (GlyphCacheBLF *)MEM_callocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new");
gc->next= NULL;
gc->prev= NULL;
gc->size= font->size;
@@ -114,7 +114,7 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
gc->p2_height= 0;
BLI_addhead(&font->cache, gc);
- return(gc);
+ return gc;
}
void blf_glyph_cache_clear(FontBLF *font)
@@ -131,10 +131,8 @@ void blf_glyph_cache_clear(FontBLF *font)
blf_glyph_free(g);
}
}
- }
- if(font->glyph_cache) {
- memset(font->glyph_cache->glyph_ascii_table, 0, sizeof(font->glyph_cache->glyph_ascii_table));
+ memset(gc->glyph_ascii_table, 0, sizeof(gc->glyph_ascii_table));
}
}
@@ -204,10 +202,10 @@ GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c)
p= gc->bucket[key].first;
while (p) {
if (p->c == c)
- return(p);
+ return p;
p= p->next;
}
- return(NULL);
+ return NULL;
}
GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
@@ -222,14 +220,14 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
g= blf_glyph_search(font->glyph_cache, c);
if (g)
- return(g);
+ return g;
if (sharp)
err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO);
else
err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */
if (err)
- return(NULL);
+ return NULL;
/* get the glyph. */
slot= font->face->glyph;
@@ -248,22 +246,13 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
}
if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)
- return(NULL);
+ return NULL;
- g= (GlyphBLF *)MEM_mallocN(sizeof(GlyphBLF), "blf_glyph_add");
- g->next= NULL;
- g->prev= NULL;
+ g= (GlyphBLF *)MEM_callocN(sizeof(GlyphBLF), "blf_glyph_add");
g->c= c;
g->idx= (FT_UInt)index;
- g->tex= 0;
- g->build_tex= 0;
- g->bitmap= NULL;
g->xoff= -1;
g->yoff= -1;
- g->uv[0][0]= 0.0f;
- g->uv[0][1]= 0.0f;
- g->uv[1][0]= 0.0f;
- g->uv[1][1]= 0.0f;
bitmap= slot->bitmap;
g->width= bitmap.width;
g->height= bitmap.rows;
@@ -294,7 +283,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
key= blf_hash(g->c);
BLI_addhead(&(font->glyph_cache->bucket[key]), g);
- return(g);
+ return g;
}
void blf_glyph_free(GlyphBLF *g)
@@ -383,7 +372,7 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
float xo, yo;
if ((!g->width) || (!g->height))
- return(1);
+ return 1;
if (g->build_tex == 0) {
GlyphCacheBLF *gc= font->glyph_cache;
@@ -449,13 +438,13 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
if (font->flags & BLF_CLIPPING) {
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1]))
- return(0);
+ return 0;
if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y2 + font->pos[1]))
- return(0);
+ return 0;
if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y2 + font->pos[1]))
- return(0);
+ return 0;
if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y1 + font->pos[1]))
- return(0);
+ return 0;
}
if (font->tex_bind_state != g->tex) {
@@ -500,5 +489,5 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
break;
}
- return(1);
+ return 1;
}
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index e7f9d1746ad..8f745180b8b 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -39,8 +39,14 @@
#ifdef INTERNATIONAL
#include <locale.h>
+
+#if defined (_WIN32)
+#include <windows.h>
+#endif
+
#include "libintl.h"
+#include "DNA_userdef_types.h"
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
@@ -51,11 +57,6 @@
#include "BLI_string.h"
#include "BLI_path_util.h"
-
-#ifdef __APPLE__
-
-#endif
-
#define DOMAIN_NAME "blender"
#define SYSTEM_ENCODING_DEFAULT "UTF-8"
#define FONT_SIZE_DEFAULT 12
@@ -65,6 +66,35 @@ static char global_messagepath[1024];
static char global_language[32];
static char global_encoding_name[32];
+/* map from the rna_userdef.c:rna_def_userdef_system(BlenderRNA *brna):language_items */
+static const char *locales[] = {
+ "", "",
+ "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_AD",
+ "czech", "cs_CZ",
+ "ptb", "pt_BR",
+ "chs", "zh_CN",
+ "cht", "zh_TW",
+ "russian", "ru_RU",
+ "croatian", "hr_HR",
+ "serbian", "sr_RS",
+ "ukrainian", "uk_UA",
+ "polish", "pl_PL",
+ "romanian", "ro_RO",
+ "arabic", "ar_EG",
+ "bulgarian", "bg_BG",
+ "greek", "el_GR",
+ "korean", "ko_KR",
+ "nepali", "ne_NP",
+};
void BLF_lang_init(void)
{
@@ -82,34 +112,95 @@ void BLF_lang_init(void)
/* XXX WARNING!!! IN osx somehow the previous function call jumps in this one??? (ton, ppc) */
void BLF_lang_set(const char *str)
{
- if(str==NULL) {
+ char *locreturn;
+ const char *short_locale;
+ int ok= 1;
+#if defined (_WIN32)
+ char *long_locale = locales[ 2 * U.language];
+#endif
+
+ if((U.transopts&USER_DOTRANSLATE)==0)
return;
+
+ if(str)
+ short_locale = str;
+ else
+ short_locale = locales[ 2 * U.language + 1];
+
+#if defined (_WIN32)
+ if(short_locale) {
+ char *envStr;
+
+ if( U.language==0 )/* use system setting */
+ envStr = BLI_sprintfN( "LANG=%s", getenv("LANG") );
+ else
+ envStr = BLI_sprintfN( "LANG=%s", short_locale );
+
+ gettext_putenv(envStr);
+ MEM_freeN(envStr);
+ }
+
+ locreturn= setlocale(LC_ALL, long_locale);
+
+ if (locreturn == NULL) {
+ printf("Could not change locale to %s\n", long_locale);
+ ok= 0;
}
- else {
-
-#if defined (_WIN32) || defined(__APPLE__)
- BLI_setenv("LANG", str);
#else
- char *locreturn= setlocale(LC_ALL, str);
+ {
+ const char *locale;
+ static char default_locale[64]="\0";
+
+ if(default_locale[0]==0) {
+ char *env_language= getenv("LANGUAGE");
+
+ if(env_language) {
+ char *s;
+
+ /* store defaul locale */
+ strncpy(default_locale, env_language, sizeof(default_locale));
+
+ /* use first language as default */
+ s= strchr(default_locale, ':');
+ if(s) s[0]= 0;
+ }
+ }
+
+ if(short_locale[0])
+ locale= short_locale;
+ else
+ locale= default_locale;
+
+ BLI_setenv("LANG", locale);
+ BLI_setenv("LANGUAGE", locale);
+
+ locreturn= setlocale(LC_ALL, locale);
+
if (locreturn == NULL) {
- char *lang= BLI_sprintfN("%s.UTF-8", str);
+ char *short_locale_utf8= BLI_sprintfN("%s.UTF-8", short_locale);
+
+ locreturn= setlocale(LC_ALL, short_locale_utf8);
- locreturn= setlocale(LC_ALL, lang);
if (locreturn == NULL) {
- printf("could not change language to %s nor %s\n", str, lang);
+ printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
+ ok= 0;
}
- MEM_freeN(lang);
+ MEM_freeN(short_locale_utf8);
}
-
- setlocale(LC_NUMERIC, "C");
+ }
#endif
- textdomain(DOMAIN_NAME);
- bindtextdomain(DOMAIN_NAME, global_messagepath);
- /* bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name); */
- BLI_strncpy(global_language, str, sizeof(global_language));
-
+
+ if(ok) {
+ //printf("Change locale to %s\n", locreturn );
+ BLI_strncpy(global_language, locreturn, sizeof(global_language));
}
+
+ setlocale(LC_NUMERIC, "C");
+
+ textdomain(DOMAIN_NAME);
+ bindtextdomain(DOMAIN_NAME, global_messagepath);
+ bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name);
}
void BLF_lang_encoding(const char *str)
diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
new file mode 100644
index 00000000000..b53f4cf7609
--- /dev/null
+++ b/source/blender/blenfont/intern/blf_translation.c
@@ -0,0 +1,86 @@
+/*
+ * $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 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation,
+ * Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenfont/intern/blf_translation.c
+ * \ingroup blf
+ */
+
+#include <stdlib.h>
+
+#ifdef INTERNATIONAL
+#include <libintl.h>
+#endif
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_path_util.h"
+#include "BLI_string.h"
+#include "BLI_path_util.h"
+#include "BLI_fileops.h"
+
+#include "BLF_translation.h"
+
+#ifdef INTERNATIONAL
+const char unifont_filename[]="droidsans.ttf.gz";
+static unsigned char *unifont_ttf= NULL;
+static int unifont_size= 0;
+
+unsigned char *BLF_get_unifont(int *unifont_size_r)
+{
+ if(unifont_ttf==NULL) {
+ char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
+ char unifont_path[1024];
+
+ BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename);
+
+ unifont_ttf= (unsigned char*)BLI_ungzip_to_mem(unifont_path, &unifont_size);
+ }
+
+ *unifont_size_r= unifont_size;
+
+ return unifont_ttf;
+}
+
+void BLF_free_unifont(void)
+{
+ if(unifont_ttf)
+ MEM_freeN(unifont_ttf);
+}
+
+#endif
+
+const char* BLF_gettext(const char *msgid)
+{
+#ifdef INTERNATIONAL
+ if( msgid[0] )
+ return gettext( msgid );
+ return "";
+#else
+ return msgid;
+#endif
+}
diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c
index edd23ac1ba6..cfe77887674 100644
--- a/source/blender/blenfont/intern/blf_util.c
+++ b/source/blender/blenfont/intern/blf_util.c
@@ -46,7 +46,7 @@ unsigned int blf_next_p2(unsigned int x)
x |= (x >> 2);
x |= (x >> 1);
x += 1;
- return(x);
+ return x;
}
unsigned int blf_hash(unsigned int val)
@@ -60,7 +60,7 @@ unsigned int blf_hash(unsigned int val)
key ^= (key >> 13);
key += ~(key << 9);
key ^= (key >> 17);
- return(key % 257);
+ return key % 257;
}
/*
@@ -85,7 +85,7 @@ int blf_utf8_next(unsigned char *buf, unsigned int *iindex)
d= buf[index++];
if (!d)
- return(0);
+ return 0;
while (buf[index] && ((buf[index] & 0xc0) == 0x80))
index++;
@@ -124,5 +124,5 @@ int blf_utf8_next(unsigned char *buf, unsigned int *iindex)
r |= (d4 & 0x3f);
}
*iindex= index;
- return(r);
+ return r;
}
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 7d60c00156d..8836999bc9b 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -100,6 +100,8 @@ void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[]
void vec_roll_to_mat3(float *vec, float roll, float mat[][3]);
void mat3_to_vec_roll(float mat[][3], float *vec, float *roll);
+int get_selected_defgroups(struct Object *ob, char *defbase_sel, int defbase_len);
+
/* Common Conversions Between Co-ordinate Spaces */
void armature_mat_world_to_pose(struct Object *ob, float inmat[][4], float outmat[][4]);
void armature_loc_world_to_pose(struct Object *ob, float *inloc, float *outloc);
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 742240d53b5..a09e475c9a3 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 2
+#define BLENDER_SUBVERSION 3
#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 alpha
+#define BLENDER_VERSION_CYCLE beta
struct ListBase;
struct MemFile;
diff --git a/source/blender/blenkernel/BKE_endian.h b/source/blender/blenkernel/BKE_endian.h
deleted file mode 100644
index 5647645e990..00000000000
--- a/source/blender/blenkernel/BKE_endian.h
+++ /dev/null
@@ -1,50 +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) 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 *****
- * Are we little or big endian? From Harbison&Steele.
- */
-#ifndef BKE_ENDIAN_H
-#define BKE_ENDIAN_H
-
-/** \file BKE_endian.h
- * \ingroup bke
- */
-
-/**
- * BKE_ENDIANNESS(a) returns 1 if big endian and returns 0 if little endian
- */
-#define BKE_ENDIANNESS(a) { \
- union { \
- intptr_t l; \
- char c[sizeof (intptr_t)]; \
- } u; \
- u.l = 1; \
- a = (u.c[sizeof (intptr_t) - 1] == 1) ? 1 : 0; \
-}
-
-#endif
-
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 0e48673f1b1..a59d43d315d 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -151,9 +151,18 @@ typedef struct Global {
/* ENDIAN_ORDER: indicates what endianness the platform where the file was
* written had. */
+#if !defined( __BIG_ENDIAN__ ) && !defined( __LITTLE_ENDIAN__ )
+# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined.
+#endif
+
#define L_ENDIAN 1
#define B_ENDIAN 0
-extern short ENDIAN_ORDER;
+
+#ifdef __BIG_ENDIAN__
+# define ENDIAN_ORDER B_ENDIAN
+#else
+# define ENDIAN_ORDER L_ENDIAN
+#endif
/* G.moving, signals drawing in (3d) window to denote transform */
#define G_TRANSFORM_OBJ 1
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 0c31083a266..8181ad6421c 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -168,6 +168,9 @@ struct Image *copy_image(struct Image *ima);
/* merge source into dest, and free source */
void BKE_image_merge(struct Image *dest, struct Image *source);
+/* check if texture has alpha (depth=32) */
+int BKE_image_has_alpha(struct Image *image);
+
/* image_gen.c */
void BKE_image_buf_fill_color(unsigned char *rect, float *rect_float, int width, int height, float color[4]);
void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int height, int width);
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 85b6f8f78fb..cb6a0b9ab37 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -42,6 +42,8 @@ struct Main;
struct Material;
struct ID;
struct Object;
+struct Mesh;
+struct MTFace;
/* materials */
@@ -50,6 +52,7 @@ void free_material(struct Material *sc);
void test_object_materials(struct ID *id);
void resize_object_material(struct Object *ob, const short totcol);
void init_material(struct Material *ma);
+struct Material *add_material_main(struct Main *main, const char *name);
struct Material *add_material(const char *name);
struct Material *copy_material(struct Material *ma);
struct Material *localize_material(struct Material *ma);
@@ -66,19 +69,19 @@ short *give_totcolp(struct Object *ob);
struct Material ***give_matarar_id(struct ID *id); /* same but for ID's */
short *give_totcolp_id(struct ID *id);
-struct Material *give_current_material(struct Object *ob, int act);
-struct ID *material_from(struct Object *ob, int act);
-void assign_material(struct Object *ob, struct Material *ma, int act);
-void assign_matarar(struct Object *ob, struct Material ***matar, int totcol);
+struct Material *give_current_material(struct Object *ob, short act);
+struct ID *material_from(struct Object *ob, short act);
+void assign_material(struct Object *ob, struct Material *ma, short act);
+void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
-int find_material_index(struct Object *ob, struct Material *ma);
+short find_material_index(struct Object *ob, struct Material *ma);
int object_add_material_slot(struct Object *ob);
int object_remove_material_slot(struct Object *ob);
/* rna api */
void material_append_id(struct ID *id, struct Material *ma);
-struct Material *material_pop_id(struct ID *id, int index, int remove_material_slot);
+struct Material *material_pop_id(struct ID *id, int index, int remove_material_slot); /* index is an int because of RNA */
/* rendering */
@@ -101,6 +104,9 @@ void clear_mat_mtex_copybuf(void);
void copy_mat_mtex_copybuf(struct ID *id);
void paste_mat_mtex_copybuf(struct ID *id);
+/* handle backward compatibility for tface/materials called from doversion (fileload=1) or Help Menu (fileload=0) */
+int do_version_tface(struct Main *main, int fileload);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 08c150e30e3..95490b1aff6 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -84,7 +84,7 @@ void nurbs_to_mesh(struct Object *ob);
void mesh_to_curve(struct Scene *scene, struct Object *ob);
void free_dverts(struct MDeformVert *dvert, int totvert);
void copy_dverts(struct MDeformVert *dst, struct MDeformVert *src, int totvert); /* __NLA */
-void mesh_delete_material_index(struct Mesh *me, int index);
+void mesh_delete_material_index(struct Mesh *me, short index);
void mesh_set_smooth_flag(struct Object *meshOb, int enableSmooth);
struct BoundBox *mesh_get_bb(struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_navmesh_conversion.h b/source/blender/blenkernel/BKE_navmesh_conversion.h
index acb3c2963a9..01d32321c81 100644
--- a/source/blender/blenkernel/BKE_navmesh_conversion.h
+++ b/source/blender/blenkernel/BKE_navmesh_conversion.h
@@ -32,33 +32,34 @@
struct DerivedMesh;
-/* navmesh_conversion.cpp */
-bool buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int& vertsPerPoly,
- int &nverts, float *&verts,
- int &ndtris, unsigned short *&dtris,
- int& npolys, unsigned short *&dmeshes,
- unsigned short*& polys, int *&dtrisToPolysMap,
- int *&dtrisToTrisMap, int *&trisToFacesMap);
+/* navmesh_conversion.c */
+int buildNavMeshDataByDerivedMesh(struct DerivedMesh *dm, int *vertsPerPoly,
+ int *nverts, float **verts,
+ int *ndtris, unsigned short **dtris,
+ int *npolys, unsigned short **dmeshes,
+ unsigned short **polys, int **dtrisToPolysMap,
+ int **dtrisToTrisMap, int **trisToFacesMap);
-bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts,
- int &ntris, unsigned short *&tris, int *&trisToFacesMap,
- int *&recastData);
+int buildRawVertIndicesData(struct DerivedMesh* dm, int *nverts, float **verts,
+ int *ntris, unsigned short **tris, int **trisToFacesMap,
+ int **recastData);
-bool buildNavMeshData(const int nverts, const float* verts,
- const int ntris, const unsigned short *tris,
+int buildNavMeshData(const int nverts, const float* verts,
+ const int ntris, const unsigned short *tris,
const int* recastData, const int* trisToFacesMap,
- int &ndtris, unsigned short *&dtris,
- int &npolys, unsigned short *&dmeshes, unsigned short *&polys,
- int &vertsPerPoly, int *&dtrisToPolysMap, int *&dtrisToTrisMap);
+ int *ndtris, unsigned short **dtris,
+ int *npolys, unsigned short **dmeshes, unsigned short **polys,
+ int *vertsPerPoly, int **dtrisToPolysMap, int **dtrisToTrisMap);
-bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
- unsigned short* polys, const unsigned short* dmeshes,
- const float* verts, const unsigned short* dtris,
+int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
+ unsigned short* polys, const unsigned short* dmeshes,
+ const float* verts, const unsigned short* dtris,
const int* dtrisToPolysMap);
int polyNumVerts(const unsigned short* p, const int vertsPerPoly);
-bool polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts);
+int polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts);
int polyFindVertex(const unsigned short* p, const int vertsPerPoly, unsigned short vertexIdx);
float distPointToSegmentSq(const float* point, const float* a, const float* b);
+
#endif //NAVMESH_CONVERSION_H
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 0400f229083..2578a90808a 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -59,6 +59,7 @@ void paint_brush_set(struct Paint *paint, struct Brush *br);
* Texture paint could be removed since selected faces are not used
* however hiding faces is useful */
int paint_facesel_test(struct Object *ob);
+int paint_vertsel_test(struct Object *ob);
/* Session data (mode-specific) */
diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h
index 14e622c972e..87684e4895d 100644
--- a/source/blender/blenkernel/BKE_utildefines.h
+++ b/source/blender/blenkernel/BKE_utildefines.h
@@ -47,18 +47,18 @@
/* this weirdo pops up in two places ... */
#if !defined(WIN32)
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
+# ifndef O_BINARY
+# define O_BINARY 0
+# endif
#endif
/* INTEGER CODES */
-#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
- /* Big Endian */
-#define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
+#ifdef __BIG_ENDIAN__
+ /* Big Endian */
+# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
#else
- /* Little Endian */
-#define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
+ /* Little Endian */
+# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
#endif
#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
@@ -74,11 +74,11 @@
#define ENDB MAKE_ID('E','N','D','B')
/* Bit operations */
-#define BTST(a,b) ( ( (a) & 1<<(b) )!=0 )
-#define BNTST(a,b) ( ( (a) & 1<<(b) )==0 )
-#define BTST2(a,b,c) ( BTST( (a), (b) ) || BTST( (a), (c) ) )
-#define BSET(a,b) ( (a) | 1<<(b) )
-#define BCLR(a,b) ( (a) & ~(1<<(b)) )
+#define BTST(a,b) ( ( (a) & 1<<(b) )!=0 )
+#define BNTST(a,b) ( ( (a) & 1<<(b) )==0 )
+#define BTST2(a,b,c) ( BTST( (a), (b) ) || BTST( (a), (c) ) )
+#define BSET(a,b) ( (a) | 1<<(b) )
+#define BCLR(a,b) ( (a) & ~(1<<(b)) )
/* bit-row */
#define BROW(min, max) (((max)>=31? 0xFFFFFFFF: (1<<(max+1))-1) - ((min)? ((1<<(min))-1):0) )
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 21ffaba8f89..68a47371354 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -181,7 +181,6 @@ set(SRC
BKE_depsgraph.h
BKE_displist.h
BKE_effect.h
- BKE_endian.h
BKE_fcurve.h
BKE_fluidsim.h
BKE_font.h
@@ -357,10 +356,10 @@ endif()
if(WITH_GAMEENGINE)
list(APPEND INC_SYS
- ../../../extern/recastnavigation/Recast/Include
+ ../../../extern/recastnavigation
)
list(APPEND SRC
- intern/navmesh_conversion.cpp
+ intern/navmesh_conversion.c
BKE_navmesh_conversion.h
)
endif()
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index 4f19b353351..66d51810413 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -2,7 +2,7 @@
Import ('env')
import os
-sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
+sources = env.Glob('intern/*.c')
incs = '. #/intern/guardedalloc #/intern/memutil'
incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager'
@@ -92,10 +92,10 @@ if env['WITH_BF_LZMA']:
defs.append('WITH_LZMA')
if env['WITH_BF_GAMEENGINE']:
- incs += ' #/extern/recastnavigation/Recast/Include'
+ incs += ' #/extern/recastnavigation'
defs.append('WITH_GAMEENGINE')
else:
- sources.remove('intern' + os.sep + 'navmesh_conversion.cpp')
+ sources.remove('intern' + os.sep + 'navmesh_conversion.c')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 7a02da57350..fddd2809c47 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -40,6 +40,7 @@
#include "DNA_cloth_types.h"
#include "DNA_key_types.h"
#include "DNA_meshdata_types.h"
+#include "DNA_armature_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h" // N_T
@@ -59,6 +60,7 @@
#include "BKE_paint.h"
#include "BKE_texture.h"
#include "BKE_multires.h"
+#include "BKE_armature.h"
#include "BLO_sys_types.h" // for intptr_t support
@@ -986,17 +988,14 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
EditFace *efa;
DMVertexAttribs attribs= {{{0}}};
GPUVertexAttribs gattribs;
- MTFace *tf;
- int transp, new_transp, orig_transp, tfoffset;
- int i, b, matnr, new_matnr, dodraw, layer;
+ /* int tfoffset; */ /* UNUSED */
+ int i, b, matnr, new_matnr, dodraw /* , layer */ /* UNUSED */;
dodraw = 0;
matnr = -1;
- transp = GPU_get_material_blend_mode();
- orig_transp = transp;
- layer = CustomData_get_layer_index(&em->fdata, CD_MTFACE);
- tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset;
+ /* layer = CustomData_get_layer_index(&em->fdata, CD_MTFACE); */ /* UNUSED */
+ /* tfoffset = (layer == -1)? -1: em->fdata.layers[layer].offset; */ /* UNUSED */
/* always use smooth shading even for flat faces, else vertex colors wont interpolate */
glShadeModel(GL_SMOOTH);
@@ -1038,19 +1037,6 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
}
- if(tfoffset != -1) {
- tf = (MTFace*)((char*)efa->data)+tfoffset;
- new_transp = tf->transp;
-
- if(new_transp != transp) {
- if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID)
- GPU_set_material_blend_mode(orig_transp);
- else
- GPU_set_material_blend_mode(new_transp);
- transp = new_transp;
- }
- }
-
if(dodraw) {
glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
if (!drawSmooth) {
@@ -1673,20 +1659,64 @@ void weight_to_rgb(float input, float *fr, float *fg, float *fb)
}
}
-static void calc_weightpaint_vert_color(Object *ob, ColorBand *coba, int vert, unsigned char *col)
+/* draw_flag's for calc_weightpaint_vert_color */
+enum {
+ CALC_WP_MULTIPAINT= (1<<0),
+ CALC_WP_AUTO_NORMALIZE= (1<<1),
+};
+
+static void calc_weightpaint_vert_color(Object *ob, ColorBand *coba, int vert, unsigned char *col, char *dg_flags, int selected, int UNUSED(unselected), const int draw_flag)
{
Mesh *me = ob->data;
float colf[4], input = 0.0f;
int i;
+
+ int make_black= FALSE;
+
if (me->dvert) {
- for (i=0; i<me->dvert[vert].totweight; i++)
- if (me->dvert[vert].dw[i].def_nr==ob->actdef-1)
- input+=me->dvert[vert].dw[i].weight;
- }
+ if ((selected > 1) && (draw_flag & CALC_WP_MULTIPAINT)) {
+
+ int was_a_nonzero= FALSE;
+ for (i=0; i<me->dvert[vert].totweight; i++) {
+ /* in multipaint, get the average if auto normalize is inactive
+ * get the sum if it is active */
+ if(dg_flags[me->dvert[vert].dw[i].def_nr]) {
+ if(me->dvert[vert].dw[i].weight) {
+ input+= me->dvert[vert].dw[i].weight;
+ was_a_nonzero= TRUE;
+ }
+ }
+ }
- CLAMP(input, 0.0f, 1.0f);
+ /* make it black if the selected groups have no weight on a vertex */
+ if(was_a_nonzero == FALSE) {
+ make_black = TRUE;
+ }
+ else if ((draw_flag & CALC_WP_AUTO_NORMALIZE) == FALSE) {
+ input /= selected; /* get the average */
+ }
+ }
+ else {
+ /* default, non tricky behavior */
+ for (i=0; i<me->dvert[vert].totweight; i++) {
+ if (me->dvert[vert].dw[i].def_nr==ob->actdef-1) {
+ input+=me->dvert[vert].dw[i].weight;
+ }
+ }
+ }
+ }
+ if (make_black) {
+ col[3] = 0;
+ col[2] = 0;
+ col[1] = 0;
+ col[0] = 255;
+ return;
+ }
+
+ CLAMP(input, 0.0f, 1.0f);
+
if(coba)
do_colorband(coba, input, colf);
else
@@ -1705,7 +1735,7 @@ void vDM_ColorBand_store(ColorBand *coba)
stored_cb= coba;
}
-static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm)
+static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag)
{
Mesh *me = ob->data;
MFace *mf = me->mface;
@@ -1713,17 +1743,24 @@ static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm)
unsigned char *wtcol;
int i;
+ int defbase_len = BLI_countlist(&ob->defbase);
+ char *defbase_sel = MEM_mallocN(defbase_len * sizeof(char), __func__);
+ int selected = get_selected_defgroups(ob, defbase_sel, defbase_len);
+ int unselected = defbase_len - selected;
+
wtcol = MEM_callocN (sizeof (unsigned char) * me->totface*4*4, "weightmap");
memset(wtcol, 0x55, sizeof (unsigned char) * me->totface*4*4);
for (i=0; i<me->totface; i++, mf++) {
- calc_weightpaint_vert_color(ob, coba, mf->v1, &wtcol[(i*4 + 0)*4]);
- calc_weightpaint_vert_color(ob, coba, mf->v2, &wtcol[(i*4 + 1)*4]);
- calc_weightpaint_vert_color(ob, coba, mf->v3, &wtcol[(i*4 + 2)*4]);
+ calc_weightpaint_vert_color(ob, coba, mf->v1, &wtcol[(i*4 + 0)*4], defbase_sel, selected, unselected, draw_flag);
+ calc_weightpaint_vert_color(ob, coba, mf->v2, &wtcol[(i*4 + 1)*4], defbase_sel, selected, unselected, draw_flag);
+ calc_weightpaint_vert_color(ob, coba, mf->v3, &wtcol[(i*4 + 2)*4], defbase_sel, selected, unselected, draw_flag);
if (mf->v4)
- calc_weightpaint_vert_color(ob, coba, mf->v4, &wtcol[(i*4 + 3)*4]);
+ calc_weightpaint_vert_color(ob, coba, mf->v4, &wtcol[(i*4 + 3)*4], defbase_sel, selected, unselected, draw_flag);
}
+ MEM_freeN(defbase_sel);
+
CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_ASSIGN, wtcol, dm->numFaceData);
}
@@ -1751,6 +1788,9 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
int has_multires = mmd != NULL, multires_applied = 0;
int sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt;
+ int draw_flag= ((scene->toolsettings->multipaint ? CALC_WP_MULTIPAINT : 0) |
+ (scene->toolsettings->auto_normalize ? CALC_WP_AUTO_NORMALIZE : 0));
+
if(mmd && !mmd->sculptlvl)
has_multires = 0;
@@ -1930,7 +1970,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
}
if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))
- add_weight_mcol_dm(ob, dm);
+ add_weight_mcol_dm(ob, dm, draw_flag);
/* Constructive modifiers need to have an origindex
* otherwise they wont have anywhere to copy the data from.
@@ -2042,7 +2082,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
CDDM_calc_normals(finaldm);
if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))
- add_weight_mcol_dm(ob, finaldm);
+ add_weight_mcol_dm(ob, finaldm, draw_flag);
} else if(dm) {
finaldm = dm;
} else {
@@ -2054,7 +2094,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
}
if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))
- add_weight_mcol_dm(ob, finaldm);
+ add_weight_mcol_dm(ob, finaldm, draw_flag);
}
/* add an orco layer if needed */
@@ -2327,7 +2367,7 @@ static void clear_mesh_caches(Object *ob)
static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask)
{
Object *obact = scene->basact?scene->basact->object:NULL;
- int editing = paint_facesel_test(ob);
+ int editing = paint_facesel_test(ob) || paint_vertsel_test(ob);/* paint_vertsel_test */
/* weight paint and face select need original indices because of selection buffer drawing */
int needMapping = (ob==obact) && (editing || (ob->mode & (OB_MODE_WEIGHT_PAINT|OB_MODE_VERTEX_PAINT)));
@@ -2895,7 +2935,7 @@ void DM_set_object_boundbox(Object *ob, DerivedMesh *dm)
dm->getMinMax(dm, min, max);
if(!ob->bb)
- ob->bb= MEM_callocN(sizeof(BoundBox), "bb");
+ ob->bb= MEM_callocN(sizeof(BoundBox), "DM-BoundBox");
boundbox_set_from_min_max(ob->bb, min, max);
}
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index e85c56a44fe..44c61fa6dcf 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1564,7 +1564,7 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels,
PropertyRNA *prop;
PointerRNA new_ptr;
char *path = NULL;
- short free_path=0;
+ /* short free_path=0; */
/* sanity checks */
if (channels == NULL)
@@ -1572,7 +1572,7 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels,
/* get RNA pointer+property info from F-Curve for more convenient handling */
/* get path, remapped as appropriate to work in its new environment */
- free_path= animsys_remap_path(strip->remap, fcu->rna_path, &path);
+ /* free_path= */ /* UNUSED */ animsys_remap_path(strip->remap, fcu->rna_path, &path);
/* a valid property must be available, and it must be animateable */
if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) {
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 08a95477c2e..1149d8eee25 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2464,3 +2464,33 @@ void where_is_pose (Scene *scene, Object *ob)
}
}
}
+
+
+/* Returns total selected vgroups,
+ * wpi.defbase_sel is assumed malloc'd, all values are set */
+int get_selected_defgroups(Object *ob, char *dg_selection, int defbase_len)
+{
+ bDeformGroup *defgroup;
+ unsigned int i;
+ Object *armob= object_pose_armature_get(ob);
+ int dg_flags_sel_tot= 0;
+
+ if(armob) {
+ bPose *pose= armob->pose;
+ for (i= 0, defgroup= ob->defbase.first; i < defbase_len && defgroup; defgroup = defgroup->next, i++) {
+ bPoseChannel *pchan= get_pose_channel(pose, defgroup->name);
+ if(pchan && (pchan->bone->flag & BONE_SELECTED)) {
+ dg_selection[i]= TRUE;
+ dg_flags_sel_tot++;
+ }
+ else {
+ dg_selection[i]= FALSE;
+ }
+ }
+ }
+ else {
+ memset(dg_selection, FALSE, sizeof(char) * defbase_len);
+ }
+
+ return dg_flags_sel_tot;
+}
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 2d4354bdd9f..218b83fc52a 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -98,7 +98,6 @@
Global G;
UserDef U;
/* ListBase = {NULL, NULL}; */
-short ENDIAN_ORDER;
char versionstr[48]= "";
@@ -132,9 +131,6 @@ void initglobals(void)
strcpy(G.ima, "//");
- ENDIAN_ORDER= 1;
- ENDIAN_ORDER= (((char*)&ENDIAN_ORDER)[0])? L_ENDIAN: B_ENDIAN;
-
if(BLENDER_SUBVERSION)
BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION);
else
@@ -504,7 +500,7 @@ static int read_undosave(bContext *C, UndoElem *uel)
void BKE_write_undo(bContext *C, const char *name)
{
uintptr_t maxmem, totmem, memused;
- int nr, success;
+ int nr /*, success */ /* UNUSED */;
UndoElem *uel;
if( (U.uiflag & USER_GLOBALUNDO)==0) return;
@@ -556,7 +552,7 @@ void BKE_write_undo(bContext *C, const char *name)
BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter);
BLI_make_file_string("/", filepath, btempdir, numstr);
- success= BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL);
+ /* success= */ /* UNUSED */ BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL);
BLI_strncpy(curundo->str, filepath, sizeof(curundo->str));
}
@@ -566,7 +562,7 @@ void BKE_write_undo(bContext *C, const char *name)
if(curundo->prev) prevfile= &(curundo->prev->memfile);
memused= MEM_get_memory_in_use();
- success= BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags);
+ /* success= */ /* UNUSED */ BLO_write_file_mem(CTX_data_main(C), prevfile, &curundo->memfile, G.fileflags);
curundo->undosize= MEM_get_memory_in_use() - memused;
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 44359a142c9..e1939335268 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1060,18 +1060,15 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
DMVertexAttribs attribs;
MVert *mvert = cddm->mvert;
MFace *mface = cddm->mface;
- MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE);
+ /* MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE); */ /* UNUSED */
float (*nors)[3] = dm->getFaceDataArray(dm, CD_NORMAL);
int a, b, dodraw, matnr, new_matnr;
- int transp, new_transp, orig_transp;
int orig, *index = dm->getFaceDataArray(dm, CD_ORIGINDEX);
cdDM_update_normals_from_pbvh(dm);
matnr = -1;
dodraw = 0;
- transp = GPU_get_material_blend_mode();
- orig_transp = transp;
glShadeModel(GL_SMOOTH);
@@ -1111,22 +1108,6 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
continue;
}
- if(tf) {
- new_transp = tf[a].transp;
-
- if(new_transp != transp) {
- glEnd();
-
- if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID)
- GPU_set_material_blend_mode(orig_transp);
- else
- GPU_set_material_blend_mode(new_transp);
- transp = new_transp;
-
- glBegin(GL_QUADS);
- }
- }
-
if(!smoothnormal) {
if(nors) {
glNormal3fv(nors[a]);
@@ -1158,7 +1139,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
GPUBuffer *buffer = NULL;
char *varray = NULL;
int numdata = 0, elementsize = 0, offset;
- int start = 0, numfaces = 0, prevdraw = 0, curface = 0;
+ int start = 0, numfaces = 0 /* , prevdraw = 0 */ /* UNUSED */, curface = 0;
int i;
MFace *mf = mface;
@@ -1202,7 +1183,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
}
numdata = 0;
start = curface;
- prevdraw = dodraw;
+ /* prevdraw = dodraw; */ /* UNUSED */
dodraw = setMaterial(matnr = new_matnr, &gattribs);
if(dodraw) {
DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
@@ -1250,7 +1231,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
else {
/* if the buffer was set, dont use it again.
* prevdraw was assumed true but didnt run so set to false - [#21036] */
- prevdraw= 0;
+ /* prevdraw= 0; */ /* UNUSED */
buffer= NULL;
}
}
@@ -1259,33 +1240,6 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
continue;
}
- if(tf) {
- new_transp = tf[a].transp;
-
- if(new_transp != transp) {
- numfaces = curface - start;
- if( numfaces > 0 ) {
- if( dodraw ) {
- if( numdata != 0 ) {
- GPU_buffer_unlock(buffer);
- GPU_interleaved_attrib_setup(buffer,datatypes,numdata);
- }
- glDrawArrays(GL_TRIANGLES,start*3,(curface-start)*3);
- if( numdata != 0 ) {
- varray = GPU_buffer_lock_stream(buffer);
- }
- }
- }
- start = curface;
-
- if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID)
- GPU_set_material_blend_mode(orig_transp);
- else
- GPU_set_material_blend_mode(new_transp);
- transp = new_transp;
- }
- }
-
if( numdata != 0 ) {
offset = 0;
if(attribs.totorco) {
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 883f67c3061..30da2e01011 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -326,7 +326,7 @@ static void layerSwap_tface(void *data, const int *corner_indices)
static void layerDefault_tface(void *data, int count)
{
static MTFace default_tf = {{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, NULL,
- 0, 0, TF_DYNAMIC, 0, 0};
+ 0, 0, TF_DYNAMIC|TF_CONVERTED, 0, 0};
MTFace *tf = (MTFace*)data;
int i;
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 002cfdbf41a..d764826cd47 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -2290,3 +2290,20 @@ void BKE_image_user_calc_frame(ImageUser *iuser, int cfra, int fieldnr)
iuser->framenr= framenr;
if(iuser->ok==0) iuser->ok= 1;
}
+
+int BKE_image_has_alpha(struct Image *image)
+{
+ ImBuf *ibuf;
+ void *lock;
+ int depth;
+
+ ibuf= BKE_image_acquire_ibuf(image, NULL, &lock);
+ depth = (ibuf?ibuf->depth:0);
+ BKE_image_release_ibuf(image, lock);
+
+ if (depth == 32)
+ return 1;
+ else
+ return 0;
+}
+
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 21e627ae3e2..e2659340a90 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -37,12 +37,16 @@
#include <string.h>
#include <math.h>
+#include <stddef.h>
#include "MEM_guardedalloc.h"
#include "DNA_curve_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_customdata_types.h"
+#include "DNA_ID.h"
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
@@ -56,6 +60,7 @@
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_icons.h"
+#include "BKE_image.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
@@ -189,6 +194,10 @@ void init_material(Material *ma)
ma->vol.ms_diff = 1.f;
ma->vol.ms_intensity = 1.f;
+ ma->game.flag=0;
+ ma->game.alpha_blend=0;
+ ma->game.face_orientation=0;
+
ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR|MA_ZTRANSP;
ma->shade_flag= MA_APPROX_OCCLUSION;
ma->preview = NULL;
@@ -516,7 +525,7 @@ short *give_totcolp_id(ID *id)
return NULL;
}
-static void data_delete_material_index_id(ID *id, int index)
+static void data_delete_material_index_id(ID *id, short index)
{
switch(GS(id->name)) {
case ID_ME:
@@ -548,8 +557,9 @@ void material_append_id(ID *id, Material *ma)
}
}
-Material *material_pop_id(ID *id, int index, int remove_material_slot)
+Material *material_pop_id(ID *id, int index_i, int remove_material_slot)
{
+ short index= (short)index_i;
Material *ret= NULL;
Material ***matar;
if((matar= give_matarar_id(id))) {
@@ -592,7 +602,7 @@ Material *material_pop_id(ID *id, int index, int remove_material_slot)
return ret;
}
-Material *give_current_material(Object *ob, int act)
+Material *give_current_material(Object *ob, short act)
{
Material ***matarar, *ma;
short *totcolp;
@@ -630,7 +640,7 @@ Material *give_current_material(Object *ob, int act)
return ma;
}
-ID *material_from(Object *ob, int act)
+ID *material_from(Object *ob, short act)
{
if(ob==NULL) return NULL;
@@ -714,7 +724,7 @@ void test_object_materials(ID *id)
}
}
-void assign_material(Object *ob, Material *ma, int act)
+void assign_material(Object *ob, Material *ma, short act)
{
Material *mao, **matar, ***matarar;
char *matbits;
@@ -785,9 +795,10 @@ void assign_material(Object *ob, Material *ma, int act)
}
/* XXX - this calls many more update calls per object then are needed, could be optimized */
-void assign_matarar(struct Object *ob, struct Material ***matar, int totcol)
+void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
{
- int i, actcol_orig= ob->actcol;
+ int actcol_orig= ob->actcol;
+ short i;
while(object_remove_material_slot(ob)) {};
@@ -802,7 +813,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, int totcol)
}
-int find_material_index(Object *ob, Material *ma)
+short find_material_index(Object *ob, Material *ma)
{
Material ***matarar;
short a, *totcolp;
@@ -1054,7 +1065,7 @@ int object_remove_material_slot(Object *ob)
Material *mao, ***matarar;
Object *obt;
short *totcolp;
- int a, actcol;
+ short a, actcol;
if(ob==NULL || ob->totcol==0) return FALSE;
@@ -1469,3 +1480,482 @@ void paste_matcopybuf(Material *ma)
ma->nodetree= ntreeCopyTree(matcopybuf.nodetree);
}
+
+
+/*********************** texface to material convert functions **********************/
+/* encode all the TF information into a single int */
+static int encode_tfaceflag(MTFace *tf, int convertall)
+{
+ /* calculate the flag */
+ int flag = tf->mode;
+
+ /* options that change the material offline render */
+ if (!convertall) {
+ flag &= ~TF_OBCOL;
+ }
+
+ /* clean flags that are not being converted */
+ flag &= ~TF_TEX;
+ flag &= ~TF_SHAREDVERT;
+ flag &= ~TF_SHAREDCOL;
+ flag &= ~TF_CONVERTED;
+
+ /* light tface flag is ignored in GLSL mode */
+ flag &= ~TF_LIGHT;
+
+ /* 15 is how big the flag can be - hardcoded here and in decode_tfaceflag() */
+ flag |= tf->transp << 15;
+
+ /* increase 1 so flag 0 is different than no flag yet */
+ return flag + 1;
+}
+
+/* set the material options based in the tface flag */
+static void decode_tfaceflag(Material *ma, int flag, int convertall)
+{
+ int alphablend;
+ GameSettings *game= &ma->game;
+
+ /* flag is shifted in 1 to make 0 != no flag yet (see encode_tfaceflag) */
+ flag -= 1;
+
+ alphablend = flag >> 15; //encoded in the encode_tfaceflag function
+ (*game).flag = 0;
+
+ /* General Material Options */
+ if ((flag & TF_DYNAMIC)==0) (*game).flag |= GEMAT_NOPHYSICS;
+
+ /* Material Offline Rendering Properties */
+ if (convertall) {
+ if (flag & TF_OBCOL) ma->shade_flag |= MA_OBCOLOR;
+ }
+
+ /* Special Face Properties */
+ if ((flag & TF_TWOSIDE)==0) (*game).flag |= GEMAT_BACKCULL;
+ if (flag & TF_INVISIBLE)(*game).flag |= GEMAT_INVISIBLE;
+ if (flag & TF_BMFONT) (*game).flag |= GEMAT_TEXT;
+
+ /* Face Orientation */
+ if (flag & TF_BILLBOARD) (*game).face_orientation |= GEMAT_HALO;
+ else if (flag & TF_BILLBOARD2) (*game).face_orientation |= GEMAT_BILLBOARD;
+ else if (flag & TF_SHADOW) (*game).face_orientation |= GEMAT_SHADOW;
+
+ /* Alpha Blend */
+ if (flag & TF_ALPHASORT && ELEM(alphablend, TF_ALPHA, TF_ADD)) (*game).alpha_blend = GEMAT_ALPHA_SORT;
+ else if (alphablend & TF_ALPHA) (*game).alpha_blend = GEMAT_ALPHA;
+ else if (alphablend & TF_ADD) (*game).alpha_blend = GEMAT_ADD;
+ else if (alphablend & TF_CLIP) (*game).alpha_blend = GEMAT_CLIP;
+}
+
+/* boolean check to see if the mesh needs a material */
+static int check_tfaceneedmaterial(int flag)
+{
+ // check if the flags we have are not deprecated != than default material options
+ // also if only flags are visible and collision see if all objects using this mesh have this option in physics
+
+ /* flag is shifted in 1 to make 0 != no flag yet (see encode_tfaceflag) */
+ flag -=1;
+
+ // deprecated flags
+ flag &= ~TF_OBCOL;
+ flag &= ~TF_SHAREDVERT;
+ flag &= ~TF_SHAREDCOL;
+
+ /* light tface flag is ignored in GLSL mode */
+ flag &= ~TF_LIGHT;
+
+ // automatic detected if tex image has alpha
+ flag &= ~(TF_ALPHA << 15);
+ // automatic detected if using texture
+ flag &= ~TF_TEX;
+
+ // settings for the default NoMaterial
+ if (flag == TF_DYNAMIC)
+ return 0;
+
+ else
+ return 1;
+}
+
+/* return number of digits of an integer */
+// XXX to be optmized or replaced by an equivalent blender internal function
+static int integer_getdigits(int number)
+{
+ int i=0;
+ if (number == 0) return 1;
+
+ while (number != 0){
+ number = (int)(number/10);
+ i++;
+ }
+ return i;
+}
+
+static void calculate_tface_materialname(char *matname, char *newname, int flag)
+{
+ // if flag has only light and collision and material matches those values
+ // you can do strcpy(name, mat_name);
+ // otherwise do:
+ int digits = integer_getdigits(flag);
+ /* clamp the old name, remove the MA prefix and add the .TF.flag suffix
+ e.g. matname = "MALoooooooooooooongName"; newname = "Loooooooooooooon.TF.2" */
+ sprintf(newname, "%.*s.TF.%0*d", MAX_ID_NAME-(digits+5), matname, digits, flag);
+}
+
+/* returns -1 if no match */
+static short mesh_getmaterialnumber(Mesh *me, Material *ma)
+{
+ short a;
+
+ for (a=0; a<me->totcol; a++) {
+ if (me->mat[a] == ma) {
+ return a;
+ }
+ }
+
+ return -1;
+}
+
+/* append material */
+static short mesh_addmaterial(Mesh *me, Material *ma)
+{
+ material_append_id(&me->id, NULL);
+ me->mat[me->totcol-1]= ma;
+
+ id_us_plus(&ma->id);
+
+ return me->totcol-1;
+}
+
+static void set_facetexture_flags(Material *ma, Image *image)
+{
+ if(image) {
+ ma->mode |= MA_FACETEXTURE;
+ /* we could check if the texture has alpha, but then more meshes sharing the same
+ * material may need it. Let's make it simple. */
+ if(BKE_image_has_alpha(image))
+ ma->mode |= MA_FACETEXTURE_ALPHA;
+ }
+}
+
+/* returns material number */
+static short convert_tfacenomaterial(Main *main, Mesh *me, MTFace *tf, int flag)
+{
+ Material *ma;
+ char idname[MAX_ID_NAME];
+ short mat_nr= -1;
+
+ /* new material, the name uses the flag*/
+ sprintf(idname, "MAMaterial.TF.%0*d", integer_getdigits(flag), flag);
+
+ if ((ma= BLI_findstring(&main->mat, idname+2, offsetof(ID, name)+2))) {
+ mat_nr= mesh_getmaterialnumber(me, ma);
+ /* assign the material to the mesh */
+ if(mat_nr == -1) mat_nr= mesh_addmaterial(me, ma);
+
+ /* if needed set "Face Textures [Alpha]" Material options */
+ set_facetexture_flags(ma, tf->tpage);
+ }
+ /* create a new material */
+ else {
+ ma= add_material(idname+2);
+
+ if(ma){
+ printf("TexFace Convert: Material \"%s\" created.\n", idname+2);
+ mat_nr= mesh_addmaterial(me, ma);
+
+ /* if needed set "Face Textures [Alpha]" Material options */
+ set_facetexture_flags(ma, tf->tpage);
+
+ decode_tfaceflag(ma, flag, 1);
+ // the final decoding will happen after, outside the main loop
+ // for now store the flag into the material and change light/tex/collision
+ // store the flag as a negative number
+ ma->game.flag = -flag;
+ id_us_min((ID *)ma);
+ }
+ else printf("Error: Unable to create Material \"%s\" for Mesh \"%s\".", idname+2, me->id.name+2);
+ }
+
+ /* set as converted, no need to go bad to this face */
+ tf->mode |= TF_CONVERTED;
+ return mat_nr;
+}
+
+/* Function to fully convert materials */
+static void convert_tfacematerial(Main *main, Material *ma)
+{
+ Mesh *me;
+ Material *mat_new;
+ MFace *mf;
+ MTFace *tf;
+ int flag, index;
+ int a;
+ short mat_nr;
+ CustomDataLayer *cdl;
+ char idname[MAX_ID_NAME];
+
+ for(me=main->mesh.first; me; me=me->id.next){
+ /* check if this mesh uses this material */
+ for(a=0;a<me->totcol;a++)
+ if(me->mat[a] == ma) break;
+
+ /* no material found */
+ if (a == me->totcol) continue;
+
+ /* get the active tface layer */
+ index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE);
+ cdl= (index == -1)? NULL: &me->fdata.layers[index];
+ if (!cdl) continue;
+
+ /* loop over all the faces and stop at the ones that use the material*/
+ for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
+ if(me->mat[mf->mat_nr] != ma) continue;
+
+ /* texface data for this face */
+ tf = ((MTFace*)cdl->data) + a;
+ flag = encode_tfaceflag(tf, 1);
+
+ /* the name of the new material */
+ calculate_tface_materialname(ma->id.name, (char *)&idname, flag);
+
+ if ((mat_new= BLI_findstring(&main->mat, idname+2, offsetof(ID, name)+2))) {
+ /* material already existent, see if the mesh has it */
+ mat_nr = mesh_getmaterialnumber(me, mat_new);
+ /* material is not in the mesh, add it */
+ if(mat_nr == -1) mat_nr= mesh_addmaterial(me, mat_new);
+ }
+ /* create a new material */
+ else {
+ mat_new=copy_material(ma);
+ if(mat_new){
+ /* rename the material*/
+ strcpy(mat_new->id.name, idname);
+ id_us_min((ID *)mat_new);
+
+ mat_nr= mesh_addmaterial(me, mat_new);
+ decode_tfaceflag(mat_new, flag, 1);
+ }
+ else {
+ printf("Error: Unable to create Material \"%s\" for Mesh \"%s.", idname+2, me->id.name+2);
+ mat_nr = mf->mat_nr;
+ continue;
+ }
+ }
+
+ /* if the material has a texture but no texture channel
+ * set "Face Textures [Alpha]" Material options
+ * actually we need to run it always, because of old behavior
+ * of using face texture if any texture channel was present (multitex) */
+ //if((!mat_new->mtex[0]) && (!mat_new->mtex[0]->tex))
+ set_facetexture_flags(mat_new, tf->tpage);
+
+ /* set the material number to the face*/
+ mf->mat_nr = mat_nr;
+ }
+ /* remove material from mesh */
+ for(a=0;a<me->totcol;)
+ if(me->mat[a] == ma) material_pop_id(&me->id, a, 1);else a++;
+ }
+}
+
+
+#define MAT_BGE_DISPUTED -99999
+
+int do_version_tface(Main *main, int fileload)
+{
+ Mesh *me;
+ Material *ma;
+ MFace *mf;
+ MTFace *tf;
+ CustomDataLayer *cdl;
+ int a;
+ int flag;
+ int index;
+
+ /* 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
+ */
+ int nomaterialslots;
+
+ /* alert to user to check the console */
+ int nowarning = 1;
+
+ /* mark all the materials to conversion with a flag
+ * if there is tface create a complete flag for that storing in flag
+ * if there is tface and flag > 0: creates a new flag based on this face
+ * if flags are different set flag to -1
+ */
+
+ /* 1st part: marking mesh materials to update */
+ for(me=main->mesh.first; me; me=me->id.next){
+ if (me->id.lib) continue;
+
+ /* get the active tface layer */
+ index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE);
+ cdl= (index == -1)? NULL: &me->fdata.layers[index];
+ if (!cdl) continue;
+
+ nomaterialslots = (me->totcol==0?1:0);
+
+ /* loop over all the faces*/
+ for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
+ /* texface data for this face */
+ tf = ((MTFace*)cdl->data) + a;
+
+ /* conversion should happen only once */
+ if (fileload)
+ tf->mode &= ~TF_CONVERTED;
+ else {
+ if((tf->mode & TF_CONVERTED)) continue;
+ else tf->mode |= TF_CONVERTED;
+ }
+
+ /* no material slots */
+ if(nomaterialslots) {
+ flag = encode_tfaceflag(tf, 1);
+
+ /* create/find a new material and assign to the face */
+ if (check_tfaceneedmaterial(flag)) {
+ mf->mat_nr= convert_tfacenomaterial(main, me, tf, flag);
+ }
+ /* else mark them as no-material to be reverted to 0 later */
+ else {
+ mf->mat_nr = -1;
+ }
+ }
+ else if(mf->mat_nr < me->totcol) {
+ ma= me->mat[mf->mat_nr];
+
+ /* no material create one if necessary */
+ if(!ma) {
+ /* find a new material and assign to the face */
+ flag = encode_tfaceflag(tf, 1);
+
+ /* create/find a new material and assign to the face */
+ if (check_tfaceneedmaterial(flag))
+ mf->mat_nr= convert_tfacenomaterial(main, me, tf, flag);
+
+ continue;
+ }
+
+ /* we can't read from this if it comes from a library,
+ * at doversion time: direct_link might not have happened on it,
+ * so ma->mtex is not pointing to valid memory yet.
+ * later we could, but it's better not */
+ else if(ma->id.lib)
+ continue;
+
+ /* material already marked as disputed */
+ else if(ma->game.flag == MAT_BGE_DISPUTED)
+ continue;
+
+ /* found a material */
+ else {
+ flag = encode_tfaceflag(tf, ((fileload)?0:1));
+
+ /* first time changing this material */
+ if (ma->game.flag == 0)
+ ma->game.flag= -flag;
+
+ /* mark material as disputed */
+ else if (ma->game.flag != -flag) {
+ ma->game.flag = MAT_BGE_DISPUTED;
+ continue;
+ }
+
+ /* material ok so far */
+ else {
+ ma->game.flag = -flag;
+
+ /* some people uses multitexture with TexFace by creating a texture
+ * channel which not neccessarly the tf->tpage image. But the game engine
+ * was enabling it. Now it's required to set "Face Texture [Alpha] in the
+ * material settings. */
+ if(!fileload)
+ set_facetexture_flags(ma, tf->tpage);
+ }
+ }
+ }
+ else
+ continue;
+ }
+
+ /* if we didn't have material slot and now we do, we need to
+ * make sure the materials are correct */
+ if(nomaterialslots) {
+ if (me->totcol>0) {
+ for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
+ if (mf->mat_nr == -1) {
+ /* texface data for this face */
+ tf = ((MTFace*)cdl->data) + a;
+ mf->mat_nr= convert_tfacenomaterial(main, me, tf, encode_tfaceflag(tf, 1));
+ }
+ }
+ }
+ else {
+ for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
+ mf->mat_nr=0;
+ }
+ }
+ }
+
+ }
+
+ /* 2nd part - conversion */
+ /* skip library files */
+
+ /* we shouldn't loop through the materials created in the loop. make the loop stop at its original length) */
+ for (ma= main->mat.first, a=0; ma; ma= ma->id.next, a++) {
+ if (ma->id.lib) continue;
+
+ /* disputed material */
+ if (ma->game.flag == MAT_BGE_DISPUTED) {
+ ma->game.flag = 0;
+ if (fileload) {
+ printf("Warning: material \"%s\" skipped - to convert old game texface to material go to the Help menu.\n", ma->id.name+2);
+ nowarning = 0;
+ }
+ else
+ convert_tfacematerial(main, ma);
+ continue;
+ }
+
+ /* no conflicts in this material - 90% of cases
+ * convert from tface system to material */
+ else if (ma->game.flag < 0) {
+ decode_tfaceflag(ma, -(ma->game.flag), 1);
+
+ /* material is good make sure all faces using
+ * this material are set to converted */
+ if (fileload) {
+ for(me=main->mesh.first; me; me=me->id.next){
+ /* check if this mesh uses this material */
+ for(a=0;a<me->totcol;a++)
+ if(me->mat[a] == ma) break;
+
+ /* no material found */
+ if (a == me->totcol) continue;
+
+ /* get the active tface layer */
+ index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE);
+ cdl= (index == -1)? NULL: &me->fdata.layers[index];
+ if (!cdl) continue;
+
+ /* loop over all the faces and stop at the ones that use the material*/
+ for (a=0, mf=me->mface; a<me->totface; a++, mf++) {
+ if (me->mat[mf->mat_nr] == ma) {
+ /* texface data for this face */
+ tf = ((MTFace*)cdl->data) + a;
+ tf->mode |= TF_CONVERTED;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return nowarning;
+}
+
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 32819226361..810e7c285e8 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -917,7 +917,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int
mface->v2= startvert+index[2];
mface->v3= startvert+index[1];
mface->v4= 0;
- mface->mat_nr= (unsigned char)dl->col;
+ mface->mat_nr= dl->col;
test_index_face(mface, NULL, 0, 3);
if(smooth) mface->flag |= ME_SMOOTH;
@@ -966,7 +966,7 @@ int nurbs_to_mdata_customdb(Object *ob, ListBase *dispbase, MVert **allvert, int
mface->v2= p3;
mface->v3= p4;
mface->v4= p2;
- mface->mat_nr= (unsigned char)dl->col;
+ mface->mat_nr= dl->col;
test_index_face(mface, NULL, 0, 4);
if(smooth) mface->flag |= ME_SMOOTH;
@@ -1252,7 +1252,7 @@ void mesh_to_curve(Scene *scene, Object *ob)
}
}
-void mesh_delete_material_index(Mesh *me, int index)
+void mesh_delete_material_index(Mesh *me, short index)
{
MFace *mf;
int i;
diff --git a/source/blender/blenkernel/intern/navmesh_conversion.cpp b/source/blender/blenkernel/intern/navmesh_conversion.c
index fbc4775cf34..8a2ec1e5169 100644
--- a/source/blender/blenkernel/intern/navmesh_conversion.cpp
+++ b/source/blender/blenkernel/intern/navmesh_conversion.c
@@ -29,30 +29,33 @@
#include <math.h>
#include <stdlib.h>
-#include "Recast.h"
-extern "C"{
-#include "BKE_navmesh_conversion.h"
+#include "MEM_guardedalloc.h"
#include "DNA_meshdata_types.h"
+
+#include "BKE_navmesh_conversion.h"
#include "BKE_cdderivedmesh.h"
+
+#include "BLI_utildefines.h"
#include "BLI_math.h"
-}
-inline float area2(const float* a, const float* b, const float* c)
+#include "recast-capi.h"
+
+BM_INLINE float area2(const float* a, const float* b, const float* c)
{
return (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]);
}
-inline bool left(const float* a, const float* b, const float* c)
+BM_INLINE int left(const float* a, const float* b, const float* c)
{
return area2(a, b, c) < 0;
}
int polyNumVerts(const unsigned short* p, const int vertsPerPoly)
{
- int nv = 0;
- for (int i=0; i<vertsPerPoly; i++)
+ int i, nv = 0;
+ for (i=0; i<vertsPerPoly; i++)
{
if (p[i]==0xffff)
break;
@@ -61,30 +64,34 @@ int polyNumVerts(const unsigned short* p, const int vertsPerPoly)
return nv;
}
-bool polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts)
+int polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts)
{
- int nv = polyNumVerts(p, vertsPerPoly);
+ int j, nv = polyNumVerts(p, vertsPerPoly);
if (nv<3)
- return false;
- for (int j=0; j<nv; j++)
+ return 0;
+ for (j=0; j<nv; j++)
{
const float* v = &verts[3*p[j]];
const float* v_next = &verts[3*p[(j+1)%nv]];
const float* v_prev = &verts[3*p[(nv+j-1)%nv]];
if (!left(v_prev, v, v_next))
- return false;
+ return 0;
}
- return true;
+ return 1;
}
float distPointToSegmentSq(const float* point, const float* a, const float* b)
{
float abx[3], dx[3];
- vsub(abx, b,a);
- vsub(dx, point,a);
- float d = abx[0]*abx[0]+abx[2]*abx[2];
- float t = abx[0]*dx[0]+abx[2]*dx[2];
+ float d, t;
+
+ sub_v3_v3v3(abx, b,a);
+ sub_v3_v3v3(dx, point,a);
+
+ d = abx[0]*abx[0]+abx[2]*abx[2];
+ t = abx[0]*dx[0]+abx[2]*dx[2];
+
if (d > 0)
t /= d;
if (t < 0)
@@ -93,33 +100,42 @@ float distPointToSegmentSq(const float* point, const float* a, const float* b)
t = 1;
dx[0] = a[0] + t*abx[0] - point[0];
dx[2] = a[2] + t*abx[2] - point[2];
+
return dx[0]*dx[0] + dx[2]*dx[2];
}
-bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts,
- int &ntris, unsigned short *&tris, int *&trisToFacesMap,
- int *&recastData)
+int buildRawVertIndicesData(DerivedMesh* dm, int *nverts_r, float **verts_r,
+ int *ntris_r, unsigned short **tris_r, int **trisToFacesMap_r,
+ int **recastData)
{
+ int vi, fi, triIdx;
+ int nverts, ntris;
+ int *trisToFacesMap;
+ float *verts;
+ unsigned short *tris, *tri;
+ int nfaces;
+ MFace *faces;
+
nverts = dm->getNumVerts(dm);
if (nverts>=0xffff)
{
printf("Converting navmesh: Error! Too many vertices. Max number of vertices %d\n", 0xffff);
- return false;
+ return 0;
}
- verts = new float[3*nverts];
+ verts = MEM_callocN(sizeof(float)*3*nverts, "buildRawVertIndicesData verts");
dm->getVertCos(dm, (float(*)[3])verts);
//flip coordinates
- for (int vi=0; vi<nverts; vi++)
+ for (vi=0; vi<nverts; vi++)
{
SWAP(float, verts[3*vi+1], verts[3*vi+2]);
}
//calculate number of tris
- int nfaces = dm->getNumFaces(dm);
- MFace *faces = dm->getFaceArray(dm);
+ nfaces = dm->getNumFaces(dm);
+ faces = dm->getFaceArray(dm);
ntris = nfaces;
- for (int fi=0; fi<nfaces; fi++)
+ for (fi=0; fi<nfaces; fi++)
{
MFace* face = &faces[fi];
if (face->v4)
@@ -127,11 +143,11 @@ bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts,
}
//copy and transform to triangles (reorder on the run)
- trisToFacesMap = new int[ntris];
- tris = new unsigned short[3*ntris];
- unsigned short* tri = tris;
- int triIdx = 0;
- for (int fi=0; fi<nfaces; fi++)
+ trisToFacesMap = MEM_callocN(sizeof(int)*ntris, "buildRawVertIndicesData trisToFacesMap");
+ tris = MEM_callocN(sizeof(unsigned short)*3*ntris, "buildRawVertIndicesData tris");
+ tri = tris;
+ triIdx = 0;
+ for (fi=0; fi<nfaces; fi++)
{
MFace* face = &faces[fi];
tri[3*triIdx+0] = (unsigned short) face->v1;
@@ -148,32 +164,46 @@ bool buildRawVertIndicesData(DerivedMesh* dm, int &nverts, float *&verts,
}
//carefully, recast data is just reference to data in derived mesh
- recastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST);
- return true;
+ *recastData = (int*)CustomData_get_layer(&dm->faceData, CD_RECAST);
+
+ *nverts_r = nverts;
+ *verts_r = verts;
+ *ntris_r = ntris;
+ *tris_r = tris;
+ *trisToFacesMap_r = trisToFacesMap;
+
+ return 1;
}
-bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
+int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
unsigned short* polys, const unsigned short* dmeshes,
const float* verts, const unsigned short* dtris,
const int* dtrisToPolysMap)
{
+ int polyidx;
int capacity = vertsPerPoly;
- unsigned short* newPoly = new unsigned short[capacity];
+ unsigned short* newPoly = MEM_callocN(sizeof(unsigned short)*capacity, "buildPolygonsByDetailedMeshes newPoly");
memset(newPoly, 0xff, sizeof(unsigned short)*capacity);
- for (int polyidx=0; polyidx<npolys; polyidx++)
+
+ for (polyidx=0; polyidx<npolys; polyidx++)
{
+ size_t i;
+ int j, k;
int nv = 0;
//search border
- int btri = -1;
- int bedge = -1;
+ int tri, btri = -1;
+ int edge, bedge = -1;
int dtrisNum = dmeshes[polyidx*4+3];
int dtrisBase = dmeshes[polyidx*4+2];
- unsigned char *traversedTris = new unsigned char[dtrisNum];
- memset(traversedTris, 0, dtrisNum*sizeof(unsigned char));
- for (int j=0; j<dtrisNum && btri==-1;j++)
+ unsigned char *traversedTris = MEM_callocN(sizeof(unsigned char)*dtrisNum, "buildPolygonsByDetailedMeshes traversedTris");
+ unsigned short* adjustedPoly;
+ int adjustedNv;
+ int allBorderTraversed;
+
+ for (j=0; j<dtrisNum && btri==-1;j++)
{
int curpolytri = dtrisBase+j;
- for (int k=0; k<3; k++)
+ for (k=0; k<3; k++)
{
unsigned short neighbortri = dtris[curpolytri*3*2+3+k];
if ( neighbortri==0xffff || dtrisToPolysMap[neighbortri]!=polyidx+1)
@@ -187,12 +217,15 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
if (btri==-1 || bedge==-1)
{
//can't find triangle with border edge
- return false;
+ MEM_freeN(traversedTris);
+ MEM_freeN(newPoly);
+
+ return 0;
}
newPoly[nv++] = dtris[btri*3*2+bedge];
- int tri = btri;
- int edge = (bedge+1)%3;
+ tri = btri;
+ edge = (bedge+1)%3;
traversedTris[tri-dtrisBase] = 1;
while (tri!=btri || edge!=bedge)
{
@@ -201,11 +234,12 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
{
if (nv==capacity)
{
+ unsigned short* newPolyBig;
capacity += vertsPerPoly;
- unsigned short* newPolyBig = new unsigned short[capacity];
+ newPolyBig = MEM_callocN(sizeof(unsigned short)*capacity, "buildPolygonsByDetailedMeshes newPolyBig");
memset(newPolyBig, 0xff, sizeof(unsigned short)*capacity);
memcpy(newPolyBig, newPoly, sizeof(unsigned short)*nv);
- delete newPoly;
+ MEM_freeN(newPoly);
newPoly = newPolyBig;
}
newPoly[nv++] = dtris[tri*3*2+edge];
@@ -216,7 +250,7 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
{
//move to next tri
int twinedge = -1;
- for (int k=0; k<3; k++)
+ for (k=0; k<3; k++)
{
if (dtris[neighbortri*3*2+3+k] == tri)
{
@@ -227,7 +261,8 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
if (twinedge==-1)
{
printf("Converting navmesh: Error! Can't find neighbor edge - invalid adjacency info\n");
- goto returnLabel;
+ MEM_freeN(traversedTris);
+ goto returnLabel;
}
tri = neighbortri;
edge = (twinedge+1)%3;
@@ -235,9 +270,9 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
}
}
- unsigned short* adjustedPoly = new unsigned short[nv];
- int adjustedNv = 0;
- for (size_t i=0; i<(size_t)nv; i++)
+ adjustedPoly = MEM_callocN(sizeof(unsigned short)*nv, "buildPolygonsByDetailedMeshes adjustedPoly");
+ adjustedNv = 0;
+ for (i=0; i<nv; i++)
{
unsigned short prev = newPoly[(nv+i-1)%nv];
unsigned short cur = newPoly[i];
@@ -248,22 +283,22 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
adjustedPoly[adjustedNv++] = cur;
}
memcpy(newPoly, adjustedPoly, adjustedNv*sizeof(unsigned short));
- delete adjustedPoly;
+ MEM_freeN(adjustedPoly);
nv = adjustedNv;
- bool allBorderTraversed = true;
- for (size_t i=0; i<(size_t)dtrisNum; i++)
+ allBorderTraversed = 1;
+ for (i=0; i<dtrisNum; i++)
{
if (traversedTris[i]==0)
{
//check whether it has border edges
int curpolytri = dtrisBase+i;
- for (int k=0; k<3; k++)
+ for (k=0; k<3; k++)
{
unsigned short neighbortri = dtris[curpolytri*3*2+3+k];
if ( neighbortri==0xffff || dtrisToPolysMap[neighbortri]!=polyidx+1)
{
- allBorderTraversed = false;
+ allBorderTraversed = 0;
break;
}
}
@@ -272,16 +307,19 @@ bool buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
if (nv<=vertsPerPoly && allBorderTraversed)
{
- for (int i=0; i<nv; i++)
+ for (i=0; i<nv; i++)
{
polys[polyidx*vertsPerPoly*2+i] = newPoly[i];
}
}
+
+ MEM_freeN(traversedTris);
}
returnLabel:
- delete newPoly;
- return true;
+ MEM_freeN(newPoly);
+
+ return 1;
}
struct SortContext
@@ -292,7 +330,7 @@ struct SortContext
/* 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 SortContext *_qsort_context;
+static struct SortContext *_qsort_context;
static int compareByData(const void * a, const void * b)
{
@@ -300,32 +338,41 @@ static int compareByData(const void * a, const void * b)
_qsort_context->recastData[_qsort_context->trisToFacesMap[*(int*)b]] );
}
-bool buildNavMeshData(const int nverts, const float* verts,
+int buildNavMeshData(const int nverts, const float* verts,
const int ntris, const unsigned short *tris,
const int* recastData, const int* trisToFacesMap,
- int &ndtris, unsigned short *&dtris,
- int &npolys, unsigned short *&dmeshes, unsigned short *&polys,
- int &vertsPerPoly, int *&dtrisToPolysMap, int *&dtrisToTrisMap)
+ int *ndtris_r, unsigned short **dtris_r,
+ int *npolys_r, unsigned short **dmeshes_r, unsigned short **polys_r,
+ int *vertsPerPoly_r, int **dtrisToPolysMap_r, int **dtrisToTrisMap_r)
{
+ int *trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping");
+ int i;
+ struct SortContext context;
+ int validTriStart, prevPolyIdx, curPolyIdx, newPolyIdx, prevpolyidx;
+ unsigned short *dmesh;
+
+ int ndtris, npolys, vertsPerPoly;
+ unsigned short *dtris, *dmeshes, *polys;
+ int *dtrisToPolysMap, *dtrisToTrisMap;
+
if (!recastData)
{
printf("Converting navmesh: Error! Can't find recast custom data\n");
- return false;
+ return 0;
}
//sort the triangles by polygon idx
- int* trisMapping = new int[ntris];
- for (int i=0; i<ntris; i++)
+ for (i=0; i<ntris; i++)
trisMapping[i]=i;
- SortContext context;
context.recastData = recastData;
context.trisToFacesMap = trisToFacesMap;
_qsort_context = &context;
qsort(trisMapping, ntris, sizeof(int), compareByData);
+
//search first valid triangle - triangle of convex polygon
- int validTriStart = -1;
- for (int i=0; i< ntris; i++)
+ validTriStart = -1;
+ for (i=0; i< ntris; i++)
{
if (recastData[trisToFacesMap[trisMapping[i]]]>0)
{
@@ -337,28 +384,30 @@ bool buildNavMeshData(const int nverts, const float* verts,
if (validTriStart<0)
{
printf("Converting navmesh: Error! No valid polygons in mesh\n");
- delete trisMapping;
- return false;
+ MEM_freeN(trisMapping);
+ return 0;
}
ndtris = ntris-validTriStart;
//fill dtris to faces mapping
- dtrisToTrisMap = new int[ndtris];
+ dtrisToTrisMap = MEM_callocN(sizeof(int)*ndtris, "buildNavMeshData dtrisToTrisMap");
memcpy(dtrisToTrisMap, &trisMapping[validTriStart], ndtris*sizeof(int));
- delete trisMapping; trisMapping=NULL;
+ MEM_freeN(trisMapping);
//create detailed mesh triangles - copy only valid triangles
//and reserve memory for adjacency info
- dtris = new unsigned short[3*2*ndtris];
+ dtris = MEM_callocN(sizeof(unsigned short)*3*2*ndtris, "buildNavMeshData dtris");
memset(dtris, 0xffff, sizeof(unsigned short)*3*2*ndtris);
- for (int i=0; i<ndtris; i++)
+ for (i=0; i<ndtris; i++)
{
memcpy(dtris+3*2*i, tris+3*dtrisToTrisMap[i], sizeof(unsigned short)*3);
}
+
//create new recast data corresponded to dtris and renumber for continuous indices
- int prevPolyIdx=-1, curPolyIdx, newPolyIdx=0;
- dtrisToPolysMap = new int[ndtris];
- for (int i=0; i<ndtris; i++)
+ prevPolyIdx = -1;
+ newPolyIdx = 0;
+ dtrisToPolysMap = MEM_callocN(sizeof(int)*ndtris, "buildNavMeshData dtrisToPolysMap");
+ for (i=0; i<ndtris; i++)
{
curPolyIdx = recastData[trisToFacesMap[dtrisToTrisMap[i]]];
if (curPolyIdx!=prevPolyIdx)
@@ -371,15 +420,15 @@ bool buildNavMeshData(const int nverts, const float* verts,
//build adjacency info for detailed mesh triangles
- buildMeshAdjacency(dtris, ndtris, nverts, 3);
+ recast_buildMeshAdjacency(dtris, ndtris, nverts, 3);
//create detailed mesh description for each navigation polygon
npolys = dtrisToPolysMap[ndtris-1];
- dmeshes = new unsigned short[npolys*4];
+ dmeshes = MEM_callocN(sizeof(unsigned short)*npolys*4, "buildNavMeshData dmeshes");
memset(dmeshes, 0, npolys*4*sizeof(unsigned short));
- unsigned short *dmesh = NULL;
- int prevpolyidx = 0;
- for (int i=0; i<ndtris; i++)
+ dmesh = NULL;
+ prevpolyidx = 0;
+ for (i=0; i<ndtris; i++)
{
int curpolyidx = dtrisToPolysMap[i];
if (curpolyidx!=prevpolyidx)
@@ -387,7 +436,7 @@ bool buildNavMeshData(const int nverts, const float* verts,
if (curpolyidx!=prevpolyidx+1)
{
printf("Converting navmesh: Error! Wrong order of detailed mesh faces\n");
- return false;
+ return 0;
}
dmesh = dmesh==NULL ? dmeshes : dmesh+4;
dmesh[2] = (unsigned short)i; //tbase
@@ -399,33 +448,43 @@ bool buildNavMeshData(const int nverts, const float* verts,
//create navigation polygons
vertsPerPoly = 6;
- polys = new unsigned short[npolys*vertsPerPoly*2];
+ polys = MEM_callocN(sizeof(unsigned short)*npolys*vertsPerPoly*2, "buildNavMeshData polys");
memset(polys, 0xff, sizeof(unsigned short)*vertsPerPoly*2*npolys);
buildPolygonsByDetailedMeshes(vertsPerPoly, npolys, polys, dmeshes, verts, dtris, dtrisToPolysMap);
- return true;
+ *ndtris_r = ndtris;
+ *npolys_r = npolys;
+ *vertsPerPoly_r = vertsPerPoly;
+ *dtris_r = dtris;
+ *dmeshes_r = dmeshes;
+ *polys_r = polys;
+ *dtrisToPolysMap_r = dtrisToPolysMap;
+ *dtrisToTrisMap_r = dtrisToTrisMap;
+
+ return 1;
}
-bool buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int& vertsPerPoly,
- int &nverts, float *&verts,
- int &ndtris, unsigned short *&dtris,
- int& npolys, unsigned short *&dmeshes,
- unsigned short*& polys, int *&dtrisToPolysMap,
- int *&dtrisToTrisMap, int *&trisToFacesMap)
+int buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int *vertsPerPoly,
+ int *nverts, float **verts,
+ int *ndtris, unsigned short **dtris,
+ int *npolys, unsigned short **dmeshes,
+ unsigned short **polys, int **dtrisToPolysMap,
+ int **dtrisToTrisMap, int **trisToFacesMap)
{
- bool res = true;
- int ntris =0, *recastData=NULL;
+ int res = 1;
+ int ntris = 0, *recastData=NULL;
unsigned short *tris=NULL;
- res = buildRawVertIndicesData(dm, nverts, verts, ntris, tris, trisToFacesMap, recastData);
+
+ res = buildRawVertIndicesData(dm, nverts, verts, &ntris, &tris, trisToFacesMap, &recastData);
if (!res)
{
printf("Converting navmesh: Error! Can't get vertices and indices from mesh\n");
goto exit;
}
- res = buildNavMeshData(nverts, verts, ntris, tris, recastData, trisToFacesMap,
+ res = buildNavMeshData(*nverts, *verts, ntris, tris, recastData, *trisToFacesMap,
ndtris, dtris, npolys, dmeshes,polys, vertsPerPoly,
dtrisToPolysMap, dtrisToTrisMap);
if (!res)
@@ -436,15 +495,15 @@ bool buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int& vertsPerPoly,
exit:
if (tris)
- delete tris;
+ MEM_freeN(tris);
return res;
}
int polyFindVertex(const unsigned short* p, const int vertsPerPoly, unsigned short vertexIdx)
{
- int res = -1;
- for(int i=0; i<vertsPerPoly; i++)
+ int i, res = -1;
+ for(i=0; i<vertsPerPoly; i++)
{
if (p[i]==0xffff)
break;
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 89fd3ff9c13..524a63a8a95 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -295,12 +295,12 @@ int nodeFindNode(bNodeTree *ntree, bNodeSocket *sock, bNode **nodep, int *sockin
static void node_add_sockets_from_type(bNodeTree *ntree, bNode *node, bNodeType *ntype)
{
bNodeSocketTemplate *sockdef;
- bNodeSocket *sock;
+ /* bNodeSocket *sock; */ /* UNUSED */
if(ntype->inputs) {
sockdef= ntype->inputs;
while(sockdef->type != -1) {
- sock = node_add_input_from_template(ntree, node, sockdef);
+ /* sock = */ node_add_input_from_template(ntree, node, sockdef);
sockdef++;
}
@@ -308,7 +308,7 @@ static void node_add_sockets_from_type(bNodeTree *ntree, bNode *node, bNodeType
if(ntype->outputs) {
sockdef= ntype->outputs;
while(sockdef->type != -1) {
- sock = node_add_output_from_template(ntree, node, sockdef);
+ /* sock = */ node_add_output_from_template(ntree, node, sockdef);
sockdef++;
}
@@ -620,7 +620,7 @@ bNodeTree *ntreeAddTree(const char *name, int type, int nodetype)
bNodeTree *ntreeCopyTree(bNodeTree *ntree)
{
bNodeTree *newtree;
- bNode *node, *nnode, *last;
+ bNode *node /*, *nnode */ /* UNUSED */, *last;
bNodeLink *link;
bNodeSocket *gsock, *oldgsock;
@@ -647,7 +647,7 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
last = ntree->nodes.last;
for(node= ntree->nodes.first; node; node= node->next) {
node->new_node= NULL;
- nnode= nodeCopyNode(newtree, node); /* sets node->new */
+ /* nnode= */ nodeCopyNode(newtree, node); /* sets node->new */
/* make sure we don't copy new nodes again! */
if (node==last)
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c6047bd94e9..f8669c30809 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2360,7 +2360,7 @@ BoundBox *unit_boundbox(void)
BoundBox *bb;
float min[3] = {-1.0f,-1.0f,-1.0f}, max[3] = {-1.0f,-1.0f,-1.0f};
- bb= MEM_callocN(sizeof(BoundBox), "bb");
+ bb= MEM_callocN(sizeof(BoundBox), "OB-BoundBox");
boundbox_set_from_min_max(bb, min, max);
return bb;
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index d00eb6192da..ddeb42d608e 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -97,6 +97,10 @@ int paint_facesel_test(Object *ob)
return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)));
}
+int paint_vertsel_test(Object *ob)
+{
+ return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) && (ob->mode & OB_MODE_WEIGHT_PAINT));
+}
void paint_init(Paint *p, const char col[3])
{
Brush *brush;
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index ff518d69e21..73d0d70778f 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -1,11 +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 *****
+ */
+
/** \file blender/blenkernel/intern/sound.c
* \ingroup bke
*/
-/**
- * sound.c (mar-2001 nzc)
- *
- * $Id$
- */
#include <string.h>
#include <stdlib.h>
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 2ff555b5b22..36263746228 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -968,8 +968,9 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface)
for(index = 0; index < totface; index++) {
CCGFace *f = ccgdm->faceMap[index].face;
int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
- int flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH;
- int mat_nr = (faceFlags)? faceFlags[index*2+1]: 0;
+ /* keep types in sync with MFace, avoid many conversions */
+ char flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH;
+ short mat_nr = (faceFlags)? faceFlags[index*2+1]: 0;
for(S = 0; S < numVerts; S++) {
for(y = 0; y < gridSize - 1; y++) {
@@ -1374,11 +1375,10 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v
CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss);
GPUVertexAttribs gattribs;
DMVertexAttribs attribs= {{{NULL}}};
- MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE);
+ /* MTFace *tf = dm->getFaceDataArray(dm, CD_MTFACE); */ /* UNUSED */
int gridSize = ccgSubSurf_getGridSize(ss);
int gridFaces = gridSize - 1;
int edgeSize = ccgSubSurf_getEdgeSize(ss);
- int transp, orig_transp, new_transp;
char *faceFlags = ccgdm->faceFlags;
int a, b, i, doDraw, numVerts, matnr, new_matnr, totface;
@@ -1386,8 +1386,6 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v
doDraw = 0;
matnr = -1;
- transp = GPU_get_material_blend_mode();
- orig_transp = transp;
#define PASSATTRIB(dx, dy, vert) { \
if(attribs.totorco) { \
@@ -1439,18 +1437,6 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v
continue;
}
- if(tf) {
- new_transp = tf[i].transp;
-
- if(new_transp != transp) {
- if(new_transp == GPU_BLEND_SOLID && orig_transp != GPU_BLEND_SOLID)
- GPU_set_material_blend_mode(orig_transp);
- else
- GPU_set_material_blend_mode(new_transp);
- transp = new_transp;
- }
- }
-
glShadeModel(drawSmooth? GL_SMOOTH: GL_FLAT);
for (S=0; S<numVerts; S++) {
DMGridData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
index 59c01348c07..21d28ca3185 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -53,6 +53,7 @@ int BLI_exists(const char *file);
int BLI_copy_fileops(const char *file, const char *to);
int BLI_rename(const char *from, const char *to);
int BLI_gzip(const char *from, const char *to);
+char *BLI_ungzip_to_mem(const char *from_file, int *size_r);
int BLI_delete(const char *file, int dir, int recursive);
int BLI_move(const char *file, const char *to);
int BLI_touch(const char *file);
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index ef20408a37e..d7ca03243df 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -102,6 +102,8 @@ void quat_to_axis_angle(float axis[3], float *angle, const float q[4]);
void mat3_to_axis_angle(float axis[3], float *angle, float M[3][3]);
void mat4_to_axis_angle(float axis[3], float *angle, float M[4][4]);
+void single_axis_angle_to_mat3(float R[3][3], const char axis, const float angle);
+
/****************************** Vector/Rotation ******************************/
/* old axis angle code */
/* TODO: the following calls should probably be depreceated sometime */
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 9a3b81e5776..456ee72c4e0 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -35,11 +35,11 @@
*/
#ifndef FALSE
-#define FALSE 0
+# define FALSE 0
#endif
#ifndef TRUE
-#define TRUE 1
+# define TRUE 1
#endif
@@ -94,7 +94,7 @@
/* some math and copy defines */
#ifndef SWAP
-#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
+# define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
#endif
#define ABS(a) ( (a)<0 ? (-(a)) : (a) )
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 3299752646b..9ccd7fbe121 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -52,6 +52,8 @@
#include <sys/param.h>
#endif
+#include "MEM_guardedalloc.h"
+
#include "BLI_blenlib.h"
#include "BKE_utildefines.h"
@@ -104,6 +106,49 @@ int BLI_gzip(const char *from, const char *to) {
return rval;
}
+/* gzip the file in from_file and write it to memery to_mem, at most size bytes.
+ return the unziped size
+ */
+char *BLI_ungzip_to_mem(const char *from_file, int *size_r)
+{
+ gzFile gzfile;
+ int readsize, size, alloc_size=0;
+ char *mem= NULL;
+ const int chunk_size= 512*1024;
+
+ size= 0;
+
+ gzfile = gzopen( from_file, "rb" );
+
+ for(;;) {
+ if(mem==NULL) {
+ mem= MEM_callocN(chunk_size, "BLI_ungzip_to_mem");
+ alloc_size= chunk_size;
+ } else {
+ mem= MEM_reallocN(mem, size+chunk_size);
+ alloc_size+= chunk_size;
+ }
+
+ readsize= gzread(gzfile, mem+size, chunk_size);
+ if(readsize>0) {
+ size+= readsize;
+ }
+ else break;
+ }
+
+ if(size==0) {
+ MEM_freeN(mem);
+ mem= NULL;
+ }
+ else if(alloc_size!=size)
+ mem= MEM_reallocN(mem, size);
+
+ *size_r= size;
+
+ return mem;
+}
+
+
/* return 1 when file can be written */
int BLI_is_writable(const char *filename)
{
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 6800b59c2c7..ef286e1d102 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -771,6 +771,52 @@ void mat4_to_axis_angle(float axis[3], float *angle,float mat[4][4])
quat_to_axis_angle(axis, angle,q);
}
+
+
+void single_axis_angle_to_mat3(float mat[3][3], const char axis, const float angle)
+{
+ const float angle_cos= cosf(angle);
+ const float angle_sin= sinf(angle);
+
+ switch(axis) {
+ case 'X': /* rotation around X */
+ mat[0][0] = 1.0f;
+ mat[0][1] = 0.0f;
+ mat[0][2] = 0.0f;
+ mat[1][0] = 0.0f;
+ mat[1][1] = angle_cos;
+ mat[1][2] = angle_sin;
+ mat[2][0] = 0.0f;
+ mat[2][1] = -angle_sin;
+ mat[2][2] = angle_cos;
+ break;
+ case 'Y': /* rotation around Y */
+ mat[0][0] = angle_cos;
+ mat[0][1] = 0.0f;
+ mat[0][2] = -angle_sin;
+ mat[1][0] = 0.0f;
+ mat[1][1] = 1.0f;
+ mat[1][2] = 0.0f;
+ mat[2][0] = angle_sin;
+ mat[2][1] = 0.0f;
+ mat[2][2] = angle_cos;
+ break;
+ case 'Z': /* rotation around Z */
+ mat[0][0] = angle_cos;
+ mat[0][1] = angle_sin;
+ mat[0][2] = 0.0f;
+ mat[1][0] = -angle_sin;
+ mat[1][1] = angle_cos;
+ mat[1][2] = 0.0f;
+ mat[2][0] = 0.0f;
+ mat[2][1] = 0.0f;
+ mat[2][2] = 1.0f;
+ break;
+ default:
+ assert("invalid axis");
+ }
+}
+
/****************************** Vector/Rotation ******************************/
/* TODO: the following calls should probably be depreceated sometime */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 132db3c3577..1134eb17f9d 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -239,6 +239,7 @@ typedef struct OldNewMap {
/* local prototypes */
static void *read_struct(FileData *fd, BHead *bh, const char *blockname);
static void direct_link_modifiers(FileData *fd, ListBase *lb);
+static void convert_tface_mt(FileData *fd, Main *main);
static OldNewMap *oldnewmap_new(void)
{
@@ -3479,6 +3480,9 @@ static void lib_link_mesh(FileData *fd, Main *main)
}
me= me->id.next;
}
+
+ /* convert texface options to material */
+ convert_tface_mt(fd, main);
}
static void direct_link_dverts(FileData *fd, int count, MDeformVert *mdverts)
@@ -4029,8 +4033,10 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;
fluidmd->fss= newdataadr(fd, fluidmd->fss);
- fluidmd->fss->fmd= fluidmd;
- fluidmd->fss->meshVelocities = NULL;
+ if(fluidmd->fss) {
+ fluidmd->fss->fmd= fluidmd;
+ fluidmd->fss->meshVelocities = NULL;
+ }
}
else if (md->type==eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData*) md;
@@ -6545,7 +6551,7 @@ static void alphasort_version_246(FileData *fd, Library *lib, Mesh *me)
/* if we do, set alpha sort if the game engine did it before */
for(a=0, mf=me->mface; a<me->totface; a++, mf++) {
if(mf->mat_nr < me->totcol) {
- ma= newlibadr(fd, lib, me->mat[(int)mf->mat_nr]);
+ ma= newlibadr(fd, lib, me->mat[mf->mat_nr]);
texalpha = 0;
/* we can't read from this if it comes from a library,
@@ -7225,6 +7231,27 @@ static void do_versions_nodetree_dynamic_sockets(bNodeTree *ntree)
sock->flag |= SOCK_DYNAMIC;
}
+void convert_tface_mt(FileData *fd, Main *main)
+{
+ Main *gmain;
+
+ /* this is a delayed do_version (so it can create new materials) */
+ if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 3)) {
+
+ //XXX hack, material.c uses G.main all over the place, instead of main
+ // temporarily set G.main to the current main
+ gmain = G.main;
+ G.main = main;
+
+ if(!(do_version_tface(main, 1))) {
+ BKE_report(fd->reports, RPT_ERROR, "Texface conversion problem. Error in console");
+ }
+
+ //XXX hack, material.c uses G.main allover the place, instead of main
+ G.main = gmain;
+ }
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -12409,7 +12436,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
BlendFileData *bfd;
bfd= MEM_callocN(sizeof(BlendFileData), "blendfiledata");
- bfd->main= MEM_callocN(sizeof(Main), "main");
+ bfd->main= MEM_callocN(sizeof(Main), "readfile_Main");
BLI_addtail(&fd->mainlist, bfd->main);
bfd->main->versionfile= fd->fileversion;
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
index 4da0a4c6e1f..4892955fd3c 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -129,7 +129,7 @@ void GeometryExporter::operator()(Object *ob)
}
// powerful because it handles both cases when there is material and when there's not
-void GeometryExporter::createPolylist(int material_index,
+void GeometryExporter::createPolylist(short material_index,
bool has_uvs,
bool has_color,
Object *ob,
diff --git a/source/blender/collada/GeometryExporter.h b/source/blender/collada/GeometryExporter.h
index 64c51b6324e..532a439eba7 100644
--- a/source/blender/collada/GeometryExporter.h
+++ b/source/blender/collada/GeometryExporter.h
@@ -67,7 +67,7 @@ public:
void operator()(Object *ob);
// powerful because it handles both cases when there is material and when there's not
- void createPolylist(int material_index,
+ void createPolylist(short material_index,
bool has_uvs,
bool has_color,
Object *ob,
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 15bd9c48f12..2f5d9e54e50 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -778,7 +778,7 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri
std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
Object *ob, const COLLADAFW::UniqueId *geom_uid,
MTex **color_texture, char *layername, MTFace *texture_face,
- std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, int mat_index)
+ std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index)
{
Mesh *me = (Mesh*)ob->data;
const COLLADAFW::UniqueId& ma_uid = cmaterial.getReferencedMaterial();
diff --git a/source/blender/collada/MeshImporter.h b/source/blender/collada/MeshImporter.h
index 88ee0e46c33..208ba4d65c0 100644
--- a/source/blender/collada/MeshImporter.h
+++ b/source/blender/collada/MeshImporter.h
@@ -141,7 +141,7 @@ public:
std::map<COLLADAFW::UniqueId, Material*>& uid_material_map,
Object *ob, const COLLADAFW::UniqueId *geom_uid,
MTex **color_texture, char *layername, MTFace *texture_face,
- std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, int mat_index);
+ std::map<Material*, TexIndexTextureArrayMap>& material_texture_mapping_map, short mat_index);
Object *create_mesh_object(COLLADAFW::Node *node, COLLADAFW::InstanceGeometry *geom,
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 6137d7a4d70..92af51326a8 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3148,21 +3148,21 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan
icon= ICON_VISIBLE_IPO_OFF;
if (ale->type == ANIMTYPE_FCURVE)
- tooltip= "Channel is visible in Graph Editor for editing.";
+ tooltip= "Channel is visible in Graph Editor for editing";
else
- tooltip= "Channel(s) are visible in Graph Editor for editing.";
+ tooltip= "Channel(s) are visible in Graph Editor for editing";
break;
case ACHANNEL_SETTING_EXPAND: /* expanded triangle */
//icon= ((enabled)? ICON_TRIA_DOWN : ICON_TRIA_RIGHT);
icon= ICON_TRIA_RIGHT;
- tooltip= "Make channels grouped under this channel visible.";
+ tooltip= "Make channels grouped under this channel visible";
break;
case ACHANNEL_SETTING_SOLO: /* NLA Tracks only */
//icon= ((enabled)? ICON_LAYER_ACTIVE : ICON_LAYER_USED);
icon= ICON_LAYER_USED;
- tooltip= "NLA Track is the only one evaluated for the AnimData block it belongs to.";
+ tooltip= "NLA Track is the only one evaluated for the AnimData block it belongs to";
break;
/* --- */
@@ -3171,7 +3171,7 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan
// TODO: what about when there's no protect needed?
//icon= ((enabled)? ICON_LOCKED : ICON_UNLOCKED);
icon= ICON_UNLOCKED;
- tooltip= "Editability of keyframes for this channel.";
+ tooltip= "Editability of keyframes for this channel";
break;
case ACHANNEL_SETTING_MUTE: /* muted speaker */
@@ -3179,9 +3179,9 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan
icon= ICON_MUTE_IPO_OFF;
if (ale->type == ALE_FCURVE)
- tooltip= "Does F-Curve contribute to result.";
+ tooltip= "Does F-Curve contribute to result";
else
- tooltip= "Do channels contribute to result.";
+ tooltip= "Do channels contribute to result";
break;
default:
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 6ebe488d2c8..e8f3fc28d74 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -364,7 +364,7 @@ short ANIM_paste_driver (ReportList *reports, ID *id, const char rna_path[], int
/* if the buffer is empty, cannot paste... */
if (channeldriver_copypaste_buf == NULL) {
- BKE_report(reports, RPT_ERROR, "Paste Driver: No Driver to paste.");
+ BKE_report(reports, RPT_ERROR, "Paste Driver: No Driver to paste");
return 0;
}
@@ -527,7 +527,7 @@ void ANIM_OT_driver_button_add (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array");
}
/* Remove Driver Button Operator ------------------------ */
@@ -579,7 +579,7 @@ void ANIM_OT_driver_button_remove (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array");
}
/* Copy Driver Button Operator ------------------------ */
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 928584966d9..77c67fc4af0 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -648,7 +648,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
uiBlockSetEmboss(block, UI_EMBOSSN);
/* delete button */
- but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier.");
+ but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier");
uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm);
uiBlockSetEmboss(block, UI_EMBOSS);
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 3d3311b35eb..0f4546968ba 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -753,7 +753,7 @@ EnumPropertyItem keyframe_paste_merge_items[] = {
{KEYFRAME_PASTE_MERGE_MIX, "MIX", 0, "Mix", "Overlay existing with new keys"},
{KEYFRAME_PASTE_MERGE_OVER, "OVER_ALL", 0, "Overwrite All", "Replace all keys"},
{KEYFRAME_PASTE_MERGE_OVER_RANGE, "OVER_RANGE", 0, "Overwrite Range", "Overwrite keys in pasted range"},
- {KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL, "OVER_RANGE_ALL", 0, "Overwrite Entire Range", "Overwrite keys in pasted range, using the range of all copied keys."},
+ {KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL, "OVER_RANGE_ALL", 0, "Overwrite Entire Range", "Overwrite keys in pasted range, using the range of all copied keys"},
{0, NULL, 0, NULL, NULL}};
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 1e7c18dc6ac..58e1549c0ed 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -763,7 +763,7 @@ short insert_keyframe_direct (ReportList *reports, PointerRNA ptr, PropertyRNA *
/* F-Curve not editable? */
if (fcurve_is_keyframable(fcu) == 0) {
BKE_reportf(reports, RPT_ERROR,
- "F-Curve with path = '%s' [%d] cannot be keyframed. Ensure that it is not locked or sampled. Also, try removing F-Modifiers.",
+ "F-Curve with path = '%s' [%d] cannot be keyframed. Ensure that it is not locked or sampled. Also, try removing F-Modifiers",
fcu->rna_path, fcu->array_index);
return 0;
}
@@ -1460,7 +1460,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
else {
if (G.f & G_DEBUG)
printf("Button Insert-Key: no path to property \n");
- BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead.");
+ BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead");
}
}
else if (G.f & G_DEBUG) {
@@ -1498,7 +1498,7 @@ void ANIM_OT_keyframe_insert_button (wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array");
}
/* Delete Key Button Operator ------------------------ */
@@ -1570,7 +1570,7 @@ void ANIM_OT_keyframe_delete_button (wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array");
}
/* ******************************************* */
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index dcd1c3abbde..7c2f969e187 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -382,7 +382,7 @@ void ANIM_OT_keyingset_button_add (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Add all elements of the array to a Keying Set.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Add all elements of the array to a Keying Set");
}
/* Remove from KeyingSet Button Operator ------------------------ */
diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt
index 9a44525611a..7ecbdc9ebe5 100644
--- a/source/blender/editors/armature/CMakeLists.txt
+++ b/source/blender/editors/armature/CMakeLists.txt
@@ -21,6 +21,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/armature/SConscript b/source/blender/editors/armature/SConscript
index b7f9a263bc1..ded82b3dfb7 100644
--- a/source/blender/editors/armature/SConscript
+++ b/source/blender/editors/armature/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf ../../blenloader'
+incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf ../../blenloader'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../gpu ../../makesrna #/intern/opennl/extern'
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index eafe65b4492..566ff09c366 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -653,7 +653,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
if (ob->type!=OB_ARMATURE)
return OPERATOR_CANCELLED;
if (object_data_is_libdata(ob)) {
- BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature."); //error_libdata();
+ BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature"); //error_libdata();
return OPERATOR_CANCELLED;
}
@@ -782,7 +782,7 @@ void POSE_OT_visual_transform_apply (wmOperatorType *ot)
/* identifiers */
ot->name= "Apply Visual Transform to Pose";
ot->idname= "POSE_OT_visual_transform_apply";
- ot->description= "Apply final constrained position of pose bones to their transform.";
+ ot->description= "Apply final constrained position of pose bones to their transform";
/* callbacks */
ot->exec= pose_visual_transform_apply_exec;
@@ -1480,7 +1480,7 @@ void POSE_OT_select_linked(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
}
/* **************** END Posemode stuff ********************** */
@@ -1574,7 +1574,7 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties s*/
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
}
/* does bones and points */
@@ -2115,8 +2115,8 @@ void ARMATURE_OT_calculate_roll(wmOperatorType *ot)
/* properties */
ot->prop= RNA_def_enum(ot->srna, "type", prop_calc_roll_types, 0, "Type", "");
- RNA_def_boolean(ot->srna, "axis_flip", 0, "Flip Axis", "Negate the alignment axis.");
- RNA_def_boolean(ot->srna, "axis_only", 0, "Shortest Rotation", "Ignore the axis direction, use the shortest rotation to align.");
+ RNA_def_boolean(ot->srna, "axis_flip", 0, "Flip Axis", "Negate the alignment axis");
+ RNA_def_boolean(ot->srna, "axis_only", 0, "Shortest Rotation", "Ignore the axis direction, use the shortest rotation to align");
}
/* **************** undo for armatures ************** */
@@ -3196,7 +3196,7 @@ void ARMATURE_OT_hide(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
}
static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op))
@@ -4290,10 +4290,15 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
/* if the bone cannot be affected, don't do anything */
if ((nearBone) && !(nearBone->flag & BONE_UNSELECTABLE)) {
+ Object *ob_act= OBACT;
bArmature *arm= ob->data;
- /* since we do unified select, we don't shift+select a bone if the armature object was not active yet */
- if (!(extend) || (base != scene->basact)) {
+ /* since we do unified select, we don't shift+select a bone if the
+ * armature object was not active yet.
+ * 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)) {
ED_pose_deselectall(ob, 0);
nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
arm->act_bone= nearBone;
@@ -4324,7 +4329,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
}
/* in weightpaint we select the associated vertex group too */
- if (OBACT && OBACT->mode & OB_MODE_WEIGHT_PAINT) {
+ if (ob_act && ob_act->mode & OB_MODE_WEIGHT_PAINT) {
if (nearBone == arm->act_bone) {
ED_vgroup_select_by_name(OBACT, nearBone->name);
DAG_id_tag_update(&OBACT->id, OB_RECALC_DATA);
@@ -5061,6 +5066,10 @@ void POSE_OT_select_inverse(wmOperatorType *ot)
static int pose_de_select_all_exec(bContext *C, wmOperator *op)
{
int action = RNA_enum_get(op->ptr, "action");
+
+ Object *ob = NULL;
+ Scene *scene= CTX_data_scene(C);
+ int multipaint = scene->toolsettings->multipaint;
if (action == SEL_TOGGLE) {
action= CTX_DATA_COUNT(C, selected_pose_bones) ? SEL_DESELECT : SEL_SELECT;
@@ -5091,6 +5100,11 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, NULL);
+ if(multipaint) {
+ ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ }
+
return OPERATOR_FINISHED;
}
@@ -5534,7 +5548,7 @@ void ARMATURE_OT_autoside_names (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* settings */
- ot->prop= RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with.");
+ ot->prop= RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with");
}
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 48ca6d6fd72..6c721660e9c 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -657,22 +657,41 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
int *vertsflipped = NULL, *mask= NULL;
int a, totface, j, bbone, firstsegment, lastsegment;
+ MVert *mvert = me->mvert;
+ int use_vert_sel= FALSE;
+ int use_face_sel= FALSE;
+
*err_str= NULL;
/* count triangles and create mask */
- if(me->editflag & ME_EDIT_PAINT_MASK)
+ if( (use_face_sel= (me->editflag & ME_EDIT_PAINT_MASK) != 0) ||
+ (use_vert_sel= ((me->editflag & ME_EDIT_VERT_SEL) != 0)))
+ {
mask= MEM_callocN(sizeof(int)*me->totvert, "heat_bone_weighting mask");
+ }
for(totface=0, a=0, mface=me->mface; a<me->totface; a++, mface++) {
totface++;
if(mface->v4) totface++;
- if(mask && (mface->flag & ME_FACE_SEL)) {
- mask[mface->v1]= 1;
- mask[mface->v2]= 1;
- mask[mface->v3]= 1;
- if(mface->v4)
- mask[mface->v4]= 1;
+ /* (added selectedVerts content for vertex mask, they used to just equal 1) */
+ if(use_vert_sel) {
+ mask[mface->v1]= (mvert[mface->v1].flag & SELECT) != 0;
+ mask[mface->v2]= (mvert[mface->v2].flag & SELECT) != 0;
+ mask[mface->v3]= (mvert[mface->v3].flag & SELECT) != 0;
+ if(mface->v4) {
+ mask[mface->v4]= (mvert[mface->v4].flag & SELECT) != 0;
+ }
+ }
+ else {
+ if(use_face_sel) {
+ mask[mface->v1]= 1;
+ mask[mface->v2]= 1;
+ mask[mface->v3]= 1;
+ if(mface->v4) {
+ mask[mface->v4]= 1;
+ }
+ }
}
}
@@ -936,7 +955,7 @@ void rigid_deform_iteration()
}
else {
if(!sys->rigid.thrownerror) {
- error("RigidDeform: failed to find solution.");
+ error("RigidDeform: failed to find solution");
sys->rigid.thrownerror= 1;
}
break;
@@ -1693,7 +1712,7 @@ static void meshdeform_matrix_solve(MeshDeformBind *mdb)
}
}
else {
- error("Mesh Deform: failed to find solution.");
+ error("Mesh Deform: failed to find solution");
break;
}
diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c
index 16888908bab..0497c0507dc 100644
--- a/source/blender/editors/armature/poseSlide.c
+++ b/source/blender/editors/armature/poseSlide.c
@@ -600,7 +600,7 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp *
}
}
else {
- BKE_report(op->reports, RPT_ERROR, "No keyframes to slide between.");
+ BKE_report(op->reports, RPT_ERROR, "No keyframes to slide between");
pose_slide_exit(op);
return OPERATOR_CANCELLED;
}
@@ -718,8 +718,8 @@ static int pose_slide_exec_common (bContext *C, wmOperator *op, tPoseSlideOp *ps
/* common code for defining RNA properties */
static void pose_slide_opdef_properties (wmOperatorType *ot)
{
- RNA_def_int(ot->srna, "prev_frame", 0, MINAFRAME, MAXFRAME, "Previous Keyframe", "Frame number of keyframe immediately before the current frame.", 0, 50);
- RNA_def_int(ot->srna, "next_frame", 0, MINAFRAME, MAXFRAME, "Next Keyframe", "Frame number of keyframe immediately after the current frame.", 0, 50);
+ RNA_def_int(ot->srna, "prev_frame", 0, MINAFRAME, MAXFRAME, "Previous Keyframe", "Frame number of keyframe immediately before the current frame", 0, 50);
+ RNA_def_int(ot->srna, "next_frame", 0, MINAFRAME, MAXFRAME, "Next Keyframe", "Frame number of keyframe immediately after the current frame", 0, 50);
RNA_def_float_percentage(ot->srna, "percentage", 0.5f, 0.0f, 1.0f, "Percentage", "Weighting factor for the sliding operation", 0.3, 0.7);
}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 67c93c4c906..8a7d837d2a8 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -43,6 +43,8 @@
#include "BLI_dlrbTree.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_object_types.h"
@@ -407,15 +409,15 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED
uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
/* add new (adds to the first unoccupied frame) */
- uiItemIntO(layout, "Add New", ICON_NONE, "POSELIB_OT_pose_add", "frame", poselib_get_free_index(ob->poselib));
+ uiItemIntO(layout, UI_translate_do_iface(N_("Add New")), ICON_NONE, "POSELIB_OT_pose_add", "frame", poselib_get_free_index(ob->poselib));
/* check if we have any choices to add a new pose in any other way */
if ((ob->poselib) && (ob->poselib->markers.first)) {
/* add new (on current frame) */
- uiItemIntO(layout, "Add New (Current Frame)", ICON_NONE, "POSELIB_OT_pose_add", "frame", CFRA);
+ uiItemIntO(layout, UI_translate_do_iface(N_("Add New (Current Frame)")), ICON_NONE, "POSELIB_OT_pose_add", "frame", CFRA);
/* replace existing - submenu */
- uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu, NULL);
+ uiItemMenuF(layout, UI_translate_do_iface(N_("Replace Existing...")), 0, poselib_add_menu_invoke__replacemenu, NULL);
}
uiPupMenuEnd(C, pup);
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 83285d3634a..4405f395843 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -673,7 +673,7 @@ void POSE_OT_select_grouped (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", "");
}
@@ -722,7 +722,7 @@ void POSE_OT_select_flip_active(wmOperatorType *ot)
/* identifiers */
ot->name= "Flip Selected Active Bone";
ot->idname= "POSE_OT_select_flip_active";
- ot->description= "Activate the bone with a flipped name.";
+ ot->description= "Activate the bone with a flipped name";
/* api callbacks */
ot->exec= pose_bone_flip_active_exec;
@@ -1844,7 +1844,7 @@ void POSE_OT_autoside_names (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* settings */
- ot->prop= RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with.");
+ ot->prop= RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with");
}
/* ********************************************** */
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index b35085ff64d..84df77bb120 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1354,7 +1354,7 @@ static int separate_exec(bContext *C, wmOperator *op)
oldedit= oldcu->editnurb;
if(oldcu->key) {
- BKE_report(op->reports, RPT_ERROR, "Can't separate a curve with vertex keys.");
+ BKE_report(op->reports, RPT_ERROR, "Can't separate a curve with vertex keys");
return OPERATOR_CANCELLED;
}
@@ -2693,7 +2693,7 @@ void CURVE_OT_hide(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
}
/********************** reveal operator *********************/
@@ -3912,7 +3912,7 @@ static int merge_nurb(bContext *C, wmOperator *op)
if(nsortbase.first == nsortbase.last) {
BLI_freelistN(&nsortbase);
- BKE_report(op->reports, RPT_ERROR, "Too few selections to merge.");
+ BKE_report(op->reports, RPT_ERROR, "Too few selections to merge");
return OPERATOR_CANCELLED;
}
@@ -4692,7 +4692,7 @@ void CURVE_OT_vertex_add(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location to add new vertex at.", -1e4, 1e4);
+ RNA_def_float_vector_xyz(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Location to add new vertex at", -1e4, 1e4);
}
/***************** extrude operator **********************/
@@ -4882,7 +4882,7 @@ void CURVE_OT_cyclic_toggle(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to make surface cyclic in.");
+ RNA_def_enum(ot->srna, "direction", direction_items, 0, "Direction", "Direction to make surface cyclic in");
}
/***************** select linked operator ******************/
@@ -5017,7 +5017,7 @@ void CURVE_OT_select_linked_pick(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked control points rather than selecting them.");
+ RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked control points rather than selecting them");
}
/***************** select row operator **********************/
@@ -5460,8 +5460,8 @@ void CURVE_OT_select_random(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly.", 0.f, 100.0f);
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first.");
+ RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly", 0.f, 100.0f);
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first");
}
/********************* every nth number of point *******************/
@@ -5992,7 +5992,7 @@ void CURVE_OT_delete(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Which elements to delete.");
+ RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Which elements to delete");
}
/********************** shade smooth/flat operator *********************/
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 6c95df53d39..fcac070f84e 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -346,7 +346,7 @@ static int paste_file(bContext *C, ReportList *reports, const char *filename)
if(!fp) {
if(reports)
- BKE_reportf(reports, RPT_ERROR, "Failed to open file %s.", filename);
+ BKE_reportf(reports, RPT_ERROR, "Failed to open file %s", filename);
return OPERATOR_CANCELLED;
}
@@ -662,8 +662,8 @@ void FONT_OT_style_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to.");
- RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear style rather than setting it.");
+ RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to");
+ RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear style rather than setting it");
}
/******************* toggle style operator ********************/
@@ -700,7 +700,7 @@ void FONT_OT_style_toggle(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to.");
+ RNA_def_enum(ot->srna, "style", style_items, CU_CHINFO_BOLD, "Style", "Style to set selection to");
}
/******************* copy text operator ********************/
@@ -799,7 +799,7 @@ static int paste_selection(Object *obedit, ReportList *reports)
}
}
else
- BKE_report(reports, RPT_WARNING, "Text too long.");
+ BKE_report(reports, RPT_WARNING, "Text too long");
return 0;
}
@@ -968,7 +968,7 @@ void FONT_OT_move(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to.");
+ RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to");
}
/******************* move select operator ********************/
@@ -995,7 +995,7 @@ void FONT_OT_move_select(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection.");
+ RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection");
}
/************************* change spacing **********************/
@@ -1037,7 +1037,7 @@ void FONT_OT_change_spacing(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increasing character spacing with.", -20, 20);
+ RNA_def_int(ot->srna, "delta", 1, -20, 20, "Delta", "Amount to decrease or increasing character spacing with", -20, 20);
}
/************************* change character **********************/
@@ -1082,7 +1082,7 @@ void FONT_OT_change_character(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_int(ot->srna, "delta", 1, -255, 255, "Delta", "Number to increase or decrease character code with.", -255, 255);
+ RNA_def_int(ot->srna, "delta", 1, -255, 255, "Delta", "Number to increase or decrease character code with", -255, 255);
}
/******************* line break operator ********************/
@@ -1215,7 +1215,7 @@ void FONT_OT_delete(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "type", delete_type_items, DEL_ALL, "Type", "Which part of the text to delete.");
+ RNA_def_enum(ot->srna, "type", delete_type_items, DEL_ALL, "Type", "Which part of the text to delete");
}
/*********************** insert text operator *************************/
@@ -1365,8 +1365,8 @@ void FONT_OT_text_insert(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position.");
- RNA_def_boolean(ot->srna, "accent", 0, "Accent mode", "Next typed character will strike through previous, for special character input.");
+ RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
+ RNA_def_boolean(ot->srna, "accent", 0, "Accent mode", "Next typed character will strike through previous, for special character input");
}
@@ -1445,9 +1445,7 @@ void FONT_OT_textbox_remove(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "The current text box.", 0, INT_MAX);
-
-
+ RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "The current text box", 0, INT_MAX);
}
@@ -1584,7 +1582,7 @@ void FONT_OT_case_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "case", case_items, CASE_LOWER, "Case", "Lower or upper case.");
+ RNA_def_enum(ot->srna, "case", case_items, CASE_LOWER, "Case", "Lower or upper case");
}
/********************** toggle case operator *********************/
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 1cd8b1f05db..c915bc9ea37 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -595,7 +595,7 @@ static int gp_convert_layer_exec (bContext *C, wmOperator *op)
/* check if there's data to work with */
if (gpd == NULL) {
- BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data to work on.");
+ BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data to work on");
return OPERATOR_CANCELLED;
}
@@ -607,7 +607,7 @@ static int gp_convert_layer_exec (bContext *C, wmOperator *op)
break;
default: /* unsupoorted */
- BKE_report(op->reports, RPT_ERROR, "Unknown conversion option.");
+ BKE_report(op->reports, RPT_ERROR, "Unknown conversion option");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index da3310ae883..842ab92ae31 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1901,7 +1901,7 @@ void GPENCIL_OT_draw (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* settings for drawing */
- RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements.");
+ RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements");
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 8bb77ad43a0..9709979ff6a 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -123,6 +123,8 @@ int EM_vertColorCheck(struct EditMesh *em);
void undo_push_mesh(struct bContext *C, const char *name);
+void paintvert_flush_flags(struct Object *ob);
+void paintvert_deselect_all_visible(struct Object *ob, int action, short flush_flags);
/* editmesh_lib.c */
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index f8682d3935b..d574ddd3030 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -53,6 +53,7 @@ struct Scene;
struct View3D;
struct ViewContext;
struct wmWindow;
+struct MVert;
/* for derivedmesh drawing callbacks, for view3d_select, .... */
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 637940f59a6..06b44e36b69 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -799,9 +799,15 @@ void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, const cha
int UI_GetStringWidth(const char *str); // XXX temp
void UI_DrawString(float x, float y, const char *str); // XXX temp
void UI_DrawTriIcon(float x, float y, char dir);
-
+uiStyle* UI_GetStyle(void);
/* linker workaround ack! */
void UI_template_fix_linking(void);
+/* translation */
+int UI_translate_iface(void);
+int UI_translate_tooltips(void);
+const char *UI_translate_do_iface(const char *msgid);
+const char *UI_translate_do_tooltip(const char *msgid);
+
#endif /* UI_INTERFACE_H */
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 0dee7a3813a..2ff77d255c6 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -55,9 +55,11 @@
#include "BIF_gl.h"
#include "BLF_api.h"
+#include "BLF_translation.h"
#include "UI_interface.h"
+#include "IMB_imbuf.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -92,19 +94,46 @@ static void ui_free_but(const bContext *C, uiBut *but);
/* ************* translation ************** */
-int ui_translate_buttons(void)
+int UI_translate_iface(void)
{
- return (U.transopts & USER_TR_BUTTONS);
+#ifdef INTERNATIONAL
+ return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE);
+#else
+ return 0;
+#endif
+}
+
+int UI_translate_tooltips(void)
+{
+#ifdef INTERNATIONAL
+ return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS);
+#else
+ return 0;
+#endif
}
-int ui_translate_menus(void)
+const char *UI_translate_do_iface(const char *msgid)
{
- return (U.transopts & USER_TR_MENUS);
+#ifdef INTERNATIONAL
+ if(UI_translate_iface())
+ return BLF_gettext(msgid);
+ else
+ return msgid;
+#else
+ return msgid;
+#endif
}
-int ui_translate_tooltips(void)
+const char *UI_translate_do_tooltip(const char *msgid)
{
- return (U.transopts & USER_TR_TOOLTIPS);
+#ifdef INTERNATIONAL
+ if(UI_translate_tooltips())
+ return BLF_gettext(msgid);
+ else
+ return msgid;
+#else
+ return msgid;
+#endif
}
/* ************* window matrix ************** */
@@ -228,7 +257,7 @@ void ui_block_translate(uiBlock *block, int x, int y)
static void ui_text_bounds_block(uiBlock *block, float offset)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style=UI_GetStyle();
uiBut *bt;
int i = 0, j, x1addval= offset, nextcol;
int lastcol= 0, col= 0;
@@ -237,9 +266,6 @@ static void ui_text_bounds_block(uiBlock *block, float offset)
for(bt= block->buttons.first; bt; bt= bt->next) {
if(bt->type!=SEPR) {
- //int transopts= ui_translate_buttons();
- //if(bt->type==TEX || bt->type==IDPOIN) transopts= 0;
-
j= BLF_width(style->widget.uifont_id, bt->drawstr);
if(j > i) i = j;
@@ -929,7 +955,7 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, u
/* uses local copy of style, to scale things down, and allow widgets to change stuff */
void uiDrawBlock(const bContext *C, uiBlock *block)
{
- uiStyle style= *((uiStyle *)U.uistyles.first); // XXX pass on as arg
+ uiStyle style= *UI_GetStyle(); // XXX pass on as arg
ARegion *ar;
uiBut *but;
rcti rect;
@@ -1894,6 +1920,8 @@ static void ui_free_but(const bContext *C, uiBut *but)
if(but->str && but->str != but->strdata) MEM_freeN(but->str);
ui_free_link(but->link);
+ if((but->type == BUT_IMAGE) && but->poin) IMB_freeImBuf((struct ImBuf *)but->poin);
+
MEM_freeN(but);
}
@@ -2030,12 +2058,9 @@ void ui_check_but(uiBut *but)
/* if something changed in the button */
double value= UI_BUT_VALUE_UNSET;
// float okwidth; // UNUSED
-// int transopts= ui_translate_buttons();
ui_is_but_sel(but, &value);
-// if(but->type==TEX || but->type==IDPOIN) transopts= 0;
-
/* only update soft range while not editing */
if(but->rnaprop && !(but->editval || but->editstr || but->editvec)) {
UI_GET_BUT_VALUE_INIT(but, value)
@@ -2544,7 +2569,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
DynStr *dynstr;
int i, totitem, value, free;
- RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
value= RNA_property_enum_get(ptr, prop);
dynstr= BLI_dynstr_new();
@@ -2579,7 +2604,7 @@ static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *s
EnumPropertyItem *item;
int i, totitem, free;
- RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
for(i=0; i<totitem; i++) {
if(item[i].identifier[0] && item[i].value == (int)max) {
str= item[i].name;
@@ -2707,6 +2732,11 @@ 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
+ if(UI_translate_tooltips())
+ tip= BLF_gettext(tip);
+#endif
}
but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, NULL, 0, 0, 0, 0, tip);
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 8889c419c35..a1275e237c1 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -461,19 +461,14 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel)
/* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */
-void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect)
+void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect)
{
#ifdef WITH_HEADLESS
(void)rect;
#else
- extern char datatoc_splash_png[];
- extern int datatoc_splash_png_size;
- ImBuf *ibuf;
+ ImBuf *ibuf= (ImBuf *)but->poin;
//GLint scissor[4];
//int w, h;
-
- /* hardcoded to splash, loading and freeing every draw, eek! */
- ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
if (!ibuf) return;
@@ -501,7 +496,6 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *
glScissor(scissor[0], scissor[1], scissor[2], scissor[3]);
*/
- IMB_freeImBuf(ibuf);
#endif
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 7661fa5994b..125928c136b 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1269,7 +1269,7 @@ static int ui_textedit_delete_selection(uiBut *but, uiHandleButtonData *data)
/* note, but->block->aspect is used here, when drawing button style is getting scaled too */
static void ui_textedit_set_cursor_pos(uiBut *but, uiHandleButtonData *data, short x)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style= UI_GetStyle(); // XXX pass on as arg
uiFontStyle *fstyle = &style->widget;
int startx= but->x1;
char *origstr;
@@ -4101,7 +4101,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
wmKeyMapItem *kmi;
PointerRNA ptr;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
int kmi_id = WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km);
@@ -4133,7 +4133,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
wmKeyMapItem *kmi;
PointerRNA ptr;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
IDProperty *prop= (but->opptr)? but->opptr->data: NULL;
int kmi_id;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index ebc8725ad5d..72eb869dea0 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -347,10 +347,6 @@ typedef struct uiSafetyRct {
extern void ui_delete_linkline(uiLinkLine *line, uiBut *but);
-extern int ui_translate_buttons(void);
-extern int ui_translate_menus(void);
-extern int ui_translate_tooltips(void);
-
void ui_fontscale(short *points, float aspect);
extern void ui_block_to_window_fl(const struct ARegion *ar, uiBlock *block, float *x, float *y);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 59bbe67a8e2..3c02f7d4bd2 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -43,6 +43,8 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
@@ -475,7 +477,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt
const char *name;
int a, totitem, itemw, icon, value, free;
- RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1));
for(a=0; a<totitem; a++) {
@@ -634,8 +636,14 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i
return PointerRNA_NULL;
}
- if(!name)
+ if(!name) {
name= ot->name;
+
+#ifdef INTERNATIONAL
+ name= UI_translate_do_iface(name);
+#endif
+ }
+
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
@@ -701,7 +709,7 @@ static const char *ui_menu_enumpropname(uiLayout *layout, const char *opname, co
int totitem, free;
const char *name;
- RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items_gettexted(layout->root->block->evil_C, &ptr, prop, &item, &totitem, &free);
if(RNA_enum_name(item, retval, &name)) {
if(free) MEM_freeN(item);
return name;
@@ -753,7 +761,7 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname
uiLayout *split= uiLayoutSplit(layout, 0, 0);
uiLayout *column= uiLayoutColumn(split, 0);
- RNA_property_enum_items(block->evil_C, &ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items_gettexted(block->evil_C, &ptr, prop, &item, &totitem, &free);
for(i=0; i<totitem; i++) {
if(item[i].identifier[0]) {
@@ -815,7 +823,7 @@ void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char
/* pass */
}
else {
- RNA_warning("%s.%s not found.", RNA_struct_identifier(ptr.type), propname);
+ RNA_warning("%s.%s not found", RNA_struct_identifier(ptr.type), propname);
return;
}
@@ -841,10 +849,10 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char
/* enum lookup */
if((prop= RNA_struct_find_property(&ptr, propname))) {
- RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free);
+ RNA_property_enum_items_gettexted(layout->root->block->evil_C, &ptr, prop, &item, NULL, &free);
if(item==NULL || RNA_enum_value_from_id(item, value_str, &value)==0) {
if(free) MEM_freeN(item);
- RNA_warning("%s.%s, enum %s not found.", RNA_struct_identifier(ptr.type), propname, value_str);
+ RNA_warning("%s.%s, enum %s not found", RNA_struct_identifier(ptr.type), propname, value_str);
return;
}
@@ -852,7 +860,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char
MEM_freeN(item);
}
else {
- RNA_warning("%s.%s not found.", RNA_struct_identifier(ptr.type), propname);
+ RNA_warning("%s.%s not found", RNA_struct_identifier(ptr.type), propname);
return;
}
@@ -1091,7 +1099,7 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr
return;
}
- RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, NULL, &free);
+ RNA_property_enum_items_gettexted(layout->root->block->evil_C, ptr, prop, &item, NULL, &free);
if(!RNA_enum_value_from_id(item, value, &ivalue)) {
if(free) MEM_freeN(item);
@@ -1135,7 +1143,7 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname
uiLayout *split= uiLayoutSplit(layout, 0, 0);
uiLayout *column= uiLayoutColumn(split, 0);
- RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free);
+ RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free);
for(i=0; i<totitem; i++) {
if(item[i].identifier[0]) {
@@ -1320,7 +1328,7 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna
type= RNA_property_type(prop);
if(!ELEM(type, PROP_POINTER, PROP_STRING)) {
- RNA_warning("property %s must be a pointer or string.", propname);
+ RNA_warning("Property %s must be a pointer or string", propname);
return;
}
@@ -1421,8 +1429,14 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const
return;
}
- if(!name)
+ if(!name) {
name= mt->label;
+
+#ifdef INTERNATIONAL
+ name= UI_translate_do_iface(name);
+#endif
+ }
+
if(layout->root->type == UI_LAYOUT_MENU && !icon)
icon= ICON_BLANK1;
@@ -2794,7 +2808,7 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
empty= uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0;
if(empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) {
- uiItemL(layout, "No Properties.", ICON_NONE);
+ uiItemL(layout, UI_translate_do_iface(N_("No Properties")), ICON_NONE);
}
}
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index e9fad382beb..fd9386dc5ab 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -317,7 +317,7 @@ static void UI_OT_reset_default_button(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array");
}
/* Copy To Selected Operator ------------------------ */
@@ -409,7 +409,7 @@ static void UI_OT_copy_to_selected_button(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Reset to default values all elements of the array");
}
/* Reports to Textblock Operator ------------------------ */
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index cd1d250d6a4..ec7456eebdc 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -173,7 +173,7 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar)
Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int *open)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
Panel *pa, *patab, *palast, *panext;
char *drawname= pt->label;
char *idname= pt->idname;
@@ -292,7 +292,7 @@ void uiEndPanel(uiBlock *block, int width, int height)
static void ui_offset_panel_block(uiBlock *block)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiBut *but;
int ofsy;
@@ -442,8 +442,12 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r
Panel *panel= block->panel;
rcti hrect;
int pnl_icons;
- char *activename= panel->drawname[0]?panel->drawname:panel->panelname;
-
+ const char *activename= panel->drawname[0]?panel->drawname:panel->panelname;
+
+#ifdef INTERNATIONAL
+ activename= UI_translate_do_iface(activename);
+#endif
+
/* + 0.001f to avoid flirting with float inaccuracy */
if(panel->control & UI_PNL_CLOSE) pnl_icons=(panel->labelofs+2*PNL_ICON+5)/block->aspect + 0.001f;
else pnl_icons= (panel->labelofs+PNL_ICON+5)/block->aspect + 0.001f;
@@ -667,7 +671,7 @@ static int compare_panel(const void *a1, const void *a2)
/* returns 1 when it did something */
static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
Panel *pa;
PanelSort *ps, *panelsort, *psnext;
int a, tot=0, done;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index f31c16cd020..4221f7c30ff 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -62,6 +62,7 @@
#include "UI_view2d.h"
#include "BLF_api.h"
+#include "BLF_translation.h"
#include "ED_screen.h"
@@ -318,7 +319,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
rcti bbox= data->bbox;
int a;
- ui_draw_menu_back(U.uistyles.first, NULL, &data->bbox);
+ ui_draw_menu_back(UI_GetStyle(), NULL, &data->bbox);
/* draw text */
uiStyleFontSet(&data->fstyle);
@@ -343,9 +344,10 @@ static void ui_tooltip_region_free_cb(ARegion *ar)
ar->regiondata= NULL;
}
+#define TIP_(msgid) UI_translate_do_tooltip(msgid)
ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style= UI_GetStyle();
static ARegionType type;
ARegion *ar;
uiTooltipData *data;
@@ -374,7 +376,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
EnumPropertyItem *item;
int i, totitem, free;
- RNA_property_enum_items(C, &but->rnapoin, but->rnaprop, &item, &totitem, &free);
+ RNA_property_enum_items_gettexted(C, &but->rnapoin, but->rnaprop, &item, &totitem, &free);
for(i=0; i<totitem; i++) {
if(item[i].identifier[0] && item[i].value == (int)but->hardmax) {
@@ -403,7 +405,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
prop= (but->opptr)? but->opptr->data: NULL;
if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, buf, sizeof(buf))) {
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Shortcut: %s", buf);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Shortcut: %s")), buf);
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -413,7 +415,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* full string */
ui_get_but_string(but, buf, sizeof(buf));
if(buf[0]) {
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Value: %s", buf);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Value: %s")), buf);
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -425,7 +427,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
if (unit_type == PROP_UNIT_ROTATION) {
if (RNA_property_type(but->rnaprop) == PROP_FLOAT) {
float value= RNA_property_array_check(but->rnaprop) ? RNA_property_float_get_index(&but->rnapoin, but->rnaprop, but->rnaindex) : RNA_property_float_get(&but->rnapoin, but->rnaprop);
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Radians: %f", value);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Radians: %f")), value);
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -434,7 +436,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
if(but->flag & UI_BUT_DRIVEN) {
if(ui_but_anim_expression_get(but, buf, sizeof(buf))) {
/* expression */
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Expression: %s", buf);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Expression: %s")), buf);
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -442,7 +444,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* rna info */
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s.%s")), RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop));
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -450,7 +452,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
if(but->rnapoin.id.data) {
ID *id= but->rnapoin.id.data;
if(id->lib && id->lib->name) {
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Library: %s", id->lib->name);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Library: %s")), id->lib->name);
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -465,7 +467,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* operator info */
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", str);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s")), str);
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -479,7 +481,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
WM_operator_poll_context(C, but->optype, but->opcontext);
poll_msg= CTX_wm_operator_poll_msg_get(C);
if(poll_msg) {
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Disabled: %s", poll_msg);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Disabled: %s")), poll_msg);
data->color[data->totline]= 0x6666ff; /* alert */
data->totline++;
}
@@ -489,7 +491,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) {
if(but->menu_create_func && WM_menutype_contains((MenuType *)but->poin)) {
MenuType *mt= (MenuType *)but->poin;
- BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s", mt->idname);
+ BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s")), mt->idname);
data->color[data->totline]= 0x888888;
data->totline++;
}
@@ -608,6 +610,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
return ar;
}
+#undef TIP_
void ui_tooltip_free(bContext *C, ARegion *ar)
{
@@ -985,7 +988,7 @@ static void ui_searchbox_region_free_cb(ARegion *ar)
ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
{
- uiStyle *style= U.uistyles.first; // XXX pass on as arg
+ uiStyle *style= UI_GetStyle();
static ARegionType type;
ARegion *ar;
uiSearchboxData *data;
@@ -2299,7 +2302,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg, char *str)
{
wmWindow *window= CTX_wm_window(C);
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiPopupBlockHandle *handle;
uiPopupMenu *pup;
@@ -2348,7 +2351,7 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut
/* only return handler, and set optional title */
uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu");
uiBut *but;
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 8d4b4209120..5ea20b33b3a 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -47,6 +47,7 @@
#include "BLF_api.h"
+#include "BLF_translation.h"
#include "UI_interface.h"
@@ -76,7 +77,7 @@
/* ********************************************** */
-static uiStyle *ui_style_new(ListBase *styles, const char *name)
+static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id)
{
uiStyle *style= MEM_callocN(sizeof(uiStyle), "new style");
@@ -85,7 +86,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->panelzoom= 1.0; /* unused */
- style->paneltitle.uifont_id= UIFONT_DEFAULT;
+ style->paneltitle.uifont_id= uifont_id;
style->paneltitle.points= 12;
style->paneltitle.kerning= 1;
style->paneltitle.shadow= 1;
@@ -94,7 +95,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->paneltitle.shadowalpha= 0.15f;
style->paneltitle.shadowcolor= 1.0f;
- style->grouplabel.uifont_id= UIFONT_DEFAULT;
+ style->grouplabel.uifont_id= uifont_id;
style->grouplabel.points= 12;
style->grouplabel.kerning= 1;
style->grouplabel.shadow= 3;
@@ -102,7 +103,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->grouplabel.shady= -1;
style->grouplabel.shadowalpha= 0.25f;
- style->widgetlabel.uifont_id= UIFONT_DEFAULT;
+ style->widgetlabel.uifont_id= uifont_id;
style->widgetlabel.points= 11;
style->widgetlabel.kerning= 1;
style->widgetlabel.shadow= 3;
@@ -111,7 +112,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name)
style->widgetlabel.shadowalpha= 0.15f;
style->widgetlabel.shadowcolor= 1.0f;
- style->widget.uifont_id= UIFONT_DEFAULT;
+ style->widget.uifont_id= uifont_id;
style->widget.points= 11;
style->widget.kerning= 1;
style->widget.shadowalpha= 0.25f;
@@ -251,11 +252,19 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str)
}
/* ************** helpers ************************ */
+/* XXX: read a style configure */
+uiStyle* UI_GetStyle(void)
+{
+ uiStyle *style = NULL;
+ /* offset is two struct uiStyle pointers */
+ /* style = BLI_findstring( &U.uistyles, "Unifont Style", sizeof(style)*2 ) */;
+ return (style != NULL) ? style : U.uistyles.first;
+}
/* temporarily, does widget font */
int UI_GetStringWidth(const char *str)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiFontStyle *fstyle= &style->widget;
int width;
@@ -274,7 +283,7 @@ int UI_GetStringWidth(const char *str)
/* temporarily, does widget font */
void UI_DrawString(float x, float y, const char *str)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
if (style->widget.kerning == 1)
BLF_enable(style->widget.uifont_id, BLF_KERNING_DEFAULT);
@@ -313,7 +322,17 @@ void uiStyleInit(void)
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);
+#else
font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+#endif
}
else {
font->blf_id= BLF_load(font->filename);
@@ -337,7 +356,7 @@ void uiStyleInit(void)
}
if(style==NULL) {
- ui_style_new(&U.uistyles, "Default Style");
+ ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT );
}
// XXX, this should be moved into a style, but for now best only load the monospaced font once.
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index bfe6a2f2602..1b1b788d046 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -68,6 +68,7 @@
#include "interface_intern.h"
#include "BLF_api.h"
+#include "BLF_translation.h"
void UI_template_fix_linking(void)
{
@@ -306,31 +307,31 @@ static const char *template_id_browse_tip(StructRNA *type)
{
if(type) {
switch(RNA_type_to_ID_code(type)) {
- case ID_SCE: return "Browse Scene to be linked";
- case ID_OB: return "Browse Object to be linked";
- case ID_ME: return "Browse Mesh Data to be linked";
- case ID_CU: return "Browse Curve Data to be linked";
- case ID_MB: return "Browse MetaBall Data to be linked";
- case ID_MA: return "Browse Material to be linked";
- case ID_TE: return "Browse Texture to be linked";
- case ID_IM: return "Browse Image to be linked";
- case ID_LT: return "Browse Lattice Data to be linked";
- case ID_LA: return "Browse Lamp Data to be linked";
- case ID_CA: return "Browse Camera Data to be linked";
- case ID_WO: return "Browse World Settings to be linked";
- case ID_SCR: return "Choose Screen lay-out";
- case ID_TXT: return "Browse Text to be linked";
- case ID_SPK: return "Browse Speaker Data to be linked";
- case ID_SO: return "Browse Sound to be linked";
- case ID_AR: return "Browse Armature data to be linked";
- case ID_AC: return "Browse Action to be linked";
- case ID_NT: return "Browse Node Tree to be linked";
- case ID_BR: return "Browse Brush to be linked";
- case ID_PA: return "Browse Particle System to be linked";
- case ID_GD: return "Browse Grease Pencil Data to be linked";
+ case ID_SCE: return N_("Browse Scene to be linked");
+ case ID_OB: return N_("Browse Object to be linked");
+ case ID_ME: return N_("Browse Mesh Data to be linked");
+ case ID_CU: return N_("Browse Curve Data to be linked");
+ case ID_MB: return N_("Browse MetaBall Data to be linked");
+ case ID_MA: return N_("Browse Material to be linked");
+ case ID_TE: return N_("Browse Texture to be linked");
+ case ID_IM: return N_("Browse Image to be linked");
+ case ID_LT: return N_("Browse Lattice Data to be linked");
+ case ID_LA: return N_("Browse Lamp Data to be linked");
+ case ID_CA: return N_("Browse Camera Data to be linked");
+ case ID_WO: return N_("Browse World Settings to be linked");
+ case ID_SCR: return N_("Choose Screen lay-out");
+ case ID_TXT: return N_("Browse Text to be linked");
+ case ID_SPK: return N_("Browse Speaker Data to be linked");
+ case ID_SO: return N_("Browse Sound to be linked");
+ case ID_AR: return N_("Browse Armature data to be linked");
+ case ID_AC: return N_("Browse Action to be linked");
+ case ID_NT: return N_("Browse Node Tree to be linked");
+ case ID_BR: return N_("Browse Brush to be linked");
+ case ID_PA: return N_("Browse Particle System to be linked");
+ case ID_GD: return N_("Browse Grease Pencil Data to be linked");
}
}
- return "Browse ID data to be linked";
+ return N_("Browse ID data to be linked");
}
static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag, const char *newop, const char *openop, const char *unlinkop)
@@ -355,7 +356,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
if(flag & UI_ID_PREVIEWS) {
- but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, template_id_browse_tip(type));
+ but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6,
+ UI_translate_do_tooltip(template_id_browse_tip(type)));
if(type) {
but->icon= RNA_struct_ui_icon(type);
if (id) but->icon = ui_id_icon_get(C, id, 1);
@@ -367,7 +369,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
uiLayoutRow(layout, 1);
}
else if(flag & UI_ID_BROWSE) {
- but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, template_id_browse_tip(type));
+ but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y,
+ UI_translate_do_tooltip(template_id_browse_tip(type)));
if(type) {
but->icon= RNA_struct_ui_icon(type);
/* default dragging of icon for id browse buttons */
@@ -393,12 +396,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
if(id->lib) {
if(id->flag & LIB_INDIRECT) {
but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- "Indirect library datablock, cannot change.");
+ UI_translate_do_tooltip(N_("Indirect library datablock, cannot change")));
uiButSetFlag(but, UI_BUT_DISABLED);
}
else {
but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
- "Direct linked library datablock, click to make local.");
+ UI_translate_do_tooltip(N_("Direct linked library datablock, click to make local")));
if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib))
uiButSetFlag(but, UI_BUT_DISABLED);
}
@@ -411,7 +414,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
sprintf(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, "Displays number of users of this data. Click to make a single-user copy.");
+ 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")));
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)
@@ -429,11 +433,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6;
if(newop) {
- but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL);
+ but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": UI_translate_do_iface(N_("New")), 0, 0, w, UI_UNIT_Y, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
else {
- but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": _("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
@@ -445,11 +449,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
int w= id?UI_UNIT_X: (flag & UI_ID_ADD_NEW)? UI_UNIT_X*3: UI_UNIT_X*6;
if(openop) {
- but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL);
+ but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": UI_translate_do_iface(N_("Open")), 0, 0, w, UI_UNIT_Y, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN));
}
else {
- but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
+ but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": UI_translate_do_iface(N_("Open")), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN));
}
@@ -465,7 +469,8 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
uiButSetNFunc(but, NULL, MEM_dupallocN(template), NULL);
}
else {
- but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Unlink datablock. Shift + Click to set users to zero, data will then not be saved");
+ but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ UI_translate_do_tooltip(N_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved")));
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE));
if(RNA_property_flag(template->prop) & PROP_NEVER_NULL)
@@ -722,7 +727,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
sprintf(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, "Make Real", 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Convert virtual modifier to a real modifier");
+ 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,
+ UI_translate_do_tooltip(N_("Convert virtual modifier to a real modifier")));
uiButSetFunc(but, modifiers_convertToReal, ob, md);
}
else {
@@ -756,7 +762,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
if ((ob->type==OB_MESH) && modifier_couldBeCage(scene, md) && (index <= lastCageIndex))
{
/* -- convert to rna ? */
- but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "Apply modifier to editing cage during Editmode");
+ but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
+ UI_translate_do_tooltip(N_("Apply modifier to editing cage during Editmode")));
if (index < cageIndex)
uiButSetFlag(but, UI_BUT_DISABLED);
uiButSetFunc(but, modifiers_setOnCage, ob, md);
@@ -768,7 +775,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
/* add disabled pre-tesselated button, so users could have
message for this modifiers */
- but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "This modifier could be applied on splines' points only");
+ but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0,
+ UI_translate_do_tooltip(N_("This modifier could be applied on splines' points only")));
uiButSetFlag(but, UI_BUT_DISABLED);
} else if (mti->type != eModifierTypeType_Constructive) {
/* constructive modifiers tesselates curve before applying */
@@ -818,17 +826,17 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
}
else {
uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT);
- uiItemEnumO(row, "OBJECT_OT_modifier_apply", "Apply", 0, "apply_as", MODIFIER_APPLY_DATA);
+ uiItemEnumO(row, "OBJECT_OT_modifier_apply", UI_translate_do_iface(N_("Apply")), 0, "apply_as", MODIFIER_APPLY_DATA);
if (modifier_sameTopology(md))
- uiItemEnumO(row, "OBJECT_OT_modifier_apply", "Apply as Shape", 0, "apply_as", MODIFIER_APPLY_SHAPE);
+ uiItemEnumO(row, "OBJECT_OT_modifier_apply", UI_translate_do_iface(N_("Apply as Shape")), 0, "apply_as", MODIFIER_APPLY_SHAPE);
}
uiBlockClearButLock(block);
uiBlockSetButLock(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE);
if (!ELEM5(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem, eModifierType_Cloth, eModifierType_Smoke))
- uiItemO(row, "Copy", ICON_NONE, "OBJECT_OT_modifier_copy");
+ uiItemO(row, UI_translate_do_tooltip(N_("Copy")), ICON_NONE, "OBJECT_OT_modifier_copy");
}
/* result is the layout block inside the box, that we return so that modifier settings can be drawn */
@@ -855,7 +863,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
/* verify we have valid data */
if(!RNA_struct_is_a(ptr->type, &RNA_Modifier)) {
- RNA_warning("Expected modifier on object.");
+ RNA_warning("Expected modifier on object");
return NULL;
}
@@ -863,7 +871,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
md= ptr->data;
if(!ob || !(GS(ob->id.name) == ID_OB)) {
- RNA_warning("expected modifier on object.");
+ RNA_warning("Expected modifier on object");
return NULL;
}
@@ -1005,8 +1013,8 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
uiBlockSetEmboss(block, UI_EMBOSSN);
/* draw a ghost icon (for proxy) and also a lock beside it, to show that constraint is "proxy locked" */
- uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco+244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Proxy Protected");
- uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Proxy Protected");
+ uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco+244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Proxy Protected")));
+ uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Proxy Protected")));
uiBlockSetEmboss(block, UI_EMBOSS);
}
@@ -1084,7 +1092,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
/* verify we have valid data */
if(!RNA_struct_is_a(ptr->type, &RNA_Constraint)) {
- RNA_warning("Expected constraint on object.");
+ RNA_warning("Expected constraint on object");
return NULL;
}
@@ -1092,7 +1100,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr)
con= ptr->data;
if(!ob || !(GS(ob->id.name) == ID_OB)) {
- RNA_warning("Expected constraint on object.");
+ RNA_warning("Expected constraint on object");
return NULL;
}
@@ -1138,7 +1146,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
PointerRNA texture_ptr;
if(id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) {
- RNA_warning("expected ID of type material, texture, lamp or world.");
+ RNA_warning("Expected ID of type material, texture, lamp or world");
return;
}
@@ -1192,14 +1200,14 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M
RNA_pointer_create(id, &RNA_Texture, tex, &texture_ptr);
uiLayoutRow(layout, 1);
- uiDefButS(block, ROW, B_MATPRV, "Texture", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, "");
+ uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Texture")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, "");
if(GS(parent->name) == ID_MA)
- uiDefButS(block, ROW, B_MATPRV, "Material", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
+ uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Material")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
else if(GS(parent->name) == ID_LA)
- uiDefButS(block, ROW, B_MATPRV, "Lamp", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
+ uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Lamp")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
else if(GS(parent->name) == ID_WO)
- uiDefButS(block, ROW, B_MATPRV, "World", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
- uiDefButS(block, ROW, B_MATPRV, "Both", 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, "");
+ uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("World")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, "");
+ uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Both")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, "");
/* Alpha buton for texture preview */
if(*pr_texture!=TEX_PR_OTHER) {
@@ -1290,21 +1298,23 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
if(coba==NULL) return;
- bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
+ bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Add")), 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ UI_translate_do_tooltip(N_("Add a new color stop to the colorband")));
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
- bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position");
+ bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Delete")), 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ UI_translate_do_tooltip(N_("Delete the active position")));
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
/* XXX, todo for later - convert to operator - campbell */
- bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Flip colorband");
+ bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, UI_translate_do_tooltip(N_("Flip colorband")));
uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
- uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop");
+ uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, UI_translate_do_tooltip(N_("Choose active color stop")));
- bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
- 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
+ bt= uiDefButS(block, MENU, 0, UI_translate_do_iface(N_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4")),
+ 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, UI_translate_do_tooltip(N_("Set interpolation between color stops")));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
uiBlockEndAlign(block);
@@ -1333,11 +1343,13 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
float xs= butr->xmin;
uiBlockBeginAlign(block);
- bt= uiDefBut(block, BUT, 0, "Add", xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
+ bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Add")), xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ UI_translate_do_tooltip(N_("Add a new color stop to the colorband")));
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
- bt= uiDefBut(block, BUT, 0, "Delete", xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position");
+ bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Delete")), xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0,
+ UI_translate_do_tooltip(N_("Delete the active position")));
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
- bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Flip the color ramp");
+ bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, UI_translate_do_tooltip(N_("Flip the color ramp")));
uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
uiBlockEndAlign(block);
@@ -1348,8 +1360,9 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand
uiItemR(layout, &ptr, "color", 0, "", ICON_NONE);
}
- bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4",
- xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops");
+ bt= uiDefButS(block, MENU, 0, UI_translate_do_tooltip(N_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4")),
+ xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0,
+ UI_translate_do_tooltip(N_("Set interpolation between color stops")));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
bt= uiDefBut(block, BUT_COLORBAND, 0, "", xs,butr->ymin,butr->xmax-butr->xmin,UI_UNIT_Y, coba, 0, 0, 0, 0, "");
@@ -1600,10 +1613,10 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu
uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL);
uiBlockBeginAlign(block);
- uiDefButF(block, NUM, 0, "Min X ", 0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, "");
- uiDefButF(block, NUM, 0, "Min Y ", 0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, "");
- uiDefButF(block, NUM, 0, "Max X ", 0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, "");
- uiDefButF(block, NUM, 0, "Max Y ", 0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Min X ")), 0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, "");
+ uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Min Y ")), 0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, "");
+ uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Max X ")), 0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, "");
+ uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Max Y ")), 0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, "");
uiBlockSetDirection(block, UI_RIGHT);
@@ -1652,12 +1665,12 @@ static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap
block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS);
uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Horizontal", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Extrapolated", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset View")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Vector Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Auto Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Extend Horizontal")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Extend Extrapolated")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset Curve")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 50);
@@ -1674,10 +1687,10 @@ static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void
block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS);
uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve", 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset View")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Vector Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Auto Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset Curve")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
uiBlockSetDirection(block, UI_RIGHT);
uiTextBoundsBlock(block, 50);
@@ -1794,24 +1807,24 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
uiBlockSetEmboss(block, UI_EMBOSSN);
- bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom in");
+ bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Zoom in")));
uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL);
- bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom out");
+ bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Zoom out")));
uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL);
if(brush)
- bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, "Tools");
+ bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Tools")));
else
- bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, "Tools");
+ bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Tools")));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT;
- bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, "Clipping Options");
+ bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Clipping Options")));
uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
- bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points");
+ bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Delete points")));
uiButSetNFunc(bt, curvemap_buttons_delete, MEM_dupallocN(cb), cumap);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -1830,7 +1843,8 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe
uiItemR(uiLayoutColumn(split, 0), ptr, "white_level", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
uiLayoutRow(layout, 0);
- bt=uiDefBut(block, BUT, 0, "Reset", 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Reset Black/White point and curves");
+ bt=uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Reset")), 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
+ UI_translate_do_tooltip(N_("Reset Black/White point and curves")));
uiButSetNFunc(bt, curvemap_buttons_reset, MEM_dupallocN(cb), cumap);
}
@@ -2124,6 +2138,18 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
//uiItemR(row, itemptr, "mute", 0, "", ICON_MUTE_IPO_OFF);
uiBlockSetEmboss(block, UI_EMBOSS);
}
+ else if(itemptr->type == &RNA_VertexGroup) {
+ bDeformGroup *dg= (bDeformGroup *)itemptr->data;
+ uiItemL(sub, name, icon);
+ /* RNA does not allow nice lock icons, use lower level buttons */
+#if 0
+ uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "lock_weight", 0, 0, 0, 0, 0, NULL);
+#else
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ uiDefIconButBitC(block, TOG, DG_LOCK_WEIGHT, 0, (dg->flag & DG_LOCK_WEIGHT) ? ICON_LOCKED : ICON_UNLOCKED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &dg->flag, 0, 0, 0, 0, "Maintain relative weights while painting");
+ uiBlockSetEmboss(block, UI_EMBOSS);
+#endif
+ }
else if(itemptr->type == &RNA_KeyingSetPath) {
KS_Path *ksp = (KS_Path*)itemptr->data;
@@ -2159,7 +2185,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
pa= block->panel;
if(!pa) {
- RNA_warning("only works inside a panel.");
+ RNA_warning("Only works inside a panel");
return;
}
@@ -2169,28 +2195,28 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *
if(ptr->data) {
prop= RNA_struct_find_property(ptr, propname);
if(!prop) {
- RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
+ RNA_warning("Property not found: %s.%s", RNA_struct_identifier(ptr->type), propname);
return;
}
}
activeprop= RNA_struct_find_property(activeptr, activepropname);
if(!activeprop) {
- RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), activepropname);
+ RNA_warning("Property not found: %s.%s", RNA_struct_identifier(ptr->type), activepropname);
return;
}
if(prop) {
type= RNA_property_type(prop);
if(type != PROP_COLLECTION) {
- RNA_warning("uiExpected collection property.");
+ RNA_warning("uiExpected collection property");
return;
}
}
activetype= RNA_property_type(activeprop);
if(activetype != PROP_INT) {
- RNA_warning("expected integer property.");
+ RNA_warning("Expected integer property");
return;
}
@@ -2437,16 +2463,18 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
(void)ui_abs; // UNUSED
uiDefIconBut(block, BUT, handle_event, ICON_PANEL_CLOSE,
- 0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, "Stop this job");
+ 0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, UI_translate_do_tooltip(N_("Stop this job")));
uiDefBut(block, PROGRESSBAR, 0, WM_jobs_name(wm, owner),
- UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, "Progress");
+ UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, UI_translate_do_tooltip(N_("Progress")));
uiLayoutRow(layout, 0);
}
if(WM_jobs_test(wm, screen))
- uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, "Capture", 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop screencast");
+ uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, UI_translate_do_iface(N_("Capture")), 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
+ UI_translate_do_tooltip(N_("Stop screencast")));
if(screen->animtimer)
- uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, "Anim Player", 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop animation playback");
+ uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, UI_translate_do_tooltip(N_("Anim Player")), 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0,
+ UI_translate_do_tooltip(N_("Stop animation playback")));
}
/************************* Reports for Last Operator Template **************************/
@@ -2508,7 +2536,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
uiBlockSetEmboss(block, UI_EMBOSSN);
if (reports->list.first != reports->list.last)
- uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, "Click to see rest of reports in textblock: 'Recent Reports'");
+ uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, UI_translate_do_tooltip(N_("Click to see rest of reports in textblock: 'Recent Reports'")));
else
uiDefIconBut(block, LABEL, 0, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index a3f56192cb5..a49060eaca2 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -37,6 +37,8 @@
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
@@ -114,7 +116,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
}
case PROP_COLLECTION: {
char text[256];
- sprintf(text, "%d items", RNA_property_collection_length(ptr, prop));
+ sprintf(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/view2d.c b/source/blender/editors/interface/view2d.c
index 43bf2f59e04..18db1c8c894 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -168,7 +168,7 @@ static void view2d_masks(View2D *v2d)
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
{
short tot_changed= 0, init= 0;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
/* initialise data if there is a need for such */
if ((v2d->flag & V2D_IS_INITIALISED) == 0) {
@@ -420,8 +420,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
/* check if we should restore aspect ratio (if view size changed) */
if (v2d->keepzoom & V2D_KEEPASPECT) {
- short do_x=0, do_y=0, do_cur, do_win;
- float curRatio, winRatio;
+ short do_x=0, do_y=0, do_cur /* , do_win */ /* UNUSED */;
+ float /* curRatio, */ /* UNUSED */ winRatio;
/* when a window edge changes, the aspect ratio can't be used to
* find which is the best new 'cur' rect. thats why it stores 'old'
@@ -429,7 +429,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
if (winx != v2d->oldwinx) do_x= 1;
if (winy != v2d->oldwiny) do_y= 1;
- curRatio= height / width;
+ /* curRatio= height / width; */ /* UNUSED */
winRatio= winy / winx;
/* both sizes change (area/region maximised) */
@@ -443,7 +443,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
else do_x= 1;
}
do_cur= do_x;
- do_win= do_y;
+ /* do_win= do_y; */ /* UNUSED */
if (do_cur) {
if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && (winx != v2d->oldwinx)) {
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 434334258af..0aaf6fe3bc6 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -51,6 +51,7 @@
#include "ED_screen.h"
#include "UI_view2d.h"
+#include "UI_interface.h"
#include "PIL_time.h" /* USER_ZOOM_CONT */
@@ -444,7 +445,7 @@ static void VIEW2D_OT_scroll_down(wmOperatorType *ot)
/* rna - must keep these in sync with the other operators */
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX);
- RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll down one page.");
+ RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll down one page");
}
@@ -494,7 +495,7 @@ static void VIEW2D_OT_scroll_up(wmOperatorType *ot)
/* rna - must keep these in sync with the other operators */
RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "deltay", 0, INT_MIN, INT_MAX, "Delta Y", "", INT_MIN, INT_MAX);
- RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll up one page.");
+ RNA_def_boolean(ot->srna, "page", 0, "Page", "Scroll up one page");
}
/* ********************************************************* */
@@ -1587,7 +1588,7 @@ static void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
static int reset_exec(bContext *C, wmOperator *UNUSED(op))
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
ARegion *ar= CTX_wm_region(C);
View2D *v2d= &ar->v2d;
int winx, winy;
diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c
index 9bf863faae3..6a263fca915 100644
--- a/source/blender/editors/mesh/editmesh.c
+++ b/source/blender/editors/mesh/editmesh.c
@@ -1335,7 +1335,7 @@ static int mesh_separate_selected(wmOperator *op, Main *bmain, Scene *scene, Bas
me= obedit->data;
em= BKE_mesh_get_editmesh(me);
if(me->key) {
- BKE_report(op->reports, RPT_WARNING, "Can't separate mesh with shape keys.");
+ BKE_report(op->reports, RPT_WARNING, "Can't separate mesh with shape keys");
BKE_mesh_end_editmesh(me, em);
return 0;
}
@@ -1958,3 +1958,101 @@ void em_setup_viewcontext(bContext *C, ViewContext *vc)
vc->em= me->edit_mesh;
}
}
+
+
+/* (similar to void paintface_flush_flags(Object *ob))
+ * copy the vertex flags, most importantly selection from the mesh to the final derived mesh,
+ * use in object mode when selecting vertices (while painting) */
+void paintvert_flush_flags(Object *ob)
+{
+ Mesh *me= get_mesh(ob);
+ DerivedMesh *dm= ob->derivedFinal;
+ MVert *dm_mvert, *dm_mv;
+ int *index_array = NULL;
+ int totvert;
+ int i;
+
+ if(me==NULL || dm==NULL)
+ return;
+
+ index_array = dm->getVertDataArray(dm, CD_ORIGINDEX);
+
+ dm_mvert = dm->getVertArray(dm);
+ totvert = dm->getNumVerts(dm);
+
+ dm_mv= dm_mvert;
+
+ if(index_array) {
+ int orig_index;
+ for (i= 0; i<totvert; i++, dm_mv++) {
+ orig_index= index_array[i];
+ if(orig_index != ORIGINDEX_NONE) {
+ dm_mv->flag= me->mvert[index_array[i]].flag;
+ }
+ }
+ }
+ else {
+ for (i= 0; i<totvert; i++, dm_mv++) {
+ dm_mv->flag= me->mvert[i].flag;
+ }
+ }
+}
+/* note: if the caller passes FALSE to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
+void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
+{
+ Mesh *me;
+ MVert *mvert;
+ int a;
+
+ me= get_mesh(ob);
+ if(me==NULL) return;
+
+ if(action == SEL_INVERT) {
+ mvert= me->mvert;
+ a= me->totvert;
+ while(a--) {
+ if((mvert->flag & ME_HIDE) == 0) {
+ mvert->flag ^= SELECT;
+ }
+ mvert++;
+ }
+ }
+ else {
+ if (action == SEL_TOGGLE) {
+ action = SEL_SELECT;
+
+ mvert= me->mvert;
+ a= me->totvert;
+ while(a--) {
+ if((mvert->flag & ME_HIDE) == 0 && mvert->flag & SELECT) {
+ action = SEL_DESELECT;
+ break;
+ }
+ mvert++;
+ }
+ }
+
+ mvert= me->mvert;
+ a= me->totvert;
+ while(a--) {
+ if((mvert->flag & ME_HIDE) == 0) {
+ switch (action) {
+ case SEL_SELECT:
+ mvert->flag |= SELECT;
+ break;
+ case SEL_DESELECT:
+ mvert->flag &= ~SELECT;
+ break;
+ case SEL_INVERT:
+ mvert->flag ^= SELECT;
+ break;
+ }
+ }
+ mvert++;
+ }
+ }
+
+ if(flush_flags) {
+ paintvert_flush_flags(ob);
+ }
+}
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 7af4ebee3bc..8c035ca46fd 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -266,6 +266,7 @@ int EM_mask_init_backbuf_border(ViewContext *vc, int mcords[][2], short tot, sho
/* method in use for face selecting too */
if(vc->obedit==NULL) {
if(paint_facesel_test(vc->obact));
+ else if(paint_vertsel_test(vc->obact));
else return 0;
}
else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;
@@ -328,6 +329,7 @@ int EM_init_backbuf_circle(ViewContext *vc, short xs, short ys, short rads)
/* method in use for face selecting too */
if(vc->obedit==NULL) {
if(paint_facesel_test(vc->obact));
+ else if (paint_vertsel_test(vc->obact));
else return 0;
}
else if(vc->v3d->drawtype<OB_SOLID || (vc->v3d->flag & V3D_ZBUF_SELECT)==0) return 0;
@@ -1463,7 +1465,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type)
break;
case 2: /* copy image */
if (!tf_act) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers");
return;
}
for(efa=em->faces.first; efa; efa=efa->next) {
@@ -1471,10 +1473,8 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type)
tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
if (tf_act->tpage) {
tf->tpage = tf_act->tpage;
- tf->mode |= TF_TEX;
} else {
tf->tpage = NULL;
- tf->mode &= ~TF_TEX;
}
tf->tile= tf_act->tile;
change = 1;
@@ -1484,7 +1484,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type)
case 3: /* copy UV's */
if (!tf_act) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers");
return;
}
for(efa=em->faces.first; efa; efa=efa->next) {
@@ -1497,7 +1497,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type)
break;
case 4: /* mode's */
if (!tf_act) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers");
return;
}
for(efa=em->faces.first; efa; efa=efa->next) {
@@ -1510,7 +1510,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type)
break;
case 5: /* copy transp's */
if (!tf_act) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers");
return;
}
for(efa=em->faces.first; efa; efa=efa->next) {
@@ -1524,7 +1524,7 @@ static void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type)
case 6: /* copy vcols's */
if (!mcol_act) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers");
return;
} else {
/* guess the 4th color if needs be */
@@ -1654,10 +1654,8 @@ void EM_mesh_copy_face_layer(EditMesh *em, wmOperator *op, short type)
tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
if (tf_from->tpage) {
tf->tpage = tf_from->tpage;
- tf->mode |= TF_TEX;
} else {
tf->tpage = NULL;
- tf->mode &= ~TF_TEX;
}
tf->tile= tf_from->tile;
change = 1;
@@ -2807,7 +2805,7 @@ void MESH_OT_hide(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
}
void EM_reveal_mesh(EditMesh *em)
@@ -2932,7 +2930,7 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, 3, "Type", "Type of elements to select.");
+ ot->prop= RNA_def_enum(ot->srna, "type", type_items, 3, "Type", "Type of elements to select");
}
@@ -3714,8 +3712,8 @@ void MESH_OT_select_random(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly.", 0.f, 100.0f);
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first.");
+ RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly", 0.f, 100.0f);
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first");
}
void EM_select_by_material(EditMesh *em, int index)
@@ -4283,9 +4281,9 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Smooth Iterations", "", 1, INT_MAX);
- RNA_def_boolean(ot->srna, "xaxis", 1, "X-Axis", "Smooth along the X axis.");
- RNA_def_boolean(ot->srna, "yaxis", 1, "Y-Axis", "Smooth along the Y axis.");
- RNA_def_boolean(ot->srna, "zaxis", 1, "Z-Axis", "Smooth along the Z axis.");
+ RNA_def_boolean(ot->srna, "xaxis", 1, "X-Axis", "Smooth along the X axis");
+ RNA_def_boolean(ot->srna, "yaxis", 1, "Y-Axis", "Smooth along the Y axis");
+ RNA_def_boolean(ot->srna, "zaxis", 1, "Z-Axis", "Smooth along the Z axis");
}
static int mesh_noise_exec(bContext *C, wmOperator *op)
@@ -4301,7 +4299,7 @@ static int mesh_noise_exec(bContext *C, wmOperator *op)
ma= give_current_material(obedit, obedit->actcol);
if(ma==0 || ma->mtex[0]==0 || ma->mtex[0]->tex==0) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no material or texture assigned.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no material or texture assigned");
return OPERATOR_FINISHED;
}
tex= give_current_material_texture(ma);
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 2dc82ae89fb..c8e3075ac60 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -494,7 +494,7 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
}
- BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s.", count, (count==1)?"ex":"ices");
+ BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count==1)?"ex":"ices");
BKE_mesh_end_editmesh(obedit->data, em);
@@ -3887,7 +3887,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate the edge around.");
+ RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate the edge around");
}
@@ -5313,10 +5313,10 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending.");
+ prop= RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending");
RNA_def_enum_funcs(prop, shape_itemf);
- RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor.", -2.0f, 2.0f);
- RNA_def_boolean(ot->srna, "add", 0, "Add", "Add rather than blend between shapes.");
+ RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor", -2.0f, 2.0f);
+ RNA_def_boolean(ot->srna, "add", 0, "Add", "Add rather than blend between shapes");
}
/************************ Merge Operator *************************/
@@ -5957,7 +5957,7 @@ static int merge_exec(bContext *C, wmOperator *op)
recalc_editnormals(em);
- BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s.", count, (count==1)?"ex":"ices");
+ BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count==1)?"ex":"ices");
BKE_mesh_end_editmesh(obedit->data, em);
@@ -6029,10 +6029,10 @@ void MESH_OT_merge(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "type", merge_type_items, 3, "Type", "Merge method to use.");
+ prop= RNA_def_enum(ot->srna, "type", merge_type_items, 3, "Type", "Merge method to use");
RNA_def_enum_funcs(prop, merge_type_itemf);
ot->prop= prop;
- RNA_def_boolean(ot->srna, "uvs", 0, "UVs", "Move UVs according to merge.");
+ RNA_def_boolean(ot->srna, "uvs", 0, "UVs", "Move UVs according to merge");
}
/************************ Vertex Path Operator *************************/
@@ -6236,7 +6236,7 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance.");
+ ot->prop= RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance");
}
/********************** Region/Loop Operators *************************/
@@ -6491,7 +6491,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op)
int dir= RNA_enum_get(op->ptr, "direction");
if (!EM_texFaceCheck(em)) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers");
BKE_mesh_end_editmesh(obedit->data, em);
return OPERATOR_CANCELLED;
}
@@ -6565,7 +6565,7 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op)
int axis= RNA_enum_get(op->ptr, "axis");
if (!EM_texFaceCheck(em)) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no uv/image layers");
BKE_mesh_end_editmesh(obedit->data, em);
return OPERATOR_CANCELLED;
}
@@ -6653,7 +6653,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op)
int dir= RNA_enum_get(op->ptr, "direction");
if (!EM_vertColorCheck(em)) {
- BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers.");
+ BKE_report(op->reports, RPT_WARNING, "Mesh has no color layers");
BKE_mesh_end_editmesh(obedit->data, em);
return OPERATOR_CANCELLED;
}
@@ -6769,7 +6769,7 @@ void MESH_OT_uvs_rotate(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate UVs around.");
+ RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate UVs around");
}
void MESH_OT_uvs_mirror(wmOperatorType *ot)
@@ -6787,7 +6787,7 @@ void MESH_OT_uvs_mirror(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror UVs around.");
+ RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror UVs around");
}
void MESH_OT_colors_rotate(wmOperatorType *ot)
@@ -6805,7 +6805,7 @@ void MESH_OT_colors_rotate(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate edge around.");
+ RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate edge around");
}
void MESH_OT_colors_mirror(wmOperatorType *ot)
@@ -6823,7 +6823,7 @@ void MESH_OT_colors_mirror(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror colors around.");
+ RNA_def_enum(ot->srna, "axis", axis_items_xy, DIRECTION_CW, "Axis", "Axis to mirror colors around");
}
/********************** Subdivide Operator *************************/
@@ -6868,8 +6868,8 @@ void MESH_OT_subdivide(wmOperatorType *ot)
/* properties */
RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
- RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor.", 0.0f, 1.0f);
- RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor.", 0.0f, 1000.0f);
+ RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor", 0.0f, 1.0f);
+ RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor", 0.0f, 1000.0f);
RNA_def_enum(ot->srna, "corner_cut_pattern", corner_type_items, SUBDIV_CORNER_INNERVERT, "Corner Cut Pattern", "Topology pattern to use to fill a face after cutting across its corner");
}
@@ -7343,7 +7343,7 @@ void MESH_OT_sort_faces(wmOperatorType *ot)
/* identifiers */
ot->name= "Sort Faces"; // XXX (Ctrl to reverse)%t|
- ot->description= "The faces of the active Mesh Object are sorted, based on the current view.";
+ ot->description= "The faces of the active Mesh Object are sorted, based on the current view";
ot->idname= "MESH_OT_sort_faces";
/* api callbacks */
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index c4a302d4d18..ef52d9be0c3 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -238,7 +238,6 @@ int ED_mesh_uv_texture_remove(bContext *C, Object *ob, Mesh *me)
int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mesh *me, const char *name, int active_set)
{
EditMesh *em;
- MCol *mcol;
int layernum;
if(me->edit_mesh) {
@@ -261,8 +260,6 @@ int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mes
if(layernum >= MAX_MCOL)
return 0;
- mcol= me->mcol;
-
if(me->mcol)
CustomData_add_layer_named(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface, name);
else
@@ -364,7 +361,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
if(!ima) {
- BKE_report(op->reports, RPT_ERROR, "Not an Image.");
+ BKE_report(op->reports, RPT_ERROR, "Not an Image");
return OPERATOR_CANCELLED;
}
@@ -413,7 +410,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign.");
+ RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign");
RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
}
@@ -683,7 +680,7 @@ static void mesh_add_faces(Mesh *mesh, int len)
void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges, int faces)
{
if(mesh->edit_mesh) {
- BKE_report(reports, RPT_ERROR, "Can't add geometry in edit mode.");
+ BKE_report(reports, RPT_ERROR, "Can't add geometry in edit mode");
return;
}
@@ -699,7 +696,7 @@ void ED_mesh_geometry_add(Mesh *mesh, ReportList *reports, int verts, int edges,
void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count)
{
if(mesh->edit_mesh) {
- BKE_report(reports, RPT_ERROR, "Can't add faces in edit mode.");
+ BKE_report(reports, RPT_ERROR, "Can't add faces in edit mode");
return;
}
@@ -709,7 +706,7 @@ void ED_mesh_faces_add(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count)
{
if(mesh->edit_mesh) {
- BKE_report(reports, RPT_ERROR, "Can't add edges in edit mode.");
+ BKE_report(reports, RPT_ERROR, "Can't add edges in edit mode");
return;
}
@@ -719,7 +716,7 @@ void ED_mesh_edges_add(Mesh *mesh, ReportList *reports, int count)
void ED_mesh_vertices_add(Mesh *mesh, ReportList *reports, int count)
{
if(mesh->edit_mesh) {
- BKE_report(reports, RPT_ERROR, "Can't add vertices in edit mode.");
+ BKE_report(reports, RPT_ERROR, "Can't add vertices in edit mode");
return;
}
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 763e82b8b53..526bf177ab7 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -217,7 +217,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
if(me->totvert) {
/* Add this object's materials to the base one's if they don't exist already (but only if limits not exceeded yet) */
- if(totcol < MAXMAT-1) {
+ if(totcol < MAXMAT) {
for(a=1; a<=base->object->totcol; a++) {
ma= give_current_material(base->object, a);
@@ -231,7 +231,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
totcol++;
}
- if(totcol>=MAXMAT-1)
+ if(totcol >= MAXMAT)
break;
}
}
@@ -574,9 +574,9 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
if (!ok) {
if (nonequal_verts)
- BKE_report(op->reports, RPT_WARNING, "Selected meshes must have equal numbers of vertices.");
+ BKE_report(op->reports, RPT_WARNING, "Selected meshes must have equal numbers of vertices");
else
- BKE_report(op->reports, RPT_WARNING, "No additional selected meshes with equal vertex count to join.");
+ BKE_report(op->reports, RPT_WARNING, "No additional selected meshes with equal vertex count to join");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index b007e30422d..a58d74d250c 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -268,7 +268,7 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_float_percentage(ot->srna, "percent", 0.5f, 0.0f, 1.0f, "Percent", "Percentage of metaelems to select randomly.", 0.0001f, 1.0f);
+ RNA_def_float_percentage(ot->srna, "percent", 0.5f, 0.0f, 1.0f, "Percent", "Percentage of metaelems to select randomly", 0.0001f, 1.0f);
}
/***************************** Duplicate operator *****************************/
@@ -412,7 +412,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
}
/***************************** Unhide operator *****************************/
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 66db7db5171..6c553289052 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -764,7 +764,7 @@ static int childof_clear_inverse_exec (bContext *C, wmOperator *op)
bChildOfConstraint *data= (con) ? (bChildOfConstraint *)con->data : NULL;
if(data==NULL) {
- BKE_report(op->reports, RPT_ERROR, "Childof constraint not found.");
+ BKE_report(op->reports, RPT_ERROR, "Childof constraint not found");
return OPERATOR_CANCELLED;
}
@@ -1095,7 +1095,7 @@ void POSE_OT_constraints_copy(wmOperatorType *ot)
/* identifiers */
ot->name= "Copy Constraints to Selected";
ot->idname= "POSE_OT_constraints_copy";
- ot->description = "Copy constraints to other selected bones.";
+ ot->description = "Copy constraints to other selected bones";
/* api callbacks */
ot->exec= pose_constraint_copy_exec;
@@ -1136,7 +1136,7 @@ void OBJECT_OT_constraints_copy(wmOperatorType *ot)
/* identifiers */
ot->name= "Copy Constraints to Selected";
ot->idname= "OBJECT_OT_constraints_copy";
- ot->description = "Copy constraints to other selected objects.";
+ ot->description = "Copy constraints to other selected objects";
/* api callbacks */
ot->exec= object_constraint_copy_exec;
@@ -1302,7 +1302,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
/* ensure not to confuse object/pose adding */
if (pchan == NULL) {
- BKE_report(op->reports, RPT_ERROR, "No active pose bone to add a constraint to.");
+ BKE_report(op->reports, RPT_ERROR, "No active pose bone to add a constraint to");
return OPERATOR_CANCELLED;
}
}
@@ -1311,15 +1311,15 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
return OPERATOR_CANCELLED;
}
if ( (type == CONSTRAINT_TYPE_RIGIDBODYJOINT) && (list != &ob->constraints) ) {
- BKE_report(op->reports, RPT_ERROR, "Rigid Body Joint Constraint can only be added to Objects.");
+ BKE_report(op->reports, RPT_ERROR, "Rigid Body Joint Constraint can only be added to Objects");
return OPERATOR_CANCELLED;
}
if ( (type == CONSTRAINT_TYPE_KINEMATIC) && ((!pchan) || (list != &pchan->constraints)) ) {
- BKE_report(op->reports, RPT_ERROR, "IK Constraint can only be added to Bones.");
+ BKE_report(op->reports, RPT_ERROR, "IK Constraint can only be added to Bones");
return OPERATOR_CANCELLED;
}
if ( (type == CONSTRAINT_TYPE_SPLINEIK) && ((!pchan) || (list != &pchan->constraints)) ) {
- BKE_report(op->reports, RPT_ERROR, "Spline IK Constraint can only be added to Bones.");
+ BKE_report(op->reports, RPT_ERROR, "Spline IK Constraint can only be added to Bones");
return OPERATOR_CANCELLED;
}
@@ -1407,7 +1407,7 @@ static int object_constraint_add_exec(bContext *C, wmOperator *op)
short with_targets= 0;
if (!ob) {
- BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to.");
+ BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to");
return OPERATOR_CANCELLED;
}
@@ -1428,7 +1428,7 @@ static int pose_constraint_add_exec(bContext *C, wmOperator *op)
short with_targets= 0;
if (!ob) {
- BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to.");
+ BKE_report(op->reports, RPT_ERROR, "No active object to add constraint to");
return OPERATOR_CANCELLED;
}
@@ -1537,7 +1537,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
/* must have active bone */
if (ELEM(NULL, ob, pchan)) {
- BKE_report(op->reports, RPT_ERROR, "Must have active bone to add IK Constraint to.");
+ BKE_report(op->reports, RPT_ERROR, "Must have active bone to add IK Constraint to");
return OPERATOR_CANCELLED;
}
@@ -1546,7 +1546,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
if (con->type==CONSTRAINT_TYPE_KINEMATIC) break;
}
if (con) {
- BKE_report(op->reports, RPT_ERROR, "Bone already has IK Constraint.");
+ BKE_report(op->reports, RPT_ERROR, "Bone already has IK Constraint");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 79cbfb6574b..ec1405f74b8 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -222,7 +222,7 @@ void OBJECT_OT_hide_view_set(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
}
@@ -297,7 +297,7 @@ void OBJECT_OT_hide_render_set(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
}
/* ******************* toggle editmode operator ***************** */
@@ -2177,7 +2177,7 @@ void OBJECT_OT_logic_bricks_copy(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Copy Logic Bricks to Selected";
- ot->description = "Copy logic bricks to other selected objects.";
+ ot->description = "Copy logic bricks to other selected objects";
ot->idname= "OBJECT_OT_logic_bricks_copy";
/* api callbacks */
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index fd4581af194..ce01bef34f6 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -292,7 +292,7 @@ static int return_editcurve_indexar(Object *obedit, int *tot, int **indexar, flo
return totvert;
}
-static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
+static int object_hook_index_array(Scene *scene, Object *obedit, int *tot, int **indexar, char *name, float *cent_r)
{
*indexar= NULL;
*tot= 0;
@@ -302,7 +302,12 @@ static int object_hook_index_array(Object *obedit, int *tot, int **indexar, char
case OB_MESH:
{
Mesh *me= obedit->data;
- EditMesh *em = BKE_mesh_get_editmesh(me);
+ EditMesh *em;
+
+ load_editMesh(scene, obedit);
+ make_editMesh(scene, obedit);
+
+ em = BKE_mesh_get_editmesh(me);
/* check selected vertices first */
if( return_editmesh_indexar(em, tot, indexar, cent_r)) {
@@ -427,7 +432,7 @@ static void add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *o
int tot, ok, *indexar;
char name[32];
- ok = object_hook_index_array(obedit, &tot, &indexar, name, cent);
+ ok = object_hook_index_array(scene, obedit, &tot, &indexar, name, cent);
if (!ok) return; // XXX error("Requires selected vertices or active Vertex Group");
@@ -485,7 +490,7 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
if (!obsel) {
- BKE_report(op->reports, RPT_ERROR, "Can't add hook with no other selected objects.");
+ BKE_report(op->reports, RPT_ERROR, "Can't add hook with no other selected objects");
return OPERATOR_CANCELLED;
}
@@ -608,7 +613,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove.");
+ prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove");
RNA_def_enum_funcs(prop, hook_mod_itemf);
ot->prop= prop;
}
@@ -675,7 +680,7 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to.");
+ prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to");
RNA_def_enum_funcs(prop, hook_mod_itemf);
}
@@ -731,7 +736,7 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to.");
+ prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to");
RNA_def_enum_funcs(prop, hook_mod_itemf);
}
@@ -760,7 +765,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
/* assign functionality */
- if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) {
+ if(!object_hook_index_array(CTX_data_scene(C), ob, &tot, &indexar, name, cent)) {
BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group");
return OPERATOR_CANCELLED;
}
@@ -794,7 +799,7 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to.");
+ prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to");
RNA_def_enum_funcs(prop, hook_mod_itemf);
}
@@ -843,7 +848,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove.");
+ prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove");
RNA_def_enum_funcs(prop, hook_mod_itemf);
}
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 3da0723ec18..434111c1227 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -200,6 +200,8 @@ void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_normalize(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_normalize_all(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_levels(struct wmOperatorType *ot);
+void OBJECT_OT_vertex_group_lock(struct wmOperatorType *ot);
+void OBJECT_OT_vertex_group_fix(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_invert(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_blend(struct wmOperatorType *ot);
void OBJECT_OT_vertex_group_clean(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 17f174a5069..ebbc4137628 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -97,7 +97,7 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
if(mti->flags&eModifierTypeFlag_Single) {
if(modifiers_findByType(ob, type)) {
- BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed.");
+ BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed");
return NULL;
}
}
@@ -169,7 +169,7 @@ int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Ob
break;
if(!obmd) {
- BKE_reportf(reports, RPT_ERROR, "Modifier '%s' not in object '%s'.", ob->id.name, md->name);
+ BKE_reportf(reports, RPT_ERROR, "Modifier '%s' not in object '%s'", ob->id.name, md->name);
return 0;
}
@@ -255,7 +255,7 @@ int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md
ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type);
if(nmti->flags&eModifierTypeFlag_RequiresOriginalData) {
- BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data.");
+ BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data");
return 0;
}
}
@@ -276,7 +276,7 @@ int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData *
ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type);
if(nmti->type!=eModifierTypeType_OnlyDeform) {
- BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier.");
+ BKE_report(reports, RPT_WARNING, "Cannot move beyond a non-deforming modifier");
return 0;
}
}
@@ -552,7 +552,7 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi
}
if (md!=ob->modifiers.first)
- BKE_report(reports, RPT_INFO, "Applied modifier was not first, result may not be as expected.");
+ BKE_report(reports, RPT_INFO, "Applied modifier was not first, result may not be as expected");
/* allow apply of a not-realtime modifier, by first re-enabling realtime. */
prev_mode= md->mode;
@@ -1068,7 +1068,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if(mmd->lvl==0) {
- BKE_report(op->reports, RPT_ERROR, "Reshape can work only with higher levels of subdivisions.");
+ BKE_report(op->reports, RPT_ERROR, "Reshape can work only with higher levels of subdivisions");
return OPERATOR_CANCELLED;
}
@@ -1081,12 +1081,12 @@ static int multires_reshape_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
if(!secondob) {
- BKE_report(op->reports, RPT_ERROR, "Second selected mesh object require to copy shape from.");
+ BKE_report(op->reports, RPT_ERROR, "Second selected mesh object require to copy shape from");
return OPERATOR_CANCELLED;
}
if(!multiresModifier_reshape(scene, mmd, ob, secondob)) {
- BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices.");
+ BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 5eb17268d19..452d1aded51 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -174,6 +174,8 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_vertex_group_copy);
WM_operatortype_append(OBJECT_OT_vertex_group_normalize);
WM_operatortype_append(OBJECT_OT_vertex_group_normalize_all);
+ WM_operatortype_append(OBJECT_OT_vertex_group_lock);
+ WM_operatortype_append(OBJECT_OT_vertex_group_fix);
WM_operatortype_append(OBJECT_OT_vertex_group_invert);
WM_operatortype_append(OBJECT_OT_vertex_group_levels);
WM_operatortype_append(OBJECT_OT_vertex_group_blend);
@@ -245,7 +247,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) {
- RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add.");
+ RNA_def_string(ot->srna, "name", "Cube", 24, "Name", "Object name to add");
WM_operatortype_macro_define(ot, "VIEW3D_OT_cursor3d");
WM_operatortype_macro_define(ot, "OBJECT_OT_add_named");
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 4d7f6fa9e7a..ec5aa19d3c0 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -95,6 +95,7 @@
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_view3d.h"
+#include "ED_mesh.h"
#include "object_intern.h"
@@ -122,7 +123,12 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
if(obedit->type==OB_MESH) {
Mesh *me= obedit->data;
- EditMesh *em = BKE_mesh_get_editmesh(me);
+ EditMesh *em;
+
+ load_editMesh(scene, obedit);
+ make_editMesh(scene, obedit);
+
+ em = BKE_mesh_get_editmesh(me);
eve= em->verts.first;
while(eve) {
@@ -404,7 +410,7 @@ void OBJECT_OT_proxy_make (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "object", "", MAX_ID_NAME-2, "Proxy Object", "Name of lib-linked/grouped object to make a proxy for.");
+ RNA_def_string(ot->srna, "object", "", MAX_ID_NAME-2, "Proxy Object", "Name of lib-linked/grouped object to make a proxy for");
prop= RNA_def_enum(ot->srna, "type", DummyRNA_DEFAULT_items, 0, "Type", "Group object"); /* XXX, relies on hard coded ID at the moment */
RNA_def_enum_funcs(prop, proxy_group_object_itemf);
ot->prop= prop;
@@ -1921,5 +1927,5 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "name", "Material", 24, "Name", "Material name to assign.");
+ RNA_def_string(ot->srna, "name", "Material", 24, "Name", "Material name to assign");
}
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 8fdd7a53e91..a4c45e033b3 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -179,7 +179,7 @@ void OBJECT_OT_select_by_type(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
ot->prop= RNA_def_enum(ot->srna, "type", object_type_items, 1, "Type", "");
}
@@ -361,7 +361,7 @@ void OBJECT_OT_select_linked(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
ot->prop= RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", "");
}
@@ -687,7 +687,7 @@ void OBJECT_OT_select_grouped(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", "");
}
@@ -736,7 +736,7 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
RNA_def_int(ot->srna, "layers", 1, 1, 20, "Layer", "", 1, 20);
}
@@ -883,7 +883,7 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_string(ot->srna, "group", "", 32, "Group", "Name of the group to select.");
+ RNA_def_string(ot->srna, "group", "", 32, "Group", "Name of the group to select");
}
/**************************** Select Mirror ****************************/
@@ -936,7 +936,7 @@ void OBJECT_OT_select_mirror(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
}
@@ -993,8 +993,8 @@ void OBJECT_OT_select_name(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_string(ot->srna, "name", "", 0, "Name", "Object name to select.");
- RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_string(ot->srna, "name", "", 0, "Name", "Object name to select");
+ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
}
/**************************** Select Random ****************************/
@@ -1043,7 +1043,7 @@ void OBJECT_OT_select_random(wmOperatorType *ot)
/* properties */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of objects to select randomly", 0.f, 100.0f);
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first");
}
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index fd2e7fd7c99..962aac06474 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -309,7 +309,7 @@ void OBJECT_OT_shape_key_add(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "from_mix", 1, "From Mix", "Create the new shape key from the existing mix of keys.");
+ RNA_def_boolean(ot->srna, "from_mix", 1, "From Mix", "Create the new shape key from the existing mix of keys");
}
static int shape_key_remove_exec(bContext *C, wmOperator *UNUSED(op))
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 78f3537bea9..4c29490b0f0 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -399,13 +399,13 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
if(ob->type==OB_MESH) {
if(ID_REAL_USERS(ob->data) > 1) {
- BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing.");
+ BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing");
return OPERATOR_CANCELLED;
}
}
else if(ob->type==OB_ARMATURE) {
if(ID_REAL_USERS(ob->data) > 1) {
- BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing.");
+ BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing");
return OPERATOR_CANCELLED;
}
}
@@ -413,18 +413,18 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
Curve *cu;
if(ID_REAL_USERS(ob->data) > 1) {
- BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing.");
+ BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing");
return OPERATOR_CANCELLED;
}
cu= ob->data;
if(!(cu->flag & CU_3D) && (apply_rot || apply_loc)) {
- BKE_report(reports, RPT_ERROR, "Neither rotation nor location could be applied to a 2d curve, doing nothing.");
+ BKE_report(reports, RPT_ERROR, "Neither rotation nor location could be applied to a 2d curve, doing nothing");
return OPERATOR_CANCELLED;
}
if(cu->key) {
- BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing.");
+ BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing");
return OPERATOR_CANCELLED;
}
}
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 52ba9460818..797cf428969 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -49,6 +49,7 @@
#include "DNA_scene_types.h"
#include "DNA_particle_types.h"
+#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
@@ -60,6 +61,7 @@
#include "BKE_global.h"
#include "BKE_mesh.h"
#include "BKE_report.h"
+#include "BKE_DerivedMesh.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -701,6 +703,10 @@ static void vgroup_normalize(Object *ob)
MDeformWeight *dw;
MDeformVert *dvert, **dvert_array=NULL;
int i, def_nr, dvert_tot=0;
+
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
@@ -712,6 +718,11 @@ static void vgroup_normalize(Object *ob)
def_nr= ob->actdef-1;
for(i = 0; i < dvert_tot; i++) {
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
+
dvert = dvert_array[i];
dw = defvert_find_index(dvert, def_nr);
if(dw) {
@@ -721,6 +732,11 @@ static void vgroup_normalize(Object *ob)
if(weight_max > 0.0f) {
for(i = 0; i < dvert_tot; i++) {
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
+
dvert = dvert_array[i];
dw = defvert_find_index(dvert, def_nr);
if(dw) {
@@ -736,6 +752,401 @@ static void vgroup_normalize(Object *ob)
if (dvert_array) MEM_freeN(dvert_array);
}
+/* This adds the indices of vertices to a list if they are not already present
+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) {
+ char containsA = FALSE;
+ char containsB = FALSE;
+ int added = 0;
+ int i;
+ for(i = 0; i < length && (!containsA || !containsB); i++) {
+ if(verts[i] == a) {
+ containsA = TRUE;
+ } else if(verts[i] == b) {
+ containsB = TRUE;
+ } else if(verts[i] == -1) {
+ if(!containsA) {
+ verts[i] = a;
+ containsA = TRUE;
+ added++;
+ } else if(!containsB){
+ verts[i] = b;
+ containsB = TRUE;
+ added++;
+ }
+ }
+ }
+ return added;
+}
+
+/* This finds all of the vertices connected to vert by an edge
+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) {
+ int length = 0;
+ int *tverts;
+ int *verts = NULL;
+ MFace *mf = me->mface;
+ int totface = me->totface;
+ int found = 0;
+ int i;
+ for(i = 0; i < totface; i++, mf++) {
+ if(vert == mf->v1 || vert == mf->v2 || vert == mf->v3 || (mf->v4 &&vert == mf->v4)) {
+ length+=2;
+ }
+ }
+ if(!length) {
+ return 0;
+ }
+ tverts = MEM_mallocN(sizeof(int)*length, "tempSurroundingVerts");
+ mf = me->mface;
+ for(i = 0; i < length; i++) {
+ tverts[i] = -1;
+ }
+ for(i = 0; i < totface; i++, mf++) {
+ int a=-1, b=-1;
+ if(mf->v1 == vert) {
+ a = mf->v2;
+ if(mf->v4) {
+ b = mf->v4;
+ } else {
+ b = mf->v3;
+ }
+ } else if(mf->v2 == vert) {
+ a = mf->v1;
+ b = mf->v3;
+ } else if(mf->v3 == vert) {
+ a = mf->v2;
+ if(mf->v4) {
+ b = mf->v4;
+ } else {
+ b = mf->v1;
+ }
+ } else if (mf->v4 && mf->v4 == vert){
+ a = mf->v1;
+ b = mf->v3;
+ } else {
+ continue;
+ }
+ found += tryToAddVerts(tverts, length, a, b);
+ }
+ if(found) {
+ verts = MEM_mallocN(sizeof(int)* found, "surroundingVerts");
+ for(i = 0; i < found; i++) {
+ verts[i] = tverts[i];
+ }
+ *count = found;
+ }
+ MEM_freeN(tverts);
+ return verts;
+}
+
+/* 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]) {
+ int i;
+ zero_v3(coord);
+ for(i = 0; i < count; i++) {
+ add_v3_v3(coord, points[i].co);
+ }
+ mul_v3_fl(coord, 1.0f/count);
+}
+
+/* find the closest point on a plane to another point and store it in dst */
+/* coord is a point on the plane */
+/* point is the point that you want the nearest of */
+/* norm is the plane's normal, and d is the last number in the plane equation 0 = ax + by + cz + d */
+static void getNearestPointOnPlane(const float norm[3], const float coord[3], const float point[3], float dst_r[3])
+{
+ float temp[3];
+ float dotprod;
+
+ sub_v3_v3v3(temp, point, coord);
+ dotprod= dot_v3v3(temp, norm);
+
+ dst_r[0] = point[0] - (norm[0] * dotprod);
+ dst_r[1] = point[1] - (norm[1] * dotprod);
+ dst_r[2] = point[2] - (norm[2] * dotprod);
+}
+
+/* distance of two vectors a and b of size length */
+static float distance(float* a, float *b, int length) {
+ int i;
+ float sum = 0;
+ for(i = 0; i < length; i++) {
+ sum += (b[i]-a[i])*(b[i]-a[i]);
+ }
+ return sqrt(sum);
+}
+
+/* given a plane and a start and end position,
+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) {
+ // A=Q-((Q-P).N)N
+ // D = (a*x0 + b*y0 +c*z0 +d)
+ float projA[3] = {0}, projB[3] = {0};
+
+ getNearestPointOnPlane(norm, coord, start, projA);
+ getNearestPointOnPlane(norm, coord, end, projB);
+ // (vertical and horizontal refer to the plane's y and xz respectively)
+ // vertical distance
+ dists[index] = norm[0]*end[0] + norm[1]*end[1] + norm[2]*end[2] + d;
+ // vertical change
+ changes[index][0] = dists[index] - distToStart;
+ //printf("vc %f %f\n", distance(end, projB, 3)-distance(start, projA, 3), changes[index][0]);
+ // horizontal change
+ changes[index][1] = distance(projA, projB, 3);
+}
+
+// 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) {
+ if(ob->derivedDeform && (ob->derivedDeform)==dm) {
+ ob->derivedDeform->needsFree = 1;
+ ob->derivedDeform->release(ob->derivedDeform);
+ ob->derivedDeform = NULL;
+ }
+ else if(dm) {
+ dm->needsFree = 1;
+ dm->release(dm);
+ }
+}
+
+// recalculate the deformation
+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
+
+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) {
+ DerivedMesh *dm;
+ MDeformWeight *dw;
+ MVert m;
+ MDeformVert *dvert = me->dvert+index;
+ int totweight = dvert->totweight;
+ float oldw = 0;
+ float oldPos[3] = {0};
+ float vc, hc, dist;
+ int i, k;
+ float (*changes)[2] = MEM_mallocN(sizeof(float *)*totweight*2, "vertHorzChange");
+ float *dists = MEM_mallocN(sizeof(float)*totweight, "distance");
+ int *upDown = MEM_callocN(sizeof(int)*totweight, "upDownTracker");// track if up or down moved it closer for each bone
+ int *dwIndices = MEM_callocN(sizeof(int)*totweight, "dwIndexTracker");
+ float distToStart;
+ int bestIndex = 0;
+ char wasChange;
+ char wasUp;
+ int lastIndex = -1;
+ float originalDistToBe = distToBe;
+ do {
+ 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;
+
+ if(distToBe == originalDistToBe) {
+ distToBe += distToStart - distToStart*strength;
+ }
+ for(i = 0; i < totweight; i++) {
+ dwIndices[i] = i;
+ dw = (dvert->dw+i);
+ vc = hc = 0;
+ if(!dw->weight) {
+ changes[i][0] = 0;
+ changes[i][1] = 0;
+ dists[i] = distToStart;
+ continue;
+ }
+ for(k = 0; k < 2; k++) {
+ if(dm) {
+ dm_deform_clear(dm, ob); dm = NULL;
+ }
+ oldw = dw->weight;
+ if(k) {
+ dw->weight *= 1+cp;
+ } else {
+ dw->weight /= 1+cp;
+ }
+ if(dw->weight == oldw) {
+ changes[i][0] = 0;
+ changes[i][1] = 0;
+ dists[i] = distToStart;
+ break;
+ }
+ if(dw->weight > 1) {
+ dw->weight = 1;
+ }
+ dm = dm_deform_recalc(scene, ob);
+ dm->getVert(dm, index, &m);
+ getVerticalAndHorizontalChange(norm, d, coord, oldPos, distToStart, m.co, changes, dists, i);
+ dw->weight = oldw;
+ if(!k) {
+ vc = changes[i][0];
+ hc = changes[i][1];
+ dist = dists[i];
+ } else {
+ if(fabs(dist - distToBe) < fabs(dists[i] - distToBe)) {
+ upDown[i] = 0;
+ changes[i][0] = vc;
+ changes[i][1] = hc;
+ dists[i] = dist;
+ } else {
+ upDown[i] = 1;
+ }
+ if(fabs(dists[i] - distToBe) > fabs(distToStart - distToBe)) {
+ changes[i][0] = 0;
+ changes[i][1] = 0;
+ dists[i] = distToStart;
+ }
+ }
+ }
+ }
+ // sort the changes by the vertical change
+ for(k = 0; k < totweight; k++) {
+ float tf;
+ int ti;
+ bestIndex = k;
+ for(i = k+1; i < totweight; i++) {
+ dist = dists[i];
+
+ if(fabs(dist) > fabs(dists[i])) {
+ bestIndex = i;
+ }
+ }
+ // switch with k
+ if(bestIndex != k) {
+ ti = upDown[k];
+ upDown[k] = upDown[bestIndex];
+ upDown[bestIndex] = ti;
+
+ ti = dwIndices[k];
+ dwIndices[k] = dwIndices[bestIndex];
+ dwIndices[bestIndex] = ti;
+
+ tf = changes[k][0];
+ changes[k][0] = changes[bestIndex][0];
+ changes[bestIndex][0] = tf;
+
+ tf = changes[k][1];
+ changes[k][1] = changes[bestIndex][1];
+ changes[bestIndex][1] = tf;
+
+ tf = dists[k];
+ dists[k] = dists[bestIndex];
+ dists[bestIndex] = tf;
+ }
+ }
+ bestIndex = -1;
+ // find the best change with an acceptable horizontal change
+ for(i = 0; i < totweight; i++) {
+ if(fabs(changes[i][0]) > fabs(changes[i][1]*2.0f)) {
+ bestIndex = i;
+ break;
+ }
+ }
+ if(bestIndex != -1) {
+ wasChange = TRUE;
+ // it is a good place to stop if it tries to move the opposite direction
+ // (relative to the plane) of last time
+ if(lastIndex != -1) {
+ if(wasUp != upDown[bestIndex]) {
+ wasChange = FALSE;
+ }
+ }
+ lastIndex = bestIndex;
+ wasUp = upDown[bestIndex];
+ dw = (dvert->dw+dwIndices[bestIndex]);
+ oldw = dw->weight;
+ if(upDown[bestIndex]) {
+ dw->weight *= 1+cp;
+ } else {
+ dw->weight /= 1+cp;
+ }
+ if(dw->weight > 1) {
+ dw->weight = 1;
+ }
+ if(oldw == dw->weight) {
+ wasChange = FALSE;
+ }
+ if(dm) {
+ dm_deform_clear(dm, ob); dm = NULL;
+ }
+ }
+ }while(wasChange && (distToStart-distToBe)/fabs(distToStart-distToBe) == (dists[bestIndex]-distToBe)/fabs(dists[bestIndex]-distToBe));
+ MEM_freeN(upDown);
+ MEM_freeN(changes);
+ MEM_freeN(dists);
+ MEM_freeN(dwIndices);
+}
+
+/* this is used to try to smooth a surface by only adjusting the nonzero weights of a vertex
+but it could be used to raise or lower an existing 'bump.' */
+static void vgroup_fix(Scene *scene, Object *ob, float distToBe, float strength, float cp)
+{
+ int i;
+
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+ int *verts = NULL;
+ for(i = 0; i < me->totvert && mvert; i++, mvert++) {
+
+ if(use_vert_sel && (mvert->flag & SELECT)) {
+
+ int count=0;
+ if((verts = getSurroundingVerts(me, i, &count))) {
+ MVert m;
+ MVert *p = MEM_callocN(sizeof(MVert)*(count), "deformedPoints");
+ int k;
+
+ DerivedMesh *dm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
+ for(k = 0; k < count; k++) {
+ dm->getVert(dm, verts[k], &m);
+ p[k] = m;
+ }
+
+ if(count >= 3) {
+ float d /*, dist */ /* UNUSED */, mag;
+ float coord[3] = {0};
+ float norm[3] = {0};
+ 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];
+ /* 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);
+ }
+ }
+
+ MEM_freeN(verts);
+ MEM_freeN(p);
+ }
+ }
+ }
+}
+
static void vgroup_levels(Object *ob, float offset, float gain)
{
bDeformGroup *dg;
@@ -743,6 +1154,10 @@ static void vgroup_levels(Object *ob, float offset, float gain)
MDeformVert *dvert, **dvert_array=NULL;
int i, def_nr, dvert_tot=0;
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
dg = BLI_findlink(&ob->defbase, (ob->actdef-1));
@@ -751,6 +1166,11 @@ static void vgroup_levels(Object *ob, float offset, float gain)
def_nr= ob->actdef-1;
for(i = 0; i < dvert_tot; i++) {
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
+
dvert = dvert_array[i];
dw = defvert_find_index(dvert, def_nr);
if(dw) {
@@ -772,6 +1192,11 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
int i, dvert_tot=0;
float tot_weight;
+
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
if(dvert_array) {
@@ -781,6 +1206,10 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
for(i = 0; i < dvert_tot; i++) {
float lock_iweight= 1.0f;
int j;
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
tot_weight= 0.0f;
dw_act= NULL;
@@ -821,6 +1250,11 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
else {
for(i = 0; i < dvert_tot; i++) {
int j;
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
+
tot_weight= 0.0f;
dvert = dvert_array[i];
@@ -848,12 +1282,45 @@ static void vgroup_normalize_all(Object *ob, int lock_active)
}
+static void vgroup_lock_all(Object *ob, int action)
+{
+ bDeformGroup *dg;
+
+ if(action == SEL_TOGGLE) {
+ action= SEL_SELECT;
+ for(dg= ob->defbase.first; dg; dg= dg->next) {
+ if(dg->flag & DG_LOCK_WEIGHT) {
+ action= SEL_DESELECT;
+ break;
+ }
+ }
+ }
+
+ for(dg= ob->defbase.first; dg; dg= dg->next) {
+ switch(action) {
+ case SEL_SELECT:
+ dg->flag |= DG_LOCK_WEIGHT;
+ break;
+ case SEL_DESELECT:
+ dg->flag &= ~DG_LOCK_WEIGHT;
+ break;
+ case SEL_INVERT:
+ dg->flag ^= DG_LOCK_WEIGHT;
+ break;
+ }
+ }
+}
+
static void vgroup_invert(Object *ob, int auto_assign, int auto_remove)
{
bDeformGroup *dg;
MDeformWeight *dw;
MDeformVert *dvert, **dvert_array=NULL;
int i, def_nr, dvert_tot=0;
+
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
@@ -864,6 +1331,10 @@ static void vgroup_invert(Object *ob, int auto_assign, int auto_remove)
for(i = 0; i < dvert_tot; i++) {
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
dvert = dvert_array[i];
if(auto_assign) {
@@ -976,6 +1447,10 @@ static void vgroup_clean(Object *ob, float eul, int keep_single)
MDeformWeight *dw;
MDeformVert *dvert, **dvert_array=NULL;
int i, def_nr, dvert_tot=0;
+
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
@@ -985,6 +1460,10 @@ static void vgroup_clean(Object *ob, float eul, int keep_single)
def_nr= ob->actdef-1;
for(i = 0; i < dvert_tot; i++) {
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
dvert = dvert_array[i];
dw= defvert_find_index(dvert, def_nr);
@@ -1006,12 +1485,21 @@ static void vgroup_clean_all(Object *ob, float eul, int keep_single)
MDeformWeight *dw;
MDeformVert *dvert, **dvert_array=NULL;
int i, dvert_tot=0;
+
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ const int use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
ED_vgroup_give_parray(ob->data, &dvert_array, &dvert_tot);
if(dvert_array) {
for(i = 0; i < dvert_tot; i++) {
int j;
+
+ if(use_vert_sel && !(mvert[i].flag & SELECT)) {
+ continue;
+ }
+
dvert = dvert_array[i];
j= dvert->totweight;
@@ -1591,7 +2079,7 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups.");
+ RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups");
}
static int vertex_group_assign_exec(bContext *C, wmOperator *op)
@@ -1623,7 +2111,7 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "new", 0, "New", "Assign vertex to new vertex group.");
+ RNA_def_boolean(ot->srna, "new", 0, "New", "Assign vertex to new vertex group");
}
static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
@@ -1662,7 +2150,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups.");
+ RNA_def_boolean(ot->srna, "all", 0, "All", "Remove from all vertex groups");
}
static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1771,8 +2259,8 @@ void OBJECT_OT_vertex_group_levels(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights.", -1.0f, 1.f);
- RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by.", 0.0f, 10.f);
+ RNA_def_float(ot->srna, "offset", 0.f, -1.0, 1.0, "Offset", "Value to add to weights", -1.0f, 1.f);
+ RNA_def_float(ot->srna, "gain", 1.f, 0.f, FLT_MAX, "Gain", "Value to multiply weights by", 0.0f, 10.f);
}
static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1829,7 +2317,83 @@ 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)
+{
+ Object *ob= CTX_data_active_object(C);
+ Scene *scene= CTX_data_scene(C);
+
+ float distToBe= RNA_float_get(op->ptr, "dist");
+ float strength= RNA_float_get(op->ptr, "strength");
+ float cp= RNA_float_get(op->ptr, "accuracy");
+ ModifierData *md= ob->modifiers.first;
+
+ while(md) {
+ if(md->type == eModifierType_Mirror && (md->mode&eModifierMode_Realtime)) {
+ break;
+ }
+ md = md->next;
+ }
+
+ if(md && md->type == eModifierType_Mirror) {
+ BKE_report(op->reports, RPT_ERROR_INVALID_CONTEXT, "This operator does not support an active mirror modifier");
+ return OPERATOR_CANCELLED;
+ }
+ vgroup_fix(scene, ob, distToBe, strength, cp);
+
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
+ WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
+
+ return OPERATOR_FINISHED;
+}
+
+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).";
+
+ /* api callbacks */
+ ot->poll= vertex_group_poll;
+ ot->exec= vertex_group_fix_exec;
+
+ /* 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);
+}
+
+
+static int vertex_group_lock_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_active_object(C);
+
+ int action = RNA_enum_get(op->ptr, "action");
+
+ vgroup_lock_all(ob, action);
+
+ return OPERATOR_FINISHED;
+}
+
+void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Change the Lock On Vertex Groups";
+ ot->idname= "OBJECT_OT_vertex_group_lock";
+
+ /* api callbacks */
+ ot->poll= vertex_group_poll;
+ ot->exec= vertex_group_lock_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ WM_operator_properties_select_all(ot);
}
static int vertex_group_invert_exec(bContext *C, wmOperator *op)
@@ -1859,8 +2423,8 @@ 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");
}
@@ -1925,9 +2489,9 @@ void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit.", 0.001f, 0.99f);
- RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups.");
- RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single", "Keep verts assigned to at least one group when cleaning.");
+ RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, 1.0, "Limit", "Remove weights under this limit", 0.001f, 0.99f);
+ RNA_def_boolean(ot->srna, "all_groups", FALSE, "All Groups", "Clean all vertex groups");
+ RNA_def_boolean(ot->srna, "keep_single", FALSE, "Keep Single", "Keep verts assigned to at least one group when cleaning");
}
@@ -1959,8 +2523,8 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "mirror_weights", TRUE, "Mirror Weights", "Mirror weights.");
- RNA_def_boolean(ot->srna, "flip_group_names", TRUE, "Flip Groups", "Flip vertex group names.");
+ RNA_def_boolean(ot->srna, "mirror_weights", TRUE, "Mirror Weights", "Mirror weights");
+ RNA_def_boolean(ot->srna, "flip_group_names", TRUE, "Flip Groups", "Flip vertex group names");
}
@@ -2102,7 +2666,7 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, "Group", "Vertex group to set as active.");
+ prop= RNA_def_enum(ot->srna, "group", vgroup_items, 0, "Group", "Vertex group to set as active");
RNA_def_enum_funcs(prop, vgroup_itemf);
ot->prop= prop;
}
@@ -2154,7 +2718,7 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op)
}
}
else {
- BKE_report(op->reports, RPT_ERROR, "Editmode lattice isnt supported yet.");
+ BKE_report(op->reports, RPT_ERROR, "Editmode lattice isnt supported yet");
MEM_freeN(sort_map_update);
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 4b0c1cb1222..74e91cf32ea 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -1526,7 +1526,7 @@ void PARTICLE_OT_select_linked(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked keys rather than selecting them.");
+ RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect linked keys rather than selecting them");
RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "", 0, 16384);
}
@@ -1713,7 +1713,7 @@ void PARTICLE_OT_hide(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
}
/*************************** reveal operator **************************/
@@ -2403,7 +2403,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
if(totremoved == 0)
return OPERATOR_CANCELLED;
- BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved);
+ BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles", totremoved);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
@@ -2579,7 +2579,7 @@ void PARTICLE_OT_delete(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys.");
+ ot->prop= RNA_def_enum(ot->srna, "type", delete_type_items, DEL_PARTICLE, "Type", "Delete a full particle or only keys");
}
/*************************** mirror operator **************************/
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index bd53de20871..11796d01620 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -594,7 +594,7 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom
}
/* if there's more than one domain, cancel */
else if (fsDomain && ob != fsDomain) {
- BKE_report(reports, RPT_ERROR, "There should be only one domain object.");
+ BKE_report(reports, RPT_ERROR, "There should be only one domain object");
return 0;
}
}
@@ -612,17 +612,17 @@ static int fluid_validate_scene(ReportList *reports, Scene *scene, Object *fsDom
fsDomain = newdomain;
if (!fsDomain) {
- BKE_report(reports, RPT_ERROR, "No domain object found.");
+ BKE_report(reports, RPT_ERROR, "No domain object found");
return 0;
}
if (channelObjCount>=255) {
- BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects.");
+ BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects");
return 0;
}
if (fluidInputCount == 0) {
- BKE_report(reports, RPT_ERROR, "No fluid input objects in the scene.");
+ BKE_report(reports, RPT_ERROR, "No fluid input objects in the scene");
return 0;
}
@@ -889,7 +889,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
/* make sure it corresponds to startFrame setting (old: noFrames = scene->r.efra - scene->r.sfra +1) */;
noFrames = scene->r.efra - 0;
if(noFrames<=0) {
- BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings.");
+ BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings");
fluidbake_free_data(channels, fobjects, fsset, fb);
return 0;
}
@@ -993,7 +993,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
if(!invert_m4_m4(invDomMat, domainMat)) {
BLI_snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n");
elbeemDebugOut(debugStrBuffer);
- BKE_report(reports, RPT_ERROR, "Invalid object matrix.");
+ BKE_report(reports, RPT_ERROR, "Invalid object matrix");
fluidbake_free_data(channels, fobjects, fsset, fb);
return 0;
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 42a163d3da5..0b350e3afd0 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -203,7 +203,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
struct Object *camera_override= v3d ? V3D_CAMERA_LOCAL(v3d) : NULL;
if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.imtype)) {
- BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected.");
+ BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected");
return OPERATOR_CANCELLED;
}
@@ -477,7 +477,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.imtype)) {
- BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected.");
+ BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 3256112426b..5a8e930e1a4 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -260,12 +260,12 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
return 0;
if(!is_view_context && scene->camera==NULL) {
- BKE_report(op->reports, RPT_ERROR, "Scene has no camera.");
+ BKE_report(op->reports, RPT_ERROR, "Scene has no camera");
return 0;
}
if(!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.imtype)) {
- BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected.");
+ BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected");
return 0;
}
@@ -611,7 +611,7 @@ void RENDER_OT_opengl(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene");
RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)");
- RNA_def_boolean(ot->srna, "view_context", 1, "View Context", "Use the current 3D view for rendering, else use scene settings.");
+ RNA_def_boolean(ot->srna, "view_context", 1, "View Context", "Use the current 3D view for rendering, else use scene settings");
}
/* function for getting an opengl buffer from a View3D, used by sequencer */
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 3aa9bef9ef8..4da1ecd8fdf 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -134,7 +134,7 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op)
/* Removing material slots in edit mode screws things up, see bug #21822.*/
if(ob == CTX_data_edit_object(C)) {
- BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode.");
+ BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode");
return OPERATOR_CANCELLED;
}
@@ -1266,7 +1266,7 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER; /* no undo since this doesnt modify the env-map */
/* properties */
- prop= RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face. Order is [+Z -Z +Y -X -Y +X]. Use -1 to skip a face.", 0.0f, 0.0f);
+ prop= RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] (use -1 to skip a face)", 0.0f, 0.0f);
RNA_def_property_flag(prop, PROP_HIDDEN);
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index d41d3245623..8951df9221e 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -43,6 +43,8 @@
#include "BLI_rand.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_screen.h"
@@ -1347,7 +1349,7 @@ void ED_area_prevspace(bContext *C, ScrArea *sa)
static const char *editortype_pup(void)
{
- return(
+ const char *types= N_(
"Editor type:%t"
"|3D View %x1"
@@ -1382,6 +1384,8 @@ static const char *editortype_pup(void)
"|Python Console %x18"
);
+
+ return UI_translate_do_iface(types);
}
static void spacefunc(struct bContext *C, void *UNUSED(arg1), void *UNUSED(arg2))
@@ -1403,8 +1407,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
but= uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D,
editortype_pup(), xco, yco, UI_UNIT_X+10, UI_UNIT_Y,
&(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0,
- "Displays current editor type. "
- "Click for menu of available types");
+ UI_translate_do_tooltip(N_("Displays current editor type. Click for menu of available types")));
uiButSetFunc(but, spacefunc, NULL, NULL);
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
@@ -1449,7 +1452,7 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco)
void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr)
{
ScrArea *sa= CTX_wm_area(C);
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiBlock *block;
PanelType *pt;
Panel *panel;
@@ -1637,7 +1640,7 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar)
void ED_region_header(const bContext *C, ARegion *ar)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiBlock *block;
uiLayout *layout;
HeaderType *ht;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 5cc42e2b6cf..a2be1e8fa6f 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1811,7 +1811,7 @@ static void SCREEN_OT_frame_jump(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* rna */
- RNA_def_boolean(ot->srna, "end", 0, "Last Frame", "Jump to the last frame of the frame range.");
+ RNA_def_boolean(ot->srna, "end", 0, "Last Frame", "Jump to the last frame of the frame range");
}
@@ -3023,7 +3023,7 @@ static void SCREEN_OT_animation_cancel(wmOperatorType *ot)
ot->poll= ED_operator_screenactive;
- RNA_def_boolean(ot->srna, "restore_frame", TRUE, "Restore Frame", "Restore the frame when animation was initialized.");
+ RNA_def_boolean(ot->srna, "restore_frame", TRUE, "Restore Frame", "Restore the frame when animation was initialized");
}
/* ************** border select operator (template) ***************************** */
@@ -3098,7 +3098,7 @@ static int fullscreen_back_exec(bContext *C, wmOperator *op)
if (sa->full) break;
}
if (!sa) {
- BKE_report(op->reports, RPT_ERROR, "No fullscreen areas were found.");
+ BKE_report(op->reports, RPT_ERROR, "No fullscreen areas were found");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 784c35ca523..eb919261127 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -5178,7 +5178,7 @@ void PAINT_OT_grab_clone(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
/* properties */
- RNA_def_float_vector(ot->srna, "delta", 2, NULL, -FLT_MAX, FLT_MAX, "Delta", "Delta offset of clone image in 0.0..1.0 coordinates.", -1.0f, 1.0f);
+ RNA_def_float_vector(ot->srna, "delta", 2, NULL, -FLT_MAX, FLT_MAX, "Delta", "Delta offset of clone image in 0.0..1.0 coordinates", -1.0f, 1.0f);
}
/******************** sample color operator ********************/
@@ -5259,7 +5259,7 @@ void PAINT_OT_sample_color(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "Cursor location in region coordinates.", 0, 16384);
+ RNA_def_int_vector(ot->srna, "location", 2, NULL, 0, INT_MAX, "Location", "Cursor location in region coordinates", 0, 16384);
}
/******************** set clone cursor operator ********************/
@@ -5309,7 +5309,7 @@ void PAINT_OT_clone_cursor_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in world space coordinates.", -10000.0f, 10000.0f);
+ RNA_def_float_vector(ot->srna, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "Cursor location in world space coordinates", -10000.0f, 10000.0f);
}
/******************** texture paint toggle operator ********************/
@@ -5334,14 +5334,14 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if (object_data_is_libdata(ob)) {
- BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata.");
+ BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata");
return OPERATOR_CANCELLED;
}
me= get_mesh(ob);
if(!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) {
- BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects.");
+ BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects");
return OPERATOR_CANCELLED;
}
@@ -5409,6 +5409,15 @@ int facemask_paint_poll(bContext *C)
return paint_facesel_test(CTX_data_active_object(C));
}
+int vert_paint_poll(bContext *C)
+{
+ return paint_vertsel_test(CTX_data_active_object(C));
+}
+
+int mask_paint_poll(bContext *C)
+{
+ return paint_facesel_test(CTX_data_active_object(C)) || paint_vertsel_test(CTX_data_active_object(C));
+}
/* use project paint to re-apply an image */
static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
{
@@ -5422,12 +5431,12 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
project_state_init(C, OBACT, &ps);
if(ps.ob==NULL || ps.ob->type != OB_MESH) {
- BKE_report(op->reports, RPT_ERROR, "No active mesh object.");
+ BKE_report(op->reports, RPT_ERROR, "No active mesh object");
return OPERATOR_CANCELLED;
}
if(image==NULL) {
- BKE_report(op->reports, RPT_ERROR, "Image could not be found.");
+ BKE_report(op->reports, RPT_ERROR, "Image could not be found");
return OPERATOR_CANCELLED;
}
@@ -5435,7 +5444,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
ps.reproject_ibuf= BKE_image_get_ibuf(image, NULL);
if(ps.reproject_ibuf==NULL || ps.reproject_ibuf->rect==NULL) {
- BKE_report(op->reports, RPT_ERROR, "Image data could not be found.");
+ BKE_report(op->reports, RPT_ERROR, "Image data could not be found");
return OPERATOR_CANCELLED;
}
@@ -5446,7 +5455,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
/* type check to make sure its ok */
if(view_data->len != PROJ_VIEW_DATA_SIZE || view_data->subtype != IDP_FLOAT) {
- BKE_report(op->reports, RPT_ERROR, "Image project data invalid.");
+ BKE_report(op->reports, RPT_ERROR, "Image project data invalid");
return OPERATOR_CANCELLED;
}
}
@@ -5459,7 +5468,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
ps.source= PROJ_SRC_IMAGE_CAM;
if(scene->camera==NULL) {
- BKE_report(op->reports, RPT_ERROR, "No active camera set.");
+ BKE_report(op->reports, RPT_ERROR, "No active camera set");
return OPERATOR_CANCELLED;
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 5a0ee19d6c9..f671b7b1713 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -122,6 +122,11 @@ void PAINT_OT_face_select_inverse(struct wmOperatorType *ot);
void PAINT_OT_face_select_hide(struct wmOperatorType *ot);
void PAINT_OT_face_select_reveal(struct wmOperatorType *ot);
+void PAINT_OT_vert_select_all(struct wmOperatorType *ot);
+void PAINT_OT_vert_select_inverse(struct wmOperatorType *ot);
+int vert_paint_poll(struct bContext *C);
+int mask_paint_poll(struct bContext *C);
+
int facemask_paint_poll(struct bContext *C);
/* stroke operator */
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 69af50415cc..287d204115c 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -373,6 +373,10 @@ void ED_operatortypes_paint(void)
WM_operatortype_append(PAINT_OT_weight_sample);
WM_operatortype_append(PAINT_OT_weight_sample_group);
+ /* vertex selection */
+ WM_operatortype_append(PAINT_OT_vert_select_all);
+ WM_operatortype_append(PAINT_OT_vert_select_inverse);
+
/* vertex */
WM_operatortype_append(PAINT_OT_vertex_paint_toggle);
WM_operatortype_append(PAINT_OT_vertex_paint);
@@ -607,6 +611,17 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0);
+
+ /*Weight paint's Vertex Selection Mode */
+ keymap= WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0);
+ keymap->poll= vert_paint_poll;
+ WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "PAINT_OT_vert_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "deselect", 1);
+ WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0);
+
/* Image/Texture Paint mode */
keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0);
keymap->poll= image_texture_paint_poll;
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 09f5c32bea0..d332dc6ec0d 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -1,3 +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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/editors/sculpt_paint/paint_utils.c
* \ingroup edsculpt
*/
@@ -358,6 +387,49 @@ void PAINT_OT_face_select_all(wmOperatorType *ot)
WM_operator_properties_select_all(ot);
}
+
+static int vert_select_all_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_active_object(C);
+ paintvert_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), TRUE);
+ ED_region_tag_redraw(CTX_wm_region(C));
+ return OPERATOR_FINISHED;
+}
+
+
+void PAINT_OT_vert_select_all(wmOperatorType *ot)
+{
+ ot->name= "Vertex Selection";
+ ot->description= "Change selection for all vertices";
+ ot->idname= "PAINT_OT_vert_select_all";
+
+ ot->exec= vert_select_all_exec;
+ ot->poll= vert_paint_poll;
+
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ WM_operator_properties_select_all(ot);
+}
+
+static int vert_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Object *ob= CTX_data_active_object(C);
+ paintvert_deselect_all_visible(ob, SEL_INVERT, TRUE);
+ ED_region_tag_redraw(CTX_wm_region(C));
+ return OPERATOR_FINISHED;
+}
+
+void PAINT_OT_vert_select_inverse(wmOperatorType *ot)
+{
+ ot->name= "Vertex Select Invert";
+ ot->description= "Invert selection of vertices";
+ ot->idname= "PAINT_OT_vert_select_inverse";
+
+ ot->exec= vert_select_inverse_exec;
+ ot->poll= vert_paint_poll;
+
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
static int face_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob= CTX_data_active_object(C);
@@ -399,7 +471,7 @@ void PAINT_OT_face_select_hide(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
}
static int face_select_reveal_exec(bContext *C, wmOperator *UNUSED(op))
@@ -421,5 +493,5 @@ void PAINT_OT_face_select_reveal(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
}
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 3da19ba7346..11a46bb373b 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -64,6 +64,7 @@
#include "RNA_enum_types.h"
#include "BKE_DerivedMesh.h"
+#include "BKE_armature.h"
#include "BKE_action.h"
#include "BKE_brush.h"
#include "BKE_context.h"
@@ -390,25 +391,27 @@ void vpaint_fill(Object *ob, unsigned int paintcol)
void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
{
Mesh *me;
- MFace *mface;
MDeformWeight *dw, *uw;
int *indexar;
- int index, vgroup;
- unsigned int faceverts[5]={0,0,0,0,0};
- unsigned char i;
- int vgroup_mirror= -1;
+ unsigned int index;
+ int vgroup, vgroup_mirror= -1;
int selected;
+ int use_vert_sel;
+
me= ob->data;
if(me==NULL || me->totface==0 || me->dvert==NULL || !me->mface) return;
selected= (me->editflag & ME_EDIT_PAINT_MASK);
+
+ use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
indexar= get_indexarray(me);
if(selected) {
- for(index=0, mface=me->mface; index<me->totface; index++, mface++) {
- if((mface->flag & ME_FACE_SEL)==0)
+ MFace *mf;
+ for(index=0, mf= me->mface; index<me->totface; index++, mf++) {
+ if((mf->flag & ME_FACE_SEL)==0)
indexar[index]= 0;
else
indexar[index]= index+1;
@@ -430,22 +433,25 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
for(index=0; index<me->totface; index++) {
if(indexar[index] && indexar[index]<=me->totface) {
- mface= me->mface + (indexar[index]-1);
- /* just so we can loop through the verts */
- faceverts[0]= mface->v1;
- faceverts[1]= mface->v2;
- faceverts[2]= mface->v3;
- faceverts[3]= mface->v4;
- for (i=0; i<3 || faceverts[i]; i++) {
- if(!((me->dvert+faceverts[i])->flag)) {
- dw= defvert_verify_index(me->dvert+faceverts[i], vgroup);
+ MFace *mf= &me->mface[indexar[index]-1];
+ unsigned int fidx= mf->v4 ? 3:2;
+
+ do {
+ unsigned int vidx= *(&mf->v1 + fidx);
+
+ if(!me->dvert[vidx].flag) {
+ if(use_vert_sel && !(me->mvert[vidx].flag & SELECT)) {
+ continue;
+ }
+
+ dw= defvert_verify_index(&me->dvert[vidx], vgroup);
if(dw) {
- uw= defvert_verify_index(wp->wpaint_prev+faceverts[i], vgroup);
+ uw= defvert_verify_index(wp->wpaint_prev+vidx, vgroup);
uw->weight= dw->weight; /* set the undo weight */
dw->weight= paintweight;
-
+
if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
- int j= mesh_get_x_mirror_vert(ob, faceverts[i]);
+ int j= mesh_get_x_mirror_vert(ob, vidx);
if(j>=0) {
/* copy, not paint again */
if(vgroup_mirror != -1) {
@@ -460,16 +466,19 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
}
}
}
- (me->dvert+faceverts[i])->flag= 1;
+ me->dvert[vidx].flag= 1;
}
- }
+
+
+ } while (fidx--);
}
}
-
- index=0;
- while (index<me->totvert) {
- (me->dvert+index)->flag= 0;
- index++;
+
+ {
+ MDeformVert *dv= me->dvert;
+ for(index= me->totvert; index != 0; index--, dv++) {
+ dv->flag= 0;
+ }
}
MEM_freeN(indexar);
@@ -792,7 +801,7 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], fl
return alpha;
}
-static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval, int flip)
+static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval, int flip, int multipaint)
{
Brush *brush = paint_brush(&wp->paint);
int tool = brush->vertexpaint_tool;
@@ -830,7 +839,10 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float
if (dw->weight > paintval)
dw->weight = paintval*alpha + dw->weight*(1.0f-alpha);
}
- CLAMP(dw->weight, 0.0f, 1.0f);
+ /* delay clamping until the end so multi-paint can function when the active group is at the limits */
+ if(multipaint == FALSE) {
+ CLAMP(dw->weight, 0.0f, 1.0f);
+ }
/* if no spray, clip result with orig weight & orig alpha */
if((wp->flag & VP_SPRAY)==0) {
@@ -857,15 +869,17 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float
else
testw = uw->weight;
}
- CLAMP(testw, 0.0f, 1.0f);
-
- if( testw<uw->weight ) {
- if(dw->weight < testw) dw->weight= testw;
- else if(dw->weight > uw->weight) dw->weight= uw->weight;
- }
- else {
- if(dw->weight > testw) dw->weight= testw;
- else if(dw->weight < uw->weight) dw->weight= uw->weight;
+
+ if(multipaint == FALSE) {
+ CLAMP(testw, 0.0f, 1.0f);
+ if( testw<uw->weight ) {
+ if(dw->weight < testw) dw->weight= testw;
+ else if(dw->weight > uw->weight) dw->weight= uw->weight;
+ }
+ else {
+ if(dw->weight > testw) dw->weight= testw;
+ else if(dw->weight < uw->weight) dw->weight= uw->weight;
+ }
}
}
@@ -980,7 +994,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA
const int totgroup= BLI_countlist(&vc.obact->defbase);
if(totgroup) {
MFace *mf= ((MFace *)me->mface) + index-1;
- int fidx= mf->v4 ? 3:2;
+ unsigned int fidx= mf->v4 ? 3:2;
int *groups= MEM_callocN(totgroup*sizeof(int), "groups");
int found= FALSE;
@@ -1062,6 +1076,7 @@ void PAINT_OT_weight_sample_group(wmOperatorType *ot)
}
+#if 0 /* UNUSED */
static void do_weight_paint_auto_normalize(MDeformVert *dvert,
int paint_nr, char *map)
{
@@ -1096,41 +1111,600 @@ 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)
+{
+// MDeformWeight *dw = dvert->dw;
+ float sum=0.0f, fac=0.0f;
+ int i, tot=0;
+
+ if (do_auto_normalize == FALSE)
+ return;
+
+ for (i=0; i<dvert->totweight; i++) {
+ if (map[dvert->dw[i].def_nr]) {
+ tot += 1;
+ sum += dvert->dw[i].weight;
+ }
+ }
+
+ if (!tot || sum == 1.0f)
+ return;
+
+ fac = sum;
+ fac = fac==0.0f ? 1.0f : 1.0f / fac;
+
+ for (i=0; i<dvert->totweight; i++) {
+ if (map[dvert->dw[i].def_nr]) {
+ dvert->dw[i].weight *= fac;
+ }
+ }
+}
+
+/*
+See if the current deform vertex has a locked group
+*/
+static char has_locked_group(MDeformVert *dvert, const char *lock_flags)
+{
+ int i;
+ for(i = 0; i < dvert->totweight; i++) {
+ if(lock_flags[dvert->dw[i].def_nr] && dvert->dw[i].weight > 0.0f) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+/*
+ * gen_lck_flags gets the status of "flag" for each bDeformGroup
+ *in ob->defbase and returns an array containing them
+ */
+static char *gen_lock_flags(Object* ob, int defbase_tot)
+{
+ char is_locked = FALSE;
+ int i;
+ //int defbase_tot = BLI_countlist(&ob->defbase);
+ char *lock_flags = MEM_mallocN(defbase_tot*sizeof(char), "defflags");
+ bDeformGroup *defgroup;
+
+ for(i = 0, defgroup = ob->defbase.first; i < defbase_tot && defgroup; defgroup = defgroup->next, i++) {
+ lock_flags[i] = ((defgroup->flag & DG_LOCK_WEIGHT) != 0);
+ is_locked |= lock_flags[i];
+ }
+ if(is_locked){
+ return lock_flags;
+ }
+
+ MEM_freeN(lock_flags);
+ return NULL;
+}
+
+static int has_locked_group_selected(int defbase_tot, char *defbase_sel, char *lock_flags)
+{
+ int i;
+ for(i = 0; i < defbase_tot; i++) {
+ if(defbase_sel[i] && lock_flags[i]) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+#if 0 /* UNUSED */
+static int has_unselected_unlocked_bone_group(int defbase_tot, char *defbase_sel, int selected, char *lock_flags, char *vgroup_validmap)
+{
+ int i;
+ if(defbase_tot == selected) {
+ return FALSE;
+ }
+ for(i = 0; i < defbase_tot; i++) {
+ if(vgroup_validmap[i] && !defbase_sel[i] && !lock_flags[i]) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+#endif
+
+
+static void multipaint_selection(MDeformVert *dvert, float change, char *defbase_sel, int defbase_tot)
+{
+ int i;
+ MDeformWeight *dw;
+ float val;
+ /* make sure they are all at most 1 after the change */
+ for(i = 0; i < defbase_tot; i++) {
+ if(defbase_sel[i]) {
+ dw = defvert_find_index(dvert, i);
+ if(dw && dw->weight) {
+ val = dw->weight * change;
+ if(val > 1) {
+ /* TODO: when the change is reduced, you need to recheck
+ * the earlier values to make sure they are not 0
+ * (precision error) */
+ change = 1.0f/dw->weight;
+ }
+ /* the value should never reach zero while multi-painting if it
+ * was nonzero beforehand */
+ if(val <= 0) {
+ return;
+ }
+ }
+ }
+ }
+ /* apply the valid change */
+ for(i = 0; i < defbase_tot; i++) {
+ if(defbase_sel[i]) {
+ dw = defvert_find_index(dvert, i);
+ if(dw && dw->weight) {
+ dw->weight = dw->weight * change;
+ }
+ }
+ }
+}
+
+/* move all change onto valid, unchanged groups. If there is change left over,
+ * then return it.
+ * assumes there are valid groups to shift weight onto */
+static float redistribute_change(MDeformVert *ndv, char *change_status, int changeme, int changeto, float totchange, float total_valid, char do_auto_normalize)
+{
+ float was_change;
+ float change;
+ float oldval;
+ MDeformWeight *ndw;
+ int i;
+ do {
+ /* assume there is no change until you see one */
+ was_change = FALSE;
+ /* change each group by the same amount each time */
+ change = totchange/total_valid;
+ for(i = 0; i < ndv->totweight && total_valid && totchange; i++) {
+ ndw = (ndv->dw+i);
+ /* change only the groups with a valid status */
+ if(change_status[ndw->def_nr] == changeme) {
+ oldval = ndw->weight;
+ /* if auto normalize is active, don't worry about upper bounds */
+ if(do_auto_normalize == FALSE && ndw->weight + change > 1) {
+ totchange -= 1-ndw->weight;
+ ndw->weight = 1;
+ /* stop the changes to this group */
+ change_status[ndw->def_nr] = changeto;
+ total_valid--;
+ }
+ else if(ndw->weight + change < 0) { /* check the lower bound */
+ totchange -= ndw->weight;
+ ndw->weight = 0;
+ change_status[ndw->def_nr] = changeto;
+ total_valid--;
+ }
+ else {/* a perfectly valid change occurred to ndw->weight */
+ totchange -= change;
+ ndw->weight += change;
+ }
+ /* see if there was a change */
+ if(oldval != ndw->weight) {
+ was_change = TRUE;
+ }
+ }
+ }
+ /* don't go again if there was no change, if there is no valid group,
+ * or there is no change left */
+ } while(was_change && total_valid && totchange);
+ /* left overs */
+ return totchange;
+}
+
+/* observe the changes made to the weights of groups.
+ * make sure all locked groups on the vertex have the same deformation
+ * by moving the changes made to groups onto other unlocked groups */
+static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defbase_tot,
+ const char *lock_flags, const char *vgroup_validmap, char do_auto_normalize)
+{
+ float totchange = 0.0f;
+ float totchange_allowed = 0.0f;
+ float left_over;
+
+ int total_valid = 0;
+ int total_changed = 0;
+ unsigned int i;
+ MDeformWeight *ndw;
+ MDeformWeight *odw;
+ MDeformWeight *ndw2;
+ MDeformWeight *odw2;
+ int designatedw = -1;
+ int designatedw_changed = FALSE;
+ float storedw;
+ char *change_status;
+ char new_weight_has_zero = FALSE;
+
+ if(!lock_flags || !has_locked_group(ndv, lock_flags)) {
+ return;
+ }
+ /* record if a group was changed, unlocked and not changed, or locked */
+ change_status = MEM_callocN(sizeof(char)*defbase_tot, "unlocked_unchanged");
+
+ for(i = 0; i < defbase_tot; i++) {
+ ndw = defvert_find_index(ndv, i);
+ odw = defvert_find_index(odv, i);
+ /* the weights are zero, so we can assume a lot */
+ if(!ndw || !odw) {
+ if (!lock_flags[i] && vgroup_validmap[i]){
+ defvert_verify_index(odv, i);
+ defvert_verify_index(ndv, i);
+ total_valid++;
+ change_status[i] = 1; /* can be altered while redistributing */
+ }
+ continue;
+ }
+ /* locked groups should not be changed */
+ if(lock_flags[i]) {
+ ndw->weight = odw->weight;
+ }
+ else if(ndw->weight != odw->weight) { /* changed groups are handled here */
+ totchange += ndw->weight - odw->weight;
+ change_status[i] = 2; /* was altered already */
+ total_changed++;
+ if(ndw->weight == 0) {
+ new_weight_has_zero = TRUE;
+ }
+ else if(designatedw == -1){
+ designatedw = i;
+ }
+ } /* unchanged, unlocked bone groups are handled here */
+ else if (vgroup_validmap[i]){
+ totchange_allowed += ndw->weight;
+ total_valid++;
+ change_status[i] = 1; /* can be altered while redistributing */
+ }
+ }
+ /* if there was any change, redistribute it */
+ if(total_changed) {
+ /* auto normalize will allow weights to temporarily go above 1 in redistribution */
+ if(vgroup_validmap && total_changed < 0 && total_valid) {
+ totchange_allowed = total_valid;
+ }
+ /* there needs to be change allowed, or you should not bother */
+ if(totchange_allowed) {
+ /* the way you modify the unlocked+unchanged groups is different depending
+ * on whether or not you are painting the weight(s) up or down */
+ if(totchange < 0) {
+ totchange_allowed = total_valid - totchange_allowed;
+ }
+ else {
+ totchange_allowed *= -1;
+ }
+ left_over = 0;
+ if(fabsf(totchange_allowed) < fabsf(totchange)) {
+ /* this amount goes back onto the changed, unlocked weights */
+ left_over = fabsf(fabsf(totchange) - fabsf(totchange_allowed));
+ if(totchange > 0) {
+ left_over *= -1;
+ }
+ }
+ else {
+ /* all of the change will be permitted */
+ totchange_allowed = -totchange;
+ }
+ /* move the weight evenly between the allowed groups, move excess back onto the used groups based on the change */
+ totchange_allowed = redistribute_change(ndv, change_status, 1, -1, totchange_allowed, total_valid, do_auto_normalize);
+ left_over += totchange_allowed;
+ if(left_over) {
+ /* more than one nonzero weights were changed with the same ratio, so keep them changed that way! */
+ if(total_changed > 1 && !new_weight_has_zero && designatedw >= 0) {
+ /* this dw is special, it is used as a base to determine how to change the others */
+ ndw = defvert_find_index(ndv, designatedw);
+ odw = defvert_find_index(odv, designatedw);
+ storedw = ndw->weight;
+ for(i = 0; i < ndv->totweight; i++) {
+ if(change_status[ndw->def_nr] == 2) {
+ odw2 = &odv->dw[i];
+ ndw2 = &ndv->dw[i];
+ if(!designatedw_changed) {
+ ndw->weight = (totchange_allowed + odw->weight + odw2->weight)/(1.0f + ndw2->weight/ndw->weight);
+ designatedw_changed = TRUE;
+ }
+ ndw2->weight = ndw->weight * ndw2->weight / storedw;
+ }
+ }
+ }
+ /* a weight was changed to zero, only one weight was changed,
+ * or designatedw is still -1 put weight back as evenly as possible */
+ else {
+ redistribute_change(ndv, change_status, 2, -2, left_over, total_changed, do_auto_normalize);
+ }
+ }
+ }
+ else {
+ /* reset the weights */
+ unsigned int i;
+ MDeformWeight *dw_old= odv->dw;
+ MDeformWeight *dw_new= ndv->dw;
+
+ for (i= odv->totweight; i != 0; i--, dw_old++, dw_new++) {
+ dw_new->weight= dw_old->weight;
+ }
+ }
+ }
+
+ MEM_freeN(change_status);
+}
-static void do_weight_paint_vertex(VPaint *wp, Object *ob, int index,
- float alpha, float paintweight, int flip,
- int vgroup_mirror, char *validmap)
+/* multi-paint's initial, potential change is computed here based on the user's stroke */
+static float get_mp_change(MDeformVert *odv, char *defbase_sel, float brush_change)
+{
+ float selwsum = 0.0f;
+ unsigned int i;
+ MDeformWeight *dw= odv->dw;
+
+ for (i= odv->totweight; i != 0; i--, dw++) {
+ if(defbase_sel[dw->def_nr]) {
+ selwsum += dw->weight;
+ }
+ }
+ if(selwsum && selwsum+brush_change > 0) {
+ return (selwsum+brush_change)/selwsum;
+ }
+ return 0.0f;
+}
+
+/* change the weights back to the wv's weights
+ * it assumes you already have the correct pointer index */
+static void reset_to_prev(MDeformVert *wv, MDeformVert *dvert)
+{
+ MDeformWeight *dw= dvert->dw;
+ MDeformWeight *w;
+ unsigned int i;
+ for (i= dvert->totweight; i != 0; i--, dw++) {
+ w= defvert_find_index(wv, dw->def_nr);
+ /* if there was no w when there is a d, then the old weight was 0 */
+ dw->weight = w ? w->weight : 0.0f;
+ }
+}
+
+static void clamp_weights(MDeformVert *dvert)
+{
+ MDeformWeight *dw= dvert->dw;
+ unsigned int i;
+ for (i= dvert->totweight; i != 0; i--, dw++) {
+ CLAMP(dw->weight, 0.0f, 1.0f);
+ }
+}
+
+/* struct to avoid passing many args each call to do_weight_paint_vertex()
+ * this _could_ be made a part of the operators 'WPaintData' struct, or at
+ * least a member, but for now keep its own struct, initialized on every
+ * paint stroke update - campbell */
+typedef struct WeightPaintInfo {
+
+ int defbase_tot;
+
+ /* both must add up to 'defbase_tot' */
+ int defbase_tot_sel;
+ int defbase_tot_unsel;
+
+ int vgroup_mirror; /* mirror group or -1 */
+
+ char *lock_flags; /* boolean array for locked bones,
+ * length of defbase_tot */
+ char *defbase_sel; /* boolean array for selected bones,
+ * length of defbase_tot */
+
+ char *vgroup_validmap; /* same as WeightPaintData.vgroup_validmap,
+ * only added here for convenience */
+
+ char do_flip;
+ char do_multipaint;
+ char do_auto_normalize;
+} WeightPaintInfo;
+
+/* fresh start to make multi-paint and locking modular */
+/* returns TRUE if it thinks you need to reset the weights due to
+ * normalizing while multi-painting */
+static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi,
+ const unsigned int index,
+ MDeformWeight *dw, MDeformWeight *tdw,
+ float change, float oldChange,
+ float oldw, float neww)
+{
+ MDeformVert *dv= &me->dvert[index];
+ MDeformVert dv_test= {NULL};
+
+ dv_test.dw= MEM_dupallocN(dv->dw);
+ dv_test.flag = dv->flag;
+ dv_test.totweight = dv->totweight;
+ /* do not multi-paint if a locked group is selected or the active group is locked
+ * !lock_flags[dw->def_nr] helps if nothing is selected, but active group is locked */
+ if( (wpi->lock_flags == NULL) ||
+ ((wpi->lock_flags[dw->def_nr] == FALSE) &&
+ has_locked_group_selected(wpi->defbase_tot, wpi->defbase_sel, wpi->lock_flags) == FALSE))
+ {
+ if(wpi->do_multipaint && wpi->defbase_tot_sel > 1) {
+ if(change && change!=1) {
+ multipaint_selection(dv, change, wpi->defbase_sel, wpi->defbase_tot);
+ }
+ }
+ else { /* this lets users paint normally, but don't let them paint locked groups */
+ dw->weight = neww;
+ }
+ }
+ clamp_weights(dv);
+
+ enforce_locks(&dv_test, dv, wpi->defbase_tot, wpi->lock_flags, wpi->vgroup_validmap, wpi->do_auto_normalize);
+
+ do_weight_paint_auto_normalize_all_groups(dv, wpi->vgroup_validmap, wpi->do_auto_normalize);
+
+ if(oldChange && wpi->do_multipaint && wpi->defbase_tot_sel > 1) {
+ if(tdw->weight != oldw) {
+ if(neww > oldw) {
+ if(tdw->weight <= oldw) {
+ MEM_freeN(dv_test.dw);
+ return TRUE;
+ }
+ }
+ else {
+ if(tdw->weight >= oldw) {
+ MEM_freeN(dv_test.dw);
+ return TRUE;
+ }
+ }
+ }
+ }
+ MEM_freeN(dv_test.dw);
+ return FALSE;
+}
+
+/* within the current dvert index, get the dw that is selected and has a weight
+ * above 0, this helps multi-paint */
+static int get_first_selected_nonzero_weight(MDeformVert *dvert, char *defbase_sel)
+{
+ int i;
+ MDeformWeight *dw= dvert->dw;
+ for(i=0; i< dvert->totweight; i++, dw++) {
+ if(defbase_sel[dw->def_nr] && dw->weight > 0.0f) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+
+static char *wpaint_make_validmap(Object *ob);
+
+
+static void do_weight_paint_vertex( /* vars which remain the same for every vert */
+ VPaint *wp, Object *ob, const WeightPaintInfo *wpi,
+ /* vars which change on each stroke */
+ const unsigned int index, float alpha, float paintweight
+ )
{
Mesh *me= ob->data;
+
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(&me->dvert[index], vgroup);
uw= defvert_find_index(wp->wpaint_prev+index, vgroup);
}
else {
- dw= defvert_verify_index(me->dvert+index, vgroup);
+ dw= defvert_verify_index(&me->dvert[index], vgroup);
uw= defvert_verify_index(wp->wpaint_prev+index, vgroup);
}
if(dw==NULL || uw==NULL)
return;
-
- wpaint_blend(wp, dw, uw, alpha, paintweight, flip);
- do_weight_paint_auto_normalize(me->dvert+index, vgroup, validmap);
- if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
- int j= mesh_get_x_mirror_vert(ob, index);
- if(j>=0) {
- /* copy, not paint again */
- if(vgroup_mirror != -1)
- uw= defvert_verify_index(me->dvert+j, vgroup_mirror);
- else
- uw= defvert_verify_index(me->dvert+j, vgroup);
-
- uw->weight= dw->weight;
+ /* 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))
+ {
+ 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) {
+ /* copy, not paint again */
+ uw= defvert_verify_index(me->dvert+j, (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : vgroup);
+
+ uw->weight= dw->weight;
- do_weight_paint_auto_normalize(me->dvert+j, vgroup, validmap);
+ do_weight_paint_auto_normalize_all_groups(me->dvert+j, wpi->vgroup_validmap, wpi->do_auto_normalize);
+ }
+ }
+ }
+ else {
+ /* use locks and/or multipaint */
+ float oldw;
+ float neww;
+ float testw=0;
+ float change = 0;
+ float oldChange = 0;
+ int i;
+ MDeformWeight *tdw = NULL, *tuw;
+ MDeformVert dv= {NULL};
+
+ oldw = dw->weight;
+ wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, wpi->do_multipaint && wpi->defbase_tot_sel >1);
+ neww = dw->weight;
+ dw->weight = oldw;
+
+ /* 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;
+ 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);
+ if(i>=0) {
+ tdw = &(me->dvert[index].dw[i]);
+ tuw = defvert_verify_index(wp->wpaint_prev+index, tdw->def_nr);
+ }
+ else {
+ change = 0;
+ }
+ }
+ if(change && tuw->weight && tuw->weight * change) {
+ if(tdw->weight != tuw->weight) {
+ oldChange = tdw->weight/tuw->weight;
+ testw = tuw->weight*change;
+ 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]);
+ }
+ else {
+ /* the old change was more significant, so set
+ * the change to 0 so that it will not do another multi-paint */
+ change = 0;
+ }
+ }
+ else {
+ if(change < oldChange) {
+ reset_to_prev(wp->wpaint_prev+index, &me->dvert[index]);
+ }
+ else {
+ change = 0;
+ }
+ }
+ }
+ }
+ else {
+ change = 0;
+ }
+ }
+ }
+
+ if(apply_mp_locks_normalize(me, wpi, index, dw, tdw, change, oldChange, oldw, neww)) {
+ reset_to_prev(&dv, &me->dvert[index]);
+ change = 0;
+ oldChange = 0;
+ }
+ if(dv.dw) {
+ MEM_freeN(dv.dw);
+ }
+ /* dvert may have been altered greatly */
+ dw = defvert_find_index(&me->dvert[index], vgroup);
+
+ if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
+ int j= mesh_get_x_mirror_vert(ob, index);
+ if(j>=0) {
+ /* copy, not paint again */
+ uw= defvert_verify_index(me->dvert+j, (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);
+ }
}
}
}
@@ -1227,16 +1801,15 @@ struct WPaintData {
/*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;
};
static char *wpaint_make_validmap(Object *ob)
{
bDeformGroup *dg;
ModifierData *md;
- char *validmap;
- bPose *pose;
- bPoseChannel *chan;
- ArmatureModifierData *amd;
+ char *vgroup_validmap;
GHash *gh = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "wpaint_make_validmap gh");
int i = 0, step1=1;
@@ -1248,7 +1821,7 @@ static char *wpaint_make_validmap(Object *ob)
if (!i)
return NULL;
- validmap = MEM_callocN(i, "wpaint valid map");
+ vgroup_validmap= MEM_callocN(i, "wpaint valid map");
/*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) {
@@ -1257,10 +1830,11 @@ static char *wpaint_make_validmap(Object *ob)
if (md->type == eModifierType_Armature)
{
- amd = (ArmatureModifierData*) md;
+ ArmatureModifierData *amd= (ArmatureModifierData*) md;
if(amd->object && amd->object->pose) {
- pose = amd->object->pose;
+ bPose *pose= amd->object->pose;
+ bPoseChannel *chan;
for (chan=pose->chanbase.first; chan; chan=chan->next) {
if (chan->bone->flag & BONE_NO_DEFORM)
@@ -1278,13 +1852,13 @@ static char *wpaint_make_validmap(Object *ob)
/*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) {
- validmap[i] = 1;
+ vgroup_validmap[i] = TRUE;
}
}
BLI_ghash_free(gh, NULL, NULL);
- return validmap;
+ return vgroup_validmap;
}
static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
@@ -1318,7 +1892,9 @@ 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;
- if (wpd->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)
wpd->vgroup_validmap = wpaint_make_validmap(ob);
// if(qual & LR_CTRLKEY) {
@@ -1385,14 +1961,19 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
float mat[4][4];
float paintweight;
int *indexar;
- int totindex, index, totw, flip;
+ int totw;
+ unsigned int index, totindex;
float alpha;
float mval[2], pressure;
-
+ int use_vert_sel;
+
+ /* intentionally dont initialize as NULL, make sure we initialize all members below */
+ WeightPaintInfo wpi;
+
/* cannot paint if there is no stroke data */
if (wpd == NULL) {
- // XXX: force a redraw here, since even though we can't paint,
- // at least view won't freeze until stroke ends
+ /* XXX: force a redraw here, since even though we can't paint,
+ * at least view won't freeze until stroke ends */
ED_region_tag_redraw(CTX_wm_region(C));
return;
}
@@ -1407,17 +1988,39 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
/* load projection matrix */
mul_m4_m4m4(mat, ob->obmat, vc->rv3d->persmat);
- flip = RNA_boolean_get(itemptr, "pen_flip");
pressure = RNA_float_get(itemptr, "pressure");
RNA_float_get_array(itemptr, "mouse", mval);
mval[0]-= vc->ar->winrct.xmin;
mval[1]-= vc->ar->winrct.ymin;
-
+
+
+
+ /* *** setup WeightPaintInfo - pass onto do_weight_paint_vertex *** */
+ wpi.defbase_tot= wpd->defbase_tot;
+ wpi.defbase_sel= MEM_mallocN(wpi.defbase_tot*sizeof(char), "wpi.defbase_sel");
+ wpi.defbase_tot_sel= get_selected_defgroups(ob, wpi.defbase_sel, wpi.defbase_tot);
+ if(wpi.defbase_tot_sel == 0 && ob->actdef) wpi.defbase_tot_sel = 1;
+ wpi.defbase_tot_unsel= wpi.defbase_tot - wpi.defbase_tot_sel;
+ wpi.vgroup_mirror= wpd->vgroup_mirror;
+ wpi.lock_flags= wpd->lock_flags;
+ 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);
+ /* *** done setting up WeightPaintInfo *** */
+
+
+
swap_m4m4(wpd->vc.rv3d->persmat, mat);
-
+
+ use_vert_sel= (me->editflag & ME_EDIT_VERT_SEL) != 0;
+
/* which faces are involved */
if(wp->flag & VP_AREA) {
+ /* Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell */
+ me->editflag &= ~ME_EDIT_VERT_SEL;
totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush_size(brush));
+ me->editflag |= use_vert_sel ? ME_EDIT_VERT_SEL : 0;
}
else {
indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]);
@@ -1460,30 +2063,40 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
for(index=0; index<totindex; index++) {
if(indexar[index] && indexar[index]<=me->totface) {
MFace *mface= me->mface + (indexar[index]-1);
-
- (me->dvert+mface->v1)->flag= 1;
- (me->dvert+mface->v2)->flag= 1;
- (me->dvert+mface->v3)->flag= 1;
- if(mface->v4) (me->dvert+mface->v4)->flag= 1;
+
+ if(use_vert_sel) {
+ me->dvert[mface->v1].flag = (me->mvert[mface->v1].flag & SELECT);
+ me->dvert[mface->v2].flag = (me->mvert[mface->v2].flag & SELECT);
+ me->dvert[mface->v3].flag = (me->mvert[mface->v3].flag & SELECT);
+ if(mface->v4) me->dvert[mface->v4].flag = (me->mvert[mface->v4].flag & SELECT);
+ }
+ else {
+ me->dvert[mface->v1].flag= 1;
+ me->dvert[mface->v2].flag= 1;
+ me->dvert[mface->v3].flag= 1;
+ if(mface->v4) me->dvert[mface->v4].flag= 1;
+ }
if(brush->vertexpaint_tool==VP_BLUR) {
MDeformWeight *dw, *(*dw_func)(MDeformVert *, const int);
+ unsigned int fidx= mface->v4 ? 3:2;
if(wp->flag & VP_ONLYVGROUP)
dw_func= (MDeformWeight *(*)(MDeformVert *, const int))defvert_find_index;
else
dw_func= defvert_verify_index;
-
- dw= dw_func(me->dvert+mface->v1, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- dw= dw_func(me->dvert+mface->v2, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- dw= dw_func(me->dvert+mface->v3, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- if(mface->v4) {
- dw= dw_func(me->dvert+mface->v4, ob->actdef-1);
- if(dw) {paintweight+= dw->weight; totw++;}
- }
+
+ do {
+ unsigned int vidx= *(&mface->v1 + fidx);
+
+ dw= dw_func(me->dvert+vidx, ob->actdef-1);
+ if(dw) {
+ paintweight+= dw->weight;
+ totw++;
+ }
+
+ } while (fidx--);
+
}
}
}
@@ -1494,52 +2107,28 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
for(index=0; index<totindex; index++) {
if(indexar[index] && indexar[index]<=me->totface) {
- MFace *mface= me->mface + (indexar[index]-1);
-
- if((me->dvert+mface->v1)->flag) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v1, mval, pressure);
- if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v1,
- alpha, paintweight, flip, wpd->vgroup_mirror,
- wpd->vgroup_validmap);
- }
- (me->dvert+mface->v1)->flag= 0;
- }
-
- if((me->dvert+mface->v2)->flag) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v2, mval, pressure);
- if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v2,
- alpha, paintweight, flip, wpd->vgroup_mirror,
- wpd->vgroup_validmap);
- }
- (me->dvert+mface->v2)->flag= 0;
- }
-
- if((me->dvert+mface->v3)->flag) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v3, mval, pressure);
- if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v3,
- alpha, paintweight, flip, wpd->vgroup_mirror,
- wpd->vgroup_validmap);
- }
- (me->dvert+mface->v3)->flag= 0;
- }
-
- if((me->dvert+mface->v4)->flag) {
- if(mface->v4) {
- alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v4, mval, pressure);
+ MFace *mf= me->mface + (indexar[index]-1);
+ unsigned int fidx= mf->v4 ? 3:2;;
+ do {
+ unsigned int vidx= *(&mf->v1 + fidx);
+
+ if(me->dvert[vidx].flag) {
+ alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*vidx, mval, pressure);
if(alpha) {
- do_weight_paint_vertex(wp, ob, mface->v4,
- alpha, paintweight, flip, wpd->vgroup_mirror,
- wpd->vgroup_validmap);
+ do_weight_paint_vertex(wp, ob, &wpi, vidx, alpha, paintweight);
}
- (me->dvert+mface->v4)->flag= 0;
+ me->dvert[vidx].flag= 0;
}
- }
+ } while (fidx--);
}
}
-
+
+
+ /* *** free wpi members */
+ MEM_freeN(wpi.defbase_sel);
+ /* *** dont freeing wpi members */
+
+
swap_m4m4(vc->rv3d->persmat, mat);
DAG_id_tag_update(ob->data, 0);
@@ -1559,7 +2148,9 @@ static void wpaint_stroke_done(bContext *C, struct PaintStroke *stroke)
if (wpd->vgroup_validmap)
MEM_freeN(wpd->vgroup_validmap);
-
+ if(wpd->lock_flags)
+ MEM_freeN(wpd->lock_flags);
+
MEM_freeN(wpd);
}
@@ -1633,7 +2224,7 @@ static int weight_paint_set_exec(bContext *C, wmOperator *UNUSED(op))
Object *obact = CTX_data_active_object(C);
wpaint_fill(scene->toolsettings->wpaint, obact, scene->toolsettings->vgroup_weight);
- ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
+ ED_region_tag_redraw(CTX_wm_region(C)); /* XXX - should redraw all 3D views */
return OPERATOR_FINISHED;
}
@@ -1645,7 +2236,7 @@ void PAINT_OT_weight_set(wmOperatorType *ot)
/* api callbacks */
ot->exec= weight_paint_set_exec;
- ot->poll= facemask_paint_poll;
+ ot->poll= mask_paint_poll; /* it was facemask_paint_poll */
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1781,12 +2372,12 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent
return 1;
}
-static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, int index, const float mval[2], float pressure, int UNUSED(flip))
+static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, const unsigned int index, const float mval[2], float pressure, int UNUSED(flip))
{
ViewContext *vc = &vpd->vc;
Brush *brush = paint_brush(&vp->paint);
Mesh *me = get_mesh(ob);
- MFace *mface= ((MFace*)me->mface) + index;
+ MFace *mface= &me->mface[index];
unsigned int *mcol= ((unsigned int*)me->mcol) + 4*index;
unsigned int *mcolorig= ((unsigned int*)vp->vpaint_prev) + 4*index;
float alpha;
@@ -1971,6 +2562,6 @@ void PAINT_OT_weight_from_bones(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Method to use for assigning weights.");
+ ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", "Method to use for assigning weights");
}
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index 60d665de94c..5b72e87f95a 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -192,8 +192,8 @@ static void SOUND_OT_open(wmOperatorType *ot)
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH);
- RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
- RNA_def_boolean(ot->srna, "mono", FALSE, "Mono", "Mixdown the sound to mono.");
+ RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory");
+ RNA_def_boolean(ot->srna, "mono", FALSE, "Mono", "Mixdown the sound to mono");
}
static void SOUND_OT_open_mono(wmOperatorType *ot)
@@ -213,8 +213,8 @@ static void SOUND_OT_open_mono(wmOperatorType *ot)
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH);
- RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
- RNA_def_boolean(ot->srna, "mono", TRUE, "Mono", "Mixdown the sound to mono.");
+ RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory");
+ RNA_def_boolean(ot->srna, "mono", TRUE, "Mono", "Mixdown the sound to mono");
}
/******************** mixdown operator ********************/
@@ -436,7 +436,7 @@ static void mixdown_draw(bContext *C, wmOperator *op)
}
#endif // WITH_AUDASPACE
-void SOUND_OT_mixdown(wmOperatorType *ot)
+static void SOUND_OT_mixdown(wmOperatorType *ot)
{
#ifdef WITH_AUDASPACE
static EnumPropertyItem format_items[] = {
@@ -496,7 +496,7 @@ void SOUND_OT_mixdown(wmOperatorType *ot)
/* properties */
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_SAVE, WM_FILESEL_FILEPATH);
#ifdef WITH_AUDASPACE
- RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy. Important for animation data. The lower the value, the more accurate.", 1, 16777216);
+ RNA_def_int(ot->srna, "accuracy", 1024, 1, 16777216, "Accuracy", "Sample accuracy, important for animation data (the lower the value, the more accurate)", 1, 16777216);
RNA_def_enum(ot->srna, "container", container_items, AUD_CONTAINER_FLAC, "Container", "File format");
RNA_def_enum(ot->srna, "codec", codec_items, AUD_CODEC_FLAC, "Codec", "Audio Codec");
RNA_def_enum(ot->srna, "format", format_items, AUD_FORMAT_S16, "Format", "Sample format");
@@ -569,7 +569,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if(G.fileflags & G_AUTOPACK)
- BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
+ BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
unpackSound(CTX_data_main(C), op->reports, sound, method);
@@ -593,7 +593,7 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
return OPERATOR_CANCELLED;
if(G.fileflags & G_AUTOPACK)
- BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
+ BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
unpack_menu(C, "SOUND_OT_unpack", sound->id.name+2, sound->name, "sounds", sound->packedfile);
@@ -616,8 +616,8 @@ static void SOUND_OT_unpack(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack.");
- RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Sound Name", "Sound datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */
+ RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
+ RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Sound Name", "Sound datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */
}
/* ******************************************************* */
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 32594e710a4..dc81fb1e8bc 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -1139,7 +1139,7 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
bAnimContext ac;
- ARegion *ar;
+ /* ARegion *ar; */ /* UNUSED */
short selectmode, column;
/* get editor data */
@@ -1147,7 +1147,7 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
return OPERATOR_CANCELLED;
/* get useful pointers from animation context data */
- ar= ac.ar;
+ /* ar= ac.ar; */ /* UNUSED */
/* select mode is either replace (deselect all, then add) or add/extend */
if (RNA_boolean_get(op->ptr, "extend"))
diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt
index 631e2adea34..a9aaf6a6d58 100644
--- a/source/blender/editors/space_buttons/CMakeLists.txt
+++ b/source/blender/editors/space_buttons/CMakeLists.txt
@@ -21,6 +21,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript
index a4270f1f59a..740353bc1f0 100644
--- a/source/blender/editors/space_buttons/SConscript
+++ b/source/blender/editors/space_buttons/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../makesrna ../../render/extern/include ../../blenloader'
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c
index e631718b0cb..b18b5373240 100644
--- a/source/blender/editors/space_buttons/buttons_header.c
+++ b/source/blender/editors/space_buttons/buttons_header.c
@@ -37,6 +37,7 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
#include "BKE_context.h"
@@ -124,24 +125,23 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
#define BUTTON_HEADER_CTX(_ctx, _icon, _tip) \
if(sbuts->pathflag & (1<<_ctx)) { \
- but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, _tip); \
+ but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, UI_translate_do_tooltip(_tip)); \
uiButClearFlag(but, UI_BUT_UNDO); \
} \
-
- BUTTON_HEADER_CTX(BCONTEXT_RENDER, ICON_SCENE, "Render")
- BUTTON_HEADER_CTX(BCONTEXT_SCENE, ICON_SCENE_DATA, "Scene");
- BUTTON_HEADER_CTX(BCONTEXT_WORLD, ICON_WORLD, "World");
- BUTTON_HEADER_CTX(BCONTEXT_OBJECT, ICON_OBJECT_DATA, "Object");
- BUTTON_HEADER_CTX(BCONTEXT_CONSTRAINT, ICON_CONSTRAINT, "Object Constraints");
- BUTTON_HEADER_CTX(BCONTEXT_MODIFIER, ICON_MODIFIER, "Object Modifiers");
- BUTTON_HEADER_CTX(BCONTEXT_DATA, sbuts->dataicon, "Object Data");
- BUTTON_HEADER_CTX(BCONTEXT_BONE, ICON_BONE_DATA, "Bone");
- BUTTON_HEADER_CTX(BCONTEXT_BONE_CONSTRAINT, ICON_CONSTRAINT_BONE, "Bone Constraints");
- BUTTON_HEADER_CTX(BCONTEXT_MATERIAL, ICON_MATERIAL, "Material");
- BUTTON_HEADER_CTX(BCONTEXT_TEXTURE, ICON_TEXTURE, "Textures");
- BUTTON_HEADER_CTX(BCONTEXT_PARTICLE, ICON_PARTICLES, "Particles");
- BUTTON_HEADER_CTX(BCONTEXT_PHYSICS, ICON_PHYSICS, "Physics");
+ BUTTON_HEADER_CTX(BCONTEXT_RENDER, ICON_SCENE, N_("Render"))
+ BUTTON_HEADER_CTX(BCONTEXT_SCENE, ICON_SCENE_DATA, N_("Scene"));
+ BUTTON_HEADER_CTX(BCONTEXT_WORLD, ICON_WORLD, N_("World"));
+ BUTTON_HEADER_CTX(BCONTEXT_OBJECT, ICON_OBJECT_DATA, N_("Object"));
+ BUTTON_HEADER_CTX(BCONTEXT_CONSTRAINT, ICON_CONSTRAINT, N_("Object Constraints"));
+ BUTTON_HEADER_CTX(BCONTEXT_MODIFIER, ICON_MODIFIER, N_("Object Modifiers"));
+ BUTTON_HEADER_CTX(BCONTEXT_DATA, sbuts->dataicon, N_("Object Data"));
+ BUTTON_HEADER_CTX(BCONTEXT_BONE, ICON_BONE_DATA, N_("Bone"));
+ BUTTON_HEADER_CTX(BCONTEXT_BONE_CONSTRAINT, ICON_CONSTRAINT_BONE, N_("Bone Constraints"));
+ BUTTON_HEADER_CTX(BCONTEXT_MATERIAL, ICON_MATERIAL, N_("Material"));
+ BUTTON_HEADER_CTX(BCONTEXT_TEXTURE, ICON_TEXTURE, N_("Textures"));
+ BUTTON_HEADER_CTX(BCONTEXT_PARTICLE, ICON_PARTICLES, N_("Particles"));
+ BUTTON_HEADER_CTX(BCONTEXT_PHYSICS, ICON_PHYSICS, N_("Physics"));
#undef BUTTON_HEADER_CTX
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 85cf30dfeba..cb2b5c47ff3 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -54,6 +54,14 @@
#include "console_intern.h"
+/* so when we type - the view scrolls to the bottom */
+static void console_scroll_bottom(ARegion *ar)
+{
+ View2D *v2d= &ar->v2d;
+ v2d->cur.ymin = 0.0;
+ v2d->cur.ymax =(float)v2d->winy;
+}
+
static void console_textview_update_rect(SpaceConsole *sc, ARegion *ar)
{
View2D *v2d= &ar->v2d;
@@ -339,9 +347,14 @@ static int move_exec(bContext *C, wmOperator *op)
}
if(done) {
- ED_area_tag_redraw(CTX_wm_area(C));
+ ScrArea *sa= CTX_wm_area(C);
+ ARegion *ar= CTX_wm_region(C);
+
+ ED_area_tag_redraw(sa);
+ console_scroll_bottom(ar);
}
-
+
+
return OPERATOR_FINISHED;
}
@@ -357,7 +370,7 @@ void CONSOLE_OT_move(wmOperatorType *ot)
ot->poll= ED_operator_console_active;
/* properties */
- RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to.");
+ RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to");
}
#define TAB_LENGTH 4
@@ -391,7 +404,9 @@ static int insert_exec(bContext *C, wmOperator *op)
console_textview_update_rect(sc, ar);
ED_area_tag_redraw(CTX_wm_area(C));
-
+
+ console_scroll_bottom(ar);
+
return OPERATOR_FINISHED;
}
@@ -427,7 +442,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot)
ot->poll= ED_operator_console_active;
/* properties */
- RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position.");
+ RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
}
@@ -478,6 +493,8 @@ static int delete_exec(bContext *C, wmOperator *op)
console_textview_update_rect(sc, ar);
ED_area_tag_redraw(CTX_wm_area(C));
+
+ console_scroll_bottom(ar);
return OPERATOR_FINISHED;
}
@@ -495,7 +512,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot)
ot->poll= ED_operator_console_active;
/* properties */
- RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete.");
+ RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete");
}
@@ -589,6 +606,8 @@ static int history_cycle_exec(bContext *C, wmOperator *op)
console_textview_update_rect(sc, ar);
ED_area_tag_redraw(CTX_wm_area(C));
+ console_scroll_bottom(ar);
+
return OPERATOR_FINISHED;
}
@@ -612,6 +631,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot)
static int history_append_exec(bContext *C, wmOperator *op)
{
SpaceConsole *sc= CTX_wm_space_console(C);
+ ARegion *ar= CTX_wm_region(C);
ScrArea *sa= CTX_wm_area(C);
ConsoleLine *ci= console_history_verify(C);
char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, dont free */
@@ -637,6 +657,8 @@ static int history_append_exec(bContext *C, wmOperator *op)
ED_area_tag_redraw(sa);
+ console_scroll_bottom(ar);
+
return OPERATOR_FINISHED;
}
@@ -652,8 +674,8 @@ void CONSOLE_OT_history_append(wmOperatorType *ot)
ot->poll= ED_operator_console_active;
/* properties */
- RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position.");
- RNA_def_int(ot->srna, "current_character", 0, 0, INT_MAX, "Cursor", "The index of the cursor.", 0, 10000);
+ RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
+ RNA_def_int(ot->srna, "current_character", 0, 0, INT_MAX, "Cursor", "The index of the cursor", 0, 10000);
RNA_def_boolean(ot->srna, "remove_duplicates", 0, "Remove Duplicates", "Remove duplicate items in the history");
}
@@ -706,8 +728,8 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
ot->poll= ED_operator_console_active;
/* properties */
- RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position.");
- RNA_def_enum(ot->srna, "type", console_line_type_items, CONSOLE_LINE_OUTPUT, "Type", "Console output type.");
+ RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
+ RNA_def_enum(ot->srna, "type", console_line_type_items, CONSOLE_LINE_OUTPUT, "Type", "Console output type");
}
@@ -825,6 +847,8 @@ static int paste_exec(bContext *C, wmOperator *UNUSED(op))
console_textview_update_rect(sc, ar);
ED_area_tag_redraw(CTX_wm_area(C));
+ console_scroll_bottom(ar);
+
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index c8fa049f5eb..5a965fc076b 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -138,8 +138,17 @@ 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 */
+
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
+ /* always keep the bottom part of the view aligned, less annoying */
+ if(prev_y_min != ar->v2d.cur.ymin) {
+ const float cur_y_range= ar->v2d.cur.ymax - ar->v2d.cur.ymin;
+ ar->v2d.cur.ymin= prev_y_min;
+ ar->v2d.cur.ymax= prev_y_min + cur_y_range;
+ }
+
/* own keymap */
keymap= WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 0080317aece..b2b734159ff 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -50,6 +50,7 @@
#include "BKE_main.h"
#include "BLF_api.h"
+#include "BLF_translation.h"
#include "IMB_imbuf_types.h"
@@ -181,7 +182,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "",
min_x, line1_y, line1_w-chan_offs, btn_h,
params->dir, 0.0, (float)FILE_MAX-1, 0, 0,
- "File path.");
+ UI_translate_do_tooltip(N_("File path")));
uiButSetCompleteFunc(but, autocomplete_directory, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
@@ -189,7 +190,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
but = uiDefBut(block, TEX, B_FS_FILENAME, "",
min_x, line2_y, line2_w-chan_offs, btn_h,
params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0,
- overwrite_alert ?"File name, overwrite existing." : "File name.");
+ UI_translate_do_tooltip(overwrite_alert ?N_("File name, overwrite existing") : N_("File name")));
uiButSetCompleteFunc(but, autocomplete_file, NULL);
uiButSetFlag(but, UI_BUT_NO_UTF8);
@@ -209,13 +210,13 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT,
min_x + line2_w + separator - chan_offs, line2_y,
btn_fn_w, btn_h,
- "Decrement the filename number");
+ UI_translate_do_tooltip(N_("Decrement the filename number")));
RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1);
but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN,
min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y,
btn_fn_w, btn_h,
- "Increment the filename number");
+ UI_translate_do_tooltip(N_("Increment the filename number")));
RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1);
uiBlockEndAlign(block);
}
@@ -226,9 +227,9 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title,
max_x - loadbutton, line1_y, loadbutton, btn_h,
params->title);
- uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, "Cancel",
+ uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, UI_translate_do_iface(N_("Cancel")),
max_x - loadbutton, line2_y, loadbutton, btn_h,
- "Cancel");
+ UI_translate_do_tooltip(N_("Cancel")));
}
uiEndBlock(C, block);
@@ -295,7 +296,7 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon,
static void file_draw_string(int sx, int sy, const char* string, float width, int height, short align)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiFontStyle fs = style->widgetlabel;
rcti rect;
char fname[FILE_MAXFILE];
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 43d5a5c9b4b..e61d7693d19 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -357,8 +357,8 @@ void FILE_OT_select(wmOperatorType *ot)
ot->poll= ED_operator_file_active;
/* rna */
- RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
- RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection.");
+ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
+ RNA_def_boolean(ot->srna, "fill", 0, "Fill", "Select everything beginning with the last selection");
}
static int file_select_all_exec(bContext *C, wmOperator *UNUSED(op))
@@ -770,7 +770,7 @@ void FILE_OT_execute(struct wmOperatorType *ot)
ot->exec= file_exec;
ot->poll= file_operator_poll;
- RNA_def_boolean(ot->srna, "need_active", 0, "Need Active", "Only execute if there's an active selected file in the file list.");
+ RNA_def_boolean(ot->srna, "need_active", 0, "Need Active", "Only execute if there's an active selected file in the file list");
}
@@ -980,7 +980,7 @@ void FILE_OT_smoothscroll(wmOperatorType *ot)
/* identifiers */
ot->name= "Smooth Scroll";
ot->idname= "FILE_OT_smoothscroll";
- ot->description="Smooth scroll to make editable file visible.";
+ ot->description="Smooth scroll to make editable file visible";
/* api callbacks */
ot->invoke= file_smoothscroll_invoke;
@@ -1020,7 +1020,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
SpaceFile *sfile= CTX_wm_space_file(C);
if(!sfile->params) {
- BKE_report(op->reports,RPT_WARNING, "No parent directory given.");
+ BKE_report(op->reports,RPT_WARNING, "No parent directory given");
return OPERATOR_CANCELLED;
}
@@ -1034,7 +1034,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
if (generate_name) {
/* create a new, non-existing folder name */
if (!new_folder_path(sfile->params->dir, path, name)) {
- BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder name.");
+ BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder name");
return OPERATOR_CANCELLED;
}
}
@@ -1043,7 +1043,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
BLI_recurdir_fileops(path);
if (!BLI_exists(path)) {
- BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder.");
+ BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 959b1ddf1b5..37dce293d77 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -37,6 +37,8 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
@@ -144,7 +146,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa)
if(sfile) {
row= uiLayoutRow(pa->layout, 0);
- uiItemO(row, "Add", ICON_ZOOMIN, "file.bookmark_add");
+ uiItemO(row, UI_translate_do_iface(N_("Add")), ICON_ZOOMIN, "file.bookmark_add");
uiItemL(row, NULL, ICON_NONE);
file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1, 0);
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 6773dfb6b2d..1e113abfcd2 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -376,7 +376,7 @@ float file_shorten_string(char* string, float w, int front)
shortened = 1;
}
if (shortened) {
- int slen = strlen(s);
+ int slen = strlen(s);
BLI_strncpy(temp+3, s, slen+1);
temp[slen+4] = '\0';
BLI_strncpy(string, temp, slen+4);
@@ -393,7 +393,7 @@ float file_shorten_string(char* string, float w, int front)
if (shortened) {
int slen = strlen(string);
if (slen > 3) {
- BLI_strncpy(string+slen-3, "...", 4);
+ BLI_strncpy(string+slen-3, "...", 4);
}
}
}
@@ -403,7 +403,7 @@ float file_shorten_string(char* string, float w, int front)
float file_string_width(const char* str)
{
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
return BLF_width(style->widget.uifont_id, str);
}
@@ -413,12 +413,12 @@ float file_font_pointsize(void)
#if 0
float s;
char tmp[2] = "X";
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
s = BLF_height(style->widget.uifont_id, tmp);
return style->widget.points;
#else
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
uiStyleFontSet(&style->widget);
return style->widget.points * UI_DPI_FAC;
#endif
diff --git a/source/blender/editors/space_graph/CMakeLists.txt b/source/blender/editors/space_graph/CMakeLists.txt
index 80205ad5564..28383b29b36 100644
--- a/source/blender/editors/space_graph/CMakeLists.txt
+++ b/source/blender/editors/space_graph/CMakeLists.txt
@@ -21,6 +21,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/space_graph/SConscript b/source/blender/editors/space_graph/SConscript
index 75d0927192b..fe8846d2c30 100644
--- a/source/blender/editors/space_graph/SConscript
+++ b/source/blender/editors/space_graph/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
+incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' #/intern/audaspace/intern ../../blenloader'
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index f3a70c496ef..28fd1cd3304 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -46,6 +46,8 @@
#include "BLI_rand.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
@@ -673,7 +675,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* remove button */
uiBlockSetEmboss(block, UI_EMBOSSN);
- but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable.");
+ but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable");
uiButSetFunc(but, driver_delete_var_cb, driver, dvar);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -750,7 +752,8 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa)
block= uiLayoutGetBlock(row);
// XXX for now, this will be a operator button which calls a 'add modifier' operator
- uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve");
+ uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, UI_translate_do_iface(N_("Add Modifier")), 10, 0, 150, 20,
+ UI_translate_do_tooltip(N_("Adds a new F-Curve Modifier for the active F-Curve")));
/* copy/paste (as sub-row)*/
row= uiLayoutRow(row, 1);
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index f115fd93c2e..90bfadd0b5a 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -1677,13 +1677,13 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op)
/* updates + finishing warnings */
if (failed == groups) {
BKE_report(op->reports, RPT_ERROR,
- "No Euler Rotations could be corrected. Ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected.");
+ "No Euler Rotations could be corrected, ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected");
return OPERATOR_CANCELLED;
}
else {
if (failed) {
BKE_report(op->reports, RPT_ERROR,
- "Some Euler Rotations couldn't be corrected due to missing/unselected/out-of-order F-Curves. Ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected.");
+ "Some Euler Rotations couldn't be corrected due to missing/unselected/out-of-order F-Curves, ensure each rotation has keys for all components, and that F-Curves for these are in consecutive XYZ order and selected");
}
/* validate keyframes after editing */
@@ -2134,7 +2134,7 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op)
if (fcm)
set_active_fmodifier(&fcu->modifiers, fcm);
else {
- BKE_report(op->reports, RPT_ERROR, "Modifier couldn't be added. See console for details.");
+ BKE_report(op->reports, RPT_ERROR, "Modifier couldn't be added, see console for details");
break;
}
}
@@ -2167,7 +2167,7 @@ void GRAPH_OT_fmodifier_add (wmOperatorType *ot)
/* id-props */
ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
- RNA_def_boolean(ot->srna, "only_active", 1, "Only Active", "Only add F-Modifier to active F-Curve.");
+ RNA_def_boolean(ot->srna, "only_active", 1, "Only Active", "Only add F-Modifier to active F-Curve");
}
/* ******************** Copy F-Modifiers Operator *********************** */
@@ -2213,7 +2213,7 @@ void GRAPH_OT_fmodifier_copy (wmOperatorType *ot)
/* identifiers */
ot->name= "Copy F-Modifiers";
ot->idname= "GRAPH_OT_fmodifier_copy";
- ot->description= "Copy the F-Modifier(s) of the active F-Curve.";
+ ot->description= "Copy the F-Modifier(s) of the active F-Curve";
/* api callbacks */
ot->exec= graph_fmodifier_copy_exec;
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 4011f038be8..71d9dd3adcb 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -510,7 +510,7 @@ static void image_pack_cb(bContext *C, void *ima_v, void *iuser_v)
else {
ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v);
if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
- // XXX error("Can't pack painted image. Save image or use Repack as PNG.");
+ // XXX error("Can't pack painted image. Save image or use Repack as PNG");
} else {
ima->packedfile = newPackedFile(NULL, ima->name); /* XXX report errors */
ED_undo_push(C, "Pack image");
@@ -587,7 +587,7 @@ static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr,
if(rr==NULL || iuser==NULL)
return;
if(rr->layers.first==NULL) {
- uiItemL(row, "No Layers in Render Result.", ICON_NONE);
+ uiItemL(row, "No Layers in Render Result", ICON_NONE);
return;
}
@@ -784,7 +784,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE);
if(ima->anim) {
block= uiLayoutGetBlock(col);
- but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence.");
+ but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence");
uiButSetFunc(but, set_frames_cb, ima, iuser);
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 68f9e4d033e..45bd1d58a53 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -303,7 +303,7 @@ void IMAGE_OT_view_pan(wmOperatorType *ot)
/* properties */
RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
- "Offset", "Offset in floating point units, 1.0 is the width and height of the image.", -FLT_MAX, FLT_MAX);
+ "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX);
}
/********************** view zoom operator *********************/
@@ -434,7 +434,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot)
/* properties */
RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX,
- "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out.", -FLT_MAX, FLT_MAX);
+ "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX);
}
/********************** NDOF operator *********************/
@@ -696,7 +696,7 @@ void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot)
/* properties */
RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
- "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX);
+ "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
}
/**************** load/replace/save callbacks ******************/
@@ -777,7 +777,7 @@ static int open_exec(bContext *C, wmOperator *op)
if(!ima) {
if(op->customdata) MEM_freeN(op->customdata);
- BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", str, errno ? strerror(errno) : "Unsupported image format");
+ BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", str, errno ? strerror(errno) : "Unsupported image format");
return OPERATOR_CANCELLED;
}
@@ -1208,7 +1208,7 @@ void IMAGE_OT_save_as(wmOperatorType *ot)
/* properties */
/* format options */
- RNA_def_enum(ot->srna, "file_format", image_file_type_items, R_PNG, "File Type", "File type to save image as.");
+ RNA_def_enum(ot->srna, "file_format", image_file_type_items, R_PNG, "File Type", "File type to save image as");
RNA_def_enum(ot->srna, "color_mode", image_color_mode_items, R_PLANES24, "Channels", "Image channels to save");
prop= RNA_def_int(ot->srna, "file_quality", 90, 0, 100, "Quality", "", 0, 100);
RNA_def_property_subtype(prop, PROP_PERCENTAGE);
@@ -1234,7 +1234,7 @@ static int save_exec(bContext *C, wmOperator *op)
save_image_doit(C, sima, op, &simopts, FALSE);
}
else {
- BKE_reportf(op->reports, RPT_ERROR, "Can not save image, path '%s' is not writable.", simopts.filepath);
+ BKE_reportf(op->reports, RPT_ERROR, "Can not save image, path '%s' is not writable", simopts.filepath);
return OPERATOR_CANCELLED;
}
@@ -1269,12 +1269,12 @@ static int save_sequence_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if(sima->image->source!=IMA_SRC_SEQUENCE) {
- BKE_report(op->reports, RPT_ERROR, "Can only save sequence on image sequences.");
+ BKE_report(op->reports, RPT_ERROR, "Can only save sequence on image sequences");
return OPERATOR_CANCELLED;
}
if(sima->image->type==IMA_TYPE_MULTILAYER) {
- BKE_report(op->reports, RPT_ERROR, "Can't save multilayer sequences.");
+ BKE_report(op->reports, RPT_ERROR, "Can't save multilayer sequences");
return OPERATOR_CANCELLED;
}
@@ -1284,7 +1284,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op)
tot++;
if(tot==0) {
- BKE_report(op->reports, RPT_WARNING, "No images have been changed.");
+ BKE_report(op->reports, RPT_WARNING, "No images have been changed");
return OPERATOR_CANCELLED;
}
@@ -1306,7 +1306,7 @@ static int save_sequence_exec(bContext *C, wmOperator *op)
BLI_path_abs(name, bmain->name);
if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) {
- BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s.", name);
+ BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s", name);
break;
}
@@ -1450,14 +1450,14 @@ void IMAGE_OT_new(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME-2, "Name", "Image datablock name.");
- RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width.", 1, 16384);
- RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height.", 1, 16384);
- prop= RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color.", 0.0f, 1.0f);
+ RNA_def_string(ot->srna, "name", "untitled", MAX_ID_NAME-2, "Name", "Image datablock name");
+ RNA_def_int(ot->srna, "width", 1024, 1, INT_MAX, "Width", "Image width", 1, 16384);
+ RNA_def_int(ot->srna, "height", 1024, 1, INT_MAX, "Height", "Image height", 1, 16384);
+ prop= RNA_def_float_color(ot->srna, "color", 4, NULL, 0.0f, FLT_MAX, "Color", "Default fill color", 0.0f, 1.0f);
RNA_def_property_float_array_default(prop, default_color);
- RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel.");
- RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing.");
- RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth.");
+ RNA_def_boolean(ot->srna, "alpha", 1, "Alpha", "Create an image with an alpha channel");
+ RNA_def_boolean(ot->srna, "uv_test_grid", 0, "UV Test Grid", "Fill the image with a grid for UV map testing");
+ RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth");
}
/********************* invert operators *********************/
@@ -1558,7 +1558,7 @@ static int pack_test(bContext *C, wmOperator *op)
return 0;
if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) {
- BKE_report(op->reports, RPT_ERROR, "Packing movies or image sequences not supported.");
+ BKE_report(op->reports, RPT_ERROR, "Packing movies or image sequences not supported");
return 0;
}
@@ -1575,7 +1575,7 @@ static int pack_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if(!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
- BKE_report(op->reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG.");
+ BKE_report(op->reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG");
return OPERATOR_CANCELLED;
}
@@ -1627,7 +1627,7 @@ void IMAGE_OT_pack(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "as_png", 0, "Pack As PNG", "Pack image as lossless PNG.");
+ RNA_def_boolean(ot->srna, "as_png", 0, "Pack As PNG", "Pack image as lossless PNG");
}
/********************* unpack operator *********************/
@@ -1649,12 +1649,12 @@ static int image_unpack_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) {
- BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported.");
+ BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
return OPERATOR_CANCELLED;
}
if(G.fileflags & G_AUTOPACK)
- BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
+ BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
/* XXX unpackImage frees image buffers */
ED_preview_kill_jobs(C);
@@ -1677,12 +1677,12 @@ static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
return OPERATOR_CANCELLED;
if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) {
- BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported.");
+ BKE_report(op->reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
return OPERATOR_CANCELLED;
}
if(G.fileflags & G_AUTOPACK)
- BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
+ BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
unpack_menu(C, "IMAGE_OT_unpack", ima->id.name+2, ima->name, "textures", ima->packedfile);
@@ -1704,8 +1704,8 @@ void IMAGE_OT_unpack(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack.");
- RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Image Name", "Image datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */
+ RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
+ RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Image Name", "Image datablock name to unpack"); /* XXX, weark!, will fail with library, name collisions */
}
/******************** sample image operator ********************/
@@ -2049,7 +2049,7 @@ void IMAGE_OT_curves_point_set(wmOperatorType *ot)
ot->poll= space_image_main_area_poll;
/* properties */
- RNA_def_enum(ot->srna, "point", point_items, 0, "Point", "Set black point or white point for curves.");
+ RNA_def_enum(ot->srna, "point", point_items, 0, "Point", "Set black point or white point for curves");
}
/******************** record composite operator *********************/
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index afab4ede229..e345caf1359 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -595,7 +595,7 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
tf = EM_get_active_mtface(em, NULL, NULL, 1); /* partially selected face is ok */
- if(tf && (tf->mode & TF_TEX)) {
+ if(tf) {
/* don't need to check for pin here, see above */
sima->image= tf->tpage;
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index e09565d38e9..6c5a6f78e90 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -151,7 +151,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
count = countPackedFiles(bmain);
if(!count) {
- BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled.");
+ BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled");
G.fileflags &= ~G_AUTOPACK;
return OPERATOR_CANCELLED;
}
@@ -186,7 +186,7 @@ void FILE_OT_unpack_all(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack.");
+ RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack");
}
/********************* make paths relative operator *********************/
@@ -196,7 +196,7 @@ static int make_paths_relative_exec(bContext *C, wmOperator *op)
Main *bmain= CTX_data_main(C);
if(!G.relbase_valid) {
- BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file.");
+ BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file");
return OPERATOR_CANCELLED;
}
@@ -228,7 +228,7 @@ static int make_paths_absolute_exec(bContext *C, wmOperator *op)
Main *bmain= CTX_data_main(C);
if(!G.relbase_valid) {
- BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file.");
+ BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file");
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index c8bda434227..d0a80cddf56 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -160,7 +160,7 @@ void INFO_OT_select_pick(wmOperatorType *ot)
/* ot->flag= OPTYPE_REGISTER; */
/* properties */
- RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "The index of the report.", 0, INT_MAX);
+ RNA_def_int(ot->srna, "report_index", 0, 0, INT_MAX, "Report", "The index of the report", 0, INT_MAX);
}
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index bd2e8077eab..75e13b24ede 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -41,6 +41,8 @@
#include "BLI_rand.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_screen.h"
@@ -278,7 +280,7 @@ static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu)
uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath);
}
} else {
- uiItemL(layout, "No Recent Files", ICON_NONE);
+ uiItemL(layout, UI_translate_do_iface(N_("No Recent Files")), ICON_NONE);
}
}
diff --git a/source/blender/editors/space_logic/CMakeLists.txt b/source/blender/editors/space_logic/CMakeLists.txt
index 44471902040..c4f9f49c9a1 100644
--- a/source/blender/editors/space_logic/CMakeLists.txt
+++ b/source/blender/editors/space_logic/CMakeLists.txt
@@ -22,6 +22,7 @@
set(INC
../include
../interface
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index 60e9595b77a..b7f9af09348 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -43,6 +43,7 @@
#include "BKE_context.h"
#include "BKE_main.h"
#include "BKE_sca.h"
+#include "BKE_material.h" //for texface convert
#include "ED_logic.h"
#include "ED_object.h"
@@ -57,6 +58,11 @@
#include "logic_intern.h"
+// temporary new includes for texface functions
+#include "DNA_mesh_types.h"
+#include "DNA_material_types.h"
+#include "DNA_meshdata_types.h"
+
/* ************* Generic Operator Helpers ************* */
static int edit_sensor_poll(bContext *C)
{
@@ -687,6 +693,36 @@ static void LOGIC_OT_actuator_move(wmOperatorType *ot)
RNA_def_enum(ot->srna, "direction", logicbricks_move_direction, 1, "Direction", "Move Up or Down");
}
+/* ************* TexFace Converter Operator ************* */
+static int texface_convert_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Main *bmain= CTX_data_main(C);
+ do_version_tface(bmain, 0);
+
+ return OPERATOR_FINISHED;
+}
+
+static int texface_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+{
+ return texface_convert_exec(C, op);
+}
+
+ static void LOGIC_OT_texface_convert(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "TexFace to Material Converter";
+ ot->description = "Convert old texface settings into material. It may create new materials if needed";
+ ot->idname= "LOGIC_OT_texface_convert";
+
+ /* api callbacks */
+ ot->invoke= texface_convert_invoke;
+ ot->exec= texface_convert_exec;
+// ot->poll= texface_convert_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
void ED_operatortypes_logic(void)
{
@@ -699,4 +735,5 @@ void ED_operatortypes_logic(void)
WM_operatortype_append(LOGIC_OT_actuator_remove);
WM_operatortype_append(LOGIC_OT_actuator_add);
WM_operatortype_append(LOGIC_OT_actuator_move);
+ WM_operatortype_append(LOGIC_OT_texface_convert);
}
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 43a8747e942..3a4371e8bb9 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -2169,31 +2169,55 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo
/* reset this value, it is for handling the event */
sa->sndnr = 0;
uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, "");
- uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19, "Load a sound file. Remember to set caching on for small sounds that are played often.");
+ uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19,
+ "Load a sound file (remember to set caching on for small sounds that are played often)");
if(sa->sound) {
- char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
- uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19, ((ID *)sa->sound)->name+2, 0.0, 21.0, 0, 0, "");
- uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound");
- uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound");
- uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space.");
+ char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|"
+ "Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
+ uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19,
+ ((ID *)sa->sound)->name+2, 0.0, 21.0, 0, 0, "");
+ uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19,
+ &sa->type, 0.0, 0.0, 0, 0, "");
+ uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume,
+ 0.0, 1.0, 0, 0, "Sets the volume of this sound");
+ uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0,
+ 12.0, 0, 0, "Sets the pitch of this sound");
+ uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19,
+ &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space");
if(sa->flag & ACT_SND_3D_SOUND)
{
- uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, "The minimum gain of the sound, no matter how far it is away.");
- uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19, &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0, "The maximum gain of the sound, no matter how near it is.");
- uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, &sa->sound3D.reference_distance, 0.0, FLT_MAX, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0.");
- uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, &sa->sound3D.max_distance, 0.0, FLT_MAX, 0.0, 0.0, "The maximum distance at which you can hear the sound.");
- uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance.");
- uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19, &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0, "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value and the normal gain in the inner cone.");
- uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval, 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the outer cone.");
- uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval, 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the inner cone.");
+ uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19,
+ &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0,
+ "The minimum gain of the sound, no matter how far it is away");
+ uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19,
+ &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0,
+ "The maximum gain of the sound, no matter how near it is");
+ uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19,
+ &sa->sound3D.reference_distance, 0.0, FLT_MAX, 0.0, 0.0,
+ "The reference distance is the distance where the sound has a gain of 1.0");
+ uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19,
+ &sa->sound3D.max_distance, 0.0, FLT_MAX, 0.0, 0.0,
+ "The maximum distance at which you can hear the sound");
+ uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19,
+ &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0,
+ "The rolloff factor defines the influence factor on volume depending on distance");
+ uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19,
+ &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0,
+ "The gain outside the outer cone. The gain in the outer cone will be "
+ "interpolated between this value and the normal gain in the inner cone");
+ uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval,
+ 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0,
+ "The angle of the outer cone");
+ uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval,
+ 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0,
+ "The angle of the inner cone");
}
}
MEM_freeN((void *)str);
}
else {
- uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file.");
+ uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file");
}
yco-= ysize;
@@ -4524,7 +4548,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* ****************** Controllers ****************** */
xco= 420; yco= 170; width= 300;
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
+ layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
row = uiLayoutRow(layout, 1);
uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
@@ -4627,7 +4651,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* ****************** Sensors ****************** */
xco= 10; yco= 170; width= 340;
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
+ layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
row = uiLayoutRow(layout, 1);
uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
@@ -4693,7 +4717,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
/* ****************** Actuators ****************** */
xco= 800; yco= 170; width= 340;
- layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, U.uistyles.first);
+ layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, xco, yco, width, 20, UI_GetStyle());
row = uiLayoutRow(layout, 1);
uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco, 300, UI_UNIT_Y, ""); /* replace this with uiLayout stuff later */
diff --git a/source/blender/editors/space_nla/CMakeLists.txt b/source/blender/editors/space_nla/CMakeLists.txt
index b05d157365d..819e80d7b2e 100644
--- a/source/blender/editors/space_nla/CMakeLists.txt
+++ b/source/blender/editors/space_nla/CMakeLists.txt
@@ -21,6 +21,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/space_nla/SConscript b/source/blender/editors/space_nla/SConscript
index 51ce829ed8d..6738f3380b4 100644
--- a/source/blender/editors/space_nla/SConscript
+++ b/source/blender/editors/space_nla/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
+incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader'
env.BlenderLib ( 'bf_editors_space_nla', sources, Split(incs), [], libtype=['core'], priority=[85] )
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index 87c8a6d39a6..d51a6a4c9a9 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -45,6 +45,8 @@
#include "BLI_editVert.h"
#include "BLI_rand.h"
+#include "BLF_translation.h"
+
#include "BKE_nla.h"
#include "BKE_context.h"
#include "BKE_screen.h"
@@ -447,7 +449,8 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa)
// XXX for now, this will be a operator button which calls a temporary 'add modifier' operator
// FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected)
- uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Modifier for the active NLA Strip");
+ uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, UI_translate_do_iface(N_("Add Modifier")), 10, 0, 150, 20,
+ UI_translate_do_tooltip(N_("Adds a new F-Modifier for the active NLA Strip")));
/* copy/paste (as sub-row)*/
row= uiLayoutRow(row, 1);
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 80691aceb6a..7cbe5058190 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -431,7 +431,7 @@ void NLA_OT_tracks_add (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "above_selected", 0, "Above Selected", "Add a new NLA Track above every existing selected one.");
+ RNA_def_boolean(ot->srna, "above_selected", 0, "Above Selected", "Add a new NLA Track above every existing selected one");
}
/* ******************** Delete Tracks Operator ***************************** */
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 08026e8a1d2..d7dfea0b7e7 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -147,7 +147,7 @@ static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_ACTCHANGE, NULL);
}
else {
- BKE_report(op->reports, RPT_ERROR, "No active strip(s) to enter tweakmode on.");
+ BKE_report(op->reports, RPT_ERROR, "No active strip(s) to enter tweakmode on");
return OPERATOR_CANCELLED;
}
@@ -398,7 +398,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
act= BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action"));
if (act == NULL) {
- BKE_report(op->reports, RPT_ERROR, "No valid Action to add.");
+ BKE_report(op->reports, RPT_ERROR, "No valid Action to add");
//printf("Add strip - actname = '%s' \n", actname);
return OPERATOR_CANCELLED;
}
@@ -416,7 +416,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
items= ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
if (items == 0) {
- BKE_report(op->reports, RPT_ERROR, "No active track(s) to add strip to.");
+ BKE_report(op->reports, RPT_ERROR, "No active track(s) to add strip to");
return OPERATOR_CANCELLED;
}
@@ -590,7 +590,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
else {
- BKE_report(op->reports, RPT_ERROR, "Needs at least a pair of adjacent selected strips with a gap between them.");
+ BKE_report(op->reports, RPT_ERROR, "Needs at least a pair of adjacent selected strips with a gap between them");
return OPERATOR_CANCELLED;
}
}
@@ -1315,7 +1315,7 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op)
if (strip) {
/* too many selected warning */
BKE_reportf(op->reports, RPT_WARNING,
- "Too many clusters of strips selected in NLA Track (%s). Needs exactly 2 to be selected.",
+ "Too many clusters of strips selected in NLA Track (%s): needs exactly 2 to be selected",
nlt->name);
}
else if (sa == NULL) {
@@ -1324,7 +1324,7 @@ static int nlaedit_swap_exec (bContext *C, wmOperator *op)
else if (sb == NULL) {
/* too few selected warning */
BKE_reportf(op->reports, RPT_WARNING,
- "Too few clusters of strips selected in NLA Track (%s). Needs exactly 2 to be selected.",
+ "Too few clusters of strips selected in NLA Track (%s): needs exactly 2 to be selected",
nlt->name);
}
else {
@@ -1619,7 +1619,7 @@ void NLA_OT_action_sync_length (wmOperatorType *ot)
/* identifiers */
ot->name= "Sync Action Length";
ot->idname= "NLA_OT_action_sync_length";
- ot->description= "Synchronise the length of the referenced Action with the lengths used in the strip";
+ ot->description= "Synchronise the length of the referenced Action with the length used in the strip";
/* api callbacks */
ot->exec= nlaedit_sync_actlen_exec;
@@ -1629,7 +1629,7 @@ void NLA_OT_action_sync_length (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- ot->prop= RNA_def_boolean(ot->srna, "active", 1, "Active Strip Only", "Only sync the active length for the active strip.");
+ ot->prop= RNA_def_boolean(ot->srna, "active", 1, "Active Strip Only", "Only sync the active length for the active strip");
}
/* ******************** Apply Scale Operator ***************************** */
@@ -2021,7 +2021,7 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
set_active_fmodifier(&strip->modifiers, fcm);
else {
BKE_reportf(op->reports, RPT_ERROR,
- "Modifier couldn't be added to (%s : %s). See console for details.",
+ "Modifier couldn't be added to (%s : %s) (see console for details)",
nlt->name, strip->name);
}
}
@@ -2042,7 +2042,7 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot)
/* identifiers */
ot->name= "Add F-Modifier";
ot->idname= "NLA_OT_fmodifier_add";
- ot->description= "Add F-Modifier of the specified type to the selected NLA-Strips";
+ ot->description= "Add a F-Modifier of the specified type to the selected NLA-Strips";
/* api callbacks */
ot->invoke= nla_fmodifier_add_invoke;
@@ -2054,7 +2054,7 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot)
/* id-props */
ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
- RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add F-Modifier of the specified type to the active strip.");
+ RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add a F-Modifier of the specified type to the active strip");
}
/* ******************** Copy F-Modifiers Operator *********************** */
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index e9b45da6bce..05d38a63109 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -479,7 +479,7 @@ void NLA_OT_select_leftright (wmOperatorType *ot)
/* identifiers */
ot->name= "Select Left/Right";
ot->idname= "NLA_OT_select_leftright";
- ot->description= "Select strips to the left or the right of the current frame ";
+ ot->description= "Select strips to the left or the right of the current frame";
/* api callbacks */
ot->invoke= nlaedit_select_leftright_invoke;
@@ -606,8 +606,8 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, const int mval[2],
static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
bAnimContext ac;
- Scene *scene;
- ARegion *ar;
+ /* Scene *scene; */ /* UNUSED */
+ /* ARegion *ar; */ /* UNUSED */
// View2D *v2d; /*UNUSED*/
short selectmode;
@@ -616,8 +616,8 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
return OPERATOR_CANCELLED;
/* get useful pointers from animation context data */
- scene= ac.scene;
- ar= ac.ar;
+ /* scene= ac.scene; */ /* UNUSED */
+ /* ar= ac.ar; */ /* UNUSED */
// v2d= &ar->v2d;
/* select mode is either replace (deselect all, then add) or add/extend */
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index cd521f7e8c7..f34cef4d2aa 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -179,6 +179,7 @@ static void node_socket_button_color(const bContext *C, uiBlock *block,
/* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */
+#if 0 /* UNUSED */
static void node_draw_socket_new(bNodeSocket *sock, float size)
{
float x=sock->locx, y=sock->locy;
@@ -216,6 +217,7 @@ static void node_draw_socket_new(bNodeSocket *sock, float size)
glDisable( GL_LINE_SMOOTH );
glDisable(GL_BLEND);
}
+#endif
/* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */
@@ -894,14 +896,14 @@ static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v)
Main *bmain= CTX_data_main(C);
bNodeTree *ntree= ntree_v;
bNode *node= node_v;
- ID *oldid;
+ /* ID *oldid; */ /* UNUSED */
if(node->menunr<1) return;
if(node->id) {
node->id->us--;
}
- oldid= node->id;
+ /* oldid= node->id; */ /* UNUSED */
node->id= BLI_findlink(&bmain->text, node->menunr-1);
id_us_plus(node->id);
BLI_strncpy(node->name, node->id->name+2, sizeof(node->name));
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index c1b114d5436..e713ed5a678 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -303,7 +303,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
layout= uiBlockLayout(node->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
- locx+NODE_DYS, dy, node->butr.xmax, NODE_DY, U.uistyles.first);
+ locx+NODE_DYS, dy, node->butr.xmax, NODE_DY, UI_GetStyle());
node->typeinfo->uifunc(layout, (bContext *)C, &ptr);
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 5f58f540aae..7cb8351cd12 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -757,6 +757,8 @@ void ED_node_update_hierarchy(bContext *UNUSED(C), bNodeTree *ntree)
/* ***************** generic operator functions for nodes ***************** */
+#if 0 /* UNUSED */
+
static int edit_node_poll(bContext *C)
{
return ED_operator_node_active(C);
@@ -815,6 +817,7 @@ static void edit_node_properties_get(wmOperator *op, bNodeTree *ntree, bNode **r
if (rin_out)
*rin_out = in_out;
}
+#endif
/* ***************** Edit Group operator ************* */
@@ -902,7 +905,7 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op)
char name[32]= "";
int type= SOCK_FLOAT;
bNodeTree *ngroup= snode->edittree;
- bNodeSocket *sock;
+ /* bNodeSocket *sock; */ /* UNUSED */
ED_preview_kill_jobs(C);
@@ -918,7 +921,7 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* using placeholder subtype first */
- sock = node_group_add_socket(ngroup, name, type, in_out);
+ /* sock = */ /* UNUSED */ node_group_add_socket(ngroup, name, type, in_out);
ntreeUpdateTree(ngroup);
@@ -983,7 +986,7 @@ void NODE_OT_group_socket_remove(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Remove Group Socket";
- ot->description = "Removed node group socket";
+ ot->description = "Remove a node group socket";
ot->idname = "NODE_OT_group_socket_remove";
/* api callbacks */
@@ -3462,7 +3465,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ima= BKE_add_image_file(path);
if(!ima) {
- BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s.", path, errno ? strerror(errno) : "Unsupported image format");
+ BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", path, errno ? strerror(errno) : "Unsupported image format");
return OPERATOR_CANCELLED;
}
}
@@ -3473,7 +3476,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ima= (Image *)find_id("IM", name);
if(!ima) {
- BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found.", name);
+ BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found", name);
return OPERATOR_CANCELLED;
}
}
@@ -3491,7 +3494,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
node = node_add_node(snode, bmain, scene, &ntemp, snode->mx, snode->my);
if (!node) {
- BKE_report(op->reports, RPT_WARNING, "Could not add an image node.");
+ BKE_report(op->reports, RPT_WARNING, "Could not add an image node");
return OPERATOR_CANCELLED;
}
@@ -3534,7 +3537,7 @@ void NODE_OT_add_file(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH); //XXX TODO, relative_path
- RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign.");
+ RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Datablock name to assign");
}
/********************** New node tree operator *********************/
diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c
index 7077f4a7497..996e05afdef 100644
--- a/source/blender/editors/space_node/node_header.c
+++ b/source/blender/editors/space_node/node_header.c
@@ -44,6 +44,8 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_screen.h"
@@ -216,6 +218,7 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
}
}
+#define IFACE_(msgid) UI_translate_do_iface(msgid)
static void node_menu_add(const bContext *C, Menu *menu)
{
SpaceNode *snode= CTX_wm_space_node(C);
@@ -225,39 +228,40 @@ static void node_menu_add(const bContext *C, Menu *menu)
uiLayoutSetActive(layout, 0);
if(snode->treetype==NTREE_SHADER) {
- uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
- uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
- uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
- uiItemMenuF(layout, "Vector", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
- uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
- uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
- uiItemMenuF(layout, "Dynamic", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
- uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
+ uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+ uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+ uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+ uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
+ uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+ uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
+ uiItemMenuF(layout, IFACE_(N_("Dynamic")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
+ uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
}
else if(snode->treetype==NTREE_COMPOSIT) {
- uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
- uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
- uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
- uiItemMenuF(layout, "Vector", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
- uiItemMenuF(layout, "Filter", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER));
- uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
- uiItemMenuF(layout, "Matte", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE));
- uiItemMenuF(layout, "Distort", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
- uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
- uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
+ uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+ uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+ uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+ uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
+ uiItemMenuF(layout, IFACE_(N_("Filter")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER));
+ uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+ uiItemMenuF(layout, IFACE_(N_("Matte")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE));
+ uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
+ uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
+ uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
}
else if(snode->treetype==NTREE_TEXTURE) {
- uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
- uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
- uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
- uiItemMenuF(layout, "Patterns", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN));
- uiItemMenuF(layout, "Textures", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
- uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
- uiItemMenuF(layout, "Distort", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
- uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
- uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
+ uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+ uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+ uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+ uiItemMenuF(layout, IFACE_(N_("Patterns")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN));
+ uiItemMenuF(layout, IFACE_(N_("Textures")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
+ uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+ uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
+ uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
+ uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
}
}
+#undef IFACE_
void node_menus_register(void)
{
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 3d8b1676ea5..e2b0b9c65d0 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -109,7 +109,7 @@ static int node_select_exec(bContext *C, wmOperator *op)
ARegion *ar= CTX_wm_region(C);
int mval[2];
short extend;
- bNode *node= NULL;
+ /* bNode *node= NULL; */ /* UNUSED */
/* get settings from RNA properties for operator */
mval[0] = RNA_int_get(op->ptr, "mouse_x");
@@ -118,7 +118,7 @@ static int node_select_exec(bContext *C, wmOperator *op)
extend = RNA_boolean_get(op->ptr, "extend");
/* perform the select */
- node= node_mouse_select(bmain, snode, ar, mval, extend);
+ /* node= */ /* UNUSED*/ node_mouse_select(bmain, snode, ar, mval, extend);
/* send notifiers */
WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
@@ -141,7 +141,7 @@ void NODE_OT_select(wmOperatorType *ot)
/* identifiers */
ot->name= "Select";
ot->idname= "NODE_OT_select";
- ot->description= "Select node under cursor";
+ ot->description= "Select the node under the cursor";
/* api callbacks */
ot->invoke= node_select_invoke;
@@ -379,7 +379,7 @@ void NODE_OT_select_same_type(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Same Type";
- ot->description = "Select all the same type";
+ ot->description = "Select all the nodes of the same type";
ot->idname = "NODE_OT_select_same_type";
/* api callbacks */
@@ -409,7 +409,7 @@ void NODE_OT_select_same_type_next(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Same Type Next";
- ot->description = "Select the next node of the same type.";
+ ot->description = "Select the next node of the same type";
ot->idname = "NODE_OT_select_same_type_next";
/* api callbacks */
@@ -436,7 +436,7 @@ void NODE_OT_select_same_type_prev(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select Same Type Prev";
- ot->description = "Select the prev node of the same type.";
+ ot->description = "Select the prev node of the same type";
ot->idname = "NODE_OT_select_same_type_prev";
/* api callbacks */
diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c
index c4567bea648..13a5f3cb3dc 100644
--- a/source/blender/editors/space_node/node_state.c
+++ b/source/blender/editors/space_node/node_state.c
@@ -214,12 +214,11 @@ void NODE_OT_visibility_toggle(wmOperatorType *ot)
static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode* snode)
{
bNode *node;
- rctf *cur, *tot;
+ rctf *cur;
float oldwidth, oldheight, width, height;
int first= 1;
cur= &ar->v2d.cur;
- tot= &ar->v2d.tot;
oldwidth= cur->xmax - cur->xmin;
oldheight= cur->ymax - cur->ymin;
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 6172273f7e1..6bfe370d105 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -213,7 +213,7 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot)
ot->poll= ED_operator_outliner_active;
- RNA_def_boolean(ot->srna, "all", 1, "All", "Close or open all items.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Close or open all items");
}
/* Rename --------------------------------------------------- */
@@ -669,7 +669,7 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot)
ot->poll= ED_operator_outliner_active;
/* properties */
- RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page.");
+ RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page");
}
/* Search ------------------------------------------------------- */
@@ -869,7 +869,7 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot)
/* no undo or registry, UI option */
/* properties */
- RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep.");
+ RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep");
}
/* Show Hierarchy ----------------------------------------------- */
@@ -969,7 +969,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
ListBase hierarchy = {NULL, NULL};
LinkData *ld;
TreeElement *tem, *temnext, *temsub;
- TreeStoreElem *tse, *tsenext;
+ TreeStoreElem *tse /* , *tsenext */ /* UNUSED */;
PointerRNA *ptr, *nextptr;
PropertyRNA *prop;
char *newpath=NULL;
@@ -1018,7 +1018,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle
char buf[128], *name;
temnext= (TreeElement*)(ld->next->data);
- tsenext= TREESTORE(temnext);
+ /* tsenext= TREESTORE(temnext); */ /* UNUSED */
nextptr= &temnext->rnaptr;
name= RNA_struct_name_get_alloc(nextptr, buf, sizeof(buf));
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index a88625aad0d..42fe14cd59c 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -867,7 +867,7 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
ot->poll= ED_operator_outliner_active;
- RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection for activation.");
+ RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection for activation");
}
/* ****************************************************** */
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index efbfbd51fb5..78907fbd1ed 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -899,7 +899,7 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
act= BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action"));
if (act == NULL) {
- BKE_report(op->reports, RPT_ERROR, "No valid Action to add.");
+ BKE_report(op->reports, RPT_ERROR, "No valid Action to add");
return OPERATOR_CANCELLED;
}
else if (act->idroot == 0) {
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 0a1f7a3599d..9fe0ed0543f 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1151,7 +1151,7 @@ static int need_add_seq_dup(Sequence *seq)
static void outliner_add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index)
{
- TreeElement *ch;
+ /* TreeElement *ch; */ /* UNUSED */
Sequence *p;
p= seq;
@@ -1162,7 +1162,7 @@ static void outliner_add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *t
}
if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
- ch= outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
+ /* ch= */ /* UNUSED */ outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
p= p->next;
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 2fe16b3a85d..b390b7dbdb5 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -464,7 +464,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot)
WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_RELPATH|WM_FILESEL_FILES);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
- RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
+ RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory");
}
/* add image operator */
@@ -647,7 +647,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
if(seq->plugin==NULL) {
BLI_remlink(ed->seqbasep, seq);
seq_free_sequence(scene, seq);
- BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load.", path);
+ BKE_reportf(op->reports, RPT_ERROR, "Sequencer plugin \"%s\" could not load", path);
return OPERATOR_CANCELLED;
}
} else if (seq->type == SEQ_COLOR) {
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index c3165adaf49..bd93a1270f6 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1161,7 +1161,7 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips");
}
@@ -1208,7 +1208,7 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips");
}
@@ -1386,7 +1386,7 @@ void SEQUENCER_OT_reassign_inputs(struct wmOperatorType *ot)
/* identifiers */
ot->name= "Reassign Inputs";
ot->idname= "SEQUENCER_OT_reassign_inputs";
- ot->description="Reassign the inputs for the effects strip";
+ ot->description="Reassign the inputs for the effect strip";
/* api callbacks */
ot->exec= sequencer_reassign_inputs_exec;
@@ -1422,7 +1422,7 @@ void SEQUENCER_OT_swap_inputs(struct wmOperatorType *ot)
/* identifiers */
ot->name= "Swap Inputs";
ot->idname= "SEQUENCER_OT_swap_inputs";
- ot->description="Swap the first two inputs for the effects strip";
+ ot->description="Swap the first two inputs for the effect strip";
/* api callbacks */
ot->exec= sequencer_swap_inputs_exec;
@@ -1483,9 +1483,13 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
sort_seq(scene);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
-
- return OPERATOR_FINISHED;
+ if(changed) {
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
}
@@ -1801,7 +1805,7 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot)
/* identifiers */
ot->name= "Separate Images";
ot->idname= "SEQUENCER_OT_images_separate";
- ot->description="On image sequences strips, it return a strip for each image";
+ ot->description="On image sequence strips, it returns a strip for each image";
/* api callbacks */
ot->exec= sequencer_separate_images_exec;
@@ -2154,7 +2158,7 @@ void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot)
/* properties */
RNA_def_float(ot->srna, "ratio", 1.0f, 0.0f, FLT_MAX,
- "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX);
+ "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
}
@@ -2483,7 +2487,7 @@ void SEQUENCER_OT_swap(wmOperatorType *ot)
/* identifiers */
ot->name= "Swap Strip";
ot->idname= "SEQUENCER_OT_swap";
- ot->description="Swap active strip with strip to the left";
+ ot->description="Swap active strip with strip to the right or left";
/* api callbacks */
ot->exec= sequencer_swap_exec;
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 86b28f5e89e..a6cc65017bb 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -519,11 +519,11 @@ void SEQUENCER_OT_select(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection.");
- RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip.");
+ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend the selection");
+ RNA_def_boolean(ot->srna, "linked_handle", 0, "Linked Handle", "Select handles next to the active strip");
/* for animation this is an enum but atm having an enum isnt useful for us */
- RNA_def_boolean(ot->srna, "left_right", 0, "Left/Right", "select based on the frame side the cursor is on.");
- RNA_def_boolean(ot->srna, "linked_time", 0, "Linked Time", "Select other strips at the same time.");
+ RNA_def_boolean(ot->srna, "left_right", 0, "Left/Right", "Select based on the current frame side the cursor is on");
+ RNA_def_boolean(ot->srna, "linked_time", 0, "Linked Time", "Select other strips at the same time");
}
@@ -627,7 +627,7 @@ static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op))
void SEQUENCER_OT_select_less(wmOperatorType *ot)
{
/* identifiers */
- ot->name= "Select less";
+ ot->name= "Select Less";
ot->idname= "SEQUENCER_OT_select_less";
ot->description="Shrink the current selection of adjacent selected strips";
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 5a0369ef80b..5c2013ee863 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -223,11 +223,11 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa)
WM_event_remove_handlers((bContext*)C, &ar_preview->handlers);
view_changed= 1;
}
- if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) {
+ if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
ar_main->alignment= RGN_ALIGN_NONE;
view_changed= 1;
}
- if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) {
+ if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
ar_preview->alignment= RGN_ALIGN_NONE;
view_changed= 1;
}
@@ -245,11 +245,11 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa)
ar_preview->v2d.cur = ar_preview->v2d.tot;
view_changed= 1;
}
- if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) {
+ if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
ar_main->alignment= RGN_ALIGN_NONE;
view_changed= 1;
}
- if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) {
+ if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) {
ar_preview->alignment= RGN_ALIGN_NONE;
view_changed= 1;
}
@@ -266,7 +266,7 @@ static void sequencer_refresh(const bContext *C, ScrArea *sa)
ar_preview->v2d.cur = ar_preview->v2d.tot;
view_changed= 1;
}
- if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) {
+ if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) {
ar_main->alignment= RGN_ALIGN_NONE;
view_changed= 1;
}
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 3d49bc7ffa0..685b15aed50 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1291,7 +1291,7 @@ static void draw_documentation(SpaceText *st, ARegion *ar)
TextLine *tmp;
char *docs, buf[DOC_WIDTH+1], *p;
int i, br, lines;
- int boxw, boxh, l, x, y, top;
+ int boxw, boxh, l, x, y /* , top */ /* UNUSED */;
if(!st || !st->text) return;
if(!texttool_text_is_active(st->text)) return;
@@ -1314,7 +1314,7 @@ static void draw_documentation(SpaceText *st, ARegion *ar)
x += SUGG_LIST_WIDTH*st->cwidth + 50;
}
- top= y= ar->winy - st->lheight*l - 2;
+ /* top= */ /* UNUSED */ y= ar->winy - st->lheight*l - 2;
boxw= DOC_WIDTH*st->cwidth + 20;
boxh= (DOC_HEIGHT+1)*st->lheight;
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 617bbf62e92..8d40550961f 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -458,7 +458,7 @@ static void txt_write_file(Text *text, ReportList *reports)
fp= fopen(filepath, "w");
if(fp==NULL) {
- BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error writing file");
+ BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error writing file");
return;
}
@@ -477,7 +477,7 @@ static void txt_write_file(Text *text, ReportList *reports)
}
else {
text->mtime= 0;
- BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error starrng file");
+ BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error starrng file");
}
if(text->flags & TXT_ISDIRTY)
@@ -819,7 +819,7 @@ void TEXT_OT_paste(wmOperatorType *ot)
ot->poll= text_edit_poll;
/* properties */
- RNA_def_boolean(ot->srna, "selection", 0, "Selection", "Paste text selected elsewhere rather than copied, X11 only.");
+ RNA_def_boolean(ot->srna, "selection", 0, "Selection", "Paste text selected elsewhere rather than copied (X11 only)");
}
/******************* copy operator *********************/
@@ -1214,7 +1214,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot)
ot->poll= text_edit_poll;
/* properties */
- RNA_def_enum(ot->srna, "type", whitespace_type_items, TO_SPACES, "type", "Type of whitespace to convert to.");
+ RNA_def_enum(ot->srna, "type", whitespace_type_items, TO_SPACES, "Type", "Type of whitespace to convert to");
}
/******************* select all operator *********************/
@@ -1907,7 +1907,7 @@ void TEXT_OT_move(wmOperatorType *ot)
ot->poll= text_edit_poll;
/* properties */
- RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to.");
+ RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to");
}
/******************* move select operator ********************/
@@ -1931,7 +1931,7 @@ void TEXT_OT_move_select(wmOperatorType *ot)
ot->poll= text_space_edit_poll;
/* properties */
- RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection.");
+ RNA_def_enum(ot->srna, "type", move_type_items, LINE_BEGIN, "Type", "Where to move cursor to, to make a selection");
}
/******************* jump operator *********************/
@@ -1974,7 +1974,7 @@ void TEXT_OT_jump(wmOperatorType *ot)
ot->poll= text_edit_poll;
/* properties */
- RNA_def_int(ot->srna, "line", 1, 1, INT_MAX, "Line", "Line number to jump to.", 1, 10000);
+ RNA_def_int(ot->srna, "line", 1, 1, INT_MAX, "Line", "Line number to jump to", 1, 10000);
}
/******************* delete operator **********************/
@@ -2026,7 +2026,7 @@ void TEXT_OT_delete(wmOperatorType *ot)
ot->poll= text_edit_poll;
/* properties */
- RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete.");
+ RNA_def_enum(ot->srna, "type", delete_type_items, DEL_NEXT_CHAR, "Type", "Which part of the text to delete");
}
/******************* toggle overwrite operator **********************/
@@ -2263,7 +2263,7 @@ void TEXT_OT_scroll(wmOperatorType *ot)
ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
/* properties */
- RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100);
+ RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100);
}
/******************** scroll bar operator *******************/
@@ -2345,7 +2345,7 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot)
ot->flag= OPTYPE_BLOCKING;
/* properties */
- RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100);
+ RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll", -100, 100);
}
/******************* set selection operator **********************/
@@ -2636,7 +2636,7 @@ void TEXT_OT_selection_set(wmOperatorType *ot)
ot->poll= text_region_edit_poll;
/* properties */
- RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor.");
+ RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor");
}
/******************* set cursor operator **********************/
@@ -2820,7 +2820,7 @@ void TEXT_OT_insert(wmOperatorType *ot)
ot->poll= text_edit_poll;
/* properties */
- RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position.");
+ RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position");
}
/******************* find operator *********************/
@@ -3169,7 +3169,7 @@ void TEXT_OT_resolve_conflict(wmOperatorType *ot)
ot->poll= save_poll;
/* properties */
- RNA_def_enum(ot->srna, "resolution", resolution_items, RESOLVE_IGNORE, "Resolution", "How to solve conflict due to different in internal and external text.");
+ RNA_def_enum(ot->srna, "resolution", resolution_items, RESOLVE_IGNORE, "Resolution", "How to solve conflict due to differences in internal and external text");
}
/********************** to 3d object operator *****************/
@@ -3199,7 +3199,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "split_lines", 0, "Split Lines", "Create one object per line in the text.");
+ RNA_def_boolean(ot->srna, "split_lines", 0, "Split Lines", "Create one object per line in the text");
}
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 6e02ecbd5a8..b6e76885719 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -64,6 +64,7 @@
#include "GPU_buffers.h"
#include "GPU_extensions.h"
#include "GPU_draw.h"
+#include "GPU_material.h"
#include "ED_mesh.h"
@@ -207,44 +208,71 @@ static Material *give_current_material_or_def(Object *ob, int matnr)
return ma?ma:&defmaterial;
}
-static int set_draw_settings_cached(int clearcache, int textured, MTFace *texface, int lit, Object *litob, int litmatnr, int doublesided)
+/* Icky globals, fix with userdata parameter */
+
+static struct TextureDrawState {
+ Object *ob;
+ int islit, istex;
+ int color_profile;
+ unsigned char obcol[4];
+} Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}};
+
+static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *ma, struct TextureDrawState gtexdraw)
{
+ static Material *c_ma;
static int c_textured;
- static int c_lit;
- static int c_doublesided;
static MTFace *c_texface;
- static Object *c_litob;
- static int c_litmatnr;
+ static int c_backculled;
static int c_badtex;
+ static int c_lit;
+ Object *litob = NULL; //to get mode to turn off mipmap in painting mode
+ int backculled = 0;
+ int alphablend = 0;
+ int textured = 0;
+ int lit = 0;
+
if (clearcache) {
- c_textured= c_lit= c_doublesided= -1;
+ c_textured= c_lit= c_backculled= -1;
c_texface= (MTFace*) -1;
- c_litob= (Object*) -1;
- c_litmatnr= -1;
c_badtex= 0;
+ } else {
+ textured = gtexdraw.istex;
+ litob = gtexdraw.ob;
+ }
+
+ /* convert number of lights into boolean */
+ if (gtexdraw.islit) lit = 1;
+
+ if (ma) {
+ alphablend = ma->game.alpha_blend;
+ if (ma->mode & MA_SHLESS) lit = 0;
+ backculled = ma->game.flag & GEMAT_BACKCULL;
}
if (texface) {
- lit = lit && (lit==-1 || texface->mode&TF_LIGHT);
- textured = textured && (texface->mode&TF_TEX);
- doublesided = texface->mode&TF_TWOSIDE;
- } else {
- textured = 0;
+ textured = textured && (texface->tpage);
+
+ /* no material, render alpha if texture has depth=32 */
+ if (!ma && BKE_image_has_alpha(texface->tpage))
+ alphablend = GPU_BLEND_ALPHA;
}
- if (doublesided!=c_doublesided) {
- if (doublesided) glDisable(GL_CULL_FACE);
- else glEnable(GL_CULL_FACE);
+ else
+ textured = 0;
+
+ if (backculled!=c_backculled) {
+ if (backculled) glEnable(GL_CULL_FACE);
+ else glDisable(GL_CULL_FACE);
- c_doublesided= doublesided;
+ c_backculled= backculled;
}
if (textured!=c_textured || texface!=c_texface) {
if (textured ) {
- c_badtex= !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT));
+ c_badtex= !GPU_set_tpage(texface, !(litob->mode & OB_MODE_TEXTURE_PAINT), alphablend);
} else {
- GPU_set_tpage(NULL, 0);
+ GPU_set_tpage(NULL, 0, 0);
c_badtex= 0;
}
c_textured= textured;
@@ -252,10 +280,10 @@ static int set_draw_settings_cached(int clearcache, int textured, MTFace *texfac
}
if (c_badtex) lit= 0;
- if (lit!=c_lit || litob!=c_litob || litmatnr!=c_litmatnr) {
+ if (lit!=c_lit || ma!=c_ma) {
if (lit) {
- Material *ma= give_current_material_or_def(litob, litmatnr+1);
float spec[4];
+ if (!ma)ma= give_current_material_or_def(NULL, 0); //default material
spec[0]= ma->spec*ma->specr;
spec[1]= ma->spec*ma->specg;
@@ -273,22 +301,11 @@ static int set_draw_settings_cached(int clearcache, int textured, MTFace *texfac
glDisable(GL_COLOR_MATERIAL);
}
c_lit= lit;
- c_litob= litob;
- c_litmatnr= litmatnr;
}
return c_badtex;
}
-/* Icky globals, fix with userdata parameter */
-
-static struct TextureDrawState {
- Object *ob;
- int islit, istex;
- int color_profile;
- unsigned char obcol[4];
-} Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}};
-
static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob)
{
unsigned char obcol[4];
@@ -318,14 +335,14 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
Gtexdraw.istex = istex;
Gtexdraw.color_profile = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
memcpy(Gtexdraw.obcol, obcol, sizeof(obcol));
- set_draw_settings_cached(1, 0, NULL, Gtexdraw.islit, NULL, 0, 0);
+ set_draw_settings_cached(1, NULL, NULL, Gtexdraw);
glShadeModel(GL_SMOOTH);
}
static void draw_textured_end(void)
{
/* switch off textures */
- GPU_set_tpage(NULL, 0);
+ GPU_set_tpage(NULL, 0, 0);
glShadeModel(GL_FLAT);
glDisable(GL_CULL_FACE);
@@ -347,18 +364,22 @@ static void draw_textured_end(void)
static int draw_tface__set_draw_legacy(MTFace *tface, MCol *mcol, int matnr)
{
- if (tface && (tface->mode&TF_INVISIBLE)) return 0;
+ Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
+ int validtexture=0;
+
+ if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0;
+
+ validtexture = set_draw_settings_cached(0, tface, ma, Gtexdraw);
- if (tface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE)) {
+ if (tface && validtexture) {
glColor3ub(0xFF, 0x00, 0xFF);
return 2; /* Don't set color */
- } else if (tface && tface->mode&TF_OBCOL) {
+ } else if (ma && ma->shade_flag&MA_OBCOLOR) {
glColor3ubv(Gtexdraw.obcol);
return 2; /* Don't set color */
} else if (!mcol) {
if (tface) glColor3f(1.0, 1.0, 1.0);
else {
- Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
if(ma) {
float col[3];
if(Gtexdraw.color_profile) linearrgb_to_srgb_v3_v3(col, &ma->r);
@@ -375,9 +396,11 @@ static int draw_tface__set_draw_legacy(MTFace *tface, MCol *mcol, int matnr)
}
static int draw_tface__set_draw(MTFace *tface, MCol *mcol, int matnr)
{
- if (tface && (tface->mode&TF_INVISIBLE)) return 0;
+ Material *ma= give_current_material(Gtexdraw.ob, matnr+1);
+
+ if (ma && (ma->game.flag & GEMAT_INVISIBLE)) return 0;
- if (tface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE)) {
+ if (tface && set_draw_settings_cached(0, tface, ma, Gtexdraw)) {
return 2; /* Don't set color */
} else if (tface && tface->mode&TF_OBCOL) {
return 2; /* Don't set color */
@@ -399,7 +422,9 @@ static void add_tface_color_layer(DerivedMesh *dm)
finalCol = MEM_mallocN(sizeof(MCol)*4*dm->getNumFaces(dm),"add_tface_color_layer");
for(i=0;i<dm->getNumFaces(dm);i++) {
- if (tface && (tface->mode&TF_INVISIBLE)) {
+ Material *ma= give_current_material(Gtexdraw.ob, mface[i].mat_nr+1);
+
+ if (ma && (ma->game.flag&GEMAT_INVISIBLE)) {
if( mcol )
memcpy(&finalCol[i*4],&mcol[i*4],sizeof(MCol)*4);
else
@@ -409,7 +434,7 @@ static void add_tface_color_layer(DerivedMesh *dm)
finalCol[i*4+j].r = 255;
}
}
- else if (tface && mface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, mface[i].mat_nr, TF_TWOSIDE)) {
+ else if (tface && mface && set_draw_settings_cached(0, tface, ma, Gtexdraw)) {
for(j=0;j<4;j++) {
finalCol[i*4+j].b = 255;
finalCol[i*4+j].g = 0;
@@ -494,10 +519,13 @@ static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmoot
{
Mesh *me = (Mesh*)userData;
- if ( (me->mface && me->mface[index].flag & ME_HIDE) ||
- (me->mtface && (me->mtface[index].mode & TF_INVISIBLE))
- ) {
- return 0;
+ if (me->mface) {
+ short matnr= me->mface[index].mat_nr;
+ Material *ma= me->mat[matnr];
+
+ if (ma && (ma->game.flag & GEMAT_INVISIBLE)) {
+ return 0;
+ }
}
*drawSmooth_r = 1;
@@ -523,17 +551,18 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
if(ob->mode & OB_MODE_EDIT)
return;
else if(ob==OBACT)
- if(paint_facesel_test(ob))
+ if(paint_facesel_test(ob) || paint_vertsel_test(ob))
return;
ddm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH);
for(a=0, mf=mface; a<totface; a++, tface++, mf++) {
- int mode= tface->mode;
- int matnr= mf->mat_nr;
+ short matnr= mf->mat_nr;
int mf_smooth= mf->flag & ME_SMOOTH;
+ Material *mat = me->mat[matnr];
+ int mode= mat->game.flag;
- if (!(mf->flag&ME_HIDE) && !(mode&TF_INVISIBLE) && (mode&TF_BMFONT)) {
+ if (!(mode&GEMAT_INVISIBLE) && (mode&GEMAT_TEXT)) {
float v1[3], v2[3], v3[3], v4[3];
char string[MAX_PROPSTRING];
int characters, i, glattrib= -1, badtex= 0;
@@ -549,7 +578,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
}
}
else {
- badtex = set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE);
+ badtex = set_draw_settings_cached(0, tface, mat, Gtexdraw);
if (badtex) {
if (mcol) mcol+=4;
continue;
@@ -578,7 +607,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
glNormal3fv(nor);
}
- GPU_render_text(tface, tface->mode, string, characters,
+ GPU_render_text(tface, mode, string, characters,
(unsigned int*)mcol, v1, v2, v3, (mf->v4? v4: NULL), glattrib);
}
if (mcol) {
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 0e8e6cdfee1..44d68ded679 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -220,16 +220,13 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt)
return (scene->gm.matmode == GAME_MAT_GLSL) && (dt > OB_SOLID);
}
-static int check_material_alpha(Base *base, Mesh *me, int glsl)
+static int check_material_alpha(Base *base, int glsl)
{
if(base->flag & OB_FROMDUPLI)
return 0;
if(G.f & G_PICKSEL)
return 0;
-
- if(me->edit_mesh)
- return 0;
return (glsl || (base->object->dtx & OB_DRAWTRANSP));
}
@@ -1740,6 +1737,31 @@ void mesh_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, EditVe
dm->release(dm);
}
+/* draw callback */
+static void drawSelectedVertices__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
+{
+ MVert *mv = &((MVert *)userData)[index];
+
+ if(!(mv->flag & ME_HIDE)) {
+ const char sel= mv->flag & SELECT;
+
+ // TODO define selected color
+ if(sel) {
+ glColor3f(1.0f, 1.0f, 0.0f);
+ }
+ else {
+ glColor3f(0.0f, 0.0f, 0.0f);
+ }
+
+ glVertex3fv(co);
+ }
+}
+
+static void drawSelectedVertices(DerivedMesh *dm, Mesh *me) {
+ glBegin(GL_POINTS);
+ dm->foreachMappedVert(dm, drawSelectedVertices__mapFunc, me->mvert);
+ glEnd();
+}
static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0co, float *v1co)
{
struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); void *userData; ViewContext vc; int clipVerts; } *data = userData;
@@ -2924,7 +2946,16 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
bglPolygonOffset(rv3d->dist, 0.0);
}
}
-
+
+ if(paint_vertsel_test(ob)) {
+
+ glColor3f(0.0f, 0.0f, 0.0f);
+ glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
+
+ drawSelectedVertices(dm, ob->data);
+
+ glPointSize(1.0f);
+ }
dm->release(dm);
}
@@ -2964,12 +2995,16 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
scene->customdata_mask);
if(dt>OB_WIRE) {
- // no transp in editmode, the fancy draw over goes bad then
glsl = draw_glsl_material(scene, ob, v3d, dt);
- GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
+ check_alpha = check_material_alpha(base, glsl);
+
+ GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl,
+ (check_alpha)? &do_alpha_pass: NULL);
}
- draw_em_fancy(scene, v3d, rv3d, ob, em, cageDM, finalDM, dt);
+ // transp in editmode makes the fancy draw over go bad
+ if (!do_alpha_pass)
+ draw_em_fancy(scene, v3d, rv3d, ob, em, cageDM, finalDM, dt);
GPU_end_object_materials();
@@ -2980,7 +3015,7 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
/* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */
if(me->totface<=4 || ED_view3d_boundbox_clip(rv3d, ob->obmat, (ob->bb)? ob->bb: me->bb)) {
glsl = draw_glsl_material(scene, ob, v3d, dt);
- check_alpha = check_material_alpha(base, me, glsl);
+ check_alpha = check_material_alpha(base, glsl);
if(dt==OB_SOLID || glsl) {
GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl,
@@ -4022,7 +4057,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if(draw_as==PART_DRAW_PATH){
ParticleCacheKey **cache, *path;
- float *cd2=NULL,*cdata2=NULL;
+ float /* *cd2=NULL, */ /* UNUSED */ *cdata2=NULL;
/* setup gl flags */
if (1) { //ob_dt > OB_WIRE) {
@@ -4090,7 +4125,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if(cdata2)
MEM_freeN(cdata2);
- cd2=cdata2=NULL;
+ /* cd2= */ /* UNUSED */ cdata2=NULL;
glLineWidth(1.0f);
@@ -6516,6 +6551,32 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* ***************** BACKBUF SEL (BBS) ********* */
+static void bbs_obmode_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
+{
+ struct {void* offset; MVert *mvert;} *data = userData;
+ MVert *mv = &data->mvert[index];
+ int offset = (intptr_t) data->offset;
+
+ if (!(mv->flag & ME_HIDE)) {
+ WM_set_framebuffer_index_color(offset+index);
+ bglVertex3fv(co);
+ }
+}
+
+static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset)
+{
+ struct {void* offset; struct MVert *mvert;} data;
+ Mesh *me = ob->data;
+ MVert *mvert = me->mvert;
+ data.mvert = mvert;
+ data.offset = (void*)(intptr_t) offset;
+ glPointSize( UI_GetThemeValuef(TH_VERTEX_SIZE) );
+ bglBegin(GL_POINTS);
+ dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data);
+ bglEnd();
+ glPointSize(1.0);
+}
+
static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
{
int offset = (intptr_t) userData;
@@ -6614,6 +6675,17 @@ static int bbs_mesh_solid_hide__setDrawOpts(void *userData, int index, int *UNUS
}
}
+// must have called WM_set_framebuffer_index_color beforehand
+static int bbs_mesh_solid_hide2__setDrawOpts(void *userData, int index, int *UNUSED(drawSmooth_r))
+{
+ Mesh *me = userData;
+
+ if (!(me->mface[index].flag & ME_HIDE)) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
static void bbs_mesh_solid(Scene *scene, Object *ob)
{
DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
@@ -6672,7 +6744,21 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
EM_free_index_arrays();
}
else {
- bbs_mesh_solid(scene, ob);
+ Mesh *me= ob->data;
+ if(me->editflag & ME_EDIT_VERT_SEL) {
+ DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
+ glColor3ub(0, 0, 0);
+
+ dm->drawMappedFaces(dm, bbs_mesh_solid_hide2__setDrawOpts, me, 0, GPU_enable_material, NULL);
+
+
+ bbs_obmode_mesh_verts(ob, dm, 1);
+ em_vertoffs = me->totvert+1;
+ dm->release(dm);
+ }
+ else {
+ bbs_mesh_solid(scene, ob);
+ }
}
break;
case OB_CURVE:
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 8da6f49e089..e87ace19edb 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -183,7 +183,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
float viewnormal[3];
int i, j, n, good_index;
- float d, d0, dd, ds;
+ float d /*, d0 */ /* UNUSED */, dd, ds;
float *points = NULL;
int numpoints = 0;
float cor[3] = {1.,1.,1.};
@@ -390,7 +390,8 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
// (a,b,c), the plane normal, are given by viewdir
// d is the parameter along the view direction. the first d is given by
// inserting previously found vertex into the plane equation
- d0 = (viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]);
+
+ /* d0 = (viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]); */ /* UNUSED */
ds = (ABS(viewnormal[0])*size[0] + ABS(viewnormal[1])*size[1] + ABS(viewnormal[2])*size[2]);
dd = 0.05; // ds/512.0f;
n = 0;
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 6833dec2e43..c46b6b6d70b 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -371,6 +371,10 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
keymap= WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
+
+ keymap= WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
+ WM_event_add_keymap_handler(&ar->handlers, keymap);
+
/* pose is not modal, operator poll checks for this */
keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 761de836cfb..0854f9f3685 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1097,7 +1097,7 @@ void VIEW3D_OT_ndof_orbit(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "NDOF Orbit View";
- ot->description = "Explore every angle of an object using the 3D mouse.";
+ ot->description = "Explore every angle of an object using the 3D mouse";
ot->idname = "VIEW3D_OT_ndof_orbit";
/* api callbacks */
@@ -1196,7 +1196,7 @@ void VIEW3D_OT_ndof_pan(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "NDOF Pan View";
- ot->description = "Position your viewpoint with the 3D mouse.";
+ ot->description = "Position your viewpoint with the 3D mouse";
ot->idname = "VIEW3D_OT_ndof_pan";
/* api callbacks */
@@ -2242,7 +2242,7 @@ void VIEW3D_OT_view_center_cursor(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Center View to Cursor";
- ot->description= "Centers the view so that the cursor is in the middle of the view";
+ ot->description= "Center the view so that the cursor is in the middle of the view";
ot->idname= "VIEW3D_OT_view_center_cursor";
/* api callbacks */
@@ -2346,7 +2346,7 @@ void VIEW3D_OT_render_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Render Border";
- ot->description = "Set the boundaries of the border render and enables border render ";
+ ot->description = "Set the boundaries of the border render and enables border render";
ot->idname= "VIEW3D_OT_render_border";
/* api callbacks */
@@ -2573,7 +2573,7 @@ static EnumPropertyItem prop_view_items[] = {
{RV3D_VIEW_RIGHT, "RIGHT", 0, "Right", "View From the Right"},
{RV3D_VIEW_TOP, "TOP", 0, "Top", "View From the Top"},
{RV3D_VIEW_BOTTOM, "BOTTOM", 0, "Bottom", "View From the Bottom"},
- {RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active amera"},
+ {RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active camera"},
{0, NULL, 0, NULL, NULL}};
@@ -2786,7 +2786,7 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
ot->flag= 0;
RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "The Type of view");
- RNA_def_boolean(ot->srna, "align_active", 0, "Align Active", "Align to the active objects axis");
+ RNA_def_boolean(ot->srna, "align_active", 0, "Align Active", "Align to the active object's axis");
}
static EnumPropertyItem prop_view_orbit_items[] = {
@@ -3013,7 +3013,7 @@ void VIEW3D_OT_background_image_add(wmOperatorType *ot)
ot->flag = 0;
/* properties */
- RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign.");
+ RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign");
RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
}
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 78dcf6c9a5c..0776ca752a9 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -47,6 +47,8 @@
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_effect.h"
@@ -269,16 +271,29 @@ void VIEW3D_OT_layers(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "toggle", 1, "Toggle", "Toggle the layer");
}
+static int modeselect_addmode(char *str, const char *title, int id, int icon)
+{
+ static char formatstr[] = "|%s %%x%d %%i%d";
+
+ if(UI_translate_iface())
+ return sprintf(str, formatstr, BLF_gettext(title), id, icon);
+ else
+ return sprintf(str, formatstr, title, id, icon);
+}
+
static char *view3d_modeselect_pup(Scene *scene)
{
Object *ob= OBACT;
static char string[256];
- static char formatstr[] = "|%s %%x%d %%i%d";
+ const char *title= N_("Mode: %%t");
char *str = string;
- str += sprintf(str, "Mode: %%t");
+ if(U.transopts&USER_TR_IFACE)
+ title= BLF_gettext(title);
+
+ sprintf(str, title);
- str += sprintf(str, formatstr, "Object Mode", OB_MODE_OBJECT, ICON_OBJECT_DATA);
+ str += modeselect_addmode(str, N_("Object Mode"), OB_MODE_OBJECT, ICON_OBJECT_DATA);
if(ob==NULL || ob->data==NULL) return string;
if(ob->id.lib) return string;
@@ -289,31 +304,31 @@ static char *view3d_modeselect_pup(Scene *scene)
|| (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT)
|| (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) {
- str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
+ str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
else if (ob->type == OB_ARMATURE) {
if (ob->mode & OB_MODE_POSE)
- str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
+ str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT|OB_MODE_POSE, ICON_EDITMODE_HLT);
else
- str += sprintf(str, formatstr, "Edit Mode", OB_MODE_EDIT, ICON_EDITMODE_HLT);
+ str += modeselect_addmode(str, N_("Edit Mode"), OB_MODE_EDIT, ICON_EDITMODE_HLT);
}
if (ob->type == OB_MESH) {
- str += sprintf(str, formatstr, "Sculpt Mode", OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
- str += sprintf(str, formatstr, "Vertex Paint", OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
- str += sprintf(str, formatstr, "Texture Paint", OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
- str += sprintf(str, formatstr, "Weight Paint", OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
+ str += modeselect_addmode(str, N_("Sculpt Mode"), OB_MODE_SCULPT, ICON_SCULPTMODE_HLT);
+ str += modeselect_addmode(str, N_("Vertex Paint"), OB_MODE_VERTEX_PAINT, ICON_VPAINT_HLT);
+ str += modeselect_addmode(str, N_("Texture Paint"), OB_MODE_TEXTURE_PAINT, ICON_TPAINT_HLT);
+ str += modeselect_addmode(str, N_("Weight Paint"), OB_MODE_WEIGHT_PAINT, ICON_WPAINT_HLT);
}
}
/* if active object is an armature */
if (ob->type==OB_ARMATURE) {
- str += sprintf(str, formatstr, "Pose Mode", OB_MODE_POSE, ICON_POSE_HLT);
+ str += modeselect_addmode(str, N_("Pose Mode"), OB_MODE_POSE, ICON_POSE_HLT);
}
if (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)) {
- str += sprintf(str, formatstr, "Particle Mode", OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE);
+ str += modeselect_addmode(str, N_("Particle Mode"), OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE);
}
(void)str;
return (string);
@@ -455,6 +470,7 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C)
}
}
+#define TIP_(msgid) UI_translate_do_tooltip(msgid)
void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
{
bScreen *screen= CTX_wm_screen(C);
@@ -488,7 +504,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiBlockBeginAlign(block);
uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) ,
- 0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, "Mode");
+ 0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, TIP_(N_("Mode")));
uiBlockEndAlign(block);
/* Draw type */
@@ -500,7 +516,15 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
PointerRNA meshptr;
RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
- uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) {
+ uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ }
+ else {
+
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ }
} else {
const char *str_menu;
@@ -514,11 +538,11 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
block= uiLayoutGetBlock(row);
if(v3d->twflag & V3D_USE_MANIPULATOR) {
- but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode");
+ but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Translate manipulator mode")));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
- but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode");
+ but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Rotate manipulator mode")));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
- but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode");
+ but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Scale manipulator mode")));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
}
@@ -526,8 +550,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
v3d->twmode = 0;
}
- str_menu = BIF_menustringTransformOrientation(C, "Orientation");
- but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
+ str_menu = BIF_menustringTransformOrientation(C, N_("Orientation"));
+ but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_(N_("Transform Orientation")));
uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */
MEM_freeN((void *)str_menu);
}
@@ -547,4 +571,4 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiTemplateEditModeSelection(layout, C);
}
-
+#undef TIP_
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 65914ead899..1c98397c7f6 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -54,6 +54,11 @@
#include "BLI_linklist.h"
#include "BLI_utildefines.h"
+/* vertex box select */
+#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
+#include "BKE_global.h"
+
#include "BKE_context.h"
#include "BKE_paint.h"
#include "BKE_armature.h"
@@ -198,6 +203,24 @@ static void EM_backbuf_checkAndSelectFaces(EditMesh *em, int select)
}
}
+
+/* object mode, EM_ prefix is confusing here, rename? */
+static void EM_backbuf_checkAndSelectVerts_obmode(Mesh *me, int select)
+{
+ MVert *mv = me->mvert;
+ int a;
+
+ if (mv) {
+ for(a=1; a<=me->totvert; a++, mv++) {
+ if(EM_check_backbuf(a)) {
+ if(!(mv->flag & ME_HIDE)) {
+ mv->flag = select?(mv->flag|SELECT):(mv->flag&~SELECT);
+ }
+ }
+ }
+ }
+}
+/* object mode, EM_ prefix is confusing here, rename? */
static void EM_backbuf_checkAndSelectTFaces(Mesh *me, int select)
{
MFace *mface = me->mface;
@@ -231,7 +254,7 @@ static int view3d_selectable_data(bContext *C)
if (ob->mode & OB_MODE_SCULPT) {
return 0;
}
- if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob)) {
+ if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT) && !paint_facesel_test(ob) && !paint_vertsel_test(ob)) {
return 0;
}
}
@@ -727,6 +750,88 @@ static void do_lasso_select_meta(ViewContext *vc, int mcords[][2], short moves,
}
}
+int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend)
+{
+ Mesh *me;
+ MVert *mvert;
+ struct ImBuf *ibuf;
+ unsigned int *rt;
+ int a, index;
+ char *selar;
+ int sx= rect->xmax-rect->xmin+1;
+ int sy= rect->ymax-rect->ymin+1;
+
+ me= vc->obact->data;
+
+ if(me==NULL || me->totvert==0 || sx*sy <= 0)
+ return OPERATOR_CANCELLED;
+
+ selar= MEM_callocN(me->totvert+1, "selar");
+
+ if (extend == 0 && select)
+ paintvert_deselect_all_visible(vc->obact, SEL_DESELECT, FALSE);
+
+ view3d_validate_backbuf(vc);
+
+ ibuf = IMB_allocImBuf(sx,sy,32,IB_rect);
+ rt = ibuf->rect;
+ glReadPixels(rect->xmin+vc->ar->winrct.xmin, rect->ymin+vc->ar->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
+ if(ENDIAN_ORDER==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
+
+ a= sx*sy;
+ while(a--) {
+ if(*rt) {
+ index= WM_framebuffer_to_index(*rt);
+ if(index<=me->totvert) selar[index]= 1;
+ }
+ rt++;
+ }
+
+ mvert= me->mvert;
+ for(a=1; a<=me->totvert; a++, mvert++) {
+ if(selar[a]) {
+ if(mvert->flag & ME_HIDE);
+ else {
+ if(select) mvert->flag |= SELECT;
+ else mvert->flag &= ~SELECT;
+ }
+ }
+ }
+
+ IMB_freeImBuf(ibuf);
+ MEM_freeN(selar);
+
+#ifdef __APPLE__
+ glReadBuffer(GL_BACK);
+#endif
+
+ paintvert_flush_flags(vc->obact);
+
+ return OPERATOR_FINISHED;
+}
+
+static void do_lasso_select_paintvert(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
+{
+ Object *ob= vc->obact;
+ Mesh *me= ob?ob->data:NULL;
+ rcti rect;
+
+ if(me==NULL || me->totvert==0)
+ return;
+
+ if(extend==0 && select)
+ paintvert_deselect_all_visible(ob, SEL_DESELECT, FALSE); /* flush selection at the end */
+ em_vertoffs= me->totvert+1; /* max index array */
+
+ lasso_select_boundbox(&rect, mcords, moves);
+ EM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+
+ EM_backbuf_checkAndSelectVerts_obmode(me, select);
+
+ EM_free_backbuf();
+
+ paintvert_flush_flags(ob);
+}
static void do_lasso_select_paintface(ViewContext *vc, int mcords[][2], short moves, short extend, short select)
{
Object *ob= vc->obact;
@@ -789,6 +894,8 @@ static void view3d_lasso_select(bContext *C, ViewContext *vc, int mcords[][2], s
if(vc->obedit==NULL) { /* Object Mode */
if(paint_facesel_test(ob))
do_lasso_select_paintface(vc, mcords, moves, extend, select);
+ else if(paint_vertsel_test(ob))
+ do_lasso_select_paintvert(vc, mcords, moves, extend, select);
else if(ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))
;
else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT)
@@ -876,8 +983,8 @@ void VIEW3D_OT_select_lasso(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
- RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items.");
- RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first.");
+ RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items");
+ RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
}
@@ -1798,6 +1905,9 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
else if(vc.obact && paint_facesel_test(vc.obact)) {
ret= do_paintface_box_select(&vc, &rect, select, extend);
}
+ else if(vc.obact && paint_vertsel_test(vc.obact)) {
+ ret= do_paintvert_box_select(&vc, &rect, select, extend);
+ }
else if(vc.obact && vc.obact->mode & OB_MODE_PARTICLE_EDIT) {
ret= PE_border_select(C, &rect, select, extend);
}
@@ -1834,6 +1944,58 @@ void VIEW3D_OT_select_border(wmOperatorType *ot)
WM_operator_properties_gesture_border(ot, TRUE);
}
+/* 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)
+{
+ ViewContext vc;
+ view3d_set_viewcontext(C, &vc);
+
+ if (!me || me->totvert==0)
+ return 0;
+
+ if (rect) {
+ /* 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);
+ }
+ else {
+ /* sample only on the exact position */
+ *index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
+ }
+
+ if ((*index)<=0 || (*index)>(unsigned int)me->totvert)
+ return 0;
+
+ (*index)--;
+
+ return 1;
+}
+
+/* mouse selection in weight paint */
+/* gets called via generic mouse select operator */
+static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], short extend, Object *obact)
+{
+ Mesh* me= obact->data; /* already checked for NULL */
+ unsigned int index = 0;
+ MVert *mv;
+ if(vertsel_vert_pick(C, me, mval, &index, 1)) {
+ mv = me->mvert+index;
+ if(extend) {
+ mv->flag ^= SELECT;
+ } else {
+ paintvert_deselect_all_visible(obact, SEL_DESELECT, FALSE);
+ mv->flag |= SELECT;
+ }
+ paintvert_flush_flags(obact);
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
+ return 1;
+ }
+ return 0;
+}
+
/* ****** Mouse Select ****** */
@@ -1878,6 +2040,8 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
return PE_mouse_particles(C, event->mval, extend);
else if(obact && paint_facesel_test(obact))
retval = paintface_mouse_select(C, obact, event->mval, extend);
+ else if (paint_vertsel_test(obact))
+ retval = mouse_weight_paint_vertex_select(C, event->mval, extend, obact);
else
retval = mouse_select(C, event->mval, extend, center, enumerate);
@@ -1905,10 +2069,10 @@ void VIEW3D_OT_select(wmOperatorType *ot)
ot->flag= OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first.");
- RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection.");
- RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only).");
- RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (editmode only).");
+ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
+ RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection");
+ RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only)");
+ RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (editmode only)");
}
@@ -1992,18 +2156,36 @@ static void paint_facesel_circle_select(ViewContext *vc, int select, const int m
{
Object *ob= vc->obact;
Mesh *me = ob?ob->data:NULL;
- int bbsel;
+ /* int bbsel; */ /* UNUSED */
if (me) {
em_vertoffs= me->totface+1; /* max index array */
- bbsel= EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f));
+ /* bbsel= */ /* UNUSED */ EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f));
EM_backbuf_checkAndSelectTFaces(me, select==LEFTMOUSE);
EM_free_backbuf();
}
}
+static void paint_vertsel_circle_select(ViewContext *vc, int select, const int mval[2], float rad)
+{
+ Object *ob= vc->obact;
+ Mesh *me = ob?ob->data:NULL;
+ /* int bbsel; */ /* UNUSED */
+ /* struct {ViewContext *vc; short select; int mval[2]; float radius; } data = {NULL}; */ /* UNUSED */
+ if (me) {
+ em_vertoffs= me->totvert+1; /* max index array */
+
+ /* bbsel= */ /* UNUSED */ EM_init_backbuf_circle(vc, mval[0], mval[1], (short)(rad+1.0f));
+ EM_backbuf_checkAndSelectVerts_obmode(me, select==LEFTMOUSE);
+ EM_free_backbuf();
+
+ paintvert_flush_flags(ob);
+ }
+}
+
+
static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
{
struct {ViewContext *vc; short select; int mval[2]; float radius; } *data = userData;
@@ -2258,7 +2440,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
select= (gesture_mode==GESTURE_MODAL_SELECT);
- if( CTX_data_edit_object(C) || paint_facesel_test(obact) ||
+ if( CTX_data_edit_object(C) || paint_facesel_test(obact) || paint_vertsel_test(obact) ||
(obact && (obact->mode & (OB_MODE_PARTICLE_EDIT|OB_MODE_POSE))) )
{
ViewContext vc;
@@ -2278,6 +2460,10 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
paint_facesel_circle_select(&vc, select, mval, (float)radius);
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
}
+ else if(paint_vertsel_test(obact)) {
+ paint_vertsel_circle_select(&vc, select, mval, (float)radius);
+ WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data);
+ }
else if(obact->mode & OB_MODE_POSE)
pose_circle_select(&vc, select, mval, (float)radius);
else
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index a2aed67821d..ddea89e1cdb 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -48,6 +48,8 @@
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
+#include "BLF_translation.h"
+
#include "BKE_context.h"
#include "BKE_idprop.h"
#include "BKE_global.h"
@@ -80,7 +82,7 @@ static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa)
wmOperator *op= WM_operator_last_redo(C);
if(op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname));
- else BLI_strncpy(pa->drawname, "Operator", sizeof(pa->drawname));
+ else BLI_strncpy(pa->drawname, N_("Operator"), sizeof(pa->drawname));
}
static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op)
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index c7feaebcddc..8227ba87021 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1667,7 +1667,7 @@ static void RestoreState(bContext *C, wmWindow *win)
win->queue= queue_back;
GPU_state_init();
- GPU_set_tpage(NULL, 0);
+ GPU_set_tpage(NULL, 0, 0);
glPopAttrib();
}
@@ -1835,7 +1835,7 @@ static int game_engine_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
#else
(void)C; /* unused */
- BKE_report(op->reports, RPT_ERROR, "Game engine is disabled in this build.");
+ BKE_report(op->reports, RPT_ERROR, "Game engine is disabled in this build");
return OPERATOR_CANCELLED;
#endif
}
diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt
index e44cc1f5df3..c4305ed6a9f 100644
--- a/source/blender/editors/transform/CMakeLists.txt
+++ b/source/blender/editors/transform/CMakeLists.txt
@@ -21,6 +21,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript
index edc2156a07b..f2d5baecfb3 100644
--- a/source/blender/editors/transform/SConscript
+++ b/source/blender/editors/transform/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../render/extern/include'
incs += ' ../../gpu ../../makesrna ../../blenloader'
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 12dca202f4f..bfaf9d20092 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -4260,7 +4260,6 @@ static int createSlideVerts(TransInfo *t)
LinkNode *edgelist = NULL, *vertlist=NULL, *look;
GHash *vertgh;
TransDataSlideVert *tempsv;
- float vertdist; // XXX, projectMat[4][4];
int i, j, numsel, numadded=0, timesthrough = 0, vertsel=0;
/* UV correction vars */
GHash **uvarray= NULL;
@@ -4525,7 +4524,6 @@ static int createSlideVerts(TransInfo *t)
look = vertlist;
nearest = NULL;
- vertdist = -1;
while(look) {
tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link);
@@ -5563,7 +5561,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
const short autosnap= getAnimEdit_SnapMode(t);
- float deltax, val, valprev;
+ float deltax, val /* , valprev */;
/* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */
for (i = 0 ; i < t->total; i++, td++, td2d++) {
@@ -5573,7 +5571,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval))
*/
AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL;
- valprev = *td->val;
+ /* valprev = *td->val; */ /* UNUSED */
/* check if any need to apply nla-mapping */
if (adt && t->spacetype != SPACE_SEQ) {
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index fc5c80d22c9..77d2e6e7ff0 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1000,7 +1000,7 @@ static void createTransPose(TransInfo *t, Object *ob)
if (arm->flag & ARM_RESTPOS) {
if (ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE)==0) {
// XXX use transform operator reports
- // BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled.");
+ // BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled");
return;
}
}
@@ -1038,7 +1038,7 @@ static void createTransPose(TransInfo *t, Object *ob)
if(td != (t->data+t->total)) {
// XXX use transform operator reports
- // BKE_report(op->reports, RPT_DEBUG, "Bone selection count error.");
+ // BKE_report(op->reports, RPT_DEBUG, "Bone selection count error");
}
/* initialise initial auto=ik chainlen's? */
@@ -1983,7 +1983,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
float *mappedcos = NULL, *quats= NULL;
float mtx[3][3], smtx[3][3], (*defmats)[3][3] = NULL, (*defcos)[3] = NULL;
int count=0, countsel=0, a, totleft;
- int propmode = t->flag & T_PROP_EDIT;
+ int propmode = (t->flag & T_PROP_EDIT) ? (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) : 0;
int mirror = 0;
short selectmode = ts->selectmode;
@@ -2053,7 +2053,9 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
copy_m3_m4(mtx, t->obedit->obmat);
invert_m3_m3(smtx, mtx);
- if(propmode) editmesh_set_connectivity_distance(em, mtx);
+ if(propmode & T_PROP_CONNECTED) {
+ editmesh_set_connectivity_distance(em, mtx);
+ }
/* detect CrazySpace [tm] */
if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) {
@@ -3406,7 +3408,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
const char sel3= use_handle ? bezt->f3 & SELECT : 0;
TransDataCurveHandleFlags *hdata = NULL;
- short h1=1, h2=1;
+ /* short h1=1, h2=1; */ /* UNUSED */
/* only include handles if selected, irrespective of the interpolation modes.
* also, only treat handles specially if the center point isn't selected.
@@ -3416,16 +3418,18 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
hdata = initTransDataCurveHandles(td, bezt);
bezt_to_transdata(td++, td2d++, adt, bezt, 0, 1, 1, intvals, mtx, smtx);
}
- else
- h1= 0;
+ else {
+ /* h1= 0; */ /* UNUSED */
+ }
if (sel3) {
if (hdata==NULL)
hdata = initTransDataCurveHandles(td, bezt);
bezt_to_transdata(td++, td2d++, adt, bezt, 2, 1, 1, intvals, mtx, smtx);
}
- else
- h2= 0;
+ else {
+ /* h2= 0; */ /* UNUSED */
+ }
}
/* only include main vert if selected */
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 3b895f5fbd0..36373562956 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -446,13 +446,13 @@ int calc_manipulator_stats(const bContext *C)
}
else if(obedit->type==OB_MBALL) {
MetaBall *mb = (MetaBall*)obedit->data;
- MetaElem *ml, *ml_sel=NULL;
+ MetaElem *ml /* , *ml_sel=NULL */ /* UNUSED */;
ml= mb->editelems->first;
while(ml) {
if(ml->flag & SELECT) {
calc_tw_center(scene, &ml->x);
- ml_sel = ml;
+ /* ml_sel = ml; */ /* UNUSED */
totsel++;
}
ml= ml->next;
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index e35b8adc570..d6e8e4aa695 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -303,7 +303,7 @@ static void TRANSFORM_OT_create_orientation(struct wmOperatorType *ot)
ot->poll = ED_operator_areaactive;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
- RNA_def_string(ot->srna, "name", "", 35, "Name", "Text to insert at the cursor position.");
+ RNA_def_string(ot->srna, "name", "", 35, "Name", "Text to insert at the cursor position");
RNA_def_boolean(ot->srna, "use", 0, "Use after creation", "Select orientation after its creation");
RNA_def_boolean(ot->srna, "overwrite", 0, "Overwrite previous", "Overwrite previously created orientation with same name");
}
@@ -476,7 +476,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
if (flags & P_PROPORTIONAL)
{
RNA_def_enum(ot->srna, "proportional", proportional_editing_items, 0, "Proportional Editing", "");
- RNA_def_enum(ot->srna, "proportional_edit_falloff", proportional_falloff_items, 0, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
+ RNA_def_enum(ot->srna, "proportional_edit_falloff", proportional_falloff_items, 0, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
RNA_def_float(ot->srna, "proportional_size", 1, 0.00001f, FLT_MAX, "Proportional Size", "", 0.001, 100);
}
@@ -601,8 +601,8 @@ void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
/* identifiers */
ot->name = "Tilt";
/*optionals -
- "Tilt selected vertices."
- "Specify an extra axis rotation for selected vertices of 3d curve." */
+ "Tilt selected vertices"
+ "Specify an extra axis rotation for selected vertices of 3d curve" */
ot->description= "Tilt selected control vertices of 3d curve";
ot->idname = OP_TILT;
ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
@@ -795,7 +795,7 @@ void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot)
ot->cancel = transform_cancel;
ot->poll = ED_operator_sequencer_active;
- RNA_def_float_vector(ot->srna, "value", 2, VecOne, -FLT_MAX, FLT_MAX, "angle", "", -FLT_MAX, FLT_MAX);
+ RNA_def_float_vector(ot->srna, "value", 2, VecOne, -FLT_MAX, FLT_MAX, "Angle", "", -FLT_MAX, FLT_MAX);
Transform_Properties(ot, P_SNAP);
}
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 96ab0b48091..b60e511dcb7 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -50,6 +50,8 @@
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
//#include "BIF_editmesh.h"
//#include "BIF_interface.h"
//#include "BIF_space.h"
@@ -60,6 +62,8 @@
#include "RNA_define.h"
+#include "UI_interface.h"
+
#include "transform.h"
/* *********************** TransSpace ************************** */
@@ -406,14 +410,18 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C)
}
const char * BIF_menustringTransformOrientation(const bContext *C, const char *title) {
- char menu[] = "%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3";
+ const char* menu = N_("%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3");
ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces;
TransformOrientation *ts;
int i = V3D_MANIP_CUSTOM;
char *str_menu, *p;
+
+ if(UI_translate_iface()) {
+ title= BLF_gettext(title);
+ menu= BLF_gettext(menu);
+ }
-
- str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), "UserTransSpace from matrix");
+ str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), UI_translate_do_tooltip(N_("UserTransSpace from matrix")));
p = str_menu;
p += sprintf(str_menu, "%s", title);
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 05159414975..61b3a9ca1ca 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -125,14 +125,12 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre
if(uvedit_face_visible(scene, previma, efa, tf)) {
if(ima) {
tf->tpage= ima;
- tf->mode |= TF_TEX;
if(ima->id.us==0) id_us_plus(&ima->id);
else id_lib_extern(&ima->id);
}
else {
tf->tpage= NULL;
- tf->mode &= ~TF_TEX;
}
update = 1;
@@ -1221,7 +1219,7 @@ static void UV_OT_align(wmOperatorType *ot)
ot->poll= ED_operator_image_active; /* requires space image */;
/* properties */
- RNA_def_enum(ot->srna, "axis", axis_items, 'a', "Axis", "Axis to align UV locations on.");
+ RNA_def_enum(ot->srna, "axis", axis_items, 'a', "Axis", "Axis to align UV locations on");
}
/* ******************** weld operator **************** */
@@ -1433,8 +1431,8 @@ static void UV_OT_stitch(wmOperatorType *ot)
ot->poll= ED_operator_uvedit;
/* properties */
- RNA_def_boolean(ot->srna, "use_limit", 1, "Use Limit", "Stitch UVs within a specified limit distance.");
- RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates.", -FLT_MAX, FLT_MAX);
+ RNA_def_boolean(ot->srna, "use_limit", 1, "Use Limit", "Stitch UVs within a specified limit distance");
+ RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates", -FLT_MAX, FLT_MAX);
}
/* ******************** (de)select all operator **************** */
@@ -1868,9 +1866,9 @@ static void UV_OT_select(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
- "Extend", "Extend selection rather than clearing the existing selection.");
+ "Extend", "Extend selection rather than clearing the existing selection");
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
- "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f);
+ "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
}
/* ******************** loop select operator **************** */
@@ -1913,9 +1911,9 @@ static void UV_OT_select_loop(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
- "Extend", "Extend selection rather than clearing the existing selection.");
+ "Extend", "Extend selection rather than clearing the existing selection");
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
- "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f);
+ "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
}
/* ******************** linked select operator **************** */
@@ -1934,7 +1932,7 @@ static int select_linked_internal(bContext *C, wmOperator *op, wmEvent *event, i
NearestHit hit, *hit_p= NULL;
if(ts->uv_flag & UV_SYNC_SELECTION) {
- BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled.");
+ BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled");
BKE_mesh_end_editmesh(obedit->data, em);
return OPERATOR_CANCELLED;
}
@@ -1989,7 +1987,7 @@ static void UV_OT_select_linked(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
- "Extend", "Extend selection rather than clearing the existing selection.");
+ "Extend", "Extend selection rather than clearing the existing selection");
}
static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
@@ -2017,10 +2015,10 @@ static void UV_OT_select_linked_pick(wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "extend", 0,
- "Extend", "Extend selection rather than clearing the existing selection.");
+ "Extend", "Extend selection rather than clearing the existing selection");
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
- "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds.", -100.0f, 100.0f);
+ "Location", "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds", -100.0f, 100.0f);
}
/* ******************** unlink selection operator **************** */
@@ -2036,7 +2034,7 @@ static int unlink_selection_exec(bContext *C, wmOperator *op)
MTFace *tf;
if(ts->uv_flag & UV_SYNC_SELECTION) {
- BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled.");
+ BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled");
BKE_mesh_end_editmesh(obedit->data, em);
return OPERATOR_CANCELLED;
}
@@ -2358,7 +2356,7 @@ static void UV_OT_select_border(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only.");
+ RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only");
WM_operator_properties_gesture_border(ot, FALSE);
}
@@ -2519,7 +2517,7 @@ static void UV_OT_snap_cursor(wmOperatorType *ot)
ot->poll= ED_operator_image_active; /* requires space image */;
/* properties */
- RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UV's to.");
+ RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UVs to");
}
/* ******************** snap selection operator **************** */
@@ -2761,7 +2759,7 @@ static void UV_OT_snap_selected(wmOperatorType *ot)
ot->poll= ED_operator_image_active; /* requires space image */;
/* properties */
- RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UV's to.");
+ RNA_def_enum(ot->srna, "target", target_items, 0, "Target", "Target to snap the selected UVs to");
}
/* ******************** pin operator **************** */
@@ -2816,7 +2814,7 @@ static void UV_OT_pin(wmOperatorType *ot)
ot->poll= ED_operator_uvedit;
/* properties */
- RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear pinning for the selection instead of setting it.");
+ RNA_def_boolean(ot->srna, "clear", 0, "Clear", "Clear pinning for the selection instead of setting it");
}
/******************* select pinned operator ***************/
@@ -3001,7 +2999,7 @@ static void UV_OT_hide(wmOperatorType *ot)
ot->poll= ED_operator_uvedit;
/* props */
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected.");
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
}
/****************** reveal operator ******************/
@@ -3181,7 +3179,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 0.0-1.0 coordinates", -10.0f, 10.0f);
}
/********************** set tile operator **********************/
@@ -3247,7 +3245,7 @@ static void UV_OT_tile_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_int_vector(ot->srna, "tile", 2, NULL, 0, INT_MAX, "Tile", "Tile coordinate.", 0, 10);
+ RNA_def_int_vector(ot->srna, "tile", 2, NULL, 0, INT_MAX, "Tile", "Tile coordinate", 0, 10);
}
/* ************************** registration **********************************/
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index dd7c336c98e..846b05c1287 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -2714,7 +2714,7 @@ static PBool p_chart_abf_solve(PChart *chart)
break;
if (!p_abf_matrix_invert(&sys, chart)) {
- param_warning("ABF failed to invert matrix.");
+ param_warning("ABF failed to invert matrix");
p_abf_free_system(&sys);
return P_FALSE;
}
@@ -2723,7 +2723,7 @@ static PBool p_chart_abf_solve(PChart *chart)
}
if (i == ABF_MAX_ITER) {
- param_warning("ABF maximum iterations reached.");
+ param_warning("ABF maximum iterations reached");
p_abf_free_system(&sys);
return P_FALSE;
}
@@ -3831,7 +3831,7 @@ static void p_smooth(PChart *chart)
if (hedges) MEM_freeN(hedges);
if (vedges) MEM_freeN(vedges);
- // printf("Not enough memory for area smoothing grid.");
+ // printf("Not enough memory for area smoothing grid");
return;
}
@@ -3981,7 +3981,7 @@ static void p_smooth(PChart *chart)
if (triangles) MEM_freeN(triangles);
if (tri) MEM_freeN(tri);
- // printf("Not enough memory for area smoothing grid.");
+ // printf("Not enough memory for area smoothing grid");
return;
}
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index e8a7896abd5..d5666d135aa 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -169,7 +169,8 @@ static int uvedit_have_selection(Scene *scene, EditMesh *em, short implicit)
return 0;
}
-static ParamHandle *construct_param_handle(Scene *scene, EditMesh *em, short implicit, short fill, short sel, short correct_aspect)
+static ParamHandle *construct_param_handle(Scene *scene, EditMesh *em, short implicit,
+ short fill, short sel, short correct_aspect)
{
ParamHandle *handle;
EditFace *efa;
@@ -333,7 +334,7 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact
param_flush(ms->handle);
if(sa) {
- sprintf(str, "Minimize Stretch. Blend %.2f.", ms->blend);
+ sprintf(str, "Minimize Stretch. Blend %.2f", ms->blend);
ED_area_headerprint(sa, str);
}
@@ -474,9 +475,12 @@ void UV_OT_minimize_stretch(wmOperatorType *ot)
ot->poll= ED_operator_uvedit;
/* properties */
- 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_float_factor(ot->srna, "blend", 0.0f, 0.0f, 1.0f, "Blend", "Blend factor between stretch minimized and original.", 0.0f, 1.0f);
- RNA_def_int(ot->srna, "iterations", 0, 0, INT_MAX, "Iterations", "Number of iterations to run, 0 is unlimited when run interactively.", 0, 100);
+ 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_float_factor(ot->srna, "blend", 0.0f, 0.0f, 1.0f, "Blend",
+ "Blend factor between stretch minimized and original", 0.0f, 1.0f);
+ RNA_def_int(ot->srna, "iterations", 0, 0, INT_MAX, "Iterations",
+ "Number of iterations to run, 0 is unlimited when run interactively", 0, 100);
}
/* ******************** Pack Islands operator **************** */
@@ -525,7 +529,8 @@ void UV_OT_pack_islands(wmOperatorType *ot)
ot->poll= ED_operator_uvedit;
/* properties */
- RNA_def_float_factor(ot->srna, "margin", 0.0f, 0.0f, 1.0f, "Margin", "Space between islands", 0.0f, 1.0f);
+ RNA_def_float_factor(ot->srna, "margin", 0.0f, 0.0f, 1.0f, "Margin",
+ "Space between islands", 0.0f, 1.0f);
}
/* ******************** Average Islands Scale operator **************** */
@@ -656,7 +661,8 @@ static void uv_map_transform_center(Scene *scene, View3D *v3d, float *result, Ob
}
}
-static void uv_map_rotation_matrix(float result[][4], RegionView3D *rv3d, Object *ob, float upangledeg, float sideangledeg, float radius)
+static void uv_map_rotation_matrix(float result[][4], RegionView3D *rv3d, Object *ob,
+ float upangledeg, float sideangledeg, float radius)
{
float rotup[4][4], rotside[4][4], viewmatrix[4][4], rotobj[4][4];
float sideangle= 0.0f, upangle= 0.0f;
@@ -752,10 +758,13 @@ static void uv_transform_properties(wmOperatorType *ot, int radius)
{0, NULL, 0, NULL, NULL}
};
- RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction", "Direction of the sphere or cylinder.");
- RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align", "How to determine rotation around the pole.");
+ RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction",
+ "Direction of the sphere or cylinder");
+ RNA_def_enum(ot->srna, "align", align_items, VIEW_ON_EQUATOR, "Align",
+ "How to determine rotation around the pole");
if(radius)
- RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius", "Radius of the sphere or cylinder.", 0.0001f, 100.0f);
+ RNA_def_float(ot->srna, "radius", 1.0f, 0.0f, FLT_MAX, "Radius",
+ "Radius of the sphere or cylinder", 0.0001f, 100.0f);
}
static void correct_uv_aspect(EditMesh *em)
@@ -808,9 +817,12 @@ 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.");
- 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", "Scale UV coordinates to bounds after unwrapping.");
+ RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect",
+ "Map UV's 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",
+ "Scale UV coordinates to bounds after unwrapping");
}
static void uv_map_clip_correct(EditMesh *em, wmOperator *op)
@@ -967,9 +979,12 @@ void UV_OT_unwrap(wmOperatorType *ot)
ot->poll= ED_operator_uvmap;
/* 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.");
- 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.");
+ RNA_def_enum(ot->srna, "method", method_items, 0, "Method",
+ "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");
}
/**************** Project From View operator **************/
@@ -1078,7 +1093,7 @@ void UV_OT_from_view(wmOperatorType *ot)
ot->poll= uv_from_view_poll;
/* properties */
- RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", "Use orthographic projection.");
+ RNA_def_boolean(ot->srna, "orthographic", 0, "Orthographic", "Use orthographic projection");
uv_map_clip_correct_properties(ot);
}
@@ -1382,6 +1397,7 @@ void UV_OT_cube_project(wmOperatorType *ot)
ot->poll= ED_operator_uvmap;
/* properties */
- RNA_def_float(ot->srna, "cube_size", 1.0f, 0.0f, FLT_MAX, "Cube Size", "Size of the cube to project on.", 0.001f, 100.0f);
+ RNA_def_float(ot->srna, "cube_size", 1.0f, 0.0f, FLT_MAX, "Cube Size",
+ "Size of the cube to project on", 0.001f, 100.0f);
uv_map_clip_correct_properties(ot);
}
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index d75b8db2c4e..55c4ff85a57 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -80,15 +80,15 @@ void GPU_end_object_materials(void);
int GPU_enable_material(int nr, void *attribs);
void GPU_disable_material(void);
-void GPU_set_material_blend_mode(int blendmode);
-int GPU_get_material_blend_mode(void);
+void GPU_set_material_alpha_blend(int alphablend);
+int GPU_get_material_alpha_blend(void);
/* TexFace drawing
* - this is mutually exclusive with material drawing, a mesh should
* be drawn using one or the other
* - passing NULL clears the state again */
-int GPU_set_tpage(struct MTFace *tface, int mipmap);
+int GPU_set_tpage(struct MTFace *tface, int mipmap, int transp);
/* Lights
* - returns how many lights were enabled
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 95a08e6d5b3..29ad9c91374 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -94,7 +94,8 @@ typedef enum GPUBlendMode {
GPU_BLEND_SOLID = 0,
GPU_BLEND_ADD = 1,
GPU_BLEND_ALPHA = 2,
- GPU_BLEND_CLIP = 4
+ GPU_BLEND_CLIP = 4,
+ GPU_BLEND_ALPHA_SORT = 8
} GPUBlendMode;
typedef struct GPUNodeStack {
@@ -121,7 +122,7 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode
void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link);
void GPU_material_enable_alpha(GPUMaterial *material);
-GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[4]);
+GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4]);
/* High level functions to create and use GPU materials */
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 7af5ef6ea14..4f79d577ae5 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -95,7 +95,7 @@ void GPU_render_text(MTFace *tface, int mode,
const char *textstr, int textlen, unsigned int *col,
float *v1, float *v2, float *v3, float *v4, int glattrib)
{
- if ((mode & TF_BMFONT) && (textlen>0) && tface->tpage) {
+ if ((mode & GEMAT_TEXT) && (textlen>0) && tface->tpage) {
Image* ima = (Image*)tface->tpage;
int index, character;
float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance;
@@ -245,7 +245,7 @@ static struct GPUTextureState {
int domipmap, linearmipmap;
- int alphamode;
+ int alphablend;
float anisotropic;
MTFace *lasttface;
} GTS = {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, 1, 0, -1, 1.f, NULL};
@@ -352,7 +352,7 @@ static void gpu_clear_tpage(void)
GTS.curtilemode= 0;
GTS.curtileXRep=0;
GTS.curtileYRep=0;
- GTS.alphamode= -1;
+ GTS.alphablend= -1;
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
@@ -361,19 +361,19 @@ static void gpu_clear_tpage(void)
glDisable(GL_ALPHA_TEST);
}
-static void gpu_set_blend_mode(GPUBlendMode blendmode)
+static void gpu_set_alpha_blend(GPUBlendMode alphablend)
{
- if(blendmode == GPU_BLEND_SOLID) {
+ if(alphablend == GPU_BLEND_SOLID) {
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
- else if(blendmode==GPU_BLEND_ADD) {
+ else if(alphablend==GPU_BLEND_ADD) {
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glDisable(GL_ALPHA_TEST);
}
- else if(blendmode==GPU_BLEND_ALPHA) {
+ else if(ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT)) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -389,21 +389,21 @@ static void gpu_set_blend_mode(GPUBlendMode blendmode)
glAlphaFunc(GL_GREATER, U.glalphaclip);
}
}
- else if(blendmode==GPU_BLEND_CLIP) {
+ else if(alphablend==GPU_BLEND_CLIP) {
glDisable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
}
}
-static void gpu_verify_alpha_mode(MTFace *tface)
+static void gpu_verify_alpha_blend(int alphablend)
{
/* verify alpha blending modes */
- if(GTS.alphamode == tface->transp)
+ if(GTS.alphablend == alphablend)
return;
- gpu_set_blend_mode(tface->transp);
- GTS.alphamode= tface->transp;
+ gpu_set_alpha_blend(alphablend);
+ GTS.alphablend= alphablend;
}
static void gpu_verify_reflection(Image *ima)
@@ -608,7 +608,7 @@ static void gpu_verify_repeat(Image *ima)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
}
-int GPU_set_tpage(MTFace *tface, int mipmap)
+int GPU_set_tpage(MTFace *tface, int mipmap, int alphablend)
{
Image *ima;
@@ -621,7 +621,7 @@ int GPU_set_tpage(MTFace *tface, int mipmap)
ima= tface->tpage;
GTS.lasttface= tface;
- gpu_verify_alpha_mode(tface);
+ gpu_verify_alpha_blend(alphablend);
gpu_verify_reflection(ima);
if(GPU_verify_image(ima, NULL, tface->tile, 1, mipmap)) {
@@ -945,12 +945,12 @@ static struct GPUMaterialState {
float (*gviewmat)[4];
float (*gviewinv)[4];
- GPUBlendMode *blendmode;
- GPUBlendMode blendmode_fixed[FIXEDMAT];
+ GPUBlendMode *alphablend;
+ GPUBlendMode alphablend_fixed[FIXEDMAT];
int alphapass;
int lastmatnr, lastretval;
- GPUBlendMode lastblendmode;
+ GPUBlendMode lastalphablend;
} GMS = {NULL};
/* fixed function material, alpha handed by caller */
@@ -1000,7 +1000,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
{
Material *ma;
GPUMaterial *gpumat;
- GPUBlendMode blendmode;
+ GPUBlendMode alphablend;
int a;
int gamma = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
@@ -1008,7 +1008,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
memset(&GMS, 0, sizeof(GMS));
GMS.lastmatnr = -1;
GMS.lastretval = -1;
- GMS.lastblendmode = GPU_BLEND_SOLID;
+ GMS.lastalphablend = GPU_BLEND_SOLID;
GMS.gob = ob;
GMS.gscene = scene;
@@ -1024,12 +1024,12 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
if(GMS.totmat > FIXEDMAT) {
GMS.matbuf= MEM_callocN(sizeof(GPUMaterialFixed)*GMS.totmat, "GMS.matbuf");
GMS.gmatbuf= MEM_callocN(sizeof(*GMS.gmatbuf)*GMS.totmat, "GMS.matbuf");
- GMS.blendmode= MEM_callocN(sizeof(*GMS.blendmode)*GMS.totmat, "GMS.matbuf");
+ GMS.alphablend= MEM_callocN(sizeof(*GMS.alphablend)*GMS.totmat, "GMS.matbuf");
}
else {
GMS.matbuf= GMS.matbuf_fixed;
GMS.gmatbuf= GMS.gmatbuf_fixed;
- GMS.blendmode= GMS.blendmode_fixed;
+ GMS.alphablend= GMS.alphablend_fixed;
}
/* no materials assigned? */
@@ -1044,7 +1044,7 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
GPU_material_from_blender(GMS.gscene, &defmaterial);
}
- GMS.blendmode[0]= GPU_BLEND_SOLID;
+ GMS.alphablend[0]= GPU_BLEND_SOLID;
}
/* setup materials */
@@ -1060,13 +1060,13 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
if(gpumat) {
/* do glsl only if creating it succeed, else fallback */
GMS.gmatbuf[a]= ma;
- blendmode = GPU_material_blend_mode(gpumat, ob->col);
+ alphablend = GPU_material_alpha_blend(gpumat, ob->col);
}
else {
/* fixed function opengl materials */
gpu_material_to_fixed(&GMS.matbuf[a], ma, gamma, ob);
- blendmode = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA;
+ alphablend = (ma->alpha == 1.0f)? GPU_BLEND_SOLID: GPU_BLEND_ALPHA;
if(do_alpha_pass && GMS.alphapass)
GMS.matbuf[a].diff[3]= ma->alpha;
else
@@ -1076,8 +1076,8 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
/* setting do_alpha_pass = 1 indicates this object needs to be
* drawn in a second alpha pass for improved blending */
if(do_alpha_pass) {
- GMS.blendmode[a]= blendmode;
- if(ELEM(blendmode, GPU_BLEND_ALPHA, GPU_BLEND_ADD) && !GMS.alphapass)
+ GMS.alphablend[a]= alphablend;
+ if(ELEM3(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ADD, GPU_BLEND_ALPHA_SORT) && !GMS.alphapass)
*do_alpha_pass= 1;
}
}
@@ -1090,7 +1090,7 @@ int GPU_enable_material(int nr, void *attribs)
{
GPUVertexAttribs *gattribs = attribs;
GPUMaterial *gpumat;
- GPUBlendMode blendmode;
+ GPUBlendMode alphablend;
/* no GPU_begin_object_materials, use default material */
if(!GMS.matbuf) {
@@ -1131,7 +1131,7 @@ int GPU_enable_material(int nr, void *attribs)
/* draw materials with alpha in alpha pass */
GMS.lastmatnr = nr;
- GMS.lastretval = ELEM(GMS.blendmode[nr], GPU_BLEND_SOLID, GPU_BLEND_CLIP);
+ GMS.lastretval = ELEM(GMS.alphablend[nr], GPU_BLEND_SOLID, GPU_BLEND_CLIP);
if(GMS.alphapass)
GMS.lastretval = !GMS.lastretval;
@@ -1145,6 +1145,7 @@ 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;
if(GMS.alphapass) glDepthMask(1);
}
@@ -1153,28 +1154,29 @@ 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 */
- blendmode = (GMS.alphapass)? GPU_BLEND_ALPHA: GPU_BLEND_SOLID;
- GPU_set_material_blend_mode(blendmode);
+ if(!GMS.alphapass) alphablend= GPU_BLEND_SOLID;
+ GPU_set_material_alpha_blend(alphablend);
}
return GMS.lastretval;
}
-void GPU_set_material_blend_mode(int blendmode)
+void GPU_set_material_alpha_blend(int alphablend)
{
- if(GMS.lastblendmode == blendmode)
+ if(GMS.lastalphablend == alphablend)
return;
- gpu_set_blend_mode(blendmode);
- GMS.lastblendmode = blendmode;
+ gpu_set_alpha_blend(alphablend);
+ GMS.lastalphablend = alphablend;
}
-int GPU_get_material_blend_mode(void)
+int GPU_get_material_alpha_blend(void)
{
- return GMS.lastblendmode;
+ return GMS.lastalphablend;
}
void GPU_disable_material(void)
@@ -1188,7 +1190,7 @@ void GPU_disable_material(void)
GMS.gboundmat= NULL;
}
- GPU_set_material_blend_mode(GPU_BLEND_SOLID);
+ GPU_set_material_alpha_blend(GPU_BLEND_SOLID);
}
void GPU_end_object_materials(void)
@@ -1198,12 +1200,12 @@ void GPU_end_object_materials(void)
if(GMS.matbuf && GMS.matbuf != GMS.matbuf_fixed) {
MEM_freeN(GMS.matbuf);
MEM_freeN(GMS.gmatbuf);
- MEM_freeN(GMS.blendmode);
+ MEM_freeN(GMS.alphablend);
}
GMS.matbuf= NULL;
GMS.gmatbuf= NULL;
- GMS.blendmode= NULL;
+ GMS.alphablend= NULL;
/* resetting the texture matrix after the glScale needed for tiled textures */
if(GTS.tilemode)
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 9aa453af4d6..40186c5a187 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -358,7 +358,7 @@ void GPU_material_enable_alpha(GPUMaterial *material)
material->alpha= 1;
}
-GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[4])
+GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4])
{
if(material->alpha || (material->obcolalpha && obcol[3] < 1.0f))
return GPU_BLEND_ALPHA;
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index 1547d2ee9ce..26be64bc268 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -58,13 +58,11 @@ set(SRC
intern/indexer.c
intern/indexer_dv.c
intern/iris.c
- intern/jp2.c
intern/jpeg.c
intern/md5.c
intern/metadata.c
intern/module.c
intern/png.c
- intern/radiance_hdr.c
intern/readimage.c
intern/rectop.c
intern/rotate.c
@@ -72,7 +70,6 @@ set(SRC
intern/targa.c
intern/thumbs.c
intern/thumbs_blend.c
- intern/tiff.c
intern/util.c
intern/writeimage.c
@@ -119,6 +116,10 @@ if(WITH_IMAGE_TIFF)
list(APPEND INC_SYS
${TIFF_INCLUDE_DIR}
)
+ list(APPEND SRC
+ intern/tiff.c
+ )
+
add_definitions(-DWITH_TIFF)
endif()
@@ -126,6 +127,10 @@ if(WITH_IMAGE_OPENJPEG)
list(APPEND INC_SYS
${OPENJPEG_INCLUDE_DIRS}
)
+ list(APPEND SRC
+ intern/jp2.c
+ )
+
add_definitions(-DWITH_OPENJPEG)
endif()
@@ -165,6 +170,9 @@ if(WITH_IMAGE_CINEON)
endif()
if(WITH_IMAGE_HDR)
+ list(APPEND SRC
+ intern/radiance_hdr.c
+ )
add_definitions(-DWITH_HDR)
endif()
diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript
index a80f92b4421..eae9665d23b 100644
--- a/source/blender/imbuf/SConscript
+++ b/source/blender/imbuf/SConscript
@@ -1,4 +1,5 @@
#!/usr/bin/python
+import os
Import ('env')
sources = env.Glob('intern/*.c')
@@ -22,6 +23,8 @@ if env['WITH_BF_OPENEXR']:
if env['WITH_BF_TIFF']:
defs.append('WITH_TIFF')
+else:
+ sources.remove(os.path.join('intern', 'tiff.c'))
if env['WITH_BF_DDS']:
defs.append('WITH_DDS')
@@ -31,6 +34,8 @@ if env['WITH_BF_CINEON']:
if env['WITH_BF_HDR']:
defs.append('WITH_HDR')
+else:
+ sources.remove(os.path.join('intern', 'radiance_hdr.c'))
if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
@@ -39,6 +44,8 @@ if env['WITH_BF_FFMPEG']:
if env['WITH_BF_OPENJPEG']:
defs.append('WITH_OPENJPEG')
incs += ' ' + env['BF_OPENJPEG_INC']
+else:
+ sources.remove(os.path.join('intern', 'jp2.c'))
if env['WITH_BF_REDCODE']:
defs.append('WITH_REDCODE')
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index 8436846bf2e..43168b97b88 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -38,21 +38,21 @@
#define IMB_ANIM_H
#ifdef _WIN32
-#define INC_OLE2
-#include <windows.h>
-#include <windowsx.h>
-#include <mmsystem.h>
-#include <memory.h>
-#include <commdlg.h>
-
-#ifndef FREE_WINDOWS
-#include <vfw.h>
-#endif
+# define INC_OLE2
+# include <windows.h>
+# include <windowsx.h>
+# include <mmsystem.h>
+# include <memory.h>
+# include <commdlg.h>
+
+# ifndef FREE_WINDOWS
+# include <vfw.h>
+# endif
-#undef AVIIF_KEYFRAME // redefined in AVI_avi.h
-#undef AVIIF_LIST // redefined in AVI_avi.h
+# undef AVIIF_KEYFRAME // redefined in AVI_avi.h
+# undef AVIIF_LIST // redefined in AVI_avi.h
-#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \
+# define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \
if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8');
#endif
@@ -60,10 +60,11 @@
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
-#ifndef _WIN32
-#include <dirent.h>
+
+#ifdef _WIN32
+# include <io.h>
#else
-#include <io.h>
+# include <dirent.h>
#endif
#include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail
@@ -74,23 +75,23 @@
#include "AVI_avi.h"
#ifdef WITH_QUICKTIME
-#if defined(_WIN32) || defined(__APPLE__)
-#include "quicktime_import.h"
-#endif /* _WIN32 || __APPLE__ */
+# if defined(_WIN32) || defined(__APPLE__)
+# include "quicktime_import.h"
+# endif /* _WIN32 || __APPLE__ */
#endif /* WITH_QUICKTIME */
#ifdef WITH_FFMPEG
-#include <libavformat/avformat.h>
-#include <libavcodec/avcodec.h>
-#include <libswscale/swscale.h>
+# include <libavformat/avformat.h>
+# include <libavcodec/avcodec.h>
+# include <libswscale/swscale.h>
#endif
#ifdef WITH_REDCODE
-#ifdef _WIN32 /* on windows we use the one in extern instead */
-#include "libredcode/format.h"
-#else
-#include "libredcode/format.h"
-#endif
+# ifdef _WIN32 /* on windows we use the one in extern instead */
+# include "libredcode/format.h"
+# else
+# include "libredcode/format.h"
+# endif
#endif
#include "IMB_imbuf_types.h"
@@ -107,12 +108,12 @@
#define SWAP_S(x) (((x << 8) & 0xff00) | ((x >> 8) & 0xff))
/* more endianness... should move to a separate file... */
-#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
-#define GET_ID GET_BIG_LONG
-#define LITTLE_LONG SWAP_LONG
+#ifdef __BIG_ENDIAN__
+# define GET_ID GET_BIG_LONG
+# define LITTLE_LONG SWAP_LONG
#else
-#define GET_ID GET_LITTLE_LONG
-#define LITTLE_LONG ENDIAN_NOP
+# define GET_ID GET_LITTLE_LONG
+# define LITTLE_LONG ENDIAN_NOP
#endif
/* anim.curtype, runtime only */
diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h
index f55420fd106..bd5a455df98 100644
--- a/source/blender/imbuf/intern/IMB_indexer.h
+++ b/source/blender/imbuf/intern/IMB_indexer.h
@@ -28,7 +28,7 @@
#define IMB_INDEXER_H
#ifdef WIN32
-#include <io.h>
+# include <io.h>
#endif
#include <stdlib.h>
diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h
index cd7d385ed92..22481241812 100644
--- a/source/blender/imbuf/intern/imbuf.h
+++ b/source/blender/imbuf/intern/imbuf.h
@@ -44,7 +44,7 @@
#include <stdio.h>
#ifndef WIN32
-#include <unistd.h>
+# include <unistd.h>
#endif
#include <fcntl.h>
@@ -53,11 +53,8 @@
#include <math.h>
#ifndef WIN32
-#include <sys/mman.h>
-#endif
-
-#if !defined(WIN32)
-#define O_BINARY 0
+# include <sys/mman.h>
+# define O_BINARY 0
#endif
#define SWAP_SHORT(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff))
@@ -65,16 +62,16 @@
#define ENDIAN_NOP(x) (x)
-#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__hppa__) || (defined (__APPLE__) && !defined(__LITTLE_ENDIAN__))
-#define LITTLE_SHORT SWAP_SHORT
-#define LITTLE_LONG SWAP_LONG
-#define BIG_SHORT ENDIAN_NOP
-#define BIG_LONG ENDIAN_NOP
+#ifdef __BIG_ENDIAN__
+# define LITTLE_SHORT SWAP_SHORT
+# define LITTLE_LONG SWAP_LONG
+# define BIG_SHORT ENDIAN_NOP
+# define BIG_LONG ENDIAN_NOP
#else
-#define LITTLE_SHORT ENDIAN_NOP
-#define LITTLE_LONG ENDIAN_NOP
-#define BIG_SHORT SWAP_SHORT
-#define BIG_LONG SWAP_LONG
+# define LITTLE_SHORT ENDIAN_NOP
+# define LITTLE_LONG ENDIAN_NOP
+# define BIG_SHORT SWAP_SHORT
+# define BIG_LONG SWAP_LONG
#endif
typedef unsigned char uchar;
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index af7f098585e..4872896bf3a 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -25,9 +25,6 @@
* \ingroup imbuf
*/
-
-#ifdef WITH_OPENJPEG
-
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
@@ -751,5 +748,3 @@ int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) {
return 1;
}
-
-#endif /* WITH_OPENJPEG */
diff --git a/source/blender/imbuf/intern/md5.c b/source/blender/imbuf/intern/md5.c
index 18148143eb9..2192fa32f19 100644
--- a/source/blender/imbuf/intern/md5.c
+++ b/source/blender/imbuf/intern/md5.c
@@ -28,11 +28,11 @@
#include "md5.h"
-#ifdef WORDS_BIGENDIAN
-# define SWAP(n) \
+#ifdef __BIG_ENDIAN__
+# define SWAP(n) \
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#else
-# define SWAP(n) (n)
+# define SWAP(n) (n)
#endif
diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c
index ddddec1c09f..9dd330ca88b 100644
--- a/source/blender/imbuf/intern/radiance_hdr.c
+++ b/source/blender/imbuf/intern/radiance_hdr.c
@@ -33,9 +33,6 @@
* \ingroup imbuf
*/
-
-#ifdef WITH_HDR
-
/* ----------------------------------------------------------------------
Radiance High Dynamic Range image file IO
For description and code for reading/writing of radiance hdr files
@@ -45,7 +42,7 @@
*/
#ifdef WIN32
-#include <io.h>
+# include <io.h>
#endif
#include "MEM_guardedalloc.h"
@@ -369,5 +366,3 @@ int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags)
fclose(file);
return 1;
}
-
-#endif /* WITH_HDR */
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 7beb853fe62..ccb271393a4 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -45,8 +45,6 @@
* used to compress images.
*/
-#ifdef WITH_TIFF
-
#include <string.h>
#include "imbuf.h"
@@ -836,5 +834,3 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
if(pixels16) _TIFFfree(pixels16);
return (1);
}
-
-#endif /* WITH_TIFF */
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 906704c8406..0fdb84617ad 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -146,16 +146,16 @@ typedef struct PreviewImage {
*
**/
-#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
-/* big endian */
-#define MAKE_ID2(c, d) ( (c)<<8 | (d) )
-#define MOST_SIG_BYTE 0
-#define BBIG_ENDIAN
+#ifdef __BIG_ENDIAN__
+ /* big endian */
+# define MAKE_ID2(c, d) ( (c)<<8 | (d) )
+# define MOST_SIG_BYTE 0
+# define BBIG_ENDIAN
#else
-/* little endian */
-#define MAKE_ID2(c, d) ( (d)<<8 | (c) )
-#define MOST_SIG_BYTE 1
-#define BLITTLE_ENDIAN
+ /* little endian */
+# define MAKE_ID2(c, d) ( (d)<<8 | (c) )
+# define MOST_SIG_BYTE 1
+# define BLITTLE_ENDIAN
#endif
/* ID from database */
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index e94e394d255..35b905a71bf 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -74,6 +74,14 @@ typedef struct VolumeSettings {
float ms_spread;
} VolumeSettings;
+/* Game Engine Options (old Texface mode, transp and flag) */
+typedef struct GameSettings {
+ int flag;
+ int alpha_blend;
+ int face_orientation;
+ int pad1;
+} GameSettings;
+
typedef struct Material {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
@@ -90,6 +98,7 @@ typedef struct Material {
/* end synced with render_types.h */
struct VolumeSettings vol;
+ struct GameSettings game;
float fresnel_mir, fresnel_mir_i;
float fresnel_tra, fresnel_tra_i;
@@ -169,12 +178,39 @@ typedef struct Material {
ListBase gpumaterial; /* runtime */
} Material;
+
+/* **************** GAME PROPERTIES ********************* */
+// Blend Transparency Options - alpha_blend /* match GPU_material::GPUBlendMode */
+#define GEMAT_SOLID 0 /* GPU_BLEND_SOLID */
+#define GEMAT_ADD 1 /* GPU_BLEND_ADD */
+#define GEMAT_ALPHA 2 /* GPU_BLEND_ALPHA */
+#define GEMAT_CLIP 4 /* GPU_BLEND_CLIP */
+#define GEMAT_ALPHA_SORT 8 /* GPU_BLEND_ALPHA_SORT */
+
+// Game Options - flag
+#define GEMAT_BACKCULL 16 /* KX_BACKCULL */
+#define GEMAT_SHADED 32 /* KX_LIGHT */
+#define GEMAT_TEXT 64 /* RAS_RENDER_3DPOLYGON_TEXT */
+#define GEMAT_NOPHYSICS 128
+#define GEMAT_INVISIBLE 256
+
+// Face Orientation Options - face_orientation
+#define GEMAT_NORMAL 0
+#define GEMAT_HALO 512 /* BILLBOARD_SCREENALIGNED */
+#define GEMAT_BILLBOARD 1024 /* BILLBOARD_AXISALIGNED */
+#define GEMAT_SHADOW 2048 /* SHADOW */
+
+// Use Textures - not defined directly in the UI
+#define GEMAT_TEX 4096 /* KX_TEX */
+
+
/* **************** MATERIAL ********************* */
/* maximum number of materials per material array.
* (on object, mesh, lamp, etc.). limited by
- * short mat_nr in verts, faces. */
-#define MAXMAT 32767
+ * short mat_nr in verts, faces.
+ * -1 becayse for active material we store the index + 1 */
+#define MAXMAT (32767-1)
/* material_type */
#define MA_TYPE_SURFACE 0
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 6ad60ac2df9..25bb4958c97 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -125,7 +125,7 @@ typedef struct TFace {
#define ME_EDIT_PAINT_MASK (1 << 3)
#define ME_EDIT_MIRROR_TOPO (1 << 4)
-
+#define ME_EDIT_VERT_SEL (1 << 5)
/* me->flag */
/* #define ME_ISDONE 1 */
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index 61c4a660992..9d7375b6755 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -247,6 +247,8 @@ typedef struct MRecast{
#define TF_SHAREDVERT 8
#define TF_LIGHT 16
+#define TF_CONVERTED 32 /* tface converted to material */
+
#define TF_SHAREDCOL 64
#define TF_TILES 128 /* deprecated */
#define TF_BILLBOARD 256
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index ed060d58123..e9e78ab25d3 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -75,6 +75,7 @@ typedef enum ModifierType {
eModifierType_WeightVGMix,
eModifierType_WeightVGProximity,
eModifierType_NavMesh,
+ eModifierType_DynamicPaint, /* reserve slot */
NUM_MODIFIER_TYPES
} ModifierType;
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 8750ee9e906..f32f8d626de 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -62,9 +62,14 @@ struct bGPdata;
typedef struct bDeformGroup {
struct bDeformGroup *next, *prev;
char name[32];
+ /* need this flag for locking weights */
+ char flag, pad[7];
} bDeformGroup;
#define MAX_VGROUP_NAME 32
+/* bDeformGroup->flag */
+#define DG_LOCK_WEIGHT 1
+
/**
* The following illustrates the orientation of the
* bounding box in local space
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index aa0a41680ec..9bcaf46f0d7 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -764,9 +764,10 @@ typedef struct ToolSettings {
short snap_flag, snap_target;
short proportional, prop_mode;
char proportional_objects; /* proportional edit, object mode */
- char pad[3];
+ char pad[5];
- int auto_normalize; /*auto normalizing mode in wpaint*/
+ char auto_normalize; /*auto normalizing mode in wpaint*/
+ char multipaint; /* paint multiple bones in wpaint */
short sculpt_paint_settings; /* user preferences for sculpt and paint */
short pad1;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index d3ac09dc812..05b16f869a8 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -510,8 +510,8 @@ extern UserDef U; /* from blenkernel blender.c */
/* transopts */
#define USER_TR_TOOLTIPS (1 << 0)
-#define USER_TR_BUTTONS (1 << 1)
-#define USER_TR_MENUS (1 << 2)
+#define USER_TR_IFACE (1 << 1)
+/*#define USER_TR_MENUS (1 << 2) deprecated*/
/*#define USER_TR_FILESELECT (1 << 3) deprecated*/
/*#define USER_TR_TEXTEDIT (1 << 4) deprecated*/
#define USER_DOTRANSLATE (1 << 5)
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 6bf5d33998d..b56c536c0c3 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -49,7 +49,10 @@ struct Scene;
extern BlenderRNA BLENDER_RNA;
extern StructRNA RNA_Action;
extern StructRNA RNA_ActionConstraint;
+extern StructRNA RNA_ActionFCurves;
extern StructRNA RNA_ActionGroup;
+extern StructRNA RNA_ActionGroups;
+extern StructRNA RNA_ActionPoseMarkers;
extern StructRNA RNA_Actuator;
extern StructRNA RNA_ActuatorSensor;
extern StructRNA RNA_Addon;
@@ -190,6 +193,7 @@ extern StructRNA RNA_DelaySensor;
extern StructRNA RNA_DisplaceModifier;
extern StructRNA RNA_DistortedNoiseTexture;
extern StructRNA RNA_DomainFluidSettings;
+extern StructRNA RNA_DopeSheet;
extern StructRNA RNA_Driver;
extern StructRNA RNA_DriverTarget;
extern StructRNA RNA_DriverVariable;
@@ -264,11 +268,13 @@ extern StructRNA RNA_Key;
extern StructRNA RNA_KeyConfig;
extern StructRNA RNA_KeyMap;
extern StructRNA RNA_KeyMapItem;
+extern StructRNA RNA_KeyMapItems;
extern StructRNA RNA_KeyboardSensor;
extern StructRNA RNA_Keyframe;
extern StructRNA RNA_KeyingSet;
extern StructRNA RNA_KeyingSetInfo;
extern StructRNA RNA_KeyingSetPath;
+extern StructRNA RNA_KeyingSetsAll;
extern StructRNA RNA_KinematicConstraint;
extern StructRNA RNA_Lamp;
extern StructRNA RNA_LampSkySettings;
@@ -582,6 +588,7 @@ extern StructRNA RNA_UnknownType;
extern StructRNA RNA_UserPreferences;
extern StructRNA RNA_UserPreferencesEdit;
extern StructRNA RNA_UserPreferencesFilePaths;
+extern StructRNA RNA_UserPreferencesInput;
extern StructRNA RNA_UserPreferencesSystem;
extern StructRNA RNA_UserPreferencesView;
extern StructRNA RNA_UserSolidLight;
@@ -603,13 +610,13 @@ extern StructRNA RNA_WipeSequence;
extern StructRNA RNA_WoodTexture;
extern StructRNA RNA_World;
extern StructRNA RNA_WorldAmbientOcclusion;
+extern StructRNA RNA_WorldLighting;
extern StructRNA RNA_WorldMistSettings;
extern StructRNA RNA_WorldStarsSettings;
extern StructRNA RNA_WorldTextureSlot;
extern StructRNA RNA_XnorController;
extern StructRNA RNA_XorController;
-
/* Pointer
*
* These functions will fill in RNA pointers, this can be done in three ways:
@@ -719,6 +726,7 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name);
int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description);
void RNA_property_enum_items(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free);
+void RNA_property_enum_items_gettexted(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free);
int RNA_property_enum_value(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value);
int RNA_property_enum_identifier(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier);
int RNA_property_enum_name(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **name);
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript
index 10006ddca6b..c80150d558b 100644
--- a/source/blender/makesrna/SConscript
+++ b/source/blender/makesrna/SConscript
@@ -63,4 +63,7 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('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 1910baea6f2..79d4dfd72ca 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -220,6 +220,10 @@ if(WITH_OPENCOLLADA)
add_definitions(-DWITH_COLLADA)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DINTERNATIONAL)
+endif()
+
# Build makesrna executable
blender_include_dirs(
.
diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript
index 5c2580e4b90..ef05875fe86 100644
--- a/source/blender/makesrna/intern/SConscript
+++ b/source/blender/makesrna/intern/SConscript
@@ -98,6 +98,9 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_PTHREADS_INC']
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('INTERNATIONAL')
+
makesrna_tool.Append(CPPDEFINES=defs)
makesrna_tool.Append (CPPPATH = Split(incs))
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 727ab679df5..d4742375989 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -238,7 +238,7 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports,
* owns the string pointer which it could potentually free while blender
* is running. */
if(BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) {
- BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME) ".", identifier);
+ BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " STRINGIFY(MAX_IDPROP_NAME), identifier);
return NULL;
}
@@ -417,16 +417,16 @@ static void rna_def_ID_materials(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials");
func= RNA_def_function(srna, "append", "material_append_id");
- RNA_def_function_ui_description(func, "Add a new material to the data block.");
- parm= RNA_def_pointer(func, "material", "Material", "", "Material to add.");
+ RNA_def_function_ui_description(func, "Add a new material to the data block");
+ parm= RNA_def_pointer(func, "material", "Material", "", "Material to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "pop", "material_pop_id");
- RNA_def_function_ui_description(func, "Remove a material from the data block.");
- parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove.", 0, MAXMAT);
+ RNA_def_function_ui_description(func, "Remove a material from the data block");
+ parm= RNA_def_int(func, "index", 0, 0, MAXMAT, "", "Index of material to remove", 0, MAXMAT);
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned.");
- parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
+ RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned");
+ parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove");
RNA_def_function_return(func, parm);
}
@@ -478,25 +478,26 @@ static void rna_def_ID(BlenderRNA *brna)
/* functions */
func= RNA_def_function(srna, "copy", "rna_ID_copy");
- RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks).");
- parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID.");
+ RNA_def_function_ui_description(func, "Create a copy of this datablock (not supported for all datablocks)");
+ parm= RNA_def_pointer(func, "id", "ID", "", "New copy of the ID");
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, "Clears 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.");
- parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL.");
+ RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this");
+ parm= RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "animation_data_clear", "BKE_free_animdata");
- RNA_def_function_ui_description(func, "Clear animation on this this ID.");
+ RNA_def_function_ui_description(func, "Clear animation on this this ID");
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_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform.");
+ 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");
}
static void rna_def_library(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 1ccd6d9a1d7..b7709416a75 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -43,6 +43,9 @@
#include "BLI_dynstr.h"
#include "BLI_ghash.h"
+#include "BLF_api.h"
+#include "BLF_translation.h"
+
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
@@ -449,8 +452,10 @@ static const char *rna_ensure_property_identifier(PropertyRNA *prop)
static const char *rna_ensure_property_description(PropertyRNA *prop)
{
+ const char *description= NULL;
+
if(prop->magic == RNA_MAGIC)
- return prop->description;
+ description= prop->description;
else {
/* attempt to get the local ID values */
IDProperty *idp_ui= rna_idproperty_ui(prop);
@@ -458,19 +463,36 @@ static const char *rna_ensure_property_description(PropertyRNA *prop)
if(idp_ui) {
IDProperty *item= IDP_GetPropertyTypeFromGroup(idp_ui, "description", IDP_STRING);
if(item)
- return IDP_String(item);
+ description= IDP_String(item);
}
- return ((IDProperty*)prop)->name; /* XXX - not correct */
+ if(description == NULL)
+ description= ((IDProperty*)prop)->name; /* XXX - not correct */
}
+
+#ifdef INTERNATIONAL
+ if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_TOOLTIPS))
+ description= BLF_gettext(description);
+#endif
+
+ return description;
}
static const char *rna_ensure_property_name(PropertyRNA *prop)
{
+ const char *name;
+
if(prop->magic == RNA_MAGIC)
- return prop->name;
+ name= prop->name;
else
- return ((IDProperty*)prop)->name;
+ name= ((IDProperty*)prop)->name;
+
+#ifdef INTERNATIONAL
+ if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE))
+ name= BLF_gettext(name);
+#endif
+
+ return name;
}
/* Structs */
@@ -1125,6 +1147,7 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En
*totitem= tot;
}
+
}
else {
*item= eprop->item;
@@ -1133,6 +1156,45 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En
}
}
+void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free)
+{
+ RNA_property_enum_items(C, ptr, prop, item, totitem, free);
+
+#ifdef INTERNATIONAL
+ if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE)) {
+ int i;
+ EnumPropertyItem *nitem;
+
+ if(*free) {
+ nitem= *item;
+ } else {
+ int totitem= 0;
+
+ /* count */
+ for(i=0; (*item)[i].identifier; i++)
+ totitem++;
+
+ nitem= MEM_callocN(sizeof(EnumPropertyItem)*(totitem+1), "enum_items_gettexted");
+
+ for(i=0; (*item)[i].identifier; i++)
+ nitem[i]= (*item)[i];
+
+ *free= 1;
+ }
+
+ for(i=0; nitem[i].identifier; i++) {
+ if( nitem[i].name )
+ nitem[i].name = BLF_gettext(nitem[i].name);
+ if( nitem[i].description )
+ nitem[i].description = BLF_gettext(nitem[i].description);
+ }
+
+ *item= nitem;
+ }
+#endif
+}
+
+
int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value)
{
EnumPropertyItem *item, *item_array;
@@ -2912,7 +2974,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
itemtype= RNA_property_type(itemprop);
if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
- BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported.");
+ BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported");
return 0;
}
@@ -2923,7 +2985,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
if(RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) {
int arraylen = (itemlen == 0) ? 1 : itemlen;
if(in.len != arraylen*out.len) {
- BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d).", out.len*arraylen, in.len);
+ BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)", out.len*arraylen, in.len);
return 0;
}
@@ -2979,13 +3041,13 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
itemtype= RNA_property_type(iprop);
}
else {
- BKE_reportf(reports, RPT_ERROR, "Property named %s not found.", propname);
+ BKE_reportf(reports, RPT_ERROR, "Property named %s not found", propname);
err= 1;
break;
}
if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) {
- BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported.");
+ BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported");
err= 1;
break;
}
@@ -2994,7 +3056,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro
/* editable check */
if(!set || RNA_property_editable(&itemptr, iprop)) {
if(a+itemlen > in.len) {
- BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more).", in.len);
+ BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more)", in.len);
err= 1;
break;
}
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 69f137c9f20..433db55b1e3 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -495,8 +495,8 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups");
func= RNA_def_function(srna, "new", "rna_Action_groups_new");
- RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
- parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the action group.");
+ RNA_def_function_ui_description(func, "Add a keyframe to the curve");
+ parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the action group");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Newly created action group");
@@ -504,9 +504,9 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "remove", "rna_Action_groups_remove");
- RNA_def_function_ui_description(func, "Remove action group.");
+ RNA_def_function_ui_description(func, "Remove action group");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove.");
+ parm= RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -523,21 +523,21 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Action FCurves", "Collection of action fcurves");
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 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", "FCurve 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_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");
parm= RNA_def_pointer(func, "fcurve", "FCurve", "", "Newly created fcurve");
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_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", "", "FCurve to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -555,18 +555,18 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers");
func= RNA_def_function(srna, "new", "rna_Action_pose_markers_new");
- RNA_def_function_ui_description(func, "Add a pose marker to the action.");
+ RNA_def_function_ui_description(func, "Add a pose marker to the action");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
+ parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove");
- RNA_def_function_ui_description(func, "Remove a timeline marker.");
+ RNA_def_function_ui_description(func, "Remove a timeline marker");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
+ parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c
index 6aff68a9c09..43cf1fae931 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", "Actuator to...");
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", "Actuator to...");
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", "Actuator to...");
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", "Actuator to...");
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", "Actuator to...");
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_actuator_api.c b/source/blender/makesrna/intern/rna_actuator_api.c
index 3c1f78c21c3..c3f9ff35279 100644
--- a/source/blender/makesrna/intern/rna_actuator_api.c
+++ b/source/blender/makesrna/intern/rna_actuator_api.c
@@ -61,14 +61,14 @@ void RNA_api_actuator(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "link", "rna_Actuator_link");
- RNA_def_function_ui_description(func, "Link the actuator to a controller.");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to.");
+ RNA_def_function_ui_description(func, "Link the actuator to a controller");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
func= RNA_def_function(srna, "unlink", "rna_Actuator_unlink");
- RNA_def_function_ui_description(func, "Unlink the actuator from a controller.");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from.");
+ RNA_def_function_ui_description(func, "Unlink the actuator from a controller");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 2f5f22c52d5..702529fde53 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -188,7 +188,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v
return NULL;
if (strlen(identifier) >= sizeof(dummyksi.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering keying set info class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyksi.idname));
+ BKE_reportf(reports, RPT_ERROR, "Registering keying set info class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummyksi.idname));
return NULL;
}
@@ -353,7 +353,7 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *report
keyingset->active_path= BLI_countlist(&keyingset->paths);
}
else {
- BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added.");
+ BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added");
}
/* return added path */
@@ -372,7 +372,7 @@ static void rna_KeyingSet_paths_remove(KeyingSet *keyingset, ReportList *reports
keyingset->active_path = 0;
}
else {
- BKE_report(reports, RPT_ERROR, "Keying Set Path could not be removed.");
+ BKE_report(reports, RPT_ERROR, "Keying Set Path could not be removed");
}
}
@@ -392,7 +392,7 @@ static void rna_KeyingSet_paths_clear(KeyingSet *keyingset, ReportList *reports)
keyingset->active_path = 0;
}
else {
- BKE_report(reports, RPT_ERROR, "Keying Set Paths could not be removed.");
+ BKE_report(reports, RPT_ERROR, "Keying Set Paths could not be removed");
}
}
@@ -608,27 +608,31 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
/* Add Path */
func= RNA_def_function(srna, "add", "rna_KeyingSet_paths_add");
- RNA_def_function_ui_description(func, "Add a new path for the Keying Set.");
+ RNA_def_function_ui_description(func, "Add a new path for the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* return arg */
parm= RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set");
RNA_def_function_return(func, parm);
/* ID-block for target */
- parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination.");
+ parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* rna-path */
- parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough
+ parm= RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property"); // xxx hopefully this is long enough
RNA_def_property_flag(parm, PROP_REQUIRED);
/* index (defaults to -1 for entire array) */
- RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", "The index of the destination property (i.e. axis of Location/Rotation/etc.), or -1 for the entire array.", 0, INT_MAX);
+ RNA_def_int(func, "index", -1, -1, INT_MAX, "Index",
+ "The index of the destination property (i.e. axis of Location/Rotation/etc.), "
+ "or -1 for the entire array", 0, INT_MAX);
/* grouping */
- RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use.");
- RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name).");
+ RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME,
+ "Grouping Method", "Method used to define which Group-name to use");
+ RNA_def_string(func, "group_name", "", 64, "Group Name",
+ "Name of Action Group to assign destination to (only if grouping mode is to use this name)");
/* Remove Path */
func= RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove");
- RNA_def_function_ui_description(func, "Remove the given path from the Keying Set.");
+ RNA_def_function_ui_description(func, "Remove the given path from the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* path to remove */
parm= RNA_def_pointer(func, "path", "KeyingSetPath", "Path", "");
@@ -637,7 +641,7 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
/* Remove All Paths */
func= RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear");
- RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set.");
+ RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
@@ -713,15 +717,15 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "new", "rna_NlaTrack_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
RNA_def_function_ui_description(func, "Add a new NLA Track");
- RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after.");
+ RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after");
/* return type */
- parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track.");
+ parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- RNA_def_function_ui_description(func, "Remove a NLA Track.");
- parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove.");
+ RNA_def_function_ui_description(func, "Remove a NLA Track");
+ parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
@@ -751,7 +755,7 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add a new driver given an existing one");
RNA_def_pointer(func, "src_driver", "FCurve", "", "Existing Driver F-Curve to use as template for a new one");
/* return type */
- parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve.");
+ parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve");
RNA_def_function_return(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 4ed5d2a125a..ec928415876 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -103,7 +103,7 @@ static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value)
EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const char *name)
{
if(arm->edbo==NULL) {
- BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone.", arm->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name+2);
return NULL;
}
return ED_armature_edit_bone_add(arm, name);
@@ -112,12 +112,12 @@ EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const
void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone *ebone)
{
if(arm->edbo==NULL) {
- BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone.", arm->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name+2);
return;
}
if(BLI_findindex(arm->edbo, ebone) == -1) {
- BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'.", arm->id.name+2, ebone->name);
+ BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name+2, ebone->name);
return;
}
@@ -787,7 +787,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop)
/* add target */
func= RNA_def_function(srna, "new", "rna_Armature_edit_bone_new");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Add a new bone.");
+ RNA_def_function_ui_description(func, "Add a new bone");
parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the bone");
RNA_def_property_flag(parm, PROP_REQUIRED);
diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c
index fd9ae7f11c2..b65122835f1 100644
--- a/source/blender/makesrna/intern/rna_armature_api.c
+++ b/source/blender/makesrna/intern/rna_armature_api.c
@@ -62,7 +62,8 @@ void RNA_api_armature_edit_bone(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "align_roll", "rna_EditBone_align_roll");
- RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis points in the direction of the vector given.");
+ RNA_def_function_ui_description(func, "Align the bone to a localspace roll so the Z axis "
+ "points in the direction of the vector given");
parm= RNA_def_float_vector(func, "vector", 3, NULL, -FLT_MAX, FLT_MAX, "Vector", "", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -73,8 +74,9 @@ void RNA_api_bone(StructRNA *srna)
FunctionRNA *func;
func= RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope");
- RNA_def_function_ui_description(func, "Calculate bone envelope at given point.");
- parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
+ RNA_def_function_ui_description(func, "Calculate bone envelope at given point");
+ parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
+ "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index 144509f4743..338c93bb96a 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -487,13 +487,13 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop)
parm= RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "New element.");
+ parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "New element");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove");
RNA_def_function_ui_description(func, "Delete element from ColorRamp");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove.");
+ parm= RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
diff --git a/source/blender/makesrna/intern/rna_controller_api.c b/source/blender/makesrna/intern/rna_controller_api.c
index d9defe3f8aa..4d16633b9cd 100644
--- a/source/blender/makesrna/intern/rna_controller_api.c
+++ b/source/blender/makesrna/intern/rna_controller_api.c
@@ -68,17 +68,17 @@ void RNA_api_controller(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "link", "rna_Controller_link");
- RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator.");
- parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to.");
+ RNA_def_function_ui_description(func, "Link the controller with a sensor/actuator");
+ parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to link the controller to");
RNA_def_property_update(parm, NC_LOGIC, NULL);
- parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to.");
+ parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to link the controller to");
RNA_def_property_update(parm, NC_LOGIC, NULL);
func= RNA_def_function(srna, "unlink", "rna_Controller_unlink");
- RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator.");
- parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from.");
+ RNA_def_function_ui_description(func, "Unlink the controller from a sensor/actuator");
+ parm= RNA_def_pointer(func, "sensor", "Sensor", "", "Sensor to unlink the controller from");
RNA_def_property_update(parm, NC_LOGIC, NULL);
- parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from.");
+ parm= RNA_def_pointer(func, "actuator", "Actuator", "", "Actuator to unlink the controller from");
RNA_def_property_update(parm, NC_LOGIC, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 3cf6feb005c..5d0c1db572d 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -74,6 +74,20 @@ EnumPropertyItem curve_type_items[] = {
{CU_NURBS, "NURBS", 0, "Ease", ""},
{0, NULL, 0, NULL, NULL}};
+static const EnumPropertyItem curve3d_fill_mode_items[]= {
+ {0, "FULL", 0, "Full", ""},
+ {CU_BACK, "BACK", 0, "Back", ""},
+ {CU_FRONT, "FRONT", 0, "Front", ""},
+ {CU_FRONT|CU_BACK, "HALF", 0, "Half", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+static const EnumPropertyItem curve2d_fill_mode_items[]= {
+ {0, "NONE", 0, "None", ""},
+ {CU_BACK, "BACK", 0, "Back", ""},
+ {CU_FRONT, "FRONT", 0, "Front", ""},
+ {CU_FRONT|CU_BACK, "BOTH", 0, "Both", ""},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
#include "BLI_math.h"
@@ -278,6 +292,13 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
}
}
+static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+{
+ Curve *cu= (Curve*)ptr->id.data;
+
+ /* cast to quiet warning it IS a const still */
+ return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items : curve2d_fill_mode_items);
+}
static int rna_Nurb_length(PointerRNA *ptr)
{
@@ -1130,15 +1151,15 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points");
func= RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
- RNA_def_function_ui_description(func, "Add a number of points to this spline.");
+ RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
/*
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
- RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
}
@@ -1157,15 +1178,15 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline bezirt points");
func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
- RNA_def_function_ui_description(func, "Add a number of points to this spline.");
+ RNA_def_function_ui_description(func, "Add a number of points to this spline");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS);
RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
/*
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
- RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
}
@@ -1185,16 +1206,16 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines");
func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
- RNA_def_function_ui_description(func, "Add a new spline to the curve.");
- parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve");
+ parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
- RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
@@ -1345,14 +1366,11 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop= RNA_def_property(srna, "use_fill_front", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT);
- RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves");
- RNA_def_property_update(prop, 0, "rna_Curve_update_data");
-
- prop= RNA_def_property(srna, "use_fill_back", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK);
- RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves");
+ prop= RNA_def_property(srna, "fill_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+ RNA_def_property_enum_items(prop, curve3d_fill_mode_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Curve_fill_mode_itemf");
+ RNA_def_property_ui_text(prop, "Fill Mode", "Mode of filling curve");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "twist_mode", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index c0c8ac6b88a..11eec6a0a47 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -410,7 +410,7 @@ DriverVar *rna_Driver_new_variable(ChannelDriver *driver)
void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *reports, DriverVar *dvar)
{
if(BLI_findindex(&driver->variables, dvar) == -1) {
- BKE_report(reports, RPT_ERROR, "Variable does not exist in this driver.");
+ BKE_report(reports, RPT_ERROR, "Variable does not exist in this driver");
return;
}
@@ -439,7 +439,7 @@ static FModifier *rna_FCurve_modifiers_new(FCurve *fcu, int type)
static void rna_FCurve_modifiers_remove(FCurve *fcu, ReportList *reports, FModifier *fcm)
{
if(BLI_findindex(&fcu->modifiers, fcm) == -1) {
- BKE_reportf(reports, RPT_ERROR, "FCurveModifier '%s' not found in fcurve.", fcm->name);
+ BKE_reportf(reports, RPT_ERROR, "F-Curve modifier '%s' not found in F-Curve", fcm->name);
return;
}
remove_fmodifier(&fcu->modifiers, fcm);
@@ -612,7 +612,7 @@ static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTri
{
int index= (int)(bezt - fcu->bezt);
if (index < 0 || index >= fcu->totvert) {
- BKE_report(reports, RPT_ERROR, "Keyframe not in F-Curve.");
+ BKE_report(reports, RPT_ERROR, "Keyframe not in F-Curve");
return;
}
@@ -1212,17 +1212,17 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop
/* add variable */
func= RNA_def_function(srna, "new", "rna_Driver_new_variable");
- RNA_def_function_ui_description(func, "Add a new variable for the driver.");
+ RNA_def_function_ui_description(func, "Add a new variable for the driver");
/* return type */
- parm= RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable.");
+ parm= RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable");
RNA_def_function_return(func, parm);
/* remove variable */
func= RNA_def_function(srna, "remove", "rna_Driver_remove_variable");
- RNA_def_function_ui_description(func, "Remove an existing variable from the driver.");
+ RNA_def_function_ui_description(func, "Remove an existing variable from the driver");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* target to remove */
- parm= RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver.");
+ parm= RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -1402,17 +1402,17 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_FCurve_modifiers_new");
RNA_def_function_ui_description(func, "Add a constraint to this object");
/* return type */
- parm= RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier.");
+ parm= RNA_def_pointer(func, "fmodifier", "FModifier", "", "New fmodifier");
RNA_def_function_return(func, parm);
/* object to add */
- parm= RNA_def_enum(func, "type", fmodifier_type_items, 1, "", "Constraint type to add.");
+ parm= RNA_def_enum(func, "type", fmodifier_type_items, 1, "", "Constraint type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "remove", "rna_FCurve_modifiers_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a modifier from this fcurve.");
+ RNA_def_function_ui_description(func, "Remove a modifier from this F-Curve");
/* modifier to remove */
- parm= RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier.");
+ parm= RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -1436,25 +1436,25 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Keyframe Points", "Collection of keyframe points");
func= RNA_def_function(srna, "insert", "rna_FKeyframe_points_insert");
- RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve.");
+ RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve");
parm= RNA_def_float(func, "frame", 0.0f, -FLT_MAX, FLT_MAX, "", "X Value of this keyframe point", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "", "Y Value of this keyframe point", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", "Keyframe options.");
+ RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", "Keyframe options");
parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created keyframe");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "add", "rna_FKeyframe_points_add");
- RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve.");
+ RNA_def_function_ui_description(func, "Add a keyframe point to a F-Curve");
RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX);
func= RNA_def_function(srna, "remove", "rna_FKeyframe_points_remove");
- RNA_def_function_ui_description(func, "Remove keyframe from an fcurve.");
+ RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove.");
+ parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* optional */
RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time");
@@ -1569,15 +1569,15 @@ static void rna_def_fcurve(BlenderRNA *brna)
/* Functions */
func= RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */
- RNA_def_function_ui_description(func, "Evaluate fcurve.");
- parm= RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate fcurve at given frame", -FLT_MAX, FLT_MAX);
+ RNA_def_function_ui_description(func, "Evaluate F-Curve");
+ parm= RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate F-Curve at given frame", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
- parm= RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "FCurve position", -FLT_MAX, FLT_MAX);
+ parm= RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "F-Curve position", -FLT_MAX, FLT_MAX);
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "range", "rna_fcurve_range");
- RNA_def_function_ui_description(func, "Get the time extents for F-Curve.");
+ RNA_def_function_ui_description(func, "Get the time extents for F-Curve");
/* return value */
parm= RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", "Min/Max values", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_THICK_WRAP);
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 9811d7bd797..810db9f3634 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -280,16 +280,16 @@ static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
#if 0
func= RNA_def_function(srna, "new", "rna_GPencil_layer_new");
- RNA_def_function_ui_description(func, "Add a new spline to the curve.");
- parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve");
+ parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
- RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
+ parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
#endif
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index 5d71d204a72..597f05ed9f6 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -56,7 +56,7 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter)
static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object)
{
if(!add_to_group(group, object, CTX_data_scene(C), NULL)) {
- BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\".", object->id.name+2, group->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name+2, group->id.name+2);
return;
}
@@ -66,7 +66,7 @@ static void rna_Group_objects_link(Group *group, bContext *C, ReportList *report
static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object)
{
if(!rem_from_group(group, object, CTX_data_scene(C), NULL)) {
- BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\".", object->id.name+2, group->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name+2, group->id.name+2);
return;
}
@@ -94,7 +94,7 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add this object to a group");
/* object to add */
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to add.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to add");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* remove object */
@@ -102,7 +102,7 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Remove this object to a group");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
/* object to remove */
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index 7327c7203b9..b7827989a94 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -37,6 +37,9 @@
#include <time.h>
#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "DNA_packedFile_types.h"
#include "BIF_gl.h"
@@ -127,6 +130,38 @@ static void rna_Image_save(Image *image, ReportList *reports)
}
}
+static void rna_Image_pack(Image *image, ReportList *reports, int as_png)
+{
+ ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
+
+ if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
+ BKE_reportf(reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG");
+ }
+ else {
+ if(as_png) {
+ BKE_image_memorypack(image);
+ }
+ else {
+ image->packedfile= newPackedFile(reports, image->name);
+ }
+ }
+}
+
+static void rna_Image_unpack(Image *image, ReportList *reports, int method)
+{
+ if (!image->packedfile) {
+ BKE_report(reports, RPT_ERROR, "Image not packed");
+ }
+ else if (image->source==IMA_SRC_SEQUENCE || image->source==IMA_SRC_MOVIE) {
+ BKE_report(reports, RPT_ERROR, "Unpacking movies or image sequences not supported");
+ return;
+ }
+ else {
+ /* reports its own error on failier */
+ unpackImage (reports, image, method);
+ }
+}
+
static void rna_Image_reload(Image *image)
{
BKE_image_signal(image, NULL, IMA_SIGNAL_RELOAD);
@@ -203,7 +238,7 @@ void RNA_api_image(StructRNA *srna)
func= RNA_def_function(srna, "save_render", "rna_Image_save_render");
RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path.");
+ parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from");
@@ -211,6 +246,16 @@ void RNA_api_image(StructRNA *srna)
RNA_def_function_ui_description(func, "Save image to its source path");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ func= RNA_def_function(srna, "pack", "rna_Image_pack");
+ RNA_def_function_ui_description(func, "Pack an image as embedded data into the .blend file");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_boolean(func, "as_png", 0, "as_png", "Pack the image as PNG (needed for generated/dirty images)");
+
+ func= RNA_def_function(srna, "unpack", "rna_Image_unpack");
+ RNA_def_function_ui_description(func, "Save an image packed in the .blend file to disk");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_enum(func, "method", unpack_method_items, PF_USE_LOCAL, "method", "How to unpack");
+
func= RNA_def_function(srna, "reload", "rna_Image_reload");
RNA_def_function_ui_description(func, "Reload the image from its source path");
@@ -221,8 +266,10 @@ void RNA_api_image(StructRNA *srna)
func= RNA_def_function(srna, "gl_load", "rna_Image_gl_load");
RNA_def_function_ui_description(func, "Load the image into OpenGL graphics memory");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter", "The texture minifying function", -INT_MAX, INT_MAX);
- RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification", "The texture magnification function", -INT_MAX, INT_MAX);
+ RNA_def_int(func, "filter", GL_LINEAR_MIPMAP_NEAREST, -INT_MAX, INT_MAX, "Filter",
+ "The texture minifying function", -INT_MAX, INT_MAX);
+ RNA_def_int(func, "mag", GL_LINEAR, -INT_MAX, INT_MAX, "Magnification",
+ "The texture magnification function", -INT_MAX, INT_MAX);
/* return value */
parm= RNA_def_int(func, "error", 0, -INT_MAX, INT_MAX, "Error", "OpenGL error value", -INT_MAX, INT_MAX);
RNA_def_function_return(func, parm);
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index c7ff420b3ad..04ad1fa0eef 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -287,34 +287,34 @@ void RNA_def_main(BlenderRNA *brna)
/* plural must match idtypes in readblenentry.c */
MainCollectionDef lists[]= {
- {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks.", RNA_def_main_cameras},
- {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", RNA_def_main_scenes},
- {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks.", RNA_def_main_objects},
- {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks.", RNA_def_main_materials},
- {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks.", RNA_def_main_node_groups},
- {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks.", RNA_def_main_meshes},
- {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks.", RNA_def_main_lamps},
- {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks.", RNA_def_main_libraries},
- {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks.", RNA_def_main_screens},
- {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks.", RNA_def_main_window_managers},
- {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks.", RNA_def_main_images},
- {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks.", RNA_def_main_lattices},
- {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks.", RNA_def_main_curves} ,
- {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks.", RNA_def_main_metaballs},
- {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font datablocks.", RNA_def_main_fonts},
- {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks.", RNA_def_main_textures},
- {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", RNA_def_main_brushes},
- {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", RNA_def_main_worlds},
- {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", RNA_def_main_groups},
- {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks.", NULL},
- {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED).", NULL},
- {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", RNA_def_main_texts},
- {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks.", RNA_def_main_speakers},
- {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", RNA_def_main_sounds},
- {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", RNA_def_main_armatures},
- {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", RNA_def_main_actions},
- {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", RNA_def_main_particles},
- {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", RNA_def_main_gpencil},
+ {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks", RNA_def_main_cameras},
+ {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks", RNA_def_main_scenes},
+ {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks", RNA_def_main_objects},
+ {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks", RNA_def_main_materials},
+ {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks", RNA_def_main_node_groups},
+ {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks", RNA_def_main_meshes},
+ {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks", RNA_def_main_lamps},
+ {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks", RNA_def_main_libraries},
+ {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks", RNA_def_main_screens},
+ {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks", RNA_def_main_window_managers},
+ {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks", RNA_def_main_images},
+ {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks", RNA_def_main_lattices},
+ {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves} ,
+ {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks", RNA_def_main_metaballs},
+ {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font datablocks", RNA_def_main_fonts},
+ {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks", RNA_def_main_textures},
+ {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks", RNA_def_main_brushes},
+ {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks", RNA_def_main_worlds},
+ {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks", RNA_def_main_groups},
+ {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key datablocks", NULL},
+ {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks (DEPRECATED)", NULL},
+ {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks", RNA_def_main_texts},
+ {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks", RNA_def_main_speakers},
+ {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks", RNA_def_main_sounds},
+ {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks", RNA_def_main_armatures},
+ {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks", RNA_def_main_actions},
+ {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks", RNA_def_main_particles},
+ {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil},
{"linestyles", "FreestyleLineStyle", "rna_Main_linestyle_begin", "Line Styles", "Line Style datablocks.", RNA_def_main_linestyles},
{NULL, NULL, NULL, NULL, NULL, NULL}};
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 505ddfaefbf..c0613310b60 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -104,7 +104,8 @@ void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *ca
if(ID_REAL_USERS(camera) <= 0)
free_libblock(&bmain->camera, camera);
else
- BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d.", camera->id.name+2, ID_REAL_USERS(camera));
+ BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d",
+ camera->id.name+2, ID_REAL_USERS(camera));
/* XXX python now has invalid pointer? */
}
@@ -123,7 +124,7 @@ void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struc
else if(scene->id.next)
newscene= scene->id.next;
else {
- BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed.", scene->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name+2);
return;
}
@@ -169,7 +170,7 @@ Object *rna_Main_objects_new(Main *UNUSED(bmain), ReportList *reports, const cha
if(RNA_enum_id_from_value(id_type_items, GS(data->name), &idname) == 0)
idname= "UNKNOWN";
- BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for a object.", idname);
+ BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for a object", idname);
return NULL;
}
}
@@ -193,7 +194,8 @@ void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *ob
free_libblock(&bmain->object, object);
}
else {
- BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d.", object->id.name+2, ID_REAL_USERS(object));
+ BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d",
+ object->id.name+2, ID_REAL_USERS(object));
}
}
@@ -208,7 +210,8 @@ void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material
if(ID_REAL_USERS(material) <= 0)
free_libblock(&bmain->mat, material);
else
- BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d.", material->id.name+2, ID_REAL_USERS(material));
+ BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d",
+ material->id.name+2, ID_REAL_USERS(material));
/* XXX python now has invalid pointer? */
}
@@ -225,7 +228,8 @@ void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree
if(ID_REAL_USERS(tree) <= 0)
free_libblock(&bmain->nodetree, tree);
else
- BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d.", tree->id.name+2, ID_REAL_USERS(tree));
+ BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d",
+ tree->id.name+2, ID_REAL_USERS(tree));
/* XXX python now has invalid pointer? */
}
@@ -241,7 +245,8 @@ void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh)
if(ID_REAL_USERS(mesh) <= 0)
free_libblock(&bmain->mesh, mesh);
else
- BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d.", mesh->id.name+2, ID_REAL_USERS(mesh));
+ BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d",
+ mesh->id.name+2, ID_REAL_USERS(mesh));
/* XXX python now has invalid pointer? */
}
@@ -258,7 +263,8 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp)
if(ID_REAL_USERS(lamp) <= 0)
free_libblock(&bmain->lamp, lamp);
else
- BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d.", lamp->id.name+2, ID_REAL_USERS(lamp));
+ BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d",
+ lamp->id.name+2, ID_REAL_USERS(lamp));
/* XXX python now has invalid pointer? */
}
@@ -278,7 +284,8 @@ Image *rna_Main_images_load(Main *UNUSED(bmain), ReportList *reports, const char
ima= BKE_add_image_file(filepath);
if(!ima)
- BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported image format");
+ BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
+ errno ? strerror(errno) : "Unsupported image format");
return ima;
}
@@ -287,7 +294,8 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image)
if(ID_REAL_USERS(image) <= 0)
free_libblock(&bmain->image, image);
else
- BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d.", image->id.name+2, ID_REAL_USERS(image));
+ BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d",
+ image->id.name+2, ID_REAL_USERS(image));
/* XXX python now has invalid pointer? */
}
@@ -303,7 +311,8 @@ void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice *
if(ID_REAL_USERS(lt) <= 0)
free_libblock(&bmain->latt, lt);
else
- BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d.", lt->id.name+2, ID_REAL_USERS(lt));
+ BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d",
+ lt->id.name+2, ID_REAL_USERS(lt));
}
Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type)
@@ -317,7 +326,8 @@ void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu)
if(ID_REAL_USERS(cu) <= 0)
free_libblock(&bmain->curve, cu);
else
- BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d.", cu->id.name+2, ID_REAL_USERS(cu));
+ BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d",
+ cu->id.name+2, ID_REAL_USERS(cu));
}
MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name)
@@ -331,7 +341,8 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall
if(ID_REAL_USERS(mb) <= 0)
free_libblock(&bmain->mball, mb);
else
- BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb));
+ BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d",
+ mb->id.name+2, ID_REAL_USERS(mb));
}
VFont *rna_Main_fonts_load(Main *UNUSED(bmain), ReportList *reports, const char *filepath)
@@ -342,7 +353,8 @@ VFont *rna_Main_fonts_load(Main *UNUSED(bmain), ReportList *reports, const char
font= load_vfont(filepath);
if(!font)
- BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unsupported font format");
+ BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
+ errno ? strerror(errno) : "Unsupported font format");
return font;
@@ -352,7 +364,8 @@ void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont)
if(ID_REAL_USERS(vfont) <= 0)
free_libblock(&bmain->vfont, vfont);
else
- BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d.", vfont->id.name+2, ID_REAL_USERS(vfont));
+ BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d",
+ vfont->id.name+2, ID_REAL_USERS(vfont));
/* XXX python now has invalid pointer? */
}
@@ -369,7 +382,8 @@ void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex)
if(ID_REAL_USERS(tex) <= 0)
free_libblock(&bmain->tex, tex);
else
- BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d.", tex->id.name+2, ID_REAL_USERS(tex));
+ BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d",
+ tex->id.name+2, ID_REAL_USERS(tex));
}
Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name)
@@ -383,7 +397,8 @@ void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *bru
if(ID_REAL_USERS(brush) <= 0)
free_libblock(&bmain->brush, brush);
else
- BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d.", brush->id.name+2, ID_REAL_USERS(brush));
+ BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d",
+ brush->id.name+2, ID_REAL_USERS(brush));
}
World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name)
@@ -397,7 +412,8 @@ void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *worl
if(ID_REAL_USERS(world) <= 0)
free_libblock(&bmain->world, world);
else
- BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d.", world->id.name+2, ID_REAL_USERS(world));
+ BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d",
+ world->id.name+2, ID_REAL_USERS(world));
}
Group *rna_Main_groups_new(Main *UNUSED(bmain), const char *name)
@@ -422,7 +438,8 @@ void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker
if(ID_REAL_USERS(speaker) <= 0)
free_libblock(&bmain->speaker, speaker);
else
- BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d.", speaker->id.name+2, ID_REAL_USERS(speaker));
+ BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d",
+ speaker->id.name+2, ID_REAL_USERS(speaker));
/* XXX python now has invalid pointer? */
}
@@ -446,7 +463,8 @@ Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath
txt= add_text(filepath, bmain->name);
if(!txt)
- BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to load text");
+ BKE_reportf(reports, RPT_ERROR, "Can't read: \"%s\", %s", filepath,
+ errno ? strerror(errno) : "Unable to load text");
return txt;
}
@@ -462,7 +480,8 @@ void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm)
if(ID_REAL_USERS(arm) <= 0)
free_libblock(&bmain->armature, arm);
else
- BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d.", arm->id.name+2, ID_REAL_USERS(arm));
+ BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d",
+ arm->id.name+2, ID_REAL_USERS(arm));
/* XXX python now has invalid pointer? */
}
@@ -479,7 +498,8 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act)
if(ID_REAL_USERS(act) <= 0)
free_libblock(&bmain->action, act);
else
- BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d.", act->id.name+2, ID_REAL_USERS(act));
+ BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d",
+ act->id.name+2, ID_REAL_USERS(act));
/* XXX python now has invalid pointer? */
}
@@ -495,7 +515,8 @@ void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSetting
if(ID_REAL_USERS(part) <= 0)
free_libblock(&bmain->particle, part);
else
- BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d.", part->id.name+2, ID_REAL_USERS(part));
+ BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d",
+ part->id.name+2, ID_REAL_USERS(part));
/* XXX python now has invalid pointer? */
}
@@ -559,10 +580,10 @@ void RNA_api_main(StructRNA *srna)
* for now they are all in collections bpy.data.images.new(...) */
/*
func= RNA_def_function(srna, "add_image", "rna_Main_add_image");
- RNA_def_function_ui_description(func, "Add a new image.");
- parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from.");
+ RNA_def_function_ui_description(func, "Add a new image");
+ parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "image", "Image", "", "New image.");
+ parm= RNA_def_pointer(func, "image", "Image", "", "New image");
RNA_def_function_return(func, parm);
*/
@@ -581,16 +602,16 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_cameras_new");
RNA_def_function_ui_description(func, "Add a new camera to the main database");
- parm= RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Camera", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock.");
+ parm= RNA_def_pointer(func, "camera", "Camera", "", "New camera datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_cameras_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a camera from the current blendfile.");
- parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove.");
+ RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
+ parm= RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
@@ -611,16 +632,16 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_scenes_new");
RNA_def_function_ui_description(func, "Add a new scene to the main database");
- parm= RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Scene", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock.");
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "New scene datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a scene from the current blendfile.");
- parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove.");
+ RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -638,19 +659,19 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_objects_new");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new object to the main database");
- parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Object", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object.");
+ parm= RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "object", "Object", "", "New object datablock.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "New object datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_objects_remove");
- RNA_def_function_ui_description(func, "Remove a object from the current blendfile.");
+ RNA_def_function_ui_description(func, "Remove a object from the current blendfile");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_objects_tag");
@@ -671,16 +692,16 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_materials_new");
RNA_def_function_ui_description(func, "Add a new material to the main database");
- parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Material", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock.");
+ parm= RNA_def_pointer(func, "material", "Material", "", "New material datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_materials_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a material from the current blendfile.");
- parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove.");
+ RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
+ parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_materials_tag");
@@ -706,18 +727,18 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_nodetree_new");
RNA_def_function_ui_description(func, "Add a new node tree to the main database");
- parm= RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "type", node_nodetree_items, 0, "Type", "The type of node_group to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock.");
+ parm= RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_nodetree_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile.");
- parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove.");
+ RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
+ parm= RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
@@ -737,16 +758,16 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_meshes_new");
RNA_def_function_ui_description(func, "Add a new mesh to the main database");
- parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock.");
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_meshes_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile.");
- parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove.");
+ RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
@@ -766,18 +787,18 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_lamps_new");
RNA_def_function_ui_description(func, "Add a new lamp to the main database");
- parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Lamp", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "type", lamp_type_items, 0, "Type", "The type of texture to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock.");
+ parm= RNA_def_pointer(func, "lamp", "Lamp", "", "New lamp datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_lamps_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile.");
- parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove.");
+ RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile");
+ parm= RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_lamps_tag");
@@ -845,31 +866,31 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_images_new");
RNA_def_function_ui_description(func, "Add a new image to the main database");
- parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Image", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image.", 0, INT_MAX);
+ parm= RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image.", 0, INT_MAX);
+ parm= RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
RNA_def_boolean(func, "float_buffer", 0, "Float Buffer", "Create an image with floating point color");
/* return type */
- parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
+ parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "load", "rna_Main_images_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Load a new image into the main database");
- parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load.");
+ parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the file to load");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock.");
+ parm= RNA_def_pointer(func, "image", "Image", "", "New image datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_images_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove an image from the current blendfile.");
- parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove.");
+ RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
+ parm= RNA_def_pointer(func, "image", "Image", "", "Image to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_images_tag");
@@ -890,16 +911,16 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_lattices_new");
RNA_def_function_ui_description(func, "Add a new lattice to the main database");
- parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Lattice", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock.");
+ parm= RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_lattices_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile.");
- parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove.");
+ RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
+ parm= RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
@@ -919,18 +940,18 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_curves_new");
RNA_def_function_ui_description(func, "Add a new curve to the main database");
- parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Curve", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "type", object_type_curve_items, 0, "Type", "The type of curve to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock.");
+ parm= RNA_def_pointer(func, "curve", "Curve", "", "New curve datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_curves_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a curve from the current blendfile.");
- parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove.");
+ RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
+ parm= RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_curves_tag");
@@ -950,16 +971,16 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_metaballs_new");
RNA_def_function_ui_description(func, "Add a new metaball to the main database");
- parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock.");
+ parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_metaballs_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile.");
- parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove.");
+ RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
+ parm= RNA_def_pointer(func, "metaball", "MetaBall", "", "MetaBall to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
@@ -980,16 +1001,16 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "load", "rna_Main_fonts_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Load a new font into the main database");
- parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load.");
+ parm= RNA_def_string_file_path(func, "filepath", "File Path", 0, "", "path of the font to load");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock.");
+ parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "New font datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_fonts_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a font from the current blendfile.");
- parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove.");
+ RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
+ parm= RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
@@ -1009,18 +1030,18 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_textures_new");
RNA_def_function_ui_description(func, "Add a new texture to the main database");
- parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Texture", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_enum(func, "type", texture_type_items, 0, "Type", "The type of texture to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock.");
+ parm= RNA_def_pointer(func, "texture", "Texture", "", "New texture datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_textures_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a texture from the current blendfile.");
- parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove.");
+ RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
+ parm= RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_textures_tag");
@@ -1040,16 +1061,16 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_brushes_new");
RNA_def_function_ui_description(func, "Add a new brush to the main database");
- parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Brush", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock.");
+ parm= RNA_def_pointer(func, "brush", "Brush", "", "New brush datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_brushes_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a brush from the current blendfile.");
- parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove.");
+ RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
+ parm= RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
@@ -1070,16 +1091,16 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_worlds_new");
RNA_def_function_ui_description(func, "Add a new world to the main database");
- parm= RNA_def_string(func, "name", "World", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "World", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "world", "World", "", "New world datablock.");
+ parm= RNA_def_pointer(func, "world", "World", "", "New world datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_worlds_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a world from the current blendfile.");
- parm= RNA_def_pointer(func, "world", "World", "", "World to remove.");
+ RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
+ parm= RNA_def_pointer(func, "world", "World", "", "World to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
@@ -1100,15 +1121,15 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_groups_new");
RNA_def_function_ui_description(func, "Add a new group to the main database");
- parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock.");
+ parm= RNA_def_pointer(func, "group", "Group", "", "New group datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_groups_remove");
- RNA_def_function_ui_description(func, "Remove a group from the current blendfile.");
- parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove.");
+ RNA_def_function_ui_description(func, "Remove a group from the current blendfile");
+ parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_groups_tag");
@@ -1129,16 +1150,16 @@ void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_speakers_new");
RNA_def_function_ui_description(func, "Add a new speaker to the main database");
- parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Speaker", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock.");
+ parm= RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_speakers_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile.");
- parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove.");
+ RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
+ parm= RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
@@ -1159,25 +1180,25 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_texts_new");
RNA_def_function_ui_description(func, "Add a new text to the main database");
- parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Text", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
+ parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_texts_remove");
- RNA_def_function_ui_description(func, "Remove a text from the current blendfile.");
- parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove.");
+ RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
+ parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* load func */
func= RNA_def_function(srna, "load", "rna_Main_texts_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
- parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
+ parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
+ parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "tag", "rna_Main_texts_tag");
@@ -1216,16 +1237,16 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_armatures_new");
RNA_def_function_ui_description(func, "Add a new armature to the main database");
- parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Armature", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock.");
+ parm= RNA_def_pointer(func, "armature", "Armature", "", "New armature datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_armatures_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a armature from the current blendfile.");
- parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove.");
+ RNA_def_function_ui_description(func, "Remove a armature from the current blendfile");
+ parm= RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
@@ -1245,16 +1266,16 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_actions_new");
RNA_def_function_ui_description(func, "Add a new action to the main database");
- parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "Action", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock.");
+ parm= RNA_def_pointer(func, "action", "Action", "", "New action datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_actions_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a action from the current blendfile.");
- parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove.");
+ RNA_def_function_ui_description(func, "Remove a action from the current blendfile");
+ parm= RNA_def_pointer(func, "action", "Action", "", "Action to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_actions_tag");
@@ -1274,16 +1295,16 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Main_particles_new");
RNA_def_function_ui_description(func, "Add a new particle settings instance to the main database");
- parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock.");
+ parm= RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock.");
+ parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "New particle settings datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_particles_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile.");
- parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove.");
+ RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile");
+ parm= RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "tag", "rna_Main_particles_tag");
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index f407aba82fb..673e768e71e 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -45,7 +45,8 @@ static EnumPropertyItem prop_texture_coordinates_items[] = {
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates"},
{TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates"},
{TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object"},
-{TEXCO_STRAND, "STRAND", 0, "Strand / Particle", "Uses normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
+{TEXCO_STRAND, "STRAND", 0, "Strand / Particle",
+ "Uses normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"},
{TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates"},
{TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates"},
{TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates"},
@@ -279,7 +280,8 @@ static void rna_Material_use_nodes_set(PointerRNA *ptr, int value)
ED_node_shader_default(ma);
}
-static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free)
+static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+ PropertyRNA *UNUSED(prop), int *free)
{
Material *ma= (Material*)ptr->id.data;
EnumPropertyItem *item= NULL;
@@ -447,12 +449,14 @@ static void rna_def_material_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_from_dupli", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_DUPLI_MAPTO);
- RNA_def_property_ui_text(prop, "From Dupli", "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent");
+ RNA_def_property_ui_text(prop, "From Dupli",
+ "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent");
RNA_def_property_update(prop, 0, "rna_Material_update");
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");
+ RNA_def_property_ui_text(prop, "From Original",
+ "Dupli's derive their object coordinates from the original objects transformation");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE);
@@ -651,7 +655,8 @@ static void rna_def_material_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_map_color_transmission", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSMISSION_COL);
- RNA_def_property_ui_text(prop, "Transmission Color", "Causes the texture to affect the result color after other light has been scattered/absorbed");
+ RNA_def_property_ui_text(prop, "Transmission Color",
+ "Causes the texture to affect the result color after other light has been scattered/absorbed");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE);
@@ -689,7 +694,8 @@ static void rna_def_material_mtex(BlenderRNA *brna)
prop= RNA_def_property(srna, "transmission_color_factor", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "coltransfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
- RNA_def_property_ui_text(prop, "Transmission Color Factor", "Amount texture affects result color after light has been scattered/absorbed");
+ RNA_def_property_ui_text(prop, "Transmission Color Factor",
+ "Amount texture affects result color after light has been scattered/absorbed");
RNA_def_property_update(prop, NC_TEXTURE, NULL);
prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE);
@@ -736,6 +742,61 @@ static void rna_def_material_mtex(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Material_update");
}
+static void rna_def_material_gamesettings(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static EnumPropertyItem prop_alpha_blend_items[] = {
+ {GEMAT_SOLID, "OPAQUE", 0, "Opaque", "Render color of textured face as color"},
+ {GEMAT_ADD, "ADD", 0, "Add", "Render face transparent and add color of face"},
+ {GEMAT_CLIP, "CLIP", 0, "Alpha Clip", "Use the image alpha values clipped with no blending (binary alpha)"},
+ {GEMAT_ALPHA, "ALPHA", 0, "Alpha Blend", "Render polygon transparent, depending on alpha channel of the texture"},
+ {GEMAT_ALPHA_SORT, "ALPHA_SORT", 0, "Alpha Sort", "Sort faces for correct alpha drawing (slow, use Alpha Clip instead when possible)"},
+ {0, NULL, 0, NULL, NULL}};
+
+ static EnumPropertyItem prop_face_orientation_items[] = {
+ {GEMAT_NORMAL,"NORMAL",0,"Normal","No tranformation"},
+ {GEMAT_HALO, "HALO", 0, "Halo", "Screen aligned billboard"},
+ {GEMAT_BILLBOARD, "BILLBOARD", 0, "Billboard", "Billboard with Z-axis constraint"},
+ {GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"},
+ {0, NULL, 0, NULL, NULL}};
+
+ srna= RNA_def_struct(brna, "MaterialGameSettings", NULL);
+ RNA_def_struct_sdna(srna, "GameSettings");
+ 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);
+ 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_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_TEXT); /* use bitflags */
+ RNA_def_property_ui_text(prop, "Text", "Use material as text in Game Engine ");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_INVISIBLE); /* use bitflags */
+ RNA_def_property_ui_text(prop, "Invisible", "Make face invisible");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "alpha_blend", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "alpha_blend");
+ RNA_def_property_enum_items(prop, prop_alpha_blend_items);
+ RNA_def_property_ui_text(prop, "Blend Mode", "Blend Mode for Transparent Faces");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
+ prop= RNA_def_property(srna, "face_orientation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, prop_face_orientation_items);
+ RNA_def_property_ui_text(prop, "Face Orientations", "Especial face orientation options");
+
+ prop= RNA_def_property(srna, "physics", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GEMAT_NOPHYSICS); /* use bitflags */
+ RNA_def_property_ui_text(prop, "Physics", "Use physics properties of materials ");
+}
+
static void rna_def_material_colors(StructRNA *srna)
{
PropertyRNA *prop;
@@ -938,13 +999,15 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections");
+ RNA_def_property_ui_text(prop, "Gloss Amount",
+ "The shininess of the reflection (values < 1.0 give diffuse, blurry reflections)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Gloss Anisotropy", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent");
+ RNA_def_property_ui_text(prop, "Gloss Anisotropy",
+ "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
@@ -956,7 +1019,9 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped");
+ RNA_def_property_ui_text(prop, "Gloss Threshold",
+ "Threshold for adaptive sampling (if a sample contributes less than "
+ "this amount [as a percentage], sampling is stopped)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
@@ -968,13 +1033,17 @@ static void rna_def_material_raymirror(BlenderRNA *brna)
prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "dist_mir");
RNA_def_property_range(prop, 0.0f, 10000.0f);
- RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color");
+ RNA_def_property_ui_text(prop, "Maximum Distance",
+ "Maximum distance of reflected rays (reflections further than this "
+ "range fade to sky color or material color)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir");
RNA_def_property_enum_items(prop, prop_fadeto_mir_items);
- RNA_def_property_ui_text(prop, "Fade-out Color", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor");
+ RNA_def_property_ui_text(prop, "Fade-out Color",
+ "The color that rays with no intersection within the Max Distance take "
+ "(material color can be best for indoor scenes, sky color for outdoor)");
RNA_def_property_update(prop, 0, "rna_Material_update");
}
@@ -1009,7 +1078,8 @@ static void rna_def_material_raytra(BlenderRNA *brna)
prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "gloss_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions");
+ RNA_def_property_ui_text(prop, "Gloss Amount",
+ "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
@@ -1021,7 +1091,9 @@ static void rna_def_material_raytra(BlenderRNA *brna)
prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped");
+ RNA_def_property_ui_text(prop, "Gloss Threshold",
+ "Threshold for adaptive sampling. If a sample contributes less than "
+ "this amount (as a percentage), sampling is stopped");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
@@ -1033,13 +1105,17 @@ static void rna_def_material_raytra(BlenderRNA *brna)
prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "filter");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Filter", "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption)");
+ RNA_def_property_ui_text(prop, "Filter",
+ "Amount to blend in the material's diffuse color in raytraced "
+ "transparency (simulating absorption)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "depth_max", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "tx_limit");
RNA_def_property_range(prop, 0.0f, 100.0f);
- RNA_def_property_ui_text(prop, "Limit", "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled)");
+ RNA_def_property_ui_text(prop, "Limit",
+ "Maximum depth for light to travel through the transparent material "
+ "before becoming fully filtered (0.0 is disabled)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE);
@@ -1099,13 +1175,16 @@ static void rna_def_material_volume(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_light_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */
- RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy");
+ RNA_def_property_ui_text(prop, "Light Cache",
+ "Pre-calculate the shading information into a voxel grid, "
+ "speeds up shading at slightly less accuracy");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "precache_resolution");
RNA_def_property_range(prop, 1, 1024);
- RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory");
+ RNA_def_property_ui_text(prop, "Resolution",
+ "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE);
@@ -1130,7 +1209,9 @@ static void rna_def_material_volume(BlenderRNA *brna)
prop= RNA_def_property(srna, "depth_threshold", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "depth_cutoff");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy");
+ RNA_def_property_ui_text(prop, "Depth Cutoff",
+ "Stop ray marching early if transmission drops below this luminance - "
+ "higher values give speedups in dense volumes at the expense of accuracy");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR);
@@ -1150,26 +1231,31 @@ static void rna_def_material_volume(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "scattering");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
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 ");
+ 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 ");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "transmission_col");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Transmission Color", "Result color of the volume, after other light has been scattered/absorbed");
+ RNA_def_property_ui_text(prop, "Transmission Color",
+ "Result color of the volume, after other light has been scattered/absorbed");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "reflection_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "reflection_col");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Reflection Color", "Color of light scattered out of the volume (does not affect transmission)");
+ RNA_def_property_ui_text(prop, "Reflection Color",
+ "Color of light scattered out of the volume (does not affect transmission)");
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
prop= RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "reflection");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1 ,3);
- RNA_def_property_ui_text(prop, "Reflection", "Multiplier to make out-scattered light brighter or darker (non-physically correct)");
+ RNA_def_property_ui_text(prop, "Reflection",
+ "Multiplier to make out-scattered light brighter or darker (non-physically correct)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR);
@@ -1329,7 +1415,8 @@ static void rna_def_material_sss(BlenderRNA *brna)
srna= RNA_def_struct(brna, "MaterialSubsurfaceScattering", NULL);
RNA_def_struct_sdna(srna, "Material");
RNA_def_struct_nested(brna, srna, "Material");
- RNA_def_struct_ui_text(srna, "Material Subsurface Scattering", "Diffuse subsurface scattering settings for a Material datablock");
+ RNA_def_struct_ui_text(srna, "Material Subsurface Scattering",
+ "Diffuse subsurface scattering settings for a Material datablock");
prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH);
RNA_def_property_float_sdna(prop, NULL, "sss_radius");
@@ -1545,7 +1632,8 @@ static void rna_def_material_physics(BlenderRNA *brna)
/* FH/Force Field Settings */
prop= RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "dynamode", MA_FH_NOR);
- RNA_def_property_ui_text(prop, "Align to Normal", "Align dynamic game objects along the surface normal, when inside the physics distance area");
+ RNA_def_property_ui_text(prop, "Align to Normal",
+ "Align dynamic game objects along the surface normal, when inside the physics distance area");
prop= RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fh");
@@ -1594,11 +1682,13 @@ void RNA_def_material(BlenderRNA *brna)
static EnumPropertyItem prop_shadows_only_items[] = {
{MA_SO_OLD, "SHADOW_ONLY_OLD", 0, "Shadow and Distance", "Old shadow only method"},
{MA_SO_SHADOW, "SHADOW_ONLY", 0, "Shadow Only", "Improved shadow only method"},
- {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading", "Improved shadow only method which also renders lightless areas as shadows"},
+ {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading",
+ "Improved shadow only method which also renders lightless areas as shadows"},
{0, NULL, 0, NULL, NULL}};
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");
+ RNA_def_struct_ui_text(srna, "Material",
+ "Material datablock to defined 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);
@@ -1645,7 +1735,8 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_cubic", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC);
- RNA_def_property_ui_text(prop, "Cubic Interpolation", "Use cubic interpolation for diffuse values, for smoother transitions");
+ RNA_def_property_ui_text(prop, "Cubic Interpolation",
+ "Use cubic interpolation for diffuse values, for smoother transitions");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_object_color", PROP_BOOLEAN, PROP_NONE);
@@ -1656,7 +1747,8 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "sbias");
RNA_def_property_range(prop, 0, 0.25);
- RNA_def_property_ui_text(prop, "Shadow Ray Bias", "Shadow raytracing bias to prevent terminator problems on shadow boundary");
+ RNA_def_property_ui_text(prop, "Shadow Ray Bias",
+ "Shadow raytracing bias to prevent terminator problems on shadow boundary");
prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "lbias");
@@ -1666,7 +1758,8 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "shadow_cast_alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "shad_alpha");
RNA_def_property_range(prop, 0.001, 1);
- RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, in use for Irregular and Deep shadow buffer");
+ RNA_def_property_ui_text(prop, "Shadow Casting Alpha",
+ "Shadow casting alpha, in use for Irregular and Deep shadow buffer");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE);
@@ -1685,12 +1778,14 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_light_group_exclusive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY);
- RNA_def_property_ui_text(prop, "Light Group Exclusive", "Material uses the light group exclusively - these lamps are excluded from other scene lighting");
+ RNA_def_property_ui_text(prop, "Light Group Exclusive",
+ "Material uses the light group exclusively - these lamps are excluded from other scene lighting");
RNA_def_property_update(prop, 0, "rna_Material_update");
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");
+ RNA_def_property_ui_text(prop, "Traceable",
+ "Include this material and geometry that uses it in ray tracing calculations");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE);
@@ -1710,7 +1805,9 @@ 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 'texture face' face assigned textures)");
+ RNA_def_property_ui_text(prop, "Vertex Color Paint",
+ "Replaces object base color with vertex colors (multiplies 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);
@@ -1725,12 +1822,15 @@ void RNA_def_material(BlenderRNA *brna)
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)");
+ RNA_def_property_ui_text(prop, "Sky",
+ "Renders 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 transparent except for shadowed areas");
+ RNA_def_property_ui_text(prop, "Only Shadow",
+ "Renders shadows as the material's alpha value, making materials "
+ "transparent except for shadowed areas");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "shadow_only_type", PROP_ENUM, PROP_NONE);
@@ -1741,17 +1841,20 @@ 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");
+ RNA_def_property_ui_text(prop, "Face Textures",
+ "Replaces 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");
+ RNA_def_property_ui_text(prop, "Face Textures Alpha",
+ "Replaces 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)");
+ RNA_def_property_ui_text(prop, "Cast Shadows Only",
+ "Makes objects with this material appear invisible, only casting shadows (not rendered)");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
@@ -1761,32 +1864,39 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_transparent_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA);
- RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows cast through other objects");
+ RNA_def_property_ui_text(prop, "Receive Transparent Shadows",
+ "Allow this object to receive transparent shadows cast through other objects");
RNA_def_property_update(prop, 0, "rna_Material_update");
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)");
+ RNA_def_property_ui_text(prop, "Ray Shadow Bias",
+ "Prevents 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);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA);
- RNA_def_property_ui_text(prop, "Full Oversampling", "Force this material to render full shading/textures for all anti-aliasing samples");
+ RNA_def_property_ui_text(prop, "Full Oversampling",
+ "Force this material to render full shading/textures for all anti-aliasing samples");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADBUF);
- RNA_def_property_ui_text(prop, "Cast Buffer Shadows", "Allow this material to cast shadows from shadow buffer lamps");
+ RNA_def_property_ui_text(prop, "Cast Buffer Shadows",
+ "Allow this material to cast shadows from shadow buffer lamps");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_cast_approximate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_APPROX_OCCLUSION);
- RNA_def_property_ui_text(prop, "Cast Approximate", "Allow this material to cast shadows when using approximate ambient occlusion.");
+ RNA_def_property_ui_text(prop, "Cast Approximate",
+ "Allow this material to cast shadows when using approximate ambient occlusion");
RNA_def_property_update(prop, 0, "rna_Material_update");
prop= RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V);
- RNA_def_property_ui_text(prop, "Tangent Shading", "Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects");
+ RNA_def_property_ui_text(prop, "Tangent Shading",
+ "Use the material's tangent vector instead of the normal for shading "
+ "- for anisotropic shading effects");
RNA_def_property_update(prop, 0, "rna_Material_update");
/* nested structs */
@@ -1832,6 +1942,13 @@ void RNA_def_material(BlenderRNA *brna)
RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Physics", "Game physics settings");
+ /* game settings */
+ prop= RNA_def_property(srna, "game_settings", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "game");
+ RNA_def_property_struct_type(prop, "MaterialGameSettings");
+ RNA_def_property_ui_text(prop, "Game Settings", "Game material settings");
+
/* nodetree */
prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
@@ -1846,7 +1963,8 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", "rna_Material_active_node_material_set", NULL, NULL);
+ RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get",
+ "rna_Material_active_node_material_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Material", "Active node material");
RNA_def_property_update(prop, NC_MATERIAL, NULL);
@@ -1876,6 +1994,7 @@ void RNA_def_material(BlenderRNA *brna)
rna_def_material_mtex(brna);
rna_def_material_strand(brna);
rna_def_material_physics(brna);
+ rna_def_material_gamesettings(brna);
RNA_api_material(srna);
}
@@ -1896,19 +2015,19 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch
/* functions */
func= RNA_def_function(srna, "add", "rna_mtex_texture_slots_add");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex.");
+ parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "create", "rna_mtex_texture_slots_create");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize.", 0, INT_MAX);
+ parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex.");
+ parm= RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear");
RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear.", 0, INT_MAX);
+ parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -1921,7 +2040,8 @@ 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", 0, 0, 0);
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 b0554ea5b4f..1bbdc7cc853 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -90,6 +90,24 @@ void rna_Mesh_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA
}
}
+
+void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Mesh* me = ptr->data;
+ if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
+ me->editflag ^= ME_EDIT_PAINT_MASK;
+ }
+ rna_Mesh_update_draw(bmain, scene, ptr);
+}
+
+void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Mesh* me = ptr->data;
+ if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) {
+ me->editflag ^= ME_EDIT_VERT_SEL;
+ }
+ rna_Mesh_update_draw(bmain, scene, ptr);
+}
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
{
MVert *mvert= (MVert*)ptr->data;
@@ -1402,6 +1420,9 @@ 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");
@@ -1468,6 +1489,9 @@ static void rna_def_mtface(BlenderRNA *brna)
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);
@@ -1701,7 +1725,7 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "add", "ED_mesh_vertices_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+ RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX);
}
/* mesh.edges */
@@ -1720,7 +1744,7 @@ static void rna_def_mesh_edges(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "add", "ED_mesh_edges_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+ RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX);
}
/* mesh.faces */
@@ -1749,7 +1773,7 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "add", "ED_mesh_faces_add");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX);
+ RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add", 0, INT_MAX);
}
/* mesh.vertex_colors */
@@ -1768,16 +1792,16 @@ static void rna_def_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Mesh_vertex_color_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh.");
- RNA_def_string(func, "name", "Col", 0, "", "Vertex color name.");
- parm= RNA_def_pointer(func, "layer", "MeshColorLayer", "", "The newly created layer.");
+ RNA_def_function_ui_description(func, "Add a vertex color layer to Mesh");
+ RNA_def_string(func, "name", "Col", 0, "", "Vertex color name");
+ parm= RNA_def_pointer(func, "layer", "MeshColorLayer", "", "The newly created layer");
RNA_def_function_return(func, parm);
/*
func= RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove");
- RNA_def_function_ui_description(func, "Remove a vertex color layer.");
+ RNA_def_function_ui_description(func, "Remove a vertex color layer");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove.");
+ parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
@@ -1809,16 +1833,16 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Mesh_uv_texture_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh.");
- RNA_def_string(func, "name", "UVTex", 0, "", "UV Texture name.");
- parm= RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer.");
+ RNA_def_function_ui_description(func, "Add a UV texture layer to Mesh");
+ RNA_def_string(func, "name", "UVTex", 0, "", "UV Texture name");
+ parm= RNA_def_pointer(func, "layer", "MeshTextureFaceLayer", "", "The newly created layer");
RNA_def_function_return(func, parm);
/*
func= RNA_def_function(srna, "remove", "rna_Mesh_uv_layers_remove");
- RNA_def_function_ui_description(func, "Remove a vertex color layer.");
+ RNA_def_function_ui_description(func, "Remove a vertex color layer");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove.");
+ parm= RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
*/
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED);
@@ -2075,8 +2099,14 @@ static void rna_def_mesh(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK);
RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting");
RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
- RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_facemask");
+
+ prop= RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL);
+ RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)");
+ RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0);
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_vertmask");
/* readonly editmesh info - use for extrude menu */
prop= RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED);
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index 87bbea334db..ef636d9a515 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -52,19 +52,20 @@ void RNA_api_mesh(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "transform", "ED_mesh_transform");
- RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix.");
- parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix.", 0.0f, 0.0f);
+ RNA_def_function_ui_description(func, "Transform mesh vertices by a matrix");
+ parm= RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f);
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "calc_normals", "ED_mesh_calc_normals");
- RNA_def_function_ui_description(func, "Calculate vertex normals.");
+ RNA_def_function_ui_description(func, "Calculate vertex normals");
func= RNA_def_function(srna, "update", "ED_mesh_update");
- RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges.");
+ RNA_def_boolean(func, "calc_edges", 0, "Calculate Edges", "Force recalculation of edges");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna, "validate", "BKE_mesh_validate");
- RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had invalid geometry corrected/removed.");
+ RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had "
+ "invalid geometry corrected/removed");
RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found");
parm= RNA_def_boolean(func, "result", 0, "Result", "");
RNA_def_function_return(func, parm);
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index d94fa130163..5e5cf0be0ae 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -236,15 +236,15 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Meta Elements", "Collection of metaball elements");
func= RNA_def_function(srna, "new", "rna_MetaBall_elements_new");
- RNA_def_function_ui_description(func, "Add a new spline to the curve.");
- RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element.");
- parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element.");
+ RNA_def_function_ui_description(func, "Add a new spline to the curve");
+ RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta-element");
+ parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created meta-element");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_MetaBall_elements_remove");
- RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ RNA_def_function_ui_description(func, "Remove a spline from a curve");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove.");
+ parm= RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index b83f06c633c..33f5e41b2cc 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -2526,29 +2526,29 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna)
prop= RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
- RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup.");
+ RNA_def_property_ui_text(prop, "Influence", "Global influence of current modifications on vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "mask_vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "mask_defgrp_name");
- RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name.");
+ RNA_def_property_ui_text(prop, "Mask VGroup", "Masking vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_mask_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE);
- RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture.");
+ RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "mask_tex_use_channel", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mask_tex_used_items);
- RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking.");
+ RNA_def_property_ui_text(prop, "Use Channel", "Which texture channel to use for masking");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items);
RNA_def_property_ui_text(prop, "Texture Coordinates", "Which texture coordinates "
- "to use for mapping.");
+ "to use for mapping");
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
prop= RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE);
@@ -2560,7 +2560,7 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna)
prop= RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mask_tex_map_obj");
RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Which object to take texture "
- "coordinates from.");
+ "coordinates from");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK);
RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update");
}
@@ -2583,43 +2583,43 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
srna= RNA_def_struct(brna, "VertexWeightEditModifier", "Modifier");
RNA_def_struct_ui_text(srna, "WeightVG Edit Modifier",
- "Edit the weights of vertices in a group.");
+ "Edit the weights of vertices in a group");
RNA_def_struct_sdna(srna, "WeightVGEditModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
- RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name.");
+ RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_edit_falloff_type_items);
- RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values.");
+ RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG);
RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold "
- "to vgroup.");
+ "to vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG);
RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold "
- "from vgroup.");
+ "from vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0f);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
RNA_def_property_ui_text(prop, "Default Weight", "Default weight a vertex will have if "
- "it is not in the vgroup.");
+ "it is not in the vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "cmap_curve");
- RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve.");
+ RNA_def_property_ui_text(prop, "Mapping Curve", "Custom mapping curve");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "add_threshold", PROP_FLOAT, PROP_NONE);
@@ -2627,7 +2627,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
RNA_def_property_ui_text(prop, "Add Threshold", "Lower bound for a vertex's weight "
- "to be added to the vgroup.");
+ "to be added to the vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE);
@@ -2635,7 +2635,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
RNA_def_property_ui_text(prop, "Rem Threshold", "Upper bound for a vertex's weight "
- "to be removed from the vgroup.");
+ "to be removed from the vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* Common masking properties. */
@@ -2667,19 +2667,19 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
srna= RNA_def_struct(brna, "VertexWeightMixModifier", "Modifier");
RNA_def_struct_ui_text(srna, "WeightVG Mix Modifier",
- "Mix the weights of two vertex groups.");
+ "Mix the weights of two vertex groups");
RNA_def_struct_sdna(srna, "WeightVGMixModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
prop= RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name_a");
- RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name.");
+ RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "vertex_group_b", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name_b");
- RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name.");
+ RNA_def_property_ui_text(prop, "Vertex Group B", "Second vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGMixModifier_vgroup2_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2687,25 +2687,25 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1.0f);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
RNA_def_property_ui_text(prop, "Default Weight A", "Default weight a vertex will have if "
- "it is not in the first vgroup.");
+ "it is not in the first vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0f);
RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 0);
RNA_def_property_ui_text(prop, "Default Weight B", "Default weight a vertex will have if "
- "it is not in the second vgroup.");
+ "it is not in the second vgroup");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mix_modes_items);
RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup 2 affect weights "
- "of vgroup 1.");
+ "of vgroup 1");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_mix_set_items);
- RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected.");
+ RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* Common masking properties. */
@@ -2716,15 +2716,16 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
{
static EnumPropertyItem weightvg_proximity_modes_items[] = {
{MOD_WVG_PROXIMITY_OBJECT, "OBJECT", 0, "Object Distance",
- "Use distance between affected and target objects."},
+ "Use distance between affected and target objects"},
{MOD_WVG_PROXIMITY_GEOMETRY, "GEOMETRY", 0, "Geometry Distance",
- "Use distance between affected object's vertices and target object, or target object's geometry."},
+ "Use distance between affected object's vertices and target "
+ "object, or target object's geometry"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem proximity_geometry_items[] = {
- {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex."},
- {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge."},
- {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face."},
+ {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex"},
+ {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge"},
+ {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem weightvg_proximity_falloff_type_items[] = {
@@ -2744,19 +2745,19 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
srna= RNA_def_struct(brna, "VertexWeightProximityModifier", "Modifier");
RNA_def_struct_ui_text(srna, "WeightVG Proximity Modifier",
"Set the weights of vertices in a group from a target object's "
- "distance.");
+ "distance");
RNA_def_struct_sdna(srna, "WeightVGProximityModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT);
prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
- RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name.");
+ RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WeightVGModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "proximity_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_proximity_modes_items);
- RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use.");
+ RNA_def_property_ui_text(prop, "Proximity Mode", "Which distances to target object to use");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "proximity_geometry", PROP_ENUM, PROP_NONE);
@@ -2765,30 +2766,30 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */
RNA_def_property_ui_text(prop, "Proximity Geometry",
"Use the shortest computed distance to target object's geometry "
- "as weight.");
+ "as weight");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target");
- RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from.");
+ RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from");
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);
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_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);
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).");
+ RNA_def_property_ui_text(prop, "Highest Dist", "Distance mapping to weight 1.0 (or weight 0.0 if below Lowest Dist)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, weightvg_proximity_falloff_type_items);
- RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values.");
+ RNA_def_property_ui_text(prop, "Falloff Type", "How weights are mapped to there new values");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* Common masking properties. */
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 2a234dfaa61..b2ea4cd966b 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -299,7 +299,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
NlaStrip *strip = add_nlastrip(action);
if (strip == NULL) {
- BKE_reportf(reports, RPT_ERROR, "Unable to create new strip.");
+ BKE_reportf(reports, RPT_ERROR, "Unable to create new strip");
return NULL;
}
@@ -307,7 +307,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
strip->start = start;
if (BKE_nlastrips_add_strip(&track->strips, strip) == 0) {
- BKE_reportf(reports, RPT_ERROR, "Unable to add strip. Track doesn't have any space to accommodate this new strip.");
+ BKE_reportf(reports, RPT_ERROR, "Unable to add strip. Track doesn't have any space to accommodate this new strip");
free_nlastrip(NULL, strip);
return NULL;
}
@@ -565,20 +565,20 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "new", "rna_NlaStrip_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track");
- parm= RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips.");
+ parm= RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip.", INT_MIN, INT_MAX);
+ parm = RNA_def_int(func, "start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame for this strip", INT_MIN, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip.");
+ parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* return type */
- parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip.");
+ parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip");
RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "rna_NlaStrip_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove a NLA Strip.");
- parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove.");
+ RNA_def_function_ui_description(func, "Remove a NLA Strip");
+ parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 61947977fee..1b113620663 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -391,6 +391,7 @@ static void rna_NodeGroupSocket_update(Main *bmain, Scene *scene, PointerRNA *pt
node_update(bmain, scene, ntree, node);
}
+#if 0 /* UNUSED */
static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
@@ -398,6 +399,7 @@ static void rna_NodeLink_update(Main *bmain, Scene *scene, PointerRNA *ptr)
ntree->update |= NTREE_UPDATE_LINKS;
ntreeUpdateTree(ntree);
}
+#endif
static void rna_NodeSocketInt_range(PointerRNA *ptr, int *min, int *max)
{
@@ -1486,7 +1488,7 @@ static void def_cmp_output_file(StructRNA *srna)
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "name");
- RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output.");
+ RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "image_type", PROP_ENUM, PROP_NONE);
@@ -2541,20 +2543,20 @@ static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Node Links", "Collection of Node Links");
func= RNA_def_function(srna, "new", "rna_NodeTree_link_new");
- RNA_def_function_ui_description(func, "Add a node link to this node tree.");
+ RNA_def_function_ui_description(func, "Add a node link to this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket.");
+ parm= RNA_def_pointer(func, "input", "NodeSocket", "", "The input socket");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket.");
+ parm= RNA_def_pointer(func, "output", "NodeSocket", "", "The output socket");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return */
- parm= RNA_def_pointer(func, "link", "NodeLink", "", "New node link.");
+ parm= RNA_def_pointer(func, "link", "NodeLink", "", "New node link");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_link_remove");
- RNA_def_function_ui_description(func, "remove a node link from the node tree.");
+ RNA_def_function_ui_description(func, "remove a node link from the node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove.");
+ parm= RNA_def_pointer(func, "link", "NodeLink", "", "The node link to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -2570,19 +2572,19 @@ static void rna_def_composite_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Compositor Nodes", "Collection of Compositor Nodes");
func= RNA_def_function(srna, "new", "rna_NodeTree_node_composite_new");
- RNA_def_function_ui_description(func, "Add a node to this node tree.");
+ RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */
- parm= RNA_def_pointer(func, "node", "Node", "", "New node.");
+ parm= RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
- RNA_def_function_ui_description(func, "remove a node from this node tree.");
+ RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove.");
+ parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -2598,19 +2600,19 @@ static void rna_def_shader_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Shader Nodes", "Collection of Shader Nodes");
func= RNA_def_function(srna, "new", "rna_NodeTree_node_new");
- RNA_def_function_ui_description(func, "Add a node to this node tree.");
+ RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */
- parm= RNA_def_pointer(func, "node", "Node", "", "New node.");
+ parm= RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
- RNA_def_function_ui_description(func, "remove a node from this node tree.");
+ RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove.");
+ parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -2626,19 +2628,19 @@ static void rna_def_texture_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Texture Nodes", "Collection of Texture Nodes");
func= RNA_def_function(srna, "new", "rna_NodeTree_node_texture_new");
- RNA_def_function_ui_description(func, "Add a node to this node tree.");
+ RNA_def_function_ui_description(func, "Add a node to this node tree");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_pointer(func, "group", "NodeTree", "", "The group tree");
/* return value */
- parm= RNA_def_pointer(func, "node", "Node", "", "New node.");
+ parm= RNA_def_pointer(func, "node", "Node", "", "New node");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_NodeTree_node_remove");
- RNA_def_function_ui_description(func, "remove a node from this node tree.");
+ RNA_def_function_ui_description(func, "Remove a node from this node tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove.");
+ parm= RNA_def_pointer(func, "node", "Node", "", "The node to remove");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -2847,22 +2849,22 @@ static void rna_def_group_sockets_api(BlenderRNA *brna, PropertyRNA *cprop, int
RNA_def_struct_ui_text(srna, "Group Sockets", "Collection of group sockets");
func= RNA_def_function(srna, "new", (in_out==SOCK_IN ? "rna_NodeTree_input_new" : "rna_NodeTree_output_new"));
- RNA_def_function_ui_description(func, "Add a socket to the group tree.");
+ RNA_def_function_ui_description(func, "Add a socket to the group tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_string(func, "name", "Socket", 32, "Name", "Name of the socket");
RNA_def_enum(func, "type", node_socket_type_items, SOCK_FLOAT, "Type", "Type of socket");
/* return value */
- parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket.");
+ parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "expose", (in_out==SOCK_IN ? "rna_NodeTree_input_expose" : "rna_NodeTree_output_expose"));
- RNA_def_function_ui_description(func, "Expose an internal socket in the group tree.");
+ RNA_def_function_ui_description(func, "Expose an internal socket in the group tree");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_pointer(func, "sock", "NodeSocket", "Socket", "Internal node socket to expose");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "add_link", TRUE, "Add Link", "If TRUE, adds a link to the internal socket");
/* return value */
- parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket.");
+ parm= RNA_def_pointer(func, "socket", "NodeSocket", "", "New socket");
RNA_def_function_return(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index e7b5529af02..720fea682ce 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1123,7 +1123,7 @@ static bConstraint *rna_Object_constraints_new(Object *object, int type)
static void rna_Object_constraints_remove(Object *object, ReportList *reports, bConstraint *con)
{
if(BLI_findindex(&object->constraints, con) == -1) {
- BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'.", con->name, object->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'", con->name, object->id.name+2);
return;
}
@@ -1177,7 +1177,7 @@ static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *re
Object *ob = (Object *)id;
if(ED_vgroup_object_is_edit_mode(ob)) {
- BKE_reportf(reports, RPT_ERROR, "VertexGroup.add(): Can't be called while object is in edit mode.");
+ BKE_reportf(reports, RPT_ERROR, "VertexGroup.add(): Can't be called while object is in edit mode");
return;
}
@@ -1192,7 +1192,7 @@ static void rna_VertexGroup_vertex_remove(ID *id, bDeformGroup *dg, ReportList *
Object *ob = (Object *)id;
if(ED_vgroup_object_is_edit_mode(ob)) {
- BKE_reportf(reports, RPT_ERROR, "VertexGroup.remove(): Can't be called while object is in edit mode.");
+ BKE_reportf(reports, RPT_ERROR, "VertexGroup.remove(): Can't be called while object is in edit mode");
return;
}
@@ -1265,6 +1265,11 @@ static void rna_def_vertex_group(BlenderRNA *brna)
RNA_def_struct_name_property(srna, prop);
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set");
RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */
+
+ prop= RNA_def_property(srna, "lock_weight", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_ui_text(prop, "", "Maintain the relative weights for the group");
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", 0);
+ RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */
prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -1272,29 +1277,29 @@ static void rna_def_vertex_group(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Index", "Index number of the vertex group");
func= RNA_def_function(srna, "add", "rna_VertexGroup_vertex_add");
- RNA_def_function_ui_description(func, "Add vertices to the group.");
+ RNA_def_function_ui_description(func, "Add vertices to the group");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
/* TODO, see how array size of 0 works, this shouldnt be used */
- prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List.", 0, 0);
+ prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0);
RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED);
- prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f);
+ prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode.");
+ prop= RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode");
RNA_def_property_flag(prop, PROP_REQUIRED);
func= RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove");
- RNA_def_function_ui_description(func, "Remove a vertex from the group.");
+ RNA_def_function_ui_description(func, "Remove a vertex from the group");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
/* TODO, see how array size of 0 works, this shouldnt be used */
- prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List.", 0, 0);
+ prop= RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0);
RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED);
func= RNA_def_function(srna, "weight", "rna_VertexGroup_weight");
- RNA_def_function_ui_description(func, "Get a vertex weight from the group.");
+ RNA_def_function_ui_description(func, "Get a vertex weight from the group");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID);
- prop=RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex.", 0, INT_MAX);
+ prop=RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight.", 0.0f, 1.0f);
+ prop= RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f);
RNA_def_function_return(func, prop);
}
@@ -1588,17 +1593,17 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "new", "rna_Object_constraints_new");
RNA_def_function_ui_description(func, "Add a new constraint to this object");
/* object to add */
- parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add.");
+ parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint.");
+ parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Object_constraints_remove");
- RNA_def_function_ui_description(func, "Remove a constraint from this object.");
+ RNA_def_function_ui_description(func, "Remove a constraint from this object");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* constraint to remove */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint.");
+ parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -1631,22 +1636,22 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
/* add target */
func= RNA_def_function(srna, "new", "rna_Object_modifier_new");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Add a new modifier.");
- parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone.");
+ RNA_def_function_ui_description(func, "Add a new modifier");
+ parm= RNA_def_string(func, "name", "Name", 0, "", "New name for the bone");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* modifier to add */
- parm= RNA_def_enum(func, "type", modifier_type_items, 1, "", "Modifier type to add.");
+ parm= RNA_def_enum(func, "type", modifier_type_items, 1, "", "Modifier type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
- parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier.");
+ parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Newly created modifier");
RNA_def_function_return(func, parm);
/* remove target */
func= RNA_def_function(srna, "remove", "rna_Object_modifier_remove");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- RNA_def_function_ui_description(func, "Remove an existing modifier from the object.");
+ RNA_def_function_ui_description(func, "Remove an existing modifier from the object");
/* target to remove*/
- parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove.");
+ parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -1709,14 +1714,14 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
/* vertex groups */ // add_vertex_group
func= RNA_def_function(srna, "new", "rna_Object_vgroup_new");
- RNA_def_function_ui_description(func, "Add vertex group to object.");
- RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */
- parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group.");
+ RNA_def_function_ui_description(func, "Add vertex group to object");
+ RNA_def_string(func, "name", "Group", 0, "", "Vertex group name"); /* optional */
+ parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Object_vgroup_remove");
- RNA_def_function_ui_description(func, "Delete vertex group from object.");
- parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove.");
+ RNA_def_function_ui_description(func, "Delete vertex group from object");
+ parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -1836,7 +1841,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, "Bound Box",
+ "Objects bound box in object-space coordinates, all values are -1.0 when not available");
/* parent */
prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
@@ -2041,7 +2047,9 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Input Matrix", "Matrix access to location, rotation and scale (including deltas), before constraints and parenting are applied.");
+ RNA_def_property_ui_text(prop, "Input Matrix",
+ "Matrix access to location, rotation and scale (including deltas), "
+ "before constraints and parenting are applied");
RNA_def_property_float_funcs(prop, "rna_Object_matrix_basis_get", "rna_Object_matrix_basis_set", NULL);
RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update");
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index d48f1c93da8..84c3d2fd68b 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -289,13 +289,13 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e
static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce)
{
if (!(ob->transflag & OB_DUPLI)) {
- BKE_report(reports, RPT_ERROR, "Object does not have duplis.");
+ BKE_report(reports, RPT_ERROR, "Object does not have duplis");
return;
}
/* free duplilist if a user forgets to */
if (ob->duplilist) {
- BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed.");
+ BKE_reportf(reports, RPT_WARNING, "Object.dupli_list has not been freed");
free_object_duplilist(ob->duplilist);
ob->duplilist= NULL;
@@ -330,7 +330,7 @@ static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList *
return keyptr;
}
else {
- BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes.", ob->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes", ob->id.name+2);
return PointerRNA_NULL;
}
}
@@ -344,19 +344,19 @@ int rna_Object_is_visible(Object *ob, Scene *sce)
static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int *indices, int totindex, float weight, int assignmode)
{
if (ob->type != OB_MESH) {
- BKE_report(reports, RPT_ERROR, "Object should be of MESH type.");
+ BKE_report(reports, RPT_ERROR, "Object should be of MESH type");
return;
}
Mesh *me = (Mesh*)ob->data;
int group_index = defgroup_find_index(ob, group);
if (group_index == -1) {
- BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh.");
+ BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh");
return;
}
if (assignmode != WEIGHT_REPLACE && assignmode != WEIGHT_ADD && assignmode != WEIGHT_SUBTRACT) {
- BKE_report(reports, RPT_ERROR, "Bad assignment mode." );
+ BKE_report(reports, RPT_ERROR, "Bad assignment mode" );
return;
}
@@ -367,7 +367,7 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int
// loop list adding verts to group
for (i= 0; i < totindex; i++) {
if(i < 0 || i >= me->totvert) {
- BKE_report(reports, RPT_ERROR, "Bad vertex index in list.");
+ BKE_report(reports, RPT_ERROR, "Bad vertex index in list");
return;
}
@@ -381,7 +381,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
BVHTreeFromMesh treeData= {NULL};
if(ob->derivedFinal==NULL) {
- BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting.", ob->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting", ob->id.name+2);
return;
}
@@ -389,7 +389,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl
bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6);
if(treeData.tree==NULL) {
- BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting.", ob->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting", ob->id.name+2);
return;
}
else {
@@ -420,7 +420,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi
BVHTreeFromMesh treeData= {NULL};
if(ob->derivedFinal==NULL) {
- BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point.", ob->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point", ob->id.name+2);
return;
}
@@ -477,46 +477,48 @@ void RNA_api_object(StructRNA *srna)
/* mesh */
func= RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh");
- RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied.");
+ RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers.");
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers.");
+ parm= RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply.");
+ parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export.");
+ parm= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export");
RNA_def_function_return(func, parm);
/* duplis */
func= RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist");
- RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to be freed manually with free_dupli_list to restore the objects real matrix and layers.");
- parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis.");
+ RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to "
+ "be freed manually with free_dupli_list to restore the "
+ "objects real matrix and layers");
+ parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
RNA_def_function_flag(func, FUNC_USE_REPORTS);
func= RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist");
- RNA_def_function_ui_description(func, "Free the list of dupli objects.");
+ RNA_def_function_ui_description(func, "Free the list of dupli objects");
/* Armature */
func= RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature");
- RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier.");
- parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL.");
+ RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier");
+ parm= RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL");
RNA_def_function_return(func, parm);
/* Shape key */
func= RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add");
- RNA_def_function_ui_description(func, "Add shape key to an object.");
+ RNA_def_function_ui_description(func, "Add shape key to an object");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock."); /* optional */
- RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes.");
- parm= RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock.");
+ RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock"); /* optional */
+ RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes");
+ parm= RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock");
RNA_def_property_flag(parm, PROP_RNAPTR);
RNA_def_function_return(func, parm);
/* Ray Cast */
func= RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast");
- RNA_def_function_ui_description(func, "Cast a ray onto in object space.");
+ RNA_def_function_ui_description(func, "Cast a ray onto in object space");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* ray start and end */
@@ -533,12 +535,12 @@ void RNA_api_object(StructRNA *srna)
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found.", 0, 0);
+ parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found", 0, 0);
RNA_def_function_output(func, parm);
/* Nearest Point */
func= RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh");
- RNA_def_function_ui_description(func, "Find the nearest point on the object.");
+ RNA_def_function_ui_description(func, "Find the nearest point on the object");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* location of point for test and max distance */
@@ -555,25 +557,25 @@ void RNA_api_object(StructRNA *srna)
RNA_def_property_flag(parm, PROP_THICK_WRAP);
RNA_def_function_output(func, parm);
- parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found.", 0, 0);
+ parm= RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found", 0, 0);
RNA_def_function_output(func, parm);
/* View */
func= RNA_def_function(srna, "is_visible", "rna_Object_is_visible");
- RNA_def_function_ui_description(func, "Determine if object is visible in a given scene.");
+ RNA_def_function_ui_description(func, "Determine if object is visible in a given scene");
parm= RNA_def_pointer(func, "scene", "Scene", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_boolean(func, "result", 0, "", "Object visibility.");
+ parm= RNA_def_boolean(func, "result", 0, "", "Object visibility");
RNA_def_function_return(func, parm);
/* utility function for checking if the object is modified */
func= RNA_def_function(srna, "is_modified", "rna_Object_is_modified");
- RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data.");
+ RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data");
parm= RNA_def_pointer(func, "scene", "Scene", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply.");
+ parm= RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_boolean(func, "result", 0, "", "Object visibility.");
+ parm= RNA_def_boolean(func, "result", 0, "", "Object visibility");
RNA_def_function_return(func, parm);
}
@@ -584,7 +586,7 @@ void RNA_api_object_base(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "layers_from_view", "rna_ObjectBase_layers_from_view");
- RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view).");
+ RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view)");
parm= RNA_def_pointer(func, "view", "SpaceView3D", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 490d9c38840..cc086bca6d8 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -823,11 +823,12 @@ static void rna_def_pointcache(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PTCACHE_IGNORE_LIBPATH);
- RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file.");
+ RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file");
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", 0, 0, 0);
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);
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 434634f6b10..338073fde00 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -479,7 +479,7 @@ static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, int typ
static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, ReportList *reports, bConstraint *con)
{
if(BLI_findindex(&pchan->constraints, con) == -1) {
- BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'.", con->name, pchan->name);
+ BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'", con->name, pchan->name);
return;
}
else {
@@ -714,17 +714,17 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro
func= RNA_def_function(srna, "new", "rna_PoseChannel_constraints_new");
RNA_def_function_ui_description(func, "Add a constraint to this object");
/* return type */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint.");
+ parm= RNA_def_pointer(func, "constraint", "Constraint", "", "New constraint");
RNA_def_function_return(func, parm);
/* constraint to add */
- parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add.");
+ parm= RNA_def_enum(func, "type", constraint_type_items, 1, "", "Constraint type to add");
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove");
- RNA_def_function_ui_description(func, "Remove a constraint from this object.");
+ RNA_def_function_ui_description(func, "Remove a constraint from this object");
RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* ID needed for refresh */
/* constraint to remove */
- parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint.");
+ parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -840,7 +840,8 @@ static void rna_def_pose_channel(BlenderRNA *brna)
/* writable because it touches loc/scale/rot directly */
prop= RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, matrix_dimsize);
- RNA_def_property_ui_text(prop, "Basis Matrix", "Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone.");
+ RNA_def_property_ui_text(prop, "Basis Matrix",
+ "Provides an alternative access to loc/scale/rotation relative to the parent and own rest bone");
RNA_def_property_float_funcs(prop, "rna_PoseChannel_matrix_basis_get", "rna_PoseChannel_matrix_basis_set", NULL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c
index e326aee212d..451a98e89fc 100644
--- a/source/blender/makesrna/intern/rna_pose_api.c
+++ b/source/blender/makesrna/intern/rna_pose_api.c
@@ -70,8 +70,9 @@ void RNA_api_pose_channel(StructRNA *srna)
FunctionRNA *func;
func= RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope");
- RNA_def_function_ui_description(func, "Calculate bone envelope at given point.");
- parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
+ RNA_def_function_ui_description(func, "Calculate bone envelope at given point");
+ parm= RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point",
+ "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return value */
parm= RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX);
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index e3e3296cb70..8c9f8c08a47 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -130,7 +130,8 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo
return NULL;
if(strlen(identifier) >= sizeof(dummyet.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyet.idname));
+ BKE_reportf(reports, RPT_ERROR, "registering render engine class: '%s' is too long, maximum length is %d",
+ identifier, (int)sizeof(dummyet.idname));
return NULL;
}
@@ -238,7 +239,7 @@ static void rna_def_render_engine(BlenderRNA *brna)
/* render */
func= RNA_def_function(srna, "render", NULL);
- RNA_def_function_ui_description(func, "Render scene into an image.");
+ RNA_def_function_ui_description(func, "Render scene into an image");
RNA_def_function_flag(func, FUNC_REGISTER);
RNA_def_pointer(func, "scene", "Scene", "", "");
@@ -310,9 +311,10 @@ static void rna_def_render_result(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes");
func= RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
- RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file.");
+ RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name", "Filename to load into this render tile, must be no smaller than the render result");
+ parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name",
+ "Filename to load into this render tile, must be no smaller than the render result");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_define_verify_sdna(0);
@@ -327,7 +329,8 @@ 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", 0, 0, 0);
RNA_define_verify_sdna(1);
}
@@ -342,12 +345,15 @@ static void rna_def_render_layer(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Render Layer", "");
func= RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
- RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file.");
+ RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- prop= RNA_def_string(func, "filename", "", 0, "Filename", "Filename to load into this render tile, must be no smaller than the renderlayer");
+ prop= RNA_def_string(func, "filename", "", 0, "Filename",
+ "Filename to load into this render tile, must be no smaller than the renderlayer");
RNA_def_property_flag(prop, PROP_REQUIRED);
- RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
- RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y", "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
+ RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X",
+ "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
+ RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y",
+ "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
RNA_define_verify_sdna(0);
@@ -355,7 +361,8 @@ 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", 0, 0, 0);
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_scene.c b/source/blender/makesrna/intern/rna_scene.c
index c7104119e56..2058edc6736 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -234,7 +234,7 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report
Base *base;
if (object_in_scene(ob, scene)) {
- BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\".", ob->id.name+2, scene->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Object \"%s\" is already in scene \"%s\"", ob->id.name+2, scene->id.name+2);
return NULL;
}
@@ -262,11 +262,11 @@ static void rna_Scene_object_unlink(Scene *scene, ReportList *reports, Object *o
{
Base *base= object_in_scene(ob, scene);
if (!base) {
- BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'.", ob->id.name+2, scene->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Object '%s' is not in this scene '%s'", ob->id.name+2, scene->id.name+2);
return;
}
if (base==scene->basact && ob->mode != OB_MODE_OBJECT) {
- BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink.", ob->id.name+2);
+ BKE_reportf(reports, RPT_ERROR, "Object '%s' must be in 'Object Mode' to unlink", ob->id.name+2);
return;
}
if(scene->basact==base) {
@@ -1042,11 +1042,27 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons
return ks;
}
else {
- BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
+ BKE_report(reports, RPT_ERROR, "Keying Set could not be added");
return NULL;
}
}
+
+
+/* note: without this, when Multi-Paint is activated/deactivated, the colors
+ * will not change right away when multiple bones are selected, this function
+ * is not for general use and only for the few cases where changing scene
+ * settings and NOT for general purpose updates, possibly this should be
+ * given its own notifier. */
+static void rna_Scene_update_active_object_data(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Object *ob= OBACT;
+ if(ob) {
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_OBJECT|ND_DRAW, &ob->id);
+ }
+}
+
static PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
{
FreestyleLineSet *lineset= (FreestyleLineSet *)ptr->data;
@@ -1163,9 +1179,17 @@ static void rna_def_tool_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1);
- RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
- "Ensure all bone-deforming vertex groups add up to 1.0 while "
- "weight painting");
+ RNA_def_property_ui_text(prop, "WPaint Auto-Normalize",
+ "Ensure all bone-deforming vertex groups add up "
+ "to 1.0 while weight painting");
+ RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
+
+ prop = RNA_def_property(srna, "use_multipaint", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "multipaint", 1);
+ RNA_def_property_ui_text(prop, "WPaint Multi-Paint",
+ "Paint across all selected bones while "
+ "weight painting");
+ RNA_def_property_update(prop, 0, "rna_Scene_update_active_object_data");
prop= RNA_def_property(srna, "vertex_paint", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "vpaint");
@@ -2138,7 +2162,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem material_items[] ={
- {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials"},
+ {GAME_MAT_TEXFACE, "SINGLETEXTURE", 0, "Singletexture", "Singletexture face materials"},
{GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials"},
{GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders"},
{0, NULL, 0, NULL, NULL}};
@@ -2358,7 +2382,9 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "restrict_animation_updates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_RESTRICT_ANIM_UPDATES);
- RNA_def_property_ui_text(prop, "Restrict Animation Updates", "Restrict the number of animation updates to the animation FPS. This is better for performance, but can cause issues with smooth playback.");
+ RNA_def_property_ui_text(prop, "Restrict Animation Updates",
+ "Restrict the number of animation updates to the animation FPS. This is "
+ "better for performance, but can cause issues with smooth playback");
/* materials */
prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE);
@@ -3546,17 +3572,17 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Scene Objects", "Collection of scene objects");
func= RNA_def_function(srna, "link", "rna_Scene_object_link");
- RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after.");
+ RNA_def_function_ui_description(func, "Link object to scene, run scene.update() after");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to add to scene");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base.");
+ parm= RNA_def_pointer(func, "base", "ObjectBase", "", "The newly created base");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "unlink", "rna_Scene_object_unlink");
- RNA_def_function_ui_description(func, "Unlink object from scene.");
+ RNA_def_function_ui_description(func, "Unlink object from scene");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene.");
+ parm= RNA_def_pointer(func, "object", "Object", "", "Object to remove from scene");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
@@ -3606,8 +3632,8 @@ static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers");
func= RNA_def_function(srna, "new", "rna_TimeLine_add");
- RNA_def_function_ui_description(func, "Add a keyframe to the curve.");
- parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique).");
+ RNA_def_function_ui_description(func, "Add a keyframe to the curve");
+ parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created timeline marker");
@@ -3615,9 +3641,9 @@ static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "remove", "rna_TimeLine_remove");
- RNA_def_function_ui_description(func, "Remove a timeline marker.");
+ RNA_def_function_ui_description(func, "Remove a timeline marker");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove.");
+ parm= RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
@@ -3637,13 +3663,13 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
/* Add Keying Set */
func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
- RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
+ RNA_def_function_ui_description(func, "Add a new Keying Set to Scene");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* name */
RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
/* returns the new KeyingSet */
- parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
+ parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set");
RNA_def_function_return(func, parm);
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index fd7987c18a2..39efa72e0ce 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -100,22 +100,22 @@ void RNA_api_scene(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "frame_set", "rna_Scene_frame_set");
- RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately.");
- parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set.", MINAFRAME, MAXFRAME);
+ RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately");
+ parm= RNA_def_int(func, "frame", 0, MINAFRAME, MAXFRAME, "", "Frame number to set", MINAFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_float(func, "subframe", 0.0, 0.0, 1.0, "", "Sub-frame time, between 0.0 and 1.0", 0.0, 1.0);
func= RNA_def_function(srna, "update", "rna_Scene_update_tagged");
- RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators.");
+ RNA_def_function_ui_description(func, "Update data tagged to be updated from previous access to data or operators");
#ifdef WITH_COLLADA
/* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */
func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export");
- RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file.");
- parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements.");
+ RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file");
+ parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */
- RNA_def_function_ui_description(func, "Export to collada file.");
+ RNA_def_function_ui_description(func, "Export to collada file");
#endif
}
@@ -126,9 +126,11 @@ void RNA_api_scene_render(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "frame_path", "rna_SceneRender_get_frame_path");
- RNA_def_function_ui_description(func, "Return the absolute path to the filename to be written for a given frame.");
- RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "", "Frame number to use, if unset the current frame will be used.", MINAFRAME, MAXFRAME);
- parm= RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path", "the resulting filepath from the scenes render settings.");
+ RNA_def_function_ui_description(func, "Return the absolute path to the filename to be written for a given frame");
+ RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "",
+ "Frame number to use, if unset the current frame will be used", MINAFRAME, MAXFRAME);
+ parm= RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path",
+ "The resulting filepath from the scenes render settings");
RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */
RNA_def_function_output(func, parm);
}
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index bd1021f038a..686c8dffcd1 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -147,7 +147,10 @@ static void rna_def_area(BlenderRNA *brna)
prop= RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE);
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.");
+ 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");
rna_def_area_spaces(brna, prop);
prop= RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE);
@@ -181,7 +184,7 @@ static void rna_def_area(BlenderRNA *brna)
func= RNA_def_function(srna, "header_text_set", "ED_area_headerprint");
RNA_def_function_ui_description(func, "Set the header text");
- RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text.");
+ RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
}
static void rna_def_region(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_sensor_api.c b/source/blender/makesrna/intern/rna_sensor_api.c
index cfa957bdd9e..7517443f4b7 100644
--- a/source/blender/makesrna/intern/rna_sensor_api.c
+++ b/source/blender/makesrna/intern/rna_sensor_api.c
@@ -61,14 +61,14 @@ void RNA_api_sensor(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "link", "rna_Sensor_link");
- RNA_def_function_ui_description(func, "Link the sensor to a controller.");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to.");
+ RNA_def_function_ui_description(func, "Link the sensor to a controller");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to link to");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
func= RNA_def_function(srna, "unlink", "rna_Sensor_unlink");
- RNA_def_function_ui_description(func, "Unlink the sensor from a controller.");
- parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from.");
+ RNA_def_function_ui_description(func, "Unlink the sensor from a controller");
+ parm= RNA_def_pointer(func, "controller", "Controller", "", "Controller to unlink from");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_update(parm, NC_LOGIC, NULL);
}
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 79724adf91c..86682af189c 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -1036,7 +1036,7 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "waveform", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM);
- RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform.");
+ RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL);
/* strip positioning */
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
index fa240fa225a..6019f46a114 100644
--- a/source/blender/makesrna/intern/rna_sequencer_api.c
+++ b/source/blender/makesrna/intern/rna_sequencer_api.c
@@ -65,8 +65,9 @@ void RNA_api_sequence_strip(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "getStripElem", "give_stripelem");
- RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
- parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame", "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
+ RNA_def_function_ui_description(func, "Return the strip element from a given frame or None");
+ parm= RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
+ "The frame to get the strip element from", -MAXFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 93ffa62a4c6..8ea00530c2f 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -245,7 +245,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
RNA_def_property_enum_items(prop, smoke_domain_colli_items);
- RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object.");
+ RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
@@ -255,21 +255,21 @@ 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", "Smoothens 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);
RNA_def_property_float_sdna(prop, NULL, "time_scale");
RNA_def_property_range(prop, 0.2, 1.5);
RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5);
- RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed.");
+ RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "vorticity");
RNA_def_property_range(prop, 0.01, 4.0);
RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
- RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid.");
+ RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
}
@@ -309,7 +309,7 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
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 allows 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 3a18fb0e7c0..a6c1f400ade 100644
--- a/source/blender/makesrna/intern/rna_sound.c
+++ b/source/blender/makesrna/intern/rna_sound.c
@@ -96,7 +96,7 @@ static void rna_def_sound(BlenderRNA *brna)
prop= RNA_def_property(srna, "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_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 3463b2f6c03..36c45cfa59e 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1589,7 +1589,7 @@ static void rna_def_space_image(BlenderRNA *brna)
prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "scopes");
RNA_def_property_struct_type(prop, "Scopes");
- RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics.");
+ RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_speaker.c b/source/blender/makesrna/intern/rna_speaker.c
index 60208de5aa5..34c67335c79 100644
--- a/source/blender/makesrna/intern/rna_speaker.c
+++ b/source/blender/makesrna/intern/rna_speaker.c
@@ -62,13 +62,13 @@ static void rna_def_speaker(BlenderRNA *brna)
prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_MUTED);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Mute", "Mutes the speaker.");
+ RNA_def_property_ui_text(prop, "Mute", "Mutes the speaker");
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
/* This shouldn't be changed actually, hiding it!
prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SPK_RELATIVE);
- RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not.");
+ RNA_def_property_ui_text(prop, "Relative", "Whether the source is relative to the camera or not");
// RNA_def_property_update(prop, 0, "rna_Speaker_update");*/
prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
@@ -76,7 +76,7 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Sound");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker.");
+ RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this speaker");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_sound_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -84,7 +84,7 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "volume_max");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is.");
+ RNA_def_property_ui_text(prop, "Maximum Volume", "Maximum volume, no matter how near the object is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_max_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -92,7 +92,7 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "volume_min");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is.");
+ RNA_def_property_ui_text(prop, "Minimum Volume", "Minimum volume, no matter how far away the object is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_min_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -100,7 +100,8 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "distance_max");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for volume calculation, no matter how far away the object is.");
+ RNA_def_property_ui_text(prop, "Maximum Distance",
+ "Maximum distance for volume calculation, no matter how far away the object is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_max_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -108,7 +109,7 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "distance_reference");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %.");
+ RNA_def_property_ui_text(prop, "Reference Distance", "Reference distance at which volume is 100 %");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_distance_reference_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -116,7 +117,7 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "attenuation");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model.");
+ RNA_def_property_ui_text(prop, "Attenuation", "How strong the distance affects volume, depending on distance model");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_attenuation_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -124,7 +125,9 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "cone_angle_outer");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 360.0f);
- RNA_def_property_ui_text(prop, "Outer Cone Angle", "Outer angle of the cone in degrees, outside this cone the volume is the outer cone volume, between inner and outer cone the volume is interpolated.");
+ RNA_def_property_ui_text(prop, "Outer Cone Angle",
+ "Outer angle of the cone in degrees, outside this cone the volume is "
+ "the outer cone volume, between inner and outer cone the volume is interpolated");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_outer_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -132,7 +135,8 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "cone_angle_inner");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 360.0f);
- RNA_def_property_ui_text(prop, "Inner Cone Angle", "Inner angle of the cone in degrees, inside the cone the volume is 100 %.");
+ RNA_def_property_ui_text(prop, "Inner Cone Angle",
+ "Inner angle of the cone in degrees, inside the cone the volume is 100 %");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_angle_inner_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
@@ -140,21 +144,21 @@ static void rna_def_speaker(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "cone_volume_outer");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone.");
+ RNA_def_property_ui_text(prop, "Outer Cone Volume", "Volume outside the outer cone");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_cone_volume_outer_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "volume");
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Volume", "How loud the sound is.");
+ RNA_def_property_ui_text(prop, "Volume", "How loud the sound is");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_volume_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
prop= RNA_def_property(srna, "pitch", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pitch");
RNA_def_property_range(prop, 0.1f, 10.0f);
- RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound.");
+ RNA_def_property_ui_text(prop, "Pitch", "Playback pitch of the sound");
// RNA_def_property_float_funcs(prop, NULL, "rna_Speaker_pitch_set", NULL);
// RNA_def_property_update(prop, 0, "rna_Speaker_update");
diff --git a/source/blender/makesrna/intern/rna_text_api.c b/source/blender/makesrna/intern/rna_text_api.c
index 54cb6714b1b..7e90dba6e3f 100644
--- a/source/blender/makesrna/intern/rna_text_api.c
+++ b/source/blender/makesrna/intern/rna_text_api.c
@@ -42,11 +42,11 @@ void RNA_api_text(StructRNA *srna)
PropertyRNA *prop;
func= RNA_def_function(srna, "clear", "clear_text");
- RNA_def_function_ui_description(func, "clear the text block.");
+ RNA_def_function_ui_description(func, "clear the text block");
func= RNA_def_function(srna, "write", "write_text");
- RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block.");
- prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock.");
+ RNA_def_function_ui_description(func, "write text at the cursor location and advance to the end of the text block");
+ prop= RNA_def_string(func, "text", "Text", 0, "", "New text for this datablock");
RNA_def_property_flag(prop, PROP_REQUIRED);
}
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 608a7326d79..e2beabf789d 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -668,22 +668,31 @@ static void rna_def_environment_map(BlenderRNA *brna)
prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0);
RNA_def_property_boolean_sdna(prop, NULL, "ok", 2);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering.");
+ RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering");
RNA_api_environment_map(srna);
}
static EnumPropertyItem prop_noise_basis_items[] = {
- {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", "Noise algorithm - Blender original: Smooth interpolated noise"},
- {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", "Noise algorithm - Original Perlin: Smooth interpolated noise"},
- {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", "Noise algorithm - Improved Perlin: Smooth interpolated noise"},
- {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", "Noise algorithm - Voronoi F1: Returns distance to the closest feature point"},
- {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", "Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"},
- {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", "Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"},
- {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", "Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"},
+ {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original",
+ "Noise algorithm - Blender original: Smooth interpolated noise"},
+ {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin",
+ "Noise algorithm - Original Perlin: Smooth interpolated noise"},
+ {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin",
+ "Noise algorithm - Improved Perlin: Smooth interpolated noise"},
+ {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1",
+ "Noise algorithm - Voronoi F1: Returns distance to the closest feature point"},
+ {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2",
+ "Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"},
+ {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3",
+ "Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"},
+ {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4",
+ "Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"},
{TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", "Noise algorithm - Voronoi F1-F2"},
- {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", "Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"},
- {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", "Noise algorithm - Cell Noise: Square cell tessallation"},
+ {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle",
+ "Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"},
+ {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise",
+ "Noise algorithm - Cell Noise: Square cell tessallation"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem prop_noise_type[] = {
diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c
index 4941c75c400..9a445ed8ae8 100644
--- a/source/blender/makesrna/intern/rna_texture_api.c
+++ b/source/blender/makesrna/intern/rna_texture_api.c
@@ -107,20 +107,23 @@ void RNA_api_environment_map(StructRNA *srna)
static const float default_layout[] = { 0,0, 1,0, 2,0, 0,1, 1,1, 2,1 };
func= RNA_def_function(srna, "clear", "clear_envmap");
- RNA_def_function_ui_description(func, "Discard the environment map and free it from memory.");
+ RNA_def_function_ui_description(func, "Discard the environment map and free it from memory");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func= RNA_def_function(srna,"save", "save_envmap");
- RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings.");
+ RNA_def_function_ui_description(func, "Save the environment map to disc using the scene render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
parm= RNA_def_string_file_name(func,"filepath","",FILE_MAX,"File path","Location of the output file");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken.");
+ RNA_def_pointer(func, "scene", "Scene", "", "Overrides the scene from which image parameters are taken");
- parm = RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout", "Flat array describing the X,Y position of each cube face in the output image, where 1 is the size of a face. Order is [+Z -Z +Y -X -Y +X]. Use -1 to skip a face.", 0.0f, 0.0f);
+ parm = RNA_def_float_array(func, "layout", 12, default_layout, 0.0f, 0.0f, "File layout",
+ "Flat array describing the X,Y position of each cube face in the "
+ "output image, where 1 is the size of a face - order is [+Z -Z +Y -X -Y +X] "
+ "(use -1 to skip a face)", 0.0f, 0.0f);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 1e60f747b4e..52c359d79dd 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -84,7 +84,7 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re
/* region type not found? abort */
if (art==NULL) {
- BKE_report(reports, RPT_ERROR, "Region not found in spacetype.");
+ BKE_report(reports, RPT_ERROR, "Region not found in spacetype");
return NULL;
}
@@ -167,7 +167,8 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type)
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
}
-static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
+ StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
ARegionType *art;
PanelType *pt, dummypt = {NULL};
@@ -184,7 +185,8 @@ static StructRNA *rna_Panel_register(Main *bmain, ReportList *reports, void *dat
return NULL;
if(strlen(identifier) >= sizeof(dummypt.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummypt.idname));
+ BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d",
+ identifier, (int)sizeof(dummypt.idname));
return NULL;
}
@@ -280,7 +282,8 @@ static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type)
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
}
-static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
+ StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
ARegionType *art;
HeaderType *ht, dummyht = {NULL};
@@ -297,7 +300,8 @@ static StructRNA *rna_Header_register(Main *bmain, ReportList *reports, void *da
return NULL;
if(strlen(identifier) >= sizeof(dummyht.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyht.idname));
+ BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d",
+ identifier, (int)sizeof(dummyht.idname));
return NULL;
}
@@ -397,7 +401,8 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type)
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);
}
-static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
+static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
+ StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
{
MenuType *mt, dummymt = {NULL};
Menu dummymenu= {NULL};
@@ -413,7 +418,8 @@ static StructRNA *rna_Menu_register(Main *bmain, ReportList *reports, void *data
return NULL;
if(strlen(identifier) >= sizeof(dummymt.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummymt.idname));
+ BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d",
+ identifier, (int)sizeof(dummymt.idname));
return NULL;
}
@@ -571,7 +577,7 @@ static void rna_def_ui_layout(BlenderRNA *brna)
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set");
- RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out.");
+ RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out");
prop= RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_funcs(prop, "rna_UILayout_alert_get", "rna_UILayout_alert_set");
@@ -587,11 +593,11 @@ static void rna_def_ui_layout(BlenderRNA *brna)
prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL);
- RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout.");
+ RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout");
prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL);
- RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout.");
+ RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout");
RNA_api_ui_layout(srna);
}
@@ -603,8 +609,11 @@ static void rna_def_panel(BlenderRNA *brna)
FunctionRNA *func;
static EnumPropertyItem panel_flag_items[] = {
- {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed", "Defines if the panel has to be open or collapsed at the time of its creation."},
- {PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header", "If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label)."},
+ {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed",
+ "Defines if the panel has to be open or collapsed at the time of its creation"},
+ {PNL_NO_HEADER, "HIDE_HEADER", 0, "Show Header",
+ "If set to True, the panel shows a header, which contains a clickable "
+ "arrow to collapse the panel and the label (see bl_label)"},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "Panel", NULL);
@@ -615,7 +624,7 @@ static void rna_def_panel(BlenderRNA *brna)
/* poll */
func= RNA_def_function(srna, "poll", NULL);
- RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn.");
+ RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", "");
@@ -623,20 +632,20 @@ static void rna_def_panel(BlenderRNA *brna)
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
func= RNA_def_function(srna, "draw_header", NULL);
- RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "UILayout");
- RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI.");
+ RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI");
prop= RNA_def_property(srna, "text", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "drawname");
@@ -646,29 +655,37 @@ static void rna_def_panel(BlenderRNA *brna)
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
- RNA_def_property_ui_text(prop, "ID Name", "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\"");
+ RNA_def_property_ui_text(prop, "ID Name",
+ "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\"");
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
- RNA_def_property_ui_text(prop, "Label", "The panel label, shows up in the panel header at the right of the triangle used to collapse the panel.");
+ RNA_def_property_ui_text(prop, "Label",
+ "The panel label, shows up in the panel header at the right of the "
+ "triangle used to collapse the panel");
prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
- RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in.");
+ RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in");
prop= RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->region_type");
RNA_def_property_enum_items(prop, region_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
- RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in.");
+ RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in");
prop= RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->context");
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */
- RNA_def_property_ui_text(prop, "Context", "The context in which the panel belongs to. (TODO: explain the possible combinations bl_context/bl_region_type/bl_space_type)");
+ RNA_def_property_ui_text(prop, "Context",
+ "The context in which the panel belongs to. (TODO: explain the "
+ "possible combinations bl_context/bl_region_type/bl_space_type)");
prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->flag");
@@ -685,14 +702,14 @@ static void rna_def_header(BlenderRNA *brna)
FunctionRNA *func;
srna= RNA_def_struct(brna, "Header", NULL);
- RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements.");
+ RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements");
RNA_def_struct_sdna(srna, "Header");
RNA_def_struct_refine_func(srna, "rna_Header_refine");
RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister", NULL);
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -702,19 +719,23 @@ 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", "Defines the structure of the header in the UI");
/* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
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 class name is \"OBJECT_HT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_HT_hello\"");
+ 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 "
+ "class name is \"OBJECT_HT_hello\", and bl_idname is not set by the "
+ "script, then bl_idname = \"OBJECT_HT_hello\"");
prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type");
RNA_def_property_enum_items(prop, space_type_items);
RNA_def_property_flag(prop, PROP_REGISTER);
- RNA_def_property_ui_text(prop, "Space type", "The space where the header is going to be used in.");
+ RNA_def_property_ui_text(prop, "Space type", "The space where the header is going to be used in");
RNA_define_verify_sdna(1);
}
@@ -734,7 +755,7 @@ static void rna_def_menu(BlenderRNA *brna)
/* poll */
func= RNA_def_function(srna, "poll", NULL);
- RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn.");
+ RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", "");
@@ -742,7 +763,7 @@ static void rna_def_menu(BlenderRNA *brna)
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout.");
+ RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout");
RNA_def_function_flag(func, FUNC_REGISTER);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
@@ -752,13 +773,17 @@ static void rna_def_menu(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 menu in the UI.");
+ RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI");
/* registration */
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
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 class name is \"OBJECT_MT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_MT_hello\"");
+ 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 "
+ "class name is \"OBJECT_MT_hello\", and bl_idname is not set by the "
+ "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 92c93f41dfc..84568d914af 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(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);
@@ -95,7 +95,7 @@ static void api_ui_item_common(FunctionRNA *func)
static void api_ui_item_op(FunctionRNA *func)
{
PropertyRNA *parm;
- parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
+ parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -109,9 +109,9 @@ static void api_ui_item_rna_common(FunctionRNA *func)
{
PropertyRNA *parm;
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
@@ -134,49 +134,52 @@ void RNA_api_ui_layout(StructRNA *srna)
/* simple layout specifiers */
func= RNA_def_function(srna, "row", "uiLayoutRow");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
+ parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row.");
- RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
+ RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row");
+ RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
func= RNA_def_function(srna, "column", "uiLayoutColumn");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
+ parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column.");
- RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
+ RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column");
+ RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow");
- RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX);
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
+ RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic", 0, INT_MAX);
+ parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
+ RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
/* box layout */
func= RNA_def_function(srna, "box", "uiLayoutBox");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
+ parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- RNA_def_function_ui_description(func, "Sublayout. Items placed in this sublayout are placed under each other in a column and are surrounded by a box.");
+ RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed "
+ "under each other in a column and are surrounded by a box)");
/* split layout */
func= RNA_def_function(srna, "split", "uiLayoutSplit");
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
+ parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
- RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f);
- RNA_def_boolean(func, "align", 0, "", "Align buttons to each other.");
+ RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at", 0.0f, 1.0f);
+ RNA_def_boolean(func, "align", 0, "", "Align buttons to each other");
/* items */
func= RNA_def_function(srna, "prop", "rna_uiItemR");
- RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout.");
+ RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout");
api_ui_item_rna_common(func);
api_ui_item_common(func);
- RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
- RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values.");
- RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values.");
- RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text.");
- RNA_def_boolean(func, "event", 0, "", "Use button to input key events.");
- RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers.");
- RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text.");
- RNA_def_int(func, "index", -1, -2, INT_MAX, "", "The index of this button, when set a single member of an array can be accessed, when set to -1 all array members are used.", -2, INT_MAX); /* RNA_NO_INDEX == -1 */
+ RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail");
+ RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values");
+ RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values");
+ RNA_def_boolean(func, "icon_only", 0, "", "Draw only icons in buttons, no text");
+ RNA_def_boolean(func, "event", 0, "", "Use button to input key events");
+ RNA_def_boolean(func, "full_event", 0, "", "Use button to input full events including modifiers");
+ RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text");
+ RNA_def_int(func, "index", -1, -2, INT_MAX, "",
+ "The index of this button, when set a single member of an array can be accessed, "
+ "when set to -1 all array members are used", -2, INT_MAX); /* RNA_NO_INDEX == -1 */
func= RNA_def_function(srna, "props_enum", "uiItemsEnumR");
api_ui_item_rna_common(func);
@@ -187,190 +190,194 @@ void RNA_api_ui_layout(StructRNA *srna)
func= RNA_def_function(srna, "prop_enum", "uiItemEnumR_string");
api_ui_item_rna_common(func);
- parm= RNA_def_string(func, "value", "", 0, "", "Enum property value.");
+ parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
func= RNA_def_function(srna, "prop_search", "uiItemPointerR");
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in.");
+ parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property.");
+ parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property");
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
func= RNA_def_function(srna, "operator", "rna_uiItemO");
api_ui_item_op_common(func);
- RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text.");
- parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true.");
+ RNA_def_boolean(func, "emboss", 1, "", "Draw the button itself, just the icon/text");
+ parm= RNA_def_pointer(func, "properties", "OperatorProperties", "",
+ "Operator properties to fill in, return when 'properties' is set to true");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
RNA_def_function_return(func, parm);
- RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator.");
+ RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator");
/* func= RNA_def_function(srna, "operator_enum_single", "uiItemEnumO_string");
api_ui_item_op_common(func);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "value", "", 0, "", "Enum property value.");
+ parm= RNA_def_string(func, "value", "", 0, "", "Enum property value");
RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "operator_enum", "uiItemsEnumO");
- parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator.");
+ parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "operator_menu_enum", "uiItemMenuEnumO");
api_ui_item_op(func); /* cant use api_ui_item_op_common because property must come right after */
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
api_ui_item_common(func);
/* func= RNA_def_function(srna, "operator_boolean", "uiItemBooleanO");
api_ui_item_op_common(func);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with.");
+ parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with");
RNA_def_property_flag(parm, PROP_REQUIRED); */
/* func= RNA_def_function(srna, "operator_int", "uiItemIntO");
api_ui_item_op_common(func);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", "Value of the property to call the operator with.", INT_MIN, INT_MAX);
+ parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "",
+ "Value of the property to call the operator with", INT_MIN, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); */
/* func= RNA_def_function(srna, "operator_float", "uiItemFloatO");
api_ui_item_op_common(func);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", "Value of the property to call the operator with.", -FLT_MAX, FLT_MAX);
+ parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "",
+ "Value of the property to call the operator with", -FLT_MAX, FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED); */
/* func= RNA_def_function(srna, "operator_string", "uiItemStringO");
api_ui_item_op_common(func);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with.");
+ parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with");
RNA_def_property_flag(parm, PROP_REQUIRED); */
func= RNA_def_function(srna, "label", "uiItemL");
- RNA_def_function_ui_description(func, "Item. Display text in the layout.");
+ RNA_def_function_ui_description(func, "Item. Display text in the layout");
api_ui_item_common(func);
func= RNA_def_function(srna, "menu", "uiItemM");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu.");
+ parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu");
api_ui_item_common(func);
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "separator", "uiItemS");
- RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items.");
+ RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items");
/* context */
func= RNA_def_function(srna, "context_pointer_set", "uiLayoutSetContextPointer");
- parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context.");
+ parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context.");
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
/* templates */
func= RNA_def_function(srna, "template_header", "uiTemplateHeader");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander.");
+ RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander");
func= RNA_def_function(srna, "template_ID", "uiTemplateID");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
- RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block.");
- RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block.");
- RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block.");
+ RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
+ RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block");
+ RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block");
func= RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
- RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block.");
- RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block.");
- RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block.");
+ RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block");
+ RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block");
+ RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block");
RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX);
RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX);
func= RNA_def_function(srna, "template_any_ID", "uiTemplateAnyID");
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_string(func, "type_property", "", 0, "", "Identifier of property in data giving the type of the ID-blocks to use.");
+ 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(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.");
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from.");
+ 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(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);
- RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers.");
- parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data.");
+ RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers");
+ parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
+ parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint");
- RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints.");
- parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data.");
+ RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints");
+ parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in.");
+ parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "template_preview", "uiTemplatePreview");
RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc.");
- parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock.");
+ parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?");
- RNA_def_pointer(func, "parent", "ID", "", "ID datablock.");
- RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot.");
+ RNA_def_pointer(func, "parent", "ID", "", "ID datablock");
+ RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot");
func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping");
- RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps.");
+ RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps");
api_ui_item_rna_common(func);
- RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display.");
- RNA_def_boolean(func, "levels", 0, "", "Show black/white levels.");
- RNA_def_boolean(func, "brush", 0, "", "Show brush options.");
+ RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display");
+ RNA_def_boolean(func, "levels", 0, "", "Show black/white levels");
+ RNA_def_boolean(func, "brush", 0, "", "Show brush options");
func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp");
- RNA_def_function_ui_description(func, "Item. A color ramp widget.");
+ RNA_def_function_ui_description(func, "Item. A color ramp widget");
api_ui_item_rna_common(func);
- RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail.");
+ RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail");
func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram");
- RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data.");
+ RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data");
api_ui_item_rna_common(func);
func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform");
- RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data.");
+ RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data");
api_ui_item_rna_common(func);
func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope");
- RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data.");
+ RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data");
api_ui_item_rna_common(func);
func= RNA_def_function(srna, "template_layers", "uiTemplateLayers");
api_ui_item_rna_common(func);
- parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property.");
+ parm= RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
- parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data.");
+ parm= RNA_def_string(func, "used_layers_property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel");
- RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors.");
+ RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors");
api_ui_item_rna_common(func);
RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel");
RNA_def_boolean(func, "lock", 0, "", "Lock the color wheel display to value 1.0 regardless of actual color");
@@ -385,27 +392,27 @@ void RNA_api_ui_layout(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
func= RNA_def_function(srna, "template_image", "uiTemplateImage");
- RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths.");
+ RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
api_ui_item_rna_common(func);
parm= RNA_def_pointer(func, "image_user", "ImageUser", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- RNA_def_boolean(func, "compact", 0, "", "Use more compact layout.");
+ RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
func= RNA_def_function(srna, "template_list", "uiTemplateList");
- RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups.");
+ RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property.");
+ parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR);
- parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data.");
+ parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element.");
+ parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
- parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element.");
+ parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display.", 0, INT_MAX);
- RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display.", 0, INT_MAX);
- RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use.");
+ RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display", 0, INT_MAX);
+ RNA_def_int(func, "maxrows", 5, 0, INT_MAX, "", "Maximum number of rows to display", 0, INT_MAX);
+ RNA_def_enum(func, "type", list_type_items, 0, "Type", "Type of list to use");
func= RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 4bc828cdc4f..b9a53acd6f4 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -44,6 +44,7 @@
#include "WM_types.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
#include "BKE_sound.h"
@@ -76,6 +77,11 @@ static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr)
WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); /* refresh region sizes */
}
+static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
+{
+ BLF_lang_set(NULL);
+}
+
static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
UserDef *userdef = (UserDef *)ptr->data;
@@ -2463,30 +2469,35 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
/* hardcoded here, could become dynamic somehow */
+ /* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
+ /* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
static EnumPropertyItem language_items[] = {
- {0, "ENGLISH", 0, "English", ""},
- {1, "JAPANESE", 0, "Japanese", ""},
- {2, "DUTCH", 0, "Dutch", ""},
- {3, "ITALIAN", 0, "Italian", ""},
- {4, "GERMAN", 0, "German", ""},
- {5, "FINNISH", 0, "Finnish", ""},
- {6, "SWEDISH", 0, "Swedish", ""},
- {7, "FRENCH", 0, "French", ""},
- {8, "SPANISH", 0, "Spanish", ""},
- {9, "CATALAN", 0, "Catalan", ""},
- {10, "CZECH", 0, "Czech", ""},
- {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""},
- {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""},
- {13, "RUSSIAN", 0, "Russian", ""},
- {14, "CROATIAN", 0, "Croatian", ""},
- {15, "SERBIAN", 0, "Serbian", ""},
- {16, "UKRAINIAN", 0, "Ukrainian", ""},
- {17, "POLISH", 0, "Polish", ""},
- {18, "ROMANIAN", 0, "Romanian", ""},
- {19, "ARABIC", 0, "Arabic", ""},
- {20, "BULGARIAN", 0, "Bulgarian", ""},
- {21, "GREEK", 0, "Greek", ""},
- {22, "KOREAN", 0, "Korean", ""},
+ {0, "DEFAULT", 0, N_("Default (Default)"), ""},
+ {1, "ENGLISH", 0, N_("English (English)"), "en_US"},
+ {2, "JAPANESE", 0, N_("Japanese (日本語)"), "ja_JP"},
+ {3, "DUTCH", 0, N_("Dutch (Nederlandse taal)"), "nl_NL"},
+ {4, "ITALIAN", 0, N_("Italian (Italiano)"), "it_IT"},
+ {5, "GERMAN", 0, N_("German (Deutsch)"), "de_DE"},
+ {6, "FINNISH", 0, N_("Finnish (Suomi)"), "fi_FI"},
+ {7, "SWEDISH", 0, N_("Swedish (Svenska)"), "sv_SE"},
+ {8, "FRENCH", 0, N_("French (Française)"), "fr_FR"},
+ {9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"},
+ {10, "CATALAN", 0, N_("Catalan (Català)"), "ca_AD"},
+ {11, "CZECH", 0, N_("Czech (Český)"), "cs_CZ"},
+ {12, "BRAZILIAN_PORTUGUESE", 0, N_("Brazilian Portuguese (Português do Brasil)"), "pt_BR"},
+ {13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"},
+ {14, "TRADITIONAL_CHINESE", 0, N_("Traditional Chinese (繁體中文)"), "zh_TW"},
+ {15, "RUSSIAN", 0, N_("Russian (Русский)"), "ru_RU"},
+ {16, "CROATIAN", 0, N_("Croatian (Hrvatski)"), "hr_HR"},
+ {17, "SERBIAN", 0, N_("Serbian (Српском језику)"), "sr_RS"},
+ {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"},
+ {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"},*/
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
@@ -2499,7 +2510,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
+ RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "dpi");
@@ -2522,21 +2533,16 @@ 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_update(prop, 0, "rna_userdef_update");
+ RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
RNA_def_property_update(prop, 0, "rna_userdef_update");
- prop= RNA_def_property(srna, "use_translate_buttons", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS);
- RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels");
- RNA_def_property_update(prop, 0, "rna_userdef_update");
-
- prop= RNA_def_property(srna, "use_translate_toolbox", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS);
- RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu");
+ prop= RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_IFACE);
+ RNA_def_property_ui_text(prop, "Translate Interface", "Translate Interface");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
@@ -3002,13 +3008,13 @@ void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_flag(func, FUNC_NO_SELF);
RNA_def_function_ui_description(func, "Add a new addon");
/* return type */
- parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock.");
+ parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
RNA_def_function_flag(func, FUNC_NO_SELF);
- RNA_def_function_ui_description(func, "Remove addon.");
- parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove.");
+ RNA_def_function_ui_description(func, "Remove addon");
+ parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
}
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index a259f84ff1a..606355c4fb6 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -970,12 +970,15 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void *
}
if(i > ((int)sizeof(dummyop.idname)) - 3) {
- BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', is too long, maximum length is %d.", identifier, _operator_idname, (int)sizeof(dummyop.idname) - 3);
+ BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', "
+ "is too long, maximum length is %d", identifier, _operator_idname,
+ (int)sizeof(dummyop.idname) - 3);
return NULL;
}
if(dot != 1) {
- BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', must contain 1 '.' character", identifier, _operator_idname);
+ BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s', invalid bl_idname '%s', "
+ "must contain 1 '.' character", identifier, _operator_idname);
return NULL;
}
}
@@ -1069,7 +1072,8 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v
}
if(strlen(identifier) >= sizeof(dummyop.idname)) {
- BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d.", identifier, (int)sizeof(dummyop.idname));
+ BKE_reportf(reports, RPT_ERROR, "registering operator class: '%s' is too long, maximum length is %d",
+ identifier, (int)sizeof(dummyop.idname));
return NULL;
}
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 89e946f498a..8b0bae58455 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -92,7 +92,7 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons
/* only on non-modal maps */
if (km->flag & KEYMAP_MODAL) {
- BKE_report(reports, RPT_ERROR, "Not a non-modal keymap.");
+ BKE_report(reports, RPT_ERROR, "Not a non-modal keymap");
return NULL;
}
@@ -115,18 +115,18 @@ static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports
/* only modal maps */
if ((km->flag & KEYMAP_MODAL) == 0) {
- BKE_report(reports, RPT_ERROR, "Not a modal keymap.");
+ BKE_report(reports, RPT_ERROR, "Not a modal keymap");
return NULL;
}
if (!km->modal_items) {
- BKE_report(reports, RPT_ERROR, "No property values defined.");
+ BKE_report(reports, RPT_ERROR, "No property values defined");
return NULL;
}
if(RNA_enum_value_from_id(km->modal_items, propvalue_str, &propvalue)==0) {
- BKE_report(reports, RPT_WARNING, "Property value not in enumeration.");
+ BKE_report(reports, RPT_WARNING, "Property value not in enumeration");
}
if(shift) modifier |= KM_SHIFT;
@@ -174,17 +174,17 @@ static void rna_generic_op_invoke(FunctionRNA *func, int flag)
PropertyRNA *parm;
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call.");
+ parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
RNA_def_property_flag(parm, PROP_REQUIRED);
if(flag & WM_GEN_INVOKE_EVENT) {
- parm= RNA_def_pointer(func, "event", "Event", "", "Event.");
+ parm= RNA_def_pointer(func, "event", "Event", "", "Event");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
if(flag & WM_GEN_INVOKE_SIZE) {
- RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup.", 0, INT_MAX);
- RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup.", 0, INT_MAX);
+ RNA_def_int(func, "width", 300, 0, INT_MAX, "", "Width of the popup", 0, INT_MAX);
+ RNA_def_int(func, "height", 20, 0, INT_MAX, "", "Height of the popup", 0, INT_MAX);
}
if(flag & WM_GEN_INVOKE_RETURN) {
@@ -199,12 +199,12 @@ void RNA_api_wm(StructRNA *srna)
PropertyRNA *parm;
func= RNA_def_function(srna, "fileselect_add", "WM_event_add_fileselect");
- RNA_def_function_ui_description(func, "Show up the file selector.");
+ RNA_def_function_ui_description(func, "Show up the file selector");
rna_generic_op_invoke(func, 0);
func= RNA_def_function(srna, "modal_handler_add", "rna_event_modal_handler_add");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call.");
+ parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call");
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_function_return(func, RNA_def_boolean(func, "handle", 1, "", ""));
@@ -214,7 +214,7 @@ void RNA_api_wm(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_property_range(parm, 0.0, FLT_MAX);
RNA_def_property_ui_text(parm, "Time Step", "Interval in seconds between timer events");
- RNA_def_pointer(func, "window", "Window", "", "Window to attach the timer to or None.");
+ RNA_def_pointer(func, "window", "Window", "", "Window to attach the timer to or None");
parm= RNA_def_pointer(func, "result", "Timer", "", "");
RNA_def_function_return(func, parm);
@@ -226,12 +226,12 @@ void RNA_api_wm(StructRNA *srna)
/* invoke functions, for use with python */
func= RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup");
- RNA_def_function_ui_description(func, "Operator popup invoke.");
+ RNA_def_function_ui_description(func, "Operator popup invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN);
/* invoked dialog opens popup with OK button, does not auto-exec operator. */
func= RNA_def_function(srna, "invoke_props_dialog", "WM_operator_props_dialog_popup");
- RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke.");
+ RNA_def_function_ui_description(func, "Operator dialog (non-autoexec popup) invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN);
/* invoke enum */
@@ -240,11 +240,11 @@ void RNA_api_wm(StructRNA *srna)
/* invoke functions, for use with python */
func= RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup");
- RNA_def_function_ui_description(func, "Operator popup invoke.");
+ RNA_def_function_ui_description(func, "Operator popup invoke");
rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE|WM_GEN_INVOKE_RETURN);
func= RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm");
- RNA_def_function_ui_description(func, "Operator confirmation.");
+ RNA_def_function_ui_description(func, "Operator confirmation");
rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT|WM_GEN_INVOKE_RETURN);
}
@@ -266,7 +266,7 @@ void RNA_api_operator(StructRNA *srna)
/* poll */
func= RNA_def_function(srna, "poll", NULL);
- RNA_def_function_ui_description(func, "Test if the operator can be called or not.");
+ RNA_def_function_ui_description(func, "Test if the operator can be called or not");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", "");
@@ -274,7 +274,7 @@ void RNA_api_operator(StructRNA *srna)
/* exec */
func= RNA_def_function(srna, "execute", NULL);
- RNA_def_function_ui_description(func, "Execute the operator.");
+ RNA_def_function_ui_description(func, "Execute the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@@ -284,7 +284,7 @@ void RNA_api_operator(StructRNA *srna)
/* check */
func= RNA_def_function(srna, "check", NULL);
- RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw.");
+ RNA_def_function_ui_description(func, "Check the operator settings, return True to signal a change to redraw");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@@ -294,7 +294,7 @@ void RNA_api_operator(StructRNA *srna)
/* invoke */
func= RNA_def_function(srna, "invoke", NULL);
- RNA_def_function_ui_description(func, "Invoke the operator.");
+ RNA_def_function_ui_description(func, "Invoke the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@@ -305,7 +305,7 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "modal", NULL); /* same as invoke */
- RNA_def_function_ui_description(func, "Modal operator function.");
+ RNA_def_function_ui_description(func, "Modal operator function");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@@ -317,14 +317,14 @@ void RNA_api_operator(StructRNA *srna)
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw function for the operator.");
+ RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
/* cancel */
func= RNA_def_function(srna, "cancel", NULL);
- RNA_def_function_ui_description(func, "Called when the operator is cancelled.");
+ RNA_def_function_ui_description(func, "Called when the operator is cancelled");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@@ -350,7 +350,7 @@ void RNA_api_macro(StructRNA *srna)
/* poll */
func= RNA_def_function(srna, "poll", NULL);
- RNA_def_function_ui_description(func, "Test if the operator can be called or not.");
+ RNA_def_function_ui_description(func, "Test if the operator can be called or not");
RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL);
RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
parm= RNA_def_pointer(func, "context", "Context", "", "");
@@ -358,7 +358,7 @@ void RNA_api_macro(StructRNA *srna)
/* draw */
func= RNA_def_function(srna, "draw", NULL);
- RNA_def_function_ui_description(func, "Draw function for the operator.");
+ RNA_def_function_ui_description(func, "Draw function for the operator");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm= RNA_def_pointer(func, "context", "Context", "", "");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@@ -377,7 +377,7 @@ void RNA_api_keymap(StructRNA *srna)
func= RNA_def_function(srna, "active", "rna_keymap_active");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map.");
+ parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default");
@@ -420,7 +420,7 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", "");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item.");
+ parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "new_modal", "rna_KeyMap_item_new_modal");
@@ -437,7 +437,7 @@ void RNA_api_keymapitems(StructRNA *srna)
RNA_def_boolean(func, "alt", 0, "Alt", "");
RNA_def_boolean(func, "oskey", 0, "OS Key", "");
RNA_def_enum(func, "key_modifier", event_type_items, 0, "Key Modifier", "");
- parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item.");
+ parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "WM_keymap_remove_item");
@@ -463,7 +463,7 @@ void RNA_api_keymaps(StructRNA *srna)
RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", "");
RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
RNA_def_boolean(func, "modal", 0, "Modal", "");
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map.");
+ parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "find", "rna_keymap_find"); // find_keymap
@@ -471,13 +471,13 @@ void RNA_api_keymaps(StructRNA *srna)
RNA_def_property_flag(parm, PROP_REQUIRED);
RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", "");
RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map.");
+ parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "find_modal", "rna_keymap_find_modal"); // find_keymap_modal
parm= RNA_def_string(func, "name", "", 0, "Operator Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map.");
+ parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map");
RNA_def_function_return(func, parm);
}
@@ -489,11 +489,11 @@ void RNA_api_keyconfigs(StructRNA *srna)
func= RNA_def_function(srna, "new", "WM_keyconfig_new_user"); // add_keyconfig
parm= RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration.");
+ parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration");
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "WM_keyconfig_remove"); // remove_keyconfig
- parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration.");
+ parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration");
RNA_def_property_flag(parm, PROP_REQUIRED);
}
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index d8344a9e19b..fb4aa4ca4a5 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -65,7 +65,7 @@ set(SRC
intern/MOD_meshdeform.c
intern/MOD_mirror.c
intern/MOD_multires.c
- intern/MOD_navmesh.cpp
+ intern/MOD_navmesh.c
intern/MOD_none.c
intern/MOD_particleinstance.c
intern/MOD_particlesystem.c
@@ -117,11 +117,11 @@ if(NOT WITH_MOD_FLUID)
endif()
if(WITH_GAMEENGINE)
- # for MOD_navmesh.cpp
+ # for MOD_navmesh.c
add_definitions(-DWITH_GAMEENGINE)
list(APPEND INC
../gpu
- ../../../extern/recastnavigation/Recast/Include
+ ../../../extern/recastnavigation
)
endif()
diff --git a/source/blender/modifiers/SConscript b/source/blender/modifiers/SConscript
index da37539e950..77a2d577fb5 100644
--- a/source/blender/modifiers/SConscript
+++ b/source/blender/modifiers/SConscript
@@ -1,7 +1,7 @@
#!/usr/bin/python
Import ('env')
-sources = env.Glob('intern/*.c') + env.Glob('intern/*.cpp')
+sources = env.Glob('intern/*.c')
incs = '. ./intern'
incs += ' #/intern/guardedalloc #/intern/decimation/extern #/intern/bsp/extern #/intern/elbeem/extern #/extern/glew/include'
@@ -21,7 +21,7 @@ if env['BF_NO_ELBEEM']:
defs.append('DISABLE_ELBEEM')
if env['WITH_BF_GAMEENGINE']:
- incs += ' #/extern/recastnavigation/Recast/Include'
+ incs += ' #/extern/recastnavigation'
defs.append('WITH_GAMEENGINE')
env.BlenderLib ( libname = 'bf_modifiers', sources = sources,
diff --git a/source/blender/modifiers/intern/MOD_navmesh.cpp b/source/blender/modifiers/intern/MOD_navmesh.c
index 927085033fc..cf4e01ad516 100644
--- a/source/blender/modifiers/intern/MOD_navmesh.cpp
+++ b/source/blender/modifiers/intern/MOD_navmesh.c
@@ -27,22 +27,17 @@
*/
#include <math.h>
-#ifdef WITH_GAMEENGINE
-# include "Recast.h"
-#endif
-
-extern "C"{
+#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 "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-
#include "BLI_math.h"
#include "BLI_utildefines.h"
@@ -53,12 +48,12 @@ extern "C"{
#include "BKE_customdata.h"
#include "MEM_guardedalloc.h"
-inline int bit(int a, int b)
+BM_INLINE int bit(int a, int b)
{
return (a & (1 << b)) >> b;
}
-inline void intToCol(int i, float* col)
+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;
@@ -69,12 +64,12 @@ inline void intToCol(int i, float* col)
}
-static void initData(ModifierData *md)
+static void initData(ModifierData *UNUSED(md))
{
/* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */ /* UNUSED */
}
-static void copyData(ModifierData *md, ModifierData *target)
+static void copyData(ModifierData *UNUSED(md), ModifierData *UNUSED(target))
{
/* NavMeshModifierData *nmmd = (NavMeshModifierData*) md; */
/* NavMeshModifierData *tnmmd = (NavMeshModifierData*) target; */
@@ -94,10 +89,12 @@ static void drawNavMeshColored(DerivedMesh *dm)
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);
- if (!polygonIdx)
- return;
const float BLACK_COLOR[3] = {0.f, 0.f, 0.f};
float col[3];
+
+ if (!polygonIdx)
+ return;
+
/*
//UI_ThemeColor(TH_WIRE);
glDisable(GL_LIGHTING);
@@ -138,23 +135,34 @@ static void drawNavMeshColored(DerivedMesh *dm)
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 fast, int (*setMaterial)(int, void *attribs))
+ 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 *mmd,DerivedMesh *dm)
+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))
@@ -163,24 +171,21 @@ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,Deriv
CustomData_add_layer_named(&result->faceData, CD_RECAST, CD_DUPLICATE,
sourceRecastData, maxFaces, "recastData");
}
- int *recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST);
+ recastData = (int*)CustomData_get_layer(&result->faceData, CD_RECAST);
result->drawFacesTex = navDM_drawFacesTex;
result->drawFacesSolid = navDM_drawFacesSolid;
//process mesh
- 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;
-
- bool res = buildNavMeshDataByDerivedMesh(dm, vertsPerPoly, nverts, verts, ndtris, dtris,
- npolys, dmeshes, polys, dtrisToPolysMap, dtrisToTrisMap,
- trisToFacesMap);
+ res = buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nverts, &verts, &ndtris, &dtris,
+ &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap,
+ &trisToFacesMap);
if (res)
{
+ size_t polyIdx;
+
//invalidate concave polygon
- for (size_t polyIdx=0; polyIdx<(size_t)npolys; polyIdx++)
+ for (polyIdx=0; polyIdx<(size_t)npolys; polyIdx++)
{
unsigned short* poly = &polys[polyIdx*2*vertsPerPoly];
if (!polyIsConvex(poly, vertsPerPoly, verts))
@@ -189,7 +194,9 @@ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,Deriv
unsigned short *dmesh = &dmeshes[4*polyIdx];
unsigned short tbase = dmesh[2];
unsigned short tnum = dmesh[3];
- for (unsigned short ti=0; ti<tnum; ti++)
+ unsigned short ti;
+
+ for (ti=0; ti<tnum; ti++)
{
unsigned short triidx = dtrisToTrisMap[tbase+ti];
unsigned short faceidx = trisToFacesMap[triidx];
@@ -207,19 +214,19 @@ static DerivedMesh *createNavMeshForVisualization(NavMeshModifierData *mmd,Deriv
//clean up
if (verts!=NULL)
- delete verts;
+ MEM_freeN(verts);
if (dtris!=NULL)
- delete dtris;
+ MEM_freeN(dtris);
if (dmeshes!=NULL)
- delete dmeshes;
+ MEM_freeN(dmeshes);
if (polys!=NULL)
- delete polys;
+ MEM_freeN(polys);
if (dtrisToPolysMap!=NULL)
- delete dtrisToPolysMap;
+ MEM_freeN(dtrisToPolysMap);
if (dtrisToTrisMap!=NULL)
- delete dtrisToTrisMap;
+ MEM_freeN(dtrisToTrisMap);
if (trisToFacesMap!=NULL)
- delete trisToFacesMap;
+ MEM_freeN(trisToFacesMap);
return result;
#else // WITH_GAMEENGINE
@@ -237,11 +244,11 @@ static int isDisabled(ModifierData *md, int useRenderParams)
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData,
- int useRenderParams, int isFinalCalc)
+ int UNUSED(useRenderParams), int UNUSED(isFinalCalc))
{
DerivedMesh *result = NULL;
NavMeshModifierData *nmmd = (NavMeshModifierData*) md;
- bool hasRecastData = CustomData_has_layer(&derivedData->faceData, CD_RECAST)>0;
+ int hasRecastData = CustomData_has_layer(&derivedData->faceData, CD_RECAST)>0;
if (ob->body_type!=OB_BODY_TYPE_NAVMESH || !hasRecastData )
{
//convert to nav mesh object:
@@ -255,10 +262,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
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");
- int* recastData = (int*)CustomData_get_layer(&obmesh->fdata, CD_RECAST);
- for (int i=0; i<numFaces; i++)
+ recastData = (int*)CustomData_get_layer(&obmesh->fdata, CD_RECAST);
+ for (i=0; i<numFaces; i++)
{
recastData[i] = i+1;
}
@@ -296,5 +305,3 @@ ModifierTypeInfo modifierType_NavMesh = {
/* foreachObjectLink */ 0,
/* foreachIDLink */ 0,
};
-
-};
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 912c14adfdd..0c343332736 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -369,7 +369,6 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
}
if(override_image) {
- tface->mode = TF_TEX;
tface->tpage = image;
}
}
diff --git a/source/blender/nodes/composite/node_composite_util.h b/source/blender/nodes/composite/node_composite_util.h
index 57ebe2191dd..f3e0f811f13 100644
--- a/source/blender/nodes/composite/node_composite_util.h
+++ b/source/blender/nodes/composite/node_composite_util.h
@@ -79,6 +79,10 @@
#include "RE_shader_ext.h"
#include "RE_render_ext.h"
+/* only for forward declarations */
+#include "NOD_composite.h"
+
+
/* *************************** operations support *************************** */
/* general signal that's in output sockets, and goes over the wires */
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
index 418d6802cec..cc55569e566 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorSpill.c
@@ -192,7 +192,7 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
/* Originally based on the information from the book "The Art and Science of Digital Composition" and
* discussions from vfxtalk.com .*/
CompBuf *cbuf;
- CompBuf *mask;
+ /* CompBuf *mask; */ /* UNUSED */
CompBuf *rgbbuf;
CompBuf *spillmap;
NodeColorspill *ncs;
@@ -204,7 +204,7 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
if(in[0]->data==NULL) return;
cbuf=typecheck_compbuf(in[0]->data, CB_RGBA);
- mask=typecheck_compbuf(in[1]->data, CB_VAL);
+ /* mask= */ /* UNUSED */ typecheck_compbuf(in[1]->data, CB_VAL);
spillmap=alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1);
rgbbuf=dupalloc_compbuf(cbuf);
diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
index 9f4af0e0d33..f3cb223079f 100644
--- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
@@ -91,7 +91,7 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **
CompBuf *outbuf= NULL;
CompBuf *imbuf1= NULL;
CompBuf *imbuf2= NULL;
- NodeChroma *c;
+ /* NodeChroma *c; */ /* UNUSED */
/*is anything connected?*/
if(out[0]->hasoutput==0 && out[1]->hasoutput==0) return;
@@ -107,7 +107,7 @@ static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **
imbuf2=typecheck_compbuf(in[1]->data, CB_RGBA);
}
- c=node->storage;
+ /* c=node->storage; */ /* UNUSED */
outbuf=dupalloc_compbuf(imbuf1);
/* note, processor gets a keyvals array passed on as buffer constant */
diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c
index d7830b6a260..35f2dbf7b32 100644
--- a/source/blender/nodes/intern/node_common.c
+++ b/source/blender/nodes/intern/node_common.c
@@ -826,11 +826,11 @@ bNodeTemplate node_forloop_template(bNode *node)
void node_forloop_init(bNodeTree *ntree, bNode *node, bNodeTemplate *ntemp)
{
- bNodeSocket *sock;
+ /* bNodeSocket *sock; */ /* UNUSED */
node->id = (ID*)ntemp->ngroup;
- sock = nodeAddInputFloat(ntree, node, "Iterations", PROP_UNSIGNED, 1, 0, 10000);
+ /* sock = */ nodeAddInputFloat(ntree, node, "Iterations", PROP_UNSIGNED, 1, 0, 10000);
/* NB: group socket input/output roles are inverted internally!
* Group "inputs" work as outputs in links and vice versa.
@@ -932,11 +932,11 @@ void node_loop_update_tree(bNodeTree *ngroup)
void node_whileloop_init(bNodeTree *ntree, bNode *node, bNodeTemplate *ntemp)
{
- bNodeSocket *sock;
+ /* bNodeSocket *sock; */ /* UNUSED */
node->id = (ID*)ntemp->ngroup;
- sock = nodeAddInputFloat(ntree, node, "Condition", PROP_NONE, 1, 0, 1);
+ /* sock = */ nodeAddInputFloat(ntree, node, "Condition", PROP_NONE, 1, 0, 1);
/* max iterations */
node->custom1 = 10000;
diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript
index 07f987f4751..e73abdeefd0 100644
--- a/source/blender/python/SConscript
+++ b/source/blender/python/SConscript
@@ -18,6 +18,9 @@ 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
diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt
index 8dfbf476995..0a49036c15d 100644
--- a/source/blender/python/generic/CMakeLists.txt
+++ b/source/blender/python/generic/CMakeLists.txt
@@ -48,5 +48,8 @@ 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/bgl.c b/source/blender/python/generic/bgl.c
index ae8069cf3c5..44d42a479ec 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -61,9 +61,9 @@ static PySequenceMethods Buffer_SeqMethods = {
(binaryfunc) NULL, /*sq_concat */
(ssizeargfunc) NULL, /*sq_repeat */
(ssizeargfunc) Buffer_item, /*sq_item */
- (ssizessizeargfunc) Buffer_slice, /*sq_slice, deprecated TODO, replace */
+ (ssizessizeargfunc) NULL, /*sq_slice, deprecated, handled in Buffer_item */
(ssizeobjargproc) Buffer_ass_item, /*sq_ass_item */
- (ssizessizeobjargproc) Buffer_ass_slice, /*sq_ass_slice, deprecated TODO, replace */
+ (ssizessizeobjargproc) NULL, /*sq_ass_slice, deprecated handled in Buffer_ass_item */
(objobjproc) NULL, /* sq_contains */
(binaryfunc) NULL, /* sq_inplace_concat */
(ssizeargfunc) NULL, /* sq_inplace_repeat */
@@ -112,13 +112,6 @@ static PyObject *Buffer_to_list_recursive(Buffer *self)
return list;
}
-/* *DEPRECATED* 2011/7/17 bgl.Buffer.list */
-static PyObject *Buffer_list(Buffer *self, void *UNUSED(arg))
-{
- fprintf(stderr, "Warning: 'Buffer.list' deprecated, use '[:]' instead\n");
- return Buffer_to_list(self);
-}
-
static PyObject *Buffer_dimensions(Buffer *self, void *UNUSED(arg))
{
PyObject *list= PyList_New(self->ndimensions);
@@ -138,7 +131,6 @@ static PyMethodDef Buffer_methods[] = {
};
static PyGetSetDef Buffer_getseters[] = {
- {(char *)"list", (getter)Buffer_list, NULL, NULL, NULL},
{(char *)"dimensions", (getter)Buffer_dimensions, NULL, NULL, NULL},
{NULL, NULL, NULL, NULL, NULL}
};
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index 3cf0b0f1f27..87e4a301eff 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -31,9 +31,13 @@
#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,
@@ -367,6 +371,35 @@ 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"
+"\n"
+" Get a msg in local language.\n"
+"\n"
+" :arg msgid: the source string.\n"
+" :type msgid: string\n"
+" :return: the localized string.\n"
+" :rtype: string\n"
+);
+static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *value)
+{
+#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;
+ }
+}
+
/*----------------------------MODULE INIT-------------------------*/
static PyMethodDef BLF_methods[] = {
{"aspect", (PyCFunction) py_blf_aspect, METH_VARARGS, py_blf_aspect_doc},
@@ -382,6 +415,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},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index 3ad5e000233..3bf22d26af4 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -48,6 +48,7 @@ set(SRC
bpy_app_handlers.c
bpy_driver.c
bpy_interface.c
+ bpy_interface_atexit.c
bpy_intern_string.c
bpy_library.c
bpy_operator.c
diff --git a/source/blender/python/intern/bpy.h b/source/blender/python/intern/bpy.h
index 0ebc6bb2438..f60146021d3 100644
--- a/source/blender/python/intern/bpy.h
+++ b/source/blender/python/intern/bpy.h
@@ -28,3 +28,7 @@
void BPy_init_modules(void);
extern PyObject *bpy_package_py;
+
+/* bpy_interface_atexit.c */
+void BPY_atexit_register(void);
+void BPY_atexit_unregister(void);
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index e5bfc1d633f..429a74fddc0 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -30,7 +30,7 @@
/* grr, python redefines */
#ifdef _POSIX_C_SOURCE
-#undef _POSIX_C_SOURCE
+# undef _POSIX_C_SOURCE
#endif
#include <Python.h>
@@ -241,6 +241,8 @@ void BPY_python_start(int argc, const char **argv)
pyrna_alloc_types();
+ BPY_atexit_register(); /* this can init any time */
+
#ifndef WITH_PYTHON_MODULE
py_tstate= PyGILState_GetThisThreadState();
PyEval_ReleaseThread(py_tstate);
@@ -260,6 +262,8 @@ void BPY_python_end(void)
bpy_intern_string_exit();
+ BPY_atexit_unregister(); /* without this we get recursive calls to WM_exit */
+
Py_Finalize();
#ifdef TIME_PY_RUN
diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c
new file mode 100644
index 00000000000..ac8c90198a0
--- /dev/null
+++ b/source/blender/python/intern/bpy_interface_atexit.c
@@ -0,0 +1,94 @@
+/*
+ * $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/python/intern/bpy_interface_atexit.c
+ * \ingroup pythonintern
+ */
+
+
+#include <Python.h>
+
+#include "bpy_util.h"
+
+#include "WM_api.h"
+
+#include "BLI_utildefines.h"
+
+static PyObject *bpy_atexit(PyObject *UNUSED(self), PyObject *UNUSED(args), PyObject *UNUSED(kw))
+{
+ /* close down enough of blender at least not to crash */
+ struct bContext *C= BPy_GetContext();
+
+ WM_exit_ext(C, 0);
+
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef meth_bpy_atexit= {"bpy_atexit", (PyCFunction)bpy_atexit, METH_NOARGS, NULL};
+static PyObject *func_bpy_atregister= NULL; /* borrowed referebce, atexit holds */
+
+static void atexit_func_call(const char *func_name, PyObject *atexit_func_arg)
+{
+ /* note - no error checking, if any of these fail we'll get a crash
+ * this is intended, but if its problematic it could be changed
+ * - campbell */
+
+ PyObject *atexit_mod= PyImport_ImportModuleLevel((char *)"atexit", NULL, NULL, NULL, 0);
+ PyObject *atexit_func= PyObject_GetAttrString(atexit_mod, func_name);
+ PyObject *args= PyTuple_New(1);
+ PyObject *ret;
+
+ PyTuple_SET_ITEM(args, 0, atexit_func_arg);
+ Py_INCREF(atexit_func_arg); /* only incref so we dont dec'ref along with 'args' */
+
+ ret= PyObject_CallObject(atexit_func, args);
+
+ Py_DECREF(atexit_mod);
+ Py_DECREF(atexit_func);
+ Py_DECREF(args);
+
+ if(ret) {
+ Py_DECREF(ret);
+ }
+ else { /* should never happen */
+ PyErr_Print();
+ }
+}
+
+void BPY_atexit_register(void)
+{
+ /* atexit module owns this new function reference */
+ BLI_assert(func_bpy_atregister == NULL);
+
+ func_bpy_atregister= (PyObject *)PyCFunction_New(&meth_bpy_atexit, NULL);
+ atexit_func_call("register", func_bpy_atregister);
+}
+
+void BPY_atexit_unregister(void)
+{
+ BLI_assert(func_bpy_atregister != NULL);
+
+ atexit_func_call("unregister", func_bpy_atregister);
+ func_bpy_atregister= NULL; /* don't really need to set but just incase */
+}
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 5c609d8961f..c96eafcd6ad 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -196,16 +196,18 @@ PyDoc_STRVAR(Euler_rotate_axis_doc,
static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args)
{
float angle = 0.0f;
- const char *axis;
+ int axis; /* actually a character */
- if(!PyArg_ParseTuple(args, "sf:rotate", &axis, &angle)){
+ if(!PyArg_ParseTuple(args, "Cf:rotate", &axis, &angle)){
PyErr_SetString(PyExc_TypeError,
- "euler.rotate(): "
- "expected angle (float) and axis (x, y, z)");
+ "Euler.rotate_axis(): "
+ "expected an axis 'X', 'Y', 'Z' and an angle (float)");
return NULL;
}
- if(!(ELEM3(*axis, 'X', 'Y', 'Z') && axis[1]=='\0')){
- PyErr_SetString(PyExc_ValueError, "euler.rotate(): "
+
+ if(!(ELEM3(axis, 'X', 'Y', 'Z'))){
+ PyErr_SetString(PyExc_ValueError,
+ "Euler.rotate_axis(): "
"expected axis to be 'X', 'Y' or 'Z'");
return NULL;
}
@@ -214,7 +216,7 @@ static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args)
return NULL;
- rotate_eulO(self->eul, self->order, *axis, angle);
+ rotate_eulO(self->eul, self->order, (char)axis, angle);
(void)BaseMath_WriteCallback(self);
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 3953171f263..a2a15600965 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -119,7 +119,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
if(kwds && PyDict_Size(kwds)) {
PyErr_SetString(PyExc_TypeError,
- "mathutils.Matrix(): "
+ "Matrix(): "
"takes no keyword args");
return NULL;
}
@@ -155,7 +155,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
/* will overwrite error */
PyErr_SetString(PyExc_TypeError,
- "mathutils.Matrix(): "
+ "Matrix(): "
"expects no args or 2-4 numeric sequences");
return NULL;
}
@@ -216,7 +216,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
if(!PyArg_ParseTuple(args, "di|O", &angle, &matSize, &vec)) {
PyErr_SetString(PyExc_TypeError,
- "mathutils.RotationMatrix(angle, size, axis): "
+ "Matrix.Rotation(angle, size, axis): "
"expected float int and a string or vector");
return NULL;
}
@@ -225,7 +225,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
axis= _PyUnicode_AsString((PyObject *)vec);
if(axis==NULL || axis[0]=='\0' || axis[1]!='\0' || axis[0] < 'X' || axis[0] > 'Z') {
PyErr_SetString(PyExc_ValueError,
- "mathutils.RotationMatrix(): "
+ "Matrix.Rotation(): "
"3rd argument axis value must be a 3D vector "
"or a string in 'X', 'Y', 'Z'");
return NULL;
@@ -240,19 +240,19 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
if(matSize != 2 && matSize != 3 && matSize != 4) {
PyErr_SetString(PyExc_ValueError,
- "mathutils.RotationMatrix(): "
+ "Matrix.Rotation(): "
"can only return a 2x2 3x3 or 4x4 matrix");
return NULL;
}
if(matSize == 2 && (vec != NULL)) {
PyErr_SetString(PyExc_ValueError,
- "mathutils.RotationMatrix(): "
+ "Matrix.Rotation(): "
"cannot create a 2x2 rotation matrix around arbitrary axis");
return NULL;
}
if((matSize == 3 || matSize == 4) && (axis == NULL) && (vec == NULL)) {
PyErr_SetString(PyExc_ValueError,
- "mathutils.RotationMatrix(): "
+ "Matrix.Rotation(): "
"axis of rotation for 3d and 4d matrices is required");
return NULL;
}
@@ -261,47 +261,24 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
if(vec) {
float tvec[3];
- if (mathutils_array_parse(tvec, 3, 3, vec, "mathutils.RotationMatrix(angle, size, axis), invalid 'axis' arg") == -1)
+ if (mathutils_array_parse(tvec, 3, 3, vec, "Matrix.Rotation(angle, size, axis), invalid 'axis' arg") == -1)
return NULL;
axis_angle_to_mat3((float (*)[3])mat, tvec, angle);
}
- else if(matSize == 2) {
+ else if (matSize == 2) {
+ const float angle_cos= cosf(angle);
+ const float angle_sin= sinf(angle);
+
//2D rotation matrix
- mat[0] = (float) cos (angle);
- mat[1] = (float) sin (angle);
- mat[2] = -((float) sin(angle));
- mat[3] = (float) cos(angle);
- }
- else if(strcmp(axis, "X") == 0) {
- //rotation around X
- mat[0] = 1.0f;
- mat[4] = (float) cos(angle);
- mat[5] = (float) sin(angle);
- mat[7] = -((float) sin(angle));
- mat[8] = (float) cos(angle);
- }
- else if(strcmp(axis, "Y") == 0) {
- //rotation around Y
- mat[0] = (float) cos(angle);
- mat[2] = -((float) sin(angle));
- mat[4] = 1.0f;
- mat[6] = (float) sin(angle);
- mat[8] = (float) cos(angle);
- }
- else if(strcmp(axis, "Z") == 0) {
- //rotation around Z
- mat[0] = (float) cos(angle);
- mat[1] = (float) sin(angle);
- mat[3] = -((float) sin(angle));
- mat[4] = (float) cos(angle);
- mat[8] = 1.0f;
+ mat[0] = angle_cos;
+ mat[1] = angle_sin;
+ mat[2] = -angle_sin;
+ mat[3] = angle_cos;
}
else {
- /* should never get here */
- PyErr_SetString(PyExc_ValueError,
- "mathutils.RotationMatrix(): unknown error");
- return NULL;
+ /* valid axis checked above */
+ single_axis_angle_to_mat3((float (*)[3])mat, axis[0], angle);
}
if(matSize == 4) {
@@ -451,7 +428,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
}
if(matSize != 2 && matSize != 3 && matSize != 4) {
PyErr_SetString(PyExc_ValueError,
- "mathutils.Matrix.OrthoProjection(): "
+ "Matrix.OrthoProjection(): "
"can only return a 2x2 3x3 or 4x4 matrix");
return NULL;
}
@@ -468,7 +445,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
}
else {
PyErr_Format(PyExc_ValueError,
- "mathutils.Matrix.OrthoProjection(): "
+ "Matrix.OrthoProjection(): "
"unknown plane, expected: X, Y, not '%.200s'",
plane);
return NULL;
@@ -489,7 +466,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
}
else {
PyErr_Format(PyExc_ValueError,
- "mathutils.Matrix.OrthoProjection(): "
+ "Matrix.OrthoProjection(): "
"unknown plane, expected: XY, XZ, YZ, not '%.200s'",
plane);
return NULL;
@@ -568,7 +545,7 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
}
if(matSize != 2 && matSize != 3 && matSize != 4) {
PyErr_SetString(PyExc_ValueError,
- "mathutils.Matrix.Shear(): "
+ "Matrix.Shear(): "
"can only return a 2x2 3x3 or 4x4 matrix");
return NULL;
}
@@ -578,7 +555,7 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
if(factor==-1.0f && PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError,
- "mathutils.Matrix.Shear(): "
+ "Matrix.Shear(): "
"the factor to be a float");
return NULL;
}
@@ -627,7 +604,7 @@ static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "mathutils.Matrix.Shear(): "
+ "Matrix.Shear(): "
"expected: X, Y, XY, XZ, YZ");
return NULL;
}
@@ -686,7 +663,7 @@ static PyObject *Matrix_to_quaternion(MatrixObject *self)
/*must be 3-4 cols, 3-4 rows, square matrix*/
if((self->col_size < 3) || (self->row_size < 3) || (self->col_size != self->row_size)) {
PyErr_SetString(PyExc_ValueError,
- "matrix.to_quat(): "
+ "Matrix.to_quat(): "
"inappropriate matrix size - expects 3x3 or 4x4 matrix");
return NULL;
}
@@ -750,13 +727,13 @@ static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "matrix.to_euler(): "
+ "Matrix.to_euler(): "
"inappropriate matrix size - expects 3x3 or 4x4 matrix");
return NULL;
}
if(order_str) {
- order= euler_order_from_string(order_str, "matrix.to_euler()");
+ order= euler_order_from_string(order_str, "Matrix.to_euler()");
if(order == -1)
return NULL;
@@ -785,11 +762,13 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self)
if(self->wrapped==Py_WRAP){
PyErr_SetString(PyExc_TypeError,
+ "Matrix.resize_4x4(): "
"cannot resize wrapped data - make a copy and resize that");
return NULL;
}
if(self->cb_user){
PyErr_SetString(PyExc_TypeError,
+ "Matrix.resize_4x4(): "
"cannot resize owned data - make a copy and resize that");
return NULL;
}
@@ -797,7 +776,8 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self)
self->contigPtr = PyMem_Realloc(self->contigPtr, (sizeof(float) * 16));
if(self->contigPtr == NULL) {
PyErr_SetString(PyExc_MemoryError,
- "matrix.resize_4x4(): problem allocating pointer space");
+ "Matrix.resize_4x4(): "
+ "problem allocating pointer space");
return NULL;
}
/*set row pointers*/
@@ -858,7 +838,8 @@ static PyObject *Matrix_to_4x4(MatrixObject *self)
/* TODO, 2x2 matrix */
PyErr_SetString(PyExc_TypeError,
- "matrix.to_4x4(): inappropriate matrix size");
+ "Matrix.to_4x4(): "
+ "inappropriate matrix size");
return NULL;
}
@@ -879,7 +860,7 @@ static PyObject *Matrix_to_3x3(MatrixObject *self)
if((self->col_size < 3) || (self->row_size < 3)) {
PyErr_SetString(PyExc_TypeError,
- "matrix.to_3x3(): inappropriate matrix size");
+ "Matrix.to_3x3(): inappropriate matrix size");
return NULL;
}
@@ -903,7 +884,7 @@ static PyObject *Matrix_to_translation(MatrixObject *self)
if((self->col_size < 3) || self->row_size < 4){
PyErr_SetString(PyExc_TypeError,
- "matrix.to_translation(): "
+ "Matrix.to_translation(): "
"inappropriate matrix size");
return NULL;
}
@@ -933,7 +914,7 @@ static PyObject *Matrix_to_scale(MatrixObject *self)
/*must be 3-4 cols, 3-4 rows, square matrix*/
if((self->col_size < 3) || (self->row_size < 3)) {
PyErr_SetString(PyExc_TypeError,
- "matrix.to_scale(): "
+ "Matrix.to_scale(): "
"inappropriate matrix size, 3x3 minimum size");
return NULL;
}
@@ -969,7 +950,7 @@ static PyObject *Matrix_invert(MatrixObject *self)
if(self->row_size != self->col_size){
PyErr_SetString(PyExc_TypeError,
- "matrix.invert(ed): "
+ "Matrix.invert(ed): "
"only square matrices are supported");
return NULL;
}
@@ -1005,6 +986,7 @@ static PyObject *Matrix_invert(MatrixObject *self)
}
else {
PyErr_SetString(PyExc_ValueError,
+ "Matrix.invert(ed): "
"matrix does not have an inverse");
return NULL;
}
@@ -1050,7 +1032,8 @@ static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value)
if(self->col_size != 3 || self->row_size != 3) {
PyErr_SetString(PyExc_TypeError,
- "Matrix must have 3x3 dimensions");
+ "Matrix.rotate(): "
+ "must have 3x3 dimensions");
return NULL;
}
@@ -1082,7 +1065,7 @@ static PyObject *Matrix_decompose(MatrixObject *self)
if(self->col_size != 4 || self->row_size != 4) {
PyErr_SetString(PyExc_TypeError,
- "matrix.decompose(): "
+ "Matrix.decompose(): "
"inappropriate matrix size - expects 4x4 matrix");
return NULL;
}
@@ -1125,7 +1108,7 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args)
if(self->row_size != mat2->row_size || self->col_size != mat2->col_size) {
PyErr_SetString(PyExc_ValueError,
- "matrix.lerp(): "
+ "Matrix.lerp(): "
"expects both matrix objects of the same dimensions");
return NULL;
}
@@ -1142,7 +1125,7 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "matrix.lerp(): "
+ "Matrix.lerp(): "
"only 3x3 and 4x4 matrices supported");
return NULL;
}
@@ -1168,7 +1151,7 @@ static PyObject *Matrix_determinant(MatrixObject *self)
if(self->row_size != self->col_size){
PyErr_SetString(PyExc_TypeError,
- "matrix.determinant: "
+ "Matrix.determinant(): "
"only square matrices are supported");
return NULL;
}
@@ -1192,7 +1175,7 @@ static PyObject *Matrix_transpose(MatrixObject *self)
if(self->row_size != self->col_size){
PyErr_SetString(PyExc_TypeError,
- "matrix.transpose(d): "
+ "Matrix.transpose(d): "
"only square matrices are supported");
return NULL;
}
@@ -1261,7 +1244,7 @@ static PyObject *Matrix_identity(MatrixObject *self)
if(self->row_size != self->col_size){
PyErr_SetString(PyExc_TypeError,
- "matrix.identity: "
+ "Matrix.identity(): "
"only square matrices are supported");
return NULL;
}
@@ -1794,7 +1777,7 @@ static PyObject *Matrix_median_scale_get(MatrixObject *self, void *UNUSED(closur
/*must be 3-4 cols, 3-4 rows, square matrix*/
if((self->col_size < 3) || (self->row_size < 3)) {
PyErr_SetString(PyExc_AttributeError,
- "matrix.median_scale: "
+ "Matrix.median_scale: "
"inappropriate matrix size, 3x3 minimum");
return NULL;
}
@@ -1816,7 +1799,7 @@ static PyObject *Matrix_is_negative_get(MatrixObject *self, void *UNUSED(closure
return PyBool_FromLong(is_negative_m3((float (*)[3])self->contigPtr));
else {
PyErr_SetString(PyExc_AttributeError,
- "matrix.is_negative: "
+ "Matrix.is_negative: "
"inappropriate matrix size - expects 3x3 or 4x4 matrix");
return NULL;
}
@@ -1834,7 +1817,7 @@ static PyObject *Matrix_is_orthogonal_get(MatrixObject *self, void *UNUSED(closu
return PyBool_FromLong(is_orthogonal_m3((float (*)[3])self->contigPtr));
else {
PyErr_SetString(PyExc_AttributeError,
- "matrix.is_orthogonal: "
+ "Matrix.is_orthogonal: "
"inappropriate matrix size - expects 3x3 or 4x4 matrix");
return NULL;
}
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index 2be258a1ef0..947e4425d3f 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -161,7 +161,7 @@ static PyObject *Quaternion_cross(QuaternionObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "quaternion.cross(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.cross(other), invalid 'other' arg") == -1)
return NULL;
mul_qt_qtqt(quat, self->quat, tquat);
@@ -186,7 +186,7 @@ static PyObject *Quaternion_dot(QuaternionObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "quaternion.dot(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.dot(other), invalid 'other' arg") == -1)
return NULL;
return PyFloat_FromDouble(dot_qtqt(self->quat, tquat));
@@ -209,7 +209,7 @@ static PyObject *Quaternion_rotation_difference(QuaternionObject *self, PyObject
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "quaternion.difference(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.difference(other), invalid 'other' arg") == -1)
return NULL;
rotation_between_quats_to_quat(quat, self->quat, tquat);
@@ -244,7 +244,7 @@ static PyObject *Quaternion_slerp(QuaternionObject *self, PyObject *args)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "quaternion.slerp(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.slerp(other), invalid 'other' arg") == -1)
return NULL;
if(fac > 1.0f || fac < 0.0f) {
@@ -275,7 +275,7 @@ static PyObject *Quaternion_rotate(QuaternionObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_any_to_rotmat(other_rmat, value, "quaternion.rotate(value)") == -1)
+ if(mathutils_any_to_rotmat(other_rmat, value, "Quaternion.rotate(value)") == -1)
return NULL;
length= normalize_qt_qt(tquat, self->quat);
@@ -909,7 +909,7 @@ static int Quaternion_setAngle(QuaternionObject *self, PyObject *value, void *UN
if(angle==-1.0 && PyErr_Occurred()) { /* parsed item not a number */
PyErr_SetString(PyExc_TypeError,
- "quaternion.angle = value: float expected");
+ "Quaternion.angle = value: float expected");
return -1;
}
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 56c1334ecac..413df78f09e 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -48,6 +48,7 @@
static PyObject *Vector_copy(VectorObject *self);
static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits);
+static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat);
/* Supports 2D, 3D, and 4D vector objects both int and float values
* accepted. Mixed float and int values accepted. Ints are parsed to float
@@ -158,13 +159,13 @@ static PyObject *Vector_resize_2d(VectorObject *self)
{
if(self->wrapped==Py_WRAP) {
PyErr_SetString(PyExc_TypeError,
- "vector.resize_2d(): "
+ "Vector.resize_2d(): "
"cannot resize wrapped data - only python vectors");
return NULL;
}
if(self->cb_user) {
PyErr_SetString(PyExc_TypeError,
- "vector.resize_2d(): "
+ "Vector.resize_2d(): "
"cannot resize a vector that has an owner");
return NULL;
}
@@ -172,7 +173,7 @@ static PyObject *Vector_resize_2d(VectorObject *self)
self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2));
if(self->vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
- "vector.resize_2d(): "
+ "Vector.resize_2d(): "
"problem allocating pointer space");
return NULL;
}
@@ -193,13 +194,13 @@ static PyObject *Vector_resize_3d(VectorObject *self)
{
if (self->wrapped==Py_WRAP) {
PyErr_SetString(PyExc_TypeError,
- "vector.resize_3d(): "
+ "Vector.resize_3d(): "
"cannot resize wrapped data - only python vectors");
return NULL;
}
if(self->cb_user) {
PyErr_SetString(PyExc_TypeError,
- "vector.resize_3d(): "
+ "Vector.resize_3d(): "
"cannot resize a vector that has an owner");
return NULL;
}
@@ -207,7 +208,7 @@ static PyObject *Vector_resize_3d(VectorObject *self)
self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3));
if(self->vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
- "vector.resize_3d(): "
+ "Vector.resize_3d(): "
"problem allocating pointer space");
return NULL;
}
@@ -231,13 +232,13 @@ static PyObject *Vector_resize_4d(VectorObject *self)
{
if(self->wrapped==Py_WRAP) {
PyErr_SetString(PyExc_TypeError,
- "vector.resize_4d(): "
+ "Vector.resize_4d(): "
"cannot resize wrapped data - only python vectors");
return NULL;
}
if(self->cb_user) {
PyErr_SetString(PyExc_TypeError,
- "vector.resize_4d(): "
+ "Vector.resize_4d(): "
"cannot resize a vector that has an owner");
return NULL;
}
@@ -245,7 +246,7 @@ static PyObject *Vector_resize_4d(VectorObject *self)
self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4));
if(self->vec == NULL) {
PyErr_SetString(PyExc_MemoryError,
- "vector.resize_4d(): "
+ "Vector.resize_4d(): "
"problem allocating pointer space");
return NULL;
}
@@ -353,7 +354,7 @@ static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
if(ndigits > 22 || ndigits < 0) {
PyErr_SetString(PyExc_ValueError,
- "vector.to_tuple(ndigits): "
+ "Vector.to_tuple(ndigits): "
"ndigits must be between 0 and 21");
return NULL;
}
@@ -390,7 +391,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
if (self->size != 3) {
PyErr_SetString(PyExc_TypeError,
- "vector.to_track_quat(): "
+ "Vector.to_track_quat(): "
"only for 3D vectors");
return NULL;
}
@@ -511,7 +512,7 @@ static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if((value_size= mathutils_array_parse(tvec, 2, 4, value, "vector.reflect(other), invalid 'other' arg")) == -1)
+ if((value_size= mathutils_array_parse(tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1)
return NULL;
mirror[0] = tvec[0];
@@ -550,7 +551,7 @@ static PyObject *Vector_cross(VectorObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, self->size, self->size, value, "vector.cross(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.cross(other), invalid 'other' arg") == -1)
return NULL;
ret= (VectorObject *)newVectorObject(NULL, 3, Py_NEW, Py_TYPE(self));
@@ -577,7 +578,7 @@ static PyObject *Vector_dot(VectorObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, self->size, self->size, value, "vector.dot(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tvec, self->size, self->size, value, "Vector.dot(other), invalid 'other' arg") == -1)
return NULL;
for(x = 0; x < self->size; x++) {
@@ -617,7 +618,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, size, size, value, "vector.angle(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tvec, size, size, value, "Vector.angle(other), invalid 'other' arg") == -1)
return NULL;
for(x = 0; x < size; x++) {
@@ -632,7 +633,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
}
else {
PyErr_SetString(PyExc_ValueError,
- "vector.angle(other): "
+ "Vector.angle(other): "
"zero length vectors have no valid angle");
return NULL;
}
@@ -674,7 +675,7 @@ static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "vector.difference(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1)
return NULL;
normalize_v3_v3(vec_a, self->vec);
@@ -706,7 +707,7 @@ static PyObject *Vector_project(VectorObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_array_parse(tvec, size, size, value, "vector.project(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tvec, size, size, value, "Vector.project(other), invalid 'other' arg") == -1)
return NULL;
if(BaseMath_ReadCallback(self) == -1)
@@ -748,7 +749,7 @@ static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
if(!PyArg_ParseTuple(args, "Of:lerp", &value, &fac))
return NULL;
- if(mathutils_array_parse(tvec, size, size, value, "vector.lerp(other), invalid 'other' arg") == -1)
+ if(mathutils_array_parse(tvec, size, size, value, "Vector.lerp(other), invalid 'other' arg") == -1)
return NULL;
if(BaseMath_ReadCallback(self) == -1)
@@ -777,7 +778,7 @@ static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
if(BaseMath_ReadCallback(self) == -1)
return NULL;
- if(mathutils_any_to_rotmat(other_rmat, value, "vector.rotate(value)") == -1)
+ if(mathutils_any_to_rotmat(other_rmat, value, "Vector.rotate(value)") == -1)
return NULL;
if(self->size < 3) {
@@ -838,7 +839,7 @@ static PyObject *vector_item_internal(VectorObject *self, int i, const int is_at
if(i < 0 || i >= self->size) {
if(is_attr) {
PyErr_Format(PyExc_AttributeError,
- "vector.%c: unavailable on %dd vector",
+ "Vector.%c: unavailable on %dd vector",
*(((char *)"xyzw") + i), self->size);
}
else {
@@ -874,7 +875,7 @@ static int vector_ass_item_internal(VectorObject *self, int i, PyObject *value,
if(i < 0 || i >= self->size){
if(is_attr) {
PyErr_Format(PyExc_AttributeError,
- "vector.%c = x: unavailable on %dd vector",
+ "Vector.%c = x: unavailable on %dd vector",
*(((char *)"xyzw") + i), self->size);
}
else {
@@ -1159,28 +1160,16 @@ static PyObject *Vector_mul(PyObject *v1, PyObject *v2)
}
else if (vec1) {
if (MatrixObject_Check(v2)) {
-
-/* ------ to be removed ------*/
-#if 1
- PyErr_SetString(PyExc_ValueError,
- "(Vector * Matrix) is now removed, reverse the "
- "order (promoted to an Error for Debug builds)");
- return NULL;
-#else
-
/* VEC * MATRIX */
- /* this is deprecated!, use the reverse instead */
float tvec[MAX_DIMENSIONS];
if(BaseMath_ReadCallback((MatrixObject *)v2) == -1)
return NULL;
- if(column_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) {
+ if(row_vector_multiplication(tvec, vec1, (MatrixObject*)v2) == -1) {
return NULL;
}
return newVectorObject(tvec, vec1->size, Py_NEW, Py_TYPE(vec1));
-#endif
-/* ------ to be removed ------*/
}
else if (QuaternionObject_Check(v2)) {
/* VEC * QUAT */
@@ -2219,20 +2208,19 @@ if len(unique) != len(items):
print "ERROR"
*/
-#if 0
-//ROW VECTOR Multiplication - Vector X Matrix
-//[x][y][z] * [1][4][7]
-// [2][5][8]
-// [3][6][9]
-//vector/matrix multiplication IS NOT COMMUTATIVE!!!!
-static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObject * mat)
+/* ROW VECTOR Multiplication - Vector X Matrix
+ * [x][y][z] * [1][4][7]
+ * [2][5][8]
+ * [3][6][9]
+ * vector/matrix multiplication IS NOT COMMUTATIVE!!!! */
+static int row_vector_multiplication(float rvec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
{
- float vec_cpy[4];
+ float vec_cpy[MAX_DIMENSIONS];
double dot = 0.0f;
- int x, y, z = 0, vec_size = vec->size;
+ int x, y, z= 0, vec_size= vec->size;
- if(mat->colSize != vec_size){
- if(mat->colSize == 4 && vec_size != 3){
+ if(mat->col_size != vec_size){
+ if(mat->col_size == 4 && vec_size != 3){
PyErr_SetString(PyExc_ValueError,
"vector * matrix: matrix column size "
"and the vector size must be the same");
@@ -2247,11 +2235,11 @@ static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObj
return -1;
memcpy(vec_cpy, vec->vec, vec_size * sizeof(float));
-
+printf("asasas\n");
rvec[3] = 1.0f;
//muliplication
- for(x = 0; x < mat->rowSize; x++) {
- for(y = 0; y < mat->colSize; y++) {
+ for(x = 0; x < mat->row_size; x++) {
+ for(y = 0; y < mat->col_size; y++) {
dot += mat->matrix[x][y] * vec_cpy[y];
}
rvec[z++] = (float)dot;
@@ -2259,7 +2247,6 @@ static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObj
}
return 0;
}
-#endif
/*----------------------------Vector.negate() -------------------- */
PyDoc_STRVAR(Vector_negate_doc,
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index ba7af235acc..a15662f86f4 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -981,7 +981,7 @@ static void flag_render_node_material(Render *re, bNodeTree *ntree)
}
}
-static Material *give_render_material(Render *re, Object *ob, int nr)
+static Material *give_render_material(Render *re, Object *ob, short nr)
{
extern Material defmaterial; /* material.c */
Material *ma;
@@ -2688,7 +2688,8 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
int timeoffset, float *orco, float mat[4][4])
{
Object *ob= obr->ob;
- int a, a1, end, totvert, vertofs;
+ int a, end, totvert, vertofs;
+ short mat_iter;
VertRen *ver;
VlakRen *vlr;
MVert *mvert = NULL;
@@ -2718,16 +2719,16 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
/* faces in order of color blocks */
vertofs= obr->totvert - totvert;
- for(a1=0; (a1<ob->totcol || (a1==0 && ob->totcol==0)); a1++) {
+ for(mat_iter= 0; (mat_iter < ob->totcol || (mat_iter==0 && ob->totcol==0)); mat_iter++) {
- ma= give_render_material(re, ob, a1+1);
+ ma= give_render_material(re, ob, mat_iter+1);
end= dm->getNumFaces(dm);
mface= dm->getFaceArray(dm);
for(a=0; a<end; a++, mface++) {
int v1, v2, v3, v4, flag;
- if( mface->mat_nr==a1 ) {
+ if(mface->mat_nr == mat_iter) {
float len;
v1= mface->v1;
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index dd5deddece9..5c5162d268b 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -306,7 +306,7 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
/* soften the halo if it intersects geometry */
if(har->mat && har->mat->mode & MA_HALO_SOFT) {
- float segment_length, halo_depth, distance_from_z, visible_depth, soften;
+ float segment_length, halo_depth, distance_from_z /* , visible_depth */ /* UNUSED */, soften;
/* calculate halo depth */
segment_length= har->hasize*sasqrt(1.0f - dist/(har->rad*har->rad));
@@ -317,7 +317,7 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
/* calculate how much of this depth is visible */
distance_from_z = haloZtoDist(zz) - haloZtoDist(har->zs);
- visible_depth = halo_depth;
+ /* visible_depth = halo_depth; */ /* UNUSED */
if(distance_from_z < segment_length) {
soften= (segment_length + distance_from_z)/halo_depth;
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 980f6b6af1e..36ded5c10d2 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -107,7 +107,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
ParticleSimulationData sim= {NULL};
ParticleData *pa=NULL;
float cfra = BKE_curframe(re->scene);
- int i, childexists;
+ int i /*, childexists*/ /* UNUSED */;
int total_particles, offset=0;
int data_used = point_data_used(pd);
float partco[3];
@@ -143,9 +143,11 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
pd->totpoints = total_particles;
if (data_used & POINT_DATA_VEL) offset = pd->totpoints*3;
+#if 0 /* UNUSED */
if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT))
childexists = 1;
-
+#endif
+
for (i=0, pa=psys->particles; i < total_particles; i++, pa++) {
state.time = cfra;
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index ad592609ce6..641fec90cf3 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -1994,7 +1994,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
else {
/* same as above, but doing 5 taps, increasing quality at cost of speed */
float STc[3], STl[3], STr[3], STd[3], STu[3];
- float Hc, Hl, Hr, Hd, Hu;
+ float /* Hc, */ /* UNUSED */ Hl, Hr, Hd, Hu;
texco_mapping(shi, tex, mtex, co, dx, dy, texvec, dxt, dyt);
@@ -2017,7 +2017,7 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T
// use texres for the center sample, set rgbnor
rgbnor = multitex_mtex(shi, mtex, STc, dxt, dyt, texres);
- Hc = (fromrgb)? RGBTOBW(texres->tr, texres->tg, texres->tb) : texres->tin;
+ /* Hc = (fromrgb)? RGBTOBW(texres->tr, texres->tg, texres->tb) : texres->tin; */ /* UNUSED */
// use ttexr for the other taps
multitex_mtex(shi, mtex, STl, dxt, dyt, &ttexr);
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 59a505a3195..bc5e7f23e21 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -992,7 +992,7 @@ static void convert_to_key_alpha(RenderPart *pa, RenderLayer *rl)
}
/* adds only alpha values */
-void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
+static void edge_enhance_tile(RenderPart *pa, float *rectf, int *rectz)
{
/* use zbuffer to define edges, add it to the image */
int y, x, col, *rz, *rz1, *rz2, *rz3;
@@ -1133,7 +1133,7 @@ typedef struct ZbufSolidData {
float *edgerect;
} ZbufSolidData;
-void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *data)
+static void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *data)
{
ZbufSolidData *sdata= (ZbufSolidData*)data;
ListBase *lb= sdata->psmlist;
@@ -1515,7 +1515,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
{
ShadeInput *shi= ssamp->shi;
ShadeResult shr;
- float texfac, orthoarea, nor[3], alpha, sx, sy;
+ float /* texfac,*/ /* UNUSED */ orthoarea, nor[3], alpha, sx, sy;
/* cache for shadow */
shi->samplenr= R.shadowsamplenr[shi->thread]++;
@@ -1578,7 +1578,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
VECCOPY(color, shr.combined);
/* texture blending */
- texfac= shi->mat->sss_texfac;
+ /* texfac= shi->mat->sss_texfac; */ /* UNUSED */
alpha= shr.combined[3];
*area *= alpha;
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index e4b2a0cf1d1..a4bf6c6b5e1 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -61,16 +61,16 @@
/* XXX, could be better implemented... this is for endian issues
*/
-#if defined(__sgi) || defined(__sparc) || defined(__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
-#define RCOMP 3
-#define GCOMP 2
-#define BCOMP 1
-#define ACOMP 0
+#ifdef __BIG_ENDIAN__
+# define RCOMP 3
+# define GCOMP 2
+# define BCOMP 1
+# define ACOMP 0
#else
-#define RCOMP 0
-#define GCOMP 1
-#define BCOMP 2
-#define ACOMP 3
+# define RCOMP 0
+# define GCOMP 1
+# define BCOMP 2
+# define ACOMP 3
#endif
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 3f26c0ad6d0..e189b3cf638 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1502,12 +1502,12 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr)
LampRen *lar;
GroupObject *go;
float inpr, lv[3];
- float *view, shadfac[4];
+ float /* *view, */ shadfac[4];
float ir, accum, visifac, lampdist;
float shaded = 0.0f, lightness = 0.0f;
- view= shi->view;
+ /* view= shi->view; */ /* UNUSED */
accum= ir= 0.0f;
lights= get_lights(shi);
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index ac56304bdcb..f36994e0969 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -2864,7 +2864,7 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
float v1[3], v2[3], v3[3], v4[3], fx, fy;
float *rectvz, *dvz, *dimg, *dvec1, *dvec2, *dz, *dz1, *dz2, *rectz;
float *minvecbufrect= NULL, *rectweight, *rw, *rectmax, *rm, *ro;
- float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed, totfac;
+ float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed;
int y, x, step, maxspeed=nbd->maxspeed, samples= nbd->samples;
int tsktsk= 0;
static int firsttime= 1;
@@ -3038,7 +3038,6 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float *
}
memset(newrect, 0, sizeof(float)*xsize*ysize*4);
- totfac= 0.0f;
/* accumulate */
samples/= 2;
diff --git a/source/blender/windowmanager/SConscript b/source/blender/windowmanager/SConscript
index 80c526f8649..c60752b85f8 100644
--- a/source/blender/windowmanager/SConscript
+++ b/source/blender/windowmanager/SConscript
@@ -39,4 +39,7 @@ if env['OURPLATFORM'] != 'darwin' or env['WITH_GHOST_COCOA']:
if env['BF_BUILDINFO']:
defs.append('WITH_BUILDINFO')
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('INTERNATIONAL')
+
env.BlenderLib ( 'bf_windowmanager', sources, Split(incs), defines=defs, libtype=['core'], priority=[5] )
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 5bdf1ec2787..9e19a057175 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -72,6 +72,7 @@ void WM_setinitialstate_fullscreen(void);
void WM_setinitialstate_normal(void);
void WM_init (struct bContext *C, int argc, const char **argv);
+void WM_exit_ext (struct bContext *C, const short do_python);
void WM_exit (struct bContext *C);
void WM_main (struct bContext *C);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 518ebeafc80..75fec6ed705 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -85,7 +85,7 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA
void wm_event_add(wmWindow *win, wmEvent *event_to_add)
{
- wmEvent *event= MEM_callocN(sizeof(wmEvent), "event");
+ wmEvent *event= MEM_callocN(sizeof(wmEvent), "wmEvent");
*event= *event_to_add;
BLI_addtail(&win->queue, event);
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 6b3a574b6b6..f862af6173a 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -59,6 +59,8 @@
#include "BLI_utildefines.h"
#include "BLI_callbacks.h"
+#include "BLF_translation.h"
+
#include "DNA_anim_types.h"
#include "DNA_ipo_types.h" // XXX old animation system
#include "DNA_object_types.h"
@@ -429,16 +431,17 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
else if(retval == BKE_READ_EXOTIC_OK_OTHER)
BKE_write_undo(C, "Import file");
else if(retval == BKE_READ_EXOTIC_FAIL_OPEN) {
- BKE_reportf(reports, RPT_ERROR, "Can't read file: \"%s\", %s.", filepath, errno ? strerror(errno) : "Unable to open the file");
+ BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("Can't read file: \"%s\", %s.")), filepath,
+ errno ? strerror(errno) : UI_translate_do_iface(N_("Unable to open the file")));
}
else if(retval == BKE_READ_EXOTIC_FAIL_FORMAT) {
- BKE_reportf(reports, RPT_ERROR, "File format is not supported in file: \"%s\".", filepath);
+ BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("File format is not supported in file: \"%s\".")), filepath);
}
else if(retval == BKE_READ_EXOTIC_FAIL_PATH) {
- BKE_reportf(reports, RPT_ERROR, "File path invalid: \"%s\".", filepath);
+ BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("File path invalid: \"%s\".")), filepath);
}
else {
- BKE_reportf(reports, RPT_ERROR, "Unknown error loading: \"%s\".", filepath);
+ BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("Unknown error loading: \"%s\".")), filepath);
BLI_assert(!"invalid 'retval'");
}
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index de4afa79448..52c0cb902c1 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -232,7 +232,7 @@ static void wm_gesture_draw_circle(wmGesture *gt)
static void draw_filled_lasso(wmGesture *gt)
{
EditVert *v=NULL, *lastv=NULL, *firstv=NULL;
- EditEdge *e;
+ /* EditEdge *e; */ /* UNUSED */
EditFace *efa;
short *lasso= (short *)gt->customdata;
int i;
@@ -246,7 +246,7 @@ static void draw_filled_lasso(wmGesture *gt)
v = BLI_addfillvert(co);
if (lastv)
- e = BLI_addfilledge(lastv, v);
+ /* e = */ /* UNUSED */ BLI_addfilledge(lastv, v);
lastv = v;
if (firstv==NULL) firstv = v;
}
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 850de9029c9..cf3f12da767 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -99,6 +99,7 @@
#include "UI_interface.h"
#include "BLF_api.h"
+#include "BLF_translation.h"
#include "GPU_buffers.h"
#include "GPU_extensions.h"
@@ -143,6 +144,8 @@ void WM_init(bContext *C, int argc, const char **argv)
/* get the default database, plus a wm */
WM_read_homefile(C, NULL, G.factory_startup);
+ BLF_lang_set(NULL);
+
/* note: there is a bug where python needs initializing before loading the
* startup.blend because it may contain PyDrivers. It also needs to be after
* initializing space types and other internal data.
@@ -296,6 +299,8 @@ int WM_init_game(bContext *C)
WM_operator_name_call(C, "VIEW3D_OT_game_start", WM_OP_EXEC_DEFAULT, NULL);
+ sound_exit();
+
return 1;
}
else
@@ -340,7 +345,8 @@ extern void free_fmodifiers_copybuf(void);
extern void free_posebuf(void);
/* called in creator.c even... tsk, split this! */
-void WM_exit(bContext *C)
+/* note, doesnt run exit() call WM_exit() for that */
+void WM_exit_ext(bContext *C, const short do_python)
{
wmWindow *win;
@@ -376,7 +382,7 @@ void WM_exit(bContext *C)
BIF_freeTemplates(C);
free_ttfont(); /* bke_font.h */
-
+
free_openrecent();
BKE_freecubetable();
@@ -396,6 +402,10 @@ void WM_exit(bContext *C)
free_posebuf();
BLF_exit();
+
+#ifdef INTERNATIONAL
+ BLF_free_unifont();
+#endif
ANIM_keyingset_infos_exit();
@@ -406,14 +416,17 @@ void WM_exit(bContext *C)
#ifdef WITH_PYTHON
- /* XXX - old note */
- /* before free_blender so py's gc happens while library still exists */
- /* needed at least for a rare sigsegv that can happen in pydrivers */
-
- /* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's
- * so decref'ing them after python ends causes bad problems every time
- * the pyDriver bug can be fixed if it happens again we can deal with it then */
- BPY_python_end();
+ /* option not to close python so we can use 'atexit' */
+ if(do_python) {
+ /* XXX - old note */
+ /* before free_blender so py's gc happens while library still exists */
+ /* needed at least for a rare sigsegv that can happen in pydrivers */
+
+ /* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's
+ * so decref'ing them after python ends causes bad problems every time
+ * the pyDriver bug can be fixed if it happens again we can deal with it then */
+ BPY_python_end();
+ }
#endif
GPU_global_buffer_pool_free();
@@ -458,6 +471,10 @@ void WM_exit(bContext *C)
getchar();
}
#endif
- exit(G.afbreek==1);
}
+void WM_exit(bContext *C)
+{
+ WM_exit_ext(C, 1);
+ exit(G.afbreek==1);
+}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 68a4eebf93f..320dc2ecdda 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -49,7 +49,7 @@
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
-#include "BLF_api.h"
+#include "BLF_translation.h"
#include "PIL_time.h"
@@ -78,8 +78,10 @@
#include "BIF_gl.h"
#include "BIF_glutil.h" /* for paint cursor */
+#include "BLF_api.h"
#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
#include "ED_screen.h"
#include "ED_util.h"
@@ -149,12 +151,11 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType*))
opfunc(ot);
if(ot->name==NULL) {
- static char dummy_name[] = "Dummy Name";
fprintf(stderr, "ERROR: Operator %s has no name property!\n", ot->idname);
- ot->name= dummy_name;
+ ot->name= UI_translate_do_iface(N_("Dummy Name"));
}
- RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:"(undocumented operator)"); // XXX All ops should have a description but for now allow them not to.
+ RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:UI_translate_do_iface(N_("(undocumented operator)"))); // XXX All ops should have a description but for now allow them not to.
RNA_def_struct_identifier(ot->srna, ot->idname);
BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
@@ -167,7 +168,7 @@ void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType*, void*), void *us
ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties");
opfunc(ot, userdata);
- RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:"(undocumented operator)");
+ RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:UI_translate_do_iface(N_("(undocumented operator)")));
RNA_def_struct_identifier(ot->srna, ot->idname);
BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot);
@@ -361,7 +362,7 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam
ot->poll= NULL;
if(!ot->description)
- ot->description= "(undocumented operator)";
+ ot->description= UI_translate_do_iface(N_("(undocumented operator)"));
RNA_def_struct_ui_text(ot->srna, ot->name, ot->description); // XXX All ops should have a description but for now allow them not to.
RNA_def_struct_identifier(ot->srna, ot->idname);
@@ -386,7 +387,7 @@ void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType*, void*), vo
ot->poll= NULL;
if(!ot->description)
- ot->description= "(undocumented operator)";
+ ot->description= UI_translate_do_iface(N_("(undocumented operator)"));
opfunc(ot, userdata);
@@ -783,7 +784,7 @@ int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message
else
properties= NULL;
- pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION);
+ pup= uiPupMenuBegin(C, UI_translate_do_iface(N_("OK?")), ICON_QUESTION);
layout= uiPupMenuLayout(pup);
uiItemFullO(layout, op->type->idname, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup);
@@ -864,10 +865,10 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
void WM_operator_properties_select_all(wmOperatorType *ot) {
static EnumPropertyItem select_all_actions[] = {
- {SEL_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle selection for all elements"},
- {SEL_SELECT, "SELECT", 0, "Select", "Select all elements"},
- {SEL_DESELECT, "DESELECT", 0, "Deselect", "Deselect all elements"},
- {SEL_INVERT, "INVERT", 0, "Invert", "Invert selection of all elements"},
+ {SEL_TOGGLE, "TOGGLE", 0, N_("Toggle"), "Toggle selection for all elements"},
+ {SEL_SELECT, "SELECT", 0, N_("Select"), "Select all elements"},
+ {SEL_DESELECT, "DESELECT", 0, N_("Deselect"), "Deselect all elements"},
+ {SEL_INVERT, "INVERT", 0, N_("Invert"), "Invert selection of all elements"},
{0, NULL, 0, NULL, NULL}
};
@@ -876,25 +877,25 @@ void WM_operator_properties_select_all(wmOperatorType *ot) {
void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
{
- RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, N_("Gesture Mode"), "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, N_("X Min"), "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, N_("X Max"), "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, N_("Y Min"), "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, N_("Y Max"), "", INT_MIN, INT_MAX);
if(extend)
- RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
+ RNA_def_boolean(ot->srna, "extend", 1, _("Extend"), _("Extend selection instead of deselecting everything first"));
}
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
{
- RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, "X Start", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xend", 0, INT_MIN, INT_MAX, "X End", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, "Y Start", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, "Y End", "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, N_("X Start"), "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "xend", 0, INT_MIN, INT_MAX, N_("X End"), "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, N_("Y Start"), "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, N_("Y End"), "", INT_MIN, INT_MAX);
if(cursor)
- RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, "Cursor", "Mouse cursor style to use during the modal operator", 0, INT_MAX);
+ RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, N_("Cursor"), N_("Mouse cursor style to use during the modal operator"), 0, INT_MAX);
}
@@ -923,7 +924,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
wmOperator *op= arg_op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
int width= 300;
@@ -1001,7 +1002,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
wmOperator *op= data->op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
block = uiBeginBlock(C, ar, "operator dialog", UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
@@ -1025,7 +1026,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
col= uiLayoutColumn(layout, FALSE);
col_block= uiLayoutGetBlock(col);
/* Create OK button, the callback of which will execute op */
- btn= uiDefBut(col_block, BUT, 0, "OK", 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+ btn= uiDefBut(col_block, BUT, 0, UI_translate_do_iface(N_("OK")), 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
uiButSetFunc(btn, dialog_exec_cb, data, col_block);
}
@@ -1042,7 +1043,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData)
wmOperator *op= data->op;
uiBlock *block;
uiLayout *layout;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
block= uiBeginBlock(C, ar, "opui_popup", UI_EMBOSS);
uiBlockClearFlag(block, UI_BLOCK_LOOP);
@@ -1206,14 +1207,19 @@ 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;
- uiStyle *style= U.uistyles.first;
+ uiStyle *style= UI_GetStyle();
struct RecentFile *recent;
int i;
MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE);
char url[96];
+ /* hardcoded to splash, loading and freeing every draw, eek! */
+ ImBuf *ibuf= IMB_ibImageFromMemory((unsigned char*)datatoc_splash_png, datatoc_splash_png_size, IB_rect);
#ifdef WITH_BUILDINFO
int ver_width, rev_width;
@@ -1237,7 +1243,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN);
- but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, NULL, 0.0, 0.0, 0, 0, "");
+ but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */
uiButSetFunc(but, wm_block_splash_close, block, NULL);
uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL);
@@ -1266,19 +1272,19 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
split = uiLayoutSplit(layout, 0, 0);
col = uiLayoutColumn(split, 0);
uiItemL(col, "Links", ICON_NONE);
- uiItemStringO(col, "Donations", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment");
- uiItemStringO(col, "Credits", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits");
- uiItemStringO(col, "Release Log", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-259");
- uiItemStringO(col, "Manual", ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual");
- uiItemStringO(col, "Blender Website", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org");
- uiItemStringO(col, "User Community", ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community");
+ 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_("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");
if(strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release")==0) {
BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION/100, BLENDER_VERSION%100);
}
else {
BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
}
- uiItemStringO(col, "Python API Reference", ICON_URL, "WM_OT_url_open", "url", url);
+ uiItemStringO(col, UI_translate_do_iface(N_("Python API Reference")), ICON_URL, "WM_OT_url_open", "url", url);
uiItemL(col, "", ICON_NONE);
col = uiLayoutColumn(split, 0);
@@ -1288,7 +1294,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
uiItemS(col);
}
- uiItemL(col, "Recent", ICON_NONE);
+ uiItemL(col, UI_translate_do_iface(N_("Recent")), ICON_NONE);
for(recent = G.recent_files.first, i=0; (i<5) && (recent); recent = recent->next, i++) {
uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath);
}
@@ -3298,13 +3304,13 @@ static void redraw_timer_window_swap(bContext *C)
}
static EnumPropertyItem redraw_timer_type_items[] = {
- {0, "DRAW", 0, "Draw Region", "Draw Region"},
- {1, "DRAW_SWAP", 0, "Draw Region + Swap", "Draw Region and Swap"},
- {2, "DRAW_WIN", 0, "Draw Window", "Draw Window"},
- {3, "DRAW_WIN_SWAP", 0, "Draw Window + Swap", "Draw Window and Swap"},
- {4, "ANIM_STEP", 0, "Anim Step", "Animation Steps"},
- {5, "ANIM_PLAY", 0, "Anim Play", "Animation Playback"},
- {6, "UNDO", 0, "Undo/Redo", "Undo/Redo"},
+ {0, "DRAW", 0, N_("Draw Region"), N_("Draw Region")},
+ {1, "DRAW_SWAP", 0, N_("Draw Region + Swap"), N_("Draw Region and Swap")},
+ {2, "DRAW_WIN", 0, N_("Draw Window"), N_("Draw Window")},
+ {3, "DRAW_WIN_SWAP", 0, N_("Draw Window + Swap"), N_("Draw Window and Swap")},
+ {4, "ANIM_STEP", 0, N_("Anim Step"), N_("Animation Steps")},
+ {5, "ANIM_PLAY", 0, N_("Anim Play"), N_("Animation Playback")},
+ {6, "UNDO", 0, N_("Undo/Redo"), N_("Undo/Redo")},
{0, NULL, 0, NULL, NULL}};
static int redraw_timer_exec(bContext *C, wmOperator *op)
@@ -3537,14 +3543,14 @@ void wm_operatortype_init(void)
static void gesture_circle_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""},
- {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, "Add", ""},
- {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, "Subtract", ""},
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""},
+ {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, N_("Confirm"), ""},
+ {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, N_("Add"), ""},
+ {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, N_("Subtract"), ""},
- {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""},
- {GESTURE_MODAL_NOP,"NOP", 0, "No Operation", ""},
+ {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""},
+ {GESTURE_MODAL_DESELECT,"DESELECT", 0, N_("DeSelect"), ""},
+ {GESTURE_MODAL_NOP,"NOP", 0, N_("No Operation"), ""},
{0, NULL, 0, NULL, NULL}};
@@ -3590,9 +3596,9 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf)
static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""},
+ {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""},
+ {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""},
{0, NULL, 0, NULL, NULL}};
wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Straight Line");
@@ -3618,10 +3624,10 @@ static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf)
static void gesture_border_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
- {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""},
- {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""},
+ {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""},
+ {GESTURE_MODAL_DESELECT,"DESELECT", 0, N_("DeSelect"), ""},
+ {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""},
{0, NULL, 0, NULL, NULL}};
wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Border");
@@ -3673,10 +3679,10 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf)
static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf)
{
static EnumPropertyItem modal_items[] = {
- {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""},
- {GESTURE_MODAL_IN, "IN", 0, "In", ""},
- {GESTURE_MODAL_OUT, "OUT", 0, "Out", ""},
- {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
+ {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""},
+ {GESTURE_MODAL_IN, "IN", 0, N_("In"), ""},
+ {GESTURE_MODAL_OUT, "OUT", 0, N_("Out"), ""},
+ {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""},
{0, NULL, 0, NULL, NULL}};
wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Zoom Border");
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 7d6010786d2..d9ca275c819 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -48,6 +48,8 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_library.h"
@@ -73,6 +75,8 @@
#include "GPU_draw.h"
#include "GPU_extensions.h"
+#include "UI_interface.h"
+
/* the global to talk to ghost */
static GHOST_SystemHandle g_system= NULL;
@@ -504,11 +508,11 @@ void WM_window_open_temp(bContext *C, rcti *position, int type)
ED_screen_set(C, win->screen);
if(sa->spacetype==SPACE_IMAGE)
- GHOST_SetTitle(win->ghostwin, "Blender Render");
+ GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender Render")));
else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF))
- GHOST_SetTitle(win->ghostwin, "Blender User Preferences");
+ GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender User Preferences")));
else if(sa->spacetype==SPACE_FILE)
- GHOST_SetTitle(win->ghostwin, "Blender File View");
+ GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender File View")));
else
GHOST_SetTitle(win->ghostwin, "Blender");
}
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 730d2fd5d47..d66b783370a 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -357,7 +357,9 @@ if(UNIX AND NOT APPLE)
)
install(
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
+ DIRECTORY
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
DESTINATION ${TARGETDIR_VER}/datafiles
PATTERN ".svn" EXCLUDE
)
@@ -431,7 +433,9 @@ elseif(WIN32)
DESTINATION ${TARGETDIR_VER}
)
install(
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
+ DIRECTORY
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
DESTINATION ${TARGETDIR_VER}/datafiles
PATTERN ".svn" EXCLUDE
)
@@ -450,8 +454,10 @@ elseif(WIN32)
endif()
install( # same as linux!, deduplicate
- DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
- DESTINATION ${TARGETDIR_VER}/datafiles/locale
+ DIRECTORY
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
+ DESTINATION ${TARGETDIR_VER}/datafiles
PATTERN ".svn" EXCLUDE
)
@@ -663,9 +669,12 @@ elseif(APPLE)
DESTINATION ${TARGETDIR_VER}/datafiles
)
- install_dir(
- ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale/
- \${TARGETDIR_VER}/datafiles/locale
+ install(
+ DIRECTORY
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts
+ ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale
+ DESTINATION ${TARGETDIR_VER}/datafiles
+ PATTERN ".svn" EXCLUDE
)
endif()
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index d4b43cd7ac1..2c2fd052b5d 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -144,6 +144,8 @@ extern "C" {
#include "BKE_cdderivedmesh.h"
#include "BKE_DerivedMesh.h"
#include "BKE_material.h" /* give_current_material */
+#include "BKE_image.h"
+#include "IMB_imbuf_types.h"
extern Material defmaterial; /* material.c */
}
@@ -195,7 +197,7 @@ extern "C" {
}
#endif
-static int default_face_mode = TF_DYNAMIC;
+static bool default_light_mode = 0;
static unsigned int KX_rgbaint2uint_new(unsigned int icol)
{
@@ -234,9 +236,9 @@ static unsigned int KX_Mcol2uint_new(MCol col)
return out_color.integer;
}
-static void SetDefaultFaceType(Scene* scene)
+static void SetDefaultLightMode(Scene* scene)
{
- default_face_mode = TF_DYNAMIC;
+ default_light_mode = false;
Scene *sce_iter;
Base *base;
@@ -244,7 +246,7 @@ static void SetDefaultFaceType(Scene* scene)
{
if (base->object->type == OB_LAMP)
{
- default_face_mode = TF_DYNAMIC|TF_LIGHT;
+ default_light_mode = true;
return;
}
}
@@ -353,41 +355,41 @@ bool ConvertMaterial(
// use lighting?
material->ras_mode |= ( mat->mode & MA_SHLESS )?0:USE_LIGHT;
+ material->ras_mode |= ( mat->game.flag & GEMAT_BACKCULL )?0:TWOSIDED;
+
// cast shadows?
material->ras_mode |= ( mat->mode & MA_SHADBUF )?CAST_SHADOW:0;
MTex *mttmp = 0;
numchan = getNumTexChannels(mat);
int valid_index = 0;
- // use the face texture if
- // 1) it is set in the buttons
- // 2) we have a face texture and a material but no valid texture in slot 1
+ /* In Multitexture use the face texture if and only if
+ * it is set in the buttons
+ * In GLSL is not working yet :/ 3.2011 */
bool facetex = false;
if(validface && mat->mode &MA_FACETEXTURE)
facetex = true;
- if(validface && !mat->mtex[0])
- facetex = true;
- if(validface && mat->mtex[0]) {
- MTex *tmp = mat->mtex[0];
- if(!tmp->tex || (tmp->tex && !tmp->tex->ima))
- facetex = true;
- }
+
numchan = numchan>MAXTEX?MAXTEX:numchan;
+ if (facetex && numchan == 0) numchan = 1;
// foreach MTex
for(int i=0; i<numchan; i++) {
// use face tex
if(i==0 && facetex ) {
+ facetex = false;
Image*tmp = (Image*)(tface->tpage);
if(tmp) {
material->img[i] = tmp;
material->texname[i] = material->img[i]->id.name;
- material->flag[i] |= ( tface->transp &TF_ALPHA )?USEALPHA:0;
- material->flag[i] |= ( tface->transp &TF_ADD )?CALCALPHA:0;
material->flag[i] |= MIPMAP;
+ material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ALPHA_SORT )?USEALPHA:0;
+ material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ALPHA )?USEALPHA:0;
+ material->flag[i] |= ( mat->game.alpha_blend & GEMAT_ADD )?CALCALPHA:0;
+
if(material->img[i]->flag & IMA_REFLECT)
material->mapping[i].mapping |= USEREFL;
else
@@ -405,11 +407,6 @@ bool ConvertMaterial(
material->mapping[i].mapping |= USEUV;
}
- if(material->ras_mode & USE_LIGHT)
- material->ras_mode &= ~USE_LIGHT;
- if(tface->mode & TF_LIGHT)
- material->ras_mode |= USE_LIGHT;
-
valid_index++;
}
else {
@@ -567,25 +564,31 @@ bool ConvertMaterial(
material->ras_mode |= (mat->material_type == MA_TYPE_WIRE)? WIRE: 0;
}
- else {
+ else { // No Material
int valid = 0;
// check for tface tex to fallback on
if( validface ){
-
- // no light bugfix
- if(tface->mode) material->ras_mode |= USE_LIGHT;
-
material->img[0] = (Image*)(tface->tpage);
// ------------------------
if(material->img[0]) {
material->texname[0] = material->img[0]->id.name;
material->mapping[0].mapping |= ( (material->img[0]->flag & IMA_REFLECT)!=0 )?USEREFL:0;
- material->flag[0] |= ( tface->transp &TF_ALPHA )?USEALPHA:0;
- material->flag[0] |= ( tface->transp &TF_ADD )?CALCALPHA:0;
+
+ /* see if depth of the image is 32bits */
+ if(BKE_image_has_alpha(material->img[0])) {
+ material->flag[0] |= USEALPHA;
+ material->alphablend = GEMAT_ALPHA;
+ }
+ else
+ material->alphablend = GEMAT_SOLID;
+
valid++;
}
}
+ else
+ material->alphablend = GEMAT_SOLID;
+
material->SetUsers(-1);
material->num_enabled = valid;
material->IdMode = TEXFACE;
@@ -598,6 +601,9 @@ bool ConvertMaterial(
material->matcolor[2] = 0.5f;
material->spec_f = 0.5f;
material->ref = 0.8f;
+
+ // No material - old default TexFace properties
+ material->ras_mode |= USE_LIGHT;
}
MT_Point2 uv[4];
MT_Point2 uv2[4];
@@ -606,13 +612,10 @@ bool ConvertMaterial(
uv2[0]= uv2[1]= uv2[2]= uv2[3]= MT_Point2(0.0f, 0.0f);
+ /* No material, what to do? let's see what is in the UV and set the material accordingly
+ light and visible is always on */
if( validface ) {
-
- material->ras_mode |= (tface->mode & TF_INVISIBLE)?0:POLY_VIS;
-
- material->transp = tface->transp;
material->tile = tface->tile;
- material->mode = tface->mode;
uv[0].setValue(tface->uv[0]);
uv[1].setValue(tface->uv[1]);
@@ -625,31 +628,26 @@ bool ConvertMaterial(
}
else {
// nothing at all
- material->ras_mode |= (POLY_VIS| (validmat?0:USE_LIGHT));
- material->mode = default_face_mode;
- material->transp = TF_SOLID;
+ material->alphablend = GEMAT_SOLID;
material->tile = 0;
uv[0]= uv[1]= uv[2]= uv[3]= MT_Point2(0.0f, 0.0f);
}
+ if (validmat && validface) {
+ material->alphablend = mat->game.alpha_blend;
+ }
+
// with ztransp enabled, enforce alpha blending mode
- if(validmat && (mat->mode & MA_TRANSP) && (mat->mode & MA_ZTRANSP) && (material->transp == TF_SOLID))
- material->transp = TF_ALPHA;
+ if(validmat && (mat->mode & MA_TRANSP) && (mat->mode & MA_ZTRANSP) && (material->alphablend == GEMAT_SOLID))
+ material->alphablend = GEMAT_ALPHA;
// always zsort alpha + add
- if((material->transp == TF_ALPHA || material->transp == TF_ADD || texalpha) && (material->transp != TF_CLIP)) {
+ if((ELEM3(material->alphablend, GEMAT_ALPHA, GEMAT_ALPHA_SORT, GEMAT_ADD) || texalpha) && (material->alphablend != GEMAT_CLIP )) {
material->ras_mode |= ALPHA;
- material->ras_mode |= (material->mode & TF_ALPHASORT)? ZSORT: 0;
+ material->ras_mode |= (mat && (mat->game.alpha_blend & GEMAT_ALPHA_SORT))? ZSORT: 0;
}
- // collider or not?
- material->ras_mode |= (material->mode & TF_DYNAMIC)? COLLIDER: 0;
-
- // these flags are irrelevant at this point, remove so they
- // don't hurt material bucketing
- material->mode &= ~(TF_DYNAMIC|TF_ALPHASORT|TF_TEX);
-
// get uv sets
if(validmat)
{
@@ -706,8 +704,8 @@ bool ConvertMaterial(
unsigned int rgb[4];
GetRGB(type,mface,mmcol,mat,rgb[0],rgb[1],rgb[2], rgb[3]);
- // swap the material color, so MCol on TF_BMFONT works
- if (validmat && type==1 && (tface && tface->mode & TF_BMFONT))
+ // swap the material color, so MCol on bitmap font works
+ if (validmat && type==1 && (mat->game.flag & GEMAT_TEXT))
{
rgb[0] = KX_rgbaint2uint_new(rgb[0]);
rgb[1] = KX_rgbaint2uint_new(rgb[1]);
@@ -864,10 +862,6 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol,
layers, converter->GetGLSLMaterials());
- visible = ((bl_mat->ras_mode & POLY_VIS)!=0);
- collider = ((bl_mat->ras_mode & COLLIDER)!=0);
- twoside = ((bl_mat->mode & TF_TWOSIDE)!=0);
-
/* vertex colors and uv's were stored in bl_mat temporarily */
bl_mat->GetConversionRGB(rgb);
rgb0 = rgb[0]; rgb1 = rgb[1];
@@ -885,7 +879,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
if (kx_blmat == NULL)
kx_blmat = new KX_BlenderMaterial();
- kx_blmat->Initialize(scene, bl_mat);
+ kx_blmat->Initialize(scene, bl_mat, (ma?&ma->game:NULL));
polymat = static_cast<RAS_IPolyMaterial*>(kx_blmat);
}
else {
@@ -893,37 +887,59 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
Image* bima = (tface)? (Image*)tface->tpage: NULL;
imastr = (tface)? (bima? (bima)->id.name : "" ) : "";
- char transp=0;
- short mode=0, tile=0;
+ char alpha_blend=0;
+ short tile=0;
int tilexrep=4,tileyrep = 4;
-
+
+ /* set material properties - old TexFace */
+ if (ma) {
+ alpha_blend = ma->game.alpha_blend;
+ /* Commented out for now. If we ever get rid of
+ * "Texture Face/Singletexture" we can then think about it */
+
+ /* Texture Face mode ignores texture but requires "Face Textures to be True "*/
+ /**
+ if ((ma->mode &MA_FACETEXTURE)==0 && (ma->game.flag &GEMAT_TEXT)==0) {
+ bima = NULL;
+ imastr = "";
+ alpha_blend = GEMAT_SOLID;
+ }
+ else
+ alpha_blend = ma->game.alpha_blend;
+ */
+ }
+ /* check for tface tex to fallback on */
+ else {
+ if (bima) {
+ /* see if depth of the image is 32 */
+ if (BKE_image_has_alpha(bima))
+ alpha_blend = GEMAT_ALPHA;
+ else
+ alpha_blend = GEMAT_SOLID;
+ }
+ else {
+ alpha_blend = GEMAT_SOLID;
+ }
+ }
+
if (bima) {
tilexrep = bima->xrep;
tileyrep = bima->yrep;
}
- /* get tface properties if available */
+ /* set UV properties */
if(tface) {
- /* TF_DYNAMIC means the polygon is a collision face */
- collider = ((tface->mode & TF_DYNAMIC) != 0);
- transp = tface->transp;
- tile = tface->tile;
- mode = tface->mode;
-
- visible = !(tface->mode & TF_INVISIBLE);
- twoside = ((tface->mode & TF_TWOSIDE)!=0);
-
uv0.setValue(tface->uv[0]);
uv1.setValue(tface->uv[1]);
uv2.setValue(tface->uv[2]);
if (mface->v4)
uv3.setValue(tface->uv[3]);
+
+ tile = tface->tile;
}
else {
- /* no texfaces, set COLLSION true and everything else FALSE */
- mode = default_face_mode;
- transp = TF_SOLID;
+ /* no texfaces */
tile = 0;
}
@@ -964,16 +980,20 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
if (mface->v4)
rgb3 = KX_rgbaint2uint_new(color);
}
-
+
// only zsort alpha + add
- bool alpha = (transp == TF_ALPHA || transp == TF_ADD);
- bool zsort = (mode & TF_ALPHASORT)? alpha: 0;
+ bool alpha = ELEM3(alpha_blend, GEMAT_ALPHA, GEMAT_ADD, GEMAT_ALPHA_SORT);
+ bool zsort = (alpha_blend == GEMAT_ALPHA_SORT);
+ bool light = (ma)?(ma->mode & MA_SHLESS)==0:default_light_mode;
+
+ // don't need zort anymore, deal as if it it's alpha blend
+ if (alpha_blend == GEMAT_ALPHA_SORT) alpha_blend = GEMAT_ALPHA;
if (kx_polymat == NULL)
kx_polymat = new KX_PolygonMaterial();
kx_polymat->Initialize(imastr, ma, (int)mface->mat_nr,
tile, tilexrep, tileyrep,
- mode, transp, alpha, zsort, lightlayer, tface, (unsigned int*)mcol);
+ alpha_blend, alpha, zsort, light, lightlayer, tface, (unsigned int*)mcol);
polymat = static_cast<RAS_IPolyMaterial*>(kx_polymat);
if (ma) {
@@ -987,6 +1007,19 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
}
}
+ // set render flags
+ if (ma)
+ {
+ visible = ((ma->game.flag & GEMAT_INVISIBLE)==0);
+ twoside = ((ma->game.flag & GEMAT_BACKCULL)==0);
+ collider = ((ma->game.flag & GEMAT_NOPHYSICS)==0);
+ }
+ else{
+ visible = true;
+ twoside = false;
+ collider = true;
+ }
+
/* mark face as flat, so vertices are split */
bool flat = (mface->flag & ME_SMOOTH) == 0;
@@ -2035,7 +2068,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie,
logicmgr->RegisterActionName(curAct->id.name + 2, curAct);
}
- SetDefaultFaceType(blenderscene);
+ SetDefaultLightMode(blenderscene);
// Let's support scene set.
// Beware of name conflict in linked data, it will not crash but will create confusion
// in Python scripting and in certain actuators (replace mesh). Linked scene *should* have
diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
index 944ec9abd67..b452bb97cde 100644
--- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt
+++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt
@@ -78,4 +78,8 @@ if(WITH_CODEC_FFMPEG)
add_definitions(-DWITH_FFMPEG)
endif()
+if(WITH_INTERNATIONAL)
+ add_definitions(-DINTERNATIONAL)
+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 d4ce19de83f..726a1d4119a 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -81,6 +81,7 @@ extern char btempdir[]; /* use this to store a valid temp directory */
// For BLF
#include "BLF_api.h"
+#include "BLF_translation.h"
extern int datatoc_bfont_ttf_size;
extern char datatoc_bfont_ttf[];
@@ -404,7 +405,7 @@ int main(int argc, char** argv)
// We don't use threads directly in the BGE, but we need to call this so things like
// freeing up GPU_Textures works correctly.
BLI_threadapi_init();
-
+
RNA_init();
init_nodesystem();
@@ -420,6 +421,9 @@ int main(int argc, char** argv)
// Setup builtin font for BLF (mostly copied from creator.c, wm_init_exit.c and interface_style.c)
BLF_init(11, U.dpi);
BLF_lang_init();
+ BLF_lang_encoding("");
+ BLF_lang_set("");
+
BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
// Parse command line options
@@ -994,6 +998,11 @@ int main(int argc, char** argv)
// Cleanup
RNA_exit();
BLF_exit();
+
+#ifdef INTERNATIONAL
+ BLF_free_unifont();
+#endif
+
IMB_exit();
free_nodesystem();
diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript
index de063f5e297..57c1122c2cd 100644
--- a/source/gameengine/GamePlayer/ghost/SConscript
+++ b/source/gameengine/GamePlayer/ghost/SConscript
@@ -51,4 +51,7 @@ if env['WITH_BF_PYTHON']:
if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG')
+if env['WITH_BF_INTERNATIONAL']:
+ defs.append('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/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp
index 4ae937cdcd6..6680e9556b9 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.cpp
+++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp
@@ -27,7 +27,7 @@ BL_BlenderShader::BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lig
mGPUMat(NULL)
{
mBlenderScene = scene->GetBlenderScene();
- mBlendMode = GPU_BLEND_SOLID;
+ mAlphaBlend = GPU_BLEND_SOLID;
ReloadMaterial();
}
@@ -148,12 +148,12 @@ void BL_BlenderShader::Update(const RAS_MeshSlot & ms, RAS_IRasterizer* rasty )
GPU_material_bind_uniforms(gpumat, obmat, viewmat, viewinvmat, obcol);
- mBlendMode = GPU_material_blend_mode(gpumat, obcol);
+ mAlphaBlend = GPU_material_alpha_blend(gpumat, obcol);
}
-int BL_BlenderShader::GetBlendMode()
+int BL_BlenderShader::GetAlphaBlend()
{
- return mBlendMode;
+ return mAlphaBlend;
}
bool BL_BlenderShader::Equals(BL_BlenderShader *blshader)
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h
index 2f22e121b8c..f187d93d648 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.h
+++ b/source/gameengine/Ketsji/BL_BlenderShader.h
@@ -63,7 +63,7 @@ private:
struct Scene *mBlenderScene;
struct Material *mMat;
int mLightLayer;
- int mBlendMode;
+ int mAlphaBlend;
GPUMaterial *mGPUMat;
bool VerifyShader()
@@ -86,7 +86,7 @@ public:
void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat);
void Update(const class RAS_MeshSlot & ms, class RAS_IRasterizer* rasty);
void ReloadMaterial();
- int GetBlendMode();
+ int GetAlphaBlend();
void SetScene(KX_Scene *scene)
{
diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp
index 25fd5467e93..fd0756d067d 100644
--- a/source/gameengine/Ketsji/BL_Material.cpp
+++ b/source/gameengine/Ketsji/BL_Material.cpp
@@ -52,12 +52,11 @@ void BL_Material::Initialize()
speccolor[0] = 1.f;
speccolor[1] = 1.f;
speccolor[2] = 1.f;
- transp = 0;
+ alphablend = 0;
hard = 50.f;
spec_f = 0.5f;
alpha = 1.f;
emit = 0.f;
- mode = 0;
material = 0;
tface = 0;
materialindex = 0;
diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h
index c0440e66501..2c6316ea32b 100644
--- a/source/gameengine/Ketsji/BL_Material.h
+++ b/source/gameengine/Ketsji/BL_Material.h
@@ -68,7 +68,7 @@ public:
float matcolor[4];
float speccolor[3];
- short transp, pad;
+ short alphablend, pad;
float hard, spec_f;
float alpha, emit, color_blend[MAXTEX], ref;
@@ -76,7 +76,6 @@ public:
int blend_mode[MAXTEX];
- int mode;
int num_enabled;
BL_Mapping mapping[MAXTEX];
@@ -151,14 +150,16 @@ enum BL_flag
// BL_Material::ras_mode
enum BL_ras_mode
{
- POLY_VIS=1,
+ // POLY_VIS=1,
COLLIDER=2,
ZSORT=4,
ALPHA=8,
// TRIANGLE=16,
USE_LIGHT=32,
WIRE=64,
- CAST_SHADOW=128
+ CAST_SHADOW=128,
+ TEX=256,
+ TWOSIDED=512
};
// -------------------------------------
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index 33da17cc505..1a1e046f54c 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -34,6 +34,8 @@
#include "DNA_meshdata_types.h"
#include "BKE_mesh.h"
// ------------------------------------
+#include "BLI_utildefines.h"
+
#define spit(x) std::cout << x << std::endl;
BL_Shader *KX_BlenderMaterial::mLastShader = NULL;
@@ -56,21 +58,24 @@ KX_BlenderMaterial::KX_BlenderMaterial()
}
void KX_BlenderMaterial::Initialize(
- KX_Scene *scene,
- BL_Material *data)
+ KX_Scene *scene,
+ BL_Material *data,
+ GameSettings *game)
{
RAS_IPolyMaterial::Initialize(
- data->texname[0],
- data->matname,
- data->materialindex,
- data->tile,
- data->tilexrep[0],
- data->tileyrep[0],
- data->mode,
- data->transp,
- ((data->ras_mode &ALPHA)!=0),
- ((data->ras_mode &ZSORT)!=0)
- );
+ data->texname[0],
+ data->matname,
+ data->materialindex,
+ data->tile,
+ data->tilexrep[0],
+ data->tileyrep[0],
+ data->alphablend,
+ ((data->ras_mode &ALPHA)!=0),
+ ((data->ras_mode &ZSORT)!=0),
+ ((data->ras_mode &USE_LIGHT)!=0),
+ ((data->ras_mode &TEX)),
+ game
+ );
mMaterial = data;
mShader = 0;
mBlenderShader = 0;
@@ -99,7 +104,7 @@ void KX_BlenderMaterial::Initialize(
for(int i=0; i<mMaterial->num_enabled; i++) {
m_multimode += (mMaterial->flag[i] + mMaterial->blend_mode[i]);
}
- m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(COLLIDER|USE_LIGHT));
+ m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(USE_LIGHT));
}
KX_BlenderMaterial::~KX_BlenderMaterial()
@@ -231,7 +236,7 @@ void KX_BlenderMaterial::OnExit()
}
if( mMaterial->tface )
- GPU_set_tpage(mMaterial->tface, 1);
+ GPU_set_tpage(mMaterial->tface, 1, mMaterial->alphablend);
}
@@ -247,7 +252,7 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras)
mLastShader = NULL;
}
- ras->SetBlendingMode(TF_SOLID);
+ ras->SetAlphaBlend(TF_SOLID);
BL_Texture::DisableAllTextures();
return;
}
@@ -268,11 +273,11 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras)
}
if(!mUserDefBlend) {
- ras->SetBlendingMode(mMaterial->transp);
+ ras->SetAlphaBlend(mMaterial->alphablend);
}
else {
- ras->SetBlendingMode(TF_SOLID);
- ras->SetBlendingMode(-1); // indicates custom mode
+ ras->SetAlphaBlend(TF_SOLID);
+ ras->SetAlphaBlend(-1); // indicates custom mode
// tested to be valid enums
glEnable(GL_BLEND);
@@ -283,7 +288,7 @@ void KX_BlenderMaterial::setShaderData( bool enable, RAS_IRasterizer *ras)
void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras)
{
if( !enable || !mBlenderShader->Ok() ) {
- ras->SetBlendingMode(TF_SOLID);
+ ras->SetAlphaBlend(TF_SOLID);
// frame cleanup.
if(mLastBlenderShader) {
@@ -297,7 +302,7 @@ void KX_BlenderMaterial::setBlenderShaderData( bool enable, RAS_IRasterizer *ras
}
if(!mBlenderShader->Equals(mLastBlenderShader)) {
- ras->SetBlendingMode(mMaterial->transp);
+ ras->SetAlphaBlend(mMaterial->alphablend);
if(mLastBlenderShader)
mLastBlenderShader->SetProg(false);
@@ -314,14 +319,14 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras)
BL_Texture::DisableAllTextures();
if( !enable ) {
- ras->SetBlendingMode(TF_SOLID);
+ ras->SetAlphaBlend(TF_SOLID);
return;
}
BL_Texture::ActivateFirst();
if( mMaterial->IdMode == DEFAULT_BLENDER ) {
- ras->SetBlendingMode(mMaterial->transp);
+ ras->SetAlphaBlend(mMaterial->alphablend);
return;
}
@@ -331,7 +336,7 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras)
mTextures[0].ActivateTexture();
mTextures[0].setTexEnv(0, true);
mTextures[0].SetMapping(mMaterial->mapping[0].mapping);
- ras->SetBlendingMode(mMaterial->transp);
+ ras->SetAlphaBlend(mMaterial->alphablend);
}
return;
}
@@ -354,11 +359,11 @@ void KX_BlenderMaterial::setTexData( bool enable, RAS_IRasterizer *ras)
}
if(!mUserDefBlend) {
- ras->SetBlendingMode(mMaterial->transp);
+ ras->SetAlphaBlend(mMaterial->alphablend);
}
else {
- ras->SetBlendingMode(TF_SOLID);
- ras->SetBlendingMode(-1); // indicates custom mode
+ ras->SetAlphaBlend(TF_SOLID);
+ ras->SetAlphaBlend(-1); // indicates custom mode
glEnable(GL_BLEND);
glBlendFunc(mBlendFunc[0], mBlendFunc[1]);
@@ -393,15 +398,15 @@ KX_BlenderMaterial::ActivatShaders(
else
tmp->setShaderData(false, rasty);
- if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE)
+ if (mMaterial->ras_mode &TWOSIDED)
rasty->SetCullFace(false);
else
rasty->SetCullFace(true);
- if (((mMaterial->ras_mode &WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) ||
+ if ((mMaterial->ras_mode &WIRE) ||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
{
- if((mMaterial->ras_mode &WIRE)!=0)
+ if (mMaterial->ras_mode &WIRE)
rasty->SetCullFace(false);
rasty->SetLines(true);
}
@@ -438,15 +443,15 @@ KX_BlenderMaterial::ActivateBlenderShaders(
else
tmp->setBlenderShaderData(false, rasty);
- if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE)
+ if (mMaterial->ras_mode &TWOSIDED)
rasty->SetCullFace(false);
else
rasty->SetCullFace(true);
- if (((mMaterial->ras_mode & WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) ||
+ if ((mMaterial->ras_mode &WIRE) ||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
{
- if((mMaterial->ras_mode &WIRE)!=0)
+ if (mMaterial->ras_mode &WIRE)
rasty->SetCullFace(false);
rasty->SetLines(true);
}
@@ -487,15 +492,15 @@ KX_BlenderMaterial::ActivateMat(
else
tmp->setTexData( false,rasty);
- if(mMaterial->mode & RAS_IRasterizer::KX_TWOSIDE)
+ if (mMaterial->ras_mode &TWOSIDED)
rasty->SetCullFace(false);
else
rasty->SetCullFace(true);
- if (((mMaterial->ras_mode &WIRE)!=0) || (mMaterial->mode & RAS_IRasterizer::KX_LINES) ||
+ if ((mMaterial->ras_mode &WIRE) ||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
{
- if((mMaterial->ras_mode &WIRE)!=0)
+ if (mMaterial->ras_mode &WIRE)
rasty->SetCullFace(false);
rasty->SetLines(true);
}
@@ -570,17 +575,17 @@ void KX_BlenderMaterial::ActivateMeshSlot(const RAS_MeshSlot & ms, RAS_IRasteriz
mShader->Update(ms, rasty);
}
else if(mBlenderShader && GLEW_ARB_shader_objects) {
- int blendmode;
+ int alphablend;
mBlenderShader->Update(ms, rasty);
/* we do blend modes here, because they can change per object
* with the same material due to obcolor/obalpha */
- blendmode = mBlenderShader->GetBlendMode();
- if((blendmode == TF_SOLID || blendmode == TF_ALPHA) && mMaterial->transp != TF_SOLID)
- blendmode = mMaterial->transp;
+ alphablend = mBlenderShader->GetAlphaBlend();
+ if(ELEM3(alphablend, GEMAT_SOLID, GEMAT_ALPHA, GEMAT_ALPHA_SORT) && mMaterial->alphablend != GEMAT_SOLID)
+ alphablend = mMaterial->alphablend;
- rasty->SetBlendingMode(blendmode);
+ rasty->SetAlphaBlend(alphablend);
}
}
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
index 766e20be825..236bd6afdc8 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.h
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -38,7 +38,8 @@ public:
KX_BlenderMaterial();
void Initialize(
class KX_Scene* scene,
- BL_Material* mat
+ BL_Material* mat,
+ GameSettings* game
);
virtual ~KX_BlenderMaterial();
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
index f72c98fb4bf..5747d8641d0 100644
--- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp
+++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
@@ -26,6 +26,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include "MEM_guardedalloc.h"
+
#include "BLI_math_vector.h"
#include "KX_NavMeshObject.h"
#include "RAS_MeshObject.h"
@@ -117,8 +119,12 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts,
int *dtrisToPolysMap=NULL, *dtrisToTrisMap=NULL, *trisToFacesMap=NULL;
int nAllVerts = 0;
float *allVerts = NULL;
- buildNavMeshDataByDerivedMesh(dm, vertsPerPoly, nAllVerts, allVerts, ndtris, dtris,
- npolys, dmeshes, polys, dtrisToPolysMap, dtrisToTrisMap, trisToFacesMap);
+ buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nAllVerts, &allVerts, &ndtris, &dtris,
+ &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, &trisToFacesMap);
+
+ MEM_freeN(dtrisToPolysMap);
+ MEM_freeN(dtrisToTrisMap);
+ MEM_freeN(trisToFacesMap);
unsigned short *verticesMap = new unsigned short[nAllVerts];
memset(verticesMap, 0xffff, sizeof(unsigned short)*nAllVerts);
@@ -207,6 +213,8 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts,
}
}
}
+
+ MEM_freeN(allVerts);
}
else
{
@@ -445,7 +453,12 @@ bool KX_NavMeshObject::BuildNavMesh()
m_navMesh->init(data, dataSize, true);
delete [] vertices;
- delete [] polys;
+
+ /* navmesh conversion is using C guarded alloc for memory allocaitons */
+ MEM_freeN(polys);
+ if (dmeshes) MEM_freeN(dmeshes);
+ if (dtris) MEM_freeN(dtris);
+
if (dvertices)
{
delete [] dvertices;
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
index d32f267f0e0..098c136bfa3 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp
@@ -78,10 +78,10 @@ void KX_PolygonMaterial::Initialize(
int tile,
int tilexrep,
int tileyrep,
- int mode,
- int transp,
+ int alphablend,
bool alpha,
bool zsort,
+ bool light,
int lightlayer,
struct MTFace* tface,
unsigned int* mcol)
@@ -93,10 +93,12 @@ void KX_PolygonMaterial::Initialize(
tile,
tilexrep,
tileyrep,
- mode,
- transp,
+ alphablend,
alpha,
- zsort);
+ zsort,
+ light,
+ (texname && texname != ""?true:false), /* if we have a texture we have image */
+ ma?&ma->game:NULL);
m_tface = tface;
m_mcol = mcol;
m_material = ma;
@@ -168,7 +170,7 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c
if (GetCachingInfo() != cachingInfo)
{
if (!cachingInfo)
- GPU_set_tpage(NULL, 0);
+ GPU_set_tpage(NULL, 0, 0);
cachingInfo = GetCachingInfo();
@@ -176,15 +178,15 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c
{
Image *ima = (Image*)m_tface->tpage;
GPU_update_image_time(ima, rasty->GetTime());
- GPU_set_tpage(m_tface, 1);
+ GPU_set_tpage(m_tface, 1, m_alphablend);
}
else
- GPU_set_tpage(NULL, 0);
+ GPU_set_tpage(NULL, 0, 0);
- if(m_drawingmode & RAS_IRasterizer::KX_TWOSIDE)
- rasty->SetCullFace(false);
- else
+ if(m_drawingmode & RAS_IRasterizer::KX_BACKCULL)
rasty->SetCullFace(true);
+ else
+ rasty->SetCullFace(false);
if ((m_drawingmode & RAS_IRasterizer::KX_LINES) ||
(rasty->GetDrawingMode() <= RAS_IRasterizer::KX_WIREFRAME))
@@ -318,7 +320,7 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setTexture, "setTexture(tface)")
if (PyArg_ParseTuple(args, "O!:setTexture", &PyCapsule_Type, &pytface))
{
MTFace *tface = (MTFace*) PyCapsule_GetPointer(pytface, KX_POLYGONMATERIAL_CAPSULE_ID);
- GPU_set_tpage(tface, 1);
+ GPU_set_tpage(tface, 1, m_alphablend);
Py_RETURN_NONE;
}
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h
index 3520995def3..b09ddd39141 100644
--- a/source/gameengine/Ketsji/KX_PolygonMaterial.h
+++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h
@@ -78,10 +78,10 @@ public:
int tile,
int tilexrep,
int tileyrep,
- int mode,
- int transp,
+ int alphablend,
bool alpha,
bool zsort,
+ bool light,
int lightlayer,
struct MTFace* tface,
unsigned int* mcol);
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
index 5a1b52489b4..9948f48d7f3 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
@@ -36,6 +36,7 @@
#include "DNA_image_types.h"
#include "DNA_meshdata_types.h"
+#include "DNA_material_types.h"
void RAS_IPolyMaterial::Initialize(
const STR_String& texname,
@@ -44,10 +45,12 @@ void RAS_IPolyMaterial::Initialize(
int tile,
int tilexrep,
int tileyrep,
- int mode,
- int transp,
+ int alphablend,
bool alpha,
- bool zsort)
+ bool zsort,
+ bool light,
+ bool image,
+ struct GameSettings* game)
{
m_texturename = texname;
m_materialname = matname;
@@ -55,10 +58,10 @@ void RAS_IPolyMaterial::Initialize(
m_tile = tile;
m_tilexrep = tilexrep;
m_tileyrep = tileyrep;
- m_drawingmode = mode;
- m_transp = transp;
+ m_alphablend = alphablend;
m_alpha = alpha;
m_zsort = zsort;
+ m_light = light;
m_polymatid = m_newpolymatid++;
m_flag = 0;
m_multimode = 0;
@@ -66,6 +69,7 @@ void RAS_IPolyMaterial::Initialize(
m_specular.setValue(0.5,0.5,0.5);
m_specularity = 1.0;
m_diffuse.setValue(0.5,0.5,0.5);
+ m_drawingmode = ConvertFaceMode(game, image);
}
RAS_IPolyMaterial::RAS_IPolyMaterial()
@@ -75,9 +79,10 @@ RAS_IPolyMaterial::RAS_IPolyMaterial()
m_tilexrep(0),
m_tileyrep(0),
m_drawingmode (0),
- m_transp(0),
+ m_alphablend(0),
m_alpha(false),
m_zsort(false),
+ m_light(false),
m_materialindex(0),
m_polymatid(0),
m_flag(0),
@@ -95,8 +100,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname,
int tile,
int tilexrep,
int tileyrep,
- int mode,
- int transp,
+ int alphablend,
bool alpha,
bool zsort)
: m_texturename(texname),
@@ -104,8 +108,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname,
m_tile(tile),
m_tilexrep(tilexrep),
m_tileyrep(tileyrep),
- m_drawingmode (mode),
- m_transp(transp),
+ m_alphablend(alphablend),
m_alpha(alpha),
m_zsort(zsort),
m_materialindex(materialindex),
@@ -128,9 +131,9 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const
this->m_multimode == lhs.m_multimode &&
this->m_flag == lhs.m_flag &&
this->m_drawingmode == lhs.m_drawingmode &&
- this->m_transp == lhs.m_transp &&
- this->m_texturename.hash() == lhs.m_texturename.hash() &&
- this->m_materialname.hash() == lhs.m_materialname.hash()
+ this->m_alphablend == lhs.m_alphablend &&
+ this->m_texturename.hash() == lhs.m_texturename.hash() &&
+ this->m_materialname.hash() == lhs.m_materialname.hash()
);
return test;
@@ -141,9 +144,10 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const
this->m_tile == lhs.m_tile &&
this->m_tilexrep == lhs.m_tilexrep &&
this->m_tileyrep == lhs.m_tileyrep &&
- this->m_transp == lhs.m_transp &&
+ this->m_alphablend == lhs.m_alphablend &&
this->m_alpha == lhs.m_alpha &&
this->m_zsort == lhs.m_zsort &&
+ this->m_light == lhs.m_light &&
this->m_drawingmode == lhs.m_drawingmode &&
this->m_texturename.hash() == lhs.m_texturename.hash() &&
this->m_materialname.hash() == lhs.m_materialname.hash()
@@ -151,6 +155,21 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const
}
}
+int RAS_IPolyMaterial::ConvertFaceMode(struct GameSettings *game, bool image) const
+{
+ if (!game) return (image?GEMAT_TEX:0);
+
+ int modefinal = 0;
+
+ int orimode = game->face_orientation;
+ int alpha_blend = game->alpha_blend;
+ int flags = game->flag & (GEMAT_TEXT | GEMAT_BACKCULL);
+
+ modefinal = orimode | alpha_blend | flags;
+ modefinal |= (image ? GEMAT_TEX : 0);
+
+ return modefinal;
+}
void RAS_IPolyMaterial::GetMaterialRGBAColor(unsigned char *rgba) const
{
@@ -241,7 +260,7 @@ bool RAS_IPolyMaterial::UsesLighting(RAS_IRasterizer *rasty) const
else if(rasty->GetDrawingMode() < RAS_IRasterizer::KX_SOLID);
else if(rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW);
else
- dolights = (m_drawingmode & RAS_IRasterizer::KX_LIGHT)!=0;
+ dolights = m_light;
return dolights;
}
diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
index 2a5c6a179b6..69d07713c49 100644
--- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
+++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
@@ -49,6 +49,7 @@ struct Material;
struct Image;
struct Scene;
class SCA_IScene;
+struct GameSettings;
enum MaterialProps
{
@@ -78,10 +79,11 @@ protected:
STR_HashedString m_materialname; //also needed for touchsensor
int m_tile;
int m_tilexrep,m_tileyrep;
- int m_drawingmode; // tface->mode
- int m_transp;
+ int m_drawingmode;
+ int m_alphablend;
bool m_alpha;
bool m_zsort;
+ bool m_light;
int m_materialindex;
unsigned int m_polymatid;
@@ -102,9 +104,9 @@ public:
// care! these are taken from blender polygonflags, see file DNA_mesh_types.h for #define TF_BILLBOARD etc.
enum MaterialFlags
{
- BILLBOARD_SCREENALIGNED = 256,
- BILLBOARD_AXISALIGNED = 4096,
- SHADOW =8192
+ BILLBOARD_SCREENALIGNED = 512, /* GEMAT_HALO */
+ BILLBOARD_AXISALIGNED = 1024, /* GEMAT_BILLBOARD */
+ SHADOW =2048 /* GEMAT_SHADOW */
};
RAS_IPolyMaterial();
@@ -114,7 +116,6 @@ public:
int tile,
int tilexrep,
int tileyrep,
- int mode,
int transp,
bool alpha,
bool zsort);
@@ -124,10 +125,13 @@ public:
int tile,
int tilexrep,
int tileyrep,
- int mode,
int transp,
bool alpha,
- bool zsort);
+ bool zsort,
+ bool light,
+ bool image,
+ struct GameSettings* game);
+
virtual ~RAS_IPolyMaterial() {};
/**
@@ -174,6 +178,11 @@ public:
virtual void Replace_IScene(SCA_IScene *val) {}; /* overridden by KX_BlenderMaterial */
+ /**
+ * @return the equivalent drawing mode for the material settings (equivalent to old TexFace tface->mode).
+ */
+ int ConvertFaceMode(struct GameSettings *game, bool image) const;
+
/*
* PreCalculate texture gen
*/
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 877a7219a1c..2988aa4effb 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -68,11 +68,7 @@ class RAS_IRasterizer
public:
RAS_IRasterizer(RAS_ICanvas* canv){};
virtual ~RAS_IRasterizer(){};
- /**
- */
- enum {
- RAS_RENDER_3DPOLYGON_TEXT = 16384 /* TF_BMFONT */
- };
+
/**
* Drawing types
*/
@@ -106,9 +102,9 @@ public:
/**
*/
enum {
- KX_TEX = 4, /* TF_TEX */
- KX_LIGHT = 16, /* TF_LIGHT */
- KX_TWOSIDE = 512, /* TF_TWOSIDE */
+ RAS_RENDER_3DPOLYGON_TEXT = 64, /* GEMAT_TEXT */
+ KX_BACKCULL = 16, /* GEMAT_BACKCULL */
+ KX_TEX = 4096, /* GEMAT_TEX */
KX_LINES = 32768
};
@@ -417,7 +413,7 @@ public:
virtual int GetMotionBlurState()=0;
virtual void SetMotionBlurState(int newstate)=0;
- virtual void SetBlendingMode(int blendmode)=0;
+ virtual void SetAlphaBlend(int alphablend)=0;
virtual void SetFrontFace(bool ccw)=0;
virtual void SetAnisotropicFiltering(short level)=0;
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 6ad9e591474..d9039a2a68d 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -89,7 +89,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas)
m_motionblurvalue(-1.0),
m_texco_num(0),
m_attrib_num(0),
- //m_last_blendmode(GPU_BLEND_SOLID),
+ //m_last_alphablend(GPU_BLEND_SOLID),
m_last_frontface(true),
m_materialCachingInfo(0)
{
@@ -126,8 +126,8 @@ bool RAS_OpenGLRasterizer::Init()
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
- //m_last_blendmode = GPU_BLEND_SOLID;
- GPU_set_material_blend_mode(GPU_BLEND_SOLID);
+ //m_last_alphablend = GPU_BLEND_SOLID;
+ GPU_set_material_alpha_blend(GPU_BLEND_SOLID);
glFrontFace(GL_CCW);
m_last_frontface = true;
@@ -303,8 +303,8 @@ bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time)
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
- //m_last_blendmode = GPU_BLEND_SOLID;
- GPU_set_material_blend_mode(GPU_BLEND_SOLID);
+ //m_last_alphablend = GPU_BLEND_SOLID;
+ GPU_set_material_alpha_blend(GPU_BLEND_SOLID);
glFrontFace(GL_CCW);
m_last_frontface = true;
@@ -873,10 +873,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi)
// MCol *mcol = (MCol*)ms.m_pDerivedMesh->getFaceDataArray(ms.m_pDerivedMesh, CD_MCOL); /* UNUSED */
// handle two-side
- if (current_polymat->GetDrawingMode() & RAS_IRasterizer::KX_TWOSIDE)
- this->SetCullFace(false);
- else
+ if (current_polymat->GetDrawingMode() & RAS_IRasterizer::KX_BACKCULL)
this->SetCullFace(true);
+ else
+ this->SetCullFace(false);
if (current_polymat->GetFlag() & RAS_BLENDERGLSL) {
// GetMaterialIndex return the original mface material index,
@@ -890,9 +890,9 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi)
else
memset(&current_gpu_attribs, 0, sizeof(current_gpu_attribs));
// DM draw can mess up blending mode, restore at the end
- int current_blend_mode = GPU_get_material_blend_mode();
+ int current_blend_mode = GPU_get_material_alpha_blend();
ms.m_pDerivedMesh->drawFacesGLSL(ms.m_pDerivedMesh, CheckMaterialDM);
- GPU_set_material_blend_mode(current_blend_mode);
+ GPU_set_material_alpha_blend(current_blend_mode);
} else {
//ms.m_pDerivedMesh->drawMappedFacesTex(ms.m_pDerivedMesh, CheckTexfaceDM, mcol);
current_blmat_nr = current_polymat->GetMaterialIndex();
@@ -1204,36 +1204,36 @@ void RAS_OpenGLRasterizer::DisableMotionBlur()
m_motionblurvalue = -1.0;
}
-void RAS_OpenGLRasterizer::SetBlendingMode(int blendmode)
+void RAS_OpenGLRasterizer::SetAlphaBlend(int alphablend)
{
- GPU_set_material_blend_mode(blendmode);
+ GPU_set_material_alpha_blend(alphablend);
/*
- if(blendmode == m_last_blendmode)
+ if(alphablend == m_last_alphablend)
return;
- if(blendmode == GPU_BLEND_SOLID) {
+ if(alphablend == GPU_BLEND_SOLID) {
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
- else if(blendmode == GPU_BLEND_ADD) {
+ else if(alphablend == GPU_BLEND_ADD) {
glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
}
- else if(blendmode == GPU_BLEND_ALPHA) {
+ else if(alphablend == GPU_BLEND_ALPHA) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.0f);
}
- else if(blendmode == GPU_BLEND_CLIP) {
+ else if(alphablend == GPU_BLEND_CLIP) {
glDisable(GL_BLEND);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
}
- m_last_blendmode = blendmode;
+ m_last_alphablend = alphablend;
*/
}
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
index c0e02f6df77..cbfa49510a5 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
@@ -111,7 +111,7 @@ protected:
TexCoGen m_attrib[RAS_MAX_ATTRIB];
int m_texco_num;
int m_attrib_num;
- //int m_last_blendmode;
+ //int m_last_alphablend;
bool m_last_frontface;
/** Stores the caching information for the last material activated. */
@@ -312,7 +312,7 @@ public:
m_motionblur = newstate;
};
- virtual void SetBlendingMode(int blendmode);
+ virtual void SetAlphaBlend(int alphablend);
virtual void SetFrontFace(bool ccw);
virtual void SetAnisotropicFiltering(short level);
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):