Yes it does. Every time you use GetBrushTexture and GetEntityBrush etc, it creates new brushes/textures. You need to do it like this:
surface=getsurface(mesh,1)
brush=getsurfacebrush(surface)
tex=getbrushtexture(brush)
print "texture name:"+texturename$(tex)
freetexture tex
freebrush brush
however, DON'T free the surface. :) GetSurfaceBrush and GetBrushTexture are funny commands that - rather than get the virtual handle of the brush/texture - create a new copy of the brush/texture for painting/texturing elsewhere.
|