In my current project, I use tags assigned in Blender to indicate various node-specific pieces of data–such as, relevantly to this thread, indicating that the node in question should use a specific custom shader.
For static objects, this seems to work well enough.
(Well, in the SDK, at least. I do worry a little that I’ll find it no longer working in a distributable build, after it’s been through egg2bam. Is that an issue?)
However, I’ve just found that, for at least one model, it doesn’t seem to work well for Actors.
Specifically, what seems to happen is this: The model in question has two nodes and an armature (that affects both nodes). If I “apply” the armature modifiers and export just the two nodes (thus making it static), calling “ls()” on the resultant NodePath indicates that it contains two GeomNodes, one of which has the intended tags. If I instead export the two nodes and their armature, with the armature modifiers intact (thus producing an Actor), I instead get a single GeomNode, containing two Geoms. The tags are, naturally, lost at this point.
Looking at the egg file, I think that the two nodes are intact, even in the “Actor” version. This suggests to me that the issue may be occurring on import, or perhaps later, under the influence of a “flatten” operation. (I would have to check whether I’m flattening after attaching objects like this. If so, however, it seems unexpected that an Actor would be affected differently by a “flatten” command than a “static” object.)
I could work around this, I imagine, by specifying (either via tags or in my level-editor) that the object in question should load a second, external object and parent it to a given joint. However, this is a bit more awkward than just exporting the whole thing.
What do you think? Where does the problem lie, and what might be done about it?