2019-12-30 06:07:56 +00:00
|
|
|
from .CatalogFurnitureItem import *
|
2019-11-02 22:27:54 +00:00
|
|
|
FTAnimRate = 6
|
|
|
|
AnimatedFurnitureItemKeys = (10020, 270, 990, 460, 470, 480, 490, 491, 492)
|
|
|
|
|
|
|
|
class CatalogAnimatedFurnitureItem(CatalogFurnitureItem):
|
|
|
|
|
|
|
|
def loadModel(self):
|
|
|
|
model = CatalogFurnitureItem.loadModel(self)
|
|
|
|
self.setAnimRate(model, self.getAnimRate())
|
|
|
|
return model
|
|
|
|
|
|
|
|
def getAnimRate(self):
|
|
|
|
item = FurnitureTypes[self.furnitureType]
|
|
|
|
if FTAnimRate < len(item):
|
|
|
|
animRate = item[FTAnimRate]
|
|
|
|
if not animRate == None:
|
|
|
|
return item[FTAnimRate]
|
|
|
|
else:
|
|
|
|
return 1
|
|
|
|
else:
|
|
|
|
return 1
|
|
|
|
return
|
|
|
|
|
|
|
|
def setAnimRate(self, model, rate):
|
|
|
|
seqNodes = model.findAllMatches('**/seqNode*')
|
|
|
|
for seqNode in seqNodes:
|
|
|
|
seqNode.node().setPlayRate(rate)
|