~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/modifiers/intern/MOD_explode.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
568
568
        int numlayer;
569
569
        unsigned int ed_v1, ed_v2;
570
570
 
571
 
        edgehash = BLI_edgehash_new();
 
571
        edgehash = BLI_edgehash_new(__func__);
572
572
 
573
573
        /* recreate vertpa from facepa calculation */
574
574
        for (i = 0, mf = mface; i < totface; i++, mf++) {
586
586
                v3 = vertpa[mf->v3];
587
587
 
588
588
                if (v1 != v2) {
589
 
                        BLI_edgehash_insert(edgehash, mf->v1, mf->v2, NULL);
 
589
                        BLI_edgehash_reinsert(edgehash, mf->v1, mf->v2, NULL);
590
590
                        (*fs) |= 1;
591
591
                }
592
592
 
593
593
                if (v2 != v3) {
594
 
                        BLI_edgehash_insert(edgehash, mf->v2, mf->v3, NULL);
 
594
                        BLI_edgehash_reinsert(edgehash, mf->v2, mf->v3, NULL);
595
595
                        (*fs) |= 2;
596
596
                }
597
597
 
599
599
                        v4 = vertpa[mf->v4];
600
600
 
601
601
                        if (v3 != v4) {
602
 
                                BLI_edgehash_insert(edgehash, mf->v3, mf->v4, NULL);
 
602
                                BLI_edgehash_reinsert(edgehash, mf->v3, mf->v4, NULL);
603
603
                                (*fs) |= 4;
604
604
                        }
605
605
 
606
606
                        if (v1 != v4) {
607
 
                                BLI_edgehash_insert(edgehash, mf->v1, mf->v4, NULL);
 
607
                                BLI_edgehash_reinsert(edgehash, mf->v1, mf->v4, NULL);
608
608
                                (*fs) |= 8;
609
609
                        }
610
610
 
611
611
                        /* mark center vertex as a fake edge split */
612
612
                        if (*fs == 15)
613
 
                                BLI_edgehash_insert(edgehash, mf->v1, mf->v3, NULL);
 
613
                                BLI_edgehash_reinsert(edgehash, mf->v1, mf->v3, NULL);
614
614
                }
615
615
                else {
616
616
                        (*fs) |= 16; /* mark face as tri */
617
617
 
618
618
                        if (v1 != v3) {
619
 
                                BLI_edgehash_insert(edgehash, mf->v1, mf->v3, NULL);
 
619
                                BLI_edgehash_reinsert(edgehash, mf->v1, mf->v3, NULL);
620
620
                                (*fs) |= 4;
621
621
                        }
622
622
                }
821
821
        cfra = BKE_scene_frame_get(scene);
822
822
 
823
823
        /* hash table for vertice <-> particle relations */
824
 
        vertpahash = BLI_edgehash_new();
 
824
        vertpahash = BLI_edgehash_new(__func__);
825
825
 
826
826
        for (i = 0; i < totface; i++) {
827
827
                if (facepa[i] != totpart) {
846
846
                mf = &mface[i];
847
847
 
848
848
                /* set face vertices to exist in particle group */
849
 
                BLI_edgehash_insert(vertpahash, mf->v1, mindex, NULL);
850
 
                BLI_edgehash_insert(vertpahash, mf->v2, mindex, NULL);
851
 
                BLI_edgehash_insert(vertpahash, mf->v3, mindex, NULL);
 
849
                BLI_edgehash_reinsert(vertpahash, mf->v1, mindex, NULL);
 
850
                BLI_edgehash_reinsert(vertpahash, mf->v2, mindex, NULL);
 
851
                BLI_edgehash_reinsert(vertpahash, mf->v3, mindex, NULL);
852
852
                if (mf->v4)
853
 
                        BLI_edgehash_insert(vertpahash, mf->v4, mindex, NULL);
 
853
                        BLI_edgehash_reinsert(vertpahash, mf->v4, mindex, NULL);
854
854
        }
855
855
 
856
856
        /* make new vertice indexes & count total vertices after duplication */
869
869
        /* getting back to object space */
870
870
        invert_m4_m4(imat, ob->obmat);
871
871
 
872
 
        psmd->psys->lattice = psys_get_lattice(&sim);
 
872
        psmd->psys->lattice_deform_data = psys_create_lattice_deform_data(&sim);
873
873
 
874
874
        /* duplicate & displace vertices */
875
875
        ehi = BLI_edgehashIterator_new(vertpahash);
973
973
        CDDM_tessfaces_to_faces(explode);
974
974
        explode->dirty |= DM_DIRTY_NORMALS;
975
975
 
976
 
        if (psmd->psys->lattice) {
977
 
                end_latt_deform(psmd->psys->lattice);
978
 
                psmd->psys->lattice = NULL;
 
976
        if (psmd->psys->lattice_deform_data) {
 
977
                end_latt_deform(psmd->psys->lattice_deform_data);
 
978
                psmd->psys->lattice_deform_data = NULL;
979
979
        }
980
980
 
981
981
        return explode;