How do I get the Texture File name From a 3Dformat
BlitzMax Forums/BlitzMax Beginners Area/How do I get the Texture File name From a 3Dformat
| ||
Lets say B3d or 3ds does the file include the names of the textures. (im guess it does) so how can i extract it from the B3d,Fbx,3ds file? thanks |
| ||
You need to refer to the format's specification. If you google "[format name] specification" you'll find the material. |
| ||
You can find file format descriptions for a ton of filetypes here: http://www.wotsit.org |
| ||
3ds format will only store the 8.3 trimmed version of texture names. Any files which use a texture name more than 8 characters long or a suffix longer than 3 characters long will be broken. I'd use B3D if I were you. The specs for that are here: http://www.blitzbasic.com/sdkspecs/sdkspecs/b3dfile_specs.txt |
| ||
My favorites are fbx and b3d. I thought there may be a module for that.. If not ill have to know how to read it from a data file |
| ||
It really depends what you're using as a renderer. BlitzMax is just a language and has no official 3D module beyond the meager and deprecated Max3D. FBX is a widely supported format and covers pretty much everything you might need for games, so I'm sure it's well supported in 3D engines. What are you doing? Since you haven't mentioned a 3D module, I'm guessing you're rolling your own in OpenGL? |
| ||
here is what i was looking for.. pretty simple when you know it.Function GetAllMeshTextures:TList(MESH) Local SURFACE, BRUSH, TEXTURE, TexCntr Global TexturesList:TList TexturesList = CreateList() For SURFACE = 0 To xCountSurfaces(MESH) - 1 SURFACE = xGetSurface(MESH, 0) BRUSH = xGetSurfaceBrush(SURFACE) Repeat TEXTURE = xGetBrushTexture(BRUSH, TexCntr) If TEXTURE > 0 Then If CheckIfExsists(xTextureName(TEXTURE)) = False Then ListAddLast(TexturesList, StripDir(xTextureName(TEXTURE))) End If End If TexCntr = TexCntr + 1 Until TEXTURE = 0 Next Function CheckIfExsists(name:String) Local TName:String For TName = EachIn TexturesList if TName=name Then Return True Next End Function return TexturesList End Function |