Merge branch 'blender2.8' into blender2.8-workbench
authorJeroen Bakker <j.bakker@atmind.nl>
Mon, 16 Apr 2018 06:20:12 +0000 (08:20 +0200)
committerJeroen Bakker <j.bakker@atmind.nl>
Mon, 16 Apr 2018 06:20:12 +0000 (08:20 +0200)
140 files changed:
doc/python_api/rst/bge.constraints.rst
doc/python_api/rst/bge.types.rst
doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst
doc/python_api/rst/bge_types/bge.types.BL_ArmatureActuator.rst
doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst
doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst
doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst
doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst
doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst
doc/python_api/rst/bge_types/bge.types.CListValue.rst
doc/python_api/rst/bge_types/bge.types.CPropValue.rst
doc/python_api/rst/bge_types/bge.types.CValue.rst
doc/python_api/rst/bge_types/bge.types.KX_ArmatureSensor.rst
doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst
doc/python_api/rst/bge_types/bge.types.KX_Camera.rst
doc/python_api/rst/bge_types/bge.types.KX_CameraActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_CharacterWrapper.rst
doc/python_api/rst/bge_types/bge.types.KX_ConstraintActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst
doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst
doc/python_api/rst/bge_types/bge.types.KX_GameActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
doc/python_api/rst/bge_types/bge.types.KX_LibLoadStatus.rst
doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst
doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst
doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_MouseFocusSensor.rst
doc/python_api/rst/bge_types/bge.types.KX_NavMeshObject.rst
doc/python_api/rst/bge_types/bge.types.KX_NearSensor.rst
doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageSensor.rst
doc/python_api/rst/bge_types/bge.types.KX_ObjectActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_ParentActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_PolyProxy.rst
doc/python_api/rst/bge_types/bge.types.KX_RadarSensor.rst
doc/python_api/rst/bge_types/bge.types.KX_RaySensor.rst
doc/python_api/rst/bge_types/bge.types.KX_SCA_AddObjectActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_SCA_DynamicActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_SCA_EndObjectActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_Scene.rst
doc/python_api/rst/bge_types/bge.types.KX_SceneActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_SoundActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_StateActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_SteeringActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_TouchSensor.rst
doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_VehicleWrapper.rst
doc/python_api/rst/bge_types/bge.types.KX_VertexProxy.rst
doc/python_api/rst/bge_types/bge.types.KX_VisibilityActuator.rst
doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst
doc/python_api/rst/bge_types/bge.types.PyObjectPlus.rst
doc/python_api/rst/bge_types/bge.types.SCA_2DFilterActuator.rst
doc/python_api/rst/bge_types/bge.types.SCA_ANDController.rst
doc/python_api/rst/bge_types/bge.types.SCA_ActuatorSensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_AlwaysSensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_DelaySensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_IActuator.rst
doc/python_api/rst/bge_types/bge.types.SCA_IController.rst
doc/python_api/rst/bge_types/bge.types.SCA_ILogicBrick.rst
doc/python_api/rst/bge_types/bge.types.SCA_IObject.rst
doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_JoystickSensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_KeyboardSensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_MouseSensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_NANDController.rst
doc/python_api/rst/bge_types/bge.types.SCA_NORController.rst
doc/python_api/rst/bge_types/bge.types.SCA_ORController.rst
doc/python_api/rst/bge_types/bge.types.SCA_PropertyActuator.rst
doc/python_api/rst/bge_types/bge.types.SCA_PropertySensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_PythonController.rst
doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst
doc/python_api/rst/bge_types/bge.types.SCA_PythonKeyboard.rst
doc/python_api/rst/bge_types/bge.types.SCA_PythonMouse.rst
doc/python_api/rst/bge_types/bge.types.SCA_RandomActuator.rst
doc/python_api/rst/bge_types/bge.types.SCA_RandomSensor.rst
doc/python_api/rst/bge_types/bge.types.SCA_XNORController.rst
doc/python_api/rst/bge_types/bge.types.SCA_XORController.rst
intern/clog/clog.c
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/BKE_undo_system.h
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/undo_system.c
source/blender/blenloader/BLO_undofile.h
source/blender/blenloader/intern/undofile.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/ArmatureImporter.cpp
source/blender/compositor/operations/COM_VectorBlurOperation.cpp
source/blender/draw/CMakeLists.txt
source/blender/draw/engines/eevee/eevee_lights.c
source/blender/draw/engines/eevee/eevee_materials.c
source/blender/draw/engines/eevee/eevee_private.h
source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
source/blender/draw/engines/eevee/shaders/shadow_copy_frag.glsl
source/blender/draw/engines/eevee/shaders/shadow_geom.glsl [deleted file]
source/blender/draw/engines/eevee/shaders/shadow_store_frag.glsl
source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
source/blender/draw/intern/DRW_render.h
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager_exec.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/armature/armature_add.c
source/blender/editors/armature/armature_edit.c
source/blender/editors/armature/armature_naming.c
source/blender/editors/armature/armature_relations.c
source/blender/editors/armature/armature_select.c
source/blender/editors/armature/armature_skinning.c
source/blender/editors/armature/armature_utils.c
source/blender/editors/armature/editarmature_generate.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/armature/meshlaplacian.h
source/blender/editors/armature/pose_select.c
source/blender/editors/armature/pose_transform.c
source/blender/editors/include/ED_armature.h
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_widgets.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_transform.c
source/blender/editors/screen/screen_context.c
source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/undo/memfile_undo.c
source/blender/editors/util/ed_transverts.c
source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_armature_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/python/generic/bgl.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index ed965c3dfc1d8bdfbfc21a7dd37e10204ac30636..3cca22e9cff4d5d236e28d273979282655cb4d79 100644 (file)
@@ -2,12 +2,33 @@
 Physics Constraints (bge.constraints)
 =====================================
 
+Bullet Physics provides collision detection
+and rigid body dynamics for the Blender Game Engine.
+
+Features:
+
+- Vehicle simulation.
+- Rigid body constraints: hinge and point to point (ball socket).
+- Access to internal physics settings,
+  like deactivation time, and debugging features
+
 .. module:: bge.constraints
 
+.. note:: Note about parameter settings
+
+   Since this API is not well documented, it can be unclear what kind of values to use for setting parameters.
+   In general, damping settings should be in the range of 0 to 1 and
+   stiffness settings should not be much higher than about 10.
+
 
 Examples
 --------
 
+.. seealso::
+
+   For more examples of Bullet physics and how to use them
+   see the `pybullet forum <https://pybullet.org/Bullet/phpBB3/viewforum.php?f=17>`__.
+
 .. include:: __/examples/bge.constraints.py
    :start-line: 1
    :end-line: 4
@@ -333,4 +354,3 @@ Constraint type to be used with :func:`createConstraint`.
 .. data:: GENERIC_6DOF_CONSTRAINT
 
    .. to do
-
index f24cc3f998c9a05f0b851de0ed13ab03d75a7d7e..b043f53e4138a18d9e15e476c1c12c78b0f8d87e 100644 (file)
@@ -35,4 +35,3 @@ Types
    :glob:
 
    bge.types.*
-
index 9b95a5ba6119ae3daa69f2971f58f796ae15ab39..c761a0d4e4462be3d1323a4a8629bfbdaaa5650c 100644 (file)
@@ -1,8 +1,6 @@
 BL_ActionActuator(SCA_IActuator)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: BL_ActionActuator(SCA_IActuator)
@@ -75,4 +73,3 @@ base class --- :class:`SCA_IActuator`
       The name of the property that is set to the current frame number.
 
       :type: string
-
index 579186ac1d6482a2da8dcd1df1db7b19e96949ad..d60782dde32c219eff628753bcb82adf1be048dc 100644 (file)
@@ -1,8 +1,6 @@
 BL_ArmatureActuator(SCA_IActuator)
 ==================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: BL_ArmatureActuator(SCA_IActuator)
@@ -58,4 +56,3 @@ base class --- :class:`SCA_IActuator`
       The influence this actuator will set on the constraint it controls.
 
       :type: float.
-
index 14a9ebe9ef3834d812ce26008e1511863dd1f901..0200c9c513bddcca115407cfb7c7135ecb391829 100644 (file)
@@ -1,8 +1,6 @@
 BL_ArmatureBone(PyObjectPlus)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: BL_ArmatureBone(PyObjectPlus)
index 07220534b2852cc239155a44a60f43baa2065a7d..d8fcfa8cbe49d3273c7656165e145fff737a1056 100644 (file)
@@ -1,8 +1,6 @@
 BL_ArmatureChannel(PyObjectPlus)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: BL_ArmatureChannel(PyObjectPlus)
@@ -275,4 +273,3 @@ base class --- :class:`PyObjectPlus`
       .. note::
       
          You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
-
index 1a4370945c1c670ddc5a6a7cf075c63ff578bb29..8a62d2d688ffaf242e6a6590ce618ac59ea01ccb 100644 (file)
@@ -1,8 +1,6 @@
 BL_ArmatureConstraint(PyObjectPlus)
 ===================================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: BL_ArmatureConstraint(PyObjectPlus)
@@ -126,4 +124,3 @@ base class --- :class:`PyObjectPlus`
       Additional mode for IK constraint. Currently only used for Distance constraint:
 
       :type: integer
-
index 8389affe8a90c165031e32feae277bf41f246f0b..336ae29daacc08348e20997b8ff57cb41897b151 100644 (file)
@@ -1,8 +1,6 @@
 BL_ArmatureObject(KX_GameObject)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`KX_GameObject`
 
 .. class:: BL_ArmatureObject(KX_GameObject)
@@ -31,4 +29,3 @@ base class --- :class:`KX_GameObject`
       This action is unecessary if a KX_ArmatureActuator with mode run is active
       or if an action is playing. Use this function in other cases. It must be called
       on each frame to ensure that the armature is updated continously.
-
index a389f68ee0480a97b4764371a132ba04374b3c9f..535449784824fb30243fe74166aee1606ed2c528 100644 (file)
@@ -1,8 +1,6 @@
 BL_Shader(PyObjectPlus)
 =======================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: BL_Shader(PyObjectPlus)
@@ -227,4 +225,3 @@ base class --- :class:`PyObjectPlus`
    .. method:: validate()
 
       Validate the shader object.
-
index 4bb3d273cb91b4c0aba0b030d7cde53a3127f553..4c8d113ad87669e9062e58bb64be76f6b6f69626 100644 (file)
@@ -1,8 +1,6 @@
 BL_ShapeActionActuator(SCA_IActuator)
 =====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: BL_ShapeActionActuator(SCA_IActuator)
index ca4cdc44bf5b3dbb49f615ec3eca1b7e1dc7ab46..e47cf351f604eef81658cad7dfab3f2ea212b594 100644 (file)
@@ -1,8 +1,6 @@
 CListValue(CPropValue)
 ======================
 
-.. module:: bge.types
-
 base class --- :class:`CPropValue`
 
 .. class:: CListValue(CPropValue)
@@ -69,4 +67,3 @@ base class --- :class:`CPropValue`
       .. warning::
 
          The id can't be stored as an integer in game object properties, as those only have a limited range that the id may not be contained in. Instead an id can be stored as a string game property and converted back to an integer for use in from_id lookups.
-
index 7be28c1e006eb3b53fd84acf8583045624859ee5..67fc2c4fafd8a91b6afe3bf45a5a0845337daa07 100644 (file)
@@ -1,11 +1,8 @@
 CPropValue(CValue)
 ==================
 
-.. module:: bge.types
-
 base class --- :class:`CValue`
 
 .. class:: CPropValue(CValue)
 
    This class has no python functions
-
index 52906de5576bd55574a88df1eb8db78331a2d582..3255471daf2020a6686e986b304e4ef149bb8e9f 100644 (file)
@@ -1,8 +1,6 @@
 CValue(PyObjectPlus)
 ====================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: CValue(PyObjectPlus)
index a7123eb5c9d1f4b2d502d86f86dcbaee5dfa36c7..ca617395a69c1171a88567a6f1f1e4455cfd9184 100644 (file)
@@ -1,8 +1,6 @@
 KX_ArmatureSensor(SCA_ISensor)
 ==============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: KX_ArmatureSensor(SCA_ISensor)
index ece2a65af719be1f38d0bff8c70e5ff595aa6e23..fd3bbc58a7cb74171e9e0af573910d2f34f5e171 100644 (file)
@@ -1,8 +1,6 @@
 KX_BlenderMaterial(PyObjectPlus)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: KX_BlenderMaterial(PyObjectPlus)
@@ -182,4 +180,3 @@ base class --- :class:`PyObjectPlus`
 
       :return: the material's index
       :rtype: integer
-
index ac5ab4b5fe5acddab1dcefc55ac1a8d92c5ed649..8c8c68fc05158d28403f93acdc0f68c0149109cd 100644 (file)
@@ -1,8 +1,6 @@
 KX_Camera(KX_GameObject)
 ========================
 
-.. module:: bge.types
-
 base class --- :class:`KX_GameObject`
 
 .. class:: KX_Camera(KX_GameObject)
index bc5efed4b08045a0d9f32b88675c235863b72b06..14cf1e470706f8f70996efcfdd7f7fae68c379f2 100644 (file)
@@ -1,8 +1,6 @@
 KX_CameraActuator(SCA_IActuator)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_CameraActuator(SCA_IActuator)
@@ -44,4 +42,3 @@ base class --- :class:`SCA_IActuator`
       the object this actuator tracks.
 
       :type: :class:`KX_GameObject` or None
-
index adff6e0a2ad5dff735cc847491cc0d9d8cdbba47..df95b842b5d4b2d1507ce81f4d2d906249b0256a 100644 (file)
@@ -1,8 +1,6 @@
 KX_CharacterWrapper(PyObjectPlus)
 =================================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: KX_CharacterWrapper(PyObjectPlus)
@@ -42,4 +40,3 @@ base class --- :class:`PyObjectPlus`
    .. method:: jump()
 
       The character jumps based on it's jump speed.
-
index 498990449fe607ec5a130efcf203c169a8aaaae0..56c87cc110ecf547eb506896003b4e012ebf547c 100644 (file)
@@ -1,8 +1,6 @@
 KX_ConstraintActuator(SCA_IActuator)
 ====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_ConstraintActuator(SCA_IActuator)
index d9f03395c34877068d410da45706c7c335dd7f18..77eec6bde78787b5c698f8d2a96d361eaa330fd4 100644 (file)
@@ -1,8 +1,6 @@
 KX_ConstraintWrapper(PyObjectPlus)
 ==================================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: KX_ConstraintWrapper(PyObjectPlus)
@@ -140,4 +138,3 @@ base class --- :class:`PyObjectPlus`
          - :class:`~bge.constraints.CONETWIST_CONSTRAINT`
          - :class:`~bge.constraints.VEHICLE_CONSTRAINT`
          - :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
-
index ca35ff49a0828ff910ffe4778cbc995928447747..f02609af0faf98973f6d55fbbcf6a81812d0804c 100644 (file)
@@ -1,8 +1,6 @@
 KX_FontObject(KX_GameObject)
 ============================
 
-.. module:: bge.types
-
 base class --- :class:`KX_GameObject`
 
 .. class:: KX_FontObject(KX_GameObject)
@@ -29,4 +27,3 @@ base class --- :class:`KX_GameObject`
       The text displayed by this Font object.
 
       :type: string
-
index 54702c5318ddd792b49097c7b1aa249b5edf8901..a36c49d57e29049eabb0964f476fc5c33ef8d752 100644 (file)
@@ -1,8 +1,6 @@
 KX_GameActuator(SCA_IActuator)
 ==============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_GameActuator(SCA_IActuator)
@@ -20,4 +18,3 @@ base class --- :class:`SCA_IActuator`
       The mode of this actuator. Can be on of :ref:`these constants <game-actuator>`
 
       :type: Int
-
index c5729fd5b197ad41dbc479858f02e975d6f972c6..2797e8ef3612f0443ffa3f1c79ea0fbed197a582 100644 (file)
@@ -1,8 +1,6 @@
 KX_GameObject(SCA_IObject)
 ==========================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IObject`
 
 .. class:: KX_GameObject(SCA_IObject)
index a37b4dad5857d71cdbfd09e4d907a6098741d786..3e7d370476e3837e9cd0c3cb6be2873d3472d20f 100644 (file)
@@ -1,8 +1,6 @@
 KX_LibLoadStatus(PyObjectPlus)
 ==============================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: KX_LibLoadStatus(PyObjectPlus)
@@ -48,4 +46,3 @@ base class --- :class:`PyObjectPlus`
       The amount of time, in seconds, the lib load took (0 until the operation is complete).
 
       :type: float
-
index 6748df13873b1ca9d922413f3f086c0fb56dd01c..ca4e4eaf1b350165c1603ac0b2bc983f8277362c 100644 (file)
@@ -1,8 +1,6 @@
 KX_LightObject(KX_GameObject)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`KX_GameObject`
 
 .. class:: KX_LightObject(KX_GameObject)
@@ -161,4 +159,3 @@ base class --- :class:`KX_GameObject`
       .. note::
          
          Higher values result in a more focused light source.
-
index 13fb3263a59a4e6e5cc334499d807b112c058760..c009db17e4d275a0d026db745847783d99feb9d0 100644 (file)
@@ -1,8 +1,6 @@
 KX_MeshProxy(SCA_IObject)
 =========================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IObject`
 
 .. class:: KX_MeshProxy(SCA_IObject)
@@ -131,4 +129,3 @@ base class --- :class:`SCA_IObject`
       :type uv_index: integer
       :arg uv_index_from: optional uv index to copy from, -1 to transform the current uv.
       :type uv_index_from: integer
-
index cc3ce49d0a50446595e2157fc0a37f1d437344ac..e0fe32baa2b3068533413abdd31f8e854e56d731 100644 (file)
@@ -1,8 +1,6 @@
 KX_MouseActuator(SCA_IActuator)
 ====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_MouseActuator(SCA_IActuator)
@@ -100,4 +98,3 @@ base class --- :class:`SCA_IActuator`
       The current rotational offset caused by the mouse actuator in degrees.
 
       :type: list (vector of 2 floats)
-
index 0600a4b5aae9d745b6d474442d10dcaaf73011b9..1d7eb007c1e31e57c649d0498b51a729b63d127e 100644 (file)
@@ -1,8 +1,6 @@
 KX_MouseFocusSensor(SCA_MouseSensor)
 ====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_MouseSensor`
 
 .. class:: KX_MouseFocusSensor(SCA_MouseSensor)
index 5c73d0aa1d32f7ef97882d26445c3d7d532f3813..00d51108937abbc51d4266ea058ccb43578b48a7 100644 (file)
@@ -1,8 +1,6 @@
 KX_NavMeshObject(KX_GameObject)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`KX_GameObject`
 
 .. class:: KX_NavMeshObject(KX_GameObject)
@@ -44,4 +42,3 @@ base class --- :class:`KX_GameObject`
       Rebuild the navigation mesh.
 
       :return: None
-
index 995e645b979af69e2a26758a6fc306846997af94..91969dfc79d63052f8818013dc5928f2a739d745 100644 (file)
@@ -1,8 +1,6 @@
 KX_NearSensor(KX_TouchSensor)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`KX_TouchSensor`
 
 .. class:: KX_NearSensor(KX_TouchSensor)
@@ -20,4 +18,3 @@ base class --- :class:`KX_TouchSensor`
       The near sensor deactivates when the object exceeds this distance.
 
       :type: float
-
index b8dcd01fe438203c1a24ea4235b11224db0f6336..525289ae71fc8b580bf88496f7a03c8c129804f5 100644 (file)
@@ -1,8 +1,6 @@
 KX_NetworkMessageActuator(SCA_IActuator)
 ========================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_NetworkMessageActuator(SCA_IActuator)
@@ -32,4 +30,3 @@ base class --- :class:`SCA_IActuator`
       Send a property instead of a regular body message.
 
       :type: boolean
-
index a6b1082a4feb73587ebb7c210e9562376af07727..a732c1e48f78f2895bd6e7de053ab693f74a20fb 100644 (file)
@@ -1,8 +1,6 @@
 KX_NetworkMessageSensor(SCA_ISensor)
 ====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: KX_NetworkMessageSensor(SCA_ISensor)
@@ -34,5 +32,3 @@ base class --- :class:`SCA_ISensor`
       The list of message bodies received. (read-only).
 
       :type: list of strings
-
-
index 347b000be3d62fe19b54111e895bc8e80ac1ede8..f3948578cd513c12690281dcf83010359732f08e 100644 (file)
@@ -1,8 +1,6 @@
 KX_ObjectActuator(SCA_IActuator)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_ObjectActuator(SCA_IActuator)
@@ -126,4 +124,3 @@ base class --- :class:`SCA_IActuator`
       The object that is used as reference to compute the velocity for the servo controller.
 
       :type: :class:`KX_GameObject` or None
-
index 77dcb907d6ac876804ff81e88e3417ff4b990adc..13f4bcb76154bb656cafc094ae1725d3c1f5cd28 100644 (file)
@@ -1,8 +1,6 @@
 KX_ParentActuator(SCA_IActuator)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_ParentActuator(SCA_IActuator)
@@ -35,4 +33,3 @@ base class --- :class:`SCA_IActuator`
       Effective only if the shape is not added to the parent compound shape.
 
       :type: boolean
-
index f43cf62eec1405baada026261a3199c8c6b79b88..68baff8d45c9d42467d427c674c1328c24143027 100644 (file)
@@ -1,8 +1,6 @@
 KX_PolyProxy(SCA_IObject)
 =========================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IObject`
 
 .. class:: KX_PolyProxy(SCA_IObject)
@@ -136,4 +134,3 @@ base class --- :class:`SCA_IObject`
 
       :return: mesh proxy
       :rtype: :class:`MeshProxy`
-
index 4274c1142f458c59d9080f34da169cdaa69d3516..82028cfc186124888e3eed8819e343455a814ae2 100644 (file)
@@ -1,8 +1,6 @@
 KX_RadarSensor(KX_NearSensor)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`KX_NearSensor`
 
 .. class:: KX_RadarSensor(KX_NearSensor)
@@ -41,4 +39,3 @@ base class --- :class:`KX_NearSensor`
 
       KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, 
       KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z
-
index f182a84409f3c87dd4caa3c16e867d802889a891..75e171dd61243cd0bac78ed0ca0660d36849dfe8 100644 (file)
@@ -1,8 +1,6 @@
 KX_RaySensor(SCA_ISensor)
 =========================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: KX_RaySensor(SCA_ISensor)
@@ -75,4 +73,3 @@ base class --- :class:`SCA_ISensor`
       * KX_RAY_AXIS_NEG_X
       * KX_RAY_AXIS_NEG_Y
       * KX_RAY_AXIS_NEG_Z
-
index fecc863909dde29b572bac2b35daf96e1261a6dd..9b7d2ad874ad072ea6721c331e67ea72649ea94a 100644 (file)
@@ -1,8 +1,6 @@
 KX_SCA_AddObjectActuator(SCA_IActuator)
 =======================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_SCA_AddObjectActuator(SCA_IActuator)
@@ -52,4 +50,3 @@ base class --- :class:`SCA_IActuator`
       adds the object without needing to calling SCA_PythonController.activate()
 
       .. note:: Use objectLastCreated to get the newly created object.
-
index 055c409825311403a064ba8be4e21db561462210..822c343aacd548b0054ffd92290a993189fedce9 100644 (file)
@@ -1,8 +1,6 @@
 KX_SCA_DynamicActuator(SCA_IActuator)
 =====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_SCA_DynamicActuator(SCA_IActuator)
@@ -26,4 +24,3 @@ base class --- :class:`SCA_IActuator`
       the mass value for the KX_DYN_SET_MASS operation.
 
       :type: float
-
index 8d9221febb0f161d33b27645e3eac529369647c9..3a414df9493a18ea8a3f6fe7d2891d1e069f1786 100644 (file)
@@ -1,8 +1,6 @@
 KX_SCA_EndObjectActuator(SCA_IActuator)
 =======================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_SCA_EndObjectActuator(SCA_IActuator)
@@ -10,4 +8,3 @@ base class --- :class:`SCA_IActuator`
    Edit Object Actuator (in End Object mode)
 
    This actuator has no python methods.
-
index 137c63ea829408ff1f1c19a09368d99d9b170e32..8a88dff99b940935a9a35b3d8bd09954ba7b1241 100644 (file)
@@ -1,8 +1,6 @@
 KX_SCA_ReplaceMeshActuator(SCA_IActuator)
 =========================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_SCA_ReplaceMeshActuator(SCA_IActuator)
@@ -86,4 +84,3 @@ base class --- :class:`SCA_IActuator`
    .. method:: instantReplaceMesh()
 
       Immediately replace mesh without delay.
-
index 5bd8e3a77decdde8f653d1af4981af0479daebb2..7e632d2c8d45e40cc24edb5157231dbe6b540099 100644 (file)
@@ -1,8 +1,6 @@
 KX_Scene(PyObjectPlus)
 ======================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: KX_Scene(PyObjectPlus)
@@ -183,4 +181,3 @@ base class --- :class:`PyObjectPlus`
    .. method:: drawObstacleSimulation()
 
       Draw debug visualization of obstacle simulation.
