entityname blank no matter what i do :(

Blitz3D Forums/Blitz3D Programming/entityname blank no matter what i do :(

ryan scott(Posted 2004) [#1]
i'm trying to read entityname from loaded objects. i've tried creating objects in milkshape, and in gamespace, and saving as .x and .b3d and whatever else, but i can never get the entityname$ from them.

am i doing something horribly wrong?

; should be simple, right?
xz=LoadMesh( "gfx\levels\testname.b3d" )
DebugLog "name:"+EntityName$(xz)


http://www.runinteractive.com/blitz/testname.b3d has the object. it's just a box. i made it in milkshape, named the group 'test' or something, and saved it as b3d. it load fine, but entityname$ is blank.

this happens with every object i try to load - ones i create, ones i do not create.

if i do this:

nameentity(xz,"testname")
print entityname$(xz)
it outputs 'testname'

so, that works fine. something is going on with loadmesh - is this the right way to load objects?

if i use LoadAnimMesh (It is not animated), I get ROOT. 0 Children. Or if saved from gameSpace, I get 'Set', 0 children. These are either single objects, or multiple objects (with multiple names), grouped together by selecting them, and saving the whole thing as an object.

i'm desperate over here :(

i can't really do much without seeing the names of the objects.

:((


Shambler(Posted 2004) [#2]
Loadmesh does not name the loaded entity, you must do that manually.


poopla(Posted 2004) [#3]
With NameEntity(Entity%, Name$)


AntonyWells(Posted 2004) [#4]
LoadAnimMesh does name entities, just do that and then use this to find the entity.

 Function FindChild2(entity,name$)
	If Lower(EntityName(entity))=Lower(name)
	     Return entity
      EndIf
	For c=1 To CountChildren(entity)
		rid=findChild2( GetChild(entity,c),name)
		If rid>0 Return rid
	Next
End Function



ryan scott(Posted 2004) [#5]
well that's the problem i'm having.

it says the entity is named ROOT or Set, depending on what program I save it with. And it is saying 0 children.

I'm not exactly sure what i'm doing wrong. If I put 2 objects in milkshape, how do i create a child/parent relationship? aren't they simply both children of ROOT? I name them, but as I said, when I save and read in Blitz, I get only ROOT, 0 children. i can't pick out those objects.

is any way you can look at the objects linked above and see if you can see the individual entities in them, maybe you can tell me what i did wrong.

or, does someone have an object with children i can have? i will try to read its children but also see how it is set up in a 3d program so that i might be able to see how i'm going wrong. i'm pretty sure i'm going wrong with how i save it, or something.


ryan scott(Posted 2004) [#6]
figured it out.

gamespace doesn't like b3d format. milkshape doesn't like it either. neither of them output the names of the children.

.x format works fine.

do YOU use the b3d format for your objects or something else?


Ross C(Posted 2004) [#7]
Milkshape doesn't export group names unfortunely. You can set the names of the groups though in another program like Ultimate Unwrap :o)


ryan scott(Posted 2004) [#8]
looks like gamespace doesn't either. which is crap since they are advertising that is exports b3d format. But if the names go away, its close to useless. if we didn't have .x format i'd be sol.


jhocking(Posted 2004) [#9]
Just because a tool can export to b3d file format doesn't mean that the export supports all features of b3d file format. You're learning the hard way that just reading a product's feature list is far from assuring you the product can do what you need.


jfk EO-11110(Posted 2004) [#10]
I use CharacterFX to export animated B3D, you may be able to use it to simply convert static meshes to B3d, tho I don't know for sure if you will be able to get the names of MESH-Children, but I know you CAN get the names of bones of a skeleton.


Eric(Posted 2004) [#11]
Ryan,

Try using LoadAnimMesh...

and

EntityName$(GetChild('Your Object's Handle',1))

Even if you only have one object, Truespace makes that object a child of the scene.

Regards,
Eric

Oh yeah, You will have to parse the Text, because Truespace puts "Frame.." Before the Name, I don't know why or how to get rid of it, but you can do that in code.


ryan scott(Posted 2004) [#12]
Eric, I saved it as .x format (that's correct, right? b3d format didn't work). I did not have to parse any text. Maybe because I have no animation frames, i don't know.

one interesting/bad thing about animmesh is that you cannot subsequently ScaleMesh or ScaleEntity on it. So, I have to read all the elements, scale them up, and move them to the right position. It's only 2 lines of code, but seems Wrong in my book. I don't know why ScaleMesh or ScaleEntity would not work on it.

Anyway, I had to loop through to pick out certain items, so it isn't that big of a deal.

I feel like I have finally turned a corner with this. Whoever said figuring all this undocumented nonsense was part of the fun was wrong.


mearrin69(Posted 2004) [#13]
Ryan,
Heya, tried to e-mail you but it bounced. I was able to export your level from gameSpace using the Greenbriar Level Editor. I have responded to your post on the gameSPace forums with an attachment. Please go check it out and see if it works for you.

Send me another e-mail when you get a chance and we can work through the issue - I think it is solvable.
M