예제 #1
0
    def __init__(self):
        super(MainWindow,self).__init__()

        self.resize(500, 40)
        self.setWindowTitle("Key Frame View")



        self.keyPanel = KeyFramePanel(None)

        dataModel = DataModel(dataContainer = DemoData(50),prefetchSize = 0)
        transModel = TransformModel()
        transModel.setModel(dataModel)

        transModel.setValueScale(0,200)
        dataModel.setPos(2)
        self.keyPanel.connect_to_transform(transModel)


        k = KeyFrameList()
        k.addItem(KeyFrame(0.1))
        k.addItem(KeyFrame(0.9))

        # k = KeyFrameList._from_JSON(open("test.json").read())

        # print k

        # self.keyPanel.setModel(k)

        self.keyPanel.load_from_JSON("test.json")

        self.setCentralWidget(self.keyPanel)

        self.setStyleSheet("background-color:black;")
예제 #2
0
 def load_from_JSON(self,fName):
     with open(fName,"r") as f:
         try:
             k = KeyFrameList._from_JSON(f.read())
             self.setModel(k)
             
         except Exception as e:
             print e
             print "not a valid keyframe json file: %s"%fName