Extracting children?

Blitz3D Forums/Blitz3D Programming/Extracting children?

Jeremy Alessi(Posted 2003) [#1]
Ok, now I'm on to something even better! If we export an animated entity from 3DS Max (which works to solve my other problem of getting local coords, which should speed up the shadows system), does anyone know if it's possible to extract the children to be seperate entities. Basically, it would be really cool if my artist could build the levels in 3DS Max and then Blitz just break down the one animesh into all the smaller parts and each of them have their own properties. I'm working on it right now, but any help would be appreciated.


Jeremy Alessi(Posted 2003) [#2]
I can copy children entities, but I only get a new mesh if I copy the whole entity not just the children. I can also use copy mesh on the whole entity, but not the children. Perhaps if it was saved from max in a different way I could copy mesh on the children or get a mesh when I use copy entity on the children.

Right now we are just exporting the object as animation with the pivot at the center of the entity, not the world. This is allowing me to get the correct local coords and indeed world coords. Apparently, in Unwrap which we use to export to .b3d there is a bone at the origin. Does anyone know if it would be better to actually place a parent mesh or another bone instead of whatever max does upon export as animesh?

By the way I tried EntityParent(GetChild(parent,i),0) and it doesn't take the mesh/child away from the parent entity.


jhocking(Posted 2003) [#3]
Ah, I didn't realize you were converting via Ultimate Unwrap. One thing Ultimate Unwrap doesn't support (and which I've asked Brad about before) is pivot points. Objects saved from Ultimate Unwrap have their pivots (ie. local coordinates) set to 0,0,0. When I talked with Brad it didn't sound like he was going to implement support for pivot points but if a couple of us petition him he may change his mind.

Meanwhile, that the code snippet you posted doesn't work is probably because of incorrect syntax. EntityParent doesn't take parentheses for its parameters; you should be writing
EntityParent GetChild(parent,i),0



Michael Reitzenstein(Posted 2003) [#4]
Parenthesis are optional and inclusion will have no effect where the function does not return a value.


jhocking(Posted 2003) [#5]
In that case the problem must be the variables used because that code should make child numbered "i" of entity "parent" a child of the scene.


Jeremy Alessi(Posted 2003) [#6]
EntityParent is not the problem. The problem I think now is that you cannot export multiple meshes in a boned hierarchy from Unwrap. I'm not even sure if .b3d format supports it. I think the old .X format supports it but I'm not sure it supports other things we use. I'll be checking into it.

What I want is to have a central bone/pivot with all the level objects being seperate children of the main bone. Each of them can be bones with a mesh attached. If there's a way to retain each mesh as an individual then we could load a .b3d file and turn all of it's children into seperate objects allowing the whole level to be built in 3DS Max and exported as one object but turned into many objects in Blitz for shadow/culling purposes.

I have a good work around idea but it's much more work for my artist. I would like to streamline his art path.


Jeremy Alessi(Posted 2003) [#7]
I've tested to try and extract just the mesh attached to a bone and to extract the whole bone as a child.

main bone -> bone(Mesh)

The problem seems to be that the mesh isn't ever a child of the second bone. The mesh always goes with the main entity. So with .b3d you cannont extract a mesh attached to a child bone which is what I want to do. Some test on the .X format may prove useful, but then you lose many features of .b3d.

Does anyone know if it would be possible for the .b3d to support the mesh deformation and also a frame hierachy where you can have many meshes in the 3D model each of which could be extracted as individuals with their own coordinates(which happens currently if you export from max as animated a bone is added at the origin and you can retrieve the correct coords).


jhocking(Posted 2003) [#8]
I refer you to my statement, "When I talked with Brad it didn't sound like he was going to implement support for pivot points but if a couple of us petition him he may change his mind." Tell your artist to mention pivot point support to Brad and I will too; maybe he'll decide to do it when he sees that multiple people are asking for it.

I think the b3d file format already supports everything you are talking about, the limitation is in the tools for creating b3d files.


Jeremy Alessi(Posted 2003) [#9]
OK, cool. If the only thing missing is pivot points then it sounds good. When you export from Unwrap it asks if you want to export as multimesh or single mesh. However, you can't do multimesh with bones. I assume this would be fixed with the pivot points? We'll ask him about it though. He's been really cool so far.


jhocking(Posted 2003) [#10]
Actually pivot point support has nothing to do with multiple meshes and bones. From your earlier thread I imagine you would no longer need bones for your level if pivot points are supported. Without support for pivot points the local coordinates of objects are set to global 0,0,0 when the scene is exported which, as I understand it, is why you are using bones. With support for pivot points the local coordinates of objects would be preserved as set in 3D Studio Max.

The reason pivot points aren't supported right now is because of the fundamental "mindset" Ultimate Unwrap takes with scenes. Instead of lots of separate objects (and logically each object would have it's own pivot point/local coordinates) scenes are understood as a polygon soup with various polygons grouped together. What Brad needs to/should do is support pivot points for Groups, with the pivot of new groups defaulting to the global 0,0,0.


Jeremy Alessi(Posted 2003) [#11]
That would work great. Then we could export a multimesh scene with no bones, just each object having it's own pivot point. Thus, I could run through that model and shadow certain children or make certain chilren pickable and indeed the children could be culled away when not in front of the camera even if another part of the scene was?

Originally, all I wanted was for the shadows to run fast. Although, I have a solution before all scenery from max was postioned at 0,0,0 making it impossible to cull away vast numbers of polygons with range checks for shadows (probably collisions and picks too). I need a quick method though that allows quick culling and quick export from Max. Anyway like I said I've got a better system now, but the pivots would rock especially if each part of the model could be treated like a seperate mesh.