-
index 9d073ff5b19718b0e8223045180f550de783ed38..b6aeaff282c2dc2792b301faafde4bf9c69c0bf2 100644 (file)
@@ -1,8 +1,6 @@
 KX_SceneActuator(SCA_IActuator)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_SceneActuator(SCA_IActuator)
@@ -46,4 +44,3 @@ base class --- :class:`SCA_IActuator`
       The mode of the actuator.
 
       :type: integer from 0 to 5.
-
index aa85bd663b894adab27fc87aac8c9b907810cba1..d6d258b40d50ae52bf7de373ad8b566228171ccf 100644 (file)
@@ -1,8 +1,6 @@
 KX_SoundActuator(SCA_IActuator)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_SoundActuator(SCA_IActuator)
@@ -112,4 +110,3 @@ base class --- :class:`SCA_IActuator`
       Stops the sound.
 
       :return: None
-
index c9d08457cc694f5707aa5c8afe8f6b1005aa994b..7dbe47276fd575ca777b0cb81279baa67e9c8460 100644 (file)
@@ -1,8 +1,6 @@
 KX_StateActuator(SCA_IActuator)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_StateActuator(SCA_IActuator)
@@ -26,4 +24,3 @@ base class --- :class:`SCA_IActuator`
       The bits that are 0 are will be left unmodified expect for the Copy operation which copies the mask to the object state.
 
       :type: integer
-
index f0ce248f06933d4e4edf815e56e7afff88ebae29..9e2f2a427a13eea0c13bc39f7b25819a4adfa37e 100644 (file)
@@ -1,8 +1,6 @@
 KX_SteeringActuator(SCA_IActuator)
 ==================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_SteeringActuator(SCA_IActuator)
@@ -68,4 +66,3 @@ base class --- :class:`SCA_IActuator`
       Path update period
 
       :type: int
-
index 876d14bc6c87bf749f8465c172aa341439978c17..79fd1a63151837bb07d5e32ed03503b07208f5e6 100644 (file)
@@ -1,8 +1,6 @@
 KX_TouchSensor(SCA_ISensor)
 ===========================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: KX_TouchSensor(SCA_ISensor)
@@ -44,4 +42,3 @@ base class --- :class:`SCA_ISensor`
       The material of the object in the face hit by the ray. (read-only).
 
       :type: string
-
index 5b5c5d0c0db65d80e3930b5d768c01aee5536472..fd80c547ce34bd4519c62f452f9112514af55379 100644 (file)
@@ -1,8 +1,6 @@
 KX_TrackToActuator(SCA_IActuator)
 =================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_TrackToActuator(SCA_IActuator)
index 631075363ca232201027f520b668216ccae940f7..0d7b7103ba432328c3a241d34907d6f17f80bc82 100644 (file)
@@ -1,8 +1,6 @@
 KX_VehicleWrapper(PyObjectPlus)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: KX_VehicleWrapper(PyObjectPlus)
@@ -163,4 +161,3 @@ base class --- :class:`PyObjectPlus`
 
       :arg wheelIndex: the wheel index
       :type wheelIndex: integer
-
index 73d692770d635ba709cbaa2bba26340d84f9581e..f6b52affa2745fc65cd6b7b00fbb51a6f6940e45 100644 (file)
@@ -1,8 +1,6 @@
 KX_VertexProxy(SCA_IObject)
 ===========================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IObject`
 
 .. class:: KX_VertexProxy(SCA_IObject)
@@ -206,4 +204,3 @@ base class --- :class:`SCA_IObject`
       :type:  sequence of floats [r, g, b]
 
       :arg normal: the new normal of this vertex.
-
index 4beb6539e0e3ed59c0bdc89e72b3a0593ae6c214..fc6c042e5b1e8117e29d003748e0a0987863a8de 100644 (file)
@@ -1,8 +1,6 @@
 KX_VisibilityActuator(SCA_IActuator)
 ====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: KX_VisibilityActuator(SCA_IActuator)
@@ -26,4 +24,3 @@ base class --- :class:`SCA_IActuator`
       whether the visibility/occlusion should be propagated to all children of the object.
 
       :type: boolean
-
index 1501d85b86c0cc0eff98f4f9ada2cb61b2565399..d96d1c1190fc5f8be383c015a05a874f7c543e48 100644 (file)
@@ -1,8 +1,6 @@
 KX_WorldInfo(PyObjectPlus)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: KX_WorldInfo(PyObjectPlus)
index e035f457a96b304d8d8f0dd37b3907107c5b8419..4c8ddb9bcf5e96533cf0b5592e98686cb84ecdce 100644 (file)
@@ -1,8 +1,6 @@
 PyObjectPlus
 ============
 
-.. module:: bge.types
-
 .. class:: PyObjectPlus
 
    PyObjectPlus base class of most other types in the Game Engine.
@@ -18,4 +16,3 @@ PyObjectPlus
       The invalid attribute allows testing for this case without exception handling.
 
       :type: boolean
-
index 0a6c5fc902534a4a8e93019692c0eec12ab5cde1..b4c00ff01816f733c3cbb5531663529d8cd233b7 100644 (file)
@@ -1,8 +1,6 @@
 SCA_2DFilterActuator(SCA_IActuator)
 ===================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: SCA_2DFilterActuator(SCA_IActuator)
@@ -46,4 +44,3 @@ base class --- :class:`SCA_IActuator`
       argument for motion blur filter.
 
       :type: float (0.0-100.0)
-
index 0942f715231fb4888511073e4febf2b18b6e3a61..abef7dd5cb3b955b517290eaa6f555c263938422 100644 (file)
@@ -1,8 +1,6 @@
 SCA_ANDController(SCA_IController)
 ==================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IController`
 
 .. class:: SCA_ANDController(SCA_IController)
@@ -10,4 +8,3 @@ base class --- :class:`SCA_IController`
    An AND controller activates only when all linked sensors are activated.
 
    There are no special python methods for this controller.
-
index 54916389298a473b72e04c21e99201c257e7ab75..cc89fd192c2f0146989fb336d94f1a50ade4a0c0 100644 (file)
@@ -1,8 +1,6 @@
 SCA_ActuatorSensor(SCA_ISensor)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_ActuatorSensor(SCA_ISensor)
@@ -16,4 +14,3 @@ base class --- :class:`SCA_ISensor`
       the name of the actuator that the sensor is monitoring.
 
       :type: string
-
index a217b114d629b991766ea4dfc540e91f680c596c..2a654a2bf389ab34d0cd96e8004b1fcbb05f13ef 100644 (file)
@@ -1,11 +1,8 @@
 SCA_AlwaysSensor(SCA_ISensor)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_AlwaysSensor(SCA_ISensor)
 
    This sensor is always activated.
-
index ce2b8e52eec664eefca4e82a55eec0b10e956418..34bdc4da44e2e25b347844d5230cec3f961522c1 100644 (file)
@@ -1,8 +1,6 @@
 SCA_DelaySensor(SCA_ISensor)
 ============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_DelaySensor(SCA_ISensor)
@@ -36,4 +34,3 @@ base class --- :class:`SCA_ISensor`
       1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
 
       :type: integer
-
index 1432d5166ef4d91d6ac13d2e32e5a6a5d388ddb1..b6afe4acc2f853b6572761386c6f34d8a94c154f 100644 (file)
@@ -1,11 +1,8 @@
 SCA_IActuator(SCA_ILogicBrick)
 ==============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ILogicBrick`
 
 .. class:: SCA_IActuator(SCA_ILogicBrick)
 
    Base class for all actuator logic bricks.
-
index 5eb225ed329833e788d7ed38629d94052580c7e8..4532070c814f0f38665de5f4de89d56f12bfdad1 100644 (file)
@@ -1,8 +1,6 @@
 SCA_IController(SCA_ILogicBrick)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ILogicBrick`
 
 .. class:: SCA_IController(SCA_ILogicBrick)
@@ -52,4 +50,3 @@ base class --- :class:`SCA_ILogicBrick`
       .. note::
          
          Order of execution between high priority controllers is not guaranteed.
-
index 5ed44c4bb38cc6340cbc81a3df49f87f346b6d35..e8d9413d7e5649fe3ca9d88a33feb8083ce6d10c 100644 (file)
@@ -1,8 +1,6 @@
 SCA_ILogicBrick(CValue)
 =======================
 
-.. module:: bge.types
-
 base class --- :class:`CValue`
 
 .. class:: SCA_ILogicBrick(CValue)
@@ -26,4 +24,3 @@ base class --- :class:`CValue`
       The name of this logic brick (read-only).
       
       :type: string
-
index 220659445424ecdcad1d0210624af860bb39a26c..a3080879fd0b271d002751049f503beed29f792e 100644 (file)
@@ -1,11 +1,8 @@
 SCA_IObject(CValue)
 ===================
 
-.. module:: bge.types
-
 base class --- :class:`CValue`
 
 .. class:: SCA_IObject(CValue)
 
    This class has no python functions
-
index af444fb9e6547de27b704d7ba683acbc20ce1cbf..7c8d632b0a26071a21fc9242810f9d68c32fb493 100644 (file)
@@ -1,8 +1,6 @@
 SCA_ISensor(SCA_ILogicBrick)
 ============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ILogicBrick`
 
 .. class:: SCA_ISensor(SCA_ILogicBrick)
@@ -98,4 +96,3 @@ base class --- :class:`SCA_ILogicBrick`
       Reset sensor internal state, effect depends on the type of sensor and settings.
 
       The sensor is put in its initial state as if it was just activated.
-
index 5b6628f60beb3ae43d21787a1dd8e8fcc44e9960..824b9932dc1af238eb55abe5adb252ea32ba2f44 100644 (file)
@@ -1,8 +1,6 @@
 SCA_JoystickSensor(SCA_ISensor)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_JoystickSensor(SCA_ISensor)
@@ -130,4 +128,3 @@ base class --- :class:`SCA_ISensor`
       :type buttonIndex: integer
       :return: The current pressed state of the specified button.
       :rtype: boolean
-
index 91613068ad0e303de0ae4003e021983fe5fc9f7b..7450d9c19bbf494ebeff0626f9f04497158676d9 100644 (file)
@@ -1,8 +1,6 @@
 SCA_KeyboardSensor(SCA_ISensor)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_KeyboardSensor(SCA_ISensor)
@@ -61,4 +59,3 @@ base class --- :class:`SCA_ISensor`
       :type keycode: integer
       :return: The state of the given key, can be one of :ref:`these constants<input-status>`
       :rtype: int
-
index bbc695e4cbf766972659893e5c9d6f34b189f6ba..8f22ec064041517b37817574f31671adb360c31d 100644 (file)
@@ -1,8 +1,6 @@
 SCA_MouseSensor(SCA_ISensor)
 ============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_MouseSensor(SCA_ISensor)
@@ -36,4 +34,3 @@ base class --- :class:`SCA_ISensor`
       :type button: int
       :return: The state of the given key, can be one of :ref:`these constants<input-status>`
       :rtype: int
-
index 4bd67fb22eeabd83b6b981988c4deded637c7083..74094f476f323c2154c86bcdf61fb8e917fbeb6d 100644 (file)
@@ -1,8 +1,6 @@
 SCA_NANDController(SCA_IController)
 ===================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IController`
 
 .. class:: SCA_NANDController(SCA_IController)
@@ -10,4 +8,3 @@ base class --- :class:`SCA_IController`
    An NAND controller activates when all linked sensors are not active.
 
    There are no special python methods for this controller.
-
index 5a567c84ecef781ea711bade7911332bb0860a8e..ee06cda19aa146ecc51bb8a56dae34f3fff5145a 100644 (file)
@@ -1,8 +1,6 @@
 SCA_NORController(SCA_IController)
 ==================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IController`
 
 .. class:: SCA_NORController(SCA_IController)
@@ -10,4 +8,3 @@ base class --- :class:`SCA_IController`
    An NOR controller activates only when all linked sensors are de-activated.
 
    There are no special python methods for this controller.
-
index ed57b0dbaf2e19b3caac9c74d89e0e8d2bc2d06d..874e706b3ab44f106a5f61198eb71febcbbca218 100644 (file)
@@ -1,8 +1,6 @@
 SCA_ORController(SCA_IController)
 =================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IController`
 
 .. class:: SCA_ORController(SCA_IController)
@@ -10,4 +8,3 @@ base class --- :class:`SCA_IController`
    An OR controller activates when any connected sensor activates.
 
    There are no special python methods for this controller.
-
index 36a4ea7fefe3d4960dfc9ee9b3fe44d12c8e26b0..149b260707771312d69f443876afba92f2938fb4 100644 (file)
@@ -1,8 +1,6 @@
 SCA_PropertyActuator(SCA_IActuator)
 ===================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: SCA_PropertyActuator(SCA_IActuator)
@@ -26,4 +24,3 @@ base class --- :class:`SCA_IActuator`
       TODO - add constants to game logic dict!.
 
       :type: integer
-
index 3c41e4679db18b427cd29738d0fc706bc9af87b7..d9fd1cc313ff2351f15b2d2baf33cc86b1ec2b3e 100644 (file)
@@ -1,8 +1,6 @@
 SCA_PropertySensor(SCA_ISensor)
 ===============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_PropertySensor(SCA_ISensor)
@@ -38,4 +36,3 @@ base class --- :class:`SCA_ISensor`
       the maximum value of the range used to evaluate the property when in interval mode.
 
       :type: string
-
index 7b5619106ed992255442bc82a56c141226ce637d..a11c1398546d115b43d0bead69dc7f80f3b96d87 100644 (file)
@@ -1,8 +1,6 @@
 SCA_PythonController(SCA_IController)
 =====================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IController`
 
 .. class:: SCA_PythonController(SCA_IController)
@@ -51,4 +49,3 @@ base class --- :class:`SCA_IController`
 
       :arg actuator: The actuator to operate on.
       :type actuator: actuator or the actuator name as a string
-
index bcec751929db73f9674222da59bd5612a2cc8b1e..a8867ee7f962509aadd4e508719ec90659e9d21e 100644 (file)
@@ -1,8 +1,6 @@
 SCA_PythonJoystick(PyObjectPlus)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: SCA_PythonJoystick(PyObjectPlus)
@@ -74,4 +72,3 @@ base class --- :class:`PyObjectPlus`
       The number of hats for the joystick at this index. (read-only).
 
       :type: integer
-
index 7511f6724d8d149f48f0f80ba398a2a172f94b81..59a3d99efc2c350d7bfcde5994e3f00c6ba8f978 100644 (file)
@@ -1,8 +1,6 @@
 SCA_PythonKeyboard(PyObjectPlus)
 ================================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: SCA_PythonKeyboard(PyObjectPlus)
@@ -34,4 +32,3 @@ base class --- :class:`PyObjectPlus`
 
       :arg text: New clipboard text
       :type text: string
-
index 5dfa78d39428e2bea3babeaeaf71082137aa64f8..6088d785eeb9b74c71e27fc2eb96dd89049c0148 100644 (file)
@@ -1,8 +1,6 @@
 SCA_PythonMouse(PyObjectPlus)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`PyObjectPlus`
 
 .. class:: SCA_PythonMouse(PyObjectPlus)
@@ -32,4 +30,3 @@ base class --- :class:`PyObjectPlus`
       The visibility of the mouse cursor.
       
       :type: boolean
-
index 683572292621376a07f73a3728e04116358a8380..ef497d81643a69bd0561572e4ba110b12ec124e1 100644 (file)
@@ -1,8 +1,6 @@
 SCA_RandomActuator(SCA_IActuator)
 =================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IActuator`
 
 .. class:: SCA_RandomActuator(SCA_IActuator)
@@ -124,4 +122,3 @@ base class --- :class:`SCA_IActuator`
       The half-life 'time' is characterized by half_life.
       
       :type half_life: float
-
index 05e61ccf118193b9e520a2e6e81f901a9bd91224..aaa8b1084fe63b6aef5c2389e40449fda8426fc0 100644 (file)
@@ -1,8 +1,6 @@
 SCA_RandomSensor(SCA_ISensor)
 =============================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_ISensor`
 
 .. class:: SCA_RandomSensor(SCA_ISensor)
@@ -20,4 +18,3 @@ base class --- :class:`SCA_ISensor`
       The seed of the random number generator.
 
       :type: integer
-
index d0235f29a20ca4e4f783436070f68e37164cd0f0..a46ac10430767aeb39976fc1b10486c5873ed33a 100644 (file)
@@ -1,8 +1,6 @@
 SCA_XNORController(SCA_IController)
 ===================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IController`
 
 .. class:: SCA_XNORController(SCA_IController)
@@ -10,4 +8,3 @@ base class --- :class:`SCA_IController`
    An XNOR controller activates when all linked sensors are the same (activated or inative).
 
    There are no special python methods for this controller.
-
index 98ccf142f63058fd0ecc9f3fd7bb4f01ed0abf97..bc69df421ea8b305c9c03e69eb1c6e71bad77043 100644 (file)
@@ -1,8 +1,6 @@
 SCA_XORController(SCA_IController)
 ==================================
 
-.. module:: bge.types
-
 base class --- :class:`SCA_IController`
 
 .. class:: SCA_XORController(SCA_IController)
@@ -10,4 +8,3 @@ base class --- :class:`SCA_IController`
    An XOR controller activates when there is the input is mixed, but not when all are on or off.
 
    There are no special python methods for this controller.
-
index dfbd34d341ac163e6137b6624e68a14532ab1bed..dc0229e0748d9a4476489b6bc0d91d2c38b52cbb 100644 (file)
 #include <assert.h>
 
 /* For 'isatty' to check for color. */
-#if defined(__unix__)
+#if defined(__unix__) || defined(__APPLE__)
 #  include <unistd.h>
 #endif
 
+#if defined(_MSC_VER)
+#  include <io.h>
+#endif
 /* Only other dependency (could use regular malloc too). */
 #include "MEM_guardedalloc.h"
 
@@ -68,7 +71,8 @@ typedef struct CLogContext {
        bool use_basename;
 
        /** Borrowed, not owned. */
-       FILE *output;
+       int output;
+       FILE *output_file;
 
        /** For new types. */
        struct {
@@ -400,13 +404,12 @@ void CLG_log_str(
        clg_str_append(&cstr, "\n");
 
        /* could be optional */
-       fwrite(cstr.data, cstr.len, 1, lg->ctx->output);
-       fflush(lg->ctx->output);
+       write(lg->ctx->output, cstr.data, cstr.len);
 
        clg_str_free(&cstr);
 
        if (severity == CLG_SEVERITY_FATAL) {
-               clg_ctx_fatal_action(lg->ctx, lg->ctx->output);
+               clg_ctx_fatal_action(lg->ctx, lg->ctx->output_file);
        }
 }
 
@@ -432,13 +435,12 @@ void CLG_logf(
        clg_str_append(&cstr, "\n");
 
        /* could be optional */
-       fwrite(cstr.data, cstr.len, 1, lg->ctx->output);
-       fflush(lg->ctx->output);
+       write(lg->ctx->output, cstr.data, cstr.len);
 
        clg_str_free(&cstr);
 
        if (severity == CLG_SEVERITY_FATAL) {
-               clg_ctx_fatal_action(lg->ctx, lg->ctx->output);
+               clg_ctx_fatal_action(lg->ctx, lg->ctx->output_file);
        }
 }
 
@@ -450,9 +452,10 @@ void CLG_logf(
 
 static void CLG_ctx_output_set(CLogContext *ctx, void *file_handle)
 {
-       ctx->output = file_handle;
-#if defined(__unix__)
-       ctx->use_color = isatty(fileno(file_handle));
+       ctx->output_file = file_handle;
+       ctx->output = fileno(file_handle);
+#if defined(__unix__) || defined(__APPLE__)
+       ctx->use_color = isatty(ctx->output);
 #endif
 }
 
index ff05ffc8df77cdd94318e12fc77d0b477b9b57c8..c698db2e8f551105a9cafb75bf8a78a291a9a0f0 100644 (file)
@@ -72,7 +72,7 @@ void BKE_object_free_caches(struct Object *object);
 
 void BKE_object_modifier_hook_reset(struct Object *ob, struct HookModifierData *hmd);
 
-bool BKE_object_support_modifier_type_check(struct Object *ob, int modifier_type);
+bool BKE_object_support_modifier_type_check(const struct Object *ob, int modifier_type);
 
 void BKE_object_link_modifiers(struct Object *ob_dst, const struct Object *ob_src);
 void BKE_object_free_modifiers(struct Object *ob, const int flag);
@@ -80,9 +80,9 @@ void BKE_object_free_modifiers(struct Object *ob, const int flag);
 void BKE_object_make_proxy(struct Object *ob, struct Object *target, struct Object *gob);
 void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target);
 
-bool BKE_object_exists_check(struct Object *obtest);
-bool BKE_object_is_in_editmode(struct Object *ob);
-bool BKE_object_is_in_editmode_vgroup(struct Object *ob);
+bool BKE_object_exists_check(const struct Object *obtest);
+bool BKE_object_is_in_editmode(const struct Object *ob);
+bool BKE_object_is_in_editmode_vgroup(const struct Object *ob);
 bool BKE_object_is_in_wpaint_select_vert(const struct Object *ob);
 
 typedef enum eObjectVisibilityCheck {
@@ -123,8 +123,8 @@ void BKE_object_copy_data(struct Main *bmain, struct Object *ob_dst, const struc
 struct Object *BKE_object_copy(struct Main *bmain, const struct Object *ob);
 void BKE_object_make_local(struct Main *bmain, struct Object *ob, const bool lib_local);
 void BKE_object_make_local_ex(struct Main *bmain, struct Object *ob, const bool lib_local, const bool clear_proxy);
-bool BKE_object_is_libdata(struct Object *ob);
-bool BKE_object_obdata_is_libdata(struct Object *ob);
+bool BKE_object_is_libdata(const struct Object *ob);
+bool BKE_object_obdata_is_libdata(const struct Object *ob);
 
 void BKE_object_obdata_size_init(struct Object *ob, const float scale);
 
@@ -136,7 +136,7 @@ void BKE_object_to_mat4(struct Object *ob, float mat[4][4]);
 void BKE_object_apply_mat4(struct Object *ob, float mat[4][4], const bool use_compat, const bool use_parent);
 void BKE_object_matrix_local_get(struct Object *ob, float mat[4][4]);
 
-bool BKE_object_pose_context_check(struct Object *ob);
+bool BKE_object_pose_context_check(const struct Object *ob);
 struct Object *BKE_object_pose_armature_get(struct Object *ob);
 struct Object *BKE_object_pose_armature_get_visible(struct Object *ob, struct ViewLayer *view_layer);
 
@@ -274,7 +274,7 @@ bool BKE_object_shapekey_free(struct Main *bmain, struct Object *ob);
 
 bool BKE_object_flag_test_recursive(const struct Object *ob, short flag);
 
-bool BKE_object_is_child_recursive(struct Object *ob_parent, struct Object *ob_child);
+bool BKE_object_is_child_recursive(const struct Object *ob_parent, const struct Object *ob_child);
 bool BKE_object_is_animated(struct Scene *scene, struct Object *ob);
 
 /* return ModifierMode flag */
index 98db06752c8ab0932b4cd9a8d125784e8ac365ee..b53af3cec53af5f5be97fa0906bc25fd1e0e7b71 100644 (file)
@@ -44,8 +44,6 @@ struct TextUndoBuf;
 
 void                   BKE_text_free_lines     (struct Text *text);
 void                   BKE_text_free           (struct Text *text);
-void                   txt_set_undostate       (int u);
-int                    txt_get_undostate       (void);
 void            BKE_text_init(struct Text *ta);
 struct Text    *BKE_text_add   (struct Main *bmain, const char *name);
 int                            txt_extended_ascii_as_utf8(char **str);
index 9697c7dd8e2a184773a2a9744e03f379119bf751..53ea8ddefe84cc39a2f3f71df8920989442bfb9a 100644 (file)
@@ -149,6 +149,7 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack, struct bContext *C, cons
 bool BKE_undosys_step_push(UndoStack *ustack, struct bContext *C, const char *name);
 
 UndoStep *BKE_undosys_step_find_by_name_with_type(UndoStack *ustack, const char *name, const UndoType *ut);
+UndoStep *BKE_undosys_step_find_by_type(UndoStack *ustack, const UndoType *ut);
 UndoStep *BKE_undosys_step_find_by_name(UndoStack *ustack, const char *name);
 
 bool BKE_undosys_step_undo_with_data_ex(UndoStack *ustack, struct bContext *C, UndoStep *us, bool use_skip);
index acb2db8d7ad25383fd97ba8e2993c923df70c3be..e47c87c995b4ba1440722309fe72f7830f209d73 100644 (file)
@@ -500,7 +500,7 @@ bPoseChannel *BKE_pose_channel_active(Object *ob)
 }
 
 /**
- * \see #ED_armature_bone_get_mirrored (edit-mode, matching function)
+ * \see #ED_armature_ebone_get_mirrored (edit-mode, matching function)
  */
 bPoseChannel *BKE_pose_channel_get_mirrored(const bPose *pose, const char *name)
 {
index 67769c9ae3b810318088ce6811cc5d803d1ccb26..875d716305f697940ea0cbc5f1ea3b0d3fc82989 100644 (file)
@@ -238,7 +238,7 @@ void BKE_object_modifier_hook_reset(Object *ob, HookModifierData *hmd)
        }
 }
 
-bool BKE_object_support_modifier_type_check(Object *ob, int modifier_type)
+bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type)
 {
        const ModifierTypeInfo *mti;
 
@@ -487,7 +487,7 @@ void BKE_object_free(Object *ob)
 }
 
 /* actual check for internal data, not context or flags */
-bool BKE_object_is_in_editmode(Object *ob)
+bool BKE_object_is_in_editmode(const Object *ob)
 {
        if (ob->data == NULL)
                return false;
@@ -530,7 +530,7 @@ bool BKE_object_is_in_editmode(Object *ob)
        return false;
 }
 
-bool BKE_object_is_in_editmode_vgroup(Object *ob)
+bool BKE_object_is_in_editmode_vgroup(const Object *ob)
 {
        return (OB_TYPE_SUPPORT_VGROUP(ob->type) &&
                BKE_object_is_in_editmode(ob));
@@ -578,7 +578,7 @@ bool BKE_object_is_visible(Object *ob, const eObjectVisibilityCheck mode)
        }
 }
 
