How Blitz knows what Milkshape groups to texture?

Blitz3D Forums/Blitz3D Programming/How Blitz knows what Milkshape groups to texture?

gameproducer(Posted 2007) [#1]
I have a tiny problem with texturing. In Milkshape it's possible to have ONE mesh and then several GROUPS. You can assign different textures to each group, and when Blitz loads (and uwmap etc. stuff is set) somehow it magically knows what texture goes where when you simply load the model. Like if you have group for "feet_texture" and "head_texture" it automagically loads the corrent "feet.jpg" and "head.jpg"... but the moment you try to EntityTexture(model, "feet.jpg") it will apply the feet texture to the WHOLE model.

If I want to change the texture - it won't happen. Since there's only one mesh, I cannot use FindChild to find the meshes, and FindChild does not find texture groups.

So - is it possible to change the texture? There must be some way how Blitz3D knows where to put textures.

Any help?


Ricky Smith(Posted 2007) [#2]
Blitz3d tranlates 'smoothing groups' to 'surfaces' - each surface can have a different texture. EntityTexture() does not take surfaces into account and will draw the texture over the whole mesh. You need to use PaintSurface() to texture individual surfaces.


DQ(Posted 2007) [#3]
maybe examine the ms3d ascii file to figure out how its applying the textures?


gameproducer(Posted 2007) [#4]
PaintSurface... hmm... I saw only one surface there?


gameproducer(Posted 2007) [#5]
---
"Blitz3d tranlates 'smoothing groups' to 'surfaces' - each surface can have a different texture. EntityTexture() does not take surfaces into account and will draw the texture over the whole mesh. You need to use PaintSurface() to texture individual surfaces."
---
I used countsurfaces, but there's only one surface (the whole character mesh, that includes groups)

ascii code reveals stuff like this (it seems there are 5 meshes... but I use .b3d export from Milkshape, so I presume those meshes are lost in the export?)


Meshes: 5
"feet_texture" 0 0
110
0 0.089024 0.406908 -0.041649 0.790132 0.100953 26
0 0.100677 0.418524 -0.018342 0.790076 0.054462 26
0 0.174636 0.418524 -0.066427 0.648314 0.054462 26
0 0.080439 0.418524 0.095656 0.897981 0.057784 26

Materials: 5
"feet_texture"
0.200000 0.200000 0.200000 1.000000
0.800000 0.800000 0.800000 1.000000
0.000000 0.000000 0.000000 1.000000
0.000000 0.000000 0.000000 1.000000
0.000000
1.000000
".\base.feet.human.jpg"


gameproducer(Posted 2007) [#6]
I exported to .3ds format and there it has 5 children (too bad the bone animations are lost, so I cannot use that info either). I suppose in .b3d export process, the meshes just vanish somewhere... and then it's some sort of in-build system that loads the textures correctly - but doesn't allow them to be changed (not with paintSurface or entityTexture)

It looks like the current Milkshape .b3d exporter simply doesn't simply know how to keep groups as separate surfaces (yet it is a mystery how blitz knows how to texture them properly when one simply loads .b3d file without using entitytexture)


gameproducer(Posted 2007) [#7]
WOOHOO - Accidently found a solution! :)

I realised that I need to first load the .b3d file so that it's located in the same directory where the default textures are also located. After that I can see 5 surfaces, and use PaintSurface to change parts of the model.

Thanks for the help Ricky & DQ