From b8a71efeba70d6c3ebc579f5043daa4162da86e8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 24 Mar 2012 07:52:14 +0000 Subject: style cleanup: follow style guide for/with/if spacing --- source/gameengine/Converter/BL_ActionActuator.cpp | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source/gameengine/Converter/BL_ActionActuator.cpp') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 5d87e7fd969..61379209151 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -365,14 +365,14 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) bPoseChannel *pchan; - if(m_userpose==NULL && m_pose==NULL) { + if (m_userpose==NULL && m_pose==NULL) { BL_ArmatureObject *obj = (BL_ArmatureObject*)GetParent(); obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ } // get_pose_channel accounts for NULL pose, run on both in case one exists but // the channel doesnt - if( !(pchan=get_pose_channel(m_userpose, string)) && + if ( !(pchan=get_pose_channel(m_userpose, string)) && !(pchan=get_pose_channel(m_pose, string)) ) { PyErr_SetString(PyExc_ValueError, "channel doesnt exist"); @@ -428,11 +428,11 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, return NULL; } - if(PyTuple_Size(args)==2) { + if (PyTuple_Size(args)==2) { if (!PyArg_ParseTuple(args,"sO:setChannel", &string, &pymat)) // matrix return NULL; } - else if(PyTuple_Size(args)==4) { + else if (PyTuple_Size(args)==4) { if (!PyArg_ParseTuple(args,"sOOO:setChannel", &string, &pyloc, &pysize, &pyquat)) // loc/size/quat return NULL; } @@ -441,11 +441,11 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, return NULL; } - if(pymat) { + if (pymat) { float matrix[4][4]; MT_Matrix4x4 mat; - if(!PyMatTo(pymat, mat)) + if (!PyMatTo(pymat, mat)) return NULL; mat.getValue((float*)matrix); @@ -453,14 +453,14 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, BL_ArmatureObject *obj = (BL_ArmatureObject*)GetParent(); if (!m_userpose) { - if(!m_pose) + if (!m_pose) obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ game_copy_pose(&m_userpose, m_pose, 0); } // pchan= verify_pose_channel(m_userpose, string); // adds the channel if its not there. pchan= get_pose_channel(m_userpose, string); // adds the channel if its not there. - if(pchan) { + if (pchan) { copy_v3_v3(pchan->loc, matrix[3]); mat4_to_size(pchan->size, matrix); mat4_to_quat(pchan->quat, matrix); @@ -476,7 +476,7 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, // same as above if (!m_userpose) { - if(!m_pose) + if (!m_pose) obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ game_copy_pose(&m_userpose, m_pose, 0); } @@ -484,14 +484,14 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, pchan= get_pose_channel(m_userpose, string); // adds the channel if its not there. // for some reason loc.setValue(pchan->loc) fails - if(pchan) { + if (pchan) { pchan->loc[0]= loc[0]; pchan->loc[1]= loc[1]; pchan->loc[2]= loc[2]; pchan->size[0]= size[0]; pchan->size[1]= size[1]; pchan->size[2]= size[2]; pchan->quat[0]= quat[3]; pchan->quat[1]= quat[0]; pchan->quat[2]= quat[1]; pchan->quat[3]= quat[2]; /* notice xyzw -> wxyz is intentional */ } } - if(pchan==NULL) { + if (pchan==NULL) { PyErr_SetString(PyExc_ValueError, "Channel could not be found, use the 'channelNames' attribute to get a list of valid channels"); return NULL; } @@ -595,9 +595,9 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA bPose *pose= ((BL_ArmatureObject*)self->GetParent())->GetOrigPose(); - if(pose) { + if (pose) { bPoseChannel *pchan; - for(pchan= (bPoseChannel *)pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) { + for (pchan= (bPoseChannel *)pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) { item= PyUnicode_FromString(pchan->name); PyList_Append(ret, item); Py_DECREF(item); -- cgit v1.2.3