[Bf-blender-cvs] [970c928f271] master: Py API Docs: Fix audio docs example

2021-09-18 Thread Jorge Bernal
Commit: 970c928f27106b26ec7cf6afa2316c60384ab4f1
Author: Jorge Bernal
Date:   Sat Sep 18 19:28:55 2021 +0200
Branches: master
https://developer.blender.org/rB970c928f27106b26ec7cf6afa2316c60384ab4f1

Py API Docs: Fix audio docs example

After new AUD API changes from 2.8x what "buffer" function used to do
has now become "cache" function (it caches a sound into RAM). Therefore,
the basic aud example should call this new "cache" function instead of
"buffer" function.

Thanks to Michael-Z-Freeman for pointing out.

===

M   doc/python_api/examples/aud.py

===

diff --git a/doc/python_api/examples/aud.py b/doc/python_api/examples/aud.py
index a52258c1a45..0eb27647671 100644
--- a/doc/python_api/examples/aud.py
+++ b/doc/python_api/examples/aud.py
@@ -14,7 +14,7 @@ sound = aud.Sound('music.ogg')
 # play the audio, this return a handle to control play/pause
 handle = device.play(sound)
 # if the audio is not too big and will be used often you can buffer it
-sound_buffered = aud.Sound.buffer(sound)
+sound_buffered = aud.Sound.cache(sound)
 handle_buffered = device.play(sound_buffered)
 
 # stop the sounds (otherwise they play until their ends)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5ff7827980e] master: Cleanup: correct mul_v4_v4fl declaration

2019-11-13 Thread Jorge Bernal
Commit: 5ff7827980e3b3e598a7f630f8b2a3c90222ac70
Author: Jorge Bernal
Date:   Thu Nov 14 00:07:35 2019 +1100
Branches: master
https://developer.blender.org/rB5ff7827980e3b3e598a7f630f8b2a3c90222ac70

Cleanup: correct mul_v4_v4fl declaration

===

M   source/blender/blenlib/BLI_math_vector.h

===

diff --git a/source/blender/blenlib/BLI_math_vector.h 
b/source/blender/blenlib/BLI_math_vector.h
index 31d725af5ad..9fbd0227b7e 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -139,7 +139,7 @@ MINLINE void mul_v3_v3(float r[3], const float a[3]);
 MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3]);
 MINLINE void mul_v4_fl(float r[4], float f);
 MINLINE void mul_v4_v4(float r[4], const float a[4]);
-MINLINE void mul_v4_v4fl(float r[3], const float a[3], float f);
+MINLINE void mul_v4_v4fl(float r[3], const float a[4], float f);
 MINLINE void mul_v2_v2_cw(float r[2], const float mat[2], const float vec[2]);
 MINLINE void mul_v2_v2_ccw(float r[2], const float mat[2], const float vec[2]);
 MINLINE float mul_project_m4_v3_zfac(const float mat[4][4],

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6e08b01bd9a] master: Fix T57059: "make deps" build error when sndio library is present.

2018-10-04 Thread Jorge Bernal
Commit: 6e08b01bd9ab87f63d8176bf2ec0b4f073a92ee3
Author: Jorge Bernal
Date:   Thu Oct 4 13:31:38 2018 +0200
Branches: master
https://developer.blender.org/rB6e08b01bd9ab87f63d8176bf2ec0b4f073a92ee3

Fix T57059: "make deps" build error when sndio library is present.

===

M   build_files/build_environment/cmake/ffmpeg.cmake
M   build_files/build_environment/cmake/sdl.cmake

===

diff --git a/build_files/build_environment/cmake/ffmpeg.cmake 
b/build_files/build_environment/cmake/ffmpeg.cmake
index 5c8347cd40e..2a8e3fd5d33 100644
--- a/build_files/build_environment/cmake/ffmpeg.cmake
+++ b/build_files/build_environment/cmake/ffmpeg.cmake
@@ -112,6 +112,7 @@ ExternalProject_Add(external_ffmpeg
--disable-indev=alsa
--disable-outdev=alsa
--disable-crystalhd
+   --disable-sndio
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd 
${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd 
${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ffmpeg 
${DEFAULT_CMAKE_FLAGS}
diff --git a/build_files/build_environment/cmake/sdl.cmake 
b/build_files/build_environment/cmake/sdl.cmake
index 8383c5a5a79..ab81ad130e8 100644
--- a/build_files/build_environment/cmake/sdl.cmake
+++ b/build_files/build_environment/cmake/sdl.cmake
@@ -25,6 +25,7 @@ else()
-DSDL_STATIC=ON
-DSDL_SHARED=OFF
-DSDL_VIDEO=OFF
+   -DSNDIO=OFF
)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [dbdc346e9f] master: CMake: Remove MOTO library dependency when it is not needed

2017-02-06 Thread Jorge Bernal
Commit: dbdc346e9ff6860fdd2c46c41bb474742405bfbd
Author: Jorge Bernal
Date:   Mon Feb 6 19:29:42 2017 +0100
Branches: master
https://developer.blender.org/rBdbdc346e9ff6860fdd2c46c41bb474742405bfbd

CMake: Remove MOTO library dependency when it is not needed

It is not necessary to add MOTO library dependency when we use
WITH_IK_SOLVER (now it uses Eigen) or we use WITH_MOD_BOOLEAN (it was
used by bsp intern library some time ago but it is not present in the
code anymore).

Reviewers: mont29, sergey

Subscribers: mont29, sergey

Differential Revision: https://developer.blender.org/D2477

===

M   intern/CMakeLists.txt

===

diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt
index 9a5476772a..dd9889c81b 100644
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@ -62,7 +62,7 @@ if(WITH_IK_ITASC)
add_subdirectory(itasc)
 endif()
 
-if(WITH_IK_SOLVER OR WITH_GAMEENGINE OR WITH_MOD_BOOLEAN)
+if(WITH_GAMEENGINE)
add_subdirectory(moto)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ee59df5] master: BGE clean up: use float version of trigonometric functions

2015-12-15 Thread Jorge Bernal
Commit: ee59df521f2af10d6a34158a39bf21dd5ae847a3
Author: Jorge Bernal
Date:   Wed Dec 16 01:52:30 2015 +0100
Branches: master
https://developer.blender.org/rBee59df521f2af10d6a34158a39bf21dd5ae847a3

BGE clean up: use float version of trigonometric functions

===

M   intern/moto/include/MT_Matrix3x3.h
M   intern/moto/include/MT_Matrix3x3.inl
M   intern/moto/include/MT_Quaternion.h
M   intern/moto/include/MT_Quaternion.inl
M   intern/moto/include/MT_Vector2.inl
M   intern/moto/include/MT_Vector3.inl
M   intern/moto/include/MT_Vector4.inl
M   source/gameengine/GamePlayer/ghost/GPG_System.cpp
M   source/gameengine/Ketsji/KX_Camera.cpp
M   source/gameengine/Ketsji/KX_ConstraintActuator.cpp
M   source/gameengine/Ketsji/KX_Dome.cpp
M   source/gameengine/Ketsji/KX_OrientationInterpolator.cpp
M   source/gameengine/Ketsji/KX_TrackToActuator.cpp
M   
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

===

diff --git a/intern/moto/include/MT_Matrix3x3.h 
b/intern/moto/include/MT_Matrix3x3.h
index 8832fd5..6f965f5 100644
--- a/intern/moto/include/MT_Matrix3x3.h
+++ b/intern/moto/include/MT_Matrix3x3.h
@@ -151,12 +151,12 @@ public:
 **/
 
void setEuler(const MT_Vector3& euler) {
-   MT_Scalar ci = cos(euler[0]); 
-   MT_Scalar cj = cos(euler[1]); 
-   MT_Scalar ch = cos(euler[2]);
-   MT_Scalar si = sin(euler[0]); 
-   MT_Scalar sj = sin(euler[1]); 
-   MT_Scalar sh = sin(euler[2]);
+   MT_Scalar ci = cosf(euler[0]);
+   MT_Scalar cj = cosf(euler[1]);
+   MT_Scalar ch = cosf(euler[2]);
+   MT_Scalar si = sinf(euler[0]);
+   MT_Scalar sj = sinf(euler[1]);
+   MT_Scalar sh = sinf(euler[2]);
MT_Scalar cc = ci * ch; 
MT_Scalar cs = ci * sh; 
MT_Scalar sc = si * ch; 
@@ -170,19 +170,19 @@ public:
void getEuler(MT_Scalar& yaw, MT_Scalar& pitch, MT_Scalar& roll) const
{   
if (m_el[2][0] != -1.0f && m_el[2][0] != 1.0f) {
-   pitch = MT_Scalar(-asin(m_el[2][0]));
-   yaw = MT_Scalar(atan2(m_el[2][1] / cos(pitch), 
m_el[2][2] / cos(pitch)));
-   roll = MT_Scalar(atan2(m_el[1][0] / cos(pitch), 
m_el[0][0] / cos(pitch)));  
+   pitch = MT_Scalar(-asinf(m_el[2][0]));
+   yaw = MT_Scalar(atan2f(m_el[2][1] / 
cosf(pitch), m_el[2][2] / cosf(pitch)));
+   roll = MT_Scalar(atan2f(m_el[1][0] / 
cosf(pitch), m_el[0][0] / cosf(pitch)));
}
else {
roll = MT_Scalar(0);
if (m_el[2][0] == -1.0f) {
pitch = (float)MT_PI / 2.0f;
-   yaw = MT_Scalar(atan2(m_el[0][1], 
m_el[0][2]));
+   yaw = MT_Scalar(atan2f(m_el[0][1], 
m_el[0][2]));
}
else {
pitch = (float)-MT_PI / 2.0f;
-   yaw = MT_Scalar(atan2(m_el[0][1], 
m_el[0][2]));
+   yaw = MT_Scalar(atan2f(m_el[0][1], 
m_el[0][2]));
}
}
}
diff --git a/intern/moto/include/MT_Matrix3x3.inl 
b/intern/moto/include/MT_Matrix3x3.inl
index 088c4b0..614e4f9 100644
--- a/intern/moto/include/MT_Matrix3x3.inl
+++ b/intern/moto/include/MT_Matrix3x3.inl
@@ -9,7 +9,7 @@ GEN_INLINE MT_Quaternion MT_Matrix3x3::getRotation() const {
 
 if (trace > 0.0f) 
 {
-MT_Scalar s = sqrt(trace + MT_Scalar(1.0f));
+MT_Scalar s = sqrtf(trace + MT_Scalar(1.0f));
 result[3] = s * MT_Scalar(0.5f);
 s = MT_Scalar(0.5f) / s;
 
@@ -28,7 +28,7 @@ GEN_INLINE MT_Quaternion MT_Matrix3x3::getRotation() const {
 int j = next[i];  
 int k = next[j];
 
-MT_Scalar s = sqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + 
MT_Scalar(1.0f));
+MT_Scalar s = sqrtf(m_el[i][i] - m_el[j][j] - m_el[k][k] + 
MT_Scalar(1.0f));
 
 result[i] = s * MT_Scalar(0.5f);
 
diff --git a/intern/moto/include/MT_Quaternion.h 
b/intern/moto/include/MT_Quaternion.h
index b7703fe..6aabb1f 100644
--- a/intern/moto/include/MT_Quaternion.h
+++ b/intern/moto/include/MT_Quaternion.h
@@ -70,18 +70,18 @@ public:
 void setRotation(const MT_Vector3& axis, MT_Scalar mt_angle) {
 MT_Scalar d = ax

[Bf-blender-cvs] [0c19a04] master: BGE Ketsji clean-up: double-promotion warnings

2015-12-15 Thread Jorge Bernal
Commit: 0c19a043e8198018ae794145fc4f1e78d5f00923
Author: Jorge Bernal
Date:   Wed Dec 16 01:31:38 2015 +0100
Branches: master
https://developer.blender.org/rB0c19a043e8198018ae794145fc4f1e78d5f00923

BGE Ketsji clean-up: double-promotion warnings

===

M   source/gameengine/Ketsji/BL_Action.cpp
M   source/gameengine/Ketsji/BL_Texture.cpp
M   source/gameengine/Ketsji/KX_BlenderMaterial.cpp
M   source/gameengine/Ketsji/KX_Camera.cpp
M   source/gameengine/Ketsji/KX_ConstraintActuator.cpp
M   source/gameengine/Ketsji/KX_Dome.cpp
M   source/gameengine/Ketsji/KX_FontObject.cpp
M   source/gameengine/Ketsji/KX_GameObject.cpp
M   source/gameengine/Ketsji/KX_IPOTransform.h
M   source/gameengine/Ketsji/KX_KetsjiEngine.cpp
M   source/gameengine/Ketsji/KX_Light.cpp
M   source/gameengine/Ketsji/KX_MouseActuator.cpp
M   source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
M   source/gameengine/Ketsji/KX_ObjectActuator.cpp
M   source/gameengine/Ketsji/KX_ObjectActuator.h
M   source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
M   source/gameengine/Ketsji/KX_RadarSensor.cpp
M   source/gameengine/Ketsji/KX_RayCast.cpp
M   source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
M   source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
M   source/gameengine/Ketsji/KX_Scene.cpp
M   source/gameengine/Ketsji/KX_SoundActuator.cpp
M   source/gameengine/Ketsji/KX_SteeringActuator.cpp
M   source/gameengine/Ketsji/KX_TimeLogger.cpp
M   source/gameengine/Ketsji/KX_TrackToActuator.cpp
M   source/gameengine/Ketsji/KX_VertexProxy.cpp

===

diff --git a/source/gameengine/Ketsji/BL_Action.cpp 
b/source/gameengine/Ketsji/BL_Action.cpp
index 89d8ec0..45946f3 100644
--- a/source/gameengine/Ketsji/BL_Action.cpp
+++ b/source/gameengine/Ketsji/BL_Action.cpp
@@ -342,7 +342,7 @@ void BL_Action::SetTimes(float start, float end)
 
 void BL_Action::SetLocalTime(float curtime)
 {
-   float dt = 
(curtime-m_starttime)*KX_KetsjiEngine::GetAnimFrameRate()*m_speed;
+   float dt = 
(curtime-m_starttime)*(float)KX_KetsjiEngine::GetAnimFrameRate()*m_speed;
 
if (m_endframe < m_startframe)
dt = -dt;
@@ -354,7 +354,7 @@ void BL_Action::ResetStartTime(float curtime)
 {
float dt = (m_localframe > m_startframe) ? m_localframe - m_startframe 
: m_startframe - m_localframe;
 
-   m_starttime = curtime - dt / 
(KX_KetsjiEngine::GetAnimFrameRate()*m_speed);
+   m_starttime = curtime - dt / 
((float)KX_KetsjiEngine::GetAnimFrameRate()*m_speed);
SetLocalTime(curtime);
 }
 
@@ -365,7 +365,7 @@ void BL_Action::IncrementBlending(float curtime)
m_blendstart = curtime;

// Bump the blend frame
-   m_blendframe = (curtime - 
m_blendstart)*KX_KetsjiEngine::GetAnimFrameRate();
+   m_blendframe = (curtime - 
m_blendstart)*(float)KX_KetsjiEngine::GetAnimFrameRate();
 
// Clamp
if (m_blendframe>m_blendin)
@@ -398,7 +398,7 @@ void BL_Action::Update(float curtime)
if (m_done)
return;
 
-   curtime -= KX_KetsjiEngine::GetSuspendedDelta();
+   curtime -= (float)KX_KetsjiEngine::GetSuspendedDelta();
 
// Grab the start time here so we don't end up with a negative 
m_localframe when
// suspending and resuming scenes.
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp 
b/source/gameengine/Ketsji/BL_Texture.cpp
index d14b9cc..0b0a0f5 100644
--- a/source/gameengine/Ketsji/BL_Texture.cpp
+++ b/source/gameengine/Ketsji/BL_Texture.cpp
@@ -685,7 +685,7 @@ void BL_Texture::setTexEnv(BL_Material *mat, bool modulate)
glTexEnvf(  GL_TEXTURE_ENV, op1,
blend_operand);
} break;
}
-   glTexEnvf(  GL_TEXTURE_ENV, GL_RGB_SCALE_ARB,   1.0);
+   glTexEnvf(  GL_TEXTURE_ENV, GL_RGB_SCALE_ARB,   1.0f);
 
glEndList();
 }
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp 
b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index a10bdf4..1d185d5 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -675,13 +675,13 @@ void KX_BlenderMaterial::ActivatGLMaterials( 
RAS_IRasterizer* rasty )const
mMaterial->matcolor[0]*mMaterial->emit,
mMaterial->matcolor[1]*mMaterial->emit,
mMaterial->matcolor[2]*mMaterial->emit,
-   1.0 );
+   1.0f );
 
rasty->SetAmbient(mMaterial->amb);
}
 
if (mMaterial->material)
-   rasty->SetPolygonOffset(-mMaterial->material->zoffs, 0.0);
+   rasty->SetPolygonOffset(-mMaterial->material->

[Bf-blender-cvs] [4510fe8] master: BGE Physics clean up: double-promotion warnings

2015-12-13 Thread Jorge Bernal
Commit: 4510fe82aaa1e60a82726d981a9a21ee4866ec7a
Author: Jorge Bernal
Date:   Mon Dec 14 06:49:56 2015 +0100
Branches: master
https://developer.blender.org/rB4510fe82aaa1e60a82726d981a9a21ee4866ec7a

BGE Physics clean up: double-promotion warnings

===

M   source/gameengine/Physics/Bullet/CcdGraphicController.cpp
M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
M   source/gameengine/Physics/Bullet/CcdPhysicsController.h
M   source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

===

diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp 
b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
index fdafc4e..470a543 100644
--- a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
@@ -86,15 +86,15 @@ void CcdGraphicController::GetAabb(btVector3& aabbMin, 
btVector3& aabbMax)
btVector3 tmpAabbMin = m_localAabbMin * scale;
btVector3 tmpAabbMax = m_localAabbMax * scale;
 
-   localAabbMin[0] = (scale.getX() >= 0.0) ? tmpAabbMin[0] : tmpAabbMax[0];
-   localAabbMin[1] = (scale.getY() >= 0.0) ? tmpAabbMin[1] : tmpAabbMax[1];
-   localAabbMin[2] = (scale.getZ() >= 0.0) ? tmpAabbMin[2] : tmpAabbMax[2];
-   localAabbMax[0] = (scale.getX() <= 0.0) ? tmpAabbMin[0] : tmpAabbMax[0];
-   localAabbMax[1] = (scale.getY() <= 0.0) ? tmpAabbMin[1] : tmpAabbMax[1];
-   localAabbMax[2] = (scale.getZ() <= 0.0) ? tmpAabbMin[2] : tmpAabbMax[2];
-
-   btVector3 localHalfExtents = btScalar(0.5)*(localAabbMax-localAabbMin);
-   btVector3 localCenter = btScalar(0.5)*(localAabbMax+localAabbMin);
+   localAabbMin[0] = (scale.getX() >= 0.0f) ? tmpAabbMin[0] : 
tmpAabbMax[0];
+   localAabbMin[1] = (scale.getY() >= 0.0f) ? tmpAabbMin[1] : 
tmpAabbMax[1];
+   localAabbMin[2] = (scale.getZ() >= 0.0f) ? tmpAabbMin[2] : 
tmpAabbMax[2];
+   localAabbMax[0] = (scale.getX() <= 0.0f) ? tmpAabbMin[0] : 
tmpAabbMax[0];
+   localAabbMax[1] = (scale.getY() <= 0.0f) ? tmpAabbMin[1] : 
tmpAabbMax[1];
+   localAabbMax[2] = (scale.getZ() <= 0.0f) ? tmpAabbMin[2] : 
tmpAabbMax[2];
+
+   btVector3 localHalfExtents = btScalar(0.5f)*(localAabbMax-localAabbMin);
+   btVector3 localCenter = btScalar(0.5f)*(localAabbMax+localAabbMin);

btMatrix3x3 abs_b = rot.absolute();  
btVector3 center = rot*localCenter + pos;
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 7917f47..89806d8 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -157,7 +157,7 @@ CcdPhysicsController::CcdPhysicsController (const 
CcdConstructionInfo& ci)
m_savedCollisionFlags = 0;
m_savedCollisionFilterGroup = 0;
m_savedCollisionFilterMask = 0;
-   m_savedMass = 0.0;
+   m_savedMass = 0.0f;
m_savedDyna = false;
m_suspended = false;

@@ -280,7 +280,7 @@ bool CcdPhysicsController::CreateSoftbody()
rbci.m_friction = m_cci.m_friction;
rbci.m_restitution = m_cci.m_restitution;

-   btVector3 p(0,0,0);// = getOrigin();
+   btVector3 p(0.0f,0.0f,0.0f);// = getOrigin();
//btSoftBody*   psb=btSoftBodyHelpers::CreateRope(worldInfo,
btVector3(-10,0,i*0.25),btVector3(10,0,i*0.25), 16,1+2);
btSoftBody* psb  = 0;
btSoftBodyWorldInfo& worldInfo = 
m_cci.m_physicsEnv->GetDynamicsWorld()->getWorldInfo();
@@ -1095,7 +1095,7 @@ void  CcdPhysicsController::SuspendDynamics(bool 
ghost)
m_savedCollisionFilterMask = handle->m_collisionFilterMask;
m_suspended = true;
GetPhysicsEnvironment()->UpdateCcdPhysicsController(this,
-   0.0,
+   0.0f,

btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)),
btBroadphaseProxy::StaticFilter,
btBroadphaseProxy::AllFilter ^ 
btBroadphaseProxy::StaticFilter);
@@ -1561,9 +1561,9 @@ void
CcdPhysicsController::AddCompoundChild(PHY_IPhysicsController* child)
rootBody->getMotionState()->getWorldTransform(rootTrans);
childBody->getMotionState()->getWorldTransform(childTrans);
btVector3 rootScale = rootShape->getLocalScaling();
-   rootScale[0] = 1.0/rootScale[0];
-   rootScale[1] = 1.0/rootScale[1];
-   rootScale[2] = 1.0/rootScale[2];
+   rootScale[0] = 1.0f/rootScale[0];
+   rootScale[1] = 1.0f/rootScale[1];
+   rootScale[2] = 1.0f/rootScale[2];
// rel

