def __createToonModels(self, avId): toon = self.getAvatar(avId) self.toonScaleDict[avId] = toon.getScale() toon.useLOD(1000) toonParent = render.attachNewNode('toonOriginChange') toon.reparentTo(toonParent) toon.setPosHpr(0, 0, -(toon.getHeight() / 2.0), 0, 0, 0) self.toonModelDict[avId] = toonParent head = ToonHead.ToonHead() head.setupHead(self.getAvatar(avId).style) head.reparentTo(hidden) self.toonHeadDict[avId] = head toon = self.getAvatar(avId) tag = NametagFloat3d() tag.hideNametag() tag.update() tag.setBillboardOffset(0) tag.setAvatar(head) toon.nametag.add(tag) tagPath = head.attachNewNode(tag) tagPath.setPos(0, 0, 1) head.tag = tag self.__loadToonInCannon(avId) self.getAvatar(avId).dropShadow.hide() self.dropShadowDict[avId] = self.dropShadow.copyTo(hidden)
def __createToonHead(self, toon): self.toonHead = ToonHead.ToonHead() self.toonHead.setupHead(toon.style) self.toonHead.reparentTo(hidden) tag = NametagFloat3d() tag.hideNametag() tag.update() tag.setBillboardOffset(0) tag.setAvatar(self.toonHead) toon.nametag.add(tag) tagPath = self.toonHead.attachNewNode(tag) tagPath.setPos(0, 0, 1) self.toonHead.tag = tag
def update(self): NametagFloat3d.update(self) self.updateClickRegion()