Reading a mesh's textures?

Blitz3D Forums/Blitz3D Programming/Reading a mesh's textures?

Guy Fawkes(Posted 2012) [#1]
Hi all, just as the question asks, is there a Codebase code that can read through a mesh, and acquire the names of each texture if the mesh has any?


Thanks to all who help! :)


Spike314(Posted 2012) [#2]
M=LoadMesh(YOURMESH)

For S=1 To CountSurfaces(M)
	Surf = GetSurface(M,S)
	Brush = GetSurfaceBrush(Surf)
	Tex = GetBrushTexture(Brush)
	DebugLog TextureName(Tex)
Next




Yasha(Posted 2012) [#3]
Remember to free brushes obtained with GetSurfaceBrush!


Guy Fawkes(Posted 2012) [#4]
Thanks ALOT, Spike & Yasha! :)