get tag if "startswith" something?

Seems Blender adds a number to a property if you have another one on the same object with the same name.

So in Panda I need to find out if my node has such a tag, but ignore any numbers added to the tag name by Blender.
so how to tell findAllMatches() or other findX() functions to ignore numbers in the end of the name string, or match if the tag name in the file starts with my string I use for searching?

I think you can put a wildcard “name*” at the end of the search string. At least that works with NodePath names, not sure about searching tags.

I wouldnt want to say it doent work, because maybe Im doing something wrong, but this returns 0 NodePaths:

model.findAllMatches("**/=" + "something*")

while “something0” works.

still haven’t figured this out

Hmmm according to the manual the * should work. http://www.panda3d.org/manual/index.php/Searching_the_Scene_Graph
One thing you could do instead is just call getChildren() and filter the names yourself instead of relying on Panda’s name searching.

I guess it might be a bug.
Here’s an example egg which has empty tags named “tag1”,“tag2” and the code for searching it.

<CoordinateSystem> { Z-up }

<Comment> { "Egg laid by Chicken for Blender, version R91" }

<Material> Material {
  <Scalar> diffr {0.800000011921}
  <Scalar> diffg {0.800000011921}
  <Scalar> diffb {0.800000011921}
  <Scalar> specr {0.25}
  <Scalar> specg {0.25}
  <Scalar> specb {0.25}
  <Scalar> shininess {12.5}
}
<Group> Cube {
  <Tag> tag1 {  }
  <Tag> tag2 {  }
  <VertexPool> Cube {
    <Vertex> 0 {
      1.0 0.999999940395 -1.0
    }
    <Vertex> 1 {
      1.0 -1.0 -1.0
    }
    <Vertex> 2 {
      -1.00000011921 -0.999999821186 -1.0
    }
    <Vertex> 3 {
      -0.999999642372 1.00000035763 -1.0
    }
    <Vertex> 4 {
      1.00000047684 0.999999463558 1.0
    }
    <Vertex> 5 {
      -0.999999940395 1.0 1.0
    }
    <Vertex> 6 {
      -1.00000035763 -0.999999642372 1.0
    }
    <Vertex> 7 {
      0.999999344349 -1.00000059605 1.0
    }
    <Vertex> 8 {
      1.0 0.999999940395 -1.0
    }
    <Vertex> 9 {
      1.00000047684 0.999999463558 1.0
    }
    <Vertex> 10 {
      0.999999344349 -1.00000059605 1.0
    }
    <Vertex> 11 {
      1.0 -1.0 -1.0
    }
    <Vertex> 12 {
      1.0 -1.0 -1.0
    }
    <Vertex> 13 {
      0.999999344349 -1.00000059605 1.0
    }
    <Vertex> 14 {
      -1.00000035763 -0.999999642372 1.0
    }
    <Vertex> 15 {
      -1.00000011921 -0.999999821186 -1.0
    }
    <Vertex> 16 {
      -1.00000011921 -0.999999821186 -1.0
    }
    <Vertex> 17 {
      -1.00000035763 -0.999999642372 1.0
    }
    <Vertex> 18 {
      -0.999999940395 1.0 1.0
    }
    <Vertex> 19 {
      -0.999999642372 1.00000035763 -1.0
    }
    <Vertex> 20 {
      1.00000047684 0.999999463558 1.0
    }
    <Vertex> 21 {
      1.0 0.999999940395 -1.0
    }
    <Vertex> 22 {
      -0.999999642372 1.00000035763 -1.0
    }
    <Vertex> 23 {
      -0.999999940395 1.0 1.0
    }
  }
  <Polygon> {
    <MRef> { Material }
    <Normal> { 0.000000 0.000000 -1.000000
    }
    <VertexRef> { 0 1 2 3 <Ref> { Cube } }
  }
  <Polygon> {
    <MRef> { Material }
    <Normal> { 0.000000 -0.000000 1.000000
    }
    <VertexRef> { 4 5 6 7 <Ref> { Cube } }
  }
  <Polygon> {
    <MRef> { Material }
    <Normal> { 1.000000 -0.000000 0.000000
    }
    <VertexRef> { 8 9 10 11 <Ref> { Cube } }
  }
  <Polygon> {
    <MRef> { Material }
    <Normal> { -0.000000 -1.000000 -0.000000
    }
    <VertexRef> { 12 13 14 15 <Ref> { Cube } }
  }
  <Polygon> {
    <MRef> { Material }
    <Normal> { -1.000000 0.000000 -0.000000
    }
    <VertexRef> { 16 17 18 19 <Ref> { Cube } }
  }
  <Polygon> {
    <MRef> { Material }
    <Normal> { 0.000000 1.000000 0.000000
    }
    <VertexRef> { 20 21 22 23 <Ref> { Cube } }
  }
}
import direct.directbase.DirectStart
from panda3d.core import *

model = loader.loadModel("example.egg")

print "tag1:", model.findAllMatches("**/=tag1")
print "tag2:", model.findAllMatches("**/=tag2")
print "both:", model.findAllMatches("**/=tag*")