[Bf-blender-cvs] [94b34c9] master: BGE Scenegraph clean up: double-promotion warnings

2015-12-13 Thread Jorge Bernal
Commit: 94b34c9d44dea4c3f22384a76122d57aec53b6ef
Author: Jorge Bernal
Date:   Mon Dec 14 06:39:52 2015 +0100
Branches: master
https://developer.blender.org/rB94b34c9d44dea4c3f22384a76122d57aec53b6ef

BGE Scenegraph clean up: double-promotion warnings

===

M   source/gameengine/SceneGraph/SG_BBox.cpp
M   source/gameengine/SceneGraph/SG_BBox.h
M   source/gameengine/SceneGraph/SG_Spatial.cpp
M   source/gameengine/SceneGraph/SG_Tree.cpp

===

diff --git a/source/gameengine/SceneGraph/SG_BBox.cpp 
b/source/gameengine/SceneGraph/SG_BBox.cpp
index 0ecf628..f9d83d3 100644
--- a/source/gameengine/SceneGraph/SG_BBox.cpp
+++ b/source/gameengine/SceneGraph/SG_BBox.cpp
@@ -37,8 +37,8 @@
 #include "SG_Node.h"
  
 SG_BBox::SG_BBox() :
-   m_min(0.0, 0.0, 0.0),
-   m_max(0.0, 0.0, 0.0)
+   m_min(0.0f, 0.0f, 0.0f),
+   m_max(0.0f, 0.0f, 0.0f)
 {
 }
 
@@ -209,11 +209,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const
{
left.m_min = m_min;
left.m_max[0] = m_max[0];
-   left.m_max[1] = m_min[1] + sizey/2.0;
+   left.m_max[1] = m_min[1] + sizey/2.0f;
left.m_max[2] = m_max[2];

right.m_min[0] = m_min[0];
-   right.m_min[1] = m_min[1] + sizey/2.0;
+   right.m_min[1] = m_min[1] + sizey/2.0f;
right.m_min[2] = m_min[2];
right.m_max = m_max;
std::cout << "splity" << std::endl;
@@ -222,11 +222,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const
left.m_min = m_min;
left.m_max[0] = m_max[0];
left.m_max[1] = m_max[1];
-   left.m_max[2] = m_min[2] + sizez/2.0;
+   left.m_max[2] = m_min[2] + sizez/2.0f;

right.m_min[0] = m_min[0];
right.m_min[1] = m_min[1];
-   right.m_min[2] = m_min[2] + sizez/2.0;
+   right.m_min[2] = m_min[2] + sizez/2.0f;
right.m_max = m_max;
std::cout << "splitz" << std::endl;
}
@@ -234,11 +234,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const
else {
if (sizex > sizez) {
left.m_min = m_min;
-   left.m_max[0] = m_min[0] + sizex/2.0;
+   left.m_max[0] = m_min[0] + sizex/2.0f;
left.m_max[1] = m_max[1];
left.m_max[2] = m_max[2];

-   right.m_min[0] = m_min[0] + sizex/2.0;
+   right.m_min[0] = m_min[0] + sizex/2.0f;
right.m_min[1] = m_min[1];
right.m_min[2] = m_min[2];
right.m_max = m_max;
@@ -248,11 +248,11 @@ void SG_BBox::split(SG_BBox &left, SG_BBox &right) const
left.m_min = m_min;
left.m_max[0] = m_max[0];
left.m_max[1] = m_max[1];
-   left.m_max[2] = m_min[2] + sizez/2.0;
+   left.m_max[2] = m_min[2] + sizez/2.0f;

right.m_min[0] = m_min[0];
right.m_min[1] = m_min[1];
-   right.m_min[2] = m_min[2] + sizez/2.0;
+   right.m_min[2] = m_min[2] + sizez/2.0f;
right.m_max = m_max;
std::cout << "splitz" << std::endl;
}
diff --git a/source/gameengine/SceneGraph/SG_BBox.h 
b/source/gameengine/SceneGraph/SG_BBox.h
index cd1c523..3c524dc 100644
--- a/source/gameengine/SceneGraph/SG_BBox.h
+++ b/source/gameengine/SceneGraph/SG_BBox.h
@@ -81,7 +81,7 @@ public:
/**
 * Scales the bounding box about the optional point.
 */
-   void scale(const MT_Vector3 &size, const MT_Point3 &point = 
MT_Point3(0.0, 0.0, 0.0));
+   void scale(const MT_Vector3 &size, const MT_Point3 &point = 
MT_Point3(0.0f, 0.0f, 0.0f));
 #endif
SG_BBox transform(const MT_Transform &world) const;
/**
diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp 
b/source/gameengine/SceneGraph/SG_Spatial.cpp
index f30c80d..5cb7587 100644
--- a/source/gameengine/SceneGraph/SG_Spatial.cpp
+++ b/source/gameengine/SceneGraph/SG_Spatial.cpp
@@ -43,18 +43,18 @@ SG_Spatial(
 ): 
 
SG_IObject(clientobj,clientinfo,callbacks),
-   m_localPosition(0.0,0.0,0.0),
-   m_localRotation(1.0,0.0,0.0,0

[Bf-blender-cvs] [d9ee88d] master: BGE Rasterizer clean up: double-promotion warnings

2015-12-12 Thread Jorge Bernal
Commit: d9ee88d126ddb59b68d2561694b522a99e4923b6
Author: Jorge Bernal
Date:   Sun Dec 13 03:17:19 2015 +0100
Branches: master
https://developer.blender.org/rBd9ee88d126ddb59b68d2561694b522a99e4923b6

BGE Rasterizer clean up: double-promotion warnings

===

M   source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
M   source/gameengine/Rasterizer/RAS_BucketManager.cpp
M   source/gameengine/Rasterizer/RAS_CameraData.h
M   source/gameengine/Rasterizer/RAS_FramingManager.cpp
M   source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
M   source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
M   source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp
M   
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
M   source/gameengine/Rasterizer/RAS_TexVert.cpp

===

diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp 
b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index cedc27c..82b2674 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -495,10 +495,10 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* 
canvas)
 
glBegin(GL_QUADS);
glColor4f(1.f, 1.f, 1.f, 1.f);
-   glTexCoord2f(1.0, 1.0); 
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[3]); 
glVertex2f(1,1);
-   glTexCoord2f(0.0, 1.0); 
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[3]); 
glVertex2f(-1,1);
-   glTexCoord2f(0.0, 0.0); 
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[2]); 
glVertex2f(-1,-1);
-   glTexCoord2f(1.0, 0.0); 
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[2]); 
glVertex2f(1,-1);
+   glTexCoord2f(1.0f, 1.0f);   
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[3]); 
glVertex2f(1.0f,1.0f);
+   glTexCoord2f(0.0f, 1.0f);   
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[3]); 
glVertex2f(-1.0f,1.0f);
+   glTexCoord2f(0.0f, 0.0f);   
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[0], canvascoord[2]); 
glVertex2f(-1.0f,-1.0f);
+   glTexCoord2f(1.0f, 0.0f);   
glMultiTexCoord2fARB(GL_TEXTURE3_ARB, canvascoord[1], canvascoord[2]); 
glVertex2f(1.0f,-1.0f);
glEnd();
}
}
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp 
b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index f90b595..d131891 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -282,7 +282,7 @@ void RAS_BucketManager::OptimizeBuckets(MT_Scalar distance)
 {
BucketList::iterator bit;

-   distance = 10.0;
+   distance = 10.0f;
 
for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit)
(*bit)->Optimize(distance);
diff --git a/source/gameengine/Rasterizer/RAS_CameraData.h 
b/source/gameengine/Rasterizer/RAS_CameraData.h
index e2024a4..bc8433a 100644
--- a/source/gameengine/Rasterizer/RAS_CameraData.h
+++ b/source/gameengine/Rasterizer/RAS_CameraData.h
@@ -51,10 +51,10 @@ struct RAS_CameraData
int m_viewporttop;
float m_focallength;
 
-   RAS_CameraData(float lens = 35.0, float scale = 6.0, float sensor_x = 
32.0, float sensor_y = 18.0, short sensor_fit = 0,
-  float shift_x = 0.0, float shift_y = 0.0,
-  float clipstart = 0.1, float clipend = 5000.0, bool 
perspective = true,
-  float focallength = 3.0, bool viewport = false, int 
viewportleft = 0, int viewportbottom = 0,
+   RAS_CameraData(float lens = 35.0f, float scale = 6.0f, float sensor_x = 
32.0f, float sensor_y = 18.0f, short sensor_fit = 0,
+  float shift_x = 0.0f, float shift_y = 0.0f,
+  float clipstart = 0.1f, float clipend = 5000.0f, bool 
perspective = true,
+  float focallength = 3.0f, bool viewport = false, int 
viewportleft = 0, int viewportbottom = 0,
   int viewportright = 0, int viewporttop = 0) :
m_lens(lens),
m_scale(scale),
diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.cpp 
b/source/gameengine/Rasterizer/RAS_FramingManager.cpp
index c5f15c9..8b0ec22 100644
--- a/source/gameengine/Rasterizer/RAS_FramingManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_FramingManager.cpp
@@ -283,14 +283,14 @@ ComputeFrustum(
switch (sensor_fit) {
case RAS_SENSORFIT_

[Bf-blender-cvs] [0dcca69] master: Moto Clean-up: double-promotion warnings

2015-12-12 Thread Jorge Bernal
Commit: 0dcca6958913093948006d389ef9a55db0f8
Author: Jorge Bernal
Date:   Sun Dec 13 02:50:30 2015 +0100
Branches: master
https://developer.blender.org/rB0dcca6958913093948006d389ef9a55db0f8

Moto Clean-up: double-promotion warnings

===

M   intern/moto/include/MT_Matrix3x3.h
M   intern/moto/include/MT_Matrix3x3.inl
M   intern/moto/include/MT_Matrix4x4.h
M   intern/moto/include/MT_Matrix4x4.inl
M   intern/moto/include/MT_Quaternion.h
M   intern/moto/include/MT_Quaternion.inl
M   intern/moto/include/MT_Scalar.h
M   intern/moto/include/MT_Vector2.inl
M   intern/moto/include/MT_Vector3.inl
M   intern/moto/include/MT_Vector4.inl
M   intern/moto/intern/MT_CmMatrix4x4.cpp
M   intern/moto/intern/MT_Transform.cpp

===

diff --git a/intern/moto/include/MT_Matrix3x3.h 
b/intern/moto/include/MT_Matrix3x3.h
index 17dd533..8832fd5 100644
--- a/intern/moto/include/MT_Matrix3x3.h
+++ b/intern/moto/include/MT_Matrix3x3.h
@@ -132,14 +132,14 @@ public:
 void setRotation(const MT_Quaternion& q) {
 MT_Scalar d = q.length2();
 MT_assert(!MT_fuzzyZero2(d));
-MT_Scalar s = MT_Scalar(2.0) / d;
+MT_Scalar s = MT_Scalar(2.0f) / d;
 MT_Scalar xs = q[0] * s,   ys = q[1] * s,   zs = q[2] * s;
 MT_Scalar wx = q[3] * xs,  wy = q[3] * ys,  wz = q[3] * zs;
 MT_Scalar xx = q[0] * xs,  xy = q[0] * ys,  xz = q[0] * zs;
 MT_Scalar yy = q[1] * ys,  yz = q[1] * zs,  zz = q[2] * zs;
-setValue(MT_Scalar(1.0) - (yy + zz), xy - wz, xz + wy,
- xy + wz, MT_Scalar(1.0) - (xx + zz), yz - wx,
- xz - wy, yz + wx, MT_Scalar(1.0) - (xx + yy));
+setValue(MT_Scalar(1.0f) - (yy + zz), xy - wz, xz + wy,
+ xy + wz, MT_Scalar(1.0f) - (xx + zz), yz - wx,
+ xz - wy, yz + wx, MT_Scalar(1.0f) - (xx + 
yy));
 }
 
/**
@@ -169,19 +169,19 @@ public:
 
void getEuler(MT_Scalar& yaw, MT_Scalar& pitch, MT_Scalar& roll) const
{   
-   if (m_el[2][0] != -1.0 && m_el[2][0] != 1.0) {
+   if (m_el[2][0] != -1.0f && m_el[2][0] != 1.0f) {
pitch = MT_Scalar(-asin(m_el[2][0]));
yaw = MT_Scalar(atan2(m_el[2][1] / cos(pitch), 
m_el[2][2] / cos(pitch)));
roll = MT_Scalar(atan2(m_el[1][0] / cos(pitch), 
m_el[0][0] / cos(pitch)));  
}
else {
roll = MT_Scalar(0);
-   if (m_el[2][0] == -1.0) {
-   pitch = MT_PI / 2.0;
+   if (m_el[2][0] == -1.0f) {
+   pitch = (float)MT_PI / 2.0f;
yaw = MT_Scalar(atan2(m_el[0][1], 
m_el[0][2]));
}
else {
-   pitch = - MT_PI / 2.0;
+   pitch = (float)-MT_PI / 2.0f;
yaw = MT_Scalar(atan2(m_el[0][1], 
m_el[0][2]));
}
}
@@ -200,15 +200,15 @@ public:
 }
 
 void setIdentity() { 
-setValue(MT_Scalar(1.0), MT_Scalar(0.0), MT_Scalar(0.0), 
- MT_Scalar(0.0), MT_Scalar(1.0), MT_Scalar(0.0), 
- MT_Scalar(0.0), MT_Scalar(0.0), MT_Scalar(1.0)); 
+setValue(MT_Scalar(1.0f), MT_Scalar(0.0f), MT_Scalar(0.0f), 
+ MT_Scalar(0.0f), MT_Scalar(1.0f), MT_Scalar(0.0f), 
+ MT_Scalar(0.0f), MT_Scalar(0.0f), MT_Scalar(1.0f)); 
 }
 
 void getValue(float *m) const {
-*m++ = (float) m_el[0][0]; *m++ = (float) m_el[1][0]; *m++ = (float) 
m_el[2][0]; *m++ = (float) 0.0;
-*m++ = (float) m_el[0][1]; *m++ = (float) m_el[1][1]; *m++ = (float) 
m_el[2][1]; *m++ = (float) 0.0;
-*m++ = (float) m_el[0][2]; *m++ = (float) m_el[1][2]; *m++ = (float) 
m_el[2][2]; *m   = (float) 0.0;
+*m++ = (float) m_el[0][0]; *m++ = (float) m_el[1][0]; *m++ = (float) 
m_el[2][0]; *m++ = (float) 0.0f;
+*m++ = (float) m_el[0][1]; *m++ = (float) m_el[1][1]; *m++ = (float) 
m_el[2][1]; *m++ = (float) 0.0f;
+*m++ = (float) m_el[0][2]; *m++ = (float) m_el[1][2]; *m++ = (float) 
m_el[2][2]; *m   = (float) 0.0f;
 }
 
 void getValue(double *m) const {
diff --git a/intern/moto/include/MT_Matrix3x3.inl 
b/intern/moto/include/MT_Matrix3x3.inl
index c581640..088c4b0 100644
--- a/intern/moto/include/MT_Matrix3x3.inl
+++ b/inte

[Bf-blender-cvs] [d2af140] master: BGE: Fix SetMass function affecting own object gravity.

2015-10-29 Thread Jorge Bernal
Commit: d2af1401510200bcc5d1841d5ef186e7cb545133
Author: Jorge Bernal
Date:   Fri Oct 30 06:49:43 2015 +0100
Branches: master
https://developer.blender.org/rBd2af1401510200bcc5d1841d5ef186e7cb545133

BGE: Fix SetMass function affecting own object gravity.

Each time we setted the mass the own object gravity was divided by its
old mass (i.e you could convert you car in a flying DeLorean with a
simple mass car modification).

A note will be included in release notes due to retro compability
issues.

===

M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index dba65c0..7917f47 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -1194,16 +1194,12 @@ void CcdPhysicsController::SetMass(MT_Scalar newmass)
btRigidBody *body = GetRigidBody();
if (body && !m_suspended && newmass>MT_EPSILON && GetMass()>MT_EPSILON)
{
-   btVector3 grav = body->getGravity();
-   btVector3 accel = grav / GetMass();
-
btBroadphaseProxy* handle = body->getBroadphaseHandle();
GetPhysicsEnvironment()->UpdateCcdPhysicsController(this,
newmass,
body->getCollisionFlags(),
handle->m_collisionFilterGroup,
handle->m_collisionFilterMask);
-   body->setGravity(accel);
}
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9eb7eb5] master: BGE: Fix T44448: LOD will display wrong LOD level object if zoomed out then in

2015-10-27 Thread Jorge Bernal
Commit: 9eb7eb5379cdb2f8584aa90d0bec0ffef2f91023
Author: Jorge Bernal
Date:   Wed Oct 28 01:21:36 2015 +0100
Branches: master
https://developer.blender.org/rB9eb7eb5379cdb2f8584aa90d0bec0ffef2f91023

BGE: Fix T8: LOD will display wrong LOD level object if zoomed out
then in

Current object distance hasn't to be cached.

===

M   source/blender/blenkernel/intern/object.c

===

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index 4ec4137..b6fcb04 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1156,16 +1156,15 @@ bool BKE_object_lod_remove(Object *ob, int level)
 static LodLevel *lod_level_select(Object *ob, const float camera_position[3])
 {
LodLevel *current = ob->currentlod;
-   float dist_sq, dist_sq_curr;
+   float dist_sq;
 
if (!current) return NULL;
 
dist_sq = len_squared_v3v3(ob->obmat[3], camera_position);
-   dist_sq_curr = current->distance * current->distance;
 
-   if (dist_sq < dist_sq_curr) {
+   if (dist_sq < SQUARE(current->distance)) {
/* check for higher LoD */
-   while (current->prev && dist_sq < dist_sq_curr) {
+   while (current->prev && dist_sq < SQUARE(current->distance)) {
current = current->prev;
}
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6ffc988] master: BGE Clean-up: New EXP prefix for the BGE Expression module

2015-07-12 Thread Jorge Bernal
Commit: 6ffc988ae3aa57822be89e9580146908c938e0a0
Author: Jorge Bernal
Date:   Sun Jul 12 16:55:33 2015 +0200
Branches: master
https://developer.blender.org/rB6ffc988ae3aa57822be89e9580146908c938e0a0

BGE Clean-up: New EXP prefix for the BGE Expression module

The expression module now uses an EXP prefix and it follows a
distribution similar to blender.

Additionally the hash function in EXP_HashedPtr.h was simplified and the
files EXP_C-Api.h &.EXP_C-Api.cpp were deleted because were unused.

Reviewers: campbellbarton, moguri, sybren, hg1

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1221

===

M   source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
M   source/gameengine/Converter/BL_ActionActuator.cpp
M   source/gameengine/Converter/BL_ArmatureChannel.h
M   source/gameengine/Converter/BL_ArmatureConstraint.h
M   source/gameengine/Converter/BL_BlenderDataConversion.h
M   source/gameengine/Converter/BL_ShapeActionActuator.cpp
M   source/gameengine/Converter/KX_BlenderSceneConverter.h
M   source/gameengine/Converter/KX_ConvertActuators.cpp
M   source/gameengine/Converter/KX_ConvertControllers.cpp
M   source/gameengine/Converter/KX_ConvertControllers.h
M   source/gameengine/Converter/KX_ConvertProperties.cpp
M   source/gameengine/Converter/KX_ConvertSensors.cpp
M   source/gameengine/Converter/KX_LibLoadStatus.h
D   source/gameengine/Expressions/BoolValue.cpp
D   source/gameengine/Expressions/BoolValue.h
M   source/gameengine/Expressions/CMakeLists.txt
D   source/gameengine/Expressions/ConstExpr.cpp
D   source/gameengine/Expressions/ConstExpr.h
A   source/gameengine/Expressions/EXP_BoolValue.h
D   source/gameengine/Expressions/EXP_C-Api.cpp
D   source/gameengine/Expressions/EXP_C-Api.h
A   source/gameengine/Expressions/EXP_ConstExpr.h
A   source/gameengine/Expressions/EXP_EmptyValue.h
A   source/gameengine/Expressions/EXP_ErrorValue.h
A   source/gameengine/Expressions/EXP_Expression.h
A   source/gameengine/Expressions/EXP_FloatValue.h
A   source/gameengine/Expressions/EXP_HashedPtr.h
A   source/gameengine/Expressions/EXP_IdentifierExpr.h
A   source/gameengine/Expressions/EXP_IfExpr.h
A   source/gameengine/Expressions/EXP_InputParser.h
A   source/gameengine/Expressions/EXP_IntValue.h
A   source/gameengine/Expressions/EXP_ListValue.h
A   source/gameengine/Expressions/EXP_Operator1Expr.h
A   source/gameengine/Expressions/EXP_Operator2Expr.h
A   source/gameengine/Expressions/EXP_PyObjectPlus.h
A   source/gameengine/Expressions/EXP_Python.h
A   source/gameengine/Expressions/EXP_PythonCallBack.h
A   source/gameengine/Expressions/EXP_StringValue.h
A   source/gameengine/Expressions/EXP_Value.h
A   source/gameengine/Expressions/EXP_VectorValue.h
A   source/gameengine/Expressions/EXP_VoidValue.h
D   source/gameengine/Expressions/EmptyValue.cpp
D   source/gameengine/Expressions/EmptyValue.h
D   source/gameengine/Expressions/ErrorValue.cpp
D   source/gameengine/Expressions/ErrorValue.h
D   source/gameengine/Expressions/Expression.cpp
D   source/gameengine/Expressions/Expression.h
D   source/gameengine/Expressions/FloatValue.cpp
D   source/gameengine/Expressions/FloatValue.h
D   source/gameengine/Expressions/IdentifierExpr.cpp
D   source/gameengine/Expressions/IdentifierExpr.h
D   source/gameengine/Expressions/IfExpr.cpp
D   source/gameengine/Expressions/IfExpr.h
D   source/gameengine/Expressions/InputParser.cpp
D   source/gameengine/Expressions/InputParser.h
D   source/gameengine/Expressions/IntValue.cpp
D   source/gameengine/Expressions/IntValue.h
D   source/gameengine/Expressions/KX_HashedPtr.cpp
D   source/gameengine/Expressions/KX_HashedPtr.h
D   source/gameengine/Expressions/KX_Python.h
D   source/gameengine/Expressions/KX_PythonCallBack.cpp
D   source/gameengine/Expressions/KX_PythonCallBack.h
D   source/gameengine/Expressions/ListValue.cpp
D   source/gameengine/Expressions/ListValue.h
D   source/gameengine/Expressions/Operator1Expr.cpp
D   source/gameengine/Expressions/Operator1Expr.h
D   source/gameengine/Expressions/Operator2Expr.cpp
D   source/gameengine/Expressions/Operator2Expr.h
D   source/gameengine/Expressions/PyObjectPlus.cpp
D   source/gameengine/Expressions/PyObjectPlus.h
M   source/gameengine/Expressions/SConscript
D   source/gameengine/Expressions/StringValue.cpp
D   source/gameengine/Expressions/StringValue.h
D   source/gameengine/Expressions/Value.cpp
D   source/gameengine/Expressions/Value.h
D   source/gameengine/Expressions/VectorValue.cpp
D   source/gameengine/Expressions/VectorValue.h
D   source/gameengine/Expressions/VoidValue.h
A   source/gameengine/Expressions/intern/BoolValue

[Bf-blender-cvs] [1258328] master: BGE: Fix T45341: Crash when camera is eliminated

2015-07-06 Thread Jorge Bernal
Commit: 12583287e78505f45d62d9fd419371be66debf93
Author: Jorge Bernal
Date:   Mon Jul 6 15:40:09 2015 +0200
Branches: master
https://developer.blender.org/rB12583287e78505f45d62d9fd419371be66debf93

BGE: Fix T45341: Crash when camera is eliminated

A null check is added to avoid crashes when the camera is removed during
the game and no other is available

===

M   source/gameengine/Ketsji/KX_Scene.cpp

===

diff --git a/source/gameengine/Ketsji/KX_Scene.cpp 
b/source/gameengine/Ketsji/KX_Scene.cpp
index 3a59654..d33cbb9 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1756,6 +1756,10 @@ void KX_Scene::RenderFonts()
 void KX_Scene::UpdateObjectLods(void)
 {
KX_GameObject* gameobj;
+
+   if (!this->m_active_camera)
+   return;
+
MT_Vector3 cam_pos = this->m_active_camera->NodeGetWorldPosition();
 
for (int i = 0; i < this->GetObjectList()->GetCount(); i++) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [51188ec] master: BGE Cleanup: Translation of several comments in Dutch

2015-06-19 Thread Jorge Bernal
Commit: 51188ecbf16f2a9cd16e2fc3c170bc2f621315f6
Author: Jorge Bernal
Date:   Sat Jun 20 01:18:39 2015 +0200
Branches: master
https://developer.blender.org/rB51188ecbf16f2a9cd16e2fc3c170bc2f621315f6

BGE Cleanup: Translation of several comments in Dutch

===

M   source/gameengine/Ketsji/KX_CameraActuator.cpp

===

diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp 
b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index acf30b48..4dc30ae 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -288,7 +288,7 @@ bool KX_CameraActuator::Update(double curtime, bool frame)
from[1] += fac * fp1[1];
from[2] += fac * fp1[2];

-   /* alleen alstie ervoor ligt: cross testen en loodrechte bijtellen */
+   /* only for it lies: cross test and perpendicular bites up */
if (inp < 0.0f) {
if (fp1[0] * fp2[1] - fp1[1] * fp2[0] > 0.0f) {
from[0] -= fac * fp1[1];
@@ -300,7 +300,7 @@ bool KX_CameraActuator::Update(double curtime, bool frame)
}
}
 
-   /* CONSTRAINT 5: minimum / maximum afstand */
+   /* CONSTRAINT 5: minimum / maximum distance */
 
rc[0] = (lookat[0]-from[0]);
rc[1] = (lookat[1]-from[1]);
@@ -323,7 +323,7 @@ bool KX_CameraActuator::Update(double curtime, bool frame)
}
 
 
-   /* CONSTRAINT 7: track to schaduw */
+   /* CONSTRAINT 7: track to floor below actor */
rc[0] = (lookat[0]-from[0]);
rc[1] = (lookat[1]-from[1]);
rc[2] = (lookat[2]-from[2]);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8e1ba0b] master: BGE Cleanup: remove dead code at SetCenterOfMassTransform

