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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt13
-rw-r--r--GNUmakefile6
-rw-r--r--SConstruct7
-rw-r--r--build_files/scons/config/win64-mingw-config.py4
-rw-r--r--doc/build_systems/scons-dev.txt2
-rw-r--r--doc/build_systems/scons.txt6
-rw-r--r--doc/guides/interface_API.txt2
-rw-r--r--doc/python_api/rst/bge.render.rst12
-rw-r--r--doc/python_api/rst/bge.types.rst58
-rw-r--r--extern/carve/include/carve/csg.hpp56
-rw-r--r--extern/carve/include/carve/polyline_decl.hpp5
-rw-r--r--extern/carve/include/carve/rtree.hpp13
-rw-r--r--extern/carve/lib/csg_data.hpp4
-rw-r--r--extern/carve/lib/csg_detail.hpp30
-rw-r--r--extern/carve/lib/intersect.cpp291
-rw-r--r--extern/carve/patches/strict_flags.patch6
-rw-r--r--intern/audaspace/intern/AUD_C-API.cpp6
-rw-r--r--intern/audaspace/intern/AUD_C-API.h8
-rw-r--r--intern/cycles/blender/addon/properties.py9
-rw-r--r--intern/cycles/render/image.cpp30
-rw-r--r--intern/cycles/render/image.h6
-rw-r--r--intern/cycles/render/nodes.cpp12
-rw-r--r--intern/ghost/GHOST_C-api.h3
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.cpp2
-rw-r--r--intern/raskter/raskter.c88
-rw-r--r--intern/smoke/intern/MERSENNETWISTER.h2
-rw-r--r--intern/smoke/intern/smoke_API.cpp4
-rw-r--r--release/scripts/modules/animsys_refactor.py4
-rw-r--r--release/scripts/modules/bl_i18n_utils/__init__.py (renamed from release/scripts/modules/i18n/__init__.py)0
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_process_msg.py (renamed from release/scripts/modules/i18n/bl_process_msg.py)15
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/check_po.py (renamed from release/scripts/modules/i18n/check_po.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/clean_po.py (renamed from release/scripts/modules/i18n/clean_po.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/import_po_from_branches.py (renamed from release/scripts/modules/i18n/import_po_from_branches.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/merge_po.py (renamed from release/scripts/modules/i18n/merge_po.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/rtl_preprocess.py (renamed from release/scripts/modules/i18n/rtl_preprocess.py)0
-rw-r--r--release/scripts/modules/bl_i18n_utils/settings.py (renamed from release/scripts/modules/i18n/settings.py)31
-rw-r--r--release/scripts/modules/bl_i18n_utils/spell_check_utils.py (renamed from release/scripts/modules/i18n/spell_check_utils.py)19
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/update_branches.py (renamed from release/scripts/modules/i18n/update_branches.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/update_mo.py (renamed from release/scripts/modules/i18n/update_mo.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/update_msg.py (renamed from release/scripts/modules/i18n/update_msg.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/update_po.py (renamed from release/scripts/modules/i18n/update_po.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/update_pot.py (renamed from release/scripts/modules/i18n/update_pot.py)0
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/update_trunk.py (renamed from release/scripts/modules/i18n/update_trunk.py)0
-rw-r--r--release/scripts/modules/bl_i18n_utils/user_settings.py (renamed from release/scripts/modules/i18n/user_settings.py)0
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils.py (renamed from release/scripts/modules/i18n/utils.py)0
-rw-r--r--release/scripts/modules/bpy/ops.py20
-rw-r--r--release/scripts/modules/bpy/utils.py2
-rw-r--r--release/scripts/modules/bpy_extras/__init__.py2
-rw-r--r--release/scripts/modules/bpy_extras/io_utils.py2
-rw-r--r--release/scripts/modules/bpy_extras/mesh_utils.py12
-rw-r--r--release/scripts/modules/bpyml_ui.py4
-rw-r--r--release/scripts/modules/console_python.py4
-rw-r--r--release/scripts/modules/console_shell.py6
-rw-r--r--release/scripts/modules/rna_info.py4
-rw-r--r--release/scripts/presets/tracking_settings/blurry_footage.py2
-rw-r--r--release/scripts/presets/tracking_settings/blurry_movie.py2
-rw-r--r--release/scripts/presets/tracking_settings/default.py2
-rw-r--r--release/scripts/presets/tracking_settings/fast_motion.py2
-rw-r--r--release/scripts/startup/bl_operators/add_mesh_torus.py2
-rw-r--r--release/scripts/startup/bl_operators/clip.py54
-rw-r--r--release/scripts/startup/bl_operators/image.py2
-rw-r--r--release/scripts/startup/bl_operators/mesh.py2
-rw-r--r--release/scripts/startup/bl_operators/object.py20
-rw-r--r--release/scripts/startup/bl_operators/object_align.py2
-rw-r--r--release/scripts/startup/bl_operators/object_randomize_transform.py6
-rw-r--r--release/scripts/startup/bl_operators/presets.py36
-rw-r--r--release/scripts/startup/bl_operators/screen_play_rendered_anim.py2
-rw-r--r--release/scripts/startup/bl_operators/sequencer.py6
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_follow_active.py8
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_lightmap.py8
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_smart_project.py17
-rw-r--r--release/scripts/startup/bl_operators/wm.py57
-rw-r--r--release/scripts/startup/bl_ui/properties_data_armature.py6
-rw-r--r--release/scripts/startup/bl_ui/properties_data_curve.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_game.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py15
-rw-r--r--release/scripts/startup/bl_ui/properties_particle.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_field.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py14
-rw-r--r--release/scripts/startup/bl_ui/space_console.py4
-rw-r--r--release/scripts/startup/bl_ui/space_image.py12
-rw-r--r--release/scripts/startup/bl_ui/space_node.py6
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py4
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py8
-rw-r--r--release/scripts/templates/addon_add_object.py2
-rw-r--r--release/scripts/templates/gamelogic.py28
-rw-r--r--release/scripts/templates/operator_node.py2
-rw-r--r--release/scripts/templates/ui_panel_simple.py4
-rw-r--r--source/blender/blenkernel/BKE_action.h2
-rw-r--r--source/blender/blenkernel/BKE_anim.h2
-rw-r--r--source/blender/blenkernel/BKE_image.h2
-rw-r--r--source/blender/blenkernel/BKE_mask.h10
-rw-r--r--source/blender/blenkernel/BKE_material.h4
-rw-r--r--source/blender/blenkernel/BKE_modifier.h1
-rw-r--r--source/blender/blenkernel/CMakeLists.txt3
-rw-r--r--source/blender/blenkernel/SConscript1
-rw-r--r--source/blender/blenkernel/intern/action.c14
-rw-r--r--source/blender/blenkernel/intern/anim.c4
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c2
-rw-r--r--source/blender/blenkernel/intern/armature.c5
-rw-r--r--source/blender/blenkernel/intern/collision.c2
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c75
-rw-r--r--source/blender/blenkernel/intern/displist.c11
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c2
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c6
-rw-r--r--source/blender/blenkernel/intern/font.c2
-rw-r--r--source/blender/blenkernel/intern/image.c37
-rw-r--r--source/blender/blenkernel/intern/mask.c92
-rw-r--r--source/blender/blenkernel/intern/material.c58
-rw-r--r--source/blender/blenkernel/intern/mesh.c8
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c82
-rw-r--r--source/blender/blenkernel/intern/modifier.c7
-rw-r--r--source/blender/blenkernel/intern/nla.c2
-rw-r--r--source/blender/blenkernel/intern/node.c18
-rw-r--r--source/blender/blenkernel/intern/object.c28
-rw-r--r--source/blender/blenkernel/intern/particle_system.c4
-rw-r--r--source/blender/blenkernel/intern/smoke.c4
-rw-r--r--source/blender/blenkernel/intern/softbody.c6
-rw-r--r--source/blender/blenkernel/intern/tracking.c10
-rw-r--r--source/blender/blenkernel/intern/unit.c144
-rw-r--r--source/blender/blenlib/BLI_args.h25
-rw-r--r--source/blender/blenlib/BLI_math_geom.h14
-rw-r--r--source/blender/blenlib/intern/BLI_args.c18
-rw-r--r--source/blender/blenlib/intern/freetypefont.c18
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c2
-rw-r--r--source/blender/blenlib/intern/math_geom.c57
-rw-r--r--source/blender/blenlib/intern/pbvh.c57
-rw-r--r--source/blender/blenloader/intern/readfile.c9
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c78
-rw-r--r--source/blender/bmesh/operators/bmo_hull.c63
-rw-r--r--source/blender/collada/GeometryExporter.h3
-rw-r--r--source/blender/collada/ImageExporter.cpp8
-rw-r--r--source/blender/compositor/CMakeLists.txt8
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.cpp1
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.h8
-rw-r--r--source/blender/compositor/intern/COM_Converter.cpp28
-rw-r--r--source/blender/compositor/intern/COM_Converter.h2
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.cpp10
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystem.cpp9
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystem.h2
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp7
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystemHelper.h2
-rw-r--r--source/blender/compositor/intern/COM_Node.cpp13
-rw-r--r--source/blender/compositor/intern/COM_Node.h14
-rw-r--r--source/blender/compositor/intern/COM_NodeBase.cpp2
-rw-r--r--source/blender/compositor/intern/COM_NodeBase.h17
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cpp2
-rw-r--r--source/blender/compositor/intern/COM_WorkScheduler.cpp22
-rw-r--r--source/blender/compositor/intern/COM_compositor.cpp17
-rw-r--r--source/blender/compositor/nodes/COM_BilateralBlurNode.cpp1
-rw-r--r--source/blender/compositor/nodes/COM_BlurNode.cpp4
-rw-r--r--source/blender/compositor/nodes/COM_BokehBlurNode.cpp1
-rw-r--r--source/blender/compositor/nodes/COM_ColorToBWNode.cpp8
-rw-r--r--source/blender/compositor/nodes/COM_ColorToBWNode.h10
-rw-r--r--source/blender/compositor/nodes/COM_CompositorNode.cpp14
-rw-r--r--source/blender/compositor/nodes/COM_DefocusNode.cpp20
-rw-r--r--source/blender/compositor/nodes/COM_DilateErodeNode.cpp7
-rw-r--r--source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp1
-rw-r--r--source/blender/compositor/nodes/COM_FilterNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_GlareNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp6
-rw-r--r--source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp6
-rw-r--r--source/blender/compositor/nodes/COM_KeyingNode.cpp9
-rw-r--r--source/blender/compositor/nodes/COM_KeyingScreenNode.cpp1
-rw-r--r--source/blender/compositor/nodes/COM_LensDistortionNode.cpp12
-rw-r--r--source/blender/compositor/nodes/COM_MapValueNode.cpp4
-rw-r--r--source/blender/compositor/nodes/COM_MaskNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_RenderLayersNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_TonemapNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_VectorBlurNode.cpp1
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverKeyOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverMixedOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ChangeHSVOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ChannelMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ChromaMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ColorSpillOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorProfileOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorToBWOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp (renamed from source/blender/compositor/operations/COM_ConvertColourToValueProg.cpp)10
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorToValueProg.h (renamed from source/blender/compositor/operations/COM_ConvertColourToValueProg.h)12
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertValueToColorProg.cpp (renamed from source/blender/compositor/operations/COM_ConvertValueToColourProg.cpp)10
-rw-r--r--source/blender/compositor/operations/COM_ConvertValueToColorProg.h (renamed from source/blender/compositor/operations/COM_ConvertValueToColourProg.h)8
-rw-r--r--source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp8
-rw-r--r--source/blender/compositor/operations/COM_DifferenceMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_DistanceMatteOperation.cpp8
-rw-r--r--source/blender/compositor/operations/COM_DistanceMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_LuminanceMatteOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MapValueOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MaskOperation.cpp13
-rw-r--r--source/blender/compositor/operations/COM_MaskOperation.h1
-rw-r--r--source/blender/compositor/operations/COM_MathBaseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixAddOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixBaseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixBlendOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixBurnOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixColorOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixDarkenOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixDifferenceOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixDivideOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixDodgeOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixGlareOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixHueOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixLightenOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixLinearLightOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixMultiplyOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixOverlayOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixSaturationOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixScreenOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixSoftLightOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixSubtractOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MixValueOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_MovieClipAttributeOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_OpenCLKernels.cl62
-rw-r--r--source/blender/compositor/operations/COM_OpenCLKernels.cl.h70
-rw-r--r--source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_RenderLayersImageProg.cpp2
-rw-r--r--source/blender/compositor/operations/COM_RenderLayersImageProg.h8
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp194
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h16
-rw-r--r--source/blender/compositor/operations/COM_SetAlphaOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SetColorOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SetSamplerOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SetValueOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_SetVectorOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp173
-rw-r--r--source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h42
-rw-r--r--source/blender/compositor/operations/COM_WriteBufferOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_WriteBufferOperation.h3
-rw-r--r--source/blender/compositor/operations/COM_ZCombineOperation.h4
-rw-r--r--source/blender/editors/animation/drivers.c19
-rw-r--r--source/blender/editors/animation/keyframing.c4
-rw-r--r--source/blender/editors/armature/armature_intern.h2
-rw-r--r--source/blender/editors/armature/armature_ops.c2
-rw-r--r--source/blender/editors/armature/editarmature.c2
-rw-r--r--source/blender/editors/armature/poseSlide.c2
-rw-r--r--source/blender/editors/armature/poselib.c10
-rw-r--r--source/blender/editors/curve/editcurve.c7
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c2
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c2
-rw-r--r--source/blender/editors/include/ED_screen_types.h8
-rw-r--r--source/blender/editors/interface/interface.c6
-rw-r--r--source/blender/editors/interface/interface_handlers.c6
-rw-r--r--source/blender/editors/interface/interface_templates.c9
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
-rw-r--r--source/blender/editors/interface/view2d.c2
-rw-r--r--source/blender/editors/io/io_collada.c2
-rw-r--r--source/blender/editors/mask/mask_draw.c4
-rw-r--r--source/blender/editors/mask/mask_edit.c9
-rw-r--r--source/blender/editors/mask/mask_shapekey.c4
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c5
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c12
-rw-r--r--source/blender/editors/metaball/mball_edit.c3
-rw-r--r--source/blender/editors/object/object_relations.c23
-rw-r--r--source/blender/editors/physics/physics_fluid.c9
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/editors/screen/screen_edit.c2
-rw-r--r--source/blender/editors/screen/screen_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c2
-rw-r--r--source/blender/editors/space_clip/clip_ops.c2
-rw-r--r--source/blender/editors/space_file/file_intern.h2
-rw-r--r--source/blender/editors/space_file/file_ops.c4
-rw-r--r--source/blender/editors/space_file/space_file.c2
-rw-r--r--source/blender/editors/space_graph/graph_draw.c4
-rw-r--r--source/blender/editors/space_graph/space_graph.c10
-rw-r--r--source/blender/editors/space_image/image_buttons.c2
-rw-r--r--source/blender/editors/space_info/info_ops.c6
-rw-r--r--source/blender/editors/space_nla/nla_draw.c8
-rw-r--r--source/blender/editors/space_node/drawnode.c34
-rw-r--r--source/blender/editors/space_node/node_draw.c22
-rw-r--r--source/blender/editors/space_node/node_edit.c2
-rw-r--r--source/blender/editors/space_node/space_node.c11
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c4
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c2
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c4
-rw-r--r--source/blender/editors/space_time/space_time.c4
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c20
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c4
-rw-r--r--source/blender/editors/transform/transform.c6
-rw-r--r--source/blender/editors/transform/transform_conversions.c2
-rw-r--r--source/blender/editors/transform/transform_manipulator.c2
-rw-r--r--source/blender/editors/transform/transform_snap.c6
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c3
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c4
-rw-r--r--source/blender/gpu/intern/gpu_draw.c4
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp2
-rw-r--r--source/blender/imbuf/intern/cineon/cineon_dpx.c2
-rw-r--r--source/blender/imbuf/intern/cineon/dpxfile.h2
-rw-r--r--source/blender/imbuf/intern/cineon/dpxlib.c2
-rw-r--r--source/blender/imbuf/intern/jp2.c10
-rw-r--r--source/blender/imbuf/intern/readimage.c4
-rw-r--r--source/blender/imbuf/intern/tiff.c4
-rw-r--r--source/blender/makesdna/DNA_action_types.h10
-rw-r--r--source/blender/makesdna/DNA_armature_types.h4
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h2
-rw-r--r--source/blender/makesdna/DNA_curve_types.h2
-rw-r--r--source/blender/makesdna/DNA_image_types.h1
-rw-r--r--source/blender/makesdna/DNA_node_types.h5
-rw-r--r--source/blender/makesdna/DNA_object_force.h2
-rw-r--r--source/blender/makesdna/DNA_object_types.h2
-rw-r--r--source/blender/makesdna/DNA_space_types.h14
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_animviz.c14
-rw-r--r--source/blender/makesrna/intern/rna_boid.c2
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c2
-rw-r--r--source/blender/makesrna/intern/rna_curve.c10
-rw-r--r--source/blender/makesrna/intern/rna_dynamicpaint.c4
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c2
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c7
-rw-r--r--source/blender/makesrna/intern/rna_key.c2
-rw-r--r--source/blender/makesrna/intern/rna_material.c2
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c5
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c12
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c7
-rw-r--r--source/blender/makesrna/intern/rna_object.c5
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c4
-rw-r--r--source/blender/makesrna/intern/rna_pose.c4
-rw-r--r--source/blender/makesrna/intern/rna_scene.c6
-rw-r--r--source/blender/makesrna/intern/rna_screen.c2
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c2
-rw-r--r--source/blender/makesrna/intern/rna_space.c13
-rw-r--r--source/blender/makesrna/intern/rna_texture.c4
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c10
-rw-r--r--source/blender/makesrna/intern/rna_ui.c2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c10
-rw-r--r--source/blender/makesrna/intern/rna_wm.c2
-rw-r--r--source/blender/makesrna/intern/rna_world.c2
-rw-r--r--source/blender/modifiers/intern/MOD_particleinstance.c59
-rw-r--r--source/blender/nodes/composite/node_composite_tree.c3
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_diffMatte.c10
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_distanceMatte.c20
-rw-r--r--source/blender/nodes/intern/node_socket.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_viewer.c4
-rw-r--r--source/blender/python/bmesh/bmesh_py_api.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c4
-rw-r--r--source/blender/python/intern/bpy_rna.c18
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c2
-rw-r--r--source/blender/render/intern/source/external_engine.c16
-rw-r--r--source/blender/render/intern/source/render_result.c2
-rw-r--r--source/blender/render/intern/source/shadeoutput.c5
-rw-r--r--source/blender/windowmanager/intern/wm_apple.c2
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c2
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
-rw-r--r--source/creator/CMakeLists.txt13
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp2
-rw-r--r--source/gameengine/GameLogic/SCA_PropertySensor.cpp110
-rw-r--r--source/gameengine/GameLogic/SCA_PropertySensor.h19
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_ObstacleSimulation.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_SoundActuator.cpp4
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.cpp2
-rw-r--r--source/gameengine/SceneGraph/SG_Tree.h2
379 files changed, 2654 insertions, 1544 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e1ef4f5d4b..75cefd0c219 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,7 +148,7 @@ mark_as_advanced(WITH_AUDASPACE)
# (unix defaults to OpenMP On)
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR (MINGW))
set(PLATFORM_DEFAULT ON)
else()
set(PLATFORM_DEFAULT OFF)
@@ -990,9 +990,11 @@ elseif(WIN32)
set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include)
if(MSVC10)
- set(BOOST_POSTFIX "vc100-mt-s-1_47.lib")
- set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_47.lib")
+ set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
+ set(BOOST_POSTFIX "vc100-mt-s-1_49.lib")
+ set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_49.lib")
else()
+ set(BOOST_LIBPATH ${BOOST}/lib)
set(BOOST_POSTFIX "vc90-mt-s-1_49.lib")
set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_49.lib")
endif()
@@ -1001,11 +1003,6 @@ elseif(WIN32)
optimized libboost_regex-${BOOST_POSTFIX} optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
debug libboost_regex-${BOOST_DEBUG_POSTFIX} debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
- if(MSVC10)
- set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
- else()
- set(BOOST_LIBPATH ${BOOST}/lib)
- endif()
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
endif()
diff --git a/GNUmakefile b/GNUmakefile
index f5cba00d452..88ce32959af 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -162,21 +162,21 @@ help:
@echo " * package_pacman - build an arch linux pacmanpackage"
@echo " * package_archive - build an archive package"
@echo ""
- @echo "Testing Targets (not assosiated with building blender)"
+ @echo "Testing Targets (not associated with building blender)"
@echo " * test - run ctest, currently tests import/export, operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8 which are tagged to use the stricter formatting"
@echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed"
@echo " * test_style - checks C/C++ conforms with blenders style guide: http://wiki.blender.org/index.php/Dev:Doc/CodeStyle"
@echo ""
- @echo "Static Source Code Checking (not assosiated with building blender)"
+ @echo "Static Source Code Checking (not associated with building blender)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
@echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)"
@echo " * check_spelling_c - check for spelling errors (C/C++ only)"
@echo " * check_spelling_py - check for spelling errors (Python only)"
@echo ""
- @echo "Documentation Targets (not assosiated with building blender)"
+ @echo "Documentation Targets (not associated with building blender)"
@echo " * doc_py - generate sphinx python api docs"
@echo " * doc_doxy - generate doxygen C/C++ docs"
@echo " * doc_dna - generate blender file format reference"
diff --git a/SConstruct b/SConstruct
index 088361af649..993167acfe9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -769,8 +769,13 @@ if env['OURPLATFORM'] == 'win64-mingw':
if env['WITH_BF_SDL']:
dllsources.append('${LCGDIR}/sdl/lib/SDL.dll')
+ if(env['WITH_BF_OPENMP']):
+ dllsources.append('${LCGDIR}/binaries/libgomp-1.dll')
+
dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
- dllsources.append('${LCGDIR}/binaries/pthreadGC2-w64.dll')
+ dllsources.append('${LCGDIR}/binaries/libgcc_s_sjlj-1.dll')
+ dllsources.append('${LCGDIR}/binaries/libwinpthread-1.dll')
+ dllsources.append('${LCGDIR}/binaries/libstdc++-6.dll')
dllsources.append('#source/icons/blender.exe.manifest')
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
diff --git a/build_files/scons/config/win64-mingw-config.py b/build_files/scons/config/win64-mingw-config.py
index 2649c5505d5..27286439297 100644
--- a/build_files/scons/config/win64-mingw-config.py
+++ b/build_files/scons/config/win64-mingw-config.py
@@ -169,8 +169,8 @@ BF_BOOST_LIBPATH = BF_BOOST + '/lib'
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
-#Produces errors while rendering with subsurf/multires,
-WITH_BF_OPENMP = False
+#May produce errors with unsupported MinGW-w64 builds
+WITH_BF_OPENMP = True
##
CC = 'gcc'
diff --git a/doc/build_systems/scons-dev.txt b/doc/build_systems/scons-dev.txt
index b7cac8109d4..ae2be2b2a94 100644
--- a/doc/build_systems/scons-dev.txt
+++ b/doc/build_systems/scons-dev.txt
@@ -37,7 +37,7 @@
Much of the actual functionality can be found in the python scripts
in the directory $BLENDERHOME/tools, with Blender.py defining the
bulk of the functionality. btools.py has some helper functions, and
- bcolors.py is for the terminal colours. mstoolkit.py and crossmingw.py
+ bcolors.py is for the terminal colors. mstoolkit.py and crossmingw.py
are modules which set up SCons for the MS VC++ 2003 toolkit and
the cross-compile toolset for compiling Windows binaries on Linux
respectively. Note: the cross-compile doesn't work yet for Blender,
diff --git a/doc/build_systems/scons.txt b/doc/build_systems/scons.txt
index d6ead8d32ae..cb88c56ddbc 100644
--- a/doc/build_systems/scons.txt
+++ b/doc/build_systems/scons.txt
@@ -48,7 +48,7 @@
% python ./scons/scons.py
This will start the build process with default values. Depending
- on your platform you may see colour in your output (non-Windows
+ on your platform you may see color in your output (non-Windows
machines). In the the beginning an overview of targets and arguments
from the command-line is given, then all libraries and binaries to
build are configured.
@@ -123,11 +123,11 @@
This rewrite features a cleaner output during the build process. If
you need to see the full command-line for compiles, then you can
- change that behaviour. Also the use of colours can be changed:
+ change that behaviour. Also the use of colors can be changed:
% python scons\scons.py BF_FANCY=0
- This will disable the use of colours.
+ This will disable the use of colors.
% python scons\scons.py BF_QUIET=0
diff --git a/doc/guides/interface_API.txt b/doc/guides/interface_API.txt
index c98794444e6..5f601dd3ebc 100644
--- a/doc/guides/interface_API.txt
+++ b/doc/guides/interface_API.txt
@@ -173,7 +173,7 @@ drawtype:
UI_EMBOSSN 2 /* Button with no border */
UI_EMBOSSF 3 /* Square embossed button (file select) */
UI_EMBOSSM 4 /* Colored, for pulldown menus */
- UI_EMBOSSP 5 /* Simple borderless coloured button (like blender sensors) */
+ UI_EMBOSSP 5 /* Simple borderless colored button (like blender sensors) */
font:
UI_HELV 0 /* normal font */
diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst
index a253b6df26f..d07d7a8734f 100644
--- a/doc/python_api/rst/bge.render.rst
+++ b/doc/python_api/rst/bge.render.rst
@@ -94,11 +94,11 @@ Functions
If filename starts with // the image will be saved relative to the current directory.
If the filename contains # it will be replaced with the frame number.
- The standalone player saves .png files. It does not support colour space conversion
+ The standalone player saves .png files. It does not support color space conversion
or gamma correction.
When run from Blender, makeScreenshot supports Iris, IrisZ, TGA, Raw TGA, PNG, HamX, and Jpeg.
- Gamma, Colourspace conversion and Jpeg compression are taken from the Render settings panels.
+ Gamma, Colorspace conversion and Jpeg compression are taken from the Render settings panels.
:type filename: string
@@ -125,14 +125,14 @@ Functions
.. function:: setBackgroundColor(rgba)
- Sets the window background colour.
+ Sets the window background color.
:type rgba: list [r, g, b, a]
.. function:: setMistColor(rgb)
- Sets the mist colour.
+ Sets the mist color.
:type rgb: list [r, g, b]
@@ -153,8 +153,8 @@ Functions
.. function:: setMistEnd(end)
- Sets the mist end value. Objects further away from this will be coloured solid with
- the colour set by setMistColor().
+ Sets the mist end value. Objects further away from this will be colored solid with
+ the color set by setMistColor().
:type end: float
diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst
index f7bdb06e58c..d0a848ee6f7 100644
--- a/doc/python_api/rst/bge.types.rst
+++ b/doc/python_api/rst/bge.types.rst
@@ -1683,7 +1683,7 @@ Game Types (bge.types)
light = co.owner
light.energy = 1.0
- light.colour = [1.0, 0.0, 0.0]
+ light.color = [1.0, 0.0, 0.0]
.. data:: SPOT
@@ -1719,15 +1719,15 @@ Game Types (bge.types)
:type: float
- .. attribute:: colour
+ .. attribute:: color
- The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
+ The color of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
:type: list [r, g, b]
- .. attribute:: color
+ .. attribute:: colour
- Synonym for colour.
+ Synonym for color.
.. attribute:: lin_attenuation
@@ -1782,7 +1782,7 @@ Game Types (bge.types)
#. They are at the same position
#. UV coordinates are the same
#. Their normals are the same (both polygons are "Set Smooth")
- #. They are the same colour, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
+ #. They are the same color, for example: a cube has 24 vertices: 6 faces with 4 vertices per face.
The correct method of iterating over every :class:`KX_VertexProxy` in a game object
@@ -1798,8 +1798,8 @@ Game Types (bge.types)
for v_index in range(mesh.getVertexArrayLength(m_index)):
vertex = mesh.getVertex(m_index, v_index)
# Do something with vertex here...
- # ... eg: colour the vertex red.
- vertex.colour = [1.0, 0.0, 0.0, 1.0]
+ # ... eg: color the vertex red.
+ vertex.color = [1.0, 0.0, 0.0, 1.0]
.. attribute:: materials
@@ -2538,13 +2538,13 @@ Game Types (bge.types)
.. attribute:: diffuse
- The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+ The diffuse color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
:type: list [r, g, b]
.. attribute:: specular
- The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
+ The specular color of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0].
:type: list [r, g, b]
@@ -3381,7 +3381,7 @@ Game Types (bge.types)
.. class:: KX_VertexProxy(SCA_IObject)
- A vertex holds position, UV, colour and normal information.
+ A vertex holds position, UV, color and normal information.
Note:
The physics simulation is NOT currently updated - physics will not respond
@@ -3405,17 +3405,17 @@ Game Types (bge.types)
:type: list [nx, ny, nz]
- .. attribute:: colour
+ .. attribute:: color
- The colour of the vertex.
+ The color of the vertex.
:type: list [r, g, b, a]
Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
- .. attribute:: color
+ .. attribute:: colour
- Synonym for colour.
+ Synonym for color.
.. attribute:: x
@@ -3461,25 +3461,25 @@ Game Types (bge.types)
.. attribute:: r
- The red component of the vertex colour. 0.0 <= r <= 1.0.
+ The red component of the vertex color. 0.0 <= r <= 1.0.
:type: float
.. attribute:: g
- The green component of the vertex colour. 0.0 <= g <= 1.0.
+ The green component of the vertex color. 0.0 <= g <= 1.0.
:type: float
.. attribute:: b
- The blue component of the vertex colour. 0.0 <= b <= 1.0.
+ The blue component of the vertex color. 0.0 <= b <= 1.0.
:type: float
.. attribute:: a
- The alpha component of the vertex colour. 0.0 <= a <= 1.0.
+ The alpha component of the vertex color. 0.0 <= a <= 1.0.
:type: float
@@ -3529,15 +3529,15 @@ Game Types (bge.types)
.. method:: getRGBA()
- Gets the colour of this vertex.
+ Gets the color of this vertex.
- The colour is represented as four bytes packed into an integer value. The colour is
+ The color is represented as four bytes packed into an integer value. The color is
packed as RGBA.
Since Python offers no way to get each byte without shifting, you must use the struct module to
- access colour in an machine independent way.
+ access color in an machine independent way.
- Because of this, it is suggested you use the r, g, b and a attributes or the colour attribute instead.
+ Because of this, it is suggested you use the r, g, b and a attributes or the color attribute instead.
.. code-block:: python
@@ -3547,17 +3547,17 @@ Game Types (bge.types)
# black = ( 0, 0, 0, 255)
# white = (255, 255, 255, 255)
- :return: packed colour. 4 byte integer with one byte per colour channel in RGBA format.
+ :return: packed color. 4 byte integer with one byte per color channel in RGBA format.
:rtype: integer
.. method:: setRGBA(col)
- Sets the colour of this vertex.
+ Sets the color of this vertex.
See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes
- or the colour attribute instead.
+ or the color attribute instead.
- setRGBA() also accepts a four component list as argument col. The list represents the colour as [r, g, b, a]
+ setRGBA() also accepts a four component list as argument col. The list represents the color as [r, g, b, a]
with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0]
.. code-block:: python
@@ -3567,14 +3567,14 @@ Game Types (bge.types)
v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red
v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms.
- :arg col: the new colour of this vertex in packed RGBA format.
+ :arg col: the new color of this vertex in packed RGBA format.
:type col: integer or list [r, g, b, a]
.. method:: getNormal()
Gets the normal vector of this vertex.
- :return: normalised normal vector.
+ :return: normalized normal vector.
:rtype: list [nx, ny, nz]
.. method:: setNormal(normal)
diff --git a/extern/carve/include/carve/csg.hpp b/extern/carve/include/carve/csg.hpp
index db32273a33c..b098cd86cef 100644
--- a/extern/carve/include/carve/csg.hpp
+++ b/extern/carve/include/carve/csg.hpp
@@ -174,34 +174,34 @@ namespace carve {
void groupIntersections();
- void _generateVertexVertexIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
- carve::mesh::MeshSet<3>::edge_t *eb);
- void generateVertexVertexIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
-
- void _generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
- carve::mesh::MeshSet<3>::edge_t *eb);
- void generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
-
- void _generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::edge_t *ea,
- carve::mesh::MeshSet<3>::edge_t *eb);
- void generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
-
- void _generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
- carve::mesh::MeshSet<3>::edge_t *eb);
- void generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
-
- void _generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
- carve::mesh::MeshSet<3>::edge_t *eb);
- void generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b);
-
- void generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
+ void _generateVertexVertexIntersections(meshset_t::vertex_t *va,
+ meshset_t::edge_t *eb);
+ void generateVertexVertexIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b);
+
+ void _generateVertexEdgeIntersections(meshset_t::vertex_t *va,
+ meshset_t::edge_t *eb);
+ void generateVertexEdgeIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b);
+
+ void _generateEdgeEdgeIntersections(meshset_t::edge_t *ea,
+ meshset_t::edge_t *eb);
+ void generateEdgeEdgeIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b);
+
+ void _generateVertexFaceIntersections(meshset_t::face_t *fa,
+ meshset_t::edge_t *eb);
+ void generateVertexFaceIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b);
+
+ void _generateEdgeFaceIntersections(meshset_t::face_t *fa,
+ meshset_t::edge_t *eb);
+ void generateEdgeFaceIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b);
+
+ void generateIntersectionCandidates(meshset_t *a,
const face_rtree_t *a_node,
- carve::mesh::MeshSet<3> *b,
+ meshset_t *b,
const face_rtree_t *b_node,
face_pairs_t &face_pairs,
bool descend_a = true);
@@ -287,7 +287,7 @@ namespace carve {
* @param[out] out_loops A list of grouped face loops.
*/
void groupFaceLoops(
- carve::mesh::MeshSet<3> *src,
+ meshset_t *src,
FaceLoopList &face_loops,
const detail::LoopEdges &loop_edges,
const V2Set &no_cross,
diff --git a/extern/carve/include/carve/polyline_decl.hpp b/extern/carve/include/carve/polyline_decl.hpp
index a29c56656ff..5934dd25a34 100644
--- a/extern/carve/include/carve/polyline_decl.hpp
+++ b/extern/carve/include/carve/polyline_decl.hpp
@@ -138,6 +138,11 @@ namespace carve {
PolylineSet(const std::vector<carve::geom3d::Vector> &points);
PolylineSet() {
}
+ ~PolylineSet() {
+ for (line_iter i = lines.begin(); i != lines.end(); ++i) {
+ delete *i;
+ }
+ }
template<typename iter_t>
void addPolyline(bool closed, iter_t begin, iter_t end);
diff --git a/extern/carve/include/carve/rtree.hpp b/extern/carve/include/carve/rtree.hpp
index 77f93c14e08..65d46e5a48d 100644
--- a/extern/carve/include/carve/rtree.hpp
+++ b/extern/carve/include/carve/rtree.hpp
@@ -49,8 +49,6 @@ namespace carve {
aabb_t getAABB() const { return bbox; }
-
-
struct data_aabb_t {
aabb_t bbox;
data_t data;
@@ -164,6 +162,17 @@ namespace carve {
_fill(begin, end, typename std::iterator_traits<iter_t>::value_type());
}
+ ~RTreeNode() {
+ if (child) {
+ RTreeNode *next = child;
+ while (next) {
+ RTreeNode *curr = next;
+ next = next->sibling;
+ delete curr;
+ }
+ }
+ }
+
// functor for ordering nodes by increasing aabb midpoint, along a specified axis.
diff --git a/extern/carve/lib/csg_data.hpp b/extern/carve/lib/csg_data.hpp
index 085d05ce8d5..e4a20825e79 100644
--- a/extern/carve/lib/csg_data.hpp
+++ b/extern/carve/lib/csg_data.hpp
@@ -30,7 +30,7 @@ struct carve::csg::detail::Data {
VVMap vmap;
// map from intersected edge to intersection points.
- EVSMap emap;
+ EIntMap emap;
// map from intersected face to intersection points.
FVSMap fmap;
@@ -39,7 +39,7 @@ struct carve::csg::detail::Data {
VFSMap fmap_rev;
// created by divideEdges().
- // holds, for each edge, a
+ // holds, for each edge, an ordered vector of inserted vertices.
EVVMap divided_edges;
// created by faceSplitEdges.
diff --git a/extern/carve/lib/csg_detail.hpp b/extern/carve/lib/csg_detail.hpp
index 4b8fca3d2d2..e5947e776b5 100644
--- a/extern/carve/lib/csg_detail.hpp
+++ b/extern/carve/lib/csg_detail.hpp
@@ -24,30 +24,32 @@
namespace carve {
namespace csg {
namespace detail {
+ typedef std::map<carve::mesh::MeshSet<3>::vertex_t *,
+ std::set<std::pair<carve::mesh::MeshSet<3>::face_t *, double> > > EdgeIntInfo;
- typedef std::unordered_set<carve::mesh::MeshSet<3>::vertex_t *> VSet;
- typedef std::unordered_set<carve::mesh::MeshSet<3>::face_t *> FSet;
+ typedef std::unordered_set<carve::mesh::MeshSet<3>::vertex_t *> VSet;
+ typedef std::unordered_set<carve::mesh::MeshSet<3>::face_t *> FSet;
- typedef std::set<carve::mesh::MeshSet<3>::vertex_t *> VSetSmall;
- typedef std::set<csg::V2> V2SetSmall;
- typedef std::set<carve::mesh::MeshSet<3>::face_t *> FSetSmall;
+ typedef std::set<carve::mesh::MeshSet<3>::vertex_t *> VSetSmall;
+ typedef std::set<csg::V2> V2SetSmall;
+ typedef std::set<carve::mesh::MeshSet<3>::face_t *> FSetSmall;
- typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, VSetSmall> VVSMap;
- typedef std::unordered_map<carve::mesh::MeshSet<3>::edge_t *, VSetSmall> EVSMap;
- typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, VSetSmall> FVSMap;
+ typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, VSetSmall> VVSMap;
+ typedef std::unordered_map<carve::mesh::MeshSet<3>::edge_t *, EdgeIntInfo> EIntMap;
+ typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, VSetSmall> FVSMap;
- typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, FSetSmall> VFSMap;
- typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, V2SetSmall> FV2SMap;
+ typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *, FSetSmall> VFSMap;
+ typedef std::unordered_map<carve::mesh::MeshSet<3>::face_t *, V2SetSmall> FV2SMap;
- typedef std::unordered_map<
- carve::mesh::MeshSet<3>::edge_t *,
- std::vector<carve::mesh::MeshSet<3>::vertex_t *> > EVVMap;
+ typedef std::unordered_map<
+ carve::mesh::MeshSet<3>::edge_t *,
+ std::vector<carve::mesh::MeshSet<3>::vertex_t *> > EVVMap;
typedef std::unordered_map<carve::mesh::MeshSet<3>::vertex_t *,
std::vector<carve::mesh::MeshSet<3>::edge_t *> > VEVecMap;
- class LoopEdges : public std::unordered_map<V2, std::list<FaceLoop *> > {
+ class LoopEdges : public std::unordered_map<V2, std::list<FaceLoop *> > {
typedef std::unordered_map<V2, std::list<FaceLoop *> > super;
public:
diff --git a/extern/carve/lib/intersect.cpp b/extern/carve/lib/intersect.cpp
index 2063164de08..b92dbcfe24c 100644
--- a/extern/carve/lib/intersect.cpp
+++ b/extern/carve/lib/intersect.cpp
@@ -41,6 +41,7 @@
#include <carve/timing.hpp>
#include <carve/colour.hpp>
+#include <memory>
@@ -114,7 +115,7 @@ namespace {
ordered_vertices.reserve(std::distance(beg, end));
for (; beg != end; ++beg) {
- carve::mesh::MeshSet<3>::vertex_t *v = (*beg);
+ carve::mesh::MeshSet<3>::vertex_t *v = *beg;
ordered_vertices.push_back(std::make_pair(carve::geom::dot(v->v - base, dir), v));
}
@@ -130,6 +131,37 @@ namespace {
}
}
+ template<typename iter_t>
+ void orderEdgeIntersectionVertices(iter_t beg, const iter_t end,
+ const carve::mesh::MeshSet<3>::vertex_t::vector_t &dir,
+ const carve::mesh::MeshSet<3>::vertex_t::vector_t &base,
+ std::vector<carve::mesh::MeshSet<3>::vertex_t *> &out) {
+ typedef std::vector<std::pair<std::pair<double, double>, carve::mesh::MeshSet<3>::vertex_t *> > DVVector;
+ DVVector ordered_vertices;
+
+ ordered_vertices.reserve(std::distance(beg, end));
+
+ for (; beg != end; ++beg) {
+ carve::mesh::MeshSet<3>::vertex_t *v = (*beg).first;
+ double ovec = 0.0;
+ for (carve::csg::detail::EdgeIntInfo::mapped_type::const_iterator j = (*beg).second.begin(); j != (*beg).second.end(); ++j) {
+ ovec += (*j).second;
+ }
+ ordered_vertices.push_back(std::make_pair(std::make_pair(carve::geom::dot(v->v - base, dir), -ovec), v));
+ }
+
+ std::sort(ordered_vertices.begin(), ordered_vertices.end());
+
+ out.clear();
+ out.reserve(ordered_vertices.size());
+ for (DVVector::const_iterator
+ i = ordered_vertices.begin(), e = ordered_vertices.end();
+ i != e;
+ ++i) {
+ out.push_back((*i).second);
+ }
+ }
+
/**
@@ -346,7 +378,7 @@ bool carve::csg::CSG::Hooks::hasHook(unsigned hook_num) {
return hooks[hook_num].size() > 0;
}
-void carve::csg::CSG::Hooks::intersectionVertex(const carve::mesh::MeshSet<3>::vertex_t *vertex,
+void carve::csg::CSG::Hooks::intersectionVertex(const meshset_t::vertex_t *vertex,
const IObjPairSet &intersections) {
for (std::list<Hook *>::iterator j = hooks[INTERSECTION_VERTEX_HOOK].begin();
j != hooks[INTERSECTION_VERTEX_HOOK].end();
@@ -355,8 +387,8 @@ void carve::csg::CSG::Hooks::intersectionVertex(const carve::mesh::MeshSet<3>::v
}
}
-void carve::csg::CSG::Hooks::processOutputFace(std::vector<carve::mesh::MeshSet<3>::face_t *> &faces,
- const carve::mesh::MeshSet<3>::face_t *orig_face,
+void carve::csg::CSG::Hooks::processOutputFace(std::vector<meshset_t::face_t *> &faces,
+ const meshset_t::face_t *orig_face,
bool flipped) {
for (std::list<Hook *>::iterator j = hooks[PROCESS_OUTPUT_FACE_HOOK].begin();
j != hooks[PROCESS_OUTPUT_FACE_HOOK].end();
@@ -365,8 +397,8 @@ void carve::csg::CSG::Hooks::processOutputFace(std::vector<carve::mesh::MeshSet<
}
}
-void carve::csg::CSG::Hooks::resultFace(const carve::mesh::MeshSet<3>::face_t *new_face,
- const carve::mesh::MeshSet<3>::face_t *orig_face,
+void carve::csg::CSG::Hooks::resultFace(const meshset_t::face_t *new_face,
+ const meshset_t::face_t *orig_face,
bool flipped) {
for (std::list<Hook *>::iterator j = hooks[RESULT_FACE_HOOK].begin();
j != hooks[RESULT_FACE_HOOK].end();
@@ -425,7 +457,7 @@ void carve::csg::CSG::makeVertexIntersections() {
j != je;
++j) {
const IObj &i_tgt = ((*j).first);
- carve::mesh::MeshSet<3>::vertex_t *i_pt = ((*j).second);
+ meshset_t::vertex_t *i_pt = ((*j).second);
vertex_intersections[i_pt].insert(std::make_pair(i_src, i_tgt));
}
@@ -499,7 +531,7 @@ void carve::csg::CSG::groupIntersections() {
carve::TimingBlock block(GROUP_INTERSECTONS);
- std::vector<carve::mesh::MeshSet<3>::vertex_t *> vertices;
+ std::vector<meshset_t::vertex_t *> vertices;
detail::VVSMap graph;
#if defined(CARVE_DEBUG)
std::cerr << "groupIntersections()" << ": vertex_intersections.size()==" << vertex_intersections.size() << std::endl;
@@ -521,7 +553,7 @@ void carve::csg::CSG::groupIntersections() {
vertex_intersections_octree.addVertices(vertices);
- std::vector<carve::mesh::MeshSet<3>::vertex_t *> out;
+ std::vector<meshset_t::vertex_t *> out;
for (size_t i = 0, l = vertices.size(); i != l; ++i) {
// let's find all the vertices near this one.
out.clear();
@@ -546,7 +578,7 @@ void carve::csg::CSG::groupIntersections() {
open.insert((*i).first);
while (open.size()) {
detail::VSet::iterator t = open.begin();
- const carve::mesh::MeshSet<3>::vertex_t *o = (*t);
+ const meshset_t::vertex_t *o = (*t);
open.erase(t);
i = graph.find(o);
CARVE_ASSERT(i != graph.end());
@@ -568,6 +600,19 @@ void carve::csg::CSG::groupIntersections() {
}
+static void recordEdgeIntersectionInfo(carve::mesh::MeshSet<3>::vertex_t *intersection,
+ carve::mesh::MeshSet<3>::edge_t *edge,
+ const carve::csg::detail::VFSMap::mapped_type &intersected_faces,
+ carve::csg::detail::Data &data) {
+ carve::mesh::MeshSet<3>::vertex_t::vector_t edge_dir = edge->v2()->v - edge->v1()->v;
+ carve::csg::detail::EdgeIntInfo::mapped_type &eint_info = data.emap[edge][intersection];
+
+ for (carve::csg::detail::VFSMap::mapped_type::const_iterator i = intersected_faces.begin(); i != intersected_faces.end(); ++i) {
+ carve::mesh::MeshSet<3>::vertex_t::vector_t normal = (*i)->plane.N;
+ eint_info.insert(std::make_pair((*i), carve::geom::dot(edge_dir, normal)));
+ }
+}
+
void carve::csg::CSG::intersectingFacePairs(detail::Data &data) {
static carve::TimingName FUNC_NAME("CSG::intersectingFacePairs()");
@@ -575,30 +620,36 @@ void carve::csg::CSG::intersectingFacePairs(detail::Data &data) {
// iterate over all intersection points.
for (VertexIntersections::const_iterator i = vertex_intersections.begin(), ie = vertex_intersections.end(); i != ie; ++i) {
- carve::mesh::MeshSet<3>::vertex_t *i_pt = ((*i).first);
+ meshset_t::vertex_t *i_pt = ((*i).first);
detail::VFSMap::mapped_type &face_set = (data.fmap_rev[i_pt]);
-
+ detail::VFSMap::mapped_type src_face_set;
+ detail::VFSMap::mapped_type tgt_face_set;
// for all pairs of intersecting objects at this point
for (VertexIntersections::data_type::const_iterator j = (*i).second.begin(), je = (*i).second.end(); j != je; ++j) {
const IObj &i_src = ((*j).first);
const IObj &i_tgt = ((*j).second);
- // work out the faces involved. this updates fmap_rev.
- facesForObject(i_src, data.vert_to_edges, face_set);
- facesForObject(i_tgt, data.vert_to_edges, face_set);
+ src_face_set.clear();
+ tgt_face_set.clear();
+ // work out the faces involved.
+ facesForObject(i_src, data.vert_to_edges, src_face_set);
+ facesForObject(i_tgt, data.vert_to_edges, tgt_face_set);
+ // this updates fmap_rev.
+ std::copy(src_face_set.begin(), src_face_set.end(), set_inserter(face_set));
+ std::copy(tgt_face_set.begin(), tgt_face_set.end(), set_inserter(face_set));
// record the intersection with respect to any involved vertex.
if (i_src.obtype == IObj::OBTYPE_VERTEX) data.vmap[i_src.vertex] = i_pt;
if (i_tgt.obtype == IObj::OBTYPE_VERTEX) data.vmap[i_tgt.vertex] = i_pt;
// record the intersection with respect to any involved edge.
- if (i_src.obtype == IObj::OBTYPE_EDGE) data.emap[i_src.edge].insert(i_pt);
- if (i_tgt.obtype == IObj::OBTYPE_EDGE) data.emap[i_tgt.edge].insert(i_pt);
+ if (i_src.obtype == IObj::OBTYPE_EDGE) recordEdgeIntersectionInfo(i_pt, i_src.edge, tgt_face_set, data);
+ if (i_tgt.obtype == IObj::OBTYPE_EDGE) recordEdgeIntersectionInfo(i_pt, i_tgt.edge, src_face_set, data);
}
// record the intersection with respect to each face.
for (carve::csg::detail::VFSMap::mapped_type::const_iterator k = face_set.begin(), ke = face_set.end(); k != ke; ++k) {
- carve::mesh::MeshSet<3>::face_t *f = (*k);
+ meshset_t::face_t *f = (*k);
data.fmap[f].insert(i_pt);
}
}
@@ -606,8 +657,8 @@ void carve::csg::CSG::intersectingFacePairs(detail::Data &data) {
-void carve::csg::CSG::_generateVertexVertexIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
- carve::mesh::MeshSet<3>::edge_t *eb) {
+void carve::csg::CSG::_generateVertexVertexIntersections(meshset_t::vertex_t *va,
+ meshset_t::edge_t *eb) {
if (intersections.intersects(va, eb->v1())) {
return;
}
@@ -621,14 +672,14 @@ void carve::csg::CSG::_generateVertexVertexIntersections(carve::mesh::MeshSet<3>
-void carve::csg::CSG::generateVertexVertexIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
- carve::mesh::MeshSet<3>::edge_t *ea, *eb;
+void carve::csg::CSG::generateVertexVertexIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b) {
+ meshset_t::edge_t *ea, *eb;
ea = a->edge;
do {
for (size_t i = 0; i < b.size(); ++i) {
- carve::mesh::MeshSet<3>::face_t *t = b[i];
+ meshset_t::face_t *t = b[i];
eb = t->edge;
do {
_generateVertexVertexIntersections(ea->v1(), eb);
@@ -641,8 +692,8 @@ void carve::csg::CSG::generateVertexVertexIntersections(carve::mesh::MeshSet<3>:
-void carve::csg::CSG::_generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::vertex_t *va,
- carve::mesh::MeshSet<3>::edge_t *eb) {
+void carve::csg::CSG::_generateVertexEdgeIntersections(meshset_t::vertex_t *va,
+ meshset_t::edge_t *eb) {
if (intersections.intersects(va, eb)) {
return;
}
@@ -665,14 +716,14 @@ void carve::csg::CSG::_generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::
-void carve::csg::CSG::generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
- carve::mesh::MeshSet<3>::edge_t *ea, *eb;
+void carve::csg::CSG::generateVertexEdgeIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b) {
+ meshset_t::edge_t *ea, *eb;
ea = a->edge;
do {
for (size_t i = 0; i < b.size(); ++i) {
- carve::mesh::MeshSet<3>::face_t *t = b[i];
+ meshset_t::face_t *t = b[i];
eb = t->edge;
do {
_generateVertexEdgeIntersections(ea->v1(), eb);
@@ -685,21 +736,21 @@ void carve::csg::CSG::generateVertexEdgeIntersections(carve::mesh::MeshSet<3>::f
-void carve::csg::CSG::_generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::edge_t *ea,
- carve::mesh::MeshSet<3>::edge_t *eb) {
+void carve::csg::CSG::_generateEdgeEdgeIntersections(meshset_t::edge_t *ea,
+ meshset_t::edge_t *eb) {
if (intersections.intersects(ea, eb)) {
return;
}
- carve::mesh::MeshSet<3>::vertex_t *v1 = ea->v1(), *v2 = ea->v2();
- carve::mesh::MeshSet<3>::vertex_t *v3 = eb->v1(), *v4 = eb->v2();
+ meshset_t::vertex_t *v1 = ea->v1(), *v2 = ea->v2();
+ meshset_t::vertex_t *v3 = eb->v1(), *v4 = eb->v2();
carve::geom::aabb<3> ea_aabb, eb_aabb;
ea_aabb.fit(v1->v, v2->v);
eb_aabb.fit(v3->v, v4->v);
if (ea_aabb.maxAxisSeparation(eb_aabb) > EPSILON) return;
- carve::mesh::MeshSet<3>::vertex_t::vector_t p1, p2;
+ meshset_t::vertex_t::vector_t p1, p2;
double mu1, mu2;
switch (carve::geom3d::rayRayIntersection(carve::geom3d::Ray(v2->v - v1->v, v1->v),
@@ -708,7 +759,7 @@ void carve::csg::CSG::_generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::ed
case carve::RR_INTERSECTION: {
// edges intersect
if (mu1 >= 0.0 && mu1 <= 1.0 && mu2 >= 0.0 && mu2 <= 1.0) {
- carve::mesh::MeshSet<3>::vertex_t *p = vertex_pool.get((p1 + p2) / 2.0);
+ meshset_t::vertex_t *p = vertex_pool.get((p1 + p2) / 2.0);
intersections.record(ea, eb, p);
if (ea->rev) intersections.record(ea->rev, eb, p);
if (eb->rev) intersections.record(ea, eb->rev, p);
@@ -733,14 +784,14 @@ void carve::csg::CSG::_generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::ed
-void carve::csg::CSG::generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
- carve::mesh::MeshSet<3>::edge_t *ea, *eb;
+void carve::csg::CSG::generateEdgeEdgeIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b) {
+ meshset_t::edge_t *ea, *eb;
ea = a->edge;
do {
for (size_t i = 0; i < b.size(); ++i) {
- carve::mesh::MeshSet<3>::face_t *t = b[i];
+ meshset_t::face_t *t = b[i];
eb = t->edge;
do {
_generateEdgeEdgeIntersections(ea, eb);
@@ -753,8 +804,8 @@ void carve::csg::CSG::generateEdgeEdgeIntersections(carve::mesh::MeshSet<3>::fac
-void carve::csg::CSG::_generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
- carve::mesh::MeshSet<3>::edge_t *eb) {
+void carve::csg::CSG::_generateVertexFaceIntersections(meshset_t::face_t *fa,
+ meshset_t::edge_t *eb) {
if (intersections.intersects(eb->v1(), fa)) {
return;
}
@@ -769,12 +820,12 @@ void carve::csg::CSG::_generateVertexFaceIntersections(carve::mesh::MeshSet<3>::
-void carve::csg::CSG::generateVertexFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
- carve::mesh::MeshSet<3>::edge_t *ea, *eb;
+void carve::csg::CSG::generateVertexFaceIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b) {
+ meshset_t::edge_t *eb;
for (size_t i = 0; i < b.size(); ++i) {
- carve::mesh::MeshSet<3>::face_t *t = b[i];
+ meshset_t::face_t *t = b[i];
eb = t->edge;
do {
_generateVertexFaceIntersections(a, eb);
@@ -785,15 +836,15 @@ void carve::csg::CSG::generateVertexFaceIntersections(carve::mesh::MeshSet<3>::f
-void carve::csg::CSG::_generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *fa,
- carve::mesh::MeshSet<3>::edge_t *eb) {
+void carve::csg::CSG::_generateEdgeFaceIntersections(meshset_t::face_t *fa,
+ meshset_t::edge_t *eb) {
if (intersections.intersects(eb, fa)) {
return;
}
- carve::mesh::MeshSet<3>::vertex_t::vector_t _p;
+ meshset_t::vertex_t::vector_t _p;
if (fa->simpleLineSegmentIntersection(carve::geom3d::LineSegment(eb->v1()->v, eb->v2()->v), _p)) {
- carve::mesh::MeshSet<3>::vertex_t *p = vertex_pool.get(_p);
+ meshset_t::vertex_t *p = vertex_pool.get(_p);
intersections.record(eb, fa, p);
if (eb->rev) intersections.record(eb->rev, fa, p);
}
@@ -801,12 +852,12 @@ void carve::csg::CSG::_generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::fa
-void carve::csg::CSG::generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::face_t *a,
- const std::vector<carve::mesh::MeshSet<3>::face_t *> &b) {
- carve::mesh::MeshSet<3>::edge_t *ea, *eb;
+void carve::csg::CSG::generateEdgeFaceIntersections(meshset_t::face_t *a,
+ const std::vector<meshset_t::face_t *> &b) {
+ meshset_t::edge_t *eb;
for (size_t i = 0; i < b.size(); ++i) {
- carve::mesh::MeshSet<3>::face_t *t = b[i];
+ meshset_t::face_t *t = b[i];
eb = t->edge;
do {
_generateEdgeFaceIntersections(a, eb);
@@ -817,9 +868,9 @@ void carve::csg::CSG::generateEdgeFaceIntersections(carve::mesh::MeshSet<3>::fac
-void carve::csg::CSG::generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
+void carve::csg::CSG::generateIntersectionCandidates(meshset_t *a,
const face_rtree_t *a_node,
- carve::mesh::MeshSet<3> *b,
+ meshset_t *b,
const face_rtree_t *b_node,
face_pairs_t &face_pairs,
bool descend_a) {
@@ -837,12 +888,12 @@ void carve::csg::CSG::generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
}
} else {
for (size_t i = 0; i < a_node->data.size(); ++i) {
- carve::mesh::MeshSet<3>::face_t *fa = a_node->data[i];
+ meshset_t::face_t *fa = a_node->data[i];
carve::geom::aabb<3> aabb_a = fa->getAABB();
if (aabb_a.maxAxisSeparation(b_node->bbox) > carve::EPSILON) continue;
for (size_t j = 0; j < b_node->data.size(); ++j) {
- carve::mesh::MeshSet<3>::face_t *fb = b_node->data[j];
+ meshset_t::face_t *fb = b_node->data[j];
carve::geom::aabb<3> aabb_b = fb->getAABB();
if (aabb_b.maxAxisSeparation(aabb_a) > carve::EPSILON) continue;
@@ -866,17 +917,17 @@ void carve::csg::CSG::generateIntersectionCandidates(carve::mesh::MeshSet<3> *a,
-void carve::csg::CSG::generateIntersections(carve::mesh::MeshSet<3> *a,
+void carve::csg::CSG::generateIntersections(meshset_t *a,
const face_rtree_t *a_rtree,
- carve::mesh::MeshSet<3> *b,
+ meshset_t *b,
const face_rtree_t *b_rtree,
detail::Data &data) {
face_pairs_t face_pairs;
generateIntersectionCandidates(a, a_rtree, b, b_rtree, face_pairs);
for (face_pairs_t::const_iterator i = face_pairs.begin(); i != face_pairs.end(); ++i) {
- carve::mesh::MeshSet<3>::face_t *f = (*i).first;
- carve::mesh::MeshSet<3>::edge_t *e = f->edge;
+ meshset_t::face_t *f = (*i).first;
+ meshset_t::edge_t *e = f->edge;
do {
data.vert_to_edges[e->v1()].push_back(e);
e = e->next;
@@ -958,13 +1009,13 @@ void carve::csg::CSG::divideIntersectedEdges(detail::Data &data) {
static carve::TimingName FUNC_NAME("CSG::divideIntersectedEdges()");
carve::TimingBlock block(FUNC_NAME);
- for (detail::EVSMap::const_iterator i = data.emap.begin(), ei = data.emap.end(); i != ei; ++i) {
- carve::mesh::MeshSet<3>::edge_t *edge = (*i).first;
- const detail::EVSMap::mapped_type &vertices = (*i).second;
- std::vector<carve::mesh::MeshSet<3>::vertex_t *> &verts = data.divided_edges[edge];
- orderVertices(vertices.begin(), vertices.end(),
- edge->v2()->v - edge->v1()->v, edge->v1()->v,
- verts);
+ for (detail::EIntMap::const_iterator i = data.emap.begin(), ei = data.emap.end(); i != ei; ++i) {
+ meshset_t::edge_t *edge = (*i).first;
+ const detail::EIntMap::mapped_type &int_info = (*i).second;
+ std::vector<meshset_t::vertex_t *> &verts = data.divided_edges[edge];
+ orderEdgeIntersectionVertices(int_info.begin(), int_info.end(),
+ edge->v2()->v - edge->v1()->v, edge->v1()->v,
+ verts);
}
}
@@ -982,7 +1033,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
i = data.fmap.begin(), ie = data.fmap.end();
i != ie;
++i) {
- carve::mesh::MeshSet<3>::face_t *face_a = (*i).first;
+ meshset_t::face_t *face_a = (*i).first;
const detail::FVSMap::mapped_type &face_a_intersections = ((*i).second);
face_b_set.clear();
@@ -995,7 +1046,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
k = data.fmap_rev[*j].begin(), ke = data.fmap_rev[*j].end();
k != ke;
++k) {
- carve::mesh::MeshSet<3>::face_t *face_b = (*k);
+ meshset_t::face_t *face_b = (*k);
if (face_a != face_b && face_b->mesh->meshset != face_a->mesh->meshset) {
face_b_set.insert(face_b);
}
@@ -1007,10 +1058,10 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
j = face_b_set.begin(), je = face_b_set.end();
j != je;
++j) {
- carve::mesh::MeshSet<3>::face_t *face_b = (*j);
+ meshset_t::face_t *face_b = (*j);
const detail::FVSMap::mapped_type &face_b_intersections = (data.fmap[face_b]);
- std::vector<carve::mesh::MeshSet<3>::vertex_t *> vertices;
+ std::vector<meshset_t::vertex_t *> vertices;
vertices.reserve(std::min(face_a_intersections.size(), face_b_intersections.size()));
// record the points of intersection between face_a and face_b
@@ -1024,7 +1075,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
std::cerr << "face pair: "
<< face_a << ":" << face_b
<< " N(verts) " << vertices.size() << std::endl;
- for (std::vector<carve::mesh::MeshSet<3>::vertex_t *>::const_iterator i = vertices.begin(), e = vertices.end(); i != e; ++i) {
+ for (std::vector<meshset_t::vertex_t *>::const_iterator i = vertices.begin(), e = vertices.end(); i != e; ++i) {
std::cerr << (*i) << " " << (*i)->v << " ("
<< carve::geom::distance(face_a->plane, (*i)->v) << ","
<< carve::geom::distance(face_b->plane, (*i)->v) << ")"
@@ -1036,8 +1087,8 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
// if there are two points of intersection, then the added edge is simple to determine.
if (vertices.size() == 2) {
- carve::mesh::MeshSet<3>::vertex_t *v1 = vertices[0];
- carve::mesh::MeshSet<3>::vertex_t *v2 = vertices[1];
+ meshset_t::vertex_t *v1 = vertices[0];
+ meshset_t::vertex_t *v2 = vertices[1];
carve::geom3d::Vector c = (v1->v + v2->v) / 2;
// determine whether the midpoint of the implied edge is contained in face_a and face_b
@@ -1065,7 +1116,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
// otherwise, it's more complex.
carve::geom3d::Vector base, dir;
- std::vector<carve::mesh::MeshSet<3>::vertex_t *> ordered;
+ std::vector<meshset_t::vertex_t *> ordered;
// skip coplanar edges. this simplifies the resulting
// mesh. eventually all coplanar face regions of two polyhedra
@@ -1080,8 +1131,8 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
// for each possible edge in the ordering, test the midpoint,
// and record if it's contained in face_a and face_b.
for (int k = 0, ke = (int)ordered.size() - 1; k < ke; ++k) {
- carve::mesh::MeshSet<3>::vertex_t *v1 = ordered[k];
- carve::mesh::MeshSet<3>::vertex_t *v2 = ordered[k + 1];
+ meshset_t::vertex_t *v1 = ordered[k];
+ meshset_t::vertex_t *v2 = ordered[k + 1];
carve::geom3d::Vector c = (v1->v + v2->v) / 2;
#if defined(CARVE_DEBUG)
@@ -1125,7 +1176,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
carve::line::PolylineSet intersection_graph;
intersection_graph.vertices.resize(vertices.size());
- std::map<const carve::mesh::MeshSet<3>::vertex_t *, size_t> vmap;
+ std::map<const meshset_t::vertex_t *, size_t> vmap;
size_t j = 0;
for (detail::VSet::const_iterator i = vertices.begin(); i != vertices.end(); ++i) {
@@ -1195,9 +1246,9 @@ static void checkFaceLoopIntegrity(carve::csg::FaceLoopList &fll) {
* @param b_edge_count
* @param hooks
*/
-void carve::csg::CSG::calc(carve::mesh::MeshSet<3> *a,
+void carve::csg::CSG::calc(meshset_t *a,
const face_rtree_t *a_rtree,
- carve::mesh::MeshSet<3> *b,
+ meshset_t *b,
const face_rtree_t *b_rtree,
carve::csg::VertexClassification &vclass,
carve::csg::EdgeClassification &eclass,
@@ -1260,12 +1311,12 @@ void carve::csg::CSG::calc(carve::mesh::MeshSet<3> *a,
#if defined(CARVE_DEBUG_WRITE_PLY_DATA)
{
- std::string out("/tmp/a_split.ply");
- writePLY(out, faceLoopsToPolyhedron(a_face_loops), false);
+ std::auto_ptr<carve::mesh::MeshSet<3> > poly(faceLoopsToPolyhedron(a_face_loops));
+ writePLY("/tmp/a_split.ply", poly.get(), false);
}
{
- std::string out("/tmp/b_split.ply");
- writePLY(out, faceLoopsToPolyhedron(b_face_loops), false);
+ std::auto_ptr<carve::mesh::MeshSet<3> > poly(faceLoopsToPolyhedron(b_face_loops));
+ writePLY("/tmp/b_split.ply", poly.get(), false);
}
#endif
@@ -1276,11 +1327,11 @@ void carve::csg::CSG::calc(carve::mesh::MeshSet<3> *a,
std::cerr << "classify" << std::endl;
#endif
// initialize some classification information.
- for (std::vector<carve::mesh::MeshSet<3>::vertex_t>::iterator
+ for (std::vector<meshset_t::vertex_t>::iterator
i = a->vertex_storage.begin(), e = a->vertex_storage.end(); i != e; ++i) {
vclass[map_vertex(data.vmap, &(*i))].cls[0] = POINT_ON;
}
- for (std::vector<carve::mesh::MeshSet<3>::vertex_t>::iterator
+ for (std::vector<meshset_t::vertex_t>::iterator
i = b->vertex_storage.begin(), e = b->vertex_storage.end(); i != e; ++i) {
vclass[map_vertex(data.vmap, &(*i))].cls[1] = POINT_ON;
}
@@ -1351,8 +1402,8 @@ void returnSharedEdges(carve::csg::V2Set &shared_edges,
*
* @return
*/
-carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
- carve::mesh::MeshSet<3> *b,
+carve::mesh::MeshSet<3> *carve::csg::CSG::compute(meshset_t *a,
+ meshset_t *b,
carve::csg::CSG::Collector &collector,
carve::csg::V2Set *shared_edges_ptr,
CLASSIFY_TYPE classify_type) {
@@ -1371,13 +1422,13 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
size_t a_edge_count;
size_t b_edge_count;
- face_rtree_t *a_rtree = face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4);
- face_rtree_t *b_rtree = face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4);
+ std::auto_ptr<face_rtree_t> a_rtree(face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4));
+ std::auto_ptr<face_rtree_t> b_rtree(face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4));
{
static carve::TimingName FUNC_NAME("CSG::compute - calc()");
carve::TimingBlock block(FUNC_NAME);
- calc(a, a_rtree, b, b_rtree, vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
+ calc(a, a_rtree.get(), b, b_rtree.get(), vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
}
detail::LoopEdges a_edge_map;
@@ -1445,11 +1496,11 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
classifyFaceGroupsEdge(shared_edges,
vclass,
a,
- a_rtree,
+ a_rtree.get(),
a_loops_grouped,
a_edge_map,
b,
- b_rtree,
+ b_rtree.get(),
b_loops_grouped,
b_edge_map,
collector);
@@ -1458,20 +1509,20 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
classifyFaceGroups(shared_edges,
vclass,
a,
- a_rtree,
+ a_rtree.get(),
a_loops_grouped,
a_edge_map,
b,
- b_rtree,
+ b_rtree.get(),
b_loops_grouped,
b_edge_map,
collector);
break;
}
- carve::mesh::MeshSet<3> *result = collector.done(hooks);
+ meshset_t *result = collector.done(hooks);
if (result != NULL && shared_edges_ptr != NULL) {
- std::list<carve::mesh::MeshSet<3> *> result_list;
+ std::list<meshset_t *> result_list;
result_list.push_back(result);
returnSharedEdges(shared_edges, result_list, shared_edges_ptr);
}
@@ -1492,15 +1543,15 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
*
* @return
*/
-carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
- carve::mesh::MeshSet<3> *b,
+carve::mesh::MeshSet<3> *carve::csg::CSG::compute(meshset_t *a,
+ meshset_t *b,
carve::csg::CSG::OP op,
carve::csg::V2Set *shared_edges,
CLASSIFY_TYPE classify_type) {
Collector *coll = makeCollector(op, a, b);
if (!coll) return NULL;
- carve::mesh::MeshSet<3> *result = compute(a, b, *coll, shared_edges, classify_type);
+ meshset_t *result = compute(a, b, *coll, shared_edges, classify_type);
delete coll;
@@ -1521,9 +1572,9 @@ carve::mesh::MeshSet<3> *carve::csg::CSG::compute(carve::mesh::MeshSet<3> *a,
*
* @return
*/
-bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
- carve::mesh::MeshSet<3> *open,
- std::list<std::pair<FaceClass, carve::mesh::MeshSet<3> *> > &result,
+bool carve::csg::CSG::sliceAndClassify(meshset_t *closed,
+ meshset_t *open,
+ std::list<std::pair<FaceClass, meshset_t *> > &result,
carve::csg::V2Set *shared_edges_ptr) {
if (!closed->isClosed()) return false;
carve::csg::VertexClassification vclass;
@@ -1538,10 +1589,10 @@ bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
size_t a_edge_count;
size_t b_edge_count;
- face_rtree_t *closed_rtree = face_rtree_t::construct_STR(closed->faceBegin(), closed->faceEnd(), 4, 4);
- face_rtree_t *open_rtree = face_rtree_t::construct_STR(open->faceBegin(), open->faceEnd(), 4, 4);
+ std::auto_ptr<face_rtree_t> closed_rtree(face_rtree_t::construct_STR(closed->faceBegin(), closed->faceEnd(), 4, 4));
+ std::auto_ptr<face_rtree_t> open_rtree(face_rtree_t::construct_STR(open->faceBegin(), open->faceEnd(), 4, 4));
- calc(closed, closed_rtree, open, open_rtree, vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
+ calc(closed, closed_rtree.get(), open, open_rtree.get(), vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
detail::LoopEdges a_edge_map;
detail::LoopEdges b_edge_map;
@@ -1559,18 +1610,18 @@ bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
halfClassifyFaceGroups(shared_edges,
vclass,
closed,
- closed_rtree,
+ closed_rtree.get(),
a_loops_grouped,
a_edge_map,
open,
- open_rtree,
+ open_rtree.get(),
b_loops_grouped,
b_edge_map,
result);
if (shared_edges_ptr != NULL) {
- std::list<carve::mesh::MeshSet<3> *> result_list;
- for (std::list<std::pair<FaceClass, carve::mesh::MeshSet<3> *> >::iterator it = result.begin(); it != result.end(); it++) {
+ std::list<meshset_t *> result_list;
+ for (std::list<std::pair<FaceClass, meshset_t *> >::iterator it = result.begin(); it != result.end(); it++) {
result_list.push_back(it->second);
}
returnSharedEdges(shared_edges, result_list, shared_edges_ptr);
@@ -1590,10 +1641,10 @@ bool carve::csg::CSG::sliceAndClassify(carve::mesh::MeshSet<3> *closed,
* @param hooks
* @param shared_edges_ptr
*/
-void carve::csg::CSG::slice(carve::mesh::MeshSet<3> *a,
- carve::mesh::MeshSet<3> *b,
- std::list<carve::mesh::MeshSet<3> *> &a_sliced,
- std::list<carve::mesh::MeshSet<3> *> &b_sliced,
+void carve::csg::CSG::slice(meshset_t *a,
+ meshset_t *b,
+ std::list<meshset_t *> &a_sliced,
+ std::list<meshset_t *> &b_sliced,
carve::csg::V2Set *shared_edges_ptr) {
carve::csg::VertexClassification vclass;
carve::csg::EdgeClassification eclass;
@@ -1607,10 +1658,10 @@ void carve::csg::CSG::slice(carve::mesh::MeshSet<3> *a,
size_t a_edge_count;
size_t b_edge_count;
- face_rtree_t *a_rtree = face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4);
- face_rtree_t *b_rtree = face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4);
+ std::auto_ptr<face_rtree_t> a_rtree(face_rtree_t::construct_STR(a->faceBegin(), a->faceEnd(), 4, 4));
+ std::auto_ptr<face_rtree_t> b_rtree(face_rtree_t::construct_STR(b->faceBegin(), b->faceEnd(), 4, 4));
- calc(a, a_rtree, b, b_rtree, vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
+ calc(a, a_rtree.get(), b, b_rtree.get(), vclass, eclass,a_face_loops, b_face_loops, a_edge_count, b_edge_count);
detail::LoopEdges a_edge_map;
detail::LoopEdges b_edge_map;
@@ -1645,7 +1696,7 @@ void carve::csg::CSG::slice(carve::mesh::MeshSet<3> *a,
delete all;
}
if (shared_edges_ptr != NULL) {
- std::list<carve::mesh::MeshSet<3> *> result_list;
+ std::list<meshset_t *> result_list;
result_list.insert(result_list.end(), a_sliced.begin(), a_sliced.end());
result_list.insert(result_list.end(), b_sliced.begin(), b_sliced.end());
returnSharedEdges(shared_edges, result_list, shared_edges_ptr);
diff --git a/extern/carve/patches/strict_flags.patch b/extern/carve/patches/strict_flags.patch
index 5c7e8967d39..c1046b78c5f 100644
--- a/extern/carve/patches/strict_flags.patch
+++ b/extern/carve/patches/strict_flags.patch
@@ -9,9 +9,9 @@ diff -r 47dfdaff1dd5 include/carve/csg_triangulator.hpp
}
carve::mesh::MeshSet<3>::face_t *mergeQuad(edge_map_t::iterator i, edge_map_t &edge_map) {
-diff -r 47dfdaff1dd5 src/selfintersect.cpp
---- a/src/selfintersect.cpp Thu Jan 12 15:49:04 2012 -0500
-+++ b/src/selfintersect.cpp Fri Jan 13 03:13:32 2012 +0600
+diff -r 47dfdaff1dd5 lib/selfintersect.cpp
+--- a/lib/selfintersect.cpp Thu Jan 12 15:49:04 2012 -0500
++++ b/lib/selfintersect.cpp Fri Jan 13 03:13:32 2012 +0600
@@ -465,6 +465,7 @@
// returns true if no intersection, based upon edge^a_i and edge^b_j separating axis.
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp
index 50b47650696..a7d37da0426 100644
--- a/intern/audaspace/intern/AUD_C-API.cpp
+++ b/intern/audaspace/intern/AUD_C-API.cpp
@@ -244,7 +244,7 @@ PyObject* AUD_initPython()
return module;
}
-PyObject* AUD_getPythonFactory(AUD_Sound* sound)
+void* AUD_getPythonFactory(AUD_Sound* sound)
{
if(sound)
{
@@ -259,9 +259,9 @@ PyObject* AUD_getPythonFactory(AUD_Sound* sound)
return NULL;
}
-AUD_Sound* AUD_getPythonSound(PyObject* sound)
+AUD_Sound* AUD_getPythonSound(void* sound)
{
- Factory* factory = checkFactory(sound);
+ Factory* factory = checkFactory((PyObject *)sound);
if(!factory)
return NULL;
diff --git a/intern/audaspace/intern/AUD_C-API.h b/intern/audaspace/intern/AUD_C-API.h
index a52a1fa8369..66e6984c71b 100644
--- a/intern/audaspace/intern/AUD_C-API.h
+++ b/intern/audaspace/intern/AUD_C-API.h
@@ -29,10 +29,6 @@
#ifndef __AUD_C_API_H__
#define __AUD_C_API_H__
-#ifdef WITH_PYTHON
-#include "Python.h"
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -740,14 +736,14 @@ extern AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* seque
* \param sound The sound factory.
* \return The python factory.
*/
-extern PyObject* AUD_getPythonFactory(AUD_Sound* sound);
+extern void* AUD_getPythonFactory(AUD_Sound* sound);
/**
* Retrieves the sound factory of a python factory.
* \param sound The python factory.
* \return The sound factory.
*/
-extern AUD_Sound* AUD_getPythonSound(PyObject* sound);
+extern AUD_Sound* AUD_getPythonSound(void* sound);
#endif
#ifdef __cplusplus
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index e2f82096901..7a22cba316e 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -143,7 +143,9 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
cls.min_bounces = IntProperty(
name="Min Bounces",
- description="Minimum number of bounces, setting this lower than the maximum enables probalistic path termination (faster but noisier)",
+ description="Minimum number of bounces, setting this lower "
+ "than the maximum enables probabilistic path "
+ "termination (faster but noisier)",
min=0, max=1024,
default=3,
)
@@ -175,7 +177,10 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
cls.transparent_min_bounces = IntProperty(
name="Transparent Min Bounces",
- description="Minimum number of transparent bounces, setting this lower than the maximum enables probalistic path termination (faster but noisier)",
+ description="Minimum number of transparent bounces, setting "
+ "this lower than the maximum enables "
+ "probabilistic path termination (faster but "
+ "noisier)",
min=0, max=1024,
default=8,
)
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index dc20dbdbea2..1af0972ecf9 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -109,8 +109,11 @@ int ImageManager::add_image(const string& filename, bool& is_float)
if(slot == float_images.size()) {
/* max images limit reached */
- if(float_images.size() == TEX_NUM_FLOAT_IMAGES)
+ if(float_images.size() == TEX_NUM_FLOAT_IMAGES) {
+ printf("ImageManager::add_image: byte image limit reached %d, skipping '%s'\n",
+ TEX_NUM_IMAGES, filename.c_str());
return -1;
+ }
float_images.resize(float_images.size() + 1);
}
@@ -141,8 +144,11 @@ int ImageManager::add_image(const string& filename, bool& is_float)
if(slot == images.size()) {
/* max images limit reached */
- if(images.size() == TEX_NUM_IMAGES)
+ if(images.size() == TEX_NUM_IMAGES) {
+ printf("ImageManager::add_image: byte image limit reached %d, skipping '%s'\n",
+ TEX_NUM_IMAGES, filename.c_str());
return -1;
+ }
images.resize(images.size() + 1);
}
@@ -353,13 +359,13 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
device->tex_free(tex_img);
if(!file_load_float_image(img, tex_img)) {
- /* on failure to load, we set a 1x1 pixels black image */
+ /* on failure to load, we set a 1x1 pixels pink image */
float *pixels = (float*)tex_img.resize(1, 1);
- pixels[0] = 0.0f;
- pixels[1] = 0.0f;
- pixels[2] = 0.0f;
- pixels[3] = 0.0f;
+ pixels[0] = TEX_IMAGE_MISSING_R;
+ pixels[1] = TEX_IMAGE_MISSING_G;
+ pixels[2] = TEX_IMAGE_MISSING_B;
+ pixels[3] = TEX_IMAGE_MISSING_A;
}
string name;
@@ -380,13 +386,13 @@ void ImageManager::device_load_image(Device *device, DeviceScene *dscene, int sl
device->tex_free(tex_img);
if(!file_load_image(img, tex_img)) {
- /* on failure to load, we set a 1x1 pixels black image */
+ /* on failure to load, we set a 1x1 pixels pink image */
uchar *pixels = (uchar*)tex_img.resize(1, 1);
- pixels[0] = 0;
- pixels[1] = 0;
- pixels[2] = 0;
- pixels[3] = 0;
+ pixels[0] = (TEX_IMAGE_MISSING_R * 255);
+ pixels[1] = (TEX_IMAGE_MISSING_G * 255);
+ pixels[2] = (TEX_IMAGE_MISSING_B * 255);
+ pixels[3] = (TEX_IMAGE_MISSING_A * 255);
}
string name;
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h
index 2b5e53cabe1..ef046cfcafb 100644
--- a/intern/cycles/render/image.h
+++ b/intern/cycles/render/image.h
@@ -31,6 +31,12 @@ CCL_NAMESPACE_BEGIN
#define TEX_IMAGE_MAX (TEX_NUM_IMAGES + TEX_NUM_FLOAT_IMAGES)
#define TEX_IMAGE_FLOAT_START TEX_NUM_IMAGES
+/* color to use when textures are not found */
+#define TEX_IMAGE_MISSING_R 1
+#define TEX_IMAGE_MISSING_G 0
+#define TEX_IMAGE_MISSING_B 1
+#define TEX_IMAGE_MISSING_A 1
+
class Device;
class DeviceScene;
class Progress;
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 0f64d858de0..e4a4b874964 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -184,10 +184,12 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
/* image not found */
if(!color_out->links.empty()) {
compiler.add_node(NODE_VALUE_V, color_out->stack_offset);
- compiler.add_node(NODE_VALUE_V, make_float3(0, 0, 0));
+ compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R,
+ TEX_IMAGE_MISSING_G,
+ TEX_IMAGE_MISSING_B));
}
if(!alpha_out->links.empty())
- compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), alpha_out->stack_offset);
+ compiler.add_node(NODE_VALUE_F, __float_as_int(TEX_IMAGE_MISSING_A), alpha_out->stack_offset);
}
}
@@ -288,10 +290,12 @@ void EnvironmentTextureNode::compile(SVMCompiler& compiler)
/* image not found */
if(!color_out->links.empty()) {
compiler.add_node(NODE_VALUE_V, color_out->stack_offset);
- compiler.add_node(NODE_VALUE_V, make_float3(0, 0, 0));
+ compiler.add_node(NODE_VALUE_V, make_float3(TEX_IMAGE_MISSING_R,
+ TEX_IMAGE_MISSING_G,
+ TEX_IMAGE_MISSING_B));
}
if(!alpha_out->links.empty())
- compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), alpha_out->stack_offset);
+ compiler.add_node(NODE_VALUE_F, __float_as_int(TEX_IMAGE_MISSING_A), alpha_out->stack_offset);
}
}
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 764df79230d..4466d614ee9 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -328,7 +328,8 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle
* @param windowhandle The handle to the window
* @param bitmap The bitmap data for the cursor.
* @param mask The mask data for the cursor.
- * @parm sizex, sizey The size of the cursor
+ * @param sizex The width of the cursor
+ * @param sizey The height of the cursor
* @param hotX The X coordinate of the cursor hotspot.
* @param hotY The Y coordinate of the cursor hotspot.
* @param fg_color, bg_color Colors of the cursor
diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp
index 79102967f3e..d62d4437972 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.cpp
+++ b/intern/ghost/intern/GHOST_NDOFManager.cpp
@@ -395,7 +395,7 @@ void GHOST_NDOFManager::setDeadZone(float dz)
dz = 0.f;
}
else if (dz > 0.5f) {
- // warn the rogue user/programmer, but allow it
+ // warn the rogue user/developer, but allow it
GHOST_PRINTF("ndof: dead zone of %.2f is rather high...\n", dz);
}
m_deadZone = dz;
diff --git a/intern/raskter/raskter.c b/intern/raskter/raskter.c
index 26d879091c1..b405fde82e8 100644
--- a/intern/raskter/raskter.c
+++ b/intern/raskter/raskter.c
@@ -34,8 +34,8 @@
#define __PLX__FAKE_AA__
/* from BLI_utildefines.h */
-#define MIN2(x, y) ( (x) < (y) ? (x) : (y) )
-#define MAX2(x, y) ( (x) > (y) ? (x) : (y) )
+#define MIN2(x, y) ( (x) < (y) ? (x) : (y) )
+#define MAX2(x, y) ( (x) > (y) ? (x) : (y) )
#define ABS(a) ( (a) < 0 ? (-(a)) : (a) )
struct e_status {
@@ -96,7 +96,8 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
/* we're not at the last vert, so end of the edge is the previous vertex */
xend = v[i - 1].x;
yend = v[i - 1].y;
- } else {
+ }
+ else {
/* we're at the first vertex, so the "end" of this edge is the last vertex */
xend = v[num_verts - 1].x;
yend = v[num_verts - 1].y;
@@ -125,7 +126,8 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
if (dx > 0) {
e_new->xdir = 1;
xdist = dx;
- } else {
+ }
+ else {
e_new->xdir = -1;
xdist = -dx;
}
@@ -138,13 +140,15 @@ static void preprocess_all_edges(struct r_fill_context *ctx, struct poly_vert *v
/* calculate deltas for incremental drawing */
if (dx >= 0) {
e_new->drift = 0;
- } else {
+ }
+ else {
e_new->drift = -dy + 1;
}
if (dy >= xdist) {
e_new->drift_inc = xdist;
e_new->xshift = 0;
- } else {
+ }
+ else {
e_new->drift_inc = xdist % dy;
e_new->xshift = (xdist / dy) * e_new->xdir;
}
@@ -187,7 +191,7 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
* If the number of verts specified to render as a polygon is less than 3,
* return immediately. Obviously we cant render a poly with sides < 3. The
* return for this we set to 1, simply so it can be distinguished from the
- * next place we could return, /home/guest/blender-svn/soc-2011-tomato/intern/raskter/raskter.
+ * next place we could return.
* which is a failure to allocate memory.
*/
if (num_verts < 3) {
@@ -211,6 +215,12 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
*/
preprocess_all_edges(ctx, verts, num_verts, edgbuf);
+ /* can happen with a zero area mask */
+ if (ctx->all_edges == NULL) {
+ free(edgbuf);
+ return(1);
+ }
+
/*
* Set the pointer for tracking the edges currently in processing to NULL to make sure
* we don't get some crazy value after initialization.
@@ -258,7 +268,8 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
edgec = &ctx->all_edges->e_next; /* Set our list to the next edge's location in memory. */
ctx->all_edges = e_temp; /* Skip the NULL or bad X edge, set pointer to next edge. */
break; /* Stop looping edges (since we ran out or hit empty X span. */
- } else {
+ }
+ else {
edgec = &e_curr->e_next; /* Set the pointer to the edge list the "next" edge. */
}
}
@@ -320,7 +331,8 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
if (!(--(e_curr->num))) {
*edgec = e_curr->e_next;
- } else {
+ }
+ else {
e_curr->x += e_curr->xshift;
if ((e_curr->drift += e_curr->drift_inc) > 0) {
e_curr->x += e_curr->xdir;
@@ -379,8 +391,9 @@ static int rast_scan_fill(struct r_fill_context *ctx, struct poly_vert *verts, i
}
int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
- float *buf, int buf_x, int buf_y, int do_mask_AA) {
- int subdiv_AA = (do_mask_AA != 0)? 8:0;
+ float *buf, int buf_x, int buf_y, int do_mask_AA)
+{
+ int subdiv_AA = (do_mask_AA != 0) ? 8 : 0;
int i; /* i: Loop counter. */
int sAx;
int sAy;
@@ -388,7 +401,7 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
struct r_fill_context ctx = {0};
const float buf_x_f = (float)(buf_x);
const float buf_y_f = (float)(buf_y);
- float div_offset=(1.0f / (float)(subdiv_AA));
+ float div_offset = (1.0f / (float)(subdiv_AA));
float div_offset_static = 0.5f * (float)(subdiv_AA) * div_offset;
/*
* Allocate enough memory for our poly_vert list. It'll be the size of the poly_vert
@@ -413,21 +426,22 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
* drawn will be 1.0f in value, there is no anti-aliasing.
*/
- if(!subdiv_AA) {
- for (i = 0; i < num_base_verts; i++) { /* Loop over all base_verts. */
- ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f); /* Range expand normalized X to integer buffer-space X. */
+ if (!subdiv_AA) {
+ for (i = 0; i < num_base_verts; i++) { /* Loop over all base_verts. */
+ ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f); /* Range expand normalized X to integer buffer-space X. */
ply[i].y = (int)((base_verts[i][1] * buf_y_f) + 0.5f); /* Range expand normalized Y to integer buffer-space Y. */
- }
+ }
- i = rast_scan_fill(&ctx, ply, num_base_verts,1.0f); /* Call our rasterizer, passing in the integer coords for each vert. */
- } else {
- for(sAx=0; sAx < subdiv_AA; sAx++) {
- for(sAy=0; sAy < subdiv_AA; sAy++) {
- for(i=0; i < num_base_verts; i++) {
- ply[i].x = (int)((base_verts[i][0]*buf_x_f)+0.5f - div_offset_static + (div_offset*(float)(sAx)));
- ply[i].y = (int)((base_verts[i][1]*buf_y_f)+0.5f - div_offset_static + (div_offset*(float)(sAy)));
+ i = rast_scan_fill(&ctx, ply, num_base_verts, 1.0f); /* Call our rasterizer, passing in the integer coords for each vert. */
+ }
+ else {
+ for (sAx = 0; sAx < subdiv_AA; sAx++) {
+ for (sAy = 0; sAy < subdiv_AA; sAy++) {
+ for (i = 0; i < num_base_verts; i++) {
+ ply[i].x = (int)((base_verts[i][0] * buf_x_f) + 0.5f - div_offset_static + (div_offset * (float)(sAx)));
+ ply[i].y = (int)((base_verts[i][1] * buf_y_f) + 0.5f - div_offset_static + (div_offset * (float)(sAy)));
}
- i = rast_scan_fill(&ctx, ply, num_base_verts,(1.0f / (float)(subdiv_AA*subdiv_AA)));
+ i = rast_scan_fill(&ctx, ply, num_base_verts, (1.0f / (float)(subdiv_AA * subdiv_AA)));
}
}
}
@@ -442,7 +456,8 @@ int PLX_raskterize(float (*base_verts)[2], int num_base_verts,
*/
static int rast_scan_feather(struct r_fill_context *ctx,
float (*base_verts_f)[2], int num_base_verts,
- struct poly_vert *feather_verts, float(*feather_verts_f)[2], int num_feather_verts) {
+ struct poly_vert *feather_verts, float(*feather_verts_f)[2], int num_feather_verts)
+{
int x_curr; /* current pixel position in X */
int y_curr; /* current scan line being drawn */
int yp; /* y-pixel's position in frame buffer */
@@ -477,7 +492,7 @@ static int rast_scan_feather(struct r_fill_context *ctx,
* If the number of verts specified to render as a polygon is less than 3,
* return immediately. Obviously we cant render a poly with sides < 3. The
* return for this we set to 1, simply so it can be distinguished from the
- * next place we could return, /home/guest/blender-svn/soc-2011-tomato/intern/raskter/raskter
+ * next place we could return,
* which is a failure to allocate memory.
*/
if (num_feather_verts < 3) {
@@ -501,6 +516,12 @@ static int rast_scan_feather(struct r_fill_context *ctx,
*/
preprocess_all_edges(ctx, feather_verts, num_feather_verts, edgbuf);
+ /* can happen with a zero area mask */
+ if (ctx->all_edges == NULL) {
+ free(edgbuf);
+ return(1);
+ }
+
/*
* Set the pointer for tracking the edges currently in processing to NULL to make sure
* we don't get some crazy value after initialization.
@@ -548,7 +569,8 @@ static int rast_scan_feather(struct r_fill_context *ctx,
edgec = &ctx->all_edges->e_next; /* Set our list to the next edge's location in memory. */
ctx->all_edges = e_temp; /* Skip the NULL or bad X edge, set pointer to next edge. */
break; /* Stop looping edges (since we ran out or hit empty X span. */
- } else {
+ }
+ else {
edgec = &e_curr->e_next; /* Set the pointer to the edge list the "next" edge. */
}
}
@@ -658,7 +680,8 @@ static int rast_scan_feather(struct r_fill_context *ctx,
for (edgec = &ctx->possible_edges; (e_curr = *edgec); ) {
if (!(--(e_curr->num))) {
*edgec = e_curr->e_next;
- } else {
+ }
+ else {
e_curr->x += e_curr->xshift;
if ((e_curr->drift += e_curr->drift_inc) > 0) {
e_curr->x += e_curr->xdir;
@@ -992,7 +1015,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
if(!horzSpan) {
lumaN = lumaW;
lumaS = lumaE;
- } else {
+ }
+ else {
lengthSign = 1.0f / (float)(buf_y);
}
subpixB = (subpixA * (1.0f/12.0f)) - lumaM;
@@ -1014,7 +1038,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
offNP_y = (horzSpan) ? 0.0f:(1.0f / (float)(buf_y));
if(!horzSpan) {
posB_x += lengthSign * 0.5f;
- } else {
+ }
+ else {
posB_y += lengthSign * 0.5f;
}
@@ -1324,7 +1349,8 @@ int PLX_antialias_buffer(float *buf, int buf_x, int buf_y)
pixelOffsetSubpix = MAX2(pixelOffsetGood, subpixH);
if(!horzSpan) {
posM_x += pixelOffsetSubpix * lengthSign;
- } else {
+ }
+ else {
posM_y += pixelOffsetSubpix * lengthSign;
}
//may need bilinear filtered get_pixel_intensity() here...
diff --git a/intern/smoke/intern/MERSENNETWISTER.h b/intern/smoke/intern/MERSENNETWISTER.h
index 116568c2834..5a9ccf88ae7 100644
--- a/intern/smoke/intern/MERSENNETWISTER.h
+++ b/intern/smoke/intern/MERSENNETWISTER.h
@@ -234,7 +234,7 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength )
initialize(19650218UL);
register int i = 1;
register uint32 j = 0;
- register int k = ( N > seedLength ? N : seedLength );
+ register int k = ( (uint32)N > seedLength ? (uint32)N : seedLength );
for( ; k; --k )
{
state[i] =
diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp
index ce298cff0d2..b45fef26504 100644
--- a/intern/smoke/intern/smoke_API.cpp
+++ b/intern/smoke/intern/smoke_API.cpp
@@ -198,8 +198,8 @@ extern "C" void smoke_export(FLUID_3D *fluid, float *dt, float *dx, float **dens
*vyold = fluid->_yVelocityOld;
*vzold = fluid->_zVelocityOld;
*obstacles = fluid->_obstacles;
- dt = &(fluid->_dt);
- dx = &(fluid->_dx);
+ *dt = fluid->_dt;
+ *dx = fluid->_dx;
}
diff --git a/release/scripts/modules/animsys_refactor.py b/release/scripts/modules/animsys_refactor.py
index 06c449afd41..fd6087b38e6 100644
--- a/release/scripts/modules/animsys_refactor.py
+++ b/release/scripts/modules/animsys_refactor.py
@@ -157,8 +157,8 @@ def find_path_new(id_data, data_path, rna_update_dict, rna_update_from_map):
def update_data_paths(rna_update):
- ''' rna_update triple [(class_name, from, to), ...]
- '''
+ """ rna_update triple [(class_name, from, to), ...]
+ """
# make a faster lookup dict
rna_update_dict = {}
diff --git a/release/scripts/modules/i18n/__init__.py b/release/scripts/modules/bl_i18n_utils/__init__.py
index 4072247c6d6..4072247c6d6 100644
--- a/release/scripts/modules/i18n/__init__.py
+++ b/release/scripts/modules/bl_i18n_utils/__init__.py
diff --git a/release/scripts/modules/i18n/bl_process_msg.py b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
index 0a28a6768e6..353b911ab2c 100644
--- a/release/scripts/modules/i18n/bl_process_msg.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
@@ -24,10 +24,9 @@
import os
-# Quite an ugly hack… But the simplest solution for now!
-#import sys
-#sys.path.append(os.path.abspath(os.path.dirname(__file__)))
-import i18n.settings as settings
+# XXX Relative import does not work here when used from Blender...
+#from . import settings
+import bl_i18n_utils.settings as settings
#classes = set()
@@ -108,8 +107,10 @@ def dump_messages_rna(messages, check_ctxt):
path_resolve = type(bpy.context).__base__.path_resolve
for idname in op_ids:
op = get_instance(idname)
- if 'INTERNAL' in path_resolve(op, "bl_options"):
- blacklist_rna_class.append(idname)
+ # XXX Do not skip INTERNAL's anymore, some of those ops
+ # show up in UI now!
+# if 'INTERNAL' in path_resolve(op, "bl_options"):
+# blacklist_rna_class.append(idname)
# ---------------------------------------------------------------------
# Collect builtin classes we don't need to doc
@@ -466,6 +467,8 @@ def dump_messages(do_messages, do_checks):
keys = set()
for c in check_ctxt.values():
keys |= c
+ # XXX Temp, see below
+ keys -= check_ctxt["multi_rnatip"]
for key in keys:
if key in check_ctxt["undoc_ops"]:
print("\tThe following operators are undocumented:")
diff --git a/release/scripts/modules/i18n/check_po.py b/release/scripts/modules/bl_i18n_utils/check_po.py
index a688d38df88..a688d38df88 100755
--- a/release/scripts/modules/i18n/check_po.py
+++ b/release/scripts/modules/bl_i18n_utils/check_po.py
diff --git a/release/scripts/modules/i18n/clean_po.py b/release/scripts/modules/bl_i18n_utils/clean_po.py
index 7e91b41065c..7e91b41065c 100755
--- a/release/scripts/modules/i18n/clean_po.py
+++ b/release/scripts/modules/bl_i18n_utils/clean_po.py
diff --git a/release/scripts/modules/i18n/import_po_from_branches.py b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
index 4739a98920f..4739a98920f 100755
--- a/release/scripts/modules/i18n/import_po_from_branches.py
+++ b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
diff --git a/release/scripts/modules/i18n/merge_po.py b/release/scripts/modules/bl_i18n_utils/merge_po.py
index 1a55cd670b0..1a55cd670b0 100755
--- a/release/scripts/modules/i18n/merge_po.py
+++ b/release/scripts/modules/bl_i18n_utils/merge_po.py
diff --git a/release/scripts/modules/i18n/rtl_preprocess.py b/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py
index c6fc5fc787e..c6fc5fc787e 100755
--- a/release/scripts/modules/i18n/rtl_preprocess.py
+++ b/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py
diff --git a/release/scripts/modules/i18n/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py
index 4b605e439df..72b521d67a5 100644
--- a/release/scripts/modules/i18n/settings.py
+++ b/release/scripts/modules/bl_i18n_utils/settings.py
@@ -66,9 +66,32 @@ PYGETTEXT_CONTEXTS_DEFSRC = os.path.join("source", "blender", "blenfont",
PYGETTEXT_CONTEXTS = "#define\\s+(BLF_I18NCONTEXT_[A-Z_0-9]+)\\s+\"([^\"]*)\""
# Keywords' regex.
-_str_whole_re = ("(?P<{_}>[\"'])(?:[^(?P={_})]|(?<=\\\\)(?P={_})|"
- "(?:(?P={_})\\s*\\+?\\s*(?P={_})))+(?P={_})")
-str_clean_re = "(?P<_grp>[\"'])(?P<clean>(?:[^(?P=_grp)]|(?<=\\\\)(?P=_grp))+)(?P=_grp)"
+# XXX Most unfortunately, we can't use named backreferences inside character sets,
+# which makes the regexes even more twisty... :/
+_str_base = (
+ # Match void string
+ "(?P<{_}1>[\"'])(?P={_}1)" # Get opening quote (' or "), and closing immediately.
+ "|"
+ # Or match non-void string
+ "(?P<{_}2>[\"'])" # Get opening quote (' or ").
+ "(?{capt}(?:"
+ # This one is for crazy things like "hi \\\\\" folks!"...
+ r"(?:(?!<\\)(?:\\\\)*\\(?=(?P={_}2)))|"
+ # The most common case.
+ ".(?!(?P={_}2))"
+ ")+.)" # Don't forget the last char!
+ "(?P={_}2)" # And closing quote.
+)
+str_clean_re = _str_base.format(_="g", capt="P<clean>")
+# Here we have to consider two different cases (empty string and other).
+_str_whole_re = (
+ _str_base.format(_="{_}1_", capt=":") +
+ # Optional loop start, this handles "split" strings...
+ "(?:(?<=[\"'])\\s*(?=[\"'])(?:"
+ + _str_base.format(_="{_}2_", capt=":") +
+ # End of loop.
+ "))*"
+)
_ctxt_re = r"(?P<ctxt_raw>(?:" + _str_whole_re.format(_="_ctxt") + r")|(?:[A-Z_0-9]+))"
_msg_re = r"(?P<msg_raw>" + _str_whole_re.format(_="_msg") + r")"
PYGETTEXT_KEYWORDS = (() +
@@ -252,7 +275,7 @@ SPELL_CACHE = os.path.join("/tmp", ".spell_cache")
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
try:
- from i18n_override_settings import *
+ from bl_i18n_override_settings import *
except ImportError: # If no i18n_override_settings available, it’s no error!
pass
diff --git a/release/scripts/modules/i18n/spell_check_utils.py b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py
index 3999c01a896..6dfb4be56aa 100644
--- a/release/scripts/modules/i18n/spell_check_utils.py
+++ b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py
@@ -38,6 +38,7 @@ dict_uimsgs = {
"betweens", # yuck! in-betweens!
"boolean", "booleans",
"decrement",
+ "derivate",
"doesn", # doesn't
"fader",
"hoc", # ad-hoc
@@ -62,7 +63,7 @@ dict_uimsgs = {
"autoscale",
"autosmooth",
"autosplit",
- "backface",
+ "backface", "backfacing",
"backimage",
"backscattered",
"bandnoise",
@@ -88,7 +89,7 @@ dict_uimsgs = {
"fullscreen",
"gridline",
"hemi",
- "inscatter",
+ "inscatter", "inscattering",
"lightless",
"lookup", "lookups",
"mathutils",
@@ -146,7 +147,7 @@ dict_uimsgs = {
"unbake",
"uncomment",
"undeformed",
- "undistort",
+ "undistort", "undistortion",
"ungroup",
"unhide",
"unindent",
@@ -161,15 +162,18 @@ dict_uimsgs = {
"unspill",
"unstitchable",
"vectorscope",
+ "whitespace", "whitespaces",
"worldspace",
"workflow",
# Neologisms, slangs
+ "affectable",
"automagic", "automagically",
"blobby",
"blockiness", "blocky",
"collider", "colliders",
"deformer", "deformers",
+ "determinator",
"editability",
"keyer",
"lacunarity",
@@ -180,6 +184,7 @@ dict_uimsgs = {
"polygonization",
"selectability",
"slurph",
+ "stitchable",
"trackability",
"transmissivity",
"rasterized", "rasterization",
@@ -194,11 +199,15 @@ dict_uimsgs = {
"config", "configs",
"const",
"coord", "coords",
+ "degr",
"dof",
"dupli", "duplis",
"eg",
"esc",
+ "expr",
"fac",
+ "fra",
+ "frs",
"grless",
"http",
"init",
@@ -210,6 +219,7 @@ dict_uimsgs = {
"multicam",
"num",
"ok",
+ "orco",
"ortho",
"persp",
"pref", "prefs",
@@ -316,6 +326,7 @@ dict_uimsgs = {
"breakdowner",
"bspline",
"bweight",
+ "colorband",
"datablock", "datablocks",
"dopesheet",
"dupliface", "duplifaces",
@@ -323,6 +334,8 @@ dict_uimsgs = {
"dupliobject", "dupliob",
"dupligroup",
"duplivert",
+ "editbone",
+ "editmode",
"fcurve", "fcurves",
"fluidsim",
"frameserver",
diff --git a/release/scripts/modules/i18n/update_branches.py b/release/scripts/modules/bl_i18n_utils/update_branches.py
index 1a856b14944..1a856b14944 100755
--- a/release/scripts/modules/i18n/update_branches.py
+++ b/release/scripts/modules/bl_i18n_utils/update_branches.py
diff --git a/release/scripts/modules/i18n/update_mo.py b/release/scripts/modules/bl_i18n_utils/update_mo.py
index 9804eb8ce34..9804eb8ce34 100755
--- a/release/scripts/modules/i18n/update_mo.py
+++ b/release/scripts/modules/bl_i18n_utils/update_mo.py
diff --git a/release/scripts/modules/i18n/update_msg.py b/release/scripts/modules/bl_i18n_utils/update_msg.py
index e5154632cfe..e5154632cfe 100755
--- a/release/scripts/modules/i18n/update_msg.py
+++ b/release/scripts/modules/bl_i18n_utils/update_msg.py
diff --git a/release/scripts/modules/i18n/update_po.py b/release/scripts/modules/bl_i18n_utils/update_po.py
index 042b46c03f2..042b46c03f2 100755
--- a/release/scripts/modules/i18n/update_po.py
+++ b/release/scripts/modules/bl_i18n_utils/update_po.py
diff --git a/release/scripts/modules/i18n/update_pot.py b/release/scripts/modules/bl_i18n_utils/update_pot.py
index ceef51aa072..ceef51aa072 100755
--- a/release/scripts/modules/i18n/update_pot.py
+++ b/release/scripts/modules/bl_i18n_utils/update_pot.py
diff --git a/release/scripts/modules/i18n/update_trunk.py b/release/scripts/modules/bl_i18n_utils/update_trunk.py
index f4a2e0b3f8f..f4a2e0b3f8f 100755
--- a/release/scripts/modules/i18n/update_trunk.py
+++ b/release/scripts/modules/bl_i18n_utils/update_trunk.py
diff --git a/release/scripts/modules/i18n/user_settings.py b/release/scripts/modules/bl_i18n_utils/user_settings.py
index 23d9783cd0f..23d9783cd0f 100644
--- a/release/scripts/modules/i18n/user_settings.py
+++ b/release/scripts/modules/bl_i18n_utils/user_settings.py
diff --git a/release/scripts/modules/i18n/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index dfed2088878..dfed2088878 100644
--- a/release/scripts/modules/i18n/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py
index c4e7e6ac19e..34beb6035ae 100644
--- a/release/scripts/modules/bpy/ops.py
+++ b/release/scripts/modules/bpy/ops.py
@@ -31,16 +31,16 @@ op_get_instance = ops_module.get_instance
class BPyOps(object):
- '''
+ """
Fake module like class.
bpy.ops
- '''
+ """
def __getattr__(self, module):
- '''
+ """
gets a bpy.ops submodule
- '''
+ """
if module.startswith('__'):
raise AttributeError(module)
return BPyOpsSubMod(module)
@@ -69,20 +69,20 @@ class BPyOps(object):
class BPyOpsSubMod(object):
- '''
+ """
Utility class to fake submodules.
eg. bpy.ops.object
- '''
+ """
__keys__ = ("module",)
def __init__(self, module):
self.module = module
def __getattr__(self, func):
- '''
+ """
gets a bpy.ops.submodule function
- '''
+ """
if func.startswith('__'):
raise AttributeError(func)
return BPyOpsSubModOp(self.module, func)
@@ -105,11 +105,11 @@ class BPyOpsSubMod(object):
class BPyOpsSubModOp(object):
- '''
+ """
Utility class to fake submodule operators.
eg. bpy.ops.object.somefunc
- '''
+ """
__keys__ = ("module", "func")
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
index 43e4bea4bb3..ad657284492 100644
--- a/release/scripts/modules/bpy/utils.py
+++ b/release/scripts/modules/bpy/utils.py
@@ -20,7 +20,7 @@
"""
This module contains utility functions specific to blender but
-not assosiated with blenders internal data.
+not associated with blenders internal data.
"""
__all__ = (
diff --git a/release/scripts/modules/bpy_extras/__init__.py b/release/scripts/modules/bpy_extras/__init__.py
index 7d74bc32f91..c8d12070de8 100644
--- a/release/scripts/modules/bpy_extras/__init__.py
+++ b/release/scripts/modules/bpy_extras/__init__.py
@@ -19,7 +19,7 @@
# <pep8-80 compliant>
"""
-Utility modules assosiated with the bpy module.
+Utility modules associated with the bpy module.
"""
__all__ = (
diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py
index 593fc85e9cb..4457ecb43e6 100644
--- a/release/scripts/modules/bpy_extras/io_utils.py
+++ b/release/scripts/modules/bpy_extras/io_utils.py
@@ -330,7 +330,7 @@ path_reference_mode = EnumProperty(
description="Method used to reference paths",
items=(('AUTO', "Auto", "Use Relative paths with subdirectories only"),
('ABSOLUTE', "Absolute", "Always write absolute paths"),
- ('RELATIVE', "Relative", "Always write relative patsh "
+ ('RELATIVE', "Relative", "Always write relative paths "
"(where possible)"),
('MATCH', "Match", "Match Absolute/Relative "
"setting with input path"),
diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py
index efd69f91a8b..ad0fe06b68b 100644
--- a/release/scripts/modules/bpy_extras/mesh_utils.py
+++ b/release/scripts/modules/bpy_extras/mesh_utils.py
@@ -319,7 +319,7 @@ def edge_loops_from_edges(mesh, edges=None):
def ngon_tessellate(from_data, indices, fix_loops=True):
- '''
+ """
Takes a polyline of indices (fgon) and returns a list of face
indicie lists. Designed to be used for importers that need indices for an
fgon to create from existing verts.
@@ -329,7 +329,7 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
to fill, and can be a subset of the data given.
fix_loops: If this is enabled polylines that use loops to make multiple
polylines are delt with correctly.
- '''
+ """
from mathutils.geometry import tessellate_polygon
from mathutils import Vector
@@ -352,9 +352,9 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
return v1[1], v2[1]
if not fix_loops:
- '''
+ """
Normal single concave loop filling
- '''
+ """
if type(from_data) in {tuple, list}:
verts = [Vector(from_data[i]) for ii, i in enumerate(indices)]
else:
@@ -368,10 +368,10 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
fill = tessellate_polygon([verts])
else:
- '''
+ """
Seperate this loop into multiple loops be finding edges that are
used twice. This is used by lightwave LWO files a lot
- '''
+ """
if type(from_data) in {tuple, list}:
verts = [vert_treplet(Vector(from_data[i]), ii)
diff --git a/release/scripts/modules/bpyml_ui.py b/release/scripts/modules/bpyml_ui.py
index a7e2e7bc04a..b4ad4e0b54a 100644
--- a/release/scripts/modules/bpyml_ui.py
+++ b/release/scripts/modules/bpyml_ui.py
@@ -85,10 +85,10 @@ def _call_recursive(context, base, py_node):
class BPyML_BaseUI():
- '''
+ """
This is a mix-in class that defines a draw function
which checks for draw_data
- '''
+ """
def draw(self, context):
layout = self.layout
diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py
index b5985d2c851..2aaadb17b71 100644
--- a/release/scripts/modules/console_python.py
+++ b/release/scripts/modules/console_python.py
@@ -48,14 +48,14 @@ def replace_help(namespace):
def get_console(console_id):
- '''
+ """
helper function for console operators
currently each text data block gets its own
console - code.InteractiveConsole()
...which is stored in this function.
console_id can be any hashable type
- '''
+ """
from code import InteractiveConsole
consoles = getattr(get_console, "consoles", None)
diff --git a/release/scripts/modules/console_shell.py b/release/scripts/modules/console_shell.py
index c27524ffe44..8beff24eedb 100644
--- a/release/scripts/modules/console_shell.py
+++ b/release/scripts/modules/console_shell.py
@@ -24,8 +24,8 @@ language_id = "shell"
def add_scrollback(text, text_type):
- for l in text.split('\n'):
- bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
+ for l in text.split("\n"):
+ bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
type=text_type)
@@ -40,7 +40,7 @@ def shell_run(text):
add_scrollback(output, style)
-PROMPT = '$ '
+PROMPT = "$ "
def execute(context):
diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py
index 7eccda74e14..0ef2ac5164d 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -437,9 +437,9 @@ def BuildRNAInfo():
# rna_functions_dict = {} # store all functions directly in this type (not inherited)
def full_rna_struct_path(rna_struct):
- '''
+ """
Needed when referencing one struct from another
- '''
+ """
nested = rna_struct.nested
if nested:
return "%s.%s" % (full_rna_struct_path(nested), rna_struct.identifier)
diff --git a/release/scripts/presets/tracking_settings/blurry_footage.py b/release/scripts/presets/tracking_settings/blurry_footage.py
index c06d4c3835b..f2df4a15320 100644
--- a/release/scripts/presets/tracking_settings/blurry_footage.py
+++ b/release/scripts/presets/tracking_settings/blurry_footage.py
@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
-settings.default_tracker = 'Hybrid'
-settings.default_pyramid_levels = 2
settings.default_correlation_min = 0.75
settings.default_pattern_size = 21
settings.default_search_size = 100
diff --git a/release/scripts/presets/tracking_settings/blurry_movie.py b/release/scripts/presets/tracking_settings/blurry_movie.py
index 8a503bec9bd..fe68f1352c1 100644
--- a/release/scripts/presets/tracking_settings/blurry_movie.py
+++ b/release/scripts/presets/tracking_settings/blurry_movie.py
@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
-settings.default_tracker = 'KLT'
-settings.default_pyramid_levels = 4
settings.default_correlation_min = 0.75
settings.default_pattern_size = 11
settings.default_search_size = 202
diff --git a/release/scripts/presets/tracking_settings/default.py b/release/scripts/presets/tracking_settings/default.py
index b9fd1928472..0cc3a21c845 100644
--- a/release/scripts/presets/tracking_settings/default.py
+++ b/release/scripts/presets/tracking_settings/default.py
@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
-settings.default_tracker = 'Hybrid'
-settings.default_pyramid_levels = 2
settings.default_correlation_min = 0.75
settings.default_pattern_size = 11
settings.default_search_size = 61
diff --git a/release/scripts/presets/tracking_settings/fast_motion.py b/release/scripts/presets/tracking_settings/fast_motion.py
index dce3304eddb..5e6e44e6a42 100644
--- a/release/scripts/presets/tracking_settings/fast_motion.py
+++ b/release/scripts/presets/tracking_settings/fast_motion.py
@@ -1,8 +1,6 @@
import bpy
settings = bpy.context.edit_movieclip.tracking.settings
-settings.default_tracker = 'Hybrid'
-settings.default_pyramid_levels = 2
settings.default_correlation_min = 0.7
settings.default_pattern_size = 31
settings.default_search_size = 300
diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py
index 75a6cd73d64..6c48ae72e4b 100644
--- a/release/scripts/startup/bl_operators/add_mesh_torus.py
+++ b/release/scripts/startup/bl_operators/add_mesh_torus.py
@@ -84,7 +84,7 @@ def add_torus(major_rad, minor_rad, major_seg, minor_seg):
class AddTorus(Operator, object_utils.AddObjectHelper):
- '''Add a torus mesh'''
+ """Add a torus mesh"""
bl_idname = "mesh.primitive_torus_add"
bl_label = "Add Torus"
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py
index ffa66274f12..a30502b454e 100644
--- a/release/scripts/startup/bl_operators/clip.py
+++ b/release/scripts/startup/bl_operators/clip.py
@@ -105,8 +105,6 @@ def CLIP_default_settings_from_track(clip, track):
search[0] = search[0] * width
search[1] = search[1] * height
- settings.default_tracker = track.tracker
- settings.default_pyramid_levels = track.pyramid_levels
settings.default_correlation_min = track.correlation_min
settings.default_pattern_size = max(pattern[0], pattern[1])
settings.default_search_size = max(search[0], search[1])
@@ -497,7 +495,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
fg = rlayers[0]
fg.name = 'Foreground'
else:
- fg = scene.render.layers.new('Foreground')
+ fg = scene.render.layers.new("Foreground")
fg.use_sky = False
fg.layers = [True] + [False] * 19
@@ -505,7 +503,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
fg.use_pass_vector = True
if not scene.render.layers.get("Background"):
- bg = scene.render.layers.new('Background')
+ bg = scene.render.layers.new("Background")
bg.use_pass_shadow = True
bg.use_pass_ambient_occlusion = True
bg.layers = [False] * 10 + [True] + [False] * 9
@@ -560,7 +558,7 @@ class CLIP_OT_setup_tracking_scene(Operator):
space.show_backdrop = True
CLIP_spaces_walk(context, True, 'NODE_EDITOR', 'NODE_EDITOR',
- setup_space)
+ setup_space)
sc = context.space_data
scene = context.scene
@@ -612,46 +610,46 @@ class CLIP_OT_setup_tracking_scene(Operator):
add_shadow.blend_type = 'ADD'
mul_shadow.blend_type = 'MULTIPLY'
- mul_shadow.inputs['Fac'].default_value = 0.8
+ mul_shadow.inputs["Fac"].default_value = 0.8
mul_image.blend_type = 'MULTIPLY'
- mul_image.inputs['Fac'].default_value = 0.8
+ mul_image.inputs["Fac"].default_value = 0.8
vector_blur.factor = 0.75
# create links
- tree.links.new(movieclip.outputs['Image'], distortion.inputs['Image'])
+ tree.links.new(movieclip.outputs["Image"], distortion.inputs["Image"])
if need_stabilization:
- tree.links.new(distortion.outputs['Image'],
- stabilize.inputs['Image'])
- tree.links.new(stabilize.outputs['Image'], scale.inputs['Image'])
+ tree.links.new(distortion.outputs["Image"],
+ stabilize.inputs["Image"])
+ tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"])
else:
- tree.links.new(distortion.outputs['Image'], scale.inputs['Image'])
+ tree.links.new(distortion.outputs["Image"], scale.inputs["Image"])
- tree.links.new(rlayer_bg.outputs['Alpha'], invert.inputs['Color'])
+ tree.links.new(rlayer_bg.outputs["Alpha"], invert.inputs["Color"])
- tree.links.new(invert.outputs['Color'], add_shadow.inputs[1])
- tree.links.new(rlayer_bg.outputs['Shadow'], add_shadow.inputs[2])
+ tree.links.new(invert.outputs["Color"], add_shadow.inputs[1])
+ tree.links.new(rlayer_bg.outputs["Shadow"], add_shadow.inputs[2])
- tree.links.new(invert.outputs['Color'], add_ao.inputs[1])
- tree.links.new(rlayer_bg.outputs['AO'], add_ao.inputs[2])
+ tree.links.new(invert.outputs["Color"], add_ao.inputs[1])
+ tree.links.new(rlayer_bg.outputs["AO"], add_ao.inputs[2])
- tree.links.new(add_ao.outputs['Image'], mul_shadow.inputs[1])
- tree.links.new(add_shadow.outputs['Image'], mul_shadow.inputs[2])
+ tree.links.new(add_ao.outputs["Image"], mul_shadow.inputs[1])
+ tree.links.new(add_shadow.outputs["Image"], mul_shadow.inputs[2])
- tree.links.new(scale.outputs['Image'], mul_image.inputs[1])
- tree.links.new(mul_shadow.outputs['Image'], mul_image.inputs[2])
+ tree.links.new(scale.outputs["Image"], mul_image.inputs[1])
+ tree.links.new(mul_shadow.outputs["Image"], mul_image.inputs[2])
- tree.links.new(rlayer_fg.outputs['Image'], vector_blur.inputs['Image'])
- tree.links.new(rlayer_fg.outputs['Z'], vector_blur.inputs['Z'])
- tree.links.new(rlayer_fg.outputs['Speed'], vector_blur.inputs['Speed'])
+ tree.links.new(rlayer_fg.outputs["Image"], vector_blur.inputs["Image"])
+ tree.links.new(rlayer_fg.outputs["Z"], vector_blur.inputs["Z"])
+ tree.links.new(rlayer_fg.outputs["Speed"], vector_blur.inputs["Speed"])
- tree.links.new(mul_image.outputs['Image'], alphaover.inputs[1])
- tree.links.new(vector_blur.outputs['Image'], alphaover.inputs[2])
+ tree.links.new(mul_image.outputs["Image"], alphaover.inputs[1])
+ tree.links.new(vector_blur.outputs["Image"], alphaover.inputs[2])
- tree.links.new(alphaover.outputs['Image'], composite.inputs['Image'])
- tree.links.new(alphaover.outputs['Image'], viewer.inputs['Image'])
+ tree.links.new(alphaover.outputs["Image"], composite.inputs["Image"])
+ tree.links.new(alphaover.outputs["Image"], viewer.inputs["Image"])
# place nodes
movieclip.location = Vector((-300.0, 350.0))
diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py
index f2e5e57fad8..074069255bc 100644
--- a/release/scripts/startup/bl_operators/image.py
+++ b/release/scripts/startup/bl_operators/image.py
@@ -24,7 +24,7 @@ from bpy.props import StringProperty
class EditExternally(Operator):
- '''Edit image in an external application'''
+ """Edit image in an external application"""
bl_idname = "image.external_edit"
bl_label = "Image Edit Externally"
bl_options = {'REGISTER'}
diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py
index 51645bfeeab..3dc25d84aca 100644
--- a/release/scripts/startup/bl_operators/mesh.py
+++ b/release/scripts/startup/bl_operators/mesh.py
@@ -25,7 +25,7 @@ from bpy.props import EnumProperty
class MeshMirrorUV(Operator):
- '''Copy mirror UV coordinates on the X axis based on a mirrored mesh'''
+ """Copy mirror UV coordinates on the X axis based on a mirrored mesh"""
bl_idname = "mesh.faces_mirror_uv"
bl_label = "Copy Mirrored UV coords"
bl_options = {'REGISTER', 'UNDO'}
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index a2c632a0244..5000d718182 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -27,7 +27,7 @@ from bpy.props import (StringProperty,
class SelectPattern(Operator):
- '''Select objects matching a naming pattern'''
+ """Select objects matching a naming pattern"""
bl_idname = "object.select_pattern"
bl_label = "Select Pattern"
bl_options = {'REGISTER', 'UNDO'}
@@ -105,7 +105,7 @@ class SelectPattern(Operator):
class SelectCamera(Operator):
- '''Select the active camera'''
+ """Select the active camera"""
bl_idname = "object.select_camera"
bl_label = "Select Camera"
bl_options = {'REGISTER', 'UNDO'}
@@ -131,7 +131,7 @@ class SelectCamera(Operator):
class SelectHierarchy(Operator):
- """Select object relative to the active object's position """
+ """Select object relative to the active object's position """ \
"""in the hierarchy"""
bl_idname = "object.select_hierarchy"
bl_label = "Select Hierarchy"
@@ -198,7 +198,7 @@ class SelectHierarchy(Operator):
class SubdivisionSet(Operator):
- '''Sets a Subdivision Surface Level (1-5)'''
+ """Sets a Subdivision Surface Level (1-5)"""
bl_idname = "object.subdivision_set"
bl_label = "Subdivision Set"
@@ -278,7 +278,7 @@ class SubdivisionSet(Operator):
class ShapeTransfer(Operator):
- """Copy another selected objects active shape to this one by """
+ """Copy another selected objects active shape to this one by """ \
"""applying the relative offsets"""
bl_idname = "object.shape_key_transfer"
@@ -468,7 +468,7 @@ class ShapeTransfer(Operator):
class JoinUVs(Operator):
- '''Copy UV Layout to objects with matching geometry'''
+ """Copy UV Layout to objects with matching geometry"""
bl_idname = "object.join_uvs"
bl_label = "Join as UVs"
@@ -547,7 +547,7 @@ class JoinUVs(Operator):
class MakeDupliFace(Operator):
- '''Make linked objects into dupli-faces'''
+ """Make linked objects into dupli-faces"""
bl_idname = "object.make_dupli_face"
bl_label = "Make Dupli-Face"
@@ -642,7 +642,7 @@ class IsolateTypeRender(Operator):
class ClearAllRestrictRender(Operator):
- '''Reveal all render objects by setting the hide render flag'''
+ """Reveal all render objects by setting the hide render flag"""
bl_idname = "object.hide_render_clear_all"
bl_label = "Clear All Restrict Render"
bl_options = {'REGISTER', 'UNDO'}
@@ -654,7 +654,7 @@ class ClearAllRestrictRender(Operator):
class TransformsToDeltasAnim(Operator):
- '''Convert object animation for normal transforms to delta transforms'''
+ """Convert object animation for normal transforms to delta transforms"""
bl_idname = "object.anim_transforms_to_deltas"
bl_label = "Animated Transforms to Deltas"
bl_options = {'REGISTER', 'UNDO'}
@@ -700,7 +700,7 @@ class TransformsToDeltasAnim(Operator):
class DupliOffsetFromCursor(Operator):
- '''Set offset used for DupliGroup based on cursor position'''
+ """Set offset used for DupliGroup based on cursor position"""
bl_idname = "object.dupli_offset_from_cursor"
bl_label = "Set Offset From Cursor"
bl_options = {'REGISTER', 'UNDO'}
diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py
index dd052c36ade..a32bb8c5353 100644
--- a/release/scripts/startup/bl_operators/object_align.py
+++ b/release/scripts/startup/bl_operators/object_align.py
@@ -341,7 +341,7 @@ from bpy.props import EnumProperty, BoolProperty
class AlignObjects(Operator):
- '''Align Objects'''
+ """Align Objects"""
bl_idname = "object.align"
bl_label = "Align Objects"
bl_options = {'REGISTER', 'UNDO'}
diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py
index 834df04fe01..a6efc9dfd85 100644
--- a/release/scripts/startup/bl_operators/object_randomize_transform.py
+++ b/release/scripts/startup/bl_operators/object_randomize_transform.py
@@ -95,7 +95,7 @@ from bpy.props import (IntProperty,
class RandomizeLocRotSize(Operator):
- '''Randomize objects loc/rot/scale'''
+ """Randomize objects loc/rot/scale"""
bl_idname = "object.randomize_transform"
bl_label = "Randomize Transform"
bl_options = {'REGISTER', 'UNDO'}
@@ -120,7 +120,7 @@ class RandomizeLocRotSize(Operator):
)
loc = FloatVectorProperty(
name="Location",
- description=("Maximun distance the objects "
+ description=("Maximum distance the objects "
"can spread over each axis"),
min=-100.0,
max=100.0,
@@ -134,7 +134,7 @@ class RandomizeLocRotSize(Operator):
)
rot = FloatVectorProperty(
name="Rotation",
- description="Maximun rotation over each axis",
+ description="Maximum rotation over each axis",
min=-3.141592, # math.pi
max=+3.141592,
default=(0.0, 0.0, 0.0),
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index bf5a57fb39a..05f76208a5f 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -24,10 +24,10 @@ from bpy.props import StringProperty, BoolProperty
class AddPresetBase():
- '''Base preset class, only for subclassing
+ """Base preset class, only for subclassing
subclasses must define
- preset_values
- - preset_subdir '''
+ - preset_subdir """
# bl_idname = "script.preset_base_add"
# bl_label = "Add a Python Preset"
bl_options = {'REGISTER'} # only because invoke_props_popup requires.
@@ -179,7 +179,7 @@ class AddPresetBase():
class ExecutePreset(Operator):
- '''Execute a preset'''
+ """Execute a preset"""
bl_idname = "script.execute_preset"
bl_label = "Execute a Python Preset"
@@ -217,7 +217,7 @@ class ExecutePreset(Operator):
class AddPresetRender(AddPresetBase, Operator):
- '''Add a Render Preset'''
+ """Add a Render Preset"""
bl_idname = "render.preset_add"
bl_label = "Add Render Preset"
preset_menu = "RENDER_MT_presets"
@@ -243,7 +243,7 @@ class AddPresetRender(AddPresetBase, Operator):
class AddPresetCamera(AddPresetBase, Operator):
- '''Add a Camera Preset'''
+ """Add a Camera Preset"""
bl_idname = "camera.preset_add"
bl_label = "Add Camera Preset"
preset_menu = "CAMERA_MT_presets"
@@ -262,7 +262,7 @@ class AddPresetCamera(AddPresetBase, Operator):
class AddPresetSSS(AddPresetBase, Operator):
- '''Add a Subsurface Scattering Preset'''
+ """Add a Subsurface Scattering Preset"""
bl_idname = "material.sss_preset_add"
bl_label = "Add SSS Preset"
preset_menu = "MATERIAL_MT_sss_presets"
@@ -290,7 +290,7 @@ class AddPresetSSS(AddPresetBase, Operator):
class AddPresetCloth(AddPresetBase, Operator):
- '''Add a Cloth Preset'''
+ """Add a Cloth Preset"""
bl_idname = "cloth.preset_add"
bl_label = "Add Cloth Preset"
preset_menu = "CLOTH_MT_presets"
@@ -312,7 +312,7 @@ class AddPresetCloth(AddPresetBase, Operator):
class AddPresetFluid(AddPresetBase, Operator):
- '''Add a Fluid Preset'''
+ """Add a Fluid Preset"""
bl_idname = "fluid.preset_add"
bl_label = "Add Fluid Preset"
preset_menu = "FLUID_MT_presets"
@@ -330,7 +330,7 @@ class AddPresetFluid(AddPresetBase, Operator):
class AddPresetSunSky(AddPresetBase, Operator):
- '''Add a Sky & Atmosphere Preset'''
+ """Add a Sky & Atmosphere Preset"""
bl_idname = "lamp.sunsky_preset_add"
bl_label = "Add Sunsky Preset"
preset_menu = "LAMP_MT_sunsky_presets"
@@ -359,7 +359,7 @@ class AddPresetSunSky(AddPresetBase, Operator):
class AddPresetInteraction(AddPresetBase, Operator):
- '''Add an Application Interaction Preset'''
+ """Add an Application Interaction Preset"""
bl_idname = "wm.interaction_preset_add"
bl_label = "Add Interaction Preset"
preset_menu = "USERPREF_MT_interaction_presets"
@@ -385,7 +385,7 @@ class AddPresetInteraction(AddPresetBase, Operator):
class AddPresetTrackingCamera(AddPresetBase, Operator):
- '''Add a Tracking Camera Intrinsics Preset'''
+ """Add a Tracking Camera Intrinsics Preset"""
bl_idname = "clip.camera_preset_add"
bl_label = "Add Camera Preset"
preset_menu = "CLIP_MT_camera_presets"
@@ -408,7 +408,7 @@ class AddPresetTrackingCamera(AddPresetBase, Operator):
class AddPresetTrackingTrackColor(AddPresetBase, Operator):
- '''Add a Clip Track Color Preset'''
+ """Add a Clip Track Color Preset"""
bl_idname = "clip.track_color_preset_add"
bl_label = "Add Track Color Preset"
preset_menu = "CLIP_MT_track_color_presets"
@@ -426,7 +426,7 @@ class AddPresetTrackingTrackColor(AddPresetBase, Operator):
class AddPresetTrackingSettings(AddPresetBase, Operator):
- '''Add a motion tracking settings preset'''
+ """Add a motion tracking settings preset"""
bl_idname = "clip.tracking_settings_preset_add"
bl_label = "Add Tracking Settings Preset"
preset_menu = "CLIP_MT_tracking_settings_presets"
@@ -436,8 +436,6 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
]
preset_values = [
- "settings.default_tracker",
- "settings.default_pyramid_levels",
"settings.default_correlation_min",
"settings.default_pattern_size",
"settings.default_search_size",
@@ -453,7 +451,7 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
class AddPresetNodeColor(AddPresetBase, Operator):
- '''Add a Node Color Preset'''
+ """Add a Node Color Preset"""
bl_idname = "node.node_color_preset_add"
bl_label = "Add Node Color Preset"
preset_menu = "NODE_MT_node_color_presets"
@@ -471,7 +469,7 @@ class AddPresetNodeColor(AddPresetBase, Operator):
class AddPresetInterfaceTheme(AddPresetBase, Operator):
- '''Add a theme preset'''
+ """Add a theme preset"""
bl_idname = "wm.interface_theme_preset_add"
bl_label = "Add Tracking Settings Preset"
preset_menu = "USERPREF_MT_interface_theme_presets"
@@ -479,7 +477,7 @@ class AddPresetInterfaceTheme(AddPresetBase, Operator):
class AddPresetKeyconfig(AddPresetBase, Operator):
- '''Add a Key-config Preset'''
+ """Add a Key-config Preset"""
bl_idname = "wm.keyconfig_preset_add"
bl_label = "Add Keyconfig Preset"
preset_menu = "USERPREF_MT_keyconfigs"
@@ -502,7 +500,7 @@ class AddPresetKeyconfig(AddPresetBase, Operator):
class AddPresetOperator(AddPresetBase, Operator):
- '''Add an Application Interaction Preset'''
+ """Add an Application Interaction Preset"""
bl_idname = "wm.operator_preset_add"
bl_label = "Operator Preset"
preset_menu = "WM_MT_operator_presets"
diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
index 5ee7cf86142..9cb9dfc708c 100644
--- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
+++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
@@ -66,7 +66,7 @@ def guess_player_path(preset):
class PlayRenderedAnim(Operator):
- '''Play back rendered frames/movies using an external player'''
+ """Play back rendered frames/movies using an external player"""
bl_idname = "render.play_rendered_anim"
bl_label = "Play Rendered Animation"
bl_options = {'REGISTER'}
diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py
index c51ec74ddd6..ebb499012ea 100644
--- a/release/scripts/startup/bl_operators/sequencer.py
+++ b/release/scripts/startup/bl_operators/sequencer.py
@@ -25,7 +25,7 @@ from bpy.props import IntProperty
class SequencerCrossfadeSounds(Operator):
- '''Do cross-fading volume animation of two selected sound strips'''
+ """Do cross-fading volume animation of two selected sound strips"""
bl_idname = "sequencer.crossfade_sounds"
bl_label = "Crossfade sounds"
@@ -76,7 +76,7 @@ class SequencerCrossfadeSounds(Operator):
class SequencerCutMulticam(Operator):
- '''Cut multi-cam strip and select camera'''
+ """Cut multi-cam strip and select camera"""
bl_idname = "sequencer.cut_multicam"
bl_label = "Cut multicam"
@@ -118,7 +118,7 @@ class SequencerCutMulticam(Operator):
class SequencerDeinterlaceSelectedMovies(Operator):
- '''Deinterlace all selected movie sources'''
+ """Deinterlace all selected movie sources"""
bl_idname = "sequencer.deinterlace_selected_movies"
bl_label = "Deinterlace Movies"
diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
index d6f657683a5..b60b5257984 100644
--- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py
+++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py
@@ -46,11 +46,11 @@ def extend(obj, operator, EXTEND_MODE):
OTHER_INDEX = 2, 3, 0, 1
def extend_uvs(face_source, face_target, edge_key):
- '''
+ """
Takes 2 faces,
Projects its extends its UV coords onto the face next to it.
Both faces must share an edge
- '''
+ """
def face_edge_vs(vi):
vlen = len(vi)
@@ -224,7 +224,7 @@ def main(context, operator):
class FollowActiveQuads(Operator):
- '''Follow UVs from active quads along continuous face loops'''
+ """Follow UVs from active quads along continuous face loops"""
bl_idname = "uv.follow_active_quads"
bl_label = "Follow Active Quads"
bl_options = {'REGISTER', 'UNDO'}
@@ -232,7 +232,7 @@ class FollowActiveQuads(Operator):
mode = bpy.props.EnumProperty(
name="Edge Length Mode",
description="Method to space UV edge loops",
- items=(('EVEN', "Even", "Space all UVs evently"),
+ items=(('EVEN', "Even", "Space all UVs evenly"),
('LENGTH', "Length", "Average space UVs edge length of each loop")),
default='LENGTH',
)
diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
index b184c81d6a7..526d78c4c11 100644
--- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py
+++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
@@ -197,12 +197,12 @@ def lightmap_uvpack(meshes,
PREF_BOX_DIV=8,
PREF_MARGIN_DIV=512
):
- '''
+ """
BOX_DIV if the maximum division of the UV map that
a box may be consolidated into.
Basically, a lower value will be slower but waist less space
and a higher value will have more clumpy boxes but more wasted space
- '''
+ """
import time
from math import sqrt
@@ -545,7 +545,7 @@ from bpy.props import BoolProperty, FloatProperty, IntProperty
class LightMapPack(Operator):
- '''Follow UVs from active quads along continuous face loops'''
+ """Follow UVs from active quads along continuous face loops"""
bl_idname = "uv.lightmap_pack"
bl_label = "Lightmap Pack"
@@ -561,7 +561,7 @@ class LightMapPack(Operator):
PREF_CONTEXT = bpy.props.EnumProperty(
name="Selection",
- items=(('SEL_FACES', "Selected Faces", "Space all UVs evently"),
+ items=(('SEL_FACES', "Selected Faces", "Space all UVs evenly"),
('ALL_FACES', "All Faces", "Average space UVs edge length of each loop"),
('ALL_OBJECTS', "Selected Mesh Object", "Average space UVs edge length of each loop")
),
diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
index ac4aa96f655..9fa44cac812 100644
--- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py
+++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
@@ -492,7 +492,7 @@ def mergeUvIslands(islandList):
pass
if Intersect == 2: # Source inside target
- '''
+ """
We have an intersection, if we are inside the target
then move us 1 whole width across,
Its possible this is a bad idea since 2 skinny Angular faces
@@ -500,7 +500,7 @@ def mergeUvIslands(islandList):
since we have already tested for it.
It gives about 10% speedup with minimal errors.
- '''
+ """
# Move the test along its width + SMALL_NUM
#boxLeft += sourceIsland[4] + SMALL_NUM
boxLeft += sourceIsland[4]
@@ -694,11 +694,11 @@ def packIslands(islandList):
islandIdx -=1
continue
- '''Save the offset to be applied later,
+ """Save the offset to be applied later,
we could apply to the UVs now and allign them to the bottom left hand area
of the UV coords like the box packer imagines they are
but, its quicker just to remember their offset and
- apply the packing and offset in 1 pass '''
+ apply the packing and offset in 1 pass """
islandOffsetList.append((minx, miny))
# Add to boxList. use the island idx for the BOX id.
@@ -709,7 +709,7 @@ def packIslands(islandList):
# with the islands.
#print '\tPacking UV Islands...'
-#XXX Window.DrawProgressBar(0.7, 'Packing %i UV Islands...' % len(packBoxes) )
+#XXX Window.DrawProgressBar(0.7, "Packing %i UV Islands..." % len(packBoxes) )
# time1 = time.time()
packWidth, packHeight = geometry.box_pack_2d(packBoxes)
@@ -720,7 +720,7 @@ def packIslands(islandList):
# raise "Error packed boxes differs from original length"
#print '\tWriting Packed Data to faces'
-#XXX Window.DrawProgressBar(0.8, 'Writing Packed Data to faces')
+#XXX Window.DrawProgressBar(0.8, "Writing Packed Data to faces")
# Sort by ID, so there in sync again
islandIdx = len(islandList)
@@ -1104,8 +1104,9 @@ from bpy.props import FloatProperty
class SmartProject(Operator):
- '''This script projection unwraps the selected faces of a mesh ''' \
- '''(it operates on all selected mesh objects, and can be used to unwrap selected faces, or all faces)'''
+ """This script projection unwraps the selected faces of a mesh """ \
+ """(it operates on all selected mesh objects, and can be used """ \
+ """to unwrap selected faces, or all faces)"""
bl_idname = "uv.smart_project"
bl_label = "Smart UV Project"
bl_options = {'REGISTER', 'UNDO'}
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index fc19a989032..2977c5ccc2f 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -31,7 +31,8 @@ from rna_prop_ui import rna_idprop_ui_prop_get, rna_idprop_ui_prop_clear
class MESH_OT_delete_edgeloop(Operator):
- '''Delete an edge loop by merging the faces on each side to a single face loop'''
+ """Delete an edge loop by merging the faces on each side """ \
+ """to a single face loop"""
bl_idname = "mesh.delete_edgeloop"
bl_label = "Delete Edge Loop"
@@ -173,7 +174,7 @@ class BRUSH_OT_active_index_set(Operator):
class WM_OT_context_set_boolean(Operator):
- '''Set a context value'''
+ """Set a context value"""
bl_idname = "wm.context_set_boolean"
bl_label = "Context Set Boolean"
bl_options = {'UNDO', 'INTERNAL'}
@@ -189,7 +190,7 @@ class WM_OT_context_set_boolean(Operator):
class WM_OT_context_set_int(Operator): # same as enum
- '''Set a context value'''
+ """Set a context value"""
bl_idname = "wm.context_set_int"
bl_label = "Context Set"
bl_options = {'UNDO', 'INTERNAL'}
@@ -206,7 +207,7 @@ class WM_OT_context_set_int(Operator): # same as enum
class WM_OT_context_scale_int(Operator):
- '''Scale an int context value'''
+ """Scale an int context value"""
bl_idname = "wm.context_scale_int"
bl_label = "Context Set"
bl_options = {'UNDO', 'INTERNAL'}
@@ -249,7 +250,7 @@ class WM_OT_context_scale_int(Operator):
class WM_OT_context_set_float(Operator): # same as enum
- '''Set a context value'''
+ """Set a context value"""
bl_idname = "wm.context_set_float"
bl_label = "Context Set Float"
bl_options = {'UNDO', 'INTERNAL'}
@@ -266,7 +267,7 @@ class WM_OT_context_set_float(Operator): # same as enum
class WM_OT_context_set_string(Operator): # same as enum
- '''Set a context value'''
+ """Set a context value"""
bl_idname = "wm.context_set_string"
bl_label = "Context Set String"
bl_options = {'UNDO', 'INTERNAL'}
@@ -282,7 +283,7 @@ class WM_OT_context_set_string(Operator): # same as enum
class WM_OT_context_set_enum(Operator):
- '''Set a context value'''
+ """Set a context value"""
bl_idname = "wm.context_set_enum"
bl_label = "Context Set Enum"
bl_options = {'UNDO', 'INTERNAL'}
@@ -298,7 +299,7 @@ class WM_OT_context_set_enum(Operator):
class WM_OT_context_set_value(Operator):
- '''Set a context value'''
+ """Set a context value"""
bl_idname = "wm.context_set_value"
bl_label = "Context Set Value"
bl_options = {'UNDO', 'INTERNAL'}
@@ -319,7 +320,7 @@ class WM_OT_context_set_value(Operator):
class WM_OT_context_toggle(Operator):
- '''Toggle a context value'''
+ """Toggle a context value"""
bl_idname = "wm.context_toggle"
bl_label = "Context Toggle"
bl_options = {'UNDO', 'INTERNAL'}
@@ -338,7 +339,7 @@ class WM_OT_context_toggle(Operator):
class WM_OT_context_toggle_enum(Operator):
- '''Toggle a context value'''
+ """Toggle a context value"""
bl_idname = "wm.context_toggle_enum"
bl_label = "Context Toggle Values"
bl_options = {'UNDO', 'INTERNAL'}
@@ -371,7 +372,7 @@ class WM_OT_context_toggle_enum(Operator):
class WM_OT_context_cycle_int(Operator):
- """Set a context value. Useful for cycling active material, """
+ """Set a context value. Useful for cycling active material, """ \
"""vertex keys, groups' etc"""
bl_idname = "wm.context_cycle_int"
bl_label = "Context Int Cycle"
@@ -406,7 +407,7 @@ class WM_OT_context_cycle_int(Operator):
class WM_OT_context_cycle_enum(Operator):
- '''Toggle a context value'''
+ """Toggle a context value"""
bl_idname = "wm.context_cycle_enum"
bl_label = "Context Enum Cycle"
bl_options = {'UNDO', 'INTERNAL'}
@@ -458,8 +459,8 @@ class WM_OT_context_cycle_enum(Operator):
class WM_OT_context_cycle_array(Operator):
- '''Set a context array value. '''
- '''Useful for cycling the active mesh edit mode'''
+ """Set a context array value """ \
+ """(useful for cycling the active mesh edit mode)"""
bl_idname = "wm.context_cycle_array"
bl_label = "Context Array Cycle"
bl_options = {'UNDO', 'INTERNAL'}
@@ -519,7 +520,7 @@ class WM_OT_context_menu_enum(Operator):
class WM_OT_context_set_id(Operator):
- '''Toggle a context value'''
+ """Toggle a context value"""
bl_idname = "wm.context_set_id"
bl_label = "Set Library ID"
bl_options = {'UNDO', 'INTERNAL'}
@@ -575,7 +576,7 @@ data_path_item = StringProperty(
class WM_OT_context_collection_boolean_set(Operator):
- '''Set boolean values for a collection of items'''
+ """Set boolean values for a collection of items"""
bl_idname = "wm.context_collection_boolean_set"
bl_label = "Context Collection Boolean Set"
bl_options = {'UNDO', 'REGISTER', 'INTERNAL'}
@@ -634,7 +635,7 @@ class WM_OT_context_collection_boolean_set(Operator):
class WM_OT_context_modal_mouse(Operator):
- '''Adjust arbitrary values with mouse input'''
+ """Adjust arbitrary values with mouse input"""
bl_idname = "wm.context_modal_mouse"
bl_label = "Context Modal Mouse"
bl_options = {'GRAB_POINTER', 'BLOCKING', 'UNDO', 'INTERNAL'}
@@ -836,7 +837,7 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
class WM_OT_doc_view_manual(Operator):
- '''Load online manual'''
+ """Load online manual"""
bl_idname = "wm.doc_view_manual"
bl_label = "View Manual"
@@ -881,7 +882,7 @@ class WM_OT_doc_view_manual(Operator):
class WM_OT_doc_view(Operator):
- '''Load online reference docs'''
+ """Load online reference docs"""
bl_idname = "wm.doc_view"
bl_label = "View Documentation"
@@ -905,7 +906,7 @@ class WM_OT_doc_view(Operator):
class WM_OT_doc_edit(Operator):
- '''Load online reference docs'''
+ """Load online reference docs"""
bl_idname = "wm.doc_edit"
bl_label = "Edit Documentation"
@@ -1008,7 +1009,7 @@ rna_max = FloatProperty(
class WM_OT_properties_edit(Operator):
- '''Internal use (edit a property data_path)'''
+ """Internal use (edit a property data_path)"""
bl_idname = "wm.properties_edit"
bl_label = "Edit Property"
bl_options = {'REGISTER'} # only because invoke_props_popup requires.
@@ -1094,7 +1095,7 @@ class WM_OT_properties_edit(Operator):
class WM_OT_properties_add(Operator):
- '''Internal use (edit a property data_path)'''
+ """Internal use (edit a property data_path)"""
bl_idname = "wm.properties_add"
bl_label = "Add Property"
bl_options = {'UNDO'}
@@ -1137,7 +1138,7 @@ class WM_OT_properties_context_change(Operator):
class WM_OT_properties_remove(Operator):
- '''Internal use (edit a property data_path)'''
+ """Internal use (edit a property data_path)"""
bl_idname = "wm.properties_remove"
bl_label = "Remove Property"
bl_options = {'UNDO'}
@@ -1203,7 +1204,7 @@ class WM_OT_appconfig_activate(Operator):
class WM_OT_sysinfo(Operator):
- '''Generate System Info'''
+ """Generate System Info"""
bl_idname = "wm.sysinfo"
bl_label = "System Info"
@@ -1214,7 +1215,7 @@ class WM_OT_sysinfo(Operator):
class WM_OT_copy_prev_settings(Operator):
- '''Copy settings from previous version'''
+ """Copy settings from previous version"""
bl_idname = "wm.copy_prev_settings"
bl_label = "Copy Previous Settings"
@@ -1251,7 +1252,7 @@ class WM_OT_copy_prev_settings(Operator):
class WM_OT_blenderplayer_start(Operator):
- '''Launch the blender-player with the current blend-file'''
+ """Launch the blender-player with the current blend-file"""
bl_idname = "wm.blenderplayer_start"
bl_label = "Start Game In Player"
@@ -1394,8 +1395,8 @@ class WM_OT_keyconfig_export(Operator):
if not self.filepath:
raise Exception("Filepath not set")
- if not self.filepath.endswith('.py'):
- self.filepath += '.py'
+ if not self.filepath.endswith(".py"):
+ self.filepath += ".py"
wm = context.window_manager
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index 6bec652045e..03aa41bb9aa 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -203,7 +203,7 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="")
col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
- col.operator("poselib.action_sanitise", icon='HELP', text="") # XXX: put in menu?
+ col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
# properties for active marker
if pose_marker_active is not None:
@@ -304,7 +304,7 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
layout = self.layout
ob = context.object
- avs = ob.pose.animation_visualisation
+ avs = ob.pose.animation_visualization
pchan = context.active_pose_bone
mpath = pchan.motion_path if pchan else None
@@ -323,7 +323,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from
def draw(self, context):
ob = context.object
- self.draw_settings(context, ob.pose.animation_visualisation, bones=True)
+ self.draw_settings(context, ob.pose.animation_visualization, bones=True)
class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index 87ac56c1104..1e9fd5dd8a9 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -33,7 +33,7 @@ class CurveButtonsPanel():
class CurveButtonsPanelCurve(CurveButtonsPanel):
- '''Same as above but for curves only'''
+ """Same as above but for curves only"""
@classmethod
def poll(cls, context):
@@ -41,7 +41,7 @@ class CurveButtonsPanelCurve(CurveButtonsPanel):
class CurveButtonsPanelActive(CurveButtonsPanel):
- '''Same as above but for curves only'''
+ """Same as above but for curves only"""
@classmethod
def poll(cls, context):
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index abcd27c308e..7485e532bd4 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -971,8 +971,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
split = layout.split()
col = split.column(align=True)
- col.operator("object.skin_loose_mark_clear", text="Mark Loose").action = "MARK"
- col.operator("object.skin_loose_mark_clear", text="Clear Loose").action = "CLEAR"
+ col.operator("object.skin_loose_mark_clear", text="Mark Loose").action = 'MARK'
+ col.operator("object.skin_loose_mark_clear", text="Clear Loose").action = 'CLEAR'
col = split.column()
col.operator("object.skin_root_mark", text="Mark Root")
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py
index 0b6e4154050..c25c0c7d40d 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -454,7 +454,7 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
rd = context.scene.game_settings.recast_data
- layout.operator("mesh.navmesh_make", text='Build navigation mesh')
+ layout.operator("mesh.navmesh_make", text="Build navigation mesh")
col = layout.column()
col.label(text="Rasterization:")
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 3c30f27f16b..68b261cc1d5 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -159,7 +159,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
- ob = context.object
+ obj = context.object
row = layout.row(align=True)
row.operator("object.group_link", text="Add to Group")
@@ -167,8 +167,13 @@ class OBJECT_PT_groups(ObjectButtonsPanel, Panel):
# XXX, this is bad practice, yes, I wrote it :( - campbell
index = 0
+ obj_name = obj.name
for group in bpy.data.groups:
- if ob.name in group.objects:
+ # XXX this is slow and stupid!, we need 2 checks, one thats fast
+ # and another that we can be sure its not a name collission
+ # from linked library data
+ group_objects = group.objects
+ if obj_name in group.objects and obj in group_objects[:]:
col = layout.column(align=True)
col.context_pointer_set("group", group)
@@ -214,7 +219,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
col = split.column()
col.prop(ob, "show_name", text="Name")
col.prop(ob, "show_axis", text="Axis")
- if ob.type in {"MESH", "CURVE", "SURFACE", "META", "FONT"}:
+ if ob.type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}:
# Makes no sense for cameras, armtures, etc.!
col.prop(ob, "show_wire", text="Wire")
# Only useful with object having faces/materials...
@@ -304,7 +309,7 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
layout = self.layout
ob = context.object
- avs = ob.animation_visualisation
+ avs = ob.animation_visualization
mpath = ob.motion_path
self.draw_settings(context, avs, mpath)
@@ -321,7 +326,7 @@ class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit fr
def draw(self, context):
ob = context.object
- self.draw_settings(context, ob.animation_visualisation)
+ self.draw_settings(context, ob.animation_visualization)
class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index a667125d4ea..8d220e5aae6 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -86,7 +86,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
- if context.scene.render.engine == "BLENDER_GAME":
+ if context.scene.render.engine == 'BLENDER_GAME':
layout.label("Not available in the Game Engine")
return
diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py
index 2054215df4a..65603c65041 100644
--- a/release/scripts/startup/bl_ui/properties_physics_field.py
+++ b/release/scripts/startup/bl_ui/properties_physics_field.py
@@ -195,7 +195,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel):
col = split.column()
col.label(text="Particle:")
col.prop(settings, "permeability", slider=True)
- col.prop(settings, "stickness")
+ col.prop(settings, "stickiness")
col.prop(settings, "use_particle_kill")
col.label(text="Particle Damping:")
sub = col.column(align=True)
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 751f3e18acc..08278c02693 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -117,10 +117,14 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
col.prop(fluid, "use_animated_mesh")
col = split.column()
- col.label(text="Slip Type:")
- col.prop(fluid, "slip_type", text="")
+ subsplit = col.split()
+ subcol = subsplit.column()
+ if fluid.use_animated_mesh:
+ subcol.enabled = False
+ subcol.label(text="Slip Type:")
+ subcol.prop(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
- col.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
+ subcol.prop(fluid, "partial_slip_factor", slider=True, text="Amount")
col.label(text="Impact:")
col.prop(fluid, "impact_factor", text="Factor")
@@ -223,10 +227,10 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
col.label(text="Use Scene Size Units", icon='SCENE_DATA')
sub = col.column()
sub.enabled = False
- sub.prop(fluid, "simulation_scale", text="Metres")
+ sub.prop(fluid, "simulation_scale", text="Meters")
else:
col.label(text="Real World Size:")
- col.prop(fluid, "simulation_scale", text="Metres")
+ col.prop(fluid, "simulation_scale", text="Meters")
col = split.column()
col.label(text="Viscosity Presets:")
diff --git a/release/scripts/startup/bl_ui/space_console.py b/release/scripts/startup/bl_ui/space_console.py
index 5ec9d06ec89..7f9699f457b 100644
--- a/release/scripts/startup/bl_ui/space_console.py
+++ b/release/scripts/startup/bl_ui/space_console.py
@@ -74,7 +74,7 @@ class CONSOLE_MT_language(Menu):
languages = []
for modname, mod in sys.modules.items():
if modname.startswith("console_") and hasattr(mod, "execute"):
- languages.append(modname.split('_', 1)[-1])
+ languages.append(modname.split("_", 1)[-1])
languages.sort()
@@ -83,7 +83,7 @@ class CONSOLE_MT_language(Menu):
def add_scrollback(text, text_type):
- for l in text.split('\n'):
+ for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
type=text_type)
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 44fb429ffe7..cfe5d66740c 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -797,12 +797,12 @@ class IMAGE_UV_sculpt_curve(Panel):
layout.template_curve_mapping(brush, "curve")
row = layout.row(align=True)
- row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
- row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
- row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
- row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
- row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
- row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
+ row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
+ row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
+ row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
+ row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
+ row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
+ row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
class IMAGE_UV_sculpt(Panel, ImagePaintPanel):
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index bb29e415c19..40c7b632247 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -217,7 +217,7 @@ class NODE_PT_properties(Panel):
class NODE_PT_quality(bpy.types.Panel):
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
- bl_label = "Quality"
+ bl_label = "Performance"
@classmethod
def poll(cls, context):
@@ -233,7 +233,9 @@ class NODE_PT_quality(bpy.types.Panel):
layout.prop(tree, "edit_quality", text="Edit")
layout.prop(tree, "chunk_size")
layout.prop(tree, "use_opencl")
-
+ layout.prop(tree, "two_pass")
+ layout.prop(snode, "show_highlight")
+
class NODE_MT_node_color_presets(Menu):
"""Predefined node color"""
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 76053987843..a71a2870bee 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -117,7 +117,7 @@ class SEQUENCER_MT_view(Menu):
layout.operator_context = 'INVOKE_DEFAULT'
# # XXX, invokes in the header view
- # layout.operator("sequencer.view_ghost_border", text='Overlay Border')
+ # layout.operator("sequencer.view_ghost_border", text="Overlay Border")
layout.operator("sequencer.view_selected")
@@ -820,7 +820,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
col.label(text="Build JPEG quality")
col.prop(strip.proxy, "quality")
- if strip.type == "MOVIE":
+ if strip.type == 'MOVIE':
col = layout.column()
col.label(text="Use timecode index:")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 0f756913cdb..18c5cff1b99 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1121,7 +1121,7 @@ class VIEW3D_MT_brush(Menu):
sculpt_tool = brush.sculpt_tool
layout.separator()
- layout.operator_menu_enum("brush.curve_preset", "shape", text='Curve Preset')
+ layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
layout.separator()
if sculpt_tool != 'GRAB':
@@ -1772,7 +1772,7 @@ class VIEW3D_MT_edit_mesh_vertices(Menu):
layout.operator("mesh.vertices_smooth")
layout.operator("mesh.remove_doubles")
- layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {"VERT"}
+ layout.operator("mesh.sort_elements", text="Sort Vertices").elements = {'VERT'}
layout.operator("mesh.select_vertex_path")
@@ -1827,7 +1827,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
layout.operator("mesh.bevel")
layout.operator("mesh.edge_split")
layout.operator("mesh.bridge_edge_loops")
- layout.operator("mesh.sort_elements", text="Sort Edges").elements = {"EDGE"}
+ layout.operator("mesh.sort_elements", text="Sort Edges").elements = {'EDGE'}
layout.separator()
@@ -1860,7 +1860,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
layout.operator("mesh.bevel")
layout.operator("mesh.solidify")
layout.operator("mesh.wireframe")
- layout.operator("mesh.sort_elements", text="Sort Faces").elements = {"FACE"}
+ layout.operator("mesh.sort_elements", text="Sort Faces").elements = {'FACE'}
layout.separator()
diff --git a/release/scripts/templates/addon_add_object.py b/release/scripts/templates/addon_add_object.py
index 3900f595584..a2d7315af4b 100644
--- a/release/scripts/templates/addon_add_object.py
+++ b/release/scripts/templates/addon_add_object.py
@@ -65,7 +65,7 @@ def add_object_button(self, context):
self.layout.operator(
OBJECT_OT_add_object.bl_idname,
text="Add Object",
- icon="PLUGIN")
+ icon='PLUGIN')
def register():
diff --git a/release/scripts/templates/gamelogic.py b/release/scripts/templates/gamelogic.py
index c6d15850a4e..01ac27c56cd 100644
--- a/release/scripts/templates/gamelogic.py
+++ b/release/scripts/templates/gamelogic.py
@@ -21,23 +21,23 @@ def main():
# Some example functions, remove to write your own script.
# check for a positive sensor, will run on any object without errors.
- print('Logic info for KX_GameObject', own.name)
+ print("Logic info for KX_GameObject", own.name)
input = False
for sens in cont.sensors:
# The sensor can be on another object, we may want to use it
own_sens = sens.owner
- print(' sensor:', sens.name, end=' ')
+ print(" sensor:", sens.name, end=" ")
if sens.positive:
- print('(true)')
+ print("(true)")
input = True
else:
- print('(false)')
+ print("(false)")
for actu in cont.actuators:
# The actuator can be on another object, we may want to use it
own_actu = actu.owner
- print(' actuator:', actu.name)
+ print(" actuator:", actu.name)
# This runs the actuator or turns it off
# note that actuators will continue to run unless explicitly turned off.
@@ -49,25 +49,25 @@ def main():
# Its also good practice to get sensors and actuators by name
# rather then index so any changes to their order wont break the script.
- # sens_key = cont.sensors['key_sensor']
- # actu_motion = cont.actuators['motion']
+ # sens_key = cont.sensors["key_sensor"]
+ # actu_motion = cont.actuators["motion"]
# Loop through all other objects in the scene
sce = bge.logic.getCurrentScene()
- print('Scene Objects:', sce.name)
+ print("Scene Objects:", sce.name)
for ob in sce.objects:
- print(' ', ob.name, ob.worldPosition)
+ print(" ", ob.name, ob.worldPosition)
# Example where collision objects are checked for their properties
# adding to our objects "life" property
"""
- actu_collide = cont.sensors['collision_sens']
+ actu_collide = cont.sensors["collision_sens"]
for ob in actu_collide.objectHitList:
# Check to see the object has this property
- if ob.has_key('life'):
- own['life'] += ob['life']
- ob['life'] = 0
- print(own['life'])
+ if "life" in ob:
+ own["life"] += ob["life"]
+ ob["life"] = 0
+ print(own["life"])
"""
main()
diff --git a/release/scripts/templates/operator_node.py b/release/scripts/templates/operator_node.py
index 9c19993a38a..b689ce7634e 100644
--- a/release/scripts/templates/operator_node.py
+++ b/release/scripts/templates/operator_node.py
@@ -1,7 +1,7 @@
import bpy
-def main(operator, context):
+def main(context):
space = context.space_data
node_tree = space.node_tree
node_active = context.active_node
diff --git a/release/scripts/templates/ui_panel_simple.py b/release/scripts/templates/ui_panel_simple.py
index 6226240ff87..3fab7d92675 100644
--- a/release/scripts/templates/ui_panel_simple.py
+++ b/release/scripts/templates/ui_panel_simple.py
@@ -5,8 +5,8 @@ class HelloWorldPanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Hello World Panel"
bl_idname = "OBJECT_PT_hello"
- bl_space_type = "PROPERTIES"
- bl_region_type = "WINDOW"
+ bl_space_type = 'PROPERTIES'
+ bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 527d85c7cf3..7df491c0fef 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -113,7 +113,7 @@ struct bActionGroup *get_active_actiongroup(struct bAction *act);
void set_active_action_group(struct bAction *act, struct bActionGroup *agrp, short select);
/* Sync colors used for action/bone group with theme settings */
-void action_group_colors_sync(struct bActionGroup *grp);
+void action_group_colors_sync(struct bActionGroup *grp, const struct bActionGroup *ref_grp);
/* Add a new action group with the given name to the action */
struct bActionGroup *action_groups_add_new(struct bAction *act, const char name[]);
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h
index d605776ed50..acb9234b2d4 100644
--- a/source/blender/blenkernel/BKE_anim.h
+++ b/source/blender/blenkernel/BKE_anim.h
@@ -43,7 +43,7 @@ struct bPoseChannel;
struct ReportList;
/* ---------------------------------------------------- */
-/* Animation Visualisation */
+/* Animation Visualization */
void animviz_settings_init(struct bAnimVizSettings *avs);
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 699eb0a9f02..909ed471081 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -157,7 +157,7 @@ void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf);
/* called on frame change or before render */
void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
void BKE_image_user_check_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
-int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr);
+int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range);
void BKE_image_user_file_path(struct ImageUser *iuser, struct Image *ima, char *path);
/* sets index offset for multilayer files */
diff --git a/source/blender/blenkernel/BKE_mask.h b/source/blender/blenkernel/BKE_mask.h
index 0682b16536c..ee7c13ba7cb 100644
--- a/source/blender/blenkernel/BKE_mask.h
+++ b/source/blender/blenkernel/BKE_mask.h
@@ -27,6 +27,7 @@
#ifndef __BKE_MASK_H__
#define __BKE_MASK_H__
+struct ListBase;
struct Main;
struct Mask;
struct MaskParent;
@@ -50,12 +51,16 @@ void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay);
void BKE_mask_layer_free_shapes(struct MaskLayer *masklay);
void BKE_mask_layer_free(struct MaskLayer *masklay);
+void BKE_mask_layer_free_list(struct ListBase *masklayers);
void BKE_mask_spline_free(struct MaskSpline *spline);
struct MaskSpline *BKE_mask_spline_copy(struct MaskSpline *spline);
void BKE_mask_point_free(struct MaskSplinePoint *point);
void BKE_mask_layer_unique_name(struct Mask *mask, struct MaskLayer *masklay);
+struct MaskLayer *BKE_mask_layer_copy(struct MaskLayer *layer);
+void BKE_mask_layer_copy_list(struct ListBase *masklayers_new, struct ListBase *masklayers);
+
/* splines */
struct MaskSpline *BKE_mask_spline_add(struct MaskLayer *masklay);
@@ -170,6 +175,11 @@ void BKE_mask_layer_shape_changed_remove(struct MaskLayer *masklay, int index, i
/* rasterization */
int BKE_mask_get_duration(struct Mask *mask);
+
+void BKE_mask_rasterize_layers(struct ListBase *masklayers, int width, int height, float *buffer,
+ const short do_aspect_correct, const short do_mask_aa,
+ const short do_feather);
+
void BKE_mask_rasterize(struct Mask *mask, int width, int height, float *buffer,
const short do_aspect_correct, const short do_mask_aa,
const short do_feather);
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 8aa25a235a8..2407330a237 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -42,6 +42,7 @@ struct ID;
struct Object;
struct Mesh;
struct MTFace;
+struct Scene;
/* materials */
@@ -92,6 +93,9 @@ int material_in_material(struct Material *parmat, struct Material *mat);
void ramp_blend(int type, float r_col[3], const float fac, const float col[3]);
+/* driver update hacks */
+void material_drivers_update(struct Scene *scene, struct Material *mat, float ctime);
+
/* copy/paste */
void clear_matcopybuf(void);
void free_matcopybuf(void);
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 551a31509a3..3b675f3b620 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -345,6 +345,7 @@ void modifiers_clearErrors(struct Object *ob);
int modifiers_getCageIndex(struct Scene *scene, struct Object *ob,
int *lastPossibleCageIndex_r, int virtual_);
+int modifiers_isModifierEnabled(struct Object *ob, int modifierType);
int modifiers_isSoftbodyEnabled(struct Object *ob);
int modifiers_isClothEnabled(struct Object *ob);
int modifiers_isParticleEnabled(struct Object *ob);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 558db1c8742..723a0e32605 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -320,9 +320,6 @@ if(WITH_PYTHON)
list(APPEND INC
../python
)
- list(APPEND INC_SYS
- ${PYTHON_INCLUDE_DIRS}
- )
add_definitions(-DWITH_PYTHON)
if(WITH_PYTHON_SECURITY)
diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript
index 819632414d9..1b150848b7e 100644
--- a/source/blender/blenkernel/SConscript
+++ b/source/blender/blenkernel/SConscript
@@ -32,7 +32,6 @@ if env['WITH_BF_FRAMESERVER']:
if env['WITH_BF_PYTHON']:
incs += ' ../python'
- incs += ' ' + env['BF_PYTHON_INC']
defs.append('WITH_PYTHON')
if env['BF_DEBUG']:
defs.append('DEBUG')
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index b3d2e3371f4..8d1707725b5 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -253,7 +253,7 @@ void set_active_action_group(bAction *act, bActionGroup *agrp, short select)
}
/* Sync colors used for action/bone group with theme settings */
-void action_group_colors_sync(bActionGroup *grp)
+void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp)
{
/* only do color copying if using a custom color (i.e. not default color) */
if (grp->customCol) {
@@ -265,9 +265,15 @@ void action_group_colors_sync(bActionGroup *grp)
memcpy(&grp->cs, col_set, sizeof(ThemeWireColor));
}
else {
- /* init custom colors with a generic multi-color rgb set, if not initialized already
- * (for custom color set) */
- if (grp->cs.solid[0] == 0) {
+ /* if a reference group is provided, use the custom color from there... */
+ if (ref_grp) {
+ /* assumption: reference group has a color set */
+ memcpy(&grp->cs, &ref_grp->cs, sizeof(ThemeWireColor));
+ }
+ /* otherwise, init custom color with a generic/placeholder color set if
+ * no previous theme color was used that we can just keep using
+ */
+ else if (grp->cs.solid[0] == 0) {
/* define for setting colors in theme below */
rgba_char_args_set(grp->cs.solid, 0xff, 0x00, 0x00, 255);
rgba_char_args_set(grp->cs.select, 0x81, 0xe6, 0x14, 255);
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index a0cfc4295ef..52399801691 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -78,9 +78,9 @@
static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int par_index, int level, int animated);
/* ******************************************************************** */
-/* Animation Visualisation */
+/* Animation Visualization */
-/* Initialize the default settings for animation visualisation */
+/* Initialize the default settings for animation visualization */
void animviz_settings_init(bAnimVizSettings *avs)
{
/* sanity check */
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index e5701927b07..e4ecdf245d1 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1864,7 +1864,7 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li
/* prepare template for 'evaluation strip'
* - based on the transition strip's evaluation strip data
* - strip_mode is NES_TIME_TRANSITION_* based on which endpoint
- * - strip_time is the 'normalised' (i.e. in-strip) time for evaluation,
+ * - strip_time is the 'normalized' (i.e. in-strip) time for evaluation,
* which doubles up as an additional weighting factor for the strip influences
* which allows us to appear to be 'interpolating' between the two extremes
*/
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 96959398bc2..c10b1e2d4f4 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2049,7 +2049,8 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
cross_v3_v3v3(raxis, rmat[1], splineVec);
rangle = dot_v3v3(rmat[1], splineVec);
- rangle = acos(MAX2(-1.0f, MIN2(1.0f, rangle)));
+ CLAMP(rangle, -1.0f, 1.0f);
+ rangle = acosf(rangle);
/* multiply the magnitude of the angle by the influence of the constraint to
* control the influence of the SplineIK effect
@@ -2207,7 +2208,7 @@ void BKE_pchan_to_mat4(bPoseChannel *pchan, float chan_mat[4][4])
axis_angle_to_mat3(rmat, pchan->rotAxis, pchan->rotAngle);
}
else {
- /* quats are normalised before use to eliminate scaling issues */
+ /* quats are normalized before use to eliminate scaling issues */
float quat[4];
/* NOTE: we now don't normalize the stored values anymore, since this was kindof evil in some cases
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index d99c36b6c91..7acbcbf6c93 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -274,7 +274,7 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM
// Decrease in magnitude of relative tangential velocity due to coulomb friction
// in original formula "magrelVel" should be the "change of relative velocity in normal direction"
- magtangent = MIN2(clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf(dot_v3v3(vrel_t_pre, vrel_t_pre)));
+ magtangent = minf(clmd->coll_parms->friction * 0.01f * magrelVel, sqrtf(dot_v3v3(vrel_t_pre, vrel_t_pre)));
// Apply friction impulse.
if ( magtangent > ALMOST_ZERO ) {
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index a1e67ebd414..05a2cfee8e6 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -66,6 +66,7 @@
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
+#include "BKE_material.h"
#include "BKE_mball.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
@@ -311,7 +312,7 @@ static void dag_add_driver_relation(AnimData *adt, DagForest *dag, DagNode *node
for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
ChannelDriver *driver = fcu->driver;
DriverVar *dvar;
- int isdata_fcu = isdata || (fcu->rna_path && strstr(fcu->rna_path, "modifiers["));
+ int isdata_fcu = (isdata) || (fcu->rna_path && strstr(fcu->rna_path, "modifiers["));
/* loop over variables to get the target relationships */
for (dvar = driver->variables.first; dvar; dvar = dvar->next) {
@@ -347,6 +348,52 @@ static void dag_add_driver_relation(AnimData *adt, DagForest *dag, DagNode *node
}
}
+/* XXX: forward def for material driver handling... */
+static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Material *ma);
+
+/* recursive handling for material nodetree drivers */
+static void dag_add_material_nodetree_driver_relations(DagForest *dag, DagNode *node, bNodeTree *ntree, Material *rootma)
+{
+ bNode *n;
+ Material *ma;
+
+ /* nodetree itself */
+ if (ntree->adt) {
+ dag_add_driver_relation(ntree->adt, dag, node, 1);
+ }
+
+ /* nodetree's nodes... */
+ for (n = ntree->nodes.first; n; n = n->next) {
+ if (n->id && GS(n->id->name) == ID_MA) {
+ ma = (Material *)n->id;
+ if (ma != rootma) {
+ dag_add_material_driver_relations(dag, node, ma);
+ }
+ }
+ else if (n->type == NODE_GROUP && n->id) {
+ dag_add_material_nodetree_driver_relations(dag, node, (bNodeTree *)n->id, rootma);
+ }
+ }
+}
+
+/* recursive handling for material drivers */
+static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Material *ma)
+{
+ /* material itself */
+ if (ma->adt) {
+ dag_add_driver_relation(ma->adt, dag, node, 1);
+ }
+
+ /* textures */
+ // TODO...
+ //dag_add_texture_driver_relations(DagForest *dag, DagNode *node, ID *id);
+
+ /* material's nodetree */
+ if (ma->nodetree) {
+ dag_add_material_nodetree_driver_relations(dag, node, ma->nodetree, ma);
+ }
+}
+
static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Object *ob, DagNode *node)
{
Base *base;
@@ -516,7 +563,11 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
/* softbody collision */
if ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_LATTICE)) {
- if (modifiers_isSoftbodyEnabled(ob) || modifiers_isClothEnabled(ob) || ob->particlesystem.first)
+ if (modifiers_isModifierEnabled(ob, eModifierType_Softbody)
+ || modifiers_isModifierEnabled(ob, eModifierType_Cloth)
+ || modifiers_isModifierEnabled(ob, eModifierType_Smoke)
+ || modifiers_isModifierEnabled(ob, eModifierType_DynamicPaint)
+ || ob->particlesystem.first)
dag_add_collision_field_relation(dag, scene, ob, node); /* TODO: use effectorweight->group */
}
@@ -572,6 +623,20 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
break;
}
+ /* material drivers */
+ if (ob->totcol) {
+ int a;
+
+ for (a = 1; a <= ob->totcol; a++) {
+ Material *ma = give_current_material(ob, a);
+
+ if (ma) {
+ /* recursively figure out if there are drivers, and hook these up to this object */
+ dag_add_material_driver_relations(dag, node, ma);
+ }
+ }
+ }
+
/* particles */
psys = ob->particlesystem.first;
if (psys) {
@@ -605,15 +670,15 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
/* note that this relation actually runs in the wrong direction, the problem
* is that dupli system all have this (due to parenting), and the render
* engine instancing assumes particular ordering of objects in list */
- dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation");
+ dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualization");
if (part->dup_ob->type == OB_MBALL)
- dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualisation");
+ dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Object Visualization");
}
if (part->ren_as == PART_DRAW_GR && part->dup_group) {
for (go = part->dup_group->gobject.first; go; go = go->next) {
node2 = dag_get_node(dag, go->ob);
- dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Particle Group Visualisation");
+ dag_add_relation(dag, node2, node, DAG_RL_OB_OB, "Particle Group Visualization");
}
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 2493507dca4..6e5d6ffb0e9 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1386,17 +1386,18 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
ListBase top_capbase = {NULL, NULL};
for (dlb = dlbev.first; dlb; dlb = dlb->next) {
- int i, start, steps;
- float bevfac1 = MIN2(cu->bevfac1, cu->bevfac2), bevfac2 = MAX2(cu->bevfac1, cu->bevfac2);
+ const float bevfac1 = minf(cu->bevfac1, cu->bevfac2);
+ const float bevfac2 = maxf(cu->bevfac1, cu->bevfac2);
float firstblend = 0.0f, lastblend = 0.0f;
+ int i, start, steps;
- if (cu->bevfac1 - cu->bevfac2 == 0.0f)
+ if (bevfac2 - bevfac1 == 0.0f)
continue;
start = (int)(bevfac1 * (bl->nr - 1));
steps = 2 + (int)((bevfac2) * (bl->nr - 1)) - start;
- firstblend = 1.0f - ((float)bevfac1 * (bl->nr - 1) - (int)((float)bevfac1 * (bl->nr - 1)));
- lastblend = (float)bevfac2 * (bl->nr - 1) - (int)((float)bevfac2 * (bl->nr - 1));
+ firstblend = 1.0f - (bevfac1 * (bl->nr - 1) - (int)(bevfac1 * (bl->nr - 1)));
+ lastblend = bevfac2 * (bl->nr - 1) - (int)(bevfac2 * (bl->nr - 1));
if (steps > bl->nr) {
steps = bl->nr;
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index a6467af2773..dd5751c5d1f 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1686,7 +1686,7 @@ struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd,
c[1] = material->g;
c[2] = material->b;
}
- else { /* default grey */
+ else { /* default gray */
c[0] = 0.65f;
c[1] = 0.65f;
c[2] = 0.65f;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index b7ede15d00b..f981ecaf810 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -285,7 +285,7 @@ static FModifierTypeInfo FMI_GENERATOR = {
* x is the evaluation 'time', and 'y' is the resultant value
*
* Functions available are
- * sin, cos, tan, sinc (normalised sin), natural log, square root
+ * sin, cos, tan, sinc (normalized sin), natural log, square root
*/
static void fcm_fn_generator_new_data(void *mdata)
@@ -297,7 +297,7 @@ static void fcm_fn_generator_new_data(void *mdata)
data->phase_multiplier = 1.0f;
}
-/* Unary 'normalised sine' function
+/* Unary 'normalized sine' function
* y = sin(PI + x) / (PI * x),
* except for x = 0 when y = 1.
*/
@@ -326,7 +326,7 @@ static void fcm_fn_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float
case FCM_GENERATOR_FN_COS: /* cosine wave */
fn = cos;
break;
- case FCM_GENERATOR_FN_SINC: /* normalised sine wave */
+ case FCM_GENERATOR_FN_SINC: /* normalized sine wave */
fn = sinc;
break;
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 061530965ef..5d33c8fbcbf 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -699,7 +699,7 @@ makebreak:
yof -= linedist;
- maxlen = MAX2(maxlen, (xof - tb->x / cu->fsize));
+ maxlen = maxf(maxlen, (xof - tb->x / cu->fsize));
linedata[lnr] = xof - tb->x / cu->fsize;
linedata2[lnr] = cnr;
linedata3[lnr] = tb->w / cu->fsize;
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index beaf8f719e3..d2a2412843a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -2784,10 +2784,14 @@ ImBuf *BKE_image_get_ibuf(Image *ima, ImageUser *iuser)
return BKE_image_acquire_ibuf(ima, iuser, NULL);
}
-int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr)
+int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range)
{
const int len = (iuser->fie_ima * iuser->frames) / 2;
+ if (r_is_in_range) {
+ *r_is_in_range = FALSE;
+ }
+
if (len == 0) {
return 0;
}
@@ -2800,10 +2804,23 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr)
cfra = ((cfra) % len);
if (cfra < 0) cfra += len;
if (cfra == 0) cfra = len;
+
+ if (r_is_in_range) {
+ *r_is_in_range = TRUE;
+ }
}
- if (cfra < 0) cfra = 0;
- else if (cfra > len) cfra = len;
+ if (cfra < 0) {
+ cfra = 0;
+ }
+ else if (cfra > len) {
+ cfra = len;
+ }
+ else {
+ if (r_is_in_range) {
+ *r_is_in_range = TRUE;
+ }
+ }
/* convert current frame to current field */
cfra = 2 * (cfra);
@@ -2812,7 +2829,6 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr)
/* transform to images space */
framenr = (cfra + iuser->fie_ima - 2) / iuser->fie_ima;
if (framenr > iuser->frames) framenr = iuser->frames;
- framenr += iuser->offset;
if (iuser->cycl) {
framenr = ((framenr) % len);
@@ -2820,6 +2836,9 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr)
if (framenr == 0) framenr = len;
}
+ /* important to apply after else we cant loop on frames 100 - 110 for eg. */
+ framenr += iuser->offset;
+
return framenr;
}
}
@@ -2827,7 +2846,15 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr)
void BKE_image_user_frame_calc(ImageUser *iuser, int cfra, int fieldnr)
{
if (iuser) {
- const int framenr = BKE_image_user_frame_get(iuser, cfra, fieldnr);
+ short is_in_range;
+ const int framenr = BKE_image_user_frame_get(iuser, cfra, fieldnr, &is_in_range);
+
+ if (is_in_range) {
+ iuser->flag |= IMA_USER_FRAME_IN_RANGE;
+ }
+ else {
+ iuser->flag &= ~IMA_USER_FRAME_IN_RANGE;
+ }
/* allows image users to handle redraws */
if (iuser->flag & IMA_ANIM_ALWAYS)
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index 2767a67086b..b400332db81 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -188,6 +188,41 @@ void BKE_mask_layer_unique_name(Mask *mask, MaskLayer *masklay)
BLI_uniquename(&mask->masklayers, masklay, "MaskLayer", '.', offsetof(MaskLayer, name), sizeof(masklay->name));
}
+MaskLayer *BKE_mask_layer_copy(MaskLayer *layer)
+{
+ MaskLayer *layer_new;
+ MaskSpline *spline;
+
+ layer_new = MEM_callocN(sizeof(MaskLayer), "new mask layer");
+
+ BLI_strncpy(layer_new->name, layer->name, sizeof(layer_new->name));
+
+ layer_new->alpha = layer->alpha;
+ layer_new->blend = layer->blend;
+ layer_new->blend_flag = layer->blend_flag;
+ layer_new->flag = layer->flag;
+ layer_new->restrictflag = layer->restrictflag;
+
+ for (spline = layer->splines.first; spline; spline = spline->next) {
+ MaskSpline *spline_new = BKE_mask_spline_copy(spline);
+
+ BLI_addtail(&layer_new->splines, spline_new);
+ }
+
+ return layer_new;
+}
+
+void BKE_mask_layer_copy_list(ListBase *masklayers_new, ListBase *masklayers)
+{
+ MaskLayer *layer;
+
+ for (layer = masklayers->first; layer; layer = layer->next) {
+ MaskLayer *layer_new = BKE_mask_layer_copy(layer);
+
+ BLI_addtail(masklayers_new, layer_new);
+ }
+}
+
/* splines */
MaskSpline *BKE_mask_spline_add(MaskLayer *masklay)
@@ -988,21 +1023,34 @@ void BKE_mask_spline_free(MaskSpline *spline)
MEM_freeN(spline);
}
+static MaskSplinePoint *mask_spline_points_copy(MaskSplinePoint *points, int tot_point)
+{
+ MaskSplinePoint *npoints;
+ int i;
+
+ npoints = MEM_dupallocN(points);
+
+ for (i = 0; i < tot_point; i++) {
+ MaskSplinePoint *point = &npoints[i];
+
+ if (point->uw)
+ point->uw = MEM_dupallocN(point->uw);
+ }
+
+ return npoints;
+}
+
MaskSpline *BKE_mask_spline_copy(MaskSpline *spline)
{
MaskSpline *nspline = MEM_callocN(sizeof(MaskSpline), "new spline");
- int i;
*nspline = *spline;
nspline->points_deform = NULL;
- nspline->points = MEM_dupallocN(nspline->points);
-
- for (i = 0; i < nspline->tot_point; i++) {
- MaskSplinePoint *point = &nspline->points[i];
+ nspline->points = mask_spline_points_copy(spline->points, spline->tot_point);
- if (point->uw)
- point->uw = MEM_dupallocN(point->uw);
+ if (spline->points_deform) {
+ nspline->points_deform = mask_spline_points_copy(spline->points_deform, spline->tot_point);
}
return nspline;
@@ -1068,20 +1116,25 @@ void BKE_mask_layer_free(MaskLayer *masklay)
MEM_freeN(masklay);
}
-void BKE_mask_free(Mask *mask)
+void BKE_mask_layer_free_list(ListBase *masklayers)
{
- MaskLayer *masklay = mask->masklayers.first;
+ MaskLayer *masklay = masklayers->first;
while (masklay) {
- MaskLayer *next_masklay = masklay->next;
+ MaskLayer *masklay_next = masklay->next;
- BLI_remlink(&mask->masklayers, masklay);
+ BLI_remlink(masklayers, masklay);
BKE_mask_layer_free(masklay);
- masklay = next_masklay;
+ masklay = masklay_next;
}
}
+void BKE_mask_free(Mask *mask)
+{
+ BKE_mask_layer_free_list(&mask->masklayers);
+}
+
void BKE_mask_unlink(Main *bmain, Mask *mask)
{
bScreen *scr;
@@ -2093,9 +2146,9 @@ int BKE_mask_get_duration(Mask *mask)
}
/* rasterization */
-void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer,
- const short do_aspect_correct, const short do_mask_aa,
- const short do_feather)
+void BKE_mask_rasterize_layers(ListBase *masklayers, int width, int height, float *buffer,
+ const short do_aspect_correct, const short do_mask_aa,
+ const short do_feather)
{
MaskLayer *masklay;
@@ -2103,7 +2156,7 @@ void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer,
const int buffer_size = width * height;
float *buffer_tmp = MEM_mallocN(sizeof(float) * buffer_size, __func__);
- for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
+ for (masklay = masklayers->first; masklay; masklay = masklay->next) {
MaskSpline *spline;
float alpha;
@@ -2226,3 +2279,10 @@ void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer,
MEM_freeN(buffer_tmp);
}
+
+void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer,
+ const short do_aspect_correct, const short do_mask_aa,
+ const short do_feather)
+{
+ BKE_mask_rasterize_layers(&mask->masklayers, width, height, buffer, do_aspect_correct, do_mask_aa, do_feather);
+}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index c59948532ac..e0761311c98 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -36,6 +36,7 @@
#include "MEM_guardedalloc.h"
+#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
@@ -1051,6 +1052,57 @@ int material_in_material(Material *parmat, Material *mat)
else
return 0;
}
+
+
+/* ****************** */
+
+/* Update drivers for materials in a nodetree */
+static void material_node_drivers_update(Scene *scene, bNodeTree *ntree, float ctime, Material *rootma)
+{
+ bNode *node;
+ Material *ma;
+
+ /* nodetree itself */
+ if (ntree->adt && ntree->adt->drivers.first) {
+ BKE_animsys_evaluate_animdata(scene, &ntree->id, ntree->adt, ctime, ADT_RECALC_DRIVERS);
+ }
+
+ /* nodes... */
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->id && GS(node->id->name) == ID_MA) {
+ /* TODO: prevent infinite recursion here... */
+ ma = (Material *)node->id;
+ if (ma != rootma) {
+ material_drivers_update(scene, ma, ctime);
+ }
+ }
+ else if (node->type == NODE_GROUP && node->id) {
+ material_node_drivers_update(scene, (bNodeTree *)node->id,
+ ctime, rootma);
+ }
+ }
+}
+
+/* Calculate all drivers for materials
+ * FIXME: this is really a terrible method which may result in some things being calculated
+ * multiple times. However, without proper despgraph support for these things, we are forced
+ * into this sort of thing...
+ */
+void material_drivers_update(Scene *scene, Material *ma, float ctime)
+{
+ //if (G.f & G_DEBUG)
+ // printf("material_drivers_update(%s, %s)\n", scene->id.name, ma->id.name);
+
+ /* material itself */
+ if (ma->adt && ma->adt->drivers.first) {
+ BKE_animsys_evaluate_animdata(scene, &ma->id, ma->adt, ctime, ADT_RECALC_DRIVERS);
+ }
+
+ /* nodes */
+ if (ma->nodetree) {
+ material_node_drivers_update(scene, ma->nodetree, ctime, ma);
+ }
+}
/* ****************** */
#if 0 /* UNUSED */
@@ -1061,19 +1113,19 @@ static char colname_array[125][20]= {
"LightGreen", "Chartreuse", "YellowGreen", "Yellow", "Gold",
"Green", "LawnGreen", "GreenYellow", "LightOlive", "Yellow",
"DarkBlue", "DarkPurple", "HotPink", "VioletPink", "RedPink",
-"SlateGray", "DarkGrey", "PalePurple", "IndianRed", "Tomato",
+"SlateGray", "DarkGray", "PalePurple", "IndianRed", "Tomato",
"SeaGreen", "PaleGreen", "GreenKhaki", "LightBrown", "LightSalmon",
"SpringGreen", "PaleGreen", "MediumOlive", "YellowBrown", "LightGold",
"LightGreen", "LightGreen", "LightGreen", "GreenYellow", "PaleYellow",
"HalfBlue", "DarkSky", "HalfMagenta", "VioletRed", "DeepPink",
"SteelBlue", "SkyBlue", "Orchid", "LightHotPink", "HotPink",
-"SeaGreen", "SlateGray", "MediumGrey", "Burlywood", "LightPink",
+"SeaGreen", "SlateGray", "MediumGray", "Burlywood", "LightPink",
"SpringGreen", "Aquamarine", "PaleGreen", "Khaki", "PaleOrange",
"SpringGreen", "SeaGreen", "PaleGreen", "PaleWhite", "YellowWhite",
"LightBlue", "Purple", "MediumOrchid", "Magenta", "Magenta",
"RoyalBlue", "SlateBlue", "MediumOrchid", "Orchid", "Magenta",
"DeepSkyBlue", "LightSteelBlue", "LightSkyBlue", "Violet", "LightPink",
-"Cyan", "DarkTurquoise", "SkyBlue", "Grey", "Snow",
+"Cyan", "DarkTurquoise", "SkyBlue", "Gray", "Snow",
"Mint", "Mint", "Aquamarine", "MintCream", "Ivory",
"Blue", "Blue", "DarkMagenta", "DarkOrchid", "Magenta",
"SkyBlue", "RoyalBlue", "LightSlateBlue", "MediumOrchid", "Magenta",
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index e3b13ca0f17..8d81e7b595d 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -2153,7 +2153,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData
}
}
- /* note, we don't convert FGons at all, these are not even real ngons,
+ /* note, we don't convert NGons at all, these are not even real ngons,
* they have their own UV's, colors etc - its more an editing feature. */
BLI_edgehash_free(eh, NULL);
@@ -3146,19 +3146,17 @@ void BKE_mesh_translate(Mesh *me, float offset[3], int do_keys)
}
}
-
void BKE_mesh_ensure_navmesh(Mesh *me)
{
if (!CustomData_has_layer(&me->pdata, CD_RECAST)) {
int i;
int numFaces = me->totpoly;
int *recastData;
- CustomData_add_layer_named(&me->pdata, CD_RECAST, CD_CALLOC, NULL, numFaces, "recastData");
- recastData = (int *)CustomData_get_layer(&me->pdata, CD_RECAST);
+ recastData = (int *)MEM_mallocN(numFaces * sizeof(int), __func__);
for (i = 0; i < numFaces; i++) {
recastData[i] = i + 1;
}
- CustomData_add_layer_named(&me->pdata, CD_RECAST, CD_REFERENCE, recastData, numFaces, "recastData");
+ CustomData_add_layer_named(&me->pdata, CD_RECAST, CD_ASSIGN, recastData, numFaces, "recastData");
}
}
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 4528b748412..79e3fc19d20 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -223,7 +223,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
__func__, totvert, totedge, totloop, totpoly);
if (totedge == 0 && totpoly != 0) {
- PRINT(" logical error, %u polygons and 0 edges\n", totpoly);
+ PRINT("\tLogical error, %u polygons and 0 edges\n", totpoly);
do_edge_recalc = do_fixes;
}
@@ -233,7 +233,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
for (j = 0; j < 3; j++) {
if (!finite(mv->co[j])) {
- PRINT(" vertex %u: has invalid coordinate\n", i);
+ PRINT("\tVertex %u: has invalid coordinate\n", i);
if (do_fixes) {
zero_v3(mv->co);
@@ -247,7 +247,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
if (fix_normal) {
- PRINT(" vertex %u: has zero normal, assuming Z-up normal\n", i);
+ PRINT("\tVertex %u: has zero normal, assuming Z-up normal\n", i);
if (do_fixes) {
mv->no[2] = SHRT_MAX;
verts_fixed = TRUE;
@@ -258,20 +258,20 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
for (i = 0, me = medges; i < totedge; i++, me++) {
int remove = FALSE;
if (me->v1 == me->v2) {
- PRINT(" edge %u: has matching verts, both %u\n", i, me->v1);
+ PRINT("\tEdge %u: has matching verts, both %u\n", i, me->v1);
remove = do_fixes;
}
if (me->v1 >= totvert) {
- PRINT(" edge %u: v1 index out of range, %u\n", i, me->v1);
+ PRINT("\tEdge %u: v1 index out of range, %u\n", i, me->v1);
remove = do_fixes;
}
if (me->v2 >= totvert) {
- PRINT(" edge %u: v2 index out of range, %u\n", i, me->v2);
+ PRINT("\tEdge %u: v2 index out of range, %u\n", i, me->v2);
remove = do_fixes;
}
if (BLI_edgehash_haskey(edge_hash, me->v1, me->v2)) {
- PRINT(" edge %u: is a duplicate of %d\n", i,
+ PRINT("\tEdge %u: is a duplicate of %d\n", i,
GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, me->v1, me->v2)));
remove = do_fixes;
}
@@ -296,7 +296,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
PRINT(" face %u: edge " STRINGIFY(a) "/" STRINGIFY(b) \
" (%u,%u) is missing egde data\n", i, mf->a, mf->b); \
do_edge_recalc = TRUE; \
- }
+ } (void)0
MFace *mf;
MFace *mf_prev;
@@ -306,6 +306,8 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
SortFace *sf_prev;
unsigned int totsortface = 0;
+ PRINT("No Polys, only tesselated Faces\n");
+
for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, mf++) {
int remove = FALSE;
int fidx;
@@ -315,7 +317,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
do {
fv[fidx] = *(&(mf->v1) + fidx);
if (fv[fidx] >= totvert) {
- PRINT(" face %u: 'v%d' index out of range, %u\n", i, fidx + 1, fv[fidx]);
+ PRINT("\tFace %u: 'v%d' index out of range, %u\n", i, fidx + 1, fv[fidx]);
remove = do_fixes;
}
} while (fidx--);
@@ -392,12 +394,12 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
mf_prev = mfaces + sf_prev->index;
if (mf->v4) {
- PRINT(" face %u & %u: are duplicates (%u,%u,%u,%u) (%u,%u,%u,%u)\n",
+ PRINT("\tFace %u & %u: are duplicates (%u,%u,%u,%u) (%u,%u,%u,%u)\n",
sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3, mf->v4,
mf_prev->v1, mf_prev->v2, mf_prev->v3, mf_prev->v4);
}
else {
- PRINT(" face %u & %u: are duplicates (%u,%u,%u) (%u,%u,%u)\n",
+ PRINT("\tFace %u & %u: are duplicates (%u,%u,%u) (%u,%u,%u)\n",
sf->index, sf_prev->index, mf->v1, mf->v2, mf->v3,
mf_prev->v1, mf_prev->v2, mf_prev->v3);
}
@@ -433,7 +435,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
*
* Also, loops not used by polys can be discarded.
* And "intersecting" loops (i.e. loops used by more than one poly) are invalid,
- * so be sure to leave at most one poly/loop!
+ * so be sure to leave at most one poly per loop!
*/
{
SortPoly *sort_polys = MEM_callocN(sizeof(SortPoly) * totpoly, "mesh validate's sort_polys");
@@ -444,12 +446,12 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
if (mp->loopstart < 0 || mp->totloop < 3) {
/* Invalid loop data. */
- PRINT(" poly %u is invalid (loopstart: %u, totloop: %u)\n", sp->index, mp->loopstart, mp->totloop);
+ PRINT("\tPoly %u is invalid (loopstart: %u, totloop: %u)\n", sp->index, mp->loopstart, mp->totloop);
sp->invalid = TRUE;
}
else if (mp->loopstart + mp->totloop > totloop) {
/* Invalid loop data. */
- PRINT(" poly %u uses loops out of range (loopstart: %u, loopend: %u, max nbr of loops: %u)\n",
+ PRINT("\tPoly %u uses loops out of range (loopstart: %u, loopend: %u, max nbr of loops: %u)\n",
sp->index, mp->loopstart, mp->loopstart + mp->totloop - 1, totloop - 1);
sp->invalid = TRUE;
}
@@ -465,7 +467,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
for (j = 0, ml = &mloops[sp->loopstart]; j < mp->totloop; j++, ml++, v++) {
if (ml->v >= totvert) {
/* Invalid vert idx. */
- PRINT(" loop %u has invalid vert reference (%u)\n", sp->loopstart + j, ml->v);
+ PRINT("\tLoop %u has invalid vert reference (%u)\n", sp->loopstart + j, ml->v);
sp->invalid = TRUE;
}
@@ -478,7 +480,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
v = sp->verts;
for (j = 0; j < mp->totloop; j++, v++) {
if ((mverts[*v].flag & ME_VERT_TMP_TAG) == 0) {
- PRINT(" poly %u has duplicate vert reference at corner (%u)\n", i, j);
+ PRINT("\tPoly %u has duplicate vert reference at corner (%u)\n", i, j);
sp->invalid = TRUE;
}
mverts[*v].flag &= ~ME_VERT_TMP_TAG;
@@ -494,7 +496,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
v2 = mloops[sp->loopstart + (j + 1) % mp->totloop].v;
if (!BLI_edgehash_haskey(edge_hash, v1, v2)) {
/* Edge not existing. */
- PRINT(" poly %u needs missing edge (%u, %u)\n", sp->index, v1, v2);
+ PRINT("\tPoly %u needs missing edge (%u, %u)\n", sp->index, v1, v2);
if (do_fixes)
do_edge_recalc = TRUE;
else
@@ -506,11 +508,11 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
if (do_fixes) {
int prev_e = ml->e;
ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
- PRINT(" loop %u has invalid edge reference (%u), fixed using edge %u\n",
+ PRINT("\tLoop %u has invalid edge reference (%u), fixed using edge %u\n",
sp->loopstart + j, prev_e, ml->e);
}
else {
- PRINT(" loop %u has invalid edge reference (%u)\n", sp->loopstart + j, ml->e);
+ PRINT("\tLoop %u has invalid edge reference (%u)\n", sp->loopstart + j, ml->e);
sp->invalid = TRUE;
}
}
@@ -522,11 +524,11 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
if (do_fixes) {
int prev_e = ml->e;
ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
- PRINT(" poly %u has invalid edge reference (%u), fixed using edge %u\n",
+ PRINT("\tPoly %u has invalid edge reference (%u), fixed using edge %u\n",
sp->index, prev_e, ml->e);
}
else {
- PRINT(" poly %u has invalid edge reference (%u)\n", sp->index, ml->e);
+ PRINT("\tPoly %u has invalid edge reference (%u)\n", sp->index, ml->e);
sp->invalid = TRUE;
}
}
@@ -544,7 +546,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
if (*v != *prev_v) {
int dlt = v - prev_v;
if (dlt > 1) {
- PRINT(" poly %u is invalid, it multi-uses vertex %u (%u times)\n",
+ PRINT("\tPoly %u is invalid, it multi-uses vertex %u (%u times)\n",
sp->index, *prev_v, dlt);
sp->invalid = TRUE;
}
@@ -552,7 +554,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
}
if (v - prev_v > 1) { /* Don't forget final verts! */
- PRINT(" poly %u is invalid, it multi-uses vertex %u (%u times)\n",
+ PRINT("\tPoly %u is invalid, it multi-uses vertex %u (%u times)\n",
sp->index, *prev_v, (int)(v - prev_v));
sp->invalid = TRUE;
}
@@ -610,17 +612,17 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
p2_sub = FALSE;
if (p1_sub && p2_sub) {
- PRINT(" polys %u and %u use same vertices, considering poly %u as invalid.\n",
+ PRINT("\tPolys %u and %u use same vertices, considering poly %u as invalid.\n",
prev_sp->index, sp->index, sp->index);
sp->invalid = TRUE;
}
/* XXX In fact, these might be valid? :/ */
else if (p1_sub) {
- PRINT(" %u is a sub-poly of %u, considering it as invalid.\n", sp->index, prev_sp->index);
+ PRINT("\t%u is a sub-poly of %u, considering it as invalid.\n", sp->index, prev_sp->index);
sp->invalid = TRUE;
}
else if (p2_sub) {
- PRINT(" %u is a sub-poly of %u, considering it as invalid.\n", prev_sp->index, sp->index);
+ PRINT("\t%u is a sub-poly of %u, considering it as invalid.\n", prev_sp->index, sp->index);
prev_sp->invalid = TRUE;
prev_sp = sp; /* sp is new reference poly. */
}
@@ -631,7 +633,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
if ((p1_nv == p2_nv) && (memcmp(p1_v, p2_v, p1_nv * sizeof(*p1_v)) == 0)) {
if (do_verbose) {
- PRINT(" polys %u and %u use same vertices (%u",
+ PRINT("\tPolys %u and %u use same vertices (%u",
prev_sp->index, sp->index, *p1_v);
for (j = 1; j < p1_nv; j++)
PRINT(", %u", p1_v[j]);
@@ -671,7 +673,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
/* Unused loops. */
if (prev_end < sp->loopstart) {
for (j = prev_end, ml = &mloops[prev_end]; j < sp->loopstart; j++, ml++) {
- PRINT(" loop %u is unused.\n", j);
+ PRINT("\tLoop %u is unused.\n", j);
if (do_fixes)
REMOVE_LOOP_TAG(ml);
}
@@ -680,7 +682,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
/* Multi-used loops. */
else if (prev_end > sp->loopstart) {
- PRINT(" polys %u and %u share loops from %u to %u, considering poly %u as invalid.\n",
+ PRINT("\tPolys %u and %u share loops from %u to %u, considering poly %u as invalid.\n",
prev_sp->index, sp->index, sp->loopstart, prev_end, sp->index);
if (do_fixes) {
REMOVE_POLY_TAG((&mpolys[sp->index]));
@@ -699,7 +701,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
/* We may have some remaining unused loops to get rid of! */
if (prev_end < totloop) {
for (j = prev_end, ml = &mloops[prev_end]; j < totloop; j++, ml++) {
- PRINT(" loop %u is unused.\n", j);
+ PRINT("\tLoop %u is unused.\n", j);
if (do_fixes)
REMOVE_LOOP_TAG(ml);
}
@@ -720,14 +722,14 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
for (j = 0, dw = dv->dw; j < dv->totweight; j++, dw++) {
/* note, greater then max defgroups is accounted for in our code, but not < 0 */
if (!finite(dw->weight)) {
- PRINT(" vertex deform %u, group %d has weight: %f\n", i, dw->def_nr, dw->weight);
+ PRINT("\tVertex deform %u, group %d has weight: %f\n", i, dw->def_nr, dw->weight);
if (do_fixes) {
dw->weight = 0.0f;
vert_weights_fixed = TRUE;
}
}
else if (dw->weight < 0.0f || dw->weight > 1.0f) {
- PRINT(" vertex deform %u, group %d has weight: %f\n", i, dw->def_nr, dw->weight);
+ PRINT("\tVertex deform %u, group %d has weight: %f\n", i, dw->def_nr, dw->weight);
if (do_fixes) {
CLAMP(dw->weight, 0.0f, 1.0f);
vert_weights_fixed = TRUE;
@@ -735,7 +737,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
if (dw->def_nr < 0) {
- PRINT(" vertex deform %u, has invalid group %d\n", i, dw->def_nr);
+ PRINT("\tVertex deform %u, has invalid group %d\n", i, dw->def_nr);
if (do_fixes) {
defvert_remove_group(dv, dw);
if (dv->dw) {
@@ -783,10 +785,10 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
int free_msel = FALSE;
for (i = 0, msel = mesh->mselect; i < mesh->totselect; i++, msel++) {
- int tot_elem;
+ int tot_elem = 0;
if (msel->index < 0) {
- PRINT("Mesh select element %d type %d index is negative, "
+ PRINT("\tMesh select element %d type %d index is negative, "
"resetting selection stack.\n", i, msel->type);
free_msel = TRUE;
break;
@@ -805,7 +807,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
if (msel->index > tot_elem) {
- PRINT("Mesh select element %d type %d index %d is larger than data array size %d, "
+ PRINT("\tMesh select element %d type %d index %d is larger than data array size %d, "
"resetting selection stack.\n", i, msel->type, msel->index, tot_elem);
free_msel = TRUE;
@@ -820,7 +822,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
}
}
- PRINT("BKE_mesh_validate: finished\n\n");
+ PRINT("%s: finished\n\n", __func__);
return (verts_fixed || vert_weights_fixed || do_polyloop_free || do_edge_free || do_edge_recalc || msel_fixed);
}
@@ -829,13 +831,15 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
{
int i = 0, has_fixes = 0;
+ PRINT("%s: Checking %d CD layers...\n", __func__, data->totlayer);
+
while (i < data->totlayer) {
CustomDataLayer *layer = &data->layers[i];
CustomDataMask mask = CD_TYPE_AS_MASK(layer->type);
int ok = 1;
if ((mask & CD_MASK_MESH) == 0) {
- PRINT("CustomDataLayer type %d which isn't in CD_MASK_MESH is stored in Mehs structure\n", layer->type);
+ PRINT("\tCustomDataLayer type %d which isn't in CD_MASK_MESH is stored in Mesh structure\n", layer->type);
if (do_fixes) {
CustomData_free_layer(data, layer->type, 0, i);
@@ -848,6 +852,8 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
i++;
}
+ PRINT("%s: Finished\n\n", __func__);
+
return has_fixes;
}
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index b4c30203000..65538e5bea2 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -331,6 +331,13 @@ int modifiers_isClothEnabled(Object *ob)
return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
}
+int modifiers_isModifierEnabled(Object *ob, int modifierType)
+{
+ ModifierData *md = modifiers_findByType(ob, modifierType);
+
+ return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render));
+}
+
int modifiers_isParticleEnabled(Object *ob)
{
ModifierData *md = modifiers_findByType(ob, eModifierType_ParticleSystem);
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 2b4fe72e8bb..fb15aa82fa2 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1391,7 +1391,7 @@ static void BKE_nlastrip_validate_autoblends(NlaTrack *nlt, NlaStrip *nls)
/* set overlaps for this strip
* - don't use the values obtained though if the end in question
- * is directly followed/preceeded by another strip, forming an
+ * is directly followed/preceded by another strip, forming an
* 'island' of continuous strips
*/
if ((ps || ns) && ((nls->prev == NULL) || IS_EQF(nls->prev->end, nls->start) == 0)) {
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index a5e081d122d..33df8e4b503 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -633,8 +633,12 @@ bNodeTree *ntreeAddTree(const char *name, int type, int nodetype)
* - this gets called when executing compositing updates (for threaded previews)
* - when the nodetree datablock needs to be copied (i.e. when users get copied)
* - for scene duplication use ntreeSwapID() after so we don't have stale pointers.
+ *
+ * do_make_extern: keep enabled for general use, only reason _not_ to enable is when
+ * copying for internal use (threads for eg), where you wont want it to modify the
+ * scene data.
*/
-bNodeTree *ntreeCopyTree(bNodeTree *ntree)
+static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, const short do_make_extern)
{
bNodeTree *newtree;
bNode *node /*, *nnode */ /* UNUSED */, *last;
@@ -664,6 +668,11 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
last = ntree->nodes.last;
for (node= ntree->nodes.first; node; node= node->next) {
+
+ if (do_make_extern) {
+ id_lib_extern(node->id);
+ }
+
node->new_node= NULL;
/* nnode= */ nodeCopyNode(newtree, node); /* sets node->new */
@@ -709,6 +718,11 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
return newtree;
}
+bNodeTree *ntreeCopyTree(bNodeTree *ntree)
+{
+ return ntreeCopyTree_internal(ntree, TRUE);
+}
+
/* use when duplicating scenes */
void ntreeSwitchID(bNodeTree *ntree, ID *id_from, ID *id_to)
{
@@ -1131,7 +1145,7 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
}
/* node copy func */
- ltree= ntreeCopyTree(ntree);
+ ltree = ntreeCopyTree_internal(ntree, FALSE);
if (adt) {
AnimData *ladt= BKE_animdata_from_id(&ltree->id);
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 877563ddd53..cd53bf01a67 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -853,7 +853,7 @@ Object *BKE_object_add_only_object(int type, const char *name)
ob->pc_ids.first = ob->pc_ids.last = NULL;
- /* Animation Visualisation defaults */
+ /* Animation Visualization defaults */
animviz_settings_init(&ob->avs);
return ob;
@@ -1470,7 +1470,7 @@ void BKE_object_rot_to_mat3(Object *ob, float mat[][3])
axis_angle_to_mat3(dmat, ob->drotAxis, ob->drotAngle);
}
else {
- /* quats are normalised before use to eliminate scaling issues */
+ /* quats are normalized before use to eliminate scaling issues */
float tquat[4];
normalize_qt_qt(tquat, ob->quat);
@@ -2548,7 +2548,7 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
printf("recalcdata %s\n", ob->id.name + 2);
if (adt) {
- /* evaluate drivers */
+ /* evaluate drivers - datalevel */
// XXX: for mesh types, should we push this to derivedmesh instead?
BKE_animsys_evaluate_animdata(scene, data_id, adt, ctime, ADT_RECALC_DRIVERS);
}
@@ -2605,8 +2605,26 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
BKE_lattice_modifiers_calc(scene, ob);
break;
}
-
-
+
+ /* related materials */
+ /* XXX: without depsgraph tagging, this will always need to be run, which will be slow!
+ * However, not doing anything (or trying to hack around this lack) is not an option
+ * anymore, especially due to Cycles [#31834]
+ */
+ if (ob->totcol) {
+ int a;
+
+ for (a = 1; a <= ob->totcol; a++) {
+ Material *ma = give_current_material(ob, a);
+
+ if (ma) {
+ /* recursively update drivers for this material */
+ material_drivers_update(scene, ma, ctime);
+ }
+ }
+ }
+
+ /* particles */
if (ob->particlesystem.first) {
ParticleSystem *tpsys, *psys;
DerivedMesh *dm;
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 569e69f2d51..65f22ebc88f 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3320,7 +3320,7 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
}
}
- /* stickness was possibly added before, so cancel that before calculating new normal velocity */
+ /* stickiness was possibly added before, so cancel that before calculating new normal velocity */
/* otherwise particles go flying out of the surface because of high reversed sticky velocity */
if (v0_dot < 0.0f) {
v0_dot += pd->pdef_stickness;
@@ -3379,7 +3379,7 @@ static int collision_response(ParticleData *pa, ParticleCollision *col, BVHTreeR
madd_v3_v3fl(pa->state.vel, nor, -dot);
}
- /* add stickness to surface */
+ /* add stickiness to surface */
madd_v3_v3fl(pa->state.vel, pce->nor, -pd->pdef_stickness);
/* set coordinates for next iteration */
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 32def1be647..ddcba509301 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -141,7 +141,7 @@ struct SmokeModifierData;
/* forward declerations */
static void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len);
-static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct);
+static void get_cell(const float p0[3], const int res[3], float dx, const float pos[3], int cell[3], int correct);
static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs);
#else /* WITH_SMOKE */
@@ -1977,7 +1977,7 @@ static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, f
cb(result, input, res, pixel, tRay, correct);
}
-static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct)
+static void get_cell(const float p0[3], const int res[3], float dx, const float pos[3], int cell[3], int correct)
{
float tmp[3];
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 63f0a29821f..1d6895a8c71 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -1718,15 +1718,15 @@ static int choose_winner(float*w, float* pos, float*a, float*b, float*c, float*c
{
float mindist, cp;
int winner =1;
- mindist = ABS(dot_v3v3(pos, a));
+ mindist = fabsf(dot_v3v3(pos, a));
- cp = ABS(dot_v3v3(pos, b));
+ cp = fabsf(dot_v3v3(pos, b));
if ( mindist < cp ) {
mindist = cp;
winner =2;
}
- cp = ABS(dot_v3v3(pos, c));
+ cp = fabsf(dot_v3v3(pos, c));
if (mindist < cp ) {
mindist = cp;
winner =3;
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 3dea8a85915..4342eb20d55 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -2315,10 +2315,10 @@ static int tracking_check_marker_margin(MovieTrackingTrack *track, MovieTracking
/* margin from frame boundaries */
BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
sub_v2_v2v2(dim, pat_max, pat_min);
- margin[0] = margin[1] = MAX2(dim[0], dim[1]) / 2.0f;
+ margin[0] = margin[1] = maxf(dim[0], dim[1]) / 2.0f;
- margin[0] = MAX2(margin[0], (float)track->margin / frame_width);
- margin[1] = MAX2(margin[1], (float)track->margin / frame_height);
+ margin[0] = maxf(margin[0], (float)track->margin / frame_width);
+ margin[1] = maxf(margin[1], (float)track->margin / frame_height);
/* do not track markers which are too close to boundary */
if (marker->pos[0] < margin[0] || marker->pos[0] > 1.0f - margin[0] ||
@@ -3028,9 +3028,9 @@ static unsigned char *detect_get_frame_ucharbuf(ImBuf *ibuf)
if (ibuf->rect_float) {
const float *rrgbf = ibuf->rect_float + pixel * 4;
- const float grey_f = 0.2126f * rrgbf[0] + 0.7152f * rrgbf[1] + 0.0722f * rrgbf[2];
+ const float gray_f = 0.2126f * rrgbf[0] + 0.7152f * rrgbf[1] + 0.0722f * rrgbf[2];
- *cp = FTOCHAR(grey_f);
+ *cp = FTOCHAR(gray_f);
}
else {
const unsigned char *rrgb = (unsigned char *)ibuf->rect + pixel * 4;
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 1180d2c72d5..df4d2d8cc38 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -108,107 +108,107 @@ static struct bUnitCollection buDummyCollecton = {buDummyDef, 0, 0, sizeof(buDum
/* Lengths */
static struct bUnitDef buMetricLenDef[] = {
- {"kilometer", "kilometers", "km", NULL, "Kilometers", UN_SC_KM, 0.0, B_UNIT_DEF_NONE},
- {"hectometer", "hectometers", "hm", NULL, "100 Meters", UN_SC_HM, 0.0, B_UNIT_DEF_SUPPRESS},
- {"dekameter", "dekameters", "dam",NULL, "10 Meters", UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},
- {"meter", "meters", "m", NULL, "Meters", UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"decimetre", "decimetres", "dm", NULL, "10 Centimeters", UN_SC_DM, 0.0, B_UNIT_DEF_SUPPRESS},
- {"centimeter", "centimeters", "cm", NULL, "Centimeters", UN_SC_CM, 0.0, B_UNIT_DEF_NONE},
- {"millimeter", "millimeters", "mm", NULL, "Millimeters", UN_SC_MM, 0.0, B_UNIT_DEF_NONE},
- {"micrometer", "micrometers", "µm", "um", "Micrometers", UN_SC_UM, 0.0, B_UNIT_DEF_NONE}, // micron too?
+ {"kilometer", "kilometers", "km", NULL, "Kilometers", UN_SC_KM, 0.0, B_UNIT_DEF_NONE},
+ {"hectometer", "hectometers", "hm", NULL, "100 Meters", UN_SC_HM, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"dekameter", "dekameters", "dam", NULL, "10 Meters", UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"meter", "meters", "m", NULL, "Meters", UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"decimeter", "decimeters", "dm", NULL, "10 Centimeters", UN_SC_DM, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"centimeter", "centimeters", "cm", NULL, "Centimeters", UN_SC_CM, 0.0, B_UNIT_DEF_NONE},
+ {"millimeter", "millimeters", "mm", NULL, "Millimeters", UN_SC_MM, 0.0, B_UNIT_DEF_NONE},
+ {"micrometer", "micrometers", "µm", "um", "Micrometers", UN_SC_UM, 0.0, B_UNIT_DEF_NONE}, // micron too?
/* These get displayed because of float precision problems in the transform header,
* could work around, but for now probably people wont use these */
#if 0
- {"nanometer", "Nanometers", "nm", NULL, 0.000000001, 0.0, B_UNIT_DEF_NONE},
- {"picometer", "Picometers", "pm", NULL, 0.000000000001, 0.0,B_UNIT_DEF_NONE},
+ {"nanometer", "Nanometers", "nm", NULL, 0.000000001, 0.0, B_UNIT_DEF_NONE},
+ {"picometer", "Picometers", "pm", NULL, 0.000000000001, 0.0, B_UNIT_DEF_NONE},
#endif
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buMetricLenCollecton = {buMetricLenDef, 3, 0, sizeof(buMetricLenDef) / sizeof(bUnitDef)};
static struct bUnitDef buImperialLenDef[] = {
- {"mile", "miles", "mi", "m", "Miles", UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
- {"furlong", "furlongs", "fur", NULL, "Furlongs",UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
- {"chain", "chains", "ch", NULL, "Chains", UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
- {"yard", "yards", "yd", NULL, "Yards", UN_SC_YD, 0.0, B_UNIT_DEF_SUPPRESS},
- {"foot", "feet", "'", "ft", "Feet", UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"inch", "inches", "\"", "in", "Inches", UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
- {"thou", "thou", "thou", "mil", "Thou", UN_SC_MIL, 0.0, B_UNIT_DEF_NONE}, /* plural for thou has no 's' */
+ {"mile", "miles", "mi", "m", "Miles", UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
+ {"furlong", "furlongs", "fur", NULL, "Furlongs", UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"chain", "chains", "ch", NULL, "Chains", UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"yard", "yards", "yd", NULL, "Yards", UN_SC_YD, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"foot", "feet", "'", "ft", "Feet", UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"inch", "inches", "\"", "in", "Inches", UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
+ {"thou", "thou", "thou", "mil", "Thou", UN_SC_MIL, 0.0, B_UNIT_DEF_NONE}, /* plural for thou has no 's' */
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buImperialLenCollecton = {buImperialLenDef, 4, 0, sizeof(buImperialLenDef) / sizeof(bUnitDef)};
/* Areas */
static struct bUnitDef buMetricAreaDef[] = {
- {"square kilometer", "square kilometers", "km²", "km2", "Square Kilometers", UN_SC_KM*UN_SC_KM, 0.0, B_UNIT_DEF_NONE},
- {"square hectometer","square hectometers", "hm²", "hm2", "Square Hectometers", UN_SC_HM*UN_SC_HM, 0.0, B_UNIT_DEF_NONE}, /* hectare */
- {"square dekameter", "square dekameters", "dam²","dam2", "Square Dekameters", UN_SC_DAM*UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS}, /* are */
- {"square meter", "square meters", "m²", "m2", "Square Meters", UN_SC_M*UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"square decimetre", "square decimetres", "dm²", "dm2", "Square Decimetres", UN_SC_DM*UN_SC_DM, 0.0, B_UNIT_DEF_SUPPRESS},
- {"square centimeter", "square centimeters", "cm²", "cm2", "Square Centimeters", UN_SC_CM*UN_SC_CM, 0.0, B_UNIT_DEF_NONE},
- {"square millimeter", "square millimeters", "mm²", "mm2", "Square Millimeters", UN_SC_MM*UN_SC_MM, 0.0, B_UNIT_DEF_NONE},
- {"square micrometer", "square micrometers", "µm²", "um2", "Square Micrometers", UN_SC_UM*UN_SC_UM, 0.0, B_UNIT_DEF_NONE},
- {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+ {"square kilometer", "square kilometers", "km²", "km2", "Square Kilometers", UN_SC_KM * UN_SC_KM, 0.0, B_UNIT_DEF_NONE},
+ {"square hectometer", "square hectometers", "hm²", "hm2", "Square Hectometers", UN_SC_HM * UN_SC_HM, 0.0, B_UNIT_DEF_NONE}, /* hectare */
+ {"square dekameter", "square dekameters", "dam²", "dam2", "Square Dekameters", UN_SC_DAM * UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS}, /* are */
+ {"square meter", "square meters", "m²", "m2", "Square Meters", UN_SC_M * UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"square decimeter", "square decimetees", "dm²", "dm2", "Square Decimeters", UN_SC_DM * UN_SC_DM, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"square centimeter", "square centimeters", "cm²", "cm2", "Square Centimeters", UN_SC_CM * UN_SC_CM, 0.0, B_UNIT_DEF_NONE},
+ {"square millimeter", "square millimeters", "mm²", "mm2", "Square Millimeters", UN_SC_MM * UN_SC_MM, 0.0, B_UNIT_DEF_NONE},
+ {"square micrometer", "square micrometers", "µm²", "um2", "Square Micrometers", UN_SC_UM * UN_SC_UM, 0.0, B_UNIT_DEF_NONE},
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buMetricAreaCollecton = {buMetricAreaDef, 3, 0, sizeof(buMetricAreaDef) / sizeof(bUnitDef)};
static struct bUnitDef buImperialAreaDef[] = {
- {"square mile", "square miles", "sq mi", "sq m","Square Miles", UN_SC_MI*UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
- {"square furlong", "square furlongs", "sq fur",NULL, "Square Furlongs", UN_SC_FUR*UN_SC_FUR, 0.0,B_UNIT_DEF_SUPPRESS},
- {"square chain", "square chains", "sq ch", NULL, "Square Chains", UN_SC_CH*UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
- {"square yard", "square yards", "sq yd", NULL, "Square Yards", UN_SC_YD*UN_SC_YD, 0.0, B_UNIT_DEF_NONE},
- {"square foot", "square feet", "sq ft", NULL, "Square Feet", UN_SC_FT*UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"square inch", "square inches", "sq in", NULL, "Square Inches", UN_SC_IN*UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
- {"square thou", "square thous", "sq mil",NULL, "Square Thous", UN_SC_MIL*UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
+ {"square mile", "square miles", "sq mi", "sq m", "Square Miles", UN_SC_MI * UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
+ {"square furlong", "square furlongs", "sq fur", NULL, "Square Furlongs", UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"square chain", "square chains", "sq ch", NULL, "Square Chains", UN_SC_CH * UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"square yard", "square yards", "sq yd", NULL, "Square Yards", UN_SC_YD * UN_SC_YD, 0.0, B_UNIT_DEF_NONE},
+ {"square foot", "square feet", "sq ft", NULL, "Square Feet", UN_SC_FT * UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"square inch", "square inches", "sq in", NULL, "Square Inches", UN_SC_IN * UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
+ {"square thou", "square thous", "sq mil", NULL, "Square Thous", UN_SC_MIL * UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buImperialAreaCollecton = {buImperialAreaDef, 4, 0, sizeof(buImperialAreaDef) / sizeof(bUnitDef)};
/* Volumes */
static struct bUnitDef buMetricVolDef[] = {
- {"cubic kilometer", "cubic kilometers", "km³", "km3", "Cubic Kilometers", UN_SC_KM*UN_SC_KM*UN_SC_KM, 0.0, B_UNIT_DEF_NONE},
- {"cubic hectometer","cubic hectometers", "hm³", "hm3", "Cubic Hectometers", UN_SC_HM*UN_SC_HM*UN_SC_HM, 0.0, B_UNIT_DEF_NONE},
- {"cubic dekameter", "cubic dekameters", "dam³","dam3", "Cubic Dekameters", UN_SC_DAM*UN_SC_DAM*UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},
- {"cubic meter", "cubic meters", "m³", "m3", "Cubic Meters", UN_SC_M*UN_SC_M*UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"cubic decimetre", "cubic decimetres", "dm³", "dm3", "Cubic Decimetres", UN_SC_DM*UN_SC_DM*UN_SC_DM, 0.0, B_UNIT_DEF_SUPPRESS},
- {"cubic centimeter", "cubic centimeters", "cm³", "cm3", "Cubic Centimeters", UN_SC_CM*UN_SC_CM*UN_SC_CM, 0.0, B_UNIT_DEF_NONE},
- {"cubic millimeter", "cubic millimeters", "mm³", "mm3", "Cubic Millimeters", UN_SC_MM*UN_SC_MM*UN_SC_MM, 0.0, B_UNIT_DEF_NONE},
- {"cubic micrometer", "cubic micrometers", "µm³", "um3", "Cubic Micrometers", UN_SC_UM*UN_SC_UM*UN_SC_UM, 0.0, B_UNIT_DEF_NONE},
- {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+ {"cubic kilometer", "cubic kilometers", "km³", "km3", "Cubic Kilometers", UN_SC_KM * UN_SC_KM * UN_SC_KM, 0.0, B_UNIT_DEF_NONE},
+ {"cubic hectometer", "cubic hectometers", "hm³", "hm3", "Cubic Hectometers", UN_SC_HM * UN_SC_HM * UN_SC_HM, 0.0, B_UNIT_DEF_NONE},
+ {"cubic dekameter", "cubic dekameters", "dam³", "dam3", "Cubic Dekameters", UN_SC_DAM * UN_SC_DAM * UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"cubic meter", "cubic meters", "m³", "m3", "Cubic Meters", UN_SC_M * UN_SC_M * UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"cubic decimeter", "cubic decimeters", "dm³", "dm3", "Cubic Decimeters", UN_SC_DM * UN_SC_DM * UN_SC_DM, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"cubic centimeter", "cubic centimeters", "cm³", "cm3", "Cubic Centimeters", UN_SC_CM * UN_SC_CM * UN_SC_CM, 0.0, B_UNIT_DEF_NONE},
+ {"cubic millimeter", "cubic millimeters", "mm³", "mm3", "Cubic Millimeters", UN_SC_MM * UN_SC_MM * UN_SC_MM, 0.0, B_UNIT_DEF_NONE},
+ {"cubic micrometer", "cubic micrometers", "µm³", "um3", "Cubic Micrometers", UN_SC_UM * UN_SC_UM * UN_SC_UM, 0.0, B_UNIT_DEF_NONE},
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buMetricVolCollecton = {buMetricVolDef, 3, 0, sizeof(buMetricVolDef) / sizeof(bUnitDef)};
static struct bUnitDef buImperialVolDef[] = {
- {"cubic mile", "cubic miles", "cu mi", "cu m","Cubic Miles", UN_SC_MI*UN_SC_MI*UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
- {"cubic furlong", "cubic furlongs", "cu fur",NULL, "Cubic Furlongs", UN_SC_FUR*UN_SC_FUR*UN_SC_FUR, 0.0,B_UNIT_DEF_SUPPRESS},
- {"cubic chain", "cubic chains", "cu ch", NULL, "Cubic Chains", UN_SC_CH*UN_SC_CH*UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
- {"cubic yard", "cubic yards", "cu yd", NULL, "Cubic Yards", UN_SC_YD*UN_SC_YD*UN_SC_YD, 0.0, B_UNIT_DEF_NONE},
- {"cubic foot", "cubic feet", "cu ft", NULL, "Cubic Feet", UN_SC_FT*UN_SC_FT*UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"cubic inch", "cubic inches", "cu in", NULL, "Cubic Inches", UN_SC_IN*UN_SC_IN*UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
- {"cubic thou", "cubic thous", "cu mil",NULL, "Cubic Thous", UN_SC_MIL*UN_SC_MIL*UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
+ {"cubic mile", "cubic miles", "cu mi", "cu m", "Cubic Miles", UN_SC_MI * UN_SC_MI * UN_SC_MI, 0.0, B_UNIT_DEF_NONE},
+ {"cubic furlong", "cubic furlongs", "cu fur", NULL, "Cubic Furlongs", UN_SC_FUR * UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"cubic chain", "cubic chains", "cu ch", NULL, "Cubic Chains", UN_SC_CH * UN_SC_CH * UN_SC_CH, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"cubic yard", "cubic yards", "cu yd", NULL, "Cubic Yards", UN_SC_YD * UN_SC_YD * UN_SC_YD, 0.0, B_UNIT_DEF_NONE},
+ {"cubic foot", "cubic feet", "cu ft", NULL, "Cubic Feet", UN_SC_FT * UN_SC_FT * UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"cubic inch", "cubic inches", "cu in", NULL , "Cubic Inches", UN_SC_IN * UN_SC_IN * UN_SC_IN, 0.0, B_UNIT_DEF_NONE},
+ {"cubic thou", "cubic thous", "cu mil", NULL, "Cubic Thous", UN_SC_MIL * UN_SC_MIL * UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buImperialVolCollecton = {buImperialVolDef, 4, 0, sizeof(buImperialVolDef) / sizeof(bUnitDef)};
/* Mass */
static struct bUnitDef buMetricMassDef[] = {
- {"ton", "tonnes", "ton", "t", "1000 Kilograms", UN_SC_MTON, 0.0, B_UNIT_DEF_NONE},
- {"quintal", "quintals", "ql", "q", "100 Kilograms", UN_SC_QL, 0.0, B_UNIT_DEF_NONE},
- {"kilogram", "kilograms", "kg", NULL, "Kilograms", UN_SC_KG, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"hectogram", "hectograms", "hg", NULL, "Hectograms", UN_SC_HG, 0.0, B_UNIT_DEF_NONE},
- {"dekagram", "dekagrams", "dag",NULL, "10 Grams", UN_SC_DAG, 0.0, B_UNIT_DEF_SUPPRESS},
- {"gram", "grams", "g", NULL, "Grams", UN_SC_G, 0.0, B_UNIT_DEF_NONE},
- {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+ {"ton", "tonnes", "ton", "t", "1000 Kilograms", UN_SC_MTON, 0.0, B_UNIT_DEF_NONE},
+ {"quintal", "quintals", "ql", "q", "100 Kilograms", UN_SC_QL, 0.0, B_UNIT_DEF_NONE},
+ {"kilogram", "kilograms", "kg", NULL, "Kilograms", UN_SC_KG, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"hectogram", "hectograms", "hg", NULL, "Hectograms", UN_SC_HG, 0.0, B_UNIT_DEF_NONE},
+ {"dekagram", "dekagrams", "dag", NULL, "10 Grams", UN_SC_DAG, 0.0, B_UNIT_DEF_SUPPRESS},
+ {"gram", "grams", "g", NULL, "Grams", UN_SC_G, 0.0, B_UNIT_DEF_NONE},
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buMetricMassCollecton = {buMetricMassDef, 2, 0, sizeof(buMetricMassDef) / sizeof(bUnitDef)};
static struct bUnitDef buImperialMassDef[] = {
- {"ton", "tonnes", "ton", "t", "Tonnes", UN_SC_ITON, 0.0, B_UNIT_DEF_NONE},
+ {"ton", "tonnes", "ton", "t", "Tonnes", UN_SC_ITON, 0.0, B_UNIT_DEF_NONE},
{"centum weight", "centum weights", "cwt", NULL, "Centum weights", UN_SC_CWT, 0.0, B_UNIT_DEF_NONE},
- {"stone", "stones", "st", NULL, "Stones", UN_SC_ST, 0.0, B_UNIT_DEF_NONE},
- {"pound", "pounds", "lb", NULL, "Pounds", UN_SC_LB, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"ounce", "ounces", "oz", NULL, "Ounces", UN_SC_OZ, 0.0, B_UNIT_DEF_NONE},
+ {"stone", "stones", "st", NULL, "Stones", UN_SC_ST, 0.0, B_UNIT_DEF_NONE},
+ {"pound", "pounds", "lb", NULL, "Pounds", UN_SC_LB, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"ounce", "ounces", "oz", NULL, "Ounces", UN_SC_OZ, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buImperialMassCollecton = {buImperialMassDef, 3, 0, sizeof(buImperialMassDef) / sizeof(bUnitDef)};
@@ -218,15 +218,15 @@ static struct bUnitCollection buImperialMassCollecton = {buImperialMassDef, 3, 0
/* Velocity */
static struct bUnitDef buMetricVelDef[] = {
- {"meter per second", "meters per second", "m/s", NULL, "Meters per second", UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"kilometer per hour", "kilometers per hour", "km/h", NULL, "Kilometers per hour", UN_SC_KM/3600.0f, 0.0, B_UNIT_DEF_SUPPRESS},
- {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+ {"meter per second", "meters per second", "m/s", NULL, "Meters per second", UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"kilometer per hour", "kilometers per hour", "km/h", NULL, "Kilometers per hour", UN_SC_KM / 3600.0f, 0.0, B_UNIT_DEF_SUPPRESS},
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buMetricVelCollecton = {buMetricVelDef, 0, 0, sizeof(buMetricVelDef) / sizeof(bUnitDef)};
static struct bUnitDef buImperialVelDef[] = {
- {"foot per second", "feet per second", "ft/s", "fps", "Feet per second", UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"mile per hour", "miles per hour", "mph", NULL, "Miles per hour", UN_SC_MI/3600.0f, 0.0,B_UNIT_DEF_SUPPRESS},
+ {"foot per second", "feet per second", "ft/s", "fps", "Feet per second", UN_SC_FT, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"mile per hour", "miles per hour", "mph", NULL, "Miles per hour", UN_SC_MI / 3600.0f, 0.0, B_UNIT_DEF_SUPPRESS},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buImperialVelCollecton = {buImperialVelDef, 0, 0, sizeof(buImperialVelDef) / sizeof(bUnitDef)};
@@ -234,7 +234,7 @@ static struct bUnitCollection buImperialVelCollecton = {buImperialVelDef, 0, 0,
/* Acceleration */
static struct bUnitDef buMetricAclDef[] = {
{"meter per second squared", "meters per second squared", "m/s²", "m/s2", "Meters per second squared", UN_SC_M, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
+ {NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buMetricAclCollecton = {buMetricAclDef, 0, 0, sizeof(buMetricAclDef) / sizeof(bUnitDef)};
@@ -247,12 +247,12 @@ static struct bUnitCollection buImperialAclCollecton = {buImperialAclDef, 0, 0,
/* Time */
static struct bUnitDef buNaturalTimeDef[] = {
/* weeks? - probably not needed for blender */
- {"day", "days", "d", NULL, "Days", 90000.0, 0.0, B_UNIT_DEF_NONE},
- {"hour", "hours", "hr", "h", "Hours", 3600.0, 0.0, B_UNIT_DEF_NONE},
- {"minute", "minutes", "min", "m", "Minutes", 60.0, 0.0, B_UNIT_DEF_NONE},
- {"second", "seconds", "sec", "s", "Seconds", 1.0, 0.0, B_UNIT_DEF_NONE}, /* base unit */
- {"millisecond", "milliseconds", "ms", NULL, "Milliseconds", 0.001, 0.0, B_UNIT_DEF_NONE},
- {"microsecond", "microseconds", "µs", "us", "Microseconds", 0.000001, 0.0, B_UNIT_DEF_NONE},
+ {"day", "days", "d", NULL, "Days", 90000.0, 0.0, B_UNIT_DEF_NONE},
+ {"hour", "hours", "hr", "h", "Hours", 3600.0, 0.0, B_UNIT_DEF_NONE},
+ {"minute", "minutes", "min", "m", "Minutes", 60.0, 0.0, B_UNIT_DEF_NONE},
+ {"second", "seconds", "sec", "s", "Seconds", 1.0, 0.0, B_UNIT_DEF_NONE}, /* base unit */
+ {"millisecond", "milliseconds", "ms", NULL, "Milliseconds", 0.001, 0.0, B_UNIT_DEF_NONE},
+ {"microsecond", "microseconds", "µs", "us", "Microseconds", 0.000001, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buNaturalTimeCollecton = {buNaturalTimeDef, 3, 0, sizeof(buNaturalTimeDef) / sizeof(bUnitDef)};
diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h
index 7a240e0e08a..6758fa399a4 100644
--- a/source/blender/blenlib/BLI_args.h
+++ b/source/blender/blenlib/BLI_args.h
@@ -36,18 +36,31 @@
struct bArgs;
typedef struct bArgs bArgs;
-/* returns the number of extra arguments consumed by the function. 0 is normal value, -1 stops parsing arguments, other negative indicates skip */
+/**
+ * Returns the number of extra arguments consumed by the function.
+ * - 0 is normal value,
+ * - -1 stops parsing arguments, other negative indicates skip
+ */
typedef int (*BA_ArgCallback)(int argc, const char **argv, void *data);
struct bArgs *BLI_argsInit(int argc, const char **argv);
void BLI_argsFree(struct bArgs *ba);
-/* pass starts at 1, -1 means valid all the time
+/**
+ * Pass starts at 1, -1 means valid all the time
* short_arg or long_arg can be null to specify no short or long versions
- * */
-void BLI_argsAdd(struct bArgs *ba, int pass, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data);
-/* short_case and long_case specify if those arguments are case specific */
-void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data);
+ */
+void BLI_argsAdd(struct bArgs *ba, int pass,
+ const char *short_arg, const char *long_arg,
+ const char *doc, BA_ArgCallback cb, void *data);
+
+/**
+ * Short_case and long_case specify if those arguments are case specific
+ */
+void BLI_argsAddCase(struct bArgs *ba, int pass,
+ const char *short_arg, int short_case,
+ const char *long_arg, int long_case,
+ const char *doc, BA_ArgCallback cb, void *data);
void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data);
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 93599dee63d..8ccc3159f78 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -159,6 +159,18 @@ void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2
void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[2], const float v2[2],
const float v3[2], const float pt[2], float r_uv[2]);
+/* axis-aligned bounding box */
+int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]);
+
+typedef struct {
+ float ray_start[3];
+ float ray_inv_dir[3];
+ int sign[3];
+} IsectRayAABBData;
+
+void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_start[3], const float ray_direction[3]);
+int isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3], const float bb_max[3], float *tmin);
+
/* other */
int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius,
const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]);
@@ -166,8 +178,6 @@ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const flo
int isect_axial_line_tri_v3(const int axis, const float co1[3], const float co2[3],
const float v0[3], const float v1[3], const float v2[3], float *r_lambda);
-int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]);
-
int clip_line_plane(float p1[3], float p2[3], const float plane[4]);
void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, void *), void *userData);
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index 785c9f9f32b..22b93948512 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -173,7 +173,8 @@ static bArgDoc *internalDocs(struct bArgs *ba, const char *short_arg, const char
return d;
}
-static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d)
+static void internalAdd(struct bArgs *ba, const char *arg, int pass,
+ int case_str, BA_ArgCallback cb, void *data, bArgDoc *d)
{
bArgument *a;
bAKey *key;
@@ -182,8 +183,10 @@ static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_st
if (a) {
printf("WARNING: conflicting argument\n");
- printf("\ttrying to add '%s' on pass %i, %scase sensitive\n", arg, pass, case_str == 1 ? "not " : "");
- printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n", a->key->arg, (int)a->key->pass, a->key->case_str == 1 ? "not " : "");
+ printf("\ttrying to add '%s' on pass %i, %scase sensitive\n",
+ arg, pass, case_str == 1 ? "not " : "");
+ printf("\tconflict with '%s' on pass %i, %scase sensitive\n\n",
+ a->key->arg, (int)a->key->pass, a->key->case_str == 1 ? "not " : "");
}
a = MEM_callocN(sizeof(bArgument), "bArgument");
@@ -201,7 +204,10 @@ static void internalAdd(struct bArgs *ba, const char *arg, int pass, int case_st
BLI_ghash_insert(ba->items, key, a);
}
-void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data)
+void BLI_argsAddCase(struct bArgs *ba, int pass,
+ const char *short_arg, int short_case,
+ const char *long_arg, int long_case,
+ const char *doc, BA_ArgCallback cb, void *data)
{
bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc);
@@ -214,7 +220,9 @@ void BLI_argsAddCase(struct bArgs *ba, int pass, const char *short_arg, int shor
}
-void BLI_argsAdd(struct bArgs *ba, int pass, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data)
+void BLI_argsAdd(struct bArgs *ba, int pass,
+ const char *short_arg, const char *long_arg,
+ const char *doc, BA_ArgCallback cb, void *data)
{
BLI_argsAddCase(ba, pass, short_arg, 0, long_arg, 0, doc, cb, data);
}
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index eb2070bce76..10eeda96b5d 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -266,17 +266,19 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
}
}
- // get the handles that are aligned, tricky...
- // dist_to_line_v2, check if the three beztriple points are on one line
- // len_squared_v2v2, see if there's a distance between the three points
- // len_squared_v2v2 again, to check the angle between the handles
- // finally, check if one of them is a vector handle
- if ((dist_to_line_v2(bezt->vec[0], bezt->vec[1], bezt->vec[2]) < 0.001f) &&
+ /* get the handles that are aligned, tricky...
+ * dist_to_line_v2, check if the three beztriple points are on one line
+ * len_squared_v2v2, see if there's a distance between the three points
+ * len_squared_v2v2 again, to check the angle between the handles
+ * finally, check if one of them is a vector handle */
+ if ((bezt->h1 != HD_VECT && bezt->h2 != HD_VECT) &&
+ (dist_to_line_v2(bezt->vec[0], bezt->vec[1], bezt->vec[2]) < 0.001f) &&
(len_squared_v2v2(bezt->vec[0], bezt->vec[1]) > 0.0001f * 0.0001f) &&
(len_squared_v2v2(bezt->vec[1], bezt->vec[2]) > 0.0001f * 0.0001f) &&
(len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > 0.0002f * 0.0001f) &&
- (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > MAX2(len_squared_v2v2(bezt->vec[0], bezt->vec[1]), len_squared_v2v2(bezt->vec[1], bezt->vec[2]))) &&
- bezt->h1 != HD_VECT && bezt->h2 != HD_VECT)
+ (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) >
+ maxf(len_squared_v2v2(bezt->vec[0], bezt->vec[1]),
+ len_squared_v2v2(bezt->vec[1], bezt->vec[2]))))
{
bezt->h1 = bezt->h2 = HD_ALIGN;
}
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index 58ee898ea28..a3835b5bb4a 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -225,7 +225,7 @@ MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack)
/* TODO:
*
* regarding #rgb_to_bw vs #rgb_to_grayscale,
- * it seems nobody knows why we have both functions which convert color to greys
+ * it seems nobody knows why we have both functions which convert color to grays
* but with different influences, this is quite stupid, and should be resolved
* by someone who knows this stuff: see this thread
* http://lists.blender.org/pipermail/bf-committers/2012-June/037180.html
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index e51d0d2645f..402aacf369a 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -1284,6 +1284,63 @@ int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min
min2[0] < max1[0] && min2[1] < max1[1] && min2[2] < max1[2]);
}
+void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_start[3], const float ray_direction[3])
+{
+ copy_v3_v3(data->ray_start, ray_start);
+
+ data->ray_inv_dir[0] = 1.0f / ray_direction[0];
+ data->ray_inv_dir[1] = 1.0f / ray_direction[1];
+ data->ray_inv_dir[2] = 1.0f / ray_direction[2];
+
+ data->sign[0] = data->ray_inv_dir[0] < 0;
+ data->sign[1] = data->ray_inv_dir[1] < 0;
+ data->sign[2] = data->ray_inv_dir[2] < 0;
+}
+
+/* Adapted from http://www.gamedev.net/community/forums/topic.asp?topic_id=459973 */
+int isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3],
+ const float bb_max[3], float *tmin_out)
+{
+ float bbox[2][3];
+ float tmin, tmax, tymin, tymax, tzmin, tzmax;
+
+ copy_v3_v3(bbox[0], bb_min);
+ copy_v3_v3(bbox[1], bb_max);
+
+ tmin = (bbox[data->sign[0]][0] - data->ray_start[0]) * data->ray_inv_dir[0];
+ tmax = (bbox[1 - data->sign[0]][0] - data->ray_start[0]) * data->ray_inv_dir[0];
+
+ tymin = (bbox[data->sign[1]][1] - data->ray_start[1]) * data->ray_inv_dir[1];
+ tymax = (bbox[1 - data->sign[1]][1] - data->ray_start[1]) * data->ray_inv_dir[1];
+
+ if ((tmin > tymax) || (tymin > tmax))
+ return FALSE;
+
+ if (tymin > tmin)
+ tmin = tymin;
+
+ if (tymax < tmax)
+ tmax = tymax;
+
+ tzmin = (bbox[data->sign[2]][2] - data->ray_start[2]) * data->ray_inv_dir[2];
+ tzmax = (bbox[1 - data->sign[2]][2] - data->ray_start[2]) * data->ray_inv_dir[2];
+
+ if ((tmin > tzmax) || (tzmin > tmax))
+ return FALSE;
+
+ if (tzmin > tmin)
+ tmin = tzmin;
+
+ // XXX jwilkins: tmax does not need to be updated since we don't use it
+ // keeping this here for future reference
+ //if (tzmax < tmax) tmax = tzmax;
+
+ if (tmin_out)
+ (*tmin_out) = tmin;
+
+ return TRUE;
+}
+
/* find closest point to p on line through l1,l2 and return lambda,
* where (0 <= lambda <= 1) when cp is in the line segement l1,l2
*/
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 409a9f88f39..14f9001814c 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -1424,56 +1424,21 @@ void BLI_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *pro
/********************************* Raycast ***********************************/
typedef struct {
- /* Ray */
- float start[3];
- int sign[3];
- float inv_dir[3];
+ IsectRayAABBData ray;
int original;
} RaycastData;
-/* Adapted from here: http://www.gamedev.net/community/forums/topic.asp?topic_id=459973 */
static int ray_aabb_intersect(PBVHNode *node, void *data_v)
{
- RaycastData *ray = data_v;
- float bbox[2][3];
- float tmin, tmax, tymin, tymax, tzmin, tzmax;
+ RaycastData *rcd = data_v;
+ float bb_min[3], bb_max[3];
- if (ray->original)
- BLI_pbvh_node_get_original_BB(node, bbox[0], bbox[1]);
+ if (rcd->original)
+ BLI_pbvh_node_get_original_BB(node, bb_min, bb_max);
else
- BLI_pbvh_node_get_BB(node, bbox[0], bbox[1]);
-
- tmin = (bbox[ray->sign[0]][0] - ray->start[0]) * ray->inv_dir[0];
- tmax = (bbox[1 - ray->sign[0]][0] - ray->start[0]) * ray->inv_dir[0];
-
- tymin = (bbox[ray->sign[1]][1] - ray->start[1]) * ray->inv_dir[1];
- tymax = (bbox[1 - ray->sign[1]][1] - ray->start[1]) * ray->inv_dir[1];
-
- if ((tmin > tymax) || (tymin > tmax))
- return 0;
-
- if (tymin > tmin)
- tmin = tymin;
-
- if (tymax < tmax)
- tmax = tymax;
+ BLI_pbvh_node_get_BB(node, bb_min, bb_max);
- tzmin = (bbox[ray->sign[2]][2] - ray->start[2]) * ray->inv_dir[2];
- tzmax = (bbox[1 - ray->sign[2]][2] - ray->start[2]) * ray->inv_dir[2];
-
- if ((tmin > tzmax) || (tzmin > tmax))
- return 0;
-
- if (tzmin > tmin)
- tmin = tzmin;
-
- // XXX jwilkins: tmax does not need to be updated since we don't use it
- // keeping this here for future reference
- //if (tzmax < tmax) tmax = tzmax;
-
- node->tmin = tmin;
-
- return 1;
+ return isect_ray_aabb(&rcd->ray, bb_min, bb_max, &node->tmin);
}
void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
@@ -1482,13 +1447,7 @@ void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data,
{
RaycastData rcd;
- copy_v3_v3(rcd.start, ray_start);
- rcd.inv_dir[0] = 1.0f / ray_normal[0];
- rcd.inv_dir[1] = 1.0f / ray_normal[1];
- rcd.inv_dir[2] = 1.0f / ray_normal[2];
- rcd.sign[0] = rcd.inv_dir[0] < 0;
- rcd.sign[1] = rcd.inv_dir[1] < 0;
- rcd.sign[2] = rcd.inv_dir[2] < 0;
+ isect_ray_aabb_initialize(&rcd.ray, ray_start, ray_normal);
rcd.original = original;
BLI_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d8b2ce8680b..735f1fcaa55 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5547,6 +5547,11 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
if (ads->filter_grp)
ads->filter_grp = restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0);
}
+
+ /* force recalc of list of channels (i.e. includes calculating F-Curve colors)
+ * thus preventing the "black curves" problem post-undo
+ */
+ sipo->flag |= SIPO_TEMP_NEEDCHANSYNC;
}
else if (sl->spacetype == SPACE_BUTS) {
SpaceButs *sbuts = (SpaceButs *)sl;
@@ -5561,10 +5566,10 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene)
SpaceAction *saction = (SpaceAction *)sl;
saction->action = restore_pointer_by_name(newmain, (ID *)saction->action, 1);
- saction->ads.source= restore_pointer_by_name(newmain, (ID *)saction->ads.source, 1);
+ saction->ads.source = restore_pointer_by_name(newmain, (ID *)saction->ads.source, 1);
if (saction->ads.filter_grp)
- saction->ads.filter_grp= restore_pointer_by_name(newmain, (ID *)saction->ads.filter_grp, 0);
+ saction->ads.filter_grp = restore_pointer_by_name(newmain, (ID *)saction->ads.filter_grp, 0);
/* force recalc of list of channels, potentially updating the active action
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index 931937263e4..b6d9fbc85a2 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -1039,7 +1039,7 @@ static BMOpDefine bmo_bevel_def = {
{BMO_OP_SLOT_BOOL, "use_dist"}, /* corner vert placement: evaluate percent as a distance,
* modifier uses this. We could do this as another float setting */
{BMO_OP_SLOT_INT, "lengthlayer"}, /* which PROP_FLT layer to us */
- {BMO_OP_SLOT_FLT, "percent"}, /* percentage to expand bevelled edge */
+ {BMO_OP_SLOT_FLT, "percent"}, /* percentage to expand beveled edge */
{0} /* null-terminating sentinel */},
bmo_bevel_exec,
BMO_OP_FLAG_UNTAN_MULTIRES
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 094b5af9a00..6b9abfb3e20 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -320,7 +320,14 @@ void poly_rotate_plane(const float normal[3], float (*verts)[3], const int nvert
angle = saacos(dot_v3v3(normal, up));
- if (angle == 0.0) return;
+ if (angle < FLT_EPSILON)
+ return;
+
+ if (len_v3(axis) < FLT_EPSILON) {
+ axis[0] = 0.0f;
+ axis[1] = 1.0f;
+ axis[2] = 0.0f;
+ }
axis_angle_to_quat(q, axis, (float)angle);
quat_to_mat3(mat, q);
@@ -611,39 +618,42 @@ int BM_face_point_inside_test(BMFace *f, const float co[3])
return crosses % 2 != 0;
}
-static int bm_face_goodline(float const (*projectverts)[3], BMFace *f,
- int v1i, int v2i, int v3i,
- int UNUSED(nvert))
+static int bm_face_goodline(float const (*projectverts)[3], BMFace *f, int v1i, int v2i, int v3i)
{
BMLoop *l_iter;
BMLoop *l_first;
- float v1[3], v2[3], v3[3], pv1[3], pv2[3];
+ float v1[3], v2[3], v3[3], pv1[3];
int i;
copy_v3_v3(v1, projectverts[v1i]);
copy_v3_v3(v2, projectverts[v2i]);
copy_v3_v3(v3, projectverts[v3i]);
-
+
+ /* v3 must be on the left side of [v1, v2] line, else we know [v1, v3] is outside of f! */
if (testedgesidef(v1, v2, v3)) {
return FALSE;
}
- //for (i = 0; i < nvert; i++) {
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
do {
i = BM_elem_index_get(l_iter->v);
- if (i == v1i || i == v2i || i == v3i) {
+ copy_v3_v3(pv1, projectverts[i]);
+
+ if (ELEM3(i, v1i, v2i, v3i)) {
+#if 0
+ printf("%d in (%d, %d, %d) tri (from indices!), continuing\n", i, v1i, v2i, v3i);
+#endif
continue;
}
-
- copy_v3_v3(pv1, projectverts[BM_elem_index_get(l_iter->v)]);
- copy_v3_v3(pv2, projectverts[BM_elem_index_get(l_iter->next->v)]);
-
- //if (linecrossesf(pv1, pv2, v1, v3)) return FALSE;
- if (isect_point_tri_v2(pv1, v1, v2, v3) ||
- isect_point_tri_v2(pv2, v3, v2, v1))
+ if (isect_point_tri_v2(pv1, v1, v2, v3) || isect_point_tri_v2(pv1, v3, v2, v1))
{
+#if 0
+ if (isect_point_tri_v2(pv1, v1, v2, v3))
+ printf("%d in (%d, %d, %d)\n", v3i, i, v1i, v2i);
+ else
+ printf("%d in (%d, %d, %d)\n", v1i, i, v3i, v2i);
+#endif
return FALSE;
}
} while ((l_iter = l_iter->next) != l_first);
@@ -653,15 +663,13 @@ static int bm_face_goodline(float const (*projectverts)[3], BMFace *f,
/**
* \brief Find Ear
*
- * Used by tessellator to find
- * the next triangle to 'clip off'
- * of a polygon while tessellating.
+ * Used by tessellator to find the next triangle to 'clip off' of a polygon while tessellating.
*
* \param use_beauty Currently only applies to quads, can be extended later on.
* \param abscoss Must be allocated by caller, and at least f->len length
* (allow to avoid allocating a new one for each tri!).
*/
-static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int nvert, const int use_beauty, float *abscoss)
+static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int use_beauty, float *abscoss)
{
BMLoop *bestear = NULL;
@@ -706,8 +714,8 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int nvert, const int
/* Last check we do not get overlapping triangles
* (as much as possible, ther are some cases with no good solution!) */
i4 = (i + 3) % 4;
- if (!bm_face_goodline((float const (*)[3])verts, f, BM_elem_index_get(larr[i4]->v), BM_elem_index_get(larr[i]->v),
- BM_elem_index_get(larr[i + 1]->v), nvert))
+ if (!bm_face_goodline((float const (*)[3])verts, f, BM_elem_index_get(larr[i4]->v),
+ BM_elem_index_get(larr[i]->v), BM_elem_index_get(larr[i + 1]->v)))
{
i = !i;
}
@@ -750,10 +758,13 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int nvert, const int
if (BM_edge_exists(v1, v3)) {
isear = FALSE;
}
- else if (!bm_face_goodline((float const (*)[3])verts, f,
- BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3),
- nvert))
+ else if (!bm_face_goodline((float const (*)[3])verts, f, BM_elem_index_get(v1),
+ BM_elem_index_get(v2), BM_elem_index_get(v3)))
{
+#if 0
+ printf("(%d, %d, %d) would not be a valid tri!\n",
+ BM_elem_index_get(v1), BM_elem_index_get(v2), BM_elem_index_get(v3));
+#endif
isear = FALSE;
}
@@ -836,9 +847,8 @@ static BMLoop *find_ear(BMFace *f, float (*verts)[3], const int nvert, const int
*
* \note newedgeflag sets a flag layer flag, obviously not the header flag.
*/
-void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
- const short newedge_oflag, const short newface_oflag, BMFace **newfaces,
- const short use_beauty)
+void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3], const short newedge_oflag,
+ const short newface_oflag, BMFace **newfaces, const short use_beauty)
{
int i, done, nvert, nf_i = 0;
BMLoop *newl;
@@ -847,7 +857,7 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
float *abscoss = NULL;
BLI_array_fixedstack_declare(abscoss, 16, f->len, "BM_face_triangulate: temp absolute cosines of face corners");
- /* copy vertex coordinates to vertspace arra */
+ /* copy vertex coordinates to vertspace area */
i = 0;
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
do {
@@ -873,13 +883,11 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
done = FALSE;
while (!done && f->len > 3) {
done = TRUE;
- l_iter = find_ear(f, projectverts, nvert, use_beauty, abscoss);
+ l_iter = find_ear(f, projectverts, use_beauty, abscoss);
if (l_iter) {
done = FALSE;
/* printf("Subdividing face...\n");*/
- f = BM_face_split(bm, l_iter->f, l_iter->prev->v,
- l_iter->next->v,
- &newl, NULL, TRUE);
+ f = BM_face_split(bm, l_iter->f, l_iter->prev->v, l_iter->next->v, &newl, NULL, TRUE);
if (UNLIKELY(!f)) {
fprintf(stderr, "%s: triangulator failed to split face! (bmesh internal error)\n", __func__);
@@ -890,7 +898,8 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
BMO_elem_flag_enable(bm, newl->e, newedge_oflag);
BMO_elem_flag_enable(bm, f, newface_oflag);
- if (newfaces) newfaces[nf_i++] = f;
+ if (newfaces)
+ newfaces[nf_i++] = f;
#if 0
l = f->loopbase;
@@ -933,7 +942,8 @@ void BM_face_triangulate(BMesh *bm, BMFace *f, float (*projectverts)[3],
BLI_array_fixedstack_free(abscoss);
/* NULL-terminate */
- if (newfaces) newfaces[nf_i] = NULL;
+ if (newfaces)
+ newfaces[nf_i] = NULL;
}
/**
diff --git a/source/blender/bmesh/operators/bmo_hull.c b/source/blender/bmesh/operators/bmo_hull.c
index 1bd2f41209b..b22bdf60210 100644
--- a/source/blender/bmesh/operators/bmo_hull.c
+++ b/source/blender/bmesh/operators/bmo_hull.c
@@ -31,12 +31,24 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+/*XXX: This operator doesn't work well (at all?) for flat surfaces with
+ * >3 sides - creating overlapping faces at times.
+ * An easy workaround is to add in some noise but this is
+ * weak and unreliable, ideally this would detect flat surfaces
+ * (possibly making them into ngons) - see
+ */
+
/* XXX: using 128 for totelem and pchunk of mempool, no idea what good
* values would be though */
#include "BLI_mempool.h"
#include "bmesh.h"
+#define HULL_EPSILON_FLT 0.0001f
+/* values above 0.0001 cause errors, see below for details, don't increase
+ * without checking against bug [#32027] */
+#define HULL_EPSILON_DOT_FLT 0.00000001f
+
/* Internal operator flags */
typedef enum {
HULL_FLAG_INPUT = (1 << 0),
@@ -70,23 +82,23 @@ typedef struct HullBoundaryEdge {
/*************************** Boundary Edges ***************************/
-static int edge_match(BMVert *e1_0, BMVert *e1_1, BMVert *e2[2])
+static int edge_match(BMVert *e1_v1, BMVert *e1_v2, BMVert *e2[2])
{
- return (e1_0 == e2[0] && e1_1 == e2[1]) ||
- (e1_0 == e2[1] && e1_1 == e2[0]);
+ return (e1_v1 == e2[0] && e1_v2 == e2[1]) ||
+ (e1_v1 == e2[1] && e1_v2 == e2[0]);
}
/* Returns true if the edge (e1, e2) is already in edges; that edge is
* deleted here as well. if not found just returns 0 */
static int check_for_dup(ListBase *edges, BLI_mempool *pool,
- BMVert *e1, BMVert *e2)
+ BMVert *v1, BMVert *v2)
{
- HullBoundaryEdge *e, *next;
+ HullBoundaryEdge *e, *e_next;
- for (e = edges->first; e; e = next) {
- next = e->next;
+ for (e = edges->first; e; e = e_next) {
+ e_next = e->next;
- if (edge_match(e1, e2, e->v)) {
+ if (edge_match(v1, v2, e->v)) {
/* remove the interior edge */
BLI_remlink(edges, e);
BLI_mempool_free(pool, e);
@@ -100,17 +112,17 @@ static int check_for_dup(ListBase *edges, BLI_mempool *pool,
static void expand_boundary_edges(ListBase *edges, BLI_mempool *edge_pool,
const HullTriangle *t)
{
- HullBoundaryEdge *new;
+ HullBoundaryEdge *e_new;
int i;
/* Insert each triangle edge into the boundary list; if any of
* its edges are already in there, remove the edge entirely */
for (i = 0; i < 3; i++) {
if (!check_for_dup(edges, edge_pool, t->v[i], t->v[(i + 1) % 3])) {
- new = BLI_mempool_calloc(edge_pool);
- new->v[0] = t->v[i];
- new->v[1] = t->v[(i + 1) % 3];
- BLI_addtail(edges, new);
+ e_new = BLI_mempool_calloc(edge_pool);
+ e_new->v[0] = t->v[i];
+ e_new->v[1] = t->v[(i + 1) % 3];
+ BLI_addtail(edges, e_new);
}
}
}
@@ -142,12 +154,16 @@ static int hull_point_tri_side(const HullTriangle *t, const float co[3])
{
/* Added epsilon to fix bug [#31941], improves output when some
* vertices are nearly coplanar. Might need further tweaking for
- * other cases though. */
- float p[3], d, epsilon = 0.0001;
+ * other cases though.
+ * ...
+ * Update: epsilon of 0.0001 causes [#32027], use HULL_EPSILON_DOT_FLT
+ * and give it a much smaller value
+ * */
+ float p[3], d;
sub_v3_v3v3(p, co, t->v[0]->co);
d = dot_v3v3(t->no, p);
- if (d < -epsilon) return -1;
- else if (d > epsilon) return 1;
+ if (d < -HULL_EPSILON_DOT_FLT) return -1;
+ else if (d > HULL_EPSILON_DOT_FLT) return 1;
else return 0;
}
@@ -177,7 +193,7 @@ static void add_point(BMesh *bm, GHash *hull_triangles, BLI_mempool *hull_pool,
BLI_mempool *edge_pool, GHash *outside, BMVert *v)
{
ListBase edges = {NULL, NULL};
- HullBoundaryEdge *e, *next;
+ HullBoundaryEdge *e, *e_next;
GHashIterator iter;
GHASH_ITER (iter, outside) {
@@ -196,8 +212,8 @@ static void add_point(BMesh *bm, GHash *hull_triangles, BLI_mempool *hull_pool,
}
/* Fill hole boundary with triangles to new point */
- for (e = edges.first; e; e = next) {
- next = e->next;
+ for (e = edges.first; e; e = e_next) {
+ e_next = e->next;
hull_add_triangle(bm, hull_triangles, hull_pool, e->v[0], e->v[1], v);
BLI_mempool_free(edge_pool, e);
}
@@ -354,7 +370,8 @@ static void hull_add_tetrahedron(BMesh *bm, GHash *hull_triangles, BLI_mempool *
{0, 1, 2},
{0, 2, 3},
{1, 0, 3},
- {2, 1, 3}};
+ {2, 1, 3}
+ };
/* Calculate center */
zero_v3(center);
@@ -464,7 +481,7 @@ static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
}
/* Check for colinear vertices */
- if (largest_dist < 0.0001f)
+ if (largest_dist < HULL_EPSILON_FLT)
return TRUE;
/* Choose fourth point farthest from existing plane */
@@ -487,7 +504,7 @@ static int hull_find_large_tetrahedron(BMesh *bm, BMOperator *op,
return TRUE;
}
- if (largest_dist < 0.0001f)
+ if (largest_dist < HULL_EPSILON_FLT)
return TRUE;
return FALSE;
diff --git a/source/blender/collada/GeometryExporter.h b/source/blender/collada/GeometryExporter.h
index f14775b9f44..7161bb751dd 100644
--- a/source/blender/collada/GeometryExporter.h
+++ b/source/blender/collada/GeometryExporter.h
@@ -119,8 +119,7 @@ struct GeometryFunctor {
LinkNode *node;
for (node=export_set; node; node = node->next) {
Object *ob = (Object *)node->link;
- if (ob->type == OB_MESH)
- {
+ if (ob->type == OB_MESH) {
f(ob);
}
}
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp
index f789cfe3660..b9e96445dcb 100644
--- a/source/blender/collada/ImageExporter.cpp
+++ b/source/blender/collada/ImageExporter.cpp
@@ -135,7 +135,7 @@ void ImagesExporter::export_UV_Image(Image *image, bool use_copies)
COLLADASW::Image img(COLLADABU::URI(COLLADABU::URI::nativePathToUri(export_path)), translated_name, translated_name); /* set name also to mNameNC. This helps other viewers import files exported from Blender better */
img.add(mSW);
- fprintf(stdout, "Collada export: Added image: %s\n",export_file);
+ fprintf(stdout, "Collada export: Added image: %s\n", export_file);
mImages.push_back(translated_name);
}
}
@@ -145,7 +145,7 @@ void ImagesExporter::export_UV_Images()
std::set<Image *> uv_textures;
LinkNode *node;
bool use_copies = this->export_settings->use_texture_copies;
- for (node=this->export_settings->export_set; node; node=node->next) {
+ for (node = this->export_settings->export_set; node; node = node->next) {
Object *ob = (Object *)node->link;
if (ob->type == OB_MESH && ob->totcol) {
Mesh *me = (Mesh *) ob->data;
@@ -160,7 +160,7 @@ void ImagesExporter::export_UV_Images()
if (ima == NULL)
continue;
- bool not_in_list = uv_textures.find(ima)==uv_textures.end();
+ bool not_in_list = uv_textures.find(ima) == uv_textures.end();
if (not_in_list) {
uv_textures.insert(ima);
export_UV_Image(ima, use_copies);
@@ -177,7 +177,7 @@ bool ImagesExporter::hasImages(Scene *sce)
{
LinkNode *node;
- for (node=this->export_settings->export_set; node; node=node->next) {
+ for (node = this->export_settings->export_set; node; node = node->next) {
Object *ob = (Object *)node->link;
int a;
for (a = 0; a < ob->totcol; a++) {
diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt
index 653e11c80a7..9bad1b55d95 100644
--- a/source/blender/compositor/CMakeLists.txt
+++ b/source/blender/compositor/CMakeLists.txt
@@ -419,10 +419,10 @@ set(SRC
operations/COM_PreviewOperation.cpp
operations/COM_SplitViewerOperation.h
operations/COM_SplitViewerOperation.cpp
- operations/COM_ConvertValueToColourProg.h
- operations/COM_ConvertValueToColourProg.cpp
- operations/COM_ConvertColourToValueProg.h
- operations/COM_ConvertColourToValueProg.cpp
+ operations/COM_ConvertValueToColorProg.h
+ operations/COM_ConvertValueToColorProg.cpp
+ operations/COM_ConvertColorToValueProg.h
+ operations/COM_ConvertColorToValueProg.cpp
operations/COM_ConvertColorToBWOperation.h
operations/COM_ConvertColorToBWOperation.cpp
operations/COM_ConvertColorToVectorOperation.h
diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp
index 56335630b80..fbdb4cd6b28 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.cpp
+++ b/source/blender/compositor/intern/COM_CompositorContext.cpp
@@ -30,6 +30,7 @@ CompositorContext::CompositorContext()
this->m_quality = COM_QUALITY_HIGH;
this->m_hasActiveOpenCLDevices = false;
this->m_activegNode = NULL;
+ this->m_fastCalculation = false;
}
const int CompositorContext::getFramenumber() const
diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h
index 49acda811f1..2f6abf39985 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.h
+++ b/source/blender/compositor/intern/COM_CompositorContext.h
@@ -73,6 +73,11 @@ private:
* @brief does this system have active opencl devices?
*/
bool m_hasActiveOpenCLDevices;
+
+ /**
+ * @brief Skip slow nodes
+ */
+ bool m_fastCalculation;
public:
/**
@@ -148,6 +153,9 @@ public:
int getChunksize() { return this->getbNodeTree()->chunksize; }
const int isColorManaged() const;
+
+ void setFastCalculation(bool fastCalculation) {this->m_fastCalculation = fastCalculation;}
+ bool isFastCalculation() {return this->m_fastCalculation;}
};
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp
index 38c514d8e99..4ed7ae7ca8a 100644
--- a/source/blender/compositor/intern/COM_Converter.cpp
+++ b/source/blender/compositor/intern/COM_Converter.cpp
@@ -48,8 +48,8 @@
#include "COM_CompositorNode.h"
#include "COM_ConvertAlphaNode.h"
#include "COM_ConvertColorToVectorOperation.h"
-#include "COM_ConvertColourToValueProg.h"
-#include "COM_ConvertValueToColourProg.h"
+#include "COM_ConvertColorToValueProg.h"
+#include "COM_ConvertValueToColorProg.h"
#include "COM_ConvertValueToVectorOperation.h"
#include "COM_ConvertVectorToColorOperation.h"
#include "COM_ConvertVectorToValueOperation.h"
@@ -117,7 +117,7 @@
#include "COM_ViewerNode.h"
#include "COM_ZCombineNode.h"
-Node *Converter::convert(bNode *b_node)
+Node *Converter::convert(bNode *b_node, bool fast)
{
Node *node;
@@ -125,6 +125,22 @@ Node *Converter::convert(bNode *b_node)
node = new MuteNode(b_node);
return node;
}
+ if (fast) {
+ if (b_node->type == CMP_NODE_BLUR ||
+ b_node->type == CMP_NODE_VECBLUR ||
+ b_node->type == CMP_NODE_BILATERALBLUR ||
+ b_node->type == CMP_NODE_DEFOCUS ||
+ b_node->type == CMP_NODE_BOKEHBLUR ||
+ b_node->type == CMP_NODE_GLARE ||
+ b_node->type == CMP_NODE_DBLUR ||
+ b_node->type == CMP_NODE_MOVIEDISTORTION ||
+ b_node->type == CMP_NODE_LENSDIST ||
+ b_node->type == CMP_NODE_DOUBLEEDGEMASK ||
+ b_node->type == CMP_NODE_DILATEERODE)
+ {
+ return new MuteNode(b_node);
+ }
+ }
switch (b_node->type) {
case CMP_NODE_COMPOSITE:
@@ -137,7 +153,7 @@ Node *Converter::convert(bNode *b_node)
node = new TextureNode(b_node);
break;
case CMP_NODE_RGBTOBW:
- node = new ColourToBWNode(b_node);
+ node = new ColorToBWNode(b_node);
break;
case CMP_NODE_MIX_RGB:
node = new MixNode(b_node);
@@ -376,13 +392,13 @@ void Converter::convertDataType(SocketConnection *connection, ExecutionSystem *s
DataType toDatatype = inputSocket->getDataType();
NodeOperation *converter = NULL;
if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
- converter = new ConvertValueToColourProg();
+ converter = new ConvertValueToColorProg();
}
else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
converter = new ConvertValueToVectorOperation();
}
else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
- converter = new ConvertColourToValueProg();
+ converter = new ConvertColorToValueProg();
}
else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
converter = new ConvertColorToVectorOperation();
diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h
index dbe98871c50..15bda0839fa 100644
--- a/source/blender/compositor/intern/COM_Converter.h
+++ b/source/blender/compositor/intern/COM_Converter.h
@@ -42,7 +42,7 @@ public:
* @see Node
* @see MuteNode
*/
- static Node *convert(bNode *b_node);
+ static Node *convert(bNode *b_node, bool fast);
/**
* @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type.
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
index 2d3d24b296f..90f4ba85c78 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
@@ -25,9 +25,6 @@
#include <sstream>
#include <stdlib.h>
-#include "BLI_math.h"
-#include "PIL_time.h"
-
#include "COM_ExecutionGroup.h"
#include "COM_InputSocket.h"
#include "COM_SocketConnection.h"
@@ -41,6 +38,11 @@
#include "COM_ChunkOrder.h"
#include "COM_ExecutionSystemHelper.h"
+#include "BLI_math.h"
+#include "PIL_time.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
ExecutionGroup::ExecutionGroup()
{
this->m_isOutput = false;
@@ -347,6 +349,8 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
finished = false;
startEvaluated = true;
numberEvaluated++;
+
+ WM_main_add_notifier(NC_WINDOW | ND_DRAW, NULL);
}
else if (state == COM_ES_SCHEDULED) {
finished = false;
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp
index 23e243187d5..ff841092848 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp
@@ -44,9 +44,10 @@
#include "MEM_guardedalloc.h"
#endif
-ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering)
+ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering, bool fastcalculation)
{
this->m_context.setbNodeTree(editingtree);
+ this->m_context.setFastCalculation(fastcalculation);
bNode *gnode;
for (gnode = (bNode *)editingtree->nodes.first; gnode; gnode = (bNode *)gnode->next) {
if (gnode->type == NODE_GROUP && gnode->typeinfo->group_edit_get(gnode)) {
@@ -137,8 +138,10 @@ void ExecutionSystem::execute()
WorkScheduler::start(this->m_context);
executeGroups(COM_PRIORITY_HIGH);
- executeGroups(COM_PRIORITY_MEDIUM);
- executeGroups(COM_PRIORITY_LOW);
+ if (!this->getContext().isFastCalculation()) {
+ executeGroups(COM_PRIORITY_MEDIUM);
+ executeGroups(COM_PRIORITY_LOW);
+ }
WorkScheduler::finish();
WorkScheduler::stop();
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h
index e51bd7f3026..209358ec786 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.h
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.h
@@ -156,7 +156,7 @@ public:
* @param editingtree [bNodeTree*]
* @param rendering [true false]
*/
- ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering);
+ ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering, bool fastcalculation);
/**
* Destructor
diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
index 0f6ba1f4ac9..4627d20ab2f 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
@@ -49,7 +49,7 @@ void ExecutionSystemHelper::addbNodeTree(ExecutionSystem &system, int nodes_star
/* add all nodes of the tree to the node list */
bNode *node = (bNode *)tree->nodes.first;
while (node != NULL) {
- addNode(nodes, node, isActiveGroup);
+ addNode(nodes, node, isActiveGroup, system.getContext().isFastCalculation());
node = (bNode *)node->next;
}
@@ -77,11 +77,10 @@ void ExecutionSystemHelper::addNode(vector<Node *>& nodes, Node *node)
nodes.push_back(node);
}
-Node *ExecutionSystemHelper::addNode(vector<Node *>& nodes, bNode *b_node, bool inActiveGroup)
+Node *ExecutionSystemHelper::addNode(vector<Node *>& nodes, bNode *b_node, bool inActiveGroup, bool fast)
{
- Converter converter;
Node *node;
- node = converter.convert(b_node);
+ node = Converter::convert(b_node, fast);
node->setIsInActiveGroup(inActiveGroup);
if (node != NULL) {
addNode(nodes, node);
diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
index 4b65ed15577..bd34fe8ab02 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
+++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
@@ -58,7 +58,7 @@ public:
* @param bNode node to add
* @return Node that represents the bNode or null when not able to convert.
*/
- static Node *addNode(vector<Node *>& nodes, bNode *b_node, bool isInActiveGroup);
+ static Node *addNode(vector<Node *>& nodes, bNode *b_node, bool isInActiveGroup, bool fast);
/**
* @brief Add a Node to a list
diff --git a/source/blender/compositor/intern/COM_Node.cpp b/source/blender/compositor/intern/COM_Node.cpp
index 15b8a3933a7..320baacb669 100644
--- a/source/blender/compositor/intern/COM_Node.cpp
+++ b/source/blender/compositor/intern/COM_Node.cpp
@@ -39,9 +39,9 @@
//#include <stdio.h>
#include "COM_defines.h"
-Node::Node(bNode *editorNode, bool create_sockets)
+Node::Node(bNode *editorNode, bool create_sockets): NodeBase()
{
- this->m_editorNode = editorNode;
+ setbNode(editorNode);
if (create_sockets) {
bNodeSocket *input = (bNodeSocket *)editorNode->inputs.first;
@@ -64,15 +64,6 @@ Node::Node(bNode *editorNode, bool create_sockets)
}
}
}
-Node::Node()
-{
- this->m_editorNode = NULL;
-}
-
-bNode *Node::getbNode()
-{
- return this->m_editorNode;
-}
void Node::addSetValueOperation(ExecutionSystem *graph, InputSocket *inputsocket, int editorNodeInputSocketIndex)
{
diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h
index 5d6d232f37a..bc4a25db605 100644
--- a/source/blender/compositor/intern/COM_Node.h
+++ b/source/blender/compositor/intern/COM_Node.h
@@ -48,10 +48,6 @@ typedef pair<NodeIterator, NodeIterator> NodeRange;
*/
class Node : public NodeBase {
private:
- /**
- * @brief stores the reference to the SDNA bNode struct
- */
- bNode *m_editorNode;
/**
* @brief Is this node part of the active group
@@ -60,12 +56,7 @@ private:
public:
Node(bNode *editorNode, bool create_sockets = true);
-
- /**
- * @brief get the reference to the SDNA bNode struct
- */
- bNode *getbNode();
-
+
/**
* @brief Is this node in the active group (the group that is being edited)
* @param isInActiveGroup
@@ -137,9 +128,6 @@ public:
*/
OutputSocket *findOutputSocketBybNodeSocket(bNodeSocket *socket);
protected:
-
- Node();
-
void addPreviewOperation(ExecutionSystem *system, InputSocket *inputSocket);
void addPreviewOperation(ExecutionSystem *system, OutputSocket *outputSocket);
diff --git a/source/blender/compositor/intern/COM_NodeBase.cpp b/source/blender/compositor/intern/COM_NodeBase.cpp
index 8dbda5f649c..5c2ce37bdea 100644
--- a/source/blender/compositor/intern/COM_NodeBase.cpp
+++ b/source/blender/compositor/intern/COM_NodeBase.cpp
@@ -33,7 +33,7 @@
NodeBase::NodeBase()
{
- /* pass */
+ this->m_editorNode = NULL;
}
diff --git a/source/blender/compositor/intern/COM_NodeBase.h b/source/blender/compositor/intern/COM_NodeBase.h
index 7095cda39e3..3c390f6bcdb 100644
--- a/source/blender/compositor/intern/COM_NodeBase.h
+++ b/source/blender/compositor/intern/COM_NodeBase.h
@@ -54,6 +54,11 @@ private:
*/
vector<OutputSocket *> m_outputsockets;
+ /**
+ * @brief stores the reference to the SDNA bNode struct
+ */
+ bNode *m_editorNode;
+
protected:
/**
* @brief get access to the vector of input sockets
@@ -74,6 +79,18 @@ public:
virtual ~NodeBase();
/**
+ * @brief get the reference to the SDNA bNode struct
+ */
+ bNode *getbNode() {return m_editorNode;}
+
+ /**
+ * @brief set the reference to the bNode
+ * @note used in Node instances to receive the storage/settings and complex node for highlight during execution
+ * @param bNode
+ */
+ void setbNode(bNode *bNode) {this->m_editorNode = bNode;}
+
+ /**
* @brief is this node an operation?
* This is true when the instance is of the subclass NodeOperation.
* @return [true:false]
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp
index 6ef8a5ff078..c3fa308971c 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperation.cpp
@@ -28,7 +28,7 @@
#include "COM_SocketConnection.h"
#include "COM_defines.h"
-NodeOperation::NodeOperation()
+NodeOperation::NodeOperation() : NodeBase()
{
this->m_resolutionInputSocketIndex = 0;
this->m_complex = false;
diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp
index c49ac24e018..120b4d6d0f2 100644
--- a/source/blender/compositor/intern/COM_WorkScheduler.cpp
+++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp
@@ -30,6 +30,7 @@
#include "COM_OpenCLDevice.h"
#include "COM_OpenCLKernels.cl.h"
#include "OCL_opencl.h"
+#include "COM_WriteBufferOperation.h"
#include "PIL_time.h"
#include "BLI_threads.h"
@@ -65,6 +66,25 @@ static bool g_openclActive = false;
#endif
#endif
+#define HIGHLIGHT(wp) \
+{ \
+ ExecutionGroup* group = wp->getExecutionGroup(); \
+ if (group->isComplex()) { \
+ NodeOperation* operation = group->getOutputNodeOperation(); \
+ if (operation->isWriteBufferOperation()) {\
+ WriteBufferOperation *writeOperation = (WriteBufferOperation*)operation;\
+ NodeOperation *complexOperation = writeOperation->getInput(); \
+ bNode *node = complexOperation->getbNode(); \
+ if (node) { \
+ if (node->original) { \
+ node->original->highlight = 1;\
+ } else {\
+ node->highlight = 1; \
+ }\
+ } \
+ } \
+ } \
+}
#if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
void *WorkScheduler::thread_execute_cpu(void *data)
@@ -73,6 +93,7 @@ void *WorkScheduler::thread_execute_cpu(void *data)
WorkPackage *work;
while ((work = (WorkPackage *)BLI_thread_queue_pop(g_cpuqueue))) {
+ HIGHLIGHT(work);
device->execute(work);
delete work;
}
@@ -86,6 +107,7 @@ void *WorkScheduler::thread_execute_gpu(void *data)
WorkPackage *work;
while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) {
+ HIGHLIGHT(work);
device->execute(work);
delete work;
}
diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp
index 7282cf65bc3..ab64f8f7bf1 100644
--- a/source/blender/compositor/intern/COM_compositor.cpp
+++ b/source/blender/compositor/intern/COM_compositor.cpp
@@ -57,8 +57,23 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering)
/* set progress bar to 0% and status to init compositing*/
editingtree->progress(editingtree->prh, 0.0);
+ bool twopass = (editingtree->flag&NTREE_TWO_PASS) > 0 && !rendering;
/* initialize execution system */
- ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering);
+ if (twopass) {
+ ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering, twopass);
+ system->execute();
+ delete system;
+
+ if (editingtree->test_break(editingtree->tbh)) {
+ // during editing multiple calls to this method can be triggered.
+ // make sure one the last one will be doing the work.
+ BLI_mutex_unlock(&compositorMutex);
+ return;
+ }
+ }
+
+
+ ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering, false);
system->execute();
delete system;
diff --git a/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp b/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp
index f96a92068f4..683093302c1 100644
--- a/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp
+++ b/source/blender/compositor/nodes/COM_BilateralBlurNode.cpp
@@ -35,6 +35,7 @@ void BilateralBlurNode::convertToOperations(ExecutionSystem *graph, CompositorCo
{
NodeBilateralBlurData *data = (NodeBilateralBlurData *)this->getbNode()->storage;
BilateralBlurOperation *operation = new BilateralBlurOperation();
+ operation->setbNode(this->getbNode());
operation->setQuality(context->getQuality());
operation->setData(data);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
diff --git a/source/blender/compositor/nodes/COM_BlurNode.cpp b/source/blender/compositor/nodes/COM_BlurNode.cpp
index 1b541d81c33..5447652c238 100644
--- a/source/blender/compositor/nodes/COM_BlurNode.cpp
+++ b/source/blender/compositor/nodes/COM_BlurNode.cpp
@@ -49,6 +49,7 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
if (data->filtertype == R_FILTER_FAST_GAUSS) {
FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation();
operationfgb->setData(data);
+ operationfgb->setbNode(editorNode);
this->getInputSocket(0)->relinkConnections(operationfgb->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operationfgb->getInputSocket(1), 1, graph);
this->getOutputSocket(0)->relinkConnections(operationfgb->getOutputSocket(0));
@@ -58,12 +59,14 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
else if (!data->bokeh) {
GaussianXBlurOperation *operationx = new GaussianXBlurOperation();
operationx->setData(data);
+ operationx->setbNode(editorNode);
operationx->setQuality(quality);
this->getInputSocket(0)->relinkConnections(operationx->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operationx->getInputSocket(1), 1, graph);
graph->addOperation(operationx);
GaussianYBlurOperation *operationy = new GaussianYBlurOperation();
operationy->setData(data);
+ operationy->setbNode(editorNode);
operationy->setQuality(quality);
this->getOutputSocket(0)->relinkConnections(operationy->getOutputSocket());
graph->addOperation(operationy);
@@ -79,6 +82,7 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
else {
GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation();
operation->setData(data);
+ operation->setbNode(editorNode);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph);
operation->setQuality(quality);
diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
index 59ec9525fa6..0ea4b20c793 100644
--- a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
+++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
@@ -61,6 +61,7 @@ void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContex
this->getInputSocket(3)->relinkConnections(operation->getInputSocket(2), 3, graph);
operation->setSize(((bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value);
operation->setQuality(context->getQuality());
+ operation->setbNode(this->getbNode());
graph->addOperation(operation);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
// }
diff --git a/source/blender/compositor/nodes/COM_ColorToBWNode.cpp b/source/blender/compositor/nodes/COM_ColorToBWNode.cpp
index 430f317eae2..511fdf09f41 100644
--- a/source/blender/compositor/nodes/COM_ColorToBWNode.cpp
+++ b/source/blender/compositor/nodes/COM_ColorToBWNode.cpp
@@ -25,18 +25,18 @@
#include "COM_ConvertColorToBWOperation.h"
#include "COM_ExecutionSystem.h"
-ColourToBWNode::ColourToBWNode(bNode *editorNode) : Node(editorNode)
+ColorToBWNode::ColorToBWNode(bNode *editorNode) : Node(editorNode)
{
/* pass */
}
-void ColourToBWNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+void ColorToBWNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
- InputSocket *colourSocket = this->getInputSocket(0);
+ InputSocket *colorSocket = this->getInputSocket(0);
OutputSocket *valueSocket = this->getOutputSocket(0);
ConvertColorToBWOperation *convertProg = new ConvertColorToBWOperation();
- colourSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph);
+ colorSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph);
valueSocket->relinkConnections(convertProg->getOutputSocket(0));
graph->addOperation(convertProg);
}
diff --git a/source/blender/compositor/nodes/COM_ColorToBWNode.h b/source/blender/compositor/nodes/COM_ColorToBWNode.h
index 9262634edda..f21c6ecef52 100644
--- a/source/blender/compositor/nodes/COM_ColorToBWNode.h
+++ b/source/blender/compositor/nodes/COM_ColorToBWNode.h
@@ -20,18 +20,18 @@
* Monique Dewanchand
*/
-#ifndef _COM_ColourToBWNode_h_
-#define _COM_ColourToBWNode_h_
+#ifndef _COM_ColorToBWNode_h_
+#define _COM_ColorToBWNode_h_
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief ColourToBWNode
+ * @brief ColorToBWNode
* @ingroup Node
*/
-class ColourToBWNode : public Node {
+class ColorToBWNode : public Node {
public:
- ColourToBWNode(bNode *editorNode);
+ ColorToBWNode(bNode *editorNode);
void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
};
#endif
diff --git a/source/blender/compositor/nodes/COM_CompositorNode.cpp b/source/blender/compositor/nodes/COM_CompositorNode.cpp
index 6a6f2d1b4ff..28e466203c4 100644
--- a/source/blender/compositor/nodes/COM_CompositorNode.cpp
+++ b/source/blender/compositor/nodes/COM_CompositorNode.cpp
@@ -34,12 +34,12 @@ void CompositorNode::convertToOperations(ExecutionSystem *graph, CompositorConte
InputSocket *imageSocket = this->getInputSocket(0);
InputSocket *alphaSocket = this->getInputSocket(1);
if (imageSocket->isConnected()) {
- CompositorOperation *colourAlphaProg = new CompositorOperation();
- colourAlphaProg->setRenderData(context->getRenderData());
- colourAlphaProg->setbNodeTree(context->getbNodeTree());
- imageSocket->relinkConnections(colourAlphaProg->getInputSocket(0));
- alphaSocket->relinkConnections(colourAlphaProg->getInputSocket(1));
- graph->addOperation(colourAlphaProg);
- addPreviewOperation(graph, colourAlphaProg->getInputSocket(0));
+ CompositorOperation *colorAlphaProg = new CompositorOperation();
+ colorAlphaProg->setRenderData(context->getRenderData());
+ colorAlphaProg->setbNodeTree(context->getbNodeTree());
+ imageSocket->relinkConnections(colorAlphaProg->getInputSocket(0));
+ alphaSocket->relinkConnections(colorAlphaProg->getInputSocket(1));
+ graph->addOperation(colorAlphaProg);
+ addPreviewOperation(graph, colorAlphaProg->getInputSocket(0));
}
}
diff --git a/source/blender/compositor/nodes/COM_DefocusNode.cpp b/source/blender/compositor/nodes/COM_DefocusNode.cpp
index 461505871c6..4c6b3ad137b 100644
--- a/source/blender/compositor/nodes/COM_DefocusNode.cpp
+++ b/source/blender/compositor/nodes/COM_DefocusNode.cpp
@@ -46,6 +46,7 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
NodeDefocus *data = (NodeDefocus *)node->storage;
NodeOperation *radiusOperation;
+ OutputSocket * depthOperation;
if (data->no_zbuf) {
MathMultiplyOperation *multiply = new MathMultiplyOperation();
SetValueOperation *multiplier = new SetValueOperation();
@@ -63,6 +64,7 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
graph->addOperation(maxRadius);
graph->addOperation(minimize);
radiusOperation = minimize;
+ depthOperation = minimize->getOutputSocket(0);
}
else {
ConvertDepthToRadiusOperation *converter = new ConvertDepthToRadiusOperation();
@@ -72,6 +74,7 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
this->getInputSocket(1)->relinkConnections(converter->getInputSocket(0), 1, graph);
graph->addOperation(converter);
radiusOperation = converter;
+ depthOperation = converter->getInputSocket(0)->getConnection()->getFromSocket();
}
BokehImageOperation *bokeh = new BokehImageOperation();
@@ -89,7 +92,15 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
bokeh->setData(bokehdata);
bokeh->deleteDataOnFinish();
graph->addOperation(bokeh);
-
+
+#ifdef COM_DEFOCUS_SEARCH
+ InverseSearchRadiusOperation *search = new InverseSearchRadiusOperation();
+ addLink(graph, radiusOperation->getOutputSocket(0), search->getInputSocket(0));
+ addLink(graph, depthOperation, search->getInputSocket(1));
+ search->setMaxBlur(data->maxblur);
+ search->setThreshold(data->bthresh);
+ graph->addOperation(search);
+#endif
VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
if (data->preview) {
operation->setQuality(COM_QUALITY_LOW);
@@ -97,10 +108,14 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
operation->setQuality(context->getQuality());
}
operation->setMaxBlur(data->maxblur);
+ operation->setbNode(node);
operation->setThreshold(data->bthresh);
addLink(graph, bokeh->getOutputSocket(), operation->getInputSocket(1));
addLink(graph, radiusOperation->getOutputSocket(), operation->getInputSocket(2));
- addLink(graph, radiusOperation->getInputSocket(0)->getConnection()->getFromSocket(), operation->getInputSocket(3));
+ addLink(graph, depthOperation, operation->getInputSocket(3));
+#ifdef COM_DEFOCUS_SEARCH
+ addLink(graph, search->getOutputSocket(), operation->getInputSocket(4));
+#endif
if (data->gamco) {
GammaCorrectOperation *correct = new GammaCorrectOperation();
GammaUncorrectOperation *inverse = new GammaUncorrectOperation();
@@ -115,6 +130,5 @@ void DefocusNode::convertToOperations(ExecutionSystem *graph, CompositorContext
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getOutputSocket()->relinkConnections(operation->getOutputSocket());
}
-
graph->addOperation(operation);
}
diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
index 3f4e3736bbe..043ae367fbb 100644
--- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
+++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp
@@ -40,6 +40,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont
bNode *editorNode = this->getbNode();
if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) {
DilateErodeThresholdOperation *operation = new DilateErodeThresholdOperation();
+ operation->setbNode(editorNode);
operation->setDistance(editorNode->custom2);
operation->setInset(editorNode->custom3);
@@ -59,6 +60,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont
else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) {
if (editorNode->custom2 > 0) {
DilateDistanceOperation *operation = new DilateDistanceOperation();
+ operation->setbNode(editorNode);
operation->setDistance(editorNode->custom2);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
@@ -66,6 +68,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont
}
else {
ErodeDistanceOperation *operation = new ErodeDistanceOperation();
+ operation->setbNode(editorNode);
operation->setDistance(-editorNode->custom2);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
@@ -90,12 +93,14 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont
}
GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation();
+ operationx->setbNode(editorNode);
operationx->setData(data);
operationx->setQuality(quality);
this->getInputSocket(0)->relinkConnections(operationx->getInputSocket(0), 0, graph);
// this->getInputSocket(1)->relinkConnections(operationx->getInputSocket(1), 1, graph); // no size input yet
graph->addOperation(operationx);
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
+ operationy->setbNode(editorNode);
operationy->setData(data);
operationy->setQuality(quality);
this->getOutputSocket(0)->relinkConnections(operationy->getOutputSocket());
@@ -127,6 +132,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont
else {
if (editorNode->custom2 > 0) {
DilateStepOperation *operation = new DilateStepOperation();
+ operation->setbNode(editorNode);
operation->setIterations(editorNode->custom2);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
@@ -134,6 +140,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont
}
else {
ErodeStepOperation *operation = new ErodeStepOperation();
+ operation->setbNode(editorNode);
operation->setIterations(-editorNode->custom2);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
diff --git a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp
index 57c319e7630..ab1d83385c7 100644
--- a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp
+++ b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.cpp
@@ -36,6 +36,7 @@ void DoubleEdgeMaskNode::convertToOperations(ExecutionSystem *system, Compositor
bNode *bnode = this->getbNode();
operation = new DoubleEdgeMaskOperation();
+ operation->setbNode(bnode);
operation->setAdjecentOnly(bnode->custom1);
operation->setKeepInside(bnode->custom2);
diff --git a/source/blender/compositor/nodes/COM_FilterNode.cpp b/source/blender/compositor/nodes/COM_FilterNode.cpp
index 23f87805821..021ec6c2508 100644
--- a/source/blender/compositor/nodes/COM_FilterNode.cpp
+++ b/source/blender/compositor/nodes/COM_FilterNode.cpp
@@ -73,7 +73,7 @@ void FilterNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
operation->set3x3Filter(0, 0, 0, 0, 1, 0, 0, 0, 0);
break;
}
-
+ operation->setbNode(this->getbNode());
inputImageSocket->relinkConnections(operation->getInputSocket(0), 1, graph);
inputSocket->relinkConnections(operation->getInputSocket(1), 0, graph);
outputSocket->relinkConnections(operation->getOutputSocket());
diff --git a/source/blender/compositor/nodes/COM_GlareNode.cpp b/source/blender/compositor/nodes/COM_GlareNode.cpp
index 7b34fa4d286..8782e6bb6d9 100644
--- a/source/blender/compositor/nodes/COM_GlareNode.cpp
+++ b/source/blender/compositor/nodes/COM_GlareNode.cpp
@@ -63,6 +63,8 @@ void GlareNode::convertToOperations(ExecutionSystem *system, CompositorContext *
SetValueOperation *mixvalueoperation = new SetValueOperation();
MixGlareOperation *mixoperation = new MixGlareOperation();
mixoperation->getInputSocket(2)->setResizeMode(COM_SC_FIT);
+ thresholdOperation->setbNode(node);
+ glareoperation->setbNode(node);
this->getInputSocket(0)->relinkConnections(thresholdOperation->getInputSocket(0), 0, system);
addLink(system, thresholdOperation->getOutputSocket(), glareoperation->getInputSocket(0));
diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp
index df125403f98..fd961030ebf 100644
--- a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp
+++ b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.cpp
@@ -22,7 +22,7 @@
#include "COM_HueSaturationValueCorrectNode.h"
-#include "COM_ConvertColourToValueProg.h"
+#include "COM_ConvertColorToValueProg.h"
#include "COM_ExecutionSystem.h"
#include "COM_ConvertRGBToHSVOperation.h"
#include "COM_ConvertHSVToRGBOperation.h"
@@ -41,7 +41,7 @@ HueSaturationValueCorrectNode::HueSaturationValueCorrectNode(bNode *editorNode)
void HueSaturationValueCorrectNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
InputSocket *valueSocket = this->getInputSocket(0);
- InputSocket *colourSocket = this->getInputSocket(1);
+ InputSocket *colorSocket = this->getInputSocket(1);
OutputSocket *outputSocket = this->getOutputSocket(0);
bNode *editorsnode = getbNode();
CurveMapping *storage = (CurveMapping *)editorsnode->storage;
@@ -51,7 +51,7 @@ void HueSaturationValueCorrectNode::convertToOperations(ExecutionSystem *graph,
HueSaturationValueCorrectOperation *changeHSV = new HueSaturationValueCorrectOperation();
MixBlendOperation *blend = new MixBlendOperation();
- colourSocket->relinkConnections(rgbToHSV->getInputSocket(0), 1, graph);
+ colorSocket->relinkConnections(rgbToHSV->getInputSocket(0), 1, graph);
addLink(graph, rgbToHSV->getOutputSocket(), changeHSV->getInputSocket(0));
addLink(graph, changeHSV->getOutputSocket(), hsvToRGB->getInputSocket(0));
addLink(graph, hsvToRGB->getOutputSocket(), blend->getInputSocket(2));
diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp
index ef501317e48..9b55b809212 100644
--- a/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp
+++ b/source/blender/compositor/nodes/COM_HueSaturationValueNode.cpp
@@ -22,7 +22,7 @@
#include "COM_HueSaturationValueNode.h"
-#include "COM_ConvertColourToValueProg.h"
+#include "COM_ConvertColorToValueProg.h"
#include "COM_ExecutionSystem.h"
#include "COM_ConvertRGBToHSVOperation.h"
#include "COM_ConvertHSVToRGBOperation.h"
@@ -40,7 +40,7 @@ HueSaturationValueNode::HueSaturationValueNode(bNode *editorNode) : Node(editorN
void HueSaturationValueNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
InputSocket *valueSocket = this->getInputSocket(0);
- InputSocket *colourSocket = this->getInputSocket(1);
+ InputSocket *colorSocket = this->getInputSocket(1);
OutputSocket *outputSocket = this->getOutputSocket(0);
bNode *editorsnode = getbNode();
NodeHueSat *storage = (NodeHueSat *)editorsnode->storage;
@@ -50,7 +50,7 @@ void HueSaturationValueNode::convertToOperations(ExecutionSystem *graph, Composi
ChangeHSVOperation *changeHSV = new ChangeHSVOperation();
MixBlendOperation *blend = new MixBlendOperation();
- colourSocket->relinkConnections(rgbToHSV->getInputSocket(0), 0, graph);
+ colorSocket->relinkConnections(rgbToHSV->getInputSocket(0), 0, graph);
addLink(graph, rgbToHSV->getOutputSocket(), changeHSV->getInputSocket(0));
addLink(graph, changeHSV->getOutputSocket(), hsvToRGB->getInputSocket(0));
addLink(graph, hsvToRGB->getOutputSocket(), blend->getInputSocket(2));
diff --git a/source/blender/compositor/nodes/COM_KeyingNode.cpp b/source/blender/compositor/nodes/COM_KeyingNode.cpp
index cc6fc6e1236..7c39765fbf1 100644
--- a/source/blender/compositor/nodes/COM_KeyingNode.cpp
+++ b/source/blender/compositor/nodes/COM_KeyingNode.cpp
@@ -74,9 +74,11 @@ OutputSocket *KeyingNode::setupPreBlur(ExecutionSystem *graph, InputSocket *inpu
blurXOperation->setSize(size);
blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
+ blurXOperation->setbNode(this->getbNode());
blurYOperation->setSize(size);
blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
+ blurYOperation->setbNode(this->getbNode());
addLink(graph, separateOperation->getOutputSocket(), blurXOperation->getInputSocket(0));
addLink(graph, blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
@@ -104,9 +106,11 @@ OutputSocket *KeyingNode::setupPostBlur(ExecutionSystem *graph, OutputSocket *po
blurXOperation->setSize(size);
blurXOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_X);
+ blurXOperation->setbNode(this->getbNode());
blurYOperation->setSize(size);
blurYOperation->setAxis(KeyingBlurOperation::BLUR_AXIS_Y);
+ blurYOperation->setbNode(this->getbNode());
addLink(graph, postBlurInput, blurXOperation->getInputSocket(0));
addLink(graph, blurXOperation->getOutputSocket(), blurYOperation->getInputSocket(0));
@@ -129,6 +133,7 @@ OutputSocket *KeyingNode::setupDilateErode(ExecutionSystem *graph, OutputSocket
dilateErodeOperation = new ErodeDistanceOperation();
dilateErodeOperation->setDistance(-distance);
}
+ dilateErodeOperation->setbNode(this->getbNode());
addLink(graph, dilateErodeInput, dilateErodeOperation->getInputSocket(0));
@@ -161,14 +166,16 @@ OutputSocket *KeyingNode::setupFeather(ExecutionSystem *graph, CompositorContext
operationx->setSize(1.0f);
operationx->setSubtract(distance < 0);
operationx->setFalloff(falloff);
+ operationx->setbNode(this->getbNode());
graph->addOperation(operationx);
-
+
GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
operationy->setData(data);
operationy->setQuality(quality);
operationy->setSize(1.0f);
operationy->setSubtract(distance < 0);
operationy->setFalloff(falloff);
+ operationy->setbNode(this->getbNode());
graph->addOperation(operationy);
addLink(graph, featherInput, operationx->getInputSocket(0));
diff --git a/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp b/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp
index 0fb8d45d066..cd1f79235ea 100644
--- a/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp
+++ b/source/blender/compositor/nodes/COM_KeyingScreenNode.cpp
@@ -45,6 +45,7 @@ void KeyingScreenNode::convertToOperations(ExecutionSystem *graph, CompositorCon
// always connect the output image
KeyingScreenOperation *operation = new KeyingScreenOperation();
+ operation->setbNode(editorNode);
if (outputScreen->isConnected()) {
outputScreen->relinkConnections(operation->getOutputSocket());
diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp
index 0319e66ee22..3913b4ac2b6 100644
--- a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp
+++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp
@@ -37,7 +37,7 @@ void LensDistortionNode::convertToOperations(ExecutionSystem *graph, CompositorC
NodeLensDist *data = (NodeLensDist *)editorNode->storage;
if (data->proj) {
ProjectorLensDistortionOperation *operation = new ProjectorLensDistortionOperation();
-
+ operation->setbNode(editorNode);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getInputSocket(2)->relinkConnections(operation->getInputSocket(1), 2, graph);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
@@ -48,13 +48,21 @@ void LensDistortionNode::convertToOperations(ExecutionSystem *graph, CompositorC
}
else {
ScreenLensDistortionOperation *operation = new ScreenLensDistortionOperation();
+ operation->setbNode(editorNode);
+ operation->setData(data);
+ if (!(this->getInputSocket(1)->isConnected() || this->getInputSocket(2)->isConnected())) {
+ // no nodes connected to the distortion and dispersion. We can precalculate some values
+ float distortion = ((const bNodeSocketValueFloat *)this->getInputSocket(1)->getbNodeSocket()->default_value)->value;
+ float dispersion = ((const bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value;
+ operation->setDistortionAndDispersion(distortion, dispersion);
+ }
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph);
this->getInputSocket(2)->relinkConnections(operation->getInputSocket(2), 2, graph);
+
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
- operation->setData(data);
graph->addOperation(operation);
}
diff --git a/source/blender/compositor/nodes/COM_MapValueNode.cpp b/source/blender/compositor/nodes/COM_MapValueNode.cpp
index ba2fc804f42..ac57ffed9da 100644
--- a/source/blender/compositor/nodes/COM_MapValueNode.cpp
+++ b/source/blender/compositor/nodes/COM_MapValueNode.cpp
@@ -32,12 +32,12 @@ MapValueNode::MapValueNode(bNode *editorNode) : Node(editorNode)
void MapValueNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
- InputSocket *colourSocket = this->getInputSocket(0);
+ InputSocket *colorSocket = this->getInputSocket(0);
OutputSocket *valueSocket = this->getOutputSocket(0);
TexMapping *storage = (TexMapping *)this->getbNode()->storage;
MapValueOperation *convertProg = new MapValueOperation();
convertProg->setSettings(storage);
- colourSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph);
+ colorSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph);
valueSocket->relinkConnections(convertProg->getOutputSocket(0));
graph->addOperation(convertProg);
}
diff --git a/source/blender/compositor/nodes/COM_MaskNode.cpp b/source/blender/compositor/nodes/COM_MaskNode.cpp
index 13037b61a56..b6300300f6f 100644
--- a/source/blender/compositor/nodes/COM_MaskNode.cpp
+++ b/source/blender/compositor/nodes/COM_MaskNode.cpp
@@ -45,7 +45,7 @@ void MaskNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
// always connect the output image
MaskOperation *operation = new MaskOperation();
-
+ operation->setbNode(editorNode);
operation->setMaskWidth(data->xsch * data->size / 100.0f);
operation->setMaskHeight(data->ysch * data->size / 100.0f);
diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
index 95e759fde24..dfb46af841c 100644
--- a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
+++ b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
@@ -82,7 +82,7 @@ void RenderLayersNode::testSocketConnection(ExecutionSystem *system, int outputS
void RenderLayersNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
- testSocketConnection(graph, 0, new RenderLayersColourProg());
+ testSocketConnection(graph, 0, new RenderLayersColorProg());
testSocketConnection(graph, 1, new RenderLayersAlphaProg());
testSocketConnection(graph, 2, new RenderLayersDepthProg());
testSocketConnection(graph, 3, new RenderLayersNormalOperation());
diff --git a/source/blender/compositor/nodes/COM_TonemapNode.cpp b/source/blender/compositor/nodes/COM_TonemapNode.cpp
index a1f33ed464b..68e322e9dcf 100644
--- a/source/blender/compositor/nodes/COM_TonemapNode.cpp
+++ b/source/blender/compositor/nodes/COM_TonemapNode.cpp
@@ -34,7 +34,7 @@ void TonemapNode::convertToOperations(ExecutionSystem *system, CompositorContext
{
NodeTonemap *data = (NodeTonemap *)this->getbNode()->storage;
TonemapOperation *operation = data->type == 1 ? new PhotoreceptorTonemapOperation() : new TonemapOperation();
-
+ operation->setbNode(this->getbNode());
operation->setData(data);
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, system);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
diff --git a/source/blender/compositor/nodes/COM_VectorBlurNode.cpp b/source/blender/compositor/nodes/COM_VectorBlurNode.cpp
index 5ef384a9984..07c8120b1d2 100644
--- a/source/blender/compositor/nodes/COM_VectorBlurNode.cpp
+++ b/source/blender/compositor/nodes/COM_VectorBlurNode.cpp
@@ -34,6 +34,7 @@ void VectorBlurNode::convertToOperations(ExecutionSystem *system, CompositorCont
bNode *node = this->getbNode();
NodeBlurData *vectorBlurSettings = (NodeBlurData *)node->storage;
VectorBlurOperation *operation = new VectorBlurOperation();
+ operation->setbNode(node);
operation->setVectorBlurSettings(vectorBlurSettings);
operation->setQuality(context->getQuality());
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, system);
diff --git a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
index e5b1f56f06c..113ec245ee6 100644
--- a/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverKeyOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class AlphaOverKeyOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
index 24a991da17b..3c0b955e360 100644
--- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class AlphaOverMixedOperation : public MixBaseOperation {
private:
diff --git a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
index bba3b714f6b..7b7b9238794 100644
--- a/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
+++ b/source/blender/compositor/operations/COM_AlphaOverPremultiplyOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class AlphaOverPremultiplyOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_ChangeHSVOperation.h b/source/blender/compositor/operations/COM_ChangeHSVOperation.h
index 9c343db9c3c..ee35fbe01d4 100644
--- a/source/blender/compositor/operations/COM_ChangeHSVOperation.h
+++ b/source/blender/compositor/operations/COM_ChangeHSVOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ChangeHSVOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ChannelMatteOperation.h b/source/blender/compositor/operations/COM_ChannelMatteOperation.h
index 5bc13736dda..ee17036a78d 100644
--- a/source/blender/compositor/operations/COM_ChannelMatteOperation.h
+++ b/source/blender/compositor/operations/COM_ChannelMatteOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ChannelMatteOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ChromaMatteOperation.h b/source/blender/compositor/operations/COM_ChromaMatteOperation.h
index 472a797fa28..eaca05e66ca 100644
--- a/source/blender/compositor/operations/COM_ChromaMatteOperation.h
+++ b/source/blender/compositor/operations/COM_ChromaMatteOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ChromaMatteOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
index 479927d30d1..a9c0dff9ad4 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
+++ b/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.h
@@ -25,8 +25,8 @@
#include "COM_NodeOperation.h"
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ColorBalanceASCCDLOperation : public NodeOperation {
protected:
diff --git a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
index ec3652da09e..ffc78fae6f1 100644
--- a/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
+++ b/source/blender/compositor/operations/COM_ColorBalanceLGGOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ColorBalanceLGGOperation : public NodeOperation {
protected:
diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.h b/source/blender/compositor/operations/COM_ColorMatteOperation.h
index ae904f8f938..d996ce34667 100644
--- a/source/blender/compositor/operations/COM_ColorMatteOperation.h
+++ b/source/blender/compositor/operations/COM_ColorMatteOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ColorMatteOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ColorSpillOperation.h b/source/blender/compositor/operations/COM_ColorSpillOperation.h
index 6e3156819b2..7aac612cb8c 100644
--- a/source/blender/compositor/operations/COM_ColorSpillOperation.h
+++ b/source/blender/compositor/operations/COM_ColorSpillOperation.h
@@ -25,8 +25,8 @@
#include "COM_NodeOperation.h"
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ColorSpillOperation : public NodeOperation {
protected:
diff --git a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
index 0b9a07a57ca..b237448d16e 100644
--- a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertColorProfileOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h
index 2a57c997196..9c62ad8dd39 100644
--- a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertColorToBWOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertColourToValueProg.cpp b/source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp
index c872f3e85bb..c09842b1aa9 100644
--- a/source/blender/compositor/operations/COM_ConvertColourToValueProg.cpp
+++ b/source/blender/compositor/operations/COM_ConvertColorToValueProg.cpp
@@ -20,28 +20,28 @@
* Monique Dewanchand
*/
-#include "COM_ConvertColourToValueProg.h"
+#include "COM_ConvertColorToValueProg.h"
-ConvertColourToValueProg::ConvertColourToValueProg() : NodeOperation()
+ConvertColorToValueProg::ConvertColorToValueProg() : NodeOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->m_inputOperation = NULL;
}
-void ConvertColourToValueProg::initExecution()
+void ConvertColorToValueProg::initExecution()
{
this->m_inputOperation = this->getInputSocketReader(0);
}
-void ConvertColourToValueProg::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
+void ConvertColorToValueProg::executePixel(float *outputValue, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
{
float inputColor[4];
this->m_inputOperation->read(&inputColor[0], x, y, sampler, inputBuffers);
outputValue[0] = (inputColor[0] + inputColor[1] + inputColor[2]) / 3.0f;
}
-void ConvertColourToValueProg::deinitExecution()
+void ConvertColorToValueProg::deinitExecution()
{
this->m_inputOperation = NULL;
}
diff --git a/source/blender/compositor/operations/COM_ConvertColourToValueProg.h b/source/blender/compositor/operations/COM_ConvertColorToValueProg.h
index ebd4bcbd59b..c1ac7ca69ce 100644
--- a/source/blender/compositor/operations/COM_ConvertColourToValueProg.h
+++ b/source/blender/compositor/operations/COM_ConvertColorToValueProg.h
@@ -20,16 +20,16 @@
* Monique Dewanchand
*/
-#ifndef _COM_ConvertColourToValueProg_h
-#define _COM_ConvertColourToValueProg_h
+#ifndef _COM_ConvertColorToValueProg_h
+#define _COM_ConvertColorToValueProg_h
#include "COM_NodeOperation.h"
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
-class ConvertColourToValueProg : public NodeOperation {
+class ConvertColorToValueProg : public NodeOperation {
private:
/**
* Cached reference to the inputProgram
@@ -39,7 +39,7 @@ public:
/**
* Default constructor
*/
- ConvertColourToValueProg();
+ ConvertColorToValueProg();
/**
* the inner loop of this program
diff --git a/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h b/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h
index f9170dfc7aa..51fa3a677cd 100644
--- a/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertColorToVectorOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertColorToVectorOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
index 966a74c04ad..415befea168 100644
--- a/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertDepthToRadiusOperation.h
@@ -26,8 +26,8 @@
#include "DNA_object_types.h"
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertDepthToRadiusOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h b/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h
index f8b6a4c11fa..3babbfb7c1d 100644
--- a/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertHSVToRGBOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertHSVToRGBOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h b/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h
index 2b5e1871972..50b39928305 100644
--- a/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertKeyToPremulOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertKeyToPremulOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h b/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h
index 05c6b26b171..173cbb4fc0a 100644
--- a/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertPremulToKeyOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertPremulToKeyOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h b/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h
index af8a7f78a61..42bd439c8c2 100644
--- a/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertRGBToHSVOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertRGBToHSVOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h b/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h
index 97fbdb29874..744e0657dc6 100644
--- a/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertRGBToYCCOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertRGBToYCCOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h b/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h
index 89998897782..b470378704e 100644
--- a/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertRGBToYUVOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertRGBToYUVOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertValueToColourProg.cpp b/source/blender/compositor/operations/COM_ConvertValueToColorProg.cpp
index a29a381938f..100a4931d69 100644
--- a/source/blender/compositor/operations/COM_ConvertValueToColourProg.cpp
+++ b/source/blender/compositor/operations/COM_ConvertValueToColorProg.cpp
@@ -20,20 +20,20 @@
* Monique Dewanchand
*/
-#include "COM_ConvertValueToColourProg.h"
+#include "COM_ConvertValueToColorProg.h"
-ConvertValueToColourProg::ConvertValueToColourProg() : NodeOperation()
+ConvertValueToColorProg::ConvertValueToColorProg() : NodeOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputProgram = NULL;
}
-void ConvertValueToColourProg::initExecution()
+void ConvertValueToColorProg::initExecution()
{
this->m_inputProgram = this->getInputSocketReader(0);
}
-void ConvertValueToColourProg::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
+void ConvertValueToColorProg::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[])
{
float inputValue[4];
this->m_inputProgram->read(inputValue, x, y, sampler, inputBuffers);
@@ -43,7 +43,7 @@ void ConvertValueToColourProg::executePixel(float *color, float x, float y, Pixe
color[3] = 1.0f;
}
-void ConvertValueToColourProg::deinitExecution()
+void ConvertValueToColorProg::deinitExecution()
{
this->m_inputProgram = NULL;
}
diff --git a/source/blender/compositor/operations/COM_ConvertValueToColourProg.h b/source/blender/compositor/operations/COM_ConvertValueToColorProg.h
index 69ce7e9afea..d59964dd400 100644
--- a/source/blender/compositor/operations/COM_ConvertValueToColourProg.h
+++ b/source/blender/compositor/operations/COM_ConvertValueToColorProg.h
@@ -20,19 +20,19 @@
* Monique Dewanchand
*/
-#ifndef _COM_ConvertValueToColourProg_h
-#define _COM_ConvertValueToColourProg_h
+#ifndef _COM_ConvertValueToColorProg_h
+#define _COM_ConvertValueToColorProg_h
#include "COM_NodeOperation.h"
-class ConvertValueToColourProg : public NodeOperation {
+class ConvertValueToColorProg : public NodeOperation {
private:
/**
* Cached reference to the inputProgram
*/
SocketReader *m_inputProgram;
public:
- ConvertValueToColourProg();
+ ConvertValueToColorProg();
/**
* the inner loop of this program
diff --git a/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h b/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h
index 781b31f7fce..0e79c1ff3df 100644
--- a/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertValueToVectorOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertValueToVectorOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h b/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h
index 2f1173ba4e8..8225d03d58e 100644
--- a/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertVectorToColorOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertVectorToColorOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h b/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h
index 8770992c69c..a7981e8dc59 100644
--- a/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertVectorToValueOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertVectorToValueOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h b/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h
index a595fc19bc7..e23dfd8a985 100644
--- a/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertYCCToRGBOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertYCCToRGBOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h b/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h
index e89f1500d69..3368e0a24df 100644
--- a/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertYUVToRGBOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ConvertYUVToRGBOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
index 75f909e2198..3c4bdfe8e5b 100644
--- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
+++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
@@ -49,7 +49,7 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y
float inColor1[4];
float inColor2[4];
- const float tolerence = this->m_settings->t1;
+ const float tolerance = this->m_settings->t1;
const float falloff = this->m_settings->t2;
float difference;
float alpha;
@@ -65,12 +65,12 @@ void DifferenceMatteOperation::executePixel(float *outputValue, float x, float y
difference = difference / 3.0f;
/*make 100% transparent*/
- if (difference < tolerence) {
+ if (difference < tolerance) {
outputValue[0] = 0.0f;
}
/*in the falloff region, make partially transparent */
- else if (difference < falloff + tolerence) {
- difference = difference - tolerence;
+ else if (difference < falloff + tolerance) {
+ difference = difference - tolerance;
alpha = difference / falloff;
/*only change if more transparent than before */
if (alpha < inColor1[3]) {
diff --git a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h
index 48eb2626f02..c35550560e1 100644
--- a/source/blender/compositor/operations/COM_DifferenceMatteOperation.h
+++ b/source/blender/compositor/operations/COM_DifferenceMatteOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class DifferenceMatteOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp b/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp
index 19cca3d25bb..5bdc616fed7 100644
--- a/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp
+++ b/source/blender/compositor/operations/COM_DistanceMatteOperation.cpp
@@ -49,7 +49,7 @@ void DistanceMatteOperation::executePixel(float *outputValue, float x, float y,
float inKey[4];
float inImage[4];
- const float tolerence = this->m_settings->t1;
+ const float tolerance = this->m_settings->t1;
const float falloff = this->m_settings->t2;
float distance;
@@ -67,12 +67,12 @@ void DistanceMatteOperation::executePixel(float *outputValue, float x, float y,
*/
/*make 100% transparent */
- if (distance < tolerence) {
+ if (distance < tolerance) {
outputValue[0] = 0.f;
}
/*in the falloff region, make partially transparent */
- else if (distance < falloff + tolerence) {
- distance = distance - tolerence;
+ else if (distance < falloff + tolerance) {
+ distance = distance - tolerance;
alpha = distance / falloff;
/*only change if more transparent than before */
if (alpha < inImage[3]) {
diff --git a/source/blender/compositor/operations/COM_DistanceMatteOperation.h b/source/blender/compositor/operations/COM_DistanceMatteOperation.h
index 51e139d179e..267aa1fca7a 100644
--- a/source/blender/compositor/operations/COM_DistanceMatteOperation.h
+++ b/source/blender/compositor/operations/COM_DistanceMatteOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class DistanceMatteOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h
index 7da56465cd8..041fd0d7ee9 100644
--- a/source/blender/compositor/operations/COM_LuminanceMatteOperation.h
+++ b/source/blender/compositor/operations/COM_LuminanceMatteOperation.h
@@ -25,8 +25,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class LuminanceMatteOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_MapValueOperation.h b/source/blender/compositor/operations/COM_MapValueOperation.h
index 53157c39938..fb50d0fbe4d 100644
--- a/source/blender/compositor/operations/COM_MapValueOperation.h
+++ b/source/blender/compositor/operations/COM_MapValueOperation.h
@@ -26,8 +26,8 @@
#include "DNA_texture_types.h"
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MapValueOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp
index aa16ecf5d09..2b45cd53fd5 100644
--- a/source/blender/compositor/operations/COM_MaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_MaskOperation.cpp
@@ -49,11 +49,19 @@ MaskOperation::MaskOperation() : NodeOperation()
void MaskOperation::initExecution()
{
initMutex();
+
this->m_rasterizedMask = NULL;
+ this->m_maskLayers.first = this->m_maskLayers.last = NULL;
+
+ if (this->m_mask) {
+ BKE_mask_layer_copy_list(&this->m_maskLayers, &this->m_mask->masklayers);
+ }
}
void MaskOperation::deinitExecution()
{
+ BKE_mask_layer_free_list(&this->m_maskLayers);
+
if (this->m_rasterizedMask) {
MEM_freeN(this->m_rasterizedMask);
this->m_rasterizedMask = NULL;
@@ -75,7 +83,10 @@ void *MaskOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers
float *buffer;
buffer = (float *)MEM_callocN(sizeof(float) * width * height, "rasterized mask");
- BKE_mask_rasterize(this->m_mask, width, height, buffer, TRUE, this->m_do_smooth, this->m_do_feather);
+
+ BKE_mask_rasterize_layers(&this->m_maskLayers, width, height, buffer, TRUE,
+ this->m_do_smooth, this->m_do_feather);
+
if (this->m_do_smooth) {
PLX_antialias_buffer(buffer, width, height);
}
diff --git a/source/blender/compositor/operations/COM_MaskOperation.h b/source/blender/compositor/operations/COM_MaskOperation.h
index d50f5c619bb..df1cad3c0f6 100644
--- a/source/blender/compositor/operations/COM_MaskOperation.h
+++ b/source/blender/compositor/operations/COM_MaskOperation.h
@@ -43,6 +43,7 @@ protected:
bool m_do_smooth;
bool m_do_feather;
float *m_rasterizedMask;
+ ListBase m_maskLayers;
/**
* Determine the output resolution. The resolution is retrieved from the Renderer
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.h b/source/blender/compositor/operations/COM_MathBaseOperation.h
index bf77223e26f..be06537cbf0 100644
--- a/source/blender/compositor/operations/COM_MathBaseOperation.h
+++ b/source/blender/compositor/operations/COM_MathBaseOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MathBaseOperation : public NodeOperation {
protected:
diff --git a/source/blender/compositor/operations/COM_MixAddOperation.h b/source/blender/compositor/operations/COM_MixAddOperation.h
index 7b03802cf7e..c5eaf0a4d77 100644
--- a/source/blender/compositor/operations/COM_MixAddOperation.h
+++ b/source/blender/compositor/operations/COM_MixAddOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixAddOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixBaseOperation.h b/source/blender/compositor/operations/COM_MixBaseOperation.h
index 8e9bb283533..268d4832243 100644
--- a/source/blender/compositor/operations/COM_MixBaseOperation.h
+++ b/source/blender/compositor/operations/COM_MixBaseOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixBaseOperation : public NodeOperation {
protected:
diff --git a/source/blender/compositor/operations/COM_MixBlendOperation.h b/source/blender/compositor/operations/COM_MixBlendOperation.h
index b906134f5cb..16ad635bebd 100644
--- a/source/blender/compositor/operations/COM_MixBlendOperation.h
+++ b/source/blender/compositor/operations/COM_MixBlendOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixBlendOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixBurnOperation.h b/source/blender/compositor/operations/COM_MixBurnOperation.h
index af09772edde..7412f651ab3 100644
--- a/source/blender/compositor/operations/COM_MixBurnOperation.h
+++ b/source/blender/compositor/operations/COM_MixBurnOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixBurnOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixColorOperation.h b/source/blender/compositor/operations/COM_MixColorOperation.h
index 9b0d93f934d..028ff517132 100644
--- a/source/blender/compositor/operations/COM_MixColorOperation.h
+++ b/source/blender/compositor/operations/COM_MixColorOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixColorOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixDarkenOperation.h b/source/blender/compositor/operations/COM_MixDarkenOperation.h
index 69fb4450458..337fa1a7024 100644
--- a/source/blender/compositor/operations/COM_MixDarkenOperation.h
+++ b/source/blender/compositor/operations/COM_MixDarkenOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixDarkenOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixDifferenceOperation.h b/source/blender/compositor/operations/COM_MixDifferenceOperation.h
index c71b22214cc..503fbb691d3 100644
--- a/source/blender/compositor/operations/COM_MixDifferenceOperation.h
+++ b/source/blender/compositor/operations/COM_MixDifferenceOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixDifferenceOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixDivideOperation.h b/source/blender/compositor/operations/COM_MixDivideOperation.h
index 375e7129e8b..db60a39f93f 100644
--- a/source/blender/compositor/operations/COM_MixDivideOperation.h
+++ b/source/blender/compositor/operations/COM_MixDivideOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixDivideOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixDodgeOperation.h b/source/blender/compositor/operations/COM_MixDodgeOperation.h
index a4adf6fde47..32aa8593657 100644
--- a/source/blender/compositor/operations/COM_MixDodgeOperation.h
+++ b/source/blender/compositor/operations/COM_MixDodgeOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixDodgeOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixGlareOperation.h b/source/blender/compositor/operations/COM_MixGlareOperation.h
index 1a025eb3edd..1c715d7414b 100644
--- a/source/blender/compositor/operations/COM_MixGlareOperation.h
+++ b/source/blender/compositor/operations/COM_MixGlareOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixGlareOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixHueOperation.h b/source/blender/compositor/operations/COM_MixHueOperation.h
index 56310e253c0..ff1ef369440 100644
--- a/source/blender/compositor/operations/COM_MixHueOperation.h
+++ b/source/blender/compositor/operations/COM_MixHueOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixHueOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixLightenOperation.h b/source/blender/compositor/operations/COM_MixLightenOperation.h
index bb251a44653..dd51215b26a 100644
--- a/source/blender/compositor/operations/COM_MixLightenOperation.h
+++ b/source/blender/compositor/operations/COM_MixLightenOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixLightenOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixLinearLightOperation.h b/source/blender/compositor/operations/COM_MixLinearLightOperation.h
index 39d5b6495d1..e96e2b7eaf7 100644
--- a/source/blender/compositor/operations/COM_MixLinearLightOperation.h
+++ b/source/blender/compositor/operations/COM_MixLinearLightOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixLinearLightOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixMultiplyOperation.h b/source/blender/compositor/operations/COM_MixMultiplyOperation.h
index 2c12854bfa6..4c89a8f2957 100644
--- a/source/blender/compositor/operations/COM_MixMultiplyOperation.h
+++ b/source/blender/compositor/operations/COM_MixMultiplyOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixMultiplyOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixOverlayOperation.h b/source/blender/compositor/operations/COM_MixOverlayOperation.h
index 48d1d10a697..7de955b9f4f 100644
--- a/source/blender/compositor/operations/COM_MixOverlayOperation.h
+++ b/source/blender/compositor/operations/COM_MixOverlayOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixOverlayOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixSaturationOperation.h b/source/blender/compositor/operations/COM_MixSaturationOperation.h
index ccb95e2f00f..241009e2645 100644
--- a/source/blender/compositor/operations/COM_MixSaturationOperation.h
+++ b/source/blender/compositor/operations/COM_MixSaturationOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixSaturationOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixScreenOperation.h b/source/blender/compositor/operations/COM_MixScreenOperation.h
index 6b9fa302325..4d0c1fded3d 100644
--- a/source/blender/compositor/operations/COM_MixScreenOperation.h
+++ b/source/blender/compositor/operations/COM_MixScreenOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixScreenOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixSoftLightOperation.h b/source/blender/compositor/operations/COM_MixSoftLightOperation.h
index 4189066de2c..bcb718027b2 100644
--- a/source/blender/compositor/operations/COM_MixSoftLightOperation.h
+++ b/source/blender/compositor/operations/COM_MixSoftLightOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixSoftLightOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixSubtractOperation.h b/source/blender/compositor/operations/COM_MixSubtractOperation.h
index b820fb1e5e1..3c8112b0e36 100644
--- a/source/blender/compositor/operations/COM_MixSubtractOperation.h
+++ b/source/blender/compositor/operations/COM_MixSubtractOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixSubtractOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MixValueOperation.h b/source/blender/compositor/operations/COM_MixValueOperation.h
index d12a2d2b3d6..c0f3ce10f29 100644
--- a/source/blender/compositor/operations/COM_MixValueOperation.h
+++ b/source/blender/compositor/operations/COM_MixValueOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MixValueOperation : public MixBaseOperation {
public:
diff --git a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
index ba104d07572..c6422fbbfc2 100644
--- a/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
+++ b/source/blender/compositor/operations/COM_MovieClipAttributeOperation.h
@@ -32,8 +32,8 @@ typedef enum MovieClipAttribute {
MCA_ANGLE
} MovieClipAttribute;
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class MovieClipAttributeOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_OpenCLKernels.cl b/source/blender/compositor/operations/COM_OpenCLKernels.cl
index 0f8e543de7f..ce197915360 100644
--- a/source/blender/compositor/operations/COM_OpenCLKernels.cl
+++ b/source/blender/compositor/operations/COM_OpenCLKernels.cl
@@ -51,6 +51,68 @@ __kernel void bokehBlurKernel(__read_only image2d_t boundingBox, __read_only ima
write_imagef(output, coords, color);
}
+//KERNEL --- DEFOCUS /VARIABLESIZEBOKEHBLUR ---
+__kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2d_t bokehImage,
+ __read_only image2d_t inputDepth, __read_only image2d_t inputSize,
+ __write_only image2d_t output, int2 offsetInput, int2 offsetOutput,
+ int step, int maxBlur, float threshold, int2 dimension, int2 offset)
+{
+ float4 color = {1.0f, 0.0f, 0.0f, 1.0f};
+ int2 coords = {get_global_id(0), get_global_id(1)};
+ coords += offset;
+ const int2 realCoordinate = coords + offsetOutput;
+
+ float4 readColor;
+ float4 bokeh;
+ float tempSize;
+ float tempDepth;
+ float4 multiplier_accum = {1.0f, 1.0f, 1.0f, 1.0f};
+ float4 color_accum;
+
+ int minx = max(realCoordinate.s0 - maxBlur, 0);
+ int miny = max(realCoordinate.s1 - maxBlur, 0);
+ int maxx = min(realCoordinate.s0 + maxBlur, dimension.s0);
+ int maxy = min(realCoordinate.s1 + maxBlur, dimension.s1);
+
+ {
+ int2 inputCoordinate = realCoordinate - offsetInput;
+ float size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0;
+ float depth = read_imagef(inputDepth, SAMPLER_NEAREST, inputCoordinate).s0 + threshold;
+ color_accum = read_imagef(inputImage, SAMPLER_NEAREST, inputCoordinate);
+
+ for (int ny = miny; ny < maxy; ny += step) {
+ for (int nx = minx; nx < maxx; nx += step) {
+ if (nx >= 0 && nx < dimension.s0 && ny >= 0 && ny < dimension.s1) {
+ inputCoordinate.s0 = nx - offsetInput.s0;
+ inputCoordinate.s1 = ny - offsetInput.s1;
+ tempDepth = read_imagef(inputDepth, SAMPLER_NEAREST, inputCoordinate).s0;
+ if (tempDepth < depth) {
+ tempSize = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0;
+
+ if ((size > threshold && tempSize > threshold) || tempSize <= threshold) {
+ float dx = nx - realCoordinate.s0;
+ float dy = ny - realCoordinate.s1;
+ if (dx != 0 || dy != 0) {
+ if (tempSize >= fabs(dx) && tempSize >= fabs(dy)) {
+ float2 uv = { 256.0f + dx * 256.0f / tempSize, 256.0f + dy * 256.0f / tempSize};
+ bokeh = read_imagef(bokehImage, SAMPLER_NEAREST, uv);
+ readColor = read_imagef(inputImage, SAMPLER_NEAREST, inputCoordinate);
+ color_accum += bokeh*readColor;
+ multiplier_accum += bokeh;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ color = color_accum * (1.0f / multiplier_accum);
+ write_imagef(output, coords, color);
+}
+
+
// KERNEL --- DILATE ---
__kernel void dilateKernel(__read_only image2d_t inputImage, __write_only image2d_t output,
int2 offsetInput, int2 offsetOutput, int scope, int distanceSquared, int2 dimension,
diff --git a/source/blender/compositor/operations/COM_OpenCLKernels.cl.h b/source/blender/compositor/operations/COM_OpenCLKernels.cl.h
index e064b7511cb..ca66ab85802 100644
--- a/source/blender/compositor/operations/COM_OpenCLKernels.cl.h
+++ b/source/blender/compositor/operations/COM_OpenCLKernels.cl.h
@@ -16,7 +16,7 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/// This file contains all ope
" coords += offset;\n" \
" float tempBoundingBox;\n" \
" float4 color = {0.0f,0.0f,0.0f,0.0f};\n" \
-" float4 multiplier = {0.0f,0.0f,0.0f,0.0f};\n" \
+" float4 multiplyer = {0.0f,0.0f,0.0f,0.0f};\n" \
" float4 bokeh;\n" \
" const float radius2 = radius*2.0f;\n" \
" const int2 realCoordinate = coords + offsetOutput;\n" \
@@ -40,10 +40,10 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/// This file contains all ope
" uv.x = ((realCoordinate.x-nx)/radius2)*bokehImageDim.x+bokehImageCenter.x;\n" \
" bokeh = read_imagef(bokehImage, SAMPLER_NEAREST, uv);\n" \
" color += bokeh * read_imagef(inputImage, SAMPLER_NEAREST, inputXy);\n" \
-" multiplier += bokeh;\n" \
+" multiplyer += bokeh;\n" \
" }\n" \
" }\n" \
-" color /= multiplier;\n" \
+" color /= multiplyer;\n" \
"\n" \
" } else {\n" \
" int2 imageCoordinates = realCoordinate - offsetInput;\n" \
@@ -53,6 +53,68 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/// This file contains all ope
" write_imagef(output, coords, color);\n" \
"}\n" \
"\n" \
+"//KERNEL --- DEFOCUS /VARIABLESIZEBOKEHBLUR ---\n" \
+"__kernel void defocusKernel(__read_only image2d_t inputImage, __read_only image2d_t bokehImage,\n" \
+" __read_only image2d_t inputDepth, __read_only image2d_t inputSize,\n" \
+" __write_only image2d_t output, int2 offsetInput, int2 offsetOutput,\n" \
+" int step, int maxBlur, float threshold, int2 dimension, int2 offset)\n" \
+"{\n" \
+" float4 color = {1.0f, 0.0f, 0.0f, 1.0f};\n" \
+" int2 coords = {get_global_id(0), get_global_id(1)};\n" \
+" coords += offset;\n" \
+" const int2 realCoordinate = coords + offsetOutput;\n" \
+"\n" \
+" float4 readColor;\n" \
+" float4 bokeh;\n" \
+" float tempSize;\n" \
+" float tempDepth;\n" \
+" float4 multiplier_accum = {1.0f, 1.0f, 1.0f, 1.0f};\n" \
+" float4 color_accum;\n" \
+"\n" \
+" int minx = max(realCoordinate.s0 - maxBlur, 0);\n" \
+" int miny = max(realCoordinate.s1 - maxBlur, 0);\n" \
+" int maxx = min(realCoordinate.s0 + maxBlur, dimension.s0);\n" \
+" int maxy = min(realCoordinate.s1 + maxBlur, dimension.s1);\n" \
+"\n" \
+" {\n" \
+" int2 inputCoordinate = realCoordinate - offsetInput;\n" \
+" float size = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0;\n" \
+" float depth = read_imagef(inputDepth, SAMPLER_NEAREST, inputCoordinate).s0 + threshold;\n" \
+" color_accum = read_imagef(inputImage, SAMPLER_NEAREST, inputCoordinate);\n" \
+"\n" \
+" for (int ny = miny; ny < maxy; ny += step) {\n" \
+" for (int nx = minx; nx < maxx; nx += step) {\n" \
+" if (nx >= 0 && nx < dimension.s0 && ny >= 0 && ny < dimension.s1) {\n" \
+" inputCoordinate.s0 = nx - offsetInput.s0;\n" \
+" inputCoordinate.s1 = ny - offsetInput.s1;\n" \
+" tempDepth = read_imagef(inputDepth, SAMPLER_NEAREST, inputCoordinate).s0;\n" \
+" if (tempDepth < depth) {\n" \
+" tempSize = read_imagef(inputSize, SAMPLER_NEAREST, inputCoordinate).s0;\n" \
+"\n" \
+" if ((size > threshold && tempSize > threshold) || tempSize <= threshold) {\n" \
+" float dx = nx - realCoordinate.s0;\n" \
+" float dy = ny - realCoordinate.s1;\n" \
+" if (dx != 0 || dy != 0) {\n" \
+" if (tempSize >= fabs(dx) && tempSize >= fabs(dy)) {\n" \
+" float2 uv = { 256.0f + dx * 256.0f / tempSize, 256.0f + dy * 256.0f / tempSize};\n" \
+" bokeh = read_imagef(bokehImage, SAMPLER_NEAREST, uv);\n" \
+" readColor = read_imagef(inputImage, SAMPLER_NEAREST, inputCoordinate);\n" \
+" color_accum += bokeh*readColor;\n" \
+" multiplier_accum += bokeh;\n" \
+" }\n" \
+" }\n" \
+" }\n" \
+" }\n" \
+" }\n" \
+" }\n" \
+" }\n" \
+" }\n" \
+"\n" \
+" color = color_accum * (1.0f / multiplier_accum);\n" \
+" write_imagef(output, coords, color);\n" \
+"}\n" \
+"\n" \
+"\n" \
"// KERNEL --- DILATE ---\n" \
"__kernel void dilateKernel(__read_only image2d_t inputImage, __write_only image2d_t output,\n" \
" int2 offsetInput, int2 offsetOutput, int scope, int distanceSquared, int2 dimension,\n" \
@@ -70,9 +132,9 @@ const char * clkernelstoh_COM_OpenCLKernels_cl = "/// This file contains all ope
" int2 inputXy;\n" \
"\n" \
" for (ny = minXY.y, inputXy.y = ny - offsetInput.y ; ny < maxXY.y ; ny ++, inputXy.y++) {\n" \
+" const float deltaY = (realCoordinate.y - ny);\n" \
" for (nx = minXY.x, inputXy.x = nx - offsetInput.x; nx < maxXY.x ; nx ++, inputXy.x++) {\n" \
" const float deltaX = (realCoordinate.x - nx);\n" \
-" const float deltaY = (realCoordinate.y - ny);\n" \
" const float measuredDistance = deltaX*deltaX+deltaY*deltaY;\n" \
" if (measuredDistance <= distanceSquared) {\n" \
" value = max(value, read_imagef(inputImage, SAMPLER_NEAREST, inputXy).s0);\n" \
diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
index 74145c52a5d..12674153bc8 100644
--- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp
@@ -79,10 +79,10 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in
newInput.xmin = input->xmin - this->m_kr2 - 2;
newInput.xmax = input->xmax + this->m_kr2 + 2;
} else {
- newInput.xmin = input->xmin-7; //(0.25f*20*1)+2 == worse case dispersion
+ newInput.xmin = input->xmin - 7; //(0.25f*20*1)+2 == worse case dispersion
newInput.ymin = input->ymin;
newInput.ymax = input->ymax;
- newInput.xmax = input->xmax+7; //(0.25f*20*1)+2 == worse case dispersion
+ newInput.xmax = input->xmax + 7; //(0.25f*20*1)+2 == worse case dispersion
}
return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
}
diff --git a/source/blender/compositor/operations/COM_RenderLayersImageProg.cpp b/source/blender/compositor/operations/COM_RenderLayersImageProg.cpp
index 14c3d652c42..f21585844ff 100644
--- a/source/blender/compositor/operations/COM_RenderLayersImageProg.cpp
+++ b/source/blender/compositor/operations/COM_RenderLayersImageProg.cpp
@@ -22,7 +22,7 @@
#include "COM_RenderLayersImageProg.h"
-RenderLayersColourProg::RenderLayersColourProg() : RenderLayersBaseProg(SCE_PASS_COMBINED, 4)
+RenderLayersColorProg::RenderLayersColorProg() : RenderLayersBaseProg(SCE_PASS_COMBINED, 4)
{
this->addOutputSocket(COM_DT_COLOR);
}
diff --git a/source/blender/compositor/operations/COM_RenderLayersImageProg.h b/source/blender/compositor/operations/COM_RenderLayersImageProg.h
index b6ddac425cb..2d63bad235b 100644
--- a/source/blender/compositor/operations/COM_RenderLayersImageProg.h
+++ b/source/blender/compositor/operations/COM_RenderLayersImageProg.h
@@ -20,15 +20,15 @@
* Monique Dewanchand
*/
-#ifndef _COM_RenderLayersColourProg_h
-#define _COM_RenderLayersColourProg_h
+#ifndef _COM_RenderLayersColorProg_h
+#define _COM_RenderLayersColorProg_h
#include "COM_RenderLayersBaseProg.h"
/// @TODO rename to image operation
-class RenderLayersColourProg : public RenderLayersBaseProg {
+class RenderLayersColorProg : public RenderLayersBaseProg {
public:
- RenderLayersColourProg();
+ RenderLayersColorProg();
};
#endif
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
index e3abf2aa70b..e70185f8fba 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
@@ -42,6 +42,10 @@ ScreenLensDistortionOperation::ScreenLensDistortionOperation() : NodeOperation()
void ScreenLensDistortionOperation::initExecution()
{
this->m_inputProgram = this->getInputSocketReader(0);
+ this->initMutex();
+ this->m_cx = 0.5f * (float)getWidth();
+ this->m_cy = 0.5f * (float)getHeight();
+
}
void *ScreenLensDistortionOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
@@ -139,52 +143,192 @@ void ScreenLensDistortionOperation::executePixel(float *outputColor, int x, int
void ScreenLensDistortionOperation::deinitExecution()
{
+ this->deinitMutex();
this->m_inputProgram = NULL;
}
-void ScreenLensDistortionOperation::determineUV(float result[2], float x, float y) const
+void ScreenLensDistortionOperation::determineUV(float result[4], float x, float y, float distortion, float dispersion)
+{
+ if (!this->m_valuesAvailable) {
+ updateVariables(distortion, dispersion);
+ }
+ determineUV(result, x, y);
+}
+
+void ScreenLensDistortionOperation::determineUV(float result[4], float x, float y) const
{
+ const float height = this->getHeight();
+ const float width = this->getWidth();
+
+ float d, t, ln[6] = {0, 0, 0, 0, 0, 0};
const float v = this->m_sc * ((y + 0.5f) - this->m_cy) / this->m_cy;
const float u = this->m_sc * ((x + 0.5f) - this->m_cx) / this->m_cx;
- const float t = ABS(MIN3(this->m_kr, this->m_kg, this->m_kb) * 4);
- float d = 1.f / (1.f + sqrtf(t));
- result[0] = (u * d + 0.5f) * getWidth() - 0.5f;
- result[1] = (v * d + 0.5f) * getHeight() - 0.5f;
+ const float uv_dot = u * u + v * v;
+
+ if ((t = 1.f - this->m_kr4 * uv_dot) >= 0.f) {
+ d = 1.f / (1.f + sqrtf(t));
+ ln[0] = (u * d + 0.5f) * width - 0.5f, ln[1] = (v * d + 0.5f) * height - 0.5f;
+ }
+ if ((t = 1.f - this->m_kg4 * uv_dot) >= 0.f) {
+ d = 1.f / (1.f + sqrtf(t));
+ ln[2] = (u * d + 0.5f) * width - 0.5f, ln[3] = (v * d + 0.5f) * height - 0.5f;
+ }
+ if ((t = 1.f - this->m_kb4 * uv_dot) >= 0.f) {
+ d = 1.f / (1.f + sqrtf(t));
+ ln[4] = (u * d + 0.5f) * width - 0.5f, ln[5] = (v * d + 0.5f) * height - 0.5f;
+ }
+
+ float jit = this->m_data->jit;
+ float z;
+ {
+ // RG
+ const int dx = ln[2] - ln[0], dy = ln[3] - ln[1];
+ const float dsf = sqrtf((float)dx * dx + dy * dy) + 1.f;
+ const int ds = (int)(jit ? ((dsf < 4.f) ? 2.f : sqrtf(dsf)) : dsf);
+ const float sd = 1.f / (float)ds;
+
+ z = ds;
+ const float tz = ((float)z + (1.0f)) * sd;
+ t = 1.0f - (this->m_kr4 + tz * this->m_drg) * uv_dot;
+ d = 1.0f / (1.f + sqrtf(t));
+ const float nx = (u * d + 0.5f) * width - 0.5f;
+ const float ny = (v * d + 0.5f) * height - 0.5f;
+ result[0] = nx;
+ result[1] = ny;
+ }
+ {
+ // GB
+ const int dx = ln[4] - ln[2], dy = ln[5] - ln[3];
+ const float dsf = sqrtf((float)dx * dx + dy * dy) + 1.f;
+ const int ds = (int)(jit ? ((dsf < 4.f) ? 2.f : sqrtf(dsf)) : dsf);
+ const float sd = 1.f / (float)ds;
+
+ z = ds;
+ const float tz = ((float)z + (1.0f)) * sd;
+ t = 1.f - (this->m_kg4 + tz * this->m_dgb) * uv_dot;
+ d = 1.f / (1.f + sqrtf(t));
+ const float nx = (u * d + 0.5f) * width - 0.5f;
+ const float ny = (v * d + 0.5f) * height - 0.5f;
+ result[2] = nx;
+ result[3] = ny;
+ }
}
bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
+ rcti newInputValue;
+ newInputValue.xmin = 0;
+ newInputValue.ymin = 0;
+ newInputValue.xmax = 2;
+ newInputValue.ymax = 2;
+
+ NodeOperation *operation = getInputOperation(1);
+ if (operation->determineDependingAreaOfInterest(&newInputValue, readOperation, output) ) {
+ return true;
+ }
+
+ operation = getInputOperation(2);
+ if (operation->determineDependingAreaOfInterest(&newInputValue, readOperation, output) ) {
+ return true;
+ }
+
+#define MARGIN 96
+
+#define UPDATE_INPUT \
+ newInput.xmin = MIN3(newInput.xmin, coords[0], coords[2]); \
+ newInput.ymin = MIN3(newInput.ymin, coords[1], coords[3]); \
+ newInput.xmax = MAX3(newInput.xmax, coords[0], coords[2]); \
+ newInput.ymax = MAX3(newInput.ymax, coords[1], coords[3]);
+
rcti newInput;
- newInput.xmin = 0;
- newInput.ymin = 0;
- newInput.ymax = this->m_inputProgram->getHeight();
- newInput.xmax = this->m_inputProgram->getWidth();
- return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+ float margin;
+ float coords[4];
+ if (m_valuesAvailable) {
+ determineUV(coords, input->xmin, input->ymin);
+ newInput.xmin = coords[0];
+ newInput.ymin = coords[1];
+ newInput.xmax = coords[0];
+ newInput.ymax = coords[1];
+ UPDATE_INPUT;
+ determineUV(coords, input->xmin, input->ymax);
+ UPDATE_INPUT;
+ determineUV(coords, input->xmax, input->ymax);
+ UPDATE_INPUT;
+ determineUV(coords, input->xmax, input->ymin);
+ UPDATE_INPUT;
+ margin = (ABS(this->m_distortion) + this->m_dispersion) * MARGIN + 2.0f;
+ }
+ else
+ {
+ determineUV(coords, input->xmin, input->ymin, 1.0f, 1.0f);
+ newInput.xmin = coords[0];
+ newInput.ymin = coords[1];
+ newInput.xmax = coords[0];
+ newInput.ymax = coords[1];
+ UPDATE_INPUT;
+ determineUV(coords, input->xmin, input->ymin, -1.0f, 1.0f);
+ UPDATE_INPUT;
+
+ determineUV(coords, input->xmin, input->ymax, -1.0f, 1.0f);
+ UPDATE_INPUT;
+ determineUV(coords, input->xmin, input->ymax, 1.0f, 1.0f);
+ UPDATE_INPUT;
+
+ determineUV(coords, input->xmax, input->ymax, -1.0f, 1.0f);
+ UPDATE_INPUT;
+ determineUV(coords, input->xmax, input->ymax, 1.0f, 1.0f);
+ UPDATE_INPUT;
+
+ determineUV(coords, input->xmax, input->ymin, -1.0f, 1.0f);
+ UPDATE_INPUT;
+ determineUV(coords, input->xmax, input->ymin, 1.0f, 1.0f);
+ UPDATE_INPUT;
+ margin = MARGIN;
+ }
+
+#undef UPDATE_INPUT
+ newInput.xmin -= margin;
+ newInput.ymin -= margin;
+ newInput.xmax += margin;
+ newInput.ymax += margin;
+
+ operation = getInputOperation(0);
+ if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output) ) {
+ return true;
+ }
+ return false;
+}
+
+void ScreenLensDistortionOperation::updateVariables(float distortion, float dispersion)
+{
+ this->m_kg = MAX2(MIN2(distortion, 1.f), -0.999f);
+ // smaller dispersion range for somewhat more control
+ const float d = 0.25f * MAX2(MIN2(dispersion, 1.f), 0.f);
+ this->m_kr = MAX2(MIN2((this->m_kg + d), 1.0f), -0.999f);
+ this->m_kb = MAX2(MIN2((this->m_kg - d), 1.0f), -0.999f);
+ this->m_maxk = MAX3(this->m_kr, this->m_kg, this->m_kb);
+ this->m_sc = (this->m_data->fit && (this->m_maxk > 0.f)) ? (1.f / (1.f + 2.f * this->m_maxk)) : (1.f / (1.f + this->m_maxk));
+ this->m_drg = 4.f * (this->m_kg - this->m_kr);
+ this->m_dgb = 4.f * (this->m_kb - this->m_kg);
+
+ this->m_kr4 = this->m_kr * 4.0f;
+ this->m_kg4 = this->m_kg * 4.0f;
+ this->m_kb4 = this->m_kb * 4.0f;
}
void ScreenLensDistortionOperation::updateDispersionAndDistortion(MemoryBuffer **inputBuffers)
{
+ if (this->m_valuesAvailable) return;
+
+ this->lockMutex();
if (!this->m_valuesAvailable) {
float result[4];
this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST, inputBuffers);
this->m_distortion = result[0];
this->getInputSocketReader(2)->read(result, 0, 0, COM_PS_NEAREST, inputBuffers);
this->m_dispersion = result[0];
- this->m_kg = MAX2(MIN2(this->m_distortion, 1.f), -0.999f);
- // smaller dispersion range for somewhat more control
- const float d = 0.25f * MAX2(MIN2(this->m_dispersion, 1.f), 0.f);
- this->m_kr = MAX2(MIN2((this->m_kg + d), 1.0f), -0.999f);
- this->m_kb = MAX2(MIN2((this->m_kg - d), 1.0f), -0.999f);
- this->m_maxk = MAX3(this->m_kr, this->m_kg, this->m_kb);
- this->m_sc = (this->m_data->fit && (this->m_maxk > 0.f)) ? (1.f / (1.f + 2.f * this->m_maxk)) : (1.f / (1.f + this->m_maxk));
- this->m_drg = 4.f * (this->m_kg - this->m_kr);
- this->m_dgb = 4.f * (this->m_kb - this->m_kg);
-
- this->m_kr4 = this->m_kr * 4.0f;
- this->m_kg4 = this->m_kg * 4.0f;
- this->m_kb4 = this->m_kb * 4.0f;
- this->m_cx = 0.5f * (float)getWidth();
- this->m_cy = 0.5f * (float)getHeight();
+ updateVariables(this->m_distortion, this->m_dispersion);
this->m_valuesAvailable = true;
}
+ this->unlockMutex();
}
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
index 7e4fda0f755..f80b938818c 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.h
@@ -66,9 +66,23 @@ public:
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
+ /**
+ * @brief Set the distortion and dispersion and precalc some values
+ * @param distortion
+ * @param dispersion
+ */
+ void setDistortionAndDispersion(float distortion, float dispersion) {
+ this->m_distortion = distortion;
+ this->m_dispersion = dispersion;
+ updateVariables(distortion, dispersion);
+ this->m_valuesAvailable = true;
+ }
+
private:
- void determineUV(float *result, float x, float y) const;
+ void determineUV(float result[4], float x, float y) const;
+ void determineUV(float result[4], float x, float y, float distortion, float dispersion);
void updateDispersionAndDistortion(MemoryBuffer **inputBuffers);
+ void updateVariables(float distortion, float dispersion);
};
#endif
diff --git a/source/blender/compositor/operations/COM_SetAlphaOperation.h b/source/blender/compositor/operations/COM_SetAlphaOperation.h
index 857bd08bfbf..21968c930e7 100644
--- a/source/blender/compositor/operations/COM_SetAlphaOperation.h
+++ b/source/blender/compositor/operations/COM_SetAlphaOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class SetAlphaOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_SetColorOperation.h b/source/blender/compositor/operations/COM_SetColorOperation.h
index abfa2b9538a..a51311837ee 100644
--- a/source/blender/compositor/operations/COM_SetColorOperation.h
+++ b/source/blender/compositor/operations/COM_SetColorOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class SetColorOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_SetSamplerOperation.h b/source/blender/compositor/operations/COM_SetSamplerOperation.h
index 24e0c5e2ef5..273eac159bc 100644
--- a/source/blender/compositor/operations/COM_SetSamplerOperation.h
+++ b/source/blender/compositor/operations/COM_SetSamplerOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output Sampler.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output Sampler.
+ * it assumes we are in sRGB color space.
*/
class SetSamplerOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_SetValueOperation.h b/source/blender/compositor/operations/COM_SetValueOperation.h
index dce0c3299ac..642940e03cd 100644
--- a/source/blender/compositor/operations/COM_SetValueOperation.h
+++ b/source/blender/compositor/operations/COM_SetValueOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class SetValueOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.h b/source/blender/compositor/operations/COM_SetVectorOperation.h
index dc2a05ceff4..d1b9fe25085 100644
--- a/source/blender/compositor/operations/COM_SetVectorOperation.h
+++ b/source/blender/compositor/operations/COM_SetVectorOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class SetVectorOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
index 9eb004b3686..7ddcb78b61f 100644
--- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
@@ -22,6 +22,7 @@
#include "COM_VariableSizeBokehBlurOperation.h"
#include "BLI_math.h"
+#include "COM_OpenCLDevice.h"
extern "C" {
#include "RE_pipeline.h"
@@ -33,8 +34,12 @@ VariableSizeBokehBlurOperation::VariableSizeBokehBlurOperation() : NodeOperation
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE); // do not resize the bokeh image.
this->addInputSocket(COM_DT_VALUE); // radius
this->addInputSocket(COM_DT_VALUE); // depth
+#ifdef COM_DEFOCUS_SEARCH
+ this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE); // inverse search radius optimization structure.
+#endif
this->addOutputSocket(COM_DT_COLOR);
this->setComplex(true);
+ this->setOpenCL(true);
this->m_inputProgram = NULL;
this->m_inputBokehProgram = NULL;
@@ -42,6 +47,9 @@ VariableSizeBokehBlurOperation::VariableSizeBokehBlurOperation() : NodeOperation
this->m_inputDepthProgram = NULL;
this->m_maxBlur = 32.0f;
this->m_threshold = 1.0f;
+#ifdef COM_DEFOCUS_SEARCH
+ this->m_inputSearchProgram = NULL;
+#endif
}
@@ -51,6 +59,9 @@ void VariableSizeBokehBlurOperation::initExecution()
this->m_inputBokehProgram = getInputSocketReader(1);
this->m_inputSizeProgram = getInputSocketReader(2);
this->m_inputDepthProgram = getInputSocketReader(3);
+#ifdef COM_DEFOCUS_SEARCH
+ this->m_inputSearchProgram = getInputSocketReader(4);
+#endif
QualityStepHelper::initExecution(COM_QH_INCREASE);
}
@@ -63,10 +74,19 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me
float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float color_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- int miny = y - this->m_maxBlur;
- int maxy = y + this->m_maxBlur;
- int minx = x - this->m_maxBlur;
- int maxx = x + this->m_maxBlur;
+#ifdef COM_DEFOCUS_SEARCH
+ float search[4];
+ this->inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y / InverseSearchRadiusOperation::DIVIDER, inputBuffers, NULL);
+ int minx = search[0];
+ int miny = search[1];
+ int maxx = search[2];
+ int maxy = search[3];
+#else
+ int minx = MAX2(x - this->m_maxBlur, 0.0f);
+ int miny = MAX2(y - this->m_maxBlur, 0.0f);
+ int maxx = MIN2(x + this->m_maxBlur, m_width);
+ int maxy = MIN2(y + this->m_maxBlur, m_height);
+#endif
{
this->m_inputSizeProgram->read(tempSize, x, y, COM_PS_NEAREST, inputBuffers);
this->m_inputDepthProgram->read(tempDepth, x, y, COM_PS_NEAREST, inputBuffers);
@@ -80,9 +100,9 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me
for (int nx = minx; nx < maxx; nx += QualityStepHelper::getStep()) {
if (nx >= 0 && nx < this->getWidth() && ny >= 0 && ny < getHeight()) {
this->m_inputDepthProgram->read(tempDepth, nx, ny, COM_PS_NEAREST, inputBuffers);
- this->m_inputSizeProgram->read(tempSize, nx, ny, COM_PS_NEAREST, inputBuffers);
- float size = tempSize[0];
if (tempDepth[0] < centerDepth) {
+ this->m_inputSizeProgram->read(tempSize, nx, ny, COM_PS_NEAREST, inputBuffers);
+ float size = tempSize[0];
if ((sizeCenter > this->m_threshold && size > this->m_threshold) || size <= this->m_threshold) {
float dx = nx - x;
float dy = ny - y;
@@ -110,11 +130,42 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me
}
+static cl_kernel defocusKernel = 0;
+void VariableSizeBokehBlurOperation::executeOpenCL(OpenCLDevice* device,
+ MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer,
+ MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp,
+ list<cl_kernel> *clKernelsToCleanUp)
+{
+ if (!defocusKernel) {
+ defocusKernel = device->COM_clCreateKernel("defocusKernel", NULL);
+ }
+ cl_int step = this->getStep();
+ cl_int maxBlur = this->m_maxBlur;
+ cl_float threshold = this->m_threshold;
+
+ device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 0, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputProgram);
+ device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 1, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputBokehProgram);
+ device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 2, 5, clMemToCleanUp, inputMemoryBuffers, this->m_inputDepthProgram);
+ device->COM_clAttachMemoryBufferToKernelParameter(defocusKernel, 3, -1, clMemToCleanUp, inputMemoryBuffers, this->m_inputSizeProgram);
+ device->COM_clAttachOutputMemoryBufferToKernelParameter(defocusKernel, 4, clOutputBuffer);
+ device->COM_clAttachMemoryBufferOffsetToKernelParameter(defocusKernel, 6, outputMemoryBuffer);
+ clSetKernelArg(defocusKernel, 7, sizeof(cl_int), &step);
+ clSetKernelArg(defocusKernel, 8, sizeof(cl_int), &maxBlur);
+ clSetKernelArg(defocusKernel, 9, sizeof(cl_float), &threshold);
+ device->COM_clAttachSizeToKernelParameter(defocusKernel, 10, this);
+
+ device->COM_clEnqueueRange(defocusKernel, outputMemoryBuffer, 11, this);
+}
+
void VariableSizeBokehBlurOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputBokehProgram = NULL;
this->m_inputSizeProgram = NULL;
+ this->m_inputDepthProgram = NULL;
+#ifdef COM_DEFOCUS_SEARCH
+ this->m_inputSearchProgram = NULL;
+#endif
}
bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
@@ -130,6 +181,7 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu
bokehInput.xmin = 0;
bokehInput.ymax = 512;
bokehInput.ymin = 0;
+
NodeOperation *operation = getInputOperation(2);
if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output) ) {
@@ -143,9 +195,118 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu
if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output) ) {
return true;
}
+#ifdef COM_DEFOCUS_SEARCH
+ rcti searchInput;
+ searchInput.xmax = (input->xmax / InverseSearchRadiusOperation::DIVIDER) + 1;
+ searchInput.xmin = (input->xmin / InverseSearchRadiusOperation::DIVIDER) - 1;
+ searchInput.ymax = (input->ymax / InverseSearchRadiusOperation::DIVIDER) + 1;
+ searchInput.ymin = (input->ymin / InverseSearchRadiusOperation::DIVIDER) - 1;
+ operation = getInputOperation(4);
+ if (operation->determineDependingAreaOfInterest(&searchInput, readOperation, output) ) {
+ return true;
+ }
+#endif
operation = getInputOperation(0);
if (operation->determineDependingAreaOfInterest(&newInput, readOperation, output) ) {
return true;
}
return false;
}
+
+#ifdef COM_DEFOCUS_SEARCH
+// InverseSearchRadiusOperation
+InverseSearchRadiusOperation::InverseSearchRadiusOperation() : NodeOperation()
+{
+ this->addInputSocket(COM_DT_VALUE, COM_SC_NO_RESIZE); // radius
+ this->addInputSocket(COM_DT_VALUE, COM_SC_NO_RESIZE); // depth
+ this->addOutputSocket(COM_DT_COLOR);
+ this->setComplex(true);
+ this->inputRadius = NULL;
+ this->inputDepth = NULL;
+}
+
+void InverseSearchRadiusOperation::initExecution()
+{
+ this->inputRadius = this->getInputSocketReader(0);
+ this->inputDepth = this->getInputSocketReader(1);
+}
+
+void* InverseSearchRadiusOperation::initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers)
+{
+ MemoryBuffer * data = new MemoryBuffer(NULL, rect);
+ int x, y;
+ float width = this->inputRadius->getWidth();
+ float height = this->inputRadius->getHeight();
+
+ for (x = rect->xmin; x < rect->xmax ; x++) {
+ for (y = rect->ymin; y < rect->ymax ; y++) {
+ float[4] temp;
+ int rx = x * DIVIDER;
+ int ry = y * DIVIDER;
+ this->inputRadius->read(temp, rx, ry, memoryBuffers, NULL);
+ float centerRadius = temp[0];
+ this->inputDepth->read(temp, rx, ry, memoryBuffers, NULL);
+ float centerDepth = temp[0];
+ t[0] = MAX2(rx - this->maxBlur, 0.0f);
+ t[1] = MAX2(ry - this->maxBlur, 0.0f);
+ t[2] = MIN2(rx + this->maxBlur, width);
+ t[3] = MIN2(ry + this->maxBlur, height);
+ int minx = t[0];
+ int miny = t[1];
+ int maxx = t[2];
+ int maxy = t[3];
+ int sminx = rx;
+ int smaxx = rx;
+ int sminy = ry;
+ int smaxy = ry;
+ for (int nx = minx ; nx < maxx ; nx ++) {
+ for (int ny = miny ; ny < maxy ; ny ++) {
+ this->inputRadius->read(temp, nx, ny, memoryBuffers, NULL);
+ if (nx < rx && temp[0])
+
+ }
+ }
+ float t[4];
+ data->writePixel(x, y, t);
+ }
+ }
+ return data;
+}
+
+void InverseSearchRadiusOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
+{
+ MemoryBuffer *buffer = (MemoryBuffer*)data;
+ buffer->read(color, x, y);
+}
+
+void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data)
+{
+ if (data) {
+ MemoryBuffer* mb = (MemoryBuffer*)data;
+ delete mb;
+ }
+}
+
+void InverseSearchRadiusOperation::deinitExecution()
+{
+ this->inputRadius = NULL;
+ this->inputDepth = NULL;
+}
+
+void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
+{
+ NodeOperation::determineResolution(resolution, preferredResolution);
+ resolution[0] = resolution[0] / DIVIDER;
+ resolution[1] = resolution[1] / DIVIDER;
+}
+
+bool InverseSearchRadiusOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+ rcti newRect;
+ newRect.ymin = input->ymin*DIVIDER;
+ newRect.ymax = input->ymax*DIVIDER;
+ newRect.xmin = input->xmin*DIVIDER;
+ newRect.xmax = input->xmax*DIVIDER;
+ return NodeOperation::determineDependingAreaOfInterest(&newRect, readOperation, output);
+}
+#endif
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
index 8e59a43fcb1..8e5589fafec 100644
--- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
+++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.h
@@ -25,6 +25,7 @@
#include "COM_NodeOperation.h"
#include "COM_QualityStepHelper.h"
+
class VariableSizeBokehBlurOperation : public NodeOperation, public QualityStepHelper {
private:
int m_maxBlur;
@@ -33,6 +34,9 @@ private:
SocketReader *m_inputBokehProgram;
SocketReader *m_inputSizeProgram;
SocketReader *m_inputDepthProgram;
+#ifdef COM_DEFOCUS_SEARCH
+ SocketReader *inputSearchProgram;
+#endif
public:
VariableSizeBokehBlurOperation();
@@ -58,6 +62,44 @@ public:
void setThreshold(float threshold) { this->m_threshold = threshold; }
+ void executeOpenCL(OpenCLDevice* device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp);
+};
+
+#ifdef COM_DEFOCUS_SEARCH
+class InverseSearchRadiusOperation : public NodeOperation {
+private:
+ int maxBlur;
+ float threshold;
+ SocketReader *inputDepth;
+ SocketReader *inputRadius;
+public:
+ static const int DIVIDER = 4;
+
+ InverseSearchRadiusOperation();
+
+ /**
+ * the inner loop of this program
+ */
+ void executePixel(float *color, int x, int y, MemoryBuffer * inputBuffers[], void *data);
+
+ /**
+ * Initialize the execution
+ */
+ void initExecution();
+ void* initializeTileData(rcti *rect, MemoryBuffer **memoryBuffers);
+ void deinitializeTileData(rcti *rect, MemoryBuffer **memoryBuffers, void *data);
+
+ /**
+ * Deinitialize the execution
+ */
+ void deinitExecution();
+
+ bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
+ void determineResolution(unsigned int resolution[], unsigned int preferredResolution[]);
+
+ void setMaxBlur(int maxRadius) { this->maxBlur = maxRadius; }
+ void setThreshold(float threshold) { this->threshold = threshold; }
};
#endif
+#endif
diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
index 7259db34134..8decb73615b 100644
--- a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
+++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
@@ -156,10 +156,8 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice* device, rcti *rect,
if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
this->getMemoryProxy()->getBuffer()->copyContentFrom(outputBuffer);
-
- // STEP 4
-
+ // STEP 4
while (clMemToCleanUp->size() > 0) {
cl_mem mem = clMemToCleanUp->front();
error = clReleaseMemObject(mem);
diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.h b/source/blender/compositor/operations/COM_WriteBufferOperation.h
index 24bfdecd124..d77814a9dc4 100644
--- a/source/blender/compositor/operations/COM_WriteBufferOperation.h
+++ b/source/blender/compositor/operations/COM_WriteBufferOperation.h
@@ -46,6 +46,9 @@ public:
void deinitExecution();
void executeOpenCLRegion(OpenCLDevice* device, rcti *rect, unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer);
void readResolutionFromInputSocket();
+ inline NodeOperation *getInput() {
+ return m_input;
+ }
};
#endif
diff --git a/source/blender/compositor/operations/COM_ZCombineOperation.h b/source/blender/compositor/operations/COM_ZCombineOperation.h
index 2ade3f599ad..422a946b98f 100644
--- a/source/blender/compositor/operations/COM_ZCombineOperation.h
+++ b/source/blender/compositor/operations/COM_ZCombineOperation.h
@@ -26,8 +26,8 @@
/**
- * this program converts an input colour to an output value.
- * it assumes we are in sRGB colour space.
+ * this program converts an input color to an output value.
+ * it assumes we are in sRGB color space.
*/
class ZCombineOperation : public NodeOperation {
protected:
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 4a5966948ae..672e11ac613 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -416,6 +416,7 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
char *basepath = RNA_path_from_ID_to_property(ptr, prop);
char *path = basepath; /* in case no remapping is needed */
+
/* Remapping will only be performed in the Properties Editor, as only this
* restricts the subspace of options to the 'active' data (a manageable state)
*/
@@ -426,23 +427,6 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
if (ob && id) {
/* only id-types which can be remapped to go through objects should be considered */
switch (GS(id->name)) {
- case ID_MA: /* materials */
- {
- Material *ma = give_current_material(ob, ob->actcol);
-
- /* assumes: material will only be shown if it is active objects's active material it's ok */
- if ((ID *)ma == id) {
- /* create new path */
- // TODO: use RNA path functions to construct instead?
- path = BLI_sprintfN("material_slots[\"%s\"].material.%s",
- ma->id.name + 2, basepath);
-
- /* free old one */
- MEM_freeN(basepath);
- }
- }
- break;
-
case ID_TE: /* textures */
{
Material *ma = give_current_material(ob, ob->actcol);
@@ -452,6 +436,7 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
if ((ID *)tex == id) {
/* create new path */
// TODO: use RNA path functions to construct step by step instead?
+ // FIXME: maybe this isn't even needed anymore...
path = BLI_sprintfN("material_slots[\"%s\"].material.texture_slots[\"%s\"].texture.%s",
ma->id.name + 2, tex->id.name + 2, basepath);
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 6250424d655..0c9a6ff6bf1 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -201,7 +201,7 @@ FCurve *verify_fcurve(bAction *act, const char group[], PointerRNA *ptr,
grp = (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1));
if (grp) {
agrp->customCol = grp->customCol;
- action_group_colors_sync(agrp);
+ action_group_colors_sync(agrp, grp);
}
}
}
@@ -1581,7 +1581,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 keyframes from all elements of the array");
}
/* ******************************************* */
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 0760b384ecd..ddf66a6169b 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -183,7 +183,7 @@ LinkData *poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, con
void POSELIB_OT_new(struct wmOperatorType *ot);
void POSELIB_OT_unlink(struct wmOperatorType *ot);
-void POSELIB_OT_action_sanitise(struct wmOperatorType *ot);
+void POSELIB_OT_action_sanitize(struct wmOperatorType *ot);
void POSELIB_OT_pose_add(struct wmOperatorType *ot);
void POSELIB_OT_pose_remove(struct wmOperatorType *ot);
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index f3461f71391..59ee90c553b 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -159,7 +159,7 @@ void ED_operatortypes_armature(void)
WM_operatortype_append(POSELIB_OT_new);
WM_operatortype_append(POSELIB_OT_unlink);
- WM_operatortype_append(POSELIB_OT_action_sanitise);
+ WM_operatortype_append(POSELIB_OT_action_sanitize);
/* POSE SLIDING */
WM_operatortype_append(POSE_OT_push);
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index d4755fc95cd..6cef843d828 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -4563,7 +4563,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor
DAG_id_tag_update(&ob_act->id, OB_RECALC_DATA);
}
}
- /* if there are some dependencies for visualising armature state
+ /* if there are some dependencies for visualizing armature state
* (e.g. Mask Modifier in 'Armature' mode), force update
*/
else if (arm->flag & ARM_HAS_VIZ_DEPS) {
diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c
index 824a39374fd..51700793791 100644
--- a/source/blender/editors/armature/poseSlide.c
+++ b/source/blender/editors/armature/poseSlide.c
@@ -220,7 +220,7 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *val)
else {
/* - these weights are derived from the relative distance of these
* poses from the current frame
- * - they then get normalised so that they only sum up to 1
+ * - they then get normalized so that they only sum up to 1
*/
float wtot;
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 18e3d967835..ee54fc2c6fe 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -288,7 +288,7 @@ void POSELIB_OT_unlink(wmOperatorType *ot)
/* This tool automagically generates/validates poselib data so that it corresponds to the data
* in the action. This is for use in making existing actions usable as poselibs.
*/
-static int poselib_sanitise_exec(bContext *C, wmOperator *op)
+static int poselib_sanitize_exec(bContext *C, wmOperator *op)
{
Object *ob = get_poselib_object(C);
bAction *act = (ob) ? ob->poselib : NULL;
@@ -353,15 +353,15 @@ static int poselib_sanitise_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void POSELIB_OT_action_sanitise(wmOperatorType *ot)
+void POSELIB_OT_action_sanitize(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Sanitise Pose Library Action";
- ot->idname = "POSELIB_OT_action_sanitise";
+ ot->name = "Sanitize Pose Library Action";
+ ot->idname = "POSELIB_OT_action_sanitize";
ot->description = "Make action suitable for use as a Pose Library";
/* callbacks */
- ot->exec = poselib_sanitise_exec;
+ ot->exec = poselib_sanitize_exec;
ot->poll = has_poselib_pose_data_poll;
/* flags */
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 032b999c60f..e8a71a35576 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -2368,7 +2368,7 @@ void CURVE_OT_smooth_radius(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Smooth Curve Radius";
- ot->description = "Flatten radiuses of selected points";
+ ot->description = "Flatten radii of selected points";
ot->idname = "CURVE_OT_smooth_radius";
/* api clastbacks */
@@ -3932,7 +3932,8 @@ static int make_segment_exec(bContext *C, wmOperator *op)
ListBase *nubase = object_editcurve_get(obedit);
Nurb *nu, *nu1 = NULL, *nu2 = NULL;
BPoint *bp;
- int a, ok = 0;
+ int ok = 0;
+ /* int a; */ /* UNUSED */
/* first decide if this is a surface merge! */
if (obedit->type == OB_SURF) nu = nubase->first;
@@ -4040,7 +4041,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
MEM_freeN(nu1->bp);
nu1->bp = bp;
- a = nu1->pntsu + nu1->orderu;
+ /* a = nu1->pntsu + nu1->orderu; */ /* UNUSED */
nu1->pntsu += nu2->pntsu;
BLI_remlink(nubase, nu2);
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index fa555b0ddb8..6d113cbb924 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -281,7 +281,7 @@ static void gp_draw_stroke(bGPDspoint *points, int totpoints, short thickness_s,
}
/* tessellation code - draw stroke as series of connected quads with connection
- * edges rotated to minimise shrinking artifacts, and rounded endcaps
+ * edges rotated to minimize shrinking artifacts, and rounded endcaps
*/
else {
bGPDspoint *pt1, *pt2;
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index a7beaa74eb7..b69db0040b5 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -399,7 +399,7 @@ void paste_gpdata(Scene *scene)
/* this should be the right frame... as it may be a pre-existing frame,
* must make sure that only compatible stroke types get copied over
* - we cannot just add a duplicate frame, as that would cause errors
- * - need to check for compatible types to minimise memory usage (copying 'junk' over)
+ * - need to check for compatible types to minimize memory usage (copying 'junk' over)
*/
for (gps = gpfs->strokes.first; gps; gps = gps->next) {
short stroke_ok;
diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h
index c53dca47da9..6b9d8385ac3 100644
--- a/source/blender/editors/include/ED_screen_types.h
+++ b/source/blender/editors/include/ED_screen_types.h
@@ -76,10 +76,10 @@ typedef struct ScreenFrameRateInfo {
/* Enum for Action Zone Edges. Which edge of area is action zone. */
typedef enum {
- AE_RIGHT_TO_TOPLEFT, /* Region located on the left, _right_ edge is action zone. Region minimised to the top left */
- AE_LEFT_TO_TOPRIGHT, /* Region located on the right, _left_ edge is action zone. Region minimised to the top right */
- AE_TOP_TO_BOTTOMRIGHT, /* Region located at the bottom, _top_ edge is action zone. Region minimised to the bottom right */
- AE_BOTTOM_TO_TOPLEFT /* Region located at the top, _bottom_edge is action zone. Region minimised to the top left */
+ AE_RIGHT_TO_TOPLEFT, /* Region located on the left, _right_ edge is action zone. Region minimized to the top left */
+ AE_LEFT_TO_TOPRIGHT, /* Region located on the right, _left_ edge is action zone. Region minimized to the top right */
+ AE_TOP_TO_BOTTOMRIGHT, /* Region located at the bottom, _top_ edge is action zone. Region minimized to the bottom right */
+ AE_BOTTOM_TO_TOPLEFT /* Region located at the top, _bottom_edge is action zone. Region minimized to the top left */
} AZEdge;
/* for editing areas/regions */
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index d26c8cefdf0..49d56d427ba 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -498,7 +498,7 @@ static int ui_but_float_precision(uiBut *but, double value)
return prec;
}
-static void ui_draw_linkline(uiLinkLine *line, int hilightActiveLines)
+static void ui_draw_linkline(uiLinkLine *line, int highlightActiveLines)
{
rcti rect;
@@ -511,7 +511,7 @@ static void ui_draw_linkline(uiLinkLine *line, int hilightActiveLines)
if (line->flag & UI_SELECT)
glColor3ub(100, 100, 100);
- else if (hilightActiveLines && ((line->from->flag & UI_ACTIVE) || (line->to->flag & UI_ACTIVE)))
+ else if (highlightActiveLines && ((line->from->flag & UI_ACTIVE) || (line->to->flag & UI_ACTIVE)))
UI_ThemeColor(TH_TEXT_HI);
else
glColor3ub(0, 0, 0);
@@ -919,7 +919,7 @@ void uiEndBlock(const bContext *C, uiBlock *block)
if (ui_but_update_from_old_block(C, block, &but))
ui_check_but(but);
- /* temp? Proper check for greying out */
+ /* temp? Proper check for graying out */
if (but->optype) {
wmOperatorType *ot = but->optype;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index b82e7c3a1e2..3a64ad22062 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -3362,7 +3362,7 @@ static void ui_ndofedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, wmND
ui_get_but_vectorf(but, rgb);
rgb_to_hsv_compat_v(rgb, hsv);
- /* Convert current colour on hue/sat disc to circular coordinates phi, r */
+ /* Convert current color on hue/sat disc to circular coordinates phi, r */
phi = fmodf(hsv[0] + 0.25f, 1.0f) * -2.0f * (float)M_PI;
r = hsv[1];
/* sqr= r>0.f?sqrtf(r):1; */ /* UNUSED */
@@ -3833,7 +3833,7 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx
}
else {
/* scale histogram values */
- const float yfac = MIN2(powf(hist->ymax, 2.f), 1.f) * 0.5f;
+ const float yfac = minf(powf(hist->ymax, 2.0f), 1.0f) * 0.5f;
hist->ymax += dy * yfac;
CLAMP(hist->ymax, 1.f, 100.f);
@@ -5009,7 +5009,7 @@ static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y)
ui_window_to_block(ar, block, &mx, &my);
for (but = block->buttons.first; but; but = but->next) {
- /* note, LABEL is included for hilights, this allows drags */
+ /* note, LABEL is included for highlights, this allows drags */
if (but->type == LABEL && but->dragpoin == NULL)
continue;
if (ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX))
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 40d530a13d4..eb89fd66b77 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -783,7 +783,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
if (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,
- TIP_("Apply modifier to editing cage during Editmode"));
+ TIP_("Apply modifier to editing cage during Edit mode"));
if (index < cageIndex)
uiButSetFlag(but, UI_BUT_DISABLED);
uiButSetFunc(but, modifiers_setOnCage, ob, md);
@@ -1052,7 +1052,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
* as that poses problems when restoring them, so disable the "up" button where
* it may cause this situation.
*
- * Up/Down buttons should only be shown (or not greyed - todo) if they serve some purpose.
+ * Up/Down buttons should only be shown (or not grayed - todo) if they serve some purpose.
*/
if (proxylocked_constraints_owner(ob, pchan)) {
if (con->prev) {
@@ -2680,7 +2680,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
but->col[3] = 255;
but = uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X + 10, 0, UI_UNIT_X + width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "");
- but->col[0] = but->col[1] = but->col[2] = FTOCHAR(rti->greyscale);
+ but->col[0] = but->col[1] = but->col[2] = FTOCHAR(rti->grayscale);
but->col[3] = 255;
uiBlockEndAlign(block);
@@ -2700,7 +2700,8 @@ 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, TIP_("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, TIP_("Click to see the remaining reports in text block: '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_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 07b1217b1bd..5ee89bb418f 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1434,7 +1434,7 @@ static struct uiWidgetColors wcol_menu_back = {
25, -20
};
-/* tooltip colour */
+/* tooltip color */
static struct uiWidgetColors wcol_tooltip = {
{0, 0, 0, 255},
{25, 25, 25, 230},
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 6dbf53cba72..392aae1632d 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -431,7 +431,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize)
/* curRatio = height / width; */ /* UNUSED */
winRatio = winy / winx;
- /* both sizes change (area/region maximised) */
+ /* both sizes change (area/region maximized) */
if (do_x == do_y) {
if (do_x && do_y) {
/* here is 1,1 case, so all others must be 0,0 */
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index 20ac3333115..77808d0a00d 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -276,7 +276,7 @@ void WM_OT_collada_export(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "include_material_textures", 0, "Include Material Textures",
"Export textures assigned to the object Materials");
- RNA_def_boolean(ot->srna, "use_texture_copies", 1, "copy",
+ RNA_def_boolean(ot->srna, "use_texture_copies", 1, "Copy",
"Copy textures to same folder where the .dae file is exported");
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index 83337a18223..f080b9f96e7 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -192,9 +192,9 @@ static void draw_spline_points(MaskLayer *masklay, MaskSpline *spline,
/* this could be split into its own loop */
if (draw_type == MASK_DT_OUTLINE) {
- const unsigned char rgb_grey[4] = {0x60, 0x60, 0x60, 0xff};
+ const unsigned char rgb_gray[4] = {0x60, 0x60, 0x60, 0xff};
glLineWidth(3);
- glColor4ubv(rgb_grey);
+ glColor4ubv(rgb_gray);
glBegin(GL_LINES);
glVertex3fv(vert);
glVertex3fv(handle);
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c
index 6e0da5fd756..cce7e26115e 100644
--- a/source/blender/editors/mask/mask_edit.c
+++ b/source/blender/editors/mask/mask_edit.c
@@ -310,7 +310,8 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MASK_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
// WM_keymap_add_item(keymap, "MASK_OT_feather_weight_clear", SKEY, KM_PRESS, KM_ALT, 0);
/* ... matches curve editmode */
- RNA_enum_set(WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", TFM_MASK_SHRINKFATTEN);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_ALT, 0)->ptr,
+ "mode", TFM_MASK_SHRINKFATTEN);
/* relationships */
WM_keymap_add_item(keymap, "MASK_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
@@ -329,13 +330,15 @@ void ED_operatormacros_mask(void)
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
- ot = WM_operatortype_append_macro("MASK_OT_add_vertex_slide", "Add Vertex and Slide", "Add new vertex and slide it", OPTYPE_UNDO | OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MASK_OT_add_vertex_slide", "Add Vertex and Slide",
+ "Add new vertex and slide it", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Add new vertex and slide it";
WM_operatortype_macro_define(ot, "MASK_OT_add_vertex");
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
RNA_boolean_set(otmacro->ptr, "release_confirm", TRUE);
- ot = WM_operatortype_append_macro("MASK_OT_add_feather_vertex_slide", "Add Feather Vertex and Slide", "Add new vertex to feater and slide it", OPTYPE_UNDO | OPTYPE_REGISTER);
+ ot = WM_operatortype_append_macro("MASK_OT_add_feather_vertex_slide", "Add Feather Vertex and Slide",
+ "Add new vertex to feather and slide it", OPTYPE_UNDO | OPTYPE_REGISTER);
ot->description = "Add new feather vertex and slide it";
WM_operatortype_macro_define(ot, "MASK_OT_add_feather_vertex");
otmacro = WM_operatortype_macro_define(ot, "MASK_OT_slide_point");
diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c
index a619ac7e3cd..c5b9fc33a9b 100644
--- a/source/blender/editors/mask/mask_shapekey.c
+++ b/source/blender/editors/mask/mask_shapekey.c
@@ -229,7 +229,7 @@ void MASK_OT_shape_key_feather_reset(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Feather Reset Animation";
- ot->description = "Resets fearther weights on all selected points animation values";
+ ot->description = "Reset feather weights on all selected points animation values";
ot->idname = "MASK_OT_shape_key_feather_reset";
/* api callbacks */
@@ -394,7 +394,7 @@ void MASK_OT_shape_key_rekey(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Re-Key Points of Selected Shapes";
- ot->description = "Recalculates animation data on selected points for frames selected in the dopesheet";
+ ot->description = "Recalculate animation data on selected points for frames selected in the dopesheet";
ot->idname = "MASK_OT_shape_key_rekey";
/* api callbacks */
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 2ceb8aeef26..882d3115ba0 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1400,9 +1400,10 @@ static float knife_snap_size(KnifeTool_OpData *kcd, float maxsize)
{
float density = (float)knife_sample_screen_density(kcd, maxsize * 2.0f);
- density = MAX2(density, 1);
+ if (density < 1.0f)
+ density = 1.0f;
- return MIN2(maxsize / (density * 0.5f), maxsize);
+ return minf(maxsize / (density * 0.5f), maxsize);
}
/* p is closest point on edge to the mouse cursor */
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 3e68e18d956..208aa2f9b12 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -2892,11 +2892,9 @@ static int mesh_separate_material(Main *bmain, Scene *scene, Base *editbase, wmO
static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOperator *wmop)
{
int i;
- BMVert *v;
BMEdge *e;
BMVert *v_seed;
BMWalker walker;
- BMIter iter;
int result = FALSE;
Object *obedit = editbase->object;
BMEditMesh *em = BMEdit_FromObject(obedit);
@@ -2913,11 +2911,7 @@ static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOper
* original mesh.*/
for (i = 0; i < max_iter; i++) {
/* Get a seed vertex to start the walk */
- v_seed = NULL;
- BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
- v_seed = v;
- break;
- }
+ v_seed = BM_iter_at_index(bm, BM_VERTS_OF_MESH, NULL, 0);
/* No vertices available, can't do anything */
if (v_seed == NULL) {
@@ -4187,11 +4181,11 @@ void MESH_OT_sort_elements(wmOperatorType *ot)
{
static EnumPropertyItem type_items[] = {
{SRT_VIEW_ZAXIS, "VIEW_ZAXIS", 0, "View Z Axis",
- "Sort selected elements from farest to nearest one in current view"},
+ "Sort selected elements from farthest to nearest one in current view"},
{SRT_VIEW_XAXIS, "VIEW_XAXIS", 0, "View X Axis",
"Sort selected elements from left to right one in current view"},
{SRT_CURSOR_DISTANCE, "CURSOR_DISTANCE", 0, "Cursor Distance",
- "Sort selected elements from nearest to farest from 3D cursor"},
+ "Sort selected elements from nearest to farthest from 3D cursor"},
{SRT_MATERIAL, "MATERIAL", 0, "Material",
"Sort selected elements from smallest to greatest material index (faces only!)"},
{SRT_SELECTED, "SELECTED", 0, "Selected",
diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c
index 7b7aaf5a3db..50d5569c483 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -228,7 +228,8 @@ 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 metaelements to select randomly", 0.0001f, 1.0f);
}
/***************************** Duplicate operator *****************************/
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index fc0aa39e733..d7c882ba51e 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1732,6 +1732,13 @@ static void make_local_makelocalmaterial(Material *ma)
/* nodetree? XXX */
}
+enum {
+ MAKE_LOCAL_SELECT_OB,
+ MAKE_LOCAL_SELECT_OBDATA,
+ MAKE_LOCAL_SELECT_OBDATA_MATERIAL,
+ MAKE_LOCAL_ALL
+};
+
static int make_local_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
@@ -1742,7 +1749,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
ID *id;
int a, b, mode = RNA_enum_get(op->ptr, "type");
- if (mode == 3) {
+ if (mode == MAKE_LOCAL_ALL) {
BKE_library_make_local(bmain, NULL, 0); /* NULL is all libs */
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_FINISHED;
@@ -1770,7 +1777,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
{
id = ob->data;
- if (id && mode > 1) {
+ if (id && (ELEM(mode, MAKE_LOCAL_SELECT_OBDATA, MAKE_LOCAL_SELECT_OBDATA_MATERIAL))) {
id_make_local(id, 0);
adt = BKE_animdata_from_id(id);
if (adt) BKE_animdata_make_local(adt);
@@ -1794,7 +1801,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- if (mode > 1) {
+ if (mode == MAKE_LOCAL_SELECT_OBDATA_MATERIAL) {
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
if (ob->type == OB_LAMP) {
@@ -1832,10 +1839,12 @@ static int make_local_exec(bContext *C, wmOperator *op)
void OBJECT_OT_make_local(wmOperatorType *ot)
{
static EnumPropertyItem type_items[] = {
- {1, "SELECTED_OBJECTS", 0, "Selected Objects", ""},
- {2, "SELECTED_OBJECTS_DATA", 0, "Selected Objects and Data", ""},
- {3, "ALL", 0, "All", ""},
- {0, NULL, 0, NULL, NULL}};
+ {MAKE_LOCAL_SELECT_OB, "SELECT_OBJECT", 0, "Selected Objects", ""},
+ {MAKE_LOCAL_SELECT_OBDATA, "SELECT_OBDATA", 0, "Selected Objects and Data", ""},
+ {MAKE_LOCAL_SELECT_OBDATA_MATERIAL, "SELECT_OBDATA_MATERIAL", 0, "Selected Objects, Data and Materials", ""},
+ {MAKE_LOCAL_ALL, "ALL", 0, "All", ""},
+ {0, NULL, 0, NULL, NULL}
+ };
/* identifiers */
ot->name = "Make Local";
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index b31e5c0aea3..2e58fa85a11 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -567,11 +567,14 @@ static void export_fluid_objects(ListBase *fobjects, Scene *scene, int length)
if (deform) {
fsmesh.channelSizeVertices = length;
fsmesh.channelVertices = fobj->VertexCache;
-
- // remove channels
+
+ /* remove channels */
fsmesh.channelTranslation =
fsmesh.channelRotation =
- fsmesh.channelScale = NULL;
+ fsmesh.channelScale = NULL;
+
+ /* Override user settings, only noslip is supported here! */
+ fsmesh.obstacleType = FLUIDSIM_OBSTACLE_NOSLIP;
}
elbeemAddMesh(&fsmesh);
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index de3d2d4e871..d37a16cb1bb 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -518,7 +518,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
ibuf = BKE_image_acquire_ibuf(oglrender->ima, &oglrender->iuser, &lock);
if (ibuf) {
- /* color -> greyscale */
+ /* color -> grayscale */
/* editing directly would alter the render view */
if (scene->r.im_format.planes == R_IMF_PLANES_BW) {
ImBuf *ibuf_bw = IMB_dupImBuf(ibuf);
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 3533a337aa1..a638aac9423 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -862,7 +862,7 @@ static void draw_join_shape(ScrArea *sa, char dir)
draw_horizontal_join_shape(sa, dir);
}
-/* draw screen area darker with arrow (visualisation of future joining) */
+/* draw screen area darker with arrow (visualization of future joining) */
static void scrarea_draw_shape_dark(ScrArea *sa, char dir)
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 6782cd55a8b..6be276dea14 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2826,7 +2826,7 @@ static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *U
uiItemS(layout);
- /* file browser should be fullscreen all the time, but other regions can be maximised/restored... */
+ /* file browser should be fullscreen all the time, but other regions can be maximized/restored... */
if (sa->spacetype != SPACE_FILE) {
if (sa->full)
uiItemO(layout, "Tile Area", ICON_NONE, "SCREEN_OT_screen_full_area");
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 3c37ad8cf2a..1b62ba8a7e0 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -3045,7 +3045,7 @@ static int weight_from_bones_exec(bContext *C, wmOperator *op)
void PAINT_OT_weight_from_bones(wmOperatorType *ot)
{
static EnumPropertyItem type_items[] = {
- {ARM_GROUPS_AUTO, "AUTOMATIC", 0, "Automatic", "Automatic weights froms bones"},
+ {ARM_GROUPS_AUTO, "AUTOMATIC", 0, "Automatic", "Automatic weights from bones"},
{ARM_GROUPS_ENVELOPE, "ENVELOPES", 0, "From Envelopes", "Weights from envelopes with user defined radius"},
{0, NULL, 0, NULL, NULL}};
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index e76edcf0290..9d1f52568b4 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -654,7 +654,7 @@ void CLIP_OT_view_zoom_out(wmOperatorType *ot)
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX, "Location",
- "Cursor location in normalised (0.0-1.0) coordinates", -10.0f, 10.0f);
+ "Cursor location in normalized (0.0-1.0) coordinates", -10.0f, 10.0f);
}
/********************** view zoom ratio operator *********************/
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index 3ad6614d356..a07a560328c 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -91,7 +91,7 @@ int file_directory_exec(bContext *C, struct wmOperator *unused);
int file_directory_new_exec(bContext *C, struct wmOperator *unused);
int file_delete_exec(bContext *C, struct wmOperator *unused);
-int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my);
+int file_highlight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my);
void file_sfile_to_operator(struct wmOperator *op, struct SpaceFile *sfile, char *filepath);
void file_operator_to_sfile(struct SpaceFile *sfile, struct wmOperator *op);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 0cf3586e659..2d778b94216 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -515,7 +515,7 @@ void FILE_OT_delete_bookmark(wmOperatorType *ot)
RNA_def_int(ot->srna, "index", -1, -1, 20000, "Index", "", -1, 20000);
}
-int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
+int file_highlight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
{
View2D *v2d = &ar->v2d;
FileSelectParams *params;
@@ -555,7 +555,7 @@ static int file_highlight_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *e
ARegion *ar = CTX_wm_region(C);
SpaceFile *sfile = CTX_wm_space_file(C);
- if (!file_hilight_set(sfile, ar, event->x, event->y))
+ if (!file_highlight_set(sfile, ar, event->x, event->y))
return OPERATOR_CANCELLED;
ED_area_tag_redraw(CTX_wm_area(C));
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 79979603f54..95d5483b42c 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -356,7 +356,7 @@ static void file_main_area_draw(const bContext *C, ARegion *ar)
/* on first read, find active file */
if (params->active_file == -1) {
wmEvent *event = CTX_wm_window(C)->eventstate;
- file_hilight_set(sfile, ar, event->x, event->y);
+ file_highlight_set(sfile, ar, event->x, event->y);
}
file_draw_list(C, ar);
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index ddca0030cf5..870e9bb8168 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -276,7 +276,7 @@ static void draw_fcurve_vertices(SpaceIpo *sipo, ARegion *ar, FCurve *fcu, short
View2D *v2d = &ar->v2d;
/* only draw points if curve is visible
- * - draw unselected points before selected points as separate passes to minimise color-changing overhead
+ * - draw unselected points before selected points as separate passes to minimize color-changing overhead
* (XXX dunno if this is faster than drawing all in one pass though)
* and also to make sure in the case of overlapping points that the selected is always visible
* - draw handles before keyframes, so that keyframes will overlap handles (keyframes are more important for users)
@@ -851,7 +851,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGrid
setlinestyle(2);
}
if ( ((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) || (fcu->flag & FCURVE_MUTED) ) {
- /* muted curves are drawn in a greyish hue */
+ /* muted curves are drawn in a grayish hue */
// XXX should we have some variations?
UI_ThemeColorShade(TH_HEADER, 50);
}
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 756e6997fc8..f4cb4ec3d05 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -189,6 +189,8 @@ static void graph_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa)
sipo->ads->source = (ID *)(G.main->scene.first); // FIXME: this is a really nasty hack here for now...
}
+ /* force immediate init of any invalid F-Curve colors */
+ sipo->flag |= SIPO_TEMP_NEEDCHANSYNC;
ED_area_tag_refresh(sa);
}
@@ -477,7 +479,13 @@ static void graph_listener(ScrArea *sa, wmNotifier *wmn)
if (wmn->data == ND_SPACE_GRAPH)
ED_area_tag_redraw(sa);
break;
-
+ case NC_WINDOW:
+ if (sipo->flag & SIPO_TEMP_NEEDCHANSYNC) {
+ /* force redraw/refresh after undo/redo - prevents "black curve" problem */
+ ED_area_tag_refresh(sa);
+ }
+ break;
+
// XXX: restore the case below if not enough updates occur...
//default:
// if (wmn->data==ND_KEYS)
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index aa596b8b635..92c339d7672 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -148,7 +148,7 @@ static void image_info(Scene *scene, ImageUser *iuser, Image *ima, ImBuf *ibuf,
/* the frame number, even if we cant */
if (ima->source == IMA_SRC_SEQUENCE) {
/* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
- const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0);
+ const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0, NULL);
ofs += sprintf(str + ofs, IFACE_(", Frame: %d"), framenr);
}
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index 080f12bf35b..33a2d5c18c5 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -340,7 +340,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
ReportTimerInfo *rti;
float progress = 0.0, color_progress = 0.0;
float neutral_col[3] = {0.35, 0.35, 0.35};
- float neutral_grey = 0.6;
+ float neutral_gray = 0.6;
float timeout = 0.0, color_timeout = 0.0;
int send_note = 0;
@@ -385,7 +385,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
rti->col[1] = 0.45;
rti->col[2] = 0.7;
}
- rti->greyscale = 0.75;
+ rti->grayscale = 0.75;
rti->widthfac = 1.0;
}
@@ -398,7 +398,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wm
/* fade colors out sharply according to progress through fade-out duration */
interp_v3_v3v3(rti->col, rti->col, neutral_col, color_progress);
- rti->greyscale = interpf(neutral_grey, rti->greyscale, color_progress);
+ rti->grayscale = interpf(neutral_gray, rti->grayscale, color_progress);
}
/* collapse report at end of timeout */
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 7eb0f676707..92f014fd804 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -89,7 +89,7 @@ static void nla_action_get_color(AnimData *adt, bAction *act, float color[4])
UI_GetThemeColor4fv(TH_ANIM_ACTIVE, color);
}
else {
- /* greyish-red color */
+ /* grayish-red color */
UI_GetThemeColor4fv(TH_ANIM_INACTIVE, color);
}
}
@@ -217,7 +217,7 @@ static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc)
{
const float yheight = ymaxc - yminc;
- /* drawing color is simply a light-grey */
+ /* drawing color is simply a light-gray */
// TODO: is this color suitable?
// XXX nasty hacked color for now... which looks quite bad too...
glColor3f(0.7f, 0.7f, 0.7f);
@@ -480,7 +480,7 @@ static void nla_draw_strip_text(AnimData *adt, NlaTrack *nlt, NlaStrip *strip, i
static void nla_draw_strip_frames_text(NlaTrack *UNUSED(nlt), NlaStrip *strip, View2D *v2d, float UNUSED(yminc), float ymaxc)
{
const float ytol = 1.0f; /* small offset to vertical positioning of text, for legibility */
- const char col[4] = {220, 220, 220, 255}; /* light grey */
+ const char col[4] = {220, 220, 220, 255}; /* light gray */
char numstr[32] = "";
@@ -551,7 +551,7 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *ar)
/* draw each strip in the track (if visible) */
for (strip = nlt->strips.first, index = 1; strip; strip = strip->next, index++) {
if (BKE_nlastrip_within_bounds(strip, v2d->cur.xmin, v2d->cur.xmax)) {
- /* draw the visualisation of the strip */
+ /* draw the visualization of the strip */
nla_draw_strip(snla, adt, nlt, strip, v2d, yminc, ymaxc);
/* add the text for this strip to the cache */
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index a4fb4d7dfee..218d11f3035 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1213,7 +1213,7 @@ static void node_buts_image_user(uiLayout *layout, bContext *C, PointerRNA *ptr,
Scene *scene = CTX_data_scene(C);
ImageUser *iuser = iuserptr->data;
char numstr[32];
- const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0);
+ const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0, NULL);
BLI_snprintf(numstr, sizeof(numstr), IFACE_("Frame: %d"), framenr);
uiItemL(layout, numstr, ICON_NONE);
}
@@ -2951,15 +2951,37 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage)
}
if (ibuf->rect) {
- if (snode->flag & SNODE_SHOW_ALPHA) {
+ if (snode->flag & (SNODE_SHOW_R | SNODE_SHOW_G | SNODE_SHOW_B)) {
+ int ofs;
+
+#ifdef __BIG_ENDIAN__
+ if (snode->flag & SNODE_SHOW_R) ofs = 2;
+ else if (snode->flag & SNODE_SHOW_G) ofs = 1;
+ else ofs = 0;
+#else
+ if (snode->flag & SNODE_SHOW_R) ofs = 1;
+ else if (snode->flag & SNODE_SHOW_G) ofs = 2;
+ else ofs = 3;
+#endif
+
glPixelZoom(snode->zoom, snode->zoom);
/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
- if (ENDIAN_ORDER == B_ENDIAN)
- glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
-
+
+ glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_UNSIGNED_INT, ((unsigned char *)ibuf->rect) + ofs);
+
+ glPixelZoom(1.0f, 1.0f);
+ }
+ else if (snode->flag & SNODE_SHOW_ALPHA) {
+ glPixelZoom(snode->zoom, snode->zoom);
+ /* swap bytes, so alpha is most significant one, then just draw it as luminance int */
+#ifdef __BIG_ENDIAN__
+ glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
+#endif
glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_UNSIGNED_INT, ibuf->rect);
-
+
+#ifdef __BIG_ENDIAN__
glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
+#endif
glPixelZoom(1.0f, 1.0f);
}
else if (snode->flag & SNODE_USE_ALPHA) {
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 17d7530d2a7..65646c855b7 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -724,6 +724,12 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
if (node->flag & NODE_MUTED)
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
+ if (ntree->type == NTREE_COMPOSIT && (snode->flag&SNODE_SHOW_HIGHLIGHT)) {
+ if (node->highlight) {
+ UI_ThemeColorBlend(color_id, TH_ACTIVE, 0.5f);
+ node->highlight = 0;
+ }
+ }
uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
uiRoundBox(rct->xmin, rct->ymax-NODE_DY, rct->xmax, rct->ymax, BASIS_RAD);
@@ -805,7 +811,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
glDisable(GL_BLEND);
/* outline active and selected emphasis */
- if ( node->flag & (NODE_ACTIVE|SELECT) ) {
+ if ( node->flag & (NODE_ACTIVE|SELECT)) {
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
@@ -862,7 +868,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
node->block= NULL;
}
-static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, bNode *node)
+static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node)
{
bNodeSocket *sock;
rctf *rct= &node->totr;
@@ -879,10 +885,18 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
UI_ThemeColor(color_id);
if (node->flag & NODE_MUTED)
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
+
+ if (ntree->type == NTREE_COMPOSIT && (snode->flag&SNODE_SHOW_HIGHLIGHT)) {
+ if (node->highlight) {
+ UI_ThemeColorBlend(color_id, TH_ACTIVE, 0.5f);
+ node->highlight = 0;
+ }
+ }
+
uiRoundBox(rct->xmin, rct->ymin, rct->xmax, rct->ymax, hiddenrad);
/* outline active and selected emphasis */
- if ( node->flag & (NODE_ACTIVE|SELECT) ) {
+ if ( node->flag & (NODE_ACTIVE|SELECT)) {
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
@@ -1005,7 +1019,7 @@ void node_set_cursor(wmWindow *win, SpaceNode *snode)
void node_draw_default(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node)
{
if (node->flag & NODE_HIDDEN)
- node_draw_hidden(C, ar, snode, node);
+ node_draw_hidden(C, ar, snode, ntree, node);
else
node_draw_basis(C, ar, snode, ntree, node);
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 48f772e8008..9a6906c43bc 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1643,7 +1643,7 @@ void NODE_OT_backimage_zoom(wmOperatorType *ot)
/* identifiers */
ot->name = "Background Image Zoom";
ot->idname = "NODE_OT_backimage_zoom";
- ot->description = "Zoom in/out the brackground image";
+ ot->description = "Zoom in/out the background image";
/* api callbacks */
ot->exec = backimage_zoom;
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 3a834ef6331..349259ad71b 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -448,8 +448,15 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case NC_SCREEN:
- if (wmn->data == ND_GPENCIL)
- ED_region_tag_redraw(ar);
+ switch (wmn->data) {
+ case ND_GPENCIL:
+ ED_region_tag_redraw(ar);
+ break;
+ case ND_SCREENCAST:
+ case ND_ANIMPLAY:
+ ED_region_tag_redraw(ar);
+ break;
+ }
break;
case NC_SCENE:
case NC_MATERIAL:
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 2f5e32c61d1..42fdd5173d4 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1541,7 +1541,7 @@ static void outliner_draw_tree(bContext *C, uiBlock *block, Scene *scene, ARegio
starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET;
outliner_draw_selection(ar, soops, &soops->tree, &starty);
- // grey hierarchy lines
+ // gray hierarchy lines
UI_ThemeColorBlend(TH_BACK, TH_TEXT, 0.4f);
starty = (int)ar->v2d.tot.ymax - UI_UNIT_Y / 2 - OL_Y_OFFSET;
startx = 6;
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index eb740e441b7..449914feae4 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1360,7 +1360,7 @@ void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot)
/* identifiers */
ot->idname = "OUTLINER_OT_keyingset_add_selected";
ot->name = "Keying Set Add Selected";
- ot->description = "Add selected items (blue-grey rows) to active Keying Set";
+ ot->description = "Add selected items (blue-gray rows) to active Keying Set";
/* api callbacks */
ot->exec = outliner_keyingset_additems_exec;
@@ -1397,7 +1397,7 @@ void OUTLINER_OT_keyingset_remove_selected(wmOperatorType *ot)
/* identifiers */
ot->idname = "OUTLINER_OT_keyingset_remove_selected";
ot->name = "Keying Set Remove Selected";
- ot->description = "Remove selected items (blue-grey rows) from active Keying Set";
+ ot->description = "Remove selected items (blue-gray rows) from active Keying Set";
/* api callbacks */
ot->exec = outliner_keyingset_removeitems_exec;
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 812fba50295..096713f9cd3 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -69,7 +69,7 @@
#include "outliner_intern.h"
/* ****************************************************** */
-/* Outliner Selection (grey-blue highlight for rows) */
+/* Outliner Selection (gray-blue highlight for rows) */
static int outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *selecting)
{
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 9148373cb2d..38f29e8816e 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1076,7 +1076,7 @@ static void draw_seq_backdrop(View2D *v2d)
{
int i;
- /* darker grey overlay over the view backdrop */
+ /* darker gray overlay over the view backdrop */
UI_ThemeColorShade(TH_BACK, -20);
glRectf(v2d->cur.xmin, -1.0, v2d->cur.xmax, 1.0);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 7ed5c77ed1f..1c3d2b61488 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2805,7 +2805,7 @@ void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot)
/* identifiers */
ot->name = "Rebuild Proxy and Timecode Indices";
ot->idname = "SEQUENCER_OT_rebuild_proxy";
- ot->description = "Rebuild all selected proxies and timecode indeces using the job system";
+ ot->description = "Rebuild all selected proxies and timecode indices using the job system";
/* api callbacks */
ot->exec = sequencer_rebuild_proxy_exec;
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index b8bf764fabc..cabc761161e 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -454,6 +454,10 @@ static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
if (wmn->action == NA_RENAME)
ED_region_tag_redraw(ar);
break;
+ case NC_SCREEN:
+ if (ELEM(wmn->data, ND_SCREENCAST, ND_ANIMPLAY))
+ ED_region_tag_redraw(ar);
+ break;
}
}
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 01d27aaa0b3..a9315313d26 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -208,6 +208,9 @@ static void time_draw_cache(SpaceTime *stime, Object *ob)
if (pid->cache->flag & PTCACHE_BAKED) {
col[0] -= 0.4f; col[1] -= 0.4f; col[2] -= 0.4f;
}
+ else if (pid->cache->flag & PTCACHE_OUTDATED) {
+ col[0] += 0.4f; col[1] += 0.4f; col[2] += 0.4f;
+ }
glColor4fv(col);
glEnableClientState(GL_VERTEX_ARRAY);
@@ -699,4 +702,3 @@ void ED_spacetype_time(void)
BKE_spacetype_register(st);
}
-
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index e51f7a312eb..cdaf7d5690f 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -709,9 +709,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
glBegin(GL_QUAD_STRIP);
for (a = 0; a < 16; a++) {
- vec[0] = -*(si + a) * dirvec[0] + *(co + a) * norvec[0];
- vec[1] = -*(si + a) * dirvec[1] + *(co + a) * norvec[1];
- vec[2] = -*(si + a) * dirvec[2] + *(co + a) * norvec[2];
+ vec[0] = -si[a] * dirvec[0] + co[a] * norvec[0];
+ vec[1] = -si[a] * dirvec[1] + co[a] * norvec[1];
+ vec[2] = -si[a] * dirvec[2] + co[a] * norvec[2];
madd_v3_v3v3fl(vec1, headvec, vec, head);
madd_v3_v3v3fl(vec2, headvec, vec, head + dist);
@@ -723,9 +723,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
}
for (a = 15; a >= 0; a--) {
- vec[0] = *(si + a) * dirvec[0] + *(co + a) * norvec[0];
- vec[1] = *(si + a) * dirvec[1] + *(co + a) * norvec[1];
- vec[2] = *(si + a) * dirvec[2] + *(co + a) * norvec[2];
+ vec[0] = si[a] * dirvec[0] + co[a] * norvec[0];
+ vec[1] = si[a] * dirvec[1] + co[a] * norvec[1];
+ vec[2] = si[a] * dirvec[2] + co[a] * norvec[2];
madd_v3_v3v3fl(vec1, tailvec, vec, tail);
madd_v3_v3v3fl(vec2, tailvec, vec, tail + dist);
@@ -737,9 +737,9 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel
}
/* make it cyclic... */
- vec[0] = -*(si) * dirvec[0] + *(co) * norvec[0];
- vec[1] = -*(si) * dirvec[1] + *(co) * norvec[1];
- vec[2] = -*(si) * dirvec[2] + *(co) * norvec[2];
+ vec[0] = -si[0] * dirvec[0] + co[0] * norvec[0];
+ vec[1] = -si[0] * dirvec[1] + co[0] * norvec[1];
+ vec[2] = -si[0] * dirvec[2] + co[0] * norvec[2];
madd_v3_v3v3fl(vec1, headvec, vec, head);
madd_v3_v3v3fl(vec2, headvec, vec, head + dist);
@@ -2269,7 +2269,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, const short dt)
}
}
-/* ****************************** Armature Visualisation ******************************** */
+/* ****************************** Armature Visualization ******************************** */
/* ---------- Paths --------- */
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 7d39a89a130..60b3b911b1b 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -373,7 +373,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float min[3], float max[3], int r
/* 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 = ds/96.f;
+ dd = ds / 96.f;
n = 0;
good_index = i;
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index a9941dc326a..6cfa828024d 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -856,7 +856,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, IFACE_("Normalize"), 0, yco, 100, 20,
NULL, 0, 0, 0, 0, TIP_("Normalize active vertex weights"));
uiDefBut(block, BUT, B_VGRP_PNL_COPY, IFACE_("Copy"), 100, yco, 100, 20,
- NULL, 0, 0, 0, 0, TIP_("Copy active vertex to other seleted verts"));
+ NULL, 0, 0, 0, 0, TIP_("Copy active vertex to other selected verts"));
uiBlockEndAlign(block);
}
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 2d4fbb90ae1..3079719efe0 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1561,7 +1561,12 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
if (ima == NULL)
continue;
BKE_image_user_frame_calc(&bgpic->iuser, CFRA, 0);
- ibuf = BKE_image_get_ibuf(ima, &bgpic->iuser);
+ if (ima->source == IMA_SRC_SEQUENCE && !(bgpic->iuser.flag & IMA_USER_FRAME_IN_RANGE)) {
+ ibuf = NULL; /* frame is out of range, dont show */
+ }
+ else {
+ ibuf = BKE_image_get_ibuf(ima, &bgpic->iuser);
+ }
image_aspect[0] = ima->aspx;
image_aspect[1] = ima->aspx;
@@ -1569,6 +1574,8 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
else if (bgpic->source == V3D_BGPIC_MOVIE) {
clip = NULL;
+ /* TODO: skip drawing when out of frame range (as image sequences do above) */
+
if (bgpic->flag & V3D_BGPIC_CAMERACLIP) {
if (scene->camera)
clip = BKE_object_movieclip_get(scene, scene->camera, 1);
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index cc3d2d383b8..218aa71d621 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2873,7 +2873,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
break;
case RV3D_VIEW_BACK:
- axis_set_view(C, v3d, ar, 0.0, 0.0, (float)-cos(M_PI / 4.0), (float)-cos(M_PI / 4.0),
+ axis_set_view(C, v3d, ar, 0.0, 0.0, -cosf(M_PI / 4.0), -cosf(M_PI / 4.0),
viewnum, nextperspo, align_active);
break;
@@ -2888,7 +2888,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
break;
case RV3D_VIEW_FRONT:
- axis_set_view(C, v3d, ar, (float)cos(M_PI / 4.0), (float)-sin(M_PI / 4.0), 0.0, 0.0,
+ axis_set_view(C, v3d, ar, cosf(M_PI / 4.0), -sinf(M_PI / 4.0), 0.0, 0.0,
viewnum, nextperspo, align_active);
break;
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 4782b95ba1c..b4350847552 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1125,7 +1125,7 @@ int ED_view3d_lock(RegionView3D *rv3d)
break;
case RV3D_VIEW_BACK:
- QUATSET(rv3d->viewquat, 0.0, 0.0, (float)-cos(M_PI / 4.0), (float)-cos(M_PI / 4.0));
+ QUATSET(rv3d->viewquat, 0.0, 0.0, -cosf(M_PI / 4.0), -cosf(M_PI / 4.0));
break;
case RV3D_VIEW_LEFT:
@@ -1137,7 +1137,7 @@ int ED_view3d_lock(RegionView3D *rv3d)
break;
case RV3D_VIEW_FRONT:
- QUATSET(rv3d->viewquat, (float)cos(M_PI / 4.0), (float)-sin(M_PI / 4.0), 0.0, 0.0);
+ QUATSET(rv3d->viewquat, (float)cos(M_PI / 4.0), -sinf(M_PI / 4.0), 0.0, 0.0);
break;
case RV3D_VIEW_RIGHT:
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 0f5f8970190..f20fa035d32 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1389,8 +1389,8 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
float dx = t->mval[0] - cent[0], dy = t->mval[1] - cent[1];
float angle = atan2f(dy, dx);
float dist = sqrtf(dx * dx + dy * dy);
- float delta_angle = MIN2(15.0f / dist, (float)M_PI / 4.0f);
- float spacing_angle = MIN2(5.0f / dist, (float)M_PI / 12.0f);
+ float delta_angle = minf(15.0f / dist, (float)M_PI / 4.0f);
+ float spacing_angle = minf(5.0f / dist, (float)M_PI / 12.0f);
UI_ThemeColor(TH_WIRE);
setlinestyle(3);
@@ -5114,7 +5114,7 @@ void projectSVData(TransInfo *t, int final)
}
- if(!affected)
+ if (!affected)
continue;
/* only loop data, no vertex data since that contains shape keys,
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index af0b33d58ae..d7241555cc7 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1829,7 +1829,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[][3], f
d2 = d + len_v3(vec);
if (dists[BM_elem_index_get(v3)] != FLT_MAX)
- dists[BM_elem_index_get(v3)] = MIN2(d2, dists[BM_elem_index_get(v3)]);
+ dists[BM_elem_index_get(v3)] = minf(d2, dists[BM_elem_index_get(v3)]);
else
dists[BM_elem_index_get(v3)] = d2;
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index b3ccf004810..1507dbfddda 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -745,7 +745,7 @@ static char axisBlendAngle(float angle)
}
/* three colors can be set;
- * grey for ghosting
+ * gray for ghosting
* moving: in transform theme color
* else the red/green/blue
*/
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index c49e1715f34..3847087111e 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -463,12 +463,10 @@ static void initSnappingMode(TransInfo *t)
t->tsnap.mode = SCE_SNAP_MODE_INCREMENT;
}
}
- else if (t->spacetype == SPACE_NODE)
- {
+ else if (t->spacetype == SPACE_NODE) {
setSnappingCallback(t);
- if (t->tsnap.applySnap != NULL)
- {
+ if (t->tsnap.applySnap != NULL) {
t->tsnap.modeSelect = SNAP_NOT_SELECTED;
}
else {
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index d52463cf406..17c57b1f6e4 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -133,7 +133,7 @@ static void draw_uvs_shadow(Object *obedit)
BMIter iter, liter;
MLoopUV *luv;
- /* draws the grey mesh when painting */
+ /* draws the gray mesh when painting */
glColor3ub(112, 112, 112);
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index b15df9c3e89..216ac61b628 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -3402,7 +3402,8 @@ 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 normalised (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 normalized (0.0-1.0) coordinates", -10.0f, 10.0f);
}
/********************** set tile operator **********************/
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 43f3e81ae92..5c2e57cf27f 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -403,7 +403,9 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchState *sta
edgecos = uv1[0] * uv2[0] + uv1[1] * uv2[1];
edgesin = uv1[0] * uv2[1] - uv2[0] * uv1[1];
- rotation = (edgesin > 0.0f) ? acosf(MAX2(-1.0f, MIN2(1.0f, edgecos))) : -acosf(MAX2(-1.0f, MIN2(1.0f, edgecos)));
+ rotation = (edgesin > 0.0f) ?
+ +acosf(maxf(-1.0f, minf(1.0f, edgecos))) :
+ -acosf(maxf(-1.0f, minf(1.0f, edgecos)));
island_stitch_data[element1->island].num_rot_elements++;
island_stitch_data[element1->island].rotation += rotation;
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 9d3463d3d19..8a31a454633 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -537,7 +537,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
IMB_buffer_float_from_float(srgb_frect, ibuf->rect_float,
ibuf->channels, IB_PROFILE_SRGB, ibuf->profile, 0,
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
- /* clamp buffer colours to 1.0 to avoid artifacts due to glu for hdr images */
+ /* clamp buffer colors to 1.0 to avoid artifacts due to glu for hdr images */
IMB_buffer_float_clamp(srgb_frect, ibuf->x, ibuf->y);
frect= srgb_frect + texwinsy*ibuf->x + texwinsx;
}
@@ -562,7 +562,7 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int
IMB_buffer_float_from_float(srgb_frect, ibuf->rect_float,
ibuf->channels, IB_PROFILE_SRGB, ibuf->profile, 0,
ibuf->x, ibuf->y, ibuf->x, ibuf->x);
- /* clamp buffer colours to 1.0 to avoid artifacts due to glu for hdr images */
+ /* clamp buffer colors to 1.0 to avoid artifacts due to glu for hdr images */
IMB_buffer_float_clamp(srgb_frect, ibuf->x, ibuf->y);
}
else
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 93934b41f28..a0d7bfbaaf6 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -812,7 +812,7 @@ static bool joint_callback(const iTaSC::Timestamp& timestamp, iTaSC::ConstraintV
axis_angle_to_mat3(rmat, &chan->quat[1], chan->quat[0]);
}
else {
- /* quats are normalised before use to eliminate scaling issues */
+ /* quats are normalized before use to eliminate scaling issues */
normalize_qt(chan->quat);
quat_to_mat3(rmat, chan->quat);
}
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c
index 8e996b97622..182e0a7e29d 100644
--- a/source/blender/imbuf/intern/cineon/cineon_dpx.c
+++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c
@@ -83,7 +83,7 @@ static ImBuf *imb_load_dpx_cineon(unsigned char *mem, int use_cineon, int size,
logImageGetSize(image, &width, &height, &depth);
- if (depth != 3) { /*need to do greyscale loading eventually.*/
+ if (depth != 3) { /*need to do grayscale loading eventually.*/
logImageClose(image);
return NULL;
}
diff --git a/source/blender/imbuf/intern/cineon/dpxfile.h b/source/blender/imbuf/intern/cineon/dpxfile.h
index 8846c7418d5..e1d95268a80 100644
--- a/source/blender/imbuf/intern/cineon/dpxfile.h
+++ b/source/blender/imbuf/intern/cineon/dpxfile.h
@@ -62,7 +62,7 @@ typedef struct {
R32 ref_high_quantity;/* reference high quantity represented */
U8 designator1;
U8 transfer_characteristics;
- U8 colourimetry;
+ U8 colorimetry;
U8 bits_per_pixel;
U16 packing;
U16 encoding;
diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c
index a4b8c9d3f36..c1138225e93 100644
--- a/source/blender/imbuf/intern/cineon/dpxlib.c
+++ b/source/blender/imbuf/intern/cineon/dpxlib.c
@@ -53,7 +53,7 @@ fillDpxChannelInfo(DpxFile* dpx, DpxChannelInformation* chan, int des) {
chan->ref_high_quantity = htonf(2.046);
chan->designator1 = des;
chan->transfer_characteristics = 0;
- chan->colourimetry = 0;
+ chan->colorimetry = 0;
chan->bits_per_pixel = 10;
chan->packing = htons(1);
chan->encoding = 0;
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 053d88c8c32..3008c233718 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -175,13 +175,13 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
h = image->comps[0].h;
switch (image->numcomps) {
- case 1: /* Greyscale */
+ case 1: /* Grayscale */
case 3: /* Color */
planes = 24;
use_alpha = FALSE;
break;
- default: /* 2 or 4 - Greyscale or Color + alpha */
- planes = 32; /* greyscale + alpha */
+ default: /* 2 or 4 - Grayscale or Color + alpha */
+ planes = 32; /* grayscale + alpha */
use_alpha = TRUE;
break;
}
@@ -220,7 +220,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
r = image->comps[0].data;
a = (use_alpha) ? image->comps[1].data : NULL;
- /* greyscale 12bits+ */
+ /* grayscale 12bits+ */
if (use_alpha) {
a = image->comps[1].data;
PIXEL_LOOPER_BEGIN(rect_float) {
@@ -272,7 +272,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags)
r = image->comps[0].data;
a = (use_alpha) ? image->comps[1].data : NULL;
- /* greyscale */
+ /* grayscale */
if (use_alpha) {
a = image->comps[3].data;
PIXEL_LOOPER_BEGIN(rect_uchar) {
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index e78c4a55843..cb6cc2c082b 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -90,7 +90,7 @@ ImBuf *IMB_loadifffile(int file, int flags, const char *descr)
size = BLI_file_descriptor_size(file);
mem = mmap(NULL, size, PROT_READ, MAP_SHARED, file, 0);
- if (mem == (unsigned char *)-1) {
+ if (mem == (unsigned char *) -1) {
fprintf(stderr, "%s: couldn't get mapping %s\n", __func__, descr);
return NULL;
}
@@ -178,7 +178,7 @@ static void imb_loadtilefile(ImBuf *ibuf, int file, int tx, int ty, unsigned int
size = BLI_file_descriptor_size(file);
mem = mmap(NULL, size, PROT_READ, MAP_SHARED, file, 0);
- if (mem == (unsigned char *)-1) {
+ if (mem == (unsigned char *) -1) {
fprintf(stderr, "Couldn't get memory mapping for %s\n", ibuf->cachename);
return;
}
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 30dc61544b4..615b420429a 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -36,7 +36,7 @@
* high-level routine that loads all images as 32-bit RGBA, handling all the
* required conversions between many different TIFF types internally.
*
- * Saving supports RGB, RGBA and BW (greyscale) images correctly, with
+ * Saving supports RGB, RGBA and BW (grayscale) images correctly, with
* 8 bits per channel in all cases. The "deflate" compression algorithm is
* used to compress images.
*/
@@ -765,7 +765,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
PHOTOMETRIC_RGB);
}
else if (samplesperpixel == 1) {
- /* greyscale images, 1 channel */
+ /* grayscale images, 1 channel */
TIFFSetField(image, TIFFTAG_PHOTOMETRIC,
PHOTOMETRIC_MINISBLACK);
}
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index a3918c3ca26..618590509b1 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -43,7 +43,7 @@ struct Group;
struct GHash;
/* ************************************************ */
-/* Visualisation */
+/* Visualization */
/* Motion Paths ------------------------------------ */
/* (used for Pose Channels and Objects) */
@@ -83,10 +83,10 @@ typedef enum eMotionPath_Flag {
MOTIONPATH_FLAG_EDIT = (1 << 1)
} eMotionPath_Flag;
-/* Visualisation General --------------------------- */
+/* Visualization General --------------------------- */
/* for Objects or Poses (but NOT PoseChannels) */
-/* Animation Visualisation Settings (avs) */
+/* Animation Visualization Settings (avs) */
typedef struct bAnimVizSettings {
/* Onion-Skinning Settings ----------------- */
int ghost_sf, ghost_ef; /* start and end frames of ghost-drawing range (only used for GHOST_TYPE_RANGE) */
@@ -254,7 +254,7 @@ typedef enum ePchan_Flag {
/* IK/Pose solving*/
POSE_CHAIN = (1 << 9),
POSE_DONE = (1 << 10),
- /* visualisation */
+ /* visualization */
POSE_KEY = (1 << 11),
POSE_STRIDE = (1 << 12),
/* standard IK solving */
@@ -680,7 +680,7 @@ typedef struct bActionChannel {
/* Action Channel flags (ONLY USED FOR DO_VERSIONS...) */
typedef enum ACHAN_FLAG {
ACHAN_SELECTED = (1 << 0),
- ACHAN_HILIGHTED = (1 << 1),
+ ACHAN_HIGHLIGHTED = (1 << 1),
ACHAN_HIDDEN = (1 << 2),
ACHAN_PROTECTED = (1 << 3),
ACHAN_EXPANDED = (1 << 4),
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index cc08d0e92bd..0afe3773c94 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -127,9 +127,9 @@ typedef enum eArmature_Flag {
ARM_AUTO_IK = (1<<9),
ARM_NO_CUSTOM = (1<<10), /* made option negative, for backwards compat */
ARM_COL_CUSTOM = (1<<11), /* draw custom colors */
- ARM_GHOST_ONLYSEL = (1<<12), /* when ghosting, only show selected bones (this should belong to ghostflag instead) */ // XXX depreceated
+ ARM_GHOST_ONLYSEL = (1<<12), /* when ghosting, only show selected bones (this should belong to ghostflag instead) */ /* XXX depreceated */
ARM_DS_EXPAND = (1<<13), /* dopesheet channel is expanded */
- ARM_HAS_VIZ_DEPS = (1<<14), /* other objects are used for visualising various states (hack for efficient updates) */
+ ARM_HAS_VIZ_DEPS = (1<<14), /* other objects are used for visualizing various states (hack for efficient updates) */
} eArmature_Flag;
/* armature->drawtype */
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 40362424532..b6036840401 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -464,7 +464,7 @@ typedef enum eBConstraint_Types {
CONSTRAINT_TYPE_CLAMPTO = 18, /* clampto constraint */
CONSTRAINT_TYPE_TRANSFORM = 19, /* transformation (loc/rot/size -> loc/rot/size) constraint */
CONSTRAINT_TYPE_SHRINKWRAP = 20, /* shrinkwrap (loc/rot) constraint */
- CONSTRAINT_TYPE_DAMPTRACK = 21, /* New Tracking constraint that minimises twisting */
+ CONSTRAINT_TYPE_DAMPTRACK = 21, /* New Tracking constraint that minimizes twisting */
CONSTRAINT_TYPE_SPLINEIK = 22, /* Spline-IK - Align 'n' bones to a curve */
CONSTRAINT_TYPE_TRANSLIKE = 23, /* Copy transform matrix */
CONSTRAINT_TYPE_SAMEVOL = 24, /* Maintain volume during scaling */
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index f5c0148d9d0..56cf90d3d9d 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -116,7 +116,7 @@ typedef struct BPoint {
float vec[4];
float alfa, weight; /* alfa: tilt in 3D View, weight: used for softbody goal weight */
short f1, hide; /* f1: selection status, hide: is point hidden or not */
- float radius, pad; /* user-set radius per point for bevelling etc */
+ float radius, pad; /* user-set radius per point for beveling etc */
} BPoint;
typedef struct Nurb {
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index f6c4822bb55..4a4b21017db 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -122,6 +122,7 @@ typedef struct Image {
#define IMA_OLD_PREMUL 128
#define IMA_CM_PREDIVIDE 256
#define IMA_USED_FOR_RENDER 512
+#define IMA_USER_FRAME_IN_RANGE 1024 /* for image user, but these flags are mixed */
/* Image.tpageflag */
#define IMA_TILES 1
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 15641d97709..e4b5a264ba3 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -166,6 +166,7 @@ typedef struct bNode {
struct bNode *parent; /* parent node */
struct ID *id; /* optional link to libdata */
void *storage; /* custom data, must be struct, for storage in file */
+ struct bNode *original; /* the original node in the tree (for localized tree) */
float locx, locy; /* root offset for drawing */
float width, height; /* node custom width and height */
@@ -177,10 +178,11 @@ typedef struct bNode {
char label[64]; /* custom user-defined label, MAX_NAME */
short custom1, custom2; /* to be abused for buttons */
float custom3, custom4;
+ int highlight; /* 0 = not highlighted, 1-N = highlighted*/
+ int pad;
short need_exec, exec; /* need_exec is set as UI execution event, exec is flag during exec */
void *threaddata; /* optional extra storage for use in thread (read only then!) */
-
rctf totr; /* entire boundbox */
rctf butr; /* optional buttons area */
rctf prvr; /* optional preview area */
@@ -302,6 +304,7 @@ typedef struct bNodeTree {
/* ntree->flag */
#define NTREE_DS_EXPAND 1 /* for animation editors */
#define NTREE_COM_OPENCL 2 /* use opencl */
+#define NTREE_TWO_PASS 4 /* two pass */
/* XXX not nice, but needed as a temporary flags
* for group updates after library linking.
*/
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 854087b3b5b..1dd2aa6c59b 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -89,7 +89,7 @@ typedef struct PartDeflect {
float pdef_perm; /* Chance of particle passing through mesh */
float pdef_frict; /* Friction factor for particle deflection */
float pdef_rfrict; /* Random element of friction for deflection */
- float pdef_stickness;/* surface particle stickness */
+ float pdef_stickness;/* surface particle stickiness */
float absorption; /* used for forces */
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 1b42d889c1d..3da6d0fc99d 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -122,7 +122,7 @@ typedef struct Object {
struct bGPdata *gpd; /* Grease Pencil data */
- bAnimVizSettings avs; /* settings for visualisation of object-transform animation */
+ bAnimVizSettings avs; /* settings for visualization of object-transform animation */
bMotionPath *mpath; /* motion path cache for this object */
ListBase constraintChannels DNA_DEPRECATED; // XXX depreceated... old animation system
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 2f6ea861cba..b3f0950fa75 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -875,11 +875,15 @@ typedef struct SpaceNode {
/* snode->flag */
typedef enum eSpaceNode_Flag {
- SNODE_BACKDRAW = (1 << 1),
-/* SNODE_DISPGP = (1 << 2), */ /* XXX: Grease Pencil - deprecated? */
- SNODE_USE_ALPHA = (1 << 3),
- SNODE_SHOW_ALPHA = (1 << 4),
- SNODE_AUTO_RENDER = (1 << 5),
+ SNODE_BACKDRAW = (1 << 1),
+/* SNODE_DISPGP = (1 << 2), */ /* XXX: Grease Pencil - deprecated? */
+ SNODE_USE_ALPHA = (1 << 3),
+ SNODE_SHOW_ALPHA = (1 << 4),
+ SNODE_SHOW_R = (1 << 7),
+ SNODE_SHOW_G = (1 << 8),
+ SNODE_SHOW_B = (1 << 9),
+ SNODE_AUTO_RENDER = (1 << 5),
+ SNODE_SHOW_HIGHLIGHT = (1 << 6),
} eSpaceNode_Flag;
/* snode->texfrom */
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 5a49e45cf5e..780ca0b5878 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -112,7 +112,7 @@ typedef struct ReportList {
#
typedef struct ReportTimerInfo {
float col[3];
- float greyscale;
+ float grayscale;
float widthfac;
} ReportTimerInfo;
diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c
index 990d7c43309..68075823a86 100644
--- a/source/blender/makesrna/intern/rna_animviz.c
+++ b/source/blender/makesrna/intern/rna_animviz.c
@@ -183,7 +183,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna)
srna = RNA_def_struct(brna, "AnimVizOnionSkinning", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_nested(brna, srna, "AnimViz");
- RNA_def_struct_ui_text(srna, "Onion Skinning Settings", "Onion Skinning settings for animation visualisation");
+ RNA_def_struct_ui_text(srna, "Onion Skinning Settings", "Onion Skinning settings for animation visualization");
/* Enums */
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
@@ -256,7 +256,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
srna = RNA_def_struct(brna, "AnimVizMotionPaths", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings");
RNA_def_struct_nested(brna, srna, "AnimViz");
- RNA_def_struct_ui_text(srna, "Motion Path Settings", "Motion Path settings for animation visualisation");
+ RNA_def_struct_ui_text(srna, "Motion Path Settings", "Motion Path settings for animation visualization");
/* Enums */
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
@@ -343,10 +343,10 @@ void rna_def_animviz_common(StructRNA *srna)
{
PropertyRNA *prop;
- prop = RNA_def_property(srna, "animation_visualisation", PROP_POINTER, PROP_NONE);
+ prop = RNA_def_property(srna, "animation_visualization", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "avs");
- RNA_def_property_ui_text(prop, "Animation Visualisation", "Animation data for this datablock");
+ RNA_def_property_ui_text(prop, "Animation Visualization", "Animation data for this datablock");
}
static void rna_def_animviz(BlenderRNA *brna)
@@ -356,21 +356,21 @@ static void rna_def_animviz(BlenderRNA *brna)
srna = RNA_def_struct(brna, "AnimViz", NULL);
RNA_def_struct_sdna(srna, "bAnimVizSettings");
- RNA_def_struct_ui_text(srna, "Animation Visualisation", "Settings for the visualisation of motion");
+ RNA_def_struct_ui_text(srna, "Animation Visualization", "Settings for the visualization of motion");
/* onion-skinning settings (nested struct) */
prop = RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizOnionSkinning");
RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL);
- RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualisation");
+ RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualization");
/* motion path settings (nested struct) */
prop = RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "AnimVizMotionPaths");
RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL, NULL);
- RNA_def_property_ui_text(prop, "Motion Paths", "Motion Path settings for visualisation");
+ RNA_def_property_ui_text(prop, "Motion Paths", "Motion Path settings for visualization");
}
/* --- */
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index f803a8b67ea..2a6ea2994fa 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -50,7 +50,7 @@ EnumPropertyItem boidrule_type_items[] = {
{eBoidRuleType_Goal, "GOAL", 0, "Goal", "Go to assigned object or loudest assigned signal source"},
{eBoidRuleType_Avoid, "AVOID", 0, "Avoid", "Get away from assigned object or loudest assigned signal source"},
{eBoidRuleType_AvoidCollision, "AVOID_COLLISION", 0, "Avoid Collision",
- "Manoeuvre to avoid collisions with other boids and deflector objects in "
+ "Maneuver to avoid collisions with other boids and deflector objects in "
"near future"},
{eBoidRuleType_Separate, "SEPARATE", 0, "Separate", "Keep from going through other boids"},
{eBoidRuleType_Flock, "FLOCK", 0, "Flock", "Move to center of neighbors and match their velocity"},
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index e44d6a11136..8d718715e5b 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -109,7 +109,7 @@ static EnumPropertyItem owner_space_pchan_items[] = {
"The constraint is applied relative to the local coordinate system of the object, "
"with the parent transformation added"},
{CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space",
- "The constraint is applied relative to the local coordinate sytem of the object"},
+ "The constraint is applied relative to the local coordinate system of the object"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index e74d192b13f..c333c56a6b8 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -754,7 +754,7 @@ static void rna_def_bpoint(BlenderRNA *brna)
prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
+ RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for beveling");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
RNA_def_struct_path_func(srna, "rna_Curve_spline_point_path");
@@ -840,7 +840,7 @@ static void rna_def_beztriple(BlenderRNA *brna)
prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0.0f, FLT_MAX);
- RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
+ RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for beveling");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
RNA_def_struct_path_func(srna, "rna_Curve_spline_point_path");
@@ -1003,7 +1003,7 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2);
RNA_def_property_ui_text(prop, "Object Font",
"Use Blender Objects as font characters (give font objects a common name "
- "followed by the character they represent, eg. familya, familyb, etc, "
+ "followed by the character they represent, eg. family_a, family_b, etc, "
"and turn on Verts Duplication)");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
@@ -1436,7 +1436,7 @@ static void rna_def_curve(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_fill_caps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FILL_CAPS);
- RNA_def_property_ui_text(prop, "Fill Caps", "Fill caps for bevelled curves");
+ RNA_def_property_ui_text(prop, "Fill Caps", "Fill caps for beveled curves");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
/* texture space */
@@ -1640,7 +1640,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna)
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "hide", 1);
- RNA_def_property_ui_text(prop, "Hide", "Hide this curve in editmode");
+ RNA_def_property_ui_text(prop, "Hide", "Hide this curve in Edit mode");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c
index 4bfcabc935b..6739e5b71fa 100644
--- a/source/blender/makesrna/intern/rna_dynamicpaint.c
+++ b/source/blender/makesrna/intern/rna_dynamicpaint.c
@@ -469,7 +469,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS);
- RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges");
+ RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smooth paint edges");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset");
prop = RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR);
@@ -677,7 +677,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna)
prop = RNA_def_property(srna, "wave_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 5.0);
RNA_def_property_ui_range(prop, 0.20, 4.0, 1, 2);
- RNA_def_property_ui_text(prop, "Speed", "Wave propogation speed");
+ RNA_def_property_ui_text(prop, "Speed", "Wave propagation speed");
prop = RNA_def_property(srna, "wave_timescale", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 3.0);
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 144b8a7f90c..5eb15cf31b6 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -688,7 +688,7 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
{2, "TAN", 0, "Tangent", ""},
{3, "SQRT", 0, "Square Root", ""},
{4, "LN", 0, "Natural Logarithm", ""},
- {5, "SINC", 0, "Normalised Sine", "sin(x) / x"},
+ {5, "SINC", 0, "Normalized Sine", "sin(x) / x"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index 8dd1bc86ca1..e84a290acb8 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -349,7 +349,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna)
prop = RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "realsize");
RNA_def_property_range(prop, 0.001, 10);
- RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres");
+ RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in meters");
prop = RNA_def_property(srna, "simulation_rate", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "animRate");
@@ -461,8 +461,9 @@ static void rna_def_fluidsim_volume(StructRNA *srna)
RNA_def_property_boolean_sdna(prop, NULL, "domainNovecgen", 0);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Export Animated Mesh",
- "Export this mesh as an animated one (slower, only use if really necessary [e.g. "
- "armatures or parented objects], animated pos/rot/scale F-Curves do not require it)");
+ "Export this mesh as an animated one (slower and enforces No Slip, only use if really "
+ "necessary [e.g. armatures or parented objects], animated pos/rot/scale F-Curves "
+ "do not require it)");
}
static void rna_def_fluidsim_active(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index c2d730f5ed9..5334c10c4c6 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -639,7 +639,7 @@ static void rna_def_key(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "slurph");
RNA_def_property_range(prop, -500, 500);
RNA_def_property_ui_text(prop, "Slurph",
- "Create a delay (in frames) in applying keypositions, first vertex goes first");
+ "Create a delay (in frames) in applying key positions, first vertex goes first");
RNA_def_property_update(prop, 0, "rna_Key_update_data");
}
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 3cee8ca271c..4523858d639 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -776,7 +776,7 @@ static void rna_def_material_gamesettings(BlenderRNA *brna)
};
static EnumPropertyItem prop_face_orientation_items[] = {
- {GEMAT_NORMAL, "NORMAL", 0, "Normal", "No tranformation"},
+ {GEMAT_NORMAL, "NORMAL", 0, "Normal", "No transformation"},
{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"},
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 9dd58dd780e..74eaca99507 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1939,7 +1939,7 @@ static void rna_def_msticky(BlenderRNA *brna)
srna = RNA_def_struct(brna, "MeshSticky", NULL);
RNA_def_struct_sdna(srna, "MSticky");
- RNA_def_struct_ui_text(srna, "Mesh Vertex Sticky Texture Coordinate", "Stricky texture coordinate");
+ RNA_def_struct_ui_text(srna, "Mesh Vertex Sticky Texture Coordinate", "Sticky texture coordinate");
RNA_def_struct_path_func(srna, "rna_MeshSticky_path");
prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
@@ -2874,7 +2874,8 @@ static void rna_def_mesh(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES);
- RNA_def_property_ui_text(prop, "Draw Edges", "Display selected edges using hilights in the 3D view and UV editor");
+ RNA_def_property_ui_text(prop, "Draw Edges",
+ "Display selected edges using highlights in the 3D view and UV editor");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index e9b3faa2c86..084cda87507 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -2811,8 +2811,8 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna)
{MOD_WVG_MIX_SUB, "SUB", 0, "Subtract", "Subtract VGroup B's weights from VGroup A's ones"},
{MOD_WVG_MIX_MUL, "MUL", 0, "Multiply", "Multiply VGroup A's weights by VGroup B's ones"},
{MOD_WVG_MIX_DIV, "DIV", 0, "Divide", "Divide VGroup A's weights by VGroup B's ones"},
- {MOD_WVG_MIX_DIF, "DIF", 0, "Difference", "Difference between VGroup A's and VGroup B's weigths"},
- {MOD_WVG_MIX_AVG, "AVG", 0, "Average", "Average value of VGroup A's and VGroup B's weigths"},
+ {MOD_WVG_MIX_DIF, "DIF", 0, "Difference", "Difference between VGroup A's and VGroup B's weights"},
+ {MOD_WVG_MIX_AVG, "AVG", 0, "Average", "Average value of VGroup A's and VGroup B's weights"},
{0, NULL, 0, NULL, NULL}
};
@@ -3236,17 +3236,17 @@ static void rna_def_modifier_skin(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_x_symmetry", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_axes", MOD_SKIN_SYMM_X);
- RNA_def_property_ui_text(prop, "X", "Avoid making unsymmetric quads across the X axis");
+ RNA_def_property_ui_text(prop, "X", "Avoid making unsymmetrical quads across the X axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "use_y_symmetry", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_axes", MOD_SKIN_SYMM_Y);
- RNA_def_property_ui_text(prop, "Y", "Avoid making unsymmetric quads across the Y axis");
+ RNA_def_property_ui_text(prop, "Y", "Avoid making unsymmetrical quads across the Y axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "use_z_symmetry", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "symmetry_axes", MOD_SKIN_SYMM_Z);
- RNA_def_property_ui_text(prop, "Z", "Avoid making unsymmetric quads across the Z axis");
+ RNA_def_property_ui_text(prop, "Z", "Avoid making unsymmetrical quads across the Z axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
@@ -3292,7 +3292,7 @@ void RNA_def_modifier(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode);
- RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode");
+ RNA_def_property_ui_text(prop, "Edit Mode", "Use modifier while in the Edit mode");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0);
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index cb1a45ed971..a39c168c594 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3259,7 +3259,7 @@ static void def_cmp_ellipsemask(StructRNA *srna)
RNA_def_property_float_sdna(prop, NULL, "rotation");
RNA_def_property_float_default(prop, 0.0f);
RNA_def_property_range(prop, -1000.0f, 1000.0f);
- RNA_def_property_ui_text(prop, "Rotation", "Rotationangle of the box");
+ RNA_def_property_ui_text(prop, "Rotation", "Rotation angle of the box");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
@@ -4267,6 +4267,11 @@ static void rna_def_composite_nodetree(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_opencl", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_COM_OPENCL);
RNA_def_property_ui_text(prop, "OpenCL", "Enable GPU calculations");
+
+ prop = RNA_def_property(srna, "two_pass", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", NTREE_TWO_PASS);
+ RNA_def_property_ui_text(prop, "Two Pass", "Use two pass execution during editing: first calculate fast nodes, "
+ "second pass calculate all nodes");
}
static void rna_def_shader_nodetree(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 51c49cf9e53..ce6b028beb5 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1449,7 +1449,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
"Collision Sensor, detects static and dynamic objects but not the other "
"collision sensor objects"},
{OB_BODY_TYPE_NAVMESH, "NAVMESH", 0, "Navigation Mesh", "Navigation mesh"},
- {OB_BODY_TYPE_CHARACTER, "CHARACTER", 0, "Character", "Simple kinematic physics appropiate for game characters"},
+ {OB_BODY_TYPE_CHARACTER, "CHARACTER", 0, "Character",
+ "Simple kinematic physics appropriate for game characters"},
{0, NULL, 0, NULL, NULL}
};
@@ -1507,7 +1508,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_GHOST);
- RNA_def_property_ui_text(prop, "Ghost", "Object does not restitute collisions, like a ghost");
+ RNA_def_property_ui_text(prop, "Ghost", "Object does not react to collisions, like a ghost");
prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.01, 10000.0);
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 25866dd996f..1c896133408 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -901,10 +901,10 @@ static void rna_def_collision(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Kill Particles", "Kill collided particles");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
- prop = RNA_def_property(srna, "stickness", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "stickiness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "pdef_stickness");
RNA_def_property_range(prop, 0.0f, 10.0f);
- RNA_def_property_ui_text(prop, "Stickness", "Amount of stickness to surface collision");
+ RNA_def_property_ui_text(prop, "Stickiness", "Amount of stickiness to surface collision");
RNA_def_property_update(prop, 0, "rna_CollisionSettings_update");
/* Soft Body and Cloth Interaction */
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index bb8a29f8fe4..35c85f0f40e 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -142,9 +142,9 @@ void rna_ActionGroup_colorset_set(PointerRNA *ptr, int value)
/* ensure only valid values get set */
if ((value >= -1) && (value < 21)) {
grp->customCol = value;
-
+
/* sync colors stored with theme colors based on the index specified */
- action_group_colors_sync(grp);
+ action_group_colors_sync(grp, NULL);
}
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 550463a947a..75baba7156a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -766,7 +766,7 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *C, P
const char is_render = (id && GS(id->name) == ID_SCE);
/* note, we need to act differently for render
- * where 'BW' will force greyscale even if the output format writes
+ * where 'BW' will force grayscale even if the output format writes
* as RGBA, this is age old blender convention and not sure how useful
* it really is but keep it for now - campbell */
char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
@@ -2896,7 +2896,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_desktop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_DESKTOP_RESOLUTION);
- RNA_def_property_ui_text(prop, "Desktop", "Uses the current desktop resultion in fullscreen mode");
+ RNA_def_property_ui_text(prop, "Desktop", "Use the current desktop resolution in fullscreen mode");
RNA_def_property_update(prop, NC_SCENE, NULL);
/* Framing */
@@ -3301,7 +3301,7 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
RNA_def_property_enum_items(prop, image_color_mode_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_color_mode_itemf");
RNA_def_property_ui_text(prop, "Color Mode",
- "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, "
+ "Choose BW for saving grayscale images, RGB for saving red, green and blue channels, "
"and RGBA for saving red, green, blue and alpha channels");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 6e5aa78b8bd..d405cba6607 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -296,7 +296,7 @@ static void rna_def_screen(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
- RNA_def_property_ui_text(prop, "Fullscreen", "An area is maximised, filling this screen");
+ RNA_def_property_ui_text(prop, "Fullscreen", "An area is maximized, filling this screen");
/* Define Anim Playback Areas */
prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 4224b3936c6..e8818248609 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -296,7 +296,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
- RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness");
+ RNA_def_property_ui_text(prop, "Smooth Emitter", "Smooth 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);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index e4af06a5012..d5bac7a8c26 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2303,7 +2303,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWGCOLORS);
RNA_def_property_ui_text(prop, "Show Group Colors",
- "Draw groups and channels with colours matching their corresponding groups");
+ "Draw groups and channels with colors matching their corresponding groups");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL);
/* editing */
@@ -2414,7 +2414,7 @@ static void rna_def_space_graph(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWGCOLORS);
RNA_def_property_ui_text(prop, "Show Group Colors",
- "Draw groups and channels with colours matching their corresponding groups");
+ "Draw groups and channels with colors matching their corresponding groups");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
/* editing */
@@ -2852,6 +2852,10 @@ static void rna_def_space_node(BlenderRNA *brna)
{SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
"Draw image with RGB colors and alpha transparency"},
{SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
+ /* XXX, we could use better icons here */
+ {SNODE_SHOW_R, "RED", ICON_COLOR, "Red", ""},
+ {SNODE_SHOW_G, "GREEN", ICON_COLOR, "Green", ""},
+ {SNODE_SHOW_B, "BLUE", ICON_COLOR, "Blue", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -2926,6 +2930,11 @@ static void rna_def_space_node(BlenderRNA *brna)
RNA_def_property_enum_items(prop, backdrop_channels_items);
RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
+
+ prop = RNA_def_property(srna, "show_highlight", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_SHOW_HIGHLIGHT);
+ RNA_def_property_ui_text(prop, "Highlight", "Highlight nodes that are being calculated");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
}
static void rna_def_space_logic(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 9b709e9ace1..0270a7643a6 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -841,7 +841,7 @@ static void rna_def_texture_clouds(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem prop_clouds_stype[] = {
- {TEX_DEFAULT, "GREYSCALE", 0, "Greyscale", ""},
+ {TEX_DEFAULT, "GRAYSCALE", 0, "Grayscale", ""},
{TEX_COLOR, "COLOR", 0, "Color", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -1783,7 +1783,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna)
static EnumPropertyItem file_format_items[] = {
{TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"},
- {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit greyscale binary data"},
+ {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit grayscale binary data"},
/*{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""}, */
{TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence",
"Generate voxels from a sequence of image slices"},
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 801bec30ecf..63e650d5867 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -636,7 +636,7 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "default_margin");
RNA_def_property_range(prop, 0, 300);
- RNA_def_property_ui_text(prop, "Margin", "Default distance from image boudary at which marker stops tracking");
+ RNA_def_property_ui_text(prop, "Margin", "Default distance from image boundary at which marker stops tracking");
/* default_tracking_motion_model */
prop = RNA_def_property(srna, "default_motion_model", PROP_ENUM, PROP_NONE);
@@ -952,7 +952,7 @@ static void rna_def_trackingTrack(BlenderRNA *brna)
RNA_def_property_int_sdna(prop, NULL, "margin");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_range(prop, 0, 300);
- RNA_def_property_ui_text(prop, "Margin", "Distance from image boudary at which marker stops tracking");
+ RNA_def_property_ui_text(prop, "Margin", "Distance from image boundary at which marker stops tracking");
/* tracking motion model */
prop = RNA_def_property(srna, "motion_model", PROP_ENUM, PROP_NONE);
@@ -1170,7 +1170,7 @@ static void rna_def_trackingStabilization(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_AUTOSCALE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Autoscale",
- "Automatically scale footage to cover unfilled areas when stabilizating");
+ "Automatically scale footage to cover unfilled areas when stabilizing");
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
/* max scale */
@@ -1242,7 +1242,7 @@ static void rna_def_reconstructedCamera(BlenderRNA *brna)
prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "error");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Average Error", "Average error of resonctruction");
+ RNA_def_property_ui_text(prop, "Average Error", "Average error of reconstruction");
}
static void rna_def_trackingReconstruction(BlenderRNA *brna)
@@ -1266,7 +1266,7 @@ static void rna_def_trackingReconstruction(BlenderRNA *brna)
prop = RNA_def_property(srna, "average_error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "error");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Average Error", "Average error of resonctruction");
+ RNA_def_property_ui_text(prop, "Average Error", "Average error of reconstruction");
/* cameras */
prop = RNA_def_property(srna, "cameras", PROP_COLLECTION, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 7c9cb04b66a..70d94bfc7ed 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -617,7 +617,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 grayed 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");
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 99d5d5ca462..b4703c06eb7 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -463,7 +463,7 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
prop = RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
+ RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in gray value");
RNA_def_property_update(prop, 0, "rna_userdef_update");
}
@@ -2103,7 +2103,7 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna)
prop = RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "marker_outline");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Marker Outline Color", "Color of marker's outile");
+ RNA_def_property_ui_text(prop, "Marker Outline Color", "Color of marker's outline");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
@@ -2766,7 +2766,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
RNA_def_property_ui_text(prop, "New Interpolation Type",
"Interpolation mode used for first keyframe on newly added F-Curves "
- "(subsequent keyframes take interpolation from preceeding keyframe)");
+ "(subsequent keyframes take interpolation from preceding keyframe)");
prop = RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, keyframe_handle_type_items);
@@ -2989,10 +2989,12 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{ 1, "ENGLISH", 0, "English (English)", "en_US"},
{ 8, "FRENCH", 0, "French (Français)", "fr_FR"},
{ 4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"},
+ { 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
{15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"},
{13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"},
{ 9, "SPANISH", 0, "Spanish (Español)", "es"},
{14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"},
+ {18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
{ 0, "", 0, N_("In progress"), ""},
/* using the utf8 flipped form of Arabic (العربية) */
{21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"},
@@ -3006,7 +3008,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
{31, "HUNGARIAN", 0, "Hungarian (magyar)", "hu_HU"},
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
- { 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
{29, "KYRGYZ", 0, "Kyrgyz (Кыргыз тили)", "ky_KG"},
/* {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"}, */ /* XXX No po's yet. */
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
@@ -3019,7 +3020,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{28, "SERBIAN_LATIN", 0, "Serbian latin (Srpski latinica)", "sr_RS@latin"},
{ 7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
{30, "TURKISH", 0, "Turkish (Türkçe)", "tr_TR"},
- {18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
{ 0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 8c6a2809ef8..61c75e306cb 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -183,7 +183,7 @@ EnumPropertyItem event_type_items[] = {
{SELECTMOUSE, "SELECTMOUSE", 0, "Select Mouse", ""},
{0, "", 0, NULL, NULL},
{MOUSEMOVE, "MOUSEMOVE", 0, "Mouse Move", ""},
- {INBETWEEN_MOUSEMOVE, "INBETWEEN_MOUSEMOVE", 0, "Inbetween Move", ""},
+ {INBETWEEN_MOUSEMOVE, "INBETWEEN_MOUSEMOVE", 0, "In-between Move", ""},
{MOUSEPAN, "TRACKPADPAN", 0, "Mouse/Trackpad Pan", ""},
{MOUSEZOOM, "TRACKPADZOOM", 0, "Mouse/Trackpad Zoom", ""},
{MOUSEROTATE, "MOUSEROTATE", 0, "Mouse/Trackpad Rotate", ""},
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index cec66831916..a84b1124d44 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -316,7 +316,7 @@ static void rna_def_lighting(BlenderRNA *brna)
prop = RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes");
RNA_def_property_range(prop, 0, 10);
- RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion");
+ RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce over-occlusion");
RNA_def_property_update(prop, 0, "rna_World_update");
prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c
index 82ab8db9c36..74026efecc5 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.c
+++ b/source/blender/modifiers/intern/MOD_particleinstance.c
@@ -114,15 +114,14 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
ParticleSimulationData sim;
ParticleSystem *psys = NULL;
ParticleData *pa = NULL, *pars = NULL;
- MFace *mface, *orig_mface;
+ MPoly *mpoly, *orig_mpoly;
+ MLoop *mloop, *orig_mloop;
MVert *mvert, *orig_mvert;
- int i, totvert, totpart = 0, totface, maxvert, maxface, first_particle = 0;
+ int i, totvert, totpoly, totloop, maxvert, maxpoly, maxloop, totpart = 0, first_particle = 0;
short track = ob->trackflag % 3, trackneg, axis = pimd->axis;
float max_co = 0.0, min_co = 0.0, temp_co[3], cross[3];
float *size = NULL;
- DM_ensure_tessface(dm); /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */
-
trackneg = ((ob->trackflag > 2) ? 1 : 0);
if (pimd->ob == ob) {
@@ -175,15 +174,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
pars = psys->particles;
totvert = dm->getNumVerts(dm);
- totface = dm->getNumTessFaces(dm);
+ totpoly = dm->getNumPolys(dm);
+ totloop = dm->getNumLoops(dm);
maxvert = totvert * totpart;
- maxface = totface * totpart;
+ maxpoly = totpoly * totpart;
+ maxloop = totloop * totpart;
psys->lattice = psys_get_lattice(&sim);
if (psys->flag & (PSYS_HAIR_DONE | PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) {
-
float min_r[3], max_r[3];
INIT_MINMAX(min_r, max_r);
dm->getMinMax(dm, min_r, max_r);
@@ -191,7 +191,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
max_co = max_r[track];
}
- result = CDDM_from_template(dm, maxvert, dm->getNumEdges(dm) * totpart, maxface, 0, 0);
+ result = CDDM_from_template(dm, maxvert, dm->getNumEdges(dm) * totpart, 0, maxloop, maxpoly);
mvert = result->getVertArray(result);
orig_mvert = dm->getVertArray(dm);
@@ -263,29 +263,31 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
add_v3_v3(mv->co, state.co);
}
- mface = result->getTessFaceArray(result);
- orig_mface = dm->getTessFaceArray(dm);
+ mpoly = result->getPolyArray(result);
+ orig_mpoly = dm->getPolyArray(dm);
+ mloop = result->getLoopArray(result);
+ orig_mloop = dm->getLoopArray(dm);
- for (i = 0; i < maxface; i++) {
- MFace *inMF;
- MFace *mf = mface + i;
+ for (i = 0; i < maxpoly; i++) {
+ MPoly *inMP = orig_mpoly + i % totpoly;
+ MPoly *mp = mpoly + i;
if (pimd->flag & eParticleInstanceFlag_Parents) {
- if (i / totface >= psys->totpart) {
+ if (i / totpoly >= psys->totpart) {
if (psys->part->childtype == PART_CHILD_PARTICLES) {
- pa = psys->particles + (psys->child + i / totface - psys->totpart)->parent;
+ pa = psys->particles + (psys->child + i / totpoly - psys->totpart)->parent;
}
else {
pa = NULL;
}
}
else {
- pa = pars + i / totface;
+ pa = pars + i / totpoly;
}
}
else {
if (psys->part->childtype == PART_CHILD_PARTICLES) {
- pa = psys->particles + (psys->child + i / totface)->parent;
+ pa = psys->particles + (psys->child + i / totpoly)->parent;
}
else {
pa = NULL;
@@ -298,19 +300,23 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (pa->alive == PARS_DEAD && (pimd->flag & eParticleInstanceFlag_Dead) == 0) continue;
}
- inMF = orig_mface + i % totface;
- DM_copy_poly_data(dm, result, i % totface, i, 1);
- *mf = *inMF;
+ DM_copy_poly_data(dm, result, i % totpoly, i, 1);
+ *mp = *inMP;
+ mp->loopstart += (i / totpoly) * totloop;
- mf->v1 += (i / totface) * totvert;
- mf->v2 += (i / totface) * totvert;
- mf->v3 += (i / totface) * totvert;
- if (mf->v4) {
- mf->v4 += (i / totface) * totvert;
+ {
+ MLoop *inML = orig_mloop + inMP->loopstart;
+ MLoop *ml = mloop + mp->loopstart;
+ int j = mp->totloop;
+
+ DM_copy_loop_data(dm, result, inMP->loopstart, mp->loopstart, j);
+ for (; j; j--, ml++, inML++) {
+ ml->v = inML->v + ((i / totpoly) * totvert);
+ }
}
}
- CDDM_calc_edges_tessface(result);
+ CDDM_calc_edges(result);
if (psys->lattice) {
end_latt_deform(psys->lattice);
@@ -320,7 +326,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (size)
MEM_freeN(size);
- CDDM_tessfaces_to_faces(result); /*builds ngon faces from tess (mface) faces*/
CDDM_calc_normals(result);
return result;
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index 72112180bc8..b9acf821efe 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -118,7 +118,6 @@ static void update_node(bNodeTree *ntree, bNode *node)
}
}
node->need_exec= 1;
-
/* individual node update call */
if (node->typeinfo->updatefunc)
node->typeinfo->updatefunc(ntree, node);
@@ -133,6 +132,7 @@ static void localize(bNodeTree *localtree, bNodeTree *ntree)
for (node= ntree->nodes.first; node; node= node->next) {
/* ensure new user input gets handled ok */
node->need_exec= 0;
+ node->new_node->original = node;
/* move over the compbufs */
/* right after ntreeCopyTree() oldsock pointers are valid */
@@ -200,6 +200,7 @@ static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
lnode->new_node->preview= lnode->preview;
lnode->preview= NULL;
}
+
}
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
index 33e6de8ea6e..53061366b8b 100644
--- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c
@@ -48,10 +48,10 @@ static bNodeSocketTemplate cmp_node_diff_matte_out[]={
static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *inColor2)
{
NodeChroma *c= (NodeChroma *)node->storage;
- float tolerence=c->t1;
+ float tolerance=c->t1;
float fper=c->t2;
- /* get falloff amount over tolerence size */
- float falloff=(1.0f-fper) * tolerence;
+ /* get falloff amount over tolerance size */
+ float falloff=(1.0f-fper) * tolerance;
float difference;
float alpha;
float maxInputAlpha;
@@ -64,13 +64,13 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float *
copy_v3_v3(outColor, inColor1);
- if (difference <= tolerence) {
+ if (difference <= tolerance) {
if (difference <= falloff) {
alpha = 0.0f;
}
else {
/* alpha as percent (distance / tolerance), each modified by falloff amount (in pixels)*/
- alpha=(difference-falloff)/(tolerence-falloff);
+ alpha=(difference-falloff)/(tolerance-falloff);
}
/*only change if more transparent than either image */
diff --git a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
index f365ee58f59..86634487776 100644
--- a/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
@@ -50,10 +50,10 @@ static bNodeSocketTemplate cmp_node_distance_matte_out[]={
static void do_distance_matte(bNode *node, float *out, float *in)
{
NodeChroma *c= (NodeChroma *)node->storage;
- float tolerence=c->t1;
+ float tolerance=c->t1;
float fper=c->t2;
- /* get falloff amount over tolerence size */
- float falloff=(1.0f-fper) * tolerence;
+ /* get falloff amount over tolerance size */
+ float falloff=(1.0f-fper) * tolerance;
float distance;
float alpha;
@@ -63,13 +63,13 @@ static void do_distance_matte(bNode *node, float *out, float *in)
copy_v3_v3(out, in);
- if (distance <= tolerence) {
+ if (distance <= tolerance) {
if (distance <= falloff) {
alpha = 0.0f;
}
else {
/* alpha as percent (distance / tolerance), each modified by falloff amount (in pixels)*/
- alpha=(distance-falloff)/(tolerence-falloff);
+ alpha=(distance-falloff)/(tolerance-falloff);
}
/*only change if more transparent than before */
@@ -88,10 +88,10 @@ static void do_distance_matte(bNode *node, float *out, float *in)
static void do_chroma_distance_matte(bNode *node, float *out, float *in)
{
NodeChroma *c= (NodeChroma *)node->storage;
- float tolerence=c->t1;
+ float tolerance=c->t1;
float fper=c->t2;
- /* get falloff amount over tolerence size */
- float falloff=(1.0f-fper) * tolerence;
+ /* get falloff amount over tolerance size */
+ float falloff=(1.0f-fper) * tolerance;
float y_key, cb_key, cr_key;
float y_pix, cb_pix, cr_pix;
float distance;
@@ -114,13 +114,13 @@ static void do_chroma_distance_matte(bNode *node, float *out, float *in)
copy_v3_v3(out, in);
- if (distance <= tolerence) {
+ if (distance <= tolerance) {
if (distance <= falloff) {
alpha = 0.0f;
}
else {
/* alpha as percent (distance / tolerance), each modified by falloff amount (in pixels)*/
- alpha=(distance-falloff)/(tolerence-falloff);
+ alpha=(distance-falloff)/(tolerance-falloff);
}
/*only change if more transparent than before */
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c
index b5400244efe..8b393dd740a 100644
--- a/source/blender/nodes/intern/node_socket.c
+++ b/source/blender/nodes/intern/node_socket.c
@@ -319,7 +319,7 @@ void node_socket_copy_default_value(int type, void *to_default_value, void *from
* In the interface this could be implemented by a pseudo-script textbox on linked inputs,
* with quick selection from a predefined list of conversion options. Some Examples:
* - vector component 'z' (vector->float): "z"
- * - greyscale color (float->color): "grey"
+ * - grayscale color (float->color): "gray"
* - color luminance (color->float): "lum"
* - matrix column 2 length (matrix->vector->float): "col[1].len"
* - mesh vertex coordinate 'y' (mesh->vertex->vector->float): "vertex.co.y"
diff --git a/source/blender/nodes/texture/nodes/node_texture_viewer.c b/source/blender/nodes/texture/nodes/node_texture_viewer.c
index 03a94d1df67..bc31bef59d8 100644
--- a/source/blender/nodes/texture/nodes/node_texture_viewer.c
+++ b/source/blender/nodes/texture/nodes/node_texture_viewer.c
@@ -34,11 +34,11 @@
#include "NOD_texture.h"
#include <math.h>
-static bNodeSocketTemplate inputs[]= {
+static bNodeSocketTemplate inputs[] = {
{ SOCK_RGBA, 1, N_("Color"), 1.0f, 0.0f, 0.0f, 1.0f },
{ -1, 0, "" }
};
-static bNodeSocketTemplate outputs[]= {
+static bNodeSocketTemplate outputs[] = {
{ -1, 0, "" }
};
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index b2fd1d3d61c..f3e5b300ced 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -73,7 +73,7 @@ PyDoc_STRVAR(bpy_bm_from_edit_mesh_doc,
"\n"
" Return a BMesh from this mesh, currently the mesh must already be in editmode.\n"
"\n"
-" :return: the BMesh assosiated with this mesh.\n"
+" :return: the BMesh associated with this mesh.\n"
" :rtype: :class:`bmesh.types.BMesh`\n"
);
static PyObject *bpy_bm_from_edit_mesh(PyObject *UNUSED(self), PyObject *value)
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 053dac71fe6..f7a7d379ba4 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -1024,7 +1024,7 @@ PyDoc_STRVAR(bpy_bm_elem_select_set_doc,
".. method:: select_set(select)\n"
"\n"
" Set the selection.\n"
-" This is different from the *select* attribute because it updates the selection state of assosiated geometry.\n"
+" This is different from the *select* attribute because it updates the selection state of associated geometry.\n"
"\n"
" :arg select: Select or de-select.\n"
" :type select: boolean\n"
@@ -1057,7 +1057,7 @@ PyDoc_STRVAR(bpy_bm_elem_hide_set_doc,
".. method:: hide_set(hide)\n"
"\n"
" Set the hide state.\n"
-" This is different from the *hide* attribute because it updates the selection and hide state of assosiated geometry.\n"
+" This is different from the *hide* attribute because it updates the selection and hide state of associated geometry.\n"
"\n"
" :arg hide: Hidden or visible.\n"
" :type hide: boolean\n"
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 04f9a90f0d2..4bba7ba6838 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -873,7 +873,7 @@ static PyObject *pyrna_struct_repr(BPy_StructRNA *self)
if (path) {
if (GS(id->name) == ID_NT) { /* nodetree paths are not accurate */
ret = PyUnicode_FromFormat("bpy.data...%s",
- path);
+ path);
}
else {
ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s",
@@ -980,7 +980,7 @@ static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self)
if (path) {
if (GS(id->name) == ID_NT) { /* nodetree paths are not accurate */
ret = PyUnicode_FromFormat("bpy.data...%s",
- path);
+ path);
}
else {
ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s",
@@ -2040,12 +2040,12 @@ static int pyrna_prop_collection_bool(BPy_PropertyRNA *self)
* This is done for faster lookups. */
#define PYRNA_PROP_COLLECTION_ABS_INDEX(ret_err) \
if (keynum < 0) { \
- keynum_abs += RNA_property_collection_length(&self->ptr, self->prop); \
- if (keynum_abs < 0) { \
- PyErr_Format(PyExc_IndexError, \
- "bpy_prop_collection[%d]: out of range.", keynum); \
- return ret_err; \
- } \
+ keynum_abs += RNA_property_collection_length(&self->ptr, self->prop); \
+ if (keynum_abs < 0) { \
+ PyErr_Format(PyExc_IndexError, \
+ "bpy_prop_collection[%d]: out of range.", keynum); \
+ return ret_err; \
+ } \
} (void)0
@@ -3508,8 +3508,8 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
PyList_Append(ret, linkptr);
Py_DECREF(linkptr);
}
+ break;
}
- break;
default:
/* should never happen */
BLI_assert(!"Invalid context type");
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 5c4c6414f39..5f372abcc69 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -1640,7 +1640,7 @@ static PyObject *Matrix_richcmpr(PyObject *a, PyObject *b, int op)
* sequence length */
static int Matrix_len(MatrixObject *self)
{
- return (self->num_row);
+ return self->num_row;
}
/*----------------------------object[]---------------------------
* sequence accessor (get)
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index 5bb3e4605a2..e3eab0c3b34 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -173,12 +173,16 @@ RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w,
disprect.ymax = y + h;
result = render_result_new(re, &disprect, 0, RR_USE_MEM);
- BLI_addtail(&engine->fullresult, result);
-
- result->tilerect.xmin += re->disprect.xmin;
- result->tilerect.xmax += re->disprect.xmin;
- result->tilerect.ymin += re->disprect.ymin;
- result->tilerect.ymax += re->disprect.ymin;
+
+ /* can be NULL if we CLAMP the width or height to 0 */
+ if (result) {
+ BLI_addtail(&engine->fullresult, result);
+
+ result->tilerect.xmin += re->disprect.xmin;
+ result->tilerect.xmax += re->disprect.xmin;
+ result->tilerect.ymin += re->disprect.ymin;
+ result->tilerect.ymax += re->disprect.ymin;
+ }
return result;
}
diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c
index 745ce77bdda..3fd59b5e67c 100644
--- a/source/blender/render/intern/source/render_result.c
+++ b/source/blender/render/intern/source/render_result.c
@@ -1044,7 +1044,7 @@ ImBuf *render_result_rect_to_ibuf(RenderResult *rr, RenderData *rd)
}
}
- /* color -> greyscale */
+ /* color -> grayscale */
/* editing directly would alter the render view */
if (rd->im_format.planes == R_IMF_PLANES_BW) {
ImBuf *ibuf_bw = IMB_dupImBuf(ibuf);
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index b75b9e5bf1f..c2e21af4ad2 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -798,7 +798,6 @@ static float OrenNayar_Diff(float nl, const float n[3], const float l[3], const
/* Minnaert diffuse */
static float Minnaert_Diff(float nl, const float n[3], const float v[3], float darkness)
{
-
float i, nv;
/* nl = dot product between surface normal and light vector */
@@ -806,12 +805,12 @@ static float Minnaert_Diff(float nl, const float n[3], const float v[3], float d
return 0.0f;
/* nv = dot product between surface normal and view vector */
- nv = n[0]*v[0]+n[1]*v[1]+n[2]*v[2];
+ nv = dot_v3v3(n, v);
if (nv < 0.0f)
nv = 0.0f;
if (darkness <= 1.0f)
- i = nl * pow(MAX2(nv*nl, 0.1f), (darkness - 1.0f) ); /*The Real model*/
+ i = nl * pow(maxf(nv * nl, 0.1f), (darkness - 1.0f) ); /*The Real model*/
else
i = nl * pow( (1.001f - nv), (darkness - 1.0f) ); /*Nvidia model*/
diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c
index 161725386c5..71d074e340f 100644
--- a/source/blender/windowmanager/intern/wm_apple.c
+++ b/source/blender/windowmanager/intern/wm_apple.c
@@ -41,7 +41,7 @@
#include <Carbon/Carbon.h>
/* To avoid killing small end comps, we want to allow
- * blender to start maximised if all the followings are true :
+ * blender to start maximized if all the followings are true :
* - Renderer is OpenGL capable
* - Hardware acceleration
* - VRAM > 16 Mo
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index e4b7d1c5d5f..b280b979280 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -224,7 +224,7 @@ static void wm_gesture_draw_circle(wmGesture *gt)
glutil_draw_lined_arc(0.0, M_PI * 2.0, rect->xmax, 40);
glDisable(GL_LINE_STIPPLE);
- glTranslatef((float)-rect->xmin, (float)-rect->ymin, 0.0f);
+ glTranslatef(-rect->xmin, -rect->ymin, 0.0f);
}
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index dd501e6d880..28e50f1655e 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -368,7 +368,7 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
if (win->eventstate == NULL)
win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
- /* until screens get drawn, make it nice grey */
+ /* until screens get drawn, make it nice gray */
glClearColor(0.55, 0.55, 0.55, 0.0);
/* Crash on OSS ATI: bugs.launchpad.net/ubuntu/+source/mesa/+bug/656100 */
if (!GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) {
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index fb53dc1a25e..2b98940e128 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -552,9 +552,20 @@ elseif(WIN32)
)
elseif(WITH_MINGW64)
install(
- FILES ${LIBDIR}/binaries/pthreadGC2-w64.dll
+ FILES
+ ${LIBDIR}/binaries/libgcc_s_sjlj-1.dll
+ ${LIBDIR}/binaries/libwinpthread-1.dll
+ ${LIBDIR}/binaries/libstdc++-6.dll
DESTINATION ${TARGETDIR}
)
+
+ if(WITH_OPENMP)
+ install(
+ FILES
+ ${LIBDIR}/binaries/libgomp-1.dll
+ DESTINATION ${TARGETDIR}
+ )
+ endif()
endif()
endif()
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
index 46ebd0ecc4f..ea4ac1e150b 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
@@ -311,7 +311,7 @@ int SCA_Joystick::pAxisTest(int axisnum)
short i2= m_axis_array[(axisnum*2)+1];
/* long winded way to do
- * return MAX2(abs(i1), abs(i2))
+ * return maxf(absf(i1), absf(i2))
* avoid abs from math.h */
if (i1 < 0) i1 = -i1;
if (i2 < 0) i2 = -i2;
diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
index a92ffac4129..5dd4cc501ca 100644
--- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
@@ -57,8 +57,7 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr,
m_checktype(checktype),
m_checkpropval(propval),
m_checkpropmaxval(propmaxval),
- m_checkpropname(propname),
- m_range_expr(NULL)
+ m_checkpropname(propname)
{
//CParser pars;
//pars.SetContext(this->AddRef());
@@ -71,10 +70,6 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr,
}
orgprop->Release();
- if (m_checktype==KX_PROPSENSOR_INTERVAL)
- {
- PrecalculateRangeExpression();
- }
Init();
}
@@ -85,45 +80,12 @@ void SCA_PropertySensor::Init()
m_reset = true;
}
-void SCA_PropertySensor::PrecalculateRangeExpression()
-{
- CParser pars;
- //The context is needed to retrieve the property at runtime but it creates
- //loop of references
- pars.SetContext(this->AddRef());
- STR_String checkstr = ("(" + m_checkpropval + " <= " +
- m_checkpropname + ") && ( " +
- m_checkpropname + " <= " +
- m_checkpropmaxval + ")");
-
- m_range_expr = pars.ProcessText(checkstr);
-}
-
-// Forced deletion of precalculated range expression to break reference loop
-// Use this function when you know that you won't use the sensor anymore
-void SCA_PropertySensor::Delete()
-{
- if (m_range_expr)
- {
- m_range_expr->Release();
- m_range_expr = NULL;
- }
- Release();
-}
-
CValue* SCA_PropertySensor::GetReplica()
{
SCA_PropertySensor* replica = new SCA_PropertySensor(*this);
// m_range_expr must be recalculated on replica!
replica->ProcessReplica();
replica->Init();
-
- replica->m_range_expr = NULL;
- if (replica->m_checktype==KX_PROPSENSOR_INTERVAL)
- {
- replica->PrecalculateRangeExpression();
- }
-
return replica;
}
@@ -143,15 +105,6 @@ bool SCA_PropertySensor::IsPositiveTrigger()
SCA_PropertySensor::~SCA_PropertySensor()
{
- //if (m_rightexpr)
- // m_rightexpr->Release();
-
- if (m_range_expr)
- {
- m_range_expr->Release();
- m_range_expr=NULL;
- }
-
}
@@ -241,34 +194,13 @@ bool SCA_PropertySensor::CheckPropertyCondition()
}
case KX_PROPSENSOR_INTERVAL:
{
- //CValue* orgprop = GetParent()->FindIdentifier(m_checkpropname);
- //if (orgprop)
- //{
- if (m_range_expr)
- {
- CValue* vallie = m_range_expr->Calculate();
- if (vallie)
- {
- const STR_String& errtext = vallie->GetText();
- if (&errtext == &CBoolValue::sTrueString)
- {
- result = true;
- } else
- {
- if (vallie->IsError())
- {
- //printf (errtext.ReadPtr());
- }
- }
-
- vallie->Release();
- }
- }
+ CValue* orgprop = GetParent()->FindIdentifier(m_checkpropname);
+ if (!orgprop->IsError())
+ {
+ float val = orgprop->GetText().ToFloat(), min = m_checkpropval.ToFloat(), max = m_checkpropmaxval.ToFloat();
-
- //}
-
- //cout << " \nSens:Prop:interval!"; /* need implementation here!!! */
+ result = (min <= val) && (val <= max);
+ }
break;
}
@@ -326,28 +258,6 @@ int SCA_PropertySensor::validValueForProperty(void *self, const PyAttributeDef*)
return 0;
}
-int SCA_PropertySensor::validValueForIntervalProperty(void *self, const PyAttributeDef*)
-{
- SCA_PropertySensor* sensor = reinterpret_cast<SCA_PropertySensor*>(self);
-
- if (sensor->m_checktype==KX_PROPSENSOR_INTERVAL)
- {
- sensor->PrecalculateRangeExpression();
- }
- return 0;
-}
-
-int SCA_PropertySensor::modeChange(void *self, const PyAttributeDef* attrdef)
-{
- SCA_PropertySensor* sensor = reinterpret_cast<SCA_PropertySensor*>(self);
-
- if (sensor->m_checktype==KX_PROPSENSOR_INTERVAL)
- {
- sensor->PrecalculateRangeExpression();
- }
- return 0;
-}
-
/* Integration hooks ------------------------------------------------------- */
PyTypeObject SCA_PropertySensor::Type = {
PyVarObject_HEAD_INIT(NULL, 0)
@@ -376,11 +286,11 @@ PyMethodDef SCA_PropertySensor::Methods[] = {
};
PyAttributeDef SCA_PropertySensor::Attributes[] = {
- KX_PYATTRIBUTE_INT_RW_CHECK("mode",KX_PROPSENSOR_NODEF,KX_PROPSENSOR_MAX-1,false,SCA_PropertySensor,m_checktype,modeChange),
+ KX_PYATTRIBUTE_INT_RW("mode",KX_PROPSENSOR_NODEF,KX_PROPSENSOR_MAX-1,false,SCA_PropertySensor,m_checktype),
KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,MAX_PROP_NAME,false,SCA_PropertySensor,m_checkpropname,CheckProperty),
KX_PYATTRIBUTE_STRING_RW_CHECK("value",0,100,false,SCA_PropertySensor,m_checkpropval,validValueForProperty),
- KX_PYATTRIBUTE_STRING_RW_CHECK("min",0,100,false,SCA_PropertySensor,m_checkpropval,validValueForIntervalProperty),
- KX_PYATTRIBUTE_STRING_RW_CHECK("max",0,100,false,SCA_PropertySensor,m_checkpropmaxval,validValueForIntervalProperty),
+ KX_PYATTRIBUTE_STRING_RW_CHECK("min",0,100,false,SCA_PropertySensor,m_checkpropval,validValueForProperty),
+ KX_PYATTRIBUTE_STRING_RW_CHECK("max",0,100,false,SCA_PropertySensor,m_checkpropmaxval,validValueForProperty),
{ NULL } //Sentinel
};
diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h
index ca942076efa..fee03dcf4c0 100644
--- a/source/gameengine/GameLogic/SCA_PropertySensor.h
+++ b/source/gameengine/GameLogic/SCA_PropertySensor.h
@@ -46,7 +46,6 @@ class SCA_PropertySensor : public SCA_ISensor
STR_String m_previoustext;
bool m_lastresult;
bool m_recentresult;
- CExpression* m_range_expr;
protected:
@@ -69,16 +68,10 @@ public:
const STR_String& propval,
const STR_String& propmaxval,
KX_PROPSENSOR_TYPE checktype);
-
- /**
- * For property sensor, it is used to release the pre-calculated expression
- * so that self references are removed before the sensor itself is released
- */
- virtual void Delete();
+
virtual ~SCA_PropertySensor();
virtual CValue* GetReplica();
virtual void Init();
- void PrecalculateRangeExpression();
bool CheckPropertyCondition();
virtual bool Evaluate();
@@ -96,16 +89,6 @@ public:
*/
static int validValueForProperty(void* self, const PyAttributeDef*);
- /**
- * Test whether this is a sensible value for interval (type check) and updates Range Expression
- */
- static int validValueForIntervalProperty(void* self, const PyAttributeDef*);
-
- /**
- * Test if the new mode is interval. If positive updates Range Expression
- */
- static int modeChange(void* self, const PyAttributeDef* attrdef);
-
#endif
};
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index f149b676aa5..d87bb937b41 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -469,7 +469,7 @@ bool KX_Dome::ParseWarpMesh(STR_String text)
* First line is the image type the mesh is support to be applied to: 2 = fisheye, 1=radial
* Tthe next line has the mesh dimensions
* Rest of the lines are the nodes of the mesh. Each line has x y u v i
- * (x,y) are the normalised screen coordinates
+ * (x,y) are the normalized screen coordinates
* (u,v) texture coordinates
* i a multiplicative intensity factor
*
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index 04113607531..21c3198b8f9 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -603,7 +603,7 @@ else
/* Suspension holds the physics and logic processing for an
* entire scene. Objects can be suspended individually, and
- * the settings for that preceed the logic and physics
+ * the settings for that precede the logic and physics
* update. */
m_logger->StartLog(tc_logic, m_kxsystem->GetTimeInSeconds(), true);
diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
index fd47587e2c8..a942f87856c 100644
--- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
+++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
@@ -378,13 +378,14 @@ static MT_Point3 nearestPointToObstacle(MT_Point3& pos ,KX_Obstacle* obstacle)
MT_Vector3 ab = obstacle->m_pos2 - obstacle->m_pos;
if (!ab.fuzzyZero())
{
+ const MT_Scalar dist = ab.length();
MT_Vector3 abdir = ab.normalized();
MT_Vector3 v = pos - obstacle->m_pos;
MT_Scalar proj = abdir.dot(v);
- CLAMP(proj, 0, ab.length());
+ CLAMP(proj, 0, dist);
MT_Point3 res = obstacle->m_pos + abdir*proj;
return res;
- }
+ }
}
case KX_OBSTACLE_CIRCLE :
default:
diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp
index 91f6224e197..db91cea9074 100644
--- a/source/gameengine/Ketsji/KX_SoundActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp
@@ -433,7 +433,7 @@ PyObject* KX_SoundActuator::pyattr_get_sound(void *self, const struct KX_PYATTRI
{
KX_SoundActuator * actuator = static_cast<KX_SoundActuator *> (self);
if (!actuator->m_sound.isNull())
- return AUD_getPythonFactory(&actuator->m_sound);
+ return (PyObject *)AUD_getPythonFactory(&actuator->m_sound);
else
Py_RETURN_NONE;
}
@@ -547,7 +547,7 @@ int KX_SoundActuator::pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_D
if (!PyArg_Parse(value, "O", &sound))
return PY_SET_ATTR_FAIL;
- AUD_Reference<AUD_IFactory>* snd = reinterpret_cast<AUD_Reference<AUD_IFactory>*>(AUD_getPythonSound(sound));
+ AUD_Reference<AUD_IFactory>* snd = reinterpret_cast<AUD_Reference<AUD_IFactory>*>(AUD_getPythonSound((void *)sound));
if (snd)
{
actuator->m_sound = *snd;
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index 43acb9e5f8a..cf6ea653402 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -431,7 +431,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
// reverting to texunit 0, without this we get bug [#28462]
glActiveTextureARB(GL_TEXTURE0);
- glViewport(rect.GetLeft(), rect.GetBottom(), texturewidth, textureheight);
+ glViewport(rect.GetLeft(), rect.GetBottom(), rect.GetWidth()+1, rect.GetHeight()+1);
glDisable(GL_DEPTH_TEST);
// in case the previous material was wire
diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h
index e0d5c712b73..339862c652f 100644
--- a/source/gameengine/SceneGraph/SG_Tree.h
+++ b/source/gameengine/SceneGraph/SG_Tree.h
@@ -122,7 +122,7 @@ public:
/**
* SG_TreeFactory generates an SG_Tree from a list of SG_Nodes.
- * It joins pairs of SG_Nodes to minimise the size of the resultant
+ * It joins pairs of SG_Nodes to minimize the size of the resultant
* bounding box.
* cf building an optimized Huffman tree.
* \warning O(n^3)!!!