def createNPCToonHead(self, NPCID, dimension=0.5):
     NPCInfo = NPCToons.NPCToonDict[NPCID]
     dnaList = NPCInfo[2]
     gender = NPCInfo[3]
     if dnaList == 'r':
         dnaList = NPCToons.getRandomDNA(NPCID, gender)
     dna = ToonDNA.ToonDNA()
     dna.newToonFromProperties(*dnaList)
     head = ToonHead.ToonHead()
     head.setupHead(dna, forGui=1)
     self.fitGeometry(head, fFlip=1, dimension=dimension)
     return head
def createNPCToonHead(NPCID, dimension = 0.5):
    NPCInfo = NPCToons.NPCToonDict[NPCID]
    dnaList = NPCInfo[2]
    gender = NPCInfo[3]
    if dnaList == 'r':
        dnaList = NPCToons.getRandomDNA(NPCID, gender)
    dna = ToonDNA.ToonDNA()
    dna.newToonFromProperties(*dnaList)
    head = ToonHead.ToonHead()
    head.setupHead(dna, forGui=1)
    fitGeometry(head, fFlip=1, dimension=dimension)
    return head
예제 #3
0
 def createNpcToonHead(self, toNpcId):
     npcInfo = NPCToons.NPCToonDict[toNpcId]
     dnaList = npcInfo[2]
     gender = npcInfo[3]
     if dnaList == 'r':
         dnaList = NPCToons.getRandomDNA(toNpcId, gender)
     dna = AvatarDNA.AvatarDNA()
     dna.newToonFromProperties(*dnaList)
     head = ToonHead.ToonHead()
     head.setupHead(dna, forGui=1)
     self.fitGeometry(head, fFlip=1)
     return head
예제 #4
0
 def createNpcToonHead(self, toNpcId):
     npcInfo = NPCToons.NPCToonDict[toNpcId]
     dnaList = npcInfo[2]
     gender = npcInfo[3]
     if dnaList == 'r':
         dnaList = NPCToons.getRandomDNA(toNpcId, gender)
     
     dna = AvatarDNA.AvatarDNA()
     dna.newToonFromProperties(*dnaList)
     head = ToonHead.ToonHead()
     head.setupHead(dna, forGui = 1)
     self.fitGeometry(head, fFlip = 1)
     return head
예제 #5
0
 def createNPCToonHead(self, NPCID, dimension = 0.5):
     NPCInfo = NPCToons.NPCToonDict[NPCID]
     dnaList = NPCInfo[2]
     gender = NPCInfo[3]
     if dnaList == 'r':
         dnaList = NPCToons.getRandomDNA(NPCID, gender)
     dna = ToonDNA.ToonDNA()
     dna.newToonFromProperties(*dnaList)
     head = ToonHead.ToonHead()
     head.setupHead(dna, forGui=1)
     self.fitGeometry(head, fFlip=1, dimension=dimension)
     if NPCID == 91917:
         LaughingManGlobals.addHeadEffect(head, book=True)
     return head
예제 #6
0
 def createNPCToonHead(self, NPCID, dimension=0.5):
     NPCInfo = NPCToons.NPCToonDict[NPCID]
     dnaList = NPCInfo[2]
     gender = NPCInfo[3]
     if dnaList == 'r':
         dnaList = NPCToons.getRandomDNA(NPCID, gender)
     dna = ToonDNA.ToonDNA()
     dna.newToonFromProperties(*dnaList)
     head = ToonHead.ToonHead()
     head.setupHead(dna, forGui=1)
     self.fitGeometry(head, fFlip=1, dimension=dimension)
     if NPCID == 91917:
         LaughingManGlobals.addHeadEffect(head, book=True)
     return head
예제 #7
0
 def createNPCToonHead(self, NPCID, dimension = 0.5):
     # Given an NPC id create a toon head suitable for framing
     NPCInfo = NPCToons.NPCToonDict[NPCID]
     dnaList = NPCInfo[2]
     gender = NPCInfo[3]
     if dnaList == 'r':
         dnaList = NPCToons.getRandomDNA(NPCID, gender)
     dna = ToonDNA.ToonDNA()
     dna.newToonFromProperties(*dnaList)
     head = ToonHead.ToonHead()
     head.setupHead(dna, forGui = 1)
     # Insert xform with gets head to uniform size
     self.fitGeometry(head, fFlip = 1, dimension = dimension)
     return head
예제 #8
0
 def updateDNA(self, description):
     # Create dna
     if isinstance(description, ToonDNA.ToonDNA):
         dna = description
     else:
         dna = ToonDNA.ToonDNA()
         if (isinstance(description, types.ListType)
                 or isinstance(description, types.TupleType)):
             # Assume it is a property list
             dna.newToonFromProperties(*description)
         elif isinstance(description, Datagram):
             # Create dna straight from datagram
             dna.makeFromNetString(description)
         elif isinstance(description, types.StringType):
             # Assume it is a server string description
             # Convert to datagram then create dna
             dna.makeFromNetString(self.convertServerDNAString(description))
         elif isinstance(description, types.IntType):
             # Assume it is an NPC id
             npcInfo = NPCToons.NPCToonDict[description]
             properties = npcInfo[2]
             if properties == 'r':
                 gender = npcInfo[3]
                 properties = NPCToons.getRandomDNA(description, gender)
             dna.newToonFromProperties(*properties)
         else:
             if random() < 0.5:
                 gender = 'm'
             else:
                 gender = 'f'
             dna.newToonRandom(gender=gender)
     if not self.style:
         # New toon, need to initialize style
         self.setDNA(dna)
     else:
         # Just jump straight to the update function
         self.updateToonDNA(dna, fForce=1)