You can read and reply to posts and download all mods without registering.
We're an independent and non-profit fan-site. Find out more about us here.
// Each element, x,y,z has 1 bit of sign, 1 bit of integer, and 8 bits// of fraction, for 10 bytes total. So the x, y, and z values of each// lighting normal can be extracted in the following manner:#define X_NORM(norm) ((short)((norm>>16)&0xFFC0))/16384.0#define Y_NORM(norm) ((short)((norm>>6)&0xFFC0))/16384.0#define Z_NORM(norm) ((short)((norm<<4)&0xFFC0))/16384.0
def pack_light(xyz): result = 0 shift = 22 for f in xyz: sign = int(f < 0) * 512 val = int(abs(f) * 256) result |= (sign + val) << shift shift -= 10 return pack('<I', result)
def pack_light2(xyz): result = 0 shift = 22 for f in xyz: fi = int(f * (511 + int(f < 0))) result |= (1024 * int(fi < 0) + fi) << shift shift -= 10 return pack('<I', result)
Seems like looking at the part of the leaked source that actually uses the unpacked data would provide the best information on how to pack it.
This object has no need for it.
That being said, have you tried adding Renderer/Transparency (alpha):1 to it?