Join also our Discord channel! Click here.

Spotlight: Señor Casaroja's Noesis

General game file tools that are useful for more than one game
Beedy
advanced
Posts: 40
Joined: Mon Dec 05, 2016 11:12 am
Has thanked: 7 times
Been thanked: 12 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Beedy » Wed Oct 09, 2019 5:49 pm

I tried to read materials from modelcontainer with 153 meshes, 65 materials and 41 textures. I assign textures to every material and then read materials to MatList and construct models with 153 range loop. When I load the file it appears 9945 (=153 x 65) materials in Noesis. It reads right material for every meshes but Noesis crashes when I go to Data Viewer because of huge amount of materials. When I move mdl.setModelMaterials(NoeModelMaterials(TexList, MatList)) out of range loop it appears 153 materials in Noesis but materials isn't loaded for meshes. What I do wrong?

Code: Select all

#Noesis python importer - EA NHL games stadium container .rx2 files - version 1.0
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("NHL Legacy (X360)", ".rx2")
	noesis.setHandlerTypeCheck(handle, noepyCheckType)
	noesis.setHandlerLoadModel(handle, noepyLoadModel)
	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)
    Magic = bs.readBytes(7)
    if Magic != b'\x89\x52\x57\x34\x78\x62\x32':
        return 0
    return 1  

#load the model
def noepyLoadModel(data, mdlList):
   VInfo = []
   VOff = []
   VBufferSize = []
   FInfo = []   
   FOff = []
   FBufferSize = []
   MatInfo = []
   MatIndexInfo = []
   MatIndexTable = []
   TexIndexInfo = []
   TexIndex = []   
   MatNames = []
   NameInfo = []
   TexList = []
   MatList = []
   MaterialInfo = []
   
   ctx = rapi.rpgCreateContext()
   bs = NoeBitStream(data, NOE_BIGENDIAN)
   bs.seek(0x20, NOESEEK_ABS)
   fileCount = bs.read(">i")
   bs.seek(12, NOESEEK_REL)
   fileTable = bs.read(">i")
   bs.seek(16, NOESEEK_REL)
   hdrSize = bs.read(">i")  
   bs.seek(fileTable[0], NOESEEK_ABS)
   meshCount = 0
   texCount = 0
   materialCount = 0
   ebCount = 0
   
   for i in range(0, fileCount[0]):
	    fileInfo = bs.read(">iiiii")
	    fileType = bs.readBytes(4)
	   			    
	    elif fileType == b'\x00\x02\x00\x05':
	   		bs.seek(-48, NOESEEK_REL)
	   		info = bs.read(">iiiiiiiiiiii")
	   		VOff.append([info[0]])
	   		VBufferSize.append([info[2]])
	   		VInfo.append([info[6]])
	   				 			   		
	    elif fileType == b'\x00\x02\x00\x07':
	   		bs.seek(-48, NOESEEK_REL)
	   		info = bs.read(">iiiiiiiiiiii")
	   		FOff.append([info[0]])
	   		FBufferSize.append([info[2]])
	   		FInfo.append([info[6]])	   		

	    elif fileType == b'\x00\x02\x00\x09':
	   		meshCount +=1 
	   		
	    elif fileType == b'\x00\xEB\x00\x03':
	   		MatIndexInfo.append([fileInfo[0]])
	   		ebCount +=1
	   		
	    elif fileType == b'\x00\xEC\x00\x10':
	   		NameInfo.append([fileInfo[0]])
	    
	    elif fileType == b'\x00\xEF\x00\x01':
	   		TexIndexInfo.append([fileInfo[0]])

	    elif fileType == b'\x00\xEF\x00\x05':
	   		MatInfo.append([fileInfo[0]])
	   		materialCount +=1				 			   		
   
#Read material names
   bs.seek(NameInfo[0][0], NOESEEK_ABS)
   nameCount = bs.read(">HH")
   bs.seek(4, NOESEEK_REL)
   for i in range(0, nameCount[1]):
   		nameOff = bs.read(">i")
   		nameType = bs.readBytes(4)
   		nameIndex = bs.read(">i")
   		pos = bs.tell()
   		if nameType == b'\x00\xEF\x00\x05':
   			bs.seek(nameOff[0], NOESEEK_ABS)
   			MatNames.append(bs.readString())
   			bs.seek(pos, NOESEEK_ABS)	
   			
