Problem with Gile[s] exporting shapes.. HELP!

Blitz3D Forums/Blitz3D Programming/Problem with Gile[s] exporting shapes.. HELP!

Pinete(Posted 2005) [#1]
Hi all,
I'm creating a map with some splines in order to read the
vertex to construct some AI paths in the game.

I'm using B3D pipeline to export the .B3D model of the map
and I'm following the instructions of the exporter in order
to export shapes.

Then, I read this shapes and its vertex and create cubes in
each one of these vertex...

Till here all seems to go well..

The problems comes when I use Gile[s] beetween the modeller
and the blitz, to create a lightmap for the terrain.

Gile[s] assume that there exist a path called AIPath01 and it shows it at the hierarchy tree at the left, but when I
export the map with the lightmap again and try to read each
vertex of IAPath01 object, it return nothing!

It seems like if Gile[s] delete the surface of a object that
doesn't understand or something similar..

This is the function I use to read the vertex, and it works if I don't work with Gile[s] to generate the lightmap.


------------------------------------------------------
numpaths = 0
child=GetChild(level,1) ; cuenta los hijos del nivel
For i=1 To CountChildren(child)
If Left$(EntityName(GetChild(child,i)),6)="AIPath"
DebugLog("AI Path found!")
numpaths = numpaths + 1
path.TipoPath = New TipoPath ; Cremos un nuevo path
path\ref = numpaths ; referencia para identificar el path
shape = GetChild(child,i)
temp_surf = CreateSurface(shape)
For s=1 To CountSurfaces(shape)
surf=GetSurface(shape,s)
For a=0 To CountVertices(surf)-1
VertexColor surf,a,Rnd(255),Rnd(255),Rnd(255)

path\numnodes = path\numnodes + 1
path\NodeX#[path\numnodes] = EntityX#(shape,True)+VertexX#(surf,a)
path\NodeY#[path\numnodes] = EntityY#(shape,True)+VertexY#(surf,a)
path\NodeZ#[path\numnodes] = EntityZ#(shape,True)+VertexZ#(surf,a)
path\NodeEnt[path\numnodes] = CreateCube()
DebugLog("Node Created!")
PositionEntity path\NodeEnt[path\numnodes],path\NodeX#[path\numnodes],path\NodeY#[path\numnodes]+0.1,path\NodeZ#[path\numnodes]

DebugLog("-> "+Str$(path\nodex#[path\numnodes])+", "+Str$(path\nodey#[path\numnodes])+", "+Str$(path\nodez#[path\numnodes])+", ")

If numpaths = 1 Then EntityColor path\NodeEnt[path\numnodes],0 , 0 , 255
If numpaths = 2 Then EntityColor path\NodeEnt[path\numnodes],0 , 255 , 255
If numpaths = 3 Then EntityColor path\NodeEnt[path\numnodes],255 , 0 , 255
EntityAlpha path\NodeEnt[path\numnodes],1.0
Next
Next
ClearSurface(temp_surf)
;FreeEntity (shape)
;DebugLog("vertices en el path..."+Str$(CountVertices(surf)-1))
EndIf

Next

------------------------------------------------------

Please, someone knows how could I do to solve this
problem???

Thanks in advance!


Pinete(Posted 2005) [#2]
I forget one thing...

The lines

temp_sufr = createsurface(shape)
....
....
clearsurface temp_surf

has been introduced in a desesperately way trying
to solve something.. but they can be deleted because
it seems they aren't doing anything positive..

Thanks again


fredborg(Posted 2005) [#3]
Hi,

Yep, gile[s] deletes isolated vertices, so your path points will disappear.

I believe you can export a path as a mesh (with polygons) from b3d pipeline. That might help you?

Otherwise you could add a number of cubes in 3dsmax, and place them along the path. I don't remember what the function is called in 3dsmax...snapshot or array or something like that.


Pinete(Posted 2005) [#4]
Thanks a lot Fredborg,

I've tried before to export the sape as "rendereable"
in order to be accepted by Gile[s],
and read the vertexs in groups of four (step 4)
assuming that the path has the minimum sides allowed (3),
but again I meet another problem!

When I load the map from Blitz and after be lightmapped in
Gile[s], (exported as rendereable object from the modeller) the shape appears like an object with more vertex than normal...

In the modeller the shape has 126 vertex and from blitz
with the funcion "countvertices", it says 270!

Do you have any idea about the process that Gile[s] is following when reading the exported shape ?

Really, the steps are:
a) make a shape
b) Set as rendereable (give volume)
c) reduce sides to three (3)
d) export the map with B3D PipeLine (last version)
e) Import from Gile[s] v1.36
f) Render and make the lightmap
g) Delete -Scene Root- created by gile because the
scene has previously its own Scene root
h) export again as B3D

It's like gile[s] invented more vertex!
and even reading them in "rendereable" form and in groups
of four, it create the various cubes those shouldn't exist!

The problem making the cubes from the modeller is the order
of the created cubes, I guess, or snapshot or array assign
a order number within the name??
However making it at that way it is a must to order the objects after read them...

If you have some idea about the reason the vertices seems to be duplicated I would be very pleasant if you share!

Thanks in advance!


fredborg(Posted 2005) [#5]
Hi,

If you disable lightmapping for the shape (ie. set it's material to 'No Lighting' in 'Lighting Method') it should stay the same. But, maybe it's better to simply import the shape seperately in Blitz3D?

Ie. do this:
1: Hide everything but the shape.
2: Export a b3d from 3dsmax, this will contain only the shape.
3: Show everything but the shape.
4: Export the scene from 3dsmax and lightmap it in gile[s].
5: Load both the first and the second scene.

That should work.


Naughty Alien(Posted 2005) [#6]
..export it from 3DSMAX as .3DS file, appart from rest of the your geometry and it will work..


Pinete(Posted 2006) [#7]
Thanks to all!
I will go for that.
:)

Thanks again!