Help with scene max exporter (not maxsdk related). Need Ideas.

Started by
4 comments, last by HexDump 20 years, 5 months ago
Hello, I´m writting a scene max exporter. I want to build my maps, create my enemies, position them, apply paths, etc... all in max. The problem is that this is a big amount of different things, and I need some ideas on how to export properly this data. For example: I can have several entities attached (an entity is a whole object that can be made of other objects, like a human is made of head, body, arms, legs, etc...), and I want to export this entities in separated files (including the hierarchy they represent) and the relationship between them (attachings between entities) in the scene file. But this leads me to a problem, how does max know where a entity ends and the other (attached) begins in order to export two different entities?. This is one of my problems, but if anyone have any idea on how to get this working I will solve 70% of my other probs. P.D. Could XRef objects help here?. Thanks in advance, HexDump.
Advertisement
You could store a "child list" with each node. The list should contain the filenames of the children. In the children nodes, store the parent-child link parameters such as whether the node should move with it''s parent or not, for example.
At load time, recursively go through all the nodes to load the world.

X-refs work somewhat like this, there''s nothing "magical" about them.

-Nik

Niko Suni

Yes, you´re right but the problem is not that of create the tree. I will try to explain it with an example

           o Root           |           o Man [Entity]          / \      arm o   o arm left             |                           o bird [entity]            / \   left wing o   o Right wing

as you can see, here there's a man with to arms and a bird on the left arm. If you start exporting this in max, you will export the Man + bird as an whole entity because Max don´t know where the Man entity starts and where it ends, and same for the bird. How would you solve this?. When I get this working I will export entities in different files (with inner relationsips) and the realtionship between entities in the scene info file.

Hope I put it clearer.

Thanks in advance,
HexDump.

[edited by - HexDump on November 17, 2003 7:06:40 AM]

[edited by - HexDump on November 17, 2003 7:10:24 AM]

[edited by - HexDump on November 17, 2003 7:12:43 AM]

[edited by - HexDump on November 17, 2003 7:13:52 AM]

[edited by - HexDump on November 17, 2003 7:14:34 AM]

[edited by - HexDump on November 17, 2003 7:15:55 AM]
I suggest that you don't strictly link the bird to the man.

Instead, you could use keyed, weighted movement constraints on the bird to "glue" it to the man (if you really want to use Max for every single aspect of the scene).

That, or in run-time, you could link the bird manually (ie. programmatically) to the man as needed, and otherwise control it individually.

There's no right or wrong way around this, these are just suggestions. Use whatever approach feels right for the project.

kind rgds,
-Nik

EDIT:
You can always use custom attributes; for example to mark the bird different entity than the man. This is the simplest solution, but most rigid (not flexible at all).

[edited by - Nik02 on November 17, 2003 7:16:56 AM]

Niko Suni

Thanks a lot man for your suggestions. But could you explain me how could I do this: Instead, you could use keyed, weighted movement constraints on the bird to "glue" it to the man?

hehe, I don´t understand what you wanted to mean, sorry :/.


Thanks in advance,

HexDump.
I meant you could use a position/orientation constraint to move the bird node with the hand(?) node when the bird is supposed to be "attached" on the man.
Now, you can weigh the constraint lower than 1.0 if you want the bird to detach gradually from the man, or even use boolean animation key to turn off the constraint, thus setting the bird "free" from the man.

I hope you understood

-Nik

EDIT:
Procedure for setting constrains and their weights:
Select Animation->Constraints->Position Constraint (for example) while the node that you want to constraint is selected.
Then point the parent node to establish the constraint.

The node's Motion tab now contains parameters for the constraint, including it's weight (and the original controller's weight).

Set the "Keep initial offset" checkbox if you don't want to move the child to the parent.

Using "Set active" you can adjust the individual constraints (including the original position/rotation/whatever).

Adjust the weights as needed, you can animate them if you want.

[edited by - Nik02 on November 17, 2003 3:21:19 PM]

Niko Suni

This topic is closed to new replies.

Advertisement