2015-06-19 Thread Jorge Bernal
Commit: 8e1ba0b805db988bff8178d707d7435cfc72a1f8
Author: Jorge Bernal
Date:   Sat Jun 20 01:00:22 2015 +0200
Branches: master
https://developer.blender.org/rB8e1ba0b805db988bff8178d707d7435cfc72a1f8

BGE Cleanup: remove dead code at SetCenterOfMassTransform

Basically, at this line body is always NULL and the code is never
executed

Reviewers: moguri, hg1, panzergame, agoose77

Reviewed By: hg1, panzergame, agoose77

Subscribers: blueprintrandom

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1331

===

M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 8ea2b4f..4fd1f10 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -893,12 +893,6 @@ void   
CcdPhysicsController::SetCenterOfMassTransform(btTransform& xform)
{
m_object->setInterpolationWorldTransform(xform);
}
-   if (body)
-   {
-   
body->setInterpolationLinearVelocity(body->getLinearVelocity());
-   
body->setInterpolationAngularVelocity(body->getAngularVelocity());
-   body->updateInertiaTensor();
-   }
m_object->setWorldTransform(xform);
}
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6d63446] master: BGE: Fix for precision lost in setBackground/getBackground at Video Texture

2015-06-15 Thread Jorge Bernal
Commit: 6d634467104fc53701d77c7aeb1382a3c198b6d2
Author: Jorge Bernal
Date:   Tue Jun 16 00:05:25 2015 +0200
Branches: master
https://developer.blender.org/rB6d634467104fc53701d77c7aeb1382a3c198b6d2

BGE: Fix for precision lost in setBackground/getBackground at Video Texture

Now internally the variables are processed as floats avoiding int->float->char 
conversions that are causing precision lost.

A check for int numbers is maintained to keep compatibility with old behaviour.

Reviewers: ben2610, campbellbarton, moguri, hg1

Reviewed By: moguri, hg1

Subscribers: campbellbarton

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1301

===

M   doc/python_api/rst/bge.texture.rst
M   source/gameengine/VideoTexture/ImageRender.cpp
M   source/gameengine/VideoTexture/ImageRender.h

===

diff --git a/doc/python_api/rst/bge.texture.rst 
b/doc/python_api/rst/bge.texture.rst
index 0c9e9da..dde2661 100644
--- a/doc/python_api/rst/bge.texture.rst
+++ b/doc/python_api/rst/bge.texture.rst
@@ -218,6 +218,8 @@ When the texture object is deleted, the new texture is 
deleted and the old textu
 
   background color
 
+  :type: int or float list [r, g, b, a] in [0.0, 255.0]
+
.. attribute:: capsize
 
   size of render area
@@ -315,6 +317,8 @@ When the texture object is deleted, the new texture is 
deleted and the old textu
 
   background color
 
+  :type: int or float list [r, g, b, a] in [0.0, 255.0]
+
.. attribute:: capsize
 
   size of render area
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp 
b/source/gameengine/VideoTexture/ImageRender.cpp
index 2b2a6e0..66bb160 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -90,14 +90,19 @@ ImageRender::~ImageRender (void)
m_camera->Release();
 }
 
+// get background color
+float ImageRender::getBackground (int idx)
+{
+   return (idx < 0 || idx > 3) ? 0.0f : m_background[idx] * 255.0f;
+}
 
 // set background color
-void ImageRender::setBackground (int red, int green, int blue, int alpha)
+void ImageRender::setBackground (float red, float green, float blue, float 
alpha)
 {
-   m_background[0] = (red < 0) ? 0.f : (red > 255) ? 1.f : 
float(red)/255.f;
-   m_background[1] = (green < 0) ? 0.f : (green > 255) ? 1.f : 
float(green)/255.f;
-   m_background[2] = (blue < 0) ? 0.f : (blue > 255) ? 1.f : 
float(blue)/255.f;
-   m_background[3] = (alpha < 0) ? 0.f : (alpha > 255) ? 1.f : 
float(alpha)/255.f;
+   m_background[0] = (red < 0.0f) ? 0.0f : (red > 255.0f) ? 1.0f : red / 
255.0f;
+   m_background[1] = (green < 0.0f) ? 0.0f : (green > 255.0f) ? 1.0f : 
green / 255.0f;
+   m_background[2] = (blue < 0.0f) ? 0.0f : (blue > 255.0f) ? 1.0f : blue 
/ 255.0f;
+   m_background[3] = (alpha < 0.0f) ? 0.0f : (alpha > 255.0f) ? 1.0f : 
alpha / 255.0f;
 }
 
 // set background color from scene
@@ -105,10 +110,12 @@ void ImageRender::setBackgroundFromScene (KX_Scene *scene)
 {
if (scene) {
const float *background_color = 
scene->GetWorldInfo()->getBackColor();
-   setBackground((int) (background_color[0] * 255.0f), (int) 
(background_color[1] * 255.0f), (int) (background_color[2] * 255.0f), 255);
+   copy_v3_v3(m_background, background_color);
+   m_background[3] = 1.0f;
}
else {
-   setBackground(0, 0, 255, 255);
+   const float blue_color[] = {0.0f, 0.0f, 1.0f, 1.0f};
+   copy_v4_v4(m_background, blue_color);
}
 }
 
