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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-08 01:48:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-08 01:48:23 +0300
commit0d8416acc7fa39a8519043e6e57006a203622644 (patch)
tree174da7aca885c66731bc9418a45a923fd53c22ce /source/blender/editors/space_logic
parent16160f5fcc1689d8008603442fe31b4edb507fb2 (diff)
minor edits, no functional changes.
- BGE was getting MCol array and not using it. - use list lookup functions for getting constraint from pose bone. - use const char * in more places.
Diffstat (limited to 'source/blender/editors/space_logic')
-rw-r--r--source/blender/editors/space_logic/logic_window.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 96999aacad8..9eae26ef8bb 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -47,6 +47,7 @@
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
+#include "BKE_action.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_library.h"
@@ -1079,25 +1080,15 @@ static void draw_default_sensor_header(bSensor *sens,
"Invert the level (output) of this sensor");
}
-static void get_armature_bone_constraint(Object *ob, char *posechannel, char *constraint_name, bConstraint **constraint)
+static void get_armature_bone_constraint(Object *ob, const char *posechannel, const char *constraint_name, bConstraint **constraint)
{
/* check that bone exist in the active object */
if (ob->type == OB_ARMATURE && ob->pose) {
- bPoseChannel *pchan;
- bPose *pose = ob->pose;
- for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) {
- if (!strcmp(pchan->name, posechannel)) {
- /* found it, now look for constraint channel */
- bConstraint *con;
- for (con=pchan->constraints.first; con; con=con->next) {
- if (!strcmp(con->name, constraint_name)) {
- /* found it, all ok */
- *constraint = con;
- return;
- }
- }
- /* didn't find constraint, make empty */
- return;
+ bPoseChannel *pchan= get_pose_channel(ob->pose, posechannel);
+ if(pchan) {
+ bConstraint *con= BLI_findstring(&pchan->constraints, constraint_name, offsetof(bConstraint, name));
+ if(con) {
+ *constraint= con;
}
}
}