hi,
last days i had a hard time fining out why my animations look strange - now i found the reason for sure: panda’s flattening.
while loading a model -or in my case, an actor-, panda automatically optimizes the model and tries to decimate the vertex- and polycount. nothing bad about that, but sometimes you need double vertices which belong to different faces.
Here’s an example:
nemesis13.de/tmp/test.egg - two squares side by side. one half is animated by an armature.
load and play it with the following code:
import direct.directbase.DirectStart
from direct.actor.Actor import Actor
from pandac.PandaModules import *
np = Actor('test.egg')
np.reparentTo(render)
base.accept("f1", render.ls)
base.accept("a", np.play, ["right down"])
render.setShaderAuto()
plight = PointLight("dlight")
alight = AmbientLight("alight")
plnp = render.attachNewNode(plight)
alnp = render.attachNewNode(alight)
plight.setColor(Vec4(1.0, 1.0, 0.8, 1))
alight.setColor(Vec4(0.0, 0.0, 0.2, 1))
plnp.setPos(10, 10, 20)
render.setLight(plnp)
render.setLight(alnp)
run()
(the light at the end is necessary, you’ll see why)
run the script, zoom out and rotate the camera a bit to see the plane from 3rd person view and press ‘a’.
you’ll notice, that the shade changes at the right side, nothing more:
in real it should look like this:
the reason is visible if you press ‘F1’. the two planes have been merged into one geom (which is one single, connected mesh)
i tried the following options without any results already:
- prc options egg-flatten 0 and egg-unify 0
- the actor argument flattenable=False
- actor function postFlatten() – causes a crash when playing any animations afterwards
so… is there any special top secret option that i have overseen?