@@ -360,7 +367,7 @@ static int ImageRender_init(PyObject *pySelf, PyObject 
*args, PyObject *kwds)
 // get background color
 static PyObject *getBackground (PyImage *self, void *closure)
 {
-   return Py_BuildValue("[]",
+   return Py_BuildValue("[]",
 getImageRender(self)->getBackground(0),
 getImageRender(self)->getBackground(1),
 getImageRender(self)->getBackground(2),
@@ -372,20 +379,20 @@ static int setBackground(PyImage *self, PyObject *value, 
void *closure)
 {
// check validity of parameter
if (value == NULL || !PySequence_Check(value) || PySequence_Size(value) 
!= 4
-   || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0))
-   || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1))
-   || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 2))
-   || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 3)))
-   {
-   PyErr_SetString(PyExc_TypeError, "The value must be a sequence 
of 4 integer between 0 and 255");
+ 

Re: [Bf-blender-cvs] [1c707a2] master: BGE: Fix T43918: adding submodule bge.app including attribute version.

2015-06-15 Thread Jorge Bernal
Hi,
Only to remark that the author of this patch is Quentin Wenger (Matpi).

I know that after phabricator update is more difficult to find the author's
mail which it is necessary to give correct acknowledgement using git.
Perhaps, the easiest way is to modify the commit log including an author
field.

Regards,
Jorge
 El 15/06/2015 21:47, "Porteries Tristan" 
escribió:

> Commit: 1c707a239258996e4f5a5873517ff34564eaf8da
> Author: Porteries Tristan
> Date:   Mon Jun 15 21:20:47 2015 +0200
> Branches: master
> https://developer.blender.org/rB1c707a239258996e4f5a5873517ff34564eaf8da
>
> BGE: Fix T43918: adding submodule bge.app including attribute version.
>
> This patch adds the submodule app to bge. apps contains constants similar
> to bpy.app, particularly version (tuple of three ints like 2.75.1).
>
> It was requested in T43918 and set as TODO.
>
> The patch also adds rst doc for the module.
>
> Reviewers: moguri, kupoman, lordloki, panzergame, campbellbarton
>
> Reviewed By: lordloki, panzergame, campbellbarton
>
> Subscribers: marcino15
>
> Projects: #game_logic, #game_python, #game_engine
>
> Differential Revision: https://developer.blender.org/D1348
>
> ===
>
> A   doc/python_api/rst/bge.app.rst
> M   doc/python_api/sphinx_doc_gen.py
> M   source/gameengine/Ketsji/KX_PythonInit.cpp
> M   source/gameengine/Ketsji/KX_PythonInit.h
>
> ===
>
> diff --git a/doc/python_api/rst/bge.app.rst
> b/doc/python_api/rst/bge.app.rst
> new file mode 100644
> index 000..a0c2cf3
> --- /dev/null
> +++ b/doc/python_api/rst/bge.app.rst
> @@ -0,0 +1,47 @@
> +
> +Application Data (bge.app)
> +==
> +
> +Module to access application values that remain unchanged during runtime.
> +
> +.. module:: bge.app
> +
> +.. data:: version
> +
> +   The Blender/BGE version as a tuple of 3 ints, eg. (2, 75, 1).
> +
> +   .. note:: Version tuples can be compared simply with (in)equality
> symbols;
> + for example, ``(2, 74, 5) <= (2, 75, 0)`` returns True
> (lexical order).
> +
> +   :type: tuple of three ints
> +
> +.. data:: version_string
> +
> +   The Blender/BGE version formatted as a string, eg. "2.75 (sub 1)".
> +
> +   :type: str
> +
> +.. data:: version_char
> +
> +   The Blender/BGE version character (for minor releases).
> +
> +   :type: str
> +
> +.. data:: has_texture_ffmpeg
> +
> +   True if the BGE has been built with FFmpeg support, enabling use of
> :class:`~bge.texture.ImageFFmpeg` and :class:`~bge.texture.VideoFFmpeg`.
> +
> +   :type: bool
> +
> +.. data:: has_joystick
> +
> +   True if the BGE has been built with joystick support.
> +
> +   :type: bool
> +
> +.. data:: has_physics
> +
> +   True if the BGE has been built with physics support.
> +
> +   :type: bool
> +
> diff --git a/doc/python_api/sphinx_doc_gen.py
> b/doc/python_api/sphinx_doc_gen.py
> index e5ce4c7..32776ef 100644
> --- a/doc/python_api/sphinx_doc_gen.py
> +++ b/doc/python_api/sphinx_doc_gen.py
> @@ -234,6 +234,7 @@ else:
>  EXCLUDE_MODULES = [
>  "aud",
>  "bge",
> +"bge.app"
>  "bge.constraints",
>  "bge.events",
>  "bge.logic",
> @@ -1669,6 +1670,7 @@ def write_rst_contents(basepath):
>  fw("   bge.texture.rst\n\n")
>  fw("   bge.events.rst\n\n")
>  fw("   bge.constraints.rst\n\n")
> +fw("   bge.app.rst\n\n")
>
>  # rna generated change log
>  fw(title_string("API Info", "=", double=True))
> @@ -1825,6 +1827,7 @@ def copy_handwritten_rsts(basepath):
>  "bge.texture",
>  "bge.events",
>  "bge.constraints",
> +"bge.app",
>  "bgl",  # "Blender OpenGl wrapper"
>  "gpu",  # "GPU Shader Module"
>
> diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp
> b/source/gameengine/Ketsji/KX_PythonInit.cpp
> index 80e56a4..a5fb2de 100644
> --- a/source/gameengine/Ketsji/KX_PythonInit.cpp
> +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
> @@ -138,6 +138,7 @@ extern "C" {
>  #include "BKE_global.h"
>  #include "BKE_library.h"
>  #include "BKE_appdir.h"
> +#include "BKE_blender.h"
>  #include "BLI_blenlib.h"
>  #include "GPU_material.h"
>  #include "MEM_guardedalloc.h"
> @@ -2027,6 +2028,11 @@ PyMODINIT_FUNC initBGE(void)
> /* skip "bge." */
>  #define SUBMOD (mod_full + 4)
>
> +   mod_full = "bge.app";
> +   PyModule_AddObject(mod, SUBMOD, (submodule =
> initApplicationPythonBinding()));
> +   PyDict_SetItemString(sys_modules, mod_full, submodule);
> +   Py_INCREF(submodule);
> +
> mod_full = "bge.constraints";
> PyModule_AddObject(mod, SUBMOD, (submodule =
> initConstraintPythonBinding()));
> PyDict_SetItemString(sys_modules, mod_full, submodule);
> @@ -2550,6 +2556,77 @@ PyMODINIT_FUNC initGameKeysPythonBinding()
> return m;
>  }
>
> +
> +
> +/*
> ---

[Bf-blender-cvs] [b2e5c01] master: BGE: correct ftell use in LoadGlobalDict

2015-06-04 Thread Jorge Bernal
Commit: b2e5c017a1a93ec9b6f001bae385c7cc9b756cca
Author: Jorge Bernal
Date:   Fri Jun 5 11:14:09 2015 +1000
Branches: master
https://developer.blender.org/rBb2e5c017a1a93ec9b6f001bae385c7cc9b756cca

BGE: correct ftell use in LoadGlobalDict

===

M   source/gameengine/Ketsji/KX_GameActuator.cpp
M   source/gameengine/Ketsji/KX_PythonInit.cpp

===

diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp 
b/source/gameengine/Ketsji/KX_GameActuator.cpp
index c6087ac..a23af68 100644
--- a/source/gameengine/Ketsji/KX_GameActuator.cpp
+++ b/source/gameengine/Ketsji/KX_GameActuator.cpp
@@ -178,6 +178,11 @@ bool KX_GameActuator::Update()
// obtain file size:
fseek (fp , 0 , SEEK_END);
marshal_length = ftell(fp);
+   if (marshal_length == -1) {
+   printf("warning: could not read 
position of '%s'\n", mashal_path);
+   fclose(fp);
+   break;
+   }
rewind(fp);

marshal_buffer = (char*) malloc 
(sizeof(char)*marshal_length);
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp 
b/source/gameengine/Ketsji/KX_PythonInit.cpp
index f7048f1..6fdc53f 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -356,7 +356,7 @@ static PyObject *gPyLoadGlobalDict(PyObject *)
 {
char marshal_path[512];
char *marshal_buffer = NULL;
-   size_t marshal_length;
+   int marshal_length;
FILE *fp = NULL;
int result;
 
@@ -367,7 +367,12 @@ static PyObject *gPyLoadGlobalDict(PyObject *)
if (fp) {
// obtain file size:
fseek (fp, 0, SEEK_END);
-   marshal_length = (size_t)ftell(fp);
+   marshal_length = ftell(fp);
+   if (marshal_length == -1) {
+   printf("Warning: could not read position of '%s'\n", 
marshal_path);
+   fclose(fp);
+   Py_RETURN_NONE;
+   }
rewind(fp);
 
marshal_buffer = (char*)malloc (sizeof(char)*marshal_length);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f3434e5] master: BGE Cleanup: remove dead code for collide, visible and twoside variables

2015-06-04 Thread Jorge Bernal
Commit: f3434e5f827c651be10fdc4be2a008ac790980ea
Author: Jorge Bernal
Date:   Fri Jun 5 02:24:23 2015 +0200
Branches: master
https://developer.blender.org/rBf3434e5f827c651be10fdc4be2a008ac790980ea

BGE Cleanup: remove dead code for collide, visible and twoside variables

As material is not NULL at this stage there is no need to do a NULL
check. Also to remove dead code

Reviewers: dfelinto, panzergame, hg1, moguri

Reviewed By: panzergame, hg1, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1330

===

M   source/gameengine/Converter/BL_BlenderDataConversion.cpp

===

diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp 
b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 3fc0215..3da0863 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -995,7 +995,6 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* 
blenderobj, KX_Scene* scene,
meshobj->m_sharedvertex_map.resize(totvert);
 
Material* ma = 0;
-   bool collider = true;
MT_Point2 uvs[4][RAS_TexVert::MAX_UNIT];
unsigned int rgb[4] = {0};
 
@@ -1071,23 +1070,13 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* 
blenderobj, KX_Scene* scene,
}
 
{
-   bool visible = true;
-   bool twoside = false;
 
RAS_MaterialBucket* bucket = material_from_mesh(ma, 
mface, tface, mcol, layers, lightlayer, rgb, uvs, tfaceName, scene, converter);
 
// set render flags
-   if (ma)
-   {
-   visible = ((ma->game.flag & 
GEMAT_INVISIBLE)==0);
-   twoside = ((ma->game.flag  & 
GEMAT_BACKCULL)==0);
-   collider = ((ma->game.flag & 
GEMAT_NOPHYSICS)==0);
-   }
-   else {
-   visible = true;
-   twoside = false;
-   collider = true;
-   }
+   bool visible = ((ma->game.flag & GEMAT_INVISIBLE)==0);
+   bool twoside = ((ma->game.flag  & GEMAT_BACKCULL)==0);
+   bool collider = ((ma->game.flag & GEMAT_NOPHYSICS)==0);
 
/* mark face as flat, so vertices are split */
bool flat = (mface->flag & ME_SMOOTH) == 0;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [28ef76d] master: BGE Cleanup: Removing flen variable where it is not used

2015-05-30 Thread Jorge Bernal
Commit: 28ef76d0f01788bd909fc5d854a494575d1c0017
Author: Jorge Bernal
Date:   Sat May 30 18:30:34 2015 +0200
Branches: master
https://developer.blender.org/rB28ef76d0f01788bd909fc5d854a494575d1c0017

BGE Cleanup: Removing flen variable where it is not used

===

M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index edc5b91..8ea2b4f 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -2203,8 +2203,6 @@ bool CcdShapeConstructionInfo::UpdateMesh(class 
KX_GameObject *gameobj, class RA
MFace *mf;
MVert *mv;
 
-   int flen;
-
if (CustomData_has_layer(&dm->faceData, CD_MTFACE)) {
MTFace *tface = (MTFace *)dm->getTessFaceDataArray(dm, 
CD_MTFACE);
MTFace *tf;
@@ -2214,6 +2212,8 @@ bool CcdShapeConstructionInfo::UpdateMesh(class 
KX_GameObject *gameobj, class RA
 
for (mf = mface, tf = tface, i = 0; i < numpolys; mf++, 
tf++, i++) {
if (tf->mode & TF_DYNAMIC) {
+   int flen;
+
if (mf->v4) {
tot_bt_tris += 2;
flen = 4;
@@ -2255,12 +2255,10 @@ bool CcdShapeConstructionInfo::UpdateMesh(class 
KX_GameObject *gameobj, class RA
fv_pt = quad_verts;
*poly_index_pt++ = origi;
*poly_index_pt++ = origi;
-   flen = 4;
}
else {
fv_pt = tri_verts;
*poly_index_pt++ = origi;
-   flen = 3;
}
 
for (; *fv_pt > -1; fv_pt++) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [71dcaa7] master: BGE Cleanup: Identical code for both if/else branches

2015-05-30 Thread Jorge Bernal
Commit: 71dcaa77446b5005d8b4d8f2afa94acfc3e21beb
Author: Jorge Bernal
Date:   Sat May 30 18:14:32 2015 +0200
Branches: master
https://developer.blender.org/rB71dcaa77446b5005d8b4d8f2afa94acfc3e21beb

BGE Cleanup: Identical code for both if/else branches

===

M   source/gameengine/GameLogic/SCA_PropertySensor.cpp

===

diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp 
b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
index 6f34f87..6841d2a 100644
--- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp
@@ -265,13 +265,8 @@ bool   SCA_PropertySensor::CheckPropertyCondition()
 
//the concept of Edge and Level triggering has unwanted effect for 
KX_PROPSENSOR_CHANGED
//see Game Engine bugtracker [ #3809 ]
-   if (m_checktype != KX_PROPSENSOR_CHANGED)
-   {
-   m_recentresult=result;
-   } else
-   {
-   m_recentresult=result;//true;
-   }
+   m_recentresult = result;
+
return result;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9755986] master: BGE: Fix memory leak when unable to add wheel

2015-05-29 Thread Jorge Bernal
Commit: 9755986637a52f81147b3f89802748aacdffa20d
Author: Jorge Bernal
Date:   Fri May 29 17:01:05 2015 +0200
Branches: master
https://developer.blender.org/rB9755986637a52f81147b3f89802748aacdffa20d

BGE: Fix memory leak when unable to add wheel

===

M   source/gameengine/Ketsji/KX_VehicleWrapper.cpp

===

diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp 
b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
index 237f485..b422007 100644
--- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
@@ -87,8 +87,6 @@ PyObject *KX_VehicleWrapper::PyAddWheel(PyObject *args)
 
if (gameOb->GetSGNode())
{
-   PHY_IMotionState* motionState = new 
KX_MotionState(gameOb->GetSGNode());
-   
MT_Vector3 attachPos,attachDir,attachAxle;
if(!PyVecTo(pylistPos,attachPos)) {
PyErr_SetString(PyExc_AttributeError,
@@ -115,6 +113,7 @@ PyObject *KX_VehicleWrapper::PyAddWheel(PyObject *args)
return NULL;
}
 
+   PHY_IMotionState *motionState = new 
KX_MotionState(gameOb->GetSGNode());

m_vehicle->AddWheel(motionState,attachPos,attachDir,attachAxle,suspensionRestLength,wheelRadius,hasSteering);
}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bdf242f] master: BGE Cleanup: Remove old commented Sumo physics code

2015-05-28 Thread Jorge Bernal
Commit: bdf242fa21fb479b4fe5e45b7522156ddd23feac
Author: Jorge Bernal
Date:   Thu May 28 17:50:39 2015 +0200
Branches: master
https://developer.blender.org/rBbdf242fa21fb479b4fe5e45b7522156ddd23feac

BGE Cleanup: Remove old commented Sumo physics code

===

M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index ed23a45..edc5b91 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -846,36 +846,6 @@ void   
CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionsta
m_cci.m_physicsEnv->AddCcdPhysicsController(this);
 
 
-/* SM_Object* dynaparent=0;
-   SumoPhysicsController* sumoparentctrl = (SumoPhysicsController* 
)parentctrl;
-   
-   if (sumoparentctrl)
-   {
-   dynaparent = sumoparentctrl->GetSumoObject();
-   }
-   
-   SM_Object* orgsumoobject = m_sumoObj;
-   
-   
-   m_sumoObj   =   new SM_Object(
-   orgsumoobject->getShapeHandle(), 
-   orgsumoobject->getMaterialProps(),
-   orgsumoobject->getShapeProps(),
-   dynaparent);
-   
-   m_sumoObj->setRigidBody(orgsumoobject->isRigidBody());
-   
-   m_sumoObj->setMargin(orgsumoobject->getMargin());
-   m_sumoObj->setPosition(orgsumoobject->getPosition());
-   m_sumoObj->setOrientation(orgsumoobject->getOrientation());
-   //if it is a dyna, register for a callback
-   m_sumoObj->registerCallback(*this);
-   
-   m_sumoScene->add(* (m_sumoObj));
-   */
-
-
-
 }
 
 void   CcdPhysicsController::SetPhysicsEnvironment(class 
PHY_IPhysicsEnvironment *env)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3b158d2] master: BGE Cleanup: The value of ikconstraint cannot be NULL at this stage and therefore it is not necessary the NULL check.

2015-05-28 Thread Jorge Bernal
Commit: 3b158d2e05b6541e1b8da9a3498d4ee91f5cbb3d
Author: Jorge Bernal
Date:   Thu May 28 17:18:05 2015 +0200
Branches: master
https://developer.blender.org/rB3b158d2e05b6541e1b8da9a3498d4ee91f5cbb3d

BGE Cleanup: The value of ikconstraint cannot be NULL at this stage and
therefore it is not necessary the NULL check.

===

M   source/gameengine/Converter/BL_ArmatureConstraint.cpp

===

diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp 
b/source/gameengine/Converter/BL_ArmatureConstraint.cpp
index e515574..88d82e2 100644
--- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp
+++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp
@@ -334,7 +334,7 @@ PyObject *BL_ArmatureConstraint::py_attr_getattr(void 
*self_v, const struct KX_P
}
switch (attr_order) {
case BCA_IKWEIGHT:
-   return 
PyFloat_FromDouble((ikconstraint)?ikconstraint->weight : 0.0f);
+   return PyFloat_FromDouble(ikconstraint->weight);
case BCA_IKTYPE:
return PyLong_FromLong(ikconstraint->type);
case BCA_IKFLAG:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cd9dc31] master: BGE: grey out Alpha and Specular sliders when Transparency panel is unchecked

2015-05-22 Thread Jorge Bernal
Commit: cd9dc3143c16878dbb8b2fe7bba2163c6982db4e
Author: Jorge Bernal
Date:   Fri May 22 16:03:38 2015 +0200
Branches: master
https://developer.blender.org/rBcd9dc3143c16878dbb8b2fe7bba2163c6982db4e

BGE: grey out Alpha and Specular sliders when Transparency panel is
unchecked

===

M   release/scripts/startup/bl_ui/properties_material.py

===

diff --git a/release/scripts/startup/bl_ui/properties_material.py 
b/release/scripts/startup/bl_ui/properties_material.py
index a990a16..d916007 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -878,9 +878,10 @@ class MATERIAL_PT_transp_game(MaterialButtonsPanel, Panel):
 base_mat = context.material
 mat = active_node_mat(base_mat)
 
+layout.active = mat.use_transparency
+
 if simple_material(base_mat):
 row = layout.row()
-row.active = mat.use_transparency
 row.prop(mat, "transparency_method", expand=True)
 
 layout.prop(mat, "alpha")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [dc95ca9] master: BGE: Fix T43822 Videotexture does not use sky color for off-screen rendering

2015-05-09 Thread Jorge Bernal
Commit: dc95ca92ca224d26423c5d63b33e7714a6a8c9ce
Author: Jorge Bernal
Date:   Sun May 10 00:54:06 2015 +0200
Branches: master
https://developer.blender.org/rBdc95ca92ca224d26423c5d63b33e7714a6a8c9ce

BGE: Fix T43822 Videotexture does not use sky color for off-screen
rendering

Make scene background color as default for render-to-texture instead of
current blue color (0, 0, 255).

It is very useful for mirrors setups.

Reviewers: moguri, ben2610, sybren, panzergame, hg1

Reviewed By: panzergame, hg1, moguri

Subscribers: mpan3

Differential Revision: https://developer.blender.org/D1287

===

M   source/gameengine/Ketsji/KX_WorldInfo.cpp
M   source/gameengine/Ketsji/KX_WorldInfo.h
M   source/gameengine/VideoTexture/ImageRender.cpp
M   source/gameengine/VideoTexture/ImageRender.h

===

diff --git a/source/gameengine/Ketsji/KX_WorldInfo.cpp 
b/source/gameengine/Ketsji/KX_WorldInfo.cpp
index e4bf439..21e7250 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.cpp
+++ b/source/gameengine/Ketsji/KX_WorldInfo.cpp
@@ -100,6 +100,11 @@ void KX_WorldInfo::setBackColor(float r, float g, float b)
}
 }
 
+const float *KX_WorldInfo::getBackColor(void) const
+{
+   return m_backgroundcolor;
+}
+
 void KX_WorldInfo::setMistType(short type)
 {
m_misttype = type;
diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h 
b/source/gameengine/Ketsji/KX_WorldInfo.h
index 64304e5..0e8fe3c 100644
--- a/source/gameengine/Ketsji/KX_WorldInfo.h
+++ b/source/gameengine/Ketsji/KX_WorldInfo.h
@@ -88,6 +88,7 @@ public:
void setMistIntensity(float intensity);
void setMistColor(float r, float g, float b);
void setBackColor(float r, float g, float b);
+   const float *getBackColor() const;
void setAmbientColor(float r, float g, float b);
void UpdateBackGround();
void UpdateWorldSettings();
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp 
b/source/gameengine/VideoTexture/ImageRender.cpp
index 6a898ff..2b2a6e0 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -75,8 +75,8 @@ ImageRender::ImageRender (KX_Scene *scene, KX_Camera * 
camera) :
 m_mirrorHalfWidth(0.f),
 m_mirrorHalfHeight(0.f)
 {
-   // initialize background color
-   setBackground(0, 0, 255, 255);
+   // initialize background color to scene background color as default
+   setBackgroundFromScene(m_scene);
// retrieve rendering objects
m_engine = KX_GetActiveEngine();
m_rasterizer = m_engine->GetRasterizer();
@@ -100,6 +100,18 @@ void ImageRender::setBackground (int red, int green, int 
blue, int alpha)
m_background[3] = (alpha < 0) ? 0.f : (alpha > 255) ? 1.f : 
float(alpha)/255.f;
 }
 
+// set background color from scene
+void ImageRender::setBackgroundFromScene (KX_Scene *scene)
+{
+   if (scene) {
+   const float *background_color = 
scene->GetWorldInfo()->getBackColor();
+   setBackground((int) (background_color[0] * 255.0f), (int) 
(background_color[1] * 255.0f), (int) (background_color[2] * 255.0f), 255);
+   }
+   else {
+   setBackground(0, 0, 255, 255);
+   }
+}
+
 
 // capture image from viewport
 void ImageRender::calcImage (unsigned int texId, double ts)
@@ -733,7 +745,8 @@ ImageRender::ImageRender (KX_Scene *scene, KX_GameObject 
*observer, KX_GameObjec
m_mirrorX = m_mirrorY.cross(m_mirrorZ);
m_render = true;
 
-   setBackground(0, 0, 255, 255);
+   // set mirror background color to scene background color as default
+   setBackgroundFromScene(m_scene);
 }
 
 
diff --git a/source/gameengine/VideoTexture/ImageRender.h 
b/source/gameengine/VideoTexture/ImageRender.h
index 98dceea..bdf442c 100644
--- a/source/gameengine/VideoTexture/ImageRender.h
+++ b/source/gameengine/VideoTexture/ImageRender.h
@@ -100,7 +100,7 @@ protected:
void Render();
void SetupRenderFrame(KX_Scene *scene, KX_Camera* cam);
void RenderFrame(KX_Scene* scene, KX_Camera* cam);
-   void SetBackGround(KX_WorldInfo* wi);
+   void setBackgroundFromScene(KX_Scene *scene);
void SetWorldSettings(KX_WorldInfo* wi);
 };

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4cd3754] master: BGE: Fix for T44374 Crash when collision sensor deactivated

2015-04-16 Thread Jorge Bernal
Commit: 4cd37541b0e44315716d898cd84ee99d89634964
Author: Jorge Bernal
Date:   Fri Apr 17 02:02:30 2015 +0200
Branches: master
https://developer.blender.org/rB4cd37541b0e44315716d898cd84ee99d89634964

BGE: Fix for T44374 Crash when collision sensor deactivated

Don't allocate memory for sensor logic brick if it is deactivated

===

M   source/gameengine/Converter/KX_ConvertSensors.cpp

===

diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp 
b/source/gameengine/Converter/KX_ConvertSensors.cpp
index b781e4d..854ae5b 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -119,542 +119,542 @@ void BL_ConvertSensors(struct Object* blenderobject,
sens = (bSensor*)blenderobject->sensors.first;
 
while (sens) {
-   SCA_ISensor* gamesensor=NULL;
-   /* All sensors have a pulse toggle, skipped ticks parameter, 
and invert field. */
-   /* These are extracted here, and set when the sensor is added 
to the */
-   /* list.
 */
-   pos_pulsemode = (sens->pulse & SENS_PULSE_REPEAT)!=0;
-   neg_pulsemode = (sens->pulse & SENS_NEG_PULSE_MODE)!=0;
-   
-   skipped_ticks = sens->freq;
-   invert= !(sens->invert == 0);
-   level = !(sens->level == 0);
-   tap   = !(sens->tap == 0);
-
-   switch (sens->type)
-   {
-   case  SENS_ALWAYS:
-   {
-   
-   SCA_EventManager* eventmgr = 
logicmgr->FindEventManager(SCA_EventManager::BASIC_EVENTMGR);
-   if (eventmgr)
-   {
-   gamesensor = new 
SCA_AlwaysSensor(eventmgr, gameobj);
-   }
-   
-   break;
-   }
-   
-   case  SENS_DELAY:
+   if (!(sens->flag & SENS_DEACTIVATE)) {
+   SCA_ISensor* gamesensor=NULL;
+   /* All sensors have a pulse toggle, skipped ticks 
parameter, and invert field. */
+   /* These are extracted here, and set when the sensor is 
added to the */
+   /* list.
 */
+   pos_pulsemode = (sens->pulse & SENS_PULSE_REPEAT)!=0;
+   neg_pulsemode = (sens->pulse & SENS_NEG_PULSE_MODE)!=0;
+
+   skipped_ticks = sens->freq;
+   invert= !(sens->invert == 0);
+   level = !(sens->level == 0);
+   tap   = !(sens->tap == 0);
+
+   switch (sens->type)
{
-   // we can reuse the Always event manager for 
the delay sensor
-   SCA_EventManager* eventmgr = 
logicmgr->FindEventManager(SCA_EventManager::BASIC_EVENTMGR);
-   if (eventmgr)
+   case  SENS_ALWAYS:
{
-   bDelaySensor* delaysensor = 
(bDelaySensor*)sens->data;
-   gamesensor = new 
SCA_DelaySensor(eventmgr, 
-   gameobj,
-   delaysensor->delay,
-   delaysensor->duration,
-   (delaysensor->flag & 
SENS_DELAY_REPEAT) != 0);
+
+   SCA_EventManager* eventmgr = 
logicmgr->FindEventManager(SCA_EventManager::BASIC_EVENTMGR);
+   if (eventmgr)
+   {
+   gamesensor = new 
SCA_AlwaysSensor(eventmgr, gameobj);
+   }
+
+   break;
}
-   break;
-   }
 
-   case SENS_COLLISION:
-   {
-   SCA_EventManager* eventmgr = 
logicmgr->FindEventManager(SCA_EventManager::TOUCH_EVENTMGR);
-   if (eventmgr)
+   case  SENS_DELAY:
{
-   // collision sensor can sense both 
materials and properties. 
-  

[Bf-blender-cvs] [8c98b16] master: BGE: Fix for T42341 Sensor.frequency is badly named

2015-04-15 Thread Jorge Bernal
Commit: 8c98b1649d1cee38faff338414d35c87ee0f8c2a
Author: Jorge Bernal
Date:   Thu Apr 16 06:31:25 2015 +0200
Branches: master
https://developer.blender.org/rB8c98b1649d1cee38faff338414d35c87ee0f8c2a

BGE: Fix for T42341 Sensor.frequency is badly named

"Frequency" parameter is renamed to "Skip" in the LogicBricks sensors as it 
represents skipped frames between pulses.

Naming something (frequency) the exact opposite of what it represents (period) 
was the worst choice.

Also, a new BGE python attribute 'skippedTicks' was introduced. 'frequency' 
attribute is maintained but deprecated.

Internally, freq variable is used yet at DNA_Sensor to maintain compability and 
to avoid do_versions.

Thanks to Sybren for the investigation.

{F162440}

Reviewers: campbellbarton, sybren, moguri, hg1

Reviewed By: sybren, hg1

Differential Revision: https://developer.blender.org/D1229

===

M   doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst
M   source/blender/editors/space_logic/logic_window.c
M   source/blender/makesdna/DNA_sensor_types.h
M   source/blender/makesrna/intern/rna_sensor.c
M   source/gameengine/Converter/KX_ConvertSensors.cpp
M   source/gameengine/GameLogic/SCA_ISensor.cpp
M   source/gameengine/GameLogic/SCA_ISensor.h
M   source/gameengine/GameLogic/SCA_RandomSensor.cpp

===

diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst 
b/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst
index 9efd2e2..af444fb 100644
--- a/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst
+++ b/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst
@@ -23,8 +23,14 @@ base class --- :class:`SCA_ILogicBrick`
 
.. attribute:: frequency
 
-  The frequency for pulse mode sensors.
-  
+  The frequency for pulse mode sensors. (Deprecated: use 
SCA_ISensor.skippedTicks)
+
+  :type: integer
+
+   .. attribute:: skippedTicks
+
+  Number of logic ticks skipped between 2 active pulses
+
   :type: integer
 
.. attribute:: level
diff --git a/source/blender/editors/space_logic/logic_window.c 
b/source/blender/editors/space_logic/logic_window.c
index 7204144..d4fa911 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -903,7 +903,7 @@ static void draw_sensor_internal_header(uiLayout *layout, 
PointerRNA *ptr)
sub = uiLayoutRow(row, false);
uiLayoutSetActive(sub, (RNA_boolean_get(ptr, "use_pulse_true_level") ||
RNA_boolean_get(ptr, "use_pulse_false_level")));
-   uiItemR(sub, ptr, "frequency", 0, IFACE_("Freq"), ICON_NONE);
+   uiItemR(sub, ptr, "skipped_ticks", 0, IFACE_("Skip"), ICON_NONE);

row = uiLayoutRow(split, true);
uiItemR(row, ptr, "use_level", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
diff --git a/source/blender/makesdna/DNA_sensor_types.h 
b/source/blender/makesdna/DNA_sensor_types.h
index 8d59a13..d886dcf 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -164,7 +164,7 @@ typedef struct bSensor {
struct bSensor *next, *prev;
/* pulse and freq are the bool toggle and frame count for pulse mode */
short type, otype, flag, pulse;
-   short freq, totlinks, pad1, pad2;
+   short freq, totlinks, pad1, pad2; /* freq makes reference to skipped 
ticks between 2 active pulses */
char name[64];  /* MAX_NAME */
void *data;

diff --git a/source/blender/makesrna/intern/rna_sensor.c 
b/source/blender/makesrna/intern/rna_sensor.c
index 69dd092..3cc9403 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -325,9 +325,11 @@ static void rna_def_sensor(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE 
level triggering (pulse mode)");
RNA_def_property_update(prop, NC_LOGIC, NULL);

-   prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE);
+   prop = RNA_def_property(srna, "skipped_ticks", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "freq");
-   RNA_def_property_ui_text(prop, "Frequency", "Delay between repeated 
pulses(in logic tics, 0=no delay)");
+   RNA_def_property_ui_text(prop, "Skip",
+"Number of logic ticks skipped between 2 
active pulses "
+"(0 = pulse every logic tick, 1 = skip 1 logic 
tick between pulses, etc.)");
RNA_def_property_range(prop, 0, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
 
diff --git a/so

[Bf-blender-cvs] [33bf1e0] blender-v2.74-release: Revert part of D1074 related to acceleration taked into account. It has been reverted because it was affecting obstacle avoidance (T44041).

2015-03-24 Thread Jorge Bernal
Commit: 33bf1e0e184a52ecd9d9989bb474f7d5534e789b
Author: Jorge Bernal
Date:   Sat Mar 21 17:53:18 2015 +0100
Branches: blender-v2.74-release
https://developer.blender.org/rB33bf1e0e184a52ecd9d9989bb474f7d5534e789b

Revert part of D1074 related to acceleration taked into account.
It has been reverted because it was affecting obstacle avoidance
(T44041).

This fix should be backported to 2.74

===

M   source/blender/blenloader/intern/versioning_270.c
M   source/gameengine/Ketsji/KX_SteeringActuator.cpp

===

diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index ab5c8ac..735ed19 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -616,18 +616,6 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
}
}
}
-
-   if (!DNA_struct_elem_find(fd->filesdna, "bSteeringActuator", 
"float", "acceleration")) {
-   for (ob = main->object.first; ob; ob = ob->id.next) {
-   bActuator *act;
-   for (act = ob->actuators.first; act; act = 
act->next) {
-   if (act->type == ACT_STEERING) {
-   bSteeringActuator *sact = 
act->data;
-   sact->acceleration = 1000.f;
-   }
-   }
-   }
-   }
}
 
if (!MAIN_VERSION_ATLEAST(main, 273, 9)) {
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp 
b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index f859b1c..83597f9 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -263,12 +263,12 @@ bool KX_SteeringActuator::Update(double curtime, bool 
frame)
 
if (apply_steerforce)
{
-   MT_Vector3 newvel;
bool isdyna = obj->IsDynamic();
if (isdyna)
m_steerVec.z() = 0;
if (!m_steerVec.fuzzyZero())
m_steerVec.normalize();
+   MT_Vector3 newvel = m_velocity * m_steerVec;
 
//adjust velocity to avoid obstacles
if (m_simulation && m_obstacle /*&& 
!newvel.fuzzyZero()*/)
@@ -281,16 +281,13 @@ bool KX_SteeringActuator::Update(double curtime, bool 
frame)
KX_RasterizerDrawDebugLine(mypos, mypos 
+ newvel, MT_Vector3(0.0, 1.0, 0.0));
}
 
-   HandleActorFace(m_steerVec);
+   HandleActorFace(newvel);
if (isdyna)
{
-   //TODO: Take into account angular velocity on 
turns
+   //temporary solution: set 2D steering velocity 
directly to obj
+   //correct way is to apply physical force
MT_Vector3 curvel = obj->GetLinearVelocity();
 
-   newvel = (curvel.length() * m_steerVec) + 
(m_acceleration * delta) * m_steerVec;
-   if (newvel.length2() >= (m_velocity * 
m_velocity))
-   newvel = m_velocity * m_steerVec;
-
if (m_lockzvel)
newvel.z() = 0.0f;
else

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ddf5800] master: BGE: LoD Hysteresis clean up

2015-03-23 Thread Jorge Bernal
Commit: ddf58004c4a4ad7fc59f9cd1c3f6f0a800424ee3
Author: Jorge Bernal
Date:   Mon Mar 23 18:57:19 2015 +0100
Branches: master
https://developer.blender.org/rBddf58004c4a4ad7fc59f9cd1c3f6f0a800424ee3

BGE: LoD Hysteresis clean up

Move scene hysteresis value to KX_Scene where it should be (instead of
KX_GameObject)

===

M   source/gameengine/Converter/BL_BlenderDataConversion.cpp
M   source/gameengine/Ketsji/KX_GameObject.cpp
M   source/gameengine/Ketsji/KX_GameObject.h
M   source/gameengine/Ketsji/KX_Scene.cpp
M   source/gameengine/Ketsji/KX_Scene.h

===

diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp 
b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 7b5cc45..6e3a321 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1556,7 +1556,7 @@ static KX_GameObject *gameobject_from_blenderobject(
}
if (blenderscene->gm.lodflag & SCE_LOD_USE_HYST) {
kxscene->SetLodHysteresis(true);
-   
gameobj->SetLodHysteresisValue(blenderscene->gm.scehysteresis);
+   
kxscene->SetLodHysteresisValue(blenderscene->gm.scehysteresis);
}
}

diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp 
b/source/gameengine/Ketsji/KX_GameObject.cpp
index 16dfe5b..d0c6792 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -93,7 +93,6 @@ KX_GameObject::KX_GameObject(
   m_layer(0),
   m_currentLodLevel(0),
   m_previousLodLevel(0),
-  m_lodHysteresis(0),
   m_pBlenderObject(NULL),
   m_pBlenderGroupObject(NULL),
   m_bSuspendDynamics(false),
@@ -786,11 +785,6 @@ void KX_GameObject::AddLodMesh(RAS_MeshObject* mesh)
m_lodmeshes.push_back(mesh);
 }
 
-void KX_GameObject::SetLodHysteresisValue(int hysteresis)
-{
-   m_lodHysteresis = hysteresis;
-}
-
 void KX_GameObject::UpdateLod(MT_Vector3 &cam_pos)
 {
// Handle dupligroups
@@ -811,20 +805,20 @@ void KX_GameObject::UpdateLod(MT_Vector3 &cam_pos)
int level = 0;
Object *bob = this->GetBlenderObject();
LodLevel *lod = (LodLevel*) bob->lodlevels.first;
-   KX_Scene *sce = this->GetScene();
+   KX_Scene *kxscene = this->GetScene();
 
for (; lod; lod = lod->next, level++) {
if (!lod->source || lod->source->type != OB_MESH) level--;
if (!lod->next) break;
if (level == (this->m_previousLodLevel) || (level == 
(this->m_previousLodLevel + 1))) {
short hysteresis = 0;
-   if (sce->IsActivedLodHysteresis()) {
+   if (kxscene->IsActivedLodHysteresis()) {
// if exists, LoD level hysteresis will 
override scene hysteresis
if (lod->next->flags & OB_LOD_USE_HYST) {
hysteresis = lod->next->obhysteresis;
}
-   else if (this->m_lodHysteresis != 0) {
-   hysteresis = m_lodHysteresis;
+   else {
+   hysteresis = 
kxscene->GetLodHysteresisValue();
}
}
float hystvariance = MT_abs(lod->next->distance - 
lod->distance) * hysteresis / 100;
@@ -833,13 +827,13 @@ void KX_GameObject::UpdateLod(MT_Vector3 &cam_pos)
}
else if (level == (this->m_previousLodLevel - 1)) {
short hysteresis = 0;
-   if (sce->IsActivedLodHysteresis()) {
+   if (kxscene->IsActivedLodHysteresis()) {
// if exists, LoD level hysteresis will 
override scene hysteresis
if (lod->next->flags & OB_LOD_USE_HYST) {
hysteresis = lod->next->obhysteresis;
}
-   else if (this->m_lodHysteresis != 0) {
-   hysteresis = m_lodHysteresis;
+   else {
+   hysteresis = 
kxscene->GetLodHysteresisValue();
}
}
float hystvariance = MT_abs(lod->next->distance - 
lod->distance) * hysteresis / 100;
diff --git a/source/gameengine/Ketsji/KX_GameObject.h 
b/sour

[Bf-blender-cvs] [e7d0510] master: BGE: New hysteresis offset to improve LOD level transitions

2015-03-22 Thread Jorge Bernal
Commit: e7d051043dc82c2991eb491e0630d9b1065934c3
Author: Jorge Bernal
Date:   Sun Mar 22 18:13:53 2015 +0100
Branches: master
https://developer.blender.org/rBe7d051043dc82c2991eb491e0630d9b1065934c3

BGE: New hysteresis offset to improve  LOD level transitions

This change introduces a new hysteresis parameter that it will be added
or subtracted to/from the LOD distance to avoid popping when a LOD
object moves close to the LOD transition continuously.

Then, we have the following:

- a new LOD Hysteresis setting per scene (default 10%) which is located
in Scene context --> Level of Detail panel. This scene parameter also
will active/deactive the scene hysteresis.
- and a new LOD Hysteresis setting per object (default 10%) which is
located in Object context --> Levels of Detail panel. The LOD hysteresis
setting per object (if active) will overwrite the hysteresis setting per
scene value.

For the new blends: the hysteresis setting per scene would be active by
default and the per object would be inactive by default.
For the old blends: both hysteresis settings (per scene and per object)
would be inactive by default. A quick way to take advantage of this
feature for old blends would be to activate the hysteresis parameter in
the scene context -> Level of Detail panel

Reviewers: campbellbarton, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: nonamejuju, lordodin

Differential Revision: https://developer.blender.org/D957

===

M   release/scripts/startup/bl_ui/properties_game.py
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenloader/intern/versioning_270.c
M   source/blender/blenloader/intern/versioning_defaults.c
M   source/blender/makesdna/DNA_object_types.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_object.c
M   source/blender/makesrna/intern/rna_scene.c
M   source/gameengine/Converter/BL_BlenderDataConversion.cpp
M   source/gameengine/Ketsji/KX_GameObject.cpp
M   source/gameengine/Ketsji/KX_GameObject.h
M   source/gameengine/Ketsji/KX_Scene.cpp
M   source/gameengine/Ketsji/KX_Scene.h

===

diff --git a/release/scripts/startup/bl_ui/properties_game.py 
b/release/scripts/startup/bl_ui/properties_game.py
index 32a8e73..8ef9a08 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -523,7 +523,27 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
 row.prop(rd, "sample_max_error")
 
 
-class WorldButtonsPanel:
+class SCENE_PT_game_hysteresis(SceneButtonsPanel, Panel):
+bl_label = "Level of Detail"
+COMPAT_ENGINES = {'BLENDER_GAME'}
+
+@classmethod
+def poll(cls, context):
+scene = context.scene
+return (scene and scene.render.engine in cls.COMPAT_ENGINES)
+
+def draw(self, context):
+layout = self.layout
+gs = context.scene.game_settings
+
+row = layout.row()
+row.prop(gs, "use_scene_hysteresis", text="Hysteresis")
+row = layout.row()
+row.active = gs.use_scene_hysteresis
+row.prop(gs, "scene_hysteresis_percentage", text="")
+
+
+class WorldButtonsPanel():
 bl_space_type = 'PROPERTIES'
 bl_region_type = 'WINDOW'
 bl_context = "world"
@@ -765,6 +785,7 @@ class OBJECT_PT_levels_of_detail(ObjectButtonsPanel, Panel):
 def draw(self, context):
 layout = self.layout
 ob = context.object
+gs = context.scene.game_settings
 
 col = layout.column()
 
@@ -782,6 +803,13 @@ class OBJECT_PT_levels_of_detail(ObjectButtonsPanel, 
Panel):
 row.prop(level, "use_mesh", text="")
 row.prop(level, "use_material", text="")
 
+row = box.row()
+row.active = gs.use_scene_hysteresis
+row.prop(level, "use_object_hysteresis", text="Hysteresis 
Override")
+row = box.row()
+row.active = gs.use_scene_hysteresis and 
level.use_object_hysteresis
+row.prop(level, "object_hysteresis_percentage", text="")
+
 row = col.row(align=True)
 row.operator("object.lod_add", text="Add", icon='ZOOMIN')
 row.menu("OBJECT_MT_lod_tools", text="", icon='TRIA_DOWN')
diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index 08a74d0..174fb38 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1098,10 +1098,12 @@ void BKE_object_lod_add(Object *ob)
BLI_addtail(&ob

[Bf-blender-cvs] [2744ce7] master: Revert part of D1074 related to acceleration taked into account. It has been reverted because it was affecting obstacle avoidance (T44041).

2015-03-21 Thread Jorge Bernal
Commit: 2744ce77dea394026bc524e68c687050bc8e0c28
Author: Jorge Bernal
Date:   Sat Mar 21 17:53:18 2015 +0100
Branches: master
https://developer.blender.org/rB2744ce77dea394026bc524e68c687050bc8e0c28

Revert part of D1074 related to acceleration taked into account.
It has been reverted because it was affecting obstacle avoidance
(T44041).

This fix should be backported to 2.74

===

M   source/blender/blenloader/intern/versioning_270.c
M   source/gameengine/Ketsji/KX_SteeringActuator.cpp

===

diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index ee015fa..adf5f93 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -616,18 +616,6 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
}
}
}
-
-   if (!DNA_struct_elem_find(fd->filesdna, "bSteeringActuator", 
"float", "acceleration")) {
-   for (ob = main->object.first; ob; ob = ob->id.next) {
-   bActuator *act;
-   for (act = ob->actuators.first; act; act = 
act->next) {
-   if (act->type == ACT_STEERING) {
-   bSteeringActuator *sact = 
act->data;
-   sact->acceleration = 1000.f;
-   }
-   }
-   }
-   }
}
 
if (!MAIN_VERSION_ATLEAST(main, 273, 9)) {
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp 
b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index f859b1c..83597f9 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -263,12 +263,12 @@ bool KX_SteeringActuator::Update(double curtime, bool 
frame)
 
if (apply_steerforce)
{
-   MT_Vector3 newvel;
bool isdyna = obj->IsDynamic();
if (isdyna)
m_steerVec.z() = 0;
if (!m_steerVec.fuzzyZero())
m_steerVec.normalize();
+   MT_Vector3 newvel = m_velocity * m_steerVec;
 
//adjust velocity to avoid obstacles
if (m_simulation && m_obstacle /*&& 
!newvel.fuzzyZero()*/)
@@ -281,16 +281,13 @@ bool KX_SteeringActuator::Update(double curtime, bool 
frame)
KX_RasterizerDrawDebugLine(mypos, mypos 
+ newvel, MT_Vector3(0.0, 1.0, 0.0));
}
 
-   HandleActorFace(m_steerVec);
+   HandleActorFace(newvel);
if (isdyna)
{
-   //TODO: Take into account angular velocity on 
turns
+   //temporary solution: set 2D steering velocity 
directly to obj
+   //correct way is to apply physical force
MT_Vector3 curvel = obj->GetLinearVelocity();
 
-   newvel = (curvel.length() * m_steerVec) + 
(m_acceleration * delta) * m_steerVec;
-   if (newvel.length2() >= (m_velocity * 
m_velocity))
-   newvel = m_velocity * m_steerVec;
-
if (m_lockzvel)
newvel.z() = 0.0f;
else

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [931f876] blender-v2.74-release: BGE: Fix for T43994 Steering actuator bug with Navmesh

2015-03-17 Thread Jorge Bernal
Commit: 931f876dddb6b284f3993567b05478e86df64b26
Author: Jorge Bernal
Date:   Sun Mar 15 11:38:04 2015 +0100
Branches: blender-v2.74-release
https://developer.blender.org/rB931f876dddb6b284f3993567b05478e86df64b26

BGE: Fix for T43994 Steering actuator bug with Navmesh

Now the facing option is taken into account as before

This is a regression and to be ported to the final release branch.

===

M   source/gameengine/Ketsji/KX_SteeringActuator.cpp

===

diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp 
b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index 10d4273..f859b1c 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -281,7 +281,7 @@ bool KX_SteeringActuator::Update(double curtime, bool frame)
KX_RasterizerDrawDebugLine(mypos, mypos 
+ newvel, MT_Vector3(0.0, 1.0, 0.0));
}
 
-   HandleActorFace(newvel);
+   HandleActorFace(m_steerVec);
if (isdyna)
{
//TODO: Take into account angular velocity on 
turns

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [dd3ade2] master: BGE: Fix for T43994 Steering actuator bug with Navmesh

2015-03-15 Thread Jorge Bernal
Commit: dd3ade250ded8c8bb86f68748b19cf5d4ab1b82a
Author: Jorge Bernal
Date:   Sun Mar 15 11:38:04 2015 +0100
Branches: master
https://developer.blender.org/rBdd3ade250ded8c8bb86f68748b19cf5d4ab1b82a

BGE: Fix for T43994 Steering actuator bug with Navmesh

Now the facing option is taken into account as before

This is a regression and to be ported to the final release branch.

===

M   source/gameengine/Ketsji/KX_SteeringActuator.cpp

===

diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp 
b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index 10d4273..f859b1c 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -281,7 +281,7 @@ bool KX_SteeringActuator::Update(double curtime, bool frame)
KX_RasterizerDrawDebugLine(mypos, mypos 
+ newvel, MT_Vector3(0.0, 1.0, 0.0));
}
 
-   HandleActorFace(newvel);
+   HandleActorFace(m_steerVec);
if (isdyna)
{
//TODO: Take into account angular velocity on 
turns

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6e17420] master: BGE: Fix for T43788 Light casts shadow when use_shadow unchecked

2015-03-13 Thread Jorge Bernal
Commit: 6e174205488b28381fdb5e8dbcff2a0a61b5ea6c
Author: Jorge Bernal
Date:   Fri Mar 13 23:46:07 2015 +0100
Branches: master
https://developer.blender.org/rB6e174205488b28381fdb5e8dbcff2a0a61b5ea6c

BGE: Fix for T43788 Light casts shadow when use_shadow unchecked

Makes use_shadow usage consistent across supported lamp types (Spot and
Sun)

Differential D1148

Reviewers: Moguri, Brecht

===

M   source/blender/makesrna/intern/rna_lamp.c

===

diff --git a/source/blender/makesrna/intern/rna_lamp.c 
b/source/blender/makesrna/intern/rna_lamp.c
index 81c26af..d4084bd 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -94,7 +94,7 @@ static int rna_use_shadow_get(PointerRNA *ptr)
Lamp *la = (Lamp *)ptr->data;
 
if (la->type == LA_SPOT) {
-   return (la->mode & LA_SHAD_BUF) != 0;
+   return (la->mode & (LA_SHAD_BUF|LA_SHAD_RAY)) != 0;
}
else {
return (la->mode & LA_SHAD_RAY) != 0;
@@ -104,14 +104,10 @@ static int rna_use_shadow_get(PointerRNA *ptr)
 static void rna_use_shadow_set(PointerRNA *ptr, int value)
 {
Lamp *la = (Lamp *)ptr->data;
+   la->mode &= ~(LA_SHAD_BUF | LA_SHAD_RAY);
if (value) {
-   if (la->type == LA_SPOT)
-   la->mode |= LA_SHAD_BUF;
-   else
-   la->mode |= LA_SHAD_RAY;
+   la->mode |= LA_SHAD_RAY;
}
-   else
-   la->mode &= ~(LA_SHAD_BUF | LA_SHAD_RAY);
 }
 
 static StructRNA *rna_Lamp_refine(struct PointerRNA *ptr)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [73ad769] master: BGE: Fix for T43980 MouseLook (actuator) triggers MouseMovement (sensor) on other objects permanently

2015-03-12 Thread Jorge Bernal
Commit: 73ad76970ef8daf5933f7f5b6e8bc21341b7e358
Author: Jorge Bernal
Date:   Fri Mar 13 00:48:28 2015 +0100
Branches: master
https://developer.blender.org/rB73ad76970ef8daf5933f7f5b6e8bc21341b7e358

BGE: Fix for T43980 MouseLook (actuator) triggers MouseMovement (sensor)
on other objects permanently

only trigger mouse event when it is necessary, this way we avoid
conflicts with other mouse sensors.

===

M   source/gameengine/Ketsji/KX_MouseActuator.cpp

===

diff --git a/source/gameengine/Ketsji/KX_MouseActuator.cpp 
b/source/gameengine/Ketsji/KX_MouseActuator.cpp
index 62417b4df..c372e6e 100644
--- a/source/gameengine/Ketsji/KX_MouseActuator.cpp
+++ b/source/gameengine/Ketsji/KX_MouseActuator.cpp
@@ -278,7 +278,10 @@ bool KX_MouseActuator::Update()
setposition[1] = center_y;
}
 
-   setMousePosition(setposition[0], 
setposition[1]);
+   // only trigger mouse event when it is necessary
+   if (m_oldposition[0] != position[0] || 
m_oldposition[1] != position[1]) {
+   setMousePosition(setposition[0], 
setposition[1]);
+   }
 
m_oldposition[0] = position[0];
m_oldposition[1] = position[1];

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [90f36d4] master: BGE: Fix for T43793 Increment frame_start/end value to 255 frames

2015-03-12 Thread Jorge Bernal
Commit: 90f36d4ec8a9b6f43310f989e7975a74124fc806
Author: Jorge Bernal
Date:   Thu Mar 12 22:07:35 2015 +0100
Branches: master
https://developer.blender.org/rB90f36d4ec8a9b6f43310f989e7975a74124fc806

BGE: Fix for T43793 Increment frame_start/end value to 255 frames

Currently, for animated textures we were allowing 16x16 tiles but we can 
reproduce 128 frames only.

Reviewers: moguri, sergey, campbellbarton

Reviewed By: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1164

===

M   source/blender/makesrna/intern/rna_image.c

===

diff --git a/source/blender/makesrna/intern/rna_image.c 
b/source/blender/makesrna/intern/rna_image.c
index 5ab6d1a..cf2973c 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -709,13 +709,13 @@ static void rna_def_image(BlenderRNA *brna)
 
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twsta");
-   RNA_def_property_range(prop, 0, 128);
+   RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an 
animated texture");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, 
"rna_Image_animated_update");
 
prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "twend");
-   RNA_def_property_range(prop, 0, 128);
+   RNA_def_property_range(prop, 0, 255);
RNA_def_property_ui_text(prop, "Animation End", "End frame of an 
animated texture");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, 
"rna_Image_animated_update");

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b4fccce] master: BGE: Fix for regressions T43883 and T43456 (and T43876 likely). SDL joystick related

2015-03-07 Thread Jorge Bernal
Commit: b4fccce1f6f4d5462d56e32934ff8652ea5d82ec
Author: Jorge Bernal
Date:   Sat Mar 7 21:27:30 2015 +0100
Branches: master
https://developer.blender.org/rBb4fccce1f6f4d5462d56e32934ff8652ea5d82ec

BGE: Fix for regressions T43883 and T43456 (and T43876 likely). SDL joystick 
related

Only to create and destroy joystick devices for connected joysticks

Reviewers: campbellbarton, sybren, moguri

Reviewed By: sybren

Maniphest Tasks: T43883, T43876

Differential Revision: https://developer.blender.org/D1161

===

M   source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp

===

diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp 
b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
index daf869e..b03570e 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
@@ -127,7 +127,7 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex 
)

m_joynum = SDL_NumJoysticks();

-   for (i=0; iCreateJoystickDevice();
}
@@ -149,7 +149,7 @@ void SCA_Joystick::ReleaseInstance()
if (!SDL_CHECK(SDL_QuitSubSystem)) {
return;
}
-   for (int i=0; iDestroyJoystickDevice();
delete m_instance[i];

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61500] trunk/lib/tests: BGE: regression test suite update

2015-02-27 Thread Jorge Bernal
Revision: 61500
  https://developer.blender.org/rBL61500
Author:   lordloki
Date: 2015-02-27 19:15:56 + (Fri, 27 Feb 2015)
Log Message:
---
BGE: regression test suite update

Basically, the following things have been updated:

- Select Blender Game instead of Blender Render
- Convert python scripts to new syntax (python 3.x and post blender 2.5)
- UV mapping several models
- New BGE layout (they used a horizontal scheme, now they use a vertical scheme)
- Rework the text files
- Other little things (improve logic, improve collision margins, etc)

Modified Paths:
--
trunk/lib/tests/gameengine/framing_extend.blend
trunk/lib/tests/gameengine_bullet_softbody/AnisoTest2.blend
trunk/lib/tests/gameengine_bullet_softbody/add_softbody.blend
trunk/lib/tests/gameengine_bullet_softbody/do_fh_bullet.blend
trunk/lib/tests/gameengine_bullet_softbody/gamesoftbody.blend
trunk/lib/tests/gameengine_bullet_softbody/gimpact.blend
trunk/lib/tests/gameengine_bullet_softbody/softbody_constraints.blend
trunk/lib/tests/gameengine_bullet_softbody/suzanne_cloth.blend
trunk/lib/tests/gameengine_bullet_softbody/torus_complex.blend
trunk/lib/tests/gameengine_bullet_softbody/webskategirl_bullet.blend
trunk/lib/tests/gameengine_logic/actuators/camera.blend
trunk/lib/tests/gameengine_logic/actuators/constraint2.blend
trunk/lib/tests/gameengine_logic/actuators/editObject_add.blend
trunk/lib/tests/gameengine_logic/actuators/editObject_end.blend
trunk/lib/tests/gameengine_logic/actuators/editObject_replaceMesh.blend
trunk/lib/tests/gameengine_logic/actuators/editObject_trackTo.blend
trunk/lib/tests/gameengine_logic/actuators/ipo.blend
trunk/lib/tests/gameengine_logic/actuators/message.blend
trunk/lib/tests/gameengine_logic/actuators/motion.blend
trunk/lib/tests/gameengine_logic/actuators/motion_LinV.blend
trunk/lib/tests/gameengine_logic/actuators/property1.blend
trunk/lib/tests/gameengine_logic/actuators/property2.blend
trunk/lib/tests/gameengine_logic/actuators/property_string.blend
trunk/lib/tests/gameengine_logic/actuators/scene_setCamera.blend
trunk/lib/tests/gameengine_logic/actuators/scene_setScene.blend
trunk/lib/tests/gameengine_logic/actuators/sound.blend
trunk/lib/tests/gameengine_logic/controllers/and.blend
trunk/lib/tests/gameengine_logic/controllers/expression.blend
trunk/lib/tests/gameengine_logic/controllers/or.blend
trunk/lib/tests/gameengine_logic/controllers/python/python_LOD.blend
trunk/lib/tests/gameengine_logic/controllers/python/python_mouse2ipo.blend
trunk/lib/tests/gameengine_logic/controllers/python/python_rec_play.blend
trunk/lib/tests/gameengine_logic/controllers/python/python_velocity.blend
trunk/lib/tests/gameengine_logic/sensors/always.blend
trunk/lib/tests/gameengine_logic/sensors/collision.blend
trunk/lib/tests/gameengine_logic/sensors/keyboard.blend
trunk/lib/tests/gameengine_logic/sensors/keyboard_text.blend
trunk/lib/tests/gameengine_logic/sensors/message.blend
trunk/lib/tests/gameengine_logic/sensors/mouse.blend
trunk/lib/tests/gameengine_logic/sensors/mouse_button.blend
trunk/lib/tests/gameengine_logic/sensors/near_property.blend
trunk/lib/tests/gameengine_logic/sensors/property.blend
trunk/lib/tests/gameengine_logic/sensors/radar1.blend
trunk/lib/tests/gameengine_logic/sensors/radar2.blend
trunk/lib/tests/gameengine_logic/sensors/random.blend
trunk/lib/tests/gameengine_logic/sensors/ray.blend
trunk/lib/tests/gameengine_logic/sensors/touch.blend
trunk/lib/tests/gameengine_logic/sensors/touch2.blend
trunk/lib/tests/gameengine_physics/2Dexample.blend
trunk/lib/tests/gameengine_physics/arch_pressure_simulation.blend
trunk/lib/tests/gameengine_physics/constraintsTutorial.blend
trunk/lib/tests/gameengine_physics/genericConstraintSpringLimitMotor.blend
trunk/lib/tests/gameengine_physics/vaults.blend
trunk/lib/tests/gameengine_visual/GLSL_samples_249.blend
trunk/lib/tests/gameengine_visual/lampRGB.blend
trunk/lib/tests/gameengine_visual/screenspace.blend
trunk/lib/tests/gameengine_visual/videotexture/MirrorTextureDemo.blend
trunk/lib/tests/gameengine_visual/videotexture/VideoTextureDemo.blend

Modified: trunk/lib/tests/gameengine/framing_extend.blend
===
(Binary files differ)

Modified: trunk/lib/tests/gameengine_bullet_softbody/AnisoTest2.blend
===
(Binary files differ)

Modified: trunk/lib/tests/gameengine_bullet_softbody/add_softbody.blend
===
(Binary files differ)

Modified: trunk/lib/tests/gameengine_bullet_softbody/do_fh_bullet.blend
===
(Binary files differ)

Modified: trunk/lib/tests/gameeng

[Bf-blender-cvs] [5d06960] master: BGE: Fix T41502 Path following jumping

2015-02-18 Thread Jorge Bernal
Commit: 5d0696052a00ca80043852ca891b1bbe0b70ff1b
Author: Jorge Bernal
Date:   Wed Feb 18 23:24:02 2015 +0100
Branches: master
https://developer.blender.org/rB5d0696052a00ca80043852ca891b1bbe0b70ff1b

BGE: Fix T41502 Path following jumping

New Lock Z velocity parameter was added. This parameter avoid the micro-jumping.
By default it is actived except when you load an old file that it is deactived 
to keep former behaviour.

Additionally it was solved another issue related with the acceleration: That is 
the acceleration value was not taked into account and we had always the maximum 
linear velocity from the beginning of movement. Now the acceleration is taken 
into account until we reach the maximum velocity.
When you load an old file, the acceleration value is set to the maximum range 
(1000.f). This way we simulate a maximum velocity constant from the beginning 
of movement (former behaviour).

{F142195}

Reviewers: moguri, dfelinto, campbellbarton

Reviewed By: campbellbarton

Subscribers: sergey

Differential Revision: https://developer.blender.org/D1074

===

M   source/blender/blenkernel/intern/sca.c
M   source/blender/blenloader/intern/versioning_270.c
M   source/blender/editors/space_logic/logic_window.c
M   source/blender/makesdna/DNA_actuator_types.h
M   source/blender/makesrna/intern/rna_actuator.c
M   source/gameengine/Converter/KX_ConvertActuators.cpp
M   source/gameengine/Ketsji/KX_SteeringActuator.cpp
M   source/gameengine/Ketsji/KX_SteeringActuator.h

===

diff --git a/source/blender/blenkernel/intern/sca.c 
b/source/blender/blenkernel/intern/sca.c
index 9159c9e..c902659 100644
--- a/source/blender/blenkernel/intern/sca.c
+++ b/source/blender/blenkernel/intern/sca.c
@@ -496,7 +496,7 @@ void init_actuator(bActuator *act)
sta->turnspeed = 120.f;
sta->dist = 1.f;
sta->velocity= 3.f;
-   sta->flag = ACT_STEERING_AUTOMATICFACING;
+   sta->flag = ACT_STEERING_AUTOMATICFACING | 
ACT_STEERING_LOCKZVEL;
sta->facingaxis = 1;
break;
case ACT_MOUSE:
diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index 1afdc34..f4591e4 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -616,5 +616,17 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
}
}
}
+
+   if (!DNA_struct_elem_find(fd->filesdna, "bSteeringActuator", 
"float", "acceleration")) {
+   for (ob = main->object.first; ob; ob = ob->id.next) {
+   bActuator *act;
+   for (act = ob->actuators.first; act; act = 
act->next) {
+   if (act->type == ACT_STEERING) {
+   bSteeringActuator *sact = 
act->data;
+   sact->acceleration = 1000.f;
+   }
+   }
+   }
+   }
}
 }
diff --git a/source/blender/editors/space_logic/logic_window.c 
b/source/blender/editors/space_logic/logic_window.c
index 37c6346..7204144 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -2105,12 +2105,15 @@ static void draw_actuator_steering(uiLayout *layout, 
PointerRNA *ptr)
}
 
row = uiLayoutRow(layout, false);
-   uiItemR(row, ptr, "self_terminated", 0, NULL, ICON_NONE);
+   col = uiLayoutColumn(row, false);
+   uiItemR(col, ptr, "self_terminated", 0, NULL, ICON_NONE);
if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING) {
-   uiItemR(row, ptr, "update_period", 0, NULL, ICON_NONE);
-   row = uiLayoutRow(layout, false);
+   col = uiLayoutColumn(row, false);
+   uiItemR(col, ptr, "update_period", 0, NULL, ICON_NONE);
}
row = uiLayoutRow(layout, false);
+   uiItemR(row, ptr, "lock_z_velocity", 1, NULL, ICON_NONE);
+   row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "show_visualization", 0, NULL, ICON_NONE);
if (RNA_enum_get(ptr, "mode") != ACT_STEERING_PATHFOLLOWING) {
uiLayoutSetActive(row, false);
diff --git a/source/blender/makesdna/DNA_actuator_types.h 
b/source/blender/makesdna/DNA_actuator_types.h
index bdf1b62..9af0c1d 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA

[Bf-blender-cvs] [4ed8b70] master: BGE: Fix T42437: Physics/Compound bug

2015-02-18 Thread Jorge Bernal
Commit: 4ed8b708700af9e80c71e4c82897fbe3cee64e41
Author: Jorge Bernal
Date:   Wed Feb 18 19:59:21 2015 +0100
Branches: master
https://developer.blender.org/rB4ed8b708700af9e80c71e4c82897fbe3cee64e41

BGE: Fix T42437: Physics/Compound bug

Null check to verify that parent has a character controller. Otherwise (i.e 
empty) it will crash.

Reviewers: moguri, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1115

===

M   source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index f450e3a..ac132a5 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -3358,46 +3358,50 @@ void CcdPhysicsEnvironment::ConvertObject(KX_GameObject 
*gameobj, RAS_MeshObject
//take relative transform into account!
CcdPhysicsController* parentCtrl = 
(CcdPhysicsController*)parent->GetPhysicsController();
assert(parentCtrl);
-   CcdShapeConstructionInfo* parentShapeInfo = 
parentCtrl->GetShapeInfo();
-   btRigidBody* rigidbody = parentCtrl->GetRigidBody();
-   btCollisionShape* colShape = 
rigidbody->getCollisionShape();
-   assert(colShape->isCompound());
-   btCompoundShape* compoundShape = 
(btCompoundShape*)colShape;
-
-   // compute the local transform from parent, this may 
include several node in the chain
-   SG_Node* gameNode = gameobj->GetSGNode();
-   SG_Node* parentNode = parent->GetSGNode();
-   // relative transform
-   MT_Vector3 parentScale = parentNode->GetWorldScaling();
-   parentScale[0] = MT_Scalar(1.0)/parentScale[0];
-   parentScale[1] = MT_Scalar(1.0)/parentScale[1];
-   parentScale[2] = MT_Scalar(1.0)/parentScale[2];
-   MT_Vector3 relativeScale = gameNode->GetWorldScaling() 
* parentScale;
-   MT_Matrix3x3 parentInvRot = 
parentNode->GetWorldOrientation().transposed();
-   MT_Vector3 relativePos = 
parentInvRot*((gameNode->GetWorldPosition()-parentNode->GetWorldPosition())*parentScale);
-   MT_Matrix3x3 relativeRot = 
parentInvRot*gameNode->GetWorldOrientation();
-
-   
shapeInfo->m_childScale.setValue(relativeScale[0],relativeScale[1],relativeScale[2]);
-   bm->setLocalScaling(shapeInfo->m_childScale);
-   
shapeInfo->m_childTrans.getOrigin().setValue(relativePos[0],relativePos[1],relativePos[2]);
-   float rot[12];
-   relativeRot.getValue(rot);
-   
shapeInfo->m_childTrans.getBasis().setFromOpenGLSubMatrix(rot);
-
-   parentShapeInfo->AddShape(shapeInfo);
-   
compoundShape->addChildShape(shapeInfo->m_childTrans,bm);
-   //do some recalc?
-   //recalc inertia for rigidbody
-   if (!rigidbody->isStaticOrKinematicObject())
-   {
-   btVector3 localInertia;
-   float mass = 1.f/rigidbody->getInvMass();
-   
compoundShape->calculateLocalInertia(mass,localInertia);
-   rigidbody->setMassProps(mass,localInertia);
+
+   // only makes compound shape if parent has a physics 
controller (i.e not an empty, etc)
+   if (parentCtrl) {
+   CcdShapeConstructionInfo* parentShapeInfo = 
parentCtrl->GetShapeInfo();
+   btRigidBody* rigidbody = 
parentCtrl->GetRigidBody();
+   btCollisionShape* colShape = 
rigidbody->getCollisionShape();
+   assert(colShape->isCompound());
+   btCompoundShape* compoundShape = 
(btCompoundShape*)colShape;
+
+   // compute the local transform from parent, 
this may include several node in the chain
+   SG_Node* gameNode = gameobj->GetSGNode();
+   SG_Node* parentNode = parent->GetSGNode();
+   // relative transform
+   MT_Vector3 parentScale = 
parentNode->GetWorldScaling();
+   parentScale[0]

[Bf-blender-cvs] [9bd2a7c] master: BGE: Fix T41570: Blender crash when physics createConstraint

2015-02-18 Thread Jorge Bernal
Commit: 9bd2a7c0a8fff43d9193184ca6920b4aaed5f6c1
Author: Jorge Bernal
Date:   Wed Feb 18 19:52:54 2015 +0100
Branches: master
https://developer.blender.org/rB9bd2a7c0a8fff43d9193184ca6920b4aaed5f6c1

BGE: Fix T41570: Blender crash when physics createConstraint

Move physicsid type to unsigned long long to avoid crashes on Windows 8.1 
64bits.
Other systems also modified to put them inline with this solution.

Reviewers: dfelinto, brita_, moguri, juicyfruit, campbellbarton

Reviewed By: juicyfruit, campbellbarton

Subscribers: juicyfruit

Differential Revision: https://developer.blender.org/D1122

===

M   source/gameengine/Ketsji/KX_GameObject.cpp
M   source/gameengine/Ketsji/KX_PyConstraintBinding.cpp

===

diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp 
b/source/gameengine/Ketsji/KX_GameObject.cpp
index 6d4b556..8d22c91 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -36,14 +36,6 @@
 #  pragma warning( disable:4786 )
 #endif
 
-#if defined(_WIN64) && !defined(FREE_WINDOWS64)
-typedef unsigned __int64 uint_ptr;
-#elif defined(FREE_WINDOWS64)
-typedef unsigned long long uint_ptr;
-#else
-typedef unsigned long uint_ptr;
-#endif
-
 #include "RAS_IPolygonMaterial.h"
 #include "KX_BlenderMaterial.h"
 #include "KX_GameObject.h"
@@ -3294,12 +3286,12 @@ PyObject *KX_GameObject::PyGetAxisVect(PyObject *value)
 PyObject *KX_GameObject::PyGetPhysicsId()
 {
PHY_IPhysicsController* ctrl = GetPhysicsController();
-   uint_ptr physid=0;
+   unsigned long long physid = 0;
if (ctrl)
{
-   physid= (uint_ptr)ctrl;
+   physid = (unsigned long long)ctrl;
}
-   return PyLong_FromLong((long)physid);
+   return PyLong_FromUnsignedLongLong(physid);
 }
 
 PyObject *KX_GameObject::PyGetPropertyNames()
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp 
b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index 1b69eab..51ae5ca 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -495,11 +495,7 @@ static PyObject *gPyCreateConstraint(PyObject *self,
  PyObject *kwds)
 {
/* FIXME - physicsid is a long being cast to a pointer, should at least 
use PyCapsule */
-#if defined(_WIN64)
-   __int64 physicsid=0,physicsid2 = 0;
-#else
-   long physicsid=0,physicsid2 = 0;
-#endif
+   unsigned long long physicsid = 0, physicsid2 = 0;
int constrainttype=0, extrainfo=0;
int len = PyTuple_Size(args);
int success = 1;
@@ -508,51 +504,28 @@ static PyObject *gPyCreateConstraint(PyObject *self,
float pivotX=1,pivotY=1,pivotZ=1,axisX=0,axisY=0,axisZ=1;
if (len == 3)
{
-#if defined(_WIN64)
-   success = 
PyArg_ParseTuple(args,"LLi",&physicsid,&physicsid2,&constrainttype);
-#else
-   success = 
PyArg_ParseTuple(args,"lli",&physicsid,&physicsid2,&constrainttype);
-#endif
+   success = PyArg_ParseTuple(args, "KKi", &physicsid, 
&physicsid2, &constrainttype);
}
else if (len == 6)
{
-#if defined(_WIN64)
-   success = 
PyArg_ParseTuple(args,"LLifff",&physicsid,&physicsid2,&constrainttype,
-  &pivotX,&pivotY,&pivotZ);
-#else
-   success = 
PyArg_ParseTuple(args,"llifff",&physicsid,&physicsid2,&constrainttype,
-  &pivotX,&pivotY,&pivotZ);
-#endif
+   success = PyArg_ParseTuple(args, "KKifff", &physicsid, 
&physicsid2, &constrainttype,
+  &pivotX, &pivotY, &pivotZ);
}
else if (len == 9)
{
-#if defined(_WIN64)
-   success = 
PyArg_ParseTuple(args,"LLiff",&physicsid,&physicsid2,&constrainttype,
-  
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
-#else
-   success = 
PyArg_ParseTuple(args,"lliff",&physicsid,&physicsid2,&constrainttype,
-  
&pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ);
-#endif
+   success = PyArg_ParseTuple(args, "KKiff", &physicsid, 
&physicsid2, &constrainttype,
+  &pivotX, &pivotY, &pivotZ, &axisX, 
&axisY, &axisZ);
}
else if (len == 10)
{
-#if defined(_WIN64)
-   success = 
PyArg_ParseTuple(args,"LLi

[Bf-blender-cvs] [1af042d] master: BGE: Fix for T42285 & T38935 crashes. They are Rayhit related.

2015-02-12 Thread Jorge Bernal
Commit: 1af042d9ed6b15463385c04665410ad54cf73f60
Author: Jorge Bernal
Date:   Fri Feb 13 00:09:32 2015 +0100
Branches: master
https://developer.blender.org/rB1af042d9ed6b15463385c04665410ad54cf73f60

BGE: Fix for T42285 & T38935 crashes. They are Rayhit related.

We make sure that good values are passed to GetPolygon() and we check that the 
visual mesh doesn't have a wrong displacement when it passes over a object 
which has a mesh triangle as compound bound.

Reviewers: dfelinto, sergof, agoose77, moguri

Reviewed By: moguri

Subscribers: agoose77

Differential Revision: https://developer.blender.org/D979

===

M   
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

===

diff --git 
a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp 
b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 415ea87..116a113 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -1269,28 +1269,32 @@ void 
RAS_OpenGLRasterizer::RemoveLight(RAS_ILightObject* lightobject)
 
 bool RAS_OpenGLRasterizer::RayHit(struct KX_ClientObjectInfo *client, 
KX_RayCast *result, void * const data)
 {
-   double* const oglmatrix = (double* const) data;
-
-   RAS_Polygon* poly = result->m_hitMesh->GetPolygon(result->m_hitPolygon);
-   if (!poly->IsVisible())
+   if (result->m_hitMesh) {
+   double* const oglmatrix = (double* const) data;
+
+   RAS_Polygon* poly = 
result->m_hitMesh->GetPolygon(result->m_hitPolygon);
+   if (!poly->IsVisible())
+   return false;
+
+   MT_Vector3 resultnormal(result->m_hitNormal);
+   MT_Vector3 left(oglmatrix[0],oglmatrix[1],oglmatrix[2]);
+   MT_Vector3 dir = -(left.cross(resultnormal)).safe_normalized();
+   left = (dir.cross(resultnormal)).safe_normalized();
+   // for the up vector, we take the 'resultnormal' returned by 
the physics
+
+   double maat[16] = {left[0], left[1], left[2],   
  0,
+  dir[0],  dir[1],  
dir[2],  0,
+  resultnormal[0], resultnormal[1], 
resultnormal[2], 0,
+  0,   0,  
 0,   1};
+
+   glTranslated(oglmatrix[12],oglmatrix[13],oglmatrix[14]);
+   //glMultMatrixd(oglmatrix);
+   glMultMatrixd(maat);
+   return true;
+   }
+   else {
return false;
-
-   MT_Point3 resultpoint(result->m_hitPoint);
-   MT_Vector3 resultnormal(result->m_hitNormal);
-   MT_Vector3 left(oglmatrix[0],oglmatrix[1],oglmatrix[2]);
-   MT_Vector3 dir = -(left.cross(resultnormal)).safe_normalized();
-   left = (dir.cross(resultnormal)).safe_normalized();
-   // for the up vector, we take the 'resultnormal' returned by the physics
-
-   double maat[16] = {left[0], left[1], left[2], 0,
-  dir[0],  dir[1],  dir[2],  0,
-  resultnormal[0], resultnormal[1], resultnormal[2], 0,
-  0,   0,   0,   
1};
-
-   glTranslated(resultpoint[0],resultpoint[1],resultpoint[2]);
-   //glMultMatrixd(oglmatrix);
-   glMultMatrixd(maat);
-   return true;
+   }
 }
 
 void RAS_OpenGLRasterizer::applyTransform(double* oglmatrix,int objectdrawmode 
)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2b847d1] master: BGE: Remove translation and rotation constrains subpanel from dynamics type

2015-02-12 Thread Jorge Bernal
Commit: 2b847d1e6508b1b2da68f5e224305c62e0acf603
Author: Jorge Bernal
Date:   Fri Feb 13 00:05:16 2015 +0100
Branches: master
https://developer.blender.org/rB2b847d1e6508b1b2da68f5e224305c62e0acf603

BGE: Remove translation and rotation constrains subpanel from dynamics type

The translation and rotation locks subpanel was not used by dynamic physics 
type to avoid inestability in the application of forces and/or torques. 
Therefore it is better to remove it from UI (for dynamics) to avoid 
misunderstandings.

Reviewers: moguri, dfelinto, campbellbarton

Reviewed By: campbellbarton

Subscribers: panzergame

Differential Revision: https://developer.blender.org/D1090

===

M   release/scripts/startup/bl_ui/properties_game.py

===

diff --git a/release/scripts/startup/bl_ui/properties_game.py 
b/release/scripts/startup/bl_ui/properties_game.py
index 4cb6929..3daf938 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -100,6 +100,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
 sub.prop(game, "damping", text="Translation", slider=True)
 sub.prop(game, "rotation_damping", text="Rotation", slider=True)
 
+if physics_type == 'RIGID_BODY':
 layout.separator()
 
 split = layout.split()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9e217cc] master: BGE Fix T39026: No collisions detected with parented rigid body object

2015-02-12 Thread Jorge Bernal
Commit: 9e217ccb2e111e051b2835a518fba02ffe97bfe3
Author: Jorge Bernal
Date:   Thu Feb 12 23:56:50 2015 +0100
Branches: master
https://developer.blender.org/rB9e217ccb2e111e051b2835a518fba02ffe97bfe3

BGE Fix T39026: No collisions detected with parented rigid body object

Fix for T39026. Preliminary investigation by blenderscripter on D446.
Also it solves bug T41285 (Parenting object leave collission box).

Refactor commit b90de0331df6c92af909b20a3e183596ff3511e4 introduced a
regression bug.

Reviewers: sergof, campbellbarton, moguri

Reviewed By: moguri

Subscribers: blueprintrandom, blenderscripter

Differential Revision: https://developer.blender.org/D1064

===

M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
M   source/gameengine/Physics/Bullet/CcdPhysicsController.h

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index ff68021..08fcb24 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -148,6 +148,7 @@ CcdPhysicsController::CcdPhysicsController (const 
CcdConstructionInfo& ci)
m_savedCollisionFilterGroup = 0;
m_savedCollisionFilterMask = 0;
m_savedMass = 0.0;
+   m_savedDyna = false;
m_suspended = false;

CreateRigidbody();
@@ -1068,6 +1069,7 @@ void  CcdPhysicsController::SuspendDynamics(bool 
ghost)
 
m_savedCollisionFlags = body->getCollisionFlags();
m_savedMass = GetMass();
+   m_savedDyna = m_cci.m_bDyna;
m_savedCollisionFilterGroup = handle->m_collisionFilterGroup;
m_savedCollisionFilterMask = handle->m_collisionFilterMask;
m_suspended = true;
@@ -1076,6 +1078,7 @@ void  CcdPhysicsController::SuspendDynamics(bool 
ghost)

btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)),
btBroadphaseProxy::StaticFilter,
btBroadphaseProxy::AllFilter ^ 
btBroadphaseProxy::StaticFilter);
+   m_cci.m_bDyna = false;
}
 }
 
@@ -1092,6 +1095,7 @@ void  CcdPhysicsController::RestoreDynamics()
m_savedCollisionFilterGroup,
m_savedCollisionFilterMask);
body->activate();
+   m_cci.m_bDyna = m_savedDyna;
m_suspended = false;
}
 }
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
index 557a5fe..be393bb 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
@@ -480,6 +480,7 @@ protected:
short m_savedCollisionFilterGroup;
short m_savedCollisionFilterMask;
MT_Scalar m_savedMass;
+   bool m_savedDyna;
bool m_suspended;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a9d09ff] master: BGE: Improve UI of Anisotropic Friction subpanel

2015-02-11 Thread Jorge Bernal
Commit: a9d09ff7ae36198dc21fd199a44d638bad859852
Author: Jorge Bernal
Date:   Thu Feb 12 06:38:21 2015 +0100
Branches: master
https://developer.blender.org/rBa9d09ff7ae36198dc21fd199a44d638bad859852

BGE: Improve UI of Anisotropic Friction subpanel

Little patch that introduces X: Y: and Z: texts over anisotropic friction 
sliders

Reviewers: moguri, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1073

===

M   source/blender/makesrna/intern/rna_object.c

===

diff --git a/source/blender/makesrna/intern/rna_object.c 
b/source/blender/makesrna/intern/rna_object.c
index 60cf753..18d506a 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1816,7 +1816,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "gameflag", 
OB_ANISOTROPIC_FRICTION);
RNA_def_property_ui_text(prop, "Anisotropic Friction", "Enable 
anisotropic friction");
 
-   prop = RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, 
PROP_NONE);
+   prop = RNA_def_property(srna, "friction_coefficients", PROP_FLOAT, 
PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "anisotropicFriction");
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Friction Coefficients",

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c44d7b0] master: BGE: Remove duplicated audio panel from Render context

