Poodletooth-iLand/toontown/toon/LaughingManGlobals.py

44 lines
1.2 KiB
Python
Raw Normal View History

from panda3d.core import *
2015-03-03 16:10:12 -06:00
def makeCard(book=False):
2015-06-02 22:55:38 -05:00
cardMaker = CardMaker('king-jake-cm')
2015-03-03 16:10:12 -06:00
cardMaker.setHasUvs(1)
cardMaker.setFrame(-0.5, 0.5, -0.5, 0.5)
2015-06-02 22:55:38 -05:00
nodePath = NodePath('king-jake')
2015-03-03 16:10:12 -06:00
nodePath.setBillboardPointEye()
lmBase = nodePath.attachNewNode(cardMaker.generate())
2015-06-02 22:55:38 -05:00
lmBase.setTexture(loader.loadTexture('phase_3/maps/kj_base.png'))
2015-03-03 16:10:12 -06:00
lmBase.setY(-0.3)
2015-06-02 22:55:38 -05:00
lmBase.setScale(0.845)
2015-03-03 16:10:12 -06:00
lmBase.setTransparency(True)
lmText = nodePath.attachNewNode(cardMaker.generate())
2015-06-02 22:55:38 -05:00
lmText.setTexture(loader.loadTexture('phase_3/maps/kj_text.png'))
2015-03-03 16:10:12 -06:00
lmText.setY(-0.301)
2015-06-02 22:55:38 -05:00
lmText.setScale(0.845)
2015-03-03 16:10:12 -06:00
lmText.setTransparency(True)
lmText.hprInterval(10, (0, 0, -360)).loop()
lmFace = nodePath.attachNewNode(cardMaker.generate())
lmFace.setTexture(loader.loadTexture('phase_3/maps/lm_face.rgba'))
lmFace.setY(-0.302)
lmFace.setTransparency(True)
return nodePath
def addHeadEffect(head, book=False):
card = makeCard(book=book)
card.setScale(1.45 if book else 2.5)
card.setZ(0.05 if book else 0.5)
2015-07-05 18:59:25 -05:00
2015-03-03 16:10:12 -06:00
for nodePath in head.getChildren():
nodePath.hide()
2015-07-05 18:59:25 -05:00
2015-03-03 16:10:12 -06:00
card.instanceTo(head)
def addToonEffect(toon):
for lod in toon.getLODNames():
2015-06-02 22:55:38 -05:00
addHeadEffect(toon.getPart('head', lod))