~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/editconstraint.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: editconstraint.c,v 1.45 2006/12/20 18:29:23 ton Exp $
 
2
 * $Id: editconstraint.c,v 1.48 2007/04/07 04:25:31 aligorith Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
90
90
                                if (!forcevalid)
91
91
                                        return NULL;
92
92
                                
93
 
                                ob->action=add_empty_action(ID_PO);
 
93
                                ob->action=add_empty_action("Action");
94
94
                        }
95
95
                        
96
96
                        /* Make sure we have an actionchannel */
313
313
                        return NULL;
314
314
                }
315
315
                break;
 
316
                case CONSTRAINT_TYPE_CLAMPTO:
 
317
                {
 
318
                        /* cannot have subtarget. if followpath is removed from here, remove this too... */
 
319
                        return NULL; 
 
320
                }
 
321
                break;
316
322
        }
317
323
        
318
324
        return NULL;  
571
577
                                        }
572
578
                                }
573
579
                                        break;
 
580
                                case CONSTRAINT_TYPE_CLAMPTO:
 
581
                                {
 
582
                                        bClampToConstraint *data = curcon->data;
 
583
                                        
 
584
                                        if (!exist_object(data->tar)){
 
585
                                                data->tar = NULL;
 
586
                                                curcon->flag |= CONSTRAINT_DISABLE;
 
587
                                                break;
 
588
                                        }
 
589
                                        
 
590
                                        if (data->tar->type != OB_CURVE){
 
591
                                                data->tar = NULL;
 
592
                                                curcon->flag |= CONSTRAINT_DISABLE;
 
593
                                                break;
 
594
                                        }
 
595
                                        else {
 
596
                                                Curve *cu= data->tar->data;
 
597
                                                
 
598
                                                /* auto-set 'Path' setting on curve so this works  */
 
599
                                                cu->flag |= CU_PATH;
 
600
                                        }                                       
 
601
                                }
 
602
                                        break;
574
603
                        }
575
604
                }
576
605
        }
661
690
                        if(pchansel)
662
691
                                nr= pupmenu("Add Constraint to Active Bone%t|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|Action%x16");
663
692
                        else if(obsel && obsel->type==OB_CURVE)
664
 
                                nr= pupmenu("Add Constraint to Active Object%t|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6|Stretch To%x7|Action%x16");
 
693
                                nr= pupmenu("Add Constraint to Active Object%t|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6|Clamp To%x17|Stretch To%x7|Action%x16");
665
694
                        else if(obsel)
666
695
                                nr= pupmenu("Add Constraint to Active Object%t|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|Action%x16");
667
696
                        else
669
698
                }
670
699
                else {
671
700
                        if(obsel && obsel->type==OB_CURVE)
672
 
                                nr= pupmenu("Add Constraint to Active Object%t|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6");
 
701
                                nr= pupmenu("Add Constraint to Active Object%t|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6|Clamp To%x17");
673
702
                        else if(obsel)
674
703
                                nr= pupmenu("Add Constraint to Active Object%t|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|Track To%x3|Floor%x4|Locked Track%x5");
675
704
                        else
728
757
                else if(nr==14) con = add_new_constraint(CONSTRAINT_TYPE_ROTLIMIT);
729
758
                else if(nr==15) con = add_new_constraint(CONSTRAINT_TYPE_SIZELIMIT);
730
759
                else if(nr==16) con = add_new_constraint(CONSTRAINT_TYPE_ACTION);
 
760
                else if(nr==17) {
 
761
                        Curve *cu= obsel->data;
 
762
                        cu->flag |= CU_PATH;
 
763
                        con = add_new_constraint(CONSTRAINT_TYPE_CLAMPTO);
 
764
                }
731
765
                
732
766
                if(con==NULL) return;   /* paranoia */
733
767