2015-01-28 Thread Jorge Bernal
Commit: c44d7b0340e6b21444b3218d58857a88b6b32fdd
Author: Jorge Bernal
Date:   Thu Jan 29 18:22:42 2015 +1100
Branches: master
https://developer.blender.org/rBc44d7b0340e6b21444b3218d58857a88b6b32fdd

BGE: Remove duplicated audio panel from Render context

This commit removes the audio panel from Render context as it exists a similar 
panel in Scene context.
Also, it gives to the Distance Model a similar UI layout as it was in the 
removed render->audio panel

===

M   release/scripts/startup/bl_ui/properties_game.py
M   release/scripts/startup/bl_ui/properties_scene.py

===

diff --git a/release/scripts/startup/bl_ui/properties_game.py 
b/release/scripts/startup/bl_ui/properties_game.py
index 4d9dbe6..4cb6929 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -519,22 +519,6 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
 row.prop(rd, "sample_max_error")
 
 
-class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
-bl_label = "Sound"
-COMPAT_ENGINES = {'BLENDER_GAME'}
-
-def draw(self, context):
-layout = self.layout
-
-scene = context.scene
-
-layout.prop(scene, "audio_distance_model")
-
-col = layout.column(align=True)
-col.prop(scene, "audio_doppler_speed", text="Speed")
-col.prop(scene, "audio_doppler_factor")
-
-
 class WorldButtonsPanel:
 bl_space_type = 'PROPERTIES'
 bl_region_type = 'WINDOW'
