Fixed the delete texture button for sculptmode textures

This commit is contained in:
Nicholas Bishop 2006-11-17 04:47:39 +00:00
parent 8768707610
commit c8ca36a9c8
2 changed files with 8 additions and 3 deletions

View File

@ -164,6 +164,7 @@
#include "BDR_editobject.h"
#include "BDR_editcurve.h"
#include "BDR_editmball.h"
#include "BDR_sculptmode.h"
#include "BPY_extern.h"
#include "BPY_menus.h"
@ -804,7 +805,10 @@ void do_global_buttons(unsigned short event)
}
else { /* from brush */
br= G.scene->toolsettings->imapaint.brush;
if(br) {
if(G.f & G_SCULPTMODE) {
sculptmode_rem_tex(NULL, NULL);
allqueue(REDRAWBUTSSHADING, 0);
} else if(br) {
mtex= br->mtex[ br->texact ];
if(mtex) {
if(mtex->tex) mtex->tex->id.us--;

View File

@ -505,8 +505,9 @@ void sculptmode_rem_tex(void *junk0,void *junk1)
{
MTex *mtex= G.scene->sculptdata.mtex[G.scene->sculptdata.texact];
if(mtex) {
mtex->tex->id.us--;
G.scene->sculptdata.mtex[G.scene->sculptdata.texact]= 0;
if(mtex->tex) mtex->tex->id.us--;
MEM_freeN(mtex);
G.scene->sculptdata.mtex[G.scene->sculptdata.texact]= NULL;
BIF_undo_push("Unlink brush texture");
allqueue(REDRAWBUTSEDIT, 0);
allqueue(REDRAWOOPS, 0);