I haven't tested this so much but until now
the function is working good,
1- First, create a new folder to save all
your .dds textures.
2- Convert any texture to dds and save it
into the folder USING THE SAME TEXTURE NAME but
with .dds extension of course.
3- Paste my code anywhere but be sure it is
scanned before your main loop so that
the Global variable gets the correct value.
Add the correct value to the Global, this is the
path to your dds folder (for example ".\DDS\")
4-Now, use the LOAD_DDS(mesh) for each
mesh you want to replace the textures, the function only works
for single meshes, not for childs, if you have an animated mesh
you will have to use the function with each child.
Basically the function search for a texture with the same name
into the dds's folder, and if found, the texture's brush is changed so
that it uses the dds texture.
Paolo.
the function is working good,
1- First, create a new folder to save all
your .dds textures.
2- Convert any texture to dds and save it
into the folder USING THE SAME TEXTURE NAME but
with .dds extension of course.
3- Paste my code anywhere but be sure it is
scanned before your main loop so that
the Global variable gets the correct value.
Add the correct value to the Global, this is the
path to your dds folder (for example ".\DDS\")
4-Now, use the LOAD_DDS(mesh) for each
mesh you want to replace the textures, the function only works
for single meshes, not for childs, if you have an animated mesh
you will have to use the function with each child.
Basically the function search for a texture with the same name
into the dds's folder, and if found, the texture's brush is changed so
that it uses the dds texture.
;_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \/ Global dds_folder_path$=".\DDS" ;-> for example: ".\dds" Function LOAD_DDS(mesh,flags_for_dds=1) Local c%=0 Local s%=0 Local br%=0 Local tex%=0 Local texname$="" Local ddspath$="" Local ddstex%=0 Local ss$="" Local count%=0 ;check if DDS folder path is ok: dds_folder_path=Replace(dds_folder_path,"/","") If Not Right(dds_folder_path,1)="" Then dds_folder_path=dds_folder_path+"" ;-------------- For c=1 To CountSurfaces(mesh) s=GetSurface(mesh,c) br=0 : tex=0 : ddstex=0 br=GetSurfaceBrush(s) tex=GetBrushTexture(br,0) ; -> texture index =0 texname=TextureName(tex) ;extract only texture_name from path: For count=1 To Len(texname) ss=Right(texname,count) If Left(ss,1)="" Or Left(ss,1)="/" texname=Mid(ss,2) Exit EndIf Next ;------------- texname=Left(texname,Len(texname)-3)+"dds" ddspath=dds_folder_path+texname ddstex=LoadTexture(ddspath,flags_for_dds) If ddstex>0 BrushTexture br,ddstex,0,0 ; -> texture index =0 PaintSurface s,br EndIf If br>0 Then FreeBrush br If tex>0 Then FreeTexture tex If ddstex>0 Then FreeTexture ddstex Next End Function ;_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /\
Paolo.