How to modify the vertices of Geoms from TextNodes?

Howdy!

I am trying to do some experimenting with the idea of having animated text, and create a wrapper to make it easier to do and hopefully make something that can be put out for others to use. However despite my research and doc searching (and good chunk of inexperience with low level work) I can’t see to figure out how to make the geoms change at all. Here is pseudo code towards what i’m doing:

textNode = textNode("text")
render.attachNewNode(textNode)

textNode.setText("hi")
textNode.setFlattenFlags(0) # so all the geoms are individual
textGeom = textNode.generate()

geomNode = textGeom.getChild(0)

for i in range(geomNode.getChildren()):
  geom = geomNode.modifiyGeom(i) # So the geom is actually modifiable
  geom.transformVertices(LMatrix4f( # Trying to do anything to make the geoms change at all
    1, 2, 1, 1,
    1, 2, 1, 1,
    1, 1, 3, 1,
    1, 1, 5, 1,
  ))

Printing out of geom’s information before and after are the same. here is an example that if it helps:

GeomTriangles (indexed):
  [ 0 1 2 ]
  [ 2 1 3 ]
Glyphs: [ 105 ]
1 Like

My mistake! Nothing is wrong with my vertex adjusting, its that I parented the TextNode to render but not the GeomNode which is what I was actually editing. I was able to make it work so I hope to come up with a good way to structure it, I would like to make a flexible animated text container that can be expanded on.

2 Likes