diff --git a/release/scripts/startup/bl_ui/properties_scene.py 
b/release/scripts/startup/bl_ui/properties_scene.py
index d601e56..facf54d 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -263,10 +263,11 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
 split = layout.split()
 
 col = split.column()
-col.label("Listener:")
+col.label("Distance Model:")
 col.prop(scene, "audio_distance_model", text="")
-col.prop(scene, "audio_doppler_speed", text="Speed")
-col.prop(scene, "audio_doppler_factor", text="Doppler")
+sub = col.column(align=True)
+sub.prop(scene, "audio_doppler_speed", text="Speed")
+sub.prop(scene, "audio_doppler_factor", text="Doppler")
 
 col = split.column()
 col.label("Format:")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [072d80a] master: Fix T42858: Non uniform gamelogic names on copy

2015-01-28 Thread Jorge Bernal
Commit: 072d80a9de3adef632b8637649b169c4a895c1b9
Author: Jorge Bernal
Date:   Thu Jan 29 16:03:19 2015 +1100
Branches: master
https://developer.blender.org/rB072d80a9de3adef632b8637649b169c4a895c1b9

Fix T42858: Non uniform gamelogic names on copy

Use generic function for consistent behavior

D949 by @lordloki

===

M   source/blender/blenkernel/intern/property.c
M   source/blender/editors/object/object_edit.c
M   source/blender/editors/space_logic/logic_ops.c
M   source/blender/editors/space_logic/logic_window.c
M   source/blender/makesrna/intern/rna_actuator.c
M   source/blender/makesrna/intern/rna_controller.c
M   source/blender/makesrna/intern/rna_property.c
M   source/blender/makesrna/intern/rna_sensor.c

