[Bf-funboard] Hard Delete

Campbell Barton cbarton at metavr.com
Tue Oct 10 10:40:12 CEST 2006


Heres global delete added to editobject.c line 253
It also happens t oremove objects from groups too ;)


void delete_obj(int ok)
{
    Base *base;
    int islamp= 0;
   
   
    if(G.obedit) return;
    if(G.scene->id.lib) return;
   
    base= FIRSTBASE;
    while(base) {
        Base *nbase= base->next;

        if TESTBASE(base) {
            if(ok==0) {
                ok=pupmenu("Erase Selected Object(s)?%t|From 
Scene%x1|Globally%x2");
                if (ok==-1) return;
            }
           
            if(base->object->type==OB_LAMP) islamp= 1;
#ifdef WITH_VERSE
            if(base->object->vnode) b_verse_delete_object(base->object);
#endif
            if (ok==2) {
                Scene *scene; /* used for global delete */
                Base *base_other;
                for (scene= G.main->scene.first; scene; scene= 
scene->id.next) {
                    if (scene != G.scene) {
                        base_other= object_in_scene( base->object, scene );
                        if (base_other) {
                            if (base_other == scene->basact) 
scene->basact= NULL;    /* in case the object was active */
                            free_and_unlink_base_from_scene( scene, 
base_other );
                        }
                    }
                }
            }
           
            /* remove from current scene only */
            free_and_unlink_base(base);
        }
       
        base= nbase;
    }
    countall();

    G.f &= ~(G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT);
    setcursor_space(SPACE_VIEW3D, CURSOR_STD);
   
    if(islamp && G.vd->drawtype==OB_SHADED) reshadeall_displist();

    redraw_test_buttons(OBACT);
    allqueue(REDRAWVIEW3D, 0);
    allqueue (REDRAWACTION, 0);
    allqueue(REDRAWIPO, 0);
    allqueue(REDRAWDATASELECT, 0);
    allspace(OOPS_TEST, 0);
    allqueue(REDRAWOOPS, 0);
    allqueue(REDRAWACTION, 0);
    allqueue(REDRAWNLA, 0);
   
    DAG_scene_sort(G.scene);

    BIF_undo_push("Delete object(s)");
}



Campbell Barton wrote:
> Karim Nassar wrote:
>>>
>>> What would you call it? - I was thinking about the linux filesystem- 
>>> soft-link and hard-link
>>> But I dont mind- just the functionality would be good.
>>
>>
>>
>> How about "Global Delete," "Universal Delete," or "Delete All 
>> Instances."
>>
>> --Karim 
> "Global Delete" sounds fine.
>
> The other day I had a problem where I deleted an object before 
> removing it from a group.
> This is realy annoying because I cant work out how to get the objet 
> out of the group since you cant access it from any scene and theres no 
> way to add it back nito a scene so as to remove it from the group 
> (Short of python)
>
> Matt, about a 'Trash' - what if arrange my size in the databrowser 
> arranged by user count? - could be done in the Outliner also
> _______________________________________________
> Bf-funboard mailing list
> Bf-funboard at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-funboard
>


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241


More information about the Bf-funboard mailing list