Cannot execute pyview

Here is the file actor_data.py from the Arena FPS sample program, with your head model added:

from direct.actor.Actor import Actor

player_character = Actor("models/npc_1.bam",
              {"walking": "models/npc_1_ArmatureAction.bam", "death": "models/npc_1_death.bam"})

NPC_1 = Actor("models/npc_1.bam",
              {"walking": "models/npc_1_ArmatureAction.bam", "death": "models/npc_1_death.bam"})
              
arm_handgun = Actor("models/arm_handgun.bam",
              {"shoot": "models/arm_handgun_ArmatureAction.bam"})
              
face = Actor("models/face.bam",
              {"wink": "models/face_ArmatureAction.bam"})

then in main.py :

import actor_data

.....showbase setup code....

        face = actor_data.face
        face.reparent_to(self.render)
        face.set_pos(0, 0, 1)
        
        # npc base animation loop
        face_ctrl = actor_data.face.get_anim_control('wink')
        if not face_ctrl.is_playing():
            actor_data.face.stop()
            actor_data.face.loop("wink", fromFrame = 250, toFrame = 300)
            actor_data.face.set_play_rate(1.0, 'wink')

TLDR: You need to make a little game environment to test your Actor out in.

i did this but nothing happens is that about npc1_.bam doesnt exist in the panda models or its just exemple and i have to put this models ? i can give you acces to my laptop by teamviewer if you want

from direct.actor.Actor import Actor

player_character = Actor(“models/npc_1.bam”,

          {"walking": "models/npc_1_ArmatureAction.bam", "death": "models/npc_1_death.bam"})

NPC_1 = Actor(“models/npc_1.bam”,

          {"walking": "models/npc_1_ArmatureAction.bam", "death": "models/npc_1_death.bam"})

arm_handgun = Actor(“models/arm_handgun.bam”,

          {"shoot": "models/arm_handgun_ArmatureAction.bam"})

face = Actor("/c/Users/anass/OneDrive/Bureau/TestShamaAnimationsFinal/face.bam",

          {"blink" : "/c/Users/anass/OneDrive/Bureau/TestShamaAnimationsFinal/face_blinking.bam"})

Panda doesn’t have shared asset files for sample programs.

The example I gave is just the logical example of how to set up an Actor in a game environment.

To be clear, there is no sample program that shows facial animation right now.

even if it is a face it is just a simple object as well!! so i need just simple environment just like the one of panda walking to set the face in ?

I would guess that the problem here is that you left both the model and the camera at their default positions (i.e. (0, 0, 0)). As a result, the camera is “inside” the model, and the model isn’t visible.

I’d suggest placing the model at some point along the Y-axis; how far depends on the size of the model.

Something like this:

self.face = Actor("/c/Users/anass/OneDrive/Bureau/TestShamaAnimationsFinal/face.bam",
                  {"blink" : "/c/Users/anass/OneDrive/Bureau/TestShamaAnimationsFinal/face_blinking.bam"})        
    self.face.reparentTo(self.render)
    self.face.loop("blink")

    self.face.setY(10) #Or whatever number suits the model

that is right bro i got this but i cannot find the eyes blinking the animation make head movements and not the eyes but in blender the eye is blinking i do not know what is wrong

1 Like

@Thaumaturge do you have an idea about that problem bro ? do i need when i finish the animation remerge the objects again ?

All that comes to mind is that you perhaps don’t have the animation set up correctly, or in the way that the exporter expects.

Is the non-working animation an armature animation, or a shape-key one? If the former, does the animation use the same armature as the animations that work? And are all of your animations held in Blender “actions”, and if so, is the one that doesn’t work also in an “action”?

yes it is in action and i had that armature doing just the blinking movements but when i load it in panda i do not have eyes and the animation is moving the head and not doing the eyes blinking if you can see the .blend file that i puted the ast one the armature doing blinking movements

Ah, wait, do you mean that the eyes aren’t there at all? If so, then the eye-model may not be exporting, or may be ending up mispositioned.

What terminal output do you get if you call “ls()” on your model after loading it into your project?

yes cannot find them and also the animation is not for head movement only a part on the top of the eyes but the head is totatly moving. and i got the face.bam and the face_blinking file only.

another prob appears how to reset the camera :
shamatopErr

And what of that command that I mentioned? What result does it produce?

Also, I return to this question:

Please do start separate threads for new problems. Doing so makes it easier for others to find solutions should they encounter similar issues.

the command gets me script files and the 2 created files the mesh and another one have animation and a third one has the same head object…

i made only one animation with one armature to this part in blender
animationblendereyes

but in panda3d the face has no eyes and moving the head and not this parts

Ah, no, if I understand you correctly then that’s not the command that I meant. I apologise for the ambiguity! Instead, I meant the call to “ls()” that I mentioned a few posts above. Quoted here for the sake of convenience:

Hmm, I see. In which case I’m afraid that I don’t know–as I said, I don’t currently use the newer exporter. Perhaps another will have a more useful answer!

i got this when i use render.ls()

Well, that indicates that the animation is there, at least.

However, the fact that I see only one GeomNode suggests that the eyes aren’t being exported–hence their lack in the scene, and thus there being no blinking.

for separations i used this command

You might have a hard time getting different mesh-objects that are not connected to the ArmatureAction mesh to export, because of the way skeletal animation works.

You may have to do something like, export the head armature as .bam, then load in the eyes separately from that as .gltf, and do your eye-logic on the Panda side. (Have I mentioned that realistic humanoid models are really complicated to do from scratch?)

i fixed this one but i got another error can you see the other question in the forum i explained what happend

That would be odd, I think: If I’m understanding you correctly, it’s perfectly possible under YABEE, I believe.

To be specific–in case I’m not understanding you correctly–I recall that on a number of occasions I’ve exported multiple meshes at once, all with an armature modifier using the same armature (of which there is only one) but not necessarily connected to each other. Indeed, I just performed a quick-and-simple test and it seemed to work as expected.