06-19-2013, 06:35 AM
(This post was last modified: 06-19-2013, 06:58 AM by SoulofDeity.)
(06-18-2013, 09:31 PM)RodLima Wrote:Quote:btw RodLima, I forgot to mention that you can make the animations import a lot faster if you buffer segment 7. that's how the model itself imports so fast.
Um, but the normal models that don't use the segment_07 took same time to import, I think it take some time because blender uses only one core to do the python Transforms
that shouldn't be a problem at all. if the script can convert / export 20+ textures and locate / import 21 + display lists, texture / position / and skin all of them instantaneously, there's no reason why a few matrix instructions should cause it to lag out so badly. All modern games execute hundreds of matrix instructions a second.
The only thing that should cause such a bad lag is if you're using file operations. Aside from segment_07, are you using the already buffered data for segment_05/06, or are you using a file handle?
EDIT:
As far as arrays in python go, its simple.
Code:
myarray = [] # initialize an empty array
myarray = [0, 2, 3] #initialize an array
myarray[0] = 1 # assign an element
myarray[1:] # this is a slice of just [2, 3]
myarray[:1] # this is a slice of just [1, 2]
myarray[:-1] # this is a slice of just [1, 2]
myarray.append(4) # add 1 item to an array
myarray.extend([4]) # add items from another array to this array
offset = 0
val = unpack_from(">L", myarray, offset)[0] # read a big endian unsigned long value (long = 32 bit) from the array
# unpack_from returns a tuple. the first argument is the format specifier where:
# > = big endian, < = little endian
# capital letter = unsigned, lowercase letter = signed
# B = byte, H = halfword (16-bit, 2 bytes) L = long (32-bit, 4 bytes)
# if you did unpack_from(">LLL", myarray, offset), it would return a tuple with 3 items because 3 L's
# how to buffer a file
file = open(filename, 'rb')
myarray = file.read()
file.close()