Unable to search the scene graph

Hi,

I’m trying to convert a blender game engine project to Panda3d and
am having an egg file problem. h3.egg contains a rigged character
and was created from blender 2.79. I need to be able to get a handle
to MakeHuman_skeleton_man1_jeans01.

But when I do:

Speaker = Actor("h3.egg")
Speaker.find("**/*MakeHuman_skeleton_man1_jeans01*")

or Speaker.find("**/MakeHuman*") find returns: **not found** each time

Otherwise, the egg file is fine. The character shows up in Panda3d dressed correctly,
with hair and a face. I can control the joints.

Any help would be very much appreciated. The details are:

Speaker.ls() initially prints:

PandaNode alonzo T:(pos 0 0 -1.4 scale 2)
  Character __Actor_modelRoot
    GeomNode  (6 geoms: S:(MaterialAttrib TextureAttrib TransparencyAttrib))

but after I access joints, rescale, and move the actor around, it prints:

PandaNode Speaker T:(pos -5 6 -1.5 scale 1.53846)
  Character __Actor_modelRoot
    GeomNode  (6 geoms: S:(MaterialAttrib TextureAttrib TransparencyAttrib))
  ModelNode upperarm02_L T:m(pos 0 0.0605149 0 hpr 3.30852 -0.0126384 2.64881)
  ModelNode upperarm02_L T:(pos 0 0.0605149 0 hpr -46 0 2.6)
  ModelNode lowerarm01_L T:m(pos 0 0.188701 0 hpr 35.6021 29.7201 -91.3218)
  ModelNode lowerarm02_L T:m(pos 0 0.129406 0 hpr 0.0926037 0.0105104 -0.140172)
  ModelNode wrist_L T:m(pos 0 0.129401 0 hpr -11.5732 3.94361 -143.456)
  ModelNode clavicle_L T:m(pos 0.0227886 0.135948 0.0302111 hpr -80.4814 -2.51058 85.7171)
  ModelNode shoulder01_L T:m(pos 0 0.0842713 0 hpr 4.90089 38.8137 -35.5284)
  ModelNode shoulder02_L T:m(pos 0 0.0868717 0 hpr -9.01538 19.5563 -23.6455)
  ModelNode upperarm02_R T:(pos 0 0.060515 0 hpr 46 0 2.6)
  ModelNode lowerarm01_R T:m(pos 0 0.188701 0 hpr -35.6021 29.7201 91.3217)
  ModelNode lowerarm02_R T:m(pos 0 0.129406 0 hpr -0.0926281 0.0105198 0.140162)
  ModelNode wrist_R T:m(pos 0 0.129401 0 hpr 11.5732 3.94361 143.456)
  ModelNode clavicle_R T:m(pos -0.0227886 0.135948 0.0302111 hpr 80.4814 -2.51058 -85.7171)
  ModelNode shoulder01_R T:m(pos 0 0.0842714 0 hpr -4.90093 38.8139 35.5284)
  ModelNode shoulder02_R T:m(pos 0 0.0868719 0 hpr 9.01538 19.5562 23.6455)

The egg file looks like (the “jeans” group is shown at the bottom):

<CoordinateSystem> { Z-up }
<Material> BrownClassicShoesMaterial {
  <Scalar> diffr { 0.640000 }
  <Scalar> diffg { 0.640000 }
  <Scalar> diffb { 0.640000 }
  ...
  }
<Texture> Texture.002 {
  "./tex/brown_eye.png"
  <Scalar> envtype { MODULATE }
  <Scalar> minfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> magfilter { LINEAR_MIPMAP_LINEAR }
  <Scalar> wrap { REPEAT }
}
   ..,

  <Group> _Point2 {
    <Transform> {
      <Matrix4> {
        1.0 0.0 0.0 0.0
        0.0 1.0 0.0 0.0
        0.0 0.0 1.0 0.0
        3.8988566398620605 -5.027559757232666 0.0705021321773529 1.0
      }
    }

  }

  ...

  <Group> Human {
    <Transform> {
      <Matrix4> {
        1.0 0.0 0.0 0.0
        0.0 1.0 0.0 0.0
        0.0 0.0 1.0 0.0
        0.0 0.0 0.0 1.0
      }
    }

     <Group> HumanSkeleton {
      <Dart> { 1 }
      <Joint> root {
        <Transform> {
          <Matrix4> {
            1.30385160446167e-08 1.0 9.99346375465393e-05 0.0
            0.993284285068512 -1.1644326150417328e-05 0.11570282280445099 0.0
            0.1157028004527092 9.927153587341309e-05 -0.9932838678359985 0.0
            -0.06652958691120148 3.995845327153802e-05 0.9598396420478821 1.0
          }
        }

       <Group> MakeHuman_skeleton_man1-classic_shoes_lres {
        ...

        }

       ...

      <Group> MakeHuman_skeleton_man1_jeans01 {
             <Transform> {
          <Matrix4> {
            1.0 0.0 0.0 0.0
            0.0 1.0 0.0 0.0
            0.0 0.0 1.0 0.0
            0.0 0.0 0.0 1.0
          }
        }

 <VertexPool> MakeHuman_skeleton_man1_jeans01 {
        ...
         }
        ...
        }
     }
   }
}

I’ve taken the liberty of fixing the formatting in your post to make it more readable; please use triple backticks (```) next time to enclose blocks of code or command-line output, or single backticks for inline code.

By default, joints don’t show up as nodes in Panda (unless you explicitly mark them as needing to be exposed using egg-optchar).

If you want to get a handle to a joint that hasn’t been exposed in such a manner, you need to use Speaker.exposeJoint or Speaker.controlJoint, see this manual page or the Looking and Gripping sample program.

Thanks very much. Sorry about the formatting. I tried
egg-optchar -d /jshare -flag MakeHuman_skeleton_man1_jeans01=jeans try.eg
and it worked. I was able to get the jeans and change their color.

But as the documentation implied, it also wiped out all my joints. The character is
unanimated. All its movements are handled dynamically by controlling the joints, and I
need most of them. The documentation says:

“In the case of an unanimated model, the way to protect a particular node
is to insert the flag into the egg file within the particular group”

but it doesnt give any details. I tried adding
-flag shoulder01_L=sh01_L
but shoulder01_L was still missing, and the file loads with warnings like
Actor(warning): Cannot control joint shoulder01
because I’m trying to access it via controlJoint.

Then I found that there was a -keep flag which is supposed to keep specified joints.
I tried it it with a few relevant joints and it seemed to work but the file was corrupted in some way
and my joint control code no longer worked properly.

So I took out the jeans flag and kept all 76 joints. In theory, this should have
made an identical egg file, which would have enabled me to spot the corruption, but the new file was about 1000 lines smaller. But keeping all the joints magically fixed the corruption problem
so I think I am good to go.

Thanks again