edits to r60777 - move ED_object_hook_reset_do into BKE object (if RNA needs to call...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 15 Oct 2013 20:15:45 +0000 (20:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 15 Oct 2013 20:15:45 +0000 (20:15 +0000)
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/object.c
source/blender/editors/include/ED_object.h
source/blender/editors/object/object_hook.c
source/blender/makesrna/intern/rna_modifier.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index e99eb2a64f26881e2e5c6d260d8b3da71c1562de..434175624b715c575a173043e344d013c2e7796b 100644 (file)
@@ -48,6 +48,7 @@ struct rctf;
 struct MovieClip;
 struct Main;
 struct RigidBodyWorld;
+struct HookModifierData;
 
 void BKE_object_workob_clear(struct Object *workob);
 void BKE_object_workob_calc_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
@@ -66,6 +67,8 @@ void BKE_object_update_base_layer(struct Scene *scene, struct Object *ob);
 void BKE_object_free(struct Object *ob);
 void BKE_object_free_derived_caches(struct Object *ob);
 
+void BKE_object_modifier_hook_reset(struct Object *ob, struct HookModifierData *hmd);
+
 bool BKE_object_support_modifier_type_check(struct Object *ob, int modifier_type);
 
 void BKE_object_link_modifiers(struct Object *ob, struct Object *from);
index 8c2475369de530fef99395144095149e2b60dc47..94744866a1725f0912af0b8b2e7b27b6e153af1b 100644 (file)
@@ -194,6 +194,28 @@ void BKE_object_free_modifiers(Object *ob)
        BKE_object_free_softbody(ob);
 }
 
+void BKE_object_modifier_hook_reset(Object *ob, HookModifierData *hmd)
+{
+       /* reset functionality */
+       if (hmd->object) {
+               bPoseChannel *pchan = BKE_pose_channel_find_name(hmd->object->pose, hmd->subtarget);
+
+               if (hmd->subtarget[0] && pchan) {
+                       float imat[4][4], mat[4][4];
+
+                       /* calculate the world-space matrix for the pose-channel target first, then carry on as usual */
+                       mul_m4_m4m4(mat, hmd->object->obmat, pchan->pose_mat);
+
+                       invert_m4_m4(imat, mat);
+                       mul_m4_m4m4(hmd->parentinv, imat, ob->obmat);
+               }
+               else {
+                       invert_m4_m4(hmd->object->imat, hmd->object->obmat);
+                       mul_m4_m4m4(hmd->parentinv, hmd->object->imat, ob->obmat);
+               }
+       }
+}
+
 bool BKE_object_support_modifier_type_check(Object *ob, int modifier_type)
 {
        ModifierTypeInfo *mti;
index 13fdbf374bb171816e9050c86fd329bf79cd01fd..0d11108d81f3b33830014aafa37282027d564018 100644 (file)
@@ -219,9 +219,6 @@ struct EnumPropertyItem *ED_object_vgroup_selection_itemf_helper(
         int *free,
         const unsigned int selection_mask);
 
-/* object_hook.c */
-void ED_object_hook_reset_do(struct Object *ob, struct HookModifierData *hmd);
-
 #ifdef __cplusplus
 }
 #endif
index d6f3bf0c26203a605172c68a3f9b0d78b6bcc039..7f97aa0b4c1b1ac63ea686a082369372ac67f14b 100644 (file)
@@ -690,28 +690,6 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot)
        ot->prop = prop;
 }
 
-void ED_object_hook_reset_do(Object *ob, HookModifierData *hmd)
-{
-       /* reset functionality */
-       if (hmd->object) {
-               bPoseChannel *pchan = BKE_pose_channel_find_name(hmd->object->pose, hmd->subtarget);
-               
-               if (hmd->subtarget[0] && pchan) {
-                       float imat[4][4], mat[4][4];
-                       
-                       /* calculate the world-space matrix for the pose-channel target first, then carry on as usual */
-                       mul_m4_m4m4(mat, hmd->object->obmat, pchan->pose_mat);
-                       
-                       invert_m4_m4(imat, mat);
-                       mul_m4_m4m4(hmd->parentinv, imat, ob->obmat);
-               }
-               else {
-                       invert_m4_m4(hmd->object->imat, hmd->object->obmat);
-                       mul_m4_m4m4(hmd->parentinv, hmd->object->imat, ob->obmat);
-               }
-       }
-}
-
 static int object_hook_reset_exec(bContext *C, wmOperator *op)
 {
        PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier);
@@ -725,7 +703,7 @@ static int object_hook_reset_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       ED_object_hook_reset_do(ob, hmd);
+       BKE_object_modifier_hook_reset(ob, hmd);
 
        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
        WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
index ca3ebff5455b9f0bfe49f82ea72cea16ea9ef8ef..57eeba61a737c0300f5c92181eed1826ad3f2440 100644 (file)
@@ -118,10 +118,9 @@ EnumPropertyItem modifier_type_items[] = {
 #include "BKE_depsgraph.h"
 #include "BKE_library.h"
 #include "BKE_modifier.h"
+#include "BKE_object.h"
 #include "BKE_particle.h"
 
-#include "ED_object.h"
-
 static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
 {
        UVProjectModifierData *uvp = (UVProjectModifierData *)ptr->data;
@@ -543,7 +542,7 @@ static void rna_HookModifier_object_set(PointerRNA *ptr, PointerRNA value)
        HookModifierData *hmd = ptr->data;
 
        hmd->object = (Object *)value.data;
-       ED_object_hook_reset_do((Object *)ptr->id.data, hmd);
+       BKE_object_modifier_hook_reset((Object *)ptr->id.data, hmd);
 }
 
 static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value)
index b4e30beb308be9d56e1e45cc185ac9b3d107a38b..7c01058ec31196186d845c3a63565b1d58a418b0 100644 (file)
@@ -233,7 +233,6 @@ void object_test_constraints(struct Object *owner) {STUB_ASSERT(0);}
 void ED_armature_ebone_to_mat4(struct EditBone *ebone, float mat[4][4]) {STUB_ASSERT(0);}
 void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr) {STUB_ASSERT(0);}
 void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con) {STUB_ASSERT(0);}
-void ED_object_hook_reset_do(struct Object *ob, struct HookModifierData *hmd) {STUB_ASSERT(0);}
 void ED_node_composit_default(struct bContext *C, struct Scene *scene) {STUB_ASSERT(0);}
 void *ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *custumdata, int type) {STUB_ASSERT(0); return 0;} /* XXX this one looks weird */
 void *ED_region_draw_cb_customdata(void *handle) {STUB_ASSERT(0); return 0;} /* XXX This one looks wrong also */