Ejemplo n.º 1
0
    def get_loading_information(self):
        info = []
        info.append([
            "Loop Mode:", j3d.loop_mode[self.loop_mode], "Duration:",
            self.duration, "Tangent Type:", j3d.tan_type[self.tan_type]
        ])
        info.append(["Cluster Number"])

        keyframes_dictionary = {}
        keyframes_dictionary[0] = []

        i = len(info)

        count = 0

        for anim in self.animations:
            info.append(["Cluster " + str(count)])

            array = anim.seq

            keyframes_dictionary = j3d.combine_dicts(array,
                                                     keyframes_dictionary)

            i = len(info)

            count += 1

        write_values(info, keyframes_dictionary, 1)
        return info
Ejemplo n.º 2
0
    def get_loading_information(self):
        info = []
        info.append( [ "Loop Mode:", j3d.loop_mode[self.loop_mode], "Angle Scale:", self.anglescale, "Duration:", self.duration, "Tan Type:", self.tan_type] )
        info.append( ["Bone Name", "Component"])
        
        keyframes_dictionary = {}
        keyframes_dictionary[0] = []
        
        i = len( info ) 
        
        count = 0
        
        for anim in self.animations:
            if anim.name == "":
                info.append( ["Joint " + str(count)] )
            else:
                info.append( [anim.name] )
            things = ["Scale X:", "Scale Y:", "Scale Z:", "Rotation X:", "Rotation Y:", "Rotation Z:",
                "Translation X:", "Translation Y:", "Translation Z:"]
            
            for j in range (len ( things ) ):    
                comp = things[j]
                if j == 0:
                    info[i].append(comp)
                elif j == 1:
                    if anim.tan_inter == 0:
                        info.append( ["LLLL", comp] )
                    elif anim.tan_inter == 1:
                        info.append( ["SSSS", comp] )
                else:
                    info.append( ["", comp] )
                
                comp_dict = {}
                if comp[0:1] == "S":
                    comp_dict = anim.scale
                elif comp[0:1] == "R":
                    comp_dict = anim.rotation
                else: 
                    comp_dict = anim.translation
                    

                array = comp_dict[ comp[-2:-1] ]
                
                #print(array)                          
                 
                
                keyframes_dictionary = j3d.combine_dicts(array, keyframes_dictionary)
            i = len(info)
            
            count += 1
            
        write_values(info, keyframes_dictionary, 1)
        return info  
Ejemplo n.º 3
0
    def get_loading_information(self):

        info = []
        info.append([
            "Loop Mode:", j3d.loop_mode[self.loop_mode], "Duration:",
            self.duration, "Tan Type:", j3d.tan_type[self.tan_type]
        ])

        keyframes_dictionary = {}
        keyframes_dictionary[0] = []

        info.append(["Material Name", "Channel"])

        i = len(info)

        for anim in self.animations:
            info.append([anim.name])
            things = ["Red", "Green", "Blue", "Alpha"]

            for j in range(len(things)):
                comp = things[j]
                if j == 0:
                    info[i].append(comp)
                else:
                    info.append(["", comp])

                array = anim.component[comp[0:1]]

                #print (array)
                keyframes_dictionary = j3d.combine_dicts(
                    array, keyframes_dictionary)

            i = len(info)

        write_values(info, keyframes_dictionary, 1)

        #print(info)
        return info
