Problem with Model/Actor

Hi, guys!

I’m new to Panda3D (and, consequently, these forums), so please forgive me if I’m a little over enthusiastic and/or ambitious. I have used other 3D graphics engines before, but nothing quite like Panda3D. I’ve also been working with Blender modelling and animation, for several years.

I’m slowly working my way through the Panda3D manual, and any tutorials I can get my hands on, and everything I’ve tried so far has worked as described. Now I’m trying to implement my own models and code.

I have come up against a problem, though, that I can’t quite figure out.

I created the model in makehuman and exported it to Blender via mhx format. Importing into Blender was no problem, neither was creating a rudimentary walk cycle and exporting to Panda3D egg format via Andrey Arbusov’s exporter.

When I try to load my model as a static mesh …

self.player = self.loader.loadModel( 'Models/Male/male-001' )

… everything appears to load correctly. I get body, hair, eyes, eyebrows, eyelashes, etc, which are separate meshes parented to the skeleton.

but if I load it as an actor …

self.player = Actor( 'Models/Male/male-001', { 'walk': 'Models/Male/male-001-Walk' } )

… I only get the body mesh, no hair, no eyes, etc. The body mesh does load its texture, but I loose the other parts of the model which appear in the static mesh.

BTW, I can also load other standard models as well, like the panda, and have both panda and my model walking side by side, so animations work.

I’ve gone through the manual several times, and searched the Internet, but I may have missed something very basic. If anyone can make any suggestions about getting the rest of my model meshes to load, I’d greatly appreciate it.

I take it that your main model has an armature modifier in Blender–do the missing pieces also have such a modifier? I think that I recall encountering a similar issue, in which elements not affected by an armature were not included in an Actor.

Otherwise, have you tried checking the “merge actor” box when exporting?

[edit] I just did a little experimenting, and it looks as though both might be called for (presuming that you don’t join the parts into a single mesh yourself): give the missing parts armature modifiers, and check “merge actor” when exporting. (I’m not sure of whether vertex weights for at least one bone in the armature are called for.)

Bingo! I knew it had to be something simple…

Thank you, thank you, thank you, Thaumaturge!

I went back to the blender file and checked the other meshes for parentage and they had all been parented to the head bone, so no problem there. Then I checked the export and found that I had unchecked “Merge Actor”. When I checked that and exported again, everything appeared in my application when I ran it.

I do notice that if I check ‘Apply Modifiers’ when I export, it gives an error:

Traceback (most recent call last):
File: ".../io_scene_egg/__init__.py", line 365, in execute sett.opt_pview)
File: ".../io_scene_egg/yabee_libs/egg.writer.py", line 1103, in write_out_apply_modifiers()
File: ".../io_scene_egg/yabee_libs/egg.writer.py", line 1019, in apply_modifiersbpy.ops.object.modifier_apply(modifier = mod.name)
File: "/usr/local/share/blender2.69/scripts/modules/bpy/ops.py", line 188, in __call__ ret = op_call( self.idname_py(), None, kw)
RuntimeError: Error: Modifier is disabled, skipping apply
location: <unknown location>:-1

Please for give any typos: I had to copy it by sight since blender does not allow cutting and pasting of error messages.

I’m not even certain what it is for, or if I need it, but since exporting works without it, I’ll leave ‘Apply Modifiers’ unchecked for the time being. But I suppose if I ever actually need it, I can always email the author.

So, thanks again, Thaumaturge, you’ve made my day (and you didn’t use a 357 magnum).

BTW. how do I add ‘[SOLVED]’ to the subject?