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>2009-11-24 02:03:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-24 02:03:04 +0300
commitb7d717cead9000c4600d71ed15fc10ebc103c591 (patch)
treef59e5c37b13a57b16b279d1f08786405896f448b /source/blender/editors/armature
parent9702ea753773664e4b322b14ae507944734ee31d (diff)
added a function to duplicate bPoseChannel's internal data - constraints, id-props etc.
duplicate_pose_channel_data(), the code to do this was inline in editarmature.c duplicating editbones now duplicates posebone id-props also removed an if test for &channew->constraints since it will always be true.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c78
1 files changed, 13 insertions, 65 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 3936bc92bb9..db499c72908 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -2599,40 +2599,16 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, char *name, ListBase *edit
*/
if (src_ob->pose) {
bPoseChannel *chanold, *channew;
- ListBase *listold, *listnew;
chanold = verify_pose_channel(src_ob->pose, curBone->name);
if (chanold) {
- listold = &chanold->constraints;
- if (listold) {
- /* WARNING: this creates a new posechannel, but there will not be an attached bone
- * yet as the new bones created here are still 'EditBones' not 'Bones'.
- */
- channew =
- verify_pose_channel(dst_ob->pose, eBone->name);
- if (channew) {
- /* copy transform locks */
- channew->protectflag = chanold->protectflag;
-
- /* copy bone group */
- channew->agrp_index= chanold->agrp_index;
-
- /* ik (dof) settings */
- channew->ikflag = chanold->ikflag;
- VECCOPY(channew->limitmin, chanold->limitmin);
- VECCOPY(channew->limitmax, chanold->limitmax);
- VECCOPY(channew->stiffness, chanold->stiffness);
- channew->ikstretch= chanold->ikstretch;
- channew->ikrotweight= chanold->ikrotweight;
- channew->iklinweight= chanold->iklinweight;
-
- /* constraints */
- listnew = &channew->constraints;
- copy_constraints(listnew, listold);
-
- /* custom shape */
- channew->custom= chanold->custom;
- }
+ /* WARNING: this creates a new posechannel, but there will not be an attached bone
+ * yet as the new bones created here are still 'EditBones' not 'Bones'.
+ */
+ channew= verify_pose_channel(dst_ob->pose, eBone->name);
+
+ if(channew) {
+ duplicate_pose_channel_data(channew, chanold);
}
}
}
@@ -2701,43 +2677,15 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
*/
if (obedit->pose) {
bPoseChannel *chanold, *channew;
- ListBase *listold, *listnew;
chanold = verify_pose_channel(obedit->pose, curBone->name);
if (chanold) {
- listold = &chanold->constraints;
- if (listold) {
- /* WARNING: this creates a new posechannel, but there will not be an attached bone
- * yet as the new bones created here are still 'EditBones' not 'Bones'.
- */
- channew =
- verify_pose_channel(obedit->pose, eBone->name);
- if (channew) {
- /* copy transform locks */
- channew->protectflag = chanold->protectflag;
-
- /* copy rotation mode */
- channew->rotmode = chanold->rotmode;
-
- /* copy bone group */
- channew->agrp_index= chanold->agrp_index;
-
- /* ik (dof) settings */
- channew->ikflag = chanold->ikflag;
- VECCOPY(channew->limitmin, chanold->limitmin);
- VECCOPY(channew->limitmax, chanold->limitmax);
- VECCOPY(channew->stiffness, chanold->stiffness);
- channew->ikstretch= chanold->ikstretch;
- channew->ikrotweight= chanold->ikrotweight;
- channew->iklinweight= chanold->iklinweight;
-
- /* constraints */
- listnew = &channew->constraints;
- copy_constraints(listnew, listold);
-
- /* custom shape */
- channew->custom= chanold->custom;
- }
+ /* WARNING: this creates a new posechannel, but there will not be an attached bone
+ * yet as the new bones created here are still 'EditBones' not 'Bones'.
+ */
+ channew= verify_pose_channel(obedit->pose, eBone->name);
+ if(channew) {
+ duplicate_pose_channel_data(channew, chanold);
}
}
}