#Read material indices for meshes
   for i in range(0, ebCount):
   		bs.seek(MatIndexInfo[i][0] + 0x10, NOESEEK_ABS)
   		contents = bs.read(">i")
   		tablesize = bs.read(">i")
   		bs.seek(tablesize[0] + 12, NOESEEK_REL)
   		for j in range(0, contents[0]):
   				materialIndex = bs.read(">i")
   				MatIndexTable.append(materialIndex[0])
   				bs.seek(40, NOESEEK_REL)

#Read texture indices for materials
   for i in range(0, materialCount):
   		bs.seek(TexIndexInfo[i][0] + 256, NOESEEK_ABS)
   		index = bs.read(">i")
   		textindex = index[0] // 2
   		TexIndex.append(str(textindex)+".tga")
   		
   for i in range(0, materialCount):
   		material = NoeMaterial(MatNames[i], TexIndex[i])
   		MatList.append(material) 
   		
 #Construct Models		  			   
   for i in range(0, meshCount):
   		bs.seek(VInfo[i][0] + 32, NOESEEK_ABS) #Seek to vertices info
   		VData = bs.read(">HHi") 
   		VBsize = VData[0]
   		VCount = VData[2]
   		bs.seek(FInfo[i][0] + 32, NOESEEK_ABS) #Seek to faces info  
   		FCount = bs.read(">HH")   
   		bs.seek(VOff[i][0] + hdrSize[0], NOESEEK_ABS) #Seek to Vertices Start
   		VertBuff = bs.readBytes(VBufferSize[i][0])
   		rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
   		rapi.rpgBindPositionBufferOfs(VertBuff, noesis.RPGEODATA_FLOAT, VBsize, 0)
   		rapi.rpgBindUV1BufferOfs(VertBuff, noesis.RPGEODATA_FLOAT, VBsize, 16)
   		bs.seek(FOff[i][0] + hdrSize[0], NOESEEK_ABS) #Seek to Faces Start
   		FaceBuff = bs.readBytes(FBufferSize[i][0])
   		rapi.rpgSetMaterial(MatNames[((MatIndexTable[i] - 1) // 3) - 28])
   		rapi.rpgCommitTriangles(FaceBuff, noesis.RPGEODATA_USHORT, FCount[1], noesis.RPGEO_TRIANGLE, 1)
   		mdl = rapi.rpgConstructModel()
   		mdl.setModelMaterials(NoeModelMaterials(TexList, MatList))
   		mdlList.append(mdl)         #important, don't forget to put your loaded model in the mdlList
   		rapi.rpgClearBufferBinds()
   		rapi.rpgReset()   
   
   return 1

Beedy
advanced
Posts: 40
Joined: Mon Dec 05, 2016 11:12 am
Has thanked: 7 times
Been thanked: 12 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Beedy » Thu Oct 10, 2019 7:36 am

I think that solution is read submeshes instead of construct every meshes to single model. Now I have 153 models 153 meshes 153 textures and 9945 materials. Can someone help me to fix the script to read 1 model 153 submeshes and 65 materials? I extract textures separately with name of texture index 1-41.
Here is model sample file with extracted textures:
https://app.box.com/s/gjpzsy19pb45g9cuncwrwl2ewifeg9dd
mdl_nhl_rx2_mat.py.zip
You do not have the required permissions to view the files attached to this post.

Beedy
advanced
Posts: 40
Joined: Mon Dec 05, 2016 11:12 am
Has thanked: 7 times
Been thanked: 12 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Beedy » Thu Oct 10, 2019 1:09 pm

Issue solved. I move mdl = rapi.rpgConstructModel(), mdl.setModelMaterials(NoeModelMaterials(TexList, MatList)), mdlList.append(mdl), rapi.rpgClearBufferBinds() and rapi.rpgReset() out of mesh loop.

Code: Select all

 #Construct Model		  			   
   for i in range(0, meshCount):
   		print(UVpos[i])
   		bs.seek(VInfo[i][0] + 32, NOESEEK_ABS) #Seek to vertices info
   		VData = bs.read(">HHi") 
   		VBsize = VData[0]
   		VCount = VData[2]
   		bs.seek(FInfo[i][0] + 32, NOESEEK_ABS) #Seek to faces info  
   		FCount = bs.read(">HH")   
   		bs.seek(VOff[i][0] + hdrSize[0], NOESEEK_ABS) #Seek to Vertices Start
   		VertBuff = bs.readBytes(VBufferSize[i][0])
   		rapi.rpgSetName("mesh" + str(i))
   		rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
   		rapi.rpgBindPositionBufferOfs(VertBuff, noesis.RPGEODATA_FLOAT, VBsize, 0)
   		rapi.rpgBindUV1BufferOfs(VertBuff, noesis.RPGEODATA_FLOAT, VBsize, UVpos[i])
   		bs.seek(FOff[i][0] + hdrSize[0], NOESEEK_ABS) #Seek to Faces Start
   		FaceBuff = bs.readBytes(FBufferSize[i][0])
   		rapi.rpgSetMaterial(MatNames[((MatIndexTable[i] - 1) // 3) - 28])
   		rapi.rpgCommitTriangles(FaceBuff, noesis.RPGEODATA_USHORT, FCount[1], noesis.RPGEO_TRIANGLE, 1)  
   mdl = rapi.rpgConstructModel()
   mdl.setModelMaterials(NoeModelMaterials(TexList, MatList))
   mdlList.append(mdl)
   rapi.rpgClearBufferBinds()
   rapi.rpgReset() 

ISKA
n00b
Posts: 11
Joined: Tue Apr 10, 2018 9:52 am

Re: Spotlight: Señor Casaroja's Noesis

Post by ISKA » Tue Oct 15, 2019 1:47 pm

Hi everyone. Im looking red dead redemption 1 fonts.
Can anyone say me font names and folders?
I found one folder is name fonts but even edit not change ingame anyone characters.

artworkplay
veteran
Posts: 114
Joined: Wed Oct 05, 2011 9:40 pm
Has thanked: 49 times
Been thanked: 4 times

Re: Spotlight: Señor Casaroja's Noesis

Post by artworkplay » Wed Oct 30, 2019 11:59 pm

I hope its ok to ask here...I've been unable to open Noesis on my new pc running windows 10 64 bit, it throws an error saying "noesis has stopped working" once i try to open it. is there a workaround for this? TIA

EDIT Added screenshot
Image

Lazov
advanced
Posts: 69
Joined: Sat Oct 08, 2016 11:56 am
Has thanked: 16 times
Been thanked: 44 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Lazov » Mon Nov 18, 2019 5:18 pm

Such a problem. The skeleton is displayed correctly during animation. But the model is distorted - very elongated. What could be the problem? In the transformation matrices?
Image

jayn23
mega-veteran
mega-veteran
Posts: 167
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 46 times
Been thanked: 149 times

Re: Spotlight: Señor Casaroja's Noesis

Post by jayn23 » Wed Nov 20, 2019 9:58 am

Such a problem. The skeleton is displayed correctly during animation. But the model is distorted - very elongated. What could be the problem? In the transformation matrices?
As far as i know transformation matrices affect only the skeleton so if skeleton is behaving (moving) correctly that isnt your issue.
My guess would be either incorrect weights or a scaling issue.

try manually scaling the mesh so its fits in size to skeleton if its still distorted then the weights are incorrect

neusi
ultra-n00b
Posts: 5
Joined: Thu Jan 31, 2019 2:55 am

Re: Spotlight: Señor Casaroja's Noesis

Post by neusi » Fri Jun 26, 2020 10:57 pm

Hi everyone!!
Sorry for make this dump question but... Its any way to make keybinding for command like "Batch Load", u know 1 for queue 2 for load atc. or for in data view setting like change value with key ??

User avatar
einherjar007
veteran
Posts: 93
Joined: Sat Dec 23, 2017 7:56 am
Has thanked: 104 times
Been thanked: 15 times
Contact:

Re: Spotlight: Señor Casaroja's Noesis

Post by einherjar007 » Sat Oct 17, 2020 1:00 pm

Animation preview has stopped working in a recent Noesis update, am I the only one?
I can play the animation manually by moving the timeline slider.

Kerilk
beginner
Posts: 38
Joined: Sun Aug 27, 2017 2:08 pm
Has thanked: 9 times
Been thanked: 36 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Kerilk » Sat Oct 24, 2020 7:02 am

I didn't notice this in version 4.434, at least not on my Bayonetta plugin.

User avatar
Joschka
mega-veteran
mega-veteran
Posts: 167
Joined: Fri Aug 09, 2019 3:51 pm
Has thanked: 38 times
Been thanked: 261 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Joschka » Sat Oct 24, 2020 12:06 pm

einherjar007 wrote:
Sat Oct 17, 2020 1:00 pm
Animation preview has stopped working in a recent Noesis update, am I the only one?
I can play the animation manually by moving the timeline slider.
It works fine for me too, did you try to redownload a fresh Noesis copy and use the "reset all" option under "View" ?

User avatar
einherjar007
veteran
Posts: 93
Joined: Sat Dec 23, 2017 7:56 am
Has thanked: 104 times
Been thanked: 15 times
Contact:

Re: Spotlight: Señor Casaroja's Noesis

Post by einherjar007 » Sat Oct 24, 2020 1:56 pm

Kerilk, Joschka, thanks reply.

Yes, I checked all resets and re-downloads. To be exact, it seems that this issue has occurred since the previous version
My PC uses an old GPU, which may be the cause.

-------------
*Edit

I investigated in more detail, but noesis v4428 plays the animation normally.
Animation does not play after v4431, and animation progresses only by manual mouse dragging on the timeline.
noesis.JPG
-------------
*Edit

Thank for the v4438, it's problem fix! Thanks for update and fixed problem!
You do not have the required permissions to view the files attached to this post.

Drawing
mega-veteran
mega-veteran
Posts: 205
Joined: Wed Jan 11, 2012 10:21 pm
Has thanked: 31 times
Been thanked: 7 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Drawing » Sun Nov 08, 2020 12:06 am

His it possible to add in noesis the possibility to decide if export fbx to version 7.4.0 or 7.7.0?
The actual fbx export version is 7.7.0 but most of users use an not updated version of 3dsm that doesn't support 7.7.0 .

mono24
ultra-veteran
ultra-veteran
Posts: 564
Joined: Sat Nov 06, 2010 12:27 am
Has thanked: 263 times
Been thanked: 116 times

Re: Spotlight: Señor Casaroja's Noesis

Post by mono24 » Sun Nov 08, 2020 2:54 pm

Drawing wrote:
Sun Nov 08, 2020 12:06 am
His it possible to add in noesis the possibility to decide if export fbx to version 7.4.0 or 7.7.0?...
Sure there is.
I highlighted the two options Noesis Advanced commands has for FBX in relation to FBX version exporting.
FBX_export.PNG
Once you click that Advanced commands button on right, you will load ALL commands available internally for Noesis export.
First command will allow you to specify your desired version while second the legacy will export to old version that was available before new updated FBX.
Basically in Advanced options above you type either:

Code: Select all

-fbxoldexport
or:

Code: Select all

-fbxexportver FBX201200
-fbxexportver FBX201400
-fbxexportver FBX201600
etc...
That way you test which ever works best suited your needs.

have fun
You do not have the required permissions to view the files attached to this post.

Drawing
mega-veteran
mega-veteran
Posts: 205
Joined: Wed Jan 11, 2012 10:21 pm
Has thanked: 31 times
Been thanked: 7 times

Re: Spotlight: Señor Casaroja's Noesis

Post by Drawing » Sun Nov 08, 2020 6:53 pm

mono24 wrote:
Sun Nov 08, 2020 2:54 pm

I highlighted the two options Noesis Advanced commands has for FBX in relation to FBX version exporting...
have fun
thanks it solved the problem :)

Post Reply