I just did this:
Code: Select all
#Noesis Python model import+export test module, imports/exports some data from/to a made-up format
from inc_noesis import *
import noesis
#rapi methods should only be used during handler callbacks
import rapi
#registerNoesisTypes is called by Noesis to allow the script to register formats.
#Do not implement this function in script files unless you want them to be dedicated format modules!
def registerNoesisTypes():
handle = noesis.register("S4 League", ".scn")
noesis.setHandlerTypeCheck(handle, noepyCheckType)
noesis.setHandlerLoadModel(handle, noepyLoadModel) #see also noepyLoadModelRPG
#noesis.setHandlerWriteModel(handle, noepyWriteModel)
#noesis.setHandlerWriteAnim(handle, noepyWriteAnim)
noesis.logPopup()
print("The log can be useful for catching debug prints from preview loads.\nBut don't leave it on when you release your script, or it will probably annoy people.")
return 1
#check if it's this type based on the data
def noepyCheckType(data):
bs = NoeBitStream(data)
if bs.readInt() != 0x01000000 :
return 0
return 1
#load the model
def noepyLoadModel(data, mdlList):
ctx = rapi.rpgCreateContext()
bs = NoeBitStream(data)
rapi.rpgClearBufferBinds()
hdrInfo = bs.read("i")
print(hdrInfo)
return 1
I think it has something to do with the header reading, but i don't know what to do.
I'm not sure if this is supposed to happen, since the images from the tutorial are missing and i'm not sure if i should continue or not.
I know this is one of those mistakes that will make you be ashamed for life, but i don't know what is wrong, i'm sorry
File i'm trying to read is attached in the post