i tried to use pyview and an error appears
Ah, I believe that it should be âpviewâ, not âpyviewââi.e. there should be no âyâ in it.
It looks like only part of the model was exported.
As to the lack of animations, that could be caused by the same, or by other causesâbut Iâll leave that to others, as Iâm still using the old tools, Iâm afraid!
i tried to export while selecting all parts of the mesh and the same. can i send you the file .blend note that the eyes are separated. the animation is eyes blinking
If youâre using a version of Blender after 2.78 then thereâs a good chance that my version wonât open the file correctly, Iâm afraid.
(In addition, Iâm about to step away for the nightâitâs rather late here! Thus you might be better off waiting for someone else.)
i can send it to you when you wake up have a look if you want of course
There are a few interactions we should clear up:
-
What version of Blender are you using? It will say in the bottom-right of the Blender window a version like â2.93.0â
-
How are you exporting the model? What formats are you trying to use?
blender 2.9 the latest version im using. and i tried fbx and gltf (gltf doesnt show even the model)
PBR support in Panda3D is pretty new. Blender 2.9 uses BSDF Principled Nodes by default.
There are a few techniques to export an animated model. I would suggest using blend2bam to convert a .blend (Blender 2.9 file) into a .bam model with separate animations made for the model, which you apply using the Actor system inside of your game logic. I gather this is not the only way to do animations in Panda, but it is a way to do all the sorts of skeletal animation youâd like (with or without using morph targets, I think).
Further, Iâd suggest using two different Actors for the head and the body model, which is yet another opinion I have about how to construct models in a game environment. And, this requires that you keep track of 2x as much information with regard to your character model, on top of âdirectlyâ animating two skeletal armatures. I gather this is pretty gnarly or âlow levelâ to the average developer.
As of Panda3D 1.10.8 we have direct support for loading and viewing .gltf files, without a patch loader, but if youâre on 1.10.7 or older you need to use the .gltf patch_loader. Iâm not 100% on all the possible interactions here, as I said the support is pretty new, and itâs not guaranteed to work in all the possible hardware and renderer cases.
Also, skeletal animation is an advanced topic, and it takes quite a while to get proficient at.
i tried whqt you said but nothing appears in the panda window
this is the link of the .blend file it contains the ani,ation as you can see eyes blinking
The model does export and separate animations with the following script, with one armature.
blend2bam -m pbr --pipeline gltf --animations separate shamaFace.blend incorrect_face.bam
You are still using two armatures, which I do not recommend. I deleted one for the sake of exporting.
The model loads in as an Actor and appears in a game environment from the resultant .bam files.
Your animation sequence is rather far from the 0-key, so youâll need to set some logic up that plays only that animation range like so:
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')
Still, youâll have to rework your armature to get the results youâre looking for.
so what i understand is to make all animations by only one armature and separate them on the timeline in blender (because the goal is to do 2 animations eyes blinking what i did and mouth movement) or one armature for an animation and then save the file as .blend then use âblend2bam -m pbr --pipeline gltf --animations separate shamaFace.blend incorrect_face.bamâ to get the mesh and the 2 others animations in different files ?
I think that, instead of placing your animations at different points on a single timeline, you can create each animation in a separate Blender âactionâ and have blend2bam export those.
(I believe that Blenderâs interface has changed since the version that I use, so I donât know with confidence how itâs done in newer versions, Iâm afraid.)
i tried what you told me i used only one armature and i animated the eyes then i used : blend2bam -m pbr --pipeline gltf --animations separate âshamatestAnim.blendâ âface.bamâ
then the code :
Load the model.
self.face = self.loader.loadModel("/c/UsersanassOneDriveBureauTestShamaAnimationsFinal/face.bam")
# Reparent the model to render.
self.face.reparentTo(self.render)
and i got an error : OSError: Could not load model file(s): [â/c/UsersanassOneDriveBureauTestShamaAnimationsFinal/face.bamâ]
this is the link of the last model :
Actor loading and animation is described in the Panda3D Manual: Loading Actors and Animations â Panda3D Manual
this is why i did and i get a blank window :
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")
Maybe we need to put together a more thorough tutorial on Actors for people new to Panda3D.
what is wrong with my animation code ? i did what in the documentation