does Actor loader mind empties?

I mean if I define an empty node for a model in blender and then export this model I’ll load afterwards as an actor, is it true I can’t find("**/thatnode") anymore even specifying flattenable=False?
And if true: how can I workaround that?

You can probably just label your node in the game editor, like it says in the chicken documentation. If you load export an empty instead of a node, it’ll be saved by default with its name intact.

but it is not a matter of the chicken exporter - if I load the same model with loader.loadModel I’m still able to find that node. It is the Actor() constructor that returns a node tree with empty nodes stipped off.

Not sure what you mean. Actor insists that the model you give it be an animatable model, that is, that it contains a Character node. If you give it a model that doesn’t contain a Character node, it will raise an error. This also means it will raise an error if you give it a model that contains only a dummy node.


I guess ‘empty’ (the blender word for a node without geometry) is the ‘dummy’ you’re talking about so you’re saying that I’ll never found in an actor node, aren’t you? but how can I circumvent my need to have a placeholder where to stick stuff at runtime to an actor? dummy bones perhaps?

If you load your models within the Actor interface, you might want to consider giving it a conventionally loaded model as argument instead of a filename, since the loader from Actor.loadModel() extracts only skeletons (rigged models).

example snippet:

model = loader.loadModel("foo/bar/model")  # contains an actor and a few empties
actor = Actor(model)
empties = model.findAllMatches("**/pattern*")
if not empties.isEmpty():

The approach with dummy bones should work as well. You can always expose those and use as usual Nodes.

quite brilliant Nemesis, that made the trick, thankyou

I suppose you could also consider not using Actor. :slight_smile: I imagine you have your own reasons for using an Actor, but without an animation you can play on it, the Actor class gives you no advantages over an ordinary NodePath.

Edit: oh, now I understand. You’re not talking about loading an empty placeholder model in place of your Actor; you’re talking about loading an animatable model and its accoutrements from the same egg file. OK, my apologies for the confusion.


as you probably know I’m not so English and it’s hard for me to make people getting what I’m saying in foreign (sometime in native as well), so no apologies needed David and I appreciate your help nonetheless.