Ejemplo n.º 4
0
    def get_loading_information(self):

        info = []
        info.append([self.loop_mode, self.duration, self.tan_type])
        #info.append( ["Loop Mode:", j3d.loop_mode[self.loop_mode] , "Duration:", self.duration, "Tan Type:", j3d.tan_type[1] ] )
        
        keyframes_dictionary = {}
        keyframes_dictionary[0] = []
        
        
        info.append( ["Material Name", "Color Index", "Channel"] )
        
        i = len( info ) 
        
        for anim in self.register_animations:
            things = ["Red:", "Green:", "Blue:", "Alpha:"]
            
            
            for j in range (len ( things ) ):    
                comp = things[j]
                if j < 2:
                
                    if j == 0:
                        info.append( [anim.name, anim.unknown, comp] )
                    elif j == 1:
                        info.append( ["Register", "", comp] )
                else:
                    info.append( ["", "", comp] )
            
                
                array = anim.component[comp[0:1]]
                
                #print (array)
                keyframes_dictionary = j3d.combine_dicts(array, keyframes_dictionary)
                
            
            i = len(info)
            
            #write_values(info, keyframes_dictionary, 2)
            
        
        
        #info.append( ["Constant Animations"] )
        
            
        l = len( info )  
        
        print ("length " + str(l) )

        for anim in self.constant_animations:
            things = ["Red", "Green", "Blue", "Alpha"]
            
            
            for j in range (len ( things ) ):    
                comp = things[j]
                if j < 2:            
                    if j == 0:
                        info.append( [anim.name, anim.unknown, comp] )
                    elif j == 1:
                        info.append( ["Constant", "", comp] )
                else:
                    info.append( ["", "", comp] )
            
                
                array = anim.component[comp[0:1]]
                keyframes_dictionary = j3d.combine_dicts(array, keyframes_dictionary)
                """
                #print (array)
                thismat_kf = {}
                for value in array:
                    thismat_kf[int(value.time)] = value.value
                    
                for k in keyframes_dictionary.keys(): #if there is a keyframe that does not apply to the current material, pad
                    if not k in thismat_kf.keys():
                        keyframes_dictionary[int(k)].append("")
                    
                for k in thismat_kf.keys():
                    if k in keyframes_dictionary: 
                        keyframes_dictionary[int(k)].append(thismat_kf[k])
                    else: #if it's a new keyframe
                        to_add = []
                        #for count in range(int( len(info) - l - 4 )):
                        for count in range( len(keyframes_dictionary[0]) - 1 ):
                            to_add.append("")
                        to_add.append(thismat_kf[k])
                        keyframes_dictionary[int(k)] = (to_add) 
                """
        #print( keyframes_dictionary)
        
        write_values(info, keyframes_dictionary, 1)
        
        #print(info)
        return info  
Ejemplo n.º 5
0
    def get_loading_information(self):
        info = []
        info.append([self.loop_mode, self.duration, self.tan_type])
        #info.append( ["Loop_mode", j3d.loop_mode[self.loop_mode], "Angle Scale:", self.anglescale,            "Duration:", self.duration, "Unknown:", self.unknown_address, "Tan Type:", j3d.tan_type[self.tan_type] ] )
        info.append(["Material name", "Tangent Interpolation", "Component"])

        keyframes_dictionary = {}
        keyframes_dictionary[0] = []

        i = len(info)

        for anim in self.animations:

            things = [
                "Scale U:", "Scale V:", "Scale W:", "Rotation U:",
                "Rotation V:", "Rotation W:", "Translation U:",
                "Translation V:", "Translation W:"
            ]

            for j in range(len(things)):
                comp = things[j]
                if j < 5:
                    if j == 0:
                        info.append([anim.name])
                    elif j == 1:
                        info.append(["Texture Index"])
                    elif j == 2:
                        info.append([str(anim.matindex)])
                    elif j == 3:
                        info.append(["Center"])
                    elif j == 4:
                        info.append([anim.center])
                else:
                    info.append([""])

                if anim.tan_inter[j] == 1:
                    info[-1].append("SSSS")

                else:
                    info[-1].append("LLLL")

                info[-1].append(comp)

                comp_dict = {}
                if comp[0:1] == "S":
                    comp_dict = anim.scale
                elif comp[0:1] == "R":
                    comp_dict = anim.rotation
                else:

                    comp_dict = anim.translation

                array = comp_dict[comp[-2:-1]]

                #print(array)

                keyframes_dictionary = j3d.combine_dicts(
                    array, keyframes_dictionary)
            i = len(info)

        write_values(info, keyframes_dictionary, 1)
        return info