HOW do you remove a texture?!?

Blitz3D Forums/Blitz3D Beginners Area/HOW do you remove a texture?!?

Danny(Posted 2007) [#1]
HOW do you remove a texture from an entity that you've applied with EntityTexture() ?!

I (obviously) never worked much with textures in Blitz, but always assumed that FreeTexture() would not only purge the image from memory but also from the entity itself. Which obivously ain't true. The image is purged, but the texture remains stuck to the entity.

I've got a (textured) 3ds model, to which I manually apply a 2nd texture (a spherical environment map to add fake reflection). So I can't rebuild the object's texturing from scratch...

And since I'm working on an editor, I want to be able to REMOVE that texture, replace it with a different one - or use different blend settings on it, check it out, OR decide to remove it completely, etc.

any ideas?! It must be something simple I'm missing here...

D.


H&K(Posted 2007) [#2]
can you not just add a new texture to that texture layer?


OJay(Posted 2007) [#3]
or try to add an empty brush:
Paintmesh mesh, CreateBrush()



sswift(Posted 2007) [#4]
You can't remove a texture. You can put a new one on there, but once you texture an object you can never remove the texture from that texture channel.


Danny(Posted 2007) [#5]
@H&K: Sure, adding a new texture to that layer will replace the previous one. But I'm trying to remove that 2nd texture, so that I have 'restored' the model's original look.

@OJay, using PaintMesh would destroy the model's original texture as well, wouldn't it?!

Perhaps the solution is a combination of both your suggestions?! Be it: replacing the 2nd texture with an 'empty' (black) texture?! So it's just invisible..

I'll try that out, thanks. But I would still be seriously disappointed if there's no way in blitz to remove a texture?! [disappointed, but not surprised :/]

Thanks!


jfk EO-11110(Posted 2007) [#6]
There is a trick, that is, to say the least, totally unprofessional and everything else but clean :o)

Unfortunately you cannot use zero as a texture handle to remove a texture from a brush (eg. BrushTexture mybrush,0 )
BUT you can use an invalid texture handle:

let's assume tex1 is an existing texture

BrushTexture brush,tex1
PaintMesh mesh,brush

Now it's textured as usual. Now here comes the dirty bit:

FreeTexture tex1
BrushTexture brush,tex1
PaintMesh mesh,brush

Et voila, the texture is removed. Tho, I have no idea if this works on all machines, or what troubles it's gonna cause.

BTW instead of PaintMesh you maybe better use PaintSurface.


Danny(Posted 2007) [#7]
ok Thanks Switft & Jfk...

Since it's to be used whilst EDITING the game I will defenitly try your suggestion Jfk..


Boiled Sweets(Posted 2007) [#8]
I had a similar problem. To get round I free the entity then copy entity an original one held in memory.


Danny(Posted 2007) [#9]
Yes boiled sweets, I was thinking the same thing as well.

I also just realised you can use '0' for textureblend - meaning 'no blend' which makes the texture disappear completely!!!
If this is just a 'visual trick' or if Blitz actually 'removes' any existing texture on that layer will remain a mystery to me.

D.