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:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/alembic/intern/abc_archive.h2
-rw-r--r--source/blender/alembic/intern/abc_curves.cc2
-rw-r--r--source/blender/alembic/intern/abc_customdata.cc10
-rw-r--r--source/blender/alembic/intern/abc_exporter.cc2
-rw-r--r--source/blender/alembic/intern/abc_exporter.h2
-rw-r--r--source/blender/alembic/intern/abc_hair.cc2
-rw-r--r--source/blender/alembic/intern/abc_nurbs.cc4
-rw-r--r--source/blender/alembic/intern/abc_points.cc8
-rw-r--r--source/blender/alembic/intern/abc_util.h4
-rw-r--r--source/blender/alembic/intern/alembic_capi.cc6
-rw-r--r--source/blender/avi/intern/avi.c10
-rw-r--r--source/blender/blenkernel/BKE_action.h2
-rw-r--r--source/blender/blenkernel/BKE_armature.h2
-rw-r--r--source/blender/blenkernel/BKE_bvhutils.h2
-rw-r--r--source/blender/blenkernel/BKE_ccg.h1
-rw-r--r--source/blender/blenkernel/BKE_constraint.h18
-rw-r--r--source/blender/blenkernel/BKE_customdata.h2
-rw-r--r--source/blender/blenkernel/BKE_dynamicpaint.h2
-rw-r--r--source/blender/blenkernel/BKE_editmesh.h2
-rw-r--r--source/blender/blenkernel/BKE_gpencil.h2
-rw-r--r--source/blender/blenkernel/BKE_library_query.h2
-rw-r--r--source/blender/blenkernel/BKE_particle.h4
-rw-r--r--source/blender/blenkernel/BKE_pbvh.h2
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h2
-rw-r--r--source/blender/blenkernel/BKE_unit.h2
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c1
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_intern.h2
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c12
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c36
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c8
-rw-r--r--source/blender/blenkernel/intern/action.c2
-rw-r--r--source/blender/blenkernel/intern/anim.c2
-rw-r--r--source/blender/blenkernel/intern/appdir.c117
-rw-r--r--source/blender/blenkernel/intern/armature.c4
-rw-r--r--source/blender/blenkernel/intern/bmfont.c2
-rw-r--r--source/blender/blenkernel/intern/boids.c2
-rw-r--r--source/blender/blenkernel/intern/brush.c4
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c2
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c22
-rw-r--r--source/blender/blenkernel/intern/cloth.c21
-rw-r--r--source/blender/blenkernel/intern/collision.c15
-rw-r--r--source/blender/blenkernel/intern/constraint.c2
-rw-r--r--source/blender/blenkernel/intern/context.c2
-rw-r--r--source/blender/blenkernel/intern/curve.c6
-rw-r--r--source/blender/blenkernel/intern/customdata.c2
-rw-r--r--source/blender/blenkernel/intern/data_transfer.c2
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c38
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c2
-rw-r--r--source/blender/blenkernel/intern/effect.c394
-rw-r--r--source/blender/blenkernel/intern/fcurve.c4
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c4
-rw-r--r--source/blender/blenkernel/intern/font.c4
-rw-r--r--source/blender/blenkernel/intern/icons.c18
-rw-r--r--source/blender/blenkernel/intern/image.c6
-rw-r--r--source/blender/blenkernel/intern/ipo.c2
-rw-r--r--source/blender/blenkernel/intern/lattice.c4
-rw-r--r--source/blender/blenkernel/intern/library.c2
-rw-r--r--source/blender/blenkernel/intern/library_remap.c2
-rw-r--r--source/blender/blenkernel/intern/mask_rasterize.c6
-rw-r--r--source/blender/blenkernel/intern/material.c4
-rw-r--r--source/blender/blenkernel/intern/mesh.c12
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.c6
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c16
-rw-r--r--source/blender/blenkernel/intern/mesh_mapping.c2
-rw-r--r--source/blender/blenkernel/intern/mesh_remap.c20
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c18
-rw-r--r--source/blender/blenkernel/intern/modifier.c4
-rw-r--r--source/blender/blenkernel/intern/modifiers_bmesh.c2
-rw-r--r--source/blender/blenkernel/intern/multires.c4
-rw-r--r--source/blender/blenkernel/intern/nla.c10
-rw-r--r--source/blender/blenkernel/intern/node.c2
-rw-r--r--source/blender/blenkernel/intern/object.c16
-rw-r--r--source/blender/blenkernel/intern/object_deform.c2
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c4
-rw-r--r--source/blender/blenkernel/intern/packedFile.c4
-rw-r--r--source/blender/blenkernel/intern/particle.c14
-rw-r--r--source/blender/blenkernel/intern/particle_system.c12
-rw-r--r--source/blender/blenkernel/intern/pbvh.c26
-rw-r--r--source/blender/blenkernel/intern/pbvh_intern.h2
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/blenkernel/intern/report.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c18
-rw-r--r--source/blender/blenkernel/intern/sequencer.c30
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c2
-rw-r--r--source/blender/blenkernel/intern/smoke.c10
-rw-r--r--source/blender/blenkernel/intern/softbody.c180
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c111
-rw-r--r--source/blender/blenkernel/intern/suggestions.c4
-rw-r--r--source/blender/blenkernel/intern/text.c4
-rw-r--r--source/blender/blenkernel/intern/tracking.c6
-rw-r--r--source/blender/blenkernel/intern/tracking_region_tracker.c2
-rw-r--r--source/blender/blenkernel/intern/tracking_stabilize.c2
-rw-r--r--source/blender/blenkernel/intern/tracking_util.c22
-rw-r--r--source/blender/blenkernel/intern/unit.c4
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c20
-rw-r--r--source/blender/blenlib/BLI_bitmap.h3
-rw-r--r--source/blender/blenlib/BLI_math_geom.h5
-rw-r--r--source/blender/blenlib/BLI_path_util.h1
-rw-r--r--source/blender/blenlib/BLI_rect.h4
-rw-r--r--source/blender/blenlib/BLI_utildefines.h8
-rw-r--r--source/blender/blenlib/intern/BLI_ghash_utils.c2
-rw-r--r--source/blender/blenlib/intern/DLRB_tree.c2
-rw-r--r--source/blender/blenlib/intern/array_store.c4
-rw-r--r--source/blender/blenlib/intern/astar.c6
-rw-r--r--source/blender/blenlib/intern/freetypefont.c2
-rw-r--r--source/blender/blenlib/intern/math_geom.c73
-rw-r--r--source/blender/blenlib/intern/math_interp.c2
-rw-r--r--source/blender/blenlib/intern/path_util.c27
-rw-r--r--source/blender/blenlib/intern/rct.c4
-rw-r--r--source/blender/blenlib/intern/storage.c2
-rw-r--r--source/blender/blenlib/intern/string_utils.c8
-rw-r--r--source/blender/blenlib/intern/task.c2
-rw-r--r--source/blender/blenloader/intern/versioning_260.c2
-rw-r--r--source/blender/blentranslation/intern/blt_lang.c2
-rw-r--r--source/blender/blentranslation/intern/blt_translation.c9
-rw-r--r--source/blender/bmesh/intern/bmesh_callback_generic.c6
-rw-r--r--source/blender/bmesh/intern/bmesh_callback_generic.h6
-rw-r--r--source/blender/bmesh/intern/bmesh_interp.c50
-rw-r--r--source/blender/bmesh/intern/bmesh_log.c60
-rw-r--r--source/blender/bmesh/intern/bmesh_opdefines.c7
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c12
-rw-r--r--source/blender/bmesh/intern/bmesh_private.h6
-rw-r--r--source/blender/bmesh/intern/bmesh_query.c16
-rw-r--r--source/blender/bmesh/operators/bmo_dupe.c73
-rw-r--r--source/blender/bmesh/operators/bmo_extrude.c20
-rw-r--r--source/blender/bmesh/operators/bmo_smooth_laplacian.c6
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.c39
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide_edgering.c6
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c2
-rw-r--r--source/blender/bmesh/tools/bmesh_intersect.c4
-rw-r--r--source/blender/collada/AnimationExporter.cpp8
-rw-r--r--source/blender/collada/AnimationImporter.h11
-rw-r--r--source/blender/collada/ArmatureExporter.cpp2
-rw-r--r--source/blender/collada/ArmatureImporter.cpp60
-rw-r--r--source/blender/collada/ControllerExporter.cpp4
-rw-r--r--source/blender/collada/DocumentImporter.cpp6
-rw-r--r--source/blender/collada/DocumentImporter.h2
-rw-r--r--source/blender/collada/ErrorHandler.cpp4
-rw-r--r--source/blender/collada/GeometryExporter.cpp4
-rw-r--r--source/blender/collada/GeometryExporter.h2
-rw-r--r--source/blender/collada/MeshImporter.cpp18
-rw-r--r--source/blender/collada/SceneExporter.cpp2
-rw-r--r--source/blender/collada/collada_utils.cpp102
-rw-r--r--source/blender/collada/collada_utils.h14
-rw-r--r--source/blender/compositor/COM_compositor.h128
-rw-r--r--source/blender/compositor/COM_defines.h44
-rw-r--r--source/blender/compositor/intern/COM_CPUDevice.h8
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.cpp2
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.h74
-rw-r--r--source/blender/compositor/intern/COM_Converter.cpp2
-rw-r--r--source/blender/compositor/intern/COM_Converter.h32
-rw-r--r--source/blender/compositor/intern/COM_Device.h14
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.cpp8
-rw-r--r--source/blender/compositor/intern/COM_ExecutionGroup.h250
-rw-r--r--source/blender/compositor/intern/COM_ExecutionSystem.h56
-rw-r--r--source/blender/compositor/intern/COM_MemoryBuffer.h60
-rw-r--r--source/blender/compositor/intern/COM_MemoryProxy.h36
-rw-r--r--source/blender/compositor/intern/COM_Node.h82
-rw-r--r--source/blender/compositor/intern/COM_NodeConverter.h49
-rw-r--r--source/blender/compositor/intern/COM_NodeGraph.cpp2
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cpp2
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.h176
-rw-r--r--source/blender/compositor/intern/COM_OpenCLDevice.h36
-rw-r--r--source/blender/compositor/intern/COM_SocketReader.h54
-rw-r--r--source/blender/compositor/intern/COM_WorkPackage.h16
-rw-r--r--source/blender/compositor/intern/COM_WorkScheduler.cpp12
-rw-r--r--source/blender/compositor/intern/COM_WorkScheduler.h36
-rw-r--r--source/blender/compositor/nodes/COM_AlphaOverNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_BilateralBlurNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_BlurNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_BokehBlurNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_BokehImageNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_BoxMaskNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_BrightnessNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ChannelMatteNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ChromaMatteNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorBalanceNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorCorrectionNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorCurveNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorMatteNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorRampNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorSpillNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ColorToBWNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_CompositorNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ConvertAlphaNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_CornerPinNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_CropNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_CryptomatteNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_DefocusNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_DespeckleNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_DifferenceMatteNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_DilateErodeNode.h6
-rw-r--r--source/blender/compositor/nodes/COM_DirectionalBlurNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_DisplaceNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_DistanceMatteNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_EllipseMaskNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_FilterNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_FlipNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_FlipNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_GammaNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_GlareNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_HueSaturationValueNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_IDMaskNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ImageNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_InpaintNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_InvertNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_KeyingNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_KeyingScreenNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_LensDistortionNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_LuminanceMatteNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MapRangeNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MapUVNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MapValueNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MaskNode.cpp1
-rw-r--r--source/blender/compositor/nodes/COM_MaskNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MathNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MixNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MovieClipNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_MovieDistortionNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_NormalNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_NormalizeNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_OutputFileNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_PixelateNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_RenderLayersNode.cpp4
-rw-r--r--source/blender/compositor/nodes/COM_RenderLayersNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_RotateNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ScaleNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_SetAlphaNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_SocketProxyNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_SplitViewerNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_Stabilize2dNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_SunBeamsNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_SwitchNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_SwitchViewNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_TextureNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_TimeNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_TonemapNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_TrackPositionNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_TransformNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_TranslateNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ValueNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_VectorBlurNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_VectorCurveNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ViewLevelsNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ViewerNode.h4
-rw-r--r--source/blender/compositor/nodes/COM_ZCombineNode.h4
-rw-r--r--source/blender/compositor/operations/COM_AntiAliasOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_BokehImageOperation.h52
-rw-r--r--source/blender/compositor/operations/COM_CalculateMeanOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cpp1
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.h26
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorProfileOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_DotproductOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_GaussianXBlurOperation.h6
-rw-r--r--source/blender/compositor/operations/COM_GaussianYBlurOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_GlareBaseOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_GlareThresholdOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ImageOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_MapValueOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_MaskOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_MaskOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_NormalizeOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_PixelateOperation.h22
-rw-r--r--source/blender/compositor/operations/COM_PreviewOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_PreviewOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ReadBufferOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_ReadBufferOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_RenderLayersProg.h6
-rw-r--r--source/blender/compositor/operations/COM_ScaleOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_SetColorOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_SetValueOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_SetVectorOperation.h8
-rw-r--r--source/blender/compositor/operations/COM_SunBeamsOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_TonemapOperation.h18
-rw-r--r--source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_VectorBlurOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_VectorBlurOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_ViewerOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_ViewerOperation.h4
-rw-r--r--source/blender/compositor/operations/COM_WriteBufferOperation.h6
-rwxr-xr-xsource/blender/datatoc/datatoc_icon_split.py2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_map.cc13
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc4
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.h2
-rw-r--r--source/blender/depsgraph/intern/depsgraph.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_types.h2
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c8
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c4
-rw-r--r--source/blender/editors/animation/anim_filter.c2
-rw-r--r--source/blender/editors/animation/anim_markers.c6
-rw-r--r--source/blender/editors/animation/anim_ops.c2
-rw-r--r--source/blender/editors/animation/drivers.c8
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c4
-rw-r--r--source/blender/editors/animation/keyframes_edit.c10
-rw-r--r--source/blender/editors/animation/keyframes_general.c12
-rw-r--r--source/blender/editors/animation/keyframing.c4
-rw-r--r--source/blender/editors/animation/keyingsets.c4
-rw-r--r--source/blender/editors/armature/armature_add.c2
-rw-r--r--source/blender/editors/armature/armature_edit.c4
-rw-r--r--source/blender/editors/armature/armature_naming.c2
-rw-r--r--source/blender/editors/armature/armature_ops.c4
-rw-r--r--source/blender/editors/armature/armature_relations.c4
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c2
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c14
-rw-r--r--source/blender/editors/armature/pose_edit.c8
-rw-r--r--source/blender/editors/armature/pose_select.c4
-rw-r--r--source/blender/editors/curve/curve_ops.c4
-rw-r--r--source/blender/editors/curve/editcurve_paint.c10
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_intern.h18
-rw-r--r--source/blender/editors/gpencil/gpencil_ops.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c10
-rw-r--r--source/blender/editors/gpencil/gpencil_select.c2
-rw-r--r--source/blender/editors/include/ED_keyframing.h6
-rw-r--r--source/blender/editors/include/ED_types.h2
-rw-r--r--source/blender/editors/include/ED_view3d.h20
-rw-r--r--source/blender/editors/include/UI_interface.h5
-rw-r--r--source/blender/editors/interface/interface.c15
-rw-r--r--source/blender/editors/interface/interface_eyedropper_color.c2
-rw-r--r--source/blender/editors/interface/interface_eyedropper_datablock.c5
-rw-r--r--source/blender/editors/interface/interface_handlers.c16
-rw-r--r--source/blender/editors/interface/interface_intern.h3
-rw-r--r--source/blender/editors/interface/interface_layout.c14
-rw-r--r--source/blender/editors/interface/interface_ops.c2
-rw-r--r--source/blender/editors/interface/interface_panel.c4
-rw-r--r--source/blender/editors/interface/interface_region_color_picker.c1
-rw-r--r--source/blender/editors/interface/interface_region_menu_pie.c1
-rw-r--r--source/blender/editors/interface/interface_region_menu_popup.c1
-rw-r--r--source/blender/editors/interface/interface_region_popup.c1
-rw-r--r--source/blender/editors/interface/interface_region_tooltip.c49
-rw-r--r--source/blender/editors/interface/interface_templates.c46
-rw-r--r--source/blender/editors/interface/interface_utils.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c26
-rw-r--r--source/blender/editors/interface/view2d.c20
-rw-r--r--source/blender/editors/interface/view2d_ops.c4
-rw-r--r--source/blender/editors/lattice/lattice_ops.c2
-rw-r--r--source/blender/editors/mask/mask_edit.c2
-rw-r--r--source/blender/editors/mask/mask_editaction.c6
-rw-r--r--source/blender/editors/mesh/editmesh_extrude.c24
-rw-r--r--source/blender/editors/mesh/editmesh_extrude_spin.c49
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c16
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c2
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c6
-rw-r--r--source/blender/editors/mesh/mesh_mirror.c2
-rw-r--r--source/blender/editors/mesh/mesh_ops.c4
-rw-r--r--source/blender/editors/mesh/meshtools.c6
-rw-r--r--source/blender/editors/metaball/mball_ops.c2
-rw-r--r--source/blender/editors/object/object_constraint.c16
-rw-r--r--source/blender/editors/object/object_ops.c4
-rw-r--r--source/blender/editors/object/object_random.c2
-rw-r--r--source/blender/editors/object/object_vgroup.c2
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c2
-rw-r--r--source/blender/editors/physics/particle_edit.c4
-rw-r--r--source/blender/editors/physics/physics_fluid.c5
-rw-r--r--source/blender/editors/physics/physics_ops.c4
-rw-r--r--source/blender/editors/render/render_internal.c2
-rw-r--r--source/blender/editors/screen/area.c22
-rw-r--r--source/blender/editors/screen/screen_edit.c2
-rw-r--r--source/blender/editors/screen/screen_ops.c12
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c26
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c16
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c60
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c13
-rw-r--r--source/blender/editors/space_action/action_ops.c4
-rw-r--r--source/blender/editors/space_action/action_select.c2
-rw-r--r--source/blender/editors/space_action/space_action.c10
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c4
-rw-r--r--source/blender/editors/space_clip/clip_ops.c12
-rw-r--r--source/blender/editors/space_clip/space_clip.c26
-rw-r--r--source/blender/editors/space_console/space_console.c4
-rw-r--r--source/blender/editors/space_file/file_draw.c2
-rw-r--r--source/blender/editors/space_file/file_ops.c2
-rw-r--r--source/blender/editors/space_file/filelist.c20
-rw-r--r--source/blender/editors/space_file/filelist.h18
-rw-r--r--source/blender/editors/space_file/fsmenu.c4
-rw-r--r--source/blender/editors/space_file/space_file.c20
-rw-r--r--source/blender/editors/space_graph/graph_ops.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_image/image_ops.c10
-rw-r--r--source/blender/editors/space_image/space_image.c24
-rw-r--r--source/blender/editors/space_info/info_ops.c4
-rw-r--r--source/blender/editors/space_info/space_info.c6
-rw-r--r--source/blender/editors/space_logic/logic_window.c2
-rw-r--r--source/blender/editors/space_logic/space_logic.c6
-rw-r--r--source/blender/editors/space_nla/nla_channels.c3
-rw-r--r--source/blender/editors/space_nla/nla_ops.c6
-rw-r--r--source/blender/editors/space_nla/nla_select.c2
-rw-r--r--source/blender/editors/space_nla/space_nla.c12
-rw-r--r--source/blender/editors/space_node/drawnode.c1
-rw-r--r--source/blender/editors/space_node/node_ops.c4
-rw-r--r--source/blender/editors/space_node/node_relationships.c8
-rw-r--r--source/blender/editors/space_node/node_select.c1
-rw-r--r--source/blender/editors/space_node/node_templates.c6
-rw-r--r--source/blender/editors/space_node/node_view.c2
-rw-r--r--source/blender/editors/space_node/space_node.c8
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h2
-rw-r--r--source/blender/editors/space_outliner/outliner_ops.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c6
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c2
-rw-r--r--source/blender/editors/space_script/space_script.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c33
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c6
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c8
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c16
-rw-r--r--source/blender/editors/space_text/space_text.c10
-rw-r--r--source/blender/editors/space_text/text_format_lua.c4
-rw-r--r--source/blender/editors/space_text/text_format_osl.c6
-rw-r--r--source/blender/editors/space_text/text_format_pov.c8
-rw-r--r--source/blender/editors/space_text/text_format_pov_ini.c4
-rw-r--r--source/blender/editors/space_text/text_format_py.c4
-rw-r--r--source/blender/editors/space_text/text_ops.c2
-rw-r--r--source/blender/editors/space_time/space_time.c2
-rw-r--r--source/blender/editors/space_time/time_ops.c2
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c2
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c50
-rw-r--r--source/blender/editors/space_view3d/view3d_camera_control.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c68
-rw-r--r--source/blender/editors/space_view3d/view3d_ruler.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_walk.c10
-rw-r--r--source/blender/editors/transform/transform.c10
-rw-r--r--source/blender/editors/transform/transform.h8
-rw-r--r--source/blender/editors/transform/transform_conversions.c10
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/transform/transform_orientations.c14
-rw-r--r--source/blender/editors/transform/transform_snap.c2
-rw-r--r--source/blender/editors/transform/transform_snap_object.c2
-rw-r--r--source/blender/editors/undo/ed_undo.c29
-rw-r--r--source/blender/editors/util/numinput.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c7
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c2
-rw-r--r--source/blender/freestyle/intern/application/AppCanvas.h2
-rw-r--r--source/blender/freestyle/intern/application/AppConfig.h2
-rw-r--r--source/blender/freestyle/intern/application/Controller.cpp10
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h2
-rw-r--r--source/blender/freestyle/intern/geometry/Grid.h11
-rw-r--r--source/blender/freestyle/intern/geometry/SweepLine.h2
-rw-r--r--source/blender/freestyle/intern/image/GaussianFilter.h22
-rw-r--r--source/blender/freestyle/intern/image/ImagePyramid.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Convert.h90
-rw-r--r--source/blender/freestyle/intern/python/BPy_IntegrationType.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_Interface1D.cpp8
-rw-r--r--source/blender/freestyle/intern/python/BPy_SShape.cpp2
-rw-r--r--source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp8
-rw-r--r--source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h2
-rw-r--r--source/blender/freestyle/intern/scene_graph/NodeCamera.h4
-rw-r--r--source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h4
-rw-r--r--source/blender/freestyle/intern/stroke/BasicStrokeShaders.h4
-rw-r--r--source/blender/freestyle/intern/stroke/Stroke.h4
-rw-r--r--source/blender/freestyle/intern/view_map/Interface0D.cpp10
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMap.h20
-rw-r--r--source/blender/freestyle/intern/view_map/ViewMapIO.cpp16
-rw-r--r--source/blender/freestyle/intern/winged_edge/WEdge.h22
-rw-r--r--source/blender/freestyle/intern/winged_edge/WXEdge.h22
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c8
-rw-r--r--source/blender/gpu/intern/gpu_shader.c2
-rw-r--r--source/blender/imbuf/IMB_imbuf_types.h4
-rw-r--r--source/blender/imbuf/intern/anim_movie.c2
-rw-r--r--source/blender/imbuf/intern/colormanagement.c2
-rw-r--r--source/blender/imbuf/intern/dds/BlockDXT.cpp4
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.cpp42
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.h4
-rw-r--r--source/blender/imbuf/intern/dds/DirectDrawSurface.cpp12
-rw-r--r--source/blender/imbuf/intern/dds/Image.cpp6
-rw-r--r--source/blender/imbuf/intern/dds/Image.h10
-rw-r--r--source/blender/imbuf/intern/filetype.c2
-rw-r--r--source/blender/imbuf/intern/imageprocess.c4
-rw-r--r--source/blender/imbuf/intern/iris.c19
-rw-r--r--source/blender/imbuf/intern/jp2.c1023
-rw-r--r--source/blender/imbuf/intern/moviecache.c2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp10
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.h1
-rw-r--r--source/blender/imbuf/intern/targa.c2
-rw-r--r--source/blender/imbuf/intern/thumbs.c8
-rw-r--r--source/blender/imbuf/intern/tiff.c8
-rw-r--r--source/blender/makesdna/DNA_ID.h6
-rw-r--r--source/blender/makesdna/DNA_armature_types.h2
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h4
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h2
-rw-r--r--source/blender/makesdna/DNA_mask_types.h2
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h2
-rw-r--r--source/blender/makesdna/DNA_node_types.h2
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim_types.h2
-rw-r--r--source/blender/makesdna/DNA_object_force_types.h4
-rw-r--r--source/blender/makesdna/DNA_particle_types.h8
-rw-r--r--source/blender/makesdna/DNA_rigidbody_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h20
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h2
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h2
-rw-r--r--source/blender/makesdna/DNA_space_types.h2
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h2
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h10
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h2
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c10
-rw-r--r--source/blender/makesdna/intern/makesdna.c4
-rw-r--r--source/blender/makesrna/RNA_define.h4
-rw-r--r--source/blender/makesrna/RNA_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_ID.c2
-rw-r--r--source/blender/makesrna/intern/rna_access.c2
-rw-r--r--source/blender/makesrna/intern/rna_armature.c2
-rw-r--r--source/blender/makesrna/intern/rna_brush.c16
-rw-r--r--source/blender/makesrna/intern/rna_dynamicpaint.c2
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c2
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c6
-rw-r--r--source/blender/makesrna/intern/rna_lattice.c2
-rw-r--r--source/blender/makesrna/intern/rna_linestyle.c2
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c3
-rw-r--r--source/blender/makesrna/intern/rna_material.c30
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c5
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c2
-rw-r--r--source/blender/makesrna/intern/rna_particle.c2
-rw-r--r--source/blender/makesrna/intern/rna_rna.c1
-rw-r--r--source/blender/makesrna/intern/rna_scene.c10
-rw-r--r--source/blender/makesrna/intern/rna_screen.c18
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c2
-rw-r--r--source/blender/modifiers/intern/MOD_array.c2
-rw-r--r--source/blender/modifiers/intern/MOD_build.c34
-rw-r--r--source/blender/modifiers/intern/MOD_explode.c10
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.c4
-rw-r--r--source/blender/modifiers/intern/MOD_laplaciandeform.c6
-rw-r--r--source/blender/modifiers/intern/MOD_laplaciansmooth.c6
-rw-r--r--source/blender/modifiers/intern/MOD_mask.c34
-rw-r--r--source/blender/modifiers/intern/MOD_meshsequencecache.c7
-rw-r--r--source/blender/modifiers/intern/MOD_mirror.c2
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c10
-rw-r--r--source/blender/modifiers/intern/MOD_simpledeform.c6
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c2
-rw-r--r--source/blender/modifiers/intern/MOD_surfacedeform.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_image.c4
-rw-r--r--source/blender/nodes/shader/node_shader_util.c2
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp2
-rw-r--r--source/blender/physics/intern/ConstrainedConjugateGradient.h2
-rw-r--r--source/blender/physics/intern/implicit_blender.c39
-rw-r--r--source/blender/physics/intern/implicit_eigen.cpp6
-rw-r--r--source/blender/python/BPY_extern.h7
-rw-r--r--source/blender/python/bmesh/bmesh_py_api.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops_call.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c12
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.c10
-rw-r--r--source/blender/python/bmesh/bmesh_py_utils.c2
-rw-r--r--source/blender/python/generic/idprop_py_api.c4
-rw-r--r--source/blender/python/generic/py_capi_utils.c80
-rw-r--r--source/blender/python/generic/py_capi_utils.h44
-rw-r--r--source/blender/python/intern/bpy_app.c8
-rw-r--r--source/blender/python/intern/bpy_app_handlers.c4
-rw-r--r--source/blender/python/intern/bpy_interface.c57
-rw-r--r--source/blender/python/intern/bpy_operator.c85
-rw-r--r--source/blender/python/intern/bpy_path.c2
-rw-r--r--source/blender/python/intern/bpy_props.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c4
-rw-r--r--source/blender/python/intern/bpy_utils_units.c2
-rw-r--r--source/blender/python/intern/gpu.c6
-rw-r--r--source/blender/python/mathutils/mathutils.c6
-rw-r--r--source/blender/python/mathutils/mathutils.h2
-rw-r--r--source/blender/python/mathutils/mathutils_Color.c8
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c6
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c6
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c4
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c22
-rw-r--r--source/blender/python/mathutils/mathutils_bvhtree.c2
-rw-r--r--source/blender/python/mathutils/mathutils_geometry.c2
-rw-r--r--source/blender/python/mathutils/mathutils_noise.c5
-rw-r--r--source/blender/render/intern/source/external_engine.c2
-rw-r--r--source/blender/render/intern/source/pipeline.c7
-rw-r--r--source/blender/render/intern/source/rayshade.c4
-rw-r--r--source/blender/render/intern/source/render_texture.c4
-rw-r--r--source/blender/render/intern/source/rendercore.c2
-rw-r--r--source/blender/render/intern/source/shadbuf.c4
-rw-r--r--source/blender/windowmanager/CMakeLists.txt1
-rw-r--r--source/blender/windowmanager/WM_api.h13
-rw-r--r--source/blender/windowmanager/WM_keymap.h29
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files.c4
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c6
-rw-r--r--source/blender/windowmanager/intern/wm_jobs.c8
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c280
-rw-r--r--source/blender/windowmanager/intern/wm_keymap_utils.c328
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c13
-rw-r--r--source/blender/windowmanager/intern/wm_window.c27
-rw-r--r--source/blender/windowmanager/wm_event_types.h5
607 files changed, 3923 insertions, 4348 deletions
diff --git a/source/blender/alembic/intern/abc_archive.h b/source/blender/alembic/intern/abc_archive.h
index 84309fbc9df..5696aed9ef3 100644
--- a/source/blender/alembic/intern/abc_archive.h
+++ b/source/blender/alembic/intern/abc_archive.h
@@ -53,7 +53,7 @@ public:
/**
* Returns true when either Blender is compiled with HDF5 support and
- * the archive was succesfully opened (valid() will also return true),
+ * the archive was successfully opened (valid() will also return true),
* or when Blender was built without HDF5 support but a HDF5 file was
* detected (valid() will return false).
*/
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index f73fe957fea..b0e2538e8bc 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -154,7 +154,7 @@ void AbcCurveWriter::do_write()
if (nurbs->knotsu != NULL) {
const size_t num_knots = KNOTSU(nurbs);
- /* Add an extra knot at the beggining and end of the array since most apps
+ /* Add an extra knot at the beginning and end of the array since most apps
* require/expect them. */
knots.resize(num_knots + 2);
diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc
index f2ae1c831d1..424475dc61b 100644
--- a/source/blender/alembic/intern/abc_customdata.cc
+++ b/source/blender/alembic/intern/abc_customdata.cc
@@ -185,7 +185,11 @@ static void write_mcol(const OCompoundProperty &prop, const CDStreamConfig &conf
MLoop *mloops = config.mloop;
MCol *cfaces = static_cast<MCol *>(data);
- std::vector<Imath::C4f> buffer(config.totvert);
+ std::vector<Imath::C4f> buffer;
+ std::vector<uint32_t> indices;
+
+ buffer.reserve(config.totvert);
+ indices.reserve(config.totvert);
Imath::C4f col;
@@ -203,7 +207,8 @@ static void write_mcol(const OCompoundProperty &prop, const CDStreamConfig &conf
col[2] = cface->g * cscale;
col[3] = cface->b * cscale;
- buffer[mloop->v] = col;
+ buffer.push_back(col);
+ indices.push_back(buffer.size() - 1);
}
}
@@ -211,6 +216,7 @@ static void write_mcol(const OCompoundProperty &prop, const CDStreamConfig &conf
OC4fGeomParam::Sample sample(
C4fArraySample(&buffer.front(), buffer.size()),
+ UInt32ArraySample(&indices.front(), indices.size()),
kVertexScope);
param.set(sample);
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index 6c1eeb9854f..9ffed421302 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -415,7 +415,7 @@ void AbcExporter::exploreTransform(EvaluationContext *eval_ctx, Object *ob, Obje
}
}
-AbcTransformWriter * AbcExporter::createTransformWriter(Object *ob, Object *parent, Object *dupliObParent)
+AbcTransformWriter *AbcExporter::createTransformWriter(Object *ob, Object *parent, Object *dupliObParent)
{
/* An object should not be its own parent, or we'll get infinite loops. */
BLI_assert(ob != parent);
diff --git a/source/blender/alembic/intern/abc_exporter.h b/source/blender/alembic/intern/abc_exporter.h
index 280682b2896..ae30b4589ee 100644
--- a/source/blender/alembic/intern/abc_exporter.h
+++ b/source/blender/alembic/intern/abc_exporter.h
@@ -114,7 +114,7 @@ private:
Alembic::Abc::TimeSamplingPtr createTimeSampling(double step);
void createTransformWritersHierarchy(EvaluationContext *eval_ctx);
- AbcTransformWriter * createTransformWriter(Object *ob, Object *parent, Object *dupliObParent);
+ AbcTransformWriter *createTransformWriter(Object *ob, Object *parent, Object *dupliObParent);
void exploreTransform(EvaluationContext *eval_ctx, Object *ob, Object *parent, Object *dupliObParent = NULL);
void exploreObject(EvaluationContext *eval_ctx, Object *ob, Object *dupliObParent);
void createShapeWriters(EvaluationContext *eval_ctx);
diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc
index 0208da8a6d7..ed70d36dbee 100644
--- a/source/blender/alembic/intern/abc_hair.cc
+++ b/source/blender/alembic/intern/abc_hair.cc
@@ -139,7 +139,7 @@ void AbcHairWriter::write_hair_sample(DerivedMesh *dm,
m_uv_warning_shown = true;
}
- ParticleData * pa = m_psys->particles;
+ ParticleData *pa = m_psys->particles;
int k;
ParticleCacheKey **cache = m_psys->pathcache;
diff --git a/source/blender/alembic/intern/abc_nurbs.cc b/source/blender/alembic/intern/abc_nurbs.cc
index eaef06fd6d1..6273507486a 100644
--- a/source/blender/alembic/intern/abc_nurbs.cc
+++ b/source/blender/alembic/intern/abc_nurbs.cc
@@ -103,7 +103,7 @@ static void get_knots(std::vector<float> &knots, const int num_knots, float *nu_
return;
}
- /* Add an extra knot at the beggining and end of the array since most apps
+ /* Add an extra knot at the beginning and end of the array since most apps
* require/expect them. */
knots.reserve(num_knots + 2);
@@ -167,7 +167,7 @@ void AbcNurbsWriter::do_write()
sample.setNu(nu->pntsu);
sample.setNv(nu->pntsv);
- /* TODO(kevin): to accomodate other software we should duplicate control
+ /* TODO(kevin): to accommodate other software we should duplicate control
* points to indicate that a NURBS is cyclic. */
OCompoundProperty user_props = m_nurbs_schema[count].getUserProperties();
diff --git a/source/blender/alembic/intern/abc_points.cc b/source/blender/alembic/intern/abc_points.cc
index 80567cd6bf0..738adb4cd3a 100644
--- a/source/blender/alembic/intern/abc_points.cc
+++ b/source/blender/alembic/intern/abc_points.cc
@@ -60,10 +60,10 @@ using Alembic::AbcGeom::OPointsSchema;
AbcPointsWriter::AbcPointsWriter(Scene *scene,
Object *ob,
- AbcTransformWriter *parent,
- uint32_t time_sampling,
- ExportSettings &settings,
- ParticleSystem *psys)
+ AbcTransformWriter *parent,
+ uint32_t time_sampling,
+ ExportSettings &settings,
+ ParticleSystem *psys)
: AbcObjectWriter(scene, ob, time_sampling, settings, parent)
{
m_psys = psys;
diff --git a/source/blender/alembic/intern/abc_util.h b/source/blender/alembic/intern/abc_util.h
index 2526958111a..06eb3f140ca 100644
--- a/source/blender/alembic/intern/abc_util.h
+++ b/source/blender/alembic/intern/abc_util.h
@@ -167,7 +167,7 @@ typedef enum {
} AbcAxisSwapMode;
/* Create a rotation matrix for each axis from euler angles.
- * Euler angles are swaped to change coordinate system. */
+ * Euler angles are swapped to change coordinate system. */
void create_swapped_rotation_matrix(
float rot_x_mat[3][3], float rot_y_mat[3][3],
float rot_z_mat[3][3], const float euler[3],
@@ -197,7 +197,7 @@ public:
/* *************************** */
/**
- * Utility class whose purpose is to more easily log related informations. An
+ * Utility class whose purpose is to more easily log related information. An
* instance of the SimpleLogger can be created in any context, and will hold a
* copy of all the strings passed to its output stream.
*
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 0d2316ce7d9..b7c1f98bfb0 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -293,7 +293,7 @@ static void export_endjob(void *customdata)
if (!data->settings.logger.empty()) {
std::cerr << data->settings.logger;
- WM_report(RPT_ERROR, "Errors occured during the export, look in the console to know more...");
+ WM_report(RPT_ERROR, "Errors occurred during the export, look in the console to know more...");
}
G.is_rendering = false;
@@ -318,7 +318,7 @@ bool ABC_export(
* ExportJobData contains an ExportSettings containing a SimpleLogger.
*
* Since ExportJobData is a C-style struct dynamically allocated with
- * MEM_mallocN (see above), its construtor is never called, therefore the
+ * MEM_mallocN (see above), its constructor is never called, therefore the
* ExportSettings constructor is not called which implies that the
* SimpleLogger one is not called either. SimpleLogger in turn does not call
* the constructor of its data members which ultimately means that its
@@ -797,7 +797,7 @@ static void import_endjob(void *user_data)
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
Object *ob = (*iter)->object();
- /* It's possible that cancellation occured between the creation of
+ /* It's possible that cancellation occurred between the creation of
* the reader and the creation of the Blender object. */
if (ob == NULL) continue;
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 2d8a0b0038f..6e798a6244e 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -64,7 +64,7 @@ char *tcc_to_char(unsigned int tcc);
-/* implemetation */
+/* implementation */
unsigned int GET_FCC(FILE *fp)
{
@@ -286,7 +286,7 @@ bool AVI_is_avi(const char *name)
fseek(movie.fp, movie.header->size - 14 * 4, SEEK_CUR);
/* Limit number of streams to some reasonable amount to prevent
- * buffer oveflow vulnerabilities. */
+ * buffer overflow vulnerabilities. */
if (movie.header->Streams < 1 || movie.header->Streams > 65536) {
DEBUG_PRINT("Number of streams should be in range 1-65536\n");
fclose(movie.fp);
@@ -489,7 +489,7 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
fseek(movie->fp, movie->header->size - 14 * 4, SEEK_CUR);
/* Limit number of streams to some reasonable amount to prevent
- * buffer oveflow vulnerabilities. */
+ * buffer overflow vulnerabilities. */
if (movie->header->Streams < 1 || movie->header->Streams > 65536) {
DEBUG_PRINT("Number of streams should be in range 1-65536\n");
return AVI_ERROR_FORMAT;
@@ -687,7 +687,7 @@ AviError AVI_open_movie(const char *name, AviMovie *movie)
movie->read_offset = 4;
}
- DEBUG_PRINT("movie succesfully opened\n");
+ DEBUG_PRINT("movie successfully opened\n");
return AVI_ERROR_NONE;
}
@@ -806,7 +806,7 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
movie->header->Reserved[3] = 0;
/* Limit number of streams to some reasonable amount to prevent
- * buffer oveflow vulnerabilities. */
+ * buffer overflow vulnerabilities. */
if (movie->header->Streams < 0 || movie->header->Streams > 65536) {
DEBUG_PRINT("Number of streams should be in range 0-65536\n");
return AVI_ERROR_FORMAT;
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 4e6fb89ba89..b627e3f69e8 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -70,7 +70,7 @@ void BKE_action_make_local(struct Main *bmain, struct bAction *act, const bool l
/* Action API ----------------- */
/* types of transforms applied to the given item
- * - these are the return falgs for action_get_item_transforms()
+ * - these are the return flags for action_get_item_transforms()
*/
typedef enum eAction_TransformFlags {
/* location */
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index d0386c8b6ca..dea5afa1ac2 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -47,7 +47,7 @@ struct ListBase;
typedef struct PoseTarget {
struct PoseTarget *next, *prev;
- struct bConstraint *con; /* the constrait of this target */
+ struct bConstraint *con; /* the constraint of this target */
int tip; /* index of tip pchan in PoseTree */
} PoseTarget;
diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h
index 1b4bb08756b..c6057442fec 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -35,7 +35,7 @@
#include "BLI_kdopbvh.h"
/**
- * This header encapsulates necessary code to buld a BVH
+ * This header encapsulates necessary code to build a BVH
*/
struct DerivedMesh;
diff --git a/source/blender/blenkernel/BKE_ccg.h b/source/blender/blenkernel/BKE_ccg.h
index 7d5d423282d..65d4688947e 100644
--- a/source/blender/blenkernel/BKE_ccg.h
+++ b/source/blender/blenkernel/BKE_ccg.h
@@ -72,7 +72,6 @@ typedef struct CCGKey {
* true */
int mask_offset;
- int num_layers;
int has_normals;
int has_mask;
} CCGKey;
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 5e7a3f4af72..293ac30f0f9 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -66,16 +66,18 @@ typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, bo
/* ....... */
-/* Constraint Type-Info (shorthand in code = cti):
- * This struct provides function pointers for runtime, so that functions can be
- * written more generally (with fewer/no special exceptions for various constraints).
+/**
+ * Constraint Type-Info (shorthand in code = cti):
+ * This struct provides function pointers for runtime, so that functions can be
+ * written more generally (with fewer/no special exceptions for various constraints).
*
- * Callers of these functions must check that they actually point to something useful,
- * as some constraints don't define some of these.
+ * Callers of these functions must check that they actually point to something useful,
+ * as some constraints don't define some of these.
*
- * Warning: it is not too advisable to reorder order of members of this struct,
- * as you'll have to edit quite a few ($NUM_CONSTRAINT_TYPES) of these
- * structs.
+ * Warning:
+ * it is not too advisable to reorder order of members of this struct,
+ * as you'll have to edit quite a few #NUM_CONSTRAINT_TYPES of these
+ * structs.
*/
typedef struct bConstraintTypeInfo {
/* admin/ident */
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 95718fa0470..e75997cd394 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -472,7 +472,7 @@ typedef struct CustomDataTransferLayerMap {
size_t data_size; /* Size of actual data we transfer. */
size_t data_offset; /* Offset of actual data we transfer (in element contained in data_src/dst). */
- uint64_t data_flag; /* For bitflag transfer, flag(s) to affect in transfered data. */
+ uint64_t data_flag; /* For bitflag transfer, flag(s) to affect in transferred data. */
void *interp_data; /* Opaque pointer, to be used by specific interp callback (e.g. transformspace for normals). */
diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h
index 937ed08a527..c265672da88 100644
--- a/source/blender/blenkernel/BKE_dynamicpaint.h
+++ b/source/blender/blenkernel/BKE_dynamicpaint.h
@@ -53,7 +53,7 @@ typedef struct PaintPoint {
float color[4];
} PaintPoint;
-/* heigh field waves */
+/* height field waves */
typedef struct PaintWavePoint {
float height;
diff --git a/source/blender/blenkernel/BKE_editmesh.h b/source/blender/blenkernel/BKE_editmesh.h
index 92e311bb53f..2cae86d4c3b 100644
--- a/source/blender/blenkernel/BKE_editmesh.h
+++ b/source/blender/blenkernel/BKE_editmesh.h
@@ -27,7 +27,7 @@
* \ingroup bke
*
* The \link edmesh EDBM module\endlink is for editmode bmesh stuff.
- * In contrast, the this module is for code shared with blenkernel thats
+ * In contrast, this module is for code shared with blenkernel that's
* only concerned with low level operations on the #BMEditMesh structure.
*/
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 3a951b7860d..92e16f02e25 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -86,7 +86,7 @@ bool gpencil_layer_is_editable(const struct bGPDlayer *gpl);
* is no existing GP-Frame on the frame requested.
*/
typedef enum eGP_GetFrame_Mode {
- /* Use the preceeding gp-frame (i.e. don't add anything) */
+ /* Use the preceding gp-frame (i.e. don't add anything) */
GP_GETFRAME_USE_PREV = 0,
/* Add a new empty/blank frame */
diff --git a/source/blender/blenkernel/BKE_library_query.h b/source/blender/blenkernel/BKE_library_query.h
index d6e7d98f371..65fe9abaa65 100644
--- a/source/blender/blenkernel/BKE_library_query.h
+++ b/source/blender/blenkernel/BKE_library_query.h
@@ -67,7 +67,7 @@ enum {
enum {
IDWALK_RET_NOP = 0,
- IDWALK_RET_STOP_ITER = 1 << 0, /* Completly stop iteration. */
+ IDWALK_RET_STOP_ITER = 1 << 0, /* Completely stop iteration. */
IDWALK_RET_STOP_RECURSION = 1 << 1, /* Stop recursion, that is, do not loop over ID used by current one. */
};
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index ddbf4025596..54c927aaa99 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -65,7 +65,7 @@ struct EdgeHash;
#define PARTICLE_COLLISION_MAX_COLLISIONS 10
-#define PARTICLE_P ParticleData * pa; int p
+#define PARTICLE_P ParticleData *pa; int p
#define LOOP_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++)
#define LOOP_EXISTING_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) if (!(pa->flag & PARS_UNEXIST))
#define LOOP_SHOWN_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) if (!(pa->flag & (PARS_UNEXIST | PARS_NO_DISP)))
@@ -73,7 +73,7 @@ struct EdgeHash;
#define LOOP_DYNAMIC_PARTICLES for (p = 0; p < psys->totpart; p++) if ((pa = psys->particles + p)->state.time > 0.0f)
/* fast but sure way to get the modifier*/
-#define PARTICLE_PSMD ParticleSystemModifierData * psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys)
+#define PARTICLE_PSMD ParticleSystemModifierData *psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys)
/* common stuff that many particle functions need */
typedef struct ParticleSimulationData {
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index f619133ee4b..1fede116193 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -74,7 +74,6 @@ void BKE_pbvh_build_grids(PBVH *bvh, struct CCGElem **grid_elems,
struct CCGKey *key, void **gridfaces, struct DMFlagMat *flagmats,
unsigned int **grid_hidden);
void BKE_pbvh_build_bmesh(PBVH *bvh, struct BMesh *bm, bool smooth_shading, struct BMLog *log, const int cd_vert_node_offset, const int cd_face_node_offset);
-void BKE_pbvh_set_ccgdm(PBVH *bvh, struct CCGDerivedMesh *ccgdm);
void BKE_pbvh_free(PBVH *bvh);
void BKE_pbvh_free_layer_disp(PBVH *bvh);
@@ -155,7 +154,6 @@ int BKE_pbvh_count_grid_quads(BLI_bitmap **grid_hidden,
/* multires level, only valid for type == PBVH_GRIDS */
void BKE_pbvh_get_grid_key(const PBVH *pbvh, struct CCGKey *key);
-struct CCGDerivedMesh *BKE_pbvh_get_ccgdm(const PBVH *bvh);
/* Only valid for type == PBVH_BMESH */
struct BMesh *BKE_pbvh_get_bmesh(PBVH *pbvh);
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 88e5a25958d..e905a5efae4 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -294,7 +294,7 @@ void BKE_ptcache_update_info(PTCacheID *pid);
/* Size of cache data type. */
int BKE_ptcache_data_size(int data_type);
-/* Is point with indes in memory cache */
+/* Is point with index in memory cache */
int BKE_ptcache_mem_index_find(struct PTCacheMem *pm, unsigned int index);
/* Memory cache read/write helpers. */
diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h
index 278b303a315..82a4659eec7 100644
--- a/source/blender/blenkernel/BKE_unit.h
+++ b/source/blender/blenkernel/BKE_unit.h
@@ -51,7 +51,7 @@ double bUnit_BaseScalar(int system, int type);
/* return true is the unit system exists */
bool bUnit_IsValid(int system, int type);
-/* loop over scales, coudl add names later */
+/* loop over scales, could add names later */
//double bUnit_Iter(void **unit, char **name, int system, int type);
void bUnit_GetSystem(int system, int type, void const **r_usys_pt, int *r_len);
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index c6224da2fe0..40dea6ca663 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -1553,7 +1553,6 @@ void CCG_key(CCGKey *key, const CCGSubSurf *ss, int level)
key->elem_size = ss->meshIFC.vertDataSize;
key->has_normals = ss->calcVertNormals;
- key->num_layers = ss->meshIFC.numLayers;
/* if normals are present, always the last three floats of an
* element */
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_intern.h b/source/blender/blenkernel/intern/CCGSubSurf_intern.h
index 9df1c9021ef..50959d21425 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_intern.h
+++ b/source/blender/blenkernel/intern/CCGSubSurf_intern.h
@@ -229,7 +229,7 @@ struct CCGSubSurf {
*/
bool osd_coarse_coords_invalid;
- /* GL mesh descriptor, used for refinment and draw. */
+ /* GL mesh descriptor, used for refinement and draw. */
struct OpenSubdiv_GLMesh *osd_mesh;
/* Refiner which is used to create GL mesh.
*
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
index f568bb94ac5..65c6518cee4 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
@@ -75,7 +75,7 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
ccgFaceIterator_next(&ccg_face_iter))
{
/*const*/ CCGFace *ccg_face = ccgFaceIterator_getCurrent(&ccg_face_iter);
- const int poly_index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ccg_face));
+ const int poly_index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(ccg_face));
const MPoly *mp = &mpoly[poly_index];
int corner;
if (ccg_face->numVerts != mp->totloop) {
@@ -83,7 +83,7 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
}
for (corner = 0; corner < ccg_face->numVerts; corner++) {
/*const*/ CCGVert *ccg_vert = FACE_getVerts(ccg_face)[corner];
- const int vert_index = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert));
+ const int vert_index = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert));
if (vert_index != mloop[mp->loopstart + corner].v) {
return false;
}
@@ -101,9 +101,9 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
/* const */ CCGEdge *ccg_edge = ccgEdgeIterator_getCurrent(&ccg_edge_iter);
/* const */ CCGVert *ccg_vert1 = ccg_edge->v0;
/* const */ CCGVert *ccg_vert2 = ccg_edge->v1;
- const int ccg_vert1_index = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert1));
- const int ccg_vert2_index = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert2));
- const int edge_index = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ const int ccg_vert1_index = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert1));
+ const int ccg_vert2_index = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert2));
+ const int edge_index = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
const MEdge *me = &medge[edge_index];
if (me->v1 != ccg_vert1_index || me->v2 != ccg_vert2_index) {
return false;
@@ -119,7 +119,7 @@ static bool compare_ccg_derivedmesh_topology(CCGSubSurf *ss, DerivedMesh *dm)
ccgEdgeIterator_next(&ccg_edge_iter))
{
/* const */ CCGEdge *ccg_edge = ccgEdgeIterator_getCurrent(&ccg_edge_iter);
- const int edge_index = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ const int edge_index = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
if (ccg_edge->crease != medge[edge_index].crease) {
return false;
}
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
index 8c1ba0c3782..d6b15148ed1 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
@@ -562,7 +562,7 @@ static int conv_ccg_get_num_face_verts(const OpenSubdiv_Converter *converter,
int face)
{
CCGSubSurf *ss = converter->user_data;
- CCGFace *ccg_face = ccgSubSurf_getFace(ss, SET_INT_IN_POINTER(face));
+ CCGFace *ccg_face = ccgSubSurf_getFace(ss, POINTER_FROM_INT(face));
return ccgSubSurf_getFaceNumVerts(ccg_face);
}
@@ -571,12 +571,12 @@ static void conv_ccg_get_face_verts(const OpenSubdiv_Converter *converter,
int *face_verts)
{
CCGSubSurf *ss = converter->user_data;
- CCGFace *ccg_face = ccgSubSurf_getFace(ss, SET_INT_IN_POINTER(face));
+ CCGFace *ccg_face = ccgSubSurf_getFace(ss, POINTER_FROM_INT(face));
int num_face_verts = ccgSubSurf_getFaceNumVerts(ccg_face);
int loop;
for (loop = 0; loop < num_face_verts; loop++) {
CCGVert *ccg_vert = ccgSubSurf_getFaceVert(ccg_face, loop);
- face_verts[loop] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert));
+ face_verts[loop] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert));
}
}
@@ -585,12 +585,12 @@ static void conv_ccg_get_face_edges(const OpenSubdiv_Converter *converter,
int *face_edges)
{
CCGSubSurf *ss = converter->user_data;
- CCGFace *ccg_face = ccgSubSurf_getFace(ss, SET_INT_IN_POINTER(face));
+ CCGFace *ccg_face = ccgSubSurf_getFace(ss, POINTER_FROM_INT(face));
int num_face_verts = ccgSubSurf_getFaceNumVerts(ccg_face);
int loop;
for (loop = 0; loop < num_face_verts; loop++) {
CCGEdge *ccg_edge = ccgSubSurf_getFaceEdge(ccg_face, loop);
- face_edges[loop] = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ face_edges[loop] = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
}
}
@@ -599,18 +599,18 @@ static void conv_ccg_get_edge_verts(const OpenSubdiv_Converter *converter,
int *edge_verts)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
CCGVert *ccg_vert0 = ccgSubSurf_getEdgeVert0(ccg_edge);
CCGVert *ccg_vert1 = ccgSubSurf_getEdgeVert1(ccg_edge);
- edge_verts[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert0));
- edge_verts[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ccg_vert1));
+ edge_verts[0] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert0));
+ edge_verts[1] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(ccg_vert1));
}
static int conv_ccg_get_num_edge_faces(const OpenSubdiv_Converter *converter,
int edge)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
return ccgSubSurf_getEdgeNumFaces(ccg_edge);
}
@@ -619,12 +619,12 @@ static void conv_ccg_get_edge_faces(const OpenSubdiv_Converter *converter,
int *edge_faces)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
int num_edge_faces = ccgSubSurf_getEdgeNumFaces(ccg_edge);
int face;
for (face = 0; face < num_edge_faces; face++) {
CCGFace *ccg_face = ccgSubSurf_getEdgeFace(ccg_edge, face);
- edge_faces[face] = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ccg_face));
+ edge_faces[face] = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(ccg_face));
}
}
@@ -632,7 +632,7 @@ static float conv_ccg_get_edge_sharpness(const OpenSubdiv_Converter *converter,
int edge)
{
CCGSubSurf *ss = converter->user_data;
- CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, SET_INT_IN_POINTER(edge));
+ CCGEdge *ccg_edge = ccgSubSurf_getEdge(ss, POINTER_FROM_INT(edge));
/* TODO(sergey): Multiply by subdivision level once CPU evaluator
* is switched to uniform subdivision type.
*/
@@ -643,7 +643,7 @@ static int conv_ccg_get_num_vert_edges(const OpenSubdiv_Converter *converter,
int vert)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
return ccgSubSurf_getVertNumEdges(ccg_vert);
}
@@ -652,12 +652,12 @@ static void conv_ccg_get_vert_edges(const OpenSubdiv_Converter *converter,
int *vert_edges)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
int num_vert_edges = ccgSubSurf_getVertNumEdges(ccg_vert);
int edge;
for (edge = 0; edge < num_vert_edges; edge++) {
CCGEdge *ccg_edge = ccgSubSurf_getVertEdge(ccg_vert, edge);
- vert_edges[edge] = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
+ vert_edges[edge] = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(ccg_edge));
}
}
@@ -665,7 +665,7 @@ static int conv_ccg_get_num_vert_faces(const OpenSubdiv_Converter *converter,
int vert)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
return ccgSubSurf_getVertNumFaces(ccg_vert);
}
@@ -674,12 +674,12 @@ static void conv_ccg_get_vert_faces(const OpenSubdiv_Converter *converter,
int *vert_faces)
{
CCGSubSurf *ss = converter->user_data;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ss, SET_INT_IN_POINTER(vert));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ss, POINTER_FROM_INT(vert));
int num_vert_faces = ccgSubSurf_getVertNumFaces(ccg_vert);
int face;
for (face = 0; face < num_vert_faces; face++) {
CCGFace *ccg_face = ccgSubSurf_getVertFace(ccg_vert, face);
- vert_faces[face] = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ccg_face));
+ vert_faces[face] = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(ccg_face));
}
}
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 9c0fc79a358..e099ceaea53 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -561,7 +561,7 @@ void DM_update_tessface_data(DerivedMesh *dm)
int *polyindex = CustomData_get_layer(fdata, CD_ORIGINDEX);
unsigned int (*loopindex)[4];
- /* Should never occure, but better abort than segfault! */
+ /* Should never occur, but better abort than segfault! */
if (!polyindex)
return;
@@ -624,7 +624,7 @@ void DM_generate_tangent_tessface_data(DerivedMesh *dm, bool generate)
int *polyindex = CustomData_get_layer(fdata, CD_ORIGINDEX);
unsigned int (*loopindex)[4] = NULL;
- /* Should never occure, but better abort than segfault! */
+ /* Should never occur, but better abort than segfault! */
if (!polyindex)
return;
@@ -4182,7 +4182,7 @@ void DM_init_origspace(DerivedMesh *dm)
scale[1] = 1e-9f;
invert_v2(scale);
- /* Finally, transform all vcos_2d into ((0, 0), (1, 1)) square and assing them as origspace. */
+ /* Finally, transform all vcos_2d into ((0, 0), (1, 1)) square and assign them as origspace. */
for (j = 0; j < mp->totloop; j++, lof++) {
add_v2_v2v2(lof->uv, vcos_2d[j], translate);
mul_v2_v2(lof->uv, scale);
@@ -4210,7 +4210,7 @@ static void dm_debug_info_layers(
for (type = 0; type < CD_NUMTYPES; type++) {
if (CustomData_has_layer(cd, type)) {
- /* note: doesnt account for multiple layers */
+ /* note: doesn't account for multiple layers */
const char *name = CustomData_layertype_name(type);
const int size = CustomData_sizeof(type);
const void *pt = getElemDataArray(dm, type);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index e6848876425..00e5d17128b 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -198,7 +198,7 @@ void set_active_action_group(bAction *act, bActionGroup *agrp, short select)
if (act == NULL)
return;
- /* Deactive all others */
+ /* Deactivate all others */
for (grp = act->groups.first; grp; grp = grp->next) {
if ((grp == agrp) && (select))
grp->flag |= AGRP_ACTIVE;
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index b3c6fb4f3a9..e35af19facb 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -643,7 +643,7 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua
s1 = (int)floor(ctime);
fac = (float)(s1 + 1) - ctime;
- /* path->len is corected for cyclic */
+ /* path->len is corrected for cyclic */
s0 = interval_test(0, path->len - 1 - cycl, s1 - 1, cycl);
s1 = interval_test(0, path->len - 1 - cycl, s1, cycl);
s2 = interval_test(0, path->len - 1 - cycl, s1 + 1, cycl);
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index 317994d4ed9..8d6c34222d7 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -69,12 +69,12 @@ static char btempdir_session[FILE_MAX] = ""; /* volatile temporary directory */
const char *BKE_appdir_folder_default(void)
{
#ifndef WIN32
- const char * const xdg_documents_dir = getenv("XDG_DOCUMENTS_DIR");
+ const char * const xdg_documents_dir = BLI_getenv("XDG_DOCUMENTS_DIR");
if (xdg_documents_dir)
return xdg_documents_dir;
- return getenv("HOME");
+ return BLI_getenv("HOME");
#else /* Windows */
static char documentfolder[MAXPATHLEN];
HRESULT hResult;
@@ -159,7 +159,7 @@ static bool test_path(
*/
static bool test_env_path(char *path, const char *envvar)
{
- const char *env = envvar ? getenv(envvar) : NULL;
+ const char *env = envvar ? BLI_getenv(envvar) : NULL;
if (!env) return false;
if (BLI_is_dir(env)) {
@@ -237,19 +237,51 @@ static bool is_portable_install(void)
}
/**
+ * Returns the path of a folder from environment variables
+ *
+ * \param targetpath: String to return path.
+ * \param subfolder_name: optional name of subfolder within folder.
+ * \param envvar: name of environment variable to check folder_name.
+ * \return true if it was able to construct such a path.
+ */
+static bool get_path_environment(
+ char *targetpath,
+ size_t targetpath_len,
+ const char *subfolder_name,
+ const char *envvar)
+{
+ char user_path[FILE_MAX];
+
+ if (test_env_path(user_path, envvar)) {
+ if (subfolder_name) {
+ return test_path(
+ targetpath,
+ targetpath_len,
+ user_path,
+ NULL,
+ subfolder_name);
+ }
+ else {
+ BLI_strncpy(targetpath, user_path, FILE_MAX);
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
* Returns the path of a folder within the user-files area.
*
*
* \param targetpath String to return path
* \param folder_name default name of folder within user area
* \param subfolder_name optional name of subfolder within folder
- * \param envvar name of environment variable which, if defined, overrides folder_name
- * \param ver Blender version, used to construct a subdirectory name
+ * \param ver Blender version, used to construct a subdirectory name
* \return true if it was able to construct such a path.
*/
static bool get_path_user(
char *targetpath, size_t targetpath_len, const char *folder_name, const char *subfolder_name,
- const char *envvar, const int ver)
+ const int ver)
{
char user_path[FILE_MAX];
const char *user_base_path;
@@ -260,16 +292,6 @@ static bool get_path_user(
}
user_path[0] = '\0';
- if (test_env_path(user_path, envvar)) {
- if (subfolder_name) {
- return test_path(targetpath, targetpath_len, user_path, NULL, subfolder_name);
- }
- else {
- BLI_strncpy(targetpath, user_path, FILE_MAX);
- return true;
- }
- }
-
user_base_path = (const char *)GHOST_getUserDir(ver, blender_version_decimal(ver));
if (user_base_path)
BLI_strncpy(user_path, user_base_path, FILE_MAX);
@@ -295,13 +317,12 @@ static bool get_path_user(
* \param targetpath String to return path
* \param folder_name default name of folder within installation area
* \param subfolder_name optional name of subfolder within folder
- * \param envvar name of environment variable which, if defined, overrides folder_name
* \param ver Blender version, used to construct a subdirectory name
* \return true if it was able to construct such a path.
*/
static bool get_path_system(
char *targetpath, size_t targetpath_len, const char *folder_name, const char *subfolder_name,
- const char *envvar, const int ver)
+ const int ver)
{
char system_path[FILE_MAX];
const char *system_base_path;
@@ -320,17 +341,6 @@ static bool get_path_system(
}
system_path[0] = '\0';
-
- if (test_env_path(system_path, envvar)) {
- if (subfolder_name) {
- return test_path(targetpath, targetpath_len, system_path, NULL, subfolder_name);
- }
- else {
- BLI_strncpy(targetpath, system_path, FILE_MAX);
- return true;
- }
- }
-
system_base_path = (const char *)GHOST_getSystemDir(ver, blender_version_decimal(ver));
if (system_base_path)
BLI_strncpy(system_path, system_base_path, FILE_MAX);
@@ -367,40 +377,49 @@ const char *BKE_appdir_folder_id_ex(
switch (folder_id) {
case BLENDER_DATAFILES: /* general case */
- if (get_path_user(path, path_len, "datafiles", subfolder, "BLENDER_USER_DATAFILES", ver)) break;
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_USER_DATAFILES")) break;
+ if (get_path_user(path, path_len, "datafiles", subfolder, ver)) break;
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_SYSTEM_DATAFILES")) break;
if (get_path_local(path, path_len, "datafiles", subfolder, ver)) break;
- if (get_path_system(path, path_len, "datafiles", subfolder, "BLENDER_SYSTEM_DATAFILES", ver)) break;
+ if (get_path_system(path, path_len, "datafiles", subfolder, ver)) break;
return NULL;
case BLENDER_USER_DATAFILES:
- if (get_path_user(path, path_len, "datafiles", subfolder, "BLENDER_USER_DATAFILES", ver)) break;
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_USER_DATAFILES")) break;
+ if (get_path_user(path, path_len, "datafiles", subfolder, ver)) break;
return NULL;
case BLENDER_SYSTEM_DATAFILES:
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_SYSTEM_DATAFILES")) break;
+ if (get_path_system(path, path_len, "datafiles", subfolder, ver)) break;
if (get_path_local(path, path_len, "datafiles", subfolder, ver)) break;
- if (get_path_system(path, path_len, "datafiles", subfolder, "BLENDER_SYSTEM_DATAFILES", ver)) break;
return NULL;
case BLENDER_USER_AUTOSAVE:
- if (get_path_user(path, path_len, "autosave", subfolder, "BLENDER_USER_DATAFILES", ver)) break;
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_USER_DATAFILES")) break;
+ if (get_path_user(path, path_len, "autosave", subfolder, ver)) break;
return NULL;
case BLENDER_USER_CONFIG:
- if (get_path_user(path, path_len, "config", subfolder, "BLENDER_USER_CONFIG", ver)) break;
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_USER_CONFIG")) break;
+ if (get_path_user(path, path_len, "config", subfolder, ver)) break;
return NULL;
case BLENDER_USER_SCRIPTS:
- if (get_path_user(path, path_len, "scripts", subfolder, "BLENDER_USER_SCRIPTS", ver)) break;
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_USER_SCRIPTS")) break;
+ if (get_path_user(path, path_len, "scripts", subfolder, ver)) break;
return NULL;
case BLENDER_SYSTEM_SCRIPTS:
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_SYSTEM_SCRIPTS")) break;
+ if (get_path_system(path, path_len, "scripts", subfolder, ver)) break;
if (get_path_local(path, path_len, "scripts", subfolder, ver)) break;
- if (get_path_system(path, path_len, "scripts", subfolder, "BLENDER_SYSTEM_SCRIPTS", ver)) break;
return NULL;
case BLENDER_SYSTEM_PYTHON:
+ if (get_path_environment(path, path_len, subfolder, "BLENDER_SYSTEM_PYTHON")) break;
+ if (get_path_system(path, path_len, "python", subfolder, ver)) break;
if (get_path_local(path, path_len, "python", subfolder, ver)) break;
- if (get_path_system(path, path_len, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
return NULL;
default:
@@ -428,16 +447,20 @@ const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *su
switch (folder_id) {
case BLENDER_USER_DATAFILES:
- get_path_user(path, sizeof(path), "datafiles", subfolder, "BLENDER_USER_DATAFILES", ver);
+ if (get_path_environment(path, sizeof(path), subfolder, "BLENDER_USER_DATAFILES")) break;
+ get_path_user(path, sizeof(path), "datafiles", subfolder, ver);
break;
case BLENDER_USER_CONFIG:
- get_path_user(path, sizeof(path), "config", subfolder, "BLENDER_USER_CONFIG", ver);
+ if (get_path_environment(path, sizeof(path), subfolder, "BLENDER_USER_CONFIG")) break;
+ get_path_user(path, sizeof(path), "config", subfolder, ver);
break;
case BLENDER_USER_AUTOSAVE:
- get_path_user(path, sizeof(path), "autosave", subfolder, "BLENDER_USER_AUTOSAVE", ver);
+ if (get_path_environment(path, sizeof(path), subfolder, "BLENDER_USER_AUTOSAVE")) break;
+ get_path_user(path, sizeof(path), "autosave", subfolder, ver);
break;
case BLENDER_USER_SCRIPTS:
- get_path_user(path, sizeof(path), "scripts", subfolder, "BLENDER_USER_SCRIPTS", ver);
+ if (get_path_environment(path, sizeof(path), subfolder, "BLENDER_USER_SCRIPTS")) break;
+ get_path_user(path, sizeof(path), "scripts", subfolder, ver);
break;
default:
BLI_assert(0);
@@ -481,13 +504,13 @@ const char *BKE_appdir_folder_id_version(const int folder_id, const int ver, con
bool ok;
switch (folder_id) {
case BLENDER_RESOURCE_PATH_USER:
- ok = get_path_user(path, sizeof(path), NULL, NULL, NULL, ver);
+ ok = get_path_user(path, sizeof(path), NULL, NULL, ver);
break;
case BLENDER_RESOURCE_PATH_LOCAL:
ok = get_path_local(path, sizeof(path), NULL, NULL, ver);
break;
case BLENDER_RESOURCE_PATH_SYSTEM:
- ok = get_path_system(path, sizeof(path), NULL, NULL, NULL, ver);
+ ok = get_path_system(path, sizeof(path), NULL, NULL, ver);
break;
default:
path[0] = '\0'; /* in case do_check is false */
@@ -743,7 +766,7 @@ static void where_is_temp(char *fullname, char *basename, const size_t maxlen, c
#ifdef WIN32
if (fullname[0] == '\0') {
- const char *tmp = getenv("TEMP"); /* Windows */
+ const char *tmp = BLI_getenv("TEMP"); /* Windows */
if (tmp && BLI_is_dir(tmp)) {
BLI_strncpy(fullname, tmp, maxlen);
}
@@ -751,14 +774,14 @@ static void where_is_temp(char *fullname, char *basename, const size_t maxlen, c
#else
/* Other OS's - Try TMP and TMPDIR */
if (fullname[0] == '\0') {
- const char *tmp = getenv("TMP");
+ const char *tmp = BLI_getenv("TMP");
if (tmp && BLI_is_dir(tmp)) {
BLI_strncpy(fullname, tmp, maxlen);
}
}
if (fullname[0] == '\0') {
- const char *tmp = getenv("TMPDIR");
+ const char *tmp = BLI_getenv("TMPDIR");
if (tmp && BLI_is_dir(tmp)) {
BLI_strncpy(fullname, tmp, maxlen);
}
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index b7a811b7574..2eded2ee8f1 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1068,7 +1068,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
GHash *idx_hash = BLI_ghash_ptr_new("pose channel index by name");
int pchan_index = 0;
for (pchan = armOb->pose->chanbase.first; pchan != NULL; pchan = pchan->next, ++pchan_index) {
- BLI_ghash_insert(idx_hash, pchan, SET_INT_IN_POINTER(pchan_index));
+ BLI_ghash_insert(idx_hash, pchan, POINTER_FROM_INT(pchan_index));
}
for (i = 0, dg = target->defbase.first; dg; i++, dg = dg->next) {
defnrToPC[i] = BKE_pose_channel_find_name(armOb->pose, dg->name);
@@ -1078,7 +1078,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
defnrToPC[i] = NULL;
}
else {
- defnrToPCIndex[i] = GET_INT_FROM_POINTER(BLI_ghash_lookup(idx_hash, defnrToPC[i]));
+ defnrToPCIndex[i] = POINTER_AS_INT(BLI_ghash_lookup(idx_hash, defnrToPC[i]));
}
}
}
diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c
index c99894bfbaf..b33b07e3a4f 100644
--- a/source/blender/blenkernel/intern/bmfont.c
+++ b/source/blender/blenkernel/intern/bmfont.c
@@ -85,7 +85,7 @@ void readBitmapFontVersion0(ImBuf *ibuf, unsigned char *rect, int step)
{
int glyphcount, bytes, i, index, linelength, ysize;
unsigned char *buffer;
- bmFont * bmfont;
+ bmFont *bmfont;
linelength = ibuf->x * step;
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index 18b2a5b2fcc..10f7a3b9457 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -1283,7 +1283,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
/* integrate new location & velocity */
/* by regarding the acceleration as a force at this stage we*/
- /* can get better control allthough it's a bit unphysical */
+ /* can get better control although it's a bit unphysical */
mul_v3_fl(acc, 1.0f/pa_mass);
copy_v3_v3(dvec, acc);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 42cd7968321..50e0d158ce0 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -954,7 +954,7 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec
texcache = MEM_callocN(sizeof(int) * side * side, "Brush texture cache");
- /* do normalized cannonical view coords for texture */
+ /* do normalized canonical view coords for texture */
for (y = -1.0, iy = 0; iy < side; iy++, y += step) {
for (x = -1.0, ix = 0; ix < side; ix++, x += step) {
co[0] = x;
@@ -962,7 +962,7 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec
co[2] = 0.0f;
/* This is copied from displace modifier code */
- /* TODO(sergey): brush are always cacheing with CM enabled for now. */
+ /* TODO(sergey): brush are always caching with CM enabled for now. */
externtex(mtex, co, &intensity,
rgba, rgba + 1, rgba + 2, rgba + 3, 0, NULL, false, false);
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index e48c6ff38d2..151d697d891 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -1097,7 +1097,7 @@ BVHTree *bvhtree_from_mesh_get(
int looptri_num = dm->getNumLoopTri(dm);
/* this assert checks we have looptris,
- * if not caller should use DM_ensure_looptri() */
+ * if not caller should use DM_ensure_looptri() */
BLI_assert(!(looptri_num == 0 && dm->getNumPolys(dm) != 0));
tree = bvhtree_from_mesh_looptri_create_tree(
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 1c5b1ca242c..ed2b8cddc14 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -2735,7 +2735,7 @@ void CDDM_calc_loop_normals_spacearr(
r_lnors_spacearr->lspacearr[i]->ref_beta, r_lnors_spacearr->lspacearr[i]->loops);
printf("\t\t(shared with loops");
while (loops) {
- printf(" %d", GET_INT_FROM_POINTER(loops->link));
+ printf(" %d", POINTER_AS_INT(loops->link));
loops = loops->next;
}
printf(")\n");
@@ -3067,13 +3067,13 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
void **val_p;
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- newe[i] = GET_INT_FROM_POINTER(*val_p);
+ newe[i] = POINTER_AS_INT(*val_p);
}
else {
STACK_PUSH(olde, i);
STACK_PUSH(medge, *med);
newe[i] = c;
- *val_p = SET_INT_IN_POINTER(c);
+ *val_p = POINTER_FROM_INT(c);
c++;
}
}
@@ -3235,7 +3235,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
uint v2 = mlv;
BLI_assert(v1 != v2);
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- last_valid_ml->e = GET_INT_FROM_POINTER(*val_p);
+ last_valid_ml->e = POINTER_AS_INT(*val_p);
}
else {
const int new_eidx = STACK_SIZE(medge);
@@ -3244,7 +3244,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
medge[new_eidx].v1 = last_valid_ml->v;
medge[new_eidx].v2 = ml->v;
/* DO NOT change newe mapping, could break actual values due to some deleted original edges. */
- *val_p = SET_INT_IN_POINTER(new_eidx);
+ *val_p = POINTER_FROM_INT(new_eidx);
created_edges++;
last_valid_ml->e = new_eidx;
@@ -3287,7 +3287,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
uint v2 = (vtargetmap[first_valid_ml->v] != -1) ? vtargetmap[first_valid_ml->v] : first_valid_ml->v;
BLI_assert(v1 != v2);
if (BLI_edgehash_ensure_p(ehash, v1, v2, &val_p)) {
- last_valid_ml->e = GET_INT_FROM_POINTER(*val_p);
+ last_valid_ml->e = POINTER_AS_INT(*val_p);
}
else {
const int new_eidx = STACK_SIZE(medge);
@@ -3296,7 +3296,7 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
medge[new_eidx].v1 = last_valid_ml->v;
medge[new_eidx].v2 = first_valid_ml->v;
/* DO NOT change newe mapping, could break actual values due to some deleted original edges. */
- *val_p = SET_INT_IN_POINTER(new_eidx);
+ *val_p = POINTER_FROM_INT(new_eidx);
created_edges++;
last_valid_ml->e = new_eidx;
@@ -3491,7 +3491,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
eh = BLI_edgehash_new_ex(__func__, eh_reserve);
if (med) {
for (i = 0; i < numEdges; i++, med++) {
- BLI_edgehash_insert(eh, med->v1, med->v2, SET_INT_IN_POINTER(i + 1));
+ BLI_edgehash_insert(eh, med->v1, med->v2, POINTER_FROM_INT(i + 1));
}
}
@@ -3520,7 +3520,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
BLI_edgehashIterator_step(ehi), ++i, ++med, ++index)
{
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
- j = GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
+ j = POINTER_AS_INT(BLI_edgehashIterator_getValue(ehi));
if (j == 0 || !eindex) {
med->flag = ME_EDGEDRAW | ME_EDGERENDER;
@@ -3531,7 +3531,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
*index = eindex[j - 1];
}
- BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(i));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(i));
}
BLI_edgehashIterator_free(ehi);
@@ -3548,7 +3548,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
for (j = 0; j < mp->totloop; j++, ml++) {
v1 = ml->v;
v2 = ME_POLY_LOOP_NEXT(cddm->mloop, mp, j)->v;
- ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(eh, v1, v2));
+ ml->e = POINTER_AS_INT(BLI_edgehash_lookup(eh, v1, v2));
}
}
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 26f998b3cb4..22fdcb9ea1f 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -553,11 +553,11 @@ void cloth_free_modifier(ClothModifierData *clmd )
if (cloth->edgeset)
BLI_edgeset_free(cloth->edgeset);
-
- /*
- if (clmd->clothObject->facemarks)
- MEM_freeN(clmd->clothObject->facemarks);
- */
+#if 0
+ if (clmd->clothObject->facemarks) {
+ MEM_freeN(clmd->clothObject->facemarks);
+ }
+#endif
MEM_freeN ( cloth );
clmd->clothObject = NULL;
}
@@ -620,10 +620,11 @@ void cloth_free_modifier_extern(ClothModifierData *clmd )
BLI_edgeset_free(cloth->edgeset);
- /*
- if (clmd->clothObject->facemarks)
- MEM_freeN(clmd->clothObject->facemarks);
- */
+#if 0
+ if (clmd->clothObject->facemarks) {
+ MEM_freeN(clmd->clothObject->facemarks);
+ }
+#endif
MEM_freeN ( cloth );
clmd->clothObject = NULL;
}
@@ -1439,7 +1440,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
}
else {
/* bending springs for hair strands */
- /* The current algorightm only goes through the edges in order of the mesh edges list */
+ /* The current algorithm only goes through the edges in order of the mesh edges list */
/* and makes springs between the outer vert of edges sharing a vertice. This works just */
/* fine for hair, but not for user generated string meshes. This could/should be later */
/* extended to work with non-ordered edges so that it can be used for general "rope */
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index b38d6b8bceb..1df749ee842 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -1339,6 +1339,14 @@ void cloth_find_point_contacts(Object *ob, ClothModifierData *clmd, float step,
// static collisions
////////////////////////////////////////////////////////////
+ /* Check we do have collision objects to test against, before doing anything else. */
+ collobjs = get_collisionobjects(clmd->scene, ob, clmd->coll_parms->group, &numcollobj, eModifierType_Collision);
+ if (!collobjs) {
+ *r_collider_contacts = NULL;
+ *r_totcolliders = 0;
+ return;
+ }
+
// create temporary cloth points bvh
cloth_bvh = BLI_bvhtree_new(mvert_num, max_ff(clmd->coll_parms->epsilon, clmd->coll_parms->distance_repel), 4, 6);
/* fill tree */
@@ -1353,13 +1361,6 @@ void cloth_find_point_contacts(Object *ob, ClothModifierData *clmd, float step,
/* balance tree */
BLI_bvhtree_balance(cloth_bvh);
- collobjs = get_collisionobjects(clmd->scene, ob, clmd->coll_parms->group, &numcollobj, eModifierType_Collision);
- if (!collobjs) {
- *r_collider_contacts = NULL;
- *r_totcolliders = 0;
- return;
- }
-
/* move object to position (step) in time */
for (i = 0; i < numcollobj; i++) {
Object *collob= collobjs[i];
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 7d861658993..2f3a18cd163 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -2551,7 +2551,7 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
unit_m3(totmat);
}
- /* apply out transformaton to the object */
+ /* apply out transformation to the object */
mul_m4_m3m4(cob->matrix, totmat, cob->matrix);
}
}
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 517d2ebe10e..c9468c7d95c 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -206,7 +206,7 @@ void CTX_store_free_list(ListBase *contexts)
}
}
-/* is python initialied? */
+/* is python initialized? */
int CTX_py_init_get(bContext *C)
{
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 792ba08358e..ea3c6c485ec 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -2077,7 +2077,7 @@ static bool bevelinside(BevList *bl1, BevList *bl2)
copy_v3_v3(hvec2, hvec1);
hvec2[0] += 1000;
- /* test it with all edges of potential surounding poly */
+ /* test it with all edges of potential surrounding poly */
/* count number of transitions left-right */
bevp = bl1->bevpoints;
@@ -2640,7 +2640,7 @@ static void make_bevel_list_segment_2D(BevList *bl)
static void make_bevel_list_2D(BevList *bl)
{
/* note: bevp->dir and bevp->quat are not needed for beveling but are
- * used when making a path from a 2D curve, therefor they need to be set - Campbell */
+ * used when making a path from a 2D curve, therefore they need to be set - Campbell */
BevPoint *bevp0, *bevp1, *bevp2;
int nr;
@@ -3938,7 +3938,7 @@ static void bezier_handle_calc_smooth_fcurve(BezTriple *bezt, int total, int sta
float first_handle_adj = 0.0f, last_handle_adj = 0.0f;
if (full_cycle) {
- /* reduce the number of uknowns by one */
+ /* reduce the number of unknowns by one */
int i = solve_count = count - 1;
dx[0] = dx[i];
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 28280c45922..8fa117dfce1 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2890,7 +2890,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest,
}
}
-/*Bmesh Custom Data Functions. Should replace editmesh ones with these as well, due to more effecient memory alloc*/
+/*Bmesh Custom Data Functions. Should replace editmesh ones with these as well, due to more efficient memory alloc*/
void *CustomData_bmesh_get(const CustomData *data, void *block, int type)
{
int layer_index;
diff --git a/source/blender/blenkernel/intern/data_transfer.c b/source/blender/blenkernel/intern/data_transfer.c
index 38340575e74..7407fc2051f 100644
--- a/source/blender/blenkernel/intern/data_transfer.c
+++ b/source/blender/blenkernel/intern/data_transfer.c
@@ -833,7 +833,7 @@ static bool data_transfer_layersmapping_generate(
return ret;
}
else if (cddata_type == CD_FAKE_SHAPEKEY) {
- /* TODO: leaving shapekeys asside for now, quite specific case, since we can't access them from MVert :/ */
+ /* TODO: leaving shapekeys aside for now, quite specific case, since we can't access them from MVert :/ */
return false;
}
}
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index ab5fe1d45f5..661c802d64e 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -778,7 +778,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
error = 1;
if (!error) {
- /* calculate number of points withing each cell */
+ /* calculate number of points within each cell */
{
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
@@ -1373,7 +1373,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, const b
}
/* also add number of vertices to temp_data
- * to locate points on "mesh edge" */
+ * to locate points on "mesh edge" */
for (i = 0; i < numOfPolys; i++) {
for (int j = 0; j < mpoly[i].totloop; j++) {
temp_data[mloop[mpoly[i].loopstart + j].v]++;
@@ -1381,7 +1381,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, const b
}
/* now check if total number of edges+faces for
- * each vertex is even, if not -> vertex is on mesh edge */
+ * each vertex is even, if not -> vertex is on mesh edge */
for (i = 0; i < sData->total_points; i++) {
if ((temp_data[i] % 2) || (temp_data[i] < 4)) {
ad->flags[i] |= ADJ_ON_MESH_EDGE;
@@ -1415,7 +1415,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, const b
}
else if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) {
/* for image sequences, only allocate memory.
- * bake initialization takes care of rest */
+ * bake initialization takes care of rest */
}
MEM_freeN(temp_data);
@@ -1583,7 +1583,7 @@ static void dynamicPaint_setInitialColor(const Scene *scene, DynamicPaintSurface
return;
/* for vertex surface loop through tfaces and find uv color
- * that provides highest alpha */
+ * that provides highest alpha */
if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX) {
struct ImagePool *pool = BKE_image_pool_new();
@@ -1988,7 +1988,7 @@ static DerivedMesh *dynamicPaint_Modifier_apply(
DM_update_weight_mcol(ob, result, 0, weight, 0, NULL);
}
- /* apply weights into a vertex group, if doesnt exists add a new layer */
+ /* apply weights into a vertex group, if doesn't exists add a new layer */
if (defgrp_index != -1 && !dvert && (surface->output_name[0] != '\0')) {
dvert = CustomData_add_layer(&result->vertData, CD_MDEFORMVERT, CD_CALLOC,
NULL, sData->total_points);
@@ -2908,7 +2908,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
int cursor = 0;
/* Create a temporary array of final indexes (before unassigned
- * pixels have been dropped) */
+ * pixels have been dropped) */
for (int i = 0; i < w * h; i++) {
if (tempPoints[i].tri_index != -1) {
final_index[i] = cursor;
@@ -3223,7 +3223,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam
setError(surface->canvas, N_("Image save failed: invalid surface"));
return;
}
- /* if selected format is openexr, but current build doesnt support one */
+ /* if selected format is openexr, but current build doesn't support one */
#ifndef WITH_OPENEXR
if (format == R_IMF_IMTYPE_OPENEXR)
format = R_IMF_IMTYPE_PNG;
@@ -3458,9 +3458,9 @@ static void mesh_tris_spherecast_dp(void *userdata, int index, const BVHTreeRay
}
/* A modified callback to bvh tree nearest point. The tree must have been built using bvhtree_from_mesh_looptri.
- * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
+ * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
*
- * To optimize brush detection speed this doesn't calculate hit normal.
+ * To optimize brush detection speed this doesn't calculate hit normal.
*/
static void mesh_tris_nearest_point_dp(void *userdata, int index, const float co[3], BVHTreeNearest *nearest)
{
@@ -3516,7 +3516,7 @@ static void dynamicPaint_mixPaintColors(
/* mix wetness and alpha depending on selected alpha mode */
if (paintFlags & MOD_DPAINT_ABS_ALPHA) {
- /* update values to the brush level unless theyre higher already */
+ /* update values to the brush level unless they're higher already */
CLAMP_MIN(pPoint->e_color[3], paintAlpha);
CLAMP_MIN(pPoint->wetness, paintWetness);
}
@@ -4119,7 +4119,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
interp_weights_tri_v3(weights, mvert[v1].co, mvert[v2].co, mvert[v3].co, hitCoord);
/* simple check based on brush surface velocity,
- * todo: perhaps implement something that handles volume movement as well */
+ * todo: perhaps implement something that handles volume movement as well. */
/* interpolate vertex speed vectors to get hit point velocity */
interp_v3_v3v3v3(brushPointVelocity,
@@ -4858,7 +4858,7 @@ static void surface_determineForceTargetPoints(
const float closest_dot = dot_v3v3(bNeighs[n_index].dir, bNeighs[closest_id[0]].dir);
/* only accept neighbor at "other side" of the first one in relation to force dir
- * so make sure angle between this and closest neigh is greater than first angle */
+ * so make sure angle between this and closest neigh is greater than first angle. */
if (dir_dot > closest_d[1] && closest_dot < closest_d[0] && dir_dot > 0.0f) {
closest_d[1] = dir_dot;
closest_id[1] = n_index;
@@ -4875,7 +4875,7 @@ static void surface_determineForceTargetPoints(
float temp;
/* project force vector on the plane determined by these two neighbor points
- * and calculate relative force angle from it*/
+ * and calculate relative force angle from it. */
cross_v3_v3v3(tangent, bNeighs[closest_id[0]].dir, bNeighs[closest_id[1]].dir);
normalize_v3(tangent);
force_intersect = dot_v3v3(force, tangent);
@@ -5025,7 +5025,7 @@ static void dynamic_paint_prepare_effect_cb(
/* if global gravity is enabled, add it too */
if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)
/* also divide by 10 to about match default grav
- * with default force strength (1.0) */
+ * with default force strength (1.0). */
madd_v3_v3fl(forc, scene->physics_settings.gravity,
surface->effector_weights->global_gravity * surface->effector_weights->weight[0] / 10.f);
@@ -5087,7 +5087,7 @@ static int dynamicPaint_prepareEffectStep(
}
/* Get number of required steps using average point distance
- * so that just a few ultra close pixels wont up substeps to max */
+ * so that just a few ultra close pixels wont up substeps to max. */
/* adjust number of required substep by fastest active effect */
if (surface->effect & MOD_DPAINT_EFFECT_DO_SPREAD)
@@ -5188,7 +5188,7 @@ static void dynamic_paint_effect_shrink_cb(
totalAlpha += pPoint_prev->e_color[3];
/* Check if neighboring point has lower alpha,
- * if so, decrease this point's alpha as well*/
+ * if so, decrease this point's alpha as well. */
if (pPoint->color[3] <= 0.0f && pPoint->e_color[3] <= 0.0f && pPoint->wetness <= 0.0f)
continue;
@@ -5573,7 +5573,7 @@ static void dynamic_paint_wave_step_cb(
}
if (data->reset_wave) {
- /* if there wasnt any brush intersection, clear isect height */
+ /* if there wasn't any brush intersection, clear isect height */
if (wPoint->state == DPAINT_WAVE_NONE) {
wPoint->brush_isect = 0.0f;
}
@@ -5699,7 +5699,7 @@ static void dynamic_paint_surface_pre_step_cb(
/* now calculate new alpha for dry layer that keeps final blended color unchanged */
pPoint->color[3] = (f_color[3] - pPoint->e_color[3]) / (1.0f - pPoint->e_color[3]);
/* for each rgb component, calculate a new dry layer color that keeps the final blend color
- * with these new alpha values. (wet layer color doesnt change)*/
+ * with these new alpha values. (wet layer color doesn't change)*/
if (pPoint->color[3]) {
for (i = 0; i < 3; i++) {
pPoint->color[i] = (f_color[i] * f_color[3] - pPoint->e_color[i] * pPoint->e_color[3]) /
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index fa4e4372273..db9ce6c9b7d 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -229,7 +229,7 @@ static void emDM_calcLoopNormalsSpaceArray(
r_lnors_spacearr->lspacearr[i]->ref_beta, r_lnors_spacearr->lspacearr[i]->loops);
printf("\t\t(shared with loops");
while (loops) {
- printf(" %d", GET_INT_FROM_POINTER(loops->link));
+ printf(" %d", POINTER_AS_INT(loops->link));
loops = loops->next;
}
printf(")\n");
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 89f85530439..82bf65993a8 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -56,7 +56,7 @@
#include "PIL_time.h"
-#include "BKE_anim.h" /* needed for where_on_path */
+#include "BKE_anim.h" /* needed for where_on_path */
#include "BKE_collision.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
@@ -87,8 +87,9 @@ EffectorWeights *BKE_add_effector_weights(Group *group)
EffectorWeights *weights = MEM_callocN(sizeof(EffectorWeights), "EffectorWeights");
int i;
- for (i=0; i<NUM_PFIELD_TYPES; i++)
+ for (i = 0; i < NUM_PFIELD_TYPES; i++) {
weights->weight[i] = 1.0f;
+ }
weights->global_gravity = 1.0f;
@@ -100,13 +101,13 @@ PartDeflect *object_add_collision_fields(int type)
{
PartDeflect *pd;
- pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect");
+ pd = MEM_callocN(sizeof(PartDeflect), "PartDeflect");
pd->forcefield = type;
pd->pdef_sbdamp = 0.1f;
pd->pdef_sbift = 0.2f;
pd->pdef_sboft = 0.02f;
- pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128;
+ pd->seed = ((uint)(ceil(PIL_check_seconds_timer())) + 1) % 128;
pd->f_strength = 1.0f;
pd->f_damp = 1.0f;
@@ -126,7 +127,7 @@ PartDeflect *object_add_collision_fields(int type)
pd->f_flow = 1.0f;
break;
}
- pd->flag = PFIELD_DO_LOCATION|PFIELD_DO_ROTATION;
+ pd->flag = PFIELD_DO_LOCATION | PFIELD_DO_ROTATION;
return pd;
}
@@ -136,12 +137,12 @@ PartDeflect *object_add_collision_fields(int type)
/* -------------------------- Effectors ------------------ */
void free_partdeflect(PartDeflect *pd)
{
- if (!pd)
+ if (!pd) {
return;
-
- if (pd->rng)
+ }
+ if (pd->rng) {
BLI_rng_free(pd->rng);
-
+ }
MEM_freeN(pd);
}
@@ -159,15 +160,18 @@ static void add_object_to_effectors(ListBase **effectors, Scene *scene, Effector
{
EffectorCache *eff = NULL;
- if ( ob == ob_src )
+ if (ob == ob_src) {
return;
+ }
if (for_simulation) {
- if (weights->weight[ob->pd->forcefield] == 0.0f )
+ if (weights->weight[ob->pd->forcefield] == 0.0f) {
return;
+ }
- if (ob->pd->shape == PFIELD_SHAPE_POINTS && !ob->derivedFinal )
+ if (ob->pd->shape == PFIELD_SHAPE_POINTS && !ob->derivedFinal) {
return;
+ }
}
if (*effectors == NULL)
@@ -182,72 +186,70 @@ static void add_object_to_effectors(ListBase **effectors, Scene *scene, Effector
}
static void add_particles_to_effectors(ListBase **effectors, Scene *scene, EffectorWeights *weights, Object *ob, ParticleSystem *psys, ParticleSystem *psys_src, bool for_simulation)
{
- ParticleSettings *part= psys->part;
+ ParticleSettings *part = psys->part;
- if ( !psys_check_enabled(ob, psys, G.is_rendering) )
+ if (!psys_check_enabled(ob, psys, G.is_rendering)) {
return;
-
- if ( psys == psys_src && (part->flag & PART_SELF_EFFECT) == 0)
+ }
+ if (psys == psys_src && (part->flag & PART_SELF_EFFECT) == 0) {
return;
-
- if ( part->pd && part->pd->forcefield && (!for_simulation || weights->weight[part->pd->forcefield] != 0.0f)) {
- if (*effectors == NULL)
+ }
+ if (part->pd && part->pd->forcefield && (!for_simulation || weights->weight[part->pd->forcefield] != 0.0f)) {
+ if (*effectors == NULL) {
*effectors = MEM_callocN(sizeof(ListBase), "effectors list");
-
+ }
BLI_addtail(*effectors, new_effector_cache(scene, ob, psys, part->pd));
}
if (part->pd2 && part->pd2->forcefield && (!for_simulation || weights->weight[part->pd2->forcefield] != 0.0f)) {
- if (*effectors == NULL)
+ if (*effectors == NULL) {
*effectors = MEM_callocN(sizeof(ListBase), "effectors list");
-
+ }
BLI_addtail(*effectors, new_effector_cache(scene, ob, psys, part->pd2));
}
}
/* returns ListBase handle with objects taking part in the effecting */
-ListBase *pdInitEffectors(Scene *scene, Object *ob_src, ParticleSystem *psys_src,
- EffectorWeights *weights, bool for_simulation)
+ListBase *pdInitEffectors(
+ Scene *scene, Object *ob_src, ParticleSystem *psys_src,
+ EffectorWeights *weights, bool for_simulation)
{
- Base *base;
- unsigned int layer= ob_src->lay;
+ const uint layer = ob_src->lay;
ListBase *effectors = NULL;
if (weights->group) {
- GroupObject *go;
-
- for (go= weights->group->gobject.first; go; go= go->next) {
- if ( (go->ob->lay & layer) ) {
- if ( go->ob->pd && go->ob->pd->forcefield )
+ for (GroupObject *go = weights->group->gobject.first; go; go = go->next) {
+ if ((go->ob->lay & layer)) {
+ if (go->ob->pd && go->ob->pd->forcefield) {
add_object_to_effectors(&effectors, scene, weights, go->ob, ob_src, for_simulation);
+ }
- if ( go->ob->particlesystem.first ) {
- ParticleSystem *psys= go->ob->particlesystem.first;
-
- for ( ; psys; psys=psys->next )
+ if (go->ob->particlesystem.first) {
+ for (ParticleSystem *psys = go->ob->particlesystem.first; psys; psys = psys->next) {
add_particles_to_effectors(&effectors, scene, weights, go->ob, psys, psys_src, for_simulation);
+ }
}
}
}
}
else {
- for (base = scene->base.first; base; base= base->next) {
- if ( (base->lay & layer) ) {
- if ( base->object->pd && base->object->pd->forcefield )
+ for (Base *base = scene->base.first; base; base = base->next) {
+ if ((base->lay & layer)) {
+ if (base->object->pd && base->object->pd->forcefield) {
add_object_to_effectors(&effectors, scene, weights, base->object, ob_src, for_simulation);
-
- if ( base->object->particlesystem.first ) {
- ParticleSystem *psys= base->object->particlesystem.first;
-
- for ( ; psys; psys=psys->next )
+ }
+ if (base->object->particlesystem.first) {
+ for (ParticleSystem *psys = base->object->particlesystem.first; psys; psys = psys->next) {
add_particles_to_effectors(&effectors, scene, weights, base->object, psys, psys_src, for_simulation);
+ }
}
}
}
}
- if (for_simulation)
+ if (for_simulation) {
pdPrecalculateEffectors(effectors);
+ }
return effectors;
}
@@ -255,11 +257,10 @@ ListBase *pdInitEffectors(Scene *scene, Object *ob_src, ParticleSystem *psys_src
void pdEndEffectors(ListBase **effectors)
{
if (*effectors) {
- EffectorCache *eff = (*effectors)->first;
-
- for (; eff; eff=eff->next) {
- if (eff->guide_data)
+ for (EffectorCache *eff = (*effectors)->first; eff; eff = eff->next) {
+ if (eff->guide_data) {
MEM_freeN(eff->guide_data);
+ }
}
BLI_freelistN(*effectors);
@@ -270,17 +271,23 @@ void pdEndEffectors(ListBase **effectors)
static void precalculate_effector(EffectorCache *eff)
{
- unsigned int cfra = (unsigned int)(eff->scene->r.cfra >= 0 ? eff->scene->r.cfra : -eff->scene->r.cfra);
- if (!eff->pd->rng)
+ uint cfra = (uint)(eff->scene->r.cfra >= 0 ? eff->scene->r.cfra : -eff->scene->r.cfra);
+ if (!eff->pd->rng) {
eff->pd->rng = BLI_rng_new(eff->pd->seed + cfra);
- else
+ }
+ else {
BLI_rng_srandom(eff->pd->rng, eff->pd->seed + cfra);
+ }
- if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type==OB_CURVE) {
- Curve *cu= eff->ob->data;
+ if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type == OB_CURVE) {
+ Curve *cu = eff->ob->data;
if (cu->flag & CU_PATH) {
- if (eff->ob->curve_cache == NULL || eff->ob->curve_cache->path==NULL || eff->ob->curve_cache->path->data==NULL)
+ if ((eff->ob->curve_cache == NULL) ||
+ (eff->ob->curve_cache->path == NULL) ||
+ (eff->ob->curve_cache->path->data == NULL))
+ {
BKE_displist_make_curveTypes(eff->scene, eff->ob, 0);
+ }
if (eff->ob->curve_cache->path && eff->ob->curve_cache->path->data) {
where_on_path(eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL);
@@ -290,12 +297,14 @@ static void precalculate_effector(EffectorCache *eff)
}
}
else if (eff->pd->shape == PFIELD_SHAPE_SURFACE) {
- eff->surmd = (SurfaceModifierData *)modifiers_findByType( eff->ob, eModifierType_Surface );
- if (eff->ob->type == OB_CURVE)
+ eff->surmd = (SurfaceModifierData *)modifiers_findByType(eff->ob, eModifierType_Surface);
+ if (eff->ob->type == OB_CURVE) {
eff->flag |= PE_USE_NORMAL_DATA;
+ }
}
- else if (eff->psys)
+ else if (eff->psys) {
psys_update_particle_tree(eff->psys, eff->scene->r.cfra);
+ }
/* Store object velocity */
if (eff->ob) {
@@ -311,9 +320,9 @@ static void precalculate_effector(EffectorCache *eff)
void pdPrecalculateEffectors(ListBase *effectors)
{
if (effectors) {
- EffectorCache *eff = effectors->first;
- for (; eff; eff=eff->next)
+ for (EffectorCache *eff = effectors->first; eff; eff = eff->next) {
precalculate_effector(eff);
+ }
}
}
@@ -400,14 +409,15 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
float norm[3], len = 0.0;
float visibility = 1.0, absorption = 0.0;
- if (!(eff->pd->flag & PFIELD_VISIBILITY))
+ if (!(eff->pd->flag & PFIELD_VISIBILITY)) {
return visibility;
-
- if (!colls)
+ }
+ if (!colls) {
colls = get_collider_cache(eff->scene, eff->ob, NULL);
-
- if (!colls)
+ }
+ if (!colls) {
return visibility;
+ }
negate_v3_v3(norm, efd->vec_to_point);
len = normalize_v3(norm);
@@ -416,9 +426,9 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
for (col = colls->first; col; col = col->next) {
CollisionModifierData *collmd = col->collmd;
- if (col->ob == eff->ob)
+ if (col->ob == eff->ob) {
continue;
-
+ }
if (collmd->bvhtree) {
BVHTreeRayHit hit;
@@ -430,13 +440,14 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
collmd->bvhtree, point->loc, norm, 0.0f, &hit,
eff_tri_ray_hit, NULL, raycast_flag) != -1)
{
- absorption= col->ob->pd->absorption;
+ absorption = col->ob->pd->absorption;
/* visibility is only between 0 and 1, calculated from 1-absorption */
- visibility *= CLAMPIS(1.0f-absorption, 0.0f, 1.0f);
+ visibility *= CLAMPIS(1.0f - absorption, 0.0f, 1.0f);
- if (visibility <= 0.0f)
+ if (visibility <= 0.0f) {
break;
+ }
}
}
}
@@ -450,14 +461,15 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
// noise function for wind e.g.
static float wind_func(struct RNG *rng, float strength)
{
- int random = (BLI_rng_get_int(rng)+1) % 128; // max 2357
+ int random = (BLI_rng_get_int(rng) + 1) % 128; /* max 2357 */
float force = BLI_rng_get_float(rng) + 1.0f;
float ret;
float sign = 0;
- sign = ((float)random > 64.0f) ? 1.0f: -1.0f; // dividing by 2 is not giving equal sign distribution
+ /* Dividing by 2 is not giving equal sign distribution. */
+ sign = ((float)random > 64.0f) ? 1.0f : -1.0f;
- ret = sign*((float)random / force)*strength/128.0f;
+ ret = sign * ((float)random / force) * strength / 128.0f;
return ret;
}
@@ -477,17 +489,17 @@ static float falloff_func(float fac, int usemin, float mindist, int usemax, floa
if (!usemin)
mindist = 0.0;
- return pow((double)(1.0f+fac-mindist), (double)(-power));
+ return pow((double)(1.0f + fac - mindist), (double)(-power));
}
static float falloff_func_dist(PartDeflect *pd, float fac)
{
- return falloff_func(fac, pd->flag&PFIELD_USEMIN, pd->mindist, pd->flag&PFIELD_USEMAX, pd->maxdist, pd->f_power);
+ return falloff_func(fac, pd->flag & PFIELD_USEMIN, pd->mindist, pd->flag & PFIELD_USEMAX, pd->maxdist, pd->f_power);
}
static float falloff_func_rad(PartDeflect *pd, float fac)
{
- return falloff_func(fac, pd->flag&PFIELD_USEMINR, pd->minrad, pd->flag&PFIELD_USEMAXR, pd->maxrad, pd->f_power_r);
+ return falloff_func(fac, pd->flag & PFIELD_USEMINR, pd->minrad, pd->flag & PFIELD_USEMAXR, pd->maxrad, pd->f_power_r);
}
float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNUSED(point), EffectorWeights *weights)
@@ -499,31 +511,31 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
fac = dot_v3v3(efd->nor, efd->vec_to_point2);
if (eff->pd->zdir == PFIELD_Z_POS && fac < 0.0f)
- falloff=0.0f;
+ falloff = 0.0f;
else if (eff->pd->zdir == PFIELD_Z_NEG && fac > 0.0f)
- falloff=0.0f;
+ falloff = 0.0f;
else {
switch (eff->pd->falloff) {
case PFIELD_FALL_SPHERE:
- falloff*= falloff_func_dist(eff->pd, efd->distance);
+ falloff *= falloff_func_dist(eff->pd, efd->distance);
break;
case PFIELD_FALL_TUBE:
- falloff*= falloff_func_dist(eff->pd, ABS(fac));
+ falloff *= falloff_func_dist(eff->pd, ABS(fac));
if (falloff == 0.0f)
break;
madd_v3_v3v3fl(temp, efd->vec_to_point2, efd->nor, -fac);
- r_fac= len_v3(temp);
- falloff*= falloff_func_rad(eff->pd, r_fac);
+ r_fac = len_v3(temp);
+ falloff *= falloff_func_rad(eff->pd, r_fac);
break;
case PFIELD_FALL_CONE:
- falloff*= falloff_func_dist(eff->pd, ABS(fac));
+ falloff *= falloff_func_dist(eff->pd, ABS(fac));
if (falloff == 0.0f)
break;
- r_fac= RAD2DEGF(saacos(fac/len_v3(efd->vec_to_point)));
- falloff*= falloff_func_rad(eff->pd, r_fac);
+ r_fac = RAD2DEGF(saacos(fac / len_v3(efd->vec_to_point)));
+ falloff *= falloff_func_rad(eff->pd, r_fac);
break;
}
@@ -570,7 +582,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
/* In case surface object is in Edit mode when loading the .blend, surface modifier is never executed
* and bvhtree never built, see T48415. */
- if (eff->pd && eff->pd->shape==PFIELD_SHAPE_SURFACE && eff->surmd && eff->surmd->bvhtree) {
+ if (eff->pd && eff->pd->shape == PFIELD_SHAPE_SURFACE && eff->surmd && eff->surmd->bvhtree) {
/* closest point in the object surface is an effector */
float vec[3];
@@ -583,7 +595,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
efd->size = 0.0f;
}
- else if (eff->pd && eff->pd->shape==PFIELD_SHAPE_POINTS) {
+ else if (eff->pd && eff->pd->shape == PFIELD_SHAPE_POINTS) {
if (eff->ob->derivedFinal) {
DerivedMesh *dm = eff->ob->derivedFinal;
@@ -611,10 +623,10 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
/* pass */
}
else {
- ParticleSimulationData sim= {NULL};
- sim.scene= eff->scene;
- sim.ob= eff->ob;
- sim.psys= eff->psys;
+ ParticleSimulationData sim = {NULL};
+ sim.scene = eff->scene;
+ sim.ob = eff->ob;
+ sim.psys = eff->psys;
/* TODO: time from actual previous calculated frame (step might not be 1) */
state.time = cfra - 1.0f;
@@ -633,9 +645,9 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
efd->nor[1] = efd->nor[2] = 0.f;
mul_qt_v3(state.rot, efd->nor);
- if (real_velocity)
+ if (real_velocity) {
copy_v3_v3(efd->vel, state.vel);
-
+ }
efd->size = pa->size;
}
}
@@ -652,18 +664,20 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
project_v3_v3v3(translate, temp, efd->nor);
/* for vortex the shape chooses between old / new force */
- if (eff->pd->forcefield == PFIELD_VORTEX)
+ if (eff->pd->forcefield == PFIELD_VORTEX) {
add_v3_v3v3(efd->loc, ob->obmat[3], translate);
- else /* normally efd->loc is closest point on effector xy-plane */
+ }
+ else { /* normally efd->loc is closest point on effector xy-plane */
sub_v3_v3v3(efd->loc, point->loc, translate);
+ }
}
else {
copy_v3_v3(efd->loc, ob->obmat[3]);
}
- if (real_velocity)
+ if (real_velocity) {
copy_v3_v3(efd->vel, eff->velocity);
-
+ }
efd->size = 0.0f;
ret = 1;
@@ -675,7 +689,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
/* rest length for harmonic effector, will have to see later if this could be extended to other effectors */
if (eff->pd && eff->pd->forcefield == PFIELD_HARMONIC && eff->pd->f_size)
- mul_v3_fl(efd->vec_to_point, (efd->distance-eff->pd->f_size)/efd->distance);
+ mul_v3_fl(efd->vec_to_point, (efd->distance - eff->pd->f_size) / efd->distance);
if (eff->flag & PE_USE_NORMAL_DATA) {
copy_v3_v3(efd->vec_to_point2, efd->vec_to_point);
@@ -700,7 +714,7 @@ static void get_effector_tot(EffectorCache *eff, EffectorData *efd, EffectedPoin
if (*tot && eff->pd->forcefield == PFIELD_HARMONIC && point->index >= 0) {
*p = point->index % *tot;
- *tot = *p+1;
+ *tot = *p + 1;
}
}
else if (eff->psys) {
@@ -715,17 +729,17 @@ static void get_effector_tot(EffectorCache *eff, EffectorData *efd, EffectedPoin
*/
efd->charge = eff->pd->f_strength;
}
- else if (eff->pd->forcefield == PFIELD_HARMONIC && (eff->pd->flag & PFIELD_MULTIPLE_SPRINGS)==0) {
+ else if (eff->pd->forcefield == PFIELD_HARMONIC && (eff->pd->flag & PFIELD_MULTIPLE_SPRINGS) == 0) {
/* every particle is mapped to only one harmonic effector particle */
- *p= point->index % eff->psys->totpart;
- *tot= *p + 1;
+ *p = point->index % eff->psys->totpart;
+ *tot = *p + 1;
}
if (eff->psys->part->effector_amount) {
int totpart = eff->psys->totpart;
int amount = eff->psys->part->effector_amount;
- *step = (totpart > amount) ? totpart/amount : 1;
+ *step = (totpart > amount) ? totpart / amount : 1;
}
}
else {
@@ -746,7 +760,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
result[0].nor = result[1].nor = result[2].nor = result[3].nor = NULL;
- strength= eff->pd->f_strength * efd->falloff;
+ strength = eff->pd->f_strength * efd->falloff;
copy_v3_v3(tex_co, point->loc);
@@ -757,7 +771,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
tex_co[2] = 0.0f;
}
else if (eff->pd->flag & PFIELD_TEX_2D) {
- float fac=-dot_v3v3(tex_co, efd->nor);
+ float fac = -dot_v3v3(tex_co, efd->nor);
madd_v3_v3fl(tex_co, efd->nor, fac);
}
@@ -765,31 +779,31 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result, 0, NULL, scene_color_manage, false);
- if (hasrgb && mode==PFIELD_TEX_RGB) {
+ if (hasrgb && mode == PFIELD_TEX_RGB) {
force[0] = (0.5f - result->tr) * strength;
force[1] = (0.5f - result->tg) * strength;
force[2] = (0.5f - result->tb) * strength;
}
else if (nabla != 0) {
- strength/=nabla;
+ strength /= nabla;
tex_co[0] += nabla;
- multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+1, 0, NULL, scene_color_manage, false);
+ multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result + 1, 0, NULL, scene_color_manage, false);
tex_co[0] -= nabla;
tex_co[1] += nabla;
- multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+2, 0, NULL, scene_color_manage, false);
+ multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result + 2, 0, NULL, scene_color_manage, false);
tex_co[1] -= nabla;
tex_co[2] += nabla;
- multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+3, 0, NULL, scene_color_manage, false);
+ multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result + 3, 0, NULL, scene_color_manage, false);
if (mode == PFIELD_TEX_GRAD || !hasrgb) { /* if we don't have rgb fall back to grad */
/* generate intensity if texture only has rgb value */
if (hasrgb & TEX_RGB) {
- int i;
- for (i=0; i<4; i++)
+ for (int i = 0; i < 4; i++) {
result[i].tin = (1.0f / 3.0f) * (result[i].tr + result[i].tg + result[i].tb);
+ }
}
force[0] = (result[0].tin - result[1].tin) * strength;
force[1] = (result[0].tin - result[2].tin) * strength;
@@ -835,8 +849,9 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
if (noise_factor > 0.0f) {
strength += wind_func(rng, noise_factor);
- if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG))
+ if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG)) {
damp += wind_func(rng, noise_factor);
+ }
}
copy_v3_v3(force, efd->vec_to_point);
@@ -848,8 +863,8 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
break;
case PFIELD_FORCE:
normalize_v3(force);
- if (pd->flag & PFIELD_GRAVITATION){ /* Option: Multiply by 1/distance^2 */
- if (efd->distance < FLT_EPSILON){
+ if (pd->flag & PFIELD_GRAVITATION) { /* Option: Multiply by 1/distance^2 */
+ if (efd->distance < FLT_EPSILON) {
strength = 0.0f;
}
else {
@@ -901,10 +916,10 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
case PFIELD_LENNARDJ:
fac = pow((efd->size + point->size) / efd->distance, 6.0);
- fac = - fac * (1.0f - fac) / efd->distance;
+ fac = -fac * (1.0f - fac) / efd->distance;
/* limit the repulsive term drastically to avoid huge forces */
- fac = ((fac>2.0f) ? 2.0f : fac);
+ fac = ((fac > 2.0f) ? 2.0f : fac);
mul_v3_fl(force, strength * fac);
break;
@@ -938,8 +953,9 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
float density;
if ((density = smoke_get_velocity_at(pd->f_source, point->loc, force)) >= 0.0f) {
float influence = strength * efd->falloff;
- if (pd->flag & PFIELD_SMOKE_DENSITY)
+ if (pd->flag & PFIELD_SMOKE_DENSITY) {
influence *= density;
+ }
mul_v3_fl(force, influence);
/* apply flow */
madd_v3_v3fl(total_force, point->vel, -pd->f_flow * influence);
@@ -950,15 +966,16 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
}
if (pd->flag & PFIELD_DO_LOCATION) {
- madd_v3_v3fl(total_force, force, 1.0f/point->vel_to_sec);
+ madd_v3_v3fl(total_force, force, 1.0f / point->vel_to_sec);
- if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG, PFIELD_SMOKEFLOW)==0 && pd->f_flow != 0.0f) {
+ if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG, PFIELD_SMOKEFLOW) == 0 && pd->f_flow != 0.0f) {
madd_v3_v3fl(total_force, point->vel, -pd->f_flow * efd->falloff);
}
}
- if (point->ave)
+ if (point->ave) {
zero_v3(point->ave);
+ }
if (pd->flag & PFIELD_DO_ROTATION && point->ave && point->rot) {
float xvec[3] = {1.0f, 0.0f, 0.0f};
float dave[3];
@@ -1001,45 +1018,47 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
*/
EffectorCache *eff;
EffectorData efd;
- int p=0, tot = 1, step = 1;
+ int p = 0, tot = 1, step = 1;
/* Cycle through collected objects, get total of (1/(gravity_strength * dist^gravity_power)) */
/* Check for min distance here? (yes would be cool to add that, ton) */
- if (effectors) for (eff = effectors->first; eff; eff=eff->next) {
- /* object effectors were fully checked to be OK to evaluate! */
-
- get_effector_tot(eff, &efd, point, &tot, &p, &step);
+ if (effectors) {
+ for (eff = effectors->first; eff; eff = eff->next) {
+ /* object effectors were fully checked to be OK to evaluate! */
- for (; p<tot; p+=step) {
- if (get_effector_data(eff, &efd, point, 0)) {
- efd.falloff= effector_falloff(eff, &efd, point, weights);
+ get_effector_tot(eff, &efd, point, &tot, &p, &step);
- if (efd.falloff > 0.0f)
- efd.falloff *= eff_calc_visibility(colliders, eff, &efd, point);
+ for (; p < tot; p += step) {
+ if (get_effector_data(eff, &efd, point, 0)) {
+ efd.falloff = effector_falloff(eff, &efd, point, weights);
- if (efd.falloff <= 0.0f) {
- /* don't do anything */
- }
- else if (eff->pd->forcefield == PFIELD_TEXTURE) {
- do_texture_effector(eff, &efd, point, force);
- }
- else {
- float temp1[3] = {0, 0, 0}, temp2[3];
- copy_v3_v3(temp1, force);
+ if (efd.falloff > 0.0f) {
+ efd.falloff *= eff_calc_visibility(colliders, eff, &efd, point);
+ }
+ if (efd.falloff <= 0.0f) {
+ /* don't do anything */
+ }
+ else if (eff->pd->forcefield == PFIELD_TEXTURE) {
+ do_texture_effector(eff, &efd, point, force);
+ }
+ else {
+ float temp1[3] = {0, 0, 0}, temp2[3];
+ copy_v3_v3(temp1, force);
- do_physical_effector(eff, &efd, point, force);
+ do_physical_effector(eff, &efd, point, force);
- /* for softbody backward compatibility */
- if (point->flag & PE_WIND_AS_SPEED && impulse) {
- sub_v3_v3v3(temp2, force, temp1);
- sub_v3_v3v3(impulse, impulse, temp2);
+ /* for softbody backward compatibility */
+ if (point->flag & PE_WIND_AS_SPEED && impulse) {
+ sub_v3_v3v3(temp2, force, temp1);
+ sub_v3_v3v3(impulse, impulse, temp2);
+ }
}
}
- }
- else if (eff->flag & PE_VELOCITY_TO_IMPULSE && impulse) {
- /* special case for harmonic effector */
- add_v3_v3v3(impulse, impulse, efd.vel);
+ else if (eff->flag & PE_VELOCITY_TO_IMPULSE && impulse) {
+ /* special case for harmonic effector */
+ add_v3_v3v3(impulse, impulse, efd.vel);
+ }
}
}
}
@@ -1049,35 +1068,35 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
SimDebugData *_sim_debug_data = NULL;
-unsigned int BKE_sim_debug_data_hash(int i)
+uint BKE_sim_debug_data_hash(int i)
{
- return BLI_ghashutil_uinthash((unsigned int)i);
+ return BLI_ghashutil_uinthash((uint)i);
}
-unsigned int BKE_sim_debug_data_hash_combine(unsigned int kx, unsigned int ky)
+uint BKE_sim_debug_data_hash_combine(uint kx, uint ky)
{
-#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
- unsigned int a, b, c;
+ uint a, b, c;
a = b = c = 0xdeadbeef + (2 << 2) + 13;
a += kx;
b += ky;
- c ^= b; c -= rot(b,14);
- a ^= c; a -= rot(c,11);
- b ^= a; b -= rot(a,25);
- c ^= b; c -= rot(b,16);
- a ^= c; a -= rot(c,4);
- b ^= a; b -= rot(a,14);
- c ^= b; c -= rot(b,24);
+ c ^= b; c -= rot(b, 14);
+ a ^= c; a -= rot(c, 11);
+ b ^= a; b -= rot(a, 25);
+ c ^= b; c -= rot(b, 16);
+ a ^= c; a -= rot(c, 4);
+ b ^= a; b -= rot(a, 14);
+ c ^= b; c -= rot(b, 24);
return c;
#undef rot
}
-static unsigned int debug_element_hash(const void *key)
+static uint debug_element_hash(const void *key)
{
const SimDebugElement *elem = key;
return elem->hash;
@@ -1121,8 +1140,9 @@ bool BKE_sim_debug_data_get_enabled(void)
void BKE_sim_debug_data_free(void)
{
if (_sim_debug_data) {
- if (_sim_debug_data->gh)
+ if (_sim_debug_data->gh) {
BLI_ghash_free(_sim_debug_data->gh, NULL, debug_element_free);
+ }
MEM_freeN(_sim_debug_data);
}
}
@@ -1134,20 +1154,23 @@ static void debug_data_insert(SimDebugData *debug_data, SimDebugElement *elem)
*old_elem = *elem;
MEM_freeN(elem);
}
- else
+ else {
BLI_ghash_insert(debug_data->gh, elem, elem);
+ }
}
-void BKE_sim_debug_data_add_element(int type, const float v1[3], const float v2[3], const char *str, float r, float g, float b, const char *category, unsigned int hash)
+void BKE_sim_debug_data_add_element(int type, const float v1[3], const float v2[3], const char *str, float r, float g, float b, const char *category, uint hash)
{
- unsigned int category_hash = BLI_ghashutil_strhash_p(category);
+ uint category_hash = BLI_ghashutil_strhash_p(category);
SimDebugElement *elem;
if (!_sim_debug_data) {
- if (G.debug & G_DEBUG_SIMDATA)
+ if (G.debug & G_DEBUG_SIMDATA) {
BKE_sim_debug_data_set_enabled(true);
- else
+ }
+ else {
return;
+ }
}
elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
@@ -1157,47 +1180,55 @@ void BKE_sim_debug_data_add_element(int type, const float v1[3], const float v2[
elem->color[0] = r;
elem->color[1] = g;
elem->color[2] = b;
- if (v1)
+ if (v1) {
copy_v3_v3(elem->v1, v1);
- else
+ }
+ else {
zero_v3(elem->v1);
- if (v2)
+ }
+ if (v2) {
copy_v3_v3(elem->v2, v2);
- else
+ }
+ else {
zero_v3(elem->v2);
- if (str)
+ }
+ if (str) {
BLI_strncpy(elem->str, str, sizeof(elem->str));
- else
+ }
+ else {
elem->str[0] = '\0';
+ }
debug_data_insert(_sim_debug_data, elem);
}
-void BKE_sim_debug_data_remove_element(unsigned int hash)
+void BKE_sim_debug_data_remove_element(uint hash)
{
SimDebugElement dummy;
- if (!_sim_debug_data)
+ if (!_sim_debug_data) {
return;
-
+ }
dummy.hash = hash;
BLI_ghash_remove(_sim_debug_data->gh, &dummy, NULL, debug_element_free);
}
void BKE_sim_debug_data_clear(void)
{
- if (!_sim_debug_data)
+ if (!_sim_debug_data) {
return;
-
- if (_sim_debug_data->gh)
+ }
+ if (_sim_debug_data->gh) {
BLI_ghash_clear(_sim_debug_data->gh, NULL, debug_element_free);
+ }
}
void BKE_sim_debug_data_clear_category(const char *category)
{
int category_hash = (int)BLI_ghashutil_strhash_p(category);
- if (!_sim_debug_data)
+ if (!_sim_debug_data) {
return;
+ }
if (_sim_debug_data->gh) {
GHashIterator iter;
@@ -1206,8 +1237,9 @@ void BKE_sim_debug_data_clear_category(const char *category)
const SimDebugElement *elem = BLI_ghashIterator_getValue(&iter);
BLI_ghashIterator_step(&iter); /* removing invalidates the current iterator, so step before removing */
- if (elem->category_hash == category_hash)
+ if (elem->category_hash == category_hash) {
BLI_ghash_remove(_sim_debug_data->gh, elem, NULL, debug_element_free);
+ }
}
}
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 95e4d2c92ae..6ee6d877b9c 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -2021,8 +2021,8 @@ float evaluate_driver(PathResolvedRNA *anim_rna, ChannelDriver *driver, const fl
default:
{
/* special 'hack' - just use stored value
- * This is currently used as the mechanism which allows animated settings to be able
- * to be changed via the UI.
+ * This is currently used as the mechanism which allows animated settings to be able
+ * to be changed via the UI.
*/
break;
}
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index b69bce088d2..e288242ce9c 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -273,7 +273,7 @@ static void fcm_fn_generator_new_data(void *mdata)
}
/* Unary 'normalized sine' function
- * y = sin(PI + x) / (PI * x),
+ * y = sin(PI + x) / (PI * x),
* except for x = 0 when y = 1.
*/
static double sinc(double x)
@@ -1284,7 +1284,7 @@ bool list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype)
const FModifierTypeInfo *fmi = fmodifier_get_typeinfo(fcm);
short mOk = 1, aOk = 1; /* by default 1, so that when only one test, won't fail */
- /* check if applicable ones are fullfilled */
+ /* check if applicable ones are fulfilled */
if (mtype)
mOk = (fcm->type == mtype);
if (acttype > -1)
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index cf2521509b5..e51b10a97a4 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -360,7 +360,7 @@ VFont *BKE_vfont_builtin_get(void)
static VChar *find_vfont_char(VFontData *vfd, unsigned int character)
{
- return BLI_ghash_lookup(vfd->characters, SET_UINT_IN_POINTER(character));
+ return BLI_ghash_lookup(vfd->characters, POINTER_FROM_UINT(character));
}
static void build_underline(Curve *cu, ListBase *nubase, const rctf *rect,
@@ -605,7 +605,7 @@ void BKE_vfont_select_clamp(Object *ob)
static float char_width(Curve *cu, VChar *che, CharInfo *info)
{
- /* The character wasn't found, propably ascii = 0, then the width shall be 0 as well */
+ /* The character wasn't found, probably ascii = 0, then the width shall be 0 as well */
if (che == NULL) {
return 0.0f;
}
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 071c10acaa5..e49f24c8120 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -107,7 +107,7 @@ static int get_next_free_id(void)
return gNextIconId++;
/* now we try to find the smallest icon id not stored in the gIcons hash */
- while (BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(startId)) && startId >= gFirstIconId)
+ while (BLI_ghash_lookup(gIcons, POINTER_FROM_INT(startId)) && startId >= gFirstIconId)
startId++;
/* if we found a suitable one that isn't used yet, return it */
@@ -161,7 +161,7 @@ void BKE_icons_deferred_free(void)
node != NULL;
node = node->next)
{
- BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(node->icon_id), NULL, icon_free);
+ BLI_ghash_remove(gIcons, POINTER_FROM_INT(node->icon_id), NULL, icon_free);
}
BLI_linklist_lockfree_clear(&g_icon_delete_queue, MEM_freeN);
}
@@ -471,7 +471,7 @@ void BKE_icon_changed(const int icon_id)
if (!icon_id || G.background) return;
- icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
+ icon = BLI_ghash_lookup(gIcons, POINTER_FROM_INT(icon_id));
if (icon) {
/* We *only* expect ID-tied icons here, not non-ID icon/preview! */
@@ -507,7 +507,7 @@ static int icon_id_ensure_create_icon(struct ID *id)
new_icon->drawinfo = NULL;
new_icon->drawinfo_free = NULL;
- BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(id->icon_id), new_icon);
+ BLI_ghash_insert(gIcons, POINTER_FROM_INT(id->icon_id), new_icon);
return id->icon_id;
}
@@ -587,7 +587,7 @@ int BKE_icon_preview_ensure(ID *id, PreviewImage *preview)
new_icon->drawinfo = NULL;
new_icon->drawinfo_free = NULL;
- BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(preview->icon_id), new_icon);
+ BLI_ghash_insert(gIcons, POINTER_FROM_INT(preview->icon_id), new_icon);
return preview->icon_id;
}
@@ -598,7 +598,7 @@ Icon *BKE_icon_get(const int icon_id)
Icon *icon = NULL;
- icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
+ icon = BLI_ghash_lookup(gIcons, POINTER_FROM_INT(icon_id));
if (!icon) {
printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
@@ -614,7 +614,7 @@ void BKE_icon_set(const int icon_id, struct Icon *icon)
void **val_p;
- if (BLI_ghash_ensure_p(gIcons, SET_INT_IN_POINTER(icon_id), &val_p)) {
+ if (BLI_ghash_ensure_p(gIcons, POINTER_FROM_INT(icon_id), &val_p)) {
printf("%s: Internal error, icon already set: %d\n", __func__, icon_id);
return;
}
@@ -643,7 +643,7 @@ void BKE_icon_id_delete(struct ID *id)
}
BKE_icons_deferred_free();
- BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(icon_id), NULL, icon_free);
+ BLI_ghash_remove(gIcons, POINTER_FROM_INT(icon_id), NULL, icon_free);
}
/**
@@ -655,7 +655,7 @@ void BKE_icon_delete(const int icon_id)
if (!icon_id) return; /* no icon defined for library object */
- icon = BLI_ghash_popkey(gIcons, SET_INT_IN_POINTER(icon_id), NULL);
+ icon = BLI_ghash_popkey(gIcons, POINTER_FROM_INT(icon_id), NULL);
if (icon) {
if (icon->id_type != 0) {
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index c520714b076..d01650e3204 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -2898,7 +2898,7 @@ static RenderPass *image_render_pass_get(RenderLayer *rl, const int pass, const
}
/* if layer or pass changes, we need an index for the imbufs list */
-/* note it is called for rendered results, but it doesnt use the index! */
+/* note it is called for rendered results, but it doesn't use the index! */
/* and because rendered results use fake layer/passes, don't correct for wrong indices here */
RenderPass *BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser)
{
@@ -2950,7 +2950,7 @@ void BKE_image_multiview_index(Image *ima, ImageUser *iuser)
}
/* if layer or pass changes, we need an index for the imbufs list */
-/* note it is called for rendered results, but it doesnt use the index! */
+/* note it is called for rendered results, but it doesn't use the index! */
/* and because rendered results use fake layer/passes, don't correct for wrong indices here */
bool BKE_image_is_multilayer(Image *ima)
{
@@ -3784,7 +3784,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **r_loc
*
* This is mainly to make it so color management treats byte buffer
* from render result with Save Buffers enabled as final display buffer
- * and doesnt' apply any color management on it.
+ * and doesn't apply any color management on it.
*
* For other cases we need to be sure it stays to default byte buffer space.
*/
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index fd8cb6d6d98..7cb9ffc3611 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -503,7 +503,7 @@ static const char *texture_adrcodes_to_paths(int adrcode, int *array_index)
case TE_BRIGHT:
return "brightness";
case TE_CONTRA:
- return "constrast";
+ return "contrast";
}
return NULL;
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 582743acff4..1e99712f47a 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -216,7 +216,9 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb)
lt->typeu = lt->typev = lt->typew = KEY_LINEAR;
/* prevent using deformed locations */
- BKE_displist_free(&ltOb->curve_cache->disp);
+ if (ltOb->curve_cache != NULL) {
+ BKE_displist_free(&ltOb->curve_cache->disp);
+ }
copy_m4_m4(mat, ltOb->obmat);
unit_m4(ltOb->obmat);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 0eb943cc15b..a6cee54d81f 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -286,7 +286,7 @@ static int id_expand_local_callback(
return IDWALK_RET_NOP;
}
- /* Can hapen that we get unlinkable ID here, e.g. with shapekey referring to itself (through drivers)...
+ /* Can happen that we get unlinkable ID here, e.g. with shapekey referring to itself (through drivers)...
* Just skip it, shape key can only be either indirectly linked, or fully local, period.
* And let's curse one more time that stupid useless shapekey ID type! */
if (*id_pointer && *id_pointer != id_self && BKE_idcode_is_linkable(GS((*id_pointer)->name))) {
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c
index 2819b0312aa..f791d9a6591 100644
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@ -499,7 +499,7 @@ ATTR_NONNULL(1) static void libblock_remap_data(
}
#ifdef DEBUG_PRINT
- printf("%s: %d occurences skipped (%d direct and %d indirect ones)\n", __func__,
+ printf("%s: %d occurrences skipped (%d direct and %d indirect ones)\n", __func__,
r_id_remap_data->skipped_direct + r_id_remap_data->skipped_indirect,
r_id_remap_data->skipped_direct, r_id_remap_data->skipped_indirect);
#endif
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 76d16334630..2f2b82a00eb 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -35,7 +35,7 @@
* - free the handle.
*
* This file is admittedly a bit confusticated, in quite few areas speed was chosen over readability,
- * though it is commented - so shouldn't be so hard to see whats going on.
+ * though it is commented - so shouldn't be so hard to see what's going on.
*
*
* Implementation:
@@ -486,7 +486,7 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size)
unsigned int xi_max = (unsigned int) ((xmax - layer->bounds.xmin) * layer->buckets_xy_scalar[0]);
unsigned int yi_min = (unsigned int) ((ymin - layer->bounds.ymin) * layer->buckets_xy_scalar[1]);
unsigned int yi_max = (unsigned int) ((ymax - layer->bounds.ymin) * layer->buckets_xy_scalar[1]);
- void *face_index_void = SET_UINT_IN_POINTER(face_index);
+ void *face_index_void = POINTER_FROM_UINT(face_index);
unsigned int xi, yi;
@@ -538,7 +538,7 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size)
buckets_face[bucket_index] = bucket;
for (bucket_node = bucketstore[bucket_index]; bucket_node; bucket_node = bucket_node->next) {
- *bucket = GET_UINT_FROM_POINTER(bucket_node->link);
+ *bucket = POINTER_AS_UINT(bucket_node->link);
bucket++;
}
*bucket = TRI_TERMINATOR_ID;
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 91658a140f0..1caef98ea11 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -844,7 +844,7 @@ void BKE_material_remap_object_calc(
for (int i = 0; i < ob_dst->totcol; i++) {
Material *ma_src = give_current_material(ob_dst, i + 1);
- BLI_ghash_reinsert(gh_mat_map, ma_src, SET_INT_IN_POINTER(i), NULL, NULL);
+ BLI_ghash_reinsert(gh_mat_map, ma_src, POINTER_FROM_INT(i), NULL, NULL);
}
/* setup default mapping (when materials don't match) */
@@ -874,7 +874,7 @@ void BKE_material_remap_object_calc(
else {
void **index_src_p = BLI_ghash_lookup_p(gh_mat_map, ma_src);
if (index_src_p) {
- remap_src_to_dst[i] = GET_INT_FROM_POINTER(*index_src_p);
+ remap_src_to_dst[i] = POINTER_AS_INT(*index_src_p);
}
}
}
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 6d481472074..5758e00a28d 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -152,7 +152,7 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
for (j = 0; j < vtot; j++, v1++, v2++) {
if (len_squared_v3v3(v1->co, v2->co) > thresh_sq)
return MESHCMP_VERTCOMISMATCH;
- /* I don't care about normals, let's just do coodinates */
+ /* I don't care about normals, let's just do coordinates */
}
}
@@ -1445,7 +1445,7 @@ static int split_faces_prepare_new_verts(
if ((*lnor_space)->flags & MLNOR_SPACE_IS_SINGLE) {
/* Single loop in this fan... */
- BLI_assert(GET_INT_FROM_POINTER((*lnor_space)->loops) == loop_idx);
+ BLI_assert(POINTER_AS_INT((*lnor_space)->loops) == loop_idx);
BLI_BITMAP_ENABLE(done_loops, loop_idx);
if (vert_used) {
ml->v = new_vert_idx;
@@ -1453,7 +1453,7 @@ static int split_faces_prepare_new_verts(
}
else {
for (LinkNode *lnode = (*lnor_space)->loops; lnode; lnode = lnode->next) {
- const int ml_fan_idx = GET_INT_FROM_POINTER(lnode->link);
+ const int ml_fan_idx = POINTER_AS_INT(lnode->link);
BLI_BITMAP_ENABLE(done_loops, ml_fan_idx);
if (vert_used) {
mloop[ml_fan_idx].v = new_vert_idx;
@@ -1514,7 +1514,7 @@ static int split_faces_prepare_new_edges(
if (BLI_BITMAP_TEST(edges_used, edge_idx)) {
/* Original edge has already been used, we need to define a new one. */
const int new_edge_idx = num_edges++;
- *eval = SET_INT_IN_POINTER(new_edge_idx);
+ *eval = POINTER_FROM_INT(new_edge_idx);
ml_prev->e = new_edge_idx;
SplitFaceNewEdge *new_edge = BLI_memarena_alloc(memarena, sizeof(*new_edge));
@@ -1529,13 +1529,13 @@ static int split_faces_prepare_new_edges(
/* We can re-use original edge. */
medge[edge_idx].v1 = ml_prev->v;
medge[edge_idx].v2 = ml->v;
- *eval = SET_INT_IN_POINTER(edge_idx);
+ *eval = POINTER_FROM_INT(edge_idx);
BLI_BITMAP_ENABLE(edges_used, edge_idx);
}
}
else {
/* Edge already known, just update loop's edge index. */
- ml_prev->e = GET_INT_FROM_POINTER(*eval);
+ ml_prev->e = POINTER_AS_INT(*eval);
}
ml_prev = ml;
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index c801c5dcb01..bfee7f3924c 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -145,7 +145,7 @@ static void make_edges_mdata_extend(
totedge_new = BLI_edgehash_len(eh);
#ifdef DEBUG
- /* ensure that theres no overlap! */
+ /* ensure that there's no overlap! */
if (totedge_new) {
MEdge *medge = *r_alledge;
for (i = 0; i < totedge; i++, medge++) {
@@ -171,7 +171,7 @@ static void make_edges_mdata_extend(
BLI_edgehashIterator_step(ehi), ++medge, e_index++)
{
BLI_edgehashIterator_getKey(ehi, &medge->v1, &medge->v2);
- BLI_edgehashIterator_setValue(ehi, SET_UINT_IN_POINTER(e_index));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_UINT(e_index));
medge->crease = medge->bweight = 0;
medge->flag = ME_EDGEDRAW | ME_EDGERENDER;
@@ -187,7 +187,7 @@ static void make_edges_mdata_extend(
int j;
for (j = 0; j < mp->totloop; j++, l++) {
/* lookup hashed edge index */
- l_prev->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(eh, l_prev->v, l->v));
+ l_prev->e = POINTER_AS_UINT(BLI_edgehash_lookup(eh, l_prev->v, l->v));
l_prev = l;
}
}
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 279ab777529..e3b1f20e583 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -569,7 +569,7 @@ void BKE_lnor_space_add_loop(
lnors_spacearr->lspacearr[ml_index] = lnor_space;
if (bm_loop == NULL) {
- bm_loop = SET_INT_IN_POINTER(ml_index);
+ bm_loop = POINTER_FROM_INT(ml_index);
}
if (is_single) {
BLI_assert(lnor_space->loops == NULL);
@@ -1658,7 +1658,7 @@ static void mesh_normals_loop_custom_set(
const float *org_nor = NULL;
while (loops) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
MLoop *ml = &mloops[lidx];
const int nidx = lidx;
float *nor = r_custom_loopnors[nidx];
@@ -1689,7 +1689,7 @@ static void mesh_normals_loop_custom_set(
* See T45984. */
loops = lnors_spacearr.lspacearr[i]->loops;
if (loops && org_nor) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
MLoop *ml = &mloops[lidx];
const int nidx = lidx;
float *nor = r_custom_loopnors[nidx];
@@ -1731,7 +1731,7 @@ static void mesh_normals_loop_custom_set(
*/
LinkNode *loops = lnors_spacearr.lspacearr[i]->loops;
if (lnors_spacearr.lspacearr[i]->flags & MLNOR_SPACE_IS_SINGLE) {
- BLI_assert(GET_INT_FROM_POINTER(loops) == i);
+ BLI_assert(POINTER_AS_INT(loops) == i);
const int nidx = use_vertices ? (int)mloops[i].v : i;
float *nor = r_custom_loopnors[nidx];
@@ -1745,7 +1745,7 @@ static void mesh_normals_loop_custom_set(
zero_v3(avg_nor);
while (loops) {
- const int lidx = GET_INT_FROM_POINTER(loops->link);
+ const int lidx = POINTER_AS_INT(loops->link);
const int nidx = use_vertices ? (int)mloops[lidx].v : lidx;
float *nor = r_custom_loopnors[nidx];
@@ -2424,7 +2424,7 @@ bool BKE_mesh_center_of_volume(const Mesh *me, float r_cent[3])
}
/* otherwise we get NAN for 0 polys */
if (total_volume != 0.0f) {
- /* multipy by 0.25 to get the correct centroid */
+ /* multiply by 0.25 to get the correct centroid */
/* no need to divide volume by 6 as the centroid is weighted by 6x the volume, so it all cancels out */
mul_v3_fl(r_cent, 0.25f / total_volume);
}
@@ -3356,7 +3356,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(
/* build edge hash */
me = medge;
for (i = 0; i < totedge_i; i++, me++) {
- BLI_edgehash_insert(eh, me->v1, me->v2, SET_UINT_IN_POINTER(i));
+ BLI_edgehash_insert(eh, me->v1, me->v2, POINTER_FROM_UINT(i));
/* unrelated but avoid having the FGON flag enabled, so we can reuse it later for something else */
me->flag &= ~ME_FGON;
@@ -3378,7 +3378,7 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(
# define ML(v1, v2) { \
ml->v = mf->v1; \
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(eh, mf->v1, mf->v2)); \
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(eh, mf->v1, mf->v2)); \
ml++; j++; \
} (void)0
diff --git a/source/blender/blenkernel/intern/mesh_mapping.c b/source/blender/blenkernel/intern/mesh_mapping.c
index 5c9849f6b74..2d82a5102b0 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.c
+++ b/source/blender/blenkernel/intern/mesh_mapping.c
@@ -1109,7 +1109,7 @@ bool BKE_mesh_calc_islands_loop_poly_edgeseam(
*
* \note If no MLoopUV layer is passed, we only consider edges tagged as seams as UV boundaries.
* This has the advantages of simplicity, and being valid/common to all UV maps.
- * However, it means actual UV islands whithout matching UV seams will not be handled correctly...
+ * However, it means actual UV islands without matching UV seams will not be handled correctly...
* If a valid UV layer is passed as \a luvs parameter, UV coordinates are also used to detect islands boundaries.
*
* \note All this could be optimized...
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index 77aefc04f5f..62c81bf8cba 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -281,7 +281,7 @@ void BKE_mesh_remap_find_best_match_from_dm(
best_match = match;
copy_m4_m4(best_mat_dst, mat_dst);
- /* And now, we have to check the otehr sixth possible mirrored versions... */
+ /* And now, we have to check the other sixth possible mirrored versions... */
for (mirr = mirrors; (*mirr)[0]; mirr++) {
mul_v3_fl(mat_dst[0], (*mirr)[0]);
mul_v3_fl(mat_dst[1], (*mirr)[1]);
@@ -972,7 +972,7 @@ static void mesh_island_to_astar_graph_edge_process(
const int pidx = edge_to_poly_map[edge_idx].indices[i];
MPoly *mp = &polys[pidx];
const int pidx_isld = islands ? poly_island_index_map[pidx] : pidx;
- void *custom_data = is_edge_innercut ? SET_INT_IN_POINTER(edge_idx) : SET_INT_IN_POINTER(-1);
+ void *custom_data = is_edge_innercut ? POINTER_FROM_INT(edge_idx) : POINTER_FROM_INT(-1);
if (UNLIKELY(islands && (islands->items_to_islands[mp->loopstart] != island_index))) {
/* poly not in current island, happens with border edges... */
@@ -1088,12 +1088,12 @@ static float mesh_remap_calc_loops_astar_f_cost(
{
float *co_next, *co_dest;
- if (link && (GET_INT_FROM_POINTER(link->custom_data) != -1)) {
+ if (link && (POINTER_AS_INT(link->custom_data) != -1)) {
/* An innercut edge... We tag our solution as potentially crossing innercuts.
* Note it might not be the case in the end (AStar will explore around optimal path), but helps
* trimming off some processing later... */
- if (!GET_INT_FROM_POINTER(as_solution->custom_data)) {
- as_solution->custom_data = SET_INT_IN_POINTER(true);
+ if (!POINTER_AS_INT(as_solution->custom_data)) {
+ as_solution->custom_data = POINTER_FROM_INT(true);
}
}
@@ -1691,7 +1691,7 @@ void BKE_mesh_remap_calc_loops_from_dm(
continue;
}
- as_solution.custom_data = SET_INT_IN_POINTER(false);
+ as_solution.custom_data = POINTER_FROM_INT(false);
isld_res = &islands_res[best_island_index][plidx_dst];
if (use_from_vert) {
@@ -1714,7 +1714,7 @@ void BKE_mesh_remap_calc_loops_from_dm(
BLI_astar_graph_solve(
as_graph, pidx_isld_src_prev, pidx_isld_src,
mesh_remap_calc_loops_astar_f_cost, &as_solution, isld_steps_src);
- if (GET_INT_FROM_POINTER(as_solution.custom_data) && (as_solution.steps > 0)) {
+ if (POINTER_AS_INT(as_solution.custom_data) && (as_solution.steps > 0)) {
/* Find first 'cutting edge' on path, and bring back lidx_src on poly just
* before that edge.
* Note we could try to be much smarter (like e.g. storing a whole poly's indices,
@@ -1726,7 +1726,7 @@ void BKE_mesh_remap_calc_loops_from_dm(
/* Note we go backward here, from dest to src poly. */
for (i = as_solution.steps - 1; i--;) {
BLI_AStarGNLink *as_link = as_solution.prev_links[pidx_isld_src];
- const int eidx = GET_INT_FROM_POINTER(as_link->custom_data);
+ const int eidx = POINTER_AS_INT(as_link->custom_data);
pidx_isld_src = as_solution.prev_nodes[pidx_isld_src];
BLI_assert(pidx_isld_src != -1);
if (eidx != -1) {
@@ -1799,7 +1799,7 @@ void BKE_mesh_remap_calc_loops_from_dm(
BLI_astar_graph_solve(
as_graph, pidx_isld_src_prev, pidx_isld_src,
mesh_remap_calc_loops_astar_f_cost, &as_solution, isld_steps_src);
- if (GET_INT_FROM_POINTER(as_solution.custom_data) && (as_solution.steps > 0)) {
+ if (POINTER_AS_INT(as_solution.custom_data) && (as_solution.steps > 0)) {
/* Find first 'cutting edge' on path, and bring back lidx_src on poly just
* before that edge.
* Note we could try to be much smarter (like e.g. storing a whole poly's indices,
@@ -1811,7 +1811,7 @@ void BKE_mesh_remap_calc_loops_from_dm(
/* Note we go backward here, from dest to src poly. */
for (i = as_solution.steps - 1; i--;) {
BLI_AStarGNLink *as_link = as_solution.prev_links[pidx_isld_src];
- int eidx = GET_INT_FROM_POINTER(as_link->custom_data);
+ int eidx = POINTER_AS_INT(as_link->custom_data);
pidx_isld_src = as_solution.prev_nodes[pidx_isld_src];
BLI_assert(pidx_isld_src != -1);
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 5c835bbf0fa..82b3edb5b49 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -326,13 +326,13 @@ bool BKE_mesh_validate_arrays(
if ((me->v1 != me->v2) && BLI_edgehash_haskey(edge_hash, me->v1, me->v2)) {
PRINT_ERR("\tEdge %u: is a duplicate of %d\n", i,
- GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, me->v1, me->v2)));
+ POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, me->v1, me->v2)));
remove = do_fixes;
}
if (remove == false) {
if (me->v1 != me->v2) {
- BLI_edgehash_insert(edge_hash, me->v1, me->v2, SET_INT_IN_POINTER(i));
+ BLI_edgehash_insert(edge_hash, me->v1, me->v2, POINTER_FROM_INT(i));
}
}
else {
@@ -362,7 +362,7 @@ bool BKE_mesh_validate_arrays(
SortFace *sf_prev;
unsigned int totsortface = 0;
- PRINT_ERR("No Polys, only tesselated Faces\n");
+ PRINT_ERR("No Polys, only tessellated Faces\n");
for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, mf++) {
bool remove = false;
@@ -566,7 +566,7 @@ bool BKE_mesh_validate_arrays(
* We already know from previous text that a valid edge exists, use it (if allowed)! */
if (do_fixes) {
int prev_e = ml->e;
- ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
+ ml->e = POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, v1, v2));
fix_flag.loops_edge = true;
PRINT_ERR("\tLoop %u has invalid edge reference (%d), fixed using edge %u\n",
sp->loopstart + j, prev_e, ml->e);
@@ -583,7 +583,7 @@ bool BKE_mesh_validate_arrays(
* and we already know from previous test that a valid one exists, use it (if allowed)! */
if (do_fixes) {
int prev_e = ml->e;
- ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
+ ml->e = POINTER_AS_INT(BLI_edgehash_lookup(edge_hash, v1, v2));
fix_flag.loops_edge = true;
PRINT_ERR("\tPoly %u has invalid edge reference (%d, is_removed: %d), fixed using edge %u\n",
sp->index, prev_e, IS_REMOVED_EDGE(me), ml->e);
@@ -1390,7 +1390,7 @@ static void mesh_calc_edges_mdata(
/* set edge members of mloops */
hash = BLI_edgehash_new_ex(__func__, totedge_final);
for (edge_index = 0, med = medge; edge_index < totedge_final; edge_index++, med++) {
- BLI_edgehash_insert(hash, med->v1, med->v2, SET_UINT_IN_POINTER(edge_index));
+ BLI_edgehash_insert(hash, med->v1, med->v2, POINTER_FROM_UINT(edge_index));
}
mpoly = allpoly;
@@ -1402,7 +1402,7 @@ static void mesh_calc_edges_mdata(
ml = &ml_next[i - 1]; /* last loop */
while (i-- != 0) {
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(hash, ml->v, ml_next->v));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(hash, ml->v, ml_next->v));
ml = ml_next;
ml_next++;
}
@@ -1511,7 +1511,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select)
}
/* store the new edge index in the hash value */
- BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(i));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(i));
}
BLI_edgehashIterator_free(ehi);
@@ -1524,7 +1524,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select)
int j;
for (j = 0; j < mp->totloop; j++, l++) {
/* lookup hashed edge index */
- med_index = GET_INT_FROM_POINTER(BLI_edgehash_lookup(eh, l_prev->v, l->v));
+ med_index = POINTER_AS_INT(BLI_edgehash_lookup(eh, l_prev->v, l->v));
l_prev->e = med_index;
l_prev = l;
}
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 9fc3fc4ba64..723b4a5aa97 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -287,7 +287,7 @@ void modifier_copyData_generic(const ModifierData *md_src, ModifierData *md_dst)
{
const ModifierTypeInfo *mti = modifierType_getInfo(md_src->type);
- /* md_dst may have alredy be fully initialized with some extra allocated data,
+ /* md_dst may have already be fully initialized with some extra allocated data,
* we need to free it now to avoid memleak. */
if (mti->freeData) {
mti->freeData(md_dst);
@@ -754,7 +754,7 @@ void test_object_modifiers(Object *ob)
}
}
-/* where should this go?, it doesnt fit well anywhere :S - campbell */
+/* where should this go?, it doesn't fit well anywhere :S - campbell */
/* elubie: changed this to default to the same dir as the render output
* to prevent saving to C:\ on Windows */
diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c
index a1172d3f110..4de876f1060 100644
--- a/source/blender/blenkernel/intern/modifiers_bmesh.c
+++ b/source/blender/blenkernel/intern/modifiers_bmesh.c
@@ -106,7 +106,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
/*do verts*/
bool vert_allocated;
- mv = mvert = DM_get_vert_array(dm, &vert_allocated);;
+ mv = mvert = DM_get_vert_array(dm, &vert_allocated);
for (i = 0; i < totvert; i++, mv++) {
v = BM_vert_create(bm, mv->co, NULL, BM_CREATE_SKIP_CD);
normal_short_to_float_v3(v->no, mv->no);
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 636157b08dd..279c6eb0c82 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -578,7 +578,7 @@ static void multires_copy_dm_grid(CCGElem *gridA, CCGElem *gridB, CCGKey *keyA,
for (x = 0; x < keyB->grid_size; x++, j++)
memcpy(CCG_elem_offset_co(keyA, gridA, y * skip * keyA->grid_size + x * skip),
CCG_elem_offset_co(keyB, gridB, j),
- sizeof(float) * keyA->num_layers);
+ keyA->elem_size);
}
else {
skip = (keyB->grid_size - 1) / (keyA->grid_size - 1);
@@ -587,7 +587,7 @@ static void multires_copy_dm_grid(CCGElem *gridA, CCGElem *gridB, CCGKey *keyA,
for (x = 0; x < keyA->grid_size; x++, j++)
memcpy(CCG_elem_offset_co(keyA, gridA, j),
CCG_elem_offset_co(keyB, gridB, y * skip * keyB->grid_size + x * skip),
- sizeof(float) * keyA->num_layers);
+ keyA->elem_size);
}
}
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index f91d88a8a4a..75dd0416e52 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1008,7 +1008,7 @@ void BKE_nlatrack_set_active(ListBase *tracks, NlaTrack *nlt_a)
if (ELEM(NULL, tracks, tracks->first))
return;
- /* deactive all the rest */
+ /* deactivate all the rest */
for (nlt = tracks->first; nlt; nlt = nlt->next)
nlt->flag &= ~NLATRACK_ACTIVE;
@@ -1180,7 +1180,7 @@ static void nlastrip_fix_resize_overlaps(NlaStrip *strip)
float offset = 0.0f;
if (nls->type == NLASTRIP_TYPE_TRANSITION) {
- /* transition strips should grow/shrink to accomodate the resized strip,
+ /* transition strips should grow/shrink to accommodate the resized strip,
* but if the strip's bounds now exceed the transition, we're forced to
* offset everything to maintain the balance
*/
@@ -1227,7 +1227,7 @@ static void nlastrip_fix_resize_overlaps(NlaStrip *strip)
float offset = 0.0f;
if (nls->type == NLASTRIP_TYPE_TRANSITION) {
- /* transition strips should grow/shrink to accomodate the resized strip,
+ /* transition strips should grow/shrink to accommodate the resized strip,
* but if the strip's bounds now exceed the transition, we're forced to
* offset everything to maintain the balance
*/
@@ -1297,7 +1297,7 @@ void BKE_nlastrip_recalculate_bounds(NlaStrip *strip)
}
/* Is the given NLA-strip the first one to occur for the given AnimData block */
-// TODO: make this an api method if necesary, but need to add prefix first
+// TODO: make this an api method if necessary, but need to add prefix first
static bool nlastrip_is_first(AnimData *adt, NlaStrip *strip)
{
NlaTrack *nlt;
@@ -1809,7 +1809,7 @@ void BKE_nla_action_pushdown(AnimData *adt)
* NOTE: An alternative way would have been to instead hack the influence
* to not get always get reset to full strength if NLASTRIP_FLAG_USR_INFLUENCE
* is disabled but auto-blending isn't being used. However, that approach
- * is a bit hacky/hard to discover, and may cause backwards compatability issues,
+ * is a bit hacky/hard to discover, and may cause backwards compatibility issues,
* so it's better to just do it this way.
*/
strip->flag |= NLASTRIP_FLAG_USR_INFLUENCE;
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index c830917a547..b3f210dfba5 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -2067,7 +2067,7 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
/* sync local composite with real tree */
/* local tree is supposed to be running, be careful moving previews! */
-/* is called by jobs manager, outside threads, so it doesnt happen during draw */
+/* is called by jobs manager, outside threads, so it doesn't happen during draw */
void ntreeLocalSync(bNodeTree *localtree, bNodeTree *ntree)
{
if (localtree && ntree) {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 0cf2993133c..add7c1fd992 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1785,7 +1785,7 @@ static void ob_parbone(Object *ob, Object *par, float mat[4][4])
/* get bone transform */
if (pchan->bone->flag & BONE_RELATIVE_PARENTING) {
- /* the new option uses the root - expected bahaviour, but differs from old... */
+ /* the new option uses the root - expected behaviour, but differs from old... */
/* XXX check on version patching? */
copy_m4_m4(mat, pchan->chan_mat);
}
@@ -1855,7 +1855,7 @@ static void give_parvert(Object *par, int nr, float vec[3])
if (use_special_ss_case) {
/* Special case if the last modifier is SS and no constructive modifier are in front of it. */
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm;
- CCGVert *ccg_vert = ccgSubSurf_getVert(ccgdm->ss, SET_INT_IN_POINTER(nr));
+ CCGVert *ccg_vert = ccgSubSurf_getVert(ccgdm->ss, POINTER_FROM_INT(nr));
/* In case we deleted some verts, nr may refer to inexistent one now, see T42557. */
if (ccg_vert) {
float *co = ccgSubSurf_getVertData(ccgdm->ss, ccg_vert);
@@ -2770,7 +2770,7 @@ int BKE_object_obdata_texspace_get(Object *ob, short **r_texflag, float **r_loc,
static int pc_cmp(const void *a, const void *b)
{
const LinkData *ad = a, *bd = b;
- if (GET_INT_FROM_POINTER(ad->data) > GET_INT_FROM_POINTER(bd->data))
+ if (POINTER_AS_INT(ad->data) > POINTER_AS_INT(bd->data))
return 1;
else return 0;
}
@@ -2783,14 +2783,14 @@ int BKE_object_insert_ptcache(Object *ob)
BLI_listbase_sort(&ob->pc_ids, pc_cmp);
for (link = ob->pc_ids.first, i = 0; link; link = link->next, i++) {
- int index = GET_INT_FROM_POINTER(link->data);
+ int index = POINTER_AS_INT(link->data);
if (i < index)
break;
}
link = MEM_callocN(sizeof(LinkData), "PCLink");
- link->data = SET_INT_IN_POINTER(i);
+ link->data = POINTER_FROM_INT(i);
BLI_addtail(&ob->pc_ids, link);
return i;
@@ -2805,7 +2805,7 @@ static int pc_findindex(ListBase *listbase, int index)
link = listbase->first;
while (link) {
- if (GET_INT_FROM_POINTER(link->data) == index)
+ if (POINTER_AS_INT(link->data) == index)
return number;
number++;
@@ -3089,7 +3089,7 @@ int BKE_object_is_modified(Scene *scene, Object *ob)
* This makes it possible to give some degree of false-positives here,
* but it's currently an acceptable tradeoff between complexity and check
* speed. In combination with checks of modifier stack and real life usage
- * percentage of false-positives shouldn't be that hight.
+ * percentage of false-positives shouldn't be that height.
*/
static bool object_moves_in_time(Object *object)
{
@@ -3647,7 +3647,7 @@ bool BKE_object_modifier_update_subframe(
if (ob->track) no_update |= BKE_object_modifier_update_subframe(bmain, eval_ctx, scene, ob->track, 0, recursion, frame, type);
/* skip subframe if object is parented
- * to vertex of a dynamic paint canvas */
+ * to vertex of a dynamic paint canvas */
if (no_update && (ob->partype == PARVERT1 || ob->partype == PARVERT3))
return false;
diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c
index dc36f2ed202..47f86c28dfc 100644
--- a/source/blender/blenkernel/intern/object_deform.c
+++ b/source/blender/blenkernel/intern/object_deform.c
@@ -624,7 +624,7 @@ bool *BKE_object_defgroup_validmap_get(Object *ob, const int defbase_tot)
val_p = BLI_ghash_lookup_p(gh, chan->name);
if (val_p) {
- *val_p = SET_INT_IN_POINTER(1);
+ *val_p = POINTER_FROM_INT(1);
}
}
}
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 589c4468000..a3fb9981880 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -254,7 +254,7 @@ static void make_child_duplis(const DupliContext *ctx, void *userdata, MakeChild
/* mballs have a different dupli handling */
if (ob->type != OB_MBALL)
- ob->flag |= OB_DONE; /* doesnt render */
+ ob->flag |= OB_DONE; /* doesn't render */
make_child_duplis_cb(&pctx, userdata, ob);
}
@@ -585,7 +585,7 @@ static Object *find_family_object(Main *bmain, const char *family, size_t family
{
Object **ob_pt;
Object *ob;
- void *ch_key = SET_UINT_IN_POINTER(ch);
+ void *ch_key = POINTER_FROM_UINT(ch);
if ((ob_pt = (Object **)BLI_ghash_lookup_p(family_gh, ch_key))) {
ob = *ob_pt;
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index da455faaa86..0637fc4f00c 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -268,7 +268,7 @@ void packAll(Main *bmain, ReportList *reports, bool verbose)
#if 0
// attempt to create a function that generates an unique filename
-// this will work when all funtions in fileops.c understand relative filenames...
+// this will work when all functions in fileops.c understand relative filenames...
static char *find_new_name(char *name)
{
@@ -362,7 +362,7 @@ int writePackedFile(
*
* - PF_EQUAL: the packed file and original file are identical
* - PF_DIFFERENT: the packed file and original file differ
- * - PF_NOFILE: the original file doens't exist
+ * - PF_NOFILE: the original file doesn't exist
*/
int checkPackedFile(const char *ref_file_name, const char *filename, PackedFile *pf)
{
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 50706a05dc0..40c0e1f8184 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1507,7 +1507,7 @@ int psys_particle_dm_face_lookup(
LinkNode *tessface_node = poly_nodes[pindex_orig];
for (; tessface_node; tessface_node = tessface_node->next) {
- int findex_dst = GET_INT_FROM_POINTER(tessface_node->link);
+ int findex_dst = POINTER_AS_INT(tessface_node->link);
faceuv = osface_final[findex_dst].uv;
/* check that this intersects - Its possible this misses :/ -
@@ -2309,12 +2309,12 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp
/*
* NOTE: Should in theory be the same as:
- cpa_num = psys_particle_dm_face_lookup(
- ctx->sim.psmd->dm_final,
- ctx->sim.psmd->dm_deformed,
- pa->num, pa->fuv,
- NULL);
- */
+ * cpa_num = psys_particle_dm_face_lookup(
+ * ctx->sim.psmd->dm_final,
+ * ctx->sim.psmd->dm_deformed,
+ * pa->num, pa->fuv,
+ * NULL);
+ */
cpa_num = (ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND))
? pa->num
: pa->num_dmcache;
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 353c75d63c6..8def945ca7c 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -366,7 +366,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm_final, DerivedMesh *dm_deform
for (i=0, node=nodedmelem; i<totdmelem; i++, node++) {
int origindex_final;
- node->link = SET_INT_IN_POINTER(i);
+ node->link = POINTER_FROM_INT(i);
/* may be vertex or face origindex */
if (use_modifier_stack) {
@@ -409,7 +409,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm_final, DerivedMesh *dm_deform
else {
if (psys->part->from == PART_FROM_VERT) {
if (pa->num < totelem && nodearray[pa->num])
- pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
+ pa->num_dmcache= POINTER_AS_INT(nodearray[pa->num]->link);
else
pa->num_dmcache = DMCACHE_NOTFOUND;
}
@@ -1546,7 +1546,7 @@ static EdgeHash *sph_springhash_build(ParticleSystem *psys)
springhash = BLI_edgehash_new_ex(__func__, psys->tot_fluidsprings);
for (i=0, spring=psys->fluid_springs; i<psys->tot_fluidsprings; i++, spring++)
- BLI_edgehash_insert(springhash, spring->particle_index[0], spring->particle_index[1], SET_INT_IN_POINTER(i+1));
+ BLI_edgehash_insert(springhash, spring->particle_index[0], spring->particle_index[1], POINTER_FROM_INT(i+1));
return springhash;
}
@@ -1610,7 +1610,7 @@ static void sph_density_accum_cb(void *userdata, int index, const float co[3], f
/* Ugh! One particle has too many neighbors! If some aren't taken into
* account, the forces will be biased by the tree search order. This
- * effectively adds enery to the system, and results in a churning motion.
+ * effectively adds energy to the system, and results in a churning motion.
* But, we have to stop somewhere, and it's not the end of the world.
* - jahka and z0r
*/
@@ -1748,7 +1748,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
/* Viscoelastic spring force */
if (pfn->psys == psys[0] && fluid->flag & SPH_VISCOELASTIC_SPRINGS && springhash) {
/* BLI_edgehash_lookup appears to be thread-safe. - z0r */
- spring_index = GET_INT_FROM_POINTER(BLI_edgehash_lookup(springhash, index, pfn->index));
+ spring_index = POINTER_AS_INT(BLI_edgehash_lookup(springhash, index, pfn->index));
if (spring_index) {
spring = psys[0]->fluid_springs + spring_index - 1;
@@ -4335,7 +4335,7 @@ void particle_system_update(Main *bmain, Scene *scene, Object *ob, ParticleSyste
pa->flag &= ~PARS_NO_DISP;
}
- /* free unexisting after reseting particles */
+ /* free unexisting after resetting particles */
if (free_unexisting)
free_unexisting_particles(&sim);
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 6d29646319f..746e8b63a18 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -246,7 +246,7 @@ static int map_insert_vert(PBVH *bvh, GHash *map,
{
void *key, **value_p;
- key = SET_INT_IN_POINTER(vertex);
+ key = POINTER_FROM_INT(vertex);
if (!BLI_ghash_ensure_p(map, key, &value_p)) {
int value_i;
if (BLI_BITMAP_TEST(bvh->vert_bitmap, vertex) == 0) {
@@ -258,11 +258,11 @@ static int map_insert_vert(PBVH *bvh, GHash *map,
value_i = ~(*face_verts);
(*face_verts)++;
}
- *value_p = SET_INT_IN_POINTER(value_i);
+ *value_p = POINTER_FROM_INT(value_i);
return value_i;
}
else {
- return GET_INT_FROM_POINTER(*value_p);
+ return POINTER_AS_INT(*value_p);
}
}
@@ -303,13 +303,13 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
GHashIterator gh_iter;
GHASH_ITER (gh_iter, map) {
void *value = BLI_ghashIterator_getValue(&gh_iter);
- int ndx = GET_INT_FROM_POINTER(value);
+ int ndx = POINTER_AS_INT(value);
if (ndx < 0)
ndx = -ndx + node->uniq_verts - 1;
vert_indices[ndx] =
- GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter));
+ POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
}
for (int i = 0; i < totface; ++i) {
@@ -607,11 +607,6 @@ void BKE_pbvh_build_grids(PBVH *bvh, CCGElem **grids,
MEM_freeN(prim_bbc);
}
-void BKE_pbvh_set_ccgdm(PBVH *bvh, CCGDerivedMesh *ccgdm)
-{
- bvh->ccgdm = ccgdm;
-}
-
PBVH *BKE_pbvh_new(void)
{
PBVH *bvh = MEM_callocN(sizeof(PBVH), "pbvh");
@@ -920,7 +915,7 @@ static void BKE_pbvh_search_callback_occluded(PBVH *bvh,
static bool update_search_cb(PBVHNode *node, void *data_v)
{
- int flag = GET_INT_FROM_POINTER(data_v);
+ int flag = POINTER_AS_INT(data_v);
if (node->flag & PBVH_Leaf)
return (node->flag & flag) != 0;
@@ -1237,7 +1232,7 @@ void BKE_pbvh_update(PBVH *bvh, int flag, float (*fnors)[3])
PBVHNode **nodes;
int totnode;
- BKE_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(flag),
+ BKE_pbvh_search_gather(bvh, update_search_cb, POINTER_FROM_INT(flag),
&nodes, &totnode);
if (flag & PBVH_UpdateNormals)
@@ -1358,11 +1353,6 @@ void BKE_pbvh_get_grid_key(const PBVH *bvh, CCGKey *key)
*key = bvh->gridkey;
}
-CCGDerivedMesh *BKE_pbvh_get_ccgdm(const PBVH *bvh)
-{
- return bvh->ccgdm;
-}
-
BMesh *BKE_pbvh_get_bmesh(PBVH *bvh)
{
@@ -2132,7 +2122,7 @@ void BKE_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*fnors)[3],
pbvh_node_check_mask_changed(bvh, &bvh->nodes[a]);
}
- BKE_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(PBVH_UpdateNormals | PBVH_UpdateDrawBuffers),
+ BKE_pbvh_search_gather(bvh, update_search_cb, POINTER_FROM_INT(PBVH_UpdateNormals | PBVH_UpdateDrawBuffers),
&nodes, &totnode);
pbvh_update_normals(bvh, nodes, totnode, fnors);
diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h
index afd539b2273..4aef97bda47 100644
--- a/source/blender/blenkernel/intern/pbvh_intern.h
+++ b/source/blender/blenkernel/intern/pbvh_intern.h
@@ -149,8 +149,6 @@ struct PBVH {
* objects in sculpt mode with different sizes at the same time, so now storing that common gpu buffer
* in an opaque pointer per pbvh. See T47637. */
struct GridCommonGPUBuffer *grid_common_gpu_buffer;
- /* The ccgdm is required for CD_ORIGINDEX lookup in vertex paint + multires */
- struct CCGDerivedMesh *ccgdm;
/* Only used during BVH build and update,
* don't need to remain valid after */
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 7311b17134d..f611e7a94cd 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -137,7 +137,7 @@ static int ptcache_extra_datasize[] = {
sizeof(ParticleSpring)
};
-/* forward declerations */
+/* forward declarations */
static int ptcache_file_compressed_read(PTCacheFile *pf, unsigned char *result, unsigned int len);
static int ptcache_file_compressed_write(PTCacheFile *pf, unsigned char *in, unsigned int in_len, unsigned char *out, int mode);
static int ptcache_file_write(PTCacheFile *pf, const void *f, unsigned int tot, unsigned int size);
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index a9b36a85602..9204bc69ee9 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -140,7 +140,7 @@ void BKE_reportf(ReportList *reports, ReportType type, const char *_format, ...)
va_start(args, _format);
vprintf(format, args);
va_end(args);
- fprintf(stdout, "\n"); /* otherise each report needs to include a \n */
+ fprintf(stdout, "\n"); /* otherwise each report needs to include a \n */
fflush(stdout); /* this ensures the message is printed before a crash */
}
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index e3fc494584c..08952113fce 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -1727,10 +1727,10 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f
break;
case DO_CLOCK_WIPE:
/*
- * temp1: angle of effect center in rads
- * temp2: angle of line through (halfx, halfy) and (x, y) in rads
- * temp3: angle of low side of blur
- * temp4: angle of high side of blur
+ * temp1: angle of effect center in rads
+ * temp2: angle of line through (halfx, halfy) and (x, y) in rads
+ * temp3: angle of low side of blur
+ * temp4: angle of high side of blur
*/
output = 1.0f - facf0;
widthf = wipe->edgeWidth * 2.0f * (float)M_PI;
@@ -2175,7 +2175,7 @@ static ImBuf *do_transform_effect(
static void RVBlurBitmap2_float(float *map, int width, int height, float blur, int quality)
/* MUUUCCH better than the previous blur. */
/* We do the blurring in two passes which is a whole lot faster. */
-/* I changed the math arount to implement an actual Gaussian */
+/* I changed the math around to implement an actual Gaussian */
/* distribution. */
/* */
/* Watch out though, it tends to misbehaven with large blur values on */
@@ -3021,7 +3021,7 @@ static void do_gaussian_blur_effect_byte_x(
const int size_x = (int) (data->size_x + 0.5f);
int i, j;
- /* Make gaussian weight tabke. */
+ /* Make gaussian weight table. */
float *gausstab_x;
gausstab_x = make_gaussian_blur_kernel(data->size_x, size_x);
@@ -3074,7 +3074,7 @@ static void do_gaussian_blur_effect_byte_y(
const int size_y = (int) (data->size_y + 0.5f);
int i, j;
- /* Make gaussian weight tabke. */
+ /* Make gaussian weight table. */
float *gausstab_y;
gausstab_y = make_gaussian_blur_kernel(data->size_y, size_y);
@@ -3127,7 +3127,7 @@ static void do_gaussian_blur_effect_float_x(
const int size_x = (int) (data->size_x + 0.5f);
int i, j;
- /* Make gaussian weight tabke. */
+ /* Make gaussian weight table. */
float *gausstab_x;
gausstab_x = make_gaussian_blur_kernel(data->size_x, size_x);
@@ -3171,7 +3171,7 @@ static void do_gaussian_blur_effect_float_y(
const int size_y = (int) (data->size_y + 0.5f);
int i, j;
- /* Make gaussian weight tabke. */
+ /* Make gaussian weight table. */
float *gausstab_y;
gausstab_y = make_gaussian_blur_kernel(data->size_y, size_y);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 7e4069305f6..c2a96d4f1ff 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -413,7 +413,7 @@ void BKE_sequence_clipboard_pointers_restore(Sequence *seq, Main *bmain)
seqclipboard_ptr_restore(bmain, (ID **)&seq->sound);
}
-/* recursive versions of funcions above */
+/* recursive versions of functions above */
void BKE_sequencer_base_clipboard_pointers_free(ListBase *seqbase)
{
Sequence *seq;
@@ -1060,7 +1060,7 @@ void BKE_sequencer_sort(Scene *scene)
*(ed->seqbasep) = seqbase;
}
-/** Comparision function suitable to be used with BLI_listbase_sort()... */
+/** Comparison function suitable to be used with BLI_listbase_sort()... */
int BKE_sequencer_cmp_time_startdisp(const void *a, const void *b)
{
const Sequence *seq_a = a;
@@ -2410,21 +2410,21 @@ void BKE_sequencer_color_balance_apply(StripColorBalance *cb, ImBuf *ibuf, float
}
/*
- * input preprocessing for SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP and SEQ_TYPE_SCENE
+ * input preprocessing for SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP and SEQ_TYPE_SCENE
*
- * Do all the things you can't really do afterwards using sequence effects
- * (read: before rescaling to render resolution has been done)
+ * Do all the things you can't really do afterwards using sequence effects
+ * (read: before rescaling to render resolution has been done)
*
- * Order is important!
+ * Order is important!
*
- * - Deinterlace
- * - Crop and transform in image source coordinate space
- * - Flip X + Flip Y (could be done afterwards, backward compatibility)
- * - Promote image to float data (affects pipeline operations afterwards)
- * - Color balance (is most efficient in the byte -> float
- * (future: half -> float should also work fine!)
- * case, if done on load, since we can use lookup tables)
- * - Premultiply
+ * - Deinterlace
+ * - Crop and transform in image source coordinate space
+ * - Flip X + Flip Y (could be done afterwards, backward compatibility)
+ * - Promote image to float data (affects pipeline operations afterwards)
+ * - Color balance (is most efficient in the byte -> float
+ * (future: half -> float should also work fine!)
+ * case, if done on load, since we can use lookup tables)
+ * - Premultiply
*/
bool BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, Sequence *seq, float UNUSED(cfra))
@@ -4507,7 +4507,7 @@ Sequence *BKE_sequencer_foreground_frame_get(Scene *scene, int frame)
return best_seq;
}
-/* return 0 if there werent enough space */
+/* return 0 if there weren't enough space */
bool BKE_sequence_base_shuffle_ex(ListBase *seqbasep, Sequence *test, Scene *evil_scene, int channel_delta)
{
const int orig_machine = test->machine;
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index e28b4ccc23d..13a82490895 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -384,7 +384,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for
SpaceTransform local2aux;
/* If the user doesn't allows to project in any direction of projection axis
- * then theres nothing todo. */
+ * then there's nothing todo. */
if ((calc->smd->shrinkOpts & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0)
return;
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index c1a085a3b15..150e8a129fe 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -1508,12 +1508,12 @@ static void sample_derivedmesh(
interp_v3_v3v3v3(hit_normal, n1, n2, n3, weights);
normalize_v3(hit_normal);
/* apply normal directional and random velocity
- * - TODO: random disabled for now since it doesnt really work well as pressure calc smoothens it out... */
+ * - TODO: random disabled for now since it doesn't really work well as pressure calc smoothens it out... */
velocity_map[index * 3] += hit_normal[0] * sfs->vel_normal * 0.25f;
velocity_map[index * 3 + 1] += hit_normal[1] * sfs->vel_normal * 0.25f;
velocity_map[index * 3 + 2] += hit_normal[2] * sfs->vel_normal * 0.25f;
/* TODO: for fire emitted from mesh surface we can use
- * Vf = Vs + (Ps/Pf - 1)*S to model gaseous expansion from solid to fuel */
+ * Vf = Vs + (Ps/Pf - 1)*S to model gaseous expansion from solid to fuel */
}
/* apply object velocity */
if (has_velocity && sfs->vel_multi) {
@@ -2140,7 +2140,7 @@ static void update_flowsfluids(
VECSUB(new_shift, total_shift, sds->shift);
copy_v3_v3_int(sds->shift, total_shift);
- /* calculate new domain boundary points so that smoke doesnt slide on sub-cell movement */
+ /* calculate new domain boundary points so that smoke doesn't slide on sub-cell movement */
sds->p0[0] = sds->dp0[0] - sds->cell_size[0] * (sds->shift_f[0] - total_shift[0] - 0.5f);
sds->p0[1] = sds->dp0[1] - sds->cell_size[1] * (sds->shift_f[1] - total_shift[1] - 0.5f);
sds->p0[2] = sds->dp0[2] - sds->cell_size[2] * (sds->shift_f[2] - total_shift[2] - 0.5f);
@@ -2713,7 +2713,7 @@ static DerivedMesh *createDomainGeometry(SmokeDomainSettings *sds, Object *ob)
ml[0].v = 1; ml[1].v = 0; ml[2].v = 4; ml[3].v = 5;
/* calculate required shift to match domain's global position
- * it was originally simulated at (if object moves without smoke step) */
+ * it was originally simulated at (if object moves without smoke step) */
invert_m4_m4(ob->imat, ob->obmat);
mul_m4_v3(ob->obmat, ob_loc);
mul_m4_v3(sds->obmat, ob_cache_loc);
@@ -3069,7 +3069,7 @@ static void smoke_calc_transparency(SmokeDomainSettings *sds, Scene *scene)
}
/* get smoke velocity and density at given coordinates
- * returns fluid density or -1.0f if outside domain*/
+ * returns fluid density or -1.0f if outside domain. */
float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3])
{
SmokeModifierData *smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke);
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index 47e567aaca1..a2f2819d132 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -30,24 +30,22 @@
*/
-/*
-******
-variables on the UI for now
-
- float mediafrict; friction to env
- float nodemass; softbody mass of *vertex*
- float grav; softbody amount of gravitaion to apply
-
- float goalspring; softbody goal springs
- float goalfrict; softbody goal springs friction
- float mingoal; quick limits for goal
- float maxgoal;
-
- float inspring; softbody inner springs
- float infrict; softbody inner springs friction
-
-*****
-*/
+/**
+ * variables on the UI for now
+ * <pre>
+ * float mediafrict; friction to env
+ * float nodemass; softbody mass of *vertex*
+ * float grav; softbody amount of gravitaion to apply
+ *
+ * float goalspring; softbody goal springs
+ * float goalfrict; softbody goal springs friction
+ * float mingoal; quick limits for goal
+ * float maxgoal;
+ *
+ * float inspring; softbody inner springs
+ * float infrict; softbody inner springs friction
+ * </pre>
+ */
#include <math.h>
@@ -112,7 +110,7 @@ typedef struct ReferenceVert {
typedef struct ReferenceState {
float com[3]; /* center of mass*/
- ReferenceVert *ivert; /* list of intial values */
+ ReferenceVert *ivert; /* list of initial values */
} ReferenceState;
@@ -213,7 +211,7 @@ static float sb_time_scale(Object *ob)
* will cause unwanted responses of the softbody system (which does inter frame calculations )
* so first 'cure' would be: interpolate linear in time ..
* Q: why do i write this?
- * A: because it happend once, that some eger coder 'streamlined' code to fail.
+ * A: because it happened once, that some eger coder 'streamlined' code to fail.
* We DO linear interpolation for goals .. and i think we should do on animated properties as well
*/
@@ -250,16 +248,16 @@ static float _final_mass(Object *ob, BodyPoint *bp)
/*+++ collider caching and dicing +++*/
-/********************
-for each target object/face the axis aligned bounding box (AABB) is stored
-faces parallel to global axes
-so only simple "value" in [min, max] ckecks are used
-float operations still
-*/
+/*
+ * for each target object/face the axis aligned bounding box (AABB) is stored
+ * faces parallel to global axes
+ * so only simple "value" in [min, max] ckecks are used
+ * float operations still
+ */
/* just an ID here to reduce the prob for killing objects
-** ob->sumohandle points to we should not kill :)
-*/
+ * ob->sumohandle points to we should not kill :)
+ */
static const int CCD_SAVETY = 190561;
typedef struct ccdf_minmax {
@@ -757,8 +755,8 @@ static void add_bp_springlist(BodyPoint *bp, int springID)
}
/* do this once when sb is build
-it is O(N^2) so scanning for springs every iteration is too expensive
-*/
+ * it is O(N^2) so scanning for springs every iteration is too expensive
+ */
static void build_bps_springlist(Object *ob)
{
SoftBody *sb= ob->soft; /* is supposed to be there */
@@ -950,29 +948,29 @@ static void free_softbody_intern(SoftBody *sb)
/* ************ dynamics ********** */
/* the most general (micro physics correct) way to do collision
-** (only needs the current particle position)
-**
-** it actually checks if the particle intrudes a short range force field generated
-** by the faces of the target object and returns a force to drive the particel out
-** the strenght of the field grows exponetially if the particle is on the 'wrong' side of the face
-** 'wrong' side : projection to the face normal is negative (all referred to a vertex in the face)
-**
-** flaw of this: 'fast' particles as well as 'fast' colliding faces
-** give a 'tunnel' effect such that the particle passes through the force field
-** without ever 'seeing' it
-** this is fully compliant to heisenberg: h >= fuzzy(location) * fuzzy(time)
-** besides our h is way larger than in QM because forces propagate way slower here
-** we have to deal with fuzzy(time) in the range of 1/25 seconds (typical frame rate)
-** yup collision targets are not known here any better
-** and 1/25 second is looong compared to real collision events
-** Q: why not use 'simple' collision here like bouncing back a particle
-** --> reverting is velocity on the face normal
-** A: because our particles are not alone here
-** and need to tell their neighbors exactly what happens via spring forces
-** unless sbObjectStep( .. ) is called on sub frame timing level
-** BTW that also questions the use of a 'implicit' solvers on softbodies
-** since that would only valid for 'slow' moving collision targets and dito particles
-*/
+ * (only needs the current particle position)
+ *
+ * it actually checks if the particle intrudes a short range force field generated
+ * by the faces of the target object and returns a force to drive the particel out
+ * the strength of the field grows exponetially if the particle is on the 'wrong' side of the face
+ * 'wrong' side : projection to the face normal is negative (all referred to a vertex in the face)
+ *
+ * flaw of this: 'fast' particles as well as 'fast' colliding faces
+ * give a 'tunnel' effect such that the particle passes through the force field
+ * without ever 'seeing' it
+ * this is fully compliant to heisenberg: h >= fuzzy(location) * fuzzy(time)
+ * besides our h is way larger than in QM because forces propagate way slower here
+ * we have to deal with fuzzy(time) in the range of 1/25 seconds (typical frame rate)
+ * yup collision targets are not known here any better
+ * and 1/25 second is looong compared to real collision events
+ * Q: why not use 'simple' collision here like bouncing back a particle
+ * --> reverting is velocity on the face normal
+ * A: because our particles are not alone here
+ * and need to tell their neighbors exactly what happens via spring forces
+ * unless sbObjectStep( .. ) is called on sub frame timing level
+ * BTW that also questions the use of a 'implicit' solvers on softbodies
+ * since that would only valid for 'slow' moving collision targets and dito particles
+ */
/* +++ dependency information functions*/
@@ -1747,11 +1745,11 @@ static int sb_detect_vertex_collisionCached(
if (mprevvert) {
/* grab the average speed of the collider vertices
- before we spoil nvX
- humm could be done once a SB steps but then we' need to store that too
- since the AABB reduced propabitlty to get here drasticallly
- it might be a nice tradeof CPU <--> memory
- */
+ * before we spoil nvX
+ * humm could be done once a SB steps but then we' need to store that too
+ * since the AABB reduced propabitlty to get here drasticallly
+ * it might be a nice tradeof CPU <--> memory
+ */
sub_v3_v3v3(vv1, nv1, mprevvert[vt->tri[0]].co);
sub_v3_v3v3(vv2, nv2, mprevvert[vt->tri[1]].co);
sub_v3_v3v3(vv3, nv3, mprevvert[vt->tri[2]].co);
@@ -1852,7 +1850,8 @@ static int sb_deflect_face(Object *ob, float *actpos, float *facenormal, float *
return(deflected);
}
-/* hiding this for now .. but the jacobian may pop up on other tasks .. so i'd like to keep it
+/* hiding this for now .. but the jacobian may pop up on other tasks .. so i'd like to keep it */
+#if 0
static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len, float factor)
{
float m, delta_ij;
@@ -1888,7 +1887,8 @@ static void dfdv_goal(int ia, int ic, float factor)
int i;
for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, ic+i, factor);
}
-*/
+#endif /* if 0 */
+
static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float UNUSED(forcetime))
{
SoftBody *sb= ob->soft; /* is supposed to be there */
@@ -1977,7 +1977,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
- /* intitialize */
+ /* initialize */
if (sb) {
/* check conditions for various options */
/* +++ could be done on object level to squeeze out the last bits of it */
@@ -2019,7 +2019,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
for (c=sb->totpoint, obp= sb->bpoint; c>0; c--, obp++) {
compare = (obp->colball + bp->colball);
sub_v3_v3v3(def, bp->pos, obp->pos);
- /* rather check the AABBoxes before ever calulating the real distance */
+ /* rather check the AABBoxes before ever calculating the real distance */
/* mathematically it is completely nuts, but performance is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
distance = normalize_v3(def);
@@ -2061,7 +2061,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
bp->force[1]+= -ks*(auxvect[1]);
bp->force[2]+= -ks*(auxvect[2]);
- /* calulate damping forces generated by goals*/
+ /* calculate damping forces generated by goals*/
sub_v3_v3v3(velgoal, bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob);
add_v3_v3v3(auxvect, velgoal, bp->vec);
@@ -2292,7 +2292,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* rule we never alter free variables :bp->vec bp->pos in here !
* this will ruin adaptive stepsize AKA heun! (BM)
- */
+ */
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
/* BodyPoint *bproot; */ /* UNUSED */
@@ -2348,7 +2348,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
compare = (obp->colball + bp->colball);
sub_v3_v3v3(def, bp->pos, obp->pos);
- /* rather check the AABBoxes before ever calulating the real distance */
+ /* rather check the AABBoxes before ever calculating the real distance */
/* mathematically it is completely nuts, but performance is pretty much (3) times faster */
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
@@ -2397,7 +2397,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
bp->force[1]+= -ks*(auxvect[1]);
bp->force[2]+= -ks*(auxvect[2]);
- /* calulate damping forces generated by goals*/
+ /* calculate damping forces generated by goals*/
sub_v3_v3v3(velgoal, bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob);
add_v3_v3v3(auxvect, velgoal, bp->vec);
@@ -2462,16 +2462,16 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (sb_deflect_face(ob, bp->pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) {
if (intrusion < 0.0f) {
if (G.debug_value & 0x01) { // 17 we did check for bit 0x10 before
- /*fixing bug [17428] this forces adaptive step size to tiny steps
- in some situations .. keeping G.debug_value==17 option for old files 'needing' the bug
- */
- /*bjornmose: uugh.. what an evil hack
- violation of the 'don't touch bp->pos in here' rule
- but works nice, like this-->
- we predict the solution being out of the collider
- in heun step No1 and leave the heun step No2 adapt to it
- so we kind of introduced a implicit solver for this case
- */
+ /* fixing bug [17428] this forces adaptive step size to tiny steps
+ * in some situations .. keeping G.debug_value==17 option for old files 'needing' the bug
+ */
+ /* bjornmose: uugh.. what an evil hack
+ * violation of the 'don't touch bp->pos in here' rule
+ * but works nice, like this-->
+ * we predict the solution being out of the collider
+ * in heun step No1 and leave the heun step No2 adapt to it
+ * so we kind of introduced a implicit solver for this case
+ */
madd_v3_v3fl(bp->pos, facenormal, -intrusion);
}
else {
@@ -2543,10 +2543,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* old one with homogeneous masses */
/* claim a minimum mass for vertex */
- /*
- if (sb->nodemass > 0.009999f) timeovermass = forcetime/sb->nodemass;
- else timeovermass = forcetime/0.009999f;
- */
+#if 0
+ if (sb->nodemass > 0.009999f) timeovermass = forcetime / sb->nodemass;
+ else timeovermass = forcetime / 0.009999f;
+#endif
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
/* now we have individual masses */
@@ -2742,11 +2742,11 @@ static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
/* care for bodypoints taken out of the 'ordinary' solver step
-** because they are screwed to goal by bolts
-** they just need to move along with the goal in time
-** we need to adjust them on sub frame timing in solver
-** so now when frame is done .. put 'em to the position at the end of frame
-*/
+ * because they are screwed to goal by bolts
+ * they just need to move along with the goal in time
+ * we need to adjust them on sub frame timing in solver
+ * so now when frame is done .. put 'em to the position at the end of frame
+ */
static void softbody_apply_goalsnap(Object *ob)
{
SoftBody *sb= ob->soft; /* is supposed to be there */
@@ -2811,9 +2811,9 @@ static void interpolate_exciter(Object *ob, int timescale, int time)
/* ************ convertors ********** */
-/* for each object type we need;
- - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry
-*/
+/* for each object type we need;
+ * - xxxx_to_softbody(Object *ob) : a full (new) copy, creates SB geometry
+ */
/* Resetting a Mesh SB object's springs */
/* Spring length are caculted from'raw' mesh vertices that are NOT altered by modifier stack. */
@@ -2827,7 +2827,7 @@ static void springs_from_mesh(Object *ob)
sb= ob->soft;
if (me && sb) {
- /* using bp->origS as a container for spring calcualtions here
+ /* using bp->origS as a container for spring calculations here
* will be overwritten sbObjectStep() to receive
* actual modifier stack positions
*/
@@ -3402,7 +3402,7 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
* that is:
* a precise position vector denoting the motion of the center of mass
* give a rotation/scale matrix using averaging method, that's why estimate and not calculate
- * see: this is kind of reverse engineering: having to states of a point cloud and recover what happend
+ * see: this is kind of reverse engineering: having to states of a point cloud and recover what happened
* our advantage here we know the identity of the vertex
* there are others methods giving other results.
* lloc, lrot, lscale are allowed to be NULL, just in case you don't need it.
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index e08560cccac..3c4e1f92344 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -89,7 +89,7 @@
# include "opensubdiv_capi.h"
#endif
-/* assumes MLoop's are layed out 4 for each poly, in order */
+/* assumes MLoop's are laid out 4 for each poly, in order */
#define USE_LOOP_LAYOUT_FAST
static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
@@ -289,7 +289,7 @@ static void get_face_uv_map_vert(UvVertMap *vmap, struct MPoly *mpoly, struct ML
break;
}
- fverts[j] = SET_UINT_IN_POINTER(mpoly[nv->poly_index].loopstart + nv->loop_of_poly_index);
+ fverts[j] = POINTER_FROM_UINT(mpoly[nv->poly_index].loopstart + nv->loop_of_poly_index);
}
}
@@ -336,7 +336,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
if (v->separate) {
CCGVert *ssv;
int loopid = mpoly[v->poly_index].loopstart + v->loop_of_poly_index;
- CCGVertHDL vhdl = SET_INT_IN_POINTER(loopid);
+ CCGVertHDL vhdl = POINTER_FROM_INT(loopid);
copy_v2_v2(uv, mloopuv[loopid].uv);
@@ -352,7 +352,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
MPoly *mp = &mpoly[i];
int nverts = mp->totloop;
int j, j_next;
- CCGFace *origf = ccgSubSurf_getFace(origss, SET_INT_IN_POINTER(i));
+ CCGFace *origf = ccgSubSurf_getFace(origss, POINTER_FROM_INT(i));
/* unsigned int *fv = &mp->v1; */
MLoop *ml = mloop + mp->loopstart;
@@ -366,12 +366,12 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
get_face_uv_map_vert(vmap, mpoly, ml, i, fverts);
for (j = 0, j_next = nverts - 1; j < nverts; j_next = j++) {
- unsigned int v0 = GET_UINT_FROM_POINTER(fverts[j_next]);
- unsigned int v1 = GET_UINT_FROM_POINTER(fverts[j]);
+ unsigned int v0 = POINTER_AS_UINT(fverts[j_next]);
+ unsigned int v1 = POINTER_AS_UINT(fverts[j]);
if (BLI_edgeset_add(eset, v0, v1)) {
CCGEdge *e, *orige = ccgSubSurf_getFaceEdge(origf, j_next);
- CCGEdgeHDL ehdl = SET_INT_IN_POINTER(mp->loopstart + j_next);
+ CCGEdgeHDL ehdl = POINTER_FROM_INT(mp->loopstart + j_next);
float crease = ccgSubSurf_getEdgeCrease(orige);
ccgSubSurf_syncEdge(ss, ehdl, fverts[j_next], fverts[j], crease, &e);
@@ -396,7 +396,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
#endif
get_face_uv_map_vert(vmap, mpoly, ml, i, fverts);
- ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), nverts, fverts, &f);
+ ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), nverts, fverts, &f);
}
#ifndef USE_DYNSIZE
@@ -441,7 +441,7 @@ static void UNUSED_FUNCTION(set_subsurf_osd_ccg_uv)(CCGSubSurf *ss,
faceMap = MEM_mallocN(totface * sizeof(*faceMap), "facemapuv");
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
+ faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
/* load coordinates from uvss into tface */
@@ -527,7 +527,7 @@ static void set_subsurf_legacy_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *
faceMap = MEM_mallocN(totface * sizeof(*faceMap), "facemapuv");
for (ccgSubSurf_initFaceIterator(uvss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
+ faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
/* load coordinates from uvss into tface */
@@ -703,10 +703,10 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
CCGVert *v;
if (vertexCos) {
- ccgSubSurf_syncVert(ss, SET_INT_IN_POINTER(i), vertexCos[i], 0, &v);
+ ccgSubSurf_syncVert(ss, POINTER_FROM_INT(i), vertexCos[i], 0, &v);
}
else {
- ccgSubSurf_syncVert(ss, SET_INT_IN_POINTER(i), mv->co, 0, &v);
+ ccgSubSurf_syncVert(ss, POINTER_FROM_INT(i), mv->co, 0, &v);
}
((int *)ccgSubSurf_getVertUserData(ss, v))[1] = (index) ? *index++ : i;
@@ -721,8 +721,8 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
crease = useFlatSubdiv ? creaseFactor :
me->crease * creaseFactor / 255.0f;
- ccgSubSurf_syncEdge(ss, SET_INT_IN_POINTER(i), SET_UINT_IN_POINTER(me->v1),
- SET_UINT_IN_POINTER(me->v2), crease, &e);
+ ccgSubSurf_syncEdge(ss, POINTER_FROM_INT(i), POINTER_FROM_UINT(me->v1),
+ POINTER_FROM_UINT(me->v2), crease, &e);
((int *)ccgSubSurf_getEdgeUserData(ss, e))[1] = (index) ? *index++ : i;
}
@@ -741,14 +741,14 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
ml = mloop + mp->loopstart;
for (j = 0; j < mp->totloop; j++, ml++) {
- fVerts[j] = SET_UINT_IN_POINTER(ml->v);
+ fVerts[j] = POINTER_FROM_UINT(ml->v);
}
/* this is very bad, means mesh is internally inconsistent.
* it is not really possible to continue without modifying
* other parts of code significantly to handle missing faces.
* since this really shouldn't even be possible we just bail.*/
- if (ccgSubSurf_syncFace(ss, SET_INT_IN_POINTER(i), mp->totloop,
+ if (ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), mp->totloop,
fVerts, &f) == eCCGError_InvalidValue)
{
static int hasGivenError = 0;
@@ -1276,7 +1276,7 @@ void subsurf_copy_grid_paint_mask(DerivedMesh *dm, const MPoly *mpoly,
}
}
-/* utility functon */
+/* utility function */
BLI_INLINE void ccgDM_to_MVert(MVert *mv, const CCGKey *key, CCGElem *elem)
{
copy_v3_v3(mv->co, CCG_elem_co(key, elem));
@@ -1349,7 +1349,7 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert)
}
-/* utility functon */
+/* utility function */
BLI_INLINE void ccgDM_to_MEdge(MEdge *med, const int v1, const int v2, const short flag)
{
med->v1 = v1;
@@ -1403,7 +1403,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge)
CCGEdge *e = ccgdm->edgeMap[index].edge;
short ed_flag = 0;
int x;
- int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e));
+ int edgeIdx = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e));
if (!ccgSubSurf_getEdgeNumFaces(e)) {
ed_flag |= ME_LOOSEEDGE;
@@ -1507,19 +1507,19 @@ static void copyFinalLoopArray_task_cb(
edge_size, grid_size);
ml->v = v1;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v1, v2));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v1, v2));
ml++;
ml->v = v2;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v2, v3));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v2, v3));
ml++;
ml->v = v3;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v3, v4));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v3, v4));
ml++;
ml->v = v4;
- ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v4, v1));
+ ml->e = POINTER_AS_UINT(BLI_edgehash_lookup(ccgdm->ehash, v4, v1));
ml++;
}
}
@@ -1541,7 +1541,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop)
medge = ccgdm->dm.getEdgeArray((DerivedMesh *)ccgdm);
for (int i = 0; i < ccgdm->dm.numEdgeData; i++) {
- BLI_edgehash_insert(ehash, medge[i].v1, medge[i].v2, SET_INT_IN_POINTER(i));
+ BLI_edgehash_insert(ehash, medge[i].v1, medge[i].v2, POINTER_FROM_INT(i));
}
atomic_cas_ptr((void **)&ccgdm->ehash, ccgdm->ehash, ehash);
@@ -1628,7 +1628,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
- vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))] = v;
+ vertMap2[POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v))] = v;
}
totedge = ccgSubSurf_getNumEdges(ss);
@@ -1636,7 +1636,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
for (ccgSubSurf_initEdgeIterator(ss, &ei), i = 0; !ccgEdgeIterator_isStopped(&ei); i++, ccgEdgeIterator_next(&ei)) {
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
- edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))] = e;
+ edgeMap2[POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e))] = e;
}
totface = ccgSubSurf_getNumFaces(ss);
@@ -1644,7 +1644,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3])
for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); ccgFaceIterator_next(&fi)) {
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- faceMap2[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))] = f;
+ faceMap2[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))] = f;
}
i = 0;
@@ -1951,7 +1951,7 @@ static void ccgDM_buffer_copy_normal(
for (i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
const float (*ln)[3] = NULL;
if (faceFlags) {
@@ -2067,7 +2067,7 @@ static void ccgDM_buffer_copy_triangles(
for (i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
bool is_hidden;
int mati;
@@ -2300,7 +2300,7 @@ static void ccgDM_buffer_copy_uv_texpaint(
for (i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
int matnr;
if (faceFlags) {
@@ -2431,7 +2431,7 @@ static void ccgDM_buffer_copy_edge(
CCGVert *ev2 = ccgSubSurf_getEdgeVert1(e);
f = ccgSubSurf_getEdgeFace(e, 0);
- fhandle = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ fhandle = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
totvert = ccgSubSurf_getFaceNumVerts(f);
/* find the index of vertices in the face */
@@ -2594,7 +2594,7 @@ static GPUDrawObject *ccgDM_GPUObjectNew(DerivedMesh *dm)
for (i = 0; i < totface; i++) {
CCGFace *f = ccgdm->faceMap[i].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
const short new_matnr = ME_MAT_NR_TEST(faceFlags[index].mat_nr, dm_totmat);
matinfo[new_matnr].totelements += numVerts * gridFaces * gridFaces * 6;
matinfo[new_matnr].totloops += numVerts * gridFaces * gridFaces * 4;
@@ -2856,7 +2856,7 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
CCGFace *f = ccgdm->faceMap[i].face;
const float (*ln)[3] = NULL;
int S, x, y, drawSmooth;
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
int origIndex = ccgDM_getFaceMapIndex(ss, f);
int numVerts = ccgSubSurf_getFaceNumVerts(f);
@@ -3079,7 +3079,7 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
for (a = 0; a < totpoly; a++) {
CCGFace *f = ccgdm->faceMap[a].face;
- int orig_index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int orig_index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
int i;
@@ -3297,7 +3297,7 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm,
CCGFace *f = ccgdm->faceMap[i].face;
const float (*ln)[3] = NULL;
int S, x, y, drawSmooth;
- int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
int origIndex = ccgDM_getFaceMapIndex(ss, f);
int new_matnr;
@@ -3577,7 +3577,7 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
CCGFace *f = ccgdm->faceMap[polyindex].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
int index = ccgDM_getFaceMapIndex(ss, f);
- int orig_index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int orig_index = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
int mat_nr;
int facequads = numVerts * gridFaces * gridFaces;
int actualFace = ccgdm->faceMap[polyindex].startFace;
@@ -3770,7 +3770,7 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
unsigned char *cp = NULL;
const float (*ln)[3] = NULL;
- origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ origIndex = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
if (flag & DM_DRAW_ALWAYS_SMOOTH) drawSmooth = 1;
else if (faceFlags) drawSmooth = (lnors || (faceFlags[origIndex].flag & ME_SMOOTH));
@@ -4492,8 +4492,9 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
if (ob->sculpt->pbvh) {
/* Note that we have to clean up exisitng pbvh instead of updating it in case it does not match current
* grid_pbvh status. */
+ const PBVHType pbvh_type = BKE_pbvh_type(ob->sculpt->pbvh);
if (grid_pbvh) {
- if (BKE_pbvh_get_ccgdm(ob->sculpt->pbvh) != NULL) {
+ if (pbvh_type == PBVH_GRIDS) {
/* pbvh's grids, gridadj and gridfaces points to data inside ccgdm
* but this can be freed on ccgdm release, this updates the pointers
* when the ccgdm gets remade, the assumption is that the topology
@@ -4507,7 +4508,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
ob->sculpt->pbvh = NULL;
}
}
- else if (BKE_pbvh_get_ccgdm(ob->sculpt->pbvh) != NULL) {
+ else if (pbvh_type == PBVH_GRIDS) {
BKE_pbvh_free(ob->sculpt->pbvh);
ob->sculpt->pbvh = NULL;
}
@@ -4516,10 +4517,6 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
}
if (ccgdm->pbvh) {
- /* For grid pbvh, keep track of ccgdm */
- if (grid_pbvh) {
- BKE_pbvh_set_ccgdm(ccgdm->pbvh, ccgdm);
- }
return ccgdm->pbvh;
}
@@ -4571,10 +4568,6 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
pbvh_show_mask_set(ccgdm->pbvh, ob->sculpt->show_mask);
}
- /* For grid pbvh, keep track of ccgdm. */
- if (grid_pbvh && ccgdm->pbvh) {
- BKE_pbvh_set_ccgdm(ccgdm->pbvh, ccgdm);
- }
return ccgdm->pbvh;
}
@@ -4714,7 +4707,7 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm,
{
CCGVert *v = ccgVertIterator_getCurrent(&vi);
- ccgdm->vertMap[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))].vert = v;
+ ccgdm->vertMap[POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v))].vert = v;
}
totedge = ccgSubSurf_getNumEdges(ss);
@@ -4725,7 +4718,7 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm,
{
CCGEdge *e = ccgEdgeIterator_getCurrent(&ei);
- ccgdm->edgeMap[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e;
+ ccgdm->edgeMap[POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e;
}
totface = ccgSubSurf_getNumFaces(ss);
@@ -4736,7 +4729,7 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm,
{
CCGFace *f = ccgFaceIterator_getCurrent(&fi);
- ccgdm->faceMap[GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f))].face = f;
+ ccgdm->faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))].face = f;
}
}
@@ -4810,7 +4803,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
CCGFace *f = ccgdm->faceMap[index].face;
int numVerts = ccgSubSurf_getFaceNumVerts(f);
int numFinalEdges = numVerts * (gridSideEdges + gridInternalEdges);
- int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
+ int origIndex = POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f));
int g2_wid = gridCuts + 2;
float *w, *w2;
int s, x, y;
@@ -4844,7 +4837,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
#endif
for (s = 0; s < numVerts; s++) {
CCGVert *v = ccgSubSurf_getFaceVert(f, s);
- vertidx[s] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertidx[s] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
}
/*I think this is for interpolating the center vert?*/
@@ -4957,13 +4950,13 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
int mapIndex = ccgDM_getEdgeMapIndex(ss, e);
int x;
int vertIdx[2];
- int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e));
+ int edgeIdx = POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e));
CCGVert *v;
v = ccgSubSurf_getEdgeVert0(e);
- vertIdx[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertIdx[0] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
v = ccgSubSurf_getEdgeVert1(e);
- vertIdx[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertIdx[1] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
ccgdm->edgeMap[index].startVert = vertNum;
ccgdm->edgeMap[index].startEdge = edgeNum;
@@ -5017,7 +5010,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
int mapIndex = ccgDM_getVertMapIndex(ccgdm->ss, v);
int vertIdx;
- vertIdx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ vertIdx = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
ccgdm->vertMap[index].startVert = vertNum;
@@ -5141,7 +5134,7 @@ static bool subsurf_use_gpu_backend(SubsurfFlags flags)
{
#ifdef WITH_OPENSUBDIV
/* Use GPU backend if it's a last modifier in the stack
- * and user choosed to use any of the OSD compute devices,
+ * and user chose to use any of the OSD compute devices,
* but also check if GPU has all needed features.
*/
return
@@ -5241,7 +5234,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
if (smd->mCache && (flags & SUBSURF_IS_FINAL_CALC)) {
#ifdef WITH_OPENSUBDIV
- /* With OpenSubdiv enabled we always tries to re-use previos
+ /* With OpenSubdiv enabled we always tries to re-use previous
* subsurf structure in order to save computation time since
* re-creation is rather a complicated business.
*
@@ -5302,7 +5295,7 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3])
for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); ccgVertIterator_next(&vi)) {
CCGVert *v = ccgVertIterator_getCurrent(&vi);
- int idx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v));
+ int idx = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
int N = ccgSubSurf_getVertNumEdges(v);
int numFaces = ccgSubSurf_getVertNumFaces(v);
float *co;
diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c
index 043fc813b95..2e48599a113 100644
--- a/source/blender/blenkernel/intern/suggestions.c
+++ b/source/blender/blenkernel/intern/suggestions.c
@@ -246,12 +246,12 @@ void texttool_docs_show(const char *docs)
/* Ensure documentation ends with a '\n' */
if (docs[len - 1] != '\n') {
documentation = MEM_mallocN(len + 2, "Documentation");
- BLI_strncpy(documentation, docs, len);
+ memcpy(documentation, docs, len);
documentation[len++] = '\n';
}
else {
documentation = MEM_mallocN(len + 1, "Documentation");
- BLI_strncpy(documentation, docs, len);
+ memcpy(documentation, docs, len);
}
documentation[len] = '\0';
}
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 76df163ee3a..345168e2000 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -355,7 +355,7 @@ static void text_from_buf(Text *text, const unsigned char *buffer, const int len
* - rest of line (if last line in file hasn't got \n terminator).
* in this case content of such line would be used to fill text line buffer
* - file is empty. in this case new line is needed to start editing from.
- * - last characted in buffer is \n. in this case new line is needed to
+ * - last character in buffer is \n. in this case new line is needed to
* deal with newline at end of file. (see [#28087]) (sergey) */
if (llen != 0 || text->nlines == 0 || buffer[len - 1] == '\n') {
TextLine *tmp;
@@ -1705,7 +1705,7 @@ static void txt_undo_add_blockop(Text *text, TextUndoBuf *utxt, int op, const ch
/* 4 bytes */
txt_undo_store_uint32(utxt->buf, &utxt->pos, length);
/* 'length' bytes */
- BLI_strncpy(utxt->buf + utxt->pos, buf, length);
+ memcpy(utxt->buf + utxt->pos, buf, length);
utxt->pos += length;
/* 4 bytes */
txt_undo_store_uint32(utxt->buf, &utxt->pos, length);
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 830732f4ce2..a3536cd0d68 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -1606,7 +1606,7 @@ MovieTrackingPlaneMarker *BKE_tracking_plane_marker_insert(MovieTrackingPlaneTra
int a = plane_track->markersnr;
/* Find position in array where to add new marker. */
- /* TODO(sergey): we coud use bisect to speed things up. */
+ /* TODO(sergey): we could use bisect to speed things up. */
while (a--) {
if (plane_track->markers[a].framenr < plane_marker->framenr) {
break;
@@ -1992,10 +1992,10 @@ void BKE_tracking_camera_to_blender(MovieTracking *tracking, Scene *scene, Camer
camera->sensor_fit = CAMERA_SENSOR_FIT_AUTO;
camera->lens = focal * camera->sensor_x / width;
- scene->r.xsch = width * tracking->camera.pixel_aspect;
+ scene->r.xsch = width;
scene->r.ysch = height;
- scene->r.xasp = 1.0f;
+ scene->r.xasp = tracking->camera.pixel_aspect;
scene->r.yasp = 1.0f;
BKE_tracking_camera_shift_get(tracking, width, height, &camera->shiftx, &camera->shifty);
diff --git a/source/blender/blenkernel/intern/tracking_region_tracker.c b/source/blender/blenkernel/intern/tracking_region_tracker.c
index 106dd125575..dcc61f409fc 100644
--- a/source/blender/blenkernel/intern/tracking_region_tracker.c
+++ b/source/blender/blenkernel/intern/tracking_region_tracker.c
@@ -149,7 +149,7 @@ static ImBuf *tracking_context_get_keyframed_ibuf(MovieClip *clip, MovieClipUser
return tracking_context_get_frame_ibuf(clip, user, clip_flag, keyed_framenr);
}
-/* Get image buffer which si used as referece for track. */
+/* Get image buffer which si used as reference for track. */
static ImBuf *tracking_context_get_reference_ibuf(MovieClip *clip, MovieClipUser *user, int clip_flag,
MovieTrackingTrack *track, int curfra, bool backwards,
MovieTrackingMarker **reference_marker)
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c
index cbf1a02a46c..331db5b6ff0 100644
--- a/source/blender/blenkernel/intern/tracking_stabilize.c
+++ b/source/blender/blenkernel/intern/tracking_stabilize.c
@@ -992,7 +992,7 @@ static void initialize_all_tracks(StabContext *ctx, float aspect)
* By definition, offset contribution is zero there.
*/
int reference_frame = tracking->stabilization.anchor_frame;
- float average_angle=0, average_scale_step=0;
+ float average_angle = 0, average_scale_step = 0;
float average_translation[2], average_pos[2], pivot[2];
zero_v2(average_translation);
zero_v2(pivot);
diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c
index 8c1b846db84..621e0cc6a2e 100644
--- a/source/blender/blenkernel/intern/tracking_util.c
+++ b/source/blender/blenkernel/intern/tracking_util.c
@@ -853,17 +853,17 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
}
static libmv_CacheKey accessor_get_image_callback(
- struct libmv_FrameAccessorUserData *user_data,
- int clip_index,
- int frame,
- libmv_InputMode input_mode,
- int downscale,
- const libmv_Region *region,
- const libmv_FrameTransform *transform,
- float **destination,
- int *width,
- int *height,
- int *channels)
+ struct libmv_FrameAccessorUserData *user_data,
+ int clip_index,
+ int frame,
+ libmv_InputMode input_mode,
+ int downscale,
+ const libmv_Region *region,
+ const libmv_FrameTransform *transform,
+ float **destination,
+ int *width,
+ int *height,
+ int *channels)
{
TrackingImageAccessor *accessor = (TrackingImageAccessor *) user_data;
ImBuf *ibuf;
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 8606da0743b..3a903eb31c1 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -321,7 +321,7 @@ static const bUnitDef *unit_best_fit(
if (suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
continue;
- /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+ /* scale down scalar so 1cm doesn't convert to 10mm because of float error */
if (UNLIKELY(unit->flag & B_UNIT_DEF_TENTH)) {
if (value_abs >= unit->scalar * (0.1 - EPS)) {
return unit;
@@ -418,7 +418,7 @@ static size_t unit_as_string(char *str, int len_max, double value, int prec, con
#endif
}
- /* terminate no matter whats done with padding above */
+ /* terminate no matter what's done with padding above */
if (i >= len_max)
i = len_max - 1;
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 2bee16a30c8..68083b499f3 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -736,6 +736,26 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, RenderData *rd, int
c->sample_fmt = AV_SAMPLE_FMT_S16;
c->channels = rd->ffcodecdata.audio_channels;
+#ifdef FFMPEG_HAVE_FRAME_CHANNEL_LAYOUT
+ switch (rd->ffcodecdata.audio_channels) {
+ case FFM_CHANNELS_MONO:
+ c->channel_layout = AV_CH_LAYOUT_MONO;
+ break;
+ case FFM_CHANNELS_STEREO:
+ c->channel_layout = AV_CH_LAYOUT_STEREO;
+ break;
+ case FFM_CHANNELS_SURROUND4:
+ c->channel_layout = AV_CH_LAYOUT_QUAD;
+ break;
+ case FFM_CHANNELS_SURROUND51:
+ c->channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
+ break;
+ case FFM_CHANNELS_SURROUND71:
+ c->channel_layout = AV_CH_LAYOUT_7POINT1;
+ break;
+ }
+#endif
+
if (request_float_audio_buffer(codec_id)) {
/* mainly for AAC codec which is experimental */
c->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index 82704e95fdd..e8c92d9baff 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -49,8 +49,7 @@ typedef unsigned int BLI_bitmap;
#define BLI_BITMAP_SIZE(_tot) \
((size_t)(_BITMAP_NUM_BLOCKS(_tot)) * sizeof(BLI_bitmap))
-/* allocate memory for a bitmap with '_tot' bits; free
- * with MEM_freeN() */
+/* allocate memory for a bitmap with '_tot' bits; free with MEM_freeN() */
#define BLI_BITMAP_NEW(_tot, _alloc_string) \
((BLI_bitmap *)MEM_callocN(BLI_BITMAP_SIZE(_tot), \
_alloc_string))
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index b3a95d65752..e4cf4839b45 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -186,6 +186,11 @@ void limit_dist_v3(float v1[3], float v2[3], const float dist);
#define ISECT_LINE_LINE_CROSS 2
int isect_seg_seg_v2(const float a1[2], const float a2[2], const float b1[2], const float b2[2]);
+void isect_seg_seg_v3(
+ const float a0[3], const float a1[3],
+ const float b0[3], const float b1[3],
+ float r_a[3], float r_b[3]);
+
int isect_seg_seg_v2_int(const int a1[2], const int a2[2], const int b1[2], const int b2[2]);
int isect_seg_seg_v2_point_ex(
const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float endpoint_bias,
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index b4329bf81ac..e434e83416b 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -41,6 +41,7 @@ struct ListBase;
void BLI_setenv(const char *env, const char *val) ATTR_NONNULL(1);
void BLI_setenv_if_new(const char *env, const char *val) ATTR_NONNULL(1);
+const char *BLI_getenv(const char *env) ATTR_NONNULL(1);
void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file);
void BLI_make_exist(char *dir);
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index 471d875c9af..a6670266643 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -92,8 +92,8 @@ bool BLI_rcti_isect_segment(const struct rcti *rect, const int s1[2], const int
bool BLI_rctf_isect_segment(const struct rctf *rect, const float s1[2], const float s2[2]);
bool BLI_rcti_isect_circle(const struct rcti *rect, const float xy[2], const float radius);
bool BLI_rctf_isect_circle(const struct rctf *rect, const float xy[2], const float radius);
-bool BLI_rcti_inside_rcti(rcti *rct_a, const rcti *rct_b);
-bool BLI_rctf_inside_rctf(rctf *rct_a, const rctf *rct_b);
+bool BLI_rcti_inside_rcti(const rcti *rct_a, const rcti *rct_b);
+bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b);
void BLI_rcti_union(struct rcti *rcti1, const struct rcti *rcti2);
void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2);
void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 3d4b227ffa7..98c27bd053b 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -508,11 +508,11 @@ extern bool BLI_memory_is_zero(const void *arr, const size_t arr_size);
/* Warning-free macros for storing ints in pointers. Use these _only_
* for storing an int in a pointer, not a pointer in an int (64bit)! */
-#define SET_INT_IN_POINTER(i) ((void *)(intptr_t)(i))
-#define GET_INT_FROM_POINTER(i) ((void)0, ((int)(intptr_t)(i)))
+#define POINTER_FROM_INT(i) ((void *)(intptr_t)(i))
+#define POINTER_AS_INT(i) ((void)0, ((int)(intptr_t)(i)))
-#define SET_UINT_IN_POINTER(i) ((void *)(uintptr_t)(i))
-#define GET_UINT_FROM_POINTER(i) ((void)0, ((unsigned int)(uintptr_t)(i)))
+#define POINTER_FROM_UINT(i) ((void *)(uintptr_t)(i))
+#define POINTER_AS_UINT(i) ((void)0, ((unsigned int)(uintptr_t)(i)))
/* Set flag from a single test */
#define SET_FLAG_FROM_TEST(value, test, flag) \
diff --git a/source/blender/blenlib/intern/BLI_ghash_utils.c b/source/blender/blenlib/intern/BLI_ghash_utils.c
index 6554ee7c92f..953ceb3442b 100644
--- a/source/blender/blenlib/intern/BLI_ghash_utils.c
+++ b/source/blender/blenlib/intern/BLI_ghash_utils.c
@@ -126,7 +126,7 @@ uint BLI_ghashutil_inthash_p_murmur(const void *ptr)
uint BLI_ghashutil_inthash_p_simple(const void *ptr)
{
- return GET_UINT_FROM_POINTER(ptr);
+ return POINTER_AS_UINT(ptr);
}
bool BLI_ghashutil_intcmp(const void *a, const void *b)
diff --git a/source/blender/blenlib/intern/DLRB_tree.c b/source/blender/blenlib/intern/DLRB_tree.c
index 6ef77890e95..eb3a79502ae 100644
--- a/source/blender/blenlib/intern/DLRB_tree.c
+++ b/source/blender/blenlib/intern/DLRB_tree.c
@@ -572,7 +572,7 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
node->tree_col = DLRBT_RED;
/* perform BST balancing steps:
- * start from case 1, an trek through the tail-recursive insertion checks
+ * start from case 1, an trek through the tail-recursive insertion checks
*/
insert_check_1(tree, node);
}
diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c
index df93dad4c32..153ba3ea0d0 100644
--- a/source/blender/blenlib/intern/array_store.c
+++ b/source/blender/blenlib/intern/array_store.c
@@ -1760,7 +1760,7 @@ bool BLI_array_store_is_valid(
}
GHASH_ITER (gh_iter, chunk_list_map) {
const struct BChunkList *chunk_list = BLI_ghashIterator_getKey(&gh_iter);
- const int users = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter));
+ const int users = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter));
if (!(chunk_list->users == users)) {
ok = false;
goto user_finally;
@@ -1790,7 +1790,7 @@ bool BLI_array_store_is_valid(
GHASH_ITER (gh_iter, chunk_map) {
const struct BChunk *chunk = BLI_ghashIterator_getKey(&gh_iter);
- const int users = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter));
+ const int users = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter));
if (!(chunk->users == users)) {
ok = false;
goto user_finally;
diff --git a/source/blender/blenlib/intern/astar.c b/source/blender/blenlib/intern/astar.c
index 1b57dc5a683..86c1faad096 100644
--- a/source/blender/blenlib/intern/astar.c
+++ b/source/blender/blenlib/intern/astar.c
@@ -228,10 +228,10 @@ bool BLI_astar_graph_solve(
todo_nodes = BLI_heap_new();
BLI_heap_insert(todo_nodes,
f_cost_cb(as_graph, r_solution, NULL, -1, node_index_src, node_index_dst),
- SET_INT_IN_POINTER(node_index_src));
+ POINTER_FROM_INT(node_index_src));
while (!BLI_heap_is_empty(todo_nodes)) {
- const int node_curr_idx = GET_INT_FROM_POINTER(BLI_heap_pop_min(todo_nodes));
+ const int node_curr_idx = POINTER_AS_INT(BLI_heap_pop_min(todo_nodes));
BLI_AStarGNode *node_curr = &as_graph->nodes[node_curr_idx];
LinkData *ld;
@@ -271,7 +271,7 @@ bool BLI_astar_graph_solve(
* no problem. */
BLI_heap_insert(todo_nodes,
f_cost_cb(as_graph, r_solution, link, node_curr_idx, node_next_idx, node_index_dst),
- SET_INT_IN_POINTER(node_next_idx));
+ POINTER_FROM_INT(node_next_idx));
}
}
}
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index c7604b3cd6d..b493b97863c 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -99,7 +99,7 @@ static VChar *freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *
che->index = charcode;
che->width = glyph->advance.x * scale;
- BLI_ghash_insert(vfd->characters, SET_UINT_IN_POINTER(che->index), che);
+ BLI_ghash_insert(vfd->characters, POINTER_FROM_UINT(che->index), che);
/* Start converting the FT data */
onpoints = (int *)MEM_callocN((ftoutline.n_contours) * sizeof(int), "onpoints");
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 356740b138f..dca9d4204c3 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -911,6 +911,70 @@ int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], co
return ISECT_LINE_LINE_NONE;
}
+/* Returns a point on each segment that is closest to the other. */
+void isect_seg_seg_v3(
+ const float a0[3], const float a1[3],
+ const float b0[3], const float b1[3],
+ float r_a[3], float r_b[3])
+{
+ float fac_a, fac_b;
+ float a_dir[3], b_dir[3], a0b0[3], crs_ab[3];
+ sub_v3_v3v3(a_dir, a1, a0);
+ sub_v3_v3v3(b_dir, b1, b0);
+ sub_v3_v3v3(a0b0, b0, a0);
+ cross_v3_v3v3(crs_ab, b_dir, a_dir);
+ const float nlen = len_squared_v3(crs_ab);
+
+ if (nlen == 0.0f) {
+ /* Parallel Lines */
+ /* In this case return any point that
+ * is between the closest segments. */
+ float a0b1[3], a1b0[3], len_a, len_b, fac1, fac2;
+ sub_v3_v3v3(a0b1, b1, a0);
+ sub_v3_v3v3(a1b0, b0, a1);
+ len_a = len_squared_v3(a_dir);
+ len_b = len_squared_v3(b_dir);
+
+ if (len_a) {
+ fac1 = dot_v3v3(a0b0, a_dir);
+ fac2 = dot_v3v3(a0b1, a_dir);
+ CLAMP(fac1, 0.0f, len_a);
+ CLAMP(fac2, 0.0f, len_a);
+ fac_a = (fac1 + fac2) / (2 * len_a);
+ }
+ else {
+ fac_a = 0.0f;
+ }
+
+ if (len_b) {
+ fac1 = -dot_v3v3(a0b0, b_dir);
+ fac2 = -dot_v3v3(a1b0, b_dir);
+ CLAMP(fac1, 0.0f, len_b);
+ CLAMP(fac2, 0.0f, len_b);
+ fac_b = (fac1 + fac2) / (2 * len_b);
+ }
+ else {
+ fac_b = 0.0f;
+ }
+ }
+ else {
+ float c[3], cray[3];
+ sub_v3_v3v3(c, crs_ab, a0b0);
+
+ cross_v3_v3v3(cray, c, b_dir);
+ fac_a = dot_v3v3(cray, crs_ab) / nlen;
+
+ cross_v3_v3v3(cray, c, a_dir);
+ fac_b = dot_v3v3(cray, crs_ab) / nlen;
+
+ CLAMP(fac_a, 0.0f, 1.0f);
+ CLAMP(fac_b, 0.0f, 1.0f);
+ }
+
+ madd_v3_v3v3fl(r_a, a0, a_dir, fac_a);
+ madd_v3_v3v3fl(r_b, b0, b_dir, fac_b);
+}
+
/**
* Get intersection point of two 2D segments.
*
@@ -2618,8 +2682,9 @@ float line_plane_factor_v3(const float plane_co[3], const float plane_no[3],
return (dot != 0.0f) ? -dot_v3v3(plane_no, h) / dot : 0.0f;
}
-/** Ensure the distance between these points is no greater than 'dist'.
- * If it is, scale then both into the center.
+/**
+ * Ensure the distance between these points is no greater than 'dist'.
+ * If it is, scale then both into the center.
*/
void limit_dist_v3(float v1[3], float v2[3], const float dist)
{
@@ -3180,8 +3245,8 @@ void transform_point_by_tri_v3(
{
/* this works by moving the source triangle so its normal is pointing on the Z
* axis where its barycentric weights can be calculated in 2D and its Z offset can
- * be re-applied. The weights are applied directly to the targets 3D points and the
- * z-depth is used to scale the targets normal as an offset.
+ * be re-applied. The weights are applied directly to the targets 3D points and the
+ * z-depth is used to scale the targets normal as an offset.
* This saves transforming the target into its Z-Up orientation and back (which could also work) */
float no_tar[3], no_src[3];
float mat_src[3][3];
diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c
index 8c361673715..b93a7f55821 100644
--- a/source/blender/blenlib/intern/math_interp.c
+++ b/source/blender/blenlib/intern/math_interp.c
@@ -44,7 +44,7 @@
***************************************************************************/
/* BICUBIC Interpolation functions
- * More info: http://wiki.blender.org/index.php/User:Damiles#Bicubic_pixel_interpolation
+ * More info: http://wiki.blender.org/index.php/User:Damiles#Bicubic_pixel_interpolation
* function assumes out to be zero'ed, only does RGBA */
static float P(float k)
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 6272f2109d2..84c932db1c7 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1095,7 +1095,7 @@ bool BLI_path_program_extensions_add_win32(char *name, const size_t maxlen)
if ((type == 0) || S_ISDIR(type)) {
/* typically 3-5, ".EXE", ".BAT"... etc */
const int ext_max = 12;
- const char *ext = getenv("PATHEXT");
+ const char *ext = BLI_getenv("PATHEXT");
if (ext) {
const int name_len = strlen(name);
char *filename = alloca(name_len + ext_max);
@@ -1152,7 +1152,7 @@ bool BLI_path_program_search(
const char separator = ':';
#endif
- path = getenv("PATH");
+ path = BLI_getenv("PATH");
if (path) {
char filename[FILE_MAX];
const char *temp;
@@ -1160,12 +1160,12 @@ bool BLI_path_program_search(
do {
temp = strchr(path, separator);
if (temp) {
- strncpy(filename, path, temp - path);
+ memcpy(filename, path, temp - path);
filename[temp - path] = 0;
path = temp + 1;
}
else {
- strncpy(filename, path, sizeof(filename));
+ BLI_strncpy(filename, path, sizeof(filename));
}
BLI_path_append(filename, maxlen, name);
@@ -1220,11 +1220,28 @@ void BLI_setenv(const char *env, const char *val)
*/
void BLI_setenv_if_new(const char *env, const char *val)
{
- if (getenv(env) == NULL)
+ if (BLI_getenv(env) == NULL)
BLI_setenv(env, val);
}
/**
+* get an env var, result has to be used immediately
+*/
+const char *BLI_getenv(const char *env)
+{
+#ifdef _MSC_VER
+ static char buffer[32767]; /* 32767 is the total size of the environment block on windows*/
+ if (GetEnvironmentVariableA(env, buffer, sizeof(buffer)))
+ return buffer;
+ else
+ return NULL;
+#else
+ return getenv(env);
+#endif
+}
+
+
+/**
* Strips off nonexistent (or non-accessible) subdirectories from the end of *dir, leaving the path of
* the lowest-level directory that does exist and we can read.
*/
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index 764b12431d0..e0d92e8a19f 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -161,14 +161,14 @@ float BLI_rctf_length_y(const rctf *rect, const float y)
/**
* is \a rct_b inside \a rct_a
*/
-bool BLI_rctf_inside_rctf(rctf *rct_a, const rctf *rct_b)
+bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b)
{
return ((rct_a->xmin <= rct_b->xmin) &&
(rct_a->xmax >= rct_b->xmax) &&
(rct_a->ymin <= rct_b->ymin) &&
(rct_a->ymax >= rct_b->ymax));
}
-bool BLI_rcti_inside_rcti(rcti *rct_a, const rcti *rct_b)
+bool BLI_rcti_inside_rcti(const rcti *rct_a, const rcti *rct_b)
{
return ((rct_a->xmin <= rct_b->xmin) &&
(rct_a->xmax >= rct_b->xmax) &&
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index f69b35ce5a9..cfcc2bc4390 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -85,7 +85,7 @@
*/
char *BLI_current_working_dir(char *dir, const size_t maxncpy)
{
- const char *pwd = getenv("PWD");
+ const char *pwd = BLI_getenv("PWD");
if (pwd) {
size_t srclen = BLI_strnlen(pwd, maxncpy);
if (srclen != maxncpy) {
diff --git a/source/blender/blenlib/intern/string_utils.c b/source/blender/blenlib/intern/string_utils.c
index de24fc4d1f5..296086ed652 100644
--- a/source/blender/blenlib/intern/string_utils.c
+++ b/source/blender/blenlib/intern/string_utils.c
@@ -326,15 +326,13 @@ bool BLI_uniquename_cb(
# define GIVE_STRADDR(data, offset) ( ((char *)data) + offset)
#endif
-/* Generic function to set a unique name. It is only designed to be used in situations
+/**
+ * Generic function to set a unique name. It is only designed to be used in situations
* where the name is part of the struct.
*
* For places where this is used, see constraint.c for example...
*
- * name_offs: should be calculated using offsetof(structname, membername) macro from stddef.h
- * len: maximum length of string (to prevent overflows, etc.)
- * defname: the name that should be used by default if none is specified already
- * delim: the character which acts as a delimiter between parts of the name
+ * \param name_offs: should be calculated using offsetof(structname, membername) macro from stddef.h
*/
static bool uniquename_find_dupe(ListBase *list, void *vlink, const char *name, int name_offs)
{
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index 5d3c6b35ac1..2bb5d5397a9 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -116,7 +116,7 @@ typedef struct Task {
* At this moment task queue owns the memory.
*
* - When task is done and task_free() is called the memory will be put to the
- * pool which corresponds to a thread which handled the task.
+ * pool which corresponds to a thread which handled the task.
*/
typedef struct TaskMemPool {
/* Number of pre-allocated tasks in the pool. */
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 13b7b7c1559..c5062ed1e16 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -400,7 +400,7 @@ static void do_versions_nodetree_image_layer_2_64_5(bNodeTree *ntree)
NodeImageLayer *output = MEM_callocN(sizeof(NodeImageLayer), "node image layer");
/* take pass index both from current storage ptr (actually an int) */
- output->pass_index = GET_INT_FROM_POINTER(sock->storage);
+ output->pass_index = POINTER_AS_INT(sock->storage);
/* replace socket data pointer */
sock->storage = output;
diff --git a/source/blender/blentranslation/intern/blt_lang.c b/source/blender/blentranslation/intern/blt_lang.c
index 916de3a5d20..f373ca24861 100644
--- a/source/blender/blentranslation/intern/blt_lang.c
+++ b/source/blender/blentranslation/intern/blt_lang.c
@@ -214,7 +214,7 @@ void BLT_lang_init(void)
*
* Would also be good to find nicer way to check if LANG is correct.
*/
- const char *lang = getenv("LANG");
+ const char *lang = BLI_getenv("LANG");
if (lang != NULL) {
char *old_locale = setlocale(LC_ALL, NULL);
/* Make a copy so subsequenct setlocale() doesn't interfere. */
diff --git a/source/blender/blentranslation/intern/blt_translation.c b/source/blender/blentranslation/intern/blt_translation.c
index 9175585f1b3..40d384dd0fe 100644
--- a/source/blender/blentranslation/intern/blt_translation.c
+++ b/source/blender/blentranslation/intern/blt_translation.c
@@ -41,6 +41,7 @@
#include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
+#include "BLI_threads.h"
#include "DNA_userdef_types.h" /* For user settings. */
@@ -91,7 +92,7 @@ const char *BLT_pgettext(const char *msgctxt, const char *msgid)
bool BLT_translate(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) != 0;
+ return BLI_thread_is_main() && (U.transopts & USER_DOTRANSLATE);
#else
return false;
#endif
@@ -100,7 +101,7 @@ bool BLT_translate(void)
bool BLT_translate_iface(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE);
+ return BLT_translate() && (U.transopts & USER_TR_IFACE);
#else
return false;
#endif
@@ -109,7 +110,7 @@ bool BLT_translate_iface(void)
bool BLT_translate_tooltips(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS);
+ return BLT_translate() && (U.transopts & USER_TR_TOOLTIPS);
#else
return false;
#endif
@@ -118,7 +119,7 @@ bool BLT_translate_tooltips(void)
bool BLT_translate_new_dataname(void)
{
#ifdef WITH_INTERNATIONAL
- return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_NEWDATANAME);
+ return BLT_translate() && (U.transopts & USER_TR_NEWDATANAME);
#else
return false;
#endif
diff --git a/source/blender/bmesh/intern/bmesh_callback_generic.c b/source/blender/bmesh/intern/bmesh_callback_generic.c
index e9304e8536f..90b2497aa80 100644
--- a/source/blender/bmesh/intern/bmesh_callback_generic.c
+++ b/source/blender/bmesh/intern/bmesh_callback_generic.c
@@ -32,7 +32,7 @@
bool BM_elem_cb_check_hflag_ex(BMElem *ele, void *user_data)
{
- const uint hflag_pair = GET_INT_FROM_POINTER(user_data);
+ const uint hflag_pair = POINTER_AS_INT(user_data);
const char hflag_p = (hflag_pair & 0xff);
const char hflag_n = (hflag_pair >> 8);
@@ -42,14 +42,14 @@ bool BM_elem_cb_check_hflag_ex(BMElem *ele, void *user_data)
bool BM_elem_cb_check_hflag_enabled(BMElem *ele, void *user_data)
{
- const char hflag = GET_INT_FROM_POINTER(user_data);
+ const char hflag = POINTER_AS_INT(user_data);
return (BM_elem_flag_test(ele, hflag) != 0);
}
bool BM_elem_cb_check_hflag_disabled(BMElem *ele, void *user_data)
{
- const char hflag = GET_INT_FROM_POINTER(user_data);
+ const char hflag = POINTER_AS_INT(user_data);
return (BM_elem_flag_test(ele, hflag) == 0);
}
diff --git a/source/blender/bmesh/intern/bmesh_callback_generic.h b/source/blender/bmesh/intern/bmesh_callback_generic.h
index 3cae01d417f..44495d54edd 100644
--- a/source/blender/bmesh/intern/bmesh_callback_generic.h
+++ b/source/blender/bmesh/intern/bmesh_callback_generic.h
@@ -32,14 +32,14 @@ bool BM_elem_cb_check_elem_not_equal(BMElem *ele, void *user_data);
#define BM_elem_cb_check_hflag_ex_simple(type, hflag_p, hflag_n) \
(bool (*)(type, void *))BM_elem_cb_check_hflag_ex, \
- SET_UINT_IN_POINTER(((hflag_p) | (hflag_n << 8)))
+ POINTER_FROM_UINT(((hflag_p) | (hflag_n << 8)))
#define BM_elem_cb_check_hflag_enabled_simple(type, hflag_p) \
(bool (*)(type, void *))BM_elem_cb_check_hflag_enabled, \
- SET_UINT_IN_POINTER((hflag_p))
+ POINTER_FROM_UINT((hflag_p))
#define BM_elem_cb_check_hflag_disabled_simple(type, hflag_n) \
(bool (*)(type, void *))BM_elem_cb_check_hflag_disabled, \
- SET_UINT_IN_POINTER(hflag_n)
+ POINTER_FROM_UINT(hflag_n)
#endif /* __BMESH_CALLBACK_GENERIC_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index e3b779ddbcd..e9c92e0d5e4 100644
--- a/source/blender/bmesh/intern/bmesh_interp.c
+++ b/source/blender/bmesh/intern/bmesh_interp.c
@@ -583,18 +583,19 @@ void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f)
int sides;
int y;
- /*
- * mdisps is a grid of displacements, ordered thus:
- *
- * v4/next
- * |
- * | v1/cent-----mid2 ---> x
- * | | |
- * | | |
- * v2/prev---mid1-----v3/cur
- * |
- * V
- * y
+ /**
+ * mdisps is a grid of displacements, ordered thus:
+ * <pre>
+ * v4/next
+ * |
+ * | v1/cent-----mid2 ---> x
+ * | | |
+ * | | |
+ * v2/prev---mid1-----v3/cur
+ * |
+ * V
+ * y
+ * </pre>
*/
sides = (int)sqrt(mdp->totdisp);
@@ -613,18 +614,19 @@ void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f)
int sides;
int y;
- /*
- * mdisps is a grid of displacements, ordered thus:
- *
- * v4/next
- * |
- * | v1/cent-----mid2 ---> x
- * | | |
- * | | |
- * v2/prev---mid1-----v3/cur
- * |
- * V
- * y
+ /**
+ * mdisps is a grid of displacements, ordered thus:
+ * <pre>
+ * v4/next
+ * |
+ * | v1/cent-----mid2 ---> x
+ * | | |
+ * | | |
+ * v2/prev---mid1-----v3/cur
+ * |
+ * V
+ * y
+ * </pre>
*/
if (l->radial_next == l)
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index 30ab0dd9459..732647f83a7 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -134,13 +134,13 @@ typedef struct {
static uint bm_log_vert_id_get(BMLog *log, BMVert *v)
{
BLI_assert(BLI_ghash_haskey(log->elem_to_id, v));
- return GET_UINT_FROM_POINTER(BLI_ghash_lookup(log->elem_to_id, v));
+ return POINTER_AS_UINT(BLI_ghash_lookup(log->elem_to_id, v));
}
/* Set the vertex's unique ID in the log */
static void bm_log_vert_id_set(BMLog *log, BMVert *v, uint id)
{
- void *vid = SET_UINT_IN_POINTER(id);
+ void *vid = POINTER_FROM_UINT(id);
BLI_ghash_reinsert(log->id_to_elem, vid, v, NULL, NULL);
BLI_ghash_reinsert(log->elem_to_id, v, vid, NULL, NULL);
@@ -149,7 +149,7 @@ static void bm_log_vert_id_set(BMLog *log, BMVert *v, uint id)
/* Get a vertex from its unique ID */
static BMVert *bm_log_vert_from_id(BMLog *log, uint id)
{
- void *key = SET_UINT_IN_POINTER(id);
+ void *key = POINTER_FROM_UINT(id);
BLI_assert(BLI_ghash_haskey(log->id_to_elem, key));
return BLI_ghash_lookup(log->id_to_elem, key);
}
@@ -158,13 +158,13 @@ static BMVert *bm_log_vert_from_id(BMLog *log, uint id)
static uint bm_log_face_id_get(BMLog *log, BMFace *f)
{
BLI_assert(BLI_ghash_haskey(log->elem_to_id, f));
- return GET_UINT_FROM_POINTER(BLI_ghash_lookup(log->elem_to_id, f));
+ return POINTER_AS_UINT(BLI_ghash_lookup(log->elem_to_id, f));
}
/* Set the face's unique ID in the log */
static void bm_log_face_id_set(BMLog *log, BMFace *f, uint id)
{
- void *fid = SET_UINT_IN_POINTER(id);
+ void *fid = POINTER_FROM_UINT(id);
BLI_ghash_reinsert(log->id_to_elem, fid, f, NULL, NULL);
BLI_ghash_reinsert(log->elem_to_id, f, fid, NULL, NULL);
@@ -173,7 +173,7 @@ static void bm_log_face_id_set(BMLog *log, BMFace *f, uint id)
/* Get a face from its unique ID */
static BMFace *bm_log_face_from_id(BMLog *log, uint id)
{
- void *key = SET_UINT_IN_POINTER(id);
+ void *key = POINTER_FROM_UINT(id);
BLI_assert(BLI_ghash_haskey(log->id_to_elem, key));
return BLI_ghash_lookup(log->id_to_elem, key);
}
@@ -255,7 +255,7 @@ static void bm_log_verts_unmake(BMesh *bm, BMLog *log, GHash *verts)
GHASH_ITER (gh_iter, verts) {
void *key = BLI_ghashIterator_getKey(&gh_iter);
BMLogVert *lv = BLI_ghashIterator_getValue(&gh_iter);
- uint id = GET_UINT_FROM_POINTER(key);
+ uint id = POINTER_AS_UINT(key);
BMVert *v = bm_log_vert_from_id(log, id);
/* Ensure the log has the final values of the vertex before
@@ -271,7 +271,7 @@ static void bm_log_faces_unmake(BMesh *bm, BMLog *log, GHash *faces)
GHashIterator gh_iter;
GHASH_ITER (gh_iter, faces) {
void *key = BLI_ghashIterator_getKey(&gh_iter);
- uint id = GET_UINT_FROM_POINTER(key);
+ uint id = POINTER_AS_UINT(key);
BMFace *f = bm_log_face_from_id(log, id);
BMEdge *e_tri[3];
BMLoop *l_iter;
@@ -304,7 +304,7 @@ static void bm_log_verts_restore(BMesh *bm, BMLog *log, GHash *verts)
vert_mask_set(v, lv->mask, cd_vert_mask_offset);
v->head.hflag = lv->hflag;
normal_short_to_float_v3(v->no, lv->no);
- bm_log_vert_id_set(log, v, GET_UINT_FROM_POINTER(key));
+ bm_log_vert_id_set(log, v, POINTER_AS_UINT(key));
}
}
@@ -321,7 +321,7 @@ static void bm_log_faces_restore(BMesh *bm, BMLog *log, GHash *faces)
f = BM_face_create_verts(bm, v, 3, NULL, BM_CREATE_NOP, true);
f->head.hflag = lf->hflag;
- bm_log_face_id_set(log, f, GET_UINT_FROM_POINTER(key));
+ bm_log_face_id_set(log, f, POINTER_AS_UINT(key));
}
}
@@ -333,7 +333,7 @@ static void bm_log_vert_values_swap(BMesh *bm, BMLog *log, GHash *verts)
GHASH_ITER (gh_iter, verts) {
void *key = BLI_ghashIterator_getKey(&gh_iter);
BMLogVert *lv = BLI_ghashIterator_getValue(&gh_iter);
- uint id = GET_UINT_FROM_POINTER(key);
+ uint id = POINTER_AS_UINT(key);
BMVert *v = bm_log_vert_from_id(log, id);
float mask;
short normal[3];
@@ -355,7 +355,7 @@ static void bm_log_face_values_swap(BMLog *log, GHash *faces)
GHASH_ITER (gh_iter, faces) {
void *key = BLI_ghashIterator_getKey(&gh_iter);
BMLogFace *lf = BLI_ghashIterator_getValue(&gh_iter);
- uint id = GET_UINT_FROM_POINTER(key);
+ uint id = POINTER_AS_UINT(key);
BMFace *f = bm_log_face_from_id(log, id);
SWAP(char, f->head.hflag, lf->hflag);
@@ -425,7 +425,7 @@ static void bm_log_id_ghash_retake(RangeTreeUInt *unused_ids, GHash *id_ghash)
GHASH_ITER (gh_iter, id_ghash) {
void *key = BLI_ghashIterator_getKey(&gh_iter);
- uint id = GET_UINT_FROM_POINTER(key);
+ uint id = POINTER_AS_UINT(key);
range_tree_uint_retake(unused_ids, id);
}
@@ -454,8 +454,8 @@ static GHash *bm_log_compress_ids_to_indices(uint *ids, uint totid)
qsort(ids, totid, sizeof(*ids), uint_compare);
for (i = 0; i < totid; i++) {
- void *key = SET_UINT_IN_POINTER(ids[i]);
- void *val = SET_UINT_IN_POINTER(i);
+ void *key = POINTER_FROM_UINT(ids[i]);
+ void *val = POINTER_FROM_UINT(i);
BLI_ghash_insert(map, key, val);
}
@@ -469,7 +469,7 @@ static void bm_log_id_ghash_release(BMLog *log, GHash *id_ghash)
GHASH_ITER (gh_iter, id_ghash) {
void *key = BLI_ghashIterator_getKey(&gh_iter);
- uint id = GET_UINT_FROM_POINTER(key);
+ uint id = POINTER_AS_UINT(key);
range_tree_uint_release(log->unused_ids, id);
}
}
@@ -620,9 +620,9 @@ void BM_log_mesh_elems_reorder(BMesh *bm, BMLog *log)
id_to_idx = bm_log_compress_ids_to_indices(varr, (uint)bm->totvert);
BM_ITER_MESH_INDEX (v, &bm_iter, bm, BM_VERTS_OF_MESH, i) {
const unsigned id = bm_log_vert_id_get(log, v);
- const void *key = SET_UINT_IN_POINTER(id);
+ const void *key = POINTER_FROM_UINT(id);
const void *val = BLI_ghash_lookup(id_to_idx, key);
- varr[i] = GET_UINT_FROM_POINTER(val);
+ varr[i] = POINTER_AS_UINT(val);
}
BLI_ghash_free(id_to_idx, NULL, NULL);
@@ -630,9 +630,9 @@ void BM_log_mesh_elems_reorder(BMesh *bm, BMLog *log)
id_to_idx = bm_log_compress_ids_to_indices(farr, (uint)bm->totface);
BM_ITER_MESH_INDEX (f, &bm_iter, bm, BM_FACES_OF_MESH, i) {
const unsigned id = bm_log_face_id_get(log, f);
- const void *key = SET_UINT_IN_POINTER(id);
+ const void *key = POINTER_FROM_UINT(id);
const void *val = BLI_ghash_lookup(id_to_idx, key);
- farr[i] = GET_UINT_FROM_POINTER(val);
+ farr[i] = POINTER_AS_UINT(val);
}
BLI_ghash_free(id_to_idx, NULL, NULL);
@@ -840,7 +840,7 @@ void BM_log_vert_before_modified(BMLog *log, BMVert *v, const int cd_vert_mask_o
BMLogEntry *entry = log->current_entry;
BMLogVert *lv;
uint v_id = bm_log_vert_id_get(log, v);
- void *key = SET_UINT_IN_POINTER(v_id);
+ void *key = POINTER_FROM_UINT(v_id);
void **val_p;
/* Find or create the BMLogVert entry */
@@ -864,7 +864,7 @@ void BM_log_vert_added(BMLog *log, BMVert *v, const int cd_vert_mask_offset)
{
BMLogVert *lv;
uint v_id = range_tree_uint_take_any(log->unused_ids);
- void *key = SET_UINT_IN_POINTER(v_id);
+ void *key = POINTER_FROM_UINT(v_id);
bm_log_vert_id_set(log, v, v_id);
lv = bm_log_vert_alloc(log, v, cd_vert_mask_offset);
@@ -881,7 +881,7 @@ void BM_log_face_modified(BMLog *log, BMFace *f)
{
BMLogFace *lf;
uint f_id = bm_log_face_id_get(log, f);
- void *key = SET_UINT_IN_POINTER(f_id);
+ void *key = POINTER_FROM_UINT(f_id);
lf = bm_log_face_alloc(log, f);
BLI_ghash_insert(log->current_entry->modified_faces, key, lf);
@@ -897,7 +897,7 @@ void BM_log_face_added(BMLog *log, BMFace *f)
{
BMLogFace *lf;
uint f_id = range_tree_uint_take_any(log->unused_ids);
- void *key = SET_UINT_IN_POINTER(f_id);
+ void *key = POINTER_FROM_UINT(f_id);
/* Only triangles are supported for now */
BLI_assert(f->len == 3);
@@ -927,7 +927,7 @@ void BM_log_vert_removed(BMLog *log, BMVert *v, const int cd_vert_mask_offset)
{
BMLogEntry *entry = log->current_entry;
uint v_id = bm_log_vert_id_get(log, v);
- void *key = SET_UINT_IN_POINTER(v_id);
+ void *key = POINTER_FROM_UINT(v_id);
/* if it has a key, it shouldn't be NULL */
BLI_assert(!!BLI_ghash_lookup(entry->added_verts, key) ==
@@ -968,7 +968,7 @@ void BM_log_face_removed(BMLog *log, BMFace *f)
{
BMLogEntry *entry = log->current_entry;
uint f_id = bm_log_face_id_get(log, f);
- void *key = SET_UINT_IN_POINTER(f_id);
+ void *key = POINTER_FROM_UINT(f_id);
/* if it has a key, it shouldn't be NULL */
BLI_assert(!!BLI_ghash_lookup(entry->added_faces, key) ==
@@ -1040,7 +1040,7 @@ const float *BM_log_original_vert_co(BMLog *log, BMVert *v)
BMLogEntry *entry = log->current_entry;
const BMLogVert *lv;
unsigned v_id = bm_log_vert_id_get(log, v);
- void *key = SET_UINT_IN_POINTER(v_id);
+ void *key = POINTER_FROM_UINT(v_id);
BLI_assert(entry);
@@ -1058,7 +1058,7 @@ const short *BM_log_original_vert_no(BMLog *log, BMVert *v)
BMLogEntry *entry = log->current_entry;
const BMLogVert *lv;
unsigned v_id = bm_log_vert_id_get(log, v);
- void *key = SET_UINT_IN_POINTER(v_id);
+ void *key = POINTER_FROM_UINT(v_id);
BLI_assert(entry);
@@ -1076,7 +1076,7 @@ float BM_log_original_mask(BMLog *log, BMVert *v)
BMLogEntry *entry = log->current_entry;
const BMLogVert *lv;
unsigned v_id = bm_log_vert_id_get(log, v);
- void *key = SET_UINT_IN_POINTER(v_id);
+ void *key = POINTER_FROM_UINT(v_id);
BLI_assert(entry);
@@ -1093,7 +1093,7 @@ void BM_log_original_vert_data(
BMLogEntry *entry = log->current_entry;
const BMLogVert *lv;
unsigned v_id = bm_log_vert_id_get(log, v);
- void *key = SET_UINT_IN_POINTER(v_id);
+ void *key = POINTER_FROM_UINT(v_id);
BLI_assert(entry);
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c
index b5e6fe168e5..7abf05044dd 100644
--- a/source/blender/bmesh/intern/bmesh_opdefines.c
+++ b/source/blender/bmesh/intern/bmesh_opdefines.c
@@ -881,6 +881,7 @@ static BMOpDefine bmo_extrude_discrete_faces_def = {
"extrude_discrete_faces",
/* slots_in */
{{"faces", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* input faces */
+ {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
{"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */
{{'\0'}},
},
@@ -902,6 +903,7 @@ static BMOpDefine bmo_extrude_edge_only_def = {
"extrude_edge_only",
/* slots_in */
{{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input vertices */
+ {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
{"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */
{{'\0'}},
},
@@ -1037,6 +1039,7 @@ static BMOpDefine bmo_extrude_face_region_def = {
{{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* edges and faces */
{"edges_exclude", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_EMPTY}},
{"use_keep_orig", BMO_OP_SLOT_BOOL}, /* keep original geometry (requires ``geom`` to include edges). */
+ {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
{"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */
{{'\0'}},
},
@@ -1386,6 +1389,8 @@ static BMOpDefine bmo_spin_def = {
{"angle", BMO_OP_SLOT_FLT}, /* total rotation angle (radians) */
{"space", BMO_OP_SLOT_MAT}, /* matrix to define the space (typically object matrix) */
{"steps", BMO_OP_SLOT_INT}, /* number of steps */
+ {"use_merge", BMO_OP_SLOT_BOOL}, /* Merge first/last when the angle is a full revolution. */
+ {"use_normal_flip", BMO_OP_SLOT_BOOL}, /* Create faces with reversed direction. */
{"use_duplicate", BMO_OP_SLOT_BOOL}, /* duplicate or extrude? */
{{'\0'}},
},
@@ -1424,7 +1429,7 @@ static BMOpDefine bmo_similar_faces_def = {
/*
* Similar Edges Search.
*
- * Find similar edges (length, direction, edge, seam, ...).
+ * Find similar edges (length, direction, edge, seam, ...).
*/
static BMOpDefine bmo_similar_edges_def = {
"similar_edges",
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 7cbc6461667..3137725d6e7 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -869,7 +869,7 @@ void BM_face_normal_flip(BMesh *bm, BMFace *f)
}
/**
- * BM POINT IN FACE
+ * BM POINT IN FACE
*
* Projects co onto face f, and returns true if it is inside
* the face bounds.
@@ -1284,7 +1284,7 @@ void BM_face_splits_check_optimal(BMFace *f, BMLoop *(*loops)[2], int len)
* Small utility functions for fast access
*
* faster alternative to:
- * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 3);
+ * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 3);
*/
void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3])
{
@@ -1299,7 +1299,7 @@ void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3])
/**
* faster alternative to:
- * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 4);
+ * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 4);
*/
void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4])
{
@@ -1318,7 +1318,7 @@ void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4])
* Small utility functions for fast access
*
* faster alternative to:
- * BM_iter_as_array(bm, BM_LOOPS_OF_FACE, f, (void **)l, 3);
+ * BM_iter_as_array(bm, BM_LOOPS_OF_FACE, f, (void **)l, 3);
*/
void BM_face_as_array_loop_tri(BMFace *f, BMLoop *r_loops[3])
{
@@ -1333,7 +1333,7 @@ void BM_face_as_array_loop_tri(BMFace *f, BMLoop *r_loops[3])
/**
* faster alternative to:
- * BM_iter_as_array(bm, BM_LOOPS_OF_FACE, f, (void **)l, 4);
+ * BM_iter_as_array(bm, BM_LOOPS_OF_FACE, f, (void **)l, 4);
*/
void BM_face_as_array_loop_quad(BMFace *f, BMLoop *r_loops[4])
{
@@ -1352,7 +1352,7 @@ void BM_face_as_array_loop_quad(BMFace *f, BMLoop *r_loops[4])
* \brief BM_mesh_calc_tessellation get the looptris and its number from a certain bmesh
* \param looptris
*
- * \note \a looptris Must be pre-allocated to at least the size of given by: poly_to_tri_count
+ * \note \a looptris Must be pre-allocated to at least the size of given by: poly_to_tri_count
*/
void BM_mesh_calc_tessellation(BMesh *bm, BMLoop *(*looptris)[3], int *r_looptris_tot)
{
diff --git a/source/blender/bmesh/intern/bmesh_private.h b/source/blender/bmesh/intern/bmesh_private.h
index daee22ffe76..61e47a6cbd4 100644
--- a/source/blender/bmesh/intern/bmesh_private.h
+++ b/source/blender/bmesh/intern/bmesh_private.h
@@ -31,9 +31,9 @@
/** \file blender/bmesh/intern/bmesh_private.h
* \ingroup bmesh
*
- * Private function prototypes for bmesh public API.
- * This file is a grab-bag of functions from various
- * parts of the bmesh internals.
+ * Private function prototypes for bmesh public API.
+ * This file is a grab-bag of functions from various
+ * parts of the bmesh internals.
*/
/* returns positive nonzero on error */
diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c
index 33ad7836893..540888ac0b9 100644
--- a/source/blender/bmesh/intern/bmesh_query.c
+++ b/source/blender/bmesh/intern/bmesh_query.c
@@ -1206,7 +1206,7 @@ bool BM_face_share_face_check(BMFace *f1, BMFace *f2)
}
/**
- * Counts the number of edges two faces share (if any)
+ * Counts the number of edges two faces share (if any)
*/
int BM_face_share_edge_count(BMFace *f_a, BMFace *f_b)
{
@@ -1225,7 +1225,7 @@ int BM_face_share_edge_count(BMFace *f_a, BMFace *f_b)
}
/**
- * Returns true if the faces share an edge
+ * Returns true if the faces share an edge
*/
bool BM_face_share_edge_check(BMFace *f1, BMFace *f2)
{
@@ -1243,7 +1243,7 @@ bool BM_face_share_edge_check(BMFace *f1, BMFace *f2)
}
/**
- * Counts the number of verts two faces share (if any).
+ * Counts the number of verts two faces share (if any).
*/
int BM_face_share_vert_count(BMFace *f_a, BMFace *f_b)
{
@@ -1262,7 +1262,7 @@ int BM_face_share_vert_count(BMFace *f_a, BMFace *f_b)
}
/**
- * Returns true if the faces share a vert.
+ * Returns true if the faces share a vert.
*/
bool BM_face_share_vert_check(BMFace *f_a, BMFace *f_b)
{
@@ -1656,8 +1656,8 @@ void BM_loop_calc_face_tangent(const BMLoop *l, float r_tangent[3])
/**
* \brief BMESH EDGE/FACE ANGLE
*
- * Calculates the angle between two faces.
- * Assumes the face normals are correct.
+ * Calculates the angle between two faces.
+ * Assumes the face normals are correct.
*
* \return angle in radians
*/
@@ -1680,8 +1680,8 @@ float BM_edge_calc_face_angle(const BMEdge *e)
/**
* \brief BMESH EDGE/FACE ANGLE
*
- * Calculates the angle between two faces.
- * Assumes the face normals are correct.
+ * Calculates the angle between two faces.
+ * Assumes the face normals are correct.
*
* \return angle in radians
*/
diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c
index eed87ed20af..c50c7657deb 100644
--- a/source/blender/bmesh/operators/bmo_dupe.c
+++ b/source/blender/bmesh/operators/bmo_dupe.c
@@ -26,6 +26,8 @@
* Duplicate, Split, Split operators.
*/
+#include "MEM_guardedalloc.h"
+
#include "BLI_math.h"
#include "BLI_alloca.h"
@@ -486,9 +488,29 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
steps = BMO_slot_int_get(op->slots_in, "steps");
phi = BMO_slot_float_get(op->slots_in, "angle") / steps;
do_dupli = BMO_slot_bool_get(op->slots_in, "use_duplicate");
+ const bool use_normal_flip = BMO_slot_bool_get(op->slots_in, "use_normal_flip");
+ /* Caller needs to perform other sanity checks (such as the spin being 360d). */
+ const bool use_merge = BMO_slot_bool_get(op->slots_in, "use_merge") && steps >= 3;
axis_angle_normalized_to_mat3(rmat, axis, phi);
+ BMVert **vtable = NULL;
+ if (use_merge) {
+ vtable = MEM_mallocN(sizeof(BMVert *) * bm->totvert, __func__);
+ int i = 0;
+ BMIter iter;
+ BMVert *v;
+ BM_ITER_MESH_INDEX (v, &iter, bm, BM_VERTS_OF_MESH, i) {
+ vtable[i] = v;
+ /* Evil! store original index in normal,
+ * this is duplicated into every other vertex.
+ * So we can read the original from the final.
+ *
+ * The normals must be recalculated anyway. */
+ *((int *)&v->no[0]) = i;
+ }
+ }
+
BMO_slot_copy(op, slots_in, "geom",
op, slots_out, "geom_last.out");
for (a = 0; a < steps; a++) {
@@ -503,14 +525,47 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
BMO_op_finish(bm, &dupop);
}
else {
- BMO_op_initf(bm, &extop, op->flag, "extrude_face_region geom=%S",
- op, "geom_last.out");
+ BMO_op_initf(bm, &extop, op->flag, "extrude_face_region geom=%S use_normal_flip=%b",
+ op, "geom_last.out", use_normal_flip && (a == 0));
BMO_op_exec(bm, &extop);
- BMO_op_callf(bm, op->flag,
- "rotate cent=%v matrix=%m3 space=%s verts=%S",
- cent, rmat, op, "space", &extop, "geom.out");
- BMO_slot_copy(&extop, slots_out, "geom.out",
- op, slots_out, "geom_last.out");
+ if ((use_merge && (a == steps - 1)) == false) {
+ BMO_op_callf(bm, op->flag,
+ "rotate cent=%v matrix=%m3 space=%s verts=%S",
+ cent, rmat, op, "space", &extop, "geom.out");
+ BMO_slot_copy(&extop, slots_out, "geom.out",
+ op, slots_out, "geom_last.out");
+ }
+ else {
+ /* Merge first/last vertices and edges (maintaining 'geom.out' state). */
+ BMOpSlot *slot_geom_out = BMO_slot_get(extop.slots_out, "geom.out");
+ BMElem **elem_array = (BMElem **)slot_geom_out->data.buf;
+ int elem_array_len = slot_geom_out->len;
+ for (int i = 0; i < elem_array_len; ) {
+ if (elem_array[i]->head.htype == BM_VERT) {
+ BMVert *v_src = (BMVert *)elem_array[i];
+ BMVert *v_dst = vtable[*((const int *)&v_src->no[0])];
+ BM_vert_splice(bm, v_dst, v_src);
+ elem_array_len--;
+ elem_array[i] = elem_array[elem_array_len];
+ }
+ else {
+ i++;
+ }
+ }
+ for (int i = 0; i < elem_array_len; ) {
+ if (elem_array[i]->head.htype == BM_EDGE) {
+ BMEdge *e_src = (BMEdge *)elem_array[i];
+ BMEdge *e_dst = BM_edge_find_double(e_src);
+ BM_edge_splice(bm, e_dst, e_src);
+ elem_array_len--;
+ elem_array[i] = elem_array[elem_array_len];
+ }
+ else {
+ i++;
+ }
+ }
+ slot_geom_out->len = elem_array_len;
+ }
BMO_op_finish(bm, &extop);
}
@@ -521,4 +576,8 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
dvec, op, "space", op, "geom_last.out");
}
}
+
+ if (vtable) {
+ MEM_freeN(vtable);
+ }
}
diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c
index 3a6fbd419c1..8c1624740da 100644
--- a/source/blender/bmesh/operators/bmo_extrude.c
+++ b/source/blender/bmesh/operators/bmo_extrude.c
@@ -186,6 +186,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
BMOperator dupeop;
BMFace *f;
BMEdge *e, *e_new;
+ const bool use_normal_flip = BMO_slot_bool_get(op->slots_in, "use_normal_flip");
BMO_ITER (e, &siter, op->slots_in, "edges", BM_EDGE) {
BMO_edge_flag_enable(bm, e, EXT_INPUT);
@@ -212,7 +213,9 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
BMVert *f_verts[4];
e_new = BMO_iter_map_value_ptr(&siter);
- if (e->l && e->v1 != e->l->v) {
+
+ const bool edge_normal_flip = !(e->l && e->v1 != e->l->v);
+ if (edge_normal_flip == use_normal_flip) {
f_verts[0] = e->v1;
f_verts[1] = e->v2;
f_verts[2] = e_new->v2;
@@ -332,9 +335,10 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
BMEdge *e, *e_new;
BMVert *v;
BMFace *f;
- bool found, fwd, delorig = false;
+ bool found, delorig = false;
BMOpSlot *slot_facemap_out;
BMOpSlot *slot_edges_exclude;
+ const bool use_normal_flip = BMO_slot_bool_get(op->slots_in, "use_normal_flip");
/* initialize our sub-operators */
BMO_op_initf(
@@ -488,13 +492,11 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
/* orient loop to give same normal as a loop of newedge
* if it exists (will be an extruded face),
* else same normal as a loop of e, if it exists */
- if (!e_new->l)
- fwd = !e->l || !(e->l->v == e->v1);
- else
- fwd = (e_new->l->v == e_new->v1);
-
-
- if (fwd) {
+ const bool edge_normal_flip = !(
+ e_new->l ?
+ (e_new->l->v == e_new->v1) :
+ (!e->l || !(e->l->v == e->v1)));
+ if (edge_normal_flip == use_normal_flip) {
f_verts[0] = e->v1;
f_verts[1] = e->v2;
f_verts[2] = e_new->v2;
diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
index 317045b303c..9f394aacc1c 100644
--- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c
+++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
@@ -153,9 +153,12 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, in
return sys;
}
-/* Compute weight between vertice v_i and all your neighbors
+/**
+ * Compute weight between vertice v_i and all your neighbors
* weight between v_i and v_neighbor
+ * <pre>
* Wij = cot(alpha) + cot(beta) / (4.0 * total area of all faces * sum all weight)
+ *
* v_i *
* / | \
* / | \
@@ -163,6 +166,7 @@ static LaplacianSystem *init_laplacian_system(int a_numEdges, int a_numFaces, in
* \ | /
* \ | /
* * v_neighbor
+ * </pre>
*/
static void init_laplacian_matrix(LaplacianSystem *sys)
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index c8ba2134a73..66730f8c837 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -182,15 +182,12 @@ static void interp_slerp_co_no_v3(
/* calculate sphere 'center' */
{
/* use point on plane to */
- float plane_a[4], plane_b[4], plane_c[4];
float no_mid[3], no_ortho[3];
/* pass this as an arg instead */
#if 0
float no_dir[3];
#endif
- float v_a_no_ortho[3], v_b_no_ortho[3];
-
add_v3_v3v3(no_mid, no_a, no_b);
normalize_v3(no_mid);
@@ -200,24 +197,28 @@ static void interp_slerp_co_no_v3(
#endif
/* axis of slerp */
+ bool center_ok = false;
cross_v3_v3v3(no_ortho, no_mid, no_dir);
- normalize_v3(no_ortho);
-
- /* create planes */
- cross_v3_v3v3(v_a_no_ortho, no_ortho, no_a);
- cross_v3_v3v3(v_b_no_ortho, no_ortho, no_b);
- project_v3_plane(v_a_no_ortho, no_ortho, v_a_no_ortho);
- project_v3_plane(v_b_no_ortho, no_ortho, v_b_no_ortho);
-
- plane_from_point_normal_v3(plane_a, co_a, v_a_no_ortho);
- plane_from_point_normal_v3(plane_b, co_b, v_b_no_ortho);
- plane_from_point_normal_v3(plane_c, co_b, no_ortho);
-
- /* find the sphere center from 3 planes */
- if (isect_plane_plane_plane_v3(plane_a, plane_b, plane_c, center)) {
- /* pass */
+ if (normalize_v3(no_ortho) != 0.0f) {
+ float plane_a[4], plane_b[4], plane_c[4];
+ float v_a_no_ortho[3], v_b_no_ortho[3];
+
+ /* create planes */
+ cross_v3_v3v3(v_a_no_ortho, no_ortho, no_a);
+ cross_v3_v3v3(v_b_no_ortho, no_ortho, no_b);
+ project_v3_plane(v_a_no_ortho, no_ortho, v_a_no_ortho);
+ project_v3_plane(v_b_no_ortho, no_ortho, v_b_no_ortho);
+
+ plane_from_point_normal_v3(plane_a, co_a, v_a_no_ortho);
+ plane_from_point_normal_v3(plane_b, co_b, v_b_no_ortho);
+ plane_from_point_normal_v3(plane_c, co_b, no_ortho);
+
+ /* find the sphere center from 3 planes */
+ if (isect_plane_plane_plane_v3(plane_a, plane_b, plane_c, center)) {
+ center_ok = true;
+ }
}
- else {
+ if (center_ok == false) {
mid_v3_v3v3(center, co_a, co_b);
}
}
diff --git a/source/blender/bmesh/operators/bmo_subdivide_edgering.c b/source/blender/bmesh/operators/bmo_subdivide_edgering.c
index e6881f6d8b1..251a79e8ff5 100644
--- a/source/blender/bmesh/operators/bmo_subdivide_edgering.c
+++ b/source/blender/bmesh/operators/bmo_subdivide_edgering.c
@@ -505,7 +505,7 @@ static LoopPairStore *bm_edgering_pair_store_create(
for (v_iter = lb->first, i = 0; v_iter; v_iter = v_iter->next, i++) {
BMVert *v = v_iter->data;
bm_vert_calc_surface_tangent(bm, v, nor[i]);
- BLI_ghash_insert(nors_gh_iter, v, SET_UINT_IN_POINTER(i));
+ BLI_ghash_insert(nors_gh_iter, v, POINTER_FROM_UINT(i));
}
}
@@ -768,8 +768,8 @@ static void bm_edgering_pair_interpolate(
bm_vert_calc_surface_tangent(bm, v_b, no_b);
#else
{
- const uint index_a = GET_UINT_FROM_POINTER(BLI_ghash_lookup(lpair->nors_gh_a, v_a));
- const uint index_b = GET_UINT_FROM_POINTER(BLI_ghash_lookup(lpair->nors_gh_b, v_b));
+ const uint index_a = POINTER_AS_UINT(BLI_ghash_lookup(lpair->nors_gh_a, v_a));
+ const uint index_b = POINTER_AS_UINT(BLI_ghash_lookup(lpair->nors_gh_b, v_b));
BLI_assert(BLI_ghash_haskey(lpair->nors_gh_a, v_a));
BLI_assert(BLI_ghash_haskey(lpair->nors_gh_b, v_b));
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index adfcb8dc68f..754db541548 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -2113,7 +2113,7 @@ static void adjust_the_cycle_or_chain(BoundVert *vstart, bool iscycle)
/* residue np + 2*i (if cycle) else np - 1 + 2*i:
* right offset for parm i matches its spec; weighted */
- row = iscycle ? np + 2 * i : np - 1 + 2 * i;
+ row = iscycle ? np + 2 * i : np - 1 + 2 * i;
EIG_linear_solver_matrix_add(solver, row, i, weight);
EIG_linear_solver_right_hand_side_add(solver, 0, row, weight * eright->offset_r);
#ifdef DEBUG_ADJUST
diff --git a/source/blender/bmesh/tools/bmesh_intersect.c b/source/blender/bmesh/tools/bmesh_intersect.c
index b1a8c3ccb86..49165b48668 100644
--- a/source/blender/bmesh/tools/bmesh_intersect.c
+++ b/source/blender/bmesh/tools/bmesh_intersect.c
@@ -232,7 +232,7 @@ static void face_edges_add(
BMEdge *e,
const bool use_test)
{
- void *f_index_key = SET_INT_IN_POINTER(f_index);
+ void *f_index_key = POINTER_FROM_INT(f_index);
BLI_assert(e->head.htype == BM_EDGE);
BLI_assert(BM_edge_in_face(e, s->bm->ftable[f_index]) == false);
BLI_assert(BM_elem_index_get(s->bm->ftable[f_index]) == f_index);
@@ -1488,7 +1488,7 @@ bool BM_mesh_intersect(
faces = bm->ftable;
GHASH_ITER (gh_iter, s.face_edges) {
- const int f_index = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter));
+ const int f_index = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
BMFace *f;
struct LinkBase *e_ls_base = BLI_ghashIterator_getValue(&gh_iter);
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 48656d15769..1cacee836ba 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -61,9 +61,9 @@ bool AnimationExporter::is_flat_line(std::vector<float> &values, int channel_cou
return true;
}
/*
- * This function creates a complete LINEAR Collada <Animation> Entry with all needed
- * <source>, <sampler>, and <channel> entries.
- * This is is used for creating sampled Transformation Animations for either:
+ * This function creates a complete LINEAR Collada <Animation> Entry with all needed
+ * <source>, <sampler>, and <channel> entries.
+ * This is is used for creating sampled Transformation Animations for either:
*
* 1-axis animation:
* times contains the time points in seconds from within the timeline
@@ -139,7 +139,7 @@ void AnimationExporter::create_sampled_animation(int channel_count,
* Export all animation FCurves of an Object.
*
* Note: This uses the keyframes as sample points,
- * and exports "baked keyframes" while keeping the tangent infromation
+ * and exports "baked keyframes" while keeping the tangent information
* of the FCurves intact. This works for simple cases, but breaks
* especially when negative scales are involved in the animation.
*
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index f63329158f0..ff49bc369cf 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -181,11 +181,12 @@ public:
// prerequisites:
// animlist_map - map animlist id -> animlist
// curve_map - map anim id -> curve(s)
- Object * translate_animation_OLD(Main *bmain, COLLADAFW::Node *node,
- std::map<COLLADAFW::UniqueId, Object*>& object_map,
- std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
- COLLADAFW::Transformation::TransformationType tm_type,
- Object *par_job = NULL);
+ Object *translate_animation_OLD(
+ Main *bmain, COLLADAFW::Node *node,
+ std::map<COLLADAFW::UniqueId, Object*>& object_map,
+ std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
+ COLLADAFW::Transformation::TransformationType tm_type,
+ Object *par_job = NULL);
void find_frames( std::vector<float>* frames, std::vector<FCurve*>* curves );
void find_frames_old( std::vector<float>* frames, COLLADAFW::Node * node, COLLADAFW::Transformation::TransformationType tm_type );
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp
index 52f7c5627b9..432ce92b49d 100644
--- a/source/blender/collada/ArmatureExporter.cpp
+++ b/source/blender/collada/ArmatureExporter.cpp
@@ -69,7 +69,7 @@ void ArmatureExporter::add_armature_bones(bContext *C, Object *ob_arm, Scene *sc
Main *bmain = CTX_data_main(C);
// write bone nodes
- bArmature * armature = (bArmature *)ob_arm->data;
+ bArmature *armature = (bArmature *)ob_arm->data;
bool is_edited = armature->edbo != NULL;
if (!is_edited)
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 28e962d62c0..a96d1e76a99 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -108,7 +108,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBon
/*
* We use the inv_bind_shape matrix to apply the armature bind pose as its rest pose.
- */
+ */
std::map<COLLADAFW::UniqueId, SkinInfo>::iterator skin_it;
bool bone_is_skinned = false;
@@ -460,11 +460,11 @@ void ArmatureImporter::create_armature_bones(Main *bmain, std::vector<Object *>
if (!ob_arm)
continue;
- bArmature * armature = (bArmature *)ob_arm->data;
+ bArmature *armature = (bArmature *)ob_arm->data;
if (!armature)
continue;
- char * bone_name = (char *)bc_get_joint_name(*ri);
+ char *bone_name = (char *)bc_get_joint_name(*ri);
Bone *bone = BKE_armature_find_bone_name(armature, bone_name);
if (bone) {
fprintf(stderr, "Reuse of child bone [%s] as root bone in same Armature is not supported.\n", bone_name);
@@ -516,32 +516,32 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo& skin)
* if so, use that skin's armature
*/
- /*
- Pseudocode:
-
- find_node_in_tree(node, root_joint)
-
- skin::find_root_joints(root_joints):
- std::vector root_joints;
- for each root in root_joints:
- for each joint in joints:
- if find_node_in_tree(joint, root):
- if (std::find(root_joints.begin(), root_joints.end(), root) == root_joints.end())
- root_joints.push_back(root);
-
- for (each skin B with armature) {
- find all root joints for skin B
-
- for each joint X in skin A:
- for each root joint R in skin B:
- if (find_node_in_tree(X, R)) {
- shared = 1;
- goto endloop;
- }
- }
-
- endloop:
- */
+ /**
+ * Pseudocode:
+ *
+ * find_node_in_tree(node, root_joint)
+ *
+ * skin::find_root_joints(root_joints):
+ * std::vector root_joints;
+ * for each root in root_joints:
+ * for each joint in joints:
+ * if find_node_in_tree(joint, root):
+ * if (std::find(root_joints.begin(), root_joints.end(), root) == root_joints.end())
+ * root_joints.push_back(root);
+ *
+ * for (each skin B with armature) {
+ * find all root joints for skin B
+ *
+ * for each joint X in skin A:
+ * for each root joint R in skin B:
+ * if (find_node_in_tree(X, R)) {
+ * shared = 1;
+ * goto endloop;
+ * }
+ * }
+ *
+ * endloop:
+ */
SkinInfo *a = &skin;
Object *shared = NULL;
@@ -589,7 +589,7 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo& skin)
}
// enter armature edit mode
- bArmature * armature = (bArmature *)ob_arm->data;
+ bArmature *armature = (bArmature *)ob_arm->data;
ED_armature_to_edit(armature);
totbone = 0;
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp
index 5673d33fcbf..a5f96123fd4 100644
--- a/source/blender/collada/ControllerExporter.cpp
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -398,13 +398,13 @@ std::string ControllerExporter::add_morph_weights(Key *key, Object *ob)
return source_id;
}
-//Added to implemente support for animations.
+//Added to implement support for animations.
void ControllerExporter::add_weight_extras(Key *key)
{
// can also try the base element and param alternative
COLLADASW::BaseExtraTechnique extra;
- KeyBlock * kb = (KeyBlock *)key->block.first;
+ KeyBlock *kb = (KeyBlock *)key->block.first;
//skip the basis
kb = kb->next;
for (; kb; kb = kb->next) {
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index f84cd069778..67fd9d648c7 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -703,8 +703,10 @@ finally:
return root_objects;
}
-/** When this method is called, the writer must write the entire visual scene.
- * Return The writer should return true, if writing succeeded, false otherwise. */
+/**
+ * When this method is called, the writer must write the entire visual scene.
+ * Return The writer should return true, if writing succeeded, false otherwise.
+ */
bool DocumentImporter::writeVisualScene(const COLLADAFW::VisualScene *visualScene)
{
if (mImportStage != General)
diff --git a/source/blender/collada/DocumentImporter.h b/source/blender/collada/DocumentImporter.h
index c5bc6907867..17e61326032 100644
--- a/source/blender/collada/DocumentImporter.h
+++ b/source/blender/collada/DocumentImporter.h
@@ -85,7 +85,7 @@ public:
/**
* This method will be called if an error in the loading process occurred and the loader cannot
* continue to load. The writer should undo all operations that have been performed.
- * \param errorMessage A message containing informations about the error that occurred.
+ * \param errorMessage A message containing information about the error that occurred.
*/
void cancel(const COLLADAFW::String& errorMessage);
diff --git a/source/blender/collada/ErrorHandler.cpp b/source/blender/collada/ErrorHandler.cpp
index 26674445d98..caa73900632 100644
--- a/source/blender/collada/ErrorHandler.cpp
+++ b/source/blender/collada/ErrorHandler.cpp
@@ -50,8 +50,8 @@ ErrorHandler::~ErrorHandler()
bool ErrorHandler::handleError(const COLLADASaxFWL::IError *error)
{
/* This method must return true when Collada should continue.
- See https://github.com/KhronosGroup/OpenCOLLADA/issues/442
- */
+ * See https://github.com/KhronosGroup/OpenCOLLADA/issues/442
+ */
bool isWarning = false;
if (error->getErrorClass() == COLLADASaxFWL::IError::ERROR_SAXPARSER) {
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp
index 5f310c26da3..eb627b5c066 100644
--- a/source/blender/collada/GeometryExporter.cpp
+++ b/source/blender/collada/GeometryExporter.cpp
@@ -166,9 +166,9 @@ void GeometryExporter::operator()(Object *ob)
closeGeometry();
if (this->export_settings->include_shapekeys) {
- Key * key = BKE_key_from_object(ob);
+ Key *key = BKE_key_from_object(ob);
if (key) {
- KeyBlock * kb = (KeyBlock *)key->block.first;
+ KeyBlock *kb = (KeyBlock *)key->block.first;
//skip the basis
kb = kb->next;
for (; kb; kb = kb->next) {
diff --git a/source/blender/collada/GeometryExporter.h b/source/blender/collada/GeometryExporter.h
index dea97fc1286..fd9db7b1fd2 100644
--- a/source/blender/collada/GeometryExporter.h
+++ b/source/blender/collada/GeometryExporter.h
@@ -143,7 +143,7 @@ private:
const ExportSettings *export_settings;
- Mesh * get_mesh(Scene *sce, Object *ob, int apply_modifiers);
+ Mesh *get_mesh(Scene *sce, Object *ob, int apply_modifiers);
};
struct GeometryFunctor {
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index d121268d8d9..1f24010b04e 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -183,7 +183,7 @@ void VCOLDataWrapper::get_vcol(int v_index, MLoopCol *mloopcol)
case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT:
{
COLLADAFW::ArrayPrimitiveType<float> *values = mVData->getFloatValues();
- if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an eror instead
+ if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an error instead
mloopcol->r = unit_float_to_uchar_clamp((*values)[v_index * stride]);
mloopcol->g = unit_float_to_uchar_clamp((*values)[v_index * stride + 1]);
@@ -194,7 +194,7 @@ void VCOLDataWrapper::get_vcol(int v_index, MLoopCol *mloopcol)
case COLLADAFW::MeshVertexData::DATA_TYPE_DOUBLE:
{
COLLADAFW::ArrayPrimitiveType<double> *values = mVData->getDoubleValues();
- if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an eror instead
+ if (values->empty() || values->getCount() <= (v_index * stride + 2)) return; // xxx need to create an error instead
mloopcol->r = unit_float_to_uchar_clamp((*values)[v_index * stride]);
mloopcol->g = unit_float_to_uchar_clamp((*values)[v_index * stride + 1]);
@@ -546,7 +546,7 @@ unsigned int MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh) {
}
// =================================================================
-// This functin is copied from source/blender/editors/mesh/mesh_data.c
+// This function is copied from source/blender/editors/mesh/mesh_data.c
//
// TODO: (As discussed with sergey-) :
// Maybe move this function to blenderkernel/intern/mesh.c
@@ -585,7 +585,7 @@ void MeshImporter::mesh_add_edges(Mesh *mesh, int len)
// =================================================================
// Read all loose edges.
// Important: This function assumes that all edges from existing
-// faces have allready been generated and added to me->medge
+// faces have already been generated and added to me->medge
// So this function MUST be called after read_faces() (see below)
// =================================================================
void MeshImporter::read_lines(COLLADAFW::Mesh *mesh, Mesh *me)
@@ -679,7 +679,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
unsigned int vertex_count = mp->getGroupedVerticesVertexCount(group_index);
for (unsigned int vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {
- // For each triangle store indeces of its 3 vertices
+ // For each triangle store indices of its 3 vertices
unsigned int triangle_vertex_indices[3] = {first_vertex, position_indices[1], position_indices[2]};
set_poly_indices(mpoly, mloop, loop_index, triangle_vertex_indices, 3);
@@ -944,7 +944,7 @@ static bool bc_has_same_material_configuration(Object *ob1, Object *ob2)
/**
*
- * Caution here: This code assumes tha all materials are assigned to Object
+ * Caution here: This code assumes that all materials are assigned to Object
* and no material is assigned to Data.
* That is true right after the objects have been imported.
*
@@ -1078,7 +1078,7 @@ MTFace *MeshImporter::assign_material_to_geom(COLLADAFW::MaterialBinding cmateri
Material *ma = uid_material_map[ma_uid];
- // Attention! This temporaly assigns material to object on purpose!
+ // Attention! This temporarily assigns material to object on purpose!
// See note above.
ob->actcol=0;
assign_material(m_bmain, ob, ma, mat_index + 1, BKE_MAT_ASSIGN_OBJECT);
@@ -1138,7 +1138,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
{
const COLLADAFW::UniqueId *geom_uid = &geom->getInstanciatedObjectId();
- // check if node instanciates controller or geometry
+ // check if node instantiates controller or geometry
if (isController) {
geom_uid = armature_importer->get_geometry_uid(*geom_uid);
@@ -1241,7 +1241,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom)
// BKE_mesh_calc_edges(me, false, false);
// read_lines() must be called after the face edges have been generated.
- // Oterwise the loose edges will be silently deleted again.
+ // Otherwise the loose edges will be silently deleted again.
read_lines(mesh, me);
return true;
diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp
index a0d1b6b5333..b571b7503d5 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -59,7 +59,7 @@ void SceneExporter::exportHierarchy(bContext *C, Scene *sce)
ob->id.tag |= LIB_TAG_DOIT;
}
- // Now find all exportable base ojects (highest in export hierarchy)
+ // Now find all exportable base objects (highest in export hierarchy)
for (node = this->export_settings->export_set; node; node = node->next) {
Object *ob = (Object *) node->link;
if (bc_is_base_node(this->export_settings->export_set, ob)) {
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index b9af19777db..b25a35a5452 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -370,8 +370,8 @@ void bc_match_scale(std::vector<Object *> *objects_done,
}
/*
- Convenience function to get only the needed components of a matrix
-*/
+ * Convenience function to get only the needed components of a matrix
+ */
void bc_decompose(float mat[4][4], float *loc, float eul[3], float quat[4], float *size)
{
if (size) {
@@ -392,17 +392,17 @@ void bc_decompose(float mat[4][4], float *loc, float eul[3], float quat[4], floa
}
/*
-* Create rotation_quaternion from a delta rotation and a reference quat
-*
-* Input:
-* mat_from: The rotation matrix before rotation
-* mat_to : The rotation matrix after rotation
-* qref : the quat corresponding to mat_from
-*
-* Output:
-* rot : the calculated result (quaternion)
-*
-*/
+ * Create rotation_quaternion from a delta rotation and a reference quat
+ *
+ * Input:
+ * mat_from: The rotation matrix before rotation
+ * mat_to : The rotation matrix after rotation
+ * qref : the quat corresponding to mat_from
+ *
+ * Output:
+ * rot : the calculated result (quaternion)
+ *
+ */
void bc_rotate_from_reference_quat(float quat_to[4], float quat_from[4], float mat_to[4][4])
{
float qd[4];
@@ -481,11 +481,11 @@ int bc_set_layer(int bitfield, int layer, bool enable)
return bitfield;
}
-/*
- | This method creates a new extension map when needed.
- | Note: The ~BoneExtensionManager destructor takes care
- | to delete the created maps when the manager is removed.
-*/
+/**
+ * This method creates a new extension map when needed.
+ * \note The ~BoneExtensionManager destructor takes care
+ * to delete the created maps when the manager is removed.
+ */
BoneExtensionMap &BoneExtensionManager::getExtensionMap(bArmature *armature)
{
std::string key = armature->id.name;
@@ -603,7 +603,7 @@ inline bool isInteger(const std::string & s)
{
if (s.empty() || ((!isdigit(s[0])) && (s[0] != '-') && (s[0] != '+'))) return false;
- char * p;
+ char *p;
strtol(s.c_str(), &p, 10);
return (*p == 0);
@@ -683,8 +683,8 @@ int BoneExtended::get_use_connect()
}
/**
-* Stores a 4*4 matrix as a custom bone property array of size 16
-*/
+ * Stores a 4*4 matrix as a custom bone property array of size 16
+ */
void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4])
{
IDProperty *idgroup = (IDProperty *)ebone->prop;
@@ -710,10 +710,10 @@ void bc_set_IDPropertyMatrix(EditBone *ebone, const char *key, float mat[4][4])
#if 0
/**
-* Stores a Float value as a custom bone property
-*
-* Note: This function is currently not needed. Keep for future usage
-*/
+ * Stores a Float value as a custom bone property
+ *
+ * Note: This function is currently not needed. Keep for future usage
+ */
static void bc_set_IDProperty(EditBone *ebone, const char *key, float value)
{
if (ebone->prop == NULL)
@@ -731,19 +731,19 @@ static void bc_set_IDProperty(EditBone *ebone, const char *key, float value)
}
#endif
-/*
-* Get a custom property when it exists.
-* This function is also used to check if a property exists.
-*/
+/**
+ * Get a custom property when it exists.
+ * This function is also used to check if a property exists.
+ */
IDProperty *bc_get_IDProperty(Bone *bone, std::string key)
{
return (bone->prop == NULL) ? NULL : IDP_GetPropertyFromGroup(bone->prop, key.c_str());
}
/**
-* Read a custom bone property and convert to float
-* Return def if the property does not exist.
-*/
+ * Read a custom bone property and convert to float
+ * Return def if the property does not exist.
+ */
float bc_get_property(Bone *bone, std::string key, float def)
{
float result = def;
@@ -767,13 +767,13 @@ float bc_get_property(Bone *bone, std::string key, float def)
}
/**
-* Read a custom bone property and convert to matrix
-* Return true if conversion was succesfull
-*
-* Return false if:
-* - the property does not exist
-* - is not an array of size 16
-*/
+ * Read a custom bone property and convert to matrix
+ * Return true if conversion was successful
+ *
+ * Return false if:
+ * - the property does not exist
+ * - is not an array of size 16
+ */
bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4])
{
IDProperty *property = bc_get_IDProperty(bone, key);
@@ -788,8 +788,8 @@ bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4])
}
/**
-* get a vector that is stored in 3 custom properties (used in Blender <= 2.78)
-*/
+ * get a vector that is stored in 3 custom properties (used in Blender <= 2.78)
+ */
void bc_get_property_vector(Bone *bone, std::string key, float val[3], const float def[3])
{
val[0] = bc_get_property(bone, key + "_x", def[0]);
@@ -798,8 +798,8 @@ void bc_get_property_vector(Bone *bone, std::string key, float val[3], const flo
}
/**
-* Check if vector exist stored in 3 custom properties (used in Blender <= 2.78)
-*/
+ * Check if vector exist stored in 3 custom properties (used in Blender <= 2.78)
+ */
static bool has_custom_props(Bone *bone, bool enabled, std::string key)
{
if (!enabled)
@@ -812,11 +812,11 @@ static bool has_custom_props(Bone *bone, bool enabled, std::string key)
}
/**
-* Check if custom information about bind matrix exists and modify the from_mat
-* accordingly.
-*
-* Note: This is old style for Blender <= 2.78 only kept for compatibility
-*/
+ * Check if custom information about bind matrix exists and modify the from_mat
+ * accordingly.
+ *
+ * Note: This is old style for Blender <= 2.78 only kept for compatibility
+ */
void bc_create_restpose_mat(const ExportSettings *export_settings, Bone *bone, float to_mat[4][4], float from_mat[4][4], bool use_local_space)
{
float loc[3];
@@ -870,8 +870,8 @@ void bc_create_restpose_mat(const ExportSettings *export_settings, Bone *bone, f
}
/*
- Make 4*4 matrices better readable
-*/
+ * Make 4*4 matrices better readable
+ */
void bc_sanitize_mat(float mat[4][4], int precision)
{
for (int i = 0; i < 4; i++)
@@ -911,7 +911,7 @@ std::string bc_get_active_uvlayer_name(Object *ob)
return bc_get_active_uvlayer_name(me);
}
-/*
+/**
* Returns name of Active UV Layer or empty String if no active UV Layer defined
*/
std::string bc_get_active_uvlayer_name(Mesh *me)
diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index 438bb4a0f98..d1591a34cce 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -191,16 +191,16 @@ public:
};
/* a map to store bone extension maps
-| std:string : an armature name
-| BoneExtended * : a map that contains extra data for bones
-*/
+ * std:string : an armature name
+ * BoneExtended * : a map that contains extra data for bones
+ */
typedef std::map<std::string, BoneExtended *> BoneExtensionMap;
/*
-| A class to organise bone extendion data for multiple Armatures.
-| this is needed for the case where a Collada file contains 2 or more
-| separate armatures.
-*/
+ * A class to organise bone extendion data for multiple Armatures.
+ * this is needed for the case where a Collada file contains 2 or more
+ * separate armatures.
+ */
class BoneExtensionManager {
private:
std::map<std::string, BoneExtensionMap *> extended_bone_maps;
diff --git a/source/blender/compositor/COM_compositor.h b/source/blender/compositor/COM_compositor.h
index 10b62070978..f9fd0999acc 100644
--- a/source/blender/compositor/COM_compositor.h
+++ b/source/blender/compositor/COM_compositor.h
@@ -31,26 +31,26 @@ extern "C" {
#include "DNA_node_types.h"
/**
- * @defgroup Model The data model of the compositor
- * @defgroup Memory The memory management stuff
- * @defgroup Execution The execution logic
- * @defgroup Conversion Conversion logic
- * @defgroup Node All nodes of the compositor
- * @defgroup Operation All operations of the compositor
+ * \defgroup Model The data model of the compositor
+ * \defgroup Memory The memory management stuff
+ * \defgroup Execution The execution logic
+ * \defgroup Conversion Conversion logic
+ * \defgroup Node All nodes of the compositor
+ * \defgroup Operation All operations of the compositor
*
- * @page Introduction of the Blender Compositor
+ * \page Introduction of the Blender Compositor
*
- * @section bcomp Blender compositor
+ * \section bcomp Blender compositor
* This project redesigns the internals of Blender's compositor. The project has been executed in 2011 by At Mind.
* At Mind is a technology company located in Amsterdam, The Netherlands.
* The project has been crowd-funded. This code has been released under GPL2 to be used in Blender.
*
- * @section goals The goals of the project
+ * \section goals The goals of the project
* the new compositor has 2 goals.
* - Make a faster compositor (speed of calculation)
* - Make the compositor work faster for you (workflow)
*
- * @section speed Faster compositor
+ * \section speed Faster compositor
* The speedup has been done by making better use of the hardware Blenders is working on. The previous compositor only
* used a single threaded model to calculate a node. The only exception to this is the Defocus node.
* Only when it is possible to calculate two full nodes in parallel a second thread was used.
@@ -59,27 +59,27 @@ extern "C" {
* In the new compositor we want to use as much of threads as possible. Even new OpenCL capable GPU-hardware can be
* used for calculation.
*
- * @section workflow Work faster
+ * \section workflow Work faster
* The previous compositor only showed the final image. The compositor could wait a long time before seeing the result
* of his work. The new compositor will work in a way that it will focus on getting information back to the user.
* It will prioritize its work to get earlier user feedback.
*
- * @page memory Memory model
+ * \page memory Memory model
* The main issue is the type of memory model to use. Blender is used by consumers and professionals.
* Ranging from low-end machines to very high-end machines.
* The system should work on high-end machines and on low-end machines.
*
*
- * @page executing Executing
- * @section prepare Prepare execution
+ * \page executing Executing
+ * \section prepare Prepare execution
*
* during the preparation of the execution All ReadBufferOperation will receive an offset.
* This offset is used during execution as an optimization trick
- * Next all operations will be initialized for execution @see NodeOperation.initExecution
- * Next all ExecutionGroup's will be initialized for execution @see ExecutionGroup.initExecution
- * this all is controlled from @see ExecutionSystem.execute
+ * Next all operations will be initialized for execution \see NodeOperation.initExecution
+ * Next all ExecutionGroup's will be initialized for execution \see ExecutionGroup.initExecution
+ * this all is controlled from \see ExecutionSystem.execute
*
- * @section priority Render priority
+ * \section priority Render priority
* Render priority is an priority of an output node. A user has a different need of Render priorities of output nodes
* than during editing.
* for example. the Active ViewerNode has top priority during editing, but during rendering a CompositeNode has.
@@ -88,11 +88,11 @@ extern "C" {
* priority do match.
* When match the ExecutionGroup will be executed (this happens in serial)
*
- * @see ExecutionSystem.execute control of the Render priority
- * @see NodeOperation.getRenderPriority receive the render priority
- * @see ExecutionGroup.execute the main loop to execute a whole ExecutionGroup
+ * \see ExecutionSystem.execute control of the Render priority
+ * \see NodeOperation.getRenderPriority receive the render priority
+ * \see ExecutionGroup.execute the main loop to execute a whole ExecutionGroup
*
- * @section order Chunk order
+ * \section order Chunk order
*
* When a ExecutionGroup is executed, first the order of chunks are determined.
* The settings are stored in the ViewerNode inside the ExecutionGroup. ExecutionGroups that have no viewer-node,
@@ -109,11 +109,11 @@ extern "C" {
* - [@ref ChunkExecutionState.COM_ES_SCHEDULED]: All dependencies are met, chunk is scheduled, but not finished
* - [@ref ChunkExecutionState.COM_ES_EXECUTED]: Chunk is finished
*
- * @see ExecutionGroup.execute
- * @see ViewerOperation.getChunkOrder
- * @see OrderOfChunks
+ * \see ExecutionGroup.execute
+ * \see ViewerOperation.getChunkOrder
+ * \see OrderOfChunks
*
- * @section interest Area of interest
+ * \section interest Area of interest
* An ExecutionGroup can have dependencies to other ExecutionGroup's. Data passing from one ExecutionGroup to another
* one are stored in 'chunks'.
* If not all input chunks are available the chunk execution will not be scheduled.
@@ -206,40 +206,40 @@ extern "C" {
*
* </pre>
*
- * @see ExecutionGroup.execute Execute a complete ExecutionGroup. Halts until finished or breaked by user
- * @see ExecutionGroup.scheduleChunkWhenPossible Tries to schedule a single chunk,
+ * \see ExecutionGroup.execute Execute a complete ExecutionGroup. Halts until finished or breaked by user
+ * \see ExecutionGroup.scheduleChunkWhenPossible Tries to schedule a single chunk,
* checks if all input data is available. Can trigger dependent chunks to be calculated
- * @see ExecutionGroup.scheduleAreaWhenPossible Tries to schedule an area. This can be multiple chunks
+ * \see ExecutionGroup.scheduleAreaWhenPossible Tries to schedule an area. This can be multiple chunks
* (is called from [@ref ExecutionGroup.scheduleChunkWhenPossible])
- * @see ExecutionGroup.scheduleChunk Schedule a chunk on the WorkScheduler
- * @see NodeOperation.determineDependingAreaOfInterest Influence the area of interest of a chunk.
- * @see WriteBufferOperation Operation to write to a MemoryProxy/MemoryBuffer
- * @see ReadBufferOperation Operation to read from a MemoryProxy/MemoryBuffer
- * @see MemoryProxy proxy for information about memory image (a image consist out of multiple chunks)
- * @see MemoryBuffer Allocated memory for a single chunk
- *
- * @section workscheduler WorkScheduler
+ * \see ExecutionGroup.scheduleChunk Schedule a chunk on the WorkScheduler
+ * \see NodeOperation.determineDependingAreaOfInterest Influence the area of interest of a chunk.
+ * \see WriteBufferOperation Operation to write to a MemoryProxy/MemoryBuffer
+ * \see ReadBufferOperation Operation to read from a MemoryProxy/MemoryBuffer
+ * \see MemoryProxy proxy for information about memory image (a image consist out of multiple chunks)
+ * \see MemoryBuffer Allocated memory for a single chunk
+ *
+ * \section workscheduler WorkScheduler
* the WorkScheduler is implemented as a static class. the responsibility of the WorkScheduler is to balance
* WorkPackages to the available and free devices.
* the work-scheduler can work in 2 states. For witching these between the state you need to recompile blender
*
- * @subsection multithread Multi threaded
+ * \subsection multithread Multi threaded
* Default the work-scheduler will place all work as WorkPackage in a queue.
* For every CPUcore a working thread is created. These working threads will ask the WorkScheduler if there is work
* for a specific Device.
* the work-scheduler will find work for the device and the device will be asked to execute the WorkPackage
*
- * @subsection singlethread Single threaded
+ * \subsection singlethread Single threaded
* For debugging reasons the multi-threading can be disabled. This is done by changing the COM_CURRENT_THREADING_MODEL
* to COM_TM_NOTHREAD. When compiling the work-scheduler
* will be changes to support no threading and run everything on the CPU.
*
- * @section devices Devices
+ * \section devices Devices
* A Device within the compositor context is a Hardware component that can used to calculate chunks.
* This chunk is encapsulated in a WorkPackage.
* the WorkScheduler controls the devices and selects the device where a WorkPackage will be calculated.
*
- * @subsection WS_Devices Workscheduler
+ * \subsection WS_Devices Workscheduler
* The WorkScheduler controls all Devices. When initializing the compositor the WorkScheduler selects
* all devices that will be used during compositor.
* There are two types of Devices, CPUDevice and OpenCLDevice.
@@ -251,63 +251,63 @@ extern "C" {
*
* A thread will read the work-list and sends a workpackage to its device.
*
- * @see WorkScheduler.schedule method that is called to schedule a chunk
- * @see Device.execute method called to execute a chunk
+ * \see WorkScheduler.schedule method that is called to schedule a chunk
+ * \see Device.execute method called to execute a chunk
*
- * @subsection CPUDevice CPUDevice
+ * \subsection CPUDevice CPUDevice
* When a CPUDevice gets a WorkPackage the Device will get the inputbuffer that is needed to calculate the chunk.
* Allocation is already done by the ExecutionGroup.
* The outputbuffer of the chunk is being created.
* The OutputOperation of the ExecutionGroup is called to execute the area of the outputbuffer.
*
- * @see ExecutionGroup
- * @see NodeOperation.executeRegion executes a single chunk of a NodeOperation
- * @see CPUDevice.execute
+ * \see ExecutionGroup
+ * \see NodeOperation.executeRegion executes a single chunk of a NodeOperation
+ * \see CPUDevice.execute
*
- * @subsection GPUDevice OpenCLDevice
+ * \subsection GPUDevice OpenCLDevice
*
* To be completed!
- * @see NodeOperation.executeOpenCLRegion
- * @see OpenCLDevice.execute
+ * \see NodeOperation.executeOpenCLRegion
+ * \see OpenCLDevice.execute
*
- * @section executePixel executing a pixel
+ * \section executePixel executing a pixel
* Finally the last step, the node functionality :)
*
- * @page newnode Creating new nodes
+ * \page newnode Creating new nodes
*/
/**
- * @brief The main method that is used to execute the compositor tree.
+ * \brief The main method that is used to execute the compositor tree.
* It can be executed during editing (blenkernel/node.c) or rendering
* (renderer/pipeline.c)
*
- * @param rd [struct RenderData]
+ * \param rd [struct RenderData]
* Render data for this composite, this won't always belong to a scene.
*
- * @param editingtree [struct bNodeTree]
+ * \param editingtree [struct bNodeTree]
* reference to the compositor editing tree
*
- * @param rendering [true false]
+ * \param rendering [true false]
* This parameter determines whether the function is called from rendering (true) or editing (false).
* based on this setting the system will work differently:
* - during rendering only Composite & the File output node will be calculated
- * @see NodeOperation.isOutputProgram(int rendering) of the specific operations
+ * \see NodeOperation.isOutputProgram(int rendering) of the specific operations
*
* - during editing all output nodes will be calculated
- * @see NodeOperation.isOutputProgram(int rendering) of the specific operations
+ * \see NodeOperation.isOutputProgram(int rendering) of the specific operations
*
* - another quality setting can be used bNodeTree. The quality is determined by the bNodeTree fields.
* quality can be modified by the user from within the node panels.
- * @see bNodeTree.edit_quality
- * @see bNodeTree.render_quality
+ * \see bNodeTree.edit_quality
+ * \see bNodeTree.render_quality
*
* - output nodes can have different priorities in the WorkScheduler.
* This is implemented in the COM_execute function.
*
- * @param viewSettings
+ * \param viewSettings
* reference to view settings used for color management
*
- * @param displaySettings
+ * \param displaySettings
* reference to display settings used for color management
*
* OCIO_TODO: this options only used in rare cases, namely in output file node,
@@ -320,13 +320,13 @@ void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rende
const char *viewName);
/**
- * @brief Deinitialize the compositor caches and allocated memory.
+ * \brief Deinitialize the compositor caches and allocated memory.
* Use COM_clearCaches to only free the caches.
*/
void COM_deinitialize(void);
/**
- * @brief Clear all compositor caches. (Compositor system will still remain available).
+ * \brief Clear all compositor caches. (Compositor system will still remain available).
* To deinitialize the compositor use the COM_deinitialize method.
*/
// void COM_clearCaches(void); // NOT YET WRITTEN
diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h
index 67b7f9b592b..c8e924da6a2 100644
--- a/source/blender/compositor/COM_defines.h
+++ b/source/blender/compositor/COM_defines.h
@@ -24,42 +24,42 @@
#define __COM_DEFINES_H__
/**
- * @brief possible data types for sockets
- * @ingroup Model
+ * \brief possible data types for sockets
+ * \ingroup Model
*/
typedef enum DataType {
- /** @brief Value data type */
+ /** \brief Value data type */
COM_DT_VALUE = 1,
- /** @brief Vector data type */
+ /** \brief Vector data type */
COM_DT_VECTOR = 2,
- /** @brief Color data type */
+ /** \brief Color data type */
COM_DT_COLOR = 4
} DataType;
/**
- * @brief Possible quality settings
- * @see CompositorContext.quality
- * @ingroup Execution
+ * \brief Possible quality settings
+ * \see CompositorContext.quality
+ * \ingroup Execution
*/
typedef enum CompositorQuality {
- /** @brief High quality setting */
+ /** \brief High quality setting */
COM_QUALITY_HIGH = 0,
- /** @brief Medium quality setting */
+ /** \brief Medium quality setting */
COM_QUALITY_MEDIUM = 1,
- /** @brief Low quality setting */
+ /** \brief Low quality setting */
COM_QUALITY_LOW = 2
} CompositorQuality;
/**
- * @brief Possible priority settings
- * @ingroup Execution
+ * \brief Possible priority settings
+ * \ingroup Execution
*/
typedef enum CompositorPriority {
- /** @brief High quality setting */
+ /** \brief High quality setting */
COM_PRIORITY_HIGH = 2,
- /** @brief Medium quality setting */
+ /** \brief Medium quality setting */
COM_PRIORITY_MEDIUM = 1,
- /** @brief Low quality setting */
+ /** \brief Low quality setting */
COM_PRIORITY_LOW = 0
} CompositorPriority;
@@ -87,17 +87,17 @@ typedef enum CompositorPriority {
#define COM_CURRENT_THREADING_MODEL COM_TM_QUEUE
// chunk order
/**
- * @brief The order of chunks to be scheduled
- * @ingroup Execution
+ * \brief The order of chunks to be scheduled
+ * \ingroup Execution
*/
typedef enum OrderOfChunks {
- /** @brief order from a distance to centerX/centerY */
+ /** \brief order from a distance to centerX/centerY */
COM_TO_CENTER_OUT = 0,
- /** @brief order randomly */
+ /** \brief order randomly */
COM_TO_RANDOM = 1,
- /** @brief no ordering */
+ /** \brief no ordering */
COM_TO_TOP_DOWN = 2,
- /** @brief experimental ordering with 9 hotspots */
+ /** \brief experimental ordering with 9 hotspots */
COM_TO_RULE_OF_THIRDS = 3
} OrderOfChunks;
diff --git a/source/blender/compositor/intern/COM_CPUDevice.h b/source/blender/compositor/intern/COM_CPUDevice.h
index b938b5fc588..8d4d5f1c324 100644
--- a/source/blender/compositor/intern/COM_CPUDevice.h
+++ b/source/blender/compositor/intern/COM_CPUDevice.h
@@ -26,16 +26,16 @@
#include "COM_Device.h"
/**
- * @brief class representing a CPU device.
- * @note for every hardware thread in the system a CPUDevice instance will exist in the workscheduler
+ * \brief class representing a CPU device.
+ * \note for every hardware thread in the system a CPUDevice instance will exist in the workscheduler
*/
class CPUDevice : public Device {
public:
CPUDevice(int thread_id);
/**
- * @brief execute a WorkPackage
- * @param work the WorkPackage to execute
+ * \brief execute a WorkPackage
+ * \param work the WorkPackage to execute
*/
void execute(WorkPackage *work);
diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp
index 5d6497f147f..8574a9ee6f0 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.cpp
+++ b/source/blender/compositor/intern/COM_CompositorContext.cpp
@@ -35,7 +35,7 @@ CompositorContext::CompositorContext()
this->m_displaySettings = NULL;
}
-const int CompositorContext::getFramenumber() const
+int CompositorContext::getFramenumber() const
{
if (this->m_rd) {
return this->m_rd->cfra;
diff --git a/source/blender/compositor/intern/COM_CompositorContext.h b/source/blender/compositor/intern/COM_CompositorContext.h
index b43e163870c..6b153ff0161 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.h
+++ b/source/blender/compositor/intern/COM_CompositorContext.h
@@ -32,98 +32,98 @@
#include "COM_defines.h"
/**
- * @brief Overall context of the compositor
+ * \brief Overall context of the compositor
*/
class CompositorContext {
private:
/**
- * @brief The rendering field describes if we are rendering (F12) or if we are editing (Node editor)
+ * \brief The rendering field describes if we are rendering (F12) or if we are editing (Node editor)
* This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
+ * \see ExecutionSystem
*/
bool m_rendering;
/**
- * @brief The quality of the composite.
+ * \brief The quality of the composite.
* This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
+ * \see ExecutionSystem
*/
CompositorQuality m_quality;
Scene *m_scene;
/**
- * @brief Reference to the render data that is being composited.
+ * \brief Reference to the render data that is being composited.
* This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
+ * \see ExecutionSystem
*/
RenderData *m_rd;
/**
- * @brief reference to the bNodeTree
+ * \brief reference to the bNodeTree
* This field is initialized in ExecutionSystem and must only be read from that point on.
- * @see ExecutionSystem
+ * \see ExecutionSystem
*/
bNodeTree *m_bnodetree;
/**
- * @brief Preview image hash table
+ * \brief Preview image hash table
* This field is initialized in ExecutionSystem and must only be read from that point on.
*/
bNodeInstanceHash *m_previews;
/**
- * @brief does this system have active opencl devices?
+ * \brief does this system have active opencl devices?
*/
bool m_hasActiveOpenCLDevices;
/**
- * @brief Skip slow nodes
+ * \brief Skip slow nodes
*/
bool m_fastCalculation;
- /* @brief color management settings */
+ /* \brief color management settings */
const ColorManagedViewSettings *m_viewSettings;
const ColorManagedDisplaySettings *m_displaySettings;
/**
- * @brief active rendering view name
+ * \brief active rendering view name
*/
const char *m_viewName;
public:
/**
- * @brief constructor initializes the context with default values.
+ * \brief constructor initializes the context with default values.
*/
CompositorContext();
/**
- * @brief set the rendering field of the context
+ * \brief set the rendering field of the context
*/
void setRendering(bool rendering) { this->m_rendering = rendering; }
/**
- * @brief get the rendering field of the context
+ * \brief get the rendering field of the context
*/
bool isRendering() const { return this->m_rendering; }
/**
- * @brief set the scene of the context
+ * \brief set the scene of the context
*/
void setRenderData(RenderData *rd) { this->m_rd = rd; }
/**
- * @brief set the bnodetree of the context
+ * \brief set the bnodetree of the context
*/
void setbNodeTree(bNodeTree *bnodetree) { this->m_bnodetree = bnodetree; }
/**
- * @brief get the bnodetree of the context
+ * \brief get the bnodetree of the context
*/
const bNodeTree *getbNodeTree() const { return this->m_bnodetree; }
/**
- * @brief get the scene of the context
+ * \brief get the scene of the context
*/
const RenderData *getRenderData() const { return this->m_rd; }
@@ -131,67 +131,67 @@ public:
Scene *getScene() const { return m_scene; }
/**
- * @brief set the preview image hash table
+ * \brief set the preview image hash table
*/
void setPreviewHash(bNodeInstanceHash *previews) { this->m_previews = previews; }
/**
- * @brief get the preview image hash table
+ * \brief get the preview image hash table
*/
bNodeInstanceHash *getPreviewHash() const { return this->m_previews; }
/**
- * @brief set view settings of color color management
+ * \brief set view settings of color color management
*/
void setViewSettings(const ColorManagedViewSettings *viewSettings) { this->m_viewSettings = viewSettings; }
/**
- * @brief get view settings of color color management
+ * \brief get view settings of color color management
*/
const ColorManagedViewSettings *getViewSettings() const { return this->m_viewSettings; }
/**
- * @brief set display settings of color color management
+ * \brief set display settings of color color management
*/
void setDisplaySettings(const ColorManagedDisplaySettings *displaySettings) { this->m_displaySettings = displaySettings; }
/**
- * @brief get display settings of color color management
+ * \brief get display settings of color color management
*/
const ColorManagedDisplaySettings *getDisplaySettings() const { return this->m_displaySettings; }
/**
- * @brief set the quality
+ * \brief set the quality
*/
void setQuality(CompositorQuality quality) { this->m_quality = quality; }
/**
- * @brief get the quality
+ * \brief get the quality
*/
- const CompositorQuality getQuality() const { return this->m_quality; }
+ CompositorQuality getQuality() const { return this->m_quality; }
/**
- * @brief get the current framenumber of the scene in this context
+ * \brief get the current framenumber of the scene in this context
*/
- const int getFramenumber() const;
+ int getFramenumber() const;
/**
- * @brief has this system active openclDevices?
+ * \brief has this system active openclDevices?
*/
- const bool getHasActiveOpenCLDevices() const { return this->m_hasActiveOpenCLDevices; }
+ bool getHasActiveOpenCLDevices() const { return this->m_hasActiveOpenCLDevices; }
/**
- * @brief set has this system active openclDevices?
+ * \brief set has this system active openclDevices?
*/
void setHasActiveOpenCLDevices(bool hasAvtiveOpenCLDevices) { this->m_hasActiveOpenCLDevices = hasAvtiveOpenCLDevices; }
/**
- * @brief get the active rendering view
+ * \brief get the active rendering view
*/
const char *getViewName() const { return this->m_viewName; }
/**
- * @brief set the active rendering view
+ * \brief set the active rendering view
*/
void setViewName(const char *viewName) { this->m_viewName = viewName; }
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp
index c9181905908..bc41be24e71 100644
--- a/source/blender/compositor/intern/COM_Converter.cpp
+++ b/source/blender/compositor/intern/COM_Converter.cpp
@@ -394,7 +394,7 @@ Node *Converter::convert(bNode *b_node)
case CMP_NODE_TRACKPOS:
node = new TrackPositionNode(b_node);
break;
- /* not inplemented yet */
+ /* not implemented yet */
case CMP_NODE_PIXELATE:
node = new PixelateNode(b_node);
break;
diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h
index d0b888e24a0..05d23eb3e7e 100644
--- a/source/blender/compositor/intern/COM_Converter.h
+++ b/source/blender/compositor/intern/COM_Converter.h
@@ -36,48 +36,48 @@ class NodeOperationOutput;
class NodeOperationBuilder;
/**
- * @brief Conversion methods for the compositor
+ * \brief Conversion methods for the compositor
*/
class Converter {
public:
/**
- * @brief Convert/wraps a bNode in its Node instance.
+ * \brief Convert/wraps a bNode in its Node instance.
*
* For all nodetypes a wrapper class is created.
*
- * @note When adding a new node to blender, this method needs to be changed to return the correct Node instance.
+ * \note When adding a new node to blender, this method needs to be changed to return the correct Node instance.
*
- * @see Node
+ * \see Node
*/
static Node *convert(bNode *b_node);
/**
- * @brief True if the node is considered 'fast'.
+ * \brief True if the node is considered 'fast'.
*
* Slow nodes will be skipped if fast execution is required.
*/
static bool is_fast_node(bNode *b_node);
/**
- * @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type.
+ * \brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type.
*
- * @note this method is called when conversion is needed.
+ * \note this method is called when conversion is needed.
*
- * @param link the NodeLink what needs conversion
- * @param system the ExecutionSystem to add the conversion to.
- * @see NodeLink - a link between two sockets
+ * \param link the NodeLink what needs conversion
+ * \param system the ExecutionSystem to add the conversion to.
+ * \see NodeLink - a link between two sockets
*/
static NodeOperation *convertDataType(NodeOperationOutput *from, NodeOperationInput *to);
/**
- * @brief This method will add a resolution rule based on the settings of the NodeInput.
+ * \brief This method will add a resolution rule based on the settings of the NodeInput.
*
- * @note Conversion logic is implemented in this method
- * @see InputSocketResizeMode for the possible conversions.
+ * \note Conversion logic is implemented in this method
+ * \see InputSocketResizeMode for the possible conversions.
*
- * @param link the NodeLink what needs conversion
- * @param system the ExecutionSystem to add the conversion to.
- * @see NodeLink - a link between two sockets
+ * \param link the NodeLink what needs conversion
+ * \param system the ExecutionSystem to add the conversion to.
+ * \see NodeLink - a link between two sockets
*/
static void convertResolution(NodeOperationBuilder &builder, NodeOperationOutput *fromSocket, NodeOperationInput *toSocket);
diff --git a/source/blender/compositor/intern/COM_Device.h b/source/blender/compositor/intern/COM_Device.h
index 202ca1d0b4f..8cb1cbebf7f 100644
--- a/source/blender/compositor/intern/COM_Device.h
+++ b/source/blender/compositor/intern/COM_Device.h
@@ -26,7 +26,7 @@
#include "COM_WorkPackage.h"
/**
- * @brief Abstract class for device implementations to be used by the Compositor.
+ * \brief Abstract class for device implementations to be used by the Compositor.
* devices are queried, initialized and used by the WorkScheduler.
* work are packaged as a WorkPackage instance.
*/
@@ -34,24 +34,24 @@ class Device {
public:
/**
- * @brief Declaration of the virtual destructor
- * @note resolve warning gcc 4.7
+ * \brief Declaration of the virtual destructor
+ * \note resolve warning gcc 4.7
*/
virtual ~Device() {}
/**
- * @brief initialize the device
+ * \brief initialize the device
*/
virtual bool initialize() { return true; }
/**
- * @brief deinitialize the device
+ * \brief deinitialize the device
*/
virtual void deinitialize() {}
/**
- * @brief execute a WorkPackage
- * @param work the WorkPackage to execute
+ * \brief execute a WorkPackage
+ * \param work the WorkPackage to execute
*/
virtual void execute(WorkPackage *work) = 0;
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
index 5a651f07868..603254baba2 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
@@ -185,9 +185,9 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
{
const CompositorContext &context = graph->getContext();
const bNodeTree *bTree = context.getbNodeTree();
- if (this->m_width == 0 || this->m_height == 0) {return; } /// @note: break out... no pixels to calculate.
- if (bTree->test_break && bTree->test_break(bTree->tbh)) {return; } /// @note: early break out for blur and preview nodes
- if (this->m_numberOfChunks == 0) {return; } /// @note: early break out
+ if (this->m_width == 0 || this->m_height == 0) {return; } /// \note: break out... no pixels to calculate.
+ if (bTree->test_break && bTree->test_break(bTree->tbh)) {return; } /// \note: early break out for blur and preview nodes
+ if (this->m_numberOfChunks == 0) {return; } /// \note: early break out
unsigned int chunkNumber;
this->m_executionStartTime = PIL_check_seconds_timer();
@@ -437,7 +437,7 @@ void ExecutionGroup::determineChunkRect(rcti *rect, const unsigned int chunkNumb
MemoryBuffer *ExecutionGroup::allocateOutputBuffer(int /*chunkNumber*/,
rcti *rect)
{
- // we asume that this method is only called from complex execution groups.
+ // we assume that this method is only called from complex execution groups.
NodeOperation *operation = this->getOutputOperation();
if (operation->isWriteBufferOperation()) {
WriteBufferOperation *writeOperation = (WriteBufferOperation *)operation;
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h
index 88c702b8477..2c79b2ba0a4 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.h
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.h
@@ -39,28 +39,28 @@ class ReadBufferOperation;
class Device;
/**
- * @brief the execution state of a chunk in an ExecutionGroup
- * @ingroup Execution
+ * \brief the execution state of a chunk in an ExecutionGroup
+ * \ingroup Execution
*/
typedef enum ChunkExecutionState {
/**
- * @brief chunk is not yet scheduled
+ * \brief chunk is not yet scheduled
*/
COM_ES_NOT_SCHEDULED = 0,
/**
- * @brief chunk is scheduled, but not yet executed
+ * \brief chunk is scheduled, but not yet executed
*/
COM_ES_SCHEDULED = 1,
/**
- * @brief chunk is executed.
+ * \brief chunk is executed.
*/
COM_ES_EXECUTED = 2
} ChunkExecutionState;
/**
- * @brief Class ExecutionGroup is a group of Operations that are executed as one.
+ * \brief Class ExecutionGroup is a group of Operations that are executed as one.
* This grouping is used to combine Operations that can be executed as one whole when multi-processing.
- * @ingroup Execution
+ * \ingroup Execution
*/
class ExecutionGroup {
public:
@@ -70,86 +70,86 @@ private:
// fields
/**
- * @brief list of operations in this ExecutionGroup
+ * \brief list of operations in this ExecutionGroup
*/
Operations m_operations;
/**
- * @brief is this ExecutionGroup an input ExecutionGroup
+ * \brief is this ExecutionGroup an input ExecutionGroup
* an input execution group is a group that is at the end of the calculation (the output is important for the user)
*/
int m_isOutput;
/**
- * @brief Width of the output
+ * \brief Width of the output
*/
unsigned int m_width;
/**
- * @brief Height of the output
+ * \brief Height of the output
*/
unsigned int m_height;
/**
- * @brief size of a single chunk, being Width or of height
+ * \brief size of a single chunk, being Width or of height
* a chunk is always a square, except at the edges of the MemoryBuffer
*/
unsigned int m_chunkSize;
/**
- * @brief number of chunks in the x-axis
+ * \brief number of chunks in the x-axis
*/
unsigned int m_numberOfXChunks;
/**
- * @brief number of chunks in the y-axis
+ * \brief number of chunks in the y-axis
*/
unsigned int m_numberOfYChunks;
/**
- * @brief total number of chunks
+ * \brief total number of chunks
*/
unsigned int m_numberOfChunks;
/**
- * @brief contains this ExecutionGroup a complex NodeOperation.
+ * \brief contains this ExecutionGroup a complex NodeOperation.
*/
bool m_complex;
/**
- * @brief can this ExecutionGroup be scheduled on an OpenCLDevice
+ * \brief can this ExecutionGroup be scheduled on an OpenCLDevice
*/
bool m_openCL;
/**
- * @brief Is this Execution group SingleThreaded
+ * \brief Is this Execution group SingleThreaded
*/
bool m_singleThreaded;
/**
- * @brief what is the maximum number field of all ReadBufferOperation in this ExecutionGroup.
- * @note this is used to construct the MemoryBuffers that will be passed during execution.
+ * \brief what is the maximum number field of all ReadBufferOperation in this ExecutionGroup.
+ * \note this is used to construct the MemoryBuffers that will be passed during execution.
*/
unsigned int m_cachedMaxReadBufferOffset;
/**
- * @brief a cached vector of all read operations in the execution group.
+ * \brief a cached vector of all read operations in the execution group.
*/
Operations m_cachedReadOperations;
/**
- * @brief reference to the original bNodeTree, this field is only set for the 'top' execution group.
- * @note can only be used to call the callbacks for progress, status and break
+ * \brief reference to the original bNodeTree, this field is only set for the 'top' execution group.
+ * \note can only be used to call the callbacks for progress, status and break
*/
const bNodeTree *m_bTree;
/**
- * @brief total number of chunks that have been calculated for this ExecutionGroup
+ * \brief total number of chunks that have been calculated for this ExecutionGroup
*/
unsigned int m_chunksFinished;
/**
- * @brief the chunkExecutionStates holds per chunk the execution state. this state can be
+ * \brief the chunkExecutionStates holds per chunk the execution state. this state can be
* - COM_ES_NOT_SCHEDULED: not scheduled
* - COM_ES_SCHEDULED: scheduled
* - COM_ES_EXECUTED: executed
@@ -157,92 +157,92 @@ private:
ChunkExecutionState *m_chunkExecutionStates;
/**
- * @brief indicator when this ExecutionGroup has valid Operations in its vector for Execution
- * @note When building the ExecutionGroup Operations are added via recursion. First a WriteBufferOperations is added, then the
- * @note Operation containing the settings that is important for the ExecutiongGroup is added,
- * @note When this occurs, these settings are copied over from the node to the ExecutionGroup
- * @note and the Initialized flag is set to true.
- * @see complex
- * @see openCL
+ * \brief indicator when this ExecutionGroup has valid Operations in its vector for Execution
+ * \note When building the ExecutionGroup Operations are added via recursion. First a WriteBufferOperations is added, then the
+ * \note Operation containing the settings that is important for the ExecutiongGroup is added,
+ * \note When this occurs, these settings are copied over from the node to the ExecutionGroup
+ * \note and the Initialized flag is set to true.
+ * \see complex
+ * \see openCL
*/
bool m_initialized;
/**
- * @brief denotes boundary for border compositing
- * @note measured in pixel space
+ * \brief denotes boundary for border compositing
+ * \note measured in pixel space
*/
rcti m_viewerBorder;
/**
- * @brief start time of execution
+ * \brief start time of execution
*/
double m_executionStartTime;
// methods
/**
- * @brief check whether parameter operation can be added to the execution group
- * @param operation the operation to be added
+ * \brief check whether parameter operation can be added to the execution group
+ * \param operation the operation to be added
*/
bool canContainOperation(NodeOperation *operation);
/**
- * @brief calculate the actual chunk size of this execution group.
- * @note A chunk size is an unsigned int that is both the height and width of a chunk.
- * @note The chunk size will not be stored in the chunkSize field. This needs to be done
- * @note by the calling method.
+ * \brief calculate the actual chunk size of this execution group.
+ * \note A chunk size is an unsigned int that is both the height and width of a chunk.
+ * \note The chunk size will not be stored in the chunkSize field. This needs to be done
+ * \note by the calling method.
*/
unsigned int determineChunkSize();
/**
- * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk at a position.
- * @note Only gives useful results ater the determination of the chunksize
- * @see determineChunkSize()
+ * \brief Determine the rect (minx, maxx, miny, maxy) of a chunk at a position.
+ * \note Only gives useful results ater the determination of the chunksize
+ * \see determineChunkSize()
*/
void determineChunkRect(rcti *rect, const unsigned int xChunk, const unsigned int yChunk) const;
/**
- * @brief determine the number of chunks, based on the chunkSize, width and height.
- * @note The result are stored in the fields numberOfChunks, numberOfXChunks, numberOfYChunks
+ * \brief determine the number of chunks, based on the chunkSize, width and height.
+ * \note The result are stored in the fields numberOfChunks, numberOfXChunks, numberOfYChunks
*/
void determineNumberOfChunks();
/**
- * @brief try to schedule a specific chunk.
- * @note scheduling succeeds when all input requirements are met and the chunks hasn't been scheduled yet.
- * @param graph
- * @param xChunk
- * @param yChunk
- * @return [true:false]
+ * \brief try to schedule a specific chunk.
+ * \note scheduling succeeds when all input requirements are met and the chunks hasn't been scheduled yet.
+ * \param graph
+ * \param xChunk
+ * \param yChunk
+ * \return [true:false]
* true: package(s) are scheduled
* false: scheduling is deferred (depending workpackages are scheduled)
*/
bool scheduleChunkWhenPossible(ExecutionSystem *graph, int xChunk, int yChunk);
/**
- * @brief try to schedule a specific area.
- * @note Check if a certain area is available, when not available this are will be checked.
- * @note This method is called from other ExecutionGroup's.
- * @param graph
- * @param rect
- * @return [true:false]
+ * \brief try to schedule a specific area.
+ * \note Check if a certain area is available, when not available this are will be checked.
+ * \note This method is called from other ExecutionGroup's.
+ * \param graph
+ * \param rect
+ * \return [true:false]
* true: package(s) are scheduled
* false: scheduling is deferred (depending workpackages are scheduled)
*/
bool scheduleAreaWhenPossible(ExecutionSystem *graph, rcti *rect);
/**
- * @brief add a chunk to the WorkScheduler.
- * @param chunknumber
+ * \brief add a chunk to the WorkScheduler.
+ * \param chunknumber
*/
bool scheduleChunk(unsigned int chunkNumber);
/**
- * @brief determine the area of interest of a certain input area
- * @note This method only evaluates a single ReadBufferOperation
- * @param input the input area
- * @param readOperation The ReadBufferOperation where the area needs to be evaluated
- * @param output the area needed of the ReadBufferOperation. Result
+ * \brief determine the area of interest of a certain input area
+ * \note This method only evaluates a single ReadBufferOperation
+ * \param input the input area
+ * \param readOperation The ReadBufferOperation where the area needs to be evaluated
+ * \param output the area needed of the ReadBufferOperation. Result
*/
void determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
@@ -253,116 +253,116 @@ public:
// methods
/**
- * @brief add an operation to this ExecutionGroup
- * @note this method will add input of the operations recursively
- * @note this method can create multiple ExecutionGroup's
- * @param system
- * @param operation
- * @return True if the operation was successfully added
+ * \brief add an operation to this ExecutionGroup
+ * \note this method will add input of the operations recursively
+ * \note this method can create multiple ExecutionGroup's
+ * \param system
+ * \param operation
+ * \return True if the operation was successfully added
*/
bool addOperation(NodeOperation *operation);
/**
- * @brief is this ExecutionGroup an output ExecutionGroup
- * @note An OutputExecution group are groups containing a
- * @note ViewerOperation, CompositeOperation, PreviewOperation.
- * @see NodeOperation.isOutputOperation
+ * \brief is this ExecutionGroup an output ExecutionGroup
+ * \note An OutputExecution group are groups containing a
+ * \note ViewerOperation, CompositeOperation, PreviewOperation.
+ * \see NodeOperation.isOutputOperation
*/
- const int isOutputExecutionGroup() const { return this->m_isOutput; }
+ int isOutputExecutionGroup() const { return this->m_isOutput; }
/**
- * @brief set whether this ExecutionGroup is an output
- * @param isOutput
+ * \brief set whether this ExecutionGroup is an output
+ * \param isOutput
*/
void setOutputExecutionGroup(int isOutput) { this->m_isOutput = isOutput; }
/**
- * @brief determine the resolution of this ExecutionGroup
- * @param resolution
+ * \brief determine the resolution of this ExecutionGroup
+ * \param resolution
*/
void determineResolution(unsigned int resolution[2]);
/**
- * @brief set the resolution of this executiongroup
- * @param resolution
+ * \brief set the resolution of this executiongroup
+ * \param resolution
*/
void setResolution(unsigned int resolution[2]) { this->m_width = resolution[0]; this->m_height = resolution[1]; }
/**
- * @brief get the width of this execution group
+ * \brief get the width of this execution group
*/
unsigned int getWidth() const { return m_width; }
/**
- * @brief get the height of this execution group
+ * \brief get the height of this execution group
*/
unsigned int getHeight() const { return m_height; }
/**
- * @brief does this ExecutionGroup contains a complex NodeOperation
+ * \brief does this ExecutionGroup contains a complex NodeOperation
*/
bool isComplex() const { return m_complex; }
/**
- * @brief get the output operation of this ExecutionGroup
- * @return NodeOperation *output operation
+ * \brief get the output operation of this ExecutionGroup
+ * \return NodeOperation *output operation
*/
NodeOperation *getOutputOperation() const;
/**
- * @brief compose multiple chunks into a single chunk
- * @return Memorybuffer *consolidated chunk
+ * \brief compose multiple chunks into a single chunk
+ * \return Memorybuffer *consolidated chunk
*/
MemoryBuffer *constructConsolidatedMemoryBuffer(MemoryProxy *memoryProxy, rcti *output);
/**
- * @brief initExecution is called just before the execution of the whole graph will be done.
- * @note The implementation will calculate the chunkSize of this execution group.
+ * \brief initExecution is called just before the execution of the whole graph will be done.
+ * \note The implementation will calculate the chunkSize of this execution group.
*/
void initExecution();
/**
- * @brief get all inputbuffers needed to calculate an chunk
- * @note all inputbuffers must be executed
- * @param chunkNumber the chunk to be calculated
- * @return (MemoryBuffer **) the inputbuffers
+ * \brief get all inputbuffers needed to calculate an chunk
+ * \note all inputbuffers must be executed
+ * \param chunkNumber the chunk to be calculated
+ * \return (MemoryBuffer **) the inputbuffers
*/
MemoryBuffer **getInputBuffersCPU();
/**
- * @brief get all inputbuffers needed to calculate an chunk
- * @note all inputbuffers must be executed
- * @param chunkNumber the chunk to be calculated
- * @return (MemoryBuffer **) the inputbuffers
+ * \brief get all inputbuffers needed to calculate an chunk
+ * \note all inputbuffers must be executed
+ * \param chunkNumber the chunk to be calculated
+ * \return (MemoryBuffer **) the inputbuffers
*/
MemoryBuffer **getInputBuffersOpenCL(int chunkNumber);
/**
- * @brief allocate the outputbuffer of a chunk
- * @param chunkNumber the number of the chunk in the ExecutionGroup
- * @param rect the rect of that chunk
- * @see determineChunkRect
+ * \brief allocate the outputbuffer of a chunk
+ * \param chunkNumber the number of the chunk in the ExecutionGroup
+ * \param rect the rect of that chunk
+ * \see determineChunkRect
*/
MemoryBuffer *allocateOutputBuffer(int chunkNumber, rcti *rect);
/**
- * @brief after a chunk is executed the needed resources can be freed or unlocked.
- * @param chunknumber
- * @param memorybuffers
+ * \brief after a chunk is executed the needed resources can be freed or unlocked.
+ * \param chunknumber
+ * \param memorybuffers
*/
void finalizeChunkExecution(int chunkNumber, MemoryBuffer **memoryBuffers);
/**
- * @brief deinitExecution is called just after execution the whole graph.
- * @note It will release all needed resources
+ * \brief deinitExecution is called just after execution the whole graph.
+ * \note It will release all needed resources
*/
void deinitExecution();
/**
- * @brief schedule an ExecutionGroup
- * @note this method will return when all chunks have been calculated, or the execution has breaked (by user)
+ * \brief schedule an ExecutionGroup
+ * \note this method will return when all chunks have been calculated, or the execution has breaked (by user)
*
* first the order of the chunks will be determined. This is determined by finding the ViewerOperation and get the relevant information from it.
* - ChunkOrdering
@@ -371,43 +371,43 @@ public:
*
* After determining the order of the chunks the chunks will be scheduled
*
- * @see ViewerOperation
- * @param system
+ * \see ViewerOperation
+ * \param system
*/
void execute(ExecutionSystem *system);
/**
- * @brief this method determines the MemoryProxy's where this execution group depends on.
- * @note After this method determineDependingAreaOfInterest can be called to determine
- * @note the area of the MemoryProxy.creator that has to be executed.
- * @param memoryProxies result
+ * \brief this method determines the MemoryProxy's where this execution group depends on.
+ * \note After this method determineDependingAreaOfInterest can be called to determine
+ * \note the area of the MemoryProxy.creator that has to be executed.
+ * \param memoryProxies result
*/
void determineDependingMemoryProxies(vector<MemoryProxy *> *memoryProxies);
/**
- * @brief Determine the rect (minx, maxx, miny, maxy) of a chunk.
- * @note Only gives useful results ater the determination of the chunksize
- * @see determineChunkSize()
+ * \brief Determine the rect (minx, maxx, miny, maxy) of a chunk.
+ * \note Only gives useful results ater the determination of the chunksize
+ * \see determineChunkSize()
*/
void determineChunkRect(rcti *rect, const unsigned int chunkNumber) const;
/**
- * @brief can this ExecutionGroup be scheduled on an OpenCLDevice
- * @see WorkScheduler.schedule
+ * \brief can this ExecutionGroup be scheduled on an OpenCLDevice
+ * \see WorkScheduler.schedule
*/
bool isOpenCL();
void setChunksize(int chunksize) { this->m_chunkSize = chunksize; }
/**
- * @brief get the Render priority of this ExecutionGroup
- * @see ExecutionSystem.execute
+ * \brief get the Render priority of this ExecutionGroup
+ * \see ExecutionSystem.execute
*/
CompositorPriority getRenderPriotrity();
/**
- * @brief set border for viewer operation
- * @note all the coordinates are assumed to be in normalized space
+ * \brief set border for viewer operation
+ * \note all the coordinates are assumed to be in normalized space
*/
void setViewerBorder(float xmin, float xmax, float ymin, float ymax);
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h
index 0990df31c55..5b0d36ebacd 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.h
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.h
@@ -33,23 +33,23 @@ class ExecutionGroup;
#include "COM_NodeOperation.h"
/**
- * @page execution Execution model
+ * \page execution Execution model
* In order to get to an efficient model for execution, several steps are being done. these steps are explained below.
*
- * @section EM_Step1 Step 1: translating blender node system to the new compsitor system
+ * \section EM_Step1 Step 1: translating blender node system to the new compsitor system
* Blenders node structure is based on C structs (DNA). These structs are not efficient in the new architecture.
* We want to use classes in order to simplify the system.
* during this step the blender node_tree is evaluated and converted to a CPP node system.
*
- * @see ExecutionSystem
- * @see Converter.convert
- * @see Node
+ * \see ExecutionSystem
+ * \see Converter.convert
+ * \see Node
*
- * @section EM_Step2 Step2: translating nodes to operations
+ * \section EM_Step2 Step2: translating nodes to operations
* Ungrouping the GroupNodes. Group nodes are node_tree's in node_tree's.
* The new system only supports a single level of node_tree. We will 'flatten' the system in a single level.
- * @see GroupNode
- * @see ExecutionSystemHelper.ungroup
+ * \see GroupNode
+ * \see ExecutionSystemHelper.ungroup
*
* Every node has the ability to convert itself to operations. The node itself is responsible to create a correct
* NodeOperation setup based on its internal settings.
@@ -59,11 +59,11 @@ class ExecutionGroup;
* based on the selected Mixtype a different operation will be used.
* for more information see the page about creating new Nodes. [@subpage newnode]
*
- * @see ExecutionSystem.convertToOperations
- * @see Node.convertToOperations
- * @see NodeOperation base class for all operations in the system
+ * \see ExecutionSystem.convertToOperations
+ * \see Node.convertToOperations
+ * \see NodeOperation base class for all operations in the system
*
- * @section EM_Step3 Step3: add additional conversions to the operation system
+ * \section EM_Step3 Step3: add additional conversions to the operation system
* - Data type conversions: the system has 3 data types COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR.
* The user can connect a Value socket to a color socket.
* As values are ordered differently than colors a conversion happens.
@@ -77,10 +77,10 @@ class ExecutionGroup;
* - [@ref InputSocketResizeMode.COM_SC_STRETCH]: The width and the height of both images are aligned
* - [@ref InputSocketResizeMode.COM_SC_NO_RESIZE]: bottom left of the images are aligned.
*
- * @see Converter.convertDataType Datatype conversions
- * @see Converter.convertResolution Image size conversions
+ * \see Converter.convertDataType Datatype conversions
+ * \see Converter.convertResolution Image size conversions
*
- * @section EM_Step4 Step4: group operations in executions groups
+ * \section EM_Step4 Step4: group operations in executions groups
* ExecutionGroup are groups of operations that are calculated as being one bigger operation.
* All operations will be part of an ExecutionGroup.
* Complex nodes will be added to separate groups. Between ExecutionGroup's the data will be stored in MemoryBuffers.
@@ -101,14 +101,14 @@ class ExecutionGroup;
* |cFAA | |cFAA | |cFAA | |cFAA |
* +------+ +------+ +-------+ +-------+
* </pre>
- * @see ExecutionSystem.groupOperations method doing this step
- * @see ExecutionSystem.addReadWriteBufferOperations
- * @see NodeOperation.isComplex
- * @see ExecutionGroup class representing the ExecutionGroup
+ * \see ExecutionSystem.groupOperations method doing this step
+ * \see ExecutionSystem.addReadWriteBufferOperations
+ * \see NodeOperation.isComplex
+ * \see ExecutionGroup class representing the ExecutionGroup
*/
/**
- * @brief the ExecutionSystem contains the whole compositor tree.
+ * \brief the ExecutionSystem contains the whole compositor tree.
*/
class ExecutionSystem {
public:
@@ -117,17 +117,17 @@ public:
private:
/**
- * @brief the context used during execution
+ * \brief the context used during execution
*/
CompositorContext m_context;
/**
- * @brief vector of operations
+ * \brief vector of operations
*/
Operations m_operations;
/**
- * @brief vector of groups
+ * \brief vector of groups
*/
Groups m_groups;
@@ -144,11 +144,11 @@ private: //methods
public:
/**
- * @brief Create a new ExecutionSystem and initialize it with the
+ * \brief Create a new ExecutionSystem and initialize it with the
* editingtree.
*
- * @param editingtree [bNodeTree *]
- * @param rendering [true false]
+ * \param editingtree [bNodeTree *]
+ * \param rendering [true false]
*/
ExecutionSystem(RenderData *rd, Scene *scene, bNodeTree *editingtree, bool rendering, bool fastcalculation,
const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings,
@@ -162,7 +162,7 @@ public:
void set_operations(const Operations &operations, const Groups &groups);
/**
- * @brief execute this system
+ * \brief execute this system
* - initialize the NodeOperation's and ExecutionGroup's
* - schedule the output ExecutionGroup's based on their priority
* - deinitialize the ExecutionGroup's and NodeOperation's
@@ -170,7 +170,7 @@ public:
void execute();
/**
- * @brief get the reference to the compositor context
+ * \brief get the reference to the compositor context
*/
const CompositorContext &getContext() const { return this->m_context; }
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h
index 5f6485475d0..7492113da34 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.h
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.h
@@ -35,15 +35,15 @@ extern "C" {
}
/**
- * @brief state of a memory buffer
- * @ingroup Memory
+ * \brief state of a memory buffer
+ * \ingroup Memory
*/
typedef enum MemoryBufferState {
- /** @brief memory has been allocated on creator device and CPU machine, but kernel has not been executed */
+ /** \brief memory has been allocated on creator device and CPU machine, but kernel has not been executed */
COM_MB_ALLOCATED = 1,
- /** @brief memory is available for use, content has been created */
+ /** \brief memory is available for use, content has been created */
COM_MB_AVAILABLE = 2,
- /** @brief chunk is consolidated from other chunks. special state.*/
+ /** \brief chunk is consolidated from other chunks. special state.*/
COM_MB_TEMPORARILY = 6
} MemoryBufferState;
@@ -56,44 +56,44 @@ typedef enum MemoryBufferExtend {
class MemoryProxy;
/**
- * @brief a MemoryBuffer contains access to the data of a chunk
+ * \brief a MemoryBuffer contains access to the data of a chunk
*/
class MemoryBuffer {
private:
/**
- * @brief proxy of the memory (same for all chunks in the same buffer)
+ * \brief proxy of the memory (same for all chunks in the same buffer)
*/
MemoryProxy *m_memoryProxy;
/**
- * @brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR
+ * \brief the type of buffer COM_DT_VALUE, COM_DT_VECTOR, COM_DT_COLOR
*/
DataType m_datatype;
/**
- * @brief region of this buffer inside relative to the MemoryProxy
+ * \brief region of this buffer inside relative to the MemoryProxy
*/
rcti m_rect;
/**
* brief refers to the chunknumber within the executiongroup where related to the MemoryProxy
- * @see memoryProxy
+ * \see memoryProxy
*/
unsigned int m_chunkNumber;
/**
- * @brief state of the buffer
+ * \brief state of the buffer
*/
MemoryBufferState m_state;
/**
- * @brief the actual float buffer/data
+ * \brief the actual float buffer/data
*/
float *m_buffer;
/**
- * @brief the number of channels of a single value in the buffer.
+ * \brief the number of channels of a single value in the buffer.
* For value buffers this is 1, vector 3 and color 4
*/
unsigned int m_num_channels;
@@ -103,40 +103,40 @@ private:
public:
/**
- * @brief construct new MemoryBuffer for a chunk
+ * \brief construct new MemoryBuffer for a chunk
*/
MemoryBuffer(MemoryProxy *memoryProxy, unsigned int chunkNumber, rcti *rect);
/**
- * @brief construct new temporarily MemoryBuffer for an area
+ * \brief construct new temporarily MemoryBuffer for an area
*/
MemoryBuffer(MemoryProxy *memoryProxy, rcti *rect);
/**
- * @brief construct new temporarily MemoryBuffer for an area
+ * \brief construct new temporarily MemoryBuffer for an area
*/
MemoryBuffer(DataType datatype, rcti *rect);
/**
- * @brief destructor
+ * \brief destructor
*/
~MemoryBuffer();
/**
- * @brief read the ChunkNumber of this MemoryBuffer
+ * \brief read the ChunkNumber of this MemoryBuffer
*/
unsigned int getChunkNumber() { return this->m_chunkNumber; }
unsigned int get_num_channels() { return this->m_num_channels; }
/**
- * @brief get the data of this MemoryBuffer
- * @note buffer should already be available in memory
+ * \brief get the data of this MemoryBuffer
+ * \note buffer should already be available in memory
*/
float *getBuffer() { return this->m_buffer; }
/**
- * @brief after execution the state will be set to available by calling this method
+ * \brief after execution the state will be set to available by calling this method
*/
void setCreatedState()
{
@@ -273,36 +273,36 @@ public:
void readEWA(float *result, const float uv[2], const float derivatives[2][2]);
/**
- * @brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk)
+ * \brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk)
*/
- inline const bool isTemporarily() const { return this->m_state == COM_MB_TEMPORARILY; }
+ inline bool isTemporarily() const { return this->m_state == COM_MB_TEMPORARILY; }
/**
- * @brief add the content from otherBuffer to this MemoryBuffer
- * @param otherBuffer source buffer
+ * \brief add the content from otherBuffer to this MemoryBuffer
+ * \param otherBuffer source buffer
*
- * @note take care when running this on a new buffer since it wont fill in
+ * \note take care when running this on a new buffer since it wont fill in
* uninitialized values in areas where the buffers don't overlap.
*/
void copyContentFrom(MemoryBuffer *otherBuffer);
/**
- * @brief get the rect of this MemoryBuffer
+ * \brief get the rect of this MemoryBuffer
*/
rcti *getRect() { return &this->m_rect; }
/**
- * @brief get the width of this MemoryBuffer
+ * \brief get the width of this MemoryBuffer
*/
int getWidth() const;
/**
- * @brief get the height of this MemoryBuffer
+ * \brief get the height of this MemoryBuffer
*/
int getHeight() const;
/**
- * @brief clear the buffer. Make all pixels black transparent.
+ * \brief clear the buffer. Make all pixels black transparent.
*/
void clear();
diff --git a/source/blender/compositor/intern/COM_MemoryProxy.h b/source/blender/compositor/intern/COM_MemoryProxy.h
index a628c09fa1f..20368eebde0 100644
--- a/source/blender/compositor/intern/COM_MemoryProxy.h
+++ b/source/blender/compositor/intern/COM_MemoryProxy.h
@@ -31,40 +31,40 @@ class ExecutionGroup;
class WriteBufferOperation;
/**
- * @brief A MemoryProxy is a unique identifier for a memory buffer.
+ * \brief A MemoryProxy is a unique identifier for a memory buffer.
* A single MemoryProxy is used among all chunks of the same buffer,
* the MemoryBuffer only stores the data of a single chunk.
- * @ingroup Memory
+ * \ingroup Memory
*/
class MemoryProxy {
private:
/**
- * @brief reference to the ouput operation of the executiongroup
+ * \brief reference to the output operation of the executiongroup
*/
WriteBufferOperation *m_writeBufferOperation;
/**
- * @brief reference to the executor. the Execution group that can fill a chunk
+ * \brief reference to the executor. the Execution group that can fill a chunk
*/
ExecutionGroup *m_executor;
/**
- * @brief datatype of this MemoryProxy
+ * \brief datatype of this MemoryProxy
*/
/* DataType m_datatype; */ /* UNUSED */
/**
- * @brief channel information of this buffer
+ * \brief channel information of this buffer
*/
/* ChannelInfo m_channelInfo[COM_NUMBER_OF_CHANNELS]; */ /* UNUSED */
/**
- * @brief the allocated memory
+ * \brief the allocated memory
*/
MemoryBuffer *m_buffer;
/**
- * @brief datatype of this MemoryProxy
+ * \brief datatype of this MemoryProxy
*/
DataType m_datatype;
@@ -72,40 +72,40 @@ public:
MemoryProxy(DataType type);
/**
- * @brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
- * @param group the ExecutionGroup to set
+ * \brief set the ExecutionGroup that can be scheduled to calculate a certain chunk.
+ * \param group the ExecutionGroup to set
*/
void setExecutor(ExecutionGroup *executor) { this->m_executor = executor; }
/**
- * @brief get the ExecutionGroup that can be scheduled to calculate a certain chunk.
+ * \brief get the ExecutionGroup that can be scheduled to calculate a certain chunk.
*/
ExecutionGroup *getExecutor() { return this->m_executor; }
/**
- * @brief set the WriteBufferOperation that is responsible for writing to this MemoryProxy
- * @param operation
+ * \brief set the WriteBufferOperation that is responsible for writing to this MemoryProxy
+ * \param operation
*/
void setWriteBufferOperation(WriteBufferOperation *operation) { this->m_writeBufferOperation = operation; }
/**
- * @brief get the WriteBufferOperation that is responsible for writing to this MemoryProxy
- * @return WriteBufferOperation
+ * \brief get the WriteBufferOperation that is responsible for writing to this MemoryProxy
+ * \return WriteBufferOperation
*/
WriteBufferOperation *getWriteBufferOperation() { return this->m_writeBufferOperation; }
/**
- * @brief allocate memory of size width x height
+ * \brief allocate memory of size width x height
*/
void allocate(unsigned int width, unsigned int height);
/**
- * @brief free the allocated memory
+ * \brief free the allocated memory
*/
void free();
/**
- * @brief get the allocated memory
+ * \brief get the allocated memory
*/
inline MemoryBuffer *getBuffer() { return this->m_buffer; }
diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h
index 1b78e7fec6d..891845517d5 100644
--- a/source/blender/compositor/intern/COM_Node.h
+++ b/source/blender/compositor/intern/COM_Node.h
@@ -48,43 +48,43 @@ public:
private:
/**
- * @brief stores the reference to the SDNA bNode struct
+ * \brief stores the reference to the SDNA bNode struct
*/
bNodeTree *m_editorNodeTree;
/**
- * @brief stores the reference to the SDNA bNode struct
+ * \brief stores the reference to the SDNA bNode struct
*/
bNode *m_editorNode;
/**
- * @brief the list of actual inputsockets @see NodeInput
+ * \brief the list of actual inputsockets \see NodeInput
*/
Inputs m_inputsockets;
/**
- * @brief the list of actual outputsockets @see NodeOutput
+ * \brief the list of actual outputsockets \see NodeOutput
*/
Outputs m_outputsockets;
/**
- * @brief Is this node part of the active group
+ * \brief Is this node part of the active group
*/
bool m_inActiveGroup;
/**
- * @brief Instance key to identify the node in an instance hash table
+ * \brief Instance key to identify the node in an instance hash table
*/
bNodeInstanceKey m_instanceKey;
protected:
/**
- * @brief get access to the vector of input sockets
+ * \brief get access to the vector of input sockets
*/
const Inputs &getInputSockets() const { return this->m_inputsockets; }
/**
- * @brief get access to the vector of input sockets
+ * \brief get access to the vector of input sockets
*/
const Outputs &getOutputSockets() const { return this->m_outputsockets; }
@@ -93,55 +93,55 @@ public:
virtual ~Node();
/**
- * @brief get the reference to the SDNA bNode struct
+ * \brief get the reference to the SDNA bNode struct
*/
bNode *getbNode() const {return m_editorNode;}
/**
- * @brief get the reference to the SDNA bNodeTree struct
+ * \brief get the reference to the SDNA bNodeTree struct
*/
bNodeTree *getbNodeTree() const {return m_editorNodeTree;}
/**
- * @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
+ * \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 *node) {this->m_editorNode = node;}
/**
- * @brief set the reference to the bNodeTree
- * @param bNodeTree
+ * \brief set the reference to the bNodeTree
+ * \param bNodeTree
*/
void setbNodeTree(bNodeTree *nodetree) {this->m_editorNodeTree = nodetree;}
/**
- * @brief Return the number of input sockets of this node.
+ * \brief Return the number of input sockets of this node.
*/
- const unsigned int getNumberOfInputSockets() const { return this->m_inputsockets.size(); }
+ unsigned int getNumberOfInputSockets() const { return this->m_inputsockets.size(); }
/**
- * @brief Return the number of output sockets of this node.
+ * \brief Return the number of output sockets of this node.
*/
- const unsigned int getNumberOfOutputSockets() const { return this->m_outputsockets.size(); }
+ unsigned int getNumberOfOutputSockets() const { return this->m_outputsockets.size(); }
/**
* get the reference to a certain outputsocket
- * @param index
+ * \param index
* the index of the needed outputsocket
*/
NodeOutput *getOutputSocket(const unsigned int index) const;
/**
* get the reference to the first outputsocket
- * @param index
+ * \param index
* the index of the needed outputsocket
*/
inline NodeOutput *getOutputSocket() const { return getOutputSocket(0); }
/**
* get the reference to a certain inputsocket
- * @param index
+ * \param index
* the index of the needed inputsocket
*/
NodeInput *getInputSocket(const unsigned int index) const;
@@ -152,26 +152,26 @@ public:
bool isInputNode() const { return m_inputsockets.empty(); }
/**
- * @brief Is this node in the active group (the group that is being edited)
- * @param isInActiveGroup
+ * \brief Is this node in the active group (the group that is being edited)
+ * \param isInActiveGroup
*/
void setIsInActiveGroup(bool value) { this->m_inActiveGroup = value; }
/**
- * @brief Is this node part of the active group
+ * \brief Is this node part of the active group
* the active group is the group that is currently being edited. When no group is edited,
* the active group will be the main tree (all nodes that are not part of a group will be active)
- * @return bool [false:true]
+ * \return bool [false:true]
*/
inline bool isInActiveGroup() const { return this->m_inActiveGroup; }
/**
- * @brief convert node to operation
+ * \brief convert node to operation
*
- * @todo this must be described further
+ * \todo this must be described further
*
- * @param system the ExecutionSystem where the operations need to be added
- * @param context reference to the CompositorContext
+ * \param system the ExecutionSystem where the operations need to be added
+ * \param context reference to the CompositorContext
*/
virtual void convertToOperations(NodeConverter &converter, const CompositorContext &context) const = 0;
@@ -191,17 +191,17 @@ public:
protected:
/**
- * @brief add an NodeInput to the collection of inputsockets
- * @note may only be called in an constructor
- * @param socket the NodeInput to add
+ * \brief add an NodeInput to the collection of inputsockets
+ * \note may only be called in an constructor
+ * \param socket the NodeInput to add
*/
void addInputSocket(DataType datatype);
void addInputSocket(DataType datatype, bNodeSocket *socket);
/**
- * @brief add an NodeOutput to the collection of outputsockets
- * @note may only be called in an constructor
- * @param socket the NodeOutput to add
+ * \brief add an NodeOutput to the collection of outputsockets
+ * \note may only be called in an constructor
+ * \param socket the NodeOutput to add
*/
void addOutputSocket(DataType datatype);
void addOutputSocket(DataType datatype, bNodeSocket *socket);
@@ -212,8 +212,8 @@ protected:
/**
- * @brief NodeInput are sockets that can receive data/input
- * @ingroup Model
+ * \brief NodeInput are sockets that can receive data/input
+ * \ingroup Model
*/
class NodeInput {
private:
@@ -223,7 +223,7 @@ private:
DataType m_datatype;
/**
- * @brief link connected to this NodeInput.
+ * \brief link connected to this NodeInput.
* An input socket can only have a single link
*/
NodeOutput *m_link;
@@ -246,8 +246,8 @@ public:
/**
- * @brief NodeOutput are sockets that can send data/input
- * @ingroup Model
+ * \brief NodeOutput are sockets that can send data/input
+ * \ingroup Model
*/
class NodeOutput {
private:
diff --git a/source/blender/compositor/intern/COM_NodeConverter.h b/source/blender/compositor/intern/COM_NodeConverter.h
index 4fb6b70ad1b..320646be50d 100644
--- a/source/blender/compositor/intern/COM_NodeConverter.h
+++ b/source/blender/compositor/intern/COM_NodeConverter.h
@@ -36,44 +36,50 @@ class NodeOperationBuilder;
class ViewerOperation;
-/** Interface type for converting a \a Node into \a NodeOperation.
- * This is passed to \a Node::convertToOperation methods and allows them
- * to register any number of operations, create links between them,
- * and map original node sockets to their inputs or outputs.
+/**
+ * Interface type for converting a \a Node into \a NodeOperation.
+ * This is passed to \a Node::convertToOperation methods and allows them
+ * to register any number of operations, create links between them,
+ * and map original node sockets to their inputs or outputs.
*/
class NodeConverter {
public:
NodeConverter(NodeOperationBuilder *builder);
- /** Insert a new operation into the operations graph.
- * The operation must be created by the node.
+ /**
+ * Insert a new operation into the operations graph.
+ * The operation must be created by the node.
*/
void addOperation(NodeOperation *operation);
- /** Map input socket of the node to an operation socket.
- * Links between nodes will then generate equivalent links between
- * the mapped operation sockets.
+ /**
+ * Map input socket of the node to an operation socket.
+ * Links between nodes will then generate equivalent links between
+ * the mapped operation sockets.
*
- * \note A \a Node input can be mapped to multiple \a NodeOperation inputs.
+ * \note A \a Node input can be mapped to multiple \a NodeOperation inputs.
*/
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket);
- /** Map output socket of the node to an operation socket.
- * Links between nodes will then generate equivalent links between
- * the mapped operation sockets.
+ /**
+ * Map output socket of the node to an operation socket.
+ * Links between nodes will then generate equivalent links between
+ * the mapped operation sockets.
*
* \note A \a Node output can only be mapped to one \a NodeOperation output.
* Any existing operation output mapping will be replaced.
*/
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket);
- /** Create a proxy operation for a node input.
- * This operation will be removed later and replaced
- * by direct links between the connected operations.
+ /**
+ * Create a proxy operation for a node input.
+ * This operation will be removed later and replaced
+ * by direct links between the connected operations.
*/
NodeOperationOutput *addInputProxy(NodeInput *input, bool use_conversion);
- /** Create a proxy operation for a node output.
- * This operation will be removed later and replaced
- * by direct links between the connected operations.
+ /**
+ * Create a proxy operation for a node output.
+ * This operation will be removed later and replaced
+ * by direct links between the connected operations.
*/
NodeOperationInput *addOutputProxy(NodeOutput *output, bool use_conversion);
@@ -99,8 +105,9 @@ public:
/** Add a preview operation for a node input. */
void addNodeInputPreview(NodeInput *input);
- /** When a node has no valid data
- * @note missing image / group pointer, or missing renderlayer from EXR
+ /**
+ * When a node has no valid data
+ * \note missing image / group pointer, or missing renderlayer from EXR
*/
NodeOperation *setInvalidOutput(NodeOutput *output);
diff --git a/source/blender/compositor/intern/COM_NodeGraph.cpp b/source/blender/compositor/intern/COM_NodeGraph.cpp
index d78450074ed..94af8543eb0 100644
--- a/source/blender/compositor/intern/COM_NodeGraph.cpp
+++ b/source/blender/compositor/intern/COM_NodeGraph.cpp
@@ -176,7 +176,7 @@ NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_s
void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink)
{
- /// @note: ignore invalid links
+ /// \note: ignore invalid links
if (!(b_nodelink->flag & NODE_LINK_VALID))
return;
if ((b_nodelink->fromsock->flag & SOCK_UNAVAIL) || (b_nodelink->tosock->flag & SOCK_UNAVAIL))
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp
index 1063386aa58..09b05313898 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperation.cpp
@@ -171,7 +171,7 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOper
rcti tempOutput;
bool first = true;
for (int i = 0; i < getNumberOfInputSockets(); i ++) {
- NodeOperation * inputOperation = this->getInputOperation(i);
+ NodeOperation *inputOperation = this->getInputOperation(i);
if (inputOperation && inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
if (first) {
output->xmin = tempOutput.xmin;
diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h
index 9ab9156e7e4..95164d727e8 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.h
+++ b/source/blender/compositor/intern/COM_NodeOperation.h
@@ -52,30 +52,30 @@ class NodeOperationInput;
class NodeOperationOutput;
/**
- * @brief Resize modes of inputsockets
+ * \brief Resize modes of inputsockets
* How are the input and working resolutions matched
- * @ingroup Model
+ * \ingroup Model
*/
typedef enum InputResizeMode {
- /** @brief Center the input image to the center of the working area of the node, no resizing occurs */
+ /** \brief Center the input image to the center of the working area of the node, no resizing occurs */
COM_SC_CENTER = NS_CR_CENTER,
- /** @brief The bottom left of the input image is the bottom left of the working area of the node, no resizing occurs */
+ /** \brief The bottom left of the input image is the bottom left of the working area of the node, no resizing occurs */
COM_SC_NO_RESIZE = NS_CR_NONE,
- /** @brief Fit the width of the input image to the width of the working area of the node */
+ /** \brief Fit the width of the input image to the width of the working area of the node */
COM_SC_FIT_WIDTH = NS_CR_FIT_WIDTH,
- /** @brief Fit the height of the input image to the height of the working area of the node */
+ /** \brief Fit the height of the input image to the height of the working area of the node */
COM_SC_FIT_HEIGHT = NS_CR_FIT_HEIGHT,
- /** @brief Fit the width or the height of the input image to the width or height of the working area of the node, image will be larger than the working area */
+ /** \brief Fit the width or the height of the input image to the width or height of the working area of the node, image will be larger than the working area */
COM_SC_FIT = NS_CR_FIT,
- /** @brief Fit the width and the height of the input image to the width and height of the working area of the node, image will be equally larger than the working area */
+ /** \brief Fit the width and the height of the input image to the width and height of the working area of the node, image will be equally larger than the working area */
COM_SC_STRETCH = NS_CR_STRETCH
} InputResizeMode;
/**
- * @brief NodeOperation contains calculation logic
+ * \brief NodeOperation contains calculation logic
*
* Subclasses needs to implement the execution method (defined in SocketReader) to implement logic.
- * @ingroup Model
+ * \ingroup Model
*/
class NodeOperation : public SocketReader {
public:
@@ -87,12 +87,12 @@ private:
Outputs m_outputs;
/**
- * @brief the index of the input socket that will be used to determine the resolution
+ * \brief the index of the input socket that will be used to determine the resolution
*/
unsigned int m_resolutionInputSocketIndex;
/**
- * @brief is this operation a complex one.
+ * \brief is this operation a complex one.
*
* Complex operations are typically doing many reads to calculate the output of a single pixel.
* Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
@@ -100,29 +100,29 @@ private:
bool m_complex;
/**
- * @brief can this operation be scheduled on an OpenCL device.
- * @note Only applicable if complex is True
+ * \brief can this operation be scheduled on an OpenCL device.
+ * \note Only applicable if complex is True
*/
bool m_openCL;
/**
- * @brief mutex reference for very special node initializations
- * @note only use when you really know what you are doing.
+ * \brief mutex reference for very special node initializations
+ * \note only use when you really know what you are doing.
* this mutex is used to share data among chunks in the same operation
- * @see TonemapOperation for an example of usage
- * @see NodeOperation.initMutex initializes this mutex
- * @see NodeOperation.deinitMutex deinitializes this mutex
- * @see NodeOperation.getMutex retrieve a pointer to this mutex.
+ * \see TonemapOperation for an example of usage
+ * \see NodeOperation.initMutex initializes this mutex
+ * \see NodeOperation.deinitMutex deinitializes this mutex
+ * \see NodeOperation.getMutex retrieve a pointer to this mutex.
*/
ThreadMutex m_mutex;
/**
- * @brief reference to the editing bNodeTree, used for break and update callback
+ * \brief reference to the editing bNodeTree, used for break and update callback
*/
const bNodeTree *m_btree;
/**
- * @brief set to truth when resolution for this operation is set
+ * \brief set to truth when resolution for this operation is set
*/
bool m_isResolutionSet;
@@ -141,25 +141,25 @@ public:
bool isInputOperation() const { return m_inputs.empty(); }
/**
- * @brief determine the resolution of this node
- * @note this method will not set the resolution, this is the responsibility of the caller
- * @param resolution the result of this operation
- * @param preferredResolution the preferable resolution as no resolution could be determined
+ * \brief determine the resolution of this node
+ * \note this method will not set the resolution, this is the responsibility of the caller
+ * \param resolution the result of this operation
+ * \param preferredResolution the preferable resolution as no resolution could be determined
*/
virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
/**
- * @brief isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing.
+ * \brief isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing.
*
* Default behaviour if not overridden, this operation will not be evaluated as being an output of the ExecutionSystem.
*
- * @see ExecutionSystem
- * @group check
- * @param rendering [true false]
+ * \see ExecutionSystem
+ * \group check
+ * \param rendering [true false]
* true: rendering
* false: editing
*
- * @return bool the result of this method
+ * \return bool the result of this method
*/
virtual bool isOutputOperation(bool /*rendering*/) const { return false; }
@@ -169,26 +169,26 @@ public:
virtual void initExecution();
/**
- * @brief when a chunk is executed by a CPUDevice, this method is called
- * @ingroup execution
- * @param rect the rectangle of the chunk (location and size)
- * @param chunkNumber the chunkNumber to be calculated
- * @param memoryBuffers all input MemoryBuffer's needed
+ * \brief when a chunk is executed by a CPUDevice, this method is called
+ * \ingroup execution
+ * \param rect the rectangle of the chunk (location and size)
+ * \param chunkNumber the chunkNumber to be calculated
+ * \param memoryBuffers all input MemoryBuffer's needed
*/
virtual void executeRegion(rcti * /*rect*/,
unsigned int /*chunkNumber*/) {}
/**
- * @brief when a chunk is executed by an OpenCLDevice, this method is called
- * @ingroup execution
- * @note this method is only implemented in WriteBufferOperation
- * @param context the OpenCL context
- * @param program the OpenCL program containing all compositor kernels
- * @param queue the OpenCL command queue of the device the chunk is executed on
- * @param rect the rectangle of the chunk (location and size)
- * @param chunkNumber the chunkNumber to be calculated
- * @param memoryBuffers all input MemoryBuffer's needed
- * @param outputBuffer the outputbuffer to write to
+ * \brief when a chunk is executed by an OpenCLDevice, this method is called
+ * \ingroup execution
+ * \note this method is only implemented in WriteBufferOperation
+ * \param context the OpenCL context
+ * \param program the OpenCL program containing all compositor kernels
+ * \param queue the OpenCL command queue of the device the chunk is executed on
+ * \param rect the rectangle of the chunk (location and size)
+ * \param chunkNumber the chunkNumber to be calculated
+ * \param memoryBuffers all input MemoryBuffer's needed
+ * \param outputBuffer the outputbuffer to write to
*/
virtual void executeOpenCLRegion(OpenCLDevice * /*device*/,
rcti * /*rect*/,
@@ -197,16 +197,16 @@ public:
MemoryBuffer * /*outputBuffer*/) {}
/**
- * @brief custom handle to add new tasks to the OpenCL command queue in order to execute a chunk on an GPUDevice
- * @ingroup execution
- * @param context the OpenCL context
- * @param program the OpenCL program containing all compositor kernels
- * @param queue the OpenCL command queue of the device the chunk is executed on
- * @param outputMemoryBuffer the allocated memory buffer in main CPU memory
- * @param clOutputBuffer the allocated memory buffer in OpenCLDevice memory
- * @param inputMemoryBuffers all input MemoryBuffer's needed
- * @param clMemToCleanUp all created cl_mem references must be added to this list. Framework will clean this after execution
- * @param clKernelsToCleanUp all created cl_kernel references must be added to this list. Framework will clean this after execution
+ * \brief custom handle to add new tasks to the OpenCL command queue in order to execute a chunk on an GPUDevice
+ * \ingroup execution
+ * \param context the OpenCL context
+ * \param program the OpenCL program containing all compositor kernels
+ * \param queue the OpenCL command queue of the device the chunk is executed on
+ * \param outputMemoryBuffer the allocated memory buffer in main CPU memory
+ * \param clOutputBuffer the allocated memory buffer in OpenCLDevice memory
+ * \param inputMemoryBuffers all input MemoryBuffer's needed
+ * \param clMemToCleanUp all created cl_mem references must be added to this list. Framework will clean this after execution
+ * \param clKernelsToCleanUp all created cl_kernel references must be added to this list. Framework will clean this after execution
*/
virtual void executeOpenCL(OpenCLDevice * /*device*/,
MemoryBuffer * /*outputMemoryBuffer*/,
@@ -221,8 +221,8 @@ public:
}
/**
- * @brief set the resolution
- * @param resolution the resolution to set
+ * \brief set the resolution
+ * \param resolution the resolution to set
*/
void setResolution(unsigned int resolution[2]) {
if (!isResolutionSet()) {
@@ -236,56 +236,56 @@ public:
void getConnectedInputSockets(Inputs *sockets);
/**
- * @brief is this operation complex
+ * \brief is this operation complex
*
* Complex operations are typically doing many reads to calculate the output of a single pixel.
* Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
*/
- const bool isComplex() const { return this->m_complex; }
+ bool isComplex() const { return this->m_complex; }
virtual bool isSetOperation() const { return false; }
/**
- * @brief is this operation of type ReadBufferOperation
- * @return [true:false]
- * @see ReadBufferOperation
+ * \brief is this operation of type ReadBufferOperation
+ * \return [true:false]
+ * \see ReadBufferOperation
*/
- virtual const bool isReadBufferOperation() const { return false; }
+ virtual bool isReadBufferOperation() const { return false; }
/**
- * @brief is this operation of type WriteBufferOperation
- * @return [true:false]
- * @see WriteBufferOperation
+ * \brief is this operation of type WriteBufferOperation
+ * \return [true:false]
+ * \see WriteBufferOperation
*/
- virtual const bool isWriteBufferOperation() const { return false; }
+ virtual bool isWriteBufferOperation() const { return false; }
/**
- * @brief is this operation the active viewer output
+ * \brief is this operation the active viewer output
* user can select an ViewerNode to be active (the result of this node will be drawn on the backdrop)
- * @return [true:false]
- * @see BaseViewerOperation
+ * \return [true:false]
+ * \see BaseViewerOperation
*/
- virtual const bool isActiveViewerOutput() const { return false; }
+ virtual bool isActiveViewerOutput() const { return false; }
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
/**
- * @brief set the index of the input socket that will determine the resolution of this operation
- * @param index the index to set
+ * \brief set the index of the input socket that will determine the resolution of this operation
+ * \param index the index to set
*/
void setResolutionInputSocketIndex(unsigned int index);
/**
- * @brief get the render priority of this node.
- * @note only applicable for output operations like ViewerOperation
- * @return CompositorPriority
+ * \brief get the render priority of this node.
+ * \note only applicable for output operations like ViewerOperation
+ * \return CompositorPriority
*/
- virtual const CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
+ virtual CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
/**
- * @brief can this NodeOperation be scheduled on an OpenCLDevice
- * @see WorkScheduler.schedule
- * @see ExecutionGroup.addOperation
+ * \brief can this NodeOperation be scheduled on an OpenCLDevice
+ * \see WorkScheduler.schedule
+ * \see ExecutionGroup.addOperation
*/
bool isOpenCL() const { return this->m_openCL; }
@@ -321,7 +321,7 @@ protected:
void unlockMutex();
/**
- * @brief set whether this operation is complex
+ * \brief set whether this operation is complex
*
* Complex operations are typically doing many reads to calculate the output of a single pixel.
* Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
@@ -329,7 +329,7 @@ protected:
void setComplex(bool complex) { this->m_complex = complex; }
/**
- * @brief set if this NodeOperation can be scheduled on a OpenCLDevice
+ * \brief set if this NodeOperation can be scheduled on a OpenCLDevice
*/
void setOpenCL(bool openCL) { this->m_openCL = openCL; }
@@ -347,7 +347,7 @@ private:
NodeOperation *m_operation;
/** Datatype of this socket. Is used for automatically data transformation.
- * @section data-conversion
+ * \section data-conversion
*/
DataType m_datatype;
@@ -385,7 +385,7 @@ private:
NodeOperation *m_operation;
/** Datatype of this socket. Is used for automatically data transformation.
- * @section data-conversion
+ * \section data-conversion
*/
DataType m_datatype;
@@ -396,9 +396,9 @@ public:
DataType getDataType() const { return m_datatype; }
/**
- * @brief determine the resolution of this data going through this socket
- * @param resolution the result of this operation
- * @param preferredResolution the preferable resolution as no resolution could be determined
+ * \brief determine the resolution of this data going through this socket
+ * \param resolution the result of this operation
+ * \param preferredResolution the preferable resolution as no resolution could be determined
*/
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h
index a3a5cd36902..f8dd3750d42 100644
--- a/source/blender/compositor/intern/COM_OpenCLDevice.h
+++ b/source/blender/compositor/intern/COM_OpenCLDevice.h
@@ -33,70 +33,70 @@ class OpenCLDevice;
using std::list;
/**
- * @brief device representing an GPU OpenCL device.
+ * \brief device representing an GPU OpenCL device.
* an instance of this class represents a single cl_device
*/
class OpenCLDevice : public Device {
private:
/**
- * @brief opencl context
+ * \brief opencl context
*/
cl_context m_context;
/**
- * @brief opencl device
+ * \brief opencl device
*/
cl_device_id m_device;
/**
- * @brief opencl program
+ * \brief opencl program
*/
cl_program m_program;
/**
- * @brief opencl command queue
+ * \brief opencl command queue
*/
cl_command_queue m_queue;
/**
- * @brief opencl vendor ID
+ * \brief opencl vendor ID
*/
cl_int m_vendorID;
public:
/**
- * @brief constructor with opencl device
- * @param context
- * @param device
- * @param program
- * @param vendorID
+ * \brief constructor with opencl device
+ * \param context
+ * \param device
+ * \param program
+ * \param vendorID
*/
OpenCLDevice(cl_context context, cl_device_id device, cl_program program, cl_int vendorId);
/**
- * @brief initialize the device
+ * \brief initialize the device
* During initialization the OpenCL cl_command_queue is created
* the command queue is stored in the field queue.
- * @see queue
+ * \see queue
*/
bool initialize();
/**
- * @brief deinitialize the device
+ * \brief deinitialize the device
* During deintiialization the command queue is cleared
*/
void deinitialize();
/**
- * @brief execute a WorkPackage
- * @param work the WorkPackage to execute
+ * \brief execute a WorkPackage
+ * \param work the WorkPackage to execute
*/
void execute(WorkPackage *work);
/**
- * @brief determine an image format
- * @param memorybuffer
+ * \brief determine an image format
+ * \param memorybuffer
*/
static const cl_image_format *determineImageFormat(MemoryBuffer *memoryBuffer);
diff --git a/source/blender/compositor/intern/COM_SocketReader.h b/source/blender/compositor/intern/COM_SocketReader.h
index af6b891e7ab..c8a8e1d3252 100644
--- a/source/blender/compositor/intern/COM_SocketReader.h
+++ b/source/blender/compositor/intern/COM_SocketReader.h
@@ -37,31 +37,31 @@ typedef enum PixelSampler {
class MemoryBuffer;
/**
- * @brief Helper class for reading socket data.
+ * \brief Helper class for reading socket data.
* Only use this class for dispatching (un-ary and n-ary) executions.
- * @ingroup Execution
+ * \ingroup Execution
*/
class SocketReader {
private:
protected:
/**
- * @brief Holds the width of the output of this operation.
+ * \brief Holds the width of the output of this operation.
*/
unsigned int m_width;
/**
- * @brief Holds the height of the output of this operation.
+ * \brief Holds the height of the output of this operation.
*/
unsigned int m_height;
/**
- * @brief calculate a single pixel
- * @note this method is called for non-complex
- * @param result is a float[4] array to store the result
- * @param x the x-coordinate of the pixel to calculate in image space
- * @param y the y-coordinate of the pixel to calculate in image space
- * @param inputBuffers chunks that can be read by their ReadBufferOperation.
+ * \brief calculate a single pixel
+ * \note this method is called for non-complex
+ * \param result is a float[4] array to store the result
+ * \param x the x-coordinate of the pixel to calculate in image space
+ * \param y the y-coordinate of the pixel to calculate in image space
+ * \param inputBuffers chunks that can be read by their ReadBufferOperation.
*/
virtual void executePixelSampled(float /*output*/[4],
float /*x*/,
@@ -69,27 +69,27 @@ protected:
PixelSampler /*sampler*/) { }
/**
- * @brief calculate a single pixel
- * @note this method is called for complex
- * @param result is a float[4] array to store the result
- * @param x the x-coordinate of the pixel to calculate in image space
- * @param y the y-coordinate of the pixel to calculate in image space
- * @param inputBuffers chunks that can be read by their ReadBufferOperation.
- * @param chunkData chunk specific data a during execution time.
+ * \brief calculate a single pixel
+ * \note this method is called for complex
+ * \param result is a float[4] array to store the result
+ * \param x the x-coordinate of the pixel to calculate in image space
+ * \param y the y-coordinate of the pixel to calculate in image space
+ * \param inputBuffers chunks that can be read by their ReadBufferOperation.
+ * \param chunkData chunk specific data a during execution time.
*/
virtual void executePixel(float output[4], int x, int y, void * /*chunkData*/) {
executePixelSampled(output, x, y, COM_PS_NEAREST);
}
/**
- * @brief calculate a single pixel using an EWA filter
- * @note this method is called for complex
- * @param result is a float[4] array to store the result
- * @param x the x-coordinate of the pixel to calculate in image space
- * @param y the y-coordinate of the pixel to calculate in image space
- * @param dx
- * @param dy
- * @param inputBuffers chunks that can be read by their ReadBufferOperation.
+ * \brief calculate a single pixel using an EWA filter
+ * \note this method is called for complex
+ * \param result is a float[4] array to store the result
+ * \param x the x-coordinate of the pixel to calculate in image space
+ * \param y the y-coordinate of the pixel to calculate in image space
+ * \param dx
+ * \param dy
+ * \param inputBuffers chunks that can be read by their ReadBufferOperation.
*/
virtual void executePixelFiltered(float /*output*/[4],
float /*x*/, float /*y*/,
@@ -113,8 +113,8 @@ public:
virtual MemoryBuffer *getInputMemoryBuffer(MemoryBuffer ** /*memoryBuffers*/) { return 0; }
- inline const unsigned int getWidth() const { return this->m_width; }
- inline const unsigned int getHeight() const { return this->m_height; }
+ inline unsigned int getWidth() const { return this->m_width; }
+ inline unsigned int getHeight() const { return this->m_height; }
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("COM:SocketReader")
diff --git a/source/blender/compositor/intern/COM_WorkPackage.h b/source/blender/compositor/intern/COM_WorkPackage.h
index b0a74a1b0ee..72677c4e112 100644
--- a/source/blender/compositor/intern/COM_WorkPackage.h
+++ b/source/blender/compositor/intern/COM_WorkPackage.h
@@ -28,35 +28,35 @@ class ExecutionGroup;
#include "COM_ExecutionGroup.h"
/**
- * @brief contains data about work that can be scheduled
- * @see WorkScheduler
+ * \brief contains data about work that can be scheduled
+ * \see WorkScheduler
*/
class WorkPackage {
private:
/**
- * @brief executionGroup with the operations-setup to be evaluated
+ * \brief executionGroup with the operations-setup to be evaluated
*/
ExecutionGroup *m_executionGroup;
/**
- * @brief number of the chunk to be executed
+ * \brief number of the chunk to be executed
*/
unsigned int m_chunkNumber;
public:
/**
* constructor
- * @param group the ExecutionGroup
- * @param chunkNumber the number of the chunk
+ * \param group the ExecutionGroup
+ * \param chunkNumber the number of the chunk
*/
WorkPackage(ExecutionGroup *group, unsigned int chunkNumber);
/**
- * @brief get the ExecutionGroup
+ * \brief get the ExecutionGroup
*/
ExecutionGroup *getExecutionGroup() const { return this->m_executionGroup; }
/**
- * @brief get the number of the chunk
+ * \brief get the number of the chunk
*/
unsigned int getChunkNumber() const { return this->m_chunkNumber; }
diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp
index 4136983e13c..5be76d84e33 100644
--- a/source/blender/compositor/intern/COM_WorkScheduler.cpp
+++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp
@@ -49,25 +49,25 @@
#endif
-/// @brief list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
+/// \brief list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
static vector<CPUDevice*> g_cpudevices;
static ThreadLocal(CPUDevice *) g_thread_device;
#if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
-/// @brief list of all thread for every CPUDevice in cpudevices a thread exists
+/// \brief list of all thread for every CPUDevice in cpudevices a thread exists
static ListBase g_cputhreads;
static bool g_cpuInitialized = false;
-/// @brief all scheduled work for the cpu
+/// \brief all scheduled work for the cpu
static ThreadQueue *g_cpuqueue;
static ThreadQueue *g_gpuqueue;
#ifdef COM_OPENCL_ENABLED
static cl_context g_context;
static cl_program g_program;
-/// @brief list of all OpenCLDevices. for every OpenCL GPU device an instance of OpenCLDevice is created
+/// \brief list of all OpenCLDevices. for every OpenCL GPU device an instance of OpenCLDevice is created
static vector<OpenCLDevice *> g_gpudevices;
-/// @brief list of all thread for every GPUDevice in cpudevices a thread exists
+/// \brief list of all thread for every GPUDevice in cpudevices a thread exists
static ListBase g_gputhreads;
-/// @brief all scheduled work for the gpu
+/// \brief all scheduled work for the gpu
#ifdef COM_OPENCL_ENABLED
static bool g_openclActive = false;
static bool g_openclInitialized = false;
diff --git a/source/blender/compositor/intern/COM_WorkScheduler.h b/source/blender/compositor/intern/COM_WorkScheduler.h
index a08b3856a8b..a6de517983e 100644
--- a/source/blender/compositor/intern/COM_WorkScheduler.h
+++ b/source/blender/compositor/intern/COM_WorkScheduler.h
@@ -31,43 +31,43 @@ extern "C" {
#include "COM_defines.h"
#include "COM_Device.h"
-/** @brief the workscheduler
- * @ingroup execution
+/** \brief the workscheduler
+ * \ingroup execution
*/
class WorkScheduler {
#if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
/**
- * @brief are we being stopped.
+ * \brief are we being stopped.
*/
static bool isStopping();
/**
- * @brief main thread loop for cpudevices
+ * \brief main thread loop for cpudevices
* inside this loop new work is queried and being executed
*/
static void *thread_execute_cpu(void *data);
/**
- * @brief main thread loop for gpudevices
+ * \brief main thread loop for gpudevices
* inside this loop new work is queried and being executed
*/
static void *thread_execute_gpu(void *data);
#endif
public:
/**
- * @brief schedule a chunk of a group to be calculated.
+ * \brief schedule a chunk of a group to be calculated.
* An execution group schedules a chunk in the WorkScheduler
* when ExecutionGroup.isOpenCL is set the work will be handled by a OpenCLDevice
* otherwise the work is scheduled for an CPUDevice
- * @see ExecutionGroup.execute
- * @param group the execution group
- * @param chunkNumber the number of the chunk in the group to be executed
+ * \see ExecutionGroup.execute
+ * \param group the execution group
+ * \param chunkNumber the number of the chunk in the group to be executed
*/
static void schedule(ExecutionGroup *group, int chunkNumber);
/**
- * @brief initialize the WorkScheduler
+ * \brief initialize the WorkScheduler
*
* during initialization the mutexes are initialized.
* there are two mutexes (for every device type one)
@@ -80,36 +80,36 @@ public:
static void initialize(bool use_opencl, int num_cpu_threads);
/**
- * @brief deinitialize the WorkScheduler
+ * \brief deinitialize the WorkScheduler
* free all allocated resources
*/
static void deinitialize();
/**
- * @brief Start the execution
+ * \brief Start the execution
* this methods will start the WorkScheduler. Inside this method all threads are initialized.
* for every device a thread is created.
- * @see initialize Initialization and query of the number of devices
+ * \see initialize Initialization and query of the number of devices
*/
static void start(CompositorContext &context);
/**
- * @brief stop the execution
+ * \brief stop the execution
* All created thread by the start method are destroyed.
- * @see start
+ * \see start
*/
static void stop();
/**
- * @brief wait for all work to be completed.
+ * \brief wait for all work to be completed.
*/
static void finish();
/**
- * @brief Are there OpenCL capable GPU devices initialized?
+ * \brief Are there OpenCL capable GPU devices initialized?
* the result of this method is stored in the CompositorContext
* A node can generate a different operation tree when OpenCLDevices exists.
- * @see CompositorContext.getHasActiveOpenCLDevices
+ * \see CompositorContext.getHasActiveOpenCLDevices
*/
static bool hasGPUDevices();
diff --git a/source/blender/compositor/nodes/COM_AlphaOverNode.h b/source/blender/compositor/nodes/COM_AlphaOverNode.h
index 0af2ea3310d..04155a9bad7 100644
--- a/source/blender/compositor/nodes/COM_AlphaOverNode.h
+++ b/source/blender/compositor/nodes/COM_AlphaOverNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief AlphaOverNode
- * @ingroup Node
+ * \brief AlphaOverNode
+ * \ingroup Node
*/
class AlphaOverNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_BilateralBlurNode.h b/source/blender/compositor/nodes/COM_BilateralBlurNode.h
index babb558e0d1..928aff65f36 100644
--- a/source/blender/compositor/nodes/COM_BilateralBlurNode.h
+++ b/source/blender/compositor/nodes/COM_BilateralBlurNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief BilateralBlurNode
- * @ingroup Node
+ * \brief BilateralBlurNode
+ * \ingroup Node
*/
class BilateralBlurNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_BlurNode.h b/source/blender/compositor/nodes/COM_BlurNode.h
index 9a5f5ea1efd..703e85c9bcc 100644
--- a/source/blender/compositor/nodes/COM_BlurNode.h
+++ b/source/blender/compositor/nodes/COM_BlurNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief BlurNode
- * @ingroup Node
+ * \brief BlurNode
+ * \ingroup Node
*/
class BlurNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.h b/source/blender/compositor/nodes/COM_BokehBlurNode.h
index 48cd661a7bf..299fe742dd2 100644
--- a/source/blender/compositor/nodes/COM_BokehBlurNode.h
+++ b/source/blender/compositor/nodes/COM_BokehBlurNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief BokehBlurNode
- * @ingroup Node
+ * \brief BokehBlurNode
+ * \ingroup Node
*/
class BokehBlurNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_BokehImageNode.h b/source/blender/compositor/nodes/COM_BokehImageNode.h
index 70f363b8cf6..810602ed5fb 100644
--- a/source/blender/compositor/nodes/COM_BokehImageNode.h
+++ b/source/blender/compositor/nodes/COM_BokehImageNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief BokehImageNode
- * @ingroup Node
+ * \brief BokehImageNode
+ * \ingroup Node
*/
class BokehImageNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_BoxMaskNode.h b/source/blender/compositor/nodes/COM_BoxMaskNode.h
index 01557229be9..f7ce0eed464 100644
--- a/source/blender/compositor/nodes/COM_BoxMaskNode.h
+++ b/source/blender/compositor/nodes/COM_BoxMaskNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief BoxMaskNode
- * @ingroup Node
+ * \brief BoxMaskNode
+ * \ingroup Node
*/
class BoxMaskNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_BrightnessNode.h b/source/blender/compositor/nodes/COM_BrightnessNode.h
index 27155e27774..2625334800e 100644
--- a/source/blender/compositor/nodes/COM_BrightnessNode.h
+++ b/source/blender/compositor/nodes/COM_BrightnessNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief BrightnessNode
- * @ingroup Node
+ * \brief BrightnessNode
+ * \ingroup Node
*/
class BrightnessNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ChannelMatteNode.h b/source/blender/compositor/nodes/COM_ChannelMatteNode.h
index c5f062cb215..84f01c25ef3 100644
--- a/source/blender/compositor/nodes/COM_ChannelMatteNode.h
+++ b/source/blender/compositor/nodes/COM_ChannelMatteNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief ChannelMatteNode
- * @ingroup Node
+ * \brief ChannelMatteNode
+ * \ingroup Node
*/
class ChannelMatteNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ChromaMatteNode.h b/source/blender/compositor/nodes/COM_ChromaMatteNode.h
index 7d0b34ecf5d..48488a9be47 100644
--- a/source/blender/compositor/nodes/COM_ChromaMatteNode.h
+++ b/source/blender/compositor/nodes/COM_ChromaMatteNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief ChromaMatteNode
- * @ingroup Node
+ * \brief ChromaMatteNode
+ * \ingroup Node
*/
class ChromaMatteNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorBalanceNode.h b/source/blender/compositor/nodes/COM_ColorBalanceNode.h
index d203fef20f4..120e745473e 100644
--- a/source/blender/compositor/nodes/COM_ColorBalanceNode.h
+++ b/source/blender/compositor/nodes/COM_ColorBalanceNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ColorBalanceNode
- * @ingroup Node
+ * \brief ColorBalanceNode
+ * \ingroup Node
*/
class ColorBalanceNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorCorrectionNode.h b/source/blender/compositor/nodes/COM_ColorCorrectionNode.h
index fcbd7631cb4..2599983e76c 100644
--- a/source/blender/compositor/nodes/COM_ColorCorrectionNode.h
+++ b/source/blender/compositor/nodes/COM_ColorCorrectionNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ColorCorrectionNode
- * @ingroup Node
+ * \brief ColorCorrectionNode
+ * \ingroup Node
*/
class ColorCorrectionNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorCurveNode.h b/source/blender/compositor/nodes/COM_ColorCurveNode.h
index ad51611d1cf..eb8ff1ae787 100644
--- a/source/blender/compositor/nodes/COM_ColorCurveNode.h
+++ b/source/blender/compositor/nodes/COM_ColorCurveNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ColorCurveNode
- * @ingroup Node
+ * \brief ColorCurveNode
+ * \ingroup Node
*/
class ColorCurveNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorMatteNode.h b/source/blender/compositor/nodes/COM_ColorMatteNode.h
index f2c3c08beea..d2979ab022d 100644
--- a/source/blender/compositor/nodes/COM_ColorMatteNode.h
+++ b/source/blender/compositor/nodes/COM_ColorMatteNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief ColorMatteNode
- * @ingroup Node
+ * \brief ColorMatteNode
+ * \ingroup Node
*/
class ColorMatteNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorNode.h b/source/blender/compositor/nodes/COM_ColorNode.h
index 205f4d07135..139f50e3848 100644
--- a/source/blender/compositor/nodes/COM_ColorNode.h
+++ b/source/blender/compositor/nodes/COM_ColorNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ColorNode
- * @ingroup Node
+ * \brief ColorNode
+ * \ingroup Node
*/
class ColorNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorRampNode.h b/source/blender/compositor/nodes/COM_ColorRampNode.h
index 4332d831e31..6457828753a 100644
--- a/source/blender/compositor/nodes/COM_ColorRampNode.h
+++ b/source/blender/compositor/nodes/COM_ColorRampNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ColorRampNode
- * @ingroup Node
+ * \brief ColorRampNode
+ * \ingroup Node
*/
class ColorRampNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorSpillNode.h b/source/blender/compositor/nodes/COM_ColorSpillNode.h
index cb2cd8a2ea3..a476163224b 100644
--- a/source/blender/compositor/nodes/COM_ColorSpillNode.h
+++ b/source/blender/compositor/nodes/COM_ColorSpillNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ColorSpillNode
- * @ingroup Node
+ * \brief ColorSpillNode
+ * \ingroup Node
*/
class ColorSpillNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ColorToBWNode.h b/source/blender/compositor/nodes/COM_ColorToBWNode.h
index 05f937eb555..b4e8493d69b 100644
--- a/source/blender/compositor/nodes/COM_ColorToBWNode.h
+++ b/source/blender/compositor/nodes/COM_ColorToBWNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief ColorToBWNode
- * @ingroup Node
+ * \brief ColorToBWNode
+ * \ingroup Node
*/
class ColorToBWNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_CompositorNode.h b/source/blender/compositor/nodes/COM_CompositorNode.h
index a21013f2ce2..54c19973134 100644
--- a/source/blender/compositor/nodes/COM_CompositorNode.h
+++ b/source/blender/compositor/nodes/COM_CompositorNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief CompositorNode
- * @ingroup Node
+ * \brief CompositorNode
+ * \ingroup Node
*/
class CompositorNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ConvertAlphaNode.h b/source/blender/compositor/nodes/COM_ConvertAlphaNode.h
index 37482d66269..3da009aec02 100644
--- a/source/blender/compositor/nodes/COM_ConvertAlphaNode.h
+++ b/source/blender/compositor/nodes/COM_ConvertAlphaNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief ConvertAlphaNode
- * @ingroup Node
+ * \brief ConvertAlphaNode
+ * \ingroup Node
*/
class ConvertAlphaNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_CornerPinNode.h b/source/blender/compositor/nodes/COM_CornerPinNode.h
index 63428fa653b..ab89107fe8a 100644
--- a/source/blender/compositor/nodes/COM_CornerPinNode.h
+++ b/source/blender/compositor/nodes/COM_CornerPinNode.h
@@ -29,8 +29,8 @@ extern "C" {
}
/**
- * @brief CornerPinNode
- * @ingroup Node
+ * \brief CornerPinNode
+ * \ingroup Node
*/
class CornerPinNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_CropNode.h b/source/blender/compositor/nodes/COM_CropNode.h
index a7d529c426f..f30acac9fd2 100644
--- a/source/blender/compositor/nodes/COM_CropNode.h
+++ b/source/blender/compositor/nodes/COM_CropNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief CropNode
- * @ingroup Node
+ * \brief CropNode
+ * \ingroup Node
*/
class CropNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.h b/source/blender/compositor/nodes/COM_CryptomatteNode.h
index 2e1784dedb9..f1e446dee20 100644
--- a/source/blender/compositor/nodes/COM_CryptomatteNode.h
+++ b/source/blender/compositor/nodes/COM_CryptomatteNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief CryptomatteNode
- * @ingroup Node
+ * \brief CryptomatteNode
+ * \ingroup Node
*/
class CryptomatteNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_DefocusNode.h b/source/blender/compositor/nodes/COM_DefocusNode.h
index 99efdd15b37..d80384ac01f 100644
--- a/source/blender/compositor/nodes/COM_DefocusNode.h
+++ b/source/blender/compositor/nodes/COM_DefocusNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief DefocusNode
- * @ingroup Node
+ * \brief DefocusNode
+ * \ingroup Node
*/
class DefocusNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.h b/source/blender/compositor/nodes/COM_DespeckleNode.h
index e8097be35dd..7c91ef2d384 100644
--- a/source/blender/compositor/nodes/COM_DespeckleNode.h
+++ b/source/blender/compositor/nodes/COM_DespeckleNode.h
@@ -24,8 +24,8 @@
#include "COM_Node.h"
/**
- * @brief DespeckleNode
- * @ingroup Node
+ * \brief DespeckleNode
+ * \ingroup Node
*/
class DespeckleNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_DifferenceMatteNode.h b/source/blender/compositor/nodes/COM_DifferenceMatteNode.h
index ea3da8d2fca..d2235c8148d 100644
--- a/source/blender/compositor/nodes/COM_DifferenceMatteNode.h
+++ b/source/blender/compositor/nodes/COM_DifferenceMatteNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief DifferenceMatteNode
- * @ingroup Node
+ * \brief DifferenceMatteNode
+ * \ingroup Node
*/
class DifferenceMatteNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.h b/source/blender/compositor/nodes/COM_DilateErodeNode.h
index aff3ecbb4b0..0033fa558fe 100644
--- a/source/blender/compositor/nodes/COM_DilateErodeNode.h
+++ b/source/blender/compositor/nodes/COM_DilateErodeNode.h
@@ -26,11 +26,11 @@
#include "COM_Node.h"
/**
- * @brief DilateErodeNode
- * @ingroup Node
+ * \brief DilateErodeNode
+ * \ingroup Node
*/
class DilateErodeNode : public Node {
- NodeBlurData m_alpha_blur; /* only used for blurring alpha, since the dilate/erode node doesnt have this */
+ NodeBlurData m_alpha_blur; /* only used for blurring alpha, since the dilate/erode node doesn't have this */
public:
DilateErodeNode(bNode *editorNode);
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const;
diff --git a/source/blender/compositor/nodes/COM_DirectionalBlurNode.h b/source/blender/compositor/nodes/COM_DirectionalBlurNode.h
index eef51e140bc..26e5573e586 100644
--- a/source/blender/compositor/nodes/COM_DirectionalBlurNode.h
+++ b/source/blender/compositor/nodes/COM_DirectionalBlurNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief DirectionalBlurNode
- * @ingroup Node
+ * \brief DirectionalBlurNode
+ * \ingroup Node
*/
class DirectionalBlurNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_DisplaceNode.h b/source/blender/compositor/nodes/COM_DisplaceNode.h
index 28105fd5963..58a77527f5b 100644
--- a/source/blender/compositor/nodes/COM_DisplaceNode.h
+++ b/source/blender/compositor/nodes/COM_DisplaceNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief DisplaceNode
- * @ingroup Node
+ * \brief DisplaceNode
+ * \ingroup Node
*/
class DisplaceNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_DistanceMatteNode.h b/source/blender/compositor/nodes/COM_DistanceMatteNode.h
index e7bd3c57dfa..e5976455371 100644
--- a/source/blender/compositor/nodes/COM_DistanceMatteNode.h
+++ b/source/blender/compositor/nodes/COM_DistanceMatteNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief DistanceMatteNode
- * @ingroup Node
+ * \brief DistanceMatteNode
+ * \ingroup Node
*/
class DistanceMatteNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h
index 91a23005128..c01772ea533 100644
--- a/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h
+++ b/source/blender/compositor/nodes/COM_DoubleEdgeMaskNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief DoubleEdgeMaskNode
- * @ingroup Node
+ * \brief DoubleEdgeMaskNode
+ * \ingroup Node
*/
class DoubleEdgeMaskNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_EllipseMaskNode.h b/source/blender/compositor/nodes/COM_EllipseMaskNode.h
index e5e9861b2d9..64f0a319195 100644
--- a/source/blender/compositor/nodes/COM_EllipseMaskNode.h
+++ b/source/blender/compositor/nodes/COM_EllipseMaskNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief EllipseMaskNode
- * @ingroup Node
+ * \brief EllipseMaskNode
+ * \ingroup Node
*/
class EllipseMaskNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_FilterNode.h b/source/blender/compositor/nodes/COM_FilterNode.h
index 0991b256ebb..6b2e0281627 100644
--- a/source/blender/compositor/nodes/COM_FilterNode.h
+++ b/source/blender/compositor/nodes/COM_FilterNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief FilterNode
- * @ingroup Node
+ * \brief FilterNode
+ * \ingroup Node
*/
class FilterNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_FlipNode.cpp b/source/blender/compositor/nodes/COM_FlipNode.cpp
index 2d1b60b784e..98703a22012 100644
--- a/source/blender/compositor/nodes/COM_FlipNode.cpp
+++ b/source/blender/compositor/nodes/COM_FlipNode.cpp
@@ -36,7 +36,7 @@ void FlipNode::convertToOperations(NodeConverter &converter, const CompositorCon
NodeOutput *outputSocket = this->getOutputSocket(0);
FlipOperation *operation = new FlipOperation();
switch (this->getbNode()->custom1) {
- case 0: /// @TODO: I didn't find any constants in the old implementation, should I introduce them.
+ case 0: /// \TODO: I didn't find any constants in the old implementation, should I introduce them.
operation->setFlipX(true);
operation->setFlipY(false);
break;
diff --git a/source/blender/compositor/nodes/COM_FlipNode.h b/source/blender/compositor/nodes/COM_FlipNode.h
index 8c9a78df85d..f13abe3df53 100644
--- a/source/blender/compositor/nodes/COM_FlipNode.h
+++ b/source/blender/compositor/nodes/COM_FlipNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief FlipNode
- * @ingroup Node
+ * \brief FlipNode
+ * \ingroup Node
*/
class FlipNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_GammaNode.h b/source/blender/compositor/nodes/COM_GammaNode.h
index 8b6434b9c6a..97bdeffcaa3 100644
--- a/source/blender/compositor/nodes/COM_GammaNode.h
+++ b/source/blender/compositor/nodes/COM_GammaNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief GammaNode
- * @ingroup Node
+ * \brief GammaNode
+ * \ingroup Node
*/
class GammaNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_GlareNode.h b/source/blender/compositor/nodes/COM_GlareNode.h
index 93f92313835..723e13b7836 100644
--- a/source/blender/compositor/nodes/COM_GlareNode.h
+++ b/source/blender/compositor/nodes/COM_GlareNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief GlareNode
- * @ingroup Node
+ * \brief GlareNode
+ * \ingroup Node
*/
class GlareNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h
index f940a20e0da..d5ff55b6d1f 100644
--- a/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h
+++ b/source/blender/compositor/nodes/COM_HueSaturationValueCorrectNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief HueSaturationValueCorrectNode
- * @ingroup Node
+ * \brief HueSaturationValueCorrectNode
+ * \ingroup Node
*/
class HueSaturationValueCorrectNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_HueSaturationValueNode.h b/source/blender/compositor/nodes/COM_HueSaturationValueNode.h
index f09164de34f..2d1a3346cc3 100644
--- a/source/blender/compositor/nodes/COM_HueSaturationValueNode.h
+++ b/source/blender/compositor/nodes/COM_HueSaturationValueNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief HueSaturationValueNode
- * @ingroup Node
+ * \brief HueSaturationValueNode
+ * \ingroup Node
*/
class HueSaturationValueNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_IDMaskNode.h b/source/blender/compositor/nodes/COM_IDMaskNode.h
index 8a6e55a946e..7fbcbce204f 100644
--- a/source/blender/compositor/nodes/COM_IDMaskNode.h
+++ b/source/blender/compositor/nodes/COM_IDMaskNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief IDMaskNode
- * @ingroup Node
+ * \brief IDMaskNode
+ * \ingroup Node
*/
class IDMaskNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ImageNode.h b/source/blender/compositor/nodes/COM_ImageNode.h
index d8bf3ea3122..11857ed98bf 100644
--- a/source/blender/compositor/nodes/COM_ImageNode.h
+++ b/source/blender/compositor/nodes/COM_ImageNode.h
@@ -30,8 +30,8 @@ extern "C" {
}
/**
- * @brief ImageNode
- * @ingroup Node
+ * \brief ImageNode
+ * \ingroup Node
*/
class ImageNode : public Node {
private:
diff --git a/source/blender/compositor/nodes/COM_InpaintNode.h b/source/blender/compositor/nodes/COM_InpaintNode.h
index dcc563234be..2a57d4f4b50 100644
--- a/source/blender/compositor/nodes/COM_InpaintNode.h
+++ b/source/blender/compositor/nodes/COM_InpaintNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief InpaintNode
- * @ingroup Node
+ * \brief InpaintNode
+ * \ingroup Node
*/
class InpaintNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_InvertNode.h b/source/blender/compositor/nodes/COM_InvertNode.h
index 9ca774e7600..27719dd39db 100644
--- a/source/blender/compositor/nodes/COM_InvertNode.h
+++ b/source/blender/compositor/nodes/COM_InvertNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief InvertNode
- * @ingroup Node
+ * \brief InvertNode
+ * \ingroup Node
*/
class InvertNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_KeyingNode.h b/source/blender/compositor/nodes/COM_KeyingNode.h
index f4a6c02aa56..d712eeb0a8b 100644
--- a/source/blender/compositor/nodes/COM_KeyingNode.h
+++ b/source/blender/compositor/nodes/COM_KeyingNode.h
@@ -24,8 +24,8 @@
#include "COM_Node.h"
/**
- * @brief KeyingNode
- * @ingroup Node
+ * \brief KeyingNode
+ * \ingroup Node
*/
class KeyingNode : public Node {
protected:
diff --git a/source/blender/compositor/nodes/COM_KeyingScreenNode.h b/source/blender/compositor/nodes/COM_KeyingScreenNode.h
index be29b939690..29619a67097 100644
--- a/source/blender/compositor/nodes/COM_KeyingScreenNode.h
+++ b/source/blender/compositor/nodes/COM_KeyingScreenNode.h
@@ -25,8 +25,8 @@
#include "DNA_node_types.h"
/**
- * @brief KeyingScreenNode
- * @ingroup Node
+ * \brief KeyingScreenNode
+ * \ingroup Node
*/
class KeyingScreenNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.h b/source/blender/compositor/nodes/COM_LensDistortionNode.h
index ee0f9f1bc06..40752d3fc9e 100644
--- a/source/blender/compositor/nodes/COM_LensDistortionNode.h
+++ b/source/blender/compositor/nodes/COM_LensDistortionNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief LensDistortionNode
- * @ingroup Node
+ * \brief LensDistortionNode
+ * \ingroup Node
*/
class LensDistortionNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_LuminanceMatteNode.h b/source/blender/compositor/nodes/COM_LuminanceMatteNode.h
index a36e6f2e732..cc57f4a39f1 100644
--- a/source/blender/compositor/nodes/COM_LuminanceMatteNode.h
+++ b/source/blender/compositor/nodes/COM_LuminanceMatteNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief LuminanceMatteNode
- * @ingroup Node
+ * \brief LuminanceMatteNode
+ * \ingroup Node
*/
class LuminanceMatteNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MapRangeNode.h b/source/blender/compositor/nodes/COM_MapRangeNode.h
index 8c2b8d1f807..74bb1e006b3 100644
--- a/source/blender/compositor/nodes/COM_MapRangeNode.h
+++ b/source/blender/compositor/nodes/COM_MapRangeNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief MapRangeNode
- * @ingroup Node
+ * \brief MapRangeNode
+ * \ingroup Node
*/
class MapRangeNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MapUVNode.h b/source/blender/compositor/nodes/COM_MapUVNode.h
index 245a31ce83c..04036df6a24 100644
--- a/source/blender/compositor/nodes/COM_MapUVNode.h
+++ b/source/blender/compositor/nodes/COM_MapUVNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief MapUVNode
- * @ingroup Node
+ * \brief MapUVNode
+ * \ingroup Node
*/
class MapUVNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MapValueNode.h b/source/blender/compositor/nodes/COM_MapValueNode.h
index dca1657ce0b..230e8134f24 100644
--- a/source/blender/compositor/nodes/COM_MapValueNode.h
+++ b/source/blender/compositor/nodes/COM_MapValueNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief MapValueNode
- * @ingroup Node
+ * \brief MapValueNode
+ * \ingroup Node
*/
class MapValueNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MaskNode.cpp b/source/blender/compositor/nodes/COM_MaskNode.cpp
index be05840f601..7e29674f9aa 100644
--- a/source/blender/compositor/nodes/COM_MaskNode.cpp
+++ b/source/blender/compositor/nodes/COM_MaskNode.cpp
@@ -62,7 +62,6 @@ void MaskNode::convertToOperations(NodeConverter &converter, const CompositorCon
operation->setMask(mask);
operation->setFramenumber(context.getFramenumber());
- operation->setSmooth((bool)(editorNode->custom1 & CMP_NODEFLAG_MASK_AA) != 0);
operation->setFeather((bool)(editorNode->custom1 & CMP_NODEFLAG_MASK_NO_FEATHER) == 0);
if ((editorNode->custom1 & CMP_NODEFLAG_MASK_MOTION_BLUR) &&
diff --git a/source/blender/compositor/nodes/COM_MaskNode.h b/source/blender/compositor/nodes/COM_MaskNode.h
index 834c421ac08..55c47c7a7d2 100644
--- a/source/blender/compositor/nodes/COM_MaskNode.h
+++ b/source/blender/compositor/nodes/COM_MaskNode.h
@@ -28,8 +28,8 @@
#include "DNA_node_types.h"
/**
- * @brief MaskNode
- * @ingroup Node
+ * \brief MaskNode
+ * \ingroup Node
*/
class MaskNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MathNode.h b/source/blender/compositor/nodes/COM_MathNode.h
index cf92765f6da..86bb1a3f683 100644
--- a/source/blender/compositor/nodes/COM_MathNode.h
+++ b/source/blender/compositor/nodes/COM_MathNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief MathNode
- * @ingroup Node
+ * \brief MathNode
+ * \ingroup Node
*/
class MathNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MixNode.h b/source/blender/compositor/nodes/COM_MixNode.h
index 10954080a51..d9edc9e570a 100644
--- a/source/blender/compositor/nodes/COM_MixNode.h
+++ b/source/blender/compositor/nodes/COM_MixNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief MixNode
- * @ingroup Node
+ * \brief MixNode
+ * \ingroup Node
*/
class MixNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MovieClipNode.h b/source/blender/compositor/nodes/COM_MovieClipNode.h
index 78fcf24de35..addee1a4ff8 100644
--- a/source/blender/compositor/nodes/COM_MovieClipNode.h
+++ b/source/blender/compositor/nodes/COM_MovieClipNode.h
@@ -27,8 +27,8 @@
#include "DNA_node_types.h"
/**
- * @brief MovieClipNode
- * @ingroup Node
+ * \brief MovieClipNode
+ * \ingroup Node
*/
class MovieClipNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_MovieDistortionNode.h b/source/blender/compositor/nodes/COM_MovieDistortionNode.h
index 97cfaec57c8..59a8980beda 100644
--- a/source/blender/compositor/nodes/COM_MovieDistortionNode.h
+++ b/source/blender/compositor/nodes/COM_MovieDistortionNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief MovieDistortionNode
- * @ingroup Node
+ * \brief MovieDistortionNode
+ * \ingroup Node
*/
class MovieDistortionNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_NormalNode.h b/source/blender/compositor/nodes/COM_NormalNode.h
index 4e1dbe55360..74422007e0e 100644
--- a/source/blender/compositor/nodes/COM_NormalNode.h
+++ b/source/blender/compositor/nodes/COM_NormalNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief NormalNode
- * @ingroup Node
+ * \brief NormalNode
+ * \ingroup Node
*/
class NormalNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_NormalizeNode.h b/source/blender/compositor/nodes/COM_NormalizeNode.h
index 02f413c6ae4..540fbfcfb7b 100644
--- a/source/blender/compositor/nodes/COM_NormalizeNode.h
+++ b/source/blender/compositor/nodes/COM_NormalizeNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief NormalizeNode
- * @ingroup Node
+ * \brief NormalizeNode
+ * \ingroup Node
*/
class NormalizeNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.h b/source/blender/compositor/nodes/COM_OutputFileNode.h
index b246dd2a541..562e8ca5b9f 100644
--- a/source/blender/compositor/nodes/COM_OutputFileNode.h
+++ b/source/blender/compositor/nodes/COM_OutputFileNode.h
@@ -28,8 +28,8 @@
#include "DNA_node_types.h"
/**
- * @brief OutputFileNode
- * @ingroup Node
+ * \brief OutputFileNode
+ * \ingroup Node
*/
class OutputFileNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_PixelateNode.h b/source/blender/compositor/nodes/COM_PixelateNode.h
index b43c15b01da..c31a09a0cbe 100644
--- a/source/blender/compositor/nodes/COM_PixelateNode.h
+++ b/source/blender/compositor/nodes/COM_PixelateNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief PixelateNode
- * @ingroup Node
+ * \brief PixelateNode
+ * \ingroup Node
*/
class PixelateNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h
index 653100ce6a4..4e3445b1581 100644
--- a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h
+++ b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.h
@@ -27,8 +27,8 @@ extern "C" {
}
/**
- * @brief PlaneTrackDeformNode
- * @ingroup Node
+ * \brief PlaneTrackDeformNode
+ * \ingroup Node
*/
class PlaneTrackDeformNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
index 2286db81860..6c0e7099150 100644
--- a/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
+++ b/source/blender/compositor/nodes/COM_RenderLayersNode.cpp
@@ -78,8 +78,8 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter,
const int num_outputs = this->getNumberOfOutputSockets();
for (int i = 0; i < num_outputs; i++) {
NodeOutput *output = this->getOutputSocket(i);
- NodeImageLayer *storage = (NodeImageLayer*) output->getbNodeSocket()->storage;
- RenderPass *rpass = (RenderPass*) BLI_findstring(
+ NodeImageLayer *storage = (NodeImageLayer *)output->getbNodeSocket()->storage;
+ RenderPass *rpass = (RenderPass *)BLI_findstring(
&rl->passes,
storage->pass_name,
offsetof(RenderPass, name));
diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.h b/source/blender/compositor/nodes/COM_RenderLayersNode.h
index edbc91fff70..0ecf4c60c43 100644
--- a/source/blender/compositor/nodes/COM_RenderLayersNode.h
+++ b/source/blender/compositor/nodes/COM_RenderLayersNode.h
@@ -27,8 +27,8 @@
struct Render;
/**
- * @brief RenderLayersNode
- * @ingroup Node
+ * \brief RenderLayersNode
+ * \ingroup Node
*/
class RenderLayersNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_RotateNode.h b/source/blender/compositor/nodes/COM_RotateNode.h
index e3c9710891b..77d3879e530 100644
--- a/source/blender/compositor/nodes/COM_RotateNode.h
+++ b/source/blender/compositor/nodes/COM_RotateNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief RotateNode
- * @ingroup Node
+ * \brief RotateNode
+ * \ingroup Node
*/
class RotateNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ScaleNode.h b/source/blender/compositor/nodes/COM_ScaleNode.h
index b1695aab966..2ae07e5ab9b 100644
--- a/source/blender/compositor/nodes/COM_ScaleNode.h
+++ b/source/blender/compositor/nodes/COM_ScaleNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ScaleNode
- * @ingroup Node
+ * \brief ScaleNode
+ * \ingroup Node
*/
class ScaleNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_SetAlphaNode.h b/source/blender/compositor/nodes/COM_SetAlphaNode.h
index f71d743c1d4..f5482c91f13 100644
--- a/source/blender/compositor/nodes/COM_SetAlphaNode.h
+++ b/source/blender/compositor/nodes/COM_SetAlphaNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief SetAlphaNode
- * @ingroup Node
+ * \brief SetAlphaNode
+ * \ingroup Node
*/
class SetAlphaNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_SocketProxyNode.h b/source/blender/compositor/nodes/COM_SocketProxyNode.h
index ce19a9abd7d..2cf4c4afac5 100644
--- a/source/blender/compositor/nodes/COM_SocketProxyNode.h
+++ b/source/blender/compositor/nodes/COM_SocketProxyNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief SocketProxyNode
- * @ingroup Node
+ * \brief SocketProxyNode
+ * \ingroup Node
*/
class SocketProxyNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_SplitViewerNode.h b/source/blender/compositor/nodes/COM_SplitViewerNode.h
index c073713f21f..695313e5d9c 100644
--- a/source/blender/compositor/nodes/COM_SplitViewerNode.h
+++ b/source/blender/compositor/nodes/COM_SplitViewerNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief SplitViewerNode
- * @ingroup Node
+ * \brief SplitViewerNode
+ * \ingroup Node
*/
class SplitViewerNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_Stabilize2dNode.h b/source/blender/compositor/nodes/COM_Stabilize2dNode.h
index 2859432fac7..4c45b2f6db0 100644
--- a/source/blender/compositor/nodes/COM_Stabilize2dNode.h
+++ b/source/blender/compositor/nodes/COM_Stabilize2dNode.h
@@ -27,8 +27,8 @@
#include "DNA_node_types.h"
/**
- * @brief Stabilize2dNode
- * @ingroup Node
+ * \brief Stabilize2dNode
+ * \ingroup Node
*/
class Stabilize2dNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_SunBeamsNode.h b/source/blender/compositor/nodes/COM_SunBeamsNode.h
index 425b97061ca..bb8c2e5defc 100644
--- a/source/blender/compositor/nodes/COM_SunBeamsNode.h
+++ b/source/blender/compositor/nodes/COM_SunBeamsNode.h
@@ -25,8 +25,8 @@
#include "COM_Node.h"
/**
- * @brief SunBeamsNode
- * @ingroup Node
+ * \brief SunBeamsNode
+ * \ingroup Node
*/
class SunBeamsNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_SwitchNode.h b/source/blender/compositor/nodes/COM_SwitchNode.h
index 5967bbd5dd0..96abef60f21 100644
--- a/source/blender/compositor/nodes/COM_SwitchNode.h
+++ b/source/blender/compositor/nodes/COM_SwitchNode.h
@@ -27,8 +27,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
/**
- * @brief SwitchNode
- * @ingroup Node
+ * \brief SwitchNode
+ * \ingroup Node
*/
class SwitchNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_SwitchViewNode.h b/source/blender/compositor/nodes/COM_SwitchViewNode.h
index f4171940880..9a89103a11e 100644
--- a/source/blender/compositor/nodes/COM_SwitchViewNode.h
+++ b/source/blender/compositor/nodes/COM_SwitchViewNode.h
@@ -26,8 +26,8 @@
#include "COM_NodeOperation.h"
#include "DNA_node_types.h"
/**
- * @brief SwitchViewNode
- * @ingroup Node
+ * \brief SwitchViewNode
+ * \ingroup Node
*/
class SwitchViewNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_TextureNode.h b/source/blender/compositor/nodes/COM_TextureNode.h
index 4809f8a781e..206b1ab102b 100644
--- a/source/blender/compositor/nodes/COM_TextureNode.h
+++ b/source/blender/compositor/nodes/COM_TextureNode.h
@@ -24,8 +24,8 @@
#include "DNA_node_types.h"
/**
- * @brief TextureNode
- * @ingroup Node
+ * \brief TextureNode
+ * \ingroup Node
*/
class TextureNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_TimeNode.h b/source/blender/compositor/nodes/COM_TimeNode.h
index 7ebc6f2cc67..7d5eef7434e 100644
--- a/source/blender/compositor/nodes/COM_TimeNode.h
+++ b/source/blender/compositor/nodes/COM_TimeNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief TimeNode
- * @ingroup Node
+ * \brief TimeNode
+ * \ingroup Node
*/
class TimeNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_TonemapNode.h b/source/blender/compositor/nodes/COM_TonemapNode.h
index 13e51acf3fe..309cd56e580 100644
--- a/source/blender/compositor/nodes/COM_TonemapNode.h
+++ b/source/blender/compositor/nodes/COM_TonemapNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief TonemapNode
- * @ingroup Node
+ * \brief TonemapNode
+ * \ingroup Node
*/
class TonemapNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_TrackPositionNode.h b/source/blender/compositor/nodes/COM_TrackPositionNode.h
index 375e28b6f8f..04c3814605a 100644
--- a/source/blender/compositor/nodes/COM_TrackPositionNode.h
+++ b/source/blender/compositor/nodes/COM_TrackPositionNode.h
@@ -25,8 +25,8 @@
#include "DNA_node_types.h"
/**
- * @brief TrackPositionNode
- * @ingroup Node
+ * \brief TrackPositionNode
+ * \ingroup Node
*/
class TrackPositionNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_TransformNode.h b/source/blender/compositor/nodes/COM_TransformNode.h
index 9a7c415cc5d..ad1935dcf23 100644
--- a/source/blender/compositor/nodes/COM_TransformNode.h
+++ b/source/blender/compositor/nodes/COM_TransformNode.h
@@ -27,8 +27,8 @@
#include "DNA_node_types.h"
/**
- * @brief TransformNode
- * @ingroup Node
+ * \brief TransformNode
+ * \ingroup Node
*/
class TransformNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_TranslateNode.h b/source/blender/compositor/nodes/COM_TranslateNode.h
index 51d969dbb04..535bd11c3b7 100644
--- a/source/blender/compositor/nodes/COM_TranslateNode.h
+++ b/source/blender/compositor/nodes/COM_TranslateNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief TranslateNode
- * @ingroup Node
+ * \brief TranslateNode
+ * \ingroup Node
*/
class TranslateNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ValueNode.h b/source/blender/compositor/nodes/COM_ValueNode.h
index e1b13c2d8aa..b7d80bcf393 100644
--- a/source/blender/compositor/nodes/COM_ValueNode.h
+++ b/source/blender/compositor/nodes/COM_ValueNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ValueNode
- * @ingroup Node
+ * \brief ValueNode
+ * \ingroup Node
*/
class ValueNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_VectorBlurNode.h b/source/blender/compositor/nodes/COM_VectorBlurNode.h
index 5f741ff0852..93249a327fa 100644
--- a/source/blender/compositor/nodes/COM_VectorBlurNode.h
+++ b/source/blender/compositor/nodes/COM_VectorBlurNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief VectorBlurNode
- * @ingroup Node
+ * \brief VectorBlurNode
+ * \ingroup Node
*/
class VectorBlurNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_VectorCurveNode.h b/source/blender/compositor/nodes/COM_VectorCurveNode.h
index d8a2121a7c6..a95d505fa6d 100644
--- a/source/blender/compositor/nodes/COM_VectorCurveNode.h
+++ b/source/blender/compositor/nodes/COM_VectorCurveNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief VectorCurveNode
- * @ingroup Node
+ * \brief VectorCurveNode
+ * \ingroup Node
*/
class VectorCurveNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ViewLevelsNode.h b/source/blender/compositor/nodes/COM_ViewLevelsNode.h
index 7fca060389a..b5b8a386051 100644
--- a/source/blender/compositor/nodes/COM_ViewLevelsNode.h
+++ b/source/blender/compositor/nodes/COM_ViewLevelsNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ViewLevelsNode
- * @ingroup Node
+ * \brief ViewLevelsNode
+ * \ingroup Node
*/
class ViewLevelsNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ViewerNode.h b/source/blender/compositor/nodes/COM_ViewerNode.h
index 67d6387a17c..666bb55b6a5 100644
--- a/source/blender/compositor/nodes/COM_ViewerNode.h
+++ b/source/blender/compositor/nodes/COM_ViewerNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
#include "DNA_node_types.h"
/**
- * @brief ViewerNode
- * @ingroup Node
+ * \brief ViewerNode
+ * \ingroup Node
*/
class ViewerNode : public Node {
public:
diff --git a/source/blender/compositor/nodes/COM_ZCombineNode.h b/source/blender/compositor/nodes/COM_ZCombineNode.h
index 8e166ddf168..ee3558cd58f 100644
--- a/source/blender/compositor/nodes/COM_ZCombineNode.h
+++ b/source/blender/compositor/nodes/COM_ZCombineNode.h
@@ -26,8 +26,8 @@
#include "COM_Node.h"
/**
- * @brief ZCombineNode
- * @ingroup Node
+ * \brief ZCombineNode
+ * \ingroup Node
*/
class ZCombineNode : public Node {
public:
diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.h b/source/blender/compositor/operations/COM_AntiAliasOperation.h
index 34243cd34b6..25781196b1f 100644
--- a/source/blender/compositor/operations/COM_AntiAliasOperation.h
+++ b/source/blender/compositor/operations/COM_AntiAliasOperation.h
@@ -26,14 +26,14 @@
#include "DNA_node_types.h"
/**
- * @brief AntiAlias operations
+ * \brief AntiAlias operations
* it only supports anti aliasing on BW buffers.
- * @ingroup operation
+ * \ingroup operation
*/
class AntiAliasOperation : public NodeOperation {
protected:
/**
- * @brief Cached reference to the reader
+ * \brief Cached reference to the reader
*/
SocketReader *m_valueReader;
public:
diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.h b/source/blender/compositor/operations/COM_BokehImageOperation.h
index c6ca7054352..d26f3f7066c 100644
--- a/source/blender/compositor/operations/COM_BokehImageOperation.h
+++ b/source/blender/compositor/operations/COM_BokehImageOperation.h
@@ -25,7 +25,7 @@
#include "COM_NodeOperation.h"
/**
- * @brief The BokehImageOperation class is an operation that creates an image useful to mimic the internals
+ * \brief The BokehImageOperation class is an operation that creates an image useful to mimic the internals
*of a camera.
*
* features:
@@ -53,91 +53,91 @@
class BokehImageOperation : public NodeOperation {
private:
/**
- * @brief Settings of the bokeh image
+ * \brief Settings of the bokeh image
*/
NodeBokehImage *m_data;
/**
- * @brief precalced center of the image
+ * \brief precalced center of the image
*/
float m_center[2];
/**
- * @brief 1.0-rounding
+ * \brief 1.0-rounding
*/
float m_inverseRounding;
/**
- * @brief distance of a full circle lens
+ * \brief distance of a full circle lens
*/
float m_circularDistance;
/**
- * @brief radius when the first flap starts
+ * \brief radius when the first flap starts
*/
float m_flapRad;
/**
- * @brief radians of a single flap
+ * \brief radians of a single flap
*/
float m_flapRadAdd;
/**
- * @brief should the m_data field by deleted when this operation is finished
+ * \brief should the m_data field by deleted when this operation is finished
*/
bool m_deleteData;
/**
- * @brief determine the coordinate of a flap cornder
+ * \brief determine the coordinate of a flap cornder
*
- * @param r result in bokehimage space are stored [x,y]
- * @param flapNumber the flap number to calculate
- * @param distance the lens distance is used to simulate lens shifts
+ * \param r result in bokehimage space are stored [x,y]
+ * \param flapNumber the flap number to calculate
+ * \param distance the lens distance is used to simulate lens shifts
*/
void detemineStartPointOfFlap(float r[2], int flapNumber, float distance);
/**
- * @brief Determine if a coordinate is inside the bokeh image
+ * \brief Determine if a coordinate is inside the bokeh image
*
- * @param distance the distance that will be used. This parameter is modified a bit to mimic lens shifts
- * @param x the x coordinate of the pixel to evaluate
- * @param y the y coordinate of the pixel to evaluate
- * @return float range 0..1 0 is completely outside
+ * \param distance the distance that will be used. This parameter is modified a bit to mimic lens shifts
+ * \param x the x coordinate of the pixel to evaluate
+ * \param y the y coordinate of the pixel to evaluate
+ * \return float range 0..1 0 is completely outside
*/
float isInsideBokeh(float distance, float x, float y);
public:
BokehImageOperation();
/**
- * @brief the inner loop of this program
+ * \brief the inner loop of this program
*/
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
/**
- * @brief Initialize the execution
+ * \brief Initialize the execution
*/
void initExecution();
/**
- * @brief Deinitialize the execution
+ * \brief Deinitialize the execution
*/
void deinitExecution();
/**
- * @brief determine the resolution of this operation. currently fixed at [COM_BLUR_BOKEH_PIXELS, COM_BLUR_BOKEH_PIXELS]
- * @param resolution
- * @param preferredResolution
+ * \brief determine the resolution of this operation. currently fixed at [COM_BLUR_BOKEH_PIXELS, COM_BLUR_BOKEH_PIXELS]
+ * \param resolution
+ * \param preferredResolution
*/
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
/**
- * @brief set the node data
- * @param data
+ * \brief set the node data
+ * \param data
*/
void setData(NodeBokehImage *data) { this->m_data = data; }
/**
- * @brief deleteDataOnFinish
+ * \brief deleteDataOnFinish
*
* There are cases that the compositor uses this operation on its own (see defocus node)
* the deleteDataOnFinish must only be called when the data has been created by the compositor.
diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.h b/source/blender/compositor/operations/COM_CalculateMeanOperation.h
index 1872cb738b2..265057b6536 100644
--- a/source/blender/compositor/operations/COM_CalculateMeanOperation.h
+++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.h
@@ -26,13 +26,13 @@
#include "DNA_node_types.h"
/**
- * @brief base class of CalculateMean, implementing the simple CalculateMean
- * @ingroup operation
+ * \brief base class of CalculateMean, implementing the simple CalculateMean
+ * \ingroup operation
*/
class CalculateMeanOperation : public NodeOperation {
protected:
/**
- * @brief Cached reference to the reader
+ * \brief Cached reference to the reader
*/
SocketReader *m_imageReader;
diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
index 7089e40b210..2d357f30f7b 100644
--- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
+++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.h
@@ -26,8 +26,8 @@
#include "DNA_node_types.h"
#include "COM_CalculateMeanOperation.h"
/**
- * @brief base class of CalculateStandardDeviation, implementing the simple CalculateStandardDeviation
- * @ingroup operation
+ * \brief base class of CalculateStandardDeviation, implementing the simple CalculateStandardDeviation
+ * \ingroup operation
*/
class CalculateStandardDeviationOperation : public CalculateMeanOperation {
protected:
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index 16e33c908d6..24846f738dd 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -94,6 +94,7 @@ void CompositorOperation::deinitExecution()
MEM_freeN(rv->rectz);
}
rv->rectz = this->m_depthBuffer;
+ rr->have_combined = true;
}
else {
if (this->m_outputBuffer) {
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.h b/source/blender/compositor/operations/COM_CompositorOperation.h
index 19ed3180ace..1a3553d14b4 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.h
+++ b/source/blender/compositor/operations/COM_CompositorOperation.h
@@ -29,63 +29,63 @@
struct Scene;
/**
- * @brief Compositor output operation
+ * \brief Compositor output operation
*/
class CompositorOperation : public NodeOperation {
private:
const struct Scene *m_scene;
/**
- * @brief Scene name, used for getting the render output, includes 'SC' prefix.
+ * \brief Scene name, used for getting the render output, includes 'SC' prefix.
*/
char m_sceneName[MAX_ID_NAME];
/**
- * @brief local reference to the scene
+ * \brief local reference to the scene
*/
const RenderData *m_rd;
/**
- * @brief reference to the output float buffer
+ * \brief reference to the output float buffer
*/
float *m_outputBuffer;
/**
- * @brief reference to the output depth float buffer
+ * \brief reference to the output depth float buffer
*/
float *m_depthBuffer;
/**
- * @brief local reference to the input image operation
+ * \brief local reference to the input image operation
*/
SocketReader *m_imageInput;
/**
- * @brief local reference to the input alpha operation
+ * \brief local reference to the input alpha operation
*/
SocketReader *m_alphaInput;
/**
- * @brief local reference to the depth operation
+ * \brief local reference to the depth operation
*/
SocketReader *m_depthInput;
/**
- * @brief Ignore any alpha input
+ * \brief Ignore any alpha input
*/
bool m_useAlphaInput;
/**
- * @brief operation is active for calculating final compo result
+ * \brief operation is active for calculating final compo result
*/
bool m_active;
/**
- * @brief View name, used for multiview
+ * \brief View name, used for multiview
*/
const char *m_viewName;
public:
CompositorOperation();
- const bool isActiveCompositorOutput() const { return this->m_active; }
+ bool isActiveCompositorOutput() const { return this->m_active; }
void executeRegion(rcti *rect, unsigned int tileNumber);
void setScene(const struct Scene *scene) { m_scene = scene; }
void setSceneName(const char *sceneName) { BLI_strncpy(this->m_sceneName, sceneName, sizeof(this->m_sceneName)); }
@@ -94,7 +94,7 @@ public:
bool isOutputOperation(bool /*rendering*/) const { return this->isActiveCompositorOutput(); }
void initExecution();
void deinitExecution();
- const CompositorPriority getRenderPriority() const { return COM_PRIORITY_MEDIUM; }
+ CompositorPriority getRenderPriority() const { return COM_PRIORITY_MEDIUM; }
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
void setUseAlphaInput(bool value) { this->m_useAlphaInput = value; }
void setActive(bool active) { this->m_active = active; }
diff --git a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
index 3dc7b67df8d..3b7272e86f6 100644
--- a/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
+++ b/source/blender/compositor/operations/COM_ConvertColorProfileOperation.h
@@ -37,17 +37,17 @@ private:
SocketReader *m_inputOperation;
/**
- * @brief color profile where to convert from
+ * \brief color profile where to convert from
*/
int m_fromProfile;
/**
- * @brief color profile where to convert to
+ * \brief color profile where to convert to
*/
int m_toProfile;
/**
- * @brief is color predivided
+ * \brief is color predivided
*/
bool m_predivided;
public:
diff --git a/source/blender/compositor/operations/COM_DotproductOperation.cpp b/source/blender/compositor/operations/COM_DotproductOperation.cpp
index e2e54ee4aa7..a0cde948d25 100644
--- a/source/blender/compositor/operations/COM_DotproductOperation.cpp
+++ b/source/blender/compositor/operations/COM_DotproductOperation.cpp
@@ -43,7 +43,7 @@ void DotproductOperation::deinitExecution()
this->m_input2Operation = NULL;
}
-/** @todo: current implementation is the inverse of a dotproduct. not 'logically' correct
+/** \todo: current implementation is the inverse of a dotproduct. not 'logically' correct
*/
void DotproductOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
index d570424cb69..c3fc632c05d 100644
--- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
@@ -128,7 +128,7 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign
if ((xy < 1) || (xy > 3)) xy = 3;
// XXX The YVV macro defined below explicitly expects sources of at least 3x3 pixels,
- // so just skiping blur along faulty direction if src's def is below that limit!
+ // so just skipping blur along faulty direction if src's def is below that limit!
if (src_width < 3) xy &= ~1;
if (src_height < 3) xy &= ~2;
if (xy < 1) return;
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h
index 985f56e3ef6..50b3d68426c 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.h
@@ -38,17 +38,17 @@ public:
GaussianAlphaXBlurOperation();
/**
- * @brief the inner loop of this program
+ * \brief the inner loop of this program
*/
void executePixel(float output[4], int x, int y, void *data);
/**
- * @brief initialize the execution
+ * \brief initialize the execution
*/
void initExecution();
/**
- * @brief Deinitialize the execution
+ * \brief Deinitialize the execution
*/
void deinitExecution();
diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h
index 3935dcd6568..30672ad5ab2 100644
--- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.h
@@ -43,7 +43,7 @@ public:
void executePixel(float output[4], int x, int y, void *data);
/**
- * @brief initialize the execution
+ * \brief initialize the execution
*/
void initExecution();
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
index 88d8ed44de6..6e7c9adbd9b 100644
--- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.h
@@ -37,7 +37,7 @@ public:
GaussianXBlurOperation();
/**
- * @brief the inner loop of this program
+ * \brief the inner loop of this program
*/
void executePixel(float output[4], int x, int y, void *data);
@@ -47,12 +47,12 @@ public:
list<cl_kernel> *clKernelsToCleanUp);
/**
- * @brief initialize the execution
+ * \brief initialize the execution
*/
void initExecution();
/**
- * @brief Deinitialize the execution
+ * \brief Deinitialize the execution
*/
void deinitExecution();
diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
index 5df77eb28ce..00f9ebcd21f 100644
--- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
+++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.h
@@ -47,7 +47,7 @@ public:
list<cl_kernel> *clKernelsToCleanUp);
/**
- * @brief initialize the execution
+ * \brief initialize the execution
*/
void initExecution();
diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.h b/source/blender/compositor/operations/COM_GlareBaseOperation.h
index 3fa676f4d31..413d495f670 100644
--- a/source/blender/compositor/operations/COM_GlareBaseOperation.h
+++ b/source/blender/compositor/operations/COM_GlareBaseOperation.h
@@ -39,12 +39,12 @@ typedef float fRGB[4];
class GlareBaseOperation : public SingleThreadedOperation {
private:
/**
- * @brief Cached reference to the inputProgram
+ * \brief Cached reference to the inputProgram
*/
SocketReader *m_inputProgram;
/**
- * @brief settings of the glare node.
+ * \brief settings of the glare node.
*/
NodeGlare *m_settings;
public:
diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.h b/source/blender/compositor/operations/COM_GlareThresholdOperation.h
index 9a922a5889c..7934dd20524 100644
--- a/source/blender/compositor/operations/COM_GlareThresholdOperation.h
+++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.h
@@ -28,12 +28,12 @@
class GlareThresholdOperation : public NodeOperation {
private:
/**
- * @brief Cached reference to the inputProgram
+ * \brief Cached reference to the inputProgram
*/
SocketReader *m_inputProgram;
/**
- * @brief settings of the glare node.
+ * \brief settings of the glare node.
*/
NodeGlare *m_settings;
public:
diff --git a/source/blender/compositor/operations/COM_ImageOperation.h b/source/blender/compositor/operations/COM_ImageOperation.h
index 60172eb6413..40928484dbb 100644
--- a/source/blender/compositor/operations/COM_ImageOperation.h
+++ b/source/blender/compositor/operations/COM_ImageOperation.h
@@ -35,7 +35,7 @@ extern "C" {
}
/**
- * @brief Base class for all image operations
+ * \brief Base class for all image operations
*/
class BaseImageOperation : public NodeOperation {
protected:
diff --git a/source/blender/compositor/operations/COM_MapValueOperation.h b/source/blender/compositor/operations/COM_MapValueOperation.h
index 33513c6f39c..c057ffe606a 100644
--- a/source/blender/compositor/operations/COM_MapValueOperation.h
+++ b/source/blender/compositor/operations/COM_MapValueOperation.h
@@ -58,7 +58,7 @@ public:
void deinitExecution();
/**
- * @brief set the TexMapping settings
+ * \brief set the TexMapping settings
*/
void setSettings(TexMapping *settings) { this->m_settings = settings; }
diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp
index caafdfe8f0c..efc9f6edd5b 100644
--- a/source/blender/compositor/operations/COM_MaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_MaskOperation.cpp
@@ -54,7 +54,7 @@ void MaskOperation::initExecution()
BKE_maskrasterize_handle_init(this->m_rasterMaskHandles[0], this->m_mask,
this->m_maskWidth, this->m_maskHeight,
- true, this->m_do_smooth, this->m_do_feather);
+ true, true, this->m_do_feather);
}
else {
/* make a throw away copy of the mask */
@@ -88,7 +88,7 @@ void MaskOperation::initExecution()
BKE_maskrasterize_handle_init(this->m_rasterMaskHandles[i], mask_temp,
this->m_maskWidth, this->m_maskHeight,
- true, this->m_do_smooth, this->m_do_feather);
+ true, true, this->m_do_feather);
frame_iter += frame_step;
}
diff --git a/source/blender/compositor/operations/COM_MaskOperation.h b/source/blender/compositor/operations/COM_MaskOperation.h
index a586a91682e..02c0e61c31e 100644
--- a/source/blender/compositor/operations/COM_MaskOperation.h
+++ b/source/blender/compositor/operations/COM_MaskOperation.h
@@ -48,7 +48,6 @@ protected:
float m_frame_shutter;
int m_frame_number;
- bool m_do_smooth;
bool m_do_feather;
struct MaskRasterHandle *m_rasterMaskHandles[CMP_NODE_MASK_MBLUR_SAMPLES_MAX];
@@ -80,7 +79,6 @@ public:
this->m_mask_px_ofs[1] = this->m_maskHeightInv * 0.5f;
}
void setFramenumber(int frame_number) { this->m_frame_number = frame_number; }
- void setSmooth(bool smooth) { this->m_do_smooth = smooth; }
void setFeather(bool feather) { this->m_do_feather = feather; }
void setMotionBlurSamples(int samples) { this->m_rasterMaskHandleTot = min(max(1, samples), CMP_NODE_MASK_MBLUR_SAMPLES_MAX); }
diff --git a/source/blender/compositor/operations/COM_NormalizeOperation.h b/source/blender/compositor/operations/COM_NormalizeOperation.h
index de1a23926f4..cebfad5dd17 100644
--- a/source/blender/compositor/operations/COM_NormalizeOperation.h
+++ b/source/blender/compositor/operations/COM_NormalizeOperation.h
@@ -25,18 +25,18 @@
#include "DNA_node_types.h"
/**
- * @brief base class of normalize, implementing the simple normalize
- * @ingroup operation
+ * \brief base class of normalize, implementing the simple normalize
+ * \ingroup operation
*/
class NormalizeOperation : public NodeOperation {
protected:
/**
- * @brief Cached reference to the reader
+ * \brief Cached reference to the reader
*/
SocketReader *m_imageReader;
/**
- * @brief temporarily cache of the execution storage
+ * \brief temporarily cache of the execution storage
* it stores x->min and y->mult
*/
NodeTwoFloats *m_cachedInstance;
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.h b/source/blender/compositor/operations/COM_OutputFileOperation.h
index cc800ca222a..d230eefdd78 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.h
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.h
@@ -57,7 +57,7 @@ public:
bool isOutputOperation(bool /*rendering*/) const { return true; }
void initExecution();
void deinitExecution();
- const CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
+ CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
bool isFileOutputOperation() const { return true; }
};
@@ -99,7 +99,7 @@ public:
bool isOutputOperation(bool /*rendering*/) const { return true; }
void initExecution();
void deinitExecution();
- const CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
+ CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
bool isFileOutputOperation() const { return true; }
};
diff --git a/source/blender/compositor/operations/COM_PixelateOperation.h b/source/blender/compositor/operations/COM_PixelateOperation.h
index 5b08cb429f4..59337f11b54 100644
--- a/source/blender/compositor/operations/COM_PixelateOperation.h
+++ b/source/blender/compositor/operations/COM_PixelateOperation.h
@@ -26,7 +26,7 @@
#include "COM_NodeOperation.h"
/**
- * @brief Pixelate operation
+ * \brief Pixelate operation
*
* The Tile compositor is by default sub-pixel accurate.
* For some setups you don want this.
@@ -35,32 +35,32 @@
class PixelateOperation : public NodeOperation {
private:
/**
- * @brief cached reference to the input operation
+ * \brief cached reference to the input operation
*/
SocketReader *m_inputOperation;
public:
/**
- * @brief PixelateOperation
- * @param dataType the datatype to create this operator for (saves datatype conversions)
+ * \brief PixelateOperation
+ * \param dataType the datatype to create this operator for (saves datatype conversions)
*/
PixelateOperation(DataType dataType);
/**
- * @brief initialization of the execution
+ * \brief initialization of the execution
*/
void initExecution();
/**
- * @brief de-initialization of the execution
+ * \brief de-initialization of the execution
*/
void deinitExecution();
/**
- * @brief executePixel
- * @param output result
- * @param x x-coordinate
- * @param y y-coordinate
- * @param sampler sampler
+ * \brief executePixel
+ * \param output result
+ * \param x x-coordinate
+ * \param y y-coordinate
+ * \param sampler sampler
*/
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
};
diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cpp b/source/blender/compositor/operations/COM_PreviewOperation.cpp
index 90e1bba3cd9..91f3dc4e643 100644
--- a/source/blender/compositor/operations/COM_PreviewOperation.cpp
+++ b/source/blender/compositor/operations/COM_PreviewOperation.cpp
@@ -142,7 +142,7 @@ void PreviewOperation::determineResolution(unsigned int resolution[2], unsigned
resolution[1] = height;
}
-const CompositorPriority PreviewOperation::getRenderPriority() const
+CompositorPriority PreviewOperation::getRenderPriority() const
{
return COM_PRIORITY_LOW;
}
diff --git a/source/blender/compositor/operations/COM_PreviewOperation.h b/source/blender/compositor/operations/COM_PreviewOperation.h
index 75317748897..350ecd5e314 100644
--- a/source/blender/compositor/operations/COM_PreviewOperation.h
+++ b/source/blender/compositor/operations/COM_PreviewOperation.h
@@ -33,7 +33,7 @@ protected:
unsigned char *m_outputBuffer;
/**
- * @brief holds reference to the SDNA bNode, where this nodes will render the preview image for
+ * \brief holds reference to the SDNA bNode, where this nodes will render the preview image for
*/
bNodePreview *m_preview;
SocketReader *m_input;
@@ -48,7 +48,7 @@ public:
bool isOutputOperation(bool /*rendering*/) const { return !G.background; }
void initExecution();
void deinitExecution();
- const CompositorPriority getRenderPriority() const;
+ CompositorPriority getRenderPriority() const;
void executeRegion(rcti *rect, unsigned int tileNumber);
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp
index 6e7a32ba5a9..277b3606ff9 100644
--- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp
+++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp
@@ -44,7 +44,7 @@ void ReadBufferOperation::determineResolution(unsigned int resolution[2], unsign
operation->determineResolution(resolution, preferredResolution);
operation->setResolution(resolution);
- /// @todo: may not occur!, but does with blur node
+ /// \todo: may not occur!, but does with blur node
if (this->m_memoryProxy->getExecutor()) {
this->m_memoryProxy->getExecutor()->setResolution(resolution);
}
diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h
index c73acbaf300..4aa6eb7d492 100644
--- a/source/blender/compositor/operations/COM_ReadBufferOperation.h
+++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h
@@ -44,7 +44,7 @@ public:
void executePixelExtend(float output[4], float x, float y, PixelSampler sampler,
MemoryBufferExtend extend_x, MemoryBufferExtend extend_y);
void executePixelFiltered(float output[4], float x, float y, float dx[2], float dy[2]);
- const bool isReadBufferOperation() const { return true; }
+ bool isReadBufferOperation() const { return true; }
void setOffset(unsigned int offset) { this->m_offset = offset; }
unsigned int getOffset() const { return this->m_offset; }
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.h b/source/blender/compositor/operations/COM_RenderLayersProg.h
index 2a0f7efc9f8..b5946d44f74 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.h
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.h
@@ -36,7 +36,7 @@ extern "C" {
/**
* Base class for all renderlayeroperations
*
- * @todo: rename to operation.
+ * \todo: rename to operation.
*/
class RenderLayersProg : public NodeOperation {
protected:
@@ -68,7 +68,7 @@ protected:
int m_elementsize;
/**
- * @brief render data used for active rendering
+ * \brief render data used for active rendering
*/
const RenderData *m_rd;
@@ -90,7 +90,7 @@ public:
RenderLayersProg(const char *passName, DataType type, int elementsize);
/**
* setter for the scene field. Will be called from
- * @see RenderLayerNode to set the actual scene where
+ * \see RenderLayerNode to set the actual scene where
* the data will be retrieved from.
*/
void setScene(Scene *scene) { this->m_scene = scene; }
diff --git a/source/blender/compositor/operations/COM_ScaleOperation.cpp b/source/blender/compositor/operations/COM_ScaleOperation.cpp
index b498b359144..ff6b2438e9b 100644
--- a/source/blender/compositor/operations/COM_ScaleOperation.cpp
+++ b/source/blender/compositor/operations/COM_ScaleOperation.cpp
@@ -201,7 +201,7 @@ bool ScaleAbsoluteOperation::determineDependingAreaOfInterest(rcti *input, ReadB
}
-// Absolute fixed siez
+// Absolute fixed size
ScaleFixedSizeOperation::ScaleFixedSizeOperation() : BaseScaleOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
diff --git a/source/blender/compositor/operations/COM_SetColorOperation.h b/source/blender/compositor/operations/COM_SetColorOperation.h
index 9a509f6fb0c..a3bd2e30749 100644
--- a/source/blender/compositor/operations/COM_SetColorOperation.h
+++ b/source/blender/compositor/operations/COM_SetColorOperation.h
@@ -39,13 +39,13 @@ public:
*/
SetColorOperation();
- const float getChannel1() { return this->m_color[0]; }
+ float getChannel1() { return this->m_color[0]; }
void setChannel1(float value) { this->m_color[0] = value; }
- const float getChannel2() { return this->m_color[1]; }
+ float getChannel2() { return this->m_color[1]; }
void setChannel2(float value) { this->m_color[1] = value; }
- const float getChannel3() { return this->m_color[2]; }
+ float getChannel3() { return this->m_color[2]; }
void setChannel3(float value) { this->m_color[2] = value; }
- const float getChannel4() { return this->m_color[3]; }
+ float getChannel4() { return this->m_color[3]; }
void setChannel4(const float value) { this->m_color[3] = value; }
void setChannels(const float value[4])
{
diff --git a/source/blender/compositor/operations/COM_SetValueOperation.h b/source/blender/compositor/operations/COM_SetValueOperation.h
index 4e274816f27..0dc7a4cd139 100644
--- a/source/blender/compositor/operations/COM_SetValueOperation.h
+++ b/source/blender/compositor/operations/COM_SetValueOperation.h
@@ -39,7 +39,7 @@ public:
*/
SetValueOperation();
- const float getValue() { return this->m_value; }
+ float getValue() { return this->m_value; }
void setValue(float value) { this->m_value = value; }
diff --git a/source/blender/compositor/operations/COM_SetVectorOperation.h b/source/blender/compositor/operations/COM_SetVectorOperation.h
index ca35784ff9a..98f5d918ec2 100644
--- a/source/blender/compositor/operations/COM_SetVectorOperation.h
+++ b/source/blender/compositor/operations/COM_SetVectorOperation.h
@@ -42,13 +42,13 @@ public:
*/
SetVectorOperation();
- const float getX() { return this->m_x; }
+ float getX() { return this->m_x; }
void setX(float value) { this->m_x = value; }
- const float getY() { return this->m_y; }
+ float getY() { return this->m_y; }
void setY(float value) { this->m_y = value; }
- const float getZ() { return this->m_z; }
+ float getZ() { return this->m_z; }
void setZ(float value) { this->m_z = value; }
- const float getW() { return this->m_w; }
+ float getW() { return this->m_w; }
void setW(float value) { this->m_w = value; }
/**
diff --git a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
index 40f2ee226ae..fc3dc6acca0 100644
--- a/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
+++ b/source/blender/compositor/operations/COM_SunBeamsOperation.cpp
@@ -141,7 +141,7 @@ struct BufferLineAccumulator {
/**
* Perform the actual accumulation along a ray segment from source to pt.
- * Only pixels withing dist_min..dist_max contribute.
+ * Only pixels within dist_min..dist_max contribute.
*
* The loop runs backwards(!) over the primary sector space axis u, i.e. increasing distance to pt.
* After each step it decrements v by dv < 1, adding a buffer shift when necessary.
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index 9f0f539800d..434f590a65d 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -37,7 +37,7 @@ extern "C" {
/**
* Base class for all renderlayeroperations
*
- * @todo: rename to operation.
+ * \todo: rename to operation.
*/
class TextureBaseOperation : public NodeOperation {
private:
diff --git a/source/blender/compositor/operations/COM_TonemapOperation.h b/source/blender/compositor/operations/COM_TonemapOperation.h
index 2b07ded7305..c205785b023 100644
--- a/source/blender/compositor/operations/COM_TonemapOperation.h
+++ b/source/blender/compositor/operations/COM_TonemapOperation.h
@@ -26,8 +26,8 @@
#include "DNA_node_types.h"
/**
- * @brief temporarily storage during execution of Tonemap
- * @ingroup operation
+ * \brief temporarily storage during execution of Tonemap
+ * \ingroup operation
*/
typedef struct AvgLogLum {
float al;
@@ -38,23 +38,23 @@ typedef struct AvgLogLum {
} AvgLogLum;
/**
- * @brief base class of tonemap, implementing the simple tonemap
- * @ingroup operation
+ * \brief base class of tonemap, implementing the simple tonemap
+ * \ingroup operation
*/
class TonemapOperation : public NodeOperation {
protected:
/**
- * @brief Cached reference to the reader
+ * \brief Cached reference to the reader
*/
SocketReader *m_imageReader;
/**
- * @brief settings of the Tonemap
+ * \brief settings of the Tonemap
*/
NodeTonemap *m_data;
/**
- * @brief temporarily cache of the execution storage
+ * \brief temporarily cache of the execution storage
*/
AvgLogLum *m_cachedInstance;
@@ -85,9 +85,9 @@ public:
};
/**
- * @brief class of tonemap, implementing the photoreceptor tonemap
+ * \brief class of tonemap, implementing the photoreceptor tonemap
* most parts have already been done in TonemapOperation
- * @ingroup operation
+ * \ingroup operation
*/
class PhotoreceptorTonemapOperation : public TonemapOperation {
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
index a252af053cc..b40051440af 100644
--- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
@@ -288,7 +288,7 @@ void InverseSearchRadiusOperation::initExecution()
void *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
{
- MemoryBuffer * data = new MemoryBuffer(COM_DT_COLOR, rect);
+ MemoryBuffer *data = new MemoryBuffer(COM_DT_COLOR, rect);
float *buffer = data->getBuffer();
int x, y;
int width = this->m_inputRadius->getWidth();
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
index d14d745d049..76550bf4119 100644
--- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
@@ -761,7 +761,7 @@ void zbuf_accumulate_vecblur(
}
/* blend with a falloff. this fixes the ugly effect you get with
- * a fast moving object. then it looks like a solid object overlayed
+ * a fast moving object. then it looks like a solid object overlaid
* over a very transparent moving version of itself. in reality, the
* whole object should become transparent if it is moving fast, be
* we don't know what is behind it so we don't do that. this hack
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.h b/source/blender/compositor/operations/COM_VectorBlurOperation.h
index a33761166c6..fe8e9f20edb 100644
--- a/source/blender/compositor/operations/COM_VectorBlurOperation.h
+++ b/source/blender/compositor/operations/COM_VectorBlurOperation.h
@@ -29,14 +29,14 @@
class VectorBlurOperation : public NodeOperation, public QualityStepHelper {
private:
/**
- * @brief Cached reference to the inputProgram
+ * \brief Cached reference to the inputProgram
*/
SocketReader *m_inputImageProgram;
SocketReader *m_inputSpeedProgram;
SocketReader *m_inputZProgram;
/**
- * @brief settings of the glare node.
+ * \brief settings of the glare node.
*/
NodeBlurData *m_settings;
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp
index 51fd5d4dc76..25167eeab9f 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.cpp
+++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp
@@ -188,7 +188,7 @@ void ViewerOperation::updateImage(rcti *rect)
this->updateDraw();
}
-const CompositorPriority ViewerOperation::getRenderPriority() const
+CompositorPriority ViewerOperation::getRenderPriority() const
{
if (this->isActiveViewerOutput()) {
return COM_PRIORITY_HIGH;
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.h b/source/blender/compositor/operations/COM_ViewerOperation.h
index 43e305fb291..1eb3a1ad602 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.h
+++ b/source/blender/compositor/operations/COM_ViewerOperation.h
@@ -58,7 +58,7 @@ public:
bool isOutputOperation(bool /*rendering*/) const { if (G.background) return false; return isActiveViewerOutput(); }
void setImage(Image *image) { this->m_image = image; }
void setImageUser(ImageUser *imageUser) { this->m_imageUser = imageUser; }
- const bool isActiveViewerOutput() const { return this->m_active; }
+ bool isActiveViewerOutput() const { return this->m_active; }
void setActive(bool active) { this->m_active = active; }
void setCenterX(float centerX) { this->m_centerX = centerX;}
void setCenterY(float centerY) { this->m_centerY = centerY;}
@@ -66,7 +66,7 @@ public:
float getCenterX() const { return this->m_centerX; }
float getCenterY() const { return this->m_centerY; }
OrderOfChunks getChunkOrder() const { return this->m_chunkOrder; }
- const CompositorPriority getRenderPriority() const;
+ CompositorPriority getRenderPriority() const;
bool isViewerOperation() const { return true; }
void setUseAlphaInput(bool value) { this->m_useAlphaInput = value; }
void setRenderData(const RenderData *rd) { this->m_rd = rd; }
diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.h b/source/blender/compositor/operations/COM_WriteBufferOperation.h
index 583d58e7b99..79e228c63fb 100644
--- a/source/blender/compositor/operations/COM_WriteBufferOperation.h
+++ b/source/blender/compositor/operations/COM_WriteBufferOperation.h
@@ -27,8 +27,8 @@
#include "COM_MemoryProxy.h"
#include "COM_SocketReader.h"
/**
- * @brief NodeOperation to write to a tile
- * @ingroup Operation
+ * \brief NodeOperation to write to a tile
+ * \ingroup Operation
*/
class WriteBufferOperation : public NodeOperation {
MemoryProxy *m_memoryProxy;
@@ -39,7 +39,7 @@ public:
~WriteBufferOperation();
MemoryProxy *getMemoryProxy() { return this->m_memoryProxy; }
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler);
- const bool isWriteBufferOperation() const { return true; }
+ bool isWriteBufferOperation() const { return true; }
bool isSingleValue() const { return m_single_value; }
void executeRegion(rcti *rect, unsigned int tileNumber);
diff --git a/source/blender/datatoc/datatoc_icon_split.py b/source/blender/datatoc/datatoc_icon_split.py
index e7cc3a71446..399d7df4d8d 100755
--- a/source/blender/datatoc/datatoc_icon_split.py
+++ b/source/blender/datatoc/datatoc_icon_split.py
@@ -130,7 +130,7 @@ def dice_icon_name(
import re
# Search for eg: DEF_ICON(BRUSH_NUDGE) --> BRUSH_NUDGE
- re_icon = re.compile('^\s*DEF_ICON\(\s*([A-Za-z0-9_]+)\s*\).*$')
+ re_icon = re.compile(r'^\s*DEF_ICON\(\s*([A-Za-z0-9_]+)\s*\).*$')
ui_icons_h = os.path.join(SOURCE_DIR, "source", "blender", "editors", "include", "UI_icons.h")
with open(ui_icons_h, 'r', encoding="utf-8") as f:
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_map.cc b/source/blender/depsgraph/intern/builder/deg_builder_map.cc
index bf29156c3fe..2d9719b3ad4 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_map.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_map.cc
@@ -37,20 +37,23 @@
namespace DEG {
-BuilderMap::BuilderMap() {
+BuilderMap::BuilderMap()
+{
set = BLI_gset_ptr_new("deg builder gset");
}
-
-BuilderMap::~BuilderMap() {
+BuilderMap::~BuilderMap()
+{
BLI_gset_free(set, NULL);
}
-bool BuilderMap::checkIsBuilt(ID *id) {
+bool BuilderMap::checkIsBuilt(ID *id)
+{
return BLI_gset_haskey(set, id);
}
-void BuilderMap::tagBuild(ID *id) {
+void BuilderMap::tagBuild(ID *id)
+{
BLI_gset_insert(set, id);
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index e8adabb2668..a3eac1120db 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -804,11 +804,11 @@ void DepsgraphRelationBuilder::build_constraints(ID *id,
/* Standard object relation. */
// TODO: loc vs rot vs scale?
if (&ct->tar->id == id) {
- /* Constraint targetting own object:
+ /* Constraint targeting own object:
* - This case is fine IFF we're dealing with a bone
* constraint pointing to its own armature. In that
* case, it's just transform -> bone.
- * - If however it is a real self targetting case, just
+ * - If however it is a real self targeting case, just
* make it depend on the previous constraint (or the
* pre-constraint state).
*/
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index 4a8e91f18db..35e17cd0dc1 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -290,7 +290,7 @@ protected:
/* TODO(sergey): All those is_same* functions are to be generalized. */
- /* Check whether two keys correponds to the same bone from same armature.
+ /* Check whether two keys corresponds to the same bone from same armature.
*
* This is used by drivers relations builder to avoid possible fake
* dependency cycle when one bone property drives another property of the
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index 241c3fb9ac3..681af26637c 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -142,7 +142,7 @@ static bool pointer_to_component_node_criteria(
else if (ptr->type == &RNA_Bone) {
Bone *bone = (Bone *)ptr->data;
/* armature-level bone, but it ends up going to bone component anyway */
- // NOTE: the ID in thise case will end up being bArmature.
+ // NOTE: the ID in this case will end up being bArmature.
*type = DEG_NODE_TYPE_BONE;
*subdata = bone->name;
return true;
diff --git a/source/blender/depsgraph/intern/depsgraph_types.h b/source/blender/depsgraph/intern/depsgraph_types.h
index 0e48be6b1e2..0478d97cf6b 100644
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@ -198,7 +198,7 @@ typedef enum eDepsOperation_Code {
* - "READY" This (internal, noop is used to signal that all pre-IK
* operations are done. Its role is to help mediate situations
* where cyclic relations may otherwise form (i.e. one bone in
- * chain targetting another in same chain,
+ * chain targeting another in same chain,
*
* - "DONE" This noop is used to signal that the bone's final pose
* transform can be read by others
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 1ea4c7ead77..5515aa075b9 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -1094,7 +1094,7 @@ static bool acf_nla_controls_setting_valid(bAnimContext *UNUSED(ac), bAnimListEl
case ACHANNEL_SETTING_EXPAND:
return true;
- // TOOD: selected?
+ // TODO: selected?
default: /* unsupported */
return false;
@@ -3022,7 +3022,7 @@ static int acf_gpl_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings
case ACHANNEL_SETTING_MUTE: /* animation muting - similar to frame lock... */
return GP_LAYER_FRAMELOCK;
- case ACHANNEL_SETTING_VISIBLE: /* visiblity of the layers (NOT muting) */
+ case ACHANNEL_SETTING_VISIBLE: /* visibility of the layers (NOT muting) */
*neg = true;
return GP_LAYER_HIDE;
@@ -4009,7 +4009,7 @@ static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void
bAnimContext ac;
ListBase anim_data = {NULL, NULL};
int filter;
- int setting = GET_INT_FROM_POINTER(setting_wrap);
+ int setting = POINTER_AS_INT(setting_wrap);
short on = 0;
/* send notifiers before doing anything else... */
@@ -4339,7 +4339,7 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, const bAni
case ACHANNEL_SETTING_PINNED: /* NLA Actions - 'map/nomap' */
case ACHANNEL_SETTING_MOD_OFF:
case ACHANNEL_SETTING_ALWAYS_VISIBLE:
- UI_but_funcN_set(but, achannel_setting_flush_widget_cb, MEM_dupallocN(ale), SET_INT_IN_POINTER(setting));
+ UI_but_funcN_set(but, achannel_setting_flush_widget_cb, MEM_dupallocN(ale), POINTER_FROM_INT(setting));
break;
/* settings needing special attention */
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 75557e60e21..8149326750e 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -2808,7 +2808,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
agrp->flag ^= AGRP_SELECTED;
}
else if (selectmode == -1) {
- /* select all in group (and deselect everthing else) */
+ /* select all in group (and deselect everything else) */
FCurve *fcu;
/* deselect all other channels */
@@ -3184,7 +3184,7 @@ void ED_operatortypes_animchannels(void)
// TODO: check on a poll callback for this, to get hotkeys into menus
void ED_keymap_animchannels(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation Channels", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Animation Channels", 0, 0);
wmKeyMapItem *kmi;
/* click-select */
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 4659fc2ca18..12b53ecbf24 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1501,7 +1501,7 @@ static size_t animfilter_nla_controls(ListBase *anim_data, bDopeSheet *ads, Anim
items += tmp_items;
}
- /* return the numebr of items added to the list */
+ /* return the number of items added to the list */
return items;
}
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 88166ac65c8..05682292485 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -588,7 +588,7 @@ static int ed_markers_opwrap_invoke(bContext *C, wmOperator *op, const wmEvent *
/* ************************** add markers *************************** */
-/* add TimeMarker at curent frame */
+/* add TimeMarker at current frame */
static int ed_marker_add_exec(bContext *C, wmOperator *UNUSED(op))
{
ListBase *markers = ED_context_get_markers(C);
@@ -816,7 +816,7 @@ static int ed_marker_move_invoke_wrapper(bContext *C, wmOperator *op, const wmEv
return ed_markers_opwrap_invoke_custom(C, op, event, ed_marker_move_invoke);
}
-/* note, init has to be called succesfully */
+/* note, init has to be called successfully */
static void ed_marker_move_apply(bContext *C, wmOperator *op)
{
#ifdef DURIAN_CAMERA_SWITCH
@@ -1581,7 +1581,7 @@ void ED_operatortypes_marker(void)
/* called in screen_ops.c:ED_keymap_screen() */
void ED_keymap_marker(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Markers", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Markers", 0, 0);
wmKeyMapItem *kmi;
WM_keymap_verify_item(keymap, "MARKER_OT_add", MKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 939d547dc94..ce991f64d5d 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -422,7 +422,7 @@ void ED_operatortypes_anim(void)
void ED_keymap_anim(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Animation", 0, 0);
wmKeyMapItem *kmi;
/* frame management */
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 3e4e3a551fe..66d636e6008 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -285,8 +285,8 @@ static int add_driver_with_target(
}
/* Main Driver Management API calls:
- * Add a new driver for the specified property on the given ID block,
- * and make it be driven by the specified target.
+ * Add a new driver for the specified property on the given ID block,
+ * and make it be driven by the specified target.
*
* This is intended to be used in conjunction with a modal "eyedropper"
* for picking the variable that is going to be used to drive this one.
@@ -368,7 +368,7 @@ int ANIM_add_driver_with_target(
/* --------------------------------- */
/* Main Driver Management API calls:
- * Add a new driver for the specified property on the given ID block
+ * Add a new driver for the specified property on the given ID block
*/
int ANIM_add_driver(ReportList *reports, ID *id, const char rna_path[], int array_index, short flag, int type)
{
@@ -464,7 +464,7 @@ int ANIM_add_driver(ReportList *reports, ID *id, const char rna_path[], int arra
}
/* Main Driver Management API calls:
- * Remove the driver for the specified property on the given ID block (if available)
+ * Remove the driver for the specified property on the given ID block (if available)
*/
bool ANIM_remove_driver(ReportList *UNUSED(reports), ID *id, const char rna_path[], int array_index, short UNUSED(flag))
{
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 951dcc2dddf..f1d8f9a1ebf 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -387,7 +387,7 @@ static void fmod_envelope_deletepoint_cb(bContext *UNUSED(C), void *fcm_dv, void
{
FMod_Envelope *env = (FMod_Envelope *)fcm_dv;
FCM_EnvelopeData *fedn;
- int index = GET_INT_FROM_POINTER(ind_v);
+ int index = POINTER_AS_INT(ind_v);
/* check that no data exists for the current frame... */
if (env->totvert > 1) {
@@ -465,7 +465,7 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
but = uiDefIconBut(block, UI_BTYPE_BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 0.9 * UI_UNIT_X, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete envelope control point"));
- UI_but_func_set(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i));
+ UI_but_func_set(but, fmod_envelope_deletepoint_cb, env, POINTER_FROM_INT(i));
UI_block_align_begin(block);
}
}
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 1bbfa6cc979..d3b8e1e3d5b 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -107,7 +107,7 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEdi
ked->curflags = 0;
}
- /* Only operate on this BezTriple if it fullfills the criteria of the validation func */
+ /* Only operate on this BezTriple if it fulfills the criteria of the validation func */
if ((ok = key_ok(ked, bezt))) {
if (ked) ked->curflags = ok;
@@ -761,7 +761,7 @@ static short snap_bezier_nearest(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
return 0;
}
-/* snaps the keyframe to the neares second */
+/* snaps the keyframe to the nearest second */
static short snap_bezier_nearestsec(KeyframeEditData *ked, BezTriple *bezt)
{
const Scene *scene = ked->scene;
@@ -882,7 +882,7 @@ static short mirror_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt)
static short mirror_bezier_yaxis(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
{
if (bezt->f2 & SELECT) {
- /* Yes, names are inverted, we are mirroring accross y axis, hence along x axis... */
+ /* Yes, names are inverted, we are mirroring across y axis, hence along x axis... */
mirror_bezier_xaxis_ex(bezt, 0.0f);
}
@@ -892,7 +892,7 @@ static short mirror_bezier_yaxis(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
static short mirror_bezier_xaxis(KeyframeEditData *UNUSED(ked), BezTriple *bezt)
{
if (bezt->f2 & SELECT) {
- /* Yes, names are inverted, we are mirroring accross x axis, hence along y axis... */
+ /* Yes, names are inverted, we are mirroring across x axis, hence along y axis... */
mirror_bezier_yaxis_ex(bezt, 0.0f);
}
@@ -911,7 +911,7 @@ static short mirror_bezier_marker(KeyframeEditData *ked, BezTriple *bezt)
static short mirror_bezier_time(KeyframeEditData *ked, BezTriple *bezt)
{
- /* value to mirror over is strored in f1 */
+ /* value to mirror over is stored in f1 */
if (bezt->f2 & SELECT) {
mirror_bezier_xaxis_ex(bezt, ked->f1);
}
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index a6ed6643257..347e3f373bb 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -973,18 +973,18 @@ short paste_animedit_keys(bAnimContext *ac, ListBase *anim_data,
}
else {
/* from selected channels
- * This "passes" system aims to try to find "matching" channels to paste keyframes
- * into with increasingly loose matching heuristics. The process finishes when at least
- * one F-Curve has been pasted into.
+ * This "passes" system aims to try to find "matching" channels to paste keyframes
+ * into with increasingly loose matching heuristics. The process finishes when at least
+ * one F-Curve has been pasted into.
*/
for (pass = 0; pass < 3; pass++) {
unsigned int totmatch = 0;
for (ale = anim_data->first; ale; ale = ale->next) {
/* find buffer item to paste from
- * - if names don't matter (i.e. only 1 channel in buffer), don't check id/group
- * - if names do matter, only check if id-type is ok for now (group check is not that important)
- * - most importantly, rna-paths should match (array indices are unimportant for now)
+ * - if names don't matter (i.e. only 1 channel in buffer), don't check id/group
+ * - if names do matter, only check if id-type is ok for now (group check is not that important)
+ * - most importantly, rna-paths should match (array indices are unimportant for now)
*/
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
FCurve *fcu = (FCurve *)ale->data; /* destination F-Curve */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index f7cfec4d48a..f3396da58bb 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -748,7 +748,7 @@ static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
case CONSTRAINT_TYPE_KINEMATIC:
return true;
- /* single-transform constraits */
+ /* single-transform constraints */
case CONSTRAINT_TYPE_TRACKTO:
if (searchtype == VISUALKEY_ROT) return true;
break;
@@ -1686,7 +1686,7 @@ static int delete_key_v3d_exec(bContext *C, wmOperator *op)
}
/* special exception for bones, as this makes this operator more convenient to use
- * NOTE: This is only done in pose mode. In object mode, we're dealign with the entire object.
+ * NOTE: This is only done in pose mode. In object mode, we're dealing with the entire object.
*/
if ((ob->mode & OB_MODE_POSE) && strstr(fcu->rna_path, "pose.bones[\"")) {
bPoseChannel *pchan;
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 5e4db3ca61c..6962647b9b7 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -709,7 +709,7 @@ int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *ks)
}
/* Get Keying Set to use for Auto-Keyframing some transforms */
-KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformKSName)
+KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *transformKSName)
{
/* get KeyingSet to use
* - use the active KeyingSet if defined (and user wants to use it for all autokeying),
@@ -720,7 +720,7 @@ KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformK
else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL))
return ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_AVAILABLE_ID);
else
- return ANIM_builtin_keyingset_get_named(NULL, tranformKSName);
+ return ANIM_builtin_keyingset_get_named(NULL, transformKSName);
}
/* Menu of All Keying Sets ----------------------------- */
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index b268baf0f97..8769a4c0f31 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -667,7 +667,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
if (axis_delta == 0.0f) {
/* both mirrored bones exist and point to eachother and overlap exactly.
*
- * in this case theres no well defined solution, so de-select both and skip.
+ * in this case there's no well defined solution, so de-select both and skip.
*/
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
ebone_iter->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 0f382f07671..a66764be731 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -242,7 +242,7 @@ float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float align_a
return roll;
}
-/* note, ranges arithmatic is used below */
+/* note, ranges arithmetic is used below */
typedef enum eCalcRollTypes {
/* pos */
CALC_ROLL_POS_X = 0,
@@ -936,7 +936,7 @@ static int armature_merge_exec(bContext *C, wmOperator *op)
bstart = ebo;
}
else {
- /* chain is broken... merge any continous segments then clear */
+ /* chain is broken... merge any continuous segments then clear */
if (bstart && bend)
bones_merge(obedit, bstart, bend, bchild, &chains);
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index fb314fd4ac0..b0614c84d14 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -135,7 +135,7 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, const char *
/* called by UI for renaming a bone */
/* warning: make sure the original bone was not renamed yet! */
-/* seems messy, but thats what you get with not using pointers but channel names :) */
+/* seems messy, but that's what you get with not using pointers but channel names :) */
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
{
Object *ob;
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c
index 3f2eefced7d..d0b87545798 100644
--- a/source/blender/editors/armature/armature_ops.c
+++ b/source/blender/editors/armature/armature_ops.c
@@ -201,7 +201,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* Armature ------------------------ */
- keymap = WM_keymap_find(keyconf, "Armature", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Armature", 0, 0);
keymap->poll = ED_operator_editarmature;
/* Armature -> Etch-A-Ton ------------------------ */
@@ -309,7 +309,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
/* Pose ------------------------ */
/* only set in posemode, by space_view3d listener */
- keymap = WM_keymap_find(keyconf, "Pose", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Pose", 0, 0);
keymap->poll = ED_operator_posemode;
/* set parent and add object are object-based operators, but we make them
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index c211f9154ef..7a5e0563dd5 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -776,8 +776,8 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op)
* - the context iterator contains both selected bones and their mirrored copies,
* so we assume that unselected bones are mirrored copies of some selected bone
* - since the active one (and/or its mirror) will also be selected, we also need
- * to check that we are not trying to operate on them, since such an operation
- * would cause errors
+ * to check that we are not trying to operate on them, since such an operation
+ * would cause errors
*/
/* parent selected bones to the active one */
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index b74b515b37f..89e510e6f3e 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -665,7 +665,7 @@ static int RIG_parentControl(RigControl *ctrl, EditBone *link)
}
/* if there's already a link
- * overwrite only if new link is higher in the chain */
+ * overwrite only if new link is higher in the chain */
if (ctrl->link && flag == ctrl->flag) {
EditBone *bone = NULL;
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 691da4cbd2b..f789cd0e80a 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -157,7 +157,7 @@ void BIF_makeListTemplates(const bContext *C)
if (ob != obedit && ob->type == OB_ARMATURE) {
index++;
- BLI_ghash_insert(TEMPLATES_HASH, SET_INT_IN_POINTER(index), ob);
+ BLI_ghash_insert(TEMPLATES_HASH, POINTER_FROM_INT(index), ob);
if (ob == ts->skgen_template) {
TEMPLATES_CURRENT = index;
@@ -187,7 +187,7 @@ const char *BIF_listTemplates(const bContext *UNUSED(C))
while (!BLI_ghashIterator_done(&ghi)) {
Object *ob = BLI_ghashIterator_getValue(&ghi);
- int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi));
+ int key = POINTER_AS_INT(BLI_ghashIterator_getKey(&ghi));
p += sprintf(p, "|%s %%x%i", ob->id.name + 2, key);
@@ -208,7 +208,7 @@ int BIF_currentTemplate(const bContext *C)
while (!BLI_ghashIterator_done(&ghi)) {
Object *ob = BLI_ghashIterator_getValue(&ghi);
- int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi));
+ int key = POINTER_AS_INT(BLI_ghashIterator_getKey(&ghi));
if (ob == ts->skgen_template) {
TEMPLATES_CURRENT = key;
@@ -302,7 +302,7 @@ void BIF_setTemplate(bContext *C, int index)
{
ToolSettings *ts = CTX_data_tool_settings(C);
if (index > 0) {
- ts->skgen_template = BLI_ghash_lookup(TEMPLATES_HASH, SET_INT_IN_POINTER(index));
+ ts->skgen_template = BLI_ghash_lookup(TEMPLATES_HASH, POINTER_FROM_INT(index));
}
else {
ts->skgen_template = NULL;
@@ -905,7 +905,7 @@ static void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end,
float pval[2] = {0, 0};
ED_view3d_project_float_global(ar, stk->points[i].p, pval, V3D_PROJ_TEST_NOP);
- ED_view3d_win_to_ray(ar, v3d, pval, ray_start, ray_normal, false);
+ ED_view3d_win_to_ray_clipped(ar, v3d, pval, ray_start, ray_normal, false);
mul_v3_fl(ray_normal, distance * progress / length);
add_v3_v3(stk->points[i].p, ray_normal);
@@ -1502,7 +1502,7 @@ static int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, S
mval[0] = vi[0];
mval[1] = vi[1];
- ED_view3d_win_to_segment(ar, v3d, mval, ray_start, ray_end, true);
+ ED_view3d_win_to_segment_clipped(ar, v3d, mval, ray_start, ray_end, true);
isect_line_line_v3(stk->points[s_i].p,
stk->points[s_i + 1].p,
@@ -2051,7 +2051,7 @@ static void sk_drawSketch(Scene *scene, View3D *UNUSED(v3d), SK_Sketch *sketch,
for (p = sketch->depth_peels.first; p; p = p->next)
{
- int index = GET_INT_FROM_POINTER(p->ob);
+ int index = POINTER_AS_INT(p->ob);
index = (index >> 5) & 7;
glColor3fv(colors[index]);
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 389a8423f23..f04106dac3a 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -801,8 +801,8 @@ static int pose_armature_layers_showall_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* use RNA to set the layers
- * although it would be faster to just set directly using bitflags, we still
- * need to setup a RNA pointer so that we get the "update" callbacks for free...
+ * although it would be faster to just set directly using bitflags, we still
+ * need to setup a RNA pointer so that we get the "update" callbacks for free...
*/
RNA_id_pointer_create(&arm->id, &ptr);
@@ -1124,7 +1124,7 @@ void POSE_OT_hide(wmOperatorType *ot)
static int show_pose_bone_cb(Object *ob, Bone *bone, void *data)
{
- const bool select = GET_INT_FROM_POINTER(data);
+ const bool select = POINTER_AS_INT(data);
bArmature *arm = ob->data;
@@ -1147,7 +1147,7 @@ static int pose_reveal_exec(bContext *C, wmOperator *op)
bArmature *arm = ob->data;
const bool select = RNA_boolean_get(op->ptr, "select");
- bone_looper(ob, arm->bonebase.first, SET_INT_IN_POINTER(select), show_pose_bone_cb);
+ bone_looper(ob, arm->bonebase.first, POINTER_FROM_INT(select), show_pose_bone_cb);
/* note, notifier might evolve */
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index ecfaa41b0b5..c4a7ecd25c7 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -63,8 +63,8 @@
#include "armature_intern.h"
/* utility macros for storing a temp int in the bone (selection flag) */
-#define PBONE_PREV_FLAG_GET(pchan) ((void)0, (GET_INT_FROM_POINTER((pchan)->temp)))
-#define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = SET_INT_IN_POINTER(val))
+#define PBONE_PREV_FLAG_GET(pchan) ((void)0, (POINTER_AS_INT((pchan)->temp)))
+#define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = POINTER_FROM_INT(val))
/* ***************** Pose Select Utilities ********************* */
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index 5d27e13ed17..4a801d9de64 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -169,7 +169,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap = WM_keymap_find(keyconf, "Font", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Font", 0, 0);
keymap->poll = ED_operator_editfont;
/* only set in editmode font, by space_view3d listener */
@@ -229,7 +229,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
RNA_boolean_set(kmi->ptr, "accent", true); /* accented characters */
/* only set in editmode curve, by space_view3d listener */
- keymap = WM_keymap_find(keyconf, "Curve", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Curve", 0, 0);
keymap->poll = ED_operator_editsurfcurve;
WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index 325c39d7f38..7bdf17e9344 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -98,7 +98,7 @@ struct CurveDrawData {
bool use_plane;
float plane[4];
- /* use 'rv3d->depths', note that this will become 'damaged' while drawing, but thats OK. */
+ /* use 'rv3d->depths', note that this will become 'damaged' while drawing, but that's OK. */
bool use_depth;
/* offset projection by this value */
@@ -186,7 +186,6 @@ static bool stroke_elem_project(
float surface_offset, const float radius,
float r_location_world[3], float r_normal_world[3])
{
- View3D *v3d = cdd->vc.v3d;
ARegion *ar = cdd->vc.ar;
RegionView3D *rv3d = cdd->vc.rv3d;
@@ -195,12 +194,7 @@ static bool stroke_elem_project(
/* project to 'location_world' */
if (cdd->project.use_plane) {
/* get the view vector to 'location' */
- float ray_origin[3], ray_direction[3];
- ED_view3d_win_to_ray(cdd->vc.ar, v3d, mval_fl, ray_origin, ray_direction, false);
-
- float lambda;
- if (isect_ray_plane_v3(ray_origin, ray_direction, cdd->project.plane, &lambda, true)) {
- madd_v3_v3v3fl(r_location_world, ray_origin, ray_direction, lambda);
+ if (ED_view3d_win_to_3d_on_plane(ar, cdd->project.plane, mval_fl, true, r_location_world)) {
if (r_normal_world) {
zero_v3(r_normal_world);
}
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 5e62a87caf3..9d9ec51119b 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -55,9 +55,9 @@
/* ***************************************** */
/* NOTE ABOUT THIS FILE:
- * This file contains code for editing Grease Pencil data in the Action Editor
- * as a 'keyframes', so that a user can adjust the timing of Grease Pencil drawings.
- * Therefore, this file mostly contains functions for selecting Grease-Pencil frames.
+ * This file contains code for editing Grease Pencil data in the Action Editor
+ * as a 'keyframes', so that a user can adjust the timing of Grease Pencil drawings.
+ * Therefore, this file mostly contains functions for selecting Grease-Pencil frames.
*/
/* ***************************************** */
/* Generics - Loopers */
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 0f51f12793a..228a2afeb83 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -956,7 +956,7 @@ static bool gpsculpt_brush_apply_clone(bContext *C, tGP_BrushEditData *gso)
gp_brush_clone_add(C, gso);
}
else {
- /* Stamp or Continous Mode */
+ /* Stamp or Continuous Mode */
if (1 /*gso->brush->mode == GP_EDITBRUSH_CLONE_MODE_STAMP*/) {
/* Stamp - Proceed to translate the newly added strokes */
gp_brush_clone_adjust(gso);
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index c28fea0fc41..1bdeeefe223 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -670,13 +670,13 @@ static int gp_merge_layer_exec(bContext *C, wmOperator *op)
/* Collect frames of gpl_current in hash table to avoid O(n^2) lookups */
GHash *gh_frames_cur = BLI_ghash_int_new_ex(__func__, 64);
for (bGPDframe *gpf = gpl_current->frames.first; gpf; gpf = gpf->next) {
- BLI_ghash_insert(gh_frames_cur, SET_INT_IN_POINTER(gpf->framenum), gpf);
+ BLI_ghash_insert(gh_frames_cur, POINTER_FROM_INT(gpf->framenum), gpf);
}
/* read all frames from next layer */
for (bGPDframe *gpf = gpl_next->frames.first; gpf; gpf = gpf->next) {
/* try to find frame in active layer */
- bGPDframe *frame = BLI_ghash_lookup(gh_frames_cur, SET_INT_IN_POINTER(gpf->framenum));
+ bGPDframe *frame = BLI_ghash_lookup(gh_frames_cur, POINTER_FROM_INT(gpf->framenum));
if (!frame) {
/* nothing found, create new */
frame = BKE_gpencil_frame_addnew(gpl_current, gpf->framenum);
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index d7e60d2a0ce..f48736a15e1 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -319,15 +319,15 @@ typedef enum ACTCONT_TYPES {
/* Stroke Iteration Utilities */
/**
-* Iterate over all editable strokes in the current context,
-* stopping on each usable layer + stroke pair (i.e. gpl and gps)
-* to perform some operations on the stroke.
-*
-* \param gpl The identifier to use for the layer of the stroke being processed.
-* Choose a suitable value to avoid name clashes.
-* \param gps The identifier to use for current stroke being processed.
-* Choose a suitable value to avoid name clashes.
-*/
+ * Iterate over all editable strokes in the current context,
+ * stopping on each usable layer + stroke pair (i.e. gpl and gps)
+ * to perform some operations on the stroke.
+ *
+ * \param gpl The identifier to use for the layer of the stroke being processed.
+ * Choose a suitable value to avoid name clashes.
+ * \param gps The identifier to use for current stroke being processed.
+ * Choose a suitable value to avoid name clashes.
+ */
#define GP_EDITABLE_STROKES_BEGIN(C, gpl, gps) \
{ \
CTX_DATA_BEGIN(C, bGPDlayer*, gpl, editable_gpencil_layers) \
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index 2a575c02046..e209b7f46e7 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -55,7 +55,7 @@
/* Generic Drawing Keymap */
static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil", 0, 0);
wmKeyMapItem *kmi;
/* Draw --------------------------------------- */
@@ -123,7 +123,7 @@ static bool gp_stroke_editmode_poll(bContext *C)
/* Stroke Editing Keymap - Only when editmode is enabled */
static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
wmKeyMapItem *kmi;
/* set poll callback - so that this keymap only gets enabled when stroke editmode is enabled */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index fd1ff857317..0eb74f137ca 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2138,10 +2138,10 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event)
p->pressure = wmtab->Pressure;
/* Hack for pressure sensitive eraser on D+RMB when using a tablet:
- * The pen has to float over the tablet surface, resulting in
- * zero pressure (T47101). Ignore pressure values if floating
- * (i.e. "effectively zero" pressure), and only when the "active"
- * end is the stylus (i.e. the default when not eraser)
+ * The pen has to float over the tablet surface, resulting in
+ * zero pressure (T47101). Ignore pressure values if floating
+ * (i.e. "effectively zero" pressure), and only when the "active"
+ * end is the stylus (i.e. the default when not eraser)
*/
if (p->paintmode == GP_PAINTMODE_ERASER) {
if ((wmtab->Active != EVT_TABLET_ERASER) && (p->pressure < 0.001f)) {
@@ -2166,7 +2166,7 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event)
p->straight[1] = 0;
/* special exception here for too high pressure values on first touch in
- * windows for some tablets, then we just skip first touch...
+ * windows for some tablets, then we just skip first touch...
*/
if (tablet && (p->pressure >= 0.99f))
return;
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index dd556e99264..a21c5618877 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -735,7 +735,7 @@ static bool gp_stroke_do_circle_sel(
if (gp_stroke_inside_circle(mval, mvalo, radius, x0, y0, x1, y1)) {
/* change selection of stroke, and then of both points
* (as the last point otherwise wouldn't get selected
- * as we only do n-1 loops through)
+ * as we only do n-1 loops through).
*/
if (select) {
pt1->flag |= GP_SPOINT_SELECT;
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 06b8197de97..eb77ee8f552 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -327,11 +327,11 @@ bool ANIM_driver_vars_paste(struct ReportList *reports, struct FCurve *fcu, bool
/* ************ Auto-Keyframing ********************** */
/* Notes:
* - All the defines for this (User-Pref settings and Per-Scene settings)
- * are defined in DNA_userdef_types.h
+ * are defined in DNA_userdef_types.h
* - Scene settings take precedence over those for userprefs, with old files
- * inheriting userpref settings for the scene settings
+ * inheriting userpref settings for the scene settings
* - "On/Off + Mode" are stored per Scene, but "settings" are currently stored
- * as userprefs
+ * as userprefs
*/
/* Auto-Keying macros for use by various tools */
diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h
index a478278da4c..9188fca2422 100644
--- a/source/blender/editors/include/ED_types.h
+++ b/source/blender/editors/include/ED_types.h
@@ -33,7 +33,7 @@
/* **************** GENERAL EDITOR-WIDE TYPES AND DEFINES ************************** */
-/* old blender defines... should be depricated? */
+/* old blender defines... should be deprecated? */
#define DESELECT 0
#define SELECT 1
#define ACTIVE 2
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 82411ba7401..c21a6cccb2e 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -221,12 +221,15 @@ float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const fl
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3], bool *r_flip);
bool ED_view3d_clip_segment(const struct RegionView3D *rv3d, float ray_start[3], float ray_end[3]);
-bool ED_view3d_win_to_ray(
+bool ED_view3d_win_to_ray_clipped(
const struct ARegion *ar, const struct View3D *v3d, const float mval[2],
float ray_start[3], float ray_normal[3], const bool do_clip);
-bool ED_view3d_win_to_ray_ex(
+bool ED_view3d_win_to_ray_clipped_ex(
const struct ARegion *ar, const struct View3D *v3d, const float mval[2],
float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], bool do_clip);
+void ED_view3d_win_to_ray(
+ const struct ARegion *ar, const float mval[2],
+ float r_ray_start[3], float r_ray_normal[3]);
void ED_view3d_global_to_vector(const struct RegionView3D *rv3d, const float coord[3], float vec[3]);
void ED_view3d_win_to_3d(
const struct View3D *v3d, const struct ARegion *ar,
@@ -236,11 +239,20 @@ void ED_view3d_win_to_3d_int(
const struct View3D *v3d, const struct ARegion *ar,
const float depth_pt[3], const int mval[2],
float r_out[3]);
+bool ED_view3d_win_to_3d_on_plane(
+ const struct ARegion *ar,
+ const float plane[4], const float mval[2], const bool do_clip,
+ float r_out[3]);
+bool ED_view3d_win_to_3d_on_plane_int(
+ const struct ARegion *ar,
+ const float plane[4], const int mval[2], const bool do_clip,
+ float r_out[3]);
void ED_view3d_win_to_delta(const struct ARegion *ar, const float mval[2], float out[3], const float zfac);
void ED_view3d_win_to_origin(const struct ARegion *ar, const float mval[2], float out[3]);
void ED_view3d_win_to_vector(const struct ARegion *ar, const float mval[2], float out[3]);
-bool ED_view3d_win_to_segment(const struct ARegion *ar, struct View3D *v3d, const float mval[2],
- float r_ray_start[3], float r_ray_end[3], const bool do_clip);
+bool ED_view3d_win_to_segment_clipped(
+ const struct ARegion *ar, struct View3D *v3d, const float mval[2],
+ float r_ray_start[3], float r_ray_end[3], const bool do_clip);
void ED_view3d_ob_project_mat_get(const struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
void ED_view3d_ob_project_mat_get_from_obmat(const struct RegionView3D *rv3d, float obmat[4][4], float pmat[4][4]);
void ED_view3d_unproject(struct bglMats *mats, float out[3], const float x, const float y, const float z);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index a38f82bc5fc..0db6e2c122c 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -462,6 +462,11 @@ void UI_block_update_from_old(const struct bContext *C, struct uiBlock *block);
uiBlock *UI_block_find_in_region(const char *name, struct ARegion *ar);
+enum {
+ UI_BLOCK_THEME_STYLE_REGULAR = 0,
+ UI_BLOCK_THEME_STYLE_POPUP = 1,
+};
+void UI_block_theme_style_set(uiBlock *block, char theme_style);
void UI_block_emboss_set(uiBlock *block, char dt);
void UI_block_free(const struct bContext *C, uiBlock *block);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 82ae4de07af..3188829bf31 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2369,7 +2369,7 @@ static bool ui_set_but_string_eval_num_unit(bContext *C, uiBut *but, const char
str_unit_convert, sizeof(str_unit_convert), but->drawstr,
ui_get_but_scale_unit(but, 1.0), but->block->unit->system, RNA_SUBTYPE_UNIT_VALUE(unit_type));
- return BPY_execute_string_as_number(C, str_unit_convert, true, r_value);
+ return BPY_execute_string_as_number(C, NULL, str_unit_convert, true, r_value);
}
#endif /* WITH_PYTHON */
@@ -2384,7 +2384,7 @@ bool ui_but_string_set_eval_num(bContext *C, uiBut *but, const char *str, double
if (str[0] != '\0') {
bool is_unit_but = (ui_but_is_float(but) && ui_but_is_unit(but));
/* only enable verbose if we won't run again with units */
- if (BPY_execute_string_as_number(C, str, is_unit_but == false, r_value)) {
+ if (BPY_execute_string_as_number(C, NULL, str, is_unit_but == false, r_value)) {
/* if the value parsed ok without unit conversion this button may still need a unit multiplier */
if (is_unit_but) {
char str_new[128];
@@ -2879,6 +2879,11 @@ void UI_block_emboss_set(uiBlock *block, char dt)
block->dt = dt;
}
+void UI_block_theme_style_set(uiBlock *block, char theme_style)
+{
+ block->theme_style = theme_style;
+}
+
/**
* \param but: Button to update.
* \param validate: When set, this function may change the button value.
@@ -4159,7 +4164,7 @@ void UI_but_drag_set_value(uiBut *but)
void UI_but_drag_set_image(uiBut *but, const char *path, int icon, struct ImBuf *imb, float scale, const bool use_free)
{
but->dragtype = WM_DRAG_PATH;
- ui_def_but_icon(but, icon, 0); /* no flag UI_HAS_ICON, so icon doesnt draw in button */
+ ui_def_but_icon(but, icon, 0); /* no flag UI_HAS_ICON, so icon doesn't draw in button */
if ((but->dragflag & UI_BUT_DRAGPOIN_FREE)) {
MEM_SAFE_FREE(but->dragpoin);
but->dragflag &= ~UI_BUT_DRAGPOIN_FREE;
@@ -4479,7 +4484,7 @@ static void operator_enum_search_cb(const struct bContext *C, void *but, const c
for (item = item_array; item->identifier; item++) {
/* note: need to give the index rather than the identifier because the enum can be freed */
if (BLI_strcasestr(item->name, str)) {
- if (false == UI_search_item_add(items, item->name, SET_INT_IN_POINTER(item->value), 0))
+ if (false == UI_search_item_add(items, item->name, POINTER_FROM_INT(item->value), 0))
break;
}
}
@@ -4497,7 +4502,7 @@ static void operator_enum_call_cb(struct bContext *UNUSED(C), void *but, void *a
if (ot) {
if (ot->prop) {
- RNA_property_enum_set(opptr, ot->prop, GET_INT_FROM_POINTER(arg2));
+ RNA_property_enum_set(opptr, ot->prop, POINTER_AS_INT(arg2));
/* We do not call op from here, will be called by button code.
* ui_apply_but_funcs_after() (in interface_handlers.c) called this func before checking operators,
* because one of its parameters is the button itself!
diff --git a/source/blender/editors/interface/interface_eyedropper_color.c b/source/blender/editors/interface/interface_eyedropper_color.c
index 5eb4359607a..34f33f1d970 100644
--- a/source/blender/editors/interface/interface_eyedropper_color.c
+++ b/source/blender/editors/interface/interface_eyedropper_color.c
@@ -103,7 +103,7 @@ static bool eyedropper_init(bContext *C, wmOperator *op)
display_device = scene->display_settings.display_device;
eye->display = IMB_colormanagement_display_get_named(display_device);
- /* store inital color */
+ /* store initial color */
RNA_property_float_get_array(&eye->ptr, eye->prop, col);
if (eye->display) {
IMB_colormanagement_display_to_scene_linear_v3(col, eye->display);
diff --git a/source/blender/editors/interface/interface_eyedropper_datablock.c b/source/blender/editors/interface/interface_eyedropper_datablock.c
index 2bb575558fc..43ccd65ddf2 100644
--- a/source/blender/editors/interface/interface_eyedropper_datablock.c
+++ b/source/blender/editors/interface/interface_eyedropper_datablock.c
@@ -190,7 +190,10 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int
}
}
- if (id) {
+ PointerRNA idptr;
+ RNA_id_pointer_create(id, &idptr);
+
+ if (id && RNA_property_pointer_poll(&ddr->ptr, ddr->prop, &idptr)) {
BLI_snprintf(ddr->name, sizeof(ddr->name), "%s: %s",
ddr->idcode_name, id->name + 2);
*r_id = id;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 06b6099cec7..64c3ae32eaa 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -160,7 +160,7 @@ typedef enum uiHandleButtonState {
#ifdef USE_ALLSELECT
-/* Unfortunately theres no good way handle more generally:
+/* Unfortunately there's no good way handle more generally:
* (propagate single clicks on layer buttons to other objects) */
#define USE_ALLSELECT_LAYER_HACK
@@ -2529,7 +2529,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
* It converts every UTF-8 character to an asterisk, and also remaps
* the cursor position and selection start/end.
*
- * \note: remaping is used, because password could contain UTF-8 characters.
+ * \note: remapping is used, because password could contain UTF-8 characters.
*
*/
@@ -2793,7 +2793,7 @@ static bool ui_textedit_insert_buf(
if ((len + step >= data->maxlen) && (data->maxlen - (len + 1) > 0)) {
if (ui_but_is_utf8(but)) {
- /* shorten 'step' to a utf8 algined size that fits */
+ /* shorten 'step' to a utf8 aligned size that fits */
BLI_strnlen_utf8_ex(buf, data->maxlen - (len + 1), &step);
}
else {
@@ -3859,7 +3859,7 @@ static int ui_do_but_HOTKEYEVT(
if (event->type == LEFTMOUSE && event->val == KM_PRESS) {
/* only cancel if click outside the button */
if (ui_but_contains_point_px(but->active->region, but, event->x, event->y) == 0) {
- /* data->cancel doesnt work, this button opens immediate */
+ /* data->cancel doesn't work, this button opens immediate */
if (but->flag & UI_BUT_IMMEDIATE)
ui_but_value_set(but, 0);
else
@@ -4444,7 +4444,7 @@ static int ui_do_but_NUM(
else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
if (data->dragchange) {
#ifdef USE_DRAG_MULTINUM
- /* if we started multibutton but didnt drag, then edit */
+ /* if we started multibutton but didn't drag, then edit */
if (data->multi_data.init == BUTTON_MULTI_INIT_SETUP) {
click = 1;
}
@@ -4755,7 +4755,7 @@ static int ui_do_but_SLI(
else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
if (data->dragchange) {
#ifdef USE_DRAG_MULTINUM
- /* if we started multibutton but didnt drag, then edit */
+ /* if we started multibutton but didn't drag, then edit */
if (data->multi_data.init == BUTTON_MULTI_INIT_SETUP) {
click = 1;
}
@@ -8327,7 +8327,7 @@ static void ui_handle_button_return_submenu(bContext *C, const wmEvent *event, u
/* ************************* menu handling *******************************/
/**
- * Function used to prevent loosing the open menu when using nested pulldowns,
+ * Function used to prevent losing the open menu when using nested pulldowns,
* when moving mouse towards the pulldown menu over other buttons that could
* steal the highlight from the current button, only checks:
*
@@ -8547,7 +8547,7 @@ static int ui_menu_scroll(ARegion *ar, uiBlock *block, int my, uiBut *to_bt)
* let the parent menu get the event.
*
* This allows a menu to be open,
- * but send key events to the parent if theres no active buttons.
+ * but send key events to the parent if there's no active buttons.
*
* Without this keyboard navigation from menu's wont work.
*/
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 75f2efdf3aa..11691fd8365 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -404,9 +404,10 @@ struct uiBlock {
short alignnr;
char direction;
+ char theme_style; /* UI_BLOCK_THEME_STYLE_* */
char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied to buttons */
bool auto_open;
- char _pad[7];
+ char _pad[6];
double auto_open_last;
const char *lockstr;
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index edd568e4fea..6550115e50b 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -370,7 +370,7 @@ static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
uiBut *but = arg_but, *cbut;
PointerRNA *ptr = &but->rnapoin;
PropertyRNA *prop = but->rnaprop;
- int i, index = GET_INT_FROM_POINTER(arg_index);
+ int i, index = POINTER_AS_INT(arg_index);
int shift = win->eventstate->shift;
int len = RNA_property_array_length(ptr, prop);
@@ -463,7 +463,7 @@ static void ui_item_array(
but = uiDefAutoButR(block, ptr, prop, layer_num, "", icon, x + butw * a, y + buth, butw, buth);
if (subtype == PROP_LAYER_MEMBER)
- UI_but_func_set(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(layer_num));
+ UI_but_func_set(but, ui_layer_but_cb, but, POINTER_FROM_INT(layer_num));
}
for (a = 0; a < colbuts; a++) {
const int layer_num = a + len / 2 + b * colbuts;
@@ -481,7 +481,7 @@ static void ui_item_array(
but = uiDefAutoButR(block, ptr, prop, layer_num, "", icon, x + butw * a, y, butw, buth);
if (subtype == PROP_LAYER_MEMBER)
- UI_but_func_set(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(layer_num));
+ UI_but_func_set(but, ui_layer_but_cb, but, POINTER_FROM_INT(layer_num));
}
UI_block_align_end(block);
@@ -567,7 +567,7 @@ static void ui_item_enum_expand_handle(bContext *C, void *arg1, void *arg2)
if (!win->eventstate->shift) {
uiBut *but = (uiBut *)arg1;
- int enum_value = GET_INT_FROM_POINTER(arg2);
+ int enum_value = POINTER_AS_INT(arg2);
int current_value = RNA_property_enum_get(&but->rnapoin, but->rnaprop);
if (!(current_value & enum_value)) {
@@ -645,7 +645,7 @@ static void ui_item_enum_expand(
but = uiDefButR_prop(block, UI_BTYPE_ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
- UI_but_func_set(but, ui_item_enum_expand_handle, but, SET_INT_IN_POINTER(value));
+ UI_but_func_set(but, ui_item_enum_expand_handle, but, POINTER_FROM_INT(value));
}
if (ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL)
@@ -1099,7 +1099,7 @@ void uiItemsFullEnumO_items(
uiItemS(target);
}
else {
- /* XXX bug here, colums draw bottom item badly */
+ /* XXX bug here, columns draw bottom item badly */
uiItemS(target);
}
}
@@ -1741,7 +1741,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s
/* add search items from temporary list */
for (cis = items_list->first; cis; cis = cis->next) {
- if (false == UI_search_item_add(items, cis->name, SET_INT_IN_POINTER(cis->index), cis->iconid)) {
+ if (false == UI_search_item_add(items, cis->name, POINTER_FROM_INT(cis->index), cis->iconid)) {
break;
}
}
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 1e67ecdfc90..d941f429339 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -1151,7 +1151,7 @@ void ED_operatortypes_ui(void)
*/
void ED_keymap_ui(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "User Interface", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "User Interface", 0, 0);
wmKeyMapItem *kmi;
/* eyedroppers - notice they all have the same shortcut, but pass the event
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 744f6b3c4d0..1e8a80bb308 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1247,7 +1247,7 @@ static void ui_panel_drag_collapse(bContext *C, uiPanelDragCollapseHandle *dragc
/**
* Panel drag-collapse (modal handler)
* Clicking and dragging over panels toggles their collapse state based on the panel that was first
- * dragged over. If it was open all affected panels incl the initial one are closed and vise versa.
+ * dragged over. If it was open all affected panels incl the initial one are closed and vice versa.
*/
static int ui_panel_drag_collapse_handler(bContext *C, const wmEvent *event, void *userdata)
{
@@ -1619,7 +1619,7 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active)
const int px = max_ii(1, round_fl_to_int(U.pixelsize));
const int category_tabs_width = round_fl_to_int(UI_PANEL_CATEGORY_MARGIN_WIDTH * zoom);
const float dpi_fac = UI_DPI_FAC;
- const int tab_v_pad_text = round_fl_to_int((2 + ((px * 3) * dpi_fac)) * zoom); /* pading of tabs around text */
+ const int tab_v_pad_text = round_fl_to_int((2 + ((px * 3) * dpi_fac)) * zoom); /* padding of tabs around text */
const int tab_v_pad = round_fl_to_int((4 + (2 * px * dpi_fac)) * zoom); /* padding between tabs */
const float tab_curve_radius = ((px * 3) * dpi_fac) * zoom;
const int roundboxtype = UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT;
diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c
index 00462b456ea..afa3486cf6c 100644
--- a/source/blender/editors/interface/interface_region_color_picker.c
+++ b/source/blender/editors/interface/interface_region_color_picker.c
@@ -629,6 +629,7 @@ uiBlock *ui_block_func_COLOR(bContext *C, uiPopupBlockHandle *handle, void *arg_
ui_block_colorpicker(block, handle->retvec, &but->rnapoin, but->rnaprop, show_picker);
block->flag = UI_BLOCK_LOOP | UI_BLOCK_KEEP_OPEN | UI_BLOCK_OUT_1 | UI_BLOCK_MOVEMOUSE_QUIT;
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
UI_block_bounds_set_normal(block, 0.5 * UI_UNIT_X);
block->block_event_func = ui_colorpicker_small_wheel_cb;
diff --git a/source/blender/editors/interface/interface_region_menu_pie.c b/source/blender/editors/interface/interface_region_menu_pie.c
index 41001d65d82..ef2d273bab6 100644
--- a/source/blender/editors/interface/interface_region_menu_pie.c
+++ b/source/blender/editors/interface/interface_region_menu_pie.c
@@ -87,6 +87,7 @@ static uiBlock *ui_block_func_PIE(bContext *UNUSED(C), uiPopupBlockHandle *handl
UI_block_layout_resolve(block, &width, &height);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_NUMSELECT);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
block->minbounds = minwidth;
block->bounds = 1;
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c
index fa7113f195e..fac96fc2154 100644
--- a/source/blender/editors/interface/interface_region_menu_popup.c
+++ b/source/blender/editors/interface/interface_region_menu_popup.c
@@ -235,6 +235,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi
uiBut *but_activate = NULL;
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_NUMSELECT);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
UI_block_direction_set(block, direction);
/* offset the mouse position, possibly based on earlier selection */
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c
index 656c59055af..93fd62b5c66 100644
--- a/source/blender/editors/interface/interface_region_popup.c
+++ b/source/blender/editors/interface/interface_region_popup.c
@@ -502,6 +502,7 @@ uiBlock *ui_popup_block_refresh(
}
block->flag |= UI_BLOCK_LOOP;
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
/* defer this until blocks are translated (below) */
block->oldblock = NULL;
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c
index 1eec3737215..7bb0a02bbf6 100644
--- a/source/blender/editors/interface/interface_region_tooltip.c
+++ b/source/blender/editors/interface/interface_region_tooltip.c
@@ -573,12 +573,12 @@ static ARegion *ui_tooltip_create_with_data(
const float pad_px = UI_TIP_PADDING;
wmWindow *win = CTX_wm_window(C);
const int winx = WM_window_pixels_x(win);
+ const int winy = WM_window_pixels_y(win);
uiStyle *style = UI_style_get();
static ARegionType type;
ARegion *ar;
int fonth, fontw;
int h, i;
- rctf rect_fl;
rcti rect_i;
int font_flag = 0;
@@ -658,35 +658,32 @@ static ARegion *ui_tooltip_create_with_data(
data->toth = fonth;
data->lineh = h;
- /* compute position */
-
- rect_fl.xmin = init_position[0] - TIP_BORDER_X;
- rect_fl.xmax = rect_fl.xmin + fontw + pad_px;
- rect_fl.ymax = init_position[1] - TIP_BORDER_Y;
- rect_fl.ymin = rect_fl.ymax - fonth - TIP_BORDER_Y;
-
- BLI_rcti_rctf_copy(&rect_i, &rect_fl);
+ /* Compute position. */
+ {
+ rctf rect_fl;
+ rect_fl.xmin = init_position[0] - TIP_BORDER_X;
+ rect_fl.xmax = rect_fl.xmin + fontw + pad_px;
+ rect_fl.ymax = init_position[1] - TIP_BORDER_Y;
+ rect_fl.ymin = rect_fl.ymax - fonth - TIP_BORDER_Y;
+ BLI_rcti_rctf_copy(&rect_i, &rect_fl);
+ }
#undef TIP_BORDER_X
#undef TIP_BORDER_Y
- /* clip with window boundaries */
- if (rect_i.xmax > winx) {
- /* super size */
- if (rect_i.xmax > winx + rect_i.xmin) {
- rect_i.xmax = winx;
- rect_i.xmin = 0;
- }
- else {
- rect_i.xmin -= rect_i.xmax - winx;
- rect_i.xmax = winx;
- }
- }
- /* ensure at least 5 px above screen bounds
- * 25 is just a guess to be above the menu item */
- if (rect_i.ymin < 5) {
- rect_i.ymax += (-rect_i.ymin) + 30;
- rect_i.ymin = 30;
+ /* Clamp to window bounds. */
+ {
+ /* Ensure at least 5 px above screen bounds
+ * UI_UNIT_Y is just a guess to be above the menu item */
+ const int pad = max_ff(1.0f, U.pixelsize) * 5;
+ const rcti rect_clamp = {
+ .xmin = pad,
+ .xmax = winx - pad,
+ .ymin = pad + (UI_UNIT_Y * 2),
+ .ymax = winy - pad,
+ };
+ int offset_dummy[2];
+ BLI_rcti_clamp(&rect_i, &rect_clamp, offset_dummy);
}
/* add padding */
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 9d05819dd6a..86f9ba40f16 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -267,6 +267,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
block = UI_block_begin(C, ar, "_popup", UI_EMBOSS);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_SEARCH_MENU);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
/* preview thumbnails */
if (template_ui.prv_rows > 0 && template_ui.prv_cols > 0) {
@@ -348,7 +349,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
TemplateID *template_ui = (TemplateID *)arg_litem;
PointerRNA idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
ID *id = idptr.data;
- int event = GET_INT_FROM_POINTER(arg_event);
+ int event = POINTER_AS_INT(arg_event);
switch (event) {
case UI_ID_BROWSE:
@@ -534,7 +535,7 @@ static void template_ID(
but = uiDefButR(
block, UI_BTYPE_TEXT, 0, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y,
&idptr, "name", -1, 0, 0, -1, -1, RNA_struct_ui_description(type));
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_RENAME));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_RENAME));
if (user_alert) UI_but_flag_enable(but, UI_BUT_REDALERT);
if (id->lib) {
@@ -552,7 +553,7 @@ static void template_ID(
UI_but_flag_enable(but, UI_BUT_DISABLED);
}
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_LOCAL));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_LOCAL));
}
if (id->us > 1) {
@@ -567,7 +568,7 @@ static void template_ID(
TIP_("Display number of users of this data (click to make a single-user copy)"));
but->flag |= UI_BUT_UNDO;
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_ALONE));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ALONE));
if (/* test only */
(id_copy(CTX_data_main(C), id, NULL, true) == false) ||
(idfrom && idfrom->lib) ||
@@ -625,13 +626,13 @@ static void template_ID(
but = uiDefIconTextButO(
block, UI_BTYPE_BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN,
(id) ? "" : CTX_IFACE_(template_id_context(type), "New"), 0, 0, w, UI_UNIT_Y, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ADD_NEW));
}
else {
but = uiDefIconTextBut(
block, UI_BTYPE_BUT, 0, ICON_ZOOMIN, (id) ? "" : CTX_IFACE_(template_id_context(type), "New"),
0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ADD_NEW));
}
if ((idfrom && idfrom->lib) || !editable)
@@ -657,13 +658,13 @@ static void template_ID(
but = uiDefIconTextButO(
block, UI_BTYPE_BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id) ? "" : IFACE_("Open"),
0, 0, w, UI_UNIT_Y, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_OPEN));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_OPEN));
}
else {
but = uiDefIconTextBut(
block, UI_BTYPE_BUT, 0, ICON_FILESEL, (id) ? "" : IFACE_("Open"), 0, 0, w, UI_UNIT_Y,
NULL, 0, 0, 0, 0, NULL);
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_OPEN));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_OPEN));
}
if ((idfrom && idfrom->lib) || !editable)
@@ -687,7 +688,7 @@ static void template_ID(
block, UI_BTYPE_BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0,
TIP_("Unlink data-block "
"(Shift + Click to set users to zero, data will then not be saved)"));
- UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), SET_INT_IN_POINTER(UI_ID_DELETE));
+ UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_DELETE));
if (RNA_property_flag(template_ui->prop) & PROP_NEVER_NULL) {
UI_but_flag_enable(but, UI_BUT_DISABLED);
@@ -1143,7 +1144,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
/* find modifier and draw it */
cageIndex = modifiers_getCageIndex(scene, ob, &lastCageIndex, 0);
- /* XXX virtual modifiers are not accesible for python */
+ /* XXX virtual modifiers are not accessible for python */
vmd = modifiers_getVirtualModifierList(ob, &virtualModifierData);
for (i = 0; vmd; i++, vmd = vmd->next) {
@@ -1283,11 +1284,11 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
short prev_proxylock, show_upbut, show_downbut;
/* Up/Down buttons:
- * Proxy-constraints are not allowed to occur after local (non-proxy) constraints
- * as that poses problems when restoring them, so disable the "up" button where
- * it may cause this situation.
+ * Proxy-constraints are not allowed to occur after local (non-proxy) constraints
+ * 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 grayed - todo) if they serve some purpose.
+ * Up/Down buttons should only be shown (or not grayed - todo) if they serve some purpose.
*/
if (BKE_constraints_proxylocked_owner(ob, pchan)) {
if (con->prev) {
@@ -1774,6 +1775,7 @@ static uiBlock *ui_icon_view_menu_cb(bContext *C, ARegion *ar, void *arg_litem)
block = UI_block_begin(C, ar, "_popup", UI_EMBOSS_PULLDOWN);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_NO_FLIP);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
RNA_property_enum_items(C, &args.ptr, args.prop, &item, NULL, &free);
@@ -2037,7 +2039,7 @@ static uiBlock *curvemap_clipping_func(bContext *C, ARegion *ar, void *cumap_v)
block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
- /* use this for a fake extra empy space around the buttons */
+ /* use this for a fake extra empty space around the buttons */
uiDefBut(block, UI_BTYPE_LABEL, 0, "", -4, 16, width + 8, 6 * UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
bt = uiDefButBitI(
@@ -2596,7 +2598,7 @@ void uiTemplateCryptoPicker(uiLayout *layout, PointerRNA *ptr, const char *propn
static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
{
uiBut *but = arg1;
- int cur = GET_INT_FROM_POINTER(arg2);
+ int cur = POINTER_AS_INT(arg2);
wmWindow *win = CTX_wm_window(C);
int i, tot, shift = win->eventstate->shift;
@@ -2680,7 +2682,7 @@ void uiTemplateLayers(
icon = ICON_LAYER_USED;
but = uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X / 2, UI_UNIT_Y / 2);
- UI_but_func_set(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer));
+ UI_but_func_set(but, handle_layer_buttons, but, POINTER_FROM_INT(layer));
but->type = UI_BTYPE_TOGGLE;
}
}
@@ -2751,7 +2753,7 @@ void uiTemplateGameStates(
but = uiDefIconButR_prop(
block, UI_BTYPE_ICON_TOGGLE, 0, icon, 0, 0, UI_UNIT_X / 2, UI_UNIT_Y / 2, ptr, prop,
state, 0, 0, -1, -1, sca_state_name_get(ob, state));
- UI_but_func_set(but, handle_layer_buttons, but, SET_INT_IN_POINTER(state));
+ UI_but_func_set(but, handle_layer_buttons, but, POINTER_FROM_INT(state));
but->type = UI_BTYPE_TOGGLE;
}
}
@@ -3874,9 +3876,11 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
UI_but_func_tooltip_set(but_progress, progress_tooltip_func, tip_arg);
}
- uiDefIconTextBut(block, UI_BTYPE_BUT, handle_event, ICON_PANEL_CLOSE,
- "", 0, 0, UI_UNIT_X, UI_UNIT_Y,
- NULL, 0.0f, 0.0f, 0, 0, TIP_("Stop this job"));
+ if (!wm->is_interface_locked) {
+ uiDefIconTextBut(block, UI_BTYPE_BUT, handle_event, ICON_PANEL_CLOSE,
+ "", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0f, 0.0f, 0, 0, TIP_("Stop this job"));
+ }
}
if (screen->animtimer)
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 2059fc1c849..2b9c6265eeb 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -120,7 +120,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
but = uiDefButR_prop(block, UI_BTYPE_TEXT, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
if (RNA_property_flag(prop) & PROP_TEXTEDIT_UPDATE) {
- /* TEXTEDIT_UPDATE is usally used for search buttons. For these we also want
+ /* TEXTEDIT_UPDATE is usually used for search buttons. For these we also want
* the 'x' icon to clear search string, so setting VALUE_CLEAR flag, too. */
UI_but_flag_enable(but, UI_BUT_TEXTEDIT_UPDATE | UI_BUT_VALUE_CLEAR);
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index a7de70629d1..a655dea9215 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -680,7 +680,9 @@ static void widgetbase_outline(uiWidgetBase *wtb)
glDisableClientState(GL_VERTEX_ARRAY);
}
-static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
+static void widgetbase_draw_ex(
+ uiWidgetBase *wtb, uiWidgetColors *wcol,
+ const bool show_alpha_checkers)
{
int j, a;
@@ -690,7 +692,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
if (wtb->draw_inner) {
BLI_assert(wtb->totvert != 0);
if (wcol->shaded == 0) {
- if (wcol->alpha_check) {
+ if (show_alpha_checkers) {
float inner_v_half[WIDGET_SIZE_MAX][2];
float x_mid = 0.0f; /* used for dumb clamping of values */
@@ -841,6 +843,11 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
glDisable(GL_BLEND);
}
+static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol)
+{
+ widgetbase_draw_ex(wtb, wcol, false);
+}
+
/* *********************** text/icon ************************************** */
#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect)
@@ -1473,7 +1480,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
#endif
/* cut string in 2 parts - only for menu entries */
- if ((but->block->flag & UI_BLOCK_LOOP) &&
+ if ((but->block->theme_style == UI_BLOCK_THEME_STYLE_POPUP) &&
(but->editstr == NULL))
{
if (but->flag & UI_BUT_HAS_SEP_CHAR) {
@@ -3100,9 +3107,9 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
ui_block_cm_to_display_space_v3(but->block, col);
rgba_float_to_uchar((unsigned char *)wcol->inner, col);
+ const bool show_alpha_checkers = (wcol->inner[3] < 255);
wcol->shaded = 0;
- wcol->alpha_check = (wcol->inner[3] < 255);
if (state & (UI_BUT_DISABLED | UI_BUT_INACTIVE)) {
/* Now we reduce alpha of the inner color (i.e. the color shown)
@@ -3113,7 +3120,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
wcol->inner[3] /= 2;
}
- widgetbase_draw(&wtb, wcol);
+ widgetbase_draw_ex(&wtb, wcol, show_alpha_checkers);
if (but->a1 == UI_PALETTE_COLOR && ((Palette *)but->rnapoin.id.data)->active_color == (int)but->a2) {
float width = rect->xmax - rect->xmin;
@@ -3749,7 +3756,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
wt->wcol_theme = &tui->wcol_box;
wt->state = widget_state;
}
- else if (but->block->flag & UI_BLOCK_LOOP) {
+ else if (but->block->theme_style == UI_BLOCK_THEME_STYLE_POPUP) {
wt->wcol_theme = &tui->wcol_menu_back;
wt->state = widget_state;
}
@@ -3785,8 +3792,9 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
case UI_BTYPE_SEARCH_MENU:
wt = widget_type(UI_WTYPE_NAME);
- if (but->block->flag & UI_BLOCK_LOOP)
+ if (but->block->theme_style == UI_BLOCK_THEME_STYLE_POPUP) {
wt->wcol_theme = &btheme->tui.wcol_menu_back;
+ }
break;
case UI_BTYPE_BUT_TOGGLE:
@@ -3805,9 +3813,9 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
wt = widget_type(UI_WTYPE_TOGGLE);
/* option buttons have strings outside, on menus use different colors */
- if (but->block->flag & UI_BLOCK_LOOP)
+ if (but->block->theme_style == UI_BLOCK_THEME_STYLE_POPUP) {
wt->state = widget_state_option_menu;
-
+ }
break;
case UI_BTYPE_MENU:
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 299001d4e45..c60371a0bbf 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -215,8 +215,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
switch (type) {
/* 'standard view' - optimum setup for 'standard' view behavior,
- * that should be used new views as basis for their
- * own unique View2D settings, which should be used instead of this in most cases...
+ * that should be used new views as basis for their
+ * own unique View2D settings, which should be used instead of this in most cases...
*/
case V2D_COMMONVIEW_STANDARD:
{
@@ -226,9 +226,9 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
v2d->maxzoom = 1000.0f;
/* tot rect and cur should be same size, and aligned using 'standard' OpenGL coordinates for now
- * - region can resize 'tot' later to fit other data
- * - keeptot is only within bounds, as strict locking is not that critical
- * - view is aligned for (0,0) -> (winx-1, winy-1) setup
+ * - region can resize 'tot' later to fit other data
+ * - keeptot is only within bounds, as strict locking is not that critical
+ * - view is aligned for (0,0) -> (winx-1, winy-1) setup
*/
v2d->align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y);
v2d->keeptot = V2D_KEEPTOT_BOUNDS;
@@ -260,7 +260,7 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
break;
}
/* 'stack view' - practically the same as list/channel view, except is located in the pos y half instead.
- * zoom, aspect ratio, and alignment restrictions are set here */
+ * zoom, aspect ratio, and alignment restrictions are set here */
case V2D_COMMONVIEW_STACK:
{
/* zoom + aspect ratio are locked */
@@ -478,7 +478,7 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas
float curRatio, winRatio;
/* when a window edge changes, the aspect ratio can't be used to
- * find which is the best new 'cur' rect. thats why it stores 'old'
+ * find which is the best new 'cur' rect. that's why it stores 'old'
*/
if (winx != v2d->oldwinx) do_x = true;
if (winy != v2d->oldwiny) do_y = true;
@@ -628,7 +628,7 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas
}
else if (cur->xmax > tot->xmax) {
/* - only offset by difference of cur-xmax and tot-xmax if that would not move
- * cur-xmin to lie past tot-xmin
+ * cur-xmin to lie past tot-xmin
* - otherwise, simply shift to tot-xmin???
*/
temp = cur->xmax - tot->xmax;
@@ -672,7 +672,7 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas
}
else if (cur->xmax > tot->xmax) {
/* - only offset by difference of cur-xmax and tot-xmax if that would not move
- * cur-xmin to lie past tot-xmin
+ * cur-xmin to lie past tot-xmin
* - otherwise, simply shift to tot-xmin???
*/
temp = cur->xmax - tot->xmax;
@@ -1189,7 +1189,7 @@ static void step_to_grid(float *step, int *power, int unit)
/* for frames, we want 1.0 frame intervals only */
if (unit == V2D_UNIT_FRAMES) {
rem = 1.0f;
- *step = 2.0f; /* use 2 since there are grid lines drawn in between, this way to get 1 line per frane */
+ *step = 2.0f; /* use 2 since there are grid lines drawn in between, this way to get 1 line per frame */
}
/* prevents printing 1.0 2.0 3.0 etc */
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 3cad2167cfa..b9ea5d96057 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -2098,7 +2098,7 @@ void ED_operatortypes_view2d(void)
void ED_keymap_view2d(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "View2D", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "View2D", 0, 0);
wmKeyMapItem *kmi;
/* scrollers */
@@ -2158,7 +2158,7 @@ void ED_keymap_view2d(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0);
/* Alternative keymap for buttons listview */
- keymap = WM_keymap_find(keyconf, "View2D Buttons List", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "View2D Buttons List", 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/lattice/lattice_ops.c b/source/blender/editors/lattice/lattice_ops.c
index 4f2e87c11c1..561397d71ff 100644
--- a/source/blender/editors/lattice/lattice_ops.c
+++ b/source/blender/editors/lattice/lattice_ops.c
@@ -58,7 +58,7 @@ void ED_keymap_lattice(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap = WM_keymap_find(keyconf, "Lattice", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Lattice", 0, 0);
keymap->poll = ED_operator_editlattice;
kmi = WM_keymap_add_item(keymap, "LATTICE_OT_select_all", AKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c
index 192ada40b5d..540101ba401 100644
--- a/source/blender/editors/mask/mask_edit.c
+++ b/source/blender/editors/mask/mask_edit.c
@@ -525,7 +525,7 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap = WM_keymap_find(keyconf, "Mask Editing", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Mask Editing", 0, 0);
keymap->poll = ED_maskedit_poll;
WM_keymap_add_item(keymap, "MASK_OT_new", NKEY, KM_PRESS, KM_ALT, 0);
diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c
index 771deca69b6..21f406c7657 100644
--- a/source/blender/editors/mask/mask_editaction.c
+++ b/source/blender/editors/mask/mask_editaction.c
@@ -51,9 +51,9 @@
/* ***************************************** */
/* NOTE ABOUT THIS FILE:
- * This file contains code for editing Mask data in the Action Editor
- * as a 'keyframes', so that a user can adjust the timing of Mask shapekeys.
- * Therefore, this file mostly contains functions for selecting Mask frames (shapekeys).
+ * This file contains code for editing Mask data in the Action Editor
+ * as a 'keyframes', so that a user can adjust the timing of Mask shapekeys.
+ * Therefore, this file mostly contains functions for selecting Mask frames (shapekeys).
*/
/* ***************************************** */
/* Generics - Loopers */
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c
index 7ea89c56432..1e5e279ef35 100644
--- a/source/blender/editors/mesh/editmesh_extrude.c
+++ b/source/blender/editors/mesh/editmesh_extrude.c
@@ -161,15 +161,15 @@ static bool edbm_extrude_discrete_faces(BMEditMesh *em, wmOperator *op, const ch
}
/* extrudes individual edges */
-static bool edbm_extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char hflag)
+static bool edbm_extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char hflag, const bool use_normal_flip)
{
BMesh *bm = em->bm;
BMOperator bmop;
EDBM_op_init(
em, &bmop, op,
- "extrude_edge_only edges=%he use_select_history=%b",
- hflag, true);
+ "extrude_edge_only edges=%he use_normal_flip=%b use_select_history=%b",
+ hflag, use_normal_flip, true);
/* deselect original verts */
BM_SELECT_HISTORY_BACKUP(bm);
@@ -236,6 +236,7 @@ static char edbm_extrude_htype_from_em_select(BMEditMesh *em)
static bool edbm_extrude_ex(
Object *obedit, BMEditMesh *em,
char htype, const char hflag,
+ const bool use_normal_flip,
const bool use_mirror,
const bool use_select_history)
{
@@ -250,6 +251,7 @@ static bool edbm_extrude_ex(
}
BMO_op_init(bm, &extop, BMO_FLAG_DEFAULTS, "extrude_face_region");
+ BMO_slot_bool_set(extop.slots_in, "use_normal_flip", use_normal_flip);
BMO_slot_bool_set(extop.slots_in, "use_select_history", use_select_history);
BMO_slot_buffer_from_enabled_hflag(bm, &extop, extop.slots_in, "geom", htype, hflag);
@@ -302,7 +304,7 @@ static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op)
mul_m3_v3(tmat, dvec);
for (a = 0; a < steps; a++) {
- edbm_extrude_ex(obedit, em, BM_ALL_NOLOOP, BM_ELEM_SELECT, false, false);
+ edbm_extrude_ex(obedit, em, BM_ALL_NOLOOP, BM_ELEM_SELECT, false, false, false);
BMO_op_callf(
em->bm, BMO_FLAG_DEFAULTS,
@@ -345,9 +347,10 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
/* generic extern called extruder */
static bool edbm_extrude_mesh(Object *obedit, BMEditMesh *em, wmOperator *op)
{
- bool changed = false;
+ const bool use_normal_flip = RNA_boolean_get(op->ptr, "use_normal_flip");
const char htype = edbm_extrude_htype_from_em_select(em);
enum {NONE = 0, ELEM_FLAG, VERT_ONLY, EDGE_ONLY} nr;
+ bool changed = false;
if (em->selectmode & SCE_SELECT_VERTEX) {
if (em->bm->totvertsel == 0) nr = NONE;
@@ -369,13 +372,13 @@ static bool edbm_extrude_mesh(Object *obedit, BMEditMesh *em, wmOperator *op)
case NONE:
return false;
case ELEM_FLAG:
- changed = edbm_extrude_ex(obedit, em, htype, BM_ELEM_SELECT, true, true);
+ changed = edbm_extrude_ex(obedit, em, htype, BM_ELEM_SELECT, use_normal_flip, true, true);
break;
case VERT_ONLY:
changed = edbm_extrude_verts_indiv(em, op, BM_ELEM_SELECT);
break;
case EDGE_ONLY:
- changed = edbm_extrude_edges_indiv(em, op, BM_ELEM_SELECT);
+ changed = edbm_extrude_edges_indiv(em, op, BM_ELEM_SELECT, use_normal_flip);
break;
}
@@ -421,6 +424,7 @@ void MESH_OT_extrude_region(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+ RNA_def_boolean(ot->srna, "use_normal_flip", false, "Flip Normals", "");
Transform_Properties(ot, P_NO_DEFAULTS | P_MIRROR_DUMMY);
}
@@ -470,8 +474,9 @@ static int edbm_extrude_edges_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BKE_editmesh_from_object(obedit);
+ const bool use_normal_flip = RNA_boolean_get(op->ptr, "use_normal_flip");
- edbm_extrude_edges_indiv(em, op, BM_ELEM_SELECT);
+ edbm_extrude_edges_indiv(em, op, BM_ELEM_SELECT, use_normal_flip);
EDBM_update_generic(em, true, true);
@@ -493,6 +498,7 @@ void MESH_OT_extrude_edges_indiv(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* to give to transform */
+ RNA_def_boolean(ot->srna, "use_normal_flip", false, "Flip Normals", "");
Transform_Properties(ot, P_NO_DEFAULTS | P_MIRROR_DUMMY);
}
@@ -664,7 +670,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
EDBM_project_snap_verts(C, vc.ar, vc.em);
}
- edbm_extrude_ex(vc.obedit, vc.em, extrude_htype, BM_ELEM_SELECT, true, true);
+ edbm_extrude_ex(vc.obedit, vc.em, extrude_htype, BM_ELEM_SELECT, false, true, true);
EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v matrix=%m3",
BM_ELEM_SELECT, center, mat);
EDBM_op_callf(vc.em, op, "translate verts=%hv vec=%v",
diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.c b/source/blender/editors/mesh/editmesh_extrude_spin.c
index 5f1670bf57d..a9e78f74012 100644
--- a/source/blender/editors/mesh/editmesh_extrude_spin.c
+++ b/source/blender/editors/mesh/editmesh_extrude_spin.c
@@ -61,16 +61,18 @@ static int edbm_spin_exec(bContext *C, wmOperator *op)
BMOperator spinop;
float cent[3], axis[3];
float d[3] = {0.0f, 0.0f, 0.0f};
- int steps, dupli;
- float angle;
RNA_float_get_array(op->ptr, "center", cent);
RNA_float_get_array(op->ptr, "axis", axis);
- steps = RNA_int_get(op->ptr, "steps");
- angle = RNA_float_get(op->ptr, "angle");
- //if (ts->editbutflag & B_CLOCKWISE)
- angle = -angle;
- dupli = RNA_boolean_get(op->ptr, "dupli");
+ const int steps = RNA_int_get(op->ptr, "steps");
+ const float angle = RNA_float_get(op->ptr, "angle");
+ const bool use_normal_flip = RNA_boolean_get(op->ptr, "use_normal_flip") ^ (angle < 0.0f);
+ const bool dupli = RNA_boolean_get(op->ptr, "dupli");
+ const bool use_auto_merge = (
+ RNA_boolean_get(op->ptr, "use_auto_merge") &&
+ (dupli == false) &&
+ (steps >= 3) &&
+ fabsf((fabsf(angle) - (M_PI * 2))) <= 1e-6f);
if (is_zero_v3(axis)) {
BKE_report(op->reports, RPT_ERROR, "Invalid/unset axis");
@@ -78,15 +80,20 @@ static int edbm_spin_exec(bContext *C, wmOperator *op)
}
/* keep the values in worldspace since we're passing the obmat */
- if (!EDBM_op_init(em, &spinop, op,
- "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 use_duplicate=%b",
- BM_ELEM_SELECT, cent, axis, d, steps, angle, obedit->obmat, dupli))
+ if (!EDBM_op_init(
+ em, &spinop, op,
+ "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 "
+ "use_normal_flip=%b use_duplicate=%b use_merge=%b",
+ BM_ELEM_SELECT, cent, axis, d, steps, -angle, obedit->obmat,
+ use_normal_flip, dupli, use_auto_merge))
{
return OPERATOR_CANCELLED;
}
BMO_op_exec(bm, &spinop);
- EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
+ if (use_auto_merge == false) {
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+ BMO_slot_buffer_hflag_enable(bm, spinop.slots_out, "geom_last.out", BM_ALL_NOLOOP, BM_ELEM_SELECT, true);
+ }
if (!EDBM_op_finish(em, &spinop, op, true)) {
return OPERATOR_CANCELLED;
}
@@ -118,6 +125,21 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e
return edbm_spin_exec(C, op);
}
+static bool edbm_spin_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
+{
+ const char *prop_id = RNA_property_identifier(prop);
+ const bool dupli = RNA_boolean_get(op->ptr, "dupli");
+
+ if (dupli) {
+ if (STREQ(prop_id, "use_auto_merge") ||
+ STREQ(prop_id, "use_normal_flip"))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
void MESH_OT_spin(wmOperatorType *ot)
{
PropertyRNA *prop;
@@ -131,6 +153,7 @@ void MESH_OT_spin(wmOperatorType *ot)
ot->invoke = edbm_spin_invoke;
ot->exec = edbm_spin_exec;
ot->poll = ED_operator_editmesh;
+ ot->poll_property = edbm_spin_poll_property;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -141,6 +164,8 @@ void MESH_OT_spin(wmOperatorType *ot)
prop = RNA_def_float(ot->srna, "angle", DEG2RADF(90.0f), -1e12f, 1e12f, "Angle", "Rotation for each step",
DEG2RADF(-360.0f), DEG2RADF(360.0f));
RNA_def_property_subtype(prop, PROP_ANGLE);
+ RNA_def_boolean(ot->srna, "use_auto_merge", true, "Auto Merge", "Merge first/last when the angle is a full revolution");
+ RNA_def_boolean(ot->srna, "use_normal_flip", 0, "Flip Normals", "");
RNA_def_float_vector(ot->srna, "center", 3, NULL, -1e12f, 1e12f,
"Center", "Center in global view space", -1e4f, 1e4f);
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 8eb3ad84919..9cc19d5194e 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -479,7 +479,7 @@ static KnifeEdge *get_bm_knife_edge(KnifeTool_OpData *kcd, BMEdge *e)
/* Record the index in kcd->em->looptris of first looptri triple for a given face,
* given an index for some triple in that array.
* This assumes that all of the triangles for a given face are contiguous
- * in that array (as they are by the current tesselation routines).
+ * in that array (as they are by the current tessellation routines).
* Actually store index + 1 in the hash, because 0 looks like "no entry"
* to hash lookup routine; will reverse this in the get routine.
* Doing this lazily rather than all at once for all faces.
@@ -502,7 +502,7 @@ static void set_lowest_face_tri(KnifeTool_OpData *kcd, BMFace *f, int index)
if (i == -1)
i++;
- BLI_ghash_insert(kcd->facetrimap, f, SET_INT_IN_POINTER(i + 1));
+ BLI_ghash_insert(kcd->facetrimap, f, POINTER_FROM_INT(i + 1));
}
/* This should only be called for faces that have had a lowest face tri set by previous function */
@@ -510,7 +510,7 @@ static int get_lowest_face_tri(KnifeTool_OpData *kcd, BMFace *f)
{
int ans;
- ans = GET_INT_FROM_POINTER(BLI_ghash_lookup(kcd->facetrimap, f));
+ ans = POINTER_AS_INT(BLI_ghash_lookup(kcd->facetrimap, f));
BLI_assert(ans != 0);
return ans - 1;
}
@@ -1217,7 +1217,7 @@ static bool knife_ray_intersect_face(
lv2 = kcd->cagecos[BM_elem_index_get(tri[1]->v)];
lv3 = kcd->cagecos[BM_elem_index_get(tri[2]->v)];
/* using epsilon test in case ray is directly through an internal
- * tesselation edge and might not hit either tesselation tri with
+ * tessellation edge and might not hit either tessellation tri with
* an exact test;
* we will exclude hits near real edges by a later test */
if (isect_ray_tri_epsilon_v3(v1, raydir, lv1, lv2, lv3, &lambda, ray_tri_uv, KNIFE_FLT_EPS)) {
@@ -1542,8 +1542,8 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
}
/* unproject screen line */
- ED_view3d_win_to_segment(kcd->ar, kcd->vc.v3d, s1, v1, v3, true);
- ED_view3d_win_to_segment(kcd->ar, kcd->vc.v3d, s2, v2, v4, true);
+ ED_view3d_win_to_segment_clipped(kcd->ar, kcd->vc.v3d, s1, v1, v3, true);
+ ED_view3d_win_to_segment_clipped(kcd->ar, kcd->vc.v3d, s2, v2, v4, true);
mul_m4_v3(kcd->ob->imat, v1);
mul_m4_v3(kcd->ob->imat, v2);
@@ -1551,7 +1551,7 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
mul_m4_v3(kcd->ob->imat, v4);
/* numeric error, 'v1' -> 'v2', 'v2' -> 'v4' can end up being ~2000 units apart in otho mode
- * (from ED_view3d_win_to_segment_clip() above)
+ * (from ED_view3d_win_to_segment_clipped() above)
* this gives precision error; rather then solving properly
* (which may involve using doubles everywhere!),
* limit the distance between these points */
@@ -2194,7 +2194,7 @@ static int knife_update_active(KnifeTool_OpData *kcd)
/* if no hits are found this would normally default to (0, 0, 0) so instead
* get a point at the mouse ray closest to the previous point.
* Note that drawing lines in `free-space` isn't properly supported
- * but theres no guarantee (0, 0, 0) has any geometry either - campbell */
+ * but there's no guarantee (0, 0, 0) has any geometry either - campbell */
if (kcd->curr.vert == NULL && kcd->curr.edge == NULL && kcd->curr.bmface == NULL) {
float origin[3];
float origin_ofs[3];
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 313dd28e806..7b687f7f045 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -2898,7 +2898,7 @@ static float bm_edge_seg_isect(
b2 = ((x22 * y21) - (x21 * y22)) / xdiff2;
}
else {
- m2 = MAXSLOPE; /* Verticle slope */
+ m2 = MAXSLOPE; /* Vertical slope */
b2 = x22;
}
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 7a344be8e5a..65b42571bbc 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -433,14 +433,14 @@ void EDBM_selectmode_flush(BMEditMesh *em)
void EDBM_deselect_flush(BMEditMesh *em)
{
- /* function below doesnt use. just do this to keep the values in sync */
+ /* function below doesn't use. just do this to keep the values in sync */
em->bm->selectmode = em->selectmode;
BM_mesh_deselect_flush(em->bm);
}
void EDBM_select_flush(BMEditMesh *em)
{
- /* function below doesnt use. just do this to keep the values in sync */
+ /* function below doesn't use. just do this to keep the values in sync */
em->bm->selectmode = em->selectmode;
BM_mesh_select_flush(em->bm);
}
@@ -1499,7 +1499,7 @@ bool BMBVH_EdgeVisible(struct BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v
ar->winy / 2.0f,
};
- ED_view3d_win_to_segment(ar, v3d, mval_f, origin, end, false);
+ ED_view3d_win_to_segment_clipped(ar, v3d, mval_f, origin, end, false);
invert_m4_m4(invmat, obedit->obmat);
mul_m4_v3(invmat, origin);
diff --git a/source/blender/editors/mesh/mesh_mirror.c b/source/blender/editors/mesh/mesh_mirror.c
index 20ece9c3336..1615ec75565 100644
--- a/source/blender/editors/mesh/mesh_mirror.c
+++ b/source/blender/editors/mesh/mesh_mirror.c
@@ -262,7 +262,7 @@ void ED_mesh_mirrtopo_init(Mesh *me, DerivedMesh *dm, const int ob_mode, MirrTop
/* sort so we can count unique values */
qsort(topo_hash_prev, totvert, sizeof(MirrTopoHash_t), mirrtopo_hash_sort);
- tot_unique = 1; /* account for skiping the first value */
+ tot_unique = 1; /* account for skipping the first value */
for (a = 1; a < totvert; a++) {
if (topo_hash_prev[a - 1] != topo_hash_prev[a]) {
tot_unique++;
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index 658bc5996a8..f3f7338716c 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -262,7 +262,7 @@ void ED_operatormacros_mesh(void)
RNA_boolean_set(otmacro->ptr, "mirror", false);
ot = WM_operatortype_append_macro("MESH_OT_extrude_region_shrink_fatten", "Extrude Region and Shrink/Fatten",
- "Extrude region and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
+ "Extrude along normals and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
RNA_enum_set(otmacro->ptr, "proportional", 0);
@@ -297,7 +297,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
int i;
- keymap = WM_keymap_find(keyconf, "Mesh", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Mesh", 0, 0);
keymap->poll = ED_operator_editmesh;
WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0);
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 8980e1830cf..3e9025baf40 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -349,9 +349,9 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
/* - if destination mesh had shapekeys, move them somewhere safe, and set up placeholders
- * with arrays that are large enough to hold shapekey data for all meshes
- * - if destination mesh didn't have shapekeys, but we encountered some in the meshes we're
- * joining, set up a new keyblock and assign to the mesh
+ * with arrays that are large enough to hold shapekey data for all meshes
+ * - if destination mesh didn't have shapekeys, but we encountered some in the meshes we're
+ * joining, set up a new keyblock and assign to the mesh
*/
if (key) {
/* make a duplicate copy that will only be used here... (must remember to free it!) */
diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c
index 3ea5f891f5f..b277584ab9e 100644
--- a/source/blender/editors/metaball/mball_ops.c
+++ b/source/blender/editors/metaball/mball_ops.c
@@ -72,7 +72,7 @@ void ED_keymap_metaball(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap = WM_keymap_find(keyconf, "Metaball", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Metaball", 0, 0);
keymap->poll = ED_operator_editmball;
WM_keymap_add_item(keymap, "OBJECT_OT_metaball_add", AKEY, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 214c995a26e..c343175c075 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -499,7 +499,7 @@ static int constraint_type_get(Object *owner, bPoseChannel *pchan)
}
/* checks validity of object pointers, and NULLs,
- * if Bone doesnt exist it sets the CONSTRAINT_DISABLE flag.
+ * if Bone doesn't exist it sets the CONSTRAINT_DISABLE flag.
*/
static void test_constraints(Main *bmain, Object *owner, bPoseChannel *pchan)
{
@@ -787,10 +787,10 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
if (ob && ob->pose && (pchan = BKE_pose_channel_active(ob))) {
bConstraint *con_last;
/* calculate/set inverse matrix:
- * We just calculate all transform-stack eval up to but not including this constraint.
- * This is because inverse should just inverse correct for just the constraint's influence
- * when it gets applied; that is, at the time of application, we don't know anything about
- * what follows.
+ * We just calculate all transform-stack eval up to but not including this constraint.
+ * This is because inverse should just inverse correct for just the constraint's influence
+ * when it gets applied; that is, at the time of application, we don't know anything about
+ * what follows.
*/
float imat[4][4], tmat[4][4];
float pmat[4][4];
@@ -1760,7 +1760,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
return OPERATOR_CANCELLED;
}
- /* create a new constraint of the type requried, and add it to the active/given constraints list */
+ /* create a new constraint of the type required, and add it to the active/given constraints list */
if (pchan)
con = BKE_constraint_add_for_pose(ob, pchan, NULL, type);
else
@@ -1995,7 +1995,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED
return OPERATOR_CANCELLED;
}
- /* prepare popup menu to choose targetting options */
+ /* prepare popup menu to choose targeting options */
pup = UI_popup_menu_begin(C, IFACE_("Add IK"), ICON_NONE);
layout = UI_popup_menu_layout(pup);
@@ -2062,7 +2062,7 @@ static int pose_ik_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
bConstraint *con, *next;
- /* TODO: should we be checking if these contraints were local before we try and remove them? */
+ /* TODO: should we be checking if these constraints were local before we try and remove them? */
for (con = pchan->constraints.first; con; con = next) {
next = con->next;
if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 407cddedbb0..f6db6d1f5fc 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -287,7 +287,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
int i;
/* Objects, Regardless of Mode -------------------------------------------------- */
- keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Object Non-modal", 0, 0);
/* Note: this keymap works disregarding mode */
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
@@ -310,7 +310,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
/* Object Mode ---------------------------------------------------------------- */
/* Note: this keymap gets disabled in non-objectmode, */
- keymap = WM_keymap_find(keyconf, "Object Mode", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Object Mode", 0, 0);
keymap->poll = object_mode_poll;
/* object mode supports PET now */
diff --git a/source/blender/editors/object/object_random.c b/source/blender/editors/object/object_random.c
index a293f7a950e..05726e5be2d 100644
--- a/source/blender/editors/object/object_random.c
+++ b/source/blender/editors/object/object_random.c
@@ -45,7 +45,7 @@
/**
- * Generic randomize vertices function
+ * Generic randomize vertices function
*/
static bool object_rand_transverts(
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 6c5076ef563..e11782cd4b3 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -491,7 +491,7 @@ static void mesh_defvert_mirror_update_internal(
const int def_nr)
{
if (def_nr == -1) {
- /* all vgroups, add groups where neded */
+ /* all vgroups, add groups where needed */
int flip_map_len;
int *flip_map = defgroup_flip_map(ob, &flip_map_len, true);
defvert_sync_mapped(dvert_dst, dvert_src, flip_map, flip_map_len, true);
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index 480d17bbf85..dc94cab0733 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -316,7 +316,7 @@ static void dpaint_bake_endjob(void *customdata)
WM_set_locked_interface(G_MAIN->wm.first, false);
/* Bake was successful:
- * Report for ended bake and how long it took */
+ * Report for ended bake and how long it took */
if (job->success) {
/* Show bake info */
WM_reportf(RPT_INFO, "DynamicPaint: Bake complete! (%.2f)", PIL_check_seconds_timer() - job->start);
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index a03892a26d1..181c42a4072 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -3212,7 +3212,7 @@ static void brush_puff(PEData *data, int point_index)
#else
/* translate (not rotate) the rest of the hair if its not selected */
{
-#if 0 /* kindof works but looks worse then whats below */
+#if 0 /* kindof works but looks worse then what's below */
/* Move the unselected point on a vector based on the
* hair direction and the offset */
@@ -3522,7 +3522,7 @@ static int brush_add(PEData *data, short number)
mco[0] = data->mval[0] + dmx;
mco[1] = data->mval[1] + dmy;
- ED_view3d_win_to_segment(data->vc.ar, data->vc.v3d, mco, co1, co2, true);
+ ED_view3d_win_to_segment_clipped(data->vc.ar, data->vc.v3d, mco, co1, co2, true);
mul_m4_v3(imat, co1);
mul_m4_v3(imat, co2);
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 1cd2528b3ca..f960d6ed97b 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -42,6 +42,7 @@
#include "DNA_object_fluidsim_types.h"
#include "BLI_blenlib.h"
+#include "BLI_path_util.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
@@ -868,8 +869,8 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
fb= MEM_callocN(sizeof(FluidBakeJob), "fluid bake job");
- if (getenv(strEnvName)) {
- int dlevel = atoi(getenv(strEnvName));
+ if (BLI_getenv(strEnvName)) {
+ int dlevel = atoi(BLI_getenv(strEnvName));
elbeemSetDebugLevel(dlevel);
BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::msg: Debug messages activated due to envvar '%s'\n", strEnvName);
elbeemDebugOut(debugStrBuffer);
diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c
index de2ee73ab26..910e461435c 100644
--- a/source/blender/editors/physics/physics_ops.c
+++ b/source/blender/editors/physics/physics_ops.c
@@ -112,7 +112,7 @@ static void keymap_particle(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
wmKeyMap *keymap;
- keymap = WM_keymap_find(keyconf, "Particle", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Particle", 0, 0);
keymap->poll = PE_poll;
kmi = WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", AKEY, KM_PRESS, 0, 0);
@@ -221,7 +221,7 @@ static void operatortypes_dynamicpaint(void)
//static void keymap_pointcache(wmWindowManager *wm)
//{
-// wmKeyMap *keymap = WM_keymap_find(wm, "Pointcache", 0, 0);
+// wmKeyMap *keymap = WM_keymap_ensure(wm, "Pointcache", 0, 0);
//
// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_all", AKEY, KM_PRESS, 0, 0);
// WM_keymap_add_item(keymap, "PHYSICS_OT_free_all", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 59538df7a05..d94776d126f 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -759,7 +759,7 @@ static int render_break(void *UNUSED(rjv))
}
/* runs in thread, no cursor setting here works. careful with notifiers too (malloc conflicts) */
-/* maybe need a way to get job send notifer? */
+/* maybe need a way to get job send notifier? */
static void render_drawlock(void *rjv, int lock)
{
RenderJob *rj = rjv;
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 6e4cbf27e28..3ca989c92fe 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -633,7 +633,7 @@ void ED_area_headerprint(ScrArea *sa, const char *str)
{
ARegion *ar;
- /* happens when running transform operators in backround mode */
+ /* happens when running transform operators in background mode */
if (sa == NULL)
return;
@@ -660,7 +660,7 @@ static void area_azone_initialize(wmWindow *win, bScreen *screen, ScrArea *sa)
{
AZone *az;
- /* reinitalize entirely, regions and fullscreen add azones too */
+ /* reinitialize entirely, regions and fullscreen add azones too */
BLI_freelistN(&sa->actionzones);
if (screen->state != SCREENNORMAL) {
@@ -1375,7 +1375,7 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
/* XXX it would be good to have boundbox checks for some of these... */
if (flag & ED_KEYMAP_UI) {
- wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "User Interface", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "User Interface", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
/* user interface widgets */
@@ -1383,12 +1383,12 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
}
if (flag & ED_KEYMAP_VIEW2D) {
/* 2d-viewport handling+manipulation */
- wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "View2D", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "View2D", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
if (flag & ED_KEYMAP_MARKERS) {
/* time-markers */
- wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Markers", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Markers", 0, 0);
/* time space only has this keymap, the others get a boundbox restricted map */
if (sa->spacetype != SPACE_TIME) {
@@ -1406,12 +1406,12 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
}
if (flag & ED_KEYMAP_ANIMATION) {
/* frame changing and timeline operators (for time spaces) */
- wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Animation", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Animation", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
if (flag & ED_KEYMAP_FRAMES) {
/* frame changing/jumping (for all spaces) */
- wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Frames", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
if (flag & ED_KEYMAP_GPENCIL) {
@@ -1423,15 +1423,15 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
* For now, it's easier to just include both,
* since you hardly want one without the other.
*/
- wmKeyMap *keymap_general = WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0);
- wmKeyMap *keymap_edit = WM_keymap_find(wm->defaultconf, "Grease Pencil Stroke Edit Mode", 0, 0);
+ wmKeyMap *keymap_general = WM_keymap_ensure(wm->defaultconf, "Grease Pencil", 0, 0);
+ wmKeyMap *keymap_edit = WM_keymap_ensure(wm->defaultconf, "Grease Pencil Stroke Edit Mode", 0, 0);
WM_event_add_keymap_handler(handlers, keymap_general);
WM_event_add_keymap_handler(handlers, keymap_edit);
}
if (flag & ED_KEYMAP_HEADER) {
/* standard keymap for headers regions */
- wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Header", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Header", 0, 0);
WM_event_add_keymap_handler(handlers, keymap);
}
}
@@ -2024,7 +2024,7 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy);
- keymap = WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "View2D Buttons List", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index e4d748afecf..2e8c5204b3d 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -572,7 +572,7 @@ int area_getorientation(ScrArea *sa, ScrArea *sb)
}
/* Helper function to join 2 areas, it has a return value, 0=failed 1=success
- * used by the split, join operators
+ * used by the split, join operators
*/
int screen_area_join(bContext *C, bScreen *scr, ScrArea *sa1, ScrArea *sa2)
{
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 44467b6a994..4f9cd7a42b6 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4259,7 +4259,7 @@ static void SCENE_OT_delete(wmOperatorType *ot)
/* implementation note: a disappearing region needs at least 1 last draw with 100% backbuffer
* texture over it- then triple buffer will clear it entirely.
- * This because flag RGN_HIDDEN is set in end - region doesnt draw at all then */
+ * This because flag RGN_HIDDEN is set in end - region doesn't draw at all then */
typedef struct RegionAlphaInfo {
ScrArea *sa;
@@ -4604,7 +4604,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* Screen Editing ------------------------------------------------ */
- keymap = WM_keymap_find(keyconf, "Screen Editing", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Screen Editing", 0, 0);
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "modifier", 0);
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "modifier", 1);
@@ -4627,12 +4627,12 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
/* Header Editing ------------------------------------------------ */
/* note: this is only used when the cursor is inside the header */
- keymap = WM_keymap_find(keyconf, "Header", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Header", 0, 0);
WM_keymap_add_item(keymap, "SCREEN_OT_header_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0);
/* Screen General ------------------------------------------------ */
- keymap = WM_keymap_find(keyconf, "Screen", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Screen", 0, 0);
/* standard timers */
WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0);
@@ -4696,7 +4696,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
/* Anim Playback ------------------------------------------------ */
- keymap = WM_keymap_find(keyconf, "Frames", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Frames", 0, 0);
/* frame offsets */
RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "delta", 10);
@@ -4735,7 +4735,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
/* Alternative keys for animation and sequencer playing */
#if 0 /* XXX: disabled for restoring later... bad implementation */
- keymap = WM_keymap_find(keyconf, "Frames", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Frames", 0, 0);
kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "cycle_speed", true);
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 76190b13b61..ddfee5de4d7 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -700,7 +700,7 @@ static void brush_painter_2d_refresh_cache(ImagePaintState *s, BrushPainter *pai
do_partial_update_mask = true;
renew_maxmask = true;
}
- /* explicilty disable partial update even if it has been enabled above */
+ /* explicitly disable partial update even if it has been enabled above */
if (brush->mask_pressure) {
do_partial_update_mask = false;
renew_maxmask = true;
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 6b13decd41b..81a44317735 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -183,7 +183,7 @@ BLI_INLINE unsigned char f_to_char(const float val)
#define PROJ_VERT_CULL 1
/* to avoid locking in tile initialization */
-#define TILE_PENDING SET_INT_IN_POINTER(-1)
+#define TILE_PENDING POINTER_FROM_INT(-1)
/* This is mainly a convenience struct used so we can keep an array of images we use -
* their imbufs, etc, in 1 array, When using threads this array is copied for each thread
@@ -566,7 +566,7 @@ static float VecZDepthPersp(
}
else /* dummy values for zero area face */
w_tmp[0] = w_tmp[1] = w_tmp[2] = 1.0f / 3.0f;
- /* done mimicing barycentric_weights_v2() */
+ /* done mimicking barycentric_weights_v2() */
return (v1[2] * w_tmp[0]) + (v2[2] * w_tmp[1]) + (v3[2] * w_tmp[2]);
}
@@ -593,7 +593,7 @@ static int project_paint_PickFace(
* that the point its testing is only every originated from an existing face */
for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
- const int tri_index = GET_INT_FROM_POINTER(node->link);
+ const int tri_index = POINTER_AS_INT(node->link);
const MLoopTri *lt = &ps->dm_mlooptri[tri_index];
const float *vtri_ss[3] = {
ps->screenCoords[ps->dm_mloop[lt->tri[0]].v],
@@ -807,7 +807,7 @@ static bool project_bucket_point_occluded(
* that the point its testing is only every originated from an existing face */
for (; bucketFace; bucketFace = bucketFace->next) {
- const int tri_index = GET_INT_FROM_POINTER(bucketFace->link);
+ const int tri_index = POINTER_AS_INT(bucketFace->link);
if (orig_face != tri_index) {
const MLoopTri *lt = &ps->dm_mlooptri[tri_index];
@@ -1028,7 +1028,7 @@ static bool check_seam(
int i1_fidx = -1, i2_fidx = -1; /* index in face */
for (node = ps->vertFaces[i1]; node; node = node->next) {
- const int tri_index = GET_INT_FROM_POINTER(node->link);
+ const int tri_index = POINTER_AS_INT(node->link);
if (tri_index != orig_face) {
const MLoopTri *lt = &ps->dm_mlooptri[tri_index];
@@ -1690,7 +1690,7 @@ static ProjPixel *project_paint_uvpixel_init(
if (ibuf->rect_float) projPixel->pixel.f_pt[0] = 0;
else projPixel->pixel.ch_pt[0] = 0;
#endif
- /* pointer arithmetics */
+ /* pointer arithmetic */
projPixel->image_index = projima - ps->projImages;
return projPixel;
@@ -2582,7 +2582,7 @@ static void project_paint_face_init(
v2coSS = ps->screenCoords[lt_vtri[1]];
v3coSS = ps->screenCoords[lt_vtri[2]];
- /* This funtion gives is a concave polyline in UV space from the clipped tri*/
+ /* This function gives is a concave polyline in UV space from the clipped tri*/
project_bucket_clip_face(
is_ortho, is_flip_object,
clip_rect, bucket_bounds,
@@ -2627,7 +2627,7 @@ static void project_paint_face_init(
//uv[0] = (((float)x) + 0.5f) / ibuf->x;
uv[0] = (float)x / ibuf_xf; /* use pixel offset UV coords instead */
- /* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesnt work,
+ /* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesn't work,
* could check the poly direction but better to do this */
if ((do_backfacecull == true && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) ||
(do_backfacecull == false && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot)))
@@ -2720,7 +2720,7 @@ static void project_paint_face_init(
/* Now create new UV's for the seam face */
float (*outset_uv)[2] = ps->faceSeamUVs[tri_index];
- float insetCos[3][3]; /* inset face coords. NOTE!!! ScreenSace for ortho, Worldspace in prespective view */
+ float insetCos[3][3]; /* inset face coords. NOTE!!! ScreenSace for ortho, Worldspace in perspective view */
const float *vCoSS[3]; /* vertex screenspace coords */
@@ -2937,7 +2937,7 @@ static void project_bucket_init(
for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
project_paint_face_init(
- ps, thread_index, bucket_index, GET_INT_FROM_POINTER(node->link), 0,
+ ps, thread_index, bucket_index, POINTER_AS_INT(node->link), 0,
clip_rect, bucket_bounds, ibuf, &tmpibuf,
(ima->tpageflag & IMA_CLAMP_U) != 0, (ima->tpageflag & IMA_CLAMP_V) != 0);
}
@@ -2946,7 +2946,7 @@ static void project_bucket_init(
/* More complicated loop, switch between images */
for (node = ps->bucketFaces[bucket_index]; node; node = node->next) {
- tri_index = GET_INT_FROM_POINTER(node->link);
+ tri_index = POINTER_AS_INT(node->link);
/* Image context switching */
tpage = project_paint_face_paint_image(ps, tri_index);
@@ -3057,7 +3057,7 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MLoopTri *
int bucket_index = bucket_x + (bucket_y * ps->buckets_x);
BLI_linklist_prepend_arena(
&ps->bucketFaces[bucket_index],
- SET_INT_IN_POINTER(tri_index), /* cast to a pointer to shut up the compiler */
+ POINTER_FROM_INT(tri_index), /* cast to a pointer to shut up the compiler */
arena
);
@@ -3415,7 +3415,7 @@ static void project_paint_bleed_add_face_user(
/* annoying but we need to add all faces even ones we never use elsewhere */
if (ps->seam_bleed_px > 0.0f) {
const int lt_vtri[3] = { PS_LOOPTRI_AS_VERT_INDEX_3(ps, lt) };
- void *tri_index_p = SET_INT_IN_POINTER(tri_index);
+ void *tri_index_p = POINTER_FROM_INT(tri_index);
BLI_linklist_prepend_arena(&ps->vertFaces[lt_vtri[0]], tri_index_p, arena);
BLI_linklist_prepend_arena(&ps->vertFaces[lt_vtri[1]], tri_index_p, arena);
BLI_linklist_prepend_arena(&ps->vertFaces[lt_vtri[2]], tri_index_p, arena);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index b42a825ad7c..74984d090f8 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -1255,13 +1255,13 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
int i;
- keymap = WM_keymap_find(keyconf, "Paint Curve", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Paint Curve", 0, 0);
keymap->poll = paint_curve_poll;
paint_keymap_curve(keymap);
/* Sculpt mode */
- keymap = WM_keymap_find(keyconf, "Sculpt", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Sculpt", 0, 0);
keymap->poll = sculpt_mode_poll;
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "mode", BRUSH_STROKE_NORMAL);
@@ -1337,7 +1337,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
WM_keymap_add_menu(keymap, "VIEW3D_MT_angle_control", RKEY, KM_PRESS, 0, 0);
/* Vertex Paint mode */
- keymap = WM_keymap_find(keyconf, "Vertex Paint", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Vertex Paint", 0, 0);
keymap->poll = vertex_paint_mode_poll;
WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
@@ -1364,7 +1364,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
RNA_string_set(kmi->ptr, "data_path", "tool_settings.vertex_paint.brush.stroke_method");
/* Weight Paint mode */
- keymap = WM_keymap_find(keyconf, "Weight Paint", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Weight Paint", 0, 0);
keymap->poll = weight_paint_mode_poll;
WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
@@ -1396,7 +1396,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
RNA_string_set(kmi->ptr, "data_path", "tool_settings.weight_paint.brush.use_smooth_stroke");
/*Weight paint's Vertex Selection Mode */
- keymap = WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Weight Paint Vertex Selection", 0, 0);
keymap->poll = vert_paint_poll;
kmi = WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
@@ -1410,7 +1410,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0);
/* Image/Texture Paint mode */
- keymap = WM_keymap_find(keyconf, "Image Paint", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Image Paint", 0, 0);
keymap->poll = image_texture_paint_poll;
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "mode", BRUSH_STROKE_NORMAL);
@@ -1439,7 +1439,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
RNA_string_set(kmi->ptr, "data_path", "tool_settings.image_paint.brush.stroke_method");
/* face-mask mode */
- keymap = WM_keymap_find(keyconf, "Face Mask", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "Face Mask", 0, 0);
keymap->poll = facemask_paint_poll;
kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0);
@@ -1458,7 +1458,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "deselect", true);
- keymap = WM_keymap_find(keyconf, "UV Sculpt", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "UV Sculpt", 0, 0);
keymap->poll = uv_sculpt_keymap_poll;
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", QKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 0fa5df4ad33..a98a246363a 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1351,7 +1351,7 @@ static void vwpaint_update_cache_variants(bContext *C, VPaint *vp, Object *ob, P
Brush *brush = BKE_paint_brush(&vp->paint);
/* This effects the actual brush radius, so things farther away
- * are compared with a larger radius and vise versa. */
+ * are compared with a larger radius and vice versa. */
if (cache->first_time) {
RNA_float_get_array(ptr, "location", cache->true_location);
}
@@ -1600,7 +1600,8 @@ static void do_wpaint_brush_blur_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
const struct SculptVertexPaintGeomMap *gmap = &ss->mode.wpaint.gmap;
const Brush *brush = data->brush;
@@ -1627,8 +1628,8 @@ static void do_wpaint_brush_blur_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
/* For grid based pbvh, take the vert whose loop coopresponds to the current grid.
* Otherwise, take the current vert. */
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
- const float grid_alpha = ccgdm ? 1.0f / vd.gridsize : 1.0f;
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ const float grid_alpha = has_grids ? 1.0f / vd.gridsize : 1.0f;
const char v_flag = data->me->mvert[v_index].flag;
/* If the vertex is selected */
if (!(use_face_sel || use_vert_sel) || v_flag & SELECT) {
@@ -1672,7 +1673,7 @@ static void do_wpaint_brush_blur_task_cb_ex(
}
weight_final /= total_hit_loops;
- /* Only paint visable verts */
+ /* Only paint visible verts */
do_weight_paint_vertex(
data->vp, data->ob, data->wpi,
v_index, final_alpha, weight_final);
@@ -1691,7 +1692,8 @@ static void do_wpaint_brush_smear_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
const struct SculptVertexPaintGeomMap *gmap = &ss->mode.wpaint.gmap;
const Brush *brush = data->brush;
@@ -1723,8 +1725,8 @@ static void do_wpaint_brush_smear_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
/* For grid based pbvh, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
- const float grid_alpha = ccgdm ? 1.0f / vd.gridsize : 1.0f;
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ const float grid_alpha = has_grids ? 1.0f / vd.gridsize : 1.0f;
const MVert *mv_curr = &data->me->mvert[v_index];
/* If the vertex is selected */
@@ -1800,7 +1802,8 @@ static void do_wpaint_brush_draw_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
const Scene *scene = CTX_data_scene(data->C);
const Brush *brush = data->brush;
@@ -1829,8 +1832,8 @@ static void do_wpaint_brush_draw_task_cb_ex(
/* Note: grids are 1:1 with corners (aka loops).
* For multires, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
- const float grid_alpha = ccgdm ? 1.0f / vd.gridsize : 1.0f;
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ const float grid_alpha = has_grids ? 1.0f / vd.gridsize : 1.0f;
const char v_flag = data->me->mvert[v_index].flag;
/* If the vertex is selected */
@@ -1873,7 +1876,8 @@ static void do_wpaint_brush_calc_average_weight_cb_ex(
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
StrokeCache *cache = ss->cache;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
const bool use_normal = vwpaint_use_normal(data->vp);
const bool use_face_sel = (data->me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
@@ -1898,8 +1902,8 @@ static void do_wpaint_brush_calc_average_weight_cb_ex(
const float angle_cos = (use_normal && vd.no) ?
dot_vf3vs3(sculpt_normal_frontface, vd.no) : 1.0f;
if (angle_cos > 0.0 && BKE_brush_curve_strength(data->brush, sqrtf(test.dist), cache->radius) > 0.0) {
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
- // const float grid_alpha = ccgdm ? 1.0f / vd.gridsize : 1.0f;
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ // const float grid_alpha = has_grids ? 1.0f / vd.gridsize : 1.0f;
const char v_flag = data->me->mvert[v_index].flag;
/* If the vertex is selected. */
@@ -2390,7 +2394,7 @@ void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot)
* (return OPERATOR_FINISHED also removes handler and operator)
*
* For future:
- * - implement a stroke event (or mousemove with past positons)
+ * - implement a stroke event (or mousemove with past positions)
* - revise whether op->customdata should be added in object, in set_vpaint
*/
@@ -2506,7 +2510,8 @@ static void do_vpaint_brush_calc_average_color_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
const struct SculptVertexPaintGeomMap *gmap = &ss->mode.vpaint.gmap;
StrokeCache *cache = ss->cache;
@@ -2528,7 +2533,7 @@ static void do_vpaint_brush_calc_average_color_cb_ex(
{
/* Test to see if the vertex coordinates are within the spherical brush region. */
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
if (BKE_brush_curve_strength(data->brush, 0.0, cache->radius) > 0.0) {
/* If the vertex is selected for painting. */
const MVert *mv = &data->me->mvert[v_index];
@@ -2570,7 +2575,8 @@ static void do_vpaint_brush_draw_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
const struct SculptVertexPaintGeomMap *gmap = &ss->mode.vpaint.gmap;
const Brush *brush = data->brush;
@@ -2598,8 +2604,8 @@ static void do_vpaint_brush_draw_task_cb_ex(
/* Note: Grids are 1:1 with corners (aka loops).
* For grid based pbvh, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
- const float grid_alpha = ccgdm ? 1.0f / vd.gridsize : 1.0f;
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ const float grid_alpha = has_grids ? 1.0f / vd.gridsize : 1.0f;
const MVert *mv = &data->me->mvert[v_index];
/* If the vertex is selected for painting. */
@@ -2664,7 +2670,8 @@ static void do_vpaint_brush_blur_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
Scene *scene = CTX_data_scene(data->C);
const struct SculptVertexPaintGeomMap *gmap = &ss->mode.vpaint.gmap;
@@ -2691,8 +2698,8 @@ static void do_vpaint_brush_blur_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
/* For grid based pbvh, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
- const float grid_alpha = ccgdm ? 1.0f / vd.gridsize : 1.0f;
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ const float grid_alpha = has_grids ? 1.0f / vd.gridsize : 1.0f;
const MVert *mv = &data->me->mvert[v_index];
/* If the vertex is selected for painting. */
@@ -2775,7 +2782,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
- CCGDerivedMesh *ccgdm = BKE_pbvh_get_ccgdm(ss->pbvh);
+ const PBVHType pbvh_type = BKE_pbvh_type(ss->pbvh);
+ const bool has_grids = (pbvh_type == PBVH_GRIDS);
Scene *scene = CTX_data_scene(data->C);
const struct SculptVertexPaintGeomMap *gmap = &ss->mode.vpaint.gmap;
@@ -2808,8 +2816,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
/* For grid based pbvh, take the vert whose loop cooresponds to the current grid.
* Otherwise, take the current vert. */
- const int v_index = ccgdm ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
- const float grid_alpha = ccgdm ? 1.0f / vd.gridsize : 1.0f;
+ const int v_index = has_grids ? data->me->mloop[vd.grid_indices[vd.g]].v : vd.vert_indices[vd.i];
+ const float grid_alpha = has_grids ? 1.0f / vd.gridsize : 1.0f;
const MVert *mv_curr = &data->me->mvert[v_index];
/* if the vertex is selected for painting. */
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index 1a37973cd7d..21965bb30d8 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -238,7 +238,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
}
if (changed) {
- /* not really correct since the brush didnt change, but redraws the toolbar */
+ /* not really correct since the brush didn't change, but redraws the toolbar */
WM_main_add_notifier(NC_BRUSH | NA_EDITED, NULL); /* ts->wpaint->paint.brush */
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 74baa267b69..3895b8ed44b 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4688,7 +4688,7 @@ static float sculpt_raycast_init(
RegionView3D *rv3d = vc->ar->regiondata;
/* TODO: what if the segment is totally clipped? (return == 0) */
- ED_view3d_win_to_segment(vc->ar, vc->v3d, mouse, ray_start, ray_end, true);
+ ED_view3d_win_to_segment_clipped(vc->ar, vc->v3d, mouse, ray_start, ray_end, true);
invert_m4_m4(obimat, ob->obmat);
mul_m4_v3(obimat, ray_start);
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index bf5ddeb71ff..62e548f661c 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -589,10 +589,9 @@ static void sculpt_undo_restore_list(bContext *C, ListBase *lb)
static void sculpt_undo_free_list(ListBase *lb)
{
- SculptUndoNode *unode;
- int i;
-
- for (unode = lb->first; unode; unode = unode->next) {
+ SculptUndoNode *unode = lb->first;
+ while (unode != NULL) {
+ SculptUndoNode *unode_next = unode->next;
if (unode->co)
MEM_freeN(unode->co);
if (unode->no)
@@ -606,7 +605,7 @@ static void sculpt_undo_free_list(ListBase *lb)
if (unode->vert_hidden)
MEM_freeN(unode->vert_hidden);
if (unode->grid_hidden) {
- for (i = 0; i < unode->totgrid; i++) {
+ for (int i = 0; i < unode->totgrid; i++) {
if (unode->grid_hidden[i])
MEM_freeN(unode->grid_hidden[i]);
}
@@ -627,6 +626,10 @@ static void sculpt_undo_free_list(ListBase *lb)
CustomData_free(&unode->bm_enter_ldata, unode->bm_enter_totloop);
if (unode->bm_enter_totpoly)
CustomData_free(&unode->bm_enter_pdata, unode->bm_enter_totpoly);
+
+ MEM_freeN(unode);
+
+ unode = unode_next;
}
}
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index 32407286258..ea7591c36c0 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -275,7 +275,7 @@ void action_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap;
/* keymap for all regions */
- keymap = WM_keymap_find(keyconf, "Dopesheet Generic", SPACE_ACTION, 0);
+ keymap = WM_keymap_ensure(keyconf, "Dopesheet Generic", SPACE_ACTION, 0);
/* region management... */
WM_keymap_add_item(keymap, "ACTION_OT_properties", NKEY, KM_PRESS, 0, 0);
@@ -288,6 +288,6 @@ void action_keymap(wmKeyConfig *keyconf)
*/
/* keyframes */
- keymap = WM_keymap_find(keyconf, "Dopesheet", SPACE_ACTION, 0);
+ keymap = WM_keymap_ensure(keyconf, "Dopesheet", SPACE_ACTION, 0);
action_keymap_keyframes(keyconf, keymap);
}
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 83bda4d63a5..ee2fbbfbb30 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -1367,7 +1367,7 @@ static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_
* on either side of mouse click (size of keyframe icon)
*/
key_hsize = ACHANNEL_HEIGHT(ac) * 0.8f; /* standard channel height (to allow for some slop) */
- key_hsize = roundf(key_hsize / 2.0f); /* half-size (for either side), but rounded up to nearest int (for easier targetting) */
+ key_hsize = roundf(key_hsize / 2.0f); /* half-size (for either side), but rounded up to nearest int (for easier targeting) */
UI_view2d_region_to_view(v2d, mval[0] - (int)key_hsize, mval[1], &rectf.xmin, &rectf.ymin);
UI_view2d_region_to_view(v2d, mval[0] + (int)key_hsize, mval[1], &rectf.xmax, &rectf.ymax);
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 9082abc0575..a2fe129c819 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -192,9 +192,9 @@ static void action_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -266,10 +266,10 @@ static void action_channel_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Animation Channels", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -550,7 +550,7 @@ static void action_buttons_area_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 7bcad841bca..1ff0cb53f6a 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -131,7 +131,7 @@ static void buttons_main_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Property Editor", SPACE_BUTS, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Property Editor", SPACE_BUTS, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -185,7 +185,7 @@ static void buttons_operatortypes(void)
static void buttons_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Property Editor", SPACE_BUTS, 0);
WM_keymap_add_item(keymap, "BUTTONS_OT_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0);
}
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 4754d45a0d1..1d9669e3e97 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -113,12 +113,16 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2])
}
if ((U.uiflag & USER_ZOOM_TO_MOUSEPOS) && location) {
- float dx, dy;
+ float aspx, aspy, w, h, dx, dy;
ED_space_clip_get_size(sc, &width, &height);
+ ED_space_clip_get_aspect(sc, &aspx, &aspy);
- dx = ((location[0] - 0.5f) * width - sc->xof) * (sc->zoom - oldzoom) / sc->zoom;
- dy = ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom;
+ w = width * aspx;
+ h = height * aspy;
+
+ dx = ((location[0] - 0.5f) * w - sc->xof) * (sc->zoom - oldzoom) / sc->zoom;
+ dy = ((location[1] - 0.5f) * h - sc->yof) * (sc->zoom - oldzoom) / sc->zoom;
if (sc->flag & SC_LOCK_SELECTION) {
sc->xlockof += dx;
@@ -1585,7 +1589,7 @@ void CLIP_OT_cursor_set(wmOperatorType *ot)
"Cursor location in normalized clip coordinates", -10.0f, 10.0f);
}
-/********************** macroses *********************/
+/********************** macros *********************/
void ED_operatormacros_clip(void)
{
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 2d17460318e..35aa9896d12 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -548,7 +548,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
/* ******** Global hotkeys avalaible for all regions ******** */
- keymap = WM_keymap_find(keyconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(keyconf, "Clip", SPACE_CLIP, 0);
WM_keymap_add_item(keymap, "CLIP_OT_open", OKEY, KM_PRESS, KM_ALT, 0);
@@ -588,7 +588,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
/* ******** Hotkeys avalaible for main region only ******** */
- keymap = WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(keyconf, "Clip Editor", SPACE_CLIP, 0);
// keymap->poll = ED_space_clip_tracking_poll;
/* ** View/navigation ** */
@@ -756,7 +756,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
/* ******** Hotkeys avalaible for preview region only ******** */
- keymap = WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(keyconf, "Clip Graph Editor", SPACE_CLIP, 0);
/* "timeline" */
WM_keymap_add_item(keymap, "CLIP_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
@@ -810,7 +810,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
/* ******** Hotkeys avalaible for channels region only ******** */
- keymap = WM_keymap_find(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
kmi = WM_keymap_add_item(keymap, "CLIP_OT_dopesheet_select_channel", LEFTMOUSE, KM_PRESS, 0, 0);
RNA_boolean_set(kmi->ptr, "extend", true); /* toggle */
@@ -1137,14 +1137,14 @@ static void clip_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* mask polls mode */
- keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -1261,13 +1261,13 @@ static void clip_preview_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -1365,7 +1365,7 @@ static void clip_channels_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
- keymap = WM_keymap_find(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -1437,7 +1437,7 @@ static void clip_tools_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -1480,7 +1480,7 @@ static void clip_properties_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 3f5adf6c1c5..919602f7bb5 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -145,7 +145,7 @@ static void console_main_region_init(wmWindowManager *wm, ARegion *ar)
}
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
@@ -271,7 +271,7 @@ static void console_operatortypes(void)
static void console_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Console", SPACE_CONSOLE, 0);
wmKeyMapItem *kmi;
#ifdef __APPLE__
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index fd9a9ff9ab1..f407d82aa5e 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -560,7 +560,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
filelist_cache_previews_update(files);
/* Handle preview timer here, since it's filelist_file_cache_block() and filelist_cache_previews_update()
- * which controlls previews task. */
+ * which controls previews task. */
{
const bool previews_running = filelist_cache_previews_running(files);
// printf("%s: preview task: %d\n", __func__, previews_running);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 81bc585db82..c9de18d9ca8 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1301,7 +1301,7 @@ void file_operator_to_sfile(bContext *C, SpaceFile *sfile, wmOperator *op)
}
/* we could check for relative_path property which is used when converting
- * in the other direction but doesnt hurt to do this every time */
+ * in the other direction but doesn't hurt to do this every time */
BLI_path_abs(sfile->params->dir, BKE_main_blendfile_path(bmain));
/* XXX, files and dirs updates missing, not really so important though */
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 09e2660a762..368fc8be35c 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -215,7 +215,7 @@ typedef struct FileListInternEntry {
int blentype; /* ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
char *relpath;
- char *name; /* not striclty needed, but used during sorting, avoids to have to recompute it there... */
+ char *name; /* not strictly needed, but used during sorting, avoids to have to recompute it there... */
BLI_stat_t st;
} FileListInternEntry;
@@ -236,7 +236,7 @@ typedef struct FileListEntryCache {
/* This one gathers all entries from both block and misc caches. Used for easy bulk-freing. */
ListBase cached_entries;
- /* Block cache: all entries between start and end index. used for part of the list on diplay. */
+ /* Block cache: all entries between start and end index. used for part of the list on display. */
FileDirEntry **block_entries;
int block_start_index, block_end_index, block_center_index, block_cursor;
@@ -1516,7 +1516,7 @@ static FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index
return cache->block_entries[idx];
}
- if ((ret = BLI_ghash_lookup(cache->misc_entries, SET_INT_IN_POINTER(index)))) {
+ if ((ret = BLI_ghash_lookup(cache->misc_entries, POINTER_FROM_INT(index)))) {
return ret;
}
@@ -1529,11 +1529,11 @@ static FileDirEntry *filelist_file_ex(struct FileList *filelist, const int index
/* Else, we have to add new entry to 'misc' cache - and possibly make room for it first! */
ret = filelist_file_create_entry(filelist, index);
old_index = cache->misc_entries_indices[cache->misc_cursor];
- if ((old = BLI_ghash_popkey(cache->misc_entries, SET_INT_IN_POINTER(old_index), NULL))) {
+ if ((old = BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(old_index), NULL))) {
BLI_ghash_remove(cache->uuids, old->uuid, NULL, NULL);
filelist_file_release_entry(filelist, old);
}
- BLI_ghash_insert(cache->misc_entries, SET_INT_IN_POINTER(index), ret);
+ BLI_ghash_insert(cache->misc_entries, POINTER_FROM_INT(index), ret);
BLI_ghash_insert(cache->uuids, ret->uuid, ret);
cache->misc_entries_indices[cache->misc_cursor] = index;
@@ -1628,7 +1628,7 @@ static bool filelist_file_cache_block_create(FileList *filelist, const int start
FileDirEntry *entry;
/* That entry might have already been requested and stored in misc cache... */
- if ((entry = BLI_ghash_popkey(cache->misc_entries, SET_INT_IN_POINTER(idx), NULL)) == NULL) {
+ if ((entry = BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(idx), NULL)) == NULL) {
entry = filelist_file_create_entry(filelist, idx);
BLI_ghash_insert(cache->uuids, entry->uuid, entry);
}
@@ -2064,7 +2064,7 @@ unsigned int filelist_entry_select_set(
{
/* Default NULL pointer if not found is fine here! */
void **es_p = BLI_ghash_lookup_p(filelist->selection_state, entry->uuid);
- unsigned int entry_flag = es_p ? GET_UINT_FROM_POINTER(*es_p) : 0;
+ unsigned int entry_flag = es_p ? POINTER_AS_UINT(*es_p) : 0;
const unsigned int org_entry_flag = entry_flag;
BLI_assert(entry);
@@ -2090,7 +2090,7 @@ unsigned int filelist_entry_select_set(
if (entry_flag != org_entry_flag) {
if (es_p) {
if (entry_flag) {
- *es_p = SET_UINT_IN_POINTER(entry_flag);
+ *es_p = POINTER_FROM_UINT(entry_flag);
}
else {
BLI_ghash_remove(filelist->selection_state, entry->uuid, MEM_freeN, NULL);
@@ -2099,7 +2099,7 @@ unsigned int filelist_entry_select_set(
else if (entry_flag) {
void *key = MEM_mallocN(sizeof(entry->uuid), __func__);
memcpy(key, entry->uuid, sizeof(entry->uuid));
- BLI_ghash_insert(filelist->selection_state, key, SET_UINT_IN_POINTER(entry_flag));
+ BLI_ghash_insert(filelist->selection_state, key, POINTER_FROM_UINT(entry_flag));
}
}
@@ -2139,7 +2139,7 @@ unsigned int filelist_entry_select_get(FileList *filelist, FileDirEntry *entry,
((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR)))
{
/* Default NULL pointer if not found is fine here! */
- return GET_UINT_FROM_POINTER(BLI_ghash_lookup(filelist->selection_state, entry->uuid));
+ return POINTER_AS_UINT(BLI_ghash_lookup(filelist->selection_state, entry->uuid));
}
return 0;
diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h
index 76845c44226..6d898ee2fe9 100644
--- a/source/blender/editors/space_file/filelist.h
+++ b/source/blender/editors/space_file/filelist.h
@@ -56,12 +56,12 @@ typedef enum FileCheckType {
CHECK_ALL = 3
} FileCheckType;
-struct ListBase * folderlist_new(void);
+struct ListBase *folderlist_new(void);
void folderlist_free(struct ListBase *folderlist);
-struct ListBase * folderlist_duplicate(ListBase *folderlist);
+struct ListBase *folderlist_duplicate(ListBase *folderlist);
void folderlist_popdir(struct ListBase *folderlist, char *dir);
void folderlist_pushdir(struct ListBase *folderlist, const char *dir);
-const char * folderlist_peeklastdir(struct ListBase *folderdist);
+const char *folderlist_peeklastdir(struct ListBase *folderdist);
int folderlist_clear_next(struct SpaceFile *sfile);
@@ -77,24 +77,24 @@ void filelist_filter(struct FileList *filelist);
void filelist_init_icons(void);
void filelist_free_icons(void);
void filelist_imgsize(struct FileList *filelist, short w, short h);
-struct ImBuf * filelist_getimage(struct FileList *filelist, const int index);
-struct ImBuf * filelist_geticon_image(struct FileList *filelist, const int index);
+struct ImBuf *filelist_getimage(struct FileList *filelist, const int index);
+struct ImBuf *filelist_geticon_image(struct FileList *filelist, const int index);
int filelist_geticon(struct FileList *filelist, const int index, const bool is_main);
-struct FileList * filelist_new(short type);
+struct FileList *filelist_new(short type);
void filelist_clear(struct FileList *filelist);
void filelist_clear_ex(struct FileList *filelist, const bool do_cache, const bool do_selection);
void filelist_free(struct FileList *filelist);
-const char * filelist_dir(struct FileList *filelist);
+const char *filelist_dir(struct FileList *filelist);
bool filelist_is_dir(struct FileList *filelist, const char *path);
void filelist_setdir(struct FileList *filelist, char *r_dir);
int filelist_files_ensure(struct FileList *filelist);
int filelist_empty(struct FileList *filelist);
-FileDirEntry * filelist_file(struct FileList *filelist, int index);
+FileDirEntry *filelist_file(struct FileList *filelist, int index);
int filelist_file_findpath(struct FileList *filelist, const char *file);
-FileDirEntry * filelist_entry_find_uuid(struct FileList *filelist, const int uuid[4]);
+FileDirEntry *filelist_entry_find_uuid(struct FileList *filelist, const int uuid[4]);
void filelist_file_cache_slidingwindow_set(struct FileList *filelist, size_t window_size);
bool filelist_file_cache_block(struct FileList *filelist, const int index);
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index baa8e78572a..38b8dd37d46 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -439,7 +439,7 @@ void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename)
line[len - 1] = '\0';
}
/* don't do this because it can be slow on network drives,
- * having a bookmark from a drive thats ejected or so isn't
+ * having a bookmark from a drive that's ejected or so isn't
* all _that_ bad */
#if 0
if (BLI_exists(line))
@@ -577,7 +577,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
#else
/* unix */
{
- const char *home = getenv("HOME");
+ const char *home = BLI_getenv("HOME");
if (read_bookmarks && home) {
BLI_snprintf(line, sizeof(line), "%s/", home);
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 94f47d5a6aa..b0dea1eb31b 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -330,10 +330,10 @@ static void file_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -386,7 +386,7 @@ static void file_main_region_draw(const bContext *C, ARegion *ar)
v2d->keepofs |= V2D_LOCKOFS_Y;
/* XXX this happens on scaling down Screen (like from startup.blend) */
- /* view2d has no type specific for filewindow case, which doesnt scroll vertically */
+ /* view2d has no type specific for filewindow case, which doesn't scroll vertically */
if (v2d->cur.ymax < 0) {
v2d->cur.ymin -= v2d->cur.ymax;
v2d->cur.ymax = 0;
@@ -453,7 +453,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
{
wmKeyMapItem *kmi;
/* keys for all regions */
- wmKeyMap *keymap = WM_keymap_find(keyconf, "File Browser", SPACE_FILE, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "File Browser", SPACE_FILE, 0);
/* More common 'fliebrowser-like navigation' shortcuts. */
WM_keymap_add_item(keymap, "FILE_OT_parent", UPARROWKEY, KM_PRESS, KM_ALT, 0);
@@ -476,7 +476,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "FILE_OT_bookmark_add", BKEY, KM_PRESS, KM_CTRL, 0);
/* keys for main region */
- keymap = WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(keyconf, "File Browser Main", SPACE_FILE, 0);
kmi = WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
RNA_boolean_set(kmi->ptr, "need_active", true);
@@ -568,7 +568,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
/* keys for button region (top) */
- keymap = WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(keyconf, "File Browser Buttons", SPACE_FILE, 0);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);
RNA_int_set(kmi->ptr, "increment", 1);
kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0);
@@ -592,7 +592,7 @@ static void file_tools_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -618,7 +618,7 @@ static void file_header_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_header_init(ar);
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -635,10 +635,10 @@ static void file_ui_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index c5d6093dc4a..0bb46ca6fb8 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -686,7 +686,7 @@ void graphedit_keymap(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* keymap for all regions */
- keymap = WM_keymap_find(keyconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_ensure(keyconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_keymap_add_item(keymap, "GRAPH_OT_properties", NKEY, KM_PRESS, 0, 0);
/* extrapolation works on channels, not keys */
@@ -712,6 +712,6 @@ void graphedit_keymap(wmKeyConfig *keyconf)
*/
/* keyframes */
- keymap = WM_keymap_find(keyconf, "Graph Editor", SPACE_IPO, 0);
+ keymap = WM_keymap_ensure(keyconf, "Graph Editor", SPACE_IPO, 0);
graphedit_keymap_keyframes(keyconf, keymap);
}
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 5eec0b05e41..4e39c741b9b 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -216,9 +216,9 @@ static void graph_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Graph Editor", SPACE_IPO, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor", SPACE_IPO, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -343,9 +343,9 @@ static void graph_channel_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Animation Channels", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -395,7 +395,7 @@ static void graph_buttons_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 3fb1d6dd2d0..26bd560b31f 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -963,7 +963,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
uiItemR(col, &imaptr, "use_view_as_render", 0, NULL, ICON_NONE);
if (ima->source != IMA_SRC_GENERATED) {
- if (compact == 0) { /* background image view doesnt need these */
+ if (compact == 0) { /* background image view doesn't need these */
ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, NULL);
bool has_alpha = true;
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 2a015177dac..561b7b99d59 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1855,6 +1855,8 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
rr = BKE_image_acquire_renderresult(scene, ima);
bool is_mono = rr ? BLI_listbase_count_at_most(&rr->views, 2) < 2 : BLI_listbase_count_at_most(&ima->views, 2) < 2;
bool is_exr_rr = rr && ELEM(imf->imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER) && RE_HasFloatPixels(rr);
+ bool is_multilayer = is_exr_rr && (imf->imtype == R_IMF_IMTYPE_MULTILAYER);
+ int layer = (is_multilayer) ? -1 : sima->iuser.layer;
/* error handling */
if (!rr) {
@@ -1886,14 +1888,14 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
/* fancy multiview OpenEXR */
if (imf->views_format == R_IMF_VIEWS_MULTIVIEW && is_exr_rr) {
/* save render result */
- ok = RE_WriteRenderResult(op->reports, rr, simopts->filepath, imf, NULL, sima->iuser.layer);
+ ok = RE_WriteRenderResult(op->reports, rr, simopts->filepath, imf, NULL, layer);
save_image_post(bmain, op, ibuf, ima, ok, true, relbase, relative, do_newpath, simopts->filepath);
ED_space_image_release_buffer(sima, ibuf, lock);
}
/* regular mono pipeline */
else if (is_mono) {
if (is_exr_rr) {
- ok = RE_WriteRenderResult(op->reports, rr, simopts->filepath, imf, NULL, -1);
+ ok = RE_WriteRenderResult(op->reports, rr, simopts->filepath, imf, NULL, layer);
}
else {
colormanaged_ibuf = IMB_colormanagement_imbuf_for_write(ibuf, save_as_render, true, &imf->view_settings, &imf->display_settings, imf);
@@ -1921,7 +1923,7 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
if (is_exr_rr) {
BKE_scene_multiview_view_filepath_get(&scene->r, simopts->filepath, view, filepath);
- ok_view = RE_WriteRenderResult(op->reports, rr, filepath, imf, view, -1);
+ ok_view = RE_WriteRenderResult(op->reports, rr, filepath, imf, view, layer);
save_image_post(bmain, op, ibuf, ima, ok_view, true, relbase, relative, do_newpath, filepath);
}
else {
@@ -1956,7 +1958,7 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
/* stereo (multiview) images */
else if (simopts->im_format.views_format == R_IMF_VIEWS_STEREO_3D) {
if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) {
- ok = RE_WriteRenderResult(op->reports, rr, simopts->filepath, imf, NULL, -1);
+ ok = RE_WriteRenderResult(op->reports, rr, simopts->filepath, imf, NULL, layer);
save_image_post(bmain, op, ibuf, ima, ok, true, relbase, relative, do_newpath, simopts->filepath);
ED_space_image_release_buffer(sima, ibuf, lock);
}
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index b9c0ca66778..fd661883f79 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -282,7 +282,7 @@ static void image_operatortypes(void)
static void image_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0);
wmKeyMapItem *kmi;
int i;
@@ -298,7 +298,7 @@ static void image_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, 0, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, KM_ALT, 0)->ptr, "reverse", true);
- keymap = WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0);
+ keymap = WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0);
WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
@@ -660,29 +660,29 @@ static void image_main_region_init(wmWindowManager *wm, ARegion *ar)
// UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* mask polls mode */
- keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* image paint polls for mode */
- keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Paint Curve", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Paint Curve", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Image Paint", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "UV Editor", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "UV Sculpt", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "UV Sculpt", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Image", SPACE_IMAGE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Image", SPACE_IMAGE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -835,7 +835,7 @@ static void image_buttons_region_init(wmWindowManager *wm, ARegion *ar)
ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -887,7 +887,7 @@ static void image_tools_region_init(wmWindowManager *wm, ARegion *ar)
ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index acd0a856f1a..793b1a79b55 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -70,7 +70,7 @@
#include "info_intern.h"
-/********************* pack blend file libaries operator *********************/
+/********************* pack blend file libraries operator *********************/
static int pack_libraries_exec(bContext *C, wmOperator *op)
{
@@ -124,7 +124,7 @@ void FILE_OT_unpack_libraries(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-/********************* toogle auto-pack operator *********************/
+/********************* toggle auto-pack operator *********************/
static int autopack_toggle_exec(bContext *C, wmOperator *op)
{
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 9ffa73af52b..7e3d57f95ed 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -133,7 +133,7 @@ static void info_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Info", SPACE_INFO, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Info", SPACE_INFO, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -203,12 +203,12 @@ static void info_operatortypes(void)
static void info_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Window", 0, 0);
WM_keymap_verify_item(keymap, "INFO_OT_reports_display_update", TIMERREPORT, KM_ANY, KM_ANY, 0);
/* info space */
- keymap = WM_keymap_find(keyconf, "Info", SPACE_INFO, 0);
+ keymap = WM_keymap_ensure(keyconf, "Info", SPACE_INFO, 0);
/* report selection */
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index c8385dfcbe3..a88d82fa05a 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -964,7 +964,7 @@ static void draw_sensor_collision(uiLayout *layout, PointerRNA *ptr, bContext *C
uiItemR(row, ptr, "use_pulse", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
uiItemR(row, ptr, "use_material", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
- switch (RNA_boolean_get(ptr, "use_material")) {
+ switch (RNA_enum_get(ptr, "use_material")) {
case SENS_COLLISION_PROPERTY:
uiItemR(split, ptr, "property", 0, NULL, ICON_NONE);
break;
diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c
index 339139b7e9e..6d484b4cb4c 100644
--- a/source/blender/editors/space_logic/space_logic.c
+++ b/source/blender/editors/space_logic/space_logic.c
@@ -179,7 +179,7 @@ static void logic_operatortypes(void)
static void logic_keymap(struct wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Logic Editor", SPACE_LOGIC, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Logic Editor", SPACE_LOGIC, 0);
WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "LOGIC_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
@@ -242,7 +242,7 @@ static void logic_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -281,7 +281,7 @@ static void logic_buttons_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 9bb25724daf..c1e4a5de0ed 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -274,7 +274,8 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
if (nlaedit_is_tweakmode_on(ac) == 0) {
/* 'push-down' action - only usable when not in TweakMode */
/* TODO: make this use the operator instead of calling the function directly
- * however, calling the operator requires that we supply the args, and that works with proper buttons only */
+ * however, calling the operator requires that we supply the args,
+ * and that works with proper buttons only */
BKE_nla_action_pushdown(adt);
}
else {
diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c
index 5bfd73b8163..78e70b76564 100644
--- a/source/blender/editors/space_nla/nla_ops.c
+++ b/source/blender/editors/space_nla/nla_ops.c
@@ -313,7 +313,7 @@ void nla_keymap(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* keymap for all regions ------------------------------------------- */
- keymap = WM_keymap_find(keyconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(keyconf, "NLA Generic", SPACE_NLA, 0);
/* region management */
WM_keymap_add_item(keymap, "NLA_OT_properties", NKEY, KM_PRESS, 0, 0);
@@ -345,10 +345,10 @@ void nla_keymap(wmKeyConfig *keyconf)
*
* However, those operations which involve clicking on channels and/or the placement of them in the view are implemented here instead
*/
- keymap = WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(keyconf, "NLA Channels", SPACE_NLA, 0);
nla_keymap_channels(keymap);
/* data ------------------------------------------------------------- */
- keymap = WM_keymap_find(keyconf, "NLA Editor", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(keyconf, "NLA Editor", SPACE_NLA, 0);
nla_keymap_main(keyconf, keymap);
}
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index 8c9372f0612..04739f0fb64 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -545,7 +545,7 @@ static void mouse_nla_strips(bContext *C, bAnimContext *ac, const int mval[2], s
return;
}
else {
- /* found some channel - we only really should do somethign when its an Nla-Track */
+ /* found some channel - we only really should do something when its an Nla-Track */
if (ale->type == ANIMTYPE_NLATRACK) {
NlaTrack *nlt = (NlaTrack *)ale->data;
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 88ef4a18142..1f9ff9aaabd 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -212,13 +212,13 @@ static void nla_channel_region_init(wmWindowManager *wm, ARegion *ar)
/* own keymap */
/* own channels map first to override some channel keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "NLA Channels", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "NLA Channels", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* now generic channels map for everything else that can apply */
- keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Animation Channels", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -258,9 +258,9 @@ static void nla_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "NLA Editor", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "NLA Editor", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -344,7 +344,7 @@ static void nla_buttons_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 6e52af2898e..46172da6b04 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -2411,7 +2411,6 @@ static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *p
bNode *node = ptr->data;
uiTemplateID(layout, C, ptr, "mask", NULL, NULL, NULL, UI_TEMPLATE_ID_FILTER_ALL);
- uiItemR(layout, ptr, "use_antialiasing", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "use_feather", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "size_source", 0, "", ICON_NONE);
diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c
index ea07341beb9..d4585c0835d 100644
--- a/source/blender/editors/space_node/node_ops.c
+++ b/source/blender/editors/space_node/node_ops.c
@@ -231,13 +231,13 @@ void node_keymap(struct wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* Entire Editor only ----------------- */
- keymap = WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0);
+ keymap = WM_keymap_ensure(keyconf, "Node Generic", SPACE_NODE, 0);
WM_keymap_add_item(keymap, "NODE_OT_properties", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "NODE_OT_toolbar", TKEY, KM_PRESS, 0, 0);
/* Main Region only ----------------- */
- keymap = WM_keymap_find(keyconf, "Node Editor", SPACE_NODE, 0);
+ keymap = WM_keymap_ensure(keyconf, "Node Editor", SPACE_NODE, 0);
/* mouse select in nodes used to be both keys, but perhaps this should be reduced?
* NOTE: mouse-clicks on left-mouse will fall through to allow transform-tweak, but also link/resize
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index e4c59bc9508..efdec512cf7 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -1161,7 +1161,7 @@ static void node_join_attach_recursive(bNode *node, bNode *frame)
if (node->parent->done & NODE_JOIN_IS_DESCENDANT)
node->done |= NODE_JOIN_IS_DESCENDANT;
else if (node->flag & NODE_TEST) {
- /* if parent is not an decendant of the frame, reattach the node */
+ /* if parent is not an descendant of the frame, reattach the node */
nodeDetachNode(node);
nodeAttachNode(node, frame);
node->done |= NODE_JOIN_IS_DESCENDANT;
@@ -1327,7 +1327,7 @@ static void node_detach_recursive(bNode *node)
if (node->parent->done & NODE_DETACH_IS_DESCENDANT)
node->done |= NODE_DETACH_IS_DESCENDANT;
else if (node->flag & NODE_SELECT) {
- /* if parent is not a decendant of a selected node, detach */
+ /* if parent is not a descendant of a selected node, detach */
nodeDetachNode(node);
node->done |= NODE_DETACH_IS_DESCENDANT;
}
@@ -1590,7 +1590,7 @@ static void node_link_insert_offset_frame_chains(
/**
* Callback that applies NodeInsertOfsData.offset_x to a node or its parent,
- * considering the logic needed for offseting nodes after link insert
+ * considering the logic needed for offsetting nodes after link insert
*/
static bool node_link_insert_offset_chain_cb(
bNode *fromnode, bNode *tonode,
@@ -1648,7 +1648,7 @@ static void node_link_insert_offset_ntree(
/* insert->totr isn't updated yet, so totr_insert is used to get the correct worldspace coords */
node_to_updated_rect(insert, &totr_insert);
- /* frame attachement was't handled yet so we search the frame that the node will be attached to later */
+ /* frame attachment wasn't handled yet so we search the frame that the node will be attached to later */
insert->parent = node_find_frame_to_attach(ar, ntree, mouse_xy);
/* this makes sure nodes are also correctly offset when inserting a node on top of a frame
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 636ed755cb1..e84d38a58ad 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -1019,6 +1019,7 @@ static uiBlock *node_find_menu(bContext *C, ARegion *ar, void *arg_op)
block = UI_block_begin(C, ar, "_popup", UI_EMBOSS);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9 * UI_UNIT_X, UI_UNIT_Y, 0, 0, "");
UI_but_func_search_set(but, NULL, node_find_cb, op->type, node_find_call_cb, NULL);
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index ef9ead3407c..c45a5c650ee 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -375,7 +375,7 @@ static void ui_node_link(bContext *C, void *arg_p, void *event_p)
bNode *node_to = arg->node;
bNodeSocket *sock_to = arg->sock;
bNodeTree *ntree = arg->ntree;
- int event = GET_INT_FROM_POINTER(event_p);
+ int event = POINTER_AS_INT(event_p);
if (event == UI_NODE_LINK_DISCONNECT)
node_socket_disconnect(bmain, ntree, node_to, sock_to);
@@ -581,11 +581,11 @@ static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_
but = uiDefBut(block, UI_BTYPE_BUT, 0, IFACE_("Remove"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Remove nodes connected to the input"));
- UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_REMOVE));
+ UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), POINTER_FROM_INT(UI_NODE_LINK_REMOVE));
but = uiDefBut(block, UI_BTYPE_BUT, 0, IFACE_("Disconnect"), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Disconnect nodes connected to the input"));
- UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), SET_INT_IN_POINTER(UI_NODE_LINK_DISCONNECT));
+ UI_but_funcN_set(but, ui_node_link, MEM_dupallocN(arg), POINTER_FROM_INT(UI_NODE_LINK_DISCONNECT));
}
ui_node_menu_column(arg, NODE_CLASS_GROUP, N_("Group"));
diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c
index 00eab0c69c1..22df2586a7b 100644
--- a/source/blender/editors/space_node/node_view.c
+++ b/source/blender/editors/space_node/node_view.c
@@ -193,7 +193,7 @@ void NODE_OT_view_selected(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-/* **************** Backround Image Operators ************** */
+/* **************** Background Image Operators ************** */
typedef struct NodeViewMove {
int mvalo[2];
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 33f4847c90f..ed228cdaf74 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -593,7 +593,7 @@ static void node_buttons_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -609,7 +609,7 @@ static void node_toolbar_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -644,10 +644,10 @@ static void node_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Node Editor", SPACE_NODE, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Node Editor", SPACE_NODE, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index a35dffc0fcc..fcbed9b8b3c 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -967,7 +967,7 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Tre
if (false == UI_but_active_only(C, ar, block, bt)) {
tselem->flag &= ~TSE_TEXTBUT;
- /* bad! (notifier within draw) without this, we don't get a refesh */
+ /* bad! (notifier within draw) without this, we don't get a refresh */
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_OUTLINER, NULL);
}
}
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 49647a0d838..dabb95e9d2b 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -122,7 +122,7 @@ typedef enum {
#define SEARCHING_OUTLINER(sov) (sov->search_flags & SO_SEARCH_RECURSIVE)
-/* is the currrent element open? if so we also show children */
+/* is the current element open? if so we also show children */
#define TSELEM_OPEN(telm, sv) ( (telm->flag & TSE_CLOSED) == 0 || (SEARCHING_OUTLINER(sv) && (telm->flag & TSE_CHILDSEARCH)) )
/* outliner_tree.c ----------------------------------------------- */
diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c
index 9574e82505f..16cd383b5c2 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -91,7 +91,7 @@ void outliner_operatortypes(void)
void outliner_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Outliner", SPACE_OUTLINER, 0);
wmKeyMapItem *kmi;
WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 173b48cc731..7bee4c3afc5 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -930,7 +930,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
tselem->flag |= TSE_CHILDSEARCH;
te->parent = parent;
- te->index = index; // for data arays
+ te->index = index; // for data arrays
if (ELEM(type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) {
/* pass */
}
@@ -1090,7 +1090,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
int a, tot;
- /* we do lazy build, for speed and to avoid infinite recusion */
+ /* we do lazy build, for speed and to avoid infinite recursion */
if (ptr->data == NULL) {
te->name = IFACE_("(empty)");
@@ -1458,7 +1458,7 @@ static int treesort_alpha(const void *v1, const void *v2)
}
-/* this is nice option for later? doesnt look too useful... */
+/* this is nice option for later? doesn't look too useful... */
#if 0
static int treesort_obtype_alpha(const void *v1, const void *v2)
{
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 413ea8cc3a7..c1039927810 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -81,7 +81,7 @@ static void outliner_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0);
/* don't pass on view2d mask, it's always set with scrollbar space, hide fails */
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, NULL, &ar->winrct);
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c
index 6f72c1d0159..2adfcc521f5 100644
--- a/source/blender/editors/space_script/space_script.c
+++ b/source/blender/editors/space_script/space_script.c
@@ -132,7 +132,7 @@ static void script_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Script", SPACE_SCRIPT, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Script", SPACE_SCRIPT, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index b3e1d3be42a..9ff6530f1e5 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -166,7 +166,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i
RNA_int_set(op->ptr, "frame_start", cfra);
if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0)
- RNA_int_set(op->ptr, "frame_end", cfra + 25); // XXX arbitary but ok for now.
+ RNA_int_set(op->ptr, "frame_end", cfra + 25); // XXX arbitrary but ok for now.
if (!(flag & SEQPROP_NOPATHS)) {
sequencer_generic_invoke_path__internal(C, op, "filepath");
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 5b8f2ae7067..c2a1079c349 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -101,8 +101,11 @@ EnumPropertyItem sequencer_prop_effect_types[] = {
/* mute operator */
+#define SEQ_SIDE_MOUSE -1
+
EnumPropertyItem prop_side_types[] = {
- {SEQ_SIDE_LEFT, "LEFT", 0, "Left", ""},
+ {SEQ_SIDE_MOUSE, "MOUSE", 0, "Mouse position", "" },
+ {SEQ_SIDE_LEFT, "LEFT", 0, "Left", "" },
{SEQ_SIDE_RIGHT, "RIGHT", 0, "Right", ""},
{SEQ_SIDE_BOTH, "BOTH", 0, "Both", ""},
{0, NULL, 0, NULL, NULL}
@@ -555,7 +558,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
switch (BKE_sequence_effect_get_num_inputs(type)) {
case 0:
*selseq1 = *selseq2 = *selseq3 = NULL;
- return 1; /* succsess */
+ return 1; /* success */
case 1:
if (seq2 == NULL) {
*error_str = N_("At least one selected sequence strip is needed");
@@ -1391,7 +1394,7 @@ static int sequencer_slip_invoke(bContext *C, wmOperator *op, const wmEvent *eve
int num_seq, i;
View2D *v2d = UI_view2d_fromcontext(C);
- /* first recursively cound the trimmed elements */
+ /* first recursively count the trimmed elements */
num_seq = slip_count_sequences_rec(ed->seqbasep, true);
if (num_seq == 0)
@@ -1501,7 +1504,7 @@ static int sequencer_slip_exec(bContext *C, wmOperator *op)
int offset = RNA_int_get(op->ptr, "offset");
bool success = false;
- /* first recursively cound the trimmed elements */
+ /* first recursively count the trimmed elements */
num_seq = slip_count_sequences_rec(ed->seqbasep, true);
if (num_seq == 0)
@@ -2138,16 +2141,20 @@ static int sequencer_cut_invoke(bContext *C, wmOperator *op, const wmEvent *even
Scene *scene = CTX_data_scene(C);
View2D *v2d = UI_view2d_fromcontext(C);
- int cut_side = SEQ_SIDE_BOTH;
+ int cut_side = RNA_enum_get(op->ptr, "side");
int cut_frame = CFRA;
- if (ED_operator_sequencer_active(C) && v2d)
- cut_side = mouse_frame_side(v2d, event->mval[0], cut_frame);
-
+ if (cut_side == SEQ_SIDE_MOUSE) {
+ if (ED_operator_sequencer_active(C) && v2d) {
+ cut_side = mouse_frame_side(v2d, event->mval[0], cut_frame);
+ }
+ else {
+ cut_side = SEQ_SIDE_BOTH;
+ }
+ }
RNA_int_set(op->ptr, "frame", cut_frame);
RNA_enum_set(op->ptr, "side", cut_side);
/*RNA_enum_set(op->ptr, "type", cut_hard); */ /*This type is set from the key shortcut */
-
return sequencer_cut_exec(C, op);
}
@@ -2167,11 +2174,15 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+ PropertyRNA *prop;
RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be cut", INT_MIN, INT_MAX);
RNA_def_enum(ot->srna, "type", prop_cut_types, SEQ_CUT_SOFT, "Type", "The type of cut operation to perform on strips");
- RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side that remains selected after cutting");
+ prop = RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_MOUSE, "Side", "The side that remains selected after cutting");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
+#undef SEQ_SIDE_MOUSE
+
/* duplicate operator */
static int apply_unique_name_cb(Sequence *seq, void *arg_pt)
{
@@ -2662,7 +2673,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
BLI_remlink(ed->seqbasep, last_seq);
BKE_sequence_free(scene, last_seq);
- /* emtpy meta strip, delete all effects depending on it */
+ /* empty meta strip, delete all effects depending on it */
for (seq = ed->seqbasep->first; seq; seq = seq->next)
if ((seq->type & SEQ_TYPE_EFFECT) && seq_depends_on_meta(seq, last_seq))
seq->flag |= SEQ_FLAG_DELETE;
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index 234989ef244..408dc551382 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -137,7 +137,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
wmKeyMapItem *kmi;
/* Common items ------------------------------------------------------------------ */
- keymap = WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(keyconf, "SequencerCommon", SPACE_SEQ, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0);
@@ -148,7 +148,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_toggle", TABKEY, KM_PRESS, KM_CTRL, 0);
/* Strips Region --------------------------------------------------------------- */
- keymap = WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(keyconf, "Sequencer", SPACE_SEQ, 0);
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all", AKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
@@ -340,7 +340,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
/* Preview Region ----------------------------------------------------------- */
- keymap = WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(keyconf, "SequencerPreview", SPACE_SEQ, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all_preview", HOMEKEY, KM_PRESS, 0, 0);
#ifdef WITH_INPUT_NDOF
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all_preview", NDOF_BUTTON_FIT, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 88ad2cad3e9..e01c7994329 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -1150,7 +1150,7 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
}
SEQ_END;
- actseq->tmp = SET_INT_IN_POINTER(true);
+ actseq->tmp = POINTER_FROM_INT(true);
for (BKE_sequence_iterator_begin(ed, &iter, true); iter.valid; BKE_sequence_iterator_next(&iter)) {
seq = iter.seq;
@@ -1166,7 +1166,7 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
continue;
}
- /* If the seq is an effect one, we need extra cheking! */
+ /* If the seq is an effect one, we need extra checking! */
if (SEQ_IS_EFFECT(seq) && ((seq->seq1 && seq->seq1->tmp) ||
(seq->seq2 && seq->seq2->tmp) ||
(seq->seq3 && seq->seq3->tmp)))
@@ -1175,7 +1175,7 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
if (enddisp < seq->enddisp) enddisp = seq->enddisp;
if (machine < seq->machine) machine = seq->machine;
- seq->tmp = SET_INT_IN_POINTER(true);
+ seq->tmp = POINTER_FROM_INT(true);
seq->flag |= SELECT;
changed = true;
@@ -1185,7 +1185,7 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
BKE_sequence_iterator_begin(ed, &iter, true);
}
- /* Video strips bellow active one, or any strip for audio (order do no matters here!). */
+ /* Video strips below active one, or any strip for audio (order do no matters here!). */
else if (seq->machine < machine || is_audio) {
seq->flag |= SELECT;
changed = true;
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 281dafe32c9..b87d878e057 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -475,15 +475,15 @@ static void sequencer_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
#if 0
- keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
#endif
- keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
@@ -556,15 +556,15 @@ static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
#if 0
- keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
#endif
- keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
@@ -627,7 +627,7 @@ static void sequencer_preview_region_listener(bScreen *UNUSED(sc), ScrArea *UNUS
case NC_ANIMATION:
switch (wmn->data) {
case ND_KEYFRAME:
- /* Otherwise, often prevents seing immediately effects of keyframe editing... */
+ /* Otherwise, often prevents seeing immediately effects of keyframe editing... */
BKE_sequencer_cache_cleanup();
ED_region_tag_redraw(ar);
break;
@@ -659,7 +659,7 @@ static void sequencer_buttons_region_init(wmWindowManager *wm, ARegion *ar)
{
wmKeyMap *keymap;
- keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
ED_region_panels_init(wm, ar);
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 3bc859dcf17..fc05fb51c1a 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -243,7 +243,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap = WM_keymap_find(keyconf, "Text Generic", SPACE_TEXT, 0);
+ keymap = WM_keymap_ensure(keyconf, "Text Generic", SPACE_TEXT, 0);
WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_CTRL, 0);
#ifdef __APPLE__
WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_OSKEY, 0);
@@ -253,7 +253,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "TEXT_OT_properties", TKEY, KM_PRESS, KM_CTRL, 0);
- keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0);
+ keymap = WM_keymap_ensure(keyconf, "Text", SPACE_TEXT, 0);
#ifdef __APPLE__
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN);
@@ -421,9 +421,9 @@ static void text_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
- keymap = WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Text", SPACE_TEXT, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
/* add drop boxes */
@@ -541,7 +541,7 @@ static void text_properties_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
/* own keymaps */
- keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
diff --git a/source/blender/editors/space_text/text_format_lua.c b/source/blender/editors/space_text/text_format_lua.c
index 8b6ec2d804b..2a92f9a4d7d 100644
--- a/source/blender/editors/space_text/text_format_lua.c
+++ b/source/blender/editors/space_text/text_format_lua.c
@@ -69,7 +69,7 @@ static int txtfmt_lua_find_keyword(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "while", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
@@ -120,7 +120,7 @@ static int txtfmt_lua_find_specialvar(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "xpcall", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c
index 2daaaa348e6..2b2dfef72d3 100644
--- a/source/blender/editors/space_text/text_format_osl.c
+++ b/source/blender/editors/space_text/text_format_osl.c
@@ -66,7 +66,7 @@ static int txtfmt_osl_find_builtinfunc(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "while", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
@@ -116,7 +116,7 @@ static int txtfmt_osl_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "volatile", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
@@ -140,7 +140,7 @@ static int txtfmt_osl_find_specialvar(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "displacement", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
diff --git a/source/blender/editors/space_text/text_format_pov.c b/source/blender/editors/space_text/text_format_pov.c
index 4c9abecedd6..f6b6d4f8d42 100644
--- a/source/blender/editors/space_text/text_format_pov.c
+++ b/source/blender/editors/space_text/text_format_pov.c
@@ -83,7 +83,7 @@ static int txtfmt_pov_find_keyword(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "if", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
return (i == 0 || text_check_identifier(string[i])) ? -1 : i;
}
@@ -236,7 +236,7 @@ static int txtfmt_pov_find_reserved_keywords(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "str", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
return (i == 0 || text_check_identifier(string[i])) ? -1 : i;
}
@@ -466,7 +466,7 @@ static int txtfmt_pov_find_reserved_builtins(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "z", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
return (i == 0 || text_check_identifier(string[i])) ? -1 : i;
}
@@ -683,7 +683,7 @@ static int txtfmt_pov_find_specialvar(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "gall", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
return (i == 0 || text_check_identifier(string[i])) ? -1 : i;
}
diff --git a/source/blender/editors/space_text/text_format_pov_ini.c b/source/blender/editors/space_text/text_format_pov_ini.c
index 453dd1d748c..ae7d784dffc 100644
--- a/source/blender/editors/space_text/text_format_pov_ini.c
+++ b/source/blender/editors/space_text/text_format_pov_ini.c
@@ -93,7 +93,7 @@ static int txtfmt_ini_find_keyword(const char *string)
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
return (i == 0 || text_check_identifier(string[i])) ? -1 : i;
}
@@ -299,7 +299,7 @@ static int txtfmt_ini_find_reserved(const char *string)
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
return (i == 0 || text_check_identifier(string[i])) ? -1 : i;
}
diff --git a/source/blender/editors/space_text/text_format_py.c b/source/blender/editors/space_text/text_format_py.c
index 2f6962f0493..3576d12998f 100644
--- a/source/blender/editors/space_text/text_format_py.c
+++ b/source/blender/editors/space_text/text_format_py.c
@@ -89,7 +89,7 @@ static int txtfmt_py_find_builtinfunc(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "yield", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
@@ -110,7 +110,7 @@ static int txtfmt_py_find_specialvar(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "class", len)) i = len;
else i = 0;
- /* If next source char is an identifier (eg. 'i' in "definate") no match */
+ /* If next source char is an identifier (eg. 'i' in "definite") no match */
if (i == 0 || text_check_identifier(string[i]))
return -1;
return i;
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index c8e9167edf9..30137f70a76 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -3194,7 +3194,7 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEve
switch (BKE_text_file_modified_check(text)) {
case 1:
if (text->flags & TXT_ISDIRTY) {
- /* modified locally and externally, ahhh. offer more possibilites. */
+ /* modified locally and externally, ahhh. offer more possibilities. */
pup = UI_popup_menu_begin(C, IFACE_("File Modified Outside and Inside Blender"), ICON_NONE);
layout = UI_popup_menu_layout(pup);
uiItemEnumO_ptr(layout, op->type, IFACE_("Reload from disk (ignore local changes)"),
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 97daed53e24..e3fe124a5c4 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -562,7 +562,7 @@ static void time_main_region_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
/* own keymap */
- keymap = WM_keymap_find(wm->defaultconf, "Timeline", SPACE_TIME, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Timeline", SPACE_TIME, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c
index d88e2fdae91..a68bd2a9fbb 100644
--- a/source/blender/editors/space_time/time_ops.c
+++ b/source/blender/editors/space_time/time_ops.c
@@ -214,7 +214,7 @@ void time_operatortypes(void)
void time_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Timeline", SPACE_TIME, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Timeline", SPACE_TIME, 0);
WM_keymap_add_item(keymap, "TIME_OT_start_frame_set", SKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "TIME_OT_end_frame_set", EKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index cf118404183..b230a5e193c 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -297,7 +297,7 @@ static int create_view_aligned_slices(VolumeSlicer *slicer,
float plane_dist = min_dist;
float plane_dist_inc = (max_dist - min_dist) / (float)num_slices;
- /* for all egdes */
+ /* for all edges */
for (int i = 0; i < 12; i++) {
copy_v3_v3(vec_start[i], vertices[edges[edge_list[max_index][i]][0]]);
copy_v3_v3(vec_dir[i], vertices[edges[edge_list[max_index][i]][1]]);
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 7f3a36c7ba6..fed056333c0 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -485,74 +485,74 @@ static void view3d_main_region_init(wmWindowManager *wm, ARegion *ar)
/* object ops. */
/* important to be before Pose keymap since they can both be enabled at once */
- keymap = WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Face Mask", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* pose is not modal, operator poll checks for this */
- keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Pose", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Object Mode", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Object Mode", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Paint Curve", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Paint Curve", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Image Paint", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Vertex Paint", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Vertex Paint", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Weight Paint", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Weight Paint", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Sculpt", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Sculpt", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Mesh", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Mesh", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Armature", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Armature", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Pose", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Metaball", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Metaball", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Lattice", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Lattice", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Particle", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Particle", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* editfont keymap swallows all... */
- keymap = WM_keymap_find(wm->defaultconf, "Font", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Font", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Object Non-modal", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Frames", 0, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* own keymap, last so modes can override it */
- keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "3D View", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "3D View", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
/* add drop boxes */
@@ -1036,7 +1036,7 @@ static void view3d_main_region_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegio
/* add handlers, stuff you only do once or on area/region changes */
static void view3d_header_region_init(wmWindowManager *wm, ARegion *ar)
{
- wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
@@ -1085,7 +1085,7 @@ static void view3d_buttons_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
@@ -1191,7 +1191,7 @@ static void view3d_tools_region_init(wmWindowManager *wm, ARegion *ar)
ED_region_panels_init(wm, ar);
- keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_event_add_keymap_handler(&ar->handlers, keymap);
}
diff --git a/source/blender/editors/space_view3d/view3d_camera_control.c b/source/blender/editors/space_view3d/view3d_camera_control.c
index e27b3fe13f9..31956ee5f86 100644
--- a/source/blender/editors/space_view3d/view3d_camera_control.c
+++ b/source/blender/editors/space_view3d/view3d_camera_control.c
@@ -87,7 +87,7 @@ typedef struct View3DCameraControl {
/* -------------------------------------------------------------------- */
- /* intial values */
+ /* initial values */
/* root most parent */
Object *root_parent;
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index b02e4ad9764..679498ab16d 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -790,7 +790,7 @@ static void viewrotate_apply(ViewOpsData *vod, const int event_xy[2])
/* avoid precision loss over time */
normalize_qt(vod->curr.viewquat);
- /* use a working copy so view rotation locking doesnt overwrite the locked
+ /* use a working copy so view rotation locking doesn't overwrite the locked
* rotation back into the view we calculate with */
copy_qt_qt(rv3d->viewquat, vod->curr.viewquat);
@@ -1033,7 +1033,7 @@ static float view3d_ndof_pan_speed_calc(RegionView3D *rv3d)
/**
* Zoom and pan in the same function since sometimes zoom is interpreted as dolly (pan forward).
*
- * \param has_zoom zoom, otherwise dolly, often `!rv3d->is_persp` since it doesnt make sense to dolly in ortho.
+ * \param has_zoom zoom, otherwise dolly, often `!rv3d->is_persp` since it doesn't make sense to dolly in ortho.
*/
static void view3d_ndof_pan_zoom(
const struct wmNDOFMotionData *ndof, ScrArea *sa, ARegion *ar,
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index c68b5e97414..320c00240c1 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -28,7 +28,7 @@
#ifdef WITH_INPUT_NDOF
//# define NDOF_FLY_DEBUG
-//# define NDOF_FLY_DRAW_TOOMUCH /* is this needed for ndof? - commented so redraw doesnt thrash - campbell */
+//# define NDOF_FLY_DRAW_TOOMUCH /* is this needed for ndof? - commented so redraw doesn't thrash - campbell */
#endif /* WITH_INPUT_NDOF */
#include "DNA_object_types.h"
@@ -150,7 +150,7 @@ void fly_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_add_item(keymap, MOUSEPAN, 0, 0, 0, FLY_MODAL_SPEED);
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_PRESS, KM_ANY, 0, FLY_MODAL_PAN_ENABLE);
- /* XXX - Bug in the event system, middle mouse release doesnt work */
+ /* XXX - Bug in the event system, middle mouse release doesn't work */
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, FLY_MODAL_PAN_DISABLE);
/* WASD */
@@ -730,7 +730,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
RegionView3D *rv3d = fly->rv3d;
float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */
- float dvec[3] = {0, 0, 0}; /* this is the direction thast added to the view offset per redraw */
+ float dvec[3] = {0, 0, 0}; /* this is the direction that's added to the view offset per redraw */
/* Camera Uprighting variables */
float moffset[2]; /* mouse offset from the views center */
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index a1441d74af4..5d662282e56 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -232,13 +232,13 @@ void view3d_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap = WM_keymap_find(keyconf, "3D View Generic", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_ensure(keyconf, "3D View Generic", SPACE_VIEW3D, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "VIEW3D_OT_toolshelf", TKEY, KM_PRESS, 0, 0);
/* only for region 3D window */
- keymap = WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0);
+ keymap = WM_keymap_ensure(keyconf, "3D View", SPACE_VIEW3D, 0);
/* Shift+LMB behavior first, so it has priority over KM_ANY item below. */
kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index 767df04c0b0..3cc0857c8a7 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -367,19 +367,19 @@ bool ED_view3d_clip_segment(const RegionView3D *rv3d, float ray_start[3], float
* \param r_ray_co The world-space point where the ray intersects the window plane.
* \param r_ray_normal The normalized world-space direction of towards mval.
* \param r_ray_start The world-space starting point of the ray.
- * \param do_clip Optionally clip the start of the ray by the view clipping planes.
+ * \param do_clip_planes Optionally clip the start of the ray by the view clipping planes.
* \return success, false if the ray is totally clipped.
*/
-bool ED_view3d_win_to_ray_ex(
+bool ED_view3d_win_to_ray_clipped_ex(
const ARegion *ar, const View3D *v3d, const float mval[2],
- float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], bool do_clip)
+ float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], bool do_clip_planes)
{
float ray_end[3];
view3d_win_to_ray_segment(ar, v3d, mval, r_ray_co, r_ray_normal, r_ray_start, ray_end);
/* bounds clipping */
- if (do_clip) {
+ if (do_clip_planes) {
return ED_view3d_clip_segment(ar->regiondata, r_ray_start, ray_end);
}
@@ -396,14 +396,32 @@ bool ED_view3d_win_to_ray_ex(
* \param mval The area relative 2d location (such as event->mval, converted into float[2]).
* \param r_ray_start The world-space point where the ray intersects the window plane.
* \param r_ray_normal The normalized world-space direction of towards mval.
- * \param do_clip Optionally clip the start of the ray by the view clipping planes.
+ * \param do_clip_planes Optionally clip the start of the ray by the view clipping planes.
* \return success, false if the ray is totally clipped.
*/
-bool ED_view3d_win_to_ray(
+bool ED_view3d_win_to_ray_clipped(
const ARegion *ar, const View3D *v3d, const float mval[2],
- float r_ray_start[3], float r_ray_normal[3], const bool do_clip)
+ float r_ray_start[3], float r_ray_normal[3], const bool do_clip_planes)
{
- return ED_view3d_win_to_ray_ex(ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip);
+ return ED_view3d_win_to_ray_clipped_ex(ar, v3d, mval, NULL, r_ray_normal, r_ray_start, do_clip_planes);
+}
+
+/**
+ * Calculate a 3d viewpoint and direction vector from 2d window coordinates.
+ * This ray_start is located at the viewpoint, ray_normal is the direction towards mval.
+ * \param ar The region (used for the window width and height).
+ * \param mval The area relative 2d location (such as event->mval, converted into float[2]).
+ * \param r_ray_start The world-space point where the ray intersects the window plane.
+ * \param r_ray_normal The normalized world-space direction of towards mval.
+ *
+ * \note Ignores view near/far clipping, to take this into account use #ED_view3d_win_to_ray_clipped.
+ */
+void ED_view3d_win_to_ray(
+ const ARegion *ar, const float mval[2],
+ float r_ray_start[3], float r_ray_normal[3])
+{
+ ED_view3d_win_to_origin(ar, mval, r_ray_start);
+ ED_view3d_win_to_vector(ar, mval, r_ray_normal);
}
/**
@@ -537,6 +555,31 @@ void ED_view3d_win_to_3d_int(
ED_view3d_win_to_3d(v3d, ar, depth_pt, mval_fl, r_out);
}
+bool ED_view3d_win_to_3d_on_plane(
+ const ARegion *ar,
+ const float plane[4], const float mval[2], const bool do_clip,
+ float r_out[3])
+{
+ float ray_co[3], ray_no[3];
+ ED_view3d_win_to_origin(ar, mval, ray_co);
+ ED_view3d_win_to_vector(ar, mval, ray_no);
+ float lambda;
+ if (isect_ray_plane_v3(ray_co, ray_no, plane, &lambda, do_clip)) {
+ madd_v3_v3v3fl(r_out, ray_co, ray_no, lambda);
+ return true;
+ }
+ return false;
+}
+
+bool ED_view3d_win_to_3d_on_plane_int(
+ const ARegion *ar,
+ const float plane[4], const int mval[2], const bool do_clip,
+ float r_out[3])
+{
+ const float mval_fl[2] = {mval[0], mval[1]};
+ return ED_view3d_win_to_3d_on_plane(ar, plane, mval_fl, do_clip, r_out);
+}
+
/**
* Calculate a 3d difference vector from 2d window offset.
* note that ED_view3d_calc_zfac() must be called first to determine
@@ -630,16 +673,17 @@ void ED_view3d_win_to_vector(const ARegion *ar, const float mval[2], float out[3
* \param mval The area relative 2d location (such as event->mval, converted into float[2]).
* \param r_ray_start The world-space starting point of the segment.
* \param r_ray_end The world-space end point of the segment.
- * \param do_clip Optionally clip the ray by the view clipping planes.
+ * \param do_clip_planes Optionally clip the ray by the view clipping planes.
* \return success, false if the segment is totally clipped.
*/
-bool ED_view3d_win_to_segment(const ARegion *ar, View3D *v3d, const float mval[2],
- float r_ray_start[3], float r_ray_end[3], const bool do_clip)
+bool ED_view3d_win_to_segment_clipped(
+ const ARegion *ar, View3D *v3d, const float mval[2],
+ float r_ray_start[3], float r_ray_end[3], const bool do_clip_planes)
{
view3d_win_to_ray_segment(ar, v3d, mval, NULL, NULL, r_ray_start, r_ray_end);
/* bounds clipping */
- if (do_clip) {
+ if (do_clip_planes) {
return ED_view3d_clip_segment((RegionView3D *)ar->regiondata, r_ray_start, r_ray_end);
}
diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c
index 012f71c10ba..f51b47032aa 100644
--- a/source/blender/editors/space_view3d/view3d_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_ruler.c
@@ -485,7 +485,7 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a
float quat[4];
float axis[3];
float angle;
- const float px_scale = (ED_view3d_pixel_size(rv3d, ruler_item->co[1]) *
+ const float px_scale = (ED_view3d_pixel_size_no_ui_scale(rv3d, ruler_item->co[1]) *
min_fff(arc_size,
len_v2v2(co_ss[0], co_ss[1]) / 2.0f,
len_v2v2(co_ss[2], co_ss[1]) / 2.0f));
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 02136af958b..76697a02270 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -180,6 +180,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase)
block = UI_block_begin(C, ar, "_popup", UI_EMBOSS);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_SEARCH_MENU);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
/* fake button, it holds space for search items */
uiDefBut(block, UI_BTYPE_LABEL, 0, "", 10, 15, UI_searchbox_size_x(), UI_searchbox_size_y(), NULL, 0, 0, 0, 0, NULL);
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c
index 97c00f1be37..33173ad3fd6 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_walk.c
@@ -60,7 +60,7 @@
#ifdef WITH_INPUT_NDOF
//# define NDOF_WALK_DEBUG
-//# define NDOF_WALK_DRAW_TOOMUCH /* is this needed for ndof? - commented so redraw doesnt thrash - campbell */
+//# define NDOF_WALK_DRAW_TOOMUCH /* is this needed for ndof? - commented so redraw doesn't thrash - campbell */
#endif
#define USE_TABLET_SUPPORT
@@ -435,7 +435,7 @@ static bool walk_floor_distance_get(
ray_start, ray_normal, r_distance,
r_location, r_normal_dummy);
- /* artifically scale the distance to the scene size */
+ /* artificially scale the distance to the scene size */
*r_distance /= walk->grid;
return ret;
}
@@ -474,7 +474,7 @@ static bool walk_ray_cast(
negate_v3(r_normal);
}
- /* artifically scale the distance to the scene size */
+ /* artificially scale the distance to the scene size */
*ray_distance /= walk->grid;
return ret;
@@ -1052,7 +1052,7 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk)
/* speed factor */
y *= WALK_ROTATE_FAC;
- /* user adjustement factor */
+ /* user adjustment factor */
y *= walk->mouse_speed;
/* clamp the angle limits */
@@ -1090,7 +1090,7 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk)
/* speed factor */
x *= WALK_ROTATE_FAC;
- /* user adjustement factor */
+ /* user adjustment factor */
x *= walk->mouse_speed;
/* Rotate about the relative up vec */
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 79d06de8b41..cfe52197ca2 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1852,7 +1852,7 @@ static void drawTransformPixel(const struct bContext *UNUSED(C), ARegion *ar, vo
/* draw autokeyframing hint in the corner
* - only draw if enabled (advanced users may be distracted/annoyed),
- * for objects that will be autokeyframed (no point ohterwise),
+ * for objects that will be autokeyframed (no point otherwise),
* AND only for the active region (as showing all is too overwhelming)
*/
if ((U.autokey_flag & AUTOKEY_FLAG_NOWARNING) == 0) {
@@ -2599,7 +2599,7 @@ static void constraintTransLim(TransInfo *t, TransData *td)
mul_m4_m3m4(cob.matrix, td->mtx, cob.matrix);
}
else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) {
- /* skip... incompatable spacetype */
+ /* skip... incompatible spacetype */
continue;
}
@@ -2675,7 +2675,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
if ((data->flag2 & LIMIT_TRANSFORM) == 0)
continue;
- /* skip incompatable spacetypes */
+ /* skip incompatible spacetypes */
if (!ELEM(con->ownspace, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL))
continue;
@@ -5713,7 +5713,7 @@ static void calcEdgeSlideCustomPoints(struct TransInfo *t)
setCustomPoints(t, &t->mouse, sld->mval_end, sld->mval_start);
/* setCustomPoints isn't normally changing as the mouse moves,
- * in this case apply mouse input immediatly so we don't refresh
+ * in this case apply mouse input immediately so we don't refresh
* with the value from the previous points */
applyMouseInput(t, &t->mouse, t->mval, t->values);
}
@@ -7081,7 +7081,7 @@ static void calcVertSlideCustomPoints(struct TransInfo *t)
}
/* setCustomPoints isn't normally changing as the mouse moves,
- * in this case apply mouse input immediatly so we don't refresh
+ * in this case apply mouse input immediately so we don't refresh
* with the value from the previous points */
applyMouseInput(t, &t->mouse, t->mval, t->values);
}
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index 5f738804579..5369fc05005 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -150,7 +150,7 @@ typedef struct TransDataExtension {
float r_mtx[3][3]; /* The rotscale matrix of pose bone, to allow using snap-align in translation mode,
* when td->mtx is the loc pose bone matrix (and hence can't be used to apply rotation in some cases,
* namely when a bone is in "NoLocal" or "Hinge" mode)... */
- float r_smtx[3][3]; /* Invers of previous one. */
+ float r_smtx[3][3]; /* Inverse of previous one. */
int rotOrder; /* rotation mode, as defined in eRotationModes (DNA_action_types.h) */
float oloc[3], orot[3], oquat[4], orotAxis[3], orotAngle; /* Original object transformation used for rigid bodies */
} TransDataExtension;
@@ -163,7 +163,7 @@ typedef struct TransData2D {
float ih1[2], ih2[2];
} TransData2D;
-/* we need to store 2 handles for each transdata in case the other handle wasnt selected */
+/* we need to store 2 handles for each transdata in case the other handle wasn't selected */
typedef struct TransDataCurveHandleFlags {
char ih1, ih2;
char *h1, *h2;
@@ -522,7 +522,7 @@ typedef struct TransInfo {
#define T_AUTOVALUES (1 << 20)
- /* to specificy if we save back settings at the end */
+ /* to specify if we save back settings at the end */
#define T_MODAL (1 << 21)
/* no retopo */
@@ -796,6 +796,8 @@ bool applyTransformOrientation(const struct bContext *C, float mat[3][3], char r
#define ORIENTATION_VERT 2
#define ORIENTATION_EDGE 3
#define ORIENTATION_FACE 4
+#define ORIENTATION_USE_PLANE(ty) \
+ ELEM(ty, ORIENTATION_NORMAL, ORIENTATION_EDGE, ORIENTATION_FACE)
int getTransformOrientation_ex(const struct bContext *C, float normal[3], float plane[3], const short around);
int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3]);
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 2836ed0699d..6c67aef2884 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2291,7 +2291,7 @@ static struct TransIslandData *editmesh_islands_info_calc(
vert_map = MEM_mallocN(sizeof(*vert_map) * bm->totvert, __func__);
/* we shouldn't need this, but with incorrect selection flushing
- * its possible we have a selected vertex thats not in a face, for now best not crash in that case. */
+ * its possible we have a selected vertex that's not in a face, for now best not crash in that case. */
copy_vn_i(vert_map, bm->totvert, -1);
BM_mesh_elem_table_ensure(bm, htype);
@@ -2895,7 +2895,7 @@ void flushTransSeq(TransInfo *t)
if (seq != seq_prev) {
if (seq->depth == 0) {
- /* test overlap, displayes red outline */
+ /* test overlap, displays red outline */
seq->flag &= ~SEQ_OVERLAP;
if (BKE_sequence_test_overlap(seqbasep, seq)) {
seq->flag |= SEQ_OVERLAP;
@@ -5784,7 +5784,7 @@ static void clear_trans_object_base_flags(TransInfo *t)
}
/* auto-keyframing feature - for objects
- * tmode: should be a transform mode
+ * tmode: should be a transform mode
*/
// NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases
void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode)
@@ -5900,8 +5900,8 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob,
}
/* auto-keyframing feature - for poses/pose-channels
- * tmode: should be a transform mode
- * targetless_ik: has targetless ik been done on any channels?
+ * tmode: should be a transform mode
+ * targetless_ik: has targetless ik been done on any channels?
*/
// NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases
void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode, short targetless_ik)
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 9a2c3674d2a..fa3bf6c81e2 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -303,7 +303,7 @@ static void animrecord_check_state(Scene *scene, ID *id, wmTimer *animtimer)
* NOTE: An alternative way would have been to instead hack the influence
* to not get always get reset to full strength if NLASTRIP_FLAG_USR_INFLUENCE
* is disabled but auto-blending isn't being used. However, that approach
- * is a bit hacky/hard to discover, and may cause backwards compatability issues,
+ * is a bit hacky/hard to discover, and may cause backwards compatibility issues,
* so it's better to just do it this way.
*/
strip->flag |= NLASTRIP_FLAG_USR_INFLUENCE;
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index c38fb15fc89..8cd31c32911 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -662,7 +662,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
}
if (em->bm->totedgesel >= 1) {
- /* find an edge thats apart of v_tri (no need to search all edges) */
+ /* find an edge that's apart of v_tri (no need to search all edges) */
float e_length;
int j;
@@ -796,12 +796,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
}
}
- if (is_zero_v3(plane)) {
- result = ORIENTATION_VERT;
- }
- else {
- result = ORIENTATION_EDGE;
- }
+ result = is_zero_v3(plane) ? ORIENTATION_VERT : ORIENTATION_EDGE;
}
else if (em->bm->totvertsel > 3) {
BMIter iter;
@@ -1104,6 +1099,11 @@ void ED_getTransformOrientationMatrix(const bContext *C, float orientation_mat[3
type = getTransformOrientation_ex(C, normal, plane, around);
+ /* Fallback, when the plane can't be calculated. */
+ if (ORIENTATION_USE_PLANE(type) && is_zero_v3(plane)) {
+ type = ORIENTATION_VERT;
+ }
+
switch (type) {
case ORIENTATION_NORMAL:
if (createSpaceNormalTangent(orientation_mat, normal, plane) == 0) {
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 8bc53127b4c..b06f22f50cc 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -611,7 +611,7 @@ static void initSnappingMode(TransInfo *t)
(bool (*)(BMVert *, void *))BM_elem_cb_check_hflag_disabled,
bm_edge_is_snap_target,
bm_face_is_snap_target,
- SET_UINT_IN_POINTER((BM_ELEM_SELECT | BM_ELEM_HIDDEN)));
+ POINTER_FROM_UINT((BM_ELEM_SELECT | BM_ELEM_HIDDEN)));
}
}
}
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index f9c628877c1..1c6ad1fe752 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -2425,7 +2425,7 @@ bool ED_transform_snap_object_project_all_view3d_ex(
{
float ray_start[3], ray_normal[3];
- if (!ED_view3d_win_to_ray_ex(
+ if (!ED_view3d_win_to_ray_clipped_ex(
sctx->v3d_data.ar, sctx->v3d_data.v3d,
mval, NULL, ray_normal, ray_start, true))
{
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 621c5d73d5a..e0a1faf04b8 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -105,8 +105,6 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
{
CLOG_INFO(&LOG, 1, "name='%s', step=%d", undoname, step);
wmWindowManager *wm = CTX_wm_manager(C);
- wmWindow *win = CTX_wm_window(C);
- // Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
/* undo during jobs are running can easily lead to freeing data using by jobs,
@@ -166,10 +164,6 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
WM_event_add_notifier(C, NC_WINDOW, NULL);
WM_event_add_notifier(C, NC_WM | ND_UNDO, NULL);
- if (win) {
- win->addmousemove = true;
- }
-
return OPERATOR_FINISHED;
}
@@ -247,7 +241,12 @@ static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op))
{
/* "last operator" should disappear, later we can tie this with undo stack nicer */
WM_operator_stack_clear(CTX_wm_manager(C));
- return ed_undo_step(C, 1, NULL);
+ int ret = ed_undo_step(C, 1, NULL);
+ if (ret & OPERATOR_FINISHED) {
+ /* Keep button under the cursor active. */
+ WM_event_add_mousemove(C);
+ }
+ return ret;
}
static int ed_undo_push_exec(bContext *C, wmOperator *op)
@@ -260,14 +259,24 @@ static int ed_undo_push_exec(bContext *C, wmOperator *op)
static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op))
{
- return ed_undo_step(C, -1, NULL);
+ int ret = ed_undo_step(C, -1, NULL);
+ if (ret & OPERATOR_FINISHED) {
+ /* Keep button under the cursor active. */
+ WM_event_add_mousemove(C);
+ }
+ return ret;
}
static int ed_undo_redo_exec(bContext *C, wmOperator *UNUSED(op))
{
wmOperator *last_op = WM_operator_last_redo(C);
- const int ret = ED_undo_operator_repeat(C, last_op);
- return ret ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ int ret = ED_undo_operator_repeat(C, last_op);
+ ret = ret ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ if (ret & OPERATOR_FINISHED) {
+ /* Keep button under the cursor active. */
+ WM_event_add_mousemove(C);
+ }
+ return ret;
}
static bool ed_undo_redo_poll(bContext *C)
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index a139f0e3c87..f25bc6350c1 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -498,7 +498,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
n->unit_sys, n->unit_type[idx]);
/* Note: with angles, we always get values as radians here... */
- if (BPY_execute_string_as_number(C, str_unit_convert, false, &val)) {
+ if (BPY_execute_string_as_number(C, NULL, str_unit_convert, false, &val)) {
n->val[idx] = (float)val;
n->val_flag[idx] &= ~NUM_INVALID;
}
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 375dda7dd6a..c0378f967ad 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -4458,7 +4458,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf)
wmKeyMap *keymap;
wmKeyMapItem *kmi;
- keymap = WM_keymap_find(keyconf, "UV Editor", 0, 0);
+ keymap = WM_keymap_ensure(keyconf, "UV Editor", 0, 0);
keymap->poll = ED_operator_uvedit_can_uv_sculpt;
/* Uv sculpt toggle */
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 0b768350942..869009d1bdf 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -955,9 +955,9 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
/* store indices to editVerts and Faces. May be unneeded but ensuring anyway */
BM_mesh_elem_index_ensure(bm, BM_VERT | BM_FACE);
- /*****************************************
- * First determine stitchability of uvs *
- *****************************************/
+ /****************************************
+ * First determine stitchability of uvs *
+ ****************************************/
for (i = 0; i < state->selection_size; i++) {
if (state->mode == STITCH_VERT) {
@@ -2002,6 +2002,7 @@ static void stitch_exit(bContext *C, wmOperator *op, int finished)
RNA_enum_set(op->ptr, "stored_mode", state->mode);
/* Store selection for re-execution of stitch */
+ RNA_collection_clear(op->ptr, "selection");
for (i = 0; i < state->selection_size; i++) {
UvElement *element;
PointerRNA itemptr;
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 06eae0ee63d..582ba989997 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -1241,7 +1241,7 @@ static int unwrap_exec(bContext *C, wmOperator *op)
else
RNA_enum_set(op->ptr, "method", scene->toolsettings->unwrapper);
- /* remember packing marging */
+ /* remember packing margin */
if (RNA_struct_property_is_set(op->ptr, "margin"))
scene->toolsettings->uvcalc_margin = RNA_float_get(op->ptr, "margin");
else
diff --git a/source/blender/freestyle/intern/application/AppCanvas.h b/source/blender/freestyle/intern/application/AppCanvas.h
index 9a92cf482d0..ed473e22489 100644
--- a/source/blender/freestyle/intern/application/AppCanvas.h
+++ b/source/blender/freestyle/intern/application/AppCanvas.h
@@ -69,7 +69,7 @@ public:
virtual float thickness() const;
AppView *_pViewer;
- inline const AppView * viewer() const {return _pViewer;}
+ inline const AppView *viewer() const {return _pViewer;}
/*! modifiers */
void setViewer(AppView *iViewer);
diff --git a/source/blender/freestyle/intern/application/AppConfig.h b/source/blender/freestyle/intern/application/AppConfig.h
index ae1d96e06d8..d7572aa1a04 100644
--- a/source/blender/freestyle/intern/application/AppConfig.h
+++ b/source/blender/freestyle/intern/application/AppConfig.h
@@ -44,7 +44,7 @@ namespace Config {
class Path {
protected:
- static Path * _pInstance;
+ static Path *_pInstance;
string _ProjectDir;
string _ModelsPath;
string _PatternsPath;
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp
index 46db99a8d51..03dc5f67d43 100644
--- a/source/blender/freestyle/intern/application/Controller.cpp
+++ b/source/blender/freestyle/intern/application/Controller.cpp
@@ -642,11 +642,11 @@ void Controller::ComputeSteerableViewMap()
NodeShape *completeNS = new NodeShape;
completeNS->material().setDiffuse(c,c,c,1);
ng[Canvas::NB_STEERABLE_VIEWMAP-1]->AddChild(completeNS);
- SteerableViewMap * svm = _Canvas->getSteerableViewMap();
+ SteerableViewMap *svm = _Canvas->getSteerableViewMap();
svm->Reset();
ViewMap::fedges_container& fedges = _ViewMap->FEdges();
- LineRep * fRep;
+ LineRep *fRep;
NodeShape *ns;
for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end();
f != fend;
@@ -722,7 +722,7 @@ void Controller::ComputeSteerableViewMap()
void Controller::saveSteerableViewMapImages()
{
- SteerableViewMap * svm = _Canvas->getSteerableViewMap();
+ SteerableViewMap *svm = _Canvas->getSteerableViewMap();
if (!svm) {
cerr << "the Steerable ViewMap has not been computed yet" << endl;
return;
@@ -1003,7 +1003,7 @@ void Controller::resetModified(bool iMod)
_Canvas->resetModified(iMod);
}
-NodeGroup * Controller::BuildRep(vector<ViewEdge*>::iterator vedges_begin, vector<ViewEdge*>::iterator vedges_end)
+NodeGroup *Controller::BuildRep(vector<ViewEdge*>::iterator vedges_begin, vector<ViewEdge*>::iterator vedges_end)
{
ViewMapTesselator2D tesselator2D;
FrsMaterial mat;
@@ -1052,7 +1052,7 @@ void Controller::resetInterpreter()
void Controller::displayDensityCurves(int x, int y)
{
- SteerableViewMap * svm = _Canvas->getSteerableViewMap();
+ SteerableViewMap *svm = _Canvas->getSteerableViewMap();
if (!svm)
return;
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
index 894f8eeeb4e..290701936e3 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
@@ -82,7 +82,7 @@ public:
virtual ~BlenderFileLoader();
/*! Loads the 3D scene and returns a pointer to the scene root node */
- NodeGroup * Load();
+ NodeGroup *Load();
/*! Gets the number of read faces */
inline unsigned int numFacesRead() {return _numFacesRead;}
diff --git a/source/blender/freestyle/intern/geometry/Grid.h b/source/blender/freestyle/intern/geometry/Grid.h
index 62c0e58232a..0a9be01aba1 100644
--- a/source/blender/freestyle/intern/geometry/Grid.h
+++ b/source/blender/freestyle/intern/geometry/Grid.h
@@ -30,7 +30,7 @@
#include <cstring> // for memset
#include <float.h>
-#include <stdint.h> // For SET_UINT_IN_POINTER, i.e. uintptr_t.
+#include <stdint.h> // For POINTER_FROM_UINT, i.e. uintptr_t.
#include <vector>
#include "Geom.h"
@@ -290,8 +290,9 @@ public:
* Returns the first intersection (occluder,t,u,v) or null.
* Starts with a call to InitRay.
*/
- Polygon3r * castRayToFindFirstIntersection(const Vec3r& orig, const Vec3r& dir, double& t,
- double& u, double& v, unsigned timestamp);
+ Polygon3r *castRayToFindFirstIntersection(
+ const Vec3r& orig, const Vec3r& dir, double& t,
+ double& u, double& v, unsigned timestamp);
/*! Init all structures and values for computing the cells intersected by this new ray */
@@ -338,8 +339,8 @@ protected:
visitor.discoverCell(current_cell);
OccludersSet& occluders = current_cell->getOccluders(); // FIXME: I had forgotten the ref &
for (OccludersSet::iterator it = occluders.begin(); it != occluders.end(); it++) {
- if (GET_UINT_FROM_POINTER((*it)->userdata2) != _timestamp) {
- (*it)->userdata2 = SET_UINT_IN_POINTER(_timestamp);
+ if (POINTER_AS_UINT((*it)->userdata2) != _timestamp) {
+ (*it)->userdata2 = POINTER_FROM_UINT(_timestamp);
visitor.examineOccluder(*it);
}
}
diff --git a/source/blender/freestyle/intern/geometry/SweepLine.h b/source/blender/freestyle/intern/geometry/SweepLine.h
index 98e860862bb..3edd045320f 100644
--- a/source/blender/freestyle/intern/geometry/SweepLine.h
+++ b/source/blender/freestyle/intern/geometry/SweepLine.h
@@ -72,7 +72,7 @@ public:
}
public:
- void * userdata; // FIXME
+ void *userdata; // FIXME
Edge *EdgeA; // first segment
Edge *EdgeB; // second segment
diff --git a/source/blender/freestyle/intern/image/GaussianFilter.h b/source/blender/freestyle/intern/image/GaussianFilter.h
index fdbfd20d764..f460d56e5a5 100644
--- a/source/blender/freestyle/intern/image/GaussianFilter.h
+++ b/source/blender/freestyle/intern/image/GaussianFilter.h
@@ -120,18 +120,16 @@ protected:
};
/*
-
- #############################################
- #############################################
- #############################################
- ###### ######
- ###### I M P L E M E N T A T I O N ######
- ###### ######
- #############################################
- #############################################
- #############################################
-
-*/
+ * #############################################
+ * #############################################
+ * #############################################
+ * ###### ######
+ * ###### I M P L E M E N T A T I O N ######
+ * ###### ######
+ * #############################################
+ * #############################################
+ * #############################################
+ */
template<class Map>
float GaussianFilter::getSmoothedPixel(Map *map, int x, int y)
diff --git a/source/blender/freestyle/intern/image/ImagePyramid.cpp b/source/blender/freestyle/intern/image/ImagePyramid.cpp
index b81f8303945..db92cc68286 100644
--- a/source/blender/freestyle/intern/image/ImagePyramid.cpp
+++ b/source/blender/freestyle/intern/image/ImagePyramid.cpp
@@ -61,7 +61,7 @@ ImagePyramid::~ImagePyramid()
}
}
-GrayImage * ImagePyramid::getLevel(int l)
+GrayImage *ImagePyramid::getLevel(int l)
{
return _levels[l];
}
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.h b/source/blender/freestyle/intern/python/BPy_Convert.h
index a0e0b578c10..976b760a325 100644
--- a/source/blender/freestyle/intern/python/BPy_Convert.h
+++ b/source/blender/freestyle/intern/python/BPy_Convert.h
@@ -98,53 +98,53 @@ extern "C" {
// C++ => Python
//==============================
-PyObject * PyBool_from_bool(bool b);
-PyObject * Vector_from_Vec2f(Vec2f& v);
-PyObject * Vector_from_Vec3f(Vec3f& v);
-PyObject * Vector_from_Vec3r(Vec3r& v);
-
-PyObject * Any_BPy_Interface0D_from_Interface0D(Interface0D& if0D);
-PyObject * Any_BPy_Interface1D_from_Interface1D(Interface1D& if1D);
-PyObject * Any_BPy_FEdge_from_FEdge(FEdge& fe);
-PyObject * Any_BPy_ViewVertex_from_ViewVertex(ViewVertex& vv);
-
-PyObject * BPy_BBox_from_BBox(const BBox< Vec3r > &bb);
-PyObject * BPy_CurvePoint_from_CurvePoint(CurvePoint& cp);
-PyObject * BPy_directedViewEdge_from_directedViewEdge(ViewVertex::directedViewEdge& dve);
-PyObject * BPy_FEdge_from_FEdge(FEdge& fe);
-PyObject * BPy_FEdgeSharp_from_FEdgeSharp(FEdgeSharp& fes);
-PyObject * BPy_FEdgeSmooth_from_FEdgeSmooth(FEdgeSmooth& fes);
-PyObject * BPy_Id_from_Id(Id& id);
-PyObject * BPy_Interface0D_from_Interface0D(Interface0D& if0D);
-PyObject * BPy_Interface1D_from_Interface1D(Interface1D& if1D);
-PyObject * BPy_IntegrationType_from_IntegrationType(IntegrationType i);
-PyObject * BPy_FrsMaterial_from_FrsMaterial(const FrsMaterial& m);
-PyObject * BPy_Nature_from_Nature(unsigned short n);
-PyObject * BPy_MediumType_from_MediumType(Stroke::MediumType n);
-PyObject * BPy_SShape_from_SShape(SShape& ss);
-PyObject * BPy_Stroke_from_Stroke(Stroke& s);
-PyObject * BPy_StrokeAttribute_from_StrokeAttribute(StrokeAttribute& sa);
-PyObject * BPy_StrokeVertex_from_StrokeVertex(StrokeVertex& sv);
-PyObject * BPy_SVertex_from_SVertex(SVertex& sv);
-PyObject * BPy_ViewVertex_from_ViewVertex(ViewVertex& vv);
-PyObject * BPy_NonTVertex_from_NonTVertex(NonTVertex& ntv);
-PyObject * BPy_TVertex_from_TVertex(TVertex& tv);
-PyObject * BPy_ViewEdge_from_ViewEdge(ViewEdge& ve);
-PyObject * BPy_Chain_from_Chain(Chain& c);
-PyObject * BPy_ViewShape_from_ViewShape(ViewShape& vs);
-
-PyObject * BPy_AdjacencyIterator_from_AdjacencyIterator(AdjacencyIterator& a_it);
-PyObject * BPy_Interface0DIterator_from_Interface0DIterator(Interface0DIterator& if0D_it, bool reversed);
-PyObject * BPy_CurvePointIterator_from_CurvePointIterator(CurveInternal::CurvePointIterator& cp_it);
-PyObject * BPy_StrokeVertexIterator_from_StrokeVertexIterator(StrokeInternal::StrokeVertexIterator& sv_it,
+PyObject *PyBool_from_bool(bool b);
+PyObject *Vector_from_Vec2f(Vec2f& v);
+PyObject *Vector_from_Vec3f(Vec3f& v);
+PyObject *Vector_from_Vec3r(Vec3r& v);
+
+PyObject *Any_BPy_Interface0D_from_Interface0D(Interface0D& if0D);
+PyObject *Any_BPy_Interface1D_from_Interface1D(Interface1D& if1D);
+PyObject *Any_BPy_FEdge_from_FEdge(FEdge& fe);
+PyObject *Any_BPy_ViewVertex_from_ViewVertex(ViewVertex& vv);
+
+PyObject *BPy_BBox_from_BBox(const BBox< Vec3r > &bb);
+PyObject *BPy_CurvePoint_from_CurvePoint(CurvePoint& cp);
+PyObject *BPy_directedViewEdge_from_directedViewEdge(ViewVertex::directedViewEdge& dve);
+PyObject *BPy_FEdge_from_FEdge(FEdge& fe);
+PyObject *BPy_FEdgeSharp_from_FEdgeSharp(FEdgeSharp& fes);
+PyObject *BPy_FEdgeSmooth_from_FEdgeSmooth(FEdgeSmooth& fes);
+PyObject *BPy_Id_from_Id(Id& id);
+PyObject *BPy_Interface0D_from_Interface0D(Interface0D& if0D);
+PyObject *BPy_Interface1D_from_Interface1D(Interface1D& if1D);
+PyObject *BPy_IntegrationType_from_IntegrationType(IntegrationType i);
+PyObject *BPy_FrsMaterial_from_FrsMaterial(const FrsMaterial& m);
+PyObject *BPy_Nature_from_Nature(unsigned short n);
+PyObject *BPy_MediumType_from_MediumType(Stroke::MediumType n);
+PyObject *BPy_SShape_from_SShape(SShape& ss);
+PyObject *BPy_Stroke_from_Stroke(Stroke& s);
+PyObject *BPy_StrokeAttribute_from_StrokeAttribute(StrokeAttribute& sa);
+PyObject *BPy_StrokeVertex_from_StrokeVertex(StrokeVertex& sv);
+PyObject *BPy_SVertex_from_SVertex(SVertex& sv);
+PyObject *BPy_ViewVertex_from_ViewVertex(ViewVertex& vv);
+PyObject *BPy_NonTVertex_from_NonTVertex(NonTVertex& ntv);
+PyObject *BPy_TVertex_from_TVertex(TVertex& tv);
+PyObject *BPy_ViewEdge_from_ViewEdge(ViewEdge& ve);
+PyObject *BPy_Chain_from_Chain(Chain& c);
+PyObject *BPy_ViewShape_from_ViewShape(ViewShape& vs);
+
+PyObject *BPy_AdjacencyIterator_from_AdjacencyIterator(AdjacencyIterator& a_it);
+PyObject *BPy_Interface0DIterator_from_Interface0DIterator(Interface0DIterator& if0D_it, bool reversed);
+PyObject *BPy_CurvePointIterator_from_CurvePointIterator(CurveInternal::CurvePointIterator& cp_it);
+PyObject *BPy_StrokeVertexIterator_from_StrokeVertexIterator(StrokeInternal::StrokeVertexIterator& sv_it,
bool reversed);
-PyObject * BPy_SVertexIterator_from_SVertexIterator(ViewEdgeInternal::SVertexIterator& sv_it);
-PyObject * BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(ViewVertexInternal::orientedViewEdgeIterator& ove_it,
+PyObject *BPy_SVertexIterator_from_SVertexIterator(ViewEdgeInternal::SVertexIterator& sv_it);
+PyObject *BPy_orientedViewEdgeIterator_from_orientedViewEdgeIterator(ViewVertexInternal::orientedViewEdgeIterator& ove_it,
bool reversed);
-PyObject * BPy_ViewEdgeIterator_from_ViewEdgeIterator(ViewEdgeInternal::ViewEdgeIterator& ve_it);
-PyObject * BPy_ChainingIterator_from_ChainingIterator(ChainingIterator& c_it);
-PyObject * BPy_ChainPredicateIterator_from_ChainPredicateIterator(ChainPredicateIterator& cp_it);
-PyObject * BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator(ChainSilhouetteIterator& cs_it);
+PyObject *BPy_ViewEdgeIterator_from_ViewEdgeIterator(ViewEdgeInternal::ViewEdgeIterator& ve_it);
+PyObject *BPy_ChainingIterator_from_ChainingIterator(ChainingIterator& c_it);
+PyObject *BPy_ChainPredicateIterator_from_ChainPredicateIterator(ChainPredicateIterator& cp_it);
+PyObject *BPy_ChainSilhouetteIterator_from_ChainSilhouetteIterator(ChainSilhouetteIterator& cs_it);
//==============================
// Python => C++
diff --git a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
index 548ab529f34..a6683f538c6 100644
--- a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
+++ b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp
@@ -63,7 +63,7 @@ PyDoc_STRVAR(Integrator_integrate_doc,
" :class:`UnaryFunction0DUnsigned` type.\n"
" :rtype: int or float");
-static PyObject * Integrator_integrate(PyObject * /*self*/, PyObject *args, PyObject *kwds)
+static PyObject *Integrator_integrate(PyObject * /*self*/, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"func", "it", "it_end", "integration_type", NULL};
PyObject *obj1, *obj4 = 0;
diff --git a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp
index 0fc3ec41dec..c5a07fd295b 100644
--- a/source/blender/freestyle/intern/python/BPy_Interface1D.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Interface1D.cpp
@@ -138,7 +138,7 @@ PyDoc_STRVAR(Interface1D_vertices_begin_doc,
" :return: An Interface0DIterator pointing to the first vertex.\n"
" :rtype: :class:`Interface0DIterator`");
-static PyObject * Interface1D_vertices_begin(BPy_Interface1D *self)
+static PyObject *Interface1D_vertices_begin(BPy_Interface1D *self)
{
Interface0DIterator if0D_it(self->if1D->verticesBegin());
return BPy_Interface0DIterator_from_Interface0DIterator(if0D_it, false);
@@ -153,7 +153,7 @@ PyDoc_STRVAR(Interface1D_vertices_end_doc,
" :return: An Interface0DIterator pointing after the last vertex.\n"
" :rtype: :class:`Interface0DIterator`");
-static PyObject * Interface1D_vertices_end(BPy_Interface1D *self)
+static PyObject *Interface1D_vertices_end(BPy_Interface1D *self)
{
Interface0DIterator if0D_it(self->if1D->verticesEnd());
return BPy_Interface0DIterator_from_Interface0DIterator(if0D_it, true);
@@ -173,7 +173,7 @@ PyDoc_STRVAR(Interface1D_points_begin_doc,
" :return: An Interface0DIterator pointing to the first point.\n"
" :rtype: :class:`Interface0DIterator`");
-static PyObject * Interface1D_points_begin(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
+static PyObject *Interface1D_points_begin(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"t", NULL};
float f = 0.0f;
@@ -198,7 +198,7 @@ PyDoc_STRVAR(Interface1D_points_end_doc,
" :return: An Interface0DIterator pointing after the last point.\n"
" :rtype: :class:`Interface0DIterator`");
-static PyObject * Interface1D_points_end(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
+static PyObject *Interface1D_points_end(BPy_Interface1D *self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"t", NULL};
float f = 0.0f;
diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp
index cf4880ad3f7..28c9e815196 100644
--- a/source/blender/freestyle/intern/python/BPy_SShape.cpp
+++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp
@@ -122,7 +122,7 @@ PyDoc_STRVAR(SShape_add_vertex_doc,
" :arg vertex: An SVertex object.\n"
" :type vertex: :class:`SVertex`");
-static PyObject * SShape_add_vertex(BPy_SShape *self, PyObject *args, PyObject *kwds)
+static PyObject *SShape_add_vertex(BPy_SShape *self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"edge", NULL};
PyObject *py_sv = 0;
diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
index fb7eb49127c..b390bb293d5 100644
--- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
+++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
@@ -135,7 +135,7 @@ static void StrokeAttribute_dealloc(BPy_StrokeAttribute *self)
Py_TYPE(self)->tp_free((PyObject *)self);
}
-static PyObject * StrokeAttribute_repr(BPy_StrokeAttribute *self)
+static PyObject *StrokeAttribute_repr(BPy_StrokeAttribute *self)
{
stringstream repr("StrokeAttribute:");
repr << " r: " << self->sa->getColorR() << " g: " << self->sa->getColorG() << " b: " << self->sa->getColorB() <<
@@ -282,7 +282,7 @@ PyDoc_STRVAR(StrokeAttribute_set_attribute_real_doc,
" :arg value: The attribute value.\n"
" :type value: float\n");
-static PyObject * StrokeAttribute_set_attribute_real(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
+static PyObject *StrokeAttribute_set_attribute_real(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"name", "value", NULL};
char *s = 0;
@@ -306,7 +306,7 @@ PyDoc_STRVAR(StrokeAttribute_set_attribute_vec2_doc,
" :arg value: The attribute value.\n"
" :type value: :class:`mathutils.Vector`, list or tuple of 2 real numbers\n");
-static PyObject * StrokeAttribute_set_attribute_vec2(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
+static PyObject *StrokeAttribute_set_attribute_vec2(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"name", "value", NULL};
char *s;
@@ -335,7 +335,7 @@ PyDoc_STRVAR(StrokeAttribute_set_attribute_vec3_doc,
" :arg value: The attribute value.\n"
" :type value: :class:`mathutils.Vector`, list or tuple of 3 real numbers\n");
-static PyObject * StrokeAttribute_set_attribute_vec3(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
+static PyObject *StrokeAttribute_set_attribute_vec3(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"name", "value", NULL};
char *s;
diff --git a/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h b/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
index a8fe3d8bbfa..4103d3299d4 100644
--- a/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
+++ b/source/blender/freestyle/intern/scene_graph/IndexedFaceSet.h
@@ -113,7 +113,7 @@ public:
* 0 : the arrays are not copied. The pointers passed as arguments are used. IndexedFaceSet takes these
* arrays desallocation in charge.
* 1 : the arrays are copied. The caller is in charge of the arrays, passed as arguments desallocation.
- */
+ */
IndexedFaceSet(float *iVertices, unsigned iVSize, float *iNormals, unsigned iNSize, FrsMaterial **iMaterials,
unsigned iMSize, float *iTexCoords, unsigned iTSize, unsigned iNumFaces, unsigned *iNumVertexPerFace,
TRIANGLES_STYLE *iFaceStyle, FaceEdgeMark *iFaceEdgeMarks, unsigned *iVIndices, unsigned iVISize,
diff --git a/source/blender/freestyle/intern/scene_graph/NodeCamera.h b/source/blender/freestyle/intern/scene_graph/NodeCamera.h
index c2f70d514a8..2fc6a00f955 100644
--- a/source/blender/freestyle/intern/scene_graph/NodeCamera.h
+++ b/source/blender/freestyle/intern/scene_graph/NodeCamera.h
@@ -68,12 +68,12 @@ public:
/*! Matrix is copied */
void setProjectionMatrix(double projection_matrix[16]);
- double * modelViewMatrix()
+ double *modelViewMatrix()
{
return modelview_matrix_;
}
- double * projectionMatrix()
+ double *projectionMatrix()
{
return projection_matrix_;
}
diff --git a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
index 5ba96f31272..50b55027de7 100644
--- a/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
+++ b/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.h
@@ -68,7 +68,7 @@ protected:
/*! [ Geometry Shader ].
* Spatial Noise stroke shader.
* Moves the vertices to make the stroke more noisy.
- * @see \htmlonly <a href=noise/noise.html>noise/noise.html</a> \endhtmlonly
+ * \see \htmlonly <a href=noise/noise.html>noise/noise.html</a> \endhtmlonly
*/
class SpatialNoiseShader : public StrokeShader
{
@@ -106,7 +106,7 @@ protected:
* (Moves the vertices to make the stroke smoother).
* Uses curvature flow to converge towards a curve of constant curvature. The diffusion method we use is anisotropic
* to prevent the diffusion accross corners.
- * @see \htmlonly <a href=/smoothing/smoothing.html>smoothing/smoothing.html</a> \endhtmlonly
+ * \see \htmlonly <a href=/smoothing/smoothing.html>smoothing/smoothing.html</a> \endhtmlonly
*/
class SmoothingShader : public StrokeShader
{
diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
index d3d19beba95..1cdc754d725 100644
--- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
+++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.h
@@ -428,7 +428,7 @@ public:
/*! [ Geometry Shader. ]
* Resamples the stroke.
- * @see Stroke::Resample(float).
+ * \see Stroke::Resample(float).
*/
class SamplingShader: public StrokeShader
{
@@ -479,7 +479,7 @@ public:
/*! [ Geometry Shader ].
* Transforms the stroke backbone geometry so that it corresponds to a Bezier Curve approximation of the
* original backbone geometry.
- * @see \htmlonly <a href=bezier/bezier.html>bezier/bezier.html</a> \endhtmlonly
+ * \see \htmlonly <a href=bezier/bezier.html>bezier/bezier.html</a> \endhtmlonly
*/
class BezierCurveShader : public StrokeShader
{
diff --git a/source/blender/freestyle/intern/stroke/Stroke.h b/source/blender/freestyle/intern/stroke/Stroke.h
index 60b8c21067f..ce63c528ac3 100644
--- a/source/blender/freestyle/intern/stroke/Stroke.h
+++ b/source/blender/freestyle/intern/stroke/Stroke.h
@@ -583,8 +583,8 @@ public:
* \param iNVertices
* The number of StrokeVertices we eventually want in our Stroke.
* \return the sampling that must be used in the Resample(float) method.
- * @see Resample(int)
- * @see Resample(float)
+ * \see Resample(int)
+ * \see Resample(float)
*/
float ComputeSampling(int iNVertices);
diff --git a/source/blender/freestyle/intern/view_map/Interface0D.cpp b/source/blender/freestyle/intern/view_map/Interface0D.cpp
index 1d8515700d3..5cfd216cda2 100644
--- a/source/blender/freestyle/intern/view_map/Interface0D.cpp
+++ b/source/blender/freestyle/intern/view_map/Interface0D.cpp
@@ -78,7 +78,7 @@ Geometry::Vec2r Interface0D::getPoint2D() const
return 0;
}
-FEdge * Interface0D::getFEdge(Interface0D&)
+FEdge *Interface0D::getFEdge(Interface0D&)
{
PyErr_SetString(PyExc_TypeError, "method getFEdge() not properly overridden");
return 0;
@@ -96,25 +96,25 @@ Nature::VertexNature Interface0D::getNature() const
return Nature::POINT;
}
-SVertex * Interface0D::castToSVertex()
+SVertex *Interface0D::castToSVertex()
{
PyErr_SetString(PyExc_TypeError, "method castToSVertex() not properly overridden");
return 0;
}
-ViewVertex * Interface0D::castToViewVertex()
+ViewVertex *Interface0D::castToViewVertex()
{
PyErr_SetString(PyExc_TypeError, "method castToViewVertex() not properly overridden");
return 0;
}
-NonTVertex * Interface0D::castToNonTVertex()
+NonTVertex *Interface0D::castToNonTVertex()
{
PyErr_SetString(PyExc_TypeError, "method castToNonTVertex() not properly overridden");
return 0;
}
-TVertex * Interface0D::castToTVertex()
+TVertex *Interface0D::castToTVertex()
{
PyErr_SetString(PyExc_TypeError, "method castToTVertex() not properly overridden");
return 0;
diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h
index 16c9699dcef..74fb875ffc6 100644
--- a/source/blender/freestyle/intern/view_map/ViewMap.h
+++ b/source/blender/freestyle/intern/view_map/ViewMap.h
@@ -1625,16 +1625,16 @@ public:
/*
- #############################################
- #############################################
- #############################################
- ###### ######
- ###### I M P L E M E N T A T I O N ######
- ###### ######
- #############################################
- #############################################
- #############################################
-*/
+ * #############################################
+ * #############################################
+ * #############################################
+ * ###### ######
+ * ###### I M P L E M E N T A T I O N ######
+ * ###### ######
+ * #############################################
+ * #############################################
+ * #############################################
+ */
/* for inline functions */
void ViewShape::SplitEdge(FEdge *fe, const vector<TVertex*>& iViewVertices, vector<FEdge*>& ioNewEdges,
diff --git a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
index 3e80c004b5f..c0562cbb417 100644
--- a/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
@@ -979,7 +979,7 @@ int load(istream& in, ViewMap *vm, ProgressBar *pb)
READ(flags);
Options::setFlags(flags);
- // Read the size of the five ViewMap's lists (with some extra informations for the ViewVertices)
+ // Read the size of the five ViewMap's lists (with some extra information for the ViewVertices)
// and instantiate them (with default costructors)
unsigned vs_s, fe_s, fe_rle1, fe_rle2, sv_s, ve_s, vv_s, vv_rle1, vv_rle2;
READ(vs_s);
@@ -1102,23 +1102,23 @@ int save(ostream& out, ViewMap *vm, ProgressBar *pb)
// For every object, initialize its userdata member to its index in the ViewMap list
for (unsigned int i0 = 0; i0 < vm->ViewShapes().size(); i0++) {
- vm->ViewShapes()[i0]->userdata = SET_UINT_IN_POINTER(i0);
- vm->ViewShapes()[i0]->sshape()->userdata = SET_UINT_IN_POINTER(i0);
+ vm->ViewShapes()[i0]->userdata = POINTER_FROM_UINT(i0);
+ vm->ViewShapes()[i0]->sshape()->userdata = POINTER_FROM_UINT(i0);
}
for (unsigned int i1 = 0; i1 < vm->FEdges().size(); i1++)
- vm->FEdges()[i1]->userdata = SET_UINT_IN_POINTER(i1);
+ vm->FEdges()[i1]->userdata = POINTER_FROM_UINT(i1);
for (unsigned int i2 = 0; i2 < vm->SVertices().size(); i2++)
- vm->SVertices()[i2]->userdata = SET_UINT_IN_POINTER(i2);
+ vm->SVertices()[i2]->userdata = POINTER_FROM_UINT(i2);
for (unsigned int i3 = 0; i3 < vm->ViewEdges().size(); i3++)
- vm->ViewEdges()[i3]->userdata = SET_UINT_IN_POINTER(i3);
+ vm->ViewEdges()[i3]->userdata = POINTER_FROM_UINT(i3);
for (unsigned int i4 = 0; i4 < vm->ViewVertices().size(); i4++)
- vm->ViewVertices()[i4]->userdata = SET_UINT_IN_POINTER(i4);
+ vm->ViewVertices()[i4]->userdata = POINTER_FROM_UINT(i4);
// Write the current options
unsigned char flags = Options::getFlags();
WRITE(flags);
- // Write the size of the five lists (with some extra informations for the ViewVertices)
+ // Write the size of the five lists (with some extra information for the ViewVertices)
unsigned size;
size = vm->ViewShapes().size();
WRITE(size);
diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.h b/source/blender/freestyle/intern/winged_edge/WEdge.h
index 14109fba843..30f55ff7e73 100644
--- a/source/blender/freestyle/intern/winged_edge/WEdge.h
+++ b/source/blender/freestyle/intern/winged_edge/WEdge.h
@@ -1370,18 +1370,16 @@ private:
/*
-
-#############################################
-#############################################
-#############################################
-###### ######
-###### I M P L E M E N T A T I O N ######
-###### ######
-#############################################
-#############################################
-#############################################
-
-*/
+ * #############################################
+ * #############################################
+ * #############################################
+ * ###### ######
+ * ###### I M P L E M E N T A T I O N ######
+ * ###### ######
+ * #############################################
+ * #############################################
+ * #############################################
+ */
/* for inline functions */
void WOEdge::RetrieveCWOrderedEdges(vector<WEdge *>& oEdges)
{
diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.h b/source/blender/freestyle/intern/winged_edge/WXEdge.h
index 774cc67f3ab..cabb1f81c1a 100644
--- a/source/blender/freestyle/intern/winged_edge/WXEdge.h
+++ b/source/blender/freestyle/intern/winged_edge/WXEdge.h
@@ -802,18 +802,16 @@ public:
};
/*
-
-#############################################
-#############################################
-#############################################
-###### ######
-###### I M P L E M E N T A T I O N ######
-###### ######
-#############################################
-#############################################
-#############################################
-
-*/
+ * #############################################
+ * #############################################
+ * #############################################
+ * ###### ######
+ * ###### I M P L E M E N T A T I O N ######
+ * ###### ######
+ * #############################################
+ * #############################################
+ * #############################################
+ */
/* for inline functions */
bool WXVertex::isFeature()
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index cc005e5b6e1..d1e74fc8b3f 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -421,14 +421,14 @@ static void codegen_set_texid(GHash *bindhash, GPUInput *input, int *texid, void
{
if (BLI_ghash_haskey(bindhash, key)) {
/* Reuse existing texid */
- input->texid = GET_INT_FROM_POINTER(BLI_ghash_lookup(bindhash, key));
+ input->texid = POINTER_AS_INT(BLI_ghash_lookup(bindhash, key));
}
else {
/* Allocate new texid */
input->texid = *texid;
(*texid)++;
input->bindtex = true;
- BLI_ghash_insert(bindhash, key, SET_INT_IN_POINTER(input->texid));
+ BLI_ghash_insert(bindhash, key, POINTER_FROM_INT(input->texid));
}
}
@@ -478,13 +478,13 @@ static void codegen_set_unique_ids(ListBase *nodes)
if (input->ima) {
if (!BLI_ghash_haskey(definehash, input->ima)) {
input->definetex = true;
- BLI_ghash_insert(definehash, input->ima, SET_INT_IN_POINTER(input->texid));
+ BLI_ghash_insert(definehash, input->ima, POINTER_FROM_INT(input->texid));
}
}
else {
if (!BLI_ghash_haskey(definehash, input->link)) {
input->definetex = true;
- BLI_ghash_insert(definehash, input->link, SET_INT_IN_POINTER(input->texid));
+ BLI_ghash_insert(definehash, input->link, POINTER_FROM_INT(input->texid));
}
}
}
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index 66945b13aba..5e35b9279d4 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -280,7 +280,7 @@ static void gpu_dump_shaders(const char **code, const int num_shaders, const cha
}
/* We use the same shader index for shaders in the same program.
- * So we call this function once before calling for the invidual shaders. */
+ * So we call this function once before calling for the individual shaders. */
static int shader_index = 0;
if (code == NULL) {
shader_index++;
diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h
index ee51854d7ed..30a9468808c 100644
--- a/source/blender/imbuf/IMB_imbuf_types.h
+++ b/source/blender/imbuf/IMB_imbuf_types.h
@@ -67,7 +67,7 @@ typedef struct DDSData {
*/
/* ibuf->ftype flag, main image types */
-/* Warning: Keep explicit value assignements here, this file is included in areas where not all format defines
+/* Warning: Keep explicit value assignments here, this file is included in areas where not all format defines
* are set (e.g. intern/dds only get WITH_DDS, even if TIFF, HDR etc are also defined). See T46524. */
enum eImbTypes {
IMB_FTYPE_PNG = 1,
@@ -254,7 +254,7 @@ typedef struct ImBuf {
#define IB_tilecache (1 << 11)
#define IB_alphamode_premul (1 << 12) /* indicates whether image on disk have premul alpha */
#define IB_alphamode_detect (1 << 13) /* if this flag is set, alpha mode would be guessed from file */
-#define IB_ignore_alpha (1 << 14) /* ignore alpha on load and substitude it with 1.0f */
+#define IB_ignore_alpha (1 << 14) /* ignore alpha on load and substitute it with 1.0f */
#define IB_thumbnail (1 << 15)
#define IB_multiview (1 << 16)
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 9ab2ee7dd21..89ae32ee2b3 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -1269,7 +1269,7 @@ static ImBuf *anim_getnew(struct anim *anim)
#ifdef WITH_AVI
case ANIM_AVI:
if (startavi(anim)) {
- printf("couldnt start avi\n");
+ printf("couldn't start avi\n");
return (NULL);
}
ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0);
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 86c0dd69930..1d287025a4e 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -624,7 +624,7 @@ void colormanagement_init(void)
OCIO_init();
- ocio_env = getenv("OCIO");
+ ocio_env = BLI_getenv("OCIO");
if (ocio_env && ocio_env[0] != '\0') {
config = OCIO_configCreateFromEnv();
diff --git a/source/blender/imbuf/intern/dds/BlockDXT.cpp b/source/blender/imbuf/intern/dds/BlockDXT.cpp
index 7273ec1659c..0887576eedf 100644
--- a/source/blender/imbuf/intern/dds/BlockDXT.cpp
+++ b/source/blender/imbuf/intern/dds/BlockDXT.cpp
@@ -430,7 +430,7 @@ void AlphaBlockDXT5::decodeBlock(ColorBlock *block) const
void AlphaBlockDXT5::flip4()
{
- uint64 * b = (uint64 *)this;
+ uint64 *b = (uint64 *)this;
// @@ The masks might have to be byte swapped.
uint64 tmp = (*b & (uint64)(0x000000000000FFFFLL));
@@ -444,7 +444,7 @@ void AlphaBlockDXT5::flip4()
void AlphaBlockDXT5::flip2()
{
- uint * b = (uint *)this;
+ uint *b = (uint *)this;
// @@ The masks might have to be byte swapped.
uint tmp = (*b & 0xFF000000);
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp
index d0db912f4dc..e2f52f547f0 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.cpp
+++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp
@@ -170,7 +170,7 @@ bool ColorBlock::isSingleColor(Color32 mask/*= Color32(0xFF, 0xFF, 0xFF, 0x00)*/
return true;
}
-/*
+#if 0
/// Returns true if the block has a single color, ignoring transparent pixels.
bool ColorBlock::isSingleColorNoAlpha() const
{
@@ -194,10 +194,11 @@ bool ColorBlock::isSingleColorNoAlpha() const
return true;
}
-*/
+#endif
+#if 0
/// Count number of unique colors in this color block.
-/*uint ColorBlock::countUniqueColors() const
+uint ColorBlock::countUniqueColors() const
{
uint count = 0;
@@ -217,9 +218,11 @@ bool ColorBlock::isSingleColorNoAlpha() const
}
return count;
-}*/
+}
+#endif
-/*/// Get average color of the block.
+#if 0
+/// Get average color of the block.
Color32 ColorBlock::averageColor() const
{
uint r, g, b, a;
@@ -233,7 +236,8 @@ Color32 ColorBlock::averageColor() const
}
return Color32(uint8(r / 16), uint8(g / 16), uint8(b / 16), uint8(a / 16));
-}*/
+}
+#endif
/// Return true if the block is not fully opaque.
bool ColorBlock::hasAlpha() const
@@ -367,7 +371,8 @@ void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
}
#endif
-/*/// Sort colors by abosolute value in their 16 bit representation.
+#if 0
+/// Sort colors by abosolute value in their 16 bit representation.
void ColorBlock::sortColorsByAbsoluteValue()
{
// Dummy selection sort.
@@ -385,10 +390,11 @@ void ColorBlock::sortColorsByAbsoluteValue()
}
swap( m_color[a], m_color[max] );
}
-}*/
-
+}
+#endif
-/*/// Find extreme colors in the given axis.
+#if 0
+/// Find extreme colors in the given axis.
void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) const
{
@@ -415,10 +421,11 @@ void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) c
*start = m_color[mini];
*end = m_color[maxi];
-}*/
-
+}
+#endif
-/*/// Sort colors in the given axis.
+#if 0
+/// Sort colors in the given axis.
void ColorBlock::sortColors(const Vector3 & axis)
{
float luma_array[16];
@@ -439,10 +446,11 @@ void ColorBlock::sortColors(const Vector3 & axis)
swap( luma_array[a], luma_array[min] );
swap( m_color[a], m_color[min] );
}
-}*/
-
+}
+#endif
-/*/// Get the volume of the color block.
+#if 0
+/// Get the volume of the color block.
float ColorBlock::volume() const
{
Box bounds;
@@ -455,4 +463,4 @@ float ColorBlock::volume() const
return bounds.volume();
}
-*/
+#endif
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.h b/source/blender/imbuf/intern/dds/ColorBlock.h
index 7b5291cf976..67c0b64d53e 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.h
+++ b/source/blender/imbuf/intern/dds/ColorBlock.h
@@ -45,9 +45,9 @@ struct ColorBlock {
ColorBlock();
ColorBlock(const uint * linearImage);
ColorBlock(const ColorBlock & block);
- ColorBlock(const Image * img, uint x, uint y);
+ ColorBlock(const Image *img, uint x, uint y);
- void init(const Image * img, uint x, uint y);
+ void init(const Image *img, uint x, uint y);
void init(uint w, uint h, const uint * data, uint x, uint y);
void init(uint w, uint h, const float * data, uint x, uint y);
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
index df9182c2c1e..9dc48fc10c8 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
@@ -792,7 +792,7 @@ void DDSHeader::setUserVersion(int version)
this->reserved[8] = version;
}
-/*
+#if 0
void DDSHeader::swapBytes()
{
this->fourcc = POSH_LittleU32(this->fourcc);
@@ -828,7 +828,7 @@ void DDSHeader::swapBytes()
this->header10.arraySize = POSH_LittleU32(this->header10.arraySize);
this->header10.reserved = POSH_LittleU32(this->header10.reserved);
}
-*/
+#endif
bool DDSHeader::hasDX10Header() const
{
@@ -909,11 +909,11 @@ bool DirectDrawSurface::isValid() const
}
/* in some files DDSCAPS_TEXTURE is missing: silently ignore */
- /*
- if ( !(header.caps.caps1 & DDSCAPS_TEXTURE) ) {
+#if 0
+ if (!(header.caps.caps1 & DDSCAPS_TEXTURE)) {
return false;
}
- */
+#endif
return true;
}
@@ -1394,7 +1394,7 @@ uint DirectDrawSurface::mipmapSize(uint mipmap) const
}
else if (header.pf.flags & DDPF_RGB || (header.pf.flags & DDPF_LUMINANCE))
{
- uint pitch = computePitch(w, header.pf.bitcount, 8); // Asuming 8 bit alignment, which is the same D3DX expects.
+ uint pitch = computePitch(w, header.pf.bitcount, 8); // Assuming 8 bit alignment, which is the same D3DX expects.
return pitch * h * d;
}
diff --git a/source/blender/imbuf/intern/dds/Image.cpp b/source/blender/imbuf/intern/dds/Image.cpp
index fd3ca1c35e6..2e9ae9da388 100644
--- a/source/blender/imbuf/intern/dds/Image.cpp
+++ b/source/blender/imbuf/intern/dds/Image.cpp
@@ -82,7 +82,7 @@ const Color32 * Image::scanline(uint h) const
return m_data + h * m_width;
}
-Color32 * Image::scanline(uint h)
+Color32 *Image::scanline(uint h)
{
if (h >= m_height) {
printf("DDS: scanline beyond dimensions of image\n");
@@ -91,12 +91,12 @@ Color32 * Image::scanline(uint h)
return m_data + h * m_width;
}
-const Color32 * Image::pixels() const
+const Color32 *Image::pixels() const
{
return m_data;
}
-Color32 * Image::pixels()
+Color32 *Image::pixels()
{
return m_data;
}
diff --git a/source/blender/imbuf/intern/dds/Image.h b/source/blender/imbuf/intern/dds/Image.h
index bb74a9d5d15..9a8bacd93a3 100644
--- a/source/blender/imbuf/intern/dds/Image.h
+++ b/source/blender/imbuf/intern/dds/Image.h
@@ -65,11 +65,11 @@ public:
uint width() const;
uint height() const;
- const Color32 * scanline(uint h) const;
- Color32 * scanline(uint h);
+ const Color32 *scanline(uint h) const;
+ Color32 *scanline(uint h);
- const Color32 * pixels() const;
- Color32 * pixels();
+ const Color32 *pixels() const;
+ Color32 *pixels();
const Color32 & pixel(uint idx) const;
Color32 & pixel(uint idx);
@@ -87,7 +87,7 @@ private:
uint m_width;
uint m_height;
Format m_format;
- Color32 * m_data;
+ Color32 *m_data;
};
diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c
index 25bbd132a49..a5af51e3e95 100644
--- a/source/blender/imbuf/intern/filetype.c
+++ b/source/blender/imbuf/intern/filetype.c
@@ -74,7 +74,7 @@ const ImFileType IMB_FILE_TYPES[] = {
{NULL, NULL, imb_is_a_hdr, NULL, imb_ftype_default, imb_loadhdr, NULL, imb_savehdr, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_RADHDR, COLOR_ROLE_DEFAULT_FLOAT},
#endif
#ifdef WITH_OPENEXR
- {imb_initopenexr, NULL, imb_is_a_openexr, NULL, imb_ftype_default, imb_load_openexr, NULL, imb_save_openexr, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_OPENEXR, COLOR_ROLE_DEFAULT_FLOAT},
+ {imb_initopenexr, imb_exitopenexr, imb_is_a_openexr, NULL, imb_ftype_default, imb_load_openexr, NULL, imb_save_openexr, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_OPENEXR, COLOR_ROLE_DEFAULT_FLOAT},
#endif
#ifdef WITH_OPENJPEG
{NULL, NULL, imb_is_a_jp2, NULL, imb_ftype_default, imb_load_jp2, NULL, imb_save_jp2, NULL, IM_FTYPE_FLOAT, IMB_FTYPE_JP2, COLOR_ROLE_DEFAULT_BYTE},
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index 2eec5da7bc4..507455c47f4 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -391,7 +391,7 @@ static void processor_apply_scanline_func(TaskPool * __restrict pool,
int UNUSED(threadid))
{
ScanlineGlobalData *data = BLI_task_pool_userdata(pool);
- int start_scanline = GET_INT_FROM_POINTER(taskdata);
+ int start_scanline = POINTER_AS_INT(taskdata);
int num_scanlines = min_ii(data->scanlines_per_task,
data->total_scanlines - start_scanline);
data->do_thread(data->custom_data,
@@ -415,7 +415,7 @@ void IMB_processor_apply_threaded_scanlines(int total_scanlines,
for (int i = 0, start_line = 0; i < total_tasks; i++) {
BLI_task_pool_push(task_pool,
processor_apply_scanline_func,
- SET_INT_IN_POINTER(start_line),
+ POINTER_FROM_INT(start_line),
false,
TASK_PRIORITY_LOW);
start_line += scanlines_per_task;
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index ba48feb01e8..50690cfa047 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -765,17 +765,16 @@ fail:
return DIRTY_FLAG_ENCODING;
}
-/*
- * output_iris -
- * copy an array of ints to an iris image file. Each int
- * represents one pixel. xsize and ysize specify the dimensions of
- * the pixel array. zsize specifies what kind of image file to
- * write out. if zsize is 1, the luminance of the pixels are
- * calculated, and a single channel black and white image is saved.
- * If zsize is 3, an RGB image file is saved. If zsize is 4, an
- * RGBA image file is saved.
+/**
+ * Copy an array of ints to an iris image file.
+ * Each int represents one pixel. xsize and ysize specify the dimensions of
+ * the pixel array. zsize specifies what kind of image file to
+ * write out. if zsize is 1, the luminance of the pixels are
+ * calculated, and a single channel black and white image is saved.
+ * If zsize is 3, an RGB image file is saved. If zsize is 4, an
+ * RGBA image file is saved.
*
- * Added: zbuf write
+ * Added: zbuf write
*/
static int output_iris(uint *lptr, int xsize, int ysize, int zsize, const char *name, int *zptr)
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index cd6bdd643d5..caf2634bac7 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -38,12 +38,6 @@
#include "openjpeg.h"
-/* Temporary duplicated implementations for version 1.5 and 2.3, until we
- * upgrade all platforms to 2.3. When removing the old code,
- * imb_load_jp2_filepath can be added in filetype.c. */
-
-#if defined(OPJ_VERSION_MAJOR) && OPJ_VERSION_MAJOR >= 2
-
#define JP2_FILEHEADER_SIZE 12
static const char JP2_HEAD[] = {0x0, 0x0, 0x0, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A};
@@ -1281,1020 +1275,3 @@ finally:
return ok;
}
-
-#else /* defined(OPJ_VERSION_MAJOR) && OPJ_VERSION_MAJOR >= 2 */
-
-static const char JP2_HEAD[] = {0x0, 0x0, 0x0, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A};
-static const char J2K_HEAD[] = {0xFF, 0x4F, 0xFF, 0x51, 0x00};
-
-/* We only need this because of how the presets are set */
-/* this typedef is copied from 'openjpeg-1.5.0/applications/codec/image_to_j2k.c' */
-typedef struct img_folder {
- /** The directory path of the folder containing input images*/
- char *imgdirpath;
- /** Output format*/
- char *out_format;
- /** Enable option*/
- char set_imgdir;
- /** Enable Cod Format for output*/
- char set_out_format;
- /** User specified rate stored in case of cinema option*/
- float *rates;
-} img_fol_t;
-
-enum {
- DCP_CINEMA2K = 3,
- DCP_CINEMA4K = 4,
-};
-
-static bool check_jp2(const unsigned char *mem) /* J2K_CFMT */
-{
- return memcmp(JP2_HEAD, mem, sizeof(JP2_HEAD)) ? 0 : 1;
-}
-
-static bool check_j2k(const unsigned char *mem) /* J2K_CFMT */
-{
- return memcmp(J2K_HEAD, mem, sizeof(J2K_HEAD)) ? 0 : 1;
-}
-
-int imb_is_a_jp2(const unsigned char *buf)
-{
- return check_jp2(buf);
-}
-
-/**
- * sample error callback expecting a FILE* client object
- */
-static void error_callback(const char *msg, void *client_data)
-{
- FILE *stream = (FILE *)client_data;
- fprintf(stream, "[ERROR] %s", msg);
-}
-/**
- * sample warning callback expecting a FILE* client object
- */
-static void warning_callback(const char *msg, void *client_data)
-{
- FILE *stream = (FILE *)client_data;
- fprintf(stream, "[WARNING] %s", msg);
-}
-
-/**
- * sample debug callback expecting no client object
- */
-static void info_callback(const char *msg, void *client_data)
-{
- (void)client_data;
- fprintf(stdout, "[INFO] %s", msg);
-}
-
-# define PIXEL_LOOPER_BEGIN(_rect) \
- for (y = h - 1; y != (unsigned int)(-1); y--) { \
- for (i = y * w, i_next = (y + 1) * w; \
- i < i_next; \
- i++, _rect += 4) \
- { \
-
-# define PIXEL_LOOPER_BEGIN_CHANNELS(_rect, _channels) \
- for (y = h - 1; y != (unsigned int)(-1); y--) { \
- for (i = y * w, i_next = (y + 1) * w; \
- i < i_next; \
- i++, _rect += _channels) \
- { \
-
-# define PIXEL_LOOPER_END \
- } \
-} (void)0 \
-
-struct ImBuf *imb_load_jp2(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
-{
- struct ImBuf *ibuf = NULL;
- bool use_float = false; /* for precision higher then 8 use float */
- bool use_alpha = false;
-
- long signed_offsets[4] = {0, 0, 0, 0};
- int float_divs[4] = {1, 1, 1, 1};
-
- unsigned int i, i_next, w, h, planes;
- unsigned int y;
- int *r, *g, *b, *a; /* matching 'opj_image_comp.data' type */
- bool is_jp2, is_j2k;
-
- opj_dparameters_t parameters; /* decompression parameters */
-
- opj_event_mgr_t event_mgr; /* event manager */
- opj_image_t *image = NULL;
-
- opj_dinfo_t *dinfo = NULL; /* handle to a decompressor */
- opj_cio_t *cio = NULL;
-
- is_jp2 = check_jp2(mem);
- is_j2k = check_j2k(mem);
-
- if (!is_jp2 && !is_j2k)
- return(NULL);
-
- /* both 8, 12 and 16 bit JP2Ks are default to standard byte colorspace */
- colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE);
-
- /* configure the event callbacks (not required) */
- memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
- event_mgr.error_handler = error_callback;
- event_mgr.warning_handler = warning_callback;
- event_mgr.info_handler = info_callback;
-
-
- /* set decoding parameters to default values */
- opj_set_default_decoder_parameters(&parameters);
-
-
- /* JPEG 2000 compressed image data */
-
- /* get a decoder handle */
- dinfo = opj_create_decompress(is_jp2 ? CODEC_JP2 : CODEC_J2K);
-
- /* catch events using our callbacks and give a local context */
- opj_set_event_mgr((opj_common_ptr)dinfo, &event_mgr, stderr);
-
- /* setup the decoder decoding parameters using the current image and user parameters */
- opj_setup_decoder(dinfo, &parameters);
-
- /* open a byte stream */
- /* note, we can't avoid removing 'const' cast here */
- cio = opj_cio_open((opj_common_ptr)dinfo, (unsigned char *)mem, size);
-
- /* decode the stream and fill the image structure */
- image = opj_decode(dinfo, cio);
-
- if (!image) {
- fprintf(stderr, "ERROR -> j2k_to_image: failed to decode image!\n");
- opj_destroy_decompress(dinfo);
- opj_cio_close(cio);
- return NULL;
- }
-
- /* close the byte stream */
- opj_cio_close(cio);
-
-
- if ((image->numcomps * image->x1 * image->y1) == 0) {
- fprintf(stderr, "\nError: invalid raw image parameters\n");
- return NULL;
- }
-
- w = image->comps[0].w;
- h = image->comps[0].h;
-
- switch (image->numcomps) {
- case 1: /* Grayscale */
- case 3: /* Color */
- planes = 24;
- use_alpha = false;
- break;
- default: /* 2 or 4 - Grayscale or Color + alpha */
- planes = 32; /* grayscale + alpha */
- use_alpha = true;
- break;
- }
-
-
- i = image->numcomps;
- if (i > 4) i = 4;
-
- while (i) {
- i--;
-
- if (image->comps[i].prec > 8)
- use_float = true;
-
- if (image->comps[i].sgnd)
- signed_offsets[i] = 1 << (image->comps[i].prec - 1);
-
- /* only needed for float images but dosnt hurt to calc this */
- float_divs[i] = (1 << image->comps[i].prec) - 1;
- }
-
- ibuf = IMB_allocImBuf(w, h, planes, use_float ? IB_rectfloat : IB_rect);
-
- if (ibuf == NULL) {
- if (dinfo)
- opj_destroy_decompress(dinfo);
- return NULL;
- }
-
- ibuf->ftype = IMB_FTYPE_JP2;
- if (is_jp2)
- ibuf->foptions.flag |= JP2_JP2;
- else
- ibuf->foptions.flag |= JP2_J2K;
-
- if (use_float) {
- float *rect_float = ibuf->rect_float;
-
- if (image->numcomps < 3) {
- r = image->comps[0].data;
- a = (use_alpha) ? image->comps[1].data : NULL;
-
- /* grayscale 12bits+ */
- if (use_alpha) {
- a = image->comps[1].data;
- PIXEL_LOOPER_BEGIN(rect_float) {
- rect_float[0] = rect_float[1] = rect_float[2] = (float)(r[i] + signed_offsets[0]) / float_divs[0];
- rect_float[3] = (a[i] + signed_offsets[1]) / float_divs[1];
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN(rect_float) {
- rect_float[0] = rect_float[1] = rect_float[2] = (float)(r[i] + signed_offsets[0]) / float_divs[0];
- rect_float[3] = 1.0f;
- }
- PIXEL_LOOPER_END;
- }
- }
- else {
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
-
- /* rgb or rgba 12bits+ */
- if (use_alpha) {
- a = image->comps[3].data;
- PIXEL_LOOPER_BEGIN(rect_float) {
- rect_float[0] = (float)(r[i] + signed_offsets[0]) / float_divs[0];
- rect_float[1] = (float)(g[i] + signed_offsets[1]) / float_divs[1];
- rect_float[2] = (float)(b[i] + signed_offsets[2]) / float_divs[2];
- rect_float[3] = (float)(a[i] + signed_offsets[3]) / float_divs[3];
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN(rect_float) {
- rect_float[0] = (float)(r[i] + signed_offsets[0]) / float_divs[0];
- rect_float[1] = (float)(g[i] + signed_offsets[1]) / float_divs[1];
- rect_float[2] = (float)(b[i] + signed_offsets[2]) / float_divs[2];
- rect_float[3] = 1.0f;
- }
- PIXEL_LOOPER_END;
- }
- }
-
- }
- else {
- unsigned char *rect_uchar = (unsigned char *)ibuf->rect;
-
- if (image->numcomps < 3) {
- r = image->comps[0].data;
- a = (use_alpha) ? image->comps[1].data : NULL;
-
- /* grayscale */
- if (use_alpha) {
- a = image->comps[3].data;
- PIXEL_LOOPER_BEGIN(rect_uchar) {
- rect_uchar[0] = rect_uchar[1] = rect_uchar[2] = (r[i] + signed_offsets[0]);
- rect_uchar[3] = a[i] + signed_offsets[1];
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN(rect_uchar) {
- rect_uchar[0] = rect_uchar[1] = rect_uchar[2] = (r[i] + signed_offsets[0]);
- rect_uchar[3] = 255;
- }
- PIXEL_LOOPER_END;
- }
- }
- else {
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
-
- /* 8bit rgb or rgba */
- if (use_alpha) {
- a = image->comps[3].data;
- PIXEL_LOOPER_BEGIN(rect_uchar) {
- rect_uchar[0] = r[i] + signed_offsets[0];
- rect_uchar[1] = g[i] + signed_offsets[1];
- rect_uchar[2] = b[i] + signed_offsets[2];
- rect_uchar[3] = a[i] + signed_offsets[3];
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN(rect_uchar) {
- rect_uchar[0] = r[i] + signed_offsets[0];
- rect_uchar[1] = g[i] + signed_offsets[1];
- rect_uchar[2] = b[i] + signed_offsets[2];
- rect_uchar[3] = 255;
- }
- PIXEL_LOOPER_END;
- }
- }
- }
-
- /* free remaining structures */
- if (dinfo) {
- opj_destroy_decompress(dinfo);
- }
-
- /* free image data structure */
- opj_image_destroy(image);
-
- if (flags & IB_rect) {
- IMB_rect_from_float(ibuf);
- }
-
- return(ibuf);
-}
-
-//static opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp)
-/* prec can be 8, 12, 16 */
-
-/* use inline because the float passed can be a function call that would end up being called many times */
-#if 0
-#define UPSAMPLE_8_TO_12(_val) ((_val << 4) | (_val & ((1 << 4) - 1)))
-#define UPSAMPLE_8_TO_16(_val) ((_val << 8) + _val)
-
-#define DOWNSAMPLE_FLOAT_TO_8BIT(_val) (_val) <= 0.0f ? 0 : ((_val) >= 1.0f ? 255 : (int)(255.0f * (_val)))
-#define DOWNSAMPLE_FLOAT_TO_12BIT(_val) (_val) <= 0.0f ? 0 : ((_val) >= 1.0f ? 4095 : (int)(4095.0f * (_val)))
-#define DOWNSAMPLE_FLOAT_TO_16BIT(_val) (_val) <= 0.0f ? 0 : ((_val) >= 1.0f ? 65535 : (int)(65535.0f * (_val)))
-#else
-
-BLI_INLINE int UPSAMPLE_8_TO_12(const unsigned char _val)
-{
- return (_val << 4) | (_val & ((1 << 4) - 1));
-}
-BLI_INLINE int UPSAMPLE_8_TO_16(const unsigned char _val)
-{
- return (_val << 8) + _val;
-}
-
-BLI_INLINE int DOWNSAMPLE_FLOAT_TO_8BIT(const float _val)
-{
- return (_val) <= 0.0f ? 0 : ((_val) >= 1.0f ? 255 : (int)(255.0f * (_val)));
-}
-BLI_INLINE int DOWNSAMPLE_FLOAT_TO_12BIT(const float _val)
-{
- return (_val) <= 0.0f ? 0 : ((_val) >= 1.0f ? 4095 : (int)(4095.0f * (_val)));
-}
-BLI_INLINE int DOWNSAMPLE_FLOAT_TO_16BIT(const float _val)
-{
- return (_val) <= 0.0f ? 0 : ((_val) >= 1.0f ? 65535 : (int)(65535.0f * (_val)));
-}
-#endif
-
-/*
- * 2048x1080 (2K) at 24 fps or 48 fps, or 4096x2160 (4K) at 24 fps; 3x12 bits per pixel, XYZ color space
- *
- * - In 2K, for Scope (2.39:1) presentation 2048x858 pixels of the image is used
- * - In 2K, for Flat (1.85:1) presentation 1998x1080 pixels of the image is used
- */
-
-/* ****************************** COPIED FROM image_to_j2k.c */
-
-/* ----------------------------------------------------------------------- */
-#define CINEMA_24_CS 1302083 /*Codestream length for 24fps*/
-#define CINEMA_48_CS 651041 /*Codestream length for 48fps*/
-#define COMP_24_CS 1041666 /*Maximum size per color component for 2K & 4K @ 24fps*/
-#define COMP_48_CS 520833 /*Maximum size per color component for 2K @ 48fps*/
-
-
-static int initialise_4K_poc(opj_poc_t *POC, int numres)
-{
- POC[0].tile = 1;
- POC[0].resno0 = 0;
- POC[0].compno0 = 0;
- POC[0].layno1 = 1;
- POC[0].resno1 = numres - 1;
- POC[0].compno1 = 3;
- POC[0].prg1 = CPRL;
- POC[1].tile = 1;
- POC[1].resno0 = numres - 1;
- POC[1].compno0 = 0;
- POC[1].layno1 = 1;
- POC[1].resno1 = numres;
- POC[1].compno1 = 3;
- POC[1].prg1 = CPRL;
- return 2;
-}
-
-static void cinema_parameters(opj_cparameters_t *parameters)
-{
- parameters->tile_size_on = 0; /* false */
- parameters->cp_tdx = 1;
- parameters->cp_tdy = 1;
-
- /*Tile part*/
- parameters->tp_flag = 'C';
- parameters->tp_on = 1;
-
- /*Tile and Image shall be at (0, 0)*/
- parameters->cp_tx0 = 0;
- parameters->cp_ty0 = 0;
- parameters->image_offset_x0 = 0;
- parameters->image_offset_y0 = 0;
-
- /*Codeblock size = 32 * 32*/
- parameters->cblockw_init = 32;
- parameters->cblockh_init = 32;
- parameters->csty |= 0x01;
-
- /*The progression order shall be CPRL*/
- parameters->prog_order = CPRL;
-
- /* No ROI */
- parameters->roi_compno = -1;
-
- parameters->subsampling_dx = 1; parameters->subsampling_dy = 1;
-
- /* 9-7 transform */
- parameters->irreversible = 1;
-}
-
-static void cinema_setup_encoder(opj_cparameters_t *parameters, opj_image_t *image, img_fol_t *img_fol)
-{
- int i;
- float temp_rate;
-
- switch (parameters->cp_cinema) {
- case CINEMA2K_24:
- case CINEMA2K_48:
- if (parameters->numresolution > 6) {
- parameters->numresolution = 6;
- }
- if (!((image->comps[0].w == 2048) || (image->comps[0].h == 1080))) {
- fprintf(stdout, "Image coordinates %d x %d is not 2K compliant.\nJPEG Digital Cinema Profile-3 "
- "(2K profile) compliance requires that at least one of coordinates match 2048 x 1080\n",
- image->comps[0].w, image->comps[0].h);
- parameters->cp_rsiz = STD_RSIZ;
- }
- else {
- parameters->cp_rsiz = DCP_CINEMA2K;
- }
- break;
-
- case CINEMA4K_24:
- if (parameters->numresolution < 1) {
- parameters->numresolution = 1;
- }
- else if (parameters->numresolution > 7) {
- parameters->numresolution = 7;
- }
- if (!((image->comps[0].w == 4096) || (image->comps[0].h == 2160))) {
- fprintf(stdout, "Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4"
- "(4K profile) compliance requires that at least one of coordinates match 4096 x 2160\n",
- image->comps[0].w, image->comps[0].h);
- parameters->cp_rsiz = STD_RSIZ;
- }
- else {
- parameters->cp_rsiz = DCP_CINEMA2K;
- }
- parameters->numpocs = initialise_4K_poc(parameters->POC, parameters->numresolution);
- break;
- case OFF:
- /* do nothing */
- break;
- }
-
- switch (parameters->cp_cinema) {
- case CINEMA2K_24:
- case CINEMA4K_24:
- for (i = 0; i < parameters->tcp_numlayers; i++) {
- temp_rate = 0;
- if (img_fol->rates[i] == 0) {
- parameters->tcp_rates[0] = ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)) /
- (CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }
- else {
- temp_rate = ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)) /
- (img_fol->rates[i] * 8 * image->comps[0].dx * image->comps[0].dy);
- if (temp_rate > CINEMA_24_CS) {
- parameters->tcp_rates[i] = ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)) /
- (CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }
- else {
- parameters->tcp_rates[i] = img_fol->rates[i];
- }
- }
- }
- parameters->max_comp_size = COMP_24_CS;
- break;
-
- case CINEMA2K_48:
- for (i = 0; i < parameters->tcp_numlayers; i++) {
- temp_rate = 0;
- if (img_fol->rates[i] == 0) {
- parameters->tcp_rates[0] = ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)) /
- (CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }
- else {
- temp_rate = ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)) /
- (img_fol->rates[i] * 8 * image->comps[0].dx * image->comps[0].dy);
- if (temp_rate > CINEMA_48_CS) {
- parameters->tcp_rates[0] = ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)) /
- (CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
- }
- else {
- parameters->tcp_rates[i] = img_fol->rates[i];
- }
- }
- }
- parameters->max_comp_size = COMP_48_CS;
- break;
- case OFF:
- /* do nothing */
- break;
- }
- parameters->cp_disto_alloc = 1;
-}
-
-static float channel_colormanage_noop(float value)
-{
- return value;
-}
-
-static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
-{
- unsigned char *rect_uchar;
- float *rect_float, from_straight[4];
-
- unsigned int subsampling_dx = parameters->subsampling_dx;
- unsigned int subsampling_dy = parameters->subsampling_dy;
-
- unsigned int i, i_next, numcomps, w, h, prec;
- unsigned int y;
- int *r, *g, *b, *a; /* matching 'opj_image_comp.data' type */
- OPJ_COLOR_SPACE color_space;
- opj_image_cmptparm_t cmptparm[4]; /* maximum of 4 components */
- opj_image_t *image = NULL;
-
- float (*chanel_colormanage_cb)(float);
-
- img_fol_t img_fol; /* only needed for cinema presets */
- memset(&img_fol, 0, sizeof(img_fol_t));
-
- if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) {
- /* float buffer was managed already, no need in color space conversion */
- chanel_colormanage_cb = channel_colormanage_noop;
- }
- else {
- /* standard linear-to-srgb conversion if float buffer wasn't managed */
- chanel_colormanage_cb = linearrgb_to_srgb;
- }
-
- if (ibuf->foptions.flag & JP2_CINE) {
-
- if (ibuf->x == 4096 || ibuf->y == 2160)
- parameters->cp_cinema = CINEMA4K_24;
- else {
- if (ibuf->foptions.flag & JP2_CINE_48FPS) {
- parameters->cp_cinema = CINEMA2K_48;
- }
- else {
- parameters->cp_cinema = CINEMA2K_24;
- }
- }
- if (parameters->cp_cinema) {
- img_fol.rates = (float *)MEM_mallocN(parameters->tcp_numlayers * sizeof(float), "jp2_rates");
- for (i = 0; i < parameters->tcp_numlayers; i++) {
- img_fol.rates[i] = parameters->tcp_rates[i];
- }
- cinema_parameters(parameters);
- }
-
- color_space = (ibuf->foptions.flag & JP2_YCC) ? CLRSPC_SYCC : CLRSPC_SRGB;
- prec = 12;
- numcomps = 3;
- }
- else {
- /* Get settings from the imbuf */
- color_space = (ibuf->foptions.flag & JP2_YCC) ? CLRSPC_SYCC : CLRSPC_SRGB;
-
- if (ibuf->foptions.flag & JP2_16BIT) prec = 16;
- else if (ibuf->foptions.flag & JP2_12BIT) prec = 12;
- else prec = 8;
-
- /* 32bit images == alpha channel */
- /* grayscale not supported yet */
- numcomps = (ibuf->planes == 32) ? 4 : 3;
- }
-
- w = ibuf->x;
- h = ibuf->y;
-
-
- /* initialize image components */
- memset(&cmptparm, 0, 4 * sizeof(opj_image_cmptparm_t));
- for (i = 0; i < numcomps; i++) {
- cmptparm[i].prec = prec;
- cmptparm[i].bpp = prec;
- cmptparm[i].sgnd = 0;
- cmptparm[i].dx = subsampling_dx;
- cmptparm[i].dy = subsampling_dy;
- cmptparm[i].w = w;
- cmptparm[i].h = h;
- }
- /* create the image */
- image = opj_image_create(numcomps, &cmptparm[0], color_space);
- if (!image) {
- printf("Error: opj_image_create() failed\n");
- return NULL;
- }
-
- /* set image offset and reference grid */
- image->x0 = parameters->image_offset_x0;
- image->y0 = parameters->image_offset_y0;
- image->x1 = image->x0 + (w - 1) * subsampling_dx + 1 + image->x0;
- image->y1 = image->y0 + (h - 1) * subsampling_dy + 1 + image->y0;
-
- /* set image data */
- rect_uchar = (unsigned char *) ibuf->rect;
- rect_float = ibuf->rect_float;
-
- /* set the destination channels */
- r = image->comps[0].data;
- g = image->comps[1].data;
- b = image->comps[2].data;
- a = (numcomps == 4) ? image->comps[3].data : NULL;
-
- if (rect_float && rect_uchar && prec == 8) {
- /* No need to use the floating point buffer, just write the 8 bits from the char buffer */
- rect_float = NULL;
- }
-
- if (rect_float) {
- int channels_in_float = ibuf->channels ? ibuf->channels : 4;
-
- switch (prec) {
- case 8: /* Convert blenders float color channels to 8, 12 or 16bit ints */
- if (numcomps == 4) {
- if (channels_in_float == 4) {
- PIXEL_LOOPER_BEGIN(rect_float)
- {
- premul_to_straight_v4_v4(from_straight, rect_float);
- r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[2]));
- a[i] = DOWNSAMPLE_FLOAT_TO_8BIT(from_straight[3]);
- }
- PIXEL_LOOPER_END;
- }
- else if (channels_in_float == 3) {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[2]));
- a[i] = 255;
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = b[i] = r[i];
- a[i] = 255;
- }
- PIXEL_LOOPER_END;
- }
- }
- else {
- if (channels_in_float == 4) {
- PIXEL_LOOPER_BEGIN(rect_float)
- {
- premul_to_straight_v4_v4(from_straight, rect_float);
- r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(from_straight[2]));
- }
- PIXEL_LOOPER_END;
- }
- else if (channels_in_float == 3) {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[2]));
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_8BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = b[i] = r[i];
- }
- PIXEL_LOOPER_END;
- }
- }
- break;
-
- case 12:
- if (numcomps == 4) {
- if (channels_in_float == 4) {
- PIXEL_LOOPER_BEGIN(rect_float)
- {
- premul_to_straight_v4_v4(from_straight, rect_float);
- r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[2]));
- a[i] = DOWNSAMPLE_FLOAT_TO_12BIT(from_straight[3]);
- }
- PIXEL_LOOPER_END;
- }
- else if (channels_in_float == 3) {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[2]));
- a[i] = 4095;
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = b[i] = r[i];
- a[i] = 4095;
- }
- PIXEL_LOOPER_END;
- }
- }
- else {
- if (channels_in_float == 4) {
- PIXEL_LOOPER_BEGIN(rect_float)
- {
- premul_to_straight_v4_v4(from_straight, rect_float);
- r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(from_straight[2]));
- }
- PIXEL_LOOPER_END;
- }
- else if (channels_in_float == 3) {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[2]));
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_12BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = b[i] = r[i];
- }
- PIXEL_LOOPER_END;
- }
- }
- break;
-
- case 16:
- if (numcomps == 4) {
- if (channels_in_float == 4) {
- PIXEL_LOOPER_BEGIN(rect_float)
- {
- premul_to_straight_v4_v4(from_straight, rect_float);
- r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[2]));
- a[i] = DOWNSAMPLE_FLOAT_TO_16BIT(from_straight[3]);
- }
- PIXEL_LOOPER_END;
- }
- else if (channels_in_float == 3) {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[2]));
- a[i] = 65535;
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = b[i] = r[i];
- a[i] = 65535;
- }
- PIXEL_LOOPER_END;
- }
- }
- else {
- if (channels_in_float == 4) {
- PIXEL_LOOPER_BEGIN(rect_float)
- {
- premul_to_straight_v4_v4(from_straight, rect_float);
- r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(from_straight[2]));
- }
- PIXEL_LOOPER_END;
- }
- else if (channels_in_float == 3) {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 3)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[1]));
- b[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[2]));
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN_CHANNELS(rect_float, 1)
- {
- r[i] = DOWNSAMPLE_FLOAT_TO_16BIT(chanel_colormanage_cb(rect_float[0]));
- g[i] = b[i] = r[i];
- }
- PIXEL_LOOPER_END;
- }
- }
- break;
- }
- }
- else {
- /* just use rect*/
- switch (prec) {
- case 8:
- if (numcomps == 4) {
- PIXEL_LOOPER_BEGIN(rect_uchar)
- {
- r[i] = rect_uchar[0];
- g[i] = rect_uchar[1];
- b[i] = rect_uchar[2];
- a[i] = rect_uchar[3];
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN(rect_uchar)
- {
- r[i] = rect_uchar[0];
- g[i] = rect_uchar[1];
- b[i] = rect_uchar[2];
- }
- PIXEL_LOOPER_END;
- }
- break;
-
- case 12: /* Up Sampling, a bit pointless but best write the bit depth requested */
- if (numcomps == 4) {
- PIXEL_LOOPER_BEGIN(rect_uchar)
- {
- r[i] = UPSAMPLE_8_TO_12(rect_uchar[0]);
- g[i] = UPSAMPLE_8_TO_12(rect_uchar[1]);
- b[i] = UPSAMPLE_8_TO_12(rect_uchar[2]);
- a[i] = UPSAMPLE_8_TO_12(rect_uchar[3]);
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN(rect_uchar)
- {
- r[i] = UPSAMPLE_8_TO_12(rect_uchar[0]);
- g[i] = UPSAMPLE_8_TO_12(rect_uchar[1]);
- b[i] = UPSAMPLE_8_TO_12(rect_uchar[2]);
- }
- PIXEL_LOOPER_END;
- }
- break;
-
- case 16:
- if (numcomps == 4) {
- PIXEL_LOOPER_BEGIN(rect_uchar)
- {
- r[i] = UPSAMPLE_8_TO_16(rect_uchar[0]);
- g[i] = UPSAMPLE_8_TO_16(rect_uchar[1]);
- b[i] = UPSAMPLE_8_TO_16(rect_uchar[2]);
- a[i] = UPSAMPLE_8_TO_16(rect_uchar[3]);
- }
- PIXEL_LOOPER_END;
- }
- else {
- PIXEL_LOOPER_BEGIN(rect_uchar)
- {
- r[i] = UPSAMPLE_8_TO_16(rect_uchar[0]);
- g[i] = UPSAMPLE_8_TO_16(rect_uchar[1]);
- b[i] = UPSAMPLE_8_TO_16(rect_uchar[2]);
- }
- PIXEL_LOOPER_END;
- }
- break;
- }
- }
-
- /* Decide if MCT should be used */
- parameters->tcp_mct = image->numcomps == 3 ? 1 : 0;
-
- if (parameters->cp_cinema) {
- cinema_setup_encoder(parameters, image, &img_fol);
- }
-
- if (img_fol.rates)
- MEM_freeN(img_fol.rates);
-
- return image;
-}
-
-
-/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
-int imb_save_jp2(struct ImBuf *ibuf, const char *name, int flags)
-{
- int quality = ibuf->foptions.quality;
-
- int bSuccess;
- opj_cparameters_t parameters; /* compression parameters */
- opj_event_mgr_t event_mgr; /* event manager */
- opj_image_t *image = NULL;
-
- (void)flags; /* unused */
-
- /*
- * configure the event callbacks (not required)
- * setting of each callback is optional
- */
- memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
- event_mgr.error_handler = error_callback;
- event_mgr.warning_handler = warning_callback;
- event_mgr.info_handler = info_callback;
-
- /* set encoding parameters to default values */
- opj_set_default_encoder_parameters(&parameters);
-
- /* compression ratio */
- /* invert range, from 10-100, 100-1
- * where jpeg see's 1 and highest quality (lossless) and 100 is very low quality*/
- parameters.tcp_rates[0] = ((100 - quality) / 90.0f * 99.0f) + 1;
-
-
- parameters.tcp_numlayers = 1; /* only one resolution */
- parameters.cp_disto_alloc = 1;
-
- image = ibuftoimage(ibuf, &parameters);
-
-
- { /* JP2 format output */
- int codestream_length;
- opj_cio_t *cio = NULL;
- FILE *f = NULL;
- opj_cinfo_t *cinfo = NULL;
-
- /* get a JP2 compressor handle */
- if (ibuf->foptions.flag & JP2_JP2)
- cinfo = opj_create_compress(CODEC_JP2);
- else if (ibuf->foptions.flag & JP2_J2K)
- cinfo = opj_create_compress(CODEC_J2K);
- else
- BLI_assert(!"Unsupported codec was specified in save settings");
-
- /* catch events using our callbacks and give a local context */
- opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr);
-
- /* setup the encoder parameters using the current image and using user parameters */
- opj_setup_encoder(cinfo, &parameters, image);
-
- /* open a byte stream for writing */
- /* allocate memory for all tiles */
- cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);
-
- /* encode the image */
- bSuccess = opj_encode(cinfo, cio, image, NULL); /* last arg used to be parameters.index but this deprecated */
-
- if (!bSuccess) {
- opj_cio_close(cio);
- fprintf(stderr, "failed to encode image\n");
- return 0;
- }
- codestream_length = cio_tell(cio);
-
- /* write the buffer to disk */
- f = BLI_fopen(name, "wb");
-
- if (!f) {
- fprintf(stderr, "failed to open %s for writing\n", name);
- return 1;
- }
- fwrite(cio->buffer, 1, codestream_length, f);
- fclose(f);
- fprintf(stderr, "Generated outfile %s\n", name);
- /* close and free the byte stream */
- opj_cio_close(cio);
-
- /* free remaining compression structures */
- opj_destroy_compress(cinfo);
- }
-
- /* free image data */
- opj_image_destroy(image);
-
- return 1;
-}
-
-#endif /* defined(OPJ_VERSION_MAJOR) && OPJ_VERSION_MAJOR >= 2 */
diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c
index daf062f5499..2a650a0c63a 100644
--- a/source/blender/imbuf/intern/moviecache.c
+++ b/source/blender/imbuf/intern/moviecache.c
@@ -380,7 +380,7 @@ static void do_moviecache_put(MovieCache *cache, void *userkey, ImBuf *ibuf, boo
if (need_lock)
BLI_mutex_unlock(&limitor_lock);
- /* cache limiter can't remove unused keys which points to destoryed values */
+ /* cache limiter can't remove unused keys which points to destroyed values */
check_unused_keys(cache);
if (cache->points) {
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index a52ae75e87b..bad5e0efd65 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1021,7 +1021,7 @@ void IMB_exr_write_channels(void *handle)
}
for (echan = (ExrChannel *)data->channels.first; echan; echan = echan->next) {
- /* Writting starts from last scanline, stride negative. */
+ /* Writing starts from last scanline, stride negative. */
if (echan->use_half_float) {
float *rect = echan->rect;
half *cur = current_rect_half;
@@ -1921,4 +1921,12 @@ void imb_initopenexr(void)
setGlobalThreadCount(num_threads);
}
+void imb_exitopenexr(void)
+{
+ /* Tells OpenEXR to free thread pool, also ensures there is no running
+ * tasks.
+ */
+ setGlobalThreadCount(0);
+}
+
} // export "C"
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.h b/source/blender/imbuf/intern/openexr/openexr_api.h
index 92bbeecfd5d..32d276b31ea 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.h
+++ b/source/blender/imbuf/intern/openexr/openexr_api.h
@@ -40,6 +40,7 @@ extern "C" {
#include <stdio.h>
void imb_initopenexr (void);
+void imb_exitopenexr (void);
int imb_is_a_openexr (const unsigned char *mem);
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index 9d92d146f50..b83097c2eaa 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -367,7 +367,7 @@ static void complete_partial_load(struct ImBuf *ibuf, unsigned int *rect)
memset(rect, 0, size);
}
else {
- /* shouldnt happen */
+ /* shouldn't happen */
printf("decodetarga: incomplete file, all pixels written\n");
}
}
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index ed7bbae6935..9d2b635bd7b 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -99,10 +99,10 @@ static bool get_thumb_dir(char *dir, ThumbSize size)
s += strlen(dir);
#else
#if defined(USE_FREEDESKTOP)
- const char *home_cache = getenv("XDG_CACHE_HOME");
- const char *home = home_cache ? home_cache : getenv("HOME");
+ const char *home_cache = BLI_getenv("XDG_CACHE_HOME");
+ const char *home = home_cache ? home_cache : BLI_getenv("HOME");
#else
- const char *home = getenv("HOME");
+ const char *home = BLI_getenv("HOME");
#endif
if (!home) return 0;
s += BLI_strncpy_rlen(s, home, FILE_MAX);
@@ -362,7 +362,7 @@ static ImBuf *thumb_create_ex(
}
else {
if (ELEM(source, THB_SOURCE_IMAGE, THB_SOURCE_BLEND, THB_SOURCE_FONT)) {
- /* only load if we didnt give an image */
+ /* only load if we didn't give an image */
if (img == NULL) {
switch (source) {
case THB_SOURCE_IMAGE:
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 0d650daa1c9..f72a924806b 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -178,10 +178,10 @@ static tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n)
* \param handle: Handle of the TIFF file (pointer to ImbTIFFMemFile).
* \param ofs: Offset value (interpreted according to whence below).
* \param whence: This can be one of three values:
- * SEEK_SET - The offset is set to ofs bytes.
- * SEEK_CUR - The offset is set to its current location plus ofs bytes.
- * SEEK_END - (This is unsupported and will return -1, indicating an
- * error).
+ * SEEK_SET - The offset is set to ofs bytes.
+ * SEEK_CUR - The offset is set to its current location plus ofs bytes.
+ * SEEK_END - (This is unsupported and will return -1, indicating an
+ * error).
*
* \return: Resulting offset location within the file, measured in bytes from
* the beginning of the file. (-1) indicates an error.
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 0c7341b0fae..e9bc0f41980 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -176,9 +176,9 @@ enum ePreviewImage_Flag {
/* for PreviewImage->tag */
enum {
- PRV_TAG_DEFFERED = (1 << 0), /* Actual loading of preview is deffered. */
- PRV_TAG_DEFFERED_RENDERING = (1 << 1), /* Deffered preview is being loaded. */
- PRV_TAG_DEFFERED_DELETE = (1 << 2), /* Deffered preview should be deleted asap. */
+ PRV_TAG_DEFFERED = (1 << 0), /* Actual loading of preview is deferred. */
+ PRV_TAG_DEFFERED_RENDERING = (1 << 1), /* Deferred preview is being loaded. */
+ PRV_TAG_DEFFERED_DELETE = (1 << 2), /* Deferred preview should be deleted asap. */
};
typedef struct PreviewImage {
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index f1fe370788d..a7c9c934304 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -111,7 +111,7 @@ typedef struct bArmature {
unsigned int layer_used; /* for UI, to show which layers are there */
unsigned int layer, layer_protected; /* for buttons to work, both variables in this order together */
-// XXX deprecated... old animaton system (armature only viz) ---
+// XXX deprecated... old animation system (armature only viz) ---
short ghostep, ghostsize; /* number of frames to ghosts to show, and step between them */
short ghosttype, pathsize; /* ghost drawing options and number of frames between points of path */
int ghostsf, ghostef; /* start and end frames of ghost-drawing range */
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 2ae686d178e..0239c236e5c 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -121,7 +121,7 @@ typedef struct bPythonConstraint {
ListBase targets; /* a list of targets that this constraint has (bConstraintTarget-s) */
struct Object *tar; /* target from previous implementation (version-patch sets this to NULL on file-load) */
- char subtarget[64]; /* subtarger from previous implentation (version-patch sets this to "" on file-load), MAX_ID_NAME-2 */
+ char subtarget[64]; /* subtarger from previous implementation (version-patch sets this to "" on file-load), MAX_ID_NAME-2 */
} bPythonConstraint;
@@ -641,7 +641,7 @@ typedef enum eTrackTo_Flags {
TARGET_Z_UP = (1<<0)
} eTrackTo_Flags;
-/* Strech To Constraint -> volmode */
+/* Stretch To Constraint -> volmode */
typedef enum eStretchTo_VolMode {
VOLUME_XZ = 0,
VOLUME_X = 1,
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 45f2d6c70e4..ed2f4d69392 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -160,7 +160,7 @@ typedef struct bGPDstroke {
struct bGPDstroke *next, *prev;
bGPDspoint *points; /* array of data-points for stroke */
- bGPDtriangle *triangles;/* tesselated triangles for GP Fill */
+ bGPDtriangle *triangles;/* tessellated triangles for GP Fill */
int totpoints; /* number of data-points in array */
int tot_triangles; /* number of triangles in array */
diff --git a/source/blender/makesdna/DNA_mask_types.h b/source/blender/makesdna/DNA_mask_types.h
index b84292d0519..9d4b68b7242 100644
--- a/source/blender/makesdna/DNA_mask_types.h
+++ b/source/blender/makesdna/DNA_mask_types.h
@@ -88,7 +88,7 @@ typedef struct MaskSplinePoint {
typedef struct MaskSpline {
struct MaskSpline *next, *prev;
- short flag; /* defferent spline flag (closed, ...) */
+ short flag; /* different spline flag (closed, ...) */
char offset_mode; /* feather offset method */
char weight_interp; /* weight interpolation */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 00ae9ff8b60..ad5f3768b93 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -870,7 +870,7 @@ typedef struct SimpleDeformModifierData {
float limit[2]; /* lower and upper limit */
char mode; /* deform function */
- char axis; /* lock axis (for taper and strech) */
+ char axis; /* lock axis (for taper and stretch) */
char deform_axis; /* axis to perform the deform on (default is X, but can be overridden by origin */
char flag;
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 5c692cf85da..91dc58ed1d4 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -500,7 +500,7 @@ enum {
};
enum {
- CMP_NODEFLAG_MASK_AA = (1 << 0),
+ /* CMP_NODEFLAG_MASK_AA = (1 << 0), */ /* DEPRECATED */
CMP_NODEFLAG_MASK_NO_FEATHER = (1 << 1),
CMP_NODEFLAG_MASK_MOTION_BLUR = (1 << 2),
diff --git a/source/blender/makesdna/DNA_object_fluidsim_types.h b/source/blender/makesdna/DNA_object_fluidsim_types.h
index 0b0c1c40ef4..9ddae38edf2 100644
--- a/source/blender/makesdna/DNA_object_fluidsim_types.h
+++ b/source/blender/makesdna/DNA_object_fluidsim_types.h
@@ -102,7 +102,7 @@ typedef struct FluidsimSettings {
/* additional flags depending on the type, lower short contains flags
* to check validity, higher short additional flags */
short typeFlags;
- /* switch off velocity genration, volume init type for fluid/obstacles (volume=1, shell=2, both=3) */
+ /* switch off velocity generation, volume init type for fluid/obstacles (volume=1, shell=2, both=3) */
char domainNovecgen, volumeInitType;
/* boundary "stickiness" for part slip values */
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h
index 6b963bb66a1..c90a626784a 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -130,8 +130,8 @@ typedef struct EffectorWeights {
/* Point cache file data types:
* - used as (1<<flag) so poke jahka if you reach the limit of 15
* - to add new data types update:
- * * BKE_ptcache_data_size()
- * * ptcache_file_init_pointers()
+ * - BKE_ptcache_data_size()
+ * - ptcache_file_init_pointers()
*/
#define BPHYS_DATA_INDEX 0
#define BPHYS_DATA_LOCATION 1
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index f1c22a884f1..26a99f49d86 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -106,15 +106,15 @@ typedef struct ParticleData {
int totkey; /* amount of hair or keyed keys*/
- float time, lifetime; /* dietime is not nescessarily time+lifetime as */
- float dietime; /* particles can die unnaturally (collision) */
+ float time, lifetime; /* dietime is not necessarily time+lifetime as */
+ float dietime; /* particles can die unnaturally (collision). */
/* WARNING! Those two indices, when not affected to vertices, are for !!! TESSELLATED FACES !!!, not POLYGONS! */
int num; /* index to vert/edge/face */
int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */
float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
- /* face normal for volume emission */
+ /* face normal for volume emission. */
float size; /* size and multiplier so that we can update size when ever */
@@ -355,7 +355,7 @@ typedef enum eParticleDrawFlag {
} eParticleDrawFlag;
/* part->type */
-/* hair is allways baked static in object/geometry space */
+/* hair is always baked static in object/geometry space */
/* other types (normal particles) are in global space and not static baked */
#define PART_EMITTER 0
//#define PART_REACTOR 1
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
index 19e49644816..dbfd3921b8b 100644
--- a/source/blender/makesdna/DNA_rigidbody_types.h
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -102,7 +102,7 @@ typedef struct RigidBodyOb {
short shape; /* (eRigidBody_Shape) collision shape to use */
int flag; /* (eRigidBodyOb_Flag) */
- int col_groups; /* Collision groups that determines wich rigid bodies can collide with each other */
+ int col_groups; /* Collision groups that determines which rigid bodies can collide with each other */
short mesh_source; /* (eRigidBody_MeshSource) mesh source for mesh based collision shapes */
short pad;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 2a62adae21f..c7bba869ef4 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -118,7 +118,7 @@ typedef enum eFFMpegPreset {
/* Used by WEBM/VP9 and h.264 to control encoding speed vs. file size.
* WEBM/VP9 use these values directly, whereas h.264 map those to
* respectively the MEDIUM, SLOWER, and SUPERFAST presets.
- */
+ */
FFM_PRESET_GOOD = 10, /* the default and recommended for most applications */
FFM_PRESET_BEST, /* recommended if you have lots of time and want the best compression efficiency */
FFM_PRESET_REALTIME, /* recommended for live / fast encoding */
@@ -141,6 +141,14 @@ typedef enum eFFMpegCrf {
FFM_CRF_LOWEST = 32,
} eFFMpegCrf;
+typedef enum eFFMpegAudioChannels {
+ FFM_CHANNELS_MONO = 1,
+ FFM_CHANNELS_STEREO = 2,
+ FFM_CHANNELS_SURROUND4 = 4,
+ FFM_CHANNELS_SURROUND51 = 6,
+ FFM_CHANNELS_SURROUND71 = 8,
+} eFFMpegAudioChannels;
+
typedef struct FFMpegCodecData {
int type;
int codec;
@@ -374,8 +382,8 @@ typedef enum eStereo3dInterlaceType {
* this is used for NodeImageFile and IMAGE_OT_save_as operator too.
*
* note: its a bit strange that even though this is an image format struct
- * the imtype can still be used to select video formats.
- * RNA ensures these enum's are only selectable for render output.
+ * the imtype can still be used to select video formats.
+ * RNA ensures these enum's are only selectable for render output.
*/
typedef struct ImageFormatData {
char imtype; /* R_IMF_IMTYPE_PNG, R_... */
@@ -1321,9 +1329,9 @@ typedef struct UnifiedPaintSettings {
float brush_rotation;
float brush_rotation_sec;
- /*********************************************************************************
- * all data below are used to communicate with cursor drawing and tex sampling *
- *********************************************************************************/
+ /*******************************************************************************
+ * all data below are used to communicate with cursor drawing and tex sampling *
+ *******************************************************************************/
int anchored_size;
float overlap_factor; /* normalization factor due to accumulated value of curve along spacing.
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index ef076c98b5f..6e2fd412445 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -126,7 +126,7 @@ typedef struct Strip {
* each of the strips uses a different sequence structure.
*
* \warning The first part identical to ID (for use in ipo's)
- * the commend above is historic, probably we can drop the ID compatibility,
+ * the comment above is historic, probably we can drop the ID compatibility,
* but take care making this change.
*
* \warning This is really a 'Strip' in the UI!, name is highly confusing.
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index d74d46aebbd..ee7e080f39b 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -113,7 +113,7 @@ enum {
#define SM_HRES_LINEAR 1
#define SM_HRES_FULLSAMPLE 2
-/* smoke data fileds (active_fields) */
+/* smoke data fields (active_fields) */
#define SM_ACTIVE_HEAT (1<<0)
#define SM_ACTIVE_FIRE (1<<1)
#define SM_ACTIVE_COLORS (1<<2)
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 6879c3044a6..e94364e8a65 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -423,7 +423,7 @@ typedef struct SpaceNla {
/* SpaceNla.flag */
typedef enum eSpaceNla_Flag {
- /* flags (1<<0), (1<<1), and (1<<3) are deprecated flags from old verisons */
+ /* flags (1<<0), (1<<1), and (1<<3) are deprecated flags from old versions */
/* draw timing in seconds instead of frames */
SNLA_DRAWTIME = (1 << 2),
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index 42b72c1ff93..bfd9edceab4 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -108,7 +108,7 @@ typedef struct MovieTrackingTrack {
char name[64]; /* MAX_NAME */
- /* ** setings ** */
+ /* ** settings ** */
/* positions of left-bottom and right-top corners of pattern (in unified 0..1 units,
* relative to marker->pos)
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index f78b48b2d25..aea5f0fd87b 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -59,7 +59,7 @@ typedef enum eUIFont_ID {
UIFONT_CUSTOM2 = 3
} eUIFont_ID;
-/* default fonts to load/initalize */
+/* default fonts to load/initialize */
/* first font is the default (index 0), others optional */
typedef struct uiFont {
struct uiFont *next, *prev;
@@ -130,7 +130,7 @@ typedef struct uiWidgetColors {
char text_sel[4];
short shaded;
short shadetop, shadedown;
- short alpha_check;
+ char _pad0[2];
} uiWidgetColors;
typedef struct uiWidgetStateColors {
@@ -168,7 +168,7 @@ typedef struct ThemeUI {
uiWidgetStateColors wcol_state;
- uiPanelColors panel; /* depricated, but we keep it for do_versions (2.66.1) */
+ uiPanelColors panel; /* deprecated, but we keep it for do_versions (2.66.1) */
char widget_emboss[4];
@@ -513,7 +513,7 @@ typedef struct UserDef {
short rvisize; /* rotating view icon size */
short rvibright; /* rotating view icon brightness */
short recent_files; /* maximum number of recently used files to remember */
- short smooth_viewtx; /* miliseconds to spend spinning the view */
+ short smooth_viewtx; /* milliseconds to spend spinning the view */
short glreslimit;
short curssize;
short color_picker_type; /* eColorPicker_Types */
@@ -670,7 +670,7 @@ typedef enum eUserpref_UI_Flag {
USER_PLAINMENUS = (1 << 5),
USER_LOCK_CURSOR_ADJUST = (1 << 6),
/* Avoid accidentally adjusting the layout
- * (exact behavior may change based on whats considered reasonable to lock down). */
+ * (exact behavior may change based on what's considered reasonable to lock down). */
USER_UIFLAG_DEPRECATED_7 = (1 << 7),
USER_ALLWINCODECS = (1 << 8),
USER_MENUOPENAUTO = (1 << 9),
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 7e55eb4633e..c76a447097e 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -174,7 +174,7 @@ enum {
# endif
#endif
-/* the savable part, rest of data is local in ghostwinlay */
+/* the saveable part, rest of data is local in ghostwinlay */
typedef struct wmWindow {
struct wmWindow *next, *prev;
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index d8d29c9c812..077bae741b8 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -102,7 +102,7 @@
*
* ALLOWED AND TESTED CHANGES IN STRUCTS:
* - type change (a char to float will be divided by 255)
- * - location within a struct (everthing can be randomly mixed up)
+ * - location within a struct (everything can be randomly mixed up)
* - struct within struct (within struct etc), this is recursive
* - adding new elements, will be default initialized zero
* - removing elements
@@ -271,7 +271,7 @@ int DNA_struct_find_nr_ex(const SDNA *sdna, const char *str, unsigned int *index
index_p = BLI_ghash_lookup_p(sdna->structs_map, str);
if (index_p) {
- a = GET_INT_FROM_POINTER(*index_p);
+ a = POINTER_AS_INT(*index_p);
*index_last = a;
}
else {
@@ -500,7 +500,7 @@ static bool init_structDNA(
for (intptr_t nr = 0; nr < sdna->nr_structs; nr++) {
sp = sdna->structs[nr];
- BLI_ghash_insert(sdna->structs_map, (void *)sdna->types[sp[0]], SET_INT_IN_POINTER(nr));
+ BLI_ghash_insert(sdna->structs_map, (void *)sdna->types[sp[0]], POINTER_FROM_INT(nr));
}
}
#endif
@@ -901,7 +901,7 @@ static int elem_strcmp(const char *name, const char *oname)
* \param type Current field type name
* \param name Current field name
* \param old Pointer to struct information in sdna
- * \return true when existsing, false otherwise.
+ * \return true when existing, false otherwise.
*/
static bool elem_exists(
const SDNA *sdna,
@@ -1259,7 +1259,7 @@ void DNA_struct_switch_endian(const SDNA *oldsdna, int oldSDNAnr, char *data)
else if (ELEM(spc[0], SDNA_TYPE_INT, SDNA_TYPE_FLOAT)) {
/* note, intentionally ignore long/ulong here these could be 4 or 8 bits,
* but turns out we only used for runtime vars and
- * only once for a struct type thats no longer used. */
+ * only once for a struct type that's no longer used. */
BLI_endian_switch_int32_array((int32_t *)cur, DNA_elem_array_size(name));
}
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 3b8d0e01ace..bf94c07baa1 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -984,7 +984,7 @@ static int make_structDNA(const char *baseDirectory, FILE *file, FILE *file_offs
printf("Running makesdna at debug level %d\n", debugSDNA);
}
- /* the longest known struct is 50k, so we assume 100k is sufficent! */
+ /* the longest known struct is 50k, so we assume 100k is sufficient! */
namedata = MEM_callocN(maxdata, "namedata");
typedata = MEM_callocN(maxdata, "typedata");
structdata = MEM_callocN(maxdata, "structdata");
@@ -1258,7 +1258,7 @@ int main(int argc, char **argv)
return(return_status);
}
-/* handy but fails on struct bounds which makesdna doesnt care about
+/* handy but fails on struct bounds which makesdna doesn't care about
* with quite the same strictness as GCC does */
#if 0
/* include files for automatic dependencies */
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index ee8c1977344..97266028f06 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -25,7 +25,9 @@
/** \file RNA_define.h
* \ingroup RNA
- * Functions used during preprocess and runtime, for defining the RNA. */
+ *
+ * Functions used during preprocess and runtime, for defining the RNA.
+ */
#include <float.h>
#include <limits.h>
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 05a166f4664..0d972a118e8 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -400,7 +400,7 @@ typedef struct ParameterDynAlloc {
typedef enum FunctionFlag {
/***** Options affecting callback signature. *****/
- /* Those add additionnal parameters at the beginning of the C callback, like that:
+ /* Those add additional parameters at the beginning of the C callback, like that:
* rna_my_func([ID *_selfid],
* [<DNA_STRUCT> *self|StructRNA *type],
* [Main *bmain],
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 6335869ca43..bebf232b3b9 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -376,7 +376,7 @@ static struct ID *rna_ID_make_local(struct ID *self, Main *bmain, bool clear_pro
}
-static AnimData * rna_ID_animation_data_create(ID *id, Main *bmain)
+static AnimData *rna_ID_animation_data_create(ID *id, Main *bmain)
{
AnimData *adt = BKE_animdata_add_id(id);
DAG_relations_tag_update(bmain);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index d805d6138a7..51293340a6c 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -6872,7 +6872,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt
case PROP_COLLECTION:
{
StructRNA *srna = va_arg(args, StructRNA *);
- ListBase **arg = va_arg(args, ListBase * *);
+ ListBase **arg = va_arg(args, ListBase **);
err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata,
srna, tid, fid, pid);
break;
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 7af3746b855..6c728ac50e5 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -886,7 +886,7 @@ static void rna_def_edit_bone(BlenderRNA *brna)
/* calculated and read only, not actual data access */
prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
- /*RNA_def_property_float_sdna(prop, NULL, ""); *//* doesnt access any real data */
+ /*RNA_def_property_float_sdna(prop, NULL, ""); *//* doesn't access any real data */
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);
//RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index bb204bf8c81..1afa462dba8 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1461,16 +1461,16 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Image Painting Capabilities", "Brush's capabilities in image paint mode");
}
-
-/* A brush stroke is a list of changes to the brush that
+/**
+ * A brush stroke is a list of changes to the brush that
* can occur during a stroke
*
- * o 3D location of the brush
- * o 2D mouse location
- * o Tablet pressure
- * o Direction flip
- * o Tool switch
- * o Time
+ * - 3D location of the brush
+ * - 2D mouse location
+ * - Tablet pressure
+ * - Direction flip
+ * - Tool switch
+ * - Time
*/
static void rna_def_operator_stroke_element(BlenderRNA *brna)
{
diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c
index d16ef3db296..c82c95e5a4b 100644
--- a/source/blender/makesrna/intern/rna_dynamicpaint.c
+++ b/source/blender/makesrna/intern/rna_dynamicpaint.c
@@ -127,7 +127,7 @@ static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, Poi
DynamicPaintSurface *surface = act_surface->canvas->surfaces.first;
/* since only one color surface can show preview at time
- * disable preview on other surfaces*/
+ * disable preview on other surfaces. */
for (; surface; surface = surface->next) {
if (surface != act_surface)
surface->flags &= ~MOD_DPAINT_PREVIEW;
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 90af65497a4..625ef7db2dc 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -263,7 +263,7 @@ static const EnumPropertyItem *rna_Object_parent_type_itemf(
Object *par = gpl->parent;
if (par->type == OB_ARMATURE) {
- /* special hack: prevents this being overrided */
+ /* special hack: prevents this being overridden */
RNA_enum_items_add_value(&item, &totitem, &parent_type_items[1], PARSKEL);
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARBONE);
}
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index b6ba06a84d5..dc625ca8d9a 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -147,7 +147,7 @@ static void rna_Image_save(Image *image, Main *bmain, bContext *C, ReportList *r
BKE_reportf(reports, RPT_ERROR, "Image '%s' does not have any image data", image->id.name + 2);
}
- BKE_image_release_ibuf(image, ibuf, &lock);
+ BKE_image_release_ibuf(image, ibuf, lock);
WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image);
}
@@ -243,7 +243,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int frame, int f
if (ibuf == NULL || ibuf->rect == NULL) {
BKE_reportf(reports, RPT_ERROR, "Image '%s' does not have any image data", image->id.name + 2);
- BKE_image_release_ibuf(image, ibuf, NULL);
+ BKE_image_release_ibuf(image, ibuf, lock);
return (int)GL_INVALID_OPERATION;
}
@@ -260,7 +260,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int frame, int f
image->bindcode[TEXTARGET_TEXTURE_2D] = 0;
}
- BKE_image_release_ibuf(image, ibuf, NULL);
+ BKE_image_release_ibuf(image, ibuf, lock);
return error;
}
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c
index bbc0c251897..782ca0d76b3 100644
--- a/source/blender/makesrna/intern/rna_lattice.c
+++ b/source/blender/makesrna/intern/rna_lattice.c
@@ -103,7 +103,7 @@ static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), P
/* copy settings to editlattice,
* we could split this up differently (one update call per property)
- * but for now thats overkill
+ * but for now that's overkill
*/
static void rna_Lattice_update_data_editlatt(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index bcd8ab054ae..b50102079a9 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -591,7 +591,7 @@ static void rna_def_modifier_type_common(
{LS_VALUE_MULT, "MULTIPLY", 0, "Multiply", ""},
{LS_VALUE_DIV, "DIVIDE", 0, "Divide", ""},
{LS_VALUE_DIFF, "DIFFERENCE", 0, "Difference", ""},
- {LS_VALUE_MIN, "MININUM", 0, "Minimum", ""},
+ {LS_VALUE_MIN, "MINIMUM", 0, "Minimum", ""},
{LS_VALUE_MAX, "MAXIMUM", 0, "Maximum", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 7d619254e07..f2249eb397d 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -1864,7 +1864,8 @@ void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
/* new func */
func = RNA_def_function(srna, "new", "rna_Main_mask_new");
RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
- RNA_def_string_file_path(func, "name", NULL, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
+ parm = RNA_def_string(func, "name", NULL, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
/* return type */
parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
RNA_def_function_return(func, parm);
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 4947557af10..5bd12d727ed 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -435,6 +435,34 @@ void rna_mtex_texture_slots_clear(ID *self_id, struct bContext *C, ReportList *r
WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C));
}
+static void rna_TexPaintSlot_uv_layer_get(PointerRNA *ptr, char *value)
+{
+ TexPaintSlot *data = (TexPaintSlot *)(ptr->data);
+
+ if (data->uvname != NULL) {
+ BLI_strncpy_utf8(value, data->uvname, 64);
+ }
+ else {
+ value[0] = '\0';
+ }
+}
+
+static int rna_TexPaintSlot_uv_layer_length(PointerRNA *ptr)
+{
+ TexPaintSlot *data = (TexPaintSlot *)(ptr->data);
+ return data->uvname == NULL ? 0 : strlen(data->uvname);
+}
+
+static void rna_TexPaintSlot_uv_layer_set(PointerRNA *ptr, const char *value)
+{
+ TexPaintSlot *data = (TexPaintSlot *)(ptr->data);
+
+ if (data->uvname != NULL) {
+ BLI_strncpy_utf8(data->uvname, value, 64);
+ }
+}
+
+
#else
static void rna_def_material_mtex(BlenderRNA *brna)
@@ -2216,6 +2244,8 @@ static void rna_def_tex_slot(BlenderRNA *brna)
prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE);
RNA_def_property_string_maxlength(prop, 64); /* else it uses the pointer size! */
RNA_def_property_string_sdna(prop, NULL, "uvname");
+ RNA_def_property_string_funcs(prop, "rna_TexPaintSlot_uv_layer_get", "rna_TexPaintSlot_uv_layer_length",
+ "rna_TexPaintSlot_uv_layer_set");
RNA_def_property_ui_text(prop, "UV Map", "Name of UV map");
RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_Material_update");
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 847de75c604..68f0272c035 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -6327,11 +6327,6 @@ static void def_cmp_mask(StructRNA *srna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Mask", "");
- prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_NODEFLAG_MASK_AA);
- RNA_def_property_ui_text(prop, "Anti-Alias", "Apply an anti-aliasing filter to the mask");
- RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
-
prop = RNA_def_property(srna, "use_feather", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "custom1", CMP_NODEFLAG_MASK_NO_FEATHER);
RNA_def_property_ui_text(prop, "Feather", "Use feather information from the mask");
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 1d62f438047..4094552d9bc 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -472,7 +472,7 @@ static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C),
RNA_enum_items_add_value(&item, &totitem, &parent_type_items[2], PARSKEL);
}
else if (par->type == OB_ARMATURE) {
- /* special hack: prevents this being overrided */
+ /* special hack: prevents this being overridden */
RNA_enum_items_add_value(&item, &totitem, &parent_type_items[1], PARSKEL);
RNA_enum_items_add_value(&item, &totitem, parent_type_items, PARBONE);
}
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 376a89c65d1..6218de2469d 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -49,7 +49,7 @@
static const EnumPropertyItem space_items[] = {
{CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space",
- "The most gobal space in Blender"},
+ "The most global space in Blender"},
{CONSTRAINT_SPACE_POSE, "POSE", 0, "Pose Space",
"The pose space of a bone (its armature's object space)"},
{CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent",
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 7da859c000c..c5d66581ca3 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -916,7 +916,7 @@ static void rna_def_pointcache_active(BlenderRNA *brna)
/* This first-level RNA pointer also has list of all caches from owning ID.
* Those caches items have exact same content as 'active' one, except for that collection,
* to prevent ugly recursive layout pattern.
- * Note: This shall probably be redone from scratch in a proper way at some poitn, but for now that will do,
+ * Note: This shall probably be redone from scratch in a proper way at some point, but for now that will do,
* and shall not break anything in the API. */
prop = RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next",
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index a2286f0b92a..05fd0ee740e 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -1528,7 +1528,7 @@ static void rna_def_particle(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Keyed States", "");
/* */
/* float fuv[4], foffset; *//* coordinates on face/edge number "num" and depth along*/
-/* *//* face normal for volume emission */
+/* *//* face normal for volume emission */
prop = RNA_def_property(srna, "birth_time", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 7eb48272c56..b8a9e9f92cd 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -121,6 +121,7 @@ const EnumPropertyItem rna_enum_property_unit_items[] = {
{PROP_UNIT_TIME, "TIME", 0, "Time", ""},
{PROP_UNIT_VELOCITY, "VELOCITY", 0, "Velocity", ""},
{PROP_UNIT_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""},
+ {PROP_UNIT_MASS, "MASS", 0, "Mass", ""},
{PROP_UNIT_CAMERA, "CAMERA", 0, "Camera", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 3c8cc9ee2be..d6c45fd69d0 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5498,11 +5498,11 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
#endif
static const EnumPropertyItem audio_channel_items[] = {
- {1, "MONO", 0, "Mono", "Set audio channels to mono"},
- {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
- {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
- {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
- {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
+ {FFM_CHANNELS_MONO, "MONO", 0, "Mono", "Set audio channels to mono"},
+ {FFM_CHANNELS_STEREO, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
+ {FFM_CHANNELS_SURROUND4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
+ {FFM_CHANNELS_SURROUND51, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
+ {FFM_CHANNELS_SURROUND71, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 7ca26ab1c9f..0a997ca2163 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -209,11 +209,21 @@ static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area");
}
+static void rna_def_area_api(StructRNA *srna)
+{
+ FunctionRNA *func;
+
+ RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
+
+ func = RNA_def_function(srna, "header_text_set", "ED_area_headerprint");
+ RNA_def_function_ui_description(func, "Set the header text");
+ RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
+}
+
static void rna_def_area(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- FunctionRNA *func;
srna = RNA_def_struct(brna, "Area", NULL);
RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor");
@@ -267,11 +277,7 @@ static void rna_def_area(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Area height");
- RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
-
- func = RNA_def_function(srna, "header_text_set", "ED_area_headerprint");
- RNA_def_function_ui_description(func, "Set the header text");
- RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text");
+ rna_def_area_api(srna);
}
static void rna_def_view2d_api(StructRNA *srna)
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index dc13ef3d163..3015d56e1ee 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -253,7 +253,7 @@ static void rna_KeyMap_item_remove(wmKeyMap *km, ReportList *reports, PointerRNA
static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid, bool modal)
{
if (modal == 0) {
- return WM_keymap_find(keyconf, idname, spaceid, regionid);
+ return WM_keymap_ensure(keyconf, idname, spaceid, regionid);
}
else {
return WM_modalkeymap_add(keyconf, idname, NULL); /* items will be lazy init */
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index a69af265a17..d7f6c263906 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -551,7 +551,7 @@ static DerivedMesh *arrayModifier_doArray(
DM_copy_loop_data(dm, result, 0, 0, chunk_nloops);
DM_copy_poly_data(dm, result, 0, 0, chunk_npolys);
- /* Subsurf for eg wont have mesh data in the custom data arrays.
+ /* Subsurf for eg won't have mesh data in the custom data arrays.
* now add mvert/medge/mpoly layers. */
if (!CustomData_has_layer(&dm->vertData, CD_MVERT)) {
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c
index e877d5649d4..34b432fe805 100644
--- a/source/blender/modifiers/intern/MOD_build.c
+++ b/source/blender/modifiers/intern/MOD_build.c
@@ -138,7 +138,7 @@ static DerivedMesh *applyModifier(
for (j = 0; j < mp->totloop; j++, ml++) {
void **val_p;
- if (!BLI_ghash_ensure_p(vertHash, SET_INT_IN_POINTER(ml->v), &val_p)) {
+ if (!BLI_ghash_ensure_p(vertHash, POINTER_FROM_INT(ml->v), &val_p)) {
*val_p = (void *)hash_num;
hash_num++;
}
@@ -157,8 +157,8 @@ static DerivedMesh *applyModifier(
for (i = 0; i < numEdge_src; i++, hash_num_alt++) {
MEdge *me = medge + i;
- if (BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v1)) &&
- BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v2)))
+ if (BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v1)) &&
+ BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v2)))
{
BLI_ghash_insert(edgeHash, (void *)hash_num, (void *)hash_num_alt);
BLI_ghash_insert(edgeHash2, (void *)hash_num_alt, (void *)hash_num);
@@ -184,11 +184,11 @@ static DerivedMesh *applyModifier(
void **val_p;
me = medge + edgeMap[i];
- if (!BLI_ghash_ensure_p(vertHash, SET_INT_IN_POINTER(me->v1), &val_p)) {
+ if (!BLI_ghash_ensure_p(vertHash, POINTER_FROM_INT(me->v1), &val_p)) {
*val_p = (void *)hash_num;
hash_num++;
}
- if (!BLI_ghash_ensure_p(vertHash, SET_INT_IN_POINTER(me->v2), &val_p)) {
+ if (!BLI_ghash_ensure_p(vertHash, POINTER_FROM_INT(me->v2), &val_p)) {
*val_p = (void *)hash_num;
hash_num++;
}
@@ -199,10 +199,10 @@ static DerivedMesh *applyModifier(
for (i = 0; i < numEdges_dst; i++) {
j = BLI_ghash_len(edgeHash);
- BLI_ghash_insert(edgeHash, SET_INT_IN_POINTER(j),
- SET_INT_IN_POINTER(edgeMap[i]));
- BLI_ghash_insert(edgeHash2, SET_INT_IN_POINTER(edgeMap[i]),
- SET_INT_IN_POINTER(j));
+ BLI_ghash_insert(edgeHash, POINTER_FROM_INT(j),
+ POINTER_FROM_INT(edgeMap[i]));
+ BLI_ghash_insert(edgeHash2, POINTER_FROM_INT(edgeMap[i]),
+ POINTER_FROM_INT(j));
}
}
else {
@@ -217,7 +217,7 @@ static DerivedMesh *applyModifier(
* mapped to the new indices
*/
for (i = 0; i < numVerts; i++) {
- BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(vertMap[i]), SET_INT_IN_POINTER(i));
+ BLI_ghash_insert(vertHash, POINTER_FROM_INT(vertMap[i]), POINTER_FROM_INT(i));
}
}
@@ -231,8 +231,8 @@ static DerivedMesh *applyModifier(
GHASH_ITER (gh_iter, vertHash) {
MVert source;
MVert *dest;
- int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter));
- int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter));
+ int oldIndex = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
+ int newIndex = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter));
source = mvert_src[oldIndex];
dest = CDDM_get_vert(result, newIndex);
@@ -245,13 +245,13 @@ static DerivedMesh *applyModifier(
for (i = 0; i < BLI_ghash_len(edgeHash); i++) {
MEdge source;
MEdge *dest;
- int oldIndex = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_INT_IN_POINTER(i)));
+ int oldIndex = POINTER_AS_INT(BLI_ghash_lookup(edgeHash, POINTER_FROM_INT(i)));
source = medge_src[oldIndex];
dest = CDDM_get_edge(result, i);
- source.v1 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v1)));
- source.v2 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v2)));
+ source.v1 = POINTER_AS_INT(BLI_ghash_lookup(vertHash, POINTER_FROM_INT(source.v1)));
+ source.v2 = POINTER_AS_INT(BLI_ghash_lookup(vertHash, POINTER_FROM_INT(source.v2)));
DM_copy_edge_data(dm, result, oldIndex, i, 1);
*dest = source;
@@ -277,8 +277,8 @@ static DerivedMesh *applyModifier(
ml_src = mloop_src + source->loopstart;
for (j = 0; j < source->totloop; j++, k++, ml_src++, ml_dst++) {
- ml_dst->v = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(ml_src->v)));
- ml_dst->e = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash2, SET_INT_IN_POINTER(ml_src->e)));
+ ml_dst->v = POINTER_AS_INT(BLI_ghash_lookup(vertHash, POINTER_FROM_INT(ml_src->v)));
+ ml_dst->e = POINTER_AS_INT(BLI_ghash_lookup(edgeHash2, POINTER_FROM_INT(ml_src->e)));
}
}
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c
index a7f09aec481..2fc30f9fddd 100644
--- a/source/blender/modifiers/intern/MOD_explode.c
+++ b/source/blender/modifiers/intern/MOD_explode.c
@@ -189,7 +189,7 @@ static void createFacepa(
static int edgecut_get(EdgeHash *edgehash, unsigned int v1, unsigned int v2)
{
- return GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, v1, v2));
+ return POINTER_AS_INT(BLI_edgehash_lookup(edgehash, v1, v2));
}
@@ -626,7 +626,7 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
ehi = BLI_edgehashIterator_new(edgehash);
totesplit = totvert;
for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
- BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totesplit));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(totesplit));
totesplit++;
}
BLI_edgehashIterator_free(ehi);
@@ -665,7 +665,7 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm)
ehi = BLI_edgehashIterator_new(edgehash);
for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
BLI_edgehashIterator_getKey(ehi, &ed_v1, &ed_v2);
- esplit = GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
+ esplit = POINTER_AS_INT(BLI_edgehashIterator_getValue(ehi));
mv = CDDM_get_vert(splitdm, ed_v2);
dupve = CDDM_get_vert(splitdm, esplit);
@@ -859,7 +859,7 @@ static DerivedMesh *explodeMesh(
/* make new vertice indexes & count total vertices after duplication */
ehi = BLI_edgehashIterator_new(vertpahash);
for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
- BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totdup));
+ BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(totdup));
totdup++;
}
BLI_edgehashIterator_free(ehi);
@@ -883,7 +883,7 @@ static DerivedMesh *explodeMesh(
/* get particle + vertex from hash */
BLI_edgehashIterator_getKey(ehi, &ed_v1, &ed_v2);
ed_v2 -= totvert;
- v = GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
+ v = POINTER_AS_INT(BLI_edgehashIterator_getValue(ehi));
dm->getVert(dm, ed_v1, &source);
dest = CDDM_get_vert(explode, v);
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c
index e366116a5fb..8dd4e289503 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.c
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c
@@ -481,8 +481,8 @@ static DerivedMesh *fluidsim_read_cache(
const char *strEnvName2 = "BLENDER_ELBEEMBOBJABORT"; // from blendercall.cpp
if (G.background == 1) {
- if (getenv(strEnvName2)) {
- int elevel = atoi(getenv(strEnvName2));
+ if (BLI_getenv(strEnvName2)) {
+ int elevel = atoi(BLI_getenv(strEnvName2));
if (elevel > 0) {
printf("Env. var %s set, fluid sim mesh '%s' not found, aborting render...\n",
strEnvName2, targetFile);
diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c
index 81cfa980135..6f963b7f1a4 100644
--- a/source/blender/modifiers/intern/MOD_laplaciandeform.c
+++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c
@@ -67,7 +67,7 @@ typedef struct LaplacianSystem {
float (*co)[3]; /* Original vertex coordinates */
float (*no)[3]; /* Original vertex normal */
float (*delta)[3]; /* Differential Coordinates */
- unsigned int (*tris)[3]; /* Copy of MLoopTri (tesselation triangle) v1-v3 */
+ unsigned int (*tris)[3]; /* Copy of MLoopTri (tessellation triangle) v1-v3 */
int *index_anchors; /* Static vertex index list */
int *unit_verts; /* Unit vectors of projected edges onto the plane orthogonal to n */
int *ringf_indices; /* Indices of faces per vertex */
@@ -209,7 +209,7 @@ static void createVertRingMap(
/**
* This method computes the Laplacian Matrix and Differential Coordinates for all vertex in the mesh.
* The Linear system is LV = d
- * Where L is Laplacian Matrix, V as the vertexes in Mesh, d is the differential coordinates
+ * Where L is Laplacian Matrix, V as the vertices in Mesh, d is the differential coordinates
* The Laplacian Matrix is computes as a
* Lij = sum(Wij) (if i == j)
* Lij = Wij (if i != j)
@@ -219,7 +219,7 @@ static void createVertRingMap(
* di = Vi * sum(Wij) - sum(Wij * Vj)
* Where :
* di is the Differential Coordinate i
- * sum (Wij) is the sum of all weights between vertex Vi and its vertexes neighbors (Vj)
+ * sum (Wij) is the sum of all weights between vertex Vi and its vertices neighbors (Vj)
* sum (Wij * Vj) is the sum of the product between vertex neighbor Vj and weight Wij for all neighborhood.
*
* This Laplacian Matrix is described in the paper:
diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
index 49b9c4af29c..7d26e76832d 100644
--- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c
+++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c
@@ -60,8 +60,8 @@ struct BLaplacianSystem {
int numLoops; /* Number of edges*/
int numPolys; /* Number of faces*/
int numVerts; /* Number of verts*/
- short *numNeFa; /* Number of neighboors faces around vertice*/
- short *numNeEd; /* Number of neighboors Edges around vertice*/
+ short *numNeFa; /* Number of neighbors faces around vertice*/
+ short *numNeEd; /* Number of neighbors Edges around vertice*/
short *zerola; /* Is zero area or length*/
/* Pointers to data*/
@@ -268,7 +268,7 @@ static void init_laplacian_matrix(LaplacianSystem *sys)
for (i = 0; i < sys->numEdges; i++) {
idv1 = sys->medges[i].v1;
idv2 = sys->medges[i].v2;
- /* if is boundary, apply scale-dependent umbrella operator only with neighboors in boundary */
+ /* if is boundary, apply scale-dependent umbrella operator only with neighbors in boundary */
if (sys->numNeEd[idv1] != sys->numNeFa[idv1] && sys->numNeEd[idv2] != sys->numNeFa[idv2]) {
sys->vlengths[idv1] += sys->eweights[i];
sys->vlengths[idv2] += sys->eweights[i];
diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c
index 25db2d5ff0b..93332fb0455 100644
--- a/source/blender/modifiers/intern/MOD_mask.c
+++ b/source/blender/modifiers/intern/MOD_mask.c
@@ -209,7 +209,7 @@ static DerivedMesh *applyModifier(
}
/* add to ghash for verts (numVerts acts as counter for mapping) */
- BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numVerts));
+ BLI_ghash_insert(vertHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numVerts));
numVerts++;
}
@@ -234,7 +234,7 @@ static DerivedMesh *applyModifier(
}
/* add to ghash for verts (numVerts acts as counter for mapping) */
- BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numVerts));
+ BLI_ghash_insert(vertHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numVerts));
numVerts++;
}
}
@@ -258,10 +258,10 @@ static DerivedMesh *applyModifier(
const MEdge *me = &medge_src[i];
/* only add if both verts will be in new mesh */
- if (BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v1)) &&
- BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v2)))
+ if (BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v1)) &&
+ BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v2)))
{
- BLI_ghash_insert(edgeHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numEdges));
+ BLI_ghash_insert(edgeHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numEdges));
numEdges++;
}
}
@@ -272,7 +272,7 @@ static DerivedMesh *applyModifier(
int j;
for (j = 0; j < mp_src->totloop; j++, ml_src++) {
- if (!BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(ml_src->v))) {
+ if (!BLI_ghash_haskey(vertHash, POINTER_FROM_INT(ml_src->v))) {
ok = false;
break;
}
@@ -280,7 +280,7 @@ static DerivedMesh *applyModifier(
/* all verts must be available */
if (ok) {
- BLI_ghash_insert(polyHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numPolys));
+ BLI_ghash_insert(polyHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numPolys));
loop_mapping[numPolys] = numLoops;
numPolys++;
numLoops += mp_src->totloop;
@@ -303,8 +303,8 @@ static DerivedMesh *applyModifier(
GHASH_ITER (gh_iter, vertHash) {
const MVert *v_src;
MVert *v_dst;
- const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter));
- const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter));
+ const int i_src = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
+ const int i_dst = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter));
v_src = &mvert_src[i_src];
v_dst = &mvert_dst[i_dst];
@@ -317,22 +317,22 @@ static DerivedMesh *applyModifier(
GHASH_ITER (gh_iter, edgeHash) {
const MEdge *e_src;
MEdge *e_dst;
- const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter));
- const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter));
+ const int i_src = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
+ const int i_dst = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter));
e_src = &medge_src[i_src];
e_dst = &medge_dst[i_dst];
DM_copy_edge_data(dm, result, i_src, i_dst, 1);
*e_dst = *e_src;
- e_dst->v1 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v1)));
- e_dst->v2 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v2)));
+ e_dst->v1 = POINTER_AS_UINT(BLI_ghash_lookup(vertHash, POINTER_FROM_UINT(e_src->v1)));
+ e_dst->v2 = POINTER_AS_UINT(BLI_ghash_lookup(vertHash, POINTER_FROM_UINT(e_src->v2)));
}
/* faces */
GHASH_ITER (gh_iter, polyHash) {
- const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter));
- const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter));
+ const int i_src = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
+ const int i_dst = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter));
const MPoly *mp_src = &mpoly_src[i_src];
MPoly *mp_dst = &mpoly_dst[i_dst];
const int i_ml_src = mp_src->loopstart;
@@ -346,8 +346,8 @@ static DerivedMesh *applyModifier(
*mp_dst = *mp_src;
mp_dst->loopstart = i_ml_dst;
for (i = 0; i < mp_src->totloop; i++) {
- ml_dst[i].v = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(ml_src[i].v)));
- ml_dst[i].e = GET_UINT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_UINT_IN_POINTER(ml_src[i].e)));
+ ml_dst[i].v = POINTER_AS_UINT(BLI_ghash_lookup(vertHash, POINTER_FROM_UINT(ml_src[i].v)));
+ ml_dst[i].e = POINTER_AS_UINT(BLI_ghash_lookup(edgeHash, POINTER_FROM_UINT(ml_src[i].e)));
}
}
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c
index 8e04ff04648..4b7b4f63dde 100644
--- a/source/blender/modifiers/intern/MOD_meshsequencecache.c
+++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c
@@ -155,8 +155,13 @@ static DerivedMesh *applyModifier(
static bool dependsOnTime(ModifierData *md)
{
+#ifdef WITH_ALEMBIC
+ MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *) md;
+ return (mcmd->cache_file != NULL);
+#else
UNUSED_VARS(md);
- return true;
+ return false;
+#endif
}
static void foreachIDLink(
diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c
index 3f6480562d9..aeb28b3ecb0 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -144,7 +144,7 @@ static DerivedMesh *doMirrorOnAxis(
DM_copy_poly_data(dm, result, 0, 0, maxPolys);
- /* Subsurf for eg wont have mesh data in the custom data arrays.
+ /* Subsurf for eg won't have mesh data in the custom data arrays.
* now add mvert/medge/mpoly layers. */
if (!CustomData_has_layer(&dm->vertData, CD_MVERT)) {
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index 5c1296d222e..18a551f6daa 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -57,7 +57,7 @@
/* used for gathering edge connectivity */
typedef struct ScrewVertConnect {
float dist; /* distance from the center axis */
- float co[3]; /* loaction relative to the transformed axis */
+ float co[3]; /* location relative to the transformed axis */
float no[3]; /* calc normal of the vertex */
unsigned int v[2]; /* 2 verts on either side of this one */
MEdge *e[2]; /* edges on either side, a bit of a waste since each edge ref's 2 edges */
@@ -297,7 +297,7 @@ static DerivedMesh *applyModifier(
/* angle */
-#if 0 /* cant incluide this, not predictable enough, though quite fun. */
+#if 0 /* can't include this, not predictable enough, though quite fun. */
if (ltmd->flag & MOD_SCREW_OBJECT_ANGLE) {
float mtx3_tx[3][3];
copy_m3_m4(mtx3_tx, mtx_tx);
@@ -673,7 +673,7 @@ static DerivedMesh *applyModifier(
if (tmpf1[ltmd->axis] < vc_tmp->co[ltmd->axis]) { /* best is above */
ed_loop_flip = 1;
}
- else { /* best is below or even... in even case we cant know whet to do. */
+ else { /* best is below or even... in even case we can't know what to do. */
ed_loop_flip = 0;
}
@@ -809,7 +809,7 @@ static DerivedMesh *applyModifier(
copy_v3_v3(vc->no, vc->co);
}
- /* we wont be looping on this data again so copy normals here */
+ /* we won't be looping on this data again so copy normals here */
if ((angle < 0.0f) != do_flip)
negate_v3(vc->no);
@@ -897,7 +897,7 @@ static DerivedMesh *applyModifier(
}
if (close) {
- /* last loop of edges, previous loop dosnt account for the last set of edges */
+ /* last loop of edges, previous loop doesn't account for the last set of edges */
const unsigned int varray_stride = (step_tot - 1) * totvert;
for (i = 0; i < totvert; i++) {
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c
index b3982bc5f3e..d14310d9199 100644
--- a/source/blender/modifiers/intern/MOD_simpledeform.c
+++ b/source/blender/modifiers/intern/MOD_simpledeform.c
@@ -50,7 +50,7 @@
#define BEND_EPS 0.000001f
-/* Re-maps the indicies for X Y Z by shifting them up and wrapping, such that
+/* Re-maps the indices for X Y Z by shifting them up and wrapping, such that
* X = Y, Y = Z, Z = X (for X axis), and X = Z, Y = X, Z = Y (for Y axis). This
* exists because the deformations (excluding bend) are based on the Z axis.
* Having this helps avoid long, drawn out switches. */
@@ -199,7 +199,7 @@ static void SimpleDeformModifier_do(
/* This is historically the lock axis, _not_ the deform axis as the name would imply */
const int deform_axis = smd->deform_axis;
int lock_axis = smd->axis;
- if (smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) { /* Bend mode shouln't have any lock axis */
+ if (smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) { /* Bend mode shouldn't have any lock axis */
lock_axis = 0;
}
else {
@@ -263,7 +263,7 @@ static void SimpleDeformModifier_do(
}
- /* SMD values are normalized to the BV, calculate the absolut values */
+ /* SMD values are normalized to the BV, calculate the absolute values */
smd_limit[1] = lower + (upper - lower) * smd->limit[1];
smd_limit[0] = lower + (upper - lower) * smd->limit[0];
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 572898c1982..8cf288e19ae 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -813,7 +813,7 @@ static DerivedMesh *applyModifier(
mp->flag = mpoly[fidx].flag;
/* notice we use 'mp->totloop' which is later overwritten,
- * we could lookup the original face but theres no point since this is a copy
+ * we could lookup the original face but there's no point since this is a copy
* and will have the same value, just take care when changing order of assignment */
k1 = mpoly[fidx].loopstart + (((edge_order[eidx] - 1) + mp->totloop) % mp->totloop); /* prev loop */
k2 = mpoly[fidx].loopstart + (edge_order[eidx]);
diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c
index 95347128ef9..84e2bf8941d 100644
--- a/source/blender/modifiers/intern/MOD_surfacedeform.c
+++ b/source/blender/modifiers/intern/MOD_surfacedeform.c
@@ -1035,7 +1035,7 @@ static bool surfacedeformBind(
}
else if (data.success == MOD_SDEF_BIND_RESULT_GENERIC_ERR) {
/* I know this message is vague, but I could not think of a way
- * to explain this whith a reasonably sized message.
+ * to explain this with a reasonably sized message.
* Though it shouldn't really matter all that much,
* because this is very unlikely to occur */
modifier_setError((ModifierData *)smd, "Target contains invalid polygons");
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index 47db0a3371f..b98036b9913 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -81,7 +81,7 @@ typedef struct Vert2GeomData {
float *dist[3];
} Vert2GeomData;
-/* Data which is localized to each computed chunk (i.e. thread-safe, and with continous subset of index range). */
+/* Data which is localized to each computed chunk (i.e. thread-safe, and with continuous subset of index range). */
typedef struct Vert2GeomDataChunk {
/* Read-only data */
float last_hit_co[3][3];
diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c
index 52e58a0ebd3..eb48d332f19 100644
--- a/source/blender/nodes/composite/nodes/node_composite_image.c
+++ b/source/blender/nodes/composite/nodes/node_composite_image.c
@@ -295,6 +295,8 @@ static void cmp_node_image_update(bNodeTree *ntree, bNode *node)
/* avoid unnecessary updates, only changes to the image/image user data are of interest */
if (node->update & NODE_UPDATE_ID)
cmp_node_image_verify_outputs(ntree, node, false);
+
+ cmp_node_update_default(ntree, node);
}
static void node_composit_init_image(bNodeTree *ntree, bNode *node)
@@ -427,6 +429,8 @@ static void node_composit_copy_rlayers(bNodeTree *UNUSED(dest_ntree), bNode *UNU
static void cmp_node_rlayers_update(bNodeTree *ntree, bNode *node)
{
cmp_node_image_verify_outputs(ntree, node, true);
+
+ cmp_node_update_default(ntree, node);
}
void register_node_type_cmp_rlayers(void)
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index 3103057cbcf..90b230a280d 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -143,7 +143,7 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns)
memset(gs, 0, sizeof(*gs));
if (ns == NULL) {
- /* node_get_stack() will generate NULL bNodeStack pointers for unknown/unsuported types of sockets... */
+ /* node_get_stack() will generate NULL bNodeStack pointers for unknown/unsupported types of sockets... */
zero_v4(gs->vec);
gs->link = NULL;
gs->type = GPU_NONE;
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index 750073dae1f..451959766cb 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -553,7 +553,7 @@ BLI_INLINE void cloth_get_grid_location(Implicit_Data *data, float cell_scale, c
add_v3_v3(x, cell_offset);
}
-/* returns next spring forming a continous hair sequence */
+/* returns next spring forming a continuous hair sequence */
BLI_INLINE LinkNode *hair_spring_next(LinkNode *spring_link)
{
ClothSpring *spring = (ClothSpring *)spring_link->link;
diff --git a/source/blender/physics/intern/ConstrainedConjugateGradient.h b/source/blender/physics/intern/ConstrainedConjugateGradient.h
index 2d5fb41cc73..8d8dc1ae187 100644
--- a/source/blender/physics/intern/ConstrainedConjugateGradient.h
+++ b/source/blender/physics/intern/ConstrainedConjugateGradient.h
@@ -175,7 +175,7 @@ struct traits<ConstrainedConjugateGradient<_MatrixType,_UpLo,_FilterMatrixType,_
* ++i;
* } while (cg.info()!=Success && i<100);
* \endcode
- * Note that such a step by step excution is slightly slower.
+ * Note that such a step by step execution is slightly slower.
*
* \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
*/
diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c
index 5fd9c6b50de..45030524566 100644
--- a/source/blender/physics/intern/implicit_blender.c
+++ b/source/blender/physics/intern/implicit_blender.c
@@ -68,14 +68,15 @@
static float I[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
static float ZERO[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
-/*
+#if 0
#define C99
#ifdef C99
#defineDO_INLINE inline
#else
#defineDO_INLINE static
#endif
-*/
+#endif /* if 0 */
+
struct Cloth;
//////////////////////////////////////////
@@ -383,14 +384,18 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3])
int i2=(i+2)%3;
int j1=(j+1)%3;
int j2=(j+2)%3;
- // reverse indexs i&j to take transpose
+ /** Reverse indexes i&j to take transpose. */
to[j][i] = (from[i1][j1]*from[i2][j2]-from[i1][j2]*from[i2][j1])/d;
- /*
- if (i==j)
- to[i][j] = 1.0f / from[i][j];
- else
- to[i][j] = 0;
- */
+ /**
+ * <pre>
+ * if (i == j) {
+ * to[i][j] = 1.0f / from[i][j];
+ * }
+ * else {
+ * to[i][j] = 0;
+ * }
+ * </pre>
+ */
}
}
@@ -916,7 +921,8 @@ DO_INLINE void BuildPPinv(fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv)
}
}
-/*
+
+#if 0
// version 1.3
static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S, fmatrix3x3 *P, fmatrix3x3 *Pinv)
{
@@ -988,7 +994,8 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
return iterations<conjgrad_looplimit;
}
-*/
+#endif
+
// version 1.4
static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S, fmatrix3x3 *P, fmatrix3x3 *Pinv, fmatrix3x3 *bigI)
{
@@ -1031,7 +1038,7 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
// deltaNew = r^TP
deltaNew = dot_lfvector(r, p, numverts);
- /*
+#if 0
filter(dv, S);
add_lfvector_lfvector(dv, dv, z, numverts);
@@ -1045,7 +1052,7 @@ static int cg_filtered_pre(lfVector *dv, fmatrix3x3 *lA, lfVector *lB, lfVector
deltaNew = dot_lfvector(r, p, numverts);
delta0 = deltaNew * sqrt(conjgrad_epsilon);
- */
+#endif
#ifdef DEBUG_TIME
double start = PIL_check_seconds_timer();
@@ -1541,8 +1548,8 @@ BLI_INLINE bool spring_length(Implicit_Data *data, int i, int j, float r_extent[
*r_length = len_v3(r_extent);
if (*r_length > ALMOST_ZERO) {
- /*
- if (length>L) {
+#if 0
+ if (length > L) {
if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
( ((length-L)*100.0f/L) > clmd->sim_parms->maxspringlen ))
{
@@ -1551,7 +1558,7 @@ BLI_INLINE bool spring_length(Implicit_Data *data, int i, int j, float r_extent[
return false;
}
}
- */
+#endif
mul_v3_v3fl(r_dir, r_extent, 1.0f/(*r_length));
}
else {
diff --git a/source/blender/physics/intern/implicit_eigen.cpp b/source/blender/physics/intern/implicit_eigen.cpp
index eaac63893a6..fd91df9c769 100644
--- a/source/blender/physics/intern/implicit_eigen.cpp
+++ b/source/blender/physics/intern/implicit_eigen.cpp
@@ -900,8 +900,8 @@ BLI_INLINE bool spring_length(Implicit_Data *data, int i, int j, float r_extent[
*r_length = len_v3(r_extent);
if (*r_length > ALMOST_ZERO) {
- /*
- if (length>L) {
+#if 0
+ if (length > L) {
if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
( ((length-L)*100.0f/L) > clmd->sim_parms->maxspringlen ))
{
@@ -910,7 +910,7 @@ BLI_INLINE bool spring_length(Implicit_Data *data, int i, int j, float r_extent[
return false;
}
}
- */
+#endif
mul_v3_v3fl(r_dir, r_extent, 1.0f/(*r_length));
}
else {
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index b4c36a7c516..5f43f0bf885 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -75,8 +75,11 @@ void BPY_thread_restore(BPy_ThreadStatePtr tstate);
bool BPY_execute_filepath(struct bContext *C, const char *filepath, struct ReportList *reports);
bool BPY_execute_text(struct bContext *C, struct Text *text, struct ReportList *reports, const bool do_jump);
-bool BPY_execute_string_as_number(struct bContext *C, const char *expr, const bool verbose, double *r_value);
-bool BPY_execute_string_as_string(struct bContext *C, const char *expr, const bool verbose, char **r_value);
+
+bool BPY_execute_string_as_number(struct bContext *C, const char *imports[], const char *expr, const bool verbose, double *r_value);
+bool BPY_execute_string_as_intptr(struct bContext *C, const char *imports[], const char *expr, const bool verbose, intptr_t *r_value);
+bool BPY_execute_string_as_string(struct bContext *C, const char *imports[], const char *expr, const bool verbose, char **r_value);
+
bool BPY_execute_string_ex(struct bContext *C, const char *expr, bool use_eval);
bool BPY_execute_string(struct bContext *C, const char *expr);
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index d5973baeadb..d7324eabb6c 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -196,7 +196,7 @@ PyObject *BPyInit_bmesh(void)
{
PyObject *mod;
PyObject *submodule;
- PyObject *sys_modules = PyThreadState_GET()->interp->modules;
+ PyObject *sys_modules = PyImport_GetModuleDict();
BPy_BM_init_types();
BPy_BM_init_types_select();
diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.c b/source/blender/python/bmesh/bmesh_py_ops_call.c
index 4dce0dc2a22..013a22fd563 100644
--- a/source/blender/python/bmesh/bmesh_py_ops_call.c
+++ b/source/blender/python/bmesh/bmesh_py_ops_call.c
@@ -510,7 +510,7 @@ static int bpy_slot_from_py(
}
/**
- * Use for getting return values from an operator thats already executed.
+ * Use for getting return values from an operator that's already executed.
*
* \note Don't throw any exceptions and should always return a valid (PyObject *).
*/
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index e8474efa31f..a53248314df 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -112,7 +112,7 @@ PyDoc_STRVAR(bpy_bm_elem_seam_doc, "Seam for UV unwrapping.\n\n:type: boolean
static PyObject *bpy_bm_elem_hflag_get(BPy_BMElem *self, void *flag)
{
- const char hflag = (char)GET_INT_FROM_POINTER(flag);
+ const char hflag = (char)POINTER_AS_INT(flag);
BPY_BM_CHECK_OBJ(self);
@@ -121,7 +121,7 @@ static PyObject *bpy_bm_elem_hflag_get(BPy_BMElem *self, void *flag)
static int bpy_bm_elem_hflag_set(BPy_BMElem *self, PyObject *value, void *flag)
{
- const char hflag = (char)GET_INT_FROM_POINTER(flag);
+ const char hflag = (char)POINTER_AS_INT(flag);
int param;
BPY_BM_CHECK_INT(self);
@@ -265,7 +265,7 @@ PyDoc_STRVAR(bpy_bmloops_link_loops_doc,
static PyObject *bpy_bmelemseq_elem_get(BPy_BMElem *self, void *itype)
{
BPY_BM_CHECK_OBJ(self);
- return BPy_BMElemSeq_CreatePyObject(self->bm, self, GET_INT_FROM_POINTER(itype));
+ return BPy_BMElemSeq_CreatePyObject(self->bm, self, POINTER_AS_INT(itype));
}
@@ -613,7 +613,7 @@ static PyObject *bpy_bmelemseq_layers_get(BPy_BMElemSeq *self, void *htype)
{
BPY_BM_CHECK_OBJ(self);
- return BPy_BMLayerAccess_CreatePyObject(self->bm, GET_INT_FROM_POINTER(htype));
+ return BPy_BMLayerAccess_CreatePyObject(self->bm, POINTER_AS_INT(htype));
}
/* FaceSeq
@@ -2453,7 +2453,7 @@ PyDoc_STRVAR(bpy_bmelemseq_index_update_doc,
" .. note::\n"
"\n"
" Running this on sequences besides :class:`BMesh.verts`, :class:`BMesh.edges`, :class:`BMesh.faces`\n"
-" works but wont result in each element having a valid index, insted its order in the sequence will be set.\n"
+" works but wont result in each element having a valid index, instead its order in the sequence will be set.\n"
);
static PyObject *bpy_bmelemseq_index_update(BPy_BMElemSeq *self)
{
@@ -4050,7 +4050,7 @@ int BPy_BMElem_CheckHType(PyTypeObject *type, const char htype)
/**
* Use for error strings only, not thread safe,
*
- * \return a sting like '(BMVert/BMEdge/BMFace/BMLoop)'
+ * \return a string like '(BMVert/BMEdge/BMFace/BMLoop)'
*/
char *BPy_BMElem_StringFromHType_ex(const char htype, char ret[32])
{
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c
index aee9d6405d0..ecf5cce8bd2 100644
--- a/source/blender/python/bmesh/bmesh_py_types_customdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c
@@ -131,7 +131,7 @@ PyDoc_STRVAR(bpy_bmlayeraccess_collection__freestyle_face_doc,
static PyObject *bpy_bmlayeraccess_collection_get(BPy_BMLayerAccess *self, void *flag)
{
- const int type = (int)GET_INT_FROM_POINTER(flag);
+ const int type = (int)POINTER_AS_INT(flag);
BPY_BM_CHECK_OBJ(self);
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
index 97e64fd376e..d2ea87dd03f 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -182,13 +182,13 @@ PyDoc_STRVAR(bpy_bmloopuv_flag__select_edge_doc,
static PyObject *bpy_bmloopuv_flag_get(BPy_BMLoopUV *self, void *flag_p)
{
- const int flag = GET_INT_FROM_POINTER(flag_p);
+ const int flag = POINTER_AS_INT(flag_p);
return PyBool_FromLong(self->data->flag & flag);
}
static int bpy_bmloopuv_flag_set(BPy_BMLoopUV *self, PyObject *value, void *flag_p)
{
- const int flag = GET_INT_FROM_POINTER(flag_p);
+ const int flag = POINTER_AS_INT(flag_p);
switch (PyC_Long_AsBool(value)) {
case true:
@@ -290,13 +290,13 @@ PyDoc_STRVAR(bpy_bmvertskin_flag__use_loose_doc,
static PyObject *bpy_bmvertskin_flag_get(BPy_BMVertSkin *self, void *flag_p)
{
- const int flag = GET_INT_FROM_POINTER(flag_p);
+ const int flag = POINTER_AS_INT(flag_p);
return PyBool_FromLong(self->data->flag & flag);
}
static int bpy_bmvertskin_flag_set(BPy_BMVertSkin *self, PyObject *value, void *flag_p)
{
- const int flag = GET_INT_FROM_POINTER(flag_p);
+ const int flag = POINTER_AS_INT(flag_p);
switch (PyC_Long_AsBool(value)) {
case true:
@@ -478,7 +478,7 @@ PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data)
* This type could eventually be used to access lattice weights.
*
* \note: Many of blender-api's dict-like-wrappers act like ordered dicts,
- * This is intentional _not_ ordered, the weights can be in any order and it wont matter,
+ * This is intentionally _not_ ordered, the weights can be in any order and it won't matter,
* the order should not be used in the api in any meaningful way (as with a python dict)
* only expose as mapping, not a sequence.
*/
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index ca34de219b8..701dd5fbc19 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -438,7 +438,7 @@ PyDoc_STRVAR(bpy_bm_utils_face_split_doc,
" :type vert_a: :class:`bmesh.types.BMVert`\n"
" :arg vert_b: Second vertex to cut in the face (face must contain the vert).\n"
" :type vert_b: :class:`bmesh.types.BMVert`\n"
-" :arg coords: Optional argument to define points inbetween *vert_a* and *vert_b*.\n"
+" :arg coords: Optional argument to define points in between *vert_a* and *vert_b*.\n"
" :type coords: sequence of float triplets\n"
" :arg use_exist: .Use an existing edge if it exists (Only used when *coords* argument is empty or omitted)\n"
" :type use_exist: boolean\n"
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 4d4d5232800..918ec8fa018 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -944,7 +944,7 @@ PyObject *BPy_Wrap_GetKeys(IDProperty *prop)
/* pass */
}
- if (i != prop->len) { /* if the loop didnt finish, we know the length is wrong */
+ if (i != prop->len) { /* if the loop didn't finish, we know the length is wrong */
BPy_IDGroup_CorrectListLen(prop, list, i, __func__);
Py_DECREF(list); /*free the list*/
/*call self again*/
@@ -1795,7 +1795,7 @@ PyObject *BPyInit_idprop(void)
{
PyObject *mod;
PyObject *submodule;
- PyObject *sys_modules = PyThreadState_GET()->interp->modules;
+ PyObject *sys_modules = PyImport_GetModuleDict();
mod = PyModule_Create(&IDProp_module_def);
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index d2d78167fae..62b24618d3f 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -46,7 +46,6 @@
#endif
#ifdef _WIN32
-#include "BLI_path_util.h" /* BLI_setenv() */
#include "BLI_math_base.h" /* isfinite() */
#endif
@@ -618,7 +617,7 @@ const char *PyC_UnicodeAsByteAndSize(PyObject *py_str, Py_ssize_t *size, PyObjec
if (result) {
/* 99% of the time this is enough but we better support non unicode
- * chars since blender doesnt limit this */
+ * chars since blender doesn't limit this */
return result;
}
else {
@@ -671,7 +670,7 @@ PyObject *PyC_UnicodeFromByteAndSize(const char *str, Py_ssize_t size)
PyObject *result = PyUnicode_FromStringAndSize(str, size);
if (result) {
/* 99% of the time this is enough but we better support non unicode
- * chars since blender doesnt limit this */
+ * chars since blender doesn't limit this */
return result;
}
else {
@@ -691,7 +690,7 @@ PyObject *PyC_UnicodeFromByte(const char *str)
* Description: This function creates a new Python dictionary object.
* note: dict is owned by sys.modules["__main__"] module, reference is borrowed
* note: important we use the dict from __main__, this is what python expects
- * for 'pickle' to work as well as strings like this...
+ * for 'pickle' to work as well as strings like this...
* >> foo = 10
* >> print(__import__("__main__").foo)
*
@@ -716,6 +715,26 @@ PyObject *PyC_DefaultNameSpace(const char *filename)
return PyModule_GetDict(mod_main);
}
+bool PyC_NameSpace_ImportArray(PyObject *py_dict, const char *imports[])
+{
+ for (int i = 0; imports[i]; i++) {
+ PyObject *name = PyUnicode_FromString(imports[i]);
+ PyObject *mod = PyImport_ImportModuleLevelObject(name, NULL, NULL, 0, 0);
+ bool ok = false;
+ if (mod) {
+ PyDict_SetItem(py_dict, name, mod);
+ ok = true;
+ Py_DECREF(mod);
+ }
+ Py_DECREF(name);
+
+ if (!ok) {
+ return false;
+ }
+ }
+ return true;
+}
+
/* restore MUST be called after this */
void PyC_MainModule_Backup(PyObject **main_mod)
{
@@ -784,7 +803,7 @@ bool PyC_IsInterpreterActive(void)
}
/* Would be nice if python had this built in
- * See: http://wiki.blender.org/index.php/Dev:Doc/Tools/Debugging/PyFromC
+ * See: https://wiki.blender.org/wiki/Tools/Debugging/PyFromC
*/
void PyC_RunQuicky(const char *filepath, int n, ...)
{
@@ -1076,7 +1095,7 @@ PyObject *PyC_FlagSet_FromBitfield(PyC_FlagSet *items, int flag)
*
* \note it is caller's responsibility to acquire & release GIL!
*/
-bool PyC_RunString_AsNumber(const char *expr, const char *filename, double *r_value)
+bool PyC_RunString_AsNumber(const char *imports[], const char *expr, const char *filename, double *r_value)
{
PyObject *py_dict, *mod, *retval;
bool ok = true;
@@ -1096,9 +1115,10 @@ bool PyC_RunString_AsNumber(const char *expr, const char *filename, double *r_va
PyErr_Clear();
}
- retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict);
-
- if (retval == NULL) {
+ if (imports && (!PyC_NameSpace_ImportArray(py_dict, imports))) {
+ ok = false;
+ }
+ else if ((retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict)) == NULL) {
ok = false;
}
else {
@@ -1140,7 +1160,7 @@ bool PyC_RunString_AsNumber(const char *expr, const char *filename, double *r_va
return ok;
}
-bool PyC_RunString_AsString(const char *expr, const char *filename, char **r_value)
+bool PyC_RunString_AsIntPtr(const char *imports[], const char *expr, const char *filename, intptr_t *r_value)
{
PyObject *py_dict, *retval;
bool ok = true;
@@ -1150,9 +1170,45 @@ bool PyC_RunString_AsString(const char *expr, const char *filename, char **r_val
py_dict = PyC_DefaultNameSpace(filename);
- retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict);
+ if (imports && (!PyC_NameSpace_ImportArray(py_dict, imports))) {
+ ok = false;
+ }
+ else if ((retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict)) == NULL) {
+ ok = false;
+ }
+ else {
+ intptr_t val;
+
+ val = (intptr_t)PyLong_AsVoidPtr(retval);
+ if (val == 0 && PyErr_Occurred()) {
+ ok = false;
+ }
+ else {
+ *r_value = val;
+ }
+
+ Py_DECREF(retval);
+ }
- if (retval == NULL) {
+ PyC_MainModule_Restore(main_mod);
+
+ return ok;
+}
+
+bool PyC_RunString_AsString(const char *imports[], const char *expr, const char *filename, char **r_value)
+{
+ PyObject *py_dict, *retval;
+ bool ok = true;
+ PyObject *main_mod = NULL;
+
+ PyC_MainModule_Backup(&main_mod);
+
+ py_dict = PyC_DefaultNameSpace(filename);
+
+ if (imports && (!PyC_NameSpace_ImportArray(py_dict, imports))) {
+ ok = false;
+ }
+ else if ((retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict)) == NULL) {
ok = false;
}
else {
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 10419ce71d4..4cf6d6b26de 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -30,19 +30,19 @@
#include "BLI_sys_types.h"
#include "BLI_utildefines_variadic.h"
-void PyC_ObSpit(const char *name, PyObject *var);
-void PyC_ObSpitStr(char *result, size_t result_len, PyObject *var);
-void PyC_LineSpit(void);
-void PyC_StackSpit(void);
-PyObject * PyC_ExceptionBuffer(void);
-PyObject * PyC_ExceptionBuffer_Simple(void);
-PyObject * PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
-PyObject * PyC_FrozenSetFromStrings(const char **strings);
-PyObject * PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *format, ...);
-void PyC_Err_PrintWithFunc(PyObject *py_func);
-
-void PyC_FileAndNum(const char **filename, int *lineno);
-void PyC_FileAndNum_Safe(const char **filename, int *lineno); /* checks python is running */
+void PyC_ObSpit(const char *name, PyObject *var);
+void PyC_ObSpitStr(char *result, size_t result_len, PyObject *var);
+void PyC_LineSpit(void);
+void PyC_StackSpit(void);
+PyObject *PyC_ExceptionBuffer(void);
+PyObject *PyC_ExceptionBuffer_Simple(void);
+PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
+PyObject *PyC_FrozenSetFromStrings(const char **strings);
+PyObject *PyC_Err_Format_Prefix(PyObject *exception_type_prefix, const char *format, ...);
+void PyC_Err_PrintWithFunc(PyObject *py_func);
+
+void PyC_FileAndNum(const char **filename, int *lineno);
+void PyC_FileAndNum_Safe(const char **filename, int *lineno); /* checks python is running */
int PyC_AsArray_FAST(
void *array, PyObject *value_fast, const Py_ssize_t length,
const PyTypeObject *type, const bool is_double, const char *error_prefix);
@@ -71,14 +71,15 @@ void PyC_Tuple_Fill(PyObject *tuple, PyObject *value);
void PyC_List_Fill(PyObject *list, PyObject *value);
/* follow http://www.python.org/dev/peps/pep-0383/ */
-PyObject * PyC_UnicodeFromByte(const char *str);
-PyObject * PyC_UnicodeFromByteAndSize(const char *str, Py_ssize_t size);
-const char * PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce); /* coerce must be NULL */
-const char * PyC_UnicodeAsByteAndSize(PyObject *py_str, Py_ssize_t *size, PyObject **coerce);
+PyObject *PyC_UnicodeFromByte(const char *str);
+PyObject *PyC_UnicodeFromByteAndSize(const char *str, Py_ssize_t size);
+const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce); /* coerce must be NULL */
+const char *PyC_UnicodeAsByteAndSize(PyObject *py_str, Py_ssize_t *size, PyObject **coerce);
/* name namespace function for bpy & bge */
-PyObject * PyC_DefaultNameSpace(const char *filename);
-void PyC_RunQuicky(const char *filepath, int n, ...);
+PyObject *PyC_DefaultNameSpace(const char *filename);
+void PyC_RunQuicky(const char *filepath, int n, ...);
+bool PyC_NameSpace_ImportArray(PyObject *py_dict, const char *imports[]);
void PyC_MainModule_Backup(PyObject **main_mod);
void PyC_MainModule_Restore(PyObject *main_mod);
@@ -101,8 +102,9 @@ int PyC_FlagSet_ValueFromID(PyC_FlagSet *item, const char *identifier, int
int PyC_FlagSet_ToBitfield(PyC_FlagSet *items, PyObject *value, int *r_value, const char *error_prefix);
PyObject *PyC_FlagSet_FromBitfield(PyC_FlagSet *items, int flag);
-bool PyC_RunString_AsNumber(const char *expr, const char *filename, double *r_value);
-bool PyC_RunString_AsString(const char *expr, const char *filename, char **r_value);
+bool PyC_RunString_AsNumber(const char **imports, const char *expr, const char *filename, double *r_value);
+bool PyC_RunString_AsIntPtr(const char **imports, const char *expr, const char *filename, intptr_t *r_value);
+bool PyC_RunString_AsString(const char **imports, const char *expr, const char *filename, char **r_value);
int PyC_ParseBool(PyObject *o, void *p);
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 66c64b580f3..d519b5f8aef 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -230,13 +230,13 @@ PyDoc_STRVAR(bpy_app_debug_doc,
);
static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *closure)
{
- const int flag = GET_INT_FROM_POINTER(closure);
+ const int flag = POINTER_AS_INT(closure);
return PyBool_FromLong(G.debug & flag);
}
static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *closure)
{
- const int flag = GET_INT_FROM_POINTER(closure);
+ const int flag = POINTER_AS_INT(closure);
const int param = PyObject_IsTrue(value);
if (param == -1) {
@@ -307,7 +307,7 @@ static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void
static PyObject *bpy_app_global_flag_get(PyObject *UNUSED(self), void *closure)
{
- const int flag = GET_INT_FROM_POINTER(closure);
+ const int flag = POINTER_AS_INT(closure);
return PyBool_FromLong(G.f & flag);
}
@@ -339,7 +339,7 @@ PyDoc_STRVAR(bpy_app_preview_render_size_doc,
);
static PyObject *bpy_app_preview_render_size_get(PyObject *UNUSED(self), void *closure)
{
- return PyLong_FromLong((long)UI_preview_render_size(GET_INT_FROM_POINTER(closure)));
+ return PyLong_FromLong((long)UI_preview_render_size(POINTER_AS_INT(closure)));
}
static PyObject *bpy_app_autoexec_fail_message_get(PyObject *UNUSED(self), void *UNUSED(closure))
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c
index ded5ead93aa..8453808d6ec 100644
--- a/source/blender/python/intern/bpy_app_handlers.c
+++ b/source/blender/python/intern/bpy_app_handlers.c
@@ -241,7 +241,7 @@ PyObject *BPY_app_handlers_struct(void)
funcstore = &funcstore_array[pos];
funcstore->func = bpy_app_generic_callback;
funcstore->alloc = 0;
- funcstore->arg = SET_INT_IN_POINTER(pos);
+ funcstore->arg = POINTER_FROM_INT(pos);
BLI_callback_add(funcstore, pos);
}
}
@@ -300,7 +300,7 @@ void BPY_app_handlers_reset(const short do_all)
/* the actual callback - not necessarily called from py */
void bpy_app_generic_callback(struct Main *UNUSED(main), struct ID *id, void *arg)
{
- PyObject *cb_list = py_cb_array[GET_INT_FROM_POINTER(arg)];
+ PyObject *cb_list = py_cb_array[POINTER_AS_INT(arg)];
if (PyList_GET_SIZE(cb_list) > 0) {
PyGILState_STATE gilstate = PyGILState_Ensure();
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index c84765e9a47..123c938b921 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -537,7 +537,7 @@ static bool python_script_exec(
if (py_dict) {
#ifdef PYMODULE_CLEAR_WORKAROUND
- PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItemString(PyThreadState_GET()->interp->modules, "__main__");
+ PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItemString(PyImport_GetModuleDict(), "__main__");
PyObject *dict_back = mmod->md_dict;
/* freeing the module will clear the namespace,
* gives problems running classes defined in this namespace being used later. */
@@ -588,7 +588,9 @@ void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr)
/**
* \return success
*/
-bool BPY_execute_string_as_number(bContext *C, const char *expr, const bool verbose, double *r_value)
+bool BPY_execute_string_as_number(
+ bContext *C, const char *imports[],
+ const char *expr, const bool verbose, double *r_value)
{
PyGILState_STATE gilstate;
bool ok = true;
@@ -604,7 +606,7 @@ bool BPY_execute_string_as_number(bContext *C, const char *expr, const bool verb
bpy_context_set(C, &gilstate);
- ok = PyC_RunString_AsNumber(expr, "<blender button>", r_value);
+ ok = PyC_RunString_AsNumber(imports, expr, "<expr as number>", r_value);
if (ok == false) {
if (verbose) {
@@ -623,15 +625,14 @@ bool BPY_execute_string_as_number(bContext *C, const char *expr, const bool verb
/**
* \return success
*/
-bool BPY_execute_string_as_string(bContext *C, const char *expr, const bool verbose, char **r_value)
+bool BPY_execute_string_as_string(
+ bContext *C, const char *imports[],
+ const char *expr, const bool verbose, char **r_value)
{
+ BLI_assert(r_value && expr);
PyGILState_STATE gilstate;
bool ok = true;
- if (!r_value || !expr) {
- return -1;
- }
-
if (expr[0] == '\0') {
*r_value = NULL;
return ok;
@@ -639,7 +640,7 @@ bool BPY_execute_string_as_string(bContext *C, const char *expr, const bool verb
bpy_context_set(C, &gilstate);
- ok = PyC_RunString_AsString(expr, "<blender button>", r_value);
+ ok = PyC_RunString_AsString(imports, expr, "<expr as str>", r_value);
if (ok == false) {
if (verbose) {
@@ -655,17 +656,51 @@ bool BPY_execute_string_as_string(bContext *C, const char *expr, const bool verb
return ok;
}
+/**
+ * Support both int and pointers.
+ *
+ * \return success
+ */
+bool BPY_execute_string_as_intptr(
+ bContext *C, const char *imports[],
+ const char *expr, const bool verbose, intptr_t *r_value)
+{
+ BLI_assert(r_value && expr);
+ PyGILState_STATE gilstate;
+ bool ok = true;
+
+ if (expr[0] == '\0') {
+ *r_value = 0;
+ return ok;
+ }
+
+ bpy_context_set(C, &gilstate);
+
+ ok = PyC_RunString_AsIntPtr(imports, expr, "<expr as intptr>", r_value);
+
+ if (ok == false) {
+ if (verbose) {
+ BPy_errors_to_report_ex(CTX_wm_reports(C), false, false);
+ }
+ else {
+ PyErr_Clear();
+ }
+ }
+
+ bpy_context_clear(C, &gilstate);
+
+ return ok;
+}
bool BPY_execute_string_ex(bContext *C, const char *expr, bool use_eval)
{
+ BLI_assert(expr);
PyGILState_STATE gilstate;
PyObject *main_mod = NULL;
PyObject *py_dict, *retval;
bool ok = true;
Main *bmain_back; /* XXX, quick fix for release (Copy Settings crash), needs further investigation */
- if (!expr) return -1;
-
if (expr[0] == '\0') {
return ok;
}
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 4652da2018c..d3abaf43aef 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -64,6 +64,21 @@
/* so operators called can spawn threads which acquire the GIL */
#define BPY_RELEASE_GIL
+static wmOperatorType *ot_lookup_from_py_string(PyObject *value, const char *py_fn_id)
+{
+ const char *opname = _PyUnicode_AsString(value);
+ if (opname == NULL) {
+ PyErr_Format(PyExc_TypeError, "%s() expects a string argument", py_fn_id);
+ return NULL;
+ }
+
+ wmOperatorType *ot = WM_operatortype_find(opname, true);
+ if (ot == NULL) {
+ PyErr_Format(PyExc_KeyError, "%s(\"%s\") not found", py_fn_id, opname);
+ return NULL;
+ }
+ return ot;
+}
static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
{
@@ -124,7 +139,7 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
CTX_py_dict_set(C, (void *)context_dict);
Py_XINCREF(context_dict); /* so we done loose it */
- /* main purpose of thsi function */
+ /* main purpose of this function */
ret = WM_operator_poll_context((bContext *)C, ot, context) ? Py_True : Py_False;
/* restore with original context dict, probably NULL but need this for nested operator calls */
@@ -394,73 +409,16 @@ static PyObject *pyop_dir(PyObject *UNUSED(self))
return list;
}
-static PyObject *pyop_getrna(PyObject *UNUSED(self), PyObject *value)
+static PyObject *pyop_getrna_type(PyObject *UNUSED(self), PyObject *value)
{
wmOperatorType *ot;
- PointerRNA ptr;
- const char *opname = _PyUnicode_AsString(value);
- BPy_StructRNA *pyrna = NULL;
-
- if (opname == NULL) {
- PyErr_SetString(PyExc_TypeError, "_bpy.ops.get_rna() expects a string argument");
- return NULL;
- }
- ot = WM_operatortype_find(opname, true);
- if (ot == NULL) {
- PyErr_Format(PyExc_KeyError, "_bpy.ops.get_rna(\"%s\") not found", opname);
+ if ((ot = ot_lookup_from_py_string(value, "get_rna_type")) == NULL) {
return NULL;
}
- /* type */
- //RNA_pointer_create(NULL, &RNA_Struct, ot->srna, &ptr);
-
- /* XXX - should call WM_operator_properties_free */
- WM_operator_properties_create_ptr(&ptr, ot);
- WM_operator_properties_sanitize(&ptr, 0);
-
-
- pyrna = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr);
-#ifdef PYRNA_FREE_SUPPORT
- pyrna->freeptr = true;
-#endif
- return (PyObject *)pyrna;
-}
-
-static PyObject *pyop_getinstance(PyObject *UNUSED(self), PyObject *value)
-{
- wmOperatorType *ot;
- wmOperator *op;
PointerRNA ptr;
- const char *opname = _PyUnicode_AsString(value);
- BPy_StructRNA *pyrna = NULL;
-
- if (opname == NULL) {
- PyErr_SetString(PyExc_TypeError, "_bpy.ops.get_instance() expects a string argument");
- return NULL;
- }
- ot = WM_operatortype_find(opname, true);
- if (ot == NULL) {
- PyErr_Format(PyExc_KeyError, "_bpy.ops.get_instance(\"%s\") not found", opname);
- return NULL;
- }
-
-#ifdef PYRNA_FREE_SUPPORT
- op = MEM_callocN(sizeof(wmOperator), __func__);
-#else
- op = PyMem_MALLOC(sizeof(wmOperator));
- memset(op, 0, sizeof(wmOperator));
-#endif
- BLI_strncpy(op->idname, ot->idname, sizeof(op->idname)); /* in case its needed */
- op->type = ot;
-
- RNA_pointer_create(NULL, &RNA_Operator, op, &ptr);
-
- pyrna = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr);
-#ifdef PYRNA_FREE_SUPPORT
- pyrna->freeptr = true;
-#endif
- op->ptr = &pyrna->ptr;
-
+ RNA_pointer_create(NULL, &RNA_Struct, ot->srna, &ptr);
+ BPy_StructRNA *pyrna = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr);
return (PyObject *)pyrna;
}
@@ -469,8 +427,7 @@ static struct PyMethodDef bpy_ops_methods[] = {
{"call", (PyCFunction) pyop_call, METH_VARARGS, NULL},
{"as_string", (PyCFunction) pyop_as_string, METH_VARARGS, NULL},
{"dir", (PyCFunction) pyop_dir, METH_NOARGS, NULL},
- {"get_rna", (PyCFunction) pyop_getrna, METH_O, NULL}, /* only for introspection, leaks memory */
- {"get_instance", (PyCFunction) pyop_getinstance, METH_O, NULL}, /* only for introspection, leaks memory */
+ {"get_rna_type", (PyCFunction) pyop_getrna_type, METH_O, NULL},
{"macro_define", (PyCFunction) PYOP_wrap_macro_define, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};
diff --git a/source/blender/python/intern/bpy_path.c b/source/blender/python/intern/bpy_path.c
index f182972ba9c..53d8f8ea954 100644
--- a/source/blender/python/intern/bpy_path.c
+++ b/source/blender/python/intern/bpy_path.c
@@ -23,7 +23,7 @@
/** \file blender/python/intern/bpy_path.c
* \ingroup pythonintern
*
- * This file defines '_bpy_path' module, Some 'C' funtionality used by 'bpy.path'
+ * This file defines '_bpy_path' module, Some 'C' functionality used by 'bpy.path'
*/
#include <Python.h>
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 9b74b551b20..0db2fc189c1 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -1904,7 +1904,7 @@ static void bpy_prop_callback_assign_enum(struct PropertyRNA *prop, PyObject *ge
" :type description: string\n" \
#define BPY_PROPDEF_UNIT_DOC \
-" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION'].\n" \
+" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION', 'MASS', 'CAMERA'].\n" \
" :type unit: string\n" \
#define BPY_PROPDEF_NUM_MIN_DOC \
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 28a6a4f7fb0..b542f32f844 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2351,7 +2351,7 @@ static int pyrna_prop_collection_subscript_str_lib_pair_ptr(
}
else {
PyErr_Format(PyExc_KeyError,
- "%s: lib must be a sting or None, not %.200s",
+ "%s: lib must be a string or None, not %.200s",
err_prefix, Py_TYPE(keylib)->tp_name);
return -1;
}
@@ -4091,7 +4091,7 @@ static PyObject *pyrna_struct_meta_idprop_getattro(PyObject *cls, PyObject *attr
* <bpy_struct, BoolProperty("foo")>
* ...rather than returning the deferred class register tuple as checked by pyrna_is_deferred_prop()
*
- * Disable for now, this is faking internal behavior in a way thats too tricky to maintain well. */
+ * Disable for now, this is faking internal behavior in a way that's too tricky to maintain well. */
#if 0
if (ret == NULL) { // || pyrna_is_deferred_prop(ret)
StructRNA *srna = srna_from_self(cls, "StructRNA.__getattr__");
diff --git a/source/blender/python/intern/bpy_utils_units.c b/source/blender/python/intern/bpy_utils_units.c
index 0ef689d1a5a..cbd8b67d1ce 100644
--- a/source/blender/python/intern/bpy_utils_units.c
+++ b/source/blender/python/intern/bpy_utils_units.c
@@ -204,7 +204,7 @@ static PyObject *bpyunits_to_value(PyObject *UNUSED(self), PyObject *args, PyObj
bUnit_ReplaceString(str, (int)str_len, uref, scale, usys, ucat);
- if (!PyC_RunString_AsNumber(str, "<bpy_units_api>", &result)) {
+ if (!PyC_RunString_AsNumber(NULL, str, "<bpy_units_api>", &result)) {
if (PyErr_Occurred()) {
PyErr_Print();
PyErr_Clear();
diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
index 7cf669e875b..d902b6838f4 100644
--- a/source/blender/python/intern/gpu.c
+++ b/source/blender/python/intern/gpu.c
@@ -62,7 +62,7 @@ static struct PyModuleDef gpumodule = {
"gpu", /* name of module */
M_gpu_doc, /* module documentation */
-1, /* size of per-interpreter state of the module,
- * or -1 if the module keeps state in global variables. */
+ * or -1 if the module keeps state in global variables. */
NULL, NULL, NULL, NULL, NULL
};
@@ -326,7 +326,7 @@ PyObject *GPU_initPython(void)
{
PyObject *module;
PyObject *submodule;
- PyObject *sys_modules = PyThreadState_GET()->interp->modules;
+ PyObject *sys_modules = PyImport_GetModuleDict();
module = PyInit_gpu();
@@ -337,6 +337,6 @@ PyObject *GPU_initPython(void)
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
Py_INCREF(submodule);
- PyDict_SetItem(PyImport_GetModuleDict(), PyModule_GetNameObject(module), module);
+ PyDict_SetItem(sys_modules, PyModule_GetNameObject(module), module);
return module;
}
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index 0c365ad192c..566bac9cb09 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -405,7 +405,7 @@ int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int flo
}
#ifndef MATH_STANDALONE
-/* dynstr as python string utility funcions, frees 'ds'! */
+/* dynstr as python string utility functions, frees 'ds'! */
PyObject *mathutils_dynstr_to_py(struct DynStr *ds)
{
const int ds_len = BLI_dynstr_get_len(ds); /* space for \0 */
@@ -615,7 +615,7 @@ PyMODINIT_FUNC PyInit_mathutils(void)
{
PyObject *mod;
PyObject *submodule;
- PyObject *sys_modules = PyThreadState_GET()->interp->modules;
+ PyObject *sys_modules = PyImport_GetModuleDict();
if (PyType_Ready(&vector_Type) < 0)
return NULL;
@@ -641,7 +641,7 @@ PyMODINIT_FUNC PyInit_mathutils(void)
/* submodule */
PyModule_AddObject(mod, "geometry", (submodule = PyInit_mathutils_geometry()));
- /* XXX, python doesnt do imports with this usefully yet
+ /* XXX, python doesn't do imports with this usefully yet
* 'from mathutils.geometry import PolyFill'
* ...fails without this. */
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
diff --git a/source/blender/python/mathutils/mathutils.h b/source/blender/python/mathutils/mathutils.h
index b151ba7280d..286dd9f0750 100644
--- a/source/blender/python/mathutils/mathutils.h
+++ b/source/blender/python/mathutils/mathutils.h
@@ -170,7 +170,7 @@ Py_hash_t mathutils_array_hash(const float *float_array, size_t array_len);
int column_vector_multiplication(float rvec[4], VectorObject *vec, MatrixObject *mat);
#ifndef MATH_STANDALONE
-/* dynstr as python string utility funcions */
+/* dynstr as python string utility functions */
PyObject *mathutils_dynstr_to_py(struct DynStr *ds);
#endif
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c
index 4c1163a6181..e97ed095b24 100644
--- a/source/blender/python/mathutils/mathutils_Color.c
+++ b/source/blender/python/mathutils/mathutils_Color.c
@@ -706,12 +706,12 @@ PyDoc_STRVAR(Color_channel_b_doc, "Blue color channel.\n\n:type: float");
static PyObject *Color_channel_get(ColorObject *self, void *type)
{
- return Color_item(self, GET_INT_FROM_POINTER(type));
+ return Color_item(self, POINTER_AS_INT(type));
}
static int Color_channel_set(ColorObject *self, PyObject *value, void *type)
{
- return Color_ass_item(self, GET_INT_FROM_POINTER(type), value);
+ return Color_ass_item(self, POINTER_AS_INT(type), value);
}
/* color channel (HSV), color.h/s/v */
@@ -722,7 +722,7 @@ PyDoc_STRVAR(Color_channel_hsv_v_doc, "HSV Value component in [0, 1].\n\n:type:
static PyObject *Color_channel_hsv_get(ColorObject *self, void *type)
{
float hsv[3];
- int i = GET_INT_FROM_POINTER(type);
+ int i = POINTER_AS_INT(type);
if (BaseMath_ReadCallback(self) == -1)
return NULL;
@@ -735,7 +735,7 @@ static PyObject *Color_channel_hsv_get(ColorObject *self, void *type)
static int Color_channel_hsv_set(ColorObject *self, PyObject *value, void *type)
{
float hsv[3];
- int i = GET_INT_FROM_POINTER(type);
+ int i = POINTER_AS_INT(type);
float f = PyFloat_AsDouble(value);
if (f == -1 && PyErr_Occurred()) {
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 8be3de42226..9046bdc1aa4 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -161,7 +161,7 @@ PyDoc_STRVAR(Euler_to_matrix_doc,
"\n"
" Return a matrix representation of the euler.\n"
"\n"
-" :return: A 3x3 roation matrix representation of the euler.\n"
+" :return: A 3x3 rotation matrix representation of the euler.\n"
" :rtype: :class:`Matrix`\n"
);
static PyObject *Euler_to_matrix(EulerObject *self)
@@ -612,12 +612,12 @@ PyDoc_STRVAR(Euler_axis_doc,
);
static PyObject *Euler_axis_get(EulerObject *self, void *type)
{
- return Euler_item(self, GET_INT_FROM_POINTER(type));
+ return Euler_item(self, POINTER_AS_INT(type));
}
static int Euler_axis_set(EulerObject *self, PyObject *value, void *type)
{
- return Euler_ass_item(self, GET_INT_FROM_POINTER(type), value);
+ return Euler_ass_item(self, POINTER_AS_INT(type), value);
}
/* rotation order */
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 70c400f99b8..951c094ec40 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -2592,7 +2592,7 @@ static int Matrix_translation_set(MatrixObject *self, PyObject *value, void *UNU
}
PyDoc_STRVAR(Matrix_row_doc,
-"Access the matix by rows (default), (read-only).\n\n:type: Matrix Access"
+"Access the matrix by rows (default), (read-only).\n\n:type: Matrix Access"
);
static PyObject *Matrix_row_get(MatrixObject *self, void *UNUSED(closure))
{
@@ -2600,7 +2600,7 @@ static PyObject *Matrix_row_get(MatrixObject *self, void *UNUSED(closure))
}
PyDoc_STRVAR(Matrix_col_doc,
-"Access the matix by colums, 3x3 and 4x4 only, (read-only).\n\n:type: Matrix Access"
+"Access the matrix by columns, 3x3 and 4x4 only, (read-only).\n\n:type: Matrix Access"
);
static PyObject *Matrix_col_get(MatrixObject *self, void *UNUSED(closure))
{
@@ -2770,7 +2770,7 @@ PyDoc_STRVAR(matrix_doc,
" matrices from 2x2 up to 4x4.\n"
"\n"
" :param rows: Sequence of rows.\n"
-" When ommitted, a 4x4 identity matrix is constructed.\n"
+" When omitted, a 4x4 identity matrix is constructed.\n"
" :type rows: 2d number sequence\n"
);
PyTypeObject matrix_Type = {
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index 48c18dd20c1..bf603502ec2 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -972,12 +972,12 @@ PyDoc_STRVAR(Quaternion_axis_doc,
);
static PyObject *Quaternion_axis_get(QuaternionObject *self, void *type)
{
- return Quaternion_item(self, GET_INT_FROM_POINTER(type));
+ return Quaternion_item(self, POINTER_AS_INT(type));
}
static int Quaternion_axis_set(QuaternionObject *self, PyObject *value, void *type)
{
- return Quaternion_ass_item(self, GET_INT_FROM_POINTER(type), value);
+ return Quaternion_ass_item(self, POINTER_AS_INT(type), value);
}
PyDoc_STRVAR(Quaternion_magnitude_doc,
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 6a40f22d9df..e7776f836aa 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -847,7 +847,7 @@ static PyObject *Vector_orthogonal(VectorObject *self)
/**
* Vector.reflect(mirror): return a reflected vector on the mirror normal.
* <pre>
- * vec - ((2 * dot(vec, mirror)) * mirror)
+ * vec - ((2 * dot(vec, mirror)) * mirror)
* </pre>
*/
PyDoc_STRVAR(Vector_reflect_doc,
@@ -1650,7 +1650,7 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2)
/**
- * column vector multiplication (Matrix * Vector)
+ * Column vector multiplication (Matrix * Vector).
* <pre>
* [1][4][7] [a]
* [2][5][8] * [b]
@@ -2132,12 +2132,12 @@ PyDoc_STRVAR(Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n\n:type: floa
static PyObject *Vector_axis_get(VectorObject *self, void *type)
{
- return vector_item_internal(self, GET_INT_FROM_POINTER(type), true);
+ return vector_item_internal(self, POINTER_AS_INT(type), true);
}
static int Vector_axis_set(VectorObject *self, PyObject *value, void *type)
{
- return vector_ass_item_internal(self, GET_INT_FROM_POINTER(type), value, true);
+ return vector_ass_item_internal(self, POINTER_AS_INT(type), value, true);
}
/* vector.length */
@@ -2280,7 +2280,7 @@ static PyObject *Vector_swizzle_get(VectorObject *self, void *closure)
/* Unpack the axes from the closure into an array. */
axis_to = 0;
- swizzleClosure = GET_INT_FROM_POINTER(closure);
+ swizzleClosure = POINTER_AS_INT(closure);
while (swizzleClosure & SWIZZLE_VALID_AXIS) {
axis_from = swizzleClosure & SWIZZLE_AXIS;
if (axis_from >= self->size) {
@@ -2299,7 +2299,7 @@ static PyObject *Vector_swizzle_get(VectorObject *self, void *closure)
}
/**
- * Set the items of this vector using a swizzle.
+ * Set the items of this vector using a swizzle.
* - If value is a vector or list this operates like an array copy, except that
* the destination is effectively re-ordered as defined by the swizzle. At
* most min(len(source), len(dest)) values will be copied.
@@ -2327,7 +2327,7 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
/* Check that the closure can be used with this vector: even 2D vectors have
* swizzles defined for axes z and w, but they would be invalid. */
- swizzleClosure = GET_INT_FROM_POINTER(closure);
+ swizzleClosure = POINTER_AS_INT(closure);
axis_from = 0;
while (swizzleClosure & SWIZZLE_VALID_AXIS) {
@@ -2366,7 +2366,7 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
/* Copy vector contents onto swizzled axes. */
axis_from = 0;
- swizzleClosure = GET_INT_FROM_POINTER(closure);
+ swizzleClosure = POINTER_AS_INT(closure);
/* We must first copy current vec into tvec, else some org values may be lost.
* See [#31760].
@@ -2396,9 +2396,9 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure
#define _SWIZZLE3(a, b, c) (_SWIZZLE2(a, b) | (((c) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2)))
#define _SWIZZLE4(a, b, c, d) (_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3)))
-#define SWIZZLE2(a, b) SET_INT_IN_POINTER(_SWIZZLE2(a, b))
-#define SWIZZLE3(a, b, c) SET_INT_IN_POINTER(_SWIZZLE3(a, b, c))
-#define SWIZZLE4(a, b, c, d) SET_INT_IN_POINTER(_SWIZZLE4(a, b, c, d))
+#define SWIZZLE2(a, b) POINTER_FROM_INT(_SWIZZLE2(a, b))
+#define SWIZZLE3(a, b, c) POINTER_FROM_INT(_SWIZZLE3(a, b, c))
+#define SWIZZLE4(a, b, c, d) POINTER_FROM_INT(_SWIZZLE4(a, b, c, d))
/*****************************************************************************/
/* Python attributes get/set structure: */
diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c
index c044cc54965..36727fb91ae 100644
--- a/source/blender/python/mathutils/mathutils_bvhtree.c
+++ b/source/blender/python/mathutils/mathutils_bvhtree.c
@@ -579,7 +579,7 @@ PyDoc_STRVAR(py_bvhtree_overlap_doc,
"\n"
" Find overlapping indices between 2 trees.\n"
"\n"
-" :arg other_tree: Other tree to preform overlap test on.\n"
+" :arg other_tree: Other tree to perform overlap test on.\n"
" :type other_tree: :class:`BVHTree`\n"
" :return: Returns a list of unique index pairs,"
" the first index referencing this tree, the second referencing the **other_tree**.\n"
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c
index d935949fd8c..c759653c5cf 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -1265,7 +1265,7 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject
BKE_displist_fill(&dispbase, &dispbase, NULL, false);
/* The faces are stored in a new DisplayList
- * thats added to the head of the listbase */
+ * that's added to the head of the listbase */
dl = dispbase.first;
tri_list = PyList_New(dl->parts);
diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c
index 839d1ffc588..834322c0aed 100644
--- a/source/blender/python/mathutils/mathutils_noise.c
+++ b/source/blender/python/mathutils/mathutils_noise.c
@@ -845,6 +845,7 @@ static struct PyModuleDef M_Noise_module_def = {
/*----------------------------MODULE INIT-------------------------*/
PyMODINIT_FUNC PyInit_mathutils_noise(void)
{
+ PyObject *sys_modules = PyImport_GetModuleDict();
PyObject *submodule = PyModule_Create(&M_Noise_module_def);
PyObject *item_types, *item_metrics;
@@ -852,11 +853,11 @@ PyMODINIT_FUNC PyInit_mathutils_noise(void)
setRndSeed(0);
PyModule_AddObject(submodule, "types", (item_types = PyInit_mathutils_noise_types()));
- PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.types", item_types);
+ PyDict_SetItemString(sys_modules, "noise.types", item_types);
Py_INCREF(item_types);
PyModule_AddObject(submodule, "distance_metrics", (item_metrics = PyInit_mathutils_noise_metrics()));
- PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.distance_metrics", item_metrics);
+ PyDict_SetItemString(sys_modules, "noise.distance_metrics", item_metrics);
Py_INCREF(item_metrics);
return submodule;
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index 3520a312012..3404a2eeb8b 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -453,7 +453,7 @@ rcti* RE_engine_get_current_tiles(Render *re, int *r_total_tiles, bool *r_needs_
if (pa->status == PART_STATUS_IN_PROGRESS) {
if (total_tiles >= allocation_size) {
/* Just in case we're using crazy network rendering with more
- * slaves as BLENDER_MAX_THREADS.
+ * workers than BLENDER_MAX_THREADS.
*/
allocation_size += allocation_step;
if (tiles == tiles_static) {
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 97971030dfb..4f2f8d67f45 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -2454,6 +2454,13 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
BLI_rw_mutex_unlock(&re->resultmutex);
render_result_uncrop(re1);
}
+#ifdef WITH_FREESTYLE
+ else if (re1->r.mode & R_EDGE_FRS) {
+ BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
+ composite_freestyle_renders(re1, 0);
+ BLI_rw_mutex_unlock(&re->resultmutex);
+ }
+#endif
ntreeCompositTagRender(re1->scene); /* ensure node gets exec to put buffers on stack */
}
}
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 6e3dffccc16..608275cdb4d 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -88,7 +88,7 @@ static void RE_rayobject_config_control(RayObject *r, Render *re)
RayObject *RE_rayobject_create(int type, int size, int octree_resolution)
{
- RayObject * res = NULL;
+ RayObject *res = NULL;
if (type == R_RAYSTRUCTURE_AUTO) {
/* TODO */
@@ -124,7 +124,7 @@ RayObject *RE_rayobject_create(int type, int size, int octree_resolution)
static RayObject* rayobject_create(Render *re, int type, int size)
{
- RayObject * res = NULL;
+ RayObject *res = NULL;
res = RE_rayobject_create(type, size, re->r.ocres);
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 7426e953632..fb3c8b542a8 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -358,8 +358,8 @@ static int wood(Tex *tex, const float texvec[3], TexResult *texres)
static float marble_int(Tex *tex, float x, float y, float z)
{
float n, mi;
- short wf = tex->noisebasis2; /* wave form: TEX_SIN=0, TEX_SAW=1, TEX_TRI=2 */
- short mt = tex->stype; /* marble type: TEX_SOFT=0, TEX_SHARP=1,TEX_SHAPER=2 */
+ short wf = tex->noisebasis2; /* wave form: TEX_SIN=0, TEX_SAW=1, TEX_TRI=2 */
+ short mt = tex->stype; /* marble type: TEX_SOFT=0, TEX_SHARP=1, TEX_SHAPER=2 */
float (*waveform[3])(float); /* create array of pointers to waveform functions */
waveform[0] = tex_sin; /* assign address of tex_sin() function to pointer array */
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 99d2436d4bc..cfbf199c94d 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -314,7 +314,7 @@ static void halo_tile(RenderPart *pa, RenderLayer *rl)
if ((zz> har->zs) || (har->mat && (har->mat->mode & MA_HALO_SOFT))) {
if (shadeHaloFloat(har, col, zz, dist, xn, yn, har->flarec)) {
for (sample=0; sample<totsample; sample++) {
- float * rect= RE_RenderLayerGetPass(rlpp[sample], RE_PASSNAME_COMBINED, R.viewname);
+ float *rect = RE_RenderLayerGetPass(rlpp[sample], RE_PASSNAME_COMBINED, R.viewname);
addalphaAddfacFloat(rect + od*4, col, har->add);
}
}
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 04e9177241b..3f2ed75f5a4 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -1086,7 +1086,7 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int
else {
/* got warning on this for 64 bits.... */
/* but it's working code! in this case rz is not a pointer but zvalue (ton) */
- zsamp= GET_INT_FROM_POINTER(rz);
+ zsamp= POINTER_AS_INT(rz);
}
/* tricky stuff here; we use ints which can overflow easily with bias values */
@@ -1270,7 +1270,7 @@ static float readshadowbuf_halo(ShadBuf *shb, ShadSampleBuf *shsample, int xs, i
else {
/* same as before */
/* still working code! (ton) */
- zsamp= GET_INT_FROM_POINTER(rz);
+ zsamp= POINTER_AS_INT(rz);
}
/* NO schadow when sampled at 'eternal' distance */
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt
index 810cceb5fc3..ebf55c64906 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -64,6 +64,7 @@ set(SRC
intern/wm_init_exit.c
intern/wm_jobs.c
intern/wm_keymap.c
+ intern/wm_keymap_utils.c
intern/wm_menu_type.c
intern/wm_operator_props.c
intern/wm_operator_type.c
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index dd2f9b4c450..2ff416c0ba6 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -29,12 +29,12 @@
/** \file blender/windowmanager/WM_api.h
* \ingroup wm
*
- * \page wmpage windowmanager
- * \section wmabout About windowmanager
- * \ref wm handles events received from \ref GHOST and manages
- * the screens, areas and input for Blender
- * \section wmnote NOTE
- * \todo document
+ * \page wmpage windowmanager
+ * \section wmabout About windowmanager
+ * \ref wm handles events received from \ref GHOST and manages
+ * the screens, areas and input for Blender
+ * \section wmnote NOTE
+ * \todo document
*/
/* dna-savable wmStructs here */
@@ -78,6 +78,7 @@ const char *WM_init_state_app_template_get(void);
void WM_init_state_size_set (int stax, int stay, int sizx, int sizy);
void WM_init_state_fullscreen_set(void);
void WM_init_state_normal_set(void);
+void WM_init_window_focus_set(bool do_it);
void WM_init_native_pixels(bool do_it);
void WM_init (struct bContext *C, int argc, const char **argv);
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h
index 9d0ccbfef64..0538df83c60 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -58,29 +58,38 @@ void WM_keyconfig_update_operatortype(void);
void WM_keymap_init (struct bContext *C);
void WM_keymap_free (struct wmKeyMap *keymap);
-wmKeyMapItem *WM_keymap_verify_item(struct wmKeyMap *keymap, const char *idname, int type,
- int val, int modifier, int keymodifier);
-wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, int type,
- int val, int modifier, int keymodifier);
-wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, int type,
- int val, int modifier, int keymodifier);
-wmKeyMapItem *WM_keymap_add_menu_pie(struct wmKeyMap *keymap, const char *idname, int type,
- int val, int modifier, int keymodifier);
+wmKeyMapItem *WM_keymap_verify_item(
+ struct wmKeyMap *keymap, const char *idname, int type,
+ int val, int modifier, int keymodifier);
+wmKeyMapItem *WM_keymap_add_item(
+ struct wmKeyMap *keymap, const char *idname, int type,
+ int val, int modifier, int keymodifier);
bool WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
int WM_keymap_item_to_string(wmKeyMapItem *kmi, const bool compact, char *result, const int result_len);
wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
-wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
+wmKeyMap *WM_keymap_ensure(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
wmKeyMap *WM_keymap_find_all(const struct bContext *C, const char *idname, int spaceid, int regionid);
wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap);
-wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
bool WM_keymap_remove(struct wmKeyConfig *keyconfig, struct wmKeyMap *keymap);
bool WM_keymap_poll(struct bContext *C, struct wmKeyMap *keymap);
wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id);
bool WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2);
+/* keymap_utils.c */
+
+/** Wrappers for #WM_keymap_add_item */
+wmKeyMapItem *WM_keymap_add_menu(
+ struct wmKeyMap *keymap, const char *idname, int type,
+ int val, int modifier, int keymodifier);
+wmKeyMapItem *WM_keymap_add_menu_pie(
+ struct wmKeyMap *keymap, const char *idname, int type,
+ int val, int modifier, int keymodifier);
+
+wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
+
/* Modal Keymap */
int WM_modalkeymap_items_to_string(
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 24ec3aef759..e789099c799 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -274,7 +274,7 @@ bool wm_cursor_arrow_move(wmWindow *win, const wmEvent *event)
}
-/* afer this you can call restore too */
+/* after this you can call restore too */
void WM_cursor_time(wmWindow *win, int nr)
{
/* 10 8x8 digits */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 3a300877750..0084c3a5407 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2101,7 +2101,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
/* modal handlers can get removed in this loop, we keep the loop this way
*
* note: check 'handlers->first' because in rare cases the handlers can be cleared
- * by the event thats called, for eg:
+ * by the event that's called, for eg:
*
* Calling a python script which changes the area.type, see [#32232] */
for (handler = handlers->first; handler && handlers->first; handler = nexthandler) {
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 477699fccaa..796103677bf 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -641,7 +641,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
struct {
char app_template[64];
bool override;
-} wm_init_state_app_template = {0};
+} wm_init_state_app_template = {{0}};
/**
* Used for setting app-template from the command line:
@@ -964,7 +964,7 @@ static RecentFile *wm_file_history_find(const char *filepath)
/**
* Write #BLENDER_HISTORY_FILE as-is, without checking the environment
- * (thats handled by #wm_history_file_update).
+ * (that's handled by #wm_history_file_update).
*/
static void wm_history_file_write(void)
{
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 72973d3de56..d8cc5b37b7d 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -361,7 +361,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
}
if (!BLI_ghash_haskey(libraries, libname)) {
- BLI_ghash_insert(libraries, BLI_strdup(libname), SET_INT_IN_POINTER(lib_idx));
+ BLI_ghash_insert(libraries, BLI_strdup(libname), POINTER_FROM_INT(lib_idx));
lib_idx++;
wm_link_append_data_library_add(lapp_data, libname);
}
@@ -382,7 +382,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
continue;
}
- lib_idx = GET_INT_FROM_POINTER(BLI_ghash_lookup(libraries, libname));
+ lib_idx = POINTER_AS_INT(BLI_ghash_lookup(libraries, libname));
item = wm_link_append_data_item_add(lapp_data, name, BKE_idcode_from_name(group), NULL);
BLI_BITMAP_ENABLE(item->libraries, lib_idx);
@@ -602,7 +602,7 @@ static void lib_relocate_do(
BKE_main_id_tag_all(bmain, LIB_TAG_PRE_EXISTING, true);
- /* We do not want any instanciation here! */
+ /* We do not want any instantiation here! */
wm_link_do(lapp_data, reports, bmain, NULL, NULL);
BKE_main_lock(bmain);
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index dd9e7edf413..92d51c9a400 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -64,12 +64,12 @@
* - add timer notifier to handle progress
*
* Stop job
- * - signal job to end
- * on end, job will tag itself as sleeping
+ * - signal job to end
+ * on end, job will tag itself as sleeping
*
* Remove job
* - signal job to end
- * on end, job will remove itself
+ * on end, job will remove itself
*
* When job is done:
* - it puts timer to sleep (or removes?)
@@ -175,7 +175,7 @@ static wmJob *wm_job_find(wmWindowManager *wm, void *owner, const int job_type)
/* ******************* public API ***************** */
/**
- * \return current job or adds new job, but doesnt run it.
+ * \return current job or adds new job, but doesn't run it.
*
* \note every owner only gets a single job,
* adding a new one will stop running job and when stopped it starts the new one.
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 762cef4a635..2834e95527a 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -121,7 +121,7 @@ static void wm_keymap_item_properties_update_ot(wmKeyMapItem *kmi)
wmOperatorType *ot = WM_operatortype_find(kmi->idname, 0);
if (ot) {
if (ot->srna != kmi->ptr->type) {
- /* matches wm_keymap_item_properties_set but doesnt alloc new ptr */
+ /* matches wm_keymap_item_properties_set but doesn't alloc new ptr */
WM_operator_properties_create_ptr(kmi->ptr, ot);
/* 'kmi->ptr->data' NULL'd above, keep using existing properties.
* Note: the operators property types may have changed,
@@ -477,21 +477,6 @@ wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, int type,
return kmi;
}
-/* menu wrapper for WM_keymap_add_item */
-wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
-{
- wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu", type, val, modifier, keymodifier);
- RNA_string_set(kmi->ptr, "name", idname);
- return kmi;
-}
-
-wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
-{
- wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu_pie", type, val, modifier, keymodifier);
- RNA_string_set(kmi->ptr, "name", idname);
- return kmi;
-}
-
bool WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi)
{
if (BLI_findindex(&keymap->items, kmi) != -1) {
@@ -771,7 +756,7 @@ wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int
return NULL;
}
-wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
{
wmKeyMap *km = WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
@@ -798,7 +783,7 @@ wmKeyMap *WM_keymap_find_all(const bContext *C, const char *idname, int spaceid,
wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
{
- wmKeyMap *km = WM_keymap_find(keyconf, idname, 0, 0);
+ wmKeyMap *km = WM_keymap_ensure(keyconf, idname, 0, 0);
km->flag |= KEYMAP_MODAL;
km->modal_items = items;
@@ -1664,265 +1649,6 @@ wmKeyMapItem *WM_keymap_item_find_id(wmKeyMap *keymap, int id)
return NULL;
}
-/* Guess an appropriate keymap from the operator name */
-/* Needs to be kept up to date with Keymap and Operator naming */
-wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
-{
- /* Op types purposely skipped for now:
- * BRUSH_OT
- * BOID_OT
- * BUTTONS_OT
- * CONSTRAINT_OT
- * PAINT_OT
- * ED_OT
- * FLUID_OT
- * TEXTURE_OT
- * UI_OT
- * VIEW2D_OT
- * WORLD_OT
- */
-
- wmKeyMap *km = NULL;
- SpaceLink *sl = CTX_wm_space_data(C);
-
- /* Window */
- if (STRPREFIX(opname, "WM_OT")) {
- km = WM_keymap_find_all(C, "Window", 0, 0);
- }
- /* Screen & Render */
- else if (STRPREFIX(opname, "SCREEN_OT") ||
- STRPREFIX(opname, "RENDER_OT") ||
- STRPREFIX(opname, "SOUND_OT") ||
- STRPREFIX(opname, "SCENE_OT"))
- {
- km = WM_keymap_find_all(C, "Screen", 0, 0);
- }
- /* Grease Pencil */
- else if (STRPREFIX(opname, "GPENCIL_OT")) {
- km = WM_keymap_find_all(C, "Grease Pencil", 0, 0);
- }
- /* Markers */
- else if (STRPREFIX(opname, "MARKER_OT")) {
- km = WM_keymap_find_all(C, "Markers", 0, 0);
- }
- /* Import/Export*/
- else if (STRPREFIX(opname, "IMPORT_") ||
- STRPREFIX(opname, "EXPORT_"))
- {
- km = WM_keymap_find_all(C, "Window", 0, 0);
- }
-
-
- /* 3D View */
- else if (STRPREFIX(opname, "VIEW3D_OT")) {
- km = WM_keymap_find_all(C, "3D View", sl->spacetype, 0);
- }
- else if (STRPREFIX(opname, "OBJECT_OT")) {
- /* exception, this needs to work outside object mode too */
- if (STRPREFIX(opname, "OBJECT_OT_mode_set"))
- km = WM_keymap_find_all(C, "Object Non-modal", 0, 0);
- else
- km = WM_keymap_find_all(C, "Object Mode", 0, 0);
- }
- /* Object mode related */
- else if (STRPREFIX(opname, "GROUP_OT") ||
- STRPREFIX(opname, "MATERIAL_OT") ||
- STRPREFIX(opname, "PTCACHE_OT") ||
- STRPREFIX(opname, "RIGIDBODY_OT"))
- {
- km = WM_keymap_find_all(C, "Object Mode", 0, 0);
- }
-
- /* Editing Modes */
- else if (STRPREFIX(opname, "MESH_OT")) {
- km = WM_keymap_find_all(C, "Mesh", 0, 0);
-
- /* some mesh operators are active in object mode too, like add-prim */
- if (km && !WM_keymap_poll((bContext *)C, km)) {
- km = WM_keymap_find_all(C, "Object Mode", 0, 0);
- }
- }
- else if (STRPREFIX(opname, "CURVE_OT") ||
- STRPREFIX(opname, "SURFACE_OT"))
- {
- km = WM_keymap_find_all(C, "Curve", 0, 0);
-
- /* some curve operators are active in object mode too, like add-prim */
- if (km && !WM_keymap_poll((bContext *)C, km)) {
- km = WM_keymap_find_all(C, "Object Mode", 0, 0);
- }
- }
- else if (STRPREFIX(opname, "ARMATURE_OT") ||
- STRPREFIX(opname, "SKETCH_OT"))
- {
- km = WM_keymap_find_all(C, "Armature", 0, 0);
- }
- else if (STRPREFIX(opname, "POSE_OT") ||
- STRPREFIX(opname, "POSELIB_OT"))
- {
- km = WM_keymap_find_all(C, "Pose", 0, 0);
- }
- else if (STRPREFIX(opname, "SCULPT_OT")) {
- switch (CTX_data_mode_enum(C)) {
- case OB_MODE_SCULPT:
- km = WM_keymap_find_all(C, "Sculpt", 0, 0);
- break;
- case OB_MODE_EDIT:
- km = WM_keymap_find_all(C, "UV Sculpt", 0, 0);
- break;
- }
- }
- else if (STRPREFIX(opname, "MBALL_OT")) {
- km = WM_keymap_find_all(C, "Metaball", 0, 0);
-
- /* some mball operators are active in object mode too, like add-prim */
- if (km && !WM_keymap_poll((bContext *)C, km)) {
- km = WM_keymap_find_all(C, "Object Mode", 0, 0);
- }
- }
- else if (STRPREFIX(opname, "LATTICE_OT")) {
- km = WM_keymap_find_all(C, "Lattice", 0, 0);
- }
- else if (STRPREFIX(opname, "PARTICLE_OT")) {
- km = WM_keymap_find_all(C, "Particle", 0, 0);
- }
- else if (STRPREFIX(opname, "FONT_OT")) {
- km = WM_keymap_find_all(C, "Font", 0, 0);
- }
- /* Paint Face Mask */
- else if (STRPREFIX(opname, "PAINT_OT_face_select")) {
- km = WM_keymap_find_all(C, "Face Mask", 0, 0);
- }
- else if (STRPREFIX(opname, "PAINT_OT")) {
- /* check for relevant mode */
- switch (CTX_data_mode_enum(C)) {
- case OB_MODE_WEIGHT_PAINT:
- km = WM_keymap_find_all(C, "Weight Paint", 0, 0);
- break;
- case OB_MODE_VERTEX_PAINT:
- km = WM_keymap_find_all(C, "Vertex Paint", 0, 0);
- break;
- case OB_MODE_TEXTURE_PAINT:
- km = WM_keymap_find_all(C, "Image Paint", 0, 0);
- break;
- }
- }
- /* Timeline */
- else if (STRPREFIX(opname, "TIME_OT")) {
- km = WM_keymap_find_all(C, "Timeline", sl->spacetype, 0);
- }
- /* Image Editor */
- else if (STRPREFIX(opname, "IMAGE_OT")) {
- km = WM_keymap_find_all(C, "Image", sl->spacetype, 0);
- }
- /* Clip Editor */
- else if (STRPREFIX(opname, "CLIP_OT")) {
- km = WM_keymap_find_all(C, "Clip", sl->spacetype, 0);
- }
- else if (STRPREFIX(opname, "MASK_OT")) {
- km = WM_keymap_find_all(C, "Mask Editing", 0, 0);
- }
- /* UV Editor */
- else if (STRPREFIX(opname, "UV_OT")) {
- /* Hack to allow using UV unwrapping ops from 3DView/editmode.
- * Mesh keymap is probably not ideal, but best place I could find to put those. */
- if (sl->spacetype == SPACE_VIEW3D) {
- km = WM_keymap_find_all(C, "Mesh", 0, 0);
- if (km && !WM_keymap_poll((bContext *)C, km)) {
- km = NULL;
- }
- }
- if (!km) {
- km = WM_keymap_find_all(C, "UV Editor", 0, 0);
- }
- }
- /* Node Editor */
- else if (STRPREFIX(opname, "NODE_OT")) {
- km = WM_keymap_find_all(C, "Node Editor", sl->spacetype, 0);
- }
- /* Animation Editor Channels */
- else if (STRPREFIX(opname, "ANIM_OT_channels")) {
- km = WM_keymap_find_all(C, "Animation Channels", 0, 0);
- }
- /* Animation Generic - after channels */
- else if (STRPREFIX(opname, "ANIM_OT")) {
- km = WM_keymap_find_all(C, "Animation", 0, 0);
- }
- /* Graph Editor */
- else if (STRPREFIX(opname, "GRAPH_OT")) {
- km = WM_keymap_find_all(C, "Graph Editor", sl->spacetype, 0);
- }
- /* Dopesheet Editor */
- else if (STRPREFIX(opname, "ACTION_OT")) {
- km = WM_keymap_find_all(C, "Dopesheet", sl->spacetype, 0);
- }
- /* NLA Editor */
- else if (STRPREFIX(opname, "NLA_OT")) {
- km = WM_keymap_find_all(C, "NLA Editor", sl->spacetype, 0);
- }
- /* Script */
- else if (STRPREFIX(opname, "SCRIPT_OT")) {
- km = WM_keymap_find_all(C, "Script", sl->spacetype, 0);
- }
- /* Text */
- else if (STRPREFIX(opname, "TEXT_OT")) {
- km = WM_keymap_find_all(C, "Text", sl->spacetype, 0);
- }
- /* Sequencer */
- else if (STRPREFIX(opname, "SEQUENCER_OT")) {
- km = WM_keymap_find_all(C, "Sequencer", sl->spacetype, 0);
- }
- /* Console */
- else if (STRPREFIX(opname, "CONSOLE_OT")) {
- km = WM_keymap_find_all(C, "Console", sl->spacetype, 0);
- }
- /* Console */
- else if (STRPREFIX(opname, "INFO_OT")) {
- km = WM_keymap_find_all(C, "Info", sl->spacetype, 0);
- }
- /* File browser */
- else if (STRPREFIX(opname, "FILE_OT")) {
- km = WM_keymap_find_all(C, "File Browser", sl->spacetype, 0);
- }
- /* Logic Editor */
- else if (STRPREFIX(opname, "LOGIC_OT")) {
- km = WM_keymap_find_all(C, "Logic Editor", sl->spacetype, 0);
- }
- /* Outliner */
- else if (STRPREFIX(opname, "OUTLINER_OT")) {
- km = WM_keymap_find_all(C, "Outliner", sl->spacetype, 0);
- }
- /* Transform */
- else if (STRPREFIX(opname, "TRANSFORM_OT")) {
- /* check for relevant editor */
- switch (sl->spacetype) {
- case SPACE_VIEW3D:
- km = WM_keymap_find_all(C, "3D View", sl->spacetype, 0);
- break;
- case SPACE_IPO:
- km = WM_keymap_find_all(C, "Graph Editor", sl->spacetype, 0);
- break;
- case SPACE_ACTION:
- km = WM_keymap_find_all(C, "Dopesheet", sl->spacetype, 0);
- break;
- case SPACE_NLA:
- km = WM_keymap_find_all(C, "NLA Editor", sl->spacetype, 0);
- break;
- case SPACE_IMAGE:
- km = WM_keymap_find_all(C, "UV Editor", 0, 0);
- break;
- case SPACE_NODE:
- km = WM_keymap_find_all(C, "Node Editor", sl->spacetype, 0);
- break;
- case SPACE_SEQ:
- km = WM_keymap_find_all(C, "Sequencer", sl->spacetype, 0);
- break;
- }
- }
-
- return km;
-}
-
const char *WM_bool_as_string(bool test)
{
return test ? IFACE_("ON") : IFACE_("OFF");
diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c
new file mode 100644
index 00000000000..1774b876f38
--- /dev/null
+++ b/source/blender/windowmanager/intern/wm_keymap_utils.c
@@ -0,0 +1,328 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/windowmanager/intern/wm_keymap_utils.c
+ * \ingroup wm
+ *
+ * Utilities to help define keymaps.
+ */
+
+#include <string.h>
+
+#include "DNA_object_types.h"
+#include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
+
+#include "BLI_utildefines.h"
+
+#include "BKE_context.h"
+
+#include "RNA_access.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+/* menu wrapper for WM_keymap_add_item */
+
+/* -------------------------------------------------------------------- */
+/** \name Wrappers for #WM_keymap_add_item
+ * \{ */
+
+wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
+{
+ wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu", type, val, modifier, keymodifier);
+ RNA_string_set(kmi->ptr, "name", idname);
+ return kmi;
+}
+
+wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
+{
+ wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu_pie", type, val, modifier, keymodifier);
+ RNA_string_set(kmi->ptr, "name", idname);
+ return kmi;
+}
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Introspection
+ * \{ */
+
+/* Guess an appropriate keymap from the operator name */
+/* Needs to be kept up to date with Keymap and Operator naming */
+wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
+{
+ /* Op types purposely skipped for now:
+ * BRUSH_OT
+ * BOID_OT
+ * BUTTONS_OT
+ * CONSTRAINT_OT
+ * PAINT_OT
+ * ED_OT
+ * FLUID_OT
+ * TEXTURE_OT
+ * UI_OT
+ * VIEW2D_OT
+ * WORLD_OT
+ */
+
+ wmKeyMap *km = NULL;
+ SpaceLink *sl = CTX_wm_space_data(C);
+
+ /* Window */
+ if (STRPREFIX(opname, "WM_OT")) {
+ km = WM_keymap_find_all(C, "Window", 0, 0);
+ }
+ /* Screen & Render */
+ else if (STRPREFIX(opname, "SCREEN_OT") ||
+ STRPREFIX(opname, "RENDER_OT") ||
+ STRPREFIX(opname, "SOUND_OT") ||
+ STRPREFIX(opname, "SCENE_OT"))
+ {
+ km = WM_keymap_find_all(C, "Screen", 0, 0);
+ }
+ /* Grease Pencil */
+ else if (STRPREFIX(opname, "GPENCIL_OT")) {
+ km = WM_keymap_find_all(C, "Grease Pencil", 0, 0);
+ }
+ /* Markers */
+ else if (STRPREFIX(opname, "MARKER_OT")) {
+ km = WM_keymap_find_all(C, "Markers", 0, 0);
+ }
+ /* Import/Export*/
+ else if (STRPREFIX(opname, "IMPORT_") ||
+ STRPREFIX(opname, "EXPORT_"))
+ {
+ km = WM_keymap_find_all(C, "Window", 0, 0);
+ }
+
+
+ /* 3D View */
+ else if (STRPREFIX(opname, "VIEW3D_OT")) {
+ km = WM_keymap_find_all(C, "3D View", sl->spacetype, 0);
+ }
+ else if (STRPREFIX(opname, "OBJECT_OT")) {
+ /* exception, this needs to work outside object mode too */
+ if (STRPREFIX(opname, "OBJECT_OT_mode_set"))
+ km = WM_keymap_find_all(C, "Object Non-modal", 0, 0);
+ else
+ km = WM_keymap_find_all(C, "Object Mode", 0, 0);
+ }
+ /* Object mode related */
+ else if (STRPREFIX(opname, "GROUP_OT") ||
+ STRPREFIX(opname, "MATERIAL_OT") ||
+ STRPREFIX(opname, "PTCACHE_OT") ||
+ STRPREFIX(opname, "RIGIDBODY_OT"))
+ {
+ km = WM_keymap_find_all(C, "Object Mode", 0, 0);
+ }
+
+ /* Editing Modes */
+ else if (STRPREFIX(opname, "MESH_OT")) {
+ km = WM_keymap_find_all(C, "Mesh", 0, 0);
+
+ /* some mesh operators are active in object mode too, like add-prim */
+ if (km && !WM_keymap_poll((bContext *)C, km)) {
+ km = WM_keymap_find_all(C, "Object Mode", 0, 0);
+ }
+ }
+ else if (STRPREFIX(opname, "CURVE_OT") ||
+ STRPREFIX(opname, "SURFACE_OT"))
+ {
+ km = WM_keymap_find_all(C, "Curve", 0, 0);
+
+ /* some curve operators are active in object mode too, like add-prim */
+ if (km && !WM_keymap_poll((bContext *)C, km)) {
+ km = WM_keymap_find_all(C, "Object Mode", 0, 0);
+ }
+ }
+ else if (STRPREFIX(opname, "ARMATURE_OT") ||
+ STRPREFIX(opname, "SKETCH_OT"))
+ {
+ km = WM_keymap_find_all(C, "Armature", 0, 0);
+ }
+ else if (STRPREFIX(opname, "POSE_OT") ||
+ STRPREFIX(opname, "POSELIB_OT"))
+ {
+ km = WM_keymap_find_all(C, "Pose", 0, 0);
+ }
+ else if (STRPREFIX(opname, "SCULPT_OT")) {
+ switch (CTX_data_mode_enum(C)) {
+ case OB_MODE_SCULPT:
+ km = WM_keymap_find_all(C, "Sculpt", 0, 0);
+ break;
+ case OB_MODE_EDIT:
+ km = WM_keymap_find_all(C, "UV Sculpt", 0, 0);
+ break;
+ }
+ }
+ else if (STRPREFIX(opname, "MBALL_OT")) {
+ km = WM_keymap_find_all(C, "Metaball", 0, 0);
+
+ /* some mball operators are active in object mode too, like add-prim */
+ if (km && !WM_keymap_poll((bContext *)C, km)) {
+ km = WM_keymap_find_all(C, "Object Mode", 0, 0);
+ }
+ }
+ else if (STRPREFIX(opname, "LATTICE_OT")) {
+ km = WM_keymap_find_all(C, "Lattice", 0, 0);
+ }
+ else if (STRPREFIX(opname, "PARTICLE_OT")) {
+ km = WM_keymap_find_all(C, "Particle", 0, 0);
+ }
+ else if (STRPREFIX(opname, "FONT_OT")) {
+ km = WM_keymap_find_all(C, "Font", 0, 0);
+ }
+ /* Paint Face Mask */
+ else if (STRPREFIX(opname, "PAINT_OT_face_select")) {
+ km = WM_keymap_find_all(C, "Face Mask", 0, 0);
+ }
+ else if (STRPREFIX(opname, "PAINT_OT")) {
+ /* check for relevant mode */
+ switch (CTX_data_mode_enum(C)) {
+ case OB_MODE_WEIGHT_PAINT:
+ km = WM_keymap_find_all(C, "Weight Paint", 0, 0);
+ break;
+ case OB_MODE_VERTEX_PAINT:
+ km = WM_keymap_find_all(C, "Vertex Paint", 0, 0);
+ break;
+ case OB_MODE_TEXTURE_PAINT:
+ km = WM_keymap_find_all(C, "Image Paint", 0, 0);
+ break;
+ }
+ }
+ /* Timeline */
+ else if (STRPREFIX(opname, "TIME_OT")) {
+ km = WM_keymap_find_all(C, "Timeline", sl->spacetype, 0);
+ }
+ /* Image Editor */
+ else if (STRPREFIX(opname, "IMAGE_OT")) {
+ km = WM_keymap_find_all(C, "Image", sl->spacetype, 0);
+ }
+ /* Clip Editor */
+ else if (STRPREFIX(opname, "CLIP_OT")) {
+ km = WM_keymap_find_all(C, "Clip", sl->spacetype, 0);
+ }
+ else if (STRPREFIX(opname, "MASK_OT")) {
+ km = WM_keymap_find_all(C, "Mask Editing", 0, 0);
+ }
+ /* UV Editor */
+ else if (STRPREFIX(opname, "UV_OT")) {
+ /* Hack to allow using UV unwrapping ops from 3DView/editmode.
+ * Mesh keymap is probably not ideal, but best place I could find to put those. */
+ if (sl->spacetype == SPACE_VIEW3D) {
+ km = WM_keymap_find_all(C, "Mesh", 0, 0);
+ if (km && !WM_keymap_poll((bContext *)C, km)) {
+ km = NULL;
+ }
+ }
+ if (!km) {
+ km = WM_keymap_find_all(C, "UV Editor", 0, 0);
+ }
+ }
+ /* Node Editor */
+ else if (STRPREFIX(opname, "NODE_OT")) {
+ km = WM_keymap_find_all(C, "Node Editor", sl->spacetype, 0);
+ }
+ /* Animation Editor Channels */
+ else if (STRPREFIX(opname, "ANIM_OT_channels")) {
+ km = WM_keymap_find_all(C, "Animation Channels", 0, 0);
+ }
+ /* Animation Generic - after channels */
+ else if (STRPREFIX(opname, "ANIM_OT")) {
+ km = WM_keymap_find_all(C, "Animation", 0, 0);
+ }
+ /* Graph Editor */
+ else if (STRPREFIX(opname, "GRAPH_OT")) {
+ km = WM_keymap_find_all(C, "Graph Editor", sl->spacetype, 0);
+ }
+ /* Dopesheet Editor */
+ else if (STRPREFIX(opname, "ACTION_OT")) {
+ km = WM_keymap_find_all(C, "Dopesheet", sl->spacetype, 0);
+ }
+ /* NLA Editor */
+ else if (STRPREFIX(opname, "NLA_OT")) {
+ km = WM_keymap_find_all(C, "NLA Editor", sl->spacetype, 0);
+ }
+ /* Script */
+ else if (STRPREFIX(opname, "SCRIPT_OT")) {
+ km = WM_keymap_find_all(C, "Script", sl->spacetype, 0);
+ }
+ /* Text */
+ else if (STRPREFIX(opname, "TEXT_OT")) {
+ km = WM_keymap_find_all(C, "Text", sl->spacetype, 0);
+ }
+ /* Sequencer */
+ else if (STRPREFIX(opname, "SEQUENCER_OT")) {
+ km = WM_keymap_find_all(C, "Sequencer", sl->spacetype, 0);
+ }
+ /* Console */
+ else if (STRPREFIX(opname, "CONSOLE_OT")) {
+ km = WM_keymap_find_all(C, "Console", sl->spacetype, 0);
+ }
+ /* Console */
+ else if (STRPREFIX(opname, "INFO_OT")) {
+ km = WM_keymap_find_all(C, "Info", sl->spacetype, 0);
+ }
+ /* File browser */
+ else if (STRPREFIX(opname, "FILE_OT")) {
+ km = WM_keymap_find_all(C, "File Browser", sl->spacetype, 0);
+ }
+ /* Logic Editor */
+ else if (STRPREFIX(opname, "LOGIC_OT")) {
+ km = WM_keymap_find_all(C, "Logic Editor", sl->spacetype, 0);
+ }
+ /* Outliner */
+ else if (STRPREFIX(opname, "OUTLINER_OT")) {
+ km = WM_keymap_find_all(C, "Outliner", sl->spacetype, 0);
+ }
+ /* Transform */
+ else if (STRPREFIX(opname, "TRANSFORM_OT")) {
+ /* check for relevant editor */
+ switch (sl->spacetype) {
+ case SPACE_VIEW3D:
+ km = WM_keymap_find_all(C, "3D View", sl->spacetype, 0);
+ break;
+ case SPACE_IPO:
+ km = WM_keymap_find_all(C, "Graph Editor", sl->spacetype, 0);
+ break;
+ case SPACE_ACTION:
+ km = WM_keymap_find_all(C, "Dopesheet", sl->spacetype, 0);
+ break;
+ case SPACE_NLA:
+ km = WM_keymap_find_all(C, "NLA Editor", sl->spacetype, 0);
+ break;
+ case SPACE_IMAGE:
+ km = WM_keymap_find_all(C, "UV Editor", 0, 0);
+ break;
+ case SPACE_NODE:
+ km = WM_keymap_find_all(C, "Node Editor", sl->spacetype, 0);
+ break;
+ case SPACE_SEQ:
+ km = WM_keymap_find_all(C, "Sequencer", sl->spacetype, 0);
+ break;
+ }
+ }
+
+ return km;
+}
+
+/** \} */
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 454d7dc57f0..45084980727 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -262,7 +262,7 @@ char *WM_operator_pystring_ex(bContext *C, wmOperator *op, const bool all_args,
}
}
else {
- /* only to get the orginal props for comparisons */
+ /* only to get the original props for comparisons */
PointerRNA opptr_default;
const bool macro_args_test = ot->macro.first ? macro_args : true;
@@ -607,7 +607,7 @@ void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
/** set all props to their default,
* \param do_update Only update un-initialized props.
*
- * \note, theres nothing specific to operators here.
+ * \note, there's nothing specific to operators here.
* this could be made a general function.
*/
bool WM_operator_properties_default(PointerRNA *ptr, const bool do_update)
@@ -768,6 +768,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op)
block = UI_block_begin(C, ar, "_popup", UI_EMBOSS);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
search[0] = '\0';
#if 0 /* ok, this isn't so easy... */
@@ -980,6 +981,8 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
UI_block_flag_disable(block, UI_BLOCK_LOOP);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_REGULAR);
+
/* UI_BLOCK_NUMSELECT for layer buttons */
UI_block_flag_enable(block, UI_BLOCK_NUMSELECT | UI_BLOCK_KEEP_OPEN | UI_BLOCK_MOVEMOUSE_QUIT);
@@ -1064,6 +1067,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData)
block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
UI_block_flag_disable(block, UI_BLOCK_LOOP);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_REGULAR);
/* intentionally don't use 'UI_BLOCK_MOVEMOUSE_QUIT', some dialogues have many items
* where quitting by accident is very annoying */
@@ -1106,6 +1110,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData)
block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
UI_block_flag_disable(block, UI_BLOCK_LOOP);
UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_MOVEMOUSE_QUIT);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_REGULAR);
layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, 0, style);
@@ -1433,6 +1438,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
* with the OS when the splash shows, window clipping in this case gives
* ugly results and clipping the splash isn't useful anyway, just disable it [#32938] */
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_KEEP_OPEN | UI_BLOCK_NO_WIN_CLIP);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
/* XXX splash scales with pixelsize, should become widget-units */
but = uiDefBut(block, UI_BTYPE_IMAGE, 0, "", 0, 0.5f * U.widget_unit, U.pixelsize * 501, U.pixelsize * 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */
@@ -1582,6 +1588,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *userdata)
block = UI_block_begin(C, ar, "_popup", UI_EMBOSS);
UI_block_flag_enable(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, init_data->size[0], UI_UNIT_Y, 0, 0, "");
UI_but_func_operator_search(but);
@@ -3320,7 +3327,7 @@ static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf)
/* default keymap for windows and screens, only call once per WM */
void wm_window_keymap(wmKeyConfig *keyconf)
{
- wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0);
+ wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Window", 0, 0);
wmKeyMapItem *kmi;
/* note, this doesn't replace existing keymap items */
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index f6ebdae8414..04a236e5d66 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -102,8 +102,9 @@ static struct WMInitStruct {
int windowstate;
WinOverrideFlag override_flag;
+ bool window_focus;
bool native_pixels;
-} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true};
+} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true, true};
/* ******** win open & close ************ */
@@ -345,6 +346,7 @@ static uiBlock *block_create_confirm_quit(struct bContext *C, struct ARegion *ar
uiBlock *block = UI_block_begin(C, ar, "confirm_quit_popup", UI_EMBOSS);
UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_LOOP | UI_BLOCK_NO_WIN_CLIP | UI_BLOCK_NUMSELECT);
+ UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP);
UI_block_emboss_set(block, UI_EMBOSS);
uiLayout *layout = UI_block_layout(
@@ -623,7 +625,9 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
#ifndef __APPLE__
/* set the state here, so minimized state comes up correct on windows */
- GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate);
+ if (wm_init_state.window_focus) {
+ GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate);
+ }
#endif
/* until screens get drawn, make it nice gray */
glClearColor(0.55, 0.55, 0.55, 0.0);
@@ -719,13 +723,13 @@ void wm_window_ghostwindows_ensure(wmWindowManager *wm)
win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
/* add keymap handlers (1 handler for all keys in map!) */
- keymap = WM_keymap_find(wm->defaultconf, "Window", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Window", 0, 0);
WM_event_add_keymap_handler(&win->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Screen", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Screen", 0, 0);
WM_event_add_keymap_handler(&win->handlers, keymap);
- keymap = WM_keymap_find(wm->defaultconf, "Screen Editing", 0, 0);
+ keymap = WM_keymap_ensure(wm->defaultconf, "Screen Editing", 0, 0);
WM_event_add_keymap_handler(&win->modalhandlers, keymap);
/* add drop boxes */
@@ -808,7 +812,7 @@ wmWindow *WM_window_open_temp(bContext *C, int x, int y, int sizex, int sizey, i
sizex /= native_pixel_size;
sizey /= native_pixel_size;
- /* calculate postition */
+ /* calculate position */
rcti rect;
rect.xmin = x + win_prev->posx - sizex / 2;
rect.ymin = y + win_prev->posy - sizey / 2;
@@ -1467,7 +1471,7 @@ static int wm_window_timer(const bContext *C)
else if (wt->event_type == TIMERAUTOSAVE)
wm_autosave_timer(C, wm, wt);
else if (wt->event_type == TIMERNOTIFIER)
- WM_main_add_notifier(GET_UINT_FROM_POINTER(wt->customdata), NULL);
+ WM_main_add_notifier(POINTER_AS_UINT(wt->customdata), NULL);
else if (win) {
wmEvent event;
wm_event_init_from_window(win, &event);
@@ -1545,6 +1549,8 @@ void wm_ghost_init(bContext *C)
if (wm_init_state.native_pixels) {
GHOST_UseNativePixels();
}
+
+ GHOST_UseWindowFocus(wm_init_state.window_focus);
}
}
@@ -1597,7 +1603,7 @@ wmTimer *WM_event_add_timer_notifier(wmWindowManager *wm, wmWindow *win, unsigne
wt->stime = wt->ltime;
wt->timestep = timestep;
wt->win = win;
- wt->customdata = SET_UINT_IN_POINTER(type);
+ wt->customdata = POINTER_FROM_UINT(type);
wt->flags |= WM_TIMER_NO_FREE_CUSTOM_DATA;
BLI_addtail(&wm->timers, wt);
@@ -1831,6 +1837,11 @@ void WM_init_state_normal_set(void)
wm_init_state.override_flag |= WIN_OVERRIDE_WINSTATE;
}
+void WM_init_window_focus_set(bool do_it)
+{
+ wm_init_state.window_focus = do_it;
+}
+
void WM_init_native_pixels(bool do_it)
{
wm_init_state.native_pixels = do_it;
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 55f29ccb048..cee7d6aab0e 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -26,9 +26,8 @@
/*
- * These define have its origin at sgi, where all device defines were written down in device.h.
- * Blender copied the conventions quite some, and expanded it with internal new defines (ton)
- *
+ * These define have its origin at sgi, where all device defines were written down in device.h.
+ * Blender copied the conventions quite some, and expanded it with internal new defines (ton)
*/