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:
authorTon Roosendaal <ton@blender.org>2006-11-16 13:24:26 +0300
committerTon Roosendaal <ton@blender.org>2006-11-16 13:24:26 +0300
commit24b2e0422e68effb50546c7cdfd6112537612345 (patch)
tree89e272292245ae18568a469d5a85b84f650ab3c0 /source/blender/src/poseobject.c
parent7b71b524ed45dabd9f9ea903f723bc38a892db02 (diff)
1)
Bugfix: Beziers in curve didn't calculate the tilt values correctly for the endpoint and not for all handle types. That way deforming curves didn't extend the tilted deform either. (IRC report by Jahka) 2) If you setup a Proxy for Armatures, the protected bones now have an error pupup for buttons and for some of the tools in 3d window (constraint edit mostly). Also the Bones Panel shows a note when the bone is not editable.
Diffstat (limited to 'source/blender/src/poseobject.c')
-rw-r--r--source/blender/src/poseobject.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c
index eb0da136a0c..432c7d9d4f0 100644
--- a/source/blender/src/poseobject.c
+++ b/source/blender/src/poseobject.c
@@ -171,6 +171,33 @@ bPoseChannel *get_active_posechannel (Object *ob)
return NULL;
}
+/* if a selected or active bone is protected, throw error and return 1 */
+/* only_selected==1 : the active bone is allowed to be protected */
+static int pose_has_protected_selected(Object *ob, int only_selected)
+{
+
+ /* check protection */
+ if(OB_IS_PROXY(ob)) {
+ bPoseChannel *pchan;
+ bArmature *arm= ob->data;
+
+ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+ if(pchan->bone && (pchan->bone->layer & arm->layer)) {
+ if(pchan->bone->layer & arm->layer_protected) {
+ if(only_selected && (pchan->bone->flag & BONE_ACTIVE));
+ else if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED))
+ break;
+ }
+ }
+ }
+ if(pchan) {
+ error("Cannot change Proxy protected bones");
+ return 1;
+ }
+ }
+ return 0;
+}
+
/* only for real IK, not for auto-IK */
int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
{
@@ -367,6 +394,9 @@ void pose_clear_IK(void)
if(!ob && !ob->pose) return;
if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if(pose_has_protected_selected(ob, 0))
+ return;
+
if(okee("Remove IK constraint(s)")==0) return;
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@@ -405,6 +435,9 @@ void pose_clear_constraints(void)
if(!ob && !ob->pose) return;
if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if(pose_has_protected_selected(ob, 0))
+ return;
+
if(okee("Remove Constraints")==0) return;
/* find active */
@@ -446,6 +479,10 @@ void pose_copy_menu(void)
}
if(pchan==NULL) return;
+
+ if(pose_has_protected_selected(ob, 1))
+ return;
+
pchanact= pchan;
i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */
@@ -794,6 +831,9 @@ void pose_flip_names(void)
if(!ob && !ob->pose) return;
if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return;
+ if(pose_has_protected_selected(ob, 0))
+ return;
+
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if(arm->layer & pchan->bone->layer) {
if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) {
@@ -876,6 +916,9 @@ void pose_movetolayer(void)
if(ob->flag & OB_POSEMODE) {
bPoseChannel *pchan;
+ if(pose_has_protected_selected(ob, 0))
+ return;
+
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
if(arm->layer & pchan->bone->layer) {
if(pchan->bone->flag & BONE_SELECTED)