Multipart - Actor: possible to combine no geoms at all?

Hi,

I have a question regarding multipart characters: I’m working on a configurable character system where I want to be able to change textures on geometryparts or geometryparts alltogether.

So, when the artist creates a character in the modelling package (we use Maya, btw) he creates a bunch of seperate geometries with speaking names, such as “Legs”, “Body”, “Head” and so on.

The artist is well-trained and well-behaving, so I know that each distinct geometry in the source model makes sense and should be kept seperate, even when the model is turned into an Actor.

I also understand, that I can achieve this by using the egg-optchar tool with the -flag option, so I’m doing something like:

egg-optchar -inplace -flag Legs=Legs -flag Body=Body -flag Head=Head ...

And it all works fine.
So here’s my problem:

I want to give the Artist total freedom, and thus don’t know the geometrynames a-priori. The artist might come up with new, unplanned bodyparts such as “Beard”, “Eyes”, “LeftUpperArm”, “Shoulders”, etc.
So whenever I get a new model from the Artist, I need to first find out the names of all GeomNodes, so I can feed them to egg-optchar.

Is there an easy, built-in way for doing this?

I have a workaround, but I don’t like it:

  1. I first export the geometry as a Model (maya2egg -a none …), so that the geometries won’t get combined
  2. I then load the model, and analyze the subtree to find all geomnames
  3. Export the model a second time, this time as Actor (maya2egg -a model …)
  4. Now I have the info to run "egg-optchar -inplace <long list of -flag options>

I’m not happy because I need to export everything twice. Is there a better way to achieve this?

Other ideas I had:
*) export once, as actor, and then parse the egg file. Alas, there are the egg parser classes in python, but I don’t know how to use them
*) change egg-optchar to take a new option, something like -flagall which would keep all geometries similar to the -keepall option keeping all joints

So if anyone has a great idea, please let me know…

Cheers,

Erik

I don’t have Maya, and I never used it before. So sorry if this might be nonsense. But I think there are only two ways:

Idea A:
If I am right the Maya exporters are written in a Maya scripting language (mel???), so it should be able to modify them. Analyze the model inside the exporter and let the exporter create either (1) a .bat file (or shell script) that calls egg-optchar with the right parameters, or (2) executes egg-optchar directly. Something like os.system( ) in Python.

Idea B:
Use your walkaround and pack it up into a small Python script. That is load the original .egg file, walk the geom tree, create the right command line and execute it for example with os.system( line ).

enn0x

I’m exactly doing what you suggest as solution “B”.
So everything is automated and works. It still just bothers me to export the model twice.

Hm…

Try:

egg-optchar -flag "*"

David

Hi David,

Sorry, -flag * didn’t work… it just renamed the root node to ‘*’…

I guess I’ll stick with my two-pass solution for now…

Erik

Whoops, that’s a bug. That was always intended to be the meaning of -flag “*”. I just checked in a fix, so future releases at least will do this correctly.

David

[x] Check!

After recompiling the latest sources, -flag * works! All geometries are left alone, nothing is merged

Thanks David!

Erik - would you like me to merge this bugfix into 1.4.1, or does it not matter to you?

May i ask for your to include it, because it’s a problem i’ll meet in the upcoming 2 or 3 weeks…

(A Selfish ashamed Manakel)

Hi Josh,

yes, please include it…

btw, how do you decide what goes into 1.4.1 and what not? I always thought at some point the head revision becomes 1.4.1… or did you already branch off?

Cheers,

Erik