Noesis Encode Png file?
Posted: Thu Apr 04, 2019 3:55 am
I'm writing an exporter for Noesis for a model format that uses internal png files to store textures.
I'm guessing the pixel data is the raw RGB or RGBA data. I've been looking through the rapi interface, but can't find what I'm looking for. Is there a way to encode png files through the python API?
Edit:
FML, found it right after posting:
Another edit:
Found that textures are not included by default on export. This line is needed as well.
Edit:
I'm getting 0 bytes of output from "data = rapi.imageEncodeRaw(pixelData, width, height, ".png")", is there a code snippet for encoding png's?
Code: Select all
class NoeTexture:
def __init__(self, name, width, height, pixelData, pixelType = noesis.NOESISTEX_RGBA32):
self.name = name
self.width = width
self.height = height
self.pixelData = pixelData
self.pixelType = pixelType
self.flags = 0
self.mipCount = 0Edit:
FML, found it right after posting:
Code: Select all
data = rapi.imageEncodeRaw(pixelData, width, height, ".png")Found that textures are not included by default on export. This line is needed as well.
Code: Select all
texList = rapi.loadMdlTextures(mdl)I'm getting 0 bytes of output from "data = rapi.imageEncodeRaw(pixelData, width, height, ".png")", is there a code snippet for encoding png's?