-bool BKE_object_exists_check(Object *obtest)
+bool BKE_object_exists_check(const Object *obtest)
 {
        Object *ob;
        
@@ -1150,7 +1150,7 @@ static void copy_object_lod(Object *obn, const Object *ob, const int UNUSED(flag
        obn->currentlod = (LodLevel *)obn->lodlevels.first;
 }
 
-bool BKE_object_pose_context_check(Object *ob)
+bool BKE_object_pose_context_check(const Object *ob)
 {
        if ((ob) &&
            (ob->type == OB_ARMATURE) &&
@@ -1352,13 +1352,13 @@ void BKE_object_make_local(Main *bmain, Object *ob, const bool lib_local)
 }
 
 /* Returns true if the Object is from an external blend file (libdata) */
-bool BKE_object_is_libdata(Object *ob)
+bool BKE_object_is_libdata(const Object *ob)
 {
        return (ob && ID_IS_LINKED(ob));
 }
 
 /* Returns true if the Object data is from an external blend file (libdata) */
-bool BKE_object_obdata_is_libdata(Object *ob)
+bool BKE_object_obdata_is_libdata(const Object *ob)
 {
        /* Linked objects with local obdata are forbidden! */
        BLI_assert(!ob || !ob->data || (ID_IS_LINKED(ob) ? ID_IS_LINKED(ob->data) : true));
@@ -3138,7 +3138,7 @@ bool BKE_object_flag_test_recursive(const Object *ob, short flag)
        }
 }
 
-bool BKE_object_is_child_recursive(Object *ob_parent, Object *ob_child)
+bool BKE_object_is_child_recursive(const Object *ob_parent, const Object *ob_child)
 {
        for (ob_child = ob_child->parent; ob_child; ob_child = ob_child->parent) {
                if (ob_child == ob_parent) {
index cd9b8ae339d37f51b92f353beb64507b48f6d5fe..b1ff2724375aea24c426e6626ebedacf2b5d36f7 100644 (file)
@@ -174,18 +174,12 @@ static void txt_make_dirty(Text *text);
 
 /***/
 
-static unsigned char undoing;
-
-/* allow to switch off undoing externally */
-void txt_set_undostate(int u)
-{
-       undoing = u;
-}
-
-int txt_get_undostate(void)
-{
-       return undoing;
-}
+/**
+ * Set to true when undoing (so we don't generate undo steps while undoing).
+ *
+ * Also use to disable undo entirely.
+ */
+static bool undoing;
 
 /**
  * \note caller must handle `undo_buf` and `compiled` members.
@@ -525,29 +519,26 @@ void BKE_text_make_local(Main *bmain, Text *text, const bool lib_local)
 
 void BKE_text_clear(Text *text, TextUndoBuf *utxt) /* called directly from rna */
 {
-       int oldstate;
-
-       if (utxt) {
-               oldstate = txt_get_undostate();
-       }
-       txt_set_undostate(utxt != NULL);
+       const bool undoing_orig = undoing;
+       undoing = (utxt == NULL);
 
        txt_sel_all(text);
        txt_delete_sel(text, utxt);
 
-       txt_set_undostate(oldstate);
+       undoing = undoing_orig;
 
        txt_make_dirty(text);
 }
 
 void BKE_text_write(Text *text, TextUndoBuf *utxt, const char *str) /* called directly from rna */
 {
-       int oldstate;
+       const bool undoing_orig = undoing;
+       undoing = (utxt == NULL);
 
-       oldstate = txt_get_undostate();
        txt_insert_buf(text, utxt, str);
        txt_move_eof(text, 0);
-       txt_set_undostate(oldstate);
+
+       undoing = undoing_orig;
 
        txt_make_dirty(text);
 }
@@ -1395,7 +1386,8 @@ char *txt_sel_to_buf(Text *text)
 
 void txt_insert_buf(Text *text, TextUndoBuf *utxt, const char *in_buffer)
 {
-       int l = 0, u, len;
+       const bool undoing_orig = undoing;
+       int l = 0, len;
        size_t i = 0, j;
        TextLine *add;
        char *buffer;
@@ -1408,41 +1400,44 @@ void txt_insert_buf(Text *text, TextUndoBuf *utxt, const char *in_buffer)
        buffer = BLI_strdupn(in_buffer, len);
        len += txt_extended_ascii_as_utf8(&buffer);
        
-       if (!undoing) txt_undo_add_blockop(text, utxt, UNDO_IBLOCK, buffer);
-
-       u = undoing;
-       undoing = 1;
+       if (!undoing) {
+               txt_undo_add_blockop(text, utxt, UNDO_IBLOCK, buffer);
+       }
+       undoing = true;
 
        /* Read the first line (or as close as possible */
-       while (buffer[i] && buffer[i] != '\n')
+       while (buffer[i] && buffer[i] != '\n') {
                txt_add_raw_char(text, utxt, BLI_str_utf8_as_unicode_step(buffer, &i));
+       }
        
-       if (buffer[i] == '\n') txt_split_curline(text, utxt);
-       else { undoing = u; MEM_freeN(buffer); return; }
-       i++;
+       if (buffer[i] == '\n') {
+               txt_split_curline(text, utxt);
+               i++;
 
-       while (i < len) {
-               l = 0;
+               while (i < len) {
+                       l = 0;
 
-               while (buffer[i] && buffer[i] != '\n') {
-                       i++; l++;
-               }
-       
-               if (buffer[i] == '\n') {
-                       add = txt_new_linen(buffer + (i - l), l);
-                       BLI_insertlinkbefore(&text->lines, text->curl, add);
-                       i++;
-               }
-               else {
-                       for (j = i - l; j < i && j < len; )
-                               txt_add_raw_char(text, utxt, BLI_str_utf8_as_unicode_step(buffer, &j));
-                       break;
+                       while (buffer[i] && buffer[i] != '\n') {
+                               i++;
+                               l++;
+                       }
+
+                       if (buffer[i] == '\n') {
+                               add = txt_new_linen(buffer + (i - l), l);
+                               BLI_insertlinkbefore(&text->lines, text->curl, add);
+                               i++;
+                       }
+                       else {
+                               for (j = i - l; j < i && j < len; ) {
+                                       txt_add_raw_char(text, utxt, BLI_str_utf8_as_unicode_step(buffer, &j));
+                               }
+                               break;
+                       }
                }
        }
-       
-       MEM_freeN(buffer);
 
-       undoing = u;
+       MEM_freeN(buffer);
+       undoing = undoing_orig;
 }
 
 /******************/
index 40cdd57fc3b780fd7b169e244554f381f8bcadac..fd62650e8988eb06589ec4504cc42dbca4071e31 100644 (file)
@@ -505,6 +505,16 @@ UndoStep *BKE_undosys_step_find_by_name(UndoStack *ustack, const char *name)
        return BLI_rfindstring(&ustack->steps, name, offsetof(UndoStep, name));
 }
 
+UndoStep *BKE_undosys_step_find_by_type(UndoStack *ustack, const UndoType *ut)
+{
+       for (UndoStep *us = ustack->steps.last; us; us = us->prev) {
+               if (us->type == ut) {
+                       return us;
+               }
+       }
+       return NULL;
+}
+
 bool BKE_undosys_step_undo_with_data_ex(
         UndoStack *ustack, bContext *C, UndoStep *us,
         bool use_skip)
index b713b963056b52b8d5407122b0b3a7be0e0c9362..c407ea31b9b23a284a576c91f6801419f8faa3d1 100644 (file)
@@ -56,7 +56,9 @@ typedef struct MemFileUndoData {
 } MemFileUndoData;
 
 /* actually only used writefile.c */
-extern void memfile_chunk_add(MemFile *compare, MemFile *current, const char *buf, unsigned int size);
+extern void memfile_chunk_add(
+        MemFile *memfile, const char *buf, unsigned int size,
+        MemFileChunk **compchunk_step);
 
 /* exports */
 extern void BLO_memfile_free(MemFile *memfile);
index f6584ecf25fbbccb825675e123bc8e97a2a08eb2..7133dee0e82bab737ab8d1354794d8e41e499c01 100644 (file)
@@ -96,36 +96,26 @@ void BLO_memfile_merge(MemFile *first, MemFile *second)
        BLO_memfile_free(first);
 }
 
-void memfile_chunk_add(MemFile *compare, MemFile *current, const char *buf, unsigned int size)
+void memfile_chunk_add(
+        MemFile *memfile, const char *buf, unsigned int size,
+        MemFileChunk **compchunk_step)
 {
-       static MemFileChunk *compchunk = NULL;
-       MemFileChunk *curchunk;
-       
-       /* this function inits when compare != NULL or when current == NULL  */
-       if (compare) {
-               compchunk = compare->chunks.first;
-               return;
-       }
-       if (current == NULL) {
-               compchunk = NULL;
-               return;
-       }
-       
-       curchunk = MEM_mallocN(sizeof(MemFileChunk), "MemFileChunk");
+       MemFileChunk *curchunk = MEM_mallocN(sizeof(MemFileChunk), "MemFileChunk");
        curchunk->size = size;
        curchunk->buf = NULL;
        curchunk->is_identical = false;
-       BLI_addtail(&current->chunks, curchunk);
-       
+       BLI_addtail(&memfile->chunks, curchunk);
+
        /* we compare compchunk with buf */
-       if (compchunk) {
+       if (*compchunk_step != NULL) {
+               MemFileChunk *compchunk = *compchunk_step;
                if (compchunk->size == curchunk->size) {
                        if (memcmp(compchunk->buf, buf, size) == 0) {
                                curchunk->buf = compchunk->buf;
                                curchunk->is_identical = true;
                        }
                }
-               compchunk = compchunk->next;
+               *compchunk_step = compchunk->next;
        }
 
        /* not equal... */
@@ -133,7 +123,7 @@ void memfile_chunk_add(MemFile *compare, MemFile *current, const char *buf, unsi
                char *buf_new = MEM_mallocN(size, "Chunk buffer");
                memcpy(buf_new, buf, size);
                curchunk->buf = buf_new;
-               current->size += size;
+               memfile->size += size;
        }
 }
 
index 40c54e04ec7f7dbef0ad36bf031e61575c86e854..7f4e7fdc646ad79f2e6585f57572322a068af9a3 100644 (file)
 #define MYWRITE_BUFFER_SIZE (MEM_SIZE_OPTIMAL(1 << 17))  /* 128kb */
 #define MYWRITE_MAX_CHUNK   (MEM_SIZE_OPTIMAL(1 << 15))  /* ~32kb */
 
+/** Use if we want to store how many bytes have been written to the file. */
+// #define USE_WRITE_DATA_LEN
 
-/** \name Small API to handle compression.
+/* -------------------------------------------------------------------- */
+/** \name Internal Write Wrapper's (Abstracts Compression)
  * \{ */
 
 typedef enum {
@@ -311,20 +314,41 @@ static void ww_handle_init(eWriteWrapType ww_type, WriteWrap *r_ww)
 
 /** \} */
 
-
+/* -------------------------------------------------------------------- */
+/** \name Write Data Type & Functions
+ * \{ */
 
 typedef struct {
        const struct SDNA *sdna;
 
-       unsigned char *buf;
-       MemFile *compare, *current;
+       /** Use for file and memory writing (fixed size of #MYWRITE_BUFFER_SIZE). */
+       uchar *buf;
+       /** Number of bytes used in #WriteData.buf (flushed when exceeded). */
+       int buf_used_len;
+
+#ifdef USE_WRITE_DATA_LEN
+       /** Total number of bytes written. */
+       size_t write_len;
+#endif
 
-       int tot, count;
+       /** Set on unlikely case of an error (ignores further file writing).  */
        bool error;
 
-       /* Wrap writing, so we can use zlib or
+       /** #MemFile writing (used for undo). */
+       struct {
+               MemFile      *current;
+               MemFile      *compare;
+               /** Use to de-duplicate chunks when writing. */
+               MemFileChunk *compare_chunk;
+       } mem;
+       /** When true, write to #WriteData.current, could also call 'is_undo'. */
+       bool use_memfile;
+
+       /**
+        * Wrap writing, so we can use zlib or
         * other compression types later, see: G_FILE_COMPRESS
-        * Will be NULL for UNDO. */
+        * Will be NULL for UNDO.
+        */
        WriteWrap *ww;
 
 #ifdef USE_BMESH_SAVE_AS_COMPAT
@@ -356,8 +380,8 @@ static void writedata_do_write(WriteData *wd, const void *mem, int memlen)
        }
 
        /* memory based save */
-       if (wd->current) {
-               memfile_chunk_add(NULL, wd->current, mem, memlen);
+       if (wd->use_memfile) {
+               memfile_chunk_add(wd->mem.current, mem, memlen, &wd->mem.compare_chunk);
        }
        else {
                if (wd->ww->write(wd->ww, mem, memlen) != memlen) {
@@ -372,7 +396,11 @@ static void writedata_free(WriteData *wd)
        MEM_freeN(wd);
 }
 
-/***/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Local Writing API 'mywrite'
+ * \{ */
 
 /**
  * Flush helps the de-duplicating memory for undo-save by logically segmenting data,
@@ -380,9 +408,9 @@ static void writedata_free(WriteData *wd)
  */
 static void mywrite_flush(WriteData *wd)
 {
-       if (wd->count) {
-               writedata_do_write(wd, wd->buf, wd->count);
-               wd->count = 0;
+       if (wd->buf_used_len) {
+               writedata_do_write(wd, wd->buf, wd->buf_used_len);
+               wd->buf_used_len = 0;
        }
 }
 
@@ -390,7 +418,6 @@ static void mywrite_flush(WriteData *wd)
  * Low level WRITE(2) wrapper that buffers data
  * \param adr Pointer to new chunk of data
  * \param len Length of new chunk of data
- * \warning Talks to other functions with global parameters
  */
 static void mywrite(WriteData *wd, const void *adr, int len)
 {
@@ -398,19 +425,21 @@ static void mywrite(WriteData *wd, const void *adr, int len)
                return;
        }
 
-       if (adr == NULL) {
+       if (UNLIKELY(adr == NULL)) {
                BLI_assert(0);
                return;
        }
 
-       wd->tot += len;
+#ifdef USE_WRITE_DATA_LEN
+       wd->write_len += len;
+#endif
 
        /* if we have a single big chunk, write existing data in
         * buffer and write out big chunk in smaller pieces */
        if (len > MYWRITE_MAX_CHUNK) {
-               if (wd->count) {
-                       writedata_do_write(wd, wd->buf, wd->count);
-                       wd->count = 0;
+               if (wd->buf_used_len) {
+                       writedata_do_write(wd, wd->buf, wd->buf_used_len);
+                       wd->buf_used_len = 0;
                }
 
                do {
@@ -424,14 +453,14 @@ static void mywrite(WriteData *wd, const void *adr, int len)
        }
 
        /* if data would overflow buffer, write out the buffer */
-       if (len + wd->count > MYWRITE_BUFFER_SIZE - 1) {
-               writedata_do_write(wd, wd->buf, wd->count);
-               wd->count = 0;
+       if (len + wd->buf_used_len > MYWRITE_BUFFER_SIZE - 1) {
+               writedata_do_write(wd, wd->buf, wd->buf_used_len);
+               wd->buf_used_len = 0;
        }
 
        /* append data at end of buffer */
-       memcpy(&wd->buf[wd->count], adr, len);
-       wd->count += len;
+       memcpy(&wd->buf[wd->buf_used_len], adr, len);
+       wd->buf_used_len += len;
 }
 
 /**
@@ -441,19 +470,17 @@ static void mywrite(WriteData *wd, const void *adr, int len)
  * \param current The current memory file (can be NULL).
  * \warning Talks to other functions with global parameters
  */
-static WriteData *bgnwrite(WriteWrap *ww, MemFile *compare, MemFile *current)
+static WriteData *mywrite_begin(WriteWrap *ww, MemFile *compare, MemFile *current)
 {
        WriteData *wd = writedata_new(ww);
 
-       if (wd == NULL) {
-               return NULL;
+       if (current != NULL) {
+               wd->mem.current = current;
+               wd->mem.compare = compare;
+               wd->mem.compare_chunk = compare ? compare->chunks.first : NULL;
+               wd->use_memfile = true;
        }
 
-       wd->compare = compare;
-       wd->current = current;
-       /* this inits comparing */
-       memfile_chunk_add(compare, NULL, NULL, 0);
-
        return wd;
 }
 
@@ -463,11 +490,11 @@ static WriteData *bgnwrite(WriteWrap *ww, MemFile *compare, MemFile *current)
  * \return unknown global variable otherwise
  * \warning Talks to other functions with global parameters
  */
-static bool endwrite(WriteData *wd)
+static bool mywrite_end(WriteData *wd)
 {
-       if (wd->count) {
-               writedata_do_write(wd, wd->buf, wd->count);
-               wd->count = 0;
+       if (wd->buf_used_len) {
+               writedata_do_write(wd, wd->buf, wd->buf_used_len);
+               wd->buf_used_len = 0;
        }
 
        const bool err = wd->error;
@@ -476,7 +503,11 @@ static bool endwrite(WriteData *wd)
        return err;
 }
 
-/* ********** WRITE FILE ****************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Generic DNA File Writing
+ * \{ */
 
 static void writestruct_at_address_nr(
         WriteData *wd, int filecode, const int struct_nr, int nr,
@@ -602,8 +633,14 @@ static void writelist_id(WriteData *wd, int filecode, const char *structname, co
 #define writelist(wd, filecode, struct_id, lb) \
        writelist_nr(wd, filecode, SDNA_TYPE_FROM_STRUCT(struct_id), lb)
 
-/* *************** writing some direct data structs used in more code parts **************** */
-/*These functions are used by blender's .blend system for file saving/loading.*/
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Typed DNA File Writing
+ *
+ * These functions are used by blender's .blend system for file saving/loading.
+ * \{ */
+
 void IDP_WriteProperty_OnlyData(const IDProperty *prop, void *wd);
 void IDP_WriteProperty(const IDProperty *prop, void *wd);
 
@@ -830,7 +867,7 @@ static void write_fcurves(WriteData *wd, ListBase *fcurves)
 
 static void write_action(WriteData *wd, bAction *act)
 {
-       if (act->id.us > 0 || wd->current) {
+       if (act->id.us > 0 || wd->use_memfile) {
                writestruct(wd, ID_AC, bAction, 1, act);
                write_iddata(wd, &act->id);
 
@@ -938,7 +975,7 @@ static void write_node_socket(WriteData *wd, bNodeTree *UNUSED(ntree), bNode *no
 {
 #ifdef USE_NODE_COMPAT_CUSTOMNODES
        /* forward compatibility code, so older blenders still open (not for undo) */
-       if (wd->current == NULL) {
+       if (wd->use_memfile == false) {
                sock->stack_type = 1;
 
                if (node->type == NODE_GROUP) {
@@ -1058,7 +1095,7 @@ static void write_nodetree_nolib(WriteData *wd, bNodeTree *ntree)
                                 * Not ideal (there is no ideal solution here), but should do for now. */
                                NodeGlare *ndg = node->storage;
                                /* Not in undo case. */
-                               if (!wd->current) {
+                               if (wd->use_memfile == false) {
                                        switch (ndg->type) {
                                                case 2:  /* Grrrr! magic numbers :( */
                                                        ndg->angle = ndg->streaks;
@@ -1319,7 +1356,7 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches)
 
 static void write_particlesettings(WriteData *wd, ParticleSettings *part)
 {
-       if (part->id.us > 0 || wd->current) {
+       if (part->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_PA, ParticleSettings, 1, part);
                write_iddata(wd, &part->id);
@@ -1904,7 +1941,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
 
 static void write_object(WriteData *wd, Object *ob)
 {
-       if (ob->id.us > 0 || wd->current) {
+       if (ob->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_OB, Object, 1, ob);
                write_iddata(wd, &ob->id);
@@ -1968,7 +2005,7 @@ static void write_object(WriteData *wd, Object *ob)
 
 static void write_vfont(WriteData *wd, VFont *vf)
 {
-       if (vf->id.us > 0 || wd->current) {
+       if (vf->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_VF, VFont, 1, vf);
                write_iddata(wd, &vf->id);
@@ -1985,7 +2022,7 @@ static void write_vfont(WriteData *wd, VFont *vf)
 
 static void write_key(WriteData *wd, Key *key)
 {
-       if (key->id.us > 0 || wd->current) {
+       if (key->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_KE, Key, 1, key);
                write_iddata(wd, &key->id);
@@ -2006,7 +2043,7 @@ static void write_key(WriteData *wd, Key *key)
 
 static void write_camera(WriteData *wd, Camera *cam)
 {
-       if (cam->id.us > 0 || wd->current) {
+       if (cam->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_CA, Camera, 1, cam);
                write_iddata(wd, &cam->id);
@@ -2023,7 +2060,7 @@ static void write_camera(WriteData *wd, Camera *cam)
 
 static void write_mball(WriteData *wd, MetaBall *mb)
 {
-       if (mb->id.us > 0 || wd->current) {
+       if (mb->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_MB, MetaBall, 1, mb);
                write_iddata(wd, &mb->id);
@@ -2042,7 +2079,7 @@ static void write_mball(WriteData *wd, MetaBall *mb)
 
 static void write_curve(WriteData *wd, Curve *cu)
 {
-       if (cu->id.us > 0 || wd->current) {
+       if (cu->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_CU, Curve, 1, cu);
                write_iddata(wd, &cu->id);
@@ -2143,7 +2180,7 @@ static void write_customdata(
        int i;
 
        /* write external customdata (not for undo) */
-       if (data->external && !wd->current) {
+       if (data->external && (wd->use_memfile == false)) {
                CustomData_external_write(data, id, CD_MASK_MESH, count, 0);
        }
 
@@ -2213,7 +2250,7 @@ static void write_mesh(WriteData *wd, Mesh *mesh)
        CustomDataLayer *llayers = NULL, llayers_buff[CD_TEMP_CHUNK_SIZE];
        CustomDataLayer *players = NULL, players_buff[CD_TEMP_CHUNK_SIZE];
 
-       if (mesh->id.us > 0 || wd->current) {
+       if (mesh->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                if (!save_for_old_blender) {
                        /* write a copy of the mesh, don't modify in place because it is
@@ -2355,7 +2392,7 @@ static void write_mesh(WriteData *wd, Mesh *mesh)
 
 static void write_lattice(WriteData *wd, Lattice *lt)
 {
-       if (lt->id.us > 0 || wd->current) {
+       if (lt->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_LT, Lattice, 1, lt);
                write_iddata(wd, &lt->id);
@@ -2374,7 +2411,7 @@ static void write_lattice(WriteData *wd, Lattice *lt)
 
 static void write_image(WriteData *wd, Image *ima)
 {
-       if (ima->id.us > 0 || wd->current) {
+       if (ima->id.us > 0 || wd->use_memfile) {
                ImagePackedFile *imapf;
 
                /* Some trickery to keep forward compatibility of packed images. */
@@ -2410,7 +2447,7 @@ static void write_image(WriteData *wd, Image *ima)
 
 static void write_texture(WriteData *wd, Tex *tex)
 {
-       if (tex->id.us > 0 || wd->current) {
+       if (tex->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_TE, Tex, 1, tex);
                write_iddata(wd, &tex->id);
@@ -2454,7 +2491,7 @@ static void write_texture(WriteData *wd, Tex *tex)
 
 static void write_material(WriteData *wd, Material *ma)
 {
-       if (ma->id.us > 0 || wd->current) {
+       if (ma->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_MA, Material, 1, ma);
                write_iddata(wd, &ma->id);
@@ -2488,7 +2525,7 @@ static void write_material(WriteData *wd, Material *ma)
 
 static void write_world(WriteData *wd, World *wrld)
 {
-       if (wrld->id.us > 0 || wd->current) {
+       if (wrld->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_WO, World, 1, wrld);
                write_iddata(wd, &wrld->id);
@@ -2515,7 +2552,7 @@ static void write_world(WriteData *wd, World *wrld)
 
 static void write_lamp(WriteData *wd, Lamp *la)
 {
-       if (la->id.us > 0 || wd->current) {
+       if (la->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_LA, Lamp, 1, la);
                write_iddata(wd, &la->id);
@@ -2832,7 +2869,7 @@ static void write_scene(WriteData *wd, Scene *sce)
 
 static void write_gpencil(WriteData *wd, bGPdata *gpd)
 {
-       if (gpd->id.us > 0 || wd->current) {
+       if (gpd->id.us > 0 || wd->use_memfile) {
                /* write gpd data block to file */
                writestruct(wd, ID_GD, bGPdata, 1, gpd);
                write_iddata(wd, &gpd->id);
@@ -3147,7 +3184,7 @@ static void write_bone(WriteData *wd, Bone *bone)
 
 static void write_armature(WriteData *wd, bArmature *arm)
 {
-       if (arm->id.us > 0 || wd->current) {
+       if (arm->id.us > 0 || wd->use_memfile) {
                writestruct(wd, ID_AR, bArmature, 1, arm);
                write_iddata(wd, &arm->id);
 
@@ -3190,7 +3227,7 @@ static void write_text(WriteData *wd, Text *text)
 
 static void write_speaker(WriteData *wd, Speaker *spk)
 {
-       if (spk->id.us > 0 || wd->current) {
+       if (spk->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_SPK, Speaker, 1, spk);
                write_iddata(wd, &spk->id);
@@ -3203,7 +3240,7 @@ static void write_speaker(WriteData *wd, Speaker *spk)
 
 static void write_sound(WriteData *wd, bSound *sound)
 {
-       if (sound->id.us > 0 || wd->current) {
+       if (sound->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_SO, bSound, 1, sound);
                write_iddata(wd, &sound->id);
@@ -3218,7 +3255,7 @@ static void write_sound(WriteData *wd, bSound *sound)
 
 static void write_probe(WriteData *wd, LightProbe *prb)
 {
-       if (prb->id.us > 0 || wd->current) {
+       if (prb->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_LP, LightProbe, 1, prb);
                write_iddata(wd, &prb->id);
@@ -3231,7 +3268,7 @@ static void write_probe(WriteData *wd, LightProbe *prb)
 
 static void write_group(WriteData *wd, Group *group)
 {
-       if (group->id.us > 0 || wd->current) {
+       if (group->id.us > 0 || wd->use_memfile) {
                /* write LibData */
                writestruct(wd, ID_GR, Group, 1, group);
                write_iddata(wd, &group->id);
@@ -3244,7 +3281,7 @@ static void write_group(WriteData *wd, Group *group)
 
 static void write_nodetree(WriteData *wd, bNodeTree *ntree)
 {
-       if (ntree->id.us > 0 || wd->current) {
+       if (ntree->id.us > 0 || wd->use_memfile) {
                writestruct(wd, ID_NT, bNodeTree, 1, ntree);
                /* Note that trees directly used by other IDs (materials etc.) are not 'real' ID, they cannot
                 * be linked, etc., so we write actual id data here only, for 'real' ID trees. */
@@ -3326,7 +3363,7 @@ static void customnodes_free_deprecated_data(Main *mainvar)
 
 static void write_brush(WriteData *wd, Brush *brush)
 {
-       if (brush->id.us > 0 || wd->current) {
+       if (brush->id.us > 0 || wd->use_memfile) {
                writestruct(wd, ID_BR, Brush, 1, brush);
                write_iddata(wd, &brush->id);
 
@@ -3341,7 +3378,7 @@ static void write_brush(WriteData *wd, Brush *brush)
 
 static void write_palette(WriteData *wd, Palette *palette)
 {
-       if (palette->id.us > 0 || wd->current) {
+       if (palette->id.us > 0 || wd->use_memfile) {
                PaletteColor *color;
                writestruct(wd, ID_PAL, Palette, 1, palette);
                write_iddata(wd, &palette->id);
@@ -3354,7 +3391,7 @@ static void write_palette(WriteData *wd, Palette *palette)
 
 static void write_paintcurve(WriteData *wd, PaintCurve *pc)
 {
-       if (pc->id.us > 0 || wd->current) {
+       if (pc->id.us > 0 || wd->use_memfile) {
                writestruct(wd, ID_PC, PaintCurve, 1, pc);
                write_iddata(wd, &pc->id);
 
@@ -3402,7 +3439,7 @@ static void write_movieReconstruction(WriteData *wd, MovieTrackingReconstruction
 
 static void write_movieclip(WriteData *wd, MovieClip *clip)
 {
-       if (clip->id.us > 0 || wd->current) {
+       if (clip->id.us > 0 || wd->use_memfile) {
                MovieTracking *tracking = &clip->tracking;
                MovieTrackingObject *object;
 
@@ -3432,7 +3469,7 @@ static void write_movieclip(WriteData *wd, MovieClip *clip)
 
 static void write_mask(WriteData *wd, Mask *mask)
 {
-       if (mask->id.us > 0 || wd->current) {
+       if (mask->id.us > 0 || wd->use_memfile) {
                MaskLayer *masklay;
 
                writestruct(wd, ID_MSK, Mask, 1, mask);
@@ -3737,7 +3774,7 @@ static void write_linestyle_geometry_modifiers(WriteData *wd, ListBase *modifier
 
 static void write_linestyle(WriteData *wd, FreestyleLineStyle *linestyle)
 {
-       if (linestyle->id.us > 0 || wd->current) {
+       if (linestyle->id.us > 0 || wd->use_memfile) {
                writestruct(wd, ID_LS, FreestyleLineStyle, 1, linestyle);
                write_iddata(wd, &linestyle->id);
 
@@ -3763,7 +3800,7 @@ static void write_linestyle(WriteData *wd, FreestyleLineStyle *linestyle)
 
 static void write_cachefile(WriteData *wd, CacheFile *cache_file)
 {
-       if (cache_file->id.us > 0 || wd->current) {
+       if (cache_file->id.us > 0 || wd->use_memfile) {
                writestruct(wd, ID_CF, CacheFile, 1, cache_file);
 
                if (cache_file->adt) {
@@ -3825,7 +3862,7 @@ static void write_libraries(WriteData *wd, Main *main)
                                PackedFile *pf = main->curlib->packedfile;
                                writestruct(wd, DATA, PackedFile, 1, pf);
                                writedata(wd, DATA, pf->size, pf->data);
-                               if (wd->current == NULL) {
+                               if (wd->use_memfile == false) {
                                        printf("write packed .blend: %s\n", main->curlib->name);
                                }
                        }
@@ -3853,7 +3890,7 @@ static void write_libraries(WriteData *wd, Main *main)
  * - for undofile, curscene needs to be saved */
 static void write_global(WriteData *wd, int fileflags, Main *mainvar)
 {
-       const bool is_undo = (wd->current != NULL);
+       const bool is_undo = wd->use_memfile;
        FileGlobal fg;
        bScreen *screen;
        Scene *scene;
@@ -3910,6 +3947,12 @@ static void write_thumb(WriteData *wd, const BlendThumbnail *thumb)
        }
 }
 
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name File Writing (Private)
+ * \{ */
+
 /* if MemFile * there's filesave to memory */
 static bool write_file_handle(
         Main *mainvar,
@@ -3924,7 +3967,7 @@ static bool write_file_handle(
 
        blo_split_main(&mainlist, mainvar);
 
-       wd = bgnwrite(ww, compare, current);
+       wd = mywrite_begin(ww, compare, current);
 
 #ifdef USE_BMESH_SAVE_AS_COMPAT
        wd->use_mesh_compat = (write_flags & G_FILE_MESH_COMPAT) != 0;
@@ -3953,7 +3996,7 @@ static bool write_file_handle(
         * avoid thumbnail detecting changes because of this. */
        mywrite_flush(wd);
 
-       OverrideStaticStorage *override_storage = !wd->current ? BKE_override_static_operations_store_initialize() : NULL;
+       OverrideStaticStorage *override_storage = wd->use_memfile ? NULL : BKE_override_static_operations_store_initialize();
 
        /* This outer loop allows to save first datablocks from real mainvar, then the temp ones from override process,
         * if needed, without duplicating whole code. */
@@ -4142,7 +4185,7 @@ static bool write_file_handle(
 
        blo_join_main(&mainlist);
 
-       return endwrite(wd);
+       return mywrite_end(wd);
 }
 
 /* do reverse file history: .blend1 -> .blend2, .blend -> .blend1 */
@@ -4187,6 +4230,12 @@ static bool do_history(const char *name, ReportList *reports)
        return 0;
 }
 
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name File Writing (Public)
+ * \{ */
+
 /**
  * \return Success.
  */
@@ -4300,3 +4349,5 @@ bool BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int w
 
        return (err == 0);
 }
+
+/** \} */
index b2794b3bd2368d6f743eccb572b2c6c02f3e6093..f24688479af0e26d2dfe6acfef7a14968b60a39b 100644 (file)
@@ -104,7 +104,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBon
        it = std::find(finished_joints.begin(), finished_joints.end(), node);
        if (it != finished_joints.end()) return chain_length;
        
-       EditBone *bone = ED_armature_edit_bone_add(arm, (char *)bc_get_joint_name(node));
+       EditBone *bone = ED_armature_ebone_add(arm, bc_get_joint_name(node));
        totbone++;
 
        /*
@@ -636,8 +636,8 @@ Object *ArmatureImporter::create_armature_bones(SkinInfo& skin)
 }
 
 void ArmatureImporter::set_pose(Object *ob_arm,  COLLADAFW::Node *root_node, const char *parentname, float parent_mat[4][4])
-{ 
-       char *bone_name = (char *) bc_get_joint_name(root_node);
+{
+       const char *bone_name = bc_get_joint_name(root_node);
        float mat[4][4];
        float obmat[4][4];
 
index bccfe02508987a137e9a986d910c1461ce594d16..9c04e74a7da28297d9b184e2ff611cd4d9826a7a 100644 (file)
 #include "MEM_guardedalloc.h"
 #include "BLI_math.h"
 extern "C" {
-       #include "BLI_jitter_2d.h"
+#include "BLI_jitter_2d.h"
 }
 #include "COM_VectorBlurOperation.h"
 
 
 /* Defined */
-#define PASS_VECTOR_MAX        10000.0f
+#define PASS_VECTOR_MAX 10000.0f
 
 /* Forward declarations */
 struct ZSpan;
 struct DrawBufPixel;
 void zbuf_accumulate_vecblur(
-               NodeBlurData *nbd, int xsize, int ysize, float *newrect,
-               const float *imgrect, float *vecbufrect, const float *zbufrect);
+        NodeBlurData *nbd, int xsize, int ysize, float *newrect,
+        const float *imgrect, float *vecbufrect, const float *zbufrect);
 void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty, float clipcrop);
 void zbuf_free_span(ZSpan *zspan);
 void antialias_tagbuf(int xsize, int ysize, char *rectmove);
@@ -70,7 +70,7 @@ void VectorBlurOperation::initExecution()
 
 void VectorBlurOperation::executePixel(float output[4], int x, int y, void *data)
 {
-       float *buffer = (float *) data;
+       float *buffer = (float *)data;
        int index = (y * this->getWidth() + x) * COM_NUM_CHANNELS_COLOR;
        copy_v4_v4(output, &buffer[index]);
 }
@@ -148,7 +148,7 @@ typedef struct ZSpan {
        float zmulx, zmuly, zofsx, zofsy;
 
        int *rectz;
-       DrawBufPixelrectdraw;
+       DrawBufPixel *rectdraw;
        float clipcrop;
 
 } ZSpan;
@@ -158,13 +158,13 @@ void zbuf_alloc_span(ZSpan *zspan, int rectx, int recty, float clipcrop)
 {
        memset(zspan, 0, sizeof(ZSpan));
 
-       zspan->rectx= rectx;
-       zspan->recty= recty;
+       zspan->rectx = rectx;
+       zspan->recty = recty;
 
-       zspan->span1= (float*)MEM_mallocN(recty*sizeof(float), "zspan");
-       zspan->span2= (float*)MEM_mallocN(recty*sizeof(float), "zspan");
+       zspan->span1 = (float *)MEM_mallocN(recty * sizeof(float), "zspan");
+       zspan->span2 = (float *)MEM_mallocN(recty * sizeof(float), "zspan");
 
-       zspan->clipcrop= clipcrop;
+       zspan->clipcrop = clipcrop;
 }
 
 void zbuf_free_span(ZSpan *zspan)
@@ -172,16 +172,16 @@ void zbuf_free_span(ZSpan *zspan)
        if (zspan) {
                if (zspan->span1) MEM_freeN(zspan->span1);
                if (zspan->span2) MEM_freeN(zspan->span2);
-               zspan->span1= zspan->span2= NULL;
+               zspan->span1 = zspan->span2 = NULL;
        }
 }
 
 /* reset range for clipping */
 static void zbuf_init_span(ZSpan *zspan)
 {
-       zspan->miny1= zspan->miny2= zspan->recty+1;
-       zspan->maxy1= zspan->maxy2= -1;
-       zspan->minp1= zspan->maxp1= zspan->minp2= zspan->maxp2= NULL;
+       zspan->miny1 = zspan->miny2 = zspan->recty + 1;
+       zspan->maxy1 = zspan->maxy2 = -1;
+       zspan->minp1 = zspan->maxp1 = zspan->minp2 = zspan->maxp2 = NULL;
 }
 
 static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2])
@@ -191,30 +191,30 @@ static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2])
        float xx1, dx0, xs0;
        int y, my0, my2;
 
-       if (v1[1]<v2[1]) {
-               minv= v1; maxv= v2;
+       if (v1[1] < v2[1]) {
+               minv = v1; maxv = v2;
        }
        else {
-               minv= v2; maxv= v1;
+               minv = v2; maxv = v1;
        }
 
-       my0= ceil(minv[1]);
-       my2= floor(maxv[1]);
+       my0 = ceil(minv[1]);
+       my2 = floor(maxv[1]);
 
-       if (my2<0 || my0>= zspan->recty) return;
+       if (my2 < 0 || my0 >= zspan->recty) return;
 
        /* clip top */
-       if (my2>=zspan->recty) my2= zspan->recty-1;
+       if (my2 >= zspan->recty) my2 = zspan->recty - 1;
        /* clip bottom */
-       if (my0<0) my0= 0;
+       if (my0 < 0) my0 = 0;
 
-       if (my0>my2) return;
+       if (my0 > my2) return;
        /* if (my0>my2) should still fill in, that way we get spans that skip nicely */
 
-       xx1= maxv[1]-minv[1];
-       if (xx1>FLT_EPSILON) {
-               dx0= (minv[0]-maxv[0])/xx1;
-               xs0= dx0*(minv[1]-my2) + minv[0];
+       xx1 = maxv[1] - minv[1];
+       if (xx1 > FLT_EPSILON) {
+               dx0 = (minv[0] - maxv[0]) / xx1;
+               xs0 = dx0 * (minv[1] - my2) + minv[0];
        }
        else {
                dx0 = 0.0f;
@@ -223,43 +223,43 @@ static void zbuf_add_to_span(ZSpan *zspan, const float v1[2], const float v2[2])
 
        /* empty span */
        if (zspan->maxp1 == NULL) {
-               span= zspan->span1;
+               span = zspan->span1;
        }
-       else {  /* does it complete left span? */
-               if ( maxv == zspan->minp1 || minv==zspan->maxp1) {
-                       span= zspan->span1;
+       else {  /* does it complete left span? */
+               if (maxv == zspan->minp1 || minv == zspan->maxp1) {
+                       span = zspan->span1;
                }
                else {
-                       span= zspan->span2;
+                       span = zspan->span2;
                }
        }
 
-       if (span==zspan->span1) {
+       if (span == zspan->span1) {
 //             printf("left span my0 %d my2 %d\n", my0, my2);
-               if (zspan->minp1==NULL || zspan->minp1[1] > minv[1] ) {
-                       zspan->minp1= minv;
+               if (zspan->minp1 == NULL || zspan->minp1[1] > minv[1]) {
+                       zspan->minp1 = minv;
                }
-               if (zspan->maxp1==NULL || zspan->maxp1[1] < maxv[1] ) {
-                       zspan->maxp1= maxv;
+               if (zspan->maxp1 == NULL || zspan->maxp1[1] < maxv[1]) {
+                       zspan->maxp1 = maxv;
                }
-               if (my0<zspan->miny1) zspan->miny1= my0;
-               if (my2>zspan->maxy1) zspan->maxy1= my2;
+               if (my0 < zspan->miny1) zspan->miny1 = my0;
+               if (my2 > zspan->maxy1) zspan->maxy1 = my2;
        }
        else {
 //             printf("right span my0 %d my2 %d\n", my0, my2);
-               if (zspan->minp2==NULL || zspan->minp2[1] > minv[1] ) {
-                       zspan->minp2= minv;
+               if (zspan->minp2 == NULL || zspan->minp2[1] > minv[1]) {
+                       zspan->minp2 = minv;
                }
-               if (zspan->maxp2==NULL || zspan->maxp2[1] < maxv[1] ) {
-                       zspan->maxp2= maxv;
+               if (zspan->maxp2 == NULL || zspan->maxp2[1] < maxv[1]) {
+                       zspan->maxp2 = maxv;
                }
-               if (my0<zspan->miny2) zspan->miny2= my0;
-               if (my2>zspan->maxy2) zspan->maxy2= my2;
+               if (my0 < zspan->miny2) zspan->miny2 = my0;
+               if (my2 > zspan->maxy2) zspan->maxy2 = my2;
        }
 
-       for (y=my2; y>=my0; y--, xs0+= dx0) {
+       for (y = my2; y >= my0; y--, xs0 += dx0) {
                /* xs0 is the xcoord! */
-               span[y]= xs0;
+               span[y] = xs0;
        }
 }
 
@@ -292,79 +292,79 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
        zbuf_add_to_span(zspan, v4, v1);
 
        /* clipped */
-       if (zspan->minp2==NULL || zspan->maxp2==NULL) return;
+       if (zspan->minp2 == NULL || zspan->maxp2 == NULL) return;
 
        my0 = max_ii(zspan->miny1, zspan->miny2);
        my2 = min_ii(zspan->maxy1, zspan->maxy2);
 
        //      printf("my %d %d\n", my0, my2);
-       if (my2<my0) return;
+       if (my2 < my0) return;
 
        /* ZBUF DX DY, in floats still */
-       x1= v1[0]- v2[0];
-       x2= v2[0]- v3[0];
-       y1= v1[1]- v2[1];
-       y2= v2[1]- v3[1];
-       z1= v1[2]- v2[2];
-       z2= v2[2]- v3[2];
-       x0= y1*z2-z1*y2;
-       y0= z1*x2-x1*z2;
-       z0= x1*y2-y1*x2;
+       x1 = v1[0] - v2[0];
+       x2 = v2[0] - v3[0];
+       y1 = v1[1] - v2[1];
+       y2 = v2[1] - v3[1];
+       z1 = v1[2] - v2[2];
+       z2 = v2[2] - v3[2];
+       x0 = y1 * z2 - z1 * y2;
+       y0 = z1 * x2 - x1 * z2;
+       z0 = x1 * y2 - y1 * x2;
 
-       if (z0==0.0f) return;
+       if (z0 == 0.0f) return;
 
-       xx1= (x0*v1[0] + y0*v1[1])/z0 + v1[2];
+       xx1 = (x0 * v1[0] + y0 * v1[1]) / z0 + v1[2];
 
-       zxd= -(double)x0/(double)z0;
-       zyd= -(double)y0/(double)z0;
-       zy0= ((double)my2)*zyd + (double)xx1;
+       zxd = -(double)x0 / (double)z0;
+       zyd = -(double)y0 / (double)z0;
+       zy0 = ((double)my2) * zyd + (double)xx1;
 
        /* start-offset in rect */
-       rectx= zspan->rectx;
-       rectzofs= (float *)(zspan->rectz + rectx*my2);
-       rectpofs= ((DrawBufPixel *)zspan->rectdraw) + rectx*my2;
+       rectx = zspan->rectx;
+       rectzofs = (float *)(zspan->rectz + rectx * my2);
+       rectpofs = ((DrawBufPixel *)zspan->rectdraw) + rectx * my2;
 
        /* correct span */
-       sn1= (my0 + my2)/2;
+       sn1 = (my0 + my2) / 2;
        if (zspan->span1[sn1] < zspan->span2[sn1]) {
-               span1= zspan->span1+my2;
-               span2= zspan->span2+my2;
+               span1 = zspan->span1 + my2;
+               span2 = zspan->span2 + my2;
        }
        else {
-               span1= zspan->span2+my2;
-               span2= zspan->span1+my2;
+               span1 = zspan->span2 + my2;
+               span2 = zspan->span1 + my2;
        }
 
-       for (y=my2; y>=my0; y--, span1--, span2--) {
+       for (y = my2; y >= my0; y--, span1--, span2--) {
 
-               sn1= floor(*span1);
-               sn2= floor(*span2);
+               sn1 = floor(*span1);
+               sn2 = floor(*span2);
                sn1++;
 
-               if (sn2>=rectx) sn2= rectx-1;
-               if (sn1<0) sn1= 0;
+               if (sn2 >= rectx) sn2 = rectx - 1;
+               if (sn1 < 0) sn1 = 0;
 
-               if (sn2>=sn1) {
-                       zverg= (double)sn1*zxd + zy0;
-                       rz= rectzofs+sn1;
-                       rp= rectpofs+sn1;
-                       x= sn2-sn1;
+               if (sn2 >= sn1) {
+                       zverg = (double)sn1 * zxd + zy0;
+                       rz = rectzofs + sn1;
+                       rp = rectpofs + sn1;
+                       x = sn2 - sn1;
 
-                       while (x>=0) {
+                       while (x >= 0) {
                                if (zverg < (double)*rz) {
-                                       *rz= zverg;
-                                       *rp= *col;
+                                       *rz = zverg;
+                                       *rp = *col;
                                }
-                               zverg+= zxd;
+                               zverg += zxd;
                                rz++;
                                rp++;
                                x--;
                        }
                }
 
-               zy0-=zyd;
-               rectzofs-= rectx;
-               rectpofs-= rectx;
+               zy0 -= zyd;
+               rectzofs -= rectx;
+               rectpofs -= rectx;
        }
 }
 
@@ -377,43 +377,43 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
        int a, x, y, step;
 
        /* 1: tag pixels to be candidate for AA */
-       for (y=2; y<ysize; y++) {
+       for (y = 2; y < ysize; y++) {
                /* setup rows */
-               row1= rectmove + (y-2)*xsize;
-               row2= row1 + xsize;
-               row3= row2 + xsize;
-               for (x=2; x<xsize; x++, row1++, row2++, row3++) {
+               row1 = rectmove + (y - 2) * xsize;
+               row2 = row1 + xsize;
+               row3 = row2 + xsize;
+               for (x = 2; x < xsize; x++, row1++, row2++, row3++) {
                        if (row2[1]) {
-                               if (row2[0]==0 || row2[2]==0 || row1[1]==0 || row3[1]==0)
-                                       row2[1]= 128;
+                               if (row2[0] == 0 || row2[2] == 0 || row1[1] == 0 || row3[1] == 0)
+                                       row2[1] = 128;
                        }
                }
        }
 
        /* 2: evaluate horizontal scanlines and calculate alphas */
-       row1= rectmove;
-       for (y=0; y<ysize; y++) {
+       row1 = rectmove;
+       for (y = 0; y < ysize; y++) {
                row1++;
-               for (x=1; x<xsize; x++, row1++) {
-                       if (row1[0]==128 && row1[1]==128) {
+               for (x = 1; x < xsize; x++, row1++) {
+                       if (row1[0] == 128 && row1[1] == 128) {
                                /* find previous color and next color and amount of steps to blend */
-                               prev= row1[-1];
-                               step= 1;
-                               while (x+step<xsize && row1[step]==128)
+                               prev = row1[-1];
+                               step = 1;
+                               while (x + step < xsize && row1[step] == 128)
                                        step++;
 
-                               if (x+step!=xsize) {
+                               if (x + step != xsize) {
                                        /* now we can blend values */
-                                       next= row1[step];
+                                       next = row1[step];
 
                                        /* note, prev value can be next value, but we do this loop to clear 128 then */
-                                       for (a=0; a<step; a++) {
+                                       for (a = 0; a < step; a++) {
                                                int fac, mfac;
 
-                                               fac= ((a+1)<<8)/(step+1);
-                                               mfac= 255-fac;
+                                               fac = ((a + 1) << 8) / (step + 1);
+                                               mfac = 255 - fac;
 
-                                               row1[a]= (prev*mfac + next*fac)>>8;
+                                               row1[a] = (prev * mfac + next * fac) >> 8;
                                        }
                                }
                        }
@@ -422,28 +422,28 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
 
        /* 3: evaluate vertical scanlines and calculate alphas */
        /*    use for reading a copy of the original tagged buffer */
-       for (x=0; x<xsize; x++) {
-               row1= rectmove + x+xsize;
+       for (x = 0; x < xsize; x++) {
+               row1 = rectmove + x + xsize;
 
-               for (y=1; y<ysize; y++, row1+=xsize) {
-                       if (row1[0]==128 && row1[xsize]==128) {
+               for (y = 1; y < ysize; y++, row1 += xsize) {
+                       if (row1[0] == 128 && row1[xsize] == 128) {
                                /* find previous color and next color and amount of steps to blend */
-                               prev= row1[-xsize];
-                               step= 1;
-                               while (y+step<ysize && row1[step*xsize]==128)
+                               prev = row1[-xsize];
+                               step = 1;
+                               while (y + step < ysize && row1[step * xsize] == 128)
                                        step++;
 
-                               if (y+step!=ysize) {
+                               if (y + step != ysize) {
                                        /* now we can blend values */
-                                       next= row1[step*xsize];
+                                       next = row1[step * xsize];
                                        /* note, prev value can be next value, but we do this loop to clear 128 then */
-                                       for (a=0; a<step; a++) {
+                                       for (a = 0; a < step; a++) {
                                                int fac, mfac;
 
-                                               fac= ((a+1)<<8)/(step+1);
-                                               mfac= 255-fac;
+                                               fac = ((a + 1) << 8) / (step + 1);
+                                               mfac = 255 - fac;
 
-                                               row1[a*xsize]= (prev*mfac + next*fac)>>8;
+                                               row1[a * xsize] = (prev * mfac + next * fac) >> 8;
                                        }
                                }
                        }
@@ -451,15 +451,15 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
        }
 
        /* last: pixels with 0 we fill in zbuffer, with 1 we skip for mask */
-       for (y=2; y<ysize; y++) {
+       for (y = 2; y < ysize; y++) {
                /* setup rows */
-               row1= rectmove + (y-2)*xsize;
-               row2= row1 + xsize;
-               row3= row2 + xsize;
-               for (x=2; x<xsize; x++, row1++, row2++, row3++) {
-                       if (row2[1]==0) {
-                               if (row2[0]>1 || row2[2]>1 || row1[1]>1 || row3[1]>1)
-                                       row2[1]= 1;
+               row1 = rectmove + (y - 2) * xsize;
+               row2 = row1 + xsize;
+               row3 = row2 + xsize;
+               for (x = 2; x < xsize; x++, row1++, row2++, row3++) {
+                       if (row2[1] == 0) {
+                               if (row2[0] > 1 || row2[2] > 1 || row1[1] > 1 || row3[1] > 1)
+                                       row2[1] = 1;
                        }
                }
        }
@@ -473,32 +473,32 @@ static void quad_bezier_2d(float *result, float *v1, float *v2, float *ipodata)
 {
        float p1[2], p2[2], p3[2];
 
-       p3[0]= -v2[0];
-       p3[1]= -v2[1];
+       p3[0] = -v2[0];
+       p3[1] = -v2[1];
 
-       p1[0]= v1[0];
-       p1[1]= v1[1];
+       p1[0] = v1[0];
+       p1[1] = v1[1];
 
        /* official formula 2*p2 - 0.5*p1 - 0.5*p3 */
-       p2[0]= -0.5f*p1[0] - 0.5f*p3[0];
-       p2[1]= -0.5f*p1[1] - 0.5f*p3[1];
+       p2[0] = -0.5f * p1[0] - 0.5f * p3[0];
+       p2[1] = -0.5f * p1[1] - 0.5f * p3[1];
 
-       result[0]= ipodata[0]*p1[0] + ipodata[1]*p2[0] + ipodata[2]*p3[0];
-       result[1]= ipodata[0]*p1[1] + ipodata[1]*p2[1] + ipodata[2]*p3[1];
+       result[0] = ipodata[0] * p1[0] + ipodata[1] * p2[0] + ipodata[2] * p3[0];
+       result[1] = ipodata[0] * p1[1] + ipodata[1] * p2[1] + ipodata[2] * p3[1];
 }
 
 static void set_quad_bezier_ipo(float fac, float *data)
 {
-       float mfac= (1.0f-fac);
+       float mfac = (1.0f - fac);
 
-       data[0]= mfac*mfac;
-       data[1]= 2.0f*mfac*fac;
-       data[2]= fac*fac;
+       data[0] = mfac * mfac;
+       data[1] = 2.0f * mfac * fac;
+       data[2] = fac * fac;
 }
 
 void zbuf_accumulate_vecblur(
-        NodeBlurData *nbd, int xsize, int ysize, float *newrect,
-        const float *imgrect, float *vecbufrect, const float *zbufrect)
+       NodeBlurData *nbd, int xsize, int ysize, float *newrect,
+       const float *imgrect, float *vecbufrect, const float *zbufrect)
 {
        ZSpan zspan;
        DrawBufPixel *rectdraw, *dr;
@@ -506,64 +506,64 @@ void zbuf_accumulate_vecblur(
        float v1[3], v2[3], v3[3], v4[3], fx, fy;
        const float *dimg, *dz, *ro;
        float *rectvz, *dvz, *dvec1, *dvec2, *dz1, *dz2, *rectz;
-       float *minvecbufrect= NULL, *rectweight, *rw, *rectmax, *rm;
-       float maxspeedsq= (float)nbd->maxspeed*nbd->maxspeed;
-       int y, x, step, maxspeed=nbd->maxspeed, samples= nbd->samples;
-       int tsktsk= 0;
-       static int firsttime= 1;
+       float *minvecbufrect = NULL, *rectweight, *rw, *rectmax, *rm;
+       float maxspeedsq = (float)nbd->maxspeed * nbd->maxspeed;
+       int y, x, step, maxspeed = nbd->maxspeed, samples = nbd->samples;
+       int tsktsk = 0;
+       static int firsttime = 1;
        char *rectmove, *dm;
 
        zbuf_alloc_span(&zspan, xsize, ysize, 1.0f);
-       zspan.zmulx=  ((float)xsize)/2.0f;
-       zspan.zmuly=  ((float)ysize)/2.0f;
-       zspan.zofsx= 0.0f;
-       zspan.zofsy= 0.0f;
+       zspan.zmulx =  ((float)xsize) / 2.0f;
+       zspan.zmuly =  ((float)ysize) / 2.0f;
+       zspan.zofsx = 0.0f;
+       zspan.zofsy = 0.0f;
 
        /* the buffers */
-       rectz= (float*)MEM_mapallocN(sizeof(float)*xsize*ysize, "zbuf accum");
-       zspan.rectz= (int *)rectz;
+       rectz = (float *)MEM_mapallocN(sizeof(float) * xsize * ysize, "zbuf accum");
+       zspan.rectz = (int *)rectz;
 
-       rectmove= (char*)MEM_mapallocN(xsize*ysize, "rectmove");
-       rectdraw= (DrawBufPixel*)MEM_mapallocN(sizeof(DrawBufPixel)*xsize*ysize, "rect draw");
-       zspan.rectdraw= rectdraw;
+       rectmove = (char *)MEM_mapallocN(xsize * ysize, "rectmove");
+       rectdraw = (DrawBufPixel *)MEM_mapallocN(sizeof(DrawBufPixel) * xsize * ysize, "rect draw");
+       zspan.rectdraw = rectdraw;
 
-       rectweight= (float*)MEM_mapallocN(sizeof(float)*xsize*ysize, "rect weight");
-       rectmax= (float*)MEM_mapallocN(sizeof(float)*xsize*ysize, "rect max");
+       rectweight = (float *)MEM_mapallocN(sizeof(float) * xsize * ysize, "rect weight");
+       rectmax = (float *)MEM_mapallocN(sizeof(float) * xsize * ysize, "rect max");
 
        /* debug... check if PASS_VECTOR_MAX still is in buffers */
-       dvec1= vecbufrect;
-       for (x= 4*xsize*ysize; x>0; x--, dvec1++) {
-               if (dvec1[0]==PASS_VECTOR_MAX) {
-                       dvec1[0]= 0.0f;
-                       tsktsk= 1;
+       dvec1 = vecbufrect;
+       for (x = 4 * xsize * ysize; x > 0; x--, dvec1++) {
+               if (dvec1[0] == PASS_VECTOR_MAX) {
+                       dvec1[0] = 0.0f;
+                       tsktsk = 1;
                }
        }
        if (tsktsk) printf("Found uninitialized speed in vector buffer... fixed.\n");
 
        /* min speed? then copy speedbuffer to recalculate speed vectors */
        if (nbd->minspeed) {
-               float minspeed= (float)nbd->minspeed;
-               float minspeedsq= minspeed*minspeed;
+               float minspeed = (float)nbd->minspeed;
+               float minspeedsq = minspeed * minspeed;
 
-               minvecbufrect= (float*)MEM_mapallocN(4*sizeof(float)*xsize*ysize, "minspeed buf");
+               minvecbufrect = (float *)MEM_mapallocN(4 * sizeof(float) * xsize * ysize, "minspeed buf");
 
-               dvec1= vecbufrect;
-               dvec2= minvecbufrect;
-               for (x= 2*xsize*ysize; x>0; x--, dvec1+=2, dvec2+=2) {
-                       if (dvec1[0]==0.0f && dvec1[1]==0.0f) {
-                               dvec2[0]= dvec1[0];
-                               dvec2[1]= dvec1[1];
+               dvec1 = vecbufrect;
+               dvec2 = minvecbufrect;
+               for (x = 2 * xsize * ysize; x > 0; x--, dvec1 += 2, dvec2 += 2) {
+                       if (dvec1[0] == 0.0f && dvec1[1] == 0.0f) {
+                               dvec2[0] = dvec1[0];
+                               dvec2[1] = dvec1[1];
                        }
                        else {
-                               float speedsq= dvec1[0]*dvec1[0] + dvec1[1]*dvec1[1];
+                               float speedsq = dvec1[0] * dvec1[0] + dvec1[1] * dvec1[1];
                                if (speedsq <= minspeedsq) {
-                                       dvec2[0]= 0.0f;
-                                       dvec2[1]= 0.0f;
+                                       dvec2[0] = 0.0f;
+                                       dvec2[1] = 0.0f;
                                }
                                else {
                                        speedsq = 1.0f - minspeed / sqrtf(speedsq);
-                                       dvec2[0]= speedsq*dvec1[0];
-                                       dvec2[1]= speedsq*dvec1[1];
+                                       dvec2[0] = speedsq * dvec1[0];
+                                       dvec2[1] = speedsq * dvec1[1];
                                }
                        }
                }
@@ -571,75 +571,75 @@ void zbuf_accumulate_vecblur(
        }
 
        /* make vertex buffer with averaged speed and zvalues */
-       rectvz= (float*)MEM_mapallocN(4*sizeof(float)*(xsize+1)*(ysize+1), "vertices");
-       dvz= rectvz;
-       for (y=0; y<=ysize; y++) {
+       rectvz = (float *)MEM_mapallocN(4 * sizeof(float) * (xsize + 1) * (ysize + 1), "vertices");
+       dvz = rectvz;
+       for (y = 0; y <= ysize; y++) {
 
-               if (y==0)
-                       dvec1= vecbufrect + 4*y*xsize;
+               if (y == 0)
+                       dvec1 = vecbufrect + 4 * y * xsize;
                else
-                       dvec1= vecbufrect + 4*(y-1)*xsize;
+                       dvec1 = vecbufrect + 4 * (y - 1) * xsize;
 
-               if (y==ysize)
-                       dvec2= vecbufrect + 4*(y-1)*xsize;
+               if (y == ysize)
+                       dvec2 = vecbufrect + 4 * (y - 1) * xsize;
                else
-                       dvec2= vecbufrect + 4*y*xsize;
+                       dvec2 = vecbufrect + 4 * y * xsize;
 
-               for (x=0; x<=xsize; x++) {
+               for (x = 0; x <= xsize; x++) {
 
                        /* two vectors, so a step loop */
-                       for (step=0; step<2; step++, dvec1+=2, dvec2+=2, dvz+=2) {
+                       for (step = 0; step < 2; step++, dvec1 += 2, dvec2 += 2, dvz += 2) {
                                /* average on minimal speed */
-                               int div= 0;
+                               int div = 0;
 
-                               if (x!=0) {
-                                       if (dvec1[-4]!=0.0f || dvec1[-3]!=0.0f) {
-                                               dvz[0]= dvec1[-4];
-                                               dvz[1]= dvec1[-3];
+                               if (x != 0) {
+                                       if (dvec1[-4] != 0.0f || dvec1[-3] != 0.0f) {
+                                               dvz[0] = dvec1[-4];
+                                               dvz[1] = dvec1[-3];
                                                div++;
                                        }
-                                       if (dvec2[-4]!=0.0f || dvec2[-3]!=0.0f) {
-                                               if (div==0) {
-                                                       dvz[0]= dvec2[-4];
-                                                       dvz[1]= dvec2[-3];
+                                       if (dvec2[-4] != 0.0f || dvec2[-3] != 0.0f) {
+                                               if (div == 0) {
+                                                       dvz[0] = dvec2[-4];
+                                                       dvz[1] = dvec2[-3];
                                                        div++;
                                                }
-                                               else if ( (ABS(dvec2[-4]) + ABS(dvec2[-3]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
-                                                       dvz[0]= dvec2[-4];
-                                                       dvz[1]= dvec2[-3];
+                                               else if ( (ABS(dvec2[-4]) + ABS(dvec2[-3])) < (ABS(dvz[0]) + ABS(dvz[1])) ) {
+                                                       dvz[0] = dvec2[-4];
+                                                       dvz[1] = dvec2[-3];
                                                }
                                        }
                                }
 
-                               if (x!=xsize) {
-                                       if (dvec1[0]!=0.0f || dvec1[1]!=0.0f) {
-                                               if (div==0) {
-                                                       dvz[0]= dvec1[0];
-                                                       dvz[1]= dvec1[1];
+                               if (x != xsize) {
+                                       if (dvec1[0] != 0.0f || dvec1[1] != 0.0f) {
+                                               if (div == 0) {
+                                                       dvz[0] = dvec1[0];
+                                                       dvz[1] = dvec1[1];
                                                        div++;
                                                }
-                                               else if ( (ABS(dvec1[0]) + ABS(dvec1[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
-                                                       dvz[0]= dvec1[0];
-                                                       dvz[1]= dvec1[1];
+                                               else if ( (ABS(dvec1[0]) + ABS(dvec1[1])) < (ABS(dvz[0]) + ABS(dvz[1])) ) {
+                                                       dvz[0] = dvec1[0];
+                                                       dvz[1] = dvec1[1];
                                                }
                                        }
-                                       if (dvec2[0]!=0.0f || dvec2[1]!=0.0f) {
-                                               if (div==0) {
-                                                       dvz[0]= dvec2[0];
-                                                       dvz[1]= dvec2[1];
+                                       if (dvec2[0] != 0.0f || dvec2[1] != 0.0f) {
+                                               if (div == 0) {
+                                                       dvz[0] = dvec2[0];
+                                                       dvz[1] = dvec2[1];
                                                }
-                                               else if ( (ABS(dvec2[0]) + ABS(dvec2[1]))< (ABS(dvz[0]) + ABS(dvz[1])) ) {
-                                                       dvz[0]= dvec2[0];
-                                                       dvz[1]= dvec2[1];
+                                               else if ( (ABS(dvec2[0]) + ABS(dvec2[1])) < (ABS(dvz[0]) + ABS(dvz[1])) ) {
+                                                       dvz[0] = dvec2[0];
+                                                       dvz[1] = dvec2[1];
                                                }
                                        }
                                }
                                if (maxspeed) {
-                                       float speedsq= dvz[0]*dvz[0] + dvz[1]*dvz[1];
+                                       float speedsq = dvz[0] * dvz[0] + dvz[1] * dvz[1];
                                        if (speedsq > maxspeedsq) {
                                                speedsq = (float)maxspeed / sqrtf(speedsq);
-                                               dvz[0]*= speedsq;
-                                               dvz[1]*= speedsq;
+                                               dvz[0] *= speedsq;
+                                               dvz[1] *= speedsq;
                                        }
                                }
                        }
@@ -647,117 +647,117 @@ void zbuf_accumulate_vecblur(
        }
 
        /* set border speeds to keep border speeds on border */
-       dz1= rectvz;
-       dz2= rectvz+4*(ysize)*(xsize+1);
-       for (x=0; x<=xsize; x++, dz1+=4, dz2+=4) {
-               dz1[1]= 0.0f;
-               dz2[1]= 0.0f;
-               dz1[3]= 0.0f;
-               dz2[3]= 0.0f;
+       dz1 = rectvz;
+       dz2 = rectvz + 4 * (ysize) * (xsize + 1);
+       for (x = 0; x <= xsize; x++, dz1 += 4, dz2 += 4) {
+               dz1[1] = 0.0f;
+               dz2[1] = 0.0f;
+               dz1[3] = 0.0f;
+               dz2[3] = 0.0f;
        }
-       dz1= rectvz;
-       dz2= rectvz+4*(xsize);
-       for (y=0; y<=ysize; y++, dz1+=4*(xsize+1), dz2+=4*(xsize+1)) {
-               dz1[0]= 0.0f;
-               dz2[0]= 0.0f;
-               dz1[2]= 0.0f;
-               dz2[2]= 0.0f;
+       dz1 = rectvz;
+       dz2 = rectvz + 4 * (xsize);
+       for (y = 0; y <= ysize; y++, dz1 += 4 * (xsize + 1), dz2 += 4 * (xsize + 1)) {
+               dz1[0] = 0.0f;
+               dz2[0] = 0.0f;
+               dz1[2] = 0.0f;
+               dz2[2] = 0.0f;
        }
 
        /* tag moving pixels, only these faces we draw */
-       dm= rectmove;
-       dvec1= vecbufrect;
-       for (x=xsize*ysize; x>0; x--, dm++, dvec1+=4) {
-               if ((dvec1[0]!=0.0f || dvec1[1]!=0.0f || dvec1[2]!=0.0f || dvec1[3]!=0.0f))
-                       *dm= 255;
+       dm = rectmove;
+       dvec1 = vecbufrect;
+       for (x = xsize * ysize; x > 0; x--, dm++, dvec1 += 4) {
+               if ((dvec1[0] != 0.0f || dvec1[1] != 0.0f || dvec1[2] != 0.0f || dvec1[3] != 0.0f))
+                       *dm = 255;
        }
 
        antialias_tagbuf(xsize, ysize, rectmove);
 
        /* has to become static, the init-jit calls a random-seed, screwing up texture noise node */
        if (firsttime) {
-               firsttime= 0;
+               firsttime = 0;
                BLI_jitter_init(jit, 256);
        }
 
-       memset(newrect, 0, sizeof(float)*xsize*ysize*4);
+       memset(newrect, 0, sizeof(float) * xsize * ysize * 4);
 
        /* accumulate */
-       samples/= 2;
-       for (step= 1; step<=samples; step++) {
-               float speedfac= 0.5f*nbd->fac*(float)step/(float)(samples+1);
+       samples /= 2;
+       for (step = 1; step <= samples; step++) {
+               float speedfac = 0.5f * nbd->fac * (float)step / (float)(samples + 1);
                int side;
 
-               for (side=0; side<2; side++) {
+               for (side = 0; side < 2; side++) {
                        float blendfac, ipodata[4];
 
                        /* clear zbuf, if we draw future we fill in not moving pixels */
                        if (0)
-                               for (x= xsize*ysize-1; x>=0; x--) rectz[x]= 10e16;
+                               for (x = xsize * ysize - 1; x >= 0; x--) rectz[x] = 10e16;
                        else
-                               for (x= xsize*ysize-1; x>=0; x--) {
-                                       if (rectmove[x]==0)
-                                               rectz[x]= zbufrect[x];
+                               for (x = xsize * ysize - 1; x >= 0; x--) {
+                                       if (rectmove[x] == 0)
+                                               rectz[x] = zbufrect[x];
                                        else
-                                               rectz[x]= 10e16;
+                                               rectz[x] = 10e16;
                                }
 
                        /* clear drawing buffer */
-                       for (x= xsize*ysize-1; x>=0; x--) rectdraw[x].colpoin= NULL;
+                       for (x = xsize * ysize - 1; x >= 0; x--) rectdraw[x].colpoin = NULL;
 
-                       dimg= imgrect;
-                       dm= rectmove;
-                       dz= zbufrect;
-                       dz1= rectvz;
-                       dz2= rectvz + 4*(xsize + 1);
+                       dimg = imgrect;
+                       dm = rectmove;
+                       dz = zbufrect;
+                       dz1 = rectvz;
+                       dz2 = rectvz + 4 * (xsize + 1);
 
                        if (side) {
-                               if (nbd->curved==0) {
-                                       dz1+= 2;
-                                       dz2+= 2;
+                               if (nbd->curved == 0) {
+                                       dz1 += 2;
+                                       dz2 += 2;
                                }
-                               speedfac= -speedfac;
+                               speedfac = -speedfac;
                        }
 
-                       set_quad_bezier_ipo(0.5f + 0.5f*speedfac, ipodata);
+                       set_quad_bezier_ipo(0.5f + 0.5f * speedfac, ipodata);
 
-                       for (fy= -0.5f+jit[step & 255][0], y=0; y<ysize; y++, fy+=1.0f) {
-                               for (fx= -0.5f+jit[step & 255][1], x=0; x<xsize; x++, fx+=1.0f, dimg+=4, dz1+=4, dz2+=4, dm++, dz++) {
-                                       if (*dm>1) {
+                       for (fy = -0.5f + jit[step & 255][0], y = 0; y < ysize; y++, fy += 1.0f) {
+                               for (fx = -0.5f + jit[step & 255][1], x = 0; x < xsize; x++, fx += 1.0f, dimg += 4, dz1 += 4, dz2 += 4, dm++, dz++) {
+                                       if (*dm > 1) {
                                                float jfx = fx + 0.5f;
                                                float jfy = fy + 0.5f;
                                                DrawBufPixel col;
 
                                                /* make vertices */
-                                               if (nbd->curved) {      /* curved */
-                                                       quad_bezier_2d(v1, dz1, dz1+2, ipodata);
-                                                       v1[0]+= jfx; v1[1]+= jfy; v1[2]= *dz;
+                                               if (nbd->curved) {  /* curved */
+                                                       quad_bezier_2d(v1, dz1, dz1 + 2, ipodata);
+                                                       v1[0] += jfx; v1[1] += jfy; v1[2] = *dz;
 
-                                                       quad_bezier_2d(v2, dz1+4, dz1+4+2, ipodata);
-                                                       v2[0]+= jfx+1.0f; v2[1]+= jfy; v2[2]= *dz;
+                                                       quad_bezier_2d(v2, dz1 + 4, dz1 + 4 + 2, ipodata);
+                                                       v2[0] += jfx + 1.0f; v2[1] += jfy; v2[2] = *dz;
 
-                                                       quad_bezier_2d(v3, dz2+4, dz2+4+2, ipodata);
-                                                       v3[0]+= jfx+1.0f; v3[1]+= jfy+1.0f; v3[2]= *dz;
+                                                       quad_bezier_2d(v3, dz2 + 4, dz2 + 4 + 2, ipodata);
+                                                       v3[0] += jfx + 1.0f; v3[1] += jfy + 1.0f; v3[2] = *dz;
 
-                                                       quad_bezier_2d(v4, dz2, dz2+2, ipodata);
-                                                       v4[0]+= jfx; v4[1]+= jfy+1.0f; v4[2]= *dz;
+                                                       quad_bezier_2d(v4, dz2, dz2 + 2, ipodata);
+                                                       v4[0] += jfx; v4[1] += jfy + 1.0f; v4[2] = *dz;
                                                }
                                                else {
-                                                       v1[0]= speedfac*dz1[0]+jfx;      v1[1]= speedfac*dz1[1]+jfy;      v1[2]= *dz;
-                                                       v2[0]= speedfac*dz1[4]+jfx+1.0f; v2[1]= speedfac*dz1[5]+jfy;      v2[2]= *dz;
-                                                       v3[0]= speedfac*dz2[4]+jfx+1.0f; v3[1]= speedfac*dz2[5]+jfy+1.0f; v3[2]= *dz;
-                                                       v4[0]= speedfac*dz2[0]+jfx;      v4[1]= speedfac*dz2[1]+jfy+1.0f; v4[2]= *dz;
+                                                       ARRAY_SET_ITEMS(v1, speedfac * dz1[0] + jfx,        speedfac * dz1[1] + jfy,        *dz);
+                                                       ARRAY_SET_ITEMS(v2, speedfac * dz1[4] + jfx + 1.0f, speedfac * dz1[5] + jfy,        *dz);
+                                                       ARRAY_SET_ITEMS(v3, speedfac * dz2[4] + jfx + 1.0f, speedfac * dz2[5] + jfy + 1.0f, *dz);
+                                                       ARRAY_SET_ITEMS(v4, speedfac * dz2[0] + jfx,        speedfac * dz2[1] + jfy + 1.0f, *dz);
                                                }
-                                               if (*dm==255) col.alpha= 1.0f;
-                                               else if (*dm<2) col.alpha= 0.0f;
-                                               else col.alpha= ((float)*dm)/255.0f;
-                                               col.colpoin= dimg;
+                                               if (*dm == 255) col.alpha = 1.0f;
+                                               else if (*dm < 2) col.alpha = 0.0f;
+                                               else col.alpha = ((float)*dm) / 255.0f;
+                                               col.colpoin = dimg;
 
                                                zbuf_fill_in_rgba(&zspan, &col, v1, v2, v3, v4);
                                        }
                                }
-                               dz1+=4;
-                               dz2+=4;
+                               dz1 += 4;
+                               dz2 += 4;
                        }
 
                        /* blend with a falloff. this fixes the ugly effect you get with
@@ -767,43 +767,43 @@ void zbuf_accumulate_vecblur(
                         * we don't know what is behind it so we don't do that. this hack
                         * overestimates the contribution of foreground pixels but looks a
                         * bit better without a sudden cutoff. */
-                       blendfac= ((samples - step)/(float)samples);
+                       blendfac = ((samples - step) / (float)samples);
                        /* smoothstep to make it look a bit nicer as well */
-                       blendfac= 3.0f*pow(blendfac, 2.0f) - 2.0f*pow(blendfac, 3.0f);
+                       blendfac = 3.0f * pow(blendfac, 2.0f) - 2.0f * pow(blendfac, 3.0f);
 
                        /* accum */
-                       rw= rectweight;
-                       rm= rectmax;
-                       for (dr= rectdraw, dz2=newrect, x= xsize*ysize-1; x>=0; x--, dr++, dz2+=4, rw++, rm++) {
+                       rw = rectweight;
+                       rm = rectmax;
+                       for (dr = rectdraw, dz2 = newrect, x = xsize * ysize - 1; x >= 0; x--, dr++, dz2 += 4, rw++, rm++) {
                                if (dr->colpoin) {
-                                       float bfac= dr->alpha*blendfac;
+                                       float bfac = dr->alpha * blendfac;
 
-                                       dz2[0] += bfac*dr->colpoin[0];
-                                       dz2[1] += bfac*dr->colpoin[1];
-                                       dz2[2] += bfac*dr->colpoin[2];
-                                       dz2[3] += bfac*dr->colpoin[3];
+                                       dz2[0] += bfac * dr->colpoin[0];
+                                       dz2[1] += bfac * dr->colpoin[1];
+                                       dz2[2] += bfac * dr->colpoin[2];
+                                       dz2[3] += bfac * dr->colpoin[3];
 
                                        *rw += bfac;
-                                       *rm= MAX2(*rm, bfac);
+                                       *rm = MAX2(*rm, bfac);
                                }
                        }
                }
        }
 
        /* blend between original images and accumulated image */
-       rw= rectweight;
-       rm= rectmax;
-       ro= imgrect;
-       dm= rectmove;
-       for (dz2=newrect, x= xsize*ysize-1; x>=0; x--, dz2+=4, ro+=4, rw++, rm++, dm++) {
+       rw = rectweight;
+       rm = rectmax;
+       ro = imgrect;
+       dm = rectmove;
+       for (dz2 = newrect, x = xsize * ysize - 1; x >= 0; x--, dz2 += 4, ro += 4, rw++, rm++, dm++) {
                float mfac = *rm;
-               float fac = (*rw == 0.0f)? 0.0f: mfac/(*rw);
+               float fac = (*rw == 0.0f) ? 0.0f : mfac / (*rw);
                float nfac = 1.0f - mfac;
 
-               dz2[0]= fac*dz2[0] + nfac*ro[0];
-               dz2[1]= fac*dz2[1] + nfac*ro[1];
-               dz2[2]= fac*dz2[2] + nfac*ro[2];
-               dz2[3]= fac*dz2[3] + nfac*ro[3];
+               dz2[0] = fac * dz2[0] + nfac * ro[0];
+               dz2[1] = fac * dz2[1] + nfac * ro[1];
+               dz2[2] = fac * dz2[2] + nfac * ro[2];
+               dz2[3] = fac * dz2[3] + nfac * ro[3];
        }
 
        MEM_freeN(rectz);
index 3e09cdd976866b975e847186355f126c523d34bb..f96f496a0f95a9abf449bd5214e98b29feccb90b 100644 (file)
@@ -183,7 +183,6 @@ data_to_c_simple(engines/eevee/shaders/lightprobe_planar_downsample_vert.glsl SR
 data_to_c_simple(engines/eevee/shaders/prepass_frag.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/prepass_vert.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/shadow_frag.glsl SRC)
-data_to_c_simple(engines/eevee/shaders/shadow_geom.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/shadow_vert.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/shadow_store_frag.glsl SRC)
 data_to_c_simple(engines/eevee/shaders/shadow_copy_frag.glsl SRC)
index 7496142a26e453daf6b56d7c24f9f3118ad35491..86c9b9c850b5d6eb19978cb025b4c4435c3a7058 100644 (file)
@@ -44,7 +44,6 @@ static struct {
 } e_data = {NULL}; /* Engine data */
 
 extern char datatoc_shadow_vert_glsl[];
-extern char datatoc_shadow_geom_glsl[];
 extern char datatoc_shadow_frag_glsl[];
 extern char datatoc_shadow_store_frag_glsl[];
 extern char datatoc_shadow_copy_frag_glsl[];
@@ -106,7 +105,7 @@ void EEVEE_lights_init(EEVEE_ViewLayerData *sldata)
 
        if (!e_data.shadow_sh) {
                e_data.shadow_sh = DRW_shader_create(
-                       datatoc_shadow_vert_glsl, datatoc_shadow_geom_glsl, datatoc_shadow_frag_glsl, NULL);
+                       datatoc_shadow_vert_glsl, NULL, datatoc_shadow_frag_glsl, NULL);
        }
 
        if (!sldata->lamps) {
@@ -287,8 +286,7 @@ void EEVEE_lights_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
                DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS;
                psl->shadow_pass = DRW_pass_create("Shadow Pass", state);
 
-               DRWShadingGroup *grp = stl->g_data->shadow_shgrp = DRW_shgroup_create(e_data.shadow_sh, psl->shadow_pass);
-               DRW_shgroup_uniform_block(grp, "shadow_render_block", sldata->shadow_render_ubo);
+               stl->g_data->shadow_shgrp = DRW_shgroup_create(e_data.shadow_sh, psl->shadow_pass);
        }
 }
 
@@ -387,30 +385,26 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob)
 
 /* Add a shadow caster to the shadowpasses */
 void EEVEE_lights_cache_shcaster_add(
-        EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, struct Gwn_Batch *geom, Object *ob)
+        EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_StorageList *stl, struct Gwn_Batch *geom, Object *ob)
 {
-       DRW_shgroup_call_object_instances_add(
+       DRW_shgroup_call_object_add(
                stl->g_data->shadow_shgrp,
-               geom, ob,
-               &sldata->lamps->shadow_instance_count);
+               geom, ob);
 }
 
 void EEVEE_lights_cache_shcaster_material_add(
-       EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl, struct GPUMaterial *gpumat,
-       struct Gwn_Batch *geom, struct Object *ob, float (*obmat)[4], float *alpha_threshold)
+       EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_PassList *psl, struct GPUMaterial *gpumat,
+       struct Gwn_Batch *geom, struct Object *ob, float *alpha_threshold)
 {
        /* TODO / PERF : reuse the same shading group for objects with the same material */
        DRWShadingGroup *grp = DRW_shgroup_material_create(gpumat, psl->shadow_pass);
 
        if (grp == NULL) return;
 
-       DRW_shgroup_uniform_block(grp, "shadow_render_block", sldata->shadow_render_ubo);
-       DRW_shgroup_uniform_mat4(grp, "ShadowModelMatrix", (float *)obmat);
-
        if (alpha_threshold != NULL)
                DRW_shgroup_uniform_float(grp, "alphaThreshold", alpha_threshold, 1);
 
-       DRW_shgroup_call_object_instances_add(grp, geom, ob, &sldata->lamps->shadow_instance_count);
+       DRW_shgroup_call_object_add(grp, geom, ob);
 }
 
 /* Make that object update shadow casting lamps inside its influence bounding box. */
@@ -719,7 +713,6 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
        }
 
        /* Lamps Matrices */
-       float (*viewmat)[4], projmat[4][4];
        int sh_nbr = 1; /* TODO : MSM */
        int cascade_nbr = la->cascade_count;
 
@@ -730,10 +723,10 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
 
        /* obmat = Object Space > World Space */
        /* viewmat = World Space > View Space */
-       invert_m4_m4(sh_data->clipmat.mat[DRW_MAT_VIEW], ob->obmat);
-       viewmat = sh_data->clipmat.mat[DRW_MAT_VIEW];
+       float (*viewmat)[4] = sh_data->viewmat;
+       invert_m4_m4(viewmat, ob->obmat);
        normalize_m4(viewmat);
-       invert_m4_m4(sh_data->clipmat.mat[DRW_MAT_VIEWINV], viewmat);
+       invert_m4_m4(sh_data->viewinv, viewmat);
 
        /* The technique consists into splitting
         * the view frustum into several sub-frustum
@@ -833,8 +826,8 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
        cascade_data->split_start[0] = LERP(la->cascade_fade, cascade_data->split_end[cascade_nbr - 1], prev_split);
 
        /* For each cascade */
-       rctf rect_clip, rect_cascade;
        for (int c = 0; c < cascade_nbr; ++c) {
+               float (*projmat)[4] = sh_data->projmat[c];
                /* Given 8 frustum corners */
                float corners[8][3] = {
                        /* Near Cap */
@@ -877,32 +870,17 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
                add_v2_v2(center, shadow_texco);
 
                /* Expand the projection to cover frustum range */
+               rctf rect_cascade;
                BLI_rctf_init_pt_radius(&rect_cascade, center, sh_data->radius[c]);
                orthographic_m4(projmat,
                                rect_cascade.xmin, rect_cascade.xmax,
                                rect_cascade.ymin, rect_cascade.ymax,
                                la->clipsta, la->clipend);
 
-               if (c == 0) {
-                       memcpy(&rect_clip, &rect_cascade, sizeof(rect_clip));
-               }
-               else {
-                       BLI_rctf_union(&rect_clip, &rect_cascade);
-               }
-
                mul_m4_m4m4(sh_data->viewprojmat[c], projmat, viewmat);
                mul_m4_m4m4(cascade_data->shadowmat[c], texcomat, sh_data->viewprojmat[c]);
        }
 
-       /* Clipping mats */
-       orthographic_m4(sh_data->clipmat.mat[DRW_MAT_WIN],
-                       rect_clip.xmin, rect_clip.xmax,
-                       rect_clip.ymin, rect_clip.ymax,
-                       la->clipsta, la->clipend);
-       mul_m4_m4m4(sh_data->clipmat.mat[DRW_MAT_PERS], sh_data->clipmat.mat[DRW_MAT_WIN], viewmat);
-       invert_m4_m4(sh_data->clipmat.mat[DRW_MAT_WININV], sh_data->clipmat.mat[DRW_MAT_WIN]);
-       invert_m4_m4(sh_data->clipmat.mat[DRW_MAT_PERSINV], sh_data->clipmat.mat[DRW_MAT_PERS]);
-
        ubo_data->bias = 0.05f * la->bias;
        ubo_data->near = la->clipsta;
        ubo_data->far = la->clipend;
@@ -1004,37 +982,6 @@ void EEVEE_lights_update(EEVEE_ViewLayerData *sldata)
        }
 }
 
-static void eevee_shadows_cube_culling_frustum(EEVEE_ShadowRender *srd)
-{
-       float persmat[4][4], persinv[4][4];
-       float viewmat[4][4], viewinv[4][4];
-       float winmat[4][4], wininv[4][4];
-       orthographic_m4(winmat, -srd->clip_far, srd->clip_far, -srd->clip_far, srd->clip_far, -srd->clip_far, srd->clip_far);
-       DRW_viewport_matrix_override_set(winmat, DRW_MAT_WIN);
-
-       invert_m4_m4(wininv, winmat);
-       DRW_viewport_matrix_override_set(wininv, DRW_MAT_WININV);
-
-       unit_m4(viewmat);
-       negate_v3_v3(viewmat[3], srd->position);
-       DRW_viewport_matrix_override_set(viewmat, DRW_MAT_VIEW);
-
-       unit_m4(viewinv);
-       copy_v3_v3(viewinv[3], srd->position);
-       DRW_viewport_matrix_override_set(viewinv, DRW_MAT_VIEWINV);
-
-       mul_m4_m4m4(persmat, winmat, viewmat);
-       DRW_viewport_matrix_override_set(persmat, DRW_MAT_PERS);
-
-       invert_m4_m4(persinv, persmat);
-       DRW_viewport_matrix_override_set(persinv, DRW_MAT_PERSINV);
-}
-
-static void eevee_shadows_cascade_culling_frustum(EEVEE_ShadowCascadeData *evscd)
-{
-       DRW_viewport_matrix_override_set_all(&evscd->clipmat);
-}
-
 /* this refresh lamps shadow buffers */
 void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl)
 {
@@ -1058,32 +1005,45 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl)
                        continue;
                }
 
+               DRWMatrixState render_mats;
+               float (*winmat)[4] = render_mats.mat[DRW_MAT_WIN];
+               float (*viewmat)[4] = render_mats.mat[DRW_MAT_VIEW];
+               float (*persmat)[4] = render_mats.mat[DRW_MAT_PERS];
+
                EEVEE_ShadowRender *srd = &linfo->shadow_render_data;
                EEVEE_ShadowCubeData *evscd = &led->data.scd;
 
-               float cube_projmat[4][4];
-               float cube_viewmat[4][4];
-               perspective_m4(cube_projmat, -la->clipsta, la->clipsta, -la->clipsta, la->clipsta, la->clipsta, la->clipend);
-               unit_m4(cube_viewmat);
+               perspective_m4(winmat, -la->clipsta, la->clipsta, -la->clipsta, la->clipsta, la->clipsta, la->clipend);
 
                srd->clip_near = la->clipsta;
                srd->clip_far = la->clipend;
                copy_v3_v3(srd->position, ob->obmat[3]);
 
-               negate_v3_v3(cube_viewmat[3], srd->position);
-               for (int j = 0; j < 6; j++) {
-                       mul_m4_m4m4(srd->viewmat[j], cubefacemat[j], cube_viewmat);
-                       mul_m4_m4m4(srd->shadowmat[j], cube_projmat, srd->viewmat[j]);
-               }
                DRW_uniformbuffer_update(sldata->shadow_render_ubo, srd);
 
-               eevee_shadows_cube_culling_frustum(srd);
-
                /* Render shadow cube */
-               linfo->shadow_instance_count = 6;
-               GPU_framebuffer_bind(sldata->shadow_cube_target_fb);
-               GPU_framebuffer_clear_depth(sldata->shadow_cube_target_fb, 1.0f);
-               DRW_draw_pass(psl->shadow_pass);
+               /* Render 6 faces separatly: seems to be faster for the general case.
+                * The only time it's more beneficial is when the CPU culling overhead
+                * outweight the instancing overhead. which is rarelly the case. */
+               for (int j = 0; j < 6; j++) {
+                       /* TODO optimize */
+                       float tmp[4][4];
+                       unit_m4(tmp);
+                       negate_v3_v3(tmp[3], srd->position);
+                       mul_m4_m4m4(viewmat, cubefacemat[j], tmp);
+                       mul_m4_m4m4(persmat, winmat, viewmat);
+                       invert_m4_m4(render_mats.mat[DRW_MAT_WININV], winmat);
+                       invert_m4_m4(render_mats.mat[DRW_MAT_VIEWINV], viewmat);
+                       invert_m4_m4(render_mats.mat[DRW_MAT_PERSINV], persmat);
+
+                       DRW_viewport_matrix_override_set_all(&render_mats);
+
+                       GPU_framebuffer_texture_cubeface_attach(sldata->shadow_cube_target_fb,
+                                                               sldata->shadow_cube_target, 0, j, 0);
+                       GPU_framebuffer_bind(sldata->shadow_cube_target_fb);
+                       GPU_framebuffer_clear_depth(sldata->shadow_cube_target_fb, 1.0f);
+                       DRW_draw_pass(psl->shadow_pass);
+               }
 
                /* 0.001f is arbitrary, but it should be relatively small so that filter size is not too big. */
                float filter_texture_size = la->soft * 0.001f;
@@ -1143,22 +1103,39 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl)
                EEVEE_ShadowCascadeData *evscd = &led->data.scad;
                EEVEE_ShadowRender *srd = &linfo->shadow_render_data;
 
+               DRWMatrixState render_mats;
+               float (*winmat)[4] = render_mats.mat[DRW_MAT_WIN];
+               float (*viewmat)[4] = render_mats.mat[DRW_MAT_VIEW];
+               float (*persmat)[4] = render_mats.mat[DRW_MAT_PERS];
+
                eevee_shadow_cascade_setup(ob, linfo, led);
 
                srd->clip_near = la->clipsta;
                srd->clip_far = la->clipend;
-               for (int j = 0; j < la->cascade_count; ++j) {
-                       copy_m4_m4(srd->shadowmat[j], evscd->viewprojmat[j]);
-               }
+
                DRW_uniformbuffer_update(sldata->shadow_render_ubo, &linfo->shadow_render_data);
 
-               eevee_shadows_cascade_culling_frustum(evscd);
+               copy_m4_m4(viewmat, evscd->viewmat);
+               invert_m4_m4(render_mats.mat[DRW_MAT_VIEWINV], viewmat);
 
                /* Render shadow cascades */
-               linfo->shadow_instance_count = la->cascade_count;
-               GPU_framebuffer_bind(sldata->shadow_cascade_target_fb);
-               GPU_framebuffer_clear_depth(sldata->shadow_cascade_target_fb, 1.0);
-               DRW_draw_pass(psl->shadow_pass);
+               /* Render cascade separatly: seems to be faster for the general case.
+                * The only time it's more beneficial is when the CPU culling overhead
+                * outweight the instancing overhead. which is rarelly the case. */
+               for (int j = 0; j < la->cascade_count; j++) {
+                       copy_m4_m4(winmat, evscd->projmat[j]);
+                       copy_m4_m4(persmat, evscd->viewprojmat[j]);
+                       invert_m4_m4(render_mats.mat[DRW_MAT_WININV], winmat);
+                       invert_m4_m4(render_mats.mat[DRW_MAT_PERSINV], persmat);
+
+                       DRW_viewport_matrix_override_set_all(&render_mats);
+
+                       GPU_framebuffer_texture_layer_attach(sldata->shadow_cascade_target_fb,
+                                                            sldata->shadow_cascade_target, 0, j, 0);
+                       GPU_framebuffer_bind(sldata->shadow_cascade_target_fb);
+                       GPU_framebuffer_clear_depth(sldata->shadow_cascade_target_fb, 1.0f);
+                       DRW_draw_pass(psl->shadow_pass);
+               }
 
                /* TODO: OPTI: Filter all cascade in one/two draw call */
                for (linfo->current_shadow_cascade = 0;
index fc4439a253c186b6caa996602bee0b0356b54892..e64b8c4282f1bb552d51b223128fda7230ed4c00 100644 (file)
@@ -47,7 +47,6 @@
 
 /* *********** STATIC *********** */
 static struct {
-       char *shadow_shader_lib;
        char *frag_shader_lib;
        char *volume_shader_lib;
 
@@ -90,7 +89,6 @@ extern char datatoc_lit_surface_vert_glsl[];
 extern char datatoc_raytrace_lib_glsl[];
 extern char datatoc_ssr_lib_glsl[];
 extern char datatoc_shadow_vert_glsl[];
-extern char datatoc_shadow_geom_glsl[];
 extern char datatoc_lightprobe_geom_glsl[];
 extern char datatoc_lightprobe_vert_glsl[];
 extern char datatoc_background_vert_glsl[];
@@ -532,7 +530,8 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, E
                char *frag_str = NULL;
 
                /* Shaders */
-               e_data.shadow_shader_lib = BLI_string_joinN(
+               e_data.frag_shader_lib = BLI_string_joinN(
+                       datatoc_common_view_lib_glsl,
                        datatoc_common_uniforms_lib_glsl,
                        datatoc_bsdf_common_lib_glsl,
                        datatoc_bsdf_sampling_lib_glsl,
@@ -556,10 +555,6 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, EEVEE_StorageList *stl, E
                        datatoc_lit_surface_frag_glsl,
                        datatoc_volumetric_lib_glsl);
 
-               e_data.frag_shader_lib = BLI_string_joinN(
-                       datatoc_common_view_lib_glsl,
-                       e_data.shadow_shader_lib);
-
                e_data.volume_shader_lib = BLI_string_joinN(
                        datatoc_common_view_lib_glsl,
                        datatoc_common_uniforms_lib_glsl,
@@ -762,13 +757,13 @@ struct GPUMaterial *EEVEE_material_mesh_depth_get(
        char *defines = eevee_get_defines(options);
 
        char *frag_str = BLI_string_joinN(
-               (is_shadow) ? e_data.shadow_shader_lib : e_data.frag_shader_lib,
+               e_data.frag_shader_lib,
                datatoc_prepass_frag_glsl);
 
        mat = DRW_shader_create_from_material(
                scene, ma, engine, options,
                (is_shadow) ? datatoc_shadow_vert_glsl : datatoc_lit_surface_vert_glsl,
-               (is_shadow) ? datatoc_shadow_geom_glsl : NULL,
+               NULL,
                frag_str,
                defines);
 
@@ -1412,11 +1407,11 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_ViewLayerData *sld
                                                        break;
                                                case MA_BS_CLIP:
                                                        gpumat = EEVEE_material_mesh_depth_get(scene, ma, false, true);
-                                                       EEVEE_lights_cache_shcaster_material_add(sldata, psl, gpumat, mat_geom[i], ob, ob->obmat, &ma->alpha_threshold);
+                                                       EEVEE_lights_cache_shcaster_material_add(sldata, psl, gpumat, mat_geom[i], ob, &ma->alpha_threshold);
                                                        break;
                                                case MA_BS_HASHED:
                                                        gpumat = EEVEE_material_mesh_depth_get(scene, ma, true, true);
-                                                       EEVEE_lights_cache_shcaster_material_add(sldata, psl, gpumat, mat_geom[i], ob, ob->obmat, NULL);
+                                                       EEVEE_lights_cache_shcaster_material_add(sldata, psl, gpumat, mat_geom[i], ob, NULL);
                                                        break;
                                                case MA_BS_NONE:
                                                default:
@@ -1530,7 +1525,7 @@ void EEVEE_materials_free(void)
        for (int i = 0; i < VAR_MAT_MAX; ++i) {
                DRW_SHADER_FREE_SAFE(e_data.default_lit[i]);
        }
-       MEM_SAFE_FREE(e_data.shadow_shader_lib);
+       MEM_SAFE_FREE(e_data.frag_shader_lib);
        MEM_SAFE_FREE(e_data.frag_shader_lib);
        MEM_SAFE_FREE(e_data.volume_shader_lib);
        DRW_SHADER_FREE_SAFE(e_data.default_prepass_sh);
index bf77914832e4b20e4be2cebac5065712fd7be7c4..f0ba458dcc88bf235649a7ba56070c00bedec1c5 100644 (file)
@@ -312,8 +312,6 @@ typedef struct EEVEE_ShadowCascade {
 } EEVEE_ShadowCascade;
 
 typedef struct EEVEE_ShadowRender {
-       float shadowmat[6][4][4]; /* World->Lamp->NDC : used to render the shadow map. 6 frustum for cubemap shadow */
-       float viewmat[6][4][4]; /* World->Lamp : used to render the shadow map. 6 viewmat for cubemap shadow */
        float position[3], pad;
        float cube_texel_size;
        float stored_texel_size;
@@ -675,7 +673,8 @@ typedef struct EEVEE_ShadowCubeData {
 typedef struct EEVEE_ShadowCascadeData {
        short light_id, shadow_id, cascade_id, layer_id;
        float viewprojmat[MAX_CASCADE_NUM][4][4]; /* World->Lamp->NDC : used for rendering the shadow map. */
-       DRWMatrixState clipmat; /* Override matrices used for clipping. */
+       float projmat[MAX_CASCADE_NUM][4][4];
+       float viewmat[4][4], viewinv[4][4];
        float radius[MAX_CASCADE_NUM];
 } EEVEE_ShadowCascadeData;
 
@@ -806,7 +805,7 @@ void EEVEE_lights_cache_shcaster_add(
 void EEVEE_lights_cache_shcaster_material_add(
         EEVEE_ViewLayerData *sldata, EEVEE_PassList *psl,
         struct GPUMaterial *gpumat, struct Gwn_Batch *geom, struct Object *ob,
-        float (*obmat)[4], float *alpha_threshold);
+        float *alpha_threshold);
 void EEVEE_lights_cache_shcaster_object_add(EEVEE_ViewLayerData *sldata, struct Object *ob);
 void EEVEE_lights_cache_finish(EEVEE_ViewLayerData *sldata);
 void EEVEE_lights_update(EEVEE_ViewLayerData *sldata);
index 77c873c15030a69d2855f6d5f9cd3dfc318725c2..b5e54c8747a14fbfe8f865d2b73d6466f34fb450 100644 (file)
@@ -8,37 +8,6 @@
 
 #define LUT_SIZE 64
 
-#ifdef SHADOW_SHADER
-layout(std140) uniform shadow_render_block {
-       mat4 ShadowMatrix[6];
-       mat4 FaceViewMatrix[6];
-       vec4 lampPosition;
-       float cubeTexelSize;
-       float storedTexelSize;
-       float nearClip;
-       float farClip;
-       int shadowSampleCount;
-       float shadowInvSampleCount;
-};
-
-flat in int shFace; /* Shadow layer we are rendering to. */
-
-/* Replacing viewBlock */
-#define ViewMatrix              FaceViewMatrix[shFace]
-#define ViewProjectionMatrix    ShadowMatrix[shFace]
-/* TODO optimize */
-#define ProjectionMatrix       \
-mat4(vec4(1.0, 0.0, 0.0, 0.0), \
-     vec4(0.0, 1.0, 0.0, 0.0), \
-     vec4(0.0, 0.0, -(farClip + nearClip) / (farClip - nearClip), -1.0), \
-     vec4(0.0, 0.0, (-2.0 * farClip * nearClip) / (farClip - nearClip), 0.0))
-
-#define ViewMatrixInverse             inverse(ViewMatrix)
-#define ViewProjectionMatrixInverse   inverse(ViewProjectionMatrix)
-#define ProjectionMatrixInverse       inverse(ProjectionMatrix)
-#define CameraTexCoFactors            vec4(1.0f, 1.0f, 0.0f, 0.0f)
-#endif
-
 /* Buffers */
 uniform sampler2D colorBuffer;
 uniform sampler2D depthBuffer;
index 67b0fc2bdfcf28b3c6875e4b2b037eb1ee062f8a..4ae22b480f171f687f2505b18c7f2ded617232e6 100644 (file)
@@ -2,8 +2,6 @@
  * to linear depth (or other storage method) and doing a 3x3 box filter. */
 
 layout(std140) uniform shadow_render_block {
-       mat4 ShadowMatrix[6];
-       mat4 FaceViewMatrix[6];
        vec4 lampPosition;
        float cubeTexelSize;
        float storedTexelSize;
diff --git a/source/blender/draw/engines/eevee/shaders/shadow_geom.glsl b/source/blender/draw/engines/eevee/shaders/shadow_geom.glsl
deleted file mode 100644 (file)
index ea51fa7..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-
-layout(std140) uniform shadow_render_block {
-       mat4 ShadowMatrix[6];
-       mat4 FaceViewMatrix[6];
-       vec4 lampPosition;
-       float cubeTexelSize;
-       float storedTexelSize;
-       float nearClip;
-       float farClip;
-       int shadowSampleCount;
-       float shadowInvSampleCount;
-};
-
-layout(triangles) in;
-layout(triangle_strip, max_vertices=3) out;
-
-in vec4 vPos[];
-flat in int face[];
-
-#ifdef MESH_SHADER
-in vec3 vNor[];
-#endif
-
-out vec3 worldPosition;
-#ifdef MESH_SHADER
-out vec3 viewPosition; /* Required. otherwise generate linking error. */
-out vec3 worldNormal; /* Required. otherwise generate linking error. */
-out vec3 viewNormal; /* Required. otherwise generate linking error. */
-flat out int shFace;
-#else
-int shFace;
-#endif
-
-void main() {
-       shFace = face[0];
-       gl_Layer = shFace;
-
-       for (int v = 0; v < 3; ++v) {
-               gl_Position = ShadowMatrix[shFace] * vPos[v];
-               worldPosition = vPos[v].xyz;
-#ifdef MESH_SHADER
-               worldNormal = vNor[v];
-               viewPosition = (FaceViewMatrix[shFace] * vec4(worldPosition, 1.0)).xyz;
-               viewNormal = (FaceViewMatrix[shFace] * vec4(worldNormal, 0.0)).xyz;
-#ifdef ATTRIB
-               pass_attrib(v);
-#endif
-#endif
-               EmitVertex();
-       }
-
-       EndPrimitive();
-}
\ No newline at end of file
index 0fc7e4c9396aac231b46c0c81d41381e2bfaaec5..b40155be454286366d42d95eca3790e670f24bf6 100644 (file)
@@ -1,7 +1,5 @@
 
 layout(std140) uniform shadow_render_block {
-       mat4 ShadowMatrix[6];
-       mat4 FaceViewMatrix[6];
        vec4 lampPosition;
        float cubeTexelSize;
        float storedTexelSize;
index 29cbcfdd6e4560f76be57da9f560fe0a62095ab6..9fa57b8e136bd26e5e6e27e13899205a186cb9eb 100644 (file)
@@ -1,29 +1,33 @@
 
-uniform mat4 ModelMatrix;
+uniform mat4 ModelViewProjectionMatrix;
 #ifdef MESH_SHADER
+uniform mat4 ModelMatrix;
+uniform mat4 ModelViewMatrix;
 uniform mat3 WorldNormalMatrix;
+#  ifndef ATTRIB
+uniform mat3 NormalMatrix;
+#  endif
 #endif
 
 in vec3 pos;
-#ifdef MESH_SHADER
 in vec3 nor;
-#endif
 
-out vec4 vPos;
 #ifdef MESH_SHADER
-out vec3 vNor;
+out vec3 worldPosition;
+out vec3 viewPosition;
+out vec3 worldNormal;
+out vec3 viewNormal;
 #endif
 
-flat out int face;
-
 void main() {
-       vPos = ModelMatrix * vec4(pos, 1.0);
-       face = gl_InstanceID;
-
+       gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
 #ifdef MESH_SHADER
-       vNor = WorldNormalMatrix * nor;
+       viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz;
+       worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
+       viewNormal = normalize(NormalMatrix * nor);
+       worldNormal = normalize(WorldNormalMatrix * nor);
 #ifdef ATTRIB
        pass_attrib(pos);
 #endif
 #endif
-}
+}
\ No newline at end of file
index 60e855108f979e95f6685891b236577b4c5c0a91..66ca8971a461bd0639f5d793796790650df336b0 100644 (file)
@@ -404,7 +404,7 @@ typedef struct DRWMatrixState {
 void DRW_viewport_init(const bContext *C);
 void DRW_viewport_matrix_get(float mat[4][4], DRWViewportMatrixType type);
 void DRW_viewport_matrix_get_all(DRWMatrixState *state);
-void DRW_viewport_matrix_override_set(float mat[4][4], DRWViewportMatrixType type);
+void DRW_viewport_matrix_override_set(const float mat[4][4], DRWViewportMatrixType type);
 void DRW_viewport_matrix_override_set_all(DRWMatrixState *state);
 void DRW_viewport_matrix_override_unset(DRWViewportMatrixType type);
 void DRW_viewport_matrix_override_unset_all(void);
index f9968fdc16c70653fa87556f56ca2a0ca931b4fe..b8ed341e2c5771d47e403444b58b82908dfd7e38 100644 (file)
@@ -518,7 +518,7 @@ void DRW_viewport_matrix_get_all(DRWMatrixState *state)
        memcpy(state, DST.view_data.matstate.mat, sizeof(DRWMatrixState));
 }
 
-void DRW_viewport_matrix_override_set(float mat[4][4], DRWViewportMatrixType type)
+void DRW_viewport_matrix_override_set(const float mat[4][4], DRWViewportMatrixType type)
 {
        BLI_assert(type < DRW_MAT_COUNT);
        copy_m4_m4(DST.view_data.matstate.mat[type], mat);
index e69a102681537c988f2e32b7210a4155774ac79b..6021863c690e7b467549ea784239db14cf832bae 100644 (file)
@@ -390,7 +390,8 @@ void DRW_state_clip_planes_reset(void)
  * BKE_boundbox_init_from_minmax(&bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f});
  * for (int i = 0; i < 8; i++) {mul_project_m4_v3(viewprojinv, bbox.vec[i]);}
  */
-static void draw_frustum_boundbox_calc(const float (*projmat)[4], const float (*viewinv)[4], BoundBox *r_bbox)
+static void UNUSED_FUNCTION(draw_frustum_boundbox_calc)(
+        const float (*projmat)[4], const float (*viewinv)[4], BoundBox *r_bbox)
 {
        float screenvecs[3][3], loc[3], near, far, w_half, h_half;
        bool is_persp = projmat[3][3] == 0.0f;
@@ -492,7 +493,14 @@ static void draw_clipping_setup_from_view(void)
 
        /* Extract Clipping Planes */
        BoundBox bbox;
+#if 0 /* does not currently work for all casses. */
        draw_frustum_boundbox_calc(projmat, viewinv, &bbox);
+#else
+       BKE_boundbox_init_from_minmax(&bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f});
+       for (int i = 0; i < 8; i++) {
+               mul_project_m4_v3(DST.view_data.matstate.mat[DRW_MAT_PERSINV], bbox.vec[i]);
+       }
+#endif
 
        /* Compute clip planes using the world space frustum corners. */
        for (int p = 0; p < 6; p++) {
index 4af8089ffea501282d6e8a8cbe6c93a280d736fd..36402b82cbf5e1eb0578cf8351d70084567be8d3 100644 (file)
@@ -2817,7 +2817,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
                                
                                /* deselect all other channels */
                                ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, false, ACHANNEL_SETFLAG_CLEAR);
-                               if (pchan) ED_pose_de_selectall(ob, SEL_DESELECT, false);
+                               if (pchan) ED_pose_deselect_all(ob, SEL_DESELECT, false);
                                
                                /* only select channels in group and group itself */
                                for (fcu = agrp->channels.first; fcu && fcu->grp == agrp; fcu = fcu->next)
@@ -2827,7 +2827,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
                        else {
                                /* select group by itself */
                                ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, false, ACHANNEL_SETFLAG_CLEAR);
-                               if (pchan) ED_pose_de_selectall(ob, SEL_DESELECT, false);
+                               if (pchan) ED_pose_deselect_all(ob, SEL_DESELECT, false);
                                
                                agrp->flag |= AGRP_SELECTED;
                        }
index bd3ddfe93c613eb8b25fd56f351b6394ca659278..cb072bee345c5c6aa045b5ceb42c92a731516969 100644 (file)
 
 /* default bone add, returns it selected, but without tail set */
 /* XXX should be used everywhere, now it mallocs bones still locally in functions */
-EditBone *ED_armature_edit_bone_add(bArmature *arm, const char *name)
+EditBone *ED_armature_ebone_add(bArmature *arm, const char *name)
 {
        EditBone *bone = MEM_callocN(sizeof(EditBone), "eBone");
        
        BLI_strncpy(bone->name, name, sizeof(bone->name));
-       unique_editbone_name(arm->edbo, bone->name, NULL);
+       ED_armature_ebone_unique_name(arm->edbo, bone->name, NULL);
        
        BLI_addtail(arm->edbo, bone);
        
@@ -97,15 +97,15 @@ EditBone *ED_armature_edit_bone_add(bArmature *arm, const char *name)
        return bone;
 }
 
-EditBone *ED_armature_edit_bone_add_primitive(Object *obedit_arm, float length, bool view_aligned)
+EditBone *ED_armature_ebone_add_primitive(Object *obedit_arm, float length, bool view_aligned)
 {
        bArmature *arm = obedit_arm->data;
        EditBone *bone;
 
-       ED_armature_deselect_all(obedit_arm);
+       ED_armature_edit_deselect_all(obedit_arm);
        
        /* Create a bone */
-       bone = ED_armature_edit_bone_add(arm, "Bone");
+       bone = ED_armature_ebone_add(arm, "Bone");
 
        arm->act_edbone = bone;
 
@@ -157,12 +157,12 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op))
                to_root = 1;
        }
        
-       ED_armature_deselect_all(obedit);
+       ED_armature_edit_deselect_all(obedit);
        
        /* we re-use code for mirror editing... */
        flipbone = NULL;
        if (arm->flag & ARM_MIRROR_EDIT)
-               flipbone = ED_armature_bone_get_mirrored(arm->edbo, ebone);
+               flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
 
        for (a = 0; a < 2; a++) {
                if (a == 1) {
@@ -173,7 +173,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op))
                        }
                }
                
-               newbone = ED_armature_edit_bone_add(arm, ebone->name);
+               newbone = ED_armature_ebone_add(arm, ebone->name);
                arm->act_edbone = newbone;
                
                if (to_root) {
@@ -205,7 +205,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op))
                
        }
        
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
        
@@ -268,7 +268,7 @@ EditBone *add_points_bone(Object *obedit, float head[3], float tail[3])
 {
        EditBone *ebo;
        
-       ebo = ED_armature_edit_bone_add(obedit->data, "Bone");
+       ebo = ED_armature_ebone_add(obedit->data, "Bone");
        
        copy_v3_v3(ebo->head, head);
        copy_v3_v3(ebo->tail, tail);
@@ -333,7 +333,7 @@ void postEditBoneDuplicate(struct ListBase *editbones, Object *ob)
        for (EditBone *ebone_src = editbones->first; ebone_src; ebone_src = ebone_src->next) {
                EditBone *ebone_dst = ebone_src->temp.ebone;
                if (!ebone_dst) {
-                       ebone_dst = ED_armature_bone_get_mirrored(editbones, ebone_src);
+                       ebone_dst = ED_armature_ebone_get_mirrored(editbones, ebone_src);
                }
                if (ebone_dst) {
                        BLI_ghash_insert(name_map, ebone_src->name, ebone_dst->name);
@@ -438,7 +438,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
                BLI_strncpy(eBone->name, name, sizeof(eBone->name));
        }
 
-       unique_editbone_name(editbones, eBone->name, NULL);
+       ED_armature_ebone_unique_name(editbones, eBone->name, NULL);
        BLI_addtail(editbones, eBone);
        
        /* copy the ID property */
@@ -487,7 +487,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
 
        const bool do_flip_names = RNA_boolean_get(op->ptr, "do_flip_names");
 
-       ED_armature_sync_selection(arm->edbo); // XXX why is this needed?
+       ED_armature_edit_sync_selection(arm->edbo); // XXX why is this needed?
 
        preEditBoneDuplicate(arm->edbo);
 
@@ -499,7 +499,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
                        {
                                EditBone *ebone;
 
-                               ebone = ED_armature_bone_get_mirrored(arm->edbo, ebone_iter);
+                               ebone = ED_armature_ebone_get_mirrored(arm->edbo, ebone_iter);
                                if (ebone) {
                                        ebone->flag |= BONE_SELECTED;
                                }
@@ -522,7 +522,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
 
                                /* Only use flipped name if not yet in use. Otherwise we'd get again inconsistent namings
                                 * (different numbers), better keep default behavior in this case. */
-                               if (ED_armature_bone_find_name(arm->edbo, new_bone_name_buff) == NULL) {
+                               if (ED_armature_ebone_find_name(arm->edbo, new_bone_name_buff) == NULL) {
                                        new_bone_name = new_bone_name_buff;
                                }
                        }
@@ -583,7 +583,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
 
        postEditBoneDuplicate(arm->edbo, obedit);
 
-       ED_armature_validate_active(arm);
+       ED_armature_edit_validate_active(arm);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
        
@@ -630,7 +630,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
        if (CTX_DATA_COUNT(C, selected_bones) == 0)
                return OPERATOR_CANCELLED;
 
-       ED_armature_sync_selection(arm->edbo); // XXX why is this needed?
+       ED_armature_edit_sync_selection(arm->edbo); // XXX why is this needed?
 
        preEditBoneDuplicate(arm->edbo);
 
@@ -648,7 +648,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
                                ebone_iter->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
                        }
                        else {
-                               EditBone *ebone = ED_armature_bone_find_name(arm->edbo, name_flip);
+                               EditBone *ebone = ED_armature_ebone_find_name(arm->edbo, name_flip);
 
                                if (ebone) {
                                        if ((ebone->flag & BONE_SELECTED) == 0) {
@@ -738,7 +738,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
                                /* the parent may have been duplicated, if not lookup the mirror parent */
                                EditBone *ebone_parent =
                                        (ebone_iter->parent->temp.ebone ?
-                                        ebone_iter->parent->temp.ebone : ED_armature_bone_get_mirrored(arm->edbo, ebone_iter->parent));
+                                        ebone_iter->parent->temp.ebone : ED_armature_ebone_get_mirrored(arm->edbo, ebone_iter->parent));
 
                                if (ebone_parent == NULL) {
                                        /* If the mirror lookup failed, (but the current bone has a parent)
@@ -759,7 +759,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
                }
        }
 
-       transform_armature_mirror_update(obedit);
+       ED_armature_edit_transform_mirror_update(obedit);
 
        /* Selected bones now have their 'temp' pointer set,
         * so we don't need this anymore */
@@ -786,7 +786,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
 
        postEditBoneDuplicate(arm->edbo, obedit);
 
-       ED_armature_validate_active(arm);
+       ED_armature_edit_validate_active(arm);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
 
@@ -870,7 +870,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
                                /* we re-use code for mirror editing... */
                                flipbone = NULL;
                                if (arm->flag & ARM_MIRROR_EDIT) {
-                                       flipbone = ED_armature_bone_get_mirrored(arm->edbo, ebone);
+                                       flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
                                        if (flipbone) {
                                                forked = 0;  // we extrude 2 different bones
                                                if (flipbone->flag & (BONE_TIPSEL | BONE_ROOTSEL | BONE_SELECTED))
@@ -944,7 +944,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
                                                        else strcat(newbone->name, "_R");
                                                }
                                        }
-                                       unique_editbone_name(arm->edbo, newbone->name, NULL);
+                                       ED_armature_ebone_unique_name(arm->edbo, newbone->name, NULL);
                                        
                                        /* Add the new bone to the list */
                                        BLI_addtail(arm->edbo, newbone);
@@ -974,7 +974,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
        }
 
        /* Transform the endpoints */
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
 
@@ -1027,10 +1027,10 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
        mul_m3_m3m3(totmat, obmat, viewmat);
        invert_m3_m3(imat, totmat);
        
-       ED_armature_deselect_all(obedit);
+       ED_armature_edit_deselect_all(obedit);
        
        /*      Create a bone */
-       bone = ED_armature_edit_bone_add(obedit->data, name);
+       bone = ED_armature_ebone_add(obedit->data, name);
 
        copy_v3_v3(bone->head, curs);
        
@@ -1118,7 +1118,7 @@ static int armature_subdivide_exec(bContext *C, wmOperator *op)
 
                        newbone->prop = NULL;
 
-                       unique_editbone_name(arm->edbo, newbone->name, NULL);
+                       ED_armature_ebone_unique_name(arm->edbo, newbone->name, NULL);
                        
                        /* correct parent bones */
                        for (tbone = arm->edbo->first; tbone; tbone = tbone->next) {
index bb3c4164fc16fd216e0374f69e91f21face4dec7..75b80627dff96b47b996e73d178bb221f941c7e4 100644 (file)
@@ -67,7 +67,7 @@
 /* ************************** Object Tools Exports ******************************* */
 /* NOTE: these functions are exported to the Object module to be called from the tools there */
 
-void ED_armature_apply_transform(Object *ob, float mat[4][4], const bool do_props)
+void ED_armature_transform_apply(Object *ob, float mat[4][4], const bool do_props)
 {
        bArmature *arm = ob->data;
 
@@ -205,7 +205,7 @@ void ED_armature_origin_set(Object *ob, float cursor[3], int centermode, int aro
 /* adjust bone roll to align Z axis with vector
  * vec is in local space and is normalized
  */
-float ED_rollBoneToVector(EditBone *bone, const float align_axis[3], const bool axis_only)
+float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float align_axis[3], const bool axis_only)
 {
        float mat[3][3], nor[3];
        float vec[3], align_axis_proj[3], roll = 0.0f;
@@ -331,7 +331,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
                                sub_v3_v3v3(cursor_rel, cursor_local, ebone->head);
                                if (axis_flip) negate_v3(cursor_rel);
                                if (normalize_v3(cursor_rel) != 0.0f) {
-                                       ebone->roll = ED_rollBoneToVector(ebone, cursor_rel, axis_only);
+                                       ebone->roll = ED_armature_ebone_roll_to_vector(ebone, cursor_rel, axis_only);
                                }
                        }
                }
@@ -370,13 +370,13 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
                                                if (axis_flip) negate_v3(vec);
 
                                                if (is_edit) {
-                                                       ebone->roll = ED_rollBoneToVector(ebone, vec, axis_only);
+                                                       ebone->roll = ED_armature_ebone_roll_to_vector(ebone, vec, axis_only);
                                                }
 
                                                /* parentless bones use cross product with child */
                                                if (is_edit_parent) {
                                                        if (ebone->parent->parent == NULL) {
-                                                               ebone->parent->roll = ED_rollBoneToVector(ebone->parent, vec, axis_only);
+                                                               ebone->parent->roll = ED_armature_ebone_roll_to_vector(ebone->parent, vec, axis_only);
                                                        }
                                                }
                                        }
@@ -420,7 +420,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
                for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
                        if (EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) {
                                /* roll func is a callback which assumes that all is well */
-                               ebone->roll = ED_rollBoneToVector(ebone, vec, axis_only);
+                               ebone->roll = ED_armature_ebone_roll_to_vector(ebone, vec, axis_only);
                        }
                }
        }
@@ -428,7 +428,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
        if (arm->flag & ARM_MIRROR_EDIT) {
                for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
                        if ((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) {
-                               EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, ebone);
+                               EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
                                if (ebone_mirr && (EBONE_VISIBLE(arm, ebone_mirr) && EBONE_EDITABLE(ebone_mirr))) {
                                        ebone->roll = -ebone_mirr->roll;
                                }
@@ -482,7 +482,7 @@ static int armature_roll_clear_exec(bContext *C, wmOperator *op)
        if (arm->flag & ARM_MIRROR_EDIT) {
                for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
                        if ((EBONE_VISIBLE(arm, ebone) && EBONE_EDITABLE(ebone)) == 0) {
-                               EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, ebone);
+                               EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
                                if (ebone_mirr && (EBONE_VISIBLE(arm, ebone_mirr) && EBONE_EDITABLE(ebone_mirr))) {
                                        ebone->roll = -ebone_mirr->roll;
                                }
@@ -771,7 +771,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op)
        }
 
        if (newbone) {
-               ED_armature_deselect_all(obedit);
+               ED_armature_edit_deselect_all(obedit);
                arm->act_edbone = newbone;
                newbone->flag |= BONE_TIPSEL;
        }
@@ -883,7 +883,7 @@ static void bones_merge(Object *obedit, EditBone *start, EditBone *end, EditBone
        }
        
        newbone->flag |= (BONE_ROOTSEL | BONE_TIPSEL | BONE_SELECTED);
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 }
 
 
@@ -959,7 +959,7 @@ static int armature_merge_exec(bContext *C, wmOperator *op)
        }
        
        /* updates */
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
        WM_event_add_notifier(C, NC_OBJECT | ND_POSE, obedit);
        
        return OPERATOR_FINISHED;
@@ -1181,7 +1181,7 @@ static int armature_align_bones_exec(bContext *C, wmOperator *op)
                 * - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent")
                 *   then just use actbone. Useful when doing upper arm to spine.
                 */
-               actmirb = ED_armature_bone_get_mirrored(arm->edbo, actbone);
+               actmirb = ED_armature_ebone_get_mirrored(arm->edbo, actbone);
                if (actmirb == NULL) 
                        actmirb = actbone;
        }
@@ -1293,7 +1293,7 @@ static bool armature_delete_ebone_cb(const char *bone_name, void *arm_p)
        bArmature *arm = arm_p;
        EditBone *ebone;
 
-       ebone = ED_armature_bone_find_name(arm->edbo, bone_name);
+       ebone = ED_armature_ebone_find_name(arm->edbo, bone_name);
        return (ebone && (ebone->flag & BONE_SELECTED) && (arm->layer & ebone->layer));
 }
 
@@ -1303,7 +1303,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
 {
        bArmature *arm;
        EditBone *curBone, *ebone_next;
-       Object *obedit = CTX_data_edit_object(C); // XXX get from context
+       Object *obedit = CTX_data_edit_object(C);
        bool changed = false;
        arm = obedit->data;
 
@@ -1320,7 +1320,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
                if (arm->layer & curBone->layer) {
                        if (curBone->flag & BONE_SELECTED) {
                                if (curBone == arm->act_edbone) arm->act_edbone = NULL;
-                               ED_armature_edit_bone_remove(arm, curBone);
+                               ED_armature_ebone_remove(arm, curBone);
                                changed = true;
                        }
                }
@@ -1329,7 +1329,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
        if (!changed)
                return OPERATOR_CANCELLED;
        
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
        BKE_pose_tag_recalc(CTX_data_main(C), obedit->pose);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
@@ -1358,7 +1358,7 @@ static bool armature_dissolve_ebone_cb(const char *bone_name, void *arm_p)
        bArmature *arm = arm_p;
        EditBone *ebone;
 
-       ebone = ED_armature_bone_find_name(arm->edbo, bone_name);
+       ebone = ED_armature_ebone_find_name(arm->edbo, bone_name);
        return (ebone && (ebone->flag & BONE_DONE));
 }
 
@@ -1460,7 +1460,7 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
                        ebone->parent->rad_tail = ebone->rad_tail;
                        SET_FLAG_FROM_TEST(ebone->parent->flag, ebone->flag & BONE_TIPSEL, BONE_TIPSEL);
 
-                       ED_armature_edit_bone_remove_ex(arm, ebone, false);
+                       ED_armature_ebone_remove_ex(arm, ebone, false);
                        changed = true;
                }
        }
@@ -1493,7 +1493,7 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
                return OPERATOR_CANCELLED;
        }
 
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
 
@@ -1538,8 +1538,8 @@ static int armature_hide_exec(bContext *C, wmOperator *op)
                        }
                }
        }
-       ED_armature_validate_active(arm);
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_validate_active(arm);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
 
@@ -1581,8 +1581,8 @@ static int armature_reveal_exec(bContext *C, wmOperator *op)
                        }
                }
        }
-       ED_armature_validate_active(arm);
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_validate_active(arm);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
 
index 52e9e424a85f79d39a587e3522468490548f0000..e8d45f72f894876c55ee43deb86adc74b7551883 100644 (file)
 static bool editbone_unique_check(void *arg, const char *name)
 {
        struct {ListBase *lb; void *bone; } *data = arg;
-       EditBone *dupli = ED_armature_bone_find_name(data->lb, name);
+       EditBone *dupli = ED_armature_ebone_find_name(data->lb, name);
        return dupli && dupli != data->bone;
 }
 
-void unique_editbone_name(ListBase *edbo, char *name, EditBone *bone)
+void ED_armature_ebone_unique_name(ListBase *edbo, char *name, EditBone *bone)
 {
        struct {ListBase *lb; void *bone; } data;
        data.lb = edbo;
@@ -153,10 +153,10 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
                
                /* now check if we're in editmode, we need to find the unique name */
                if (arm->edbo) {
-                       EditBone *eBone = ED_armature_bone_find_name(arm->edbo, oldname);
+                       EditBone *eBone = ED_armature_ebone_find_name(arm->edbo, oldname);
                        
                        if (eBone) {
-                               unique_editbone_name(arm->edbo, newname, NULL);
+                               ED_armature_ebone_unique_name(arm->edbo, newname, NULL);
                                BLI_strncpy(eBone->name, newname, MAXBONENAME);
                        }
                        else {
index de2611f7092ef223425aa249a0da86d4008f7e79..0dafbf51d74161ff652d555a88e2b87372a72986 100644 (file)
@@ -312,10 +312,10 @@ int join_armature_exec(bContext *C, wmOperator *op)
                        /* Copy bones and posechannels from the object to the edit armature */
                        for (pchan = opose->chanbase.first; pchan; pchan = pchann) {
                                pchann = pchan->next;
-                               curbone = ED_armature_bone_find_name(curarm->edbo, pchan->name);
+                               curbone = ED_armature_ebone_find_name(curarm->edbo, pchan->name);
                                
                                /* Get new name */
-                               unique_editbone_name(arm->edbo, curbone->name, NULL);
+                               ED_armature_ebone_unique_name(arm->edbo, curbone->name, NULL);
                                BLI_ghash_insert(afd.names_map, BLI_strdup(pchan->name), curbone->name);
                                
                                /* Transform the bone */
@@ -528,7 +528,7 @@ static void separate_armature_bones(Object *ob, short sel)
        /* go through pose-channels, checking if a bone should be removed */
        for (pchan = ob->pose->chanbase.first; pchan; pchan = pchann) {
                pchann = pchan->next;
-               curbone = ED_armature_bone_find_name(arm->edbo, pchan->name);
+               curbone = ED_armature_ebone_find_name(arm->edbo, pchan->name);
                
                /* check if bone needs to be removed */
                if ( (sel && (curbone->flag & BONE_SELECTED)) ||
@@ -640,7 +640,7 @@ static int separate_armature_exec(bContext *C, wmOperator *op)
        ED_armature_to_edit(obedit->data);
        
        /* parents tips remain selected when connected children are removed. */
-       ED_armature_deselect_all(obedit);
+       ED_armature_edit_deselect_all(obedit);
 
        BKE_report(op->reports, RPT_INFO, "Separated bones");
 
@@ -760,7 +760,7 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op)
                 * - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent")
                 *   then just use actbone. Useful when doing upper arm to spine.
                 */
-               actmirb = ED_armature_bone_get_mirrored(arm->edbo, actbone);
+               actmirb = ED_armature_ebone_get_mirrored(arm->edbo, actbone);
                if (actmirb == NULL) 
                        actmirb = actbone;
        }
@@ -883,7 +883,7 @@ static int armature_parent_clear_exec(bContext *C, wmOperator *op)
        }
        CTX_DATA_END;
        
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        /* note, notifier might evolve */
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
index 397691a409b635e2cfa5683c04a1bd47fe81a911..587cafa6d486187a935d04bef35e327163b44e45 100644 (file)
@@ -64,7 +64,7 @@
 /* **************** PoseMode & EditMode Selection Buffer Queries *************************** */
 
 /* only for opengl selection indices */
-Bone *get_indexed_bone(Object *ob, int index)
+Bone *ED_armature_bone_find_index(Object *ob, int index)
 {
        bPoseChannel *pchan;
        if (ob->pose == NULL) return NULL;
@@ -100,7 +100,7 @@ void *get_bone_from_selectbuffer(
                                if (obedit == NULL || base->object != obedit) {
                                        /* no singular posemode, so check for correct object */
                                        if (base->object->select_color == (hitresult & 0xFFFF)) {
-                                               bone = get_indexed_bone(base->object, hitresult);
+                                               bone = ED_armature_bone_find_index(base->object, hitresult);
                                                
                                                if (findunsel)
                                                        sel = (bone->flag & BONE_SELECTED);
@@ -247,7 +247,7 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, const wmEv
                        bone = NULL;
        }
        
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
        
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
        
@@ -294,8 +294,8 @@ static int selectbuffer_ret_hits_5(unsigned int *buffer, const int hits12, const
 /* does bones and points */
 /* note that BONE ROOT only gets drawn for root bones (or without IK) */
 static EditBone *get_nearest_editbonepoint(
-        const EvaluationContext *eval_ctx, ViewContext *vc, const int mval[2],
-        ListBase *edbo, bool findunsel, bool use_cycle, int *r_selmask)
+        const EvaluationContext *eval_ctx, ViewContext *vc,
+        bool findunsel, bool use_cycle, int *r_selmask)
 {
        bArmature *arm = (bArmature *)vc->obedit->data;
        EditBone *ebone_next_act = arm->act_edbone;
@@ -327,11 +327,11 @@ static EditBone *get_nearest_editbonepoint(
        if (use_cycle) {
                if (vc->v3d->drawtype > OB_WIRE) {
                        do_nearest = true;
-                       if (len_manhattan_v2v2_int(mval, last_mval) < 3) {
+                       if (len_manhattan_v2v2_int(vc->mval, last_mval) < 3) {
                                do_nearest = false;
                        }
                }
-               copy_v2_v2_int(last_mval, mval);
+               copy_v2_v2_int(last_mval, vc->mval);
        }
        else {
                if (vc->v3d->drawtype > OB_WIRE) {
@@ -346,7 +346,7 @@ static EditBone *get_nearest_editbonepoint(
        /* we _must_ end cache before return, use 'goto cache_end' */
        view3d_opengl_select_cache_begin();
 
-       BLI_rcti_init_pt_radius(&rect, mval, 12);
+       BLI_rcti_init_pt_radius(&rect, vc->mval, 12);
        hits12 = view3d_opengl_select(eval_ctx, vc, buffer, MAXPICKBUF, &rect, select_mode);
        if (hits12 == 1) {
                hits = selectbuffer_ret_hits_12(buffer, hits12);
@@ -356,7 +356,7 @@ static EditBone *get_nearest_editbonepoint(
                int offs;
 
                offs = 4 * hits12;
-               BLI_rcti_init_pt_radius(&rect, mval, 5);
+               BLI_rcti_init_pt_radius(&rect, vc->mval, 5);
                hits5 = view3d_opengl_select(eval_ctx, vc, buffer + offs, MAXPICKBUF - offs, &rect, select_mode);
 
                if (hits5 == 1) {
@@ -384,7 +384,7 @@ cache_end:
                                if (!(hitresult & BONESEL_NOSEL)) {
                                        int dep;
                                        
-                                       ebone = BLI_findlink(edbo, hitresult & ~BONESEL_ANY);
+                                       ebone = BLI_findlink(arm->edbo, hitresult & ~BONESEL_ANY);
                                        
                                        /* clicks on bone points get advantage */
                                        if (hitresult & (BONESEL_ROOT | BONESEL_TIP)) {
@@ -428,7 +428,7 @@ cache_end:
                
                if (!(besthitresult & BONESEL_NOSEL)) {
                        
-                       ebone = BLI_findlink(edbo, besthitresult & ~BONESEL_ANY);
+                       ebone = BLI_findlink(arm->edbo, besthitresult & ~BONESEL_ANY);
                        
                        *r_selmask = 0;
                        if (besthitresult & BONESEL_ROOT)
@@ -444,7 +444,7 @@ cache_end:
        return NULL;
 }
 
-void ED_armature_deselect_all(Object *obedit)
+void ED_armature_edit_deselect_all(Object *obedit)
 {
        bArmature *arm = obedit->data;
        EditBone *ebone;
@@ -454,7 +454,7 @@ void ED_armature_deselect_all(Object *obedit)
        }
 }
 
-void ED_armature_deselect_all_visible(Object *obedit)
+void ED_armature_edit_deselect_all_visible(Object *obedit)
 {
        bArmature *arm = obedit->data;
        EditBone    *ebone;
@@ -466,7 +466,7 @@ void ED_armature_deselect_all_visible(Object *obedit)
                }
        }
 
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 }
 
 /* accounts for connected parents */
@@ -481,10 +481,9 @@ static int ebone_select_flag(EditBone *ebone)
 }
 
 /* context: editmode armature in view3d */
-bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
+bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
 {
        Object *obedit = CTX_data_edit_object(C);
-       bArmature *arm = obedit->data;
        EvaluationContext eval_ctx;
        ViewContext vc;
        EditBone *nearBone = NULL;
@@ -492,16 +491,19 @@ bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool d
 
        CTX_data_eval_ctx(C, &eval_ctx);
        ED_view3d_viewcontext_init(C, &vc);
+       vc.mval[0] = mval[0];
+       vc.mval[1] = mval[1];
 
        if (BIF_sk_selectStroke(C, mval, extend)) {
                return true;
        }
 
-       nearBone = get_nearest_editbonepoint(&eval_ctx, &vc, mval, arm->edbo, true, true, &selmask);
+       nearBone = get_nearest_editbonepoint(&eval_ctx, &vc, true, true, &selmask);
        if (nearBone) {
+               bArmature *arm = obedit->data;
 
                if (!extend && !deselect && !toggle) {
-                       ED_armature_deselect_all(obedit);
+                       ED_armature_edit_deselect_all(obedit);
                }
                
                /* by definition the non-root connected bones have no root point drawn,
@@ -572,7 +574,7 @@ bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool d
                                nearBone->flag |= selmask;
                }
                
-               ED_armature_sync_selection(arm->edbo);
+               ED_armature_edit_sync_selection(arm->edbo);
                
                if (nearBone) {
                        /* then now check for active status */
@@ -716,7 +718,7 @@ static void armature_select_more_less(Object *ob, bool more)
        EditBone *ebone;
 
        /* XXX, eventually we shouldn't need this - campbell */
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        /* count bones & store selection state */
        for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
@@ -746,7 +748,7 @@ static void armature_select_more_less(Object *ob, bool more)
                ebone->temp.p = NULL;
        }
 
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 }
 
 static int armature_de_select_more_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1151,7 +1153,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
        
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
        
@@ -1207,7 +1209,7 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op)
                        EditBone *ebone_mirror;
                        int flag_new = extend ? EBONE_PREV_FLAG_GET(ebone) : 0;
 
-                       if ((ebone_mirror = ED_armature_bone_get_mirrored(arm->edbo, ebone)) &&
+                       if ((ebone_mirror = ED_armature_ebone_get_mirrored(arm->edbo, ebone)) &&
                            (EBONE_VISIBLE(arm, ebone_mirror)))
                        {
                                const int flag_mirror = EBONE_PREV_FLAG_GET(ebone_mirror);
@@ -1231,7 +1233,7 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op)
                arm->act_edbone = ebone_mirror_act;
        }
 
-       ED_armature_sync_selection(arm->edbo);
+       ED_armature_edit_sync_selection(arm->edbo);
 
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
 
@@ -1316,7 +1318,7 @@ static int armature_shortest_path_pick_invoke(bContext *C, wmOperator *op, const
        else if (ED_armature_ebone_is_child_recursive(ebone_dst, ebone_src)) {
                SWAP(EditBone *, ebone_src, ebone_dst);
        }
-       else if ((ebone_isect_parent = ED_armature_bone_find_shared_parent(ebone_isect_child, 2))) {
+       else if ((ebone_isect_parent = ED_armature_ebone_find_shared_parent(ebone_isect_child, 2))) {
                /* pass */
        }
        else {
@@ -1351,7 +1353,7 @@ static int armature_shortest_path_pick_invoke(bContext *C, wmOperator *op, const
 
        if (changed) {
                arm->act_edbone = ebone_dst;
-               ED_armature_sync_selection(arm->edbo);
+               ED_armature_edit_sync_selection(arm->edbo);
                WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, obedit);
 
                return OPERATOR_FINISHED;
index 5c8e08a0d8975467a88855a1152ccaa6b549355c..e25056a7a4a59d12daecd0f14fb72597f72964a1 100644 (file)
@@ -431,7 +431,7 @@ static void add_verts_to_dgroups(
        MEM_freeN(verts);
 }
 
-void create_vgroups_from_armature(
+void ED_object_vgroup_calc_from_armature(
         ReportList *reports, const EvaluationContext *eval_ctx, Scene *scene, Object *ob, Object *par,
         const int mode, const bool mirror)
 {
index aa0aa0e03ffaa8faeab43f7f8ea9509565dc4117..c4580a370c9448dcdde85310afe76b2e9345cb56 100644 (file)
@@ -54,7 +54,7 @@
 /* Validation */
 
 /* Sync selection to parent for connected children */
-void ED_armature_sync_selection(ListBase *edbo)
+void ED_armature_edit_sync_selection(ListBase *edbo)
 {
        EditBone *ebo;
        
@@ -76,7 +76,7 @@ void ED_armature_sync_selection(ListBase *edbo)
        }
 }
 
-void ED_armature_validate_active(struct bArmature *arm)
+void ED_armature_edit_validate_active(struct bArmature *arm)
 {
        EditBone *ebone = arm->act_edbone;
 
@@ -137,7 +137,7 @@ void bone_free(bArmature *arm, EditBone *bone)
 /**
  * \param clear_connected: When false caller is responsible for keeping the flag in a valid state.
  */
-void ED_armature_edit_bone_remove_ex(bArmature *arm, EditBone *exBone, bool clear_connected)
+void ED_armature_ebone_remove_ex(bArmature *arm, EditBone *exBone, bool clear_connected)
 {
        EditBone *curBone;
 
@@ -154,9 +154,9 @@ void ED_armature_edit_bone_remove_ex(bArmature *arm, EditBone *exBone, bool clea
        bone_free(arm, exBone);
 }
 
-void ED_armature_edit_bone_remove(bArmature *arm, EditBone *exBone)
+void ED_armature_ebone_remove(bArmature *arm, EditBone *exBone)
 {
-       ED_armature_edit_bone_remove_ex(arm, exBone, true);
+       ED_armature_ebone_remove_ex(arm, exBone, true);
 }
 
 bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebone_child)
@@ -175,7 +175,7 @@ bool ED_armature_ebone_is_child_recursive(EditBone *ebone_parent, EditBone *ebon
  * \param ebone_child_tot  Size of the ebone_child array
  * \return The shared parent or NULL.
  */
-EditBone *ED_armature_bone_find_shared_parent(EditBone *ebone_child[], const unsigned int ebone_child_tot)
+EditBone *ED_armature_ebone_find_shared_parent(EditBone *ebone_child[], const unsigned int ebone_child_tot)
 {
        unsigned int i;
        EditBone *ebone_iter;
@@ -255,7 +255,7 @@ void ED_armature_ebone_from_mat4(EditBone *ebone, float mat[4][4])
 /**
  * Return a pointer to the bone of the given name
  */
-EditBone *ED_armature_bone_find_name(const ListBase *edbo, const char *name)
+EditBone *ED_armature_ebone_find_name(const ListBase *edbo, const char *name)
 {
        return BLI_findstring(edbo, name, offsetof(EditBone, name));
 }
@@ -267,7 +267,7 @@ EditBone *ED_armature_bone_find_name(const ListBase *edbo, const char *name)
 /**
  * \see #BKE_pose_channel_get_mirrored (pose-mode, matching function)
  */
-EditBone *ED_armature_bone_get_mirrored(const ListBase *edbo, EditBone *ebo)
+EditBone *ED_armature_ebone_get_mirrored(const ListBase *edbo, EditBone *ebo)
 {
        char name_flip[MAXBONENAME];
 
@@ -277,7 +277,7 @@ EditBone *ED_armature_bone_get_mirrored(const ListBase *edbo, EditBone *ebo)
        BLI_string_flip_side_name(name_flip, ebo->name, false, sizeof(name_flip));
        
        if (!STREQ(name_flip, ebo->name)) {
-               return ED_armature_bone_find_name(edbo, name_flip);
+               return ED_armature_ebone_find_name(edbo, name_flip);
        }
        
        return NULL;
@@ -297,7 +297,7 @@ void armature_select_mirrored_ex(bArmature *arm, const int flag)
                for (curBone = arm->edbo->first; curBone; curBone = curBone->next) {
                        if (arm->layer & curBone->layer) {
                                if (curBone->flag & flag) {
-                                       ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, curBone);
+                                       ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone);
                                        if (ebone_mirr)
                                                ebone_mirr->flag |= (curBone->flag & flag);
                                }
@@ -326,7 +326,7 @@ void armature_tag_select_mirrored(bArmature *arm)
                for (curBone = arm->edbo->first; curBone; curBone = curBone->next) {
                        if (arm->layer & curBone->layer) {
                                if (curBone->flag & (BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL)) {
-                                       EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, curBone);
+                                       EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone);
                                        if (ebone_mirr && (ebone_mirr->flag & BONE_SELECTED) == 0) {
                                                ebone_mirr->flag |= BONE_DONE;
                                        }
@@ -336,7 +336,7 @@ void armature_tag_select_mirrored(bArmature *arm)
                
                for (curBone = arm->edbo->first; curBone; curBone = curBone->next) {
                        if (curBone->flag & BONE_DONE) {
-                               EditBone *ebone_mirr = ED_armature_bone_get_mirrored(arm->edbo, curBone);
+                               EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone);
                                curBone->flag |= ebone_mirr->flag & (BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL);
                        }
                }
@@ -359,7 +359,7 @@ void armature_tag_unselect(bArmature *arm)
 
 /* if editbone (partial) selected, copy data */
 /* context; editmode armature, with mirror editing enabled */
-void transform_armature_mirror_update(Object *obedit)
+void ED_armature_edit_transform_mirror_update(Object *obedit)
 {
        bArmature *arm = obedit->data;
        EditBone *ebo, *eboflip;
@@ -367,7 +367,7 @@ void transform_armature_mirror_update(Object *obedit)
        for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
                /* no layer check, correct mirror is more important */
                if (ebo->flag & (BONE_TIPSEL | BONE_ROOTSEL)) {
-                       eboflip = ED_armature_bone_get_mirrored(arm->edbo, ebo);
+                       eboflip = ED_armature_ebone_get_mirrored(arm->edbo, ebo);
                        
                        if (eboflip) {
                                /* we assume X-axis flipping for now */
@@ -437,7 +437,7 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
                eBone = MEM_callocN(sizeof(EditBone), "make_editbone");
                
                /* Copy relevant data from bone to eBone
-                * Keep selection logic in sync with ED_armature_sync_selection.
+                * Keep selection logic in sync with ED_armature_edit_sync_selection.
                 */
                eBone->parent = parent;
                BLI_strncpy(eBone->name, curBone->name, sizeof(eBone->name));
index 4eb9e3ecc79b3d9e66384ba3a8e697769a467f41..57843265496289d1bdae73fef2d1cfcf9831e413 100644 (file)
@@ -39,7 +39,7 @@ void setBoneRollFromNormal(EditBone *bone, const float no[3], float UNUSED(invma
                copy_v3_v3(normal, no);
                mul_m3_v3(tmat, normal);
                
-               bone->roll = ED_rollBoneToVector(bone, normal, false);
+               bone->roll = ED_armature_ebone_roll_to_vector(bone, normal, false);
        }
 }
 
@@ -252,7 +252,7 @@ EditBone *subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *U
        
        IT_head(iter);
        
-       parent = ED_armature_edit_bone_add(arm, "Bone");
+       parent = ED_armature_ebone_add(arm, "Bone");
        copy_v3_v3(parent->head, iter->p);
        
        if (iter->size > FLT_EPSILON) {
@@ -265,7 +265,7 @@ EditBone *subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase *U
        while (index != -1) {
                IT_peek(iter, index);
 
-               child = ED_armature_edit_bone_add(arm, "Bone");
+               child = ED_armature_ebone_add(arm, "Bone");
                copy_v3_v3(child->head, parent->tail);
                child->parent = parent;
                child->flag |= BONE_CONNECTED;
index 3dd41f25e0924bc970985f282295984ab21fbaf8..bf6126658af190e0532bd85aa63a50ecc1571c74 100644 (file)
@@ -158,11 +158,11 @@ static float rollBoneByQuatAligned(EditBone *bone, float old_up_axis[3], float q
        
        if (angle_normalized_v3v3(x_axis, new_up_axis) < angle_normalized_v3v3(z_axis, new_up_axis)) {
                rotation_between_vecs_to_quat(qroll, new_up_axis, x_axis); /* set roll rotation quat */
-               return ED_rollBoneToVector(bone, x_axis, false);
+               return ED_armature_ebone_roll_to_vector(bone, x_axis, false);
        }
        else {
                rotation_between_vecs_to_quat(qroll, new_up_axis, z_axis); /* set roll rotation quat */
-               return ED_rollBoneToVector(bone, z_axis, false);
+               return ED_armature_ebone_roll_to_vector(bone, z_axis, false);
        }
 }
 
@@ -207,7 +207,7 @@ static float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4]
                /* real qroll between normal and up_axis */
                rotation_between_vecs_to_quat(qroll, new_up_axis, normal);
 
-               return ED_rollBoneToVector(edge->bone, normal, false);
+               return ED_armature_ebone_roll_to_vector(edge->bone, normal, false);
        }
 }
 
@@ -218,7 +218,7 @@ float rollBoneByQuat(EditBone *bone, float old_up_axis[3], float qrot[4])
        copy_v3_v3(new_up_axis, old_up_axis);
        mul_qt_v3(qrot, new_up_axis);
        
-       return ED_rollBoneToVector(bone, new_up_axis, false);
+       return ED_armature_ebone_roll_to_vector(bone, new_up_axis, false);
 }
 
 /************************************ DESTRUCTORS ******************************************************/
@@ -424,7 +424,7 @@ static void renameTemplateBone(char *name, char *template_name, ListBase *editbo
        
        name[j] = '\0';
        
-       unique_editbone_name(editbones, name, NULL);
+       ED_armature_ebone_unique_name(editbones, name, NULL);
 }
 
 static RigControl *cloneControl(RigGraph *rg, RigGraph *src_rg, RigControl *src_ctrl, GHash *ptr_hash, char *side_string, char *num_string)
@@ -1435,7 +1435,7 @@ static EditBone *add_editbonetolist(char *name, ListBase *list)
        EditBone *bone = MEM_callocN(sizeof(EditBone), "eBone");
        
        BLI_strncpy(bone->name, name, sizeof(bone->name));
-       unique_editbone_name(list, bone->name, NULL);
+       ED_armature_ebone_unique_name(list, bone->name, NULL);
        
        BLI_addtail(list, bone);
        
@@ -2626,7 +2626,7 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg)
        }
        RIG_freeRigGraph((BGraph *)rigg);
        
-       ED_armature_validate_active(armedit);
+       ED_armature_edit_validate_active(armedit);
 
 //     XXX
 //     allqueue(REDRAWVIEW3D, 0);
index 1f1468a8e41ba18227fd8995543f0d66c7a8afa9..26f11f8fd608a815d312b3b5b4ccc6e5feb0fa06 100644 (file)
@@ -1358,7 +1358,7 @@ static void sk_convertStroke(bContext *C, SK_Stroke *stk)
                                }
 
                                if (bone == NULL) {
-                                       bone = ED_armature_edit_bone_add(arm, "Bone");
+                                       bone = ED_armature_ebone_add(arm, "Bone");
 
                                        copy_v3_v3(bone->head, head->p);
                                        copy_v3_v3(bone->tail, pt->p);
index 489940007e4f45a9c38c63982181b96f7f266f48..ea7a35a4b0e81e5fb34a4433b0c77af0cccaf3f8 100644 (file)
@@ -1636,7 +1636,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
        free_bvhtree_f