===

diff --git a/source/blender/blenkernel/intern/property.c 
b/source/blender/blenkernel/intern/property.c
index 819f4af..100df5f 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -131,60 +131,6 @@ bProperty *BKE_bproperty_new(int type)
return prop;
 }
 
-/* used by BKE_bproperty_unique() only */
-static bProperty *bproperty_get(bProperty *first, bProperty *self, const char 
*name)
-{
-   bProperty *p;
-   for (p = first; p; p = p->next) {
-   if (p != self && STREQ(p->name, name))
-   return p;
-   }
-   return NULL;
-}
-void BKE_bproperty_unique(bProperty *first, bProperty *prop, int force)
-{
-   bProperty *p;
-
-   /* set the first if its not set */
-   if (first == NULL) {
-   first = prop;
-   while (first->prev) {
-   first = first->prev;
-   }
-   }
-
-   if (force) {
-   /* change other names to make them unique */
-   while ((p = bproperty_get(first, prop, prop->name))) {
-   BKE_bproperty_unique(first, p, 0);
-   }
-   }
-   else {
-   /* change our own name until its unique */
-   if (bproperty_get(first, prop, prop->name)) {
-   /* there is a collision */
-   char new_name[sizeof(prop->name)];
-   char base_name[sizeof(prop->name)];
-   char num[sizeof(prop->name)];
-   int i = 0;
-
-   /* strip numbers */
-   BLI_strncpy(base_name, prop->name, sizeof(base_name));
-   for (i = strlen(base_name) - 1; (i >= 0 && 
isdigit(base_name[i])); i--) {
-   base_name[i] = '\0';
-   }
-   i = 0;
-
-   do { /* ensure we have enough chars for the new number 
in the name */
-   const size_t num_len = BLI_snprintf(num, 
sizeof(num), "%d", i++);
-   BLI_snprintf(new_name, sizeof(prop->name),
-"%.*s%s", (int)(sizeof(prop->name) 
- num_len), base_name, num);
-   } while (bproperty_get(first, prop, new_name));
-
-   BLI_strncpy(prop->name, new_name, sizeof(prop->name));
-   }
-   }
-}
 
 bProperty *BKE_bproperty_object_get(Object *ob, const char *name)
 {
diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index 62c27d8..749a178 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -42,6 +42,8 @@
 #include "BLI_utildefines.h"
 #include "BLI_ghash.h"
 
+#include "BLF_translation.h"
+
 #include "DNA_armature_types.h"
 #include "DNA_curve_types.h"
 #include "DNA_group_types.h"
@@ -1701,7 +1703,7 @@ static int game_property_new_exec(bContext *C, wmOperator 
*op)
BLI_strncpy(prop->name, name, sizeof(prop->name));
}
 
-   BKE_bproperty_unique(NULL, prop, 0); // 
make_unique_prop_names(prop->name);
+   BLI_uniquename(&ob->prop, prop, DATA_("Property"), '.', 
offsetof(bProperty, name), sizeof(prop->name));
 
WM_event_add_notifier(C, NC_LOGIC, NULL);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_logic/logic_ops.c 
b/source/blender/editors/space_logic/logic_ops.c
index 62703ba..2c6280f 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -39,6 +39,8 @@
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_context.h"
 #include "BKE_main.h"
 #include "BKE_sca.

[Bf-blender-cvs] [ee58d44] master: BGE: Fix for bugs T42520 and T42097 (mouse look actuator related).

2015-01-05 Thread Jorge Bernal
Commit: ee58d449455df9470c4a0a902056b8c2001128bf
Author: Jorge Bernal
Date:   Mon Jan 5 22:06:40 2015 -0800
Branches: master
https://developer.blender.org/rBee58d449455df9470c4a0a902056b8c2001128bf

BGE: Fix for bugs T42520 and T42097 (mouse look actuator related).

With this fix the mouse actuator movement works well as with even screen 
resolutions as odd screen resolutions.
Also it fixed the movement when the border of the blenderplayer window is out 
of the screen limits.

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D946

===

M   source/gameengine/Ketsji/KX_MouseActuator.cpp

===

diff --git a/source/gameengine/Ketsji/KX_MouseActuator.cpp 
b/source/gameengine/Ketsji/KX_MouseActuator.cpp
index 74b3d09..8774abe 100644
--- a/source/gameengine/Ketsji/KX_MouseActuator.cpp
+++ b/source/gameengine/Ketsji/KX_MouseActuator.cpp
@@ -126,24 +126,33 @@ bool KX_MouseActuator::Update()
float movement[2];
MT_Vector3 rotation;
float setposition[2] = {0.0};
+   float center_x = 0.5, center_y = 0.5;
 
getMousePosition(position);
 
movement[0] = position[0];
movement[1] = position[1];
 
+   //preventing undesired drifting when resolution 
is odd
+   if ((m_canvas->GetWidth() % 2) != 0) {
+   center_x = ((m_canvas->GetWidth() - 
1.0) / 2.0) / (m_canvas->GetWidth());
+   }
+   if ((m_canvas->GetHeight() % 2) != 0) {
+   center_y = ((m_canvas->GetHeight() - 1.0) / 
2.0) / (m_canvas->GetHeight());
+   }
+
//preventing initial skipping.
if ((m_oldposition[0] <= -0.9) && 
(m_oldposition[1] <= -0.9)) {
 
if (m_reset_x) {
-   m_oldposition[0] = 0.5;
+   m_oldposition[0] = center_x;
}
else {
m_oldposition[0] = position[0];
}
 
if (m_reset_y) {
-   m_oldposition[1] = 0.5;
+   m_oldposition[1] = center_y;
}
else {
m_oldposition[1] = position[1];
@@ -156,8 +165,8 @@ bool KX_MouseActuator::Update()
if (m_use_axis_x) {
 
if (m_reset_x) {
-   setposition[0] = 0.5;
-   movement[0] -= 0.5;
+   setposition[0] = center_x;
+   movement[0] -= center_x;
}
else {
setposition[0] = position[0];
@@ -166,12 +175,10 @@ bool KX_MouseActuator::Update()
 
movement[0] *= -1.0;
 
-   /* Don't apply the rotation when width 
resolution is odd (+ little movement) to
- avoid undesired drifting or when we 
are under a certain threshold for mouse
+   /* Don't apply the rotation when we are 
under a certain threshold for mouse
  movement */
 
-   if (!((m_canvas->GetWidth() % 2 != 0) 
&& MT_abs(movement[0]) < 0.01) &&
-   ((movement[0] > (m_threshold[0] / 
10.0)) ||
+   if (((movement[0] > (m_threshold[0] / 
10.0)) ||
((movement[0] * (-1.0)) > 
(m_threshold[0] / 10.0 {
 
movement[0] *= m_sensitivity[0];
@@ -209,15 +216,15 @@ bool KX_MouseActuator::Update()
}
}
else {
-   setposition[0] = 0.5;
+   setposition[0] = center_x;
   

[Bf-blender-cvs] [1bf87fa] master: BGE: TrackTo actuator: increasing up & track axis options

2014-07-14 Thread Jorge Bernal
Commit: 1bf87fa26c6763ef282ec39b07b678723a7f389b
Author: Jorge Bernal
Date:   Mon Jul 14 17:36:56 2014 -0700
https://developer.blender.org/rB1bf87fa26c6763ef282ec39b07b678723a7f389b

BGE: TrackTo actuator: increasing up & track axis options

This is related to Task T34861 to increase up & track axis options for TrackTo 
actuator. I've just added it to differential to facilitate an easier review.

With the patch applied you can select X, Y and Z axis for the Up axis, and X, 
Y, Z, -X, -Y and -Z for the track axis.

Related to the implementation I have used the algorithm from Trackto constrain 
placed in constrain.c but adapted to be used with MOTO library.

The wiki docs are here 
(http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Edit_Object#Trackto_Actuator).

Test file is here: {F97623}

I have also uploaded 2 screenshots showing the UI modifications to the TrackTo 
actuator:

{F91992} {F91990}

Reviewers: moguri, dfelinto

Reviewed By: moguri

CC: Genome36

Differential Revision: https://developer.blender.org/D565

===

M   doc/python_api/rst/bge.logic.rst
M   doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst
M   intern/moto/include/MT_Matrix3x3.h
M   intern/moto/include/MT_Vector3.h
M   intern/moto/include/MT_Vector3.inl
M   release/scripts/startup/bl_ui/properties_object.py
M   source/blender/blenkernel/BKE_blender.h
M   source/blender/blenkernel/intern/sca.c
M   source/blender/blenloader/intern/versioning_270.c
M   source/blender/editors/space_logic/logic_window.c
M   source/blender/makesdna/DNA_actuator_types.h
M   source/blender/makesrna/intern/rna_actuator.c
M   source/gameengine/Converter/KX_ConvertActuators.cpp
M   source/gameengine/Ketsji/KX_PythonInit.cpp
M   source/gameengine/Ketsji/KX_TrackToActuator.cpp
M   source/gameengine/Ketsji/KX_TrackToActuator.h

===

diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst
index 4e0d317..d901a4e 100644
--- a/doc/python_api/rst/bge.logic.rst
+++ b/doc/python_api/rst/bge.logic.rst
@@ -868,6 +868,23 @@ See :class:`bge.types.KX_SteeringActuator.behavior`
 
:value: 3
 
+.. _logic-trackto-actuator:
+
+-
+TrackTo Actuator
+-
+
+See :class:`bge.types.KX_TrackToActuator`
+
+.. data:: KX_TRACK_UPAXIS_POS_X
+.. data:: KX_TRACK_UPAXIS_POS_Y
+.. data:: KX_TRACK_UPAXIS_POS_Z
+.. data:: KX_TRACK_TRAXIS_POS_X
+.. data:: KX_TRACK_TRAXIS_POS_Y
+.. data:: KX_TRACK_TRAXIS_POS_Z
+.. data:: KX_TRACK_TRAXIS_NEG_X
+.. data:: KX_TRACK_TRAXIS_NEG_Y
+.. data:: KX_TRACK_TRAXIS_NEG_Z
 
 ===
 Various
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst 
b/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst
index 070243c..5b5c5d0 100644
--- a/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst
+++ b/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst
@@ -37,3 +37,25 @@ base class --- :class:`SCA_IActuator`
 
   :type: boolean
 
+   .. attribute:: upAxis
+
+  The axis that points upward.
+
+  :type: integer from 0 to 2
+
+  * KX_TRACK_UPAXIS_POS_X
+  * KX_TRACK_UPAXIS_POS_Y
+  * KX_TRACK_UPAXIS_POS_Z
+
+   .. attribute:: trackAxis
+
+  The axis that points to the target object.
+
+  :type: integer from 0 to 5
+
+  * KX_TRACK_TRAXIS_POS_X
+  * KX_TRACK_TRAXIS_POS_Y
+  * KX_TRACK_TRAXIS_POS_Z
+  * KX_TRACK_TRAXIS_NEG_X
+  * KX_TRACK_TRAXIS_NEG_Y
+  * KX_TRACK_TRAXIS_NEG_Z
diff --git a/intern/moto/include/MT_Matrix3x3.h 
b/intern/moto/include/MT_Matrix3x3.h
index 6d709fa..17dd533 100644
--- a/intern/moto/include/MT_Matrix3x3.h
+++ b/intern/moto/include/MT_Matrix3x3.h
@@ -84,11 +84,18 @@ public:
MT_Vector3 getColumn(int i) const {
return MT_Vector3(m_el[0][i], m_el[1][i], m_el[2][i]);
}
+
void setColumn(int i, const MT_Vector3& v) {
m_el[0][i] = v[0];
m_el[1][i] = v[1];
m_el[2][i] = v[2];
}
+
+   void setRow(int i, const MT_Vector3& v) {
+   m_el[i][0] = v[0];
+   m_el[i][1] = v[1];
+   m_el[i][2] = v[2];
+   }
 
 void setValue(const float *m) {
 m_el[0][0] = *m++; m_el[1][0] = *m++; m_el[2][0] = *m++; m++;
diff --git a/intern/moto/include/MT_Vector3.h b/intern/moto/include/MT_Vector3.h
index 83c53a1..b06f345 100644
--- a/intern/moto/include/MT_Vector3.h
+++ b/intern/moto/include/MT_Vector3.h
@@ -75,7 +75,7 @@ public:
 voidnormalize();
 MT_Vector3  normalized() const;
MT_Vector3  safe_normalized() const;
-   
+   MT_Vector3  safe_normalized_vec(MT_Vector3 vecnormalized) const;
 
 voidscale(MT_Scalar x, MT_Scalar y, MT_Scalar z); 
 MT_Vector3  scaled(MT_

[Bf-blender-cvs] [1f43b08] master: BGE: Fix for applyImpulse function

2014-07-07 Thread Jorge Bernal
Commit: 1f43b083a97ee56b8b15692ef19d0e973b6d31ac
Author: Jorge Bernal
Date:   Mon Jul 7 08:01:49 2014 -0700
https://developer.blender.org/rB1f43b083a97ee56b8b15692ef19d0e973b6d31ac

BGE: Fix for applyImpulse function

This is related to task T29419. Credit also goes to Goran Milovanovic
(goran) for proposing an initial fix for this issue.

The issue is the current behavior of applyImpulse doesn't match the behavior
described in the documentation as instead of a impulse point in world 
coordinates,
it seems to require a coordinate in a local space.

Additionally, applyImpulse function isn't consistent with similar functions 
(applyForce, applyTorque, etc)
as it doesn't allow  to choose in which space (local or global) the impulse is 
applied.

Now, we have the following function:

applyImpulse(point, impulse, local=False)
being "point" the point to apply the impulse to (in world or local 
coordinates). When local is False will
have both point and impulse in World space and when local is True will have 
point and impulse in local space.

Reviewers: moguri, dfelinto, brita_

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D567

===

M   doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
M   source/gameengine/Ketsji/KX_GameObject.cpp
M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
M   source/gameengine/Physics/Bullet/CcdPhysicsController.h
M   source/gameengine/Physics/common/PHY_IPhysicsController.h

===

diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst 
b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
index b314a47..215ff40 100644
--- a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
+++ b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
@@ -551,7 +551,7 @@ base class --- :class:`SCA_IObject`
 
  This is not implimented at the moment.
 
-   .. method:: applyImpulse(point, impulse)
+   .. method:: applyImpulse(point, impulse, local=False)
 
   Applies an impulse to the game object.
 
@@ -559,8 +559,14 @@ base class --- :class:`SCA_IObject`
   If point != position, applyImpulse will also change the object's angular 
momentum.
   Otherwise, only linear momentum will change.
 
-  :arg point: the point to apply the impulse to (in world coordinates)
-  :type point: the point to apply the impulse to (in world coordinates)
+  :arg point: the point to apply the impulse to (in world or local 
coordinates)
+  :type point: point [ix, iy, iz] the point to apply the impulse to (in 
world or local coordinates)
+  :arg impulse: impulse vector.
+  :type impulse: 3D Vector
+  :arg local:
+ * False: you get the "global" impulse ie: relative to world 
coordinates with world orientation.
+ * True: you get the "local" impulse ie: relative to local coordinates 
with object orientation.
+  :type local: boolean
 
.. method:: suspendDynamics()
 
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp 
b/source/gameengine/Ketsji/KX_GameObject.cpp
index 44646f1..f61d08e 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -3034,19 +3034,20 @@ PyObject *KX_GameObject::PyApplyImpulse(PyObject *args)
 {
PyObject *pyattach;
PyObject *pyimpulse;
+   int local = 0;

if (!m_pPhysicsController)  {
PyErr_SetString(PyExc_RuntimeError, "This object has no physics 
controller");
return NULL;
}

-   if (PyArg_ParseTuple(args, "OO:applyImpulse", &pyattach, &pyimpulse))
+   if (PyArg_ParseTuple(args, "OO|i:applyImpulse", &pyattach, &pyimpulse, 
&local))
{
MT_Point3  attach;
MT_Vector3 impulse;
if (PyVecTo(pyattach, attach) && PyVecTo(pyimpulse, impulse))
{
-   m_pPhysicsController->ApplyImpulse(attach, impulse);
+   m_pPhysicsController->ApplyImpulse(attach, impulse, 
(local!=0));
Py_RETURN_NONE;
}
 
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index c98cf21..72c3b13 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -1309,8 +1309,9 @@ void  
CcdPhysicsController::SetLinearVelocity(const MT_Vector3& lin_vel,bool loc
}
}
 }
-void   CcdPhysicsController::ApplyImpulse(const MT_Point3& attach, 
const MT_Vector3& impulsein)
+void   CcdPhysicsController::ApplyImpulse(const MT_Point3& attach, 
cons

[Bf-blender-cvs] [7d99a4d] master: BGE: New Mouse Actuator

2014-06-25 Thread Jorge Bernal
Commit: 7d99a4ded9d3d24c24ea2d5bcc488469cf60fa4a
Author: Jorge Bernal
Date:   Wed Jun 25 15:47:30 2014 -0700
https://developer.blender.org/rB7d99a4ded9d3d24c24ea2d5bcc488469cf60fa4a

BGE: New Mouse Actuator

Disclaimer: The author of this patch is Geoffrey Gollmer (gomer). I only 
updated the patch to the current git master status, reworked several parts to 
fit well with current coding style and applied several fixes.

This actuator allows users to show/hide the mouse cursor using logic bricks, as 
well as control object rotation with a mouse in the BGE.
The mouse rotation is flexible enough to allow any type of mouse look, as well 
as banking for flight controls.

{F94520}

{F91859}

Blend file for testing Mouse actuator (with default parameters and crosshair): 
{F94920}

Reviewers: moguri

Reviewed By: moguri

CC: gomer, lordodin

Differential Revision: https://developer.blender.org/D559

===

M   doc/python_api/rst/bge.logic.rst
A   doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst
M   source/blender/blenkernel/intern/sca.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/editors/space_logic/logic_window.c
M   source/blender/makesdna/DNA_actuator_types.h
M   source/blender/makesrna/intern/rna_actuator.c
M   source/gameengine/Converter/KX_ConvertActuators.cpp
M   source/gameengine/GameLogic/SCA_IActuator.h
M   source/gameengine/Ketsji/CMakeLists.txt
A   source/gameengine/Ketsji/KX_MouseActuator.cpp
A   source/gameengine/Ketsji/KX_MouseActuator.h
M   source/gameengine/Ketsji/KX_PythonInit.cpp
M   source/gameengine/Ketsji/KX_PythonInitTypes.cpp

===

diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst
index b378064..4e0d317 100644
--- a/doc/python_api/rst/bge.logic.rst
+++ b/doc/python_api/rst/bge.logic.rst
@@ -72,6 +72,7 @@ See the actuator's reference for available methods
* :class:`~bge.types.KX_CameraActuator`
* :class:`~bge.types.KX_ConstraintActuator`
* :class:`~bge.types.KX_GameActuator`
+   * :class:`~bge.types.KX_MouseActuator`
* :class:`~bge.types.KX_NetworkMessageActuator`
* :class:`~bge.types.KX_ObjectActuator`
* :class:`~bge.types.KX_ParentActuator`
@@ -764,6 +765,16 @@ See :class:`bge.types.KX_GameActuator`
 .. data:: KX_GAME_SAVECFG
 .. data:: KX_GAME_LOADCFG
 
+.. _mouse-actuator:
+
+---
+Mouse Actuator
+---
+
+.. data:: KX_ACT_MOUSE_OBJECT_AXIS_X
+.. data:: KX_ACT_MOUSE_OBJECT_AXIS_Y
+.. data:: KX_ACT_MOUSE_OBJECT_AXIS_Z
+
 ---
 Parent Actuator
 ---
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst 
b/doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst
new file mode 100644
index 000..cc3ce49
--- /dev/null
+++ b/doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst
@@ -0,0 +1,103 @@
+KX_MouseActuator(SCA_IActuator)
+
+
+.. module:: bge.types
+
+base class --- :class:`SCA_IActuator`
+
+.. class:: KX_MouseActuator(SCA_IActuator)
+
+   The mouse actuator gives control over the visibility of the mouse cursor 
and rotates the parent object according to mouse movement.
+
+   .. method:: reset()
+
+  Undoes the rotation caused by the mouse actuator.
+
+   .. attribute:: visible
+
+  The visibility of the mouse cursor.
+
+  :type: boolean
+
+   .. attribute:: use_axis_x
+
+  Mouse movement along the x axis effects object rotation.
+
+  :type: boolean
+
+   .. attribute:: use_axis_y
+
+  Mouse movement along the y axis effects object rotation.
+
+  :type: boolean
+
+   .. attribute:: threshold
+
+  Amount of movement from the mouse required before rotation is triggered.
+
+  :type: list (vector of 2 floats)
+
+  The values in the list should be between 0.0 and 0.5.
+
+   .. attribute:: reset_x
+
+  Mouse is locked to the center of the screen on the x axis.
+
+  :type: boolean
+
+   .. attribute:: reset_y
+
+  Mouse is locked to the center of the screen on the y axis.
+
+  :type: boolean
+
+   .. attribute:: object_axis
+
+  The object's 3D axis to rotate with the mouse movement. ([x, y])
+
+  :type: list (vector of 2 integers from 0 to 2)
+
+  * KX_ACT_MOUSE_OBJECT_AXIS_X
+  * KX_ACT_MOUSE_OBJECT_AXIS_Y
+  * KX_ACT_MOUSE_OBJECT_AXIS_Z
+
+   .. attribute:: local_x
+
+  Rotation caused by mouse movement along the x axis is local.
+
+  :type: boolean
+
+   .. attribute:: local_y
+
+  Rotation caused by mouse movement along the y axis is local.
+
+  :type: boolean
+
+   .. attribute:: sensitivity
+
+  The amount of rotation caused by mouse movement along the x and y axis.
+
+  :type: list (vector of 2 floats)
+
+  Negative values invert th

[Bf-blender-cvs] [8c16f4c] master: BGE: New Property sensor evaluation types

2014-06-16 Thread Jorge Bernal
Commit: 8c16f4c7d0b334b70ec3b01ac1d81d280e9759b1
Author: Jorge Bernal
Date:   Tue Jun 3 13:20:59 2014 -0700
https://developer.blender.org/rB8c16f4c7d0b334b70ec3b01ac1d81d280e9759b1

BGE: New Property sensor evaluation types

This patch adds "Less Than" and "Greater Than" evaluation types to the property 
sensor.
The Wiki Docs modifications 
http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Sensors/Property
Also, I have attached a screenshot and a blend to check.

Reviewers: dfelinto, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D476

===

M   doc/python_api/rst/bge.logic.rst
M   source/blender/editors/space_logic/logic_window.c
M   source/blender/makesdna/DNA_sensor_types.h
M   source/blender/makesrna/intern/rna_sensor.c
M   source/gameengine/Converter/KX_ConvertSensors.cpp
M   source/gameengine/Expressions/BoolValue.cpp
M   source/gameengine/Expressions/BoolValue.h
M   source/gameengine/Expressions/EmptyValue.cpp
M   source/gameengine/Expressions/EmptyValue.h
M   source/gameengine/Expressions/ErrorValue.cpp
M   source/gameengine/Expressions/ErrorValue.h
M   source/gameengine/Expressions/FloatValue.cpp
M   source/gameengine/Expressions/FloatValue.h
M   source/gameengine/Expressions/IntValue.cpp
M   source/gameengine/Expressions/IntValue.h
M   source/gameengine/Expressions/ListValue.cpp
M   source/gameengine/Expressions/ListValue.h
M   source/gameengine/Expressions/StringValue.cpp
M   source/gameengine/Expressions/StringValue.h
M   source/gameengine/Expressions/Value.cpp
M   source/gameengine/Expressions/Value.h
M   source/gameengine/Expressions/VectorValue.cpp
M   source/gameengine/Expressions/VectorValue.h
M   source/gameengine/Expressions/VoidValue.h
M   source/gameengine/GameLogic/SCA_PropertySensor.cpp
M   source/gameengine/GameLogic/SCA_PropertySensor.h
M   source/gameengine/Ketsji/KX_PythonInit.cpp

===

diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst
index 0ddae47..b378064 100644
--- a/doc/python_api/rst/bge.logic.rst
+++ b/doc/python_api/rst/bge.logic.rst
@@ -507,6 +507,18 @@ Property Sensor

:value: 5
 
+.. data:: KX_PROPSENSOR_LESSTHAN
+
+   Activate when the property is less than the sensor value
+
+   :value: 6
+
+.. data:: KX_PROPSENSOR_GREATERTHAN
+
+   Activate when the property is greater than the sensor value
+
+   :value: 7
+
 
 Radar Sensor
 
diff --git a/source/blender/editors/space_logic/logic_window.c 
b/source/blender/editors/space_logic/logic_window.c
index 4b53329..7f0fadc 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1182,9 +1182,9 @@ static void draw_sensor_property(uiLayout *layout, 
PointerRNA *ptr)
uiItemR(row, ptr, "value_max", 0, NULL, ICON_NONE);
break;
case SENS_PROP_EQUAL:
-   uiItemR(layout, ptr, "value", 0, NULL, ICON_NONE);
-   break;
case SENS_PROP_NEQUAL:
+   case SENS_PROP_LESSTHAN:
+   case SENS_PROP_GREATERTHAN:
uiItemR(layout, ptr, "value", 0, NULL, ICON_NONE);
break;
case SENS_PROP_CHANGED:
diff --git a/source/blender/makesdna/DNA_sensor_types.h 
b/source/blender/makesdna/DNA_sensor_types.h
index fcdbbe3..cd1977c 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -202,6 +202,8 @@ typedef struct bJoystickSensor {
 #define SENS_PROP_INTERVAL 2
 #define SENS_PROP_CHANGED  3
 #define SENS_PROP_EXPRESSION   4
+#define SENS_PROP_LESSTHAN 5
+#define SENS_PROP_GREATERTHAN  6
 
 /* raysensor->axisflag */
 /* flip x and y to make y default!!! */
diff --git a/source/blender/makesrna/intern/rna_sensor.c 
b/source/blender/makesrna/intern/rna_sensor.c
index f5e5911..aeef04f 100644
--- a/source/blender/makesrna/intern/rna_sensor.c
+++ b/source/blender/makesrna/intern/rna_sensor.c
@@ -478,6 +478,8 @@ static void rna_def_property_sensor(BlenderRNA *brna)
{SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""},
{SENS_PROP_CHANGED, "PROPCHANGED", 0, "Changed", ""},
/* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", 0, "Expression", 
""},  NOT_USED_IN_UI */
+   {SENS_PROP_LESSTHAN, "PROPLESSTHAN", 0, "Less Than", ""},
+   {SENS_PROP_GREATERTHAN, "PROPGREATERTHAN", 0, "Greater Than", 
""

[Bf-blender-cvs] [a5b9f22] master: BGE - button for deactivate sensors, controllers and actuators

2014-04-16 Thread Jorge Bernal
Commit: a5b9f22454cc36c8811b10fe65d40ec900497922
Author: Jorge Bernal
Date:   Wed Apr 16 22:23:29 2014 -0300
https://developer.blender.org/rBa5b9f22454cc36c8811b10fe65d40ec900497922

BGE - button for deactivate sensors, controllers and actuators

This change introduces a new checkbox to deactivate the sensors, controllers 
and/or actuators. It is useful during the development phase to avoid delete 
sensors, controllers or actuators if you want to test something new.

NOC: The wiki page is being updated (the images mostly), but the feature is 
already in the 2.71 release log.

{F61628}

Reviewers: moguri, dfelinto, campbellbarton, dingto, #user_interface, billrey

Reviewed By: moguri

CC: billrey

Differential Revision: https://developer.blender.org/D16

===

M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/space_logic/logic_window.c
M   source/blender/makesdna/DNA_actuator_types.h
M   source/blender/makesdna/DNA_controller_types.h
M   source/blender/makesdna/DNA_sensor_types.h
M   source/blender/makesrna/intern/rna_actuator.c
M   source/blender/makesrna/intern/rna_controller.c
M   source/blender/makesrna/intern/rna_sensor.c
M   source/gameengine/Converter/KX_ConvertActuators.cpp
M   source/gameengine/Converter/KX_ConvertControllers.cpp
M   source/gameengine/Converter/KX_ConvertSensors.cpp

===

diff --git a/source/blender/editors/include/UI_interface.h 
b/source/blender/editors/include/UI_interface.h
index 7eb39fd..12efd89 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -173,6 +173,7 @@ enum {
UI_BUT_COLOR_CUBIC   = (1 << 23),  /* cubic saturation for the color 
wheel */
UI_BUT_LIST_ITEM = (1 << 24),  /* This but is "inside" a list item 
(currently used to change theme colors). */
UI_BUT_DRAG_MULTI= (1 << 25),  /* edit this button as well as the 
active button (not just dragging) */
+   UI_BUT_SCA_LINK_GREY = (1 << 26),  /* used to flag if sca links shoud 
be grey out */
 };
 
 #define UI_PANEL_WIDTH  340
diff --git a/source/blender/editors/interface/interface.c 
b/source/blender/editors/interface/interface.c
index 5622288..b7e2034 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -443,7 +443,7 @@ static int ui_but_float_precision(uiBut *but, double value)
 
 /* link line drawing is not part of buttons or theme.. so we stick with it 
here */
 
-static void ui_draw_linkline(uiLinkLine *line, int highlightActiveLines)
+static void ui_draw_linkline(uiLinkLine *line, int highlightActiveLines, int 
dashInactiveLines)
 {
rcti rect;
 
@@ -454,11 +454,13 @@ static void ui_draw_linkline(uiLinkLine *line, int 
highlightActiveLines)
rect.xmax = BLI_rctf_cent_x(&line->to->rect);
rect.ymax = BLI_rctf_cent_y(&line->to->rect);

-   if (line->flag & UI_SELECT)
+   if (dashInactiveLines)
+   UI_ThemeColor(TH_GRID);
+   else if (line->flag & UI_SELECT)
glColor3ub(100, 100, 100);
else if (highlightActiveLines && ((line->from->flag & UI_ACTIVE) || 
(line->to->flag & UI_ACTIVE)))
UI_ThemeColor(TH_TEXT_HI);
-   else 
+   else
glColor3ub(0, 0, 0);
 
ui_draw_link_bezier(&rect);
@@ -469,7 +471,8 @@ static void ui_draw_links(uiBlock *block)
uiBut *but;
uiLinkLine *line;
 
-   /* Draw the inactive lines (lines with neither button being hovered 
over).
+   /* Draw the grey out lines. Do this first so they appear at the
+* bottom of inactive or active lines.
 * As we go, remember if we see any active or selected lines. */
bool found_selectline = false;
bool found_activeline = false;
@@ -477,8 +480,10 @@ static void ui_draw_links(uiBlock *block)
for (but = block->buttons.first; but; but = but->next) {
if (but->type == LINK && but->link) {
for (line = but->link->lines.first; line; line = 
line->next) {
-   if (!(line->from->flag & UI_ACTIVE) && 
!(line->to->flag & UI_ACTIVE))
-   ui_draw_linkline(line, 0);
+   if (!(line->from->flag & UI_ACTIVE) && 
!(line->to->flag & UI_ACTIVE)) {
+   if (line->deactive)
+   ui_draw_linkline(line, 0, true);
+