How to determine a Surfaces Texture(s)?

Blitz3D Forums/Blitz3D Programming/How to determine a Surfaces Texture(s)?

jfk EO-11110(Posted 2003) [#1]
I have a handy .B3D Save Function, but if I used to load the model, then I cannot figure what textures are used by every Surface. Some time ago I wrote a workaround and posted it in the Code Archives (GetTextures()), but that one was really a complicated way to do it and probably not that stabile a.s.o.

There must be an easier way, I mean, Quill3D can import Meshes too, so there must be an adequate Way to determine what Texture Files are used by the Surfaces of a mesh. I really hope I only missed this. There must be something like:

n=countsurfaces(mesh)
for i=1 to n
s=getsurface(mesh,s)
t$=GetTexture$(mesh,s,index) ; or something
print t$
next

Can somebody help me with this or do I have to accept that the B3D Format is a halfbaked Thing for Blitz and the average Blitz-User as it seems to me right now? I guess it wouldn't be an impossible thing to get a surfaces Texture Path since Blitz used to load that Texture anyway.

Thanks for your Help!

EDIT: ok, I have just found Halos B3D Loader n the Code-Archives. This could solve the Problem, thanks a lot Halo.

Don't hesitate to answer if you know a solution for LoadMesh()-loaded Meshes.


Bot Builder(Posted 2003) [#2]
Sorry. I don't have a solution, but Terabit had a similar problem with Decorator. He wanted to be able to know the texture used to lightmap, but I surpose this went un-solved as you have to tell decorator the lightmap.

If halo's loader works out, tell me. I always wanted to have my charachters interact with different textures in different ways, but didn't want to put to much into it. "PickedTexture" function would be absolutly fab.......


Steve Hill(Posted 2003) [#3]
Perhaps this should be a feature request. I hit the same problem with my attempt at something similar to Decorator (as a learning exercise).

If you load a mesh by hand, you can find out what the textures are, but you then have to keep track of any changes to the mesh within your app.

Unless someone knows better ...

Steve.


jfk EO-11110(Posted 2003) [#4]
This is a well known wish. I think Halos Loader is ok for our Purposes. But it would be nice to be able to use LoadMesh(), have Access to the Texturepaths used by the surfaces (or their brushes) and then save the Mesh as B3D.

Thanks anyway.


TeraBit(Posted 2003) [#5]
Decorator parses the B3D file at the moment (hence you no longer need to specify the lightmap), but GetTexture() and its companions shouldn't be long in coming and sort out this problem.


DrakeX(Posted 2003) [#6]
it would be great to get the texture of a surface, or better yet, a brush for it (and a way to get the texture of a brush). what annoys me about B3D is that there are several functions to set properties of things -- but none to get them.


Steve Hill(Posted 2003) [#7]
I second that!

Any settable attribute ought to be gettable, otherwise application code ends up mirroring information (possibly incorrectly) that is already known to the Blitz run-time.

Steve.


Gabriel(Posted 2003) [#8]
Any settable attribute ought to be gettable


Yes indeed.

Roll on BlitzMax and it's OOP.

This would be nice :

mesh\brush=LoadBrush("blah.jpg")
getbrush=mesh\brush



Steve Hill(Posted 2003) [#9]
Roll on BlitzMax and it's OOP.


Properly encapsulated it could look something like this:

mesh\Paint(LoadBrush("blah.jpg")
brush = mesh\GetBrush() 


That would be nice too! I'm getting OT again.

Steve.

(Just discovered how to work the forum codes, so the above will either look nice or I'll have made a complete prat of myself.)


DrakeX(Posted 2003) [#10]
ooh ooh! and have stuff like

brush1.Brush=LoadBrush("c:\blitz3d\texture.bmp",255,128,128)
sfc=player\CreateSurface()
sfc\brush=brush1

interesting. what also would be SERIOUSLY nice would be the ability to access the internal blitz definitions of internal TYPEs, like Mesh and Brush, so we can add our own parameters to the existing types. we could store other information in them.. like pointers to other entities, or more strings, or whatever! though i don't know if that'd be a good thing... messing with the internals nd all. or maybe it could be implemented like so:

AddField Mesh,text1$,text2$

now when you made a Mesh, you could then access text1$ and text2$ as if they were a standard part of the Mesh type. this way you could also customize the internal types for each project, which would be much better than changing the types for all the projects..


Rob(Posted 2003) [#11]
The Amiga Blitz allowed this messing around with internal types. I can only hope Blitz3D will one day, but I think we're talkin' BlitzMax!


Steve Hill(Posted 2003) [#12]
Don't know how well known this is, but I stumbled on the code archive from Rob (Code archives/Algorithms/Object and Handle with Entities).

This lets you decorate an entity with anything you like! NameEntity and EntityName don't seem very fussy.

Thanks Rob!

Steve.


poopla(Posted 2003) [#13]
Has mark ever given a decent reason of why it cannot be done? Or why he hasn't implemented it? As a paying customer this is one tool in the language I need. Everyone needs it, so I hope this gets sorted soon. It seems illogical to be working on maplet etc when so many baseline features go untouched, or at least unmentioned. If he has said he is implementing it soon, slap me and Ill go home happy.


poopla(Posted 2003) [#14]
Don't let this die, I need this atm as well :(.


jfk EO-11110(Posted 2003) [#15]
I guess it will be one of the reasons to buy BlitzMAX :)