Hello,
I generate normal mapping on a man model except his hair.
So I ignore a shader on the man’s hair.
See my code below,
self.man = loader.loadModel("man.bam")
self.man.reparentTo(render)
self.man.setShaderAuto()
self.man.find("**/hair").setShaderOff()
It’s thrown an error.
self.man.find("**/hair").setShaderOff()
AssertionError: !is_empty() at line 3590 of panda/src/pgraph/nodePath.cxx
The egg file show as below.
<Group> character {
<Dart> { 1 }
<Group> hair {
<VertexPool> hair.verts {
<Vertex> 0 { .....
I search for the solution on this forum and see someone remove " { 1 }" to fix it.
<Group> character {
<Group> hair {
<VertexPool> hair.verts {
<Vertex> 0 { .....
Then I remove " { 1 }" and it work. I can refer to the hair model.
But when I load this model as Actor.See the code below.
self.man = Actor()
self.man.loadModel("man.bam")
self.man.loadAnims({'stand0' : "man_stand1.bam"})
self.man.reparentTo(render)
self.man.setShaderAuto()
self.man.loop('stand0')
self.man.find("**/hair").setShaderOff()
The error appear.
:Actor(warning): man.bam is not a character!
self.man.loop('stand0')
File "C:\Panda3D-1.7.0\direct\actor\Actor.py", line 1555, in loop
for control in self.getAnimControls(animName, partName):
File "C:\Panda3D-1.7.0\direct\actor\Actor.py", line 1849, in getAnimControls
allowAsyncBind = allowAsyncBind)
File "C:\Panda3D-1.7.0\direct\actor\Actor.py", line 2341, in __bindAnimToPart
bundle = self.__commonBundleHandles[subpartDef.truePartName].getBundle()
KeyError: 'modelRoot'
But if I insert " { 1 }" as native egg file, it can loop animation without an error.
How can I loop an animation and find the part of model in the same egg(bam) file?
Or I has to modify the path in the “find()”'s parameter.
Please give me an advise.
Thanks in advance.
- ola -