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

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/intern/anim.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
/** anim.c
2
2
 *
3
3
 *
4
 
 * $Id: anim.c,v 1.45 2006/12/05 17:42:01 artificer Exp $
 
4
 * $Id: anim.c,v 1.47 2007/03/12 10:30:39 ton Exp $
5
5
 *
6
6
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
7
7
 *
70
70
#include <config.h>
71
71
#endif
72
72
 
73
 
ListBase duplilist= {0, 0}; 
74
 
 
75
73
void free_path(Path *path)
76
74
{
77
75
        if(path->data) MEM_freeN(path->data);
323
321
                        Mat4MulMat4(mat, go->ob->obmat, ob->obmat);
324
322
                        dob= new_dupli_object(lb, go->ob, mat, ob->lay, 0);
325
323
                        dob->no_draw= (dob->origlay & group->layer)==0;
326
 
                        if(go->ob->dup_group) {
 
324
                        
 
325
                        if(go->ob->dup_group && (go->ob->transflag & OB_DUPLIGROUP)) {
327
326
                                Mat4CpyMat4(dob->ob->obmat, dob->mat);
328
327
                                group_duplilist(lb, go->ob, level+1);
329
328
                                Mat4CpyMat4(dob->ob->obmat, dob->omat);
764
763
/* note; group dupli's already set transform matrix. see note in group_duplilist() */
765
764
ListBase *object_duplilist(Scene *sce, Object *ob)
766
765
{
767
 
        static ListBase duplilist={NULL, NULL};
768
 
        
769
 
        if(duplilist.first) {
770
 
                printf("wrong call to object_duplilist\n");
771
 
                return &duplilist;
772
 
        }
773
 
        duplilist.first= duplilist.last= NULL;
 
766
        ListBase *duplilist= MEM_mallocN(sizeof(ListBase), "duplilist");
 
767
        duplilist->first= duplilist->last= NULL;
774
768
        
775
769
        if(ob->transflag & OB_DUPLI) {
776
770
                if(ob->transflag & OB_DUPLIVERTS) {
777
771
                        if(ob->type==OB_MESH) {
778
772
                                PartEff *paf;
779
773
                                if( (paf=give_parteff(ob)) ) 
780
 
                                        particle_duplilist(&duplilist, sce, ob, paf);
 
774
                                        particle_duplilist(duplilist, sce, ob, paf);
781
775
                                else 
782
 
                                        vertex_duplilist(&duplilist, sce, ob);
 
776
                                        vertex_duplilist(duplilist, sce, ob);
783
777
                        }
784
778
                        else if(ob->type==OB_FONT) {
785
 
                                font_duplilist(&duplilist, ob);
 
779
                                font_duplilist(duplilist, ob);
786
780
                        }
787
781
                }
788
782
                else if(ob->transflag & OB_DUPLIFACES) {
789
783
                        if(ob->type==OB_MESH)
790
 
                                face_duplilist(&duplilist, sce, ob);
 
784
                                face_duplilist(duplilist, sce, ob);
791
785
                }
792
786
                else if(ob->transflag & OB_DUPLIFRAMES) 
793
 
                        frames_duplilist(&duplilist, ob);
 
787
                        frames_duplilist(duplilist, ob);
794
788
                else if(ob->transflag & OB_DUPLIGROUP) {
795
789
                        DupliObject *dob;
796
790
                        
797
 
                        group_duplilist(&duplilist, ob, 0); /* now recursive */
 
791
                        group_duplilist(duplilist, ob, 0); /* now recursive */
798
792
                        
799
793
                        /* make copy already, because in group dupli's deform displists can be makde, requiring parent matrices */
800
 
                        for(dob= duplilist.first; dob; dob= dob->next)
 
794
                        for(dob= duplilist->first; dob; dob= dob->next)
801
795
                                Mat4CpyMat4(dob->ob->obmat, dob->mat);
802
796
                }
803
797
                
804
798
        }
805
799
        
806
 
        return &duplilist;
 
800
        return duplilist;
807
801
}
808
802
 
809
803
void free_object_duplilist(ListBase *lb)
816
810
        }
817
811
        
818
812
        BLI_freelistN(lb);
 
813
        MEM_freeN(lb);
819
814
}
820
815
 
821
816
int count_duplilist(Object *ob)