libpanda.MeshDrawer ' object has no attribute 'setPlateSize'

I’ve been working with (or trying to) meshdrawer, and I downloaded the example that I found online from here:

[url]Particles: Effects or Home-made?]

it was posted up by treeform here is the code:

    This example show how to use MeshDrawer to draw
    on the screen in any way shape or form you want
    The texture MeshDrawer takes is a plate of
    for instance plate of 3 x 3 will be numberd 
    this way:
    1 2 3  
    4 5 6
    7 8 9
    The plates are created by the create plate tool 

import direct.directbase.DirectStart
from pandac.PandaModules import *
from random import *
from math import *

maxParticles = 500 # max number of particle (1000) triangles we will display
by = 16 # we have a 16x16 plate texture

generator = MeshDrawer()
generatorNode = generator.getRoot()

# load some thing into our scene
t = loader.loadModel('teapot')

# very usefull function
def randVec():
    return Vec3(random()-.5,random()-.5,random()-.5)

seed(1988)  # random seed - remove if you always want different random results

# create 100 random particles
particles = []
for i in range(100):
    p = [randVec()*1, randVec()*100,randint(181,207),1,Vec4(random(),random(),random(),1)]

# create 100 random lines
lines = []
for i in range(100):
    l = [randVec()*100,randVec()*100,187,.1,Vec4(random(),random(),random(),1)]

def drawtask(taks):
    """ this is called every frame to regen the mesh """
    t = globalClock.getFrameTime()
    for v,pos,frame,size,color in particles:        

    for start,stop,frame,size,color in lines:
    return taks.cont

# add the draw task to be drawn every frame
taskMgr.add(drawtask, "draw task")

# run the sample

however when I run it I get this error:

File “”, line 26, in
AttributeError: ‘libpanda.MeshDrawer’ object has no attribute ‘setPlateSize’

I’ve tried searching, but have gotten almost no results, and what little I have found seems to be the result of running the program on linux or a mac, but I’m running on a windows machine, so I’m a bit confused as to what is wrong here, does anyone have any ideas?


Treeform removed setPlateSize after 1.6.2, it doesn’t exist any more in 1.7.0.

Oh, thanks, good to know.

Could you tell me what I’m supposed to replace setplatesize with in stead? Normally I could examine the program itself and figure out what each thing does, but it doesn’t work in the first place, I’m not even sure what setplatesize even did to begin with :confused: .


I don’t know, you’ll have to ask treeform. The quote from et1337 is all I know about it.

ok, thanks, I’ll do that.

greatly appreciated

Pos is the position of the billboard
Size is the size of the billboard

Frame is Vec4() which is Vec4(u,v, u+w, v+h) were uv and wh are texture position and texture size in fraction. If the rectangle you want to put on the billboard is at center and extends all the way to the other corner you would use Vec4(.5,.5,1,1)

set plate wise was a bad decision that was too constricting so it got removed. It essentially computed uv and wh from an integer. If you gave it your plate size it would compute which rectangle you wanted based on index.