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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-08 20:23:48 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-08 20:23:48 +0300
commit07904712e8943b5845df9559093018c8473f72f3 (patch)
tree03cdc6ea24ac87a2ee2a3c1a7299874040675489 /source/blender/makesrna/intern/rna_pose.c
parentee74e720a82b7a1fb5f732cd8ceacbb26fa7e0d3 (diff)
RNA:
* Property update functions no longer get context, instead they get only Main and Scene. The RNA api was intended to be as context-less as possible, since it doesn't really matter who is changing the property, everything that uses the property should be updated. * There's still one exception case that use it now, screen operations still depend on context too much. It also revealed a few places using context where they shouldn't. * Ideally Scene shouldn't be passed, but much of Blender still depends on it, should be dropped when we try to support multiple scene editing. Change was planned for a while, but need this now to be able to call update without a context pointer.
Diffstat (limited to 'source/blender/makesrna/intern/rna_pose.c')
-rw-r--r--source/blender/makesrna/intern/rna_pose.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index 8a4aadcba57..c7aca9c9738 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -58,14 +58,14 @@
#include "MEM_guardedalloc.h"
-static void rna_Pose_update(bContext *C, PointerRNA *ptr)
+static void rna_Pose_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
// XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
}
-static void rna_Pose_IK_update(bContext *C, PointerRNA *ptr)
+static void rna_Pose_IK_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
// XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
Object *ob= ptr->id.data;
@@ -142,11 +142,10 @@ static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value)
}
}
-static void rna_Pose_ik_solver_update(bContext *C, PointerRNA *ptr)
+static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob= ptr->id.data;
bPose *pose = ptr->data;
- Scene *scene = CTX_data_scene(C);
pose->flag |= POSE_RECALC; // checks & sorts pose channels
DAG_scene_sort(scene);
@@ -242,7 +241,7 @@ static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr)
}
}
-static void rna_Itasc_update(bContext *C, PointerRNA *ptr)
+static void rna_Itasc_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob = ptr->id.data;
bItasc *itasc = ptr->data;
@@ -267,13 +266,13 @@ static void rna_Itasc_update(bContext *C, PointerRNA *ptr)
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
-static void rna_Itasc_update_rebuild(bContext *C, PointerRNA *ptr)
+static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Object *ob= ptr->id.data;
bPose *pose = ob->pose;
pose->flag |= POSE_RECALC; // checks & sorts pose channels
- rna_Itasc_update(C, ptr);
+ rna_Itasc_update(bmain, scene, ptr);
}
static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr)
@@ -431,7 +430,7 @@ static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA va
static bConstraint *rna_PoseChannel_constraints_new(bPoseChannel *pchan, bContext *C, int type)
{
- //WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
+ //WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object);
// TODO, pass object also
// TODO, new pose bones don't have updated draw flags
return add_pose_constraint(NULL, pchan, NULL, type);
@@ -441,7 +440,7 @@ static int rna_PoseChannel_constraints_remove(bPoseChannel *pchan, bContext *C,
{
// TODO
//ED_object_constraint_set_active(object, NULL);
- //WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, object);
+ //WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object);
return remove_constraint_index(&pchan->constraints, index);
}