Page 1 of 2

Resident Evil Outbreak Noesis script

Posted: Sat Jul 07, 2018 8:19 pm
by Steve666
Hi everyone, I'm looking for help importing REO Models in noesis.

I have a noesis script but its Incomplete and only imports REO skeleton's at the moment so I'm looking for someone to help finish this noesis script.
I uploaded some samples from REO here http://www.mediafire.com/folder/jgti51rbb59pw/reo .

Also I didn't make this script.

Code: Select all

from inc_noesis import *
import noesis
import rapi


def registerNoesisTypes():
	handle = noesis.register("Resident Evil Outbreak skeletons", ".AHI")
	noesis.setHandlerTypeCheck(handle, noepyCheckType)
	noesis.setHandlerLoadModel(handle, noepyLoadModel)
	noesis.logPopup()
	return 1



def noepyCheckType(data):
	f = NoeBitStream(data)
	if len(data) < 16:
		return 0
	return 1


def noepyLoadModel(data, mdlList):
	ctxt = rapi.rpgCreateContext()
	rapi.rpgSetOption(noesis.RPGOPT_TRIWINDBACKWARD, 0)
	f = NoeBitStream(data)
	
	boneList=[]
	
	unk1=f.read("i")[0]
	numBones=f.read("i")[0]
	fileSize=f.read("i")[0]
	unkA=f.read("4i")[0]
	for x in range(0,numBones-1):
		start=f.read("H")[0]
		unkB=f.read("H")[0]
		unkC=f.read("i")[0]
		boneSize=f.read("i")[0]
		boneID=f.read("i")[0]
		boneName="bone " + str(boneID)
		boneParent=f.read("i")[0]
		print (boneParent)
		boneParentName="bone " + str(boneParent)
		boneChild=f.read("i")[0]
		unkD=f.read("i")[0]
		scl=NoeVec3.fromBytes(f.readBytes(12))
		s4=f.read("f")[0]
		q=NoeQuat.fromBytes(f.readBytes(16))
		trans=NoeVec3.fromBytes(f.readBytes(12))
		t4=f.read(">f")[0]
		unkE=f.read("i")[0]
		unkF=f.read("i")[0]
		unkG=f.read("46i")[0]
		mtrx = q.toMat43(1)
		mtrx[0] *= scl
		mtrx[1] *= scl
		mtrx[2] *= scl
		mtrx[3] = trans
		
		if boneID==0:
			boneList.append(NoeBone(boneID+1, boneName, mtrx, None, boneParent))
		else:
			boneList.append(NoeBone(boneID, boneName, mtrx, None, boneParent))
	
		
		
		
	boneList = rapi.multiplyBones(boneList)
	mdl =  NoeModel()
	mdlList.append(mdl)
	mdl.setBones(boneList)
	
	
	rapi.rpgClearBufferBinds()
	
	return 23474868				#because I said so

Re: Resident Evil Outbreak Noesis script

Posted: Sun Jul 08, 2018 10:48 am
by shakotay2
Steve666 wrote:so I'm looking for someone to help finish this noesis script.
i.e. a Noesis script that can import .amo meshes? (Don't want to be mean but I don't think that someone will write it.
Iirc Predator created a max script/tool to import Resident Evil 5 assets into 3dsmax. Maybe it supports amo, too.)

Anyways, you'll need someone to find out where's the bone ids and weights to be located, maybe in the amo file.
Also I didn't make this script.
Then who did?

I used Noesis to create an smd from the skeleton then imported it to blender:
P00_00_dkrl.jpg

Re: Resident Evil Outbreak Noesis script

Posted: Sun Jul 08, 2018 4:04 pm
by akderebur
shakotay2 wrote: Anyways, you'll need someone to find out where's the bone ids and weights to be located, maybe in the amo file.
In the file "HE00_00.AMO" there is a data starting at 0x1B9CC, which I believe are bone ids and weights. The structure goes like this : number of entries / number of bones influencing the vertex (int), bone id (int), weight (float, 0 - 100 range).

Here is an example with 2 entries / bones.
re_bw.png

Re: Resident Evil Outbreak Noesis script

Posted: Sun Jul 08, 2018 7:56 pm
by Steve666
Thanks you akderebur for taking the time to help.
by the way i don't know how to write Noesis script so I still looking for help.
shakotay2 wrote:
Steve666 wrote:Also I didn't make this script.
Then who did?
Its created by someone named "The dude" I found that script here https://pastebin.com/kp1RgZNx
shakotay2 wrote: I used Noesis to create an smd from the skeleton then imported it to blender:
shakotay2 that method doesn't work on r0060100.AMO map files.
Also the nbdx_obj.exe doesn't export the r0060100.AMO map files correctly.

Re: Resident Evil Outbreak Noesis script

Posted: Sun Jul 08, 2018 9:19 pm
by shakotay2
Steve666 wrote:Its created by someone named "The dude" I found that script here https://pastebin.com/kp1RgZNx
Thanks, but I really don't get it why you removed this line from the script:
#Code is by TheDude
Steve666 wrote:
shakotay2 wrote: I used Noesis to create an smd from the skeleton then imported it to blender:
shakotay2 that method doesn't work on r0060100.AMO map files.
You should know that maps usually don't have skeletons (huuh?).
btw: there was no amo map file in your samples, was it?

edit/correction: okay, skeleton for a room, sounds funny:
shadowmoy wrote:unsupported files are the AHI files that contain the scene bones /skeleton, in order to make the room look correct you need to load the ahi file and the bone id in each mesh block then transform/rotate the mesh according to the bone , same trick is used in re4 ps2 and pc version and maybe some other re games (not used in re5 or re6)
Steve666 wrote:Also the nbdx_obj.exe doesn't export the r0060100.AMO map files correctly.
Use the quickbms script mentioned here:
viewtopic.php?f=16&t=9923&p=82047&hilit ... bms#p82047

(dunno whether it works with maps, though)

Re: Resident Evil Outbreak Noesis script

Posted: Sun Jul 08, 2018 10:10 pm
by Steve666
shakotay2 wrote:Use the quickbms script mentioned here:
viewtopic.php?f=16&t=9923&p=82047&hilit ... bms#p82047

(dunno whether it works with maps, though)
I tried that method too, it doesn't export r0060100.AMO room files correctly either.

Re: Resident Evil Outbreak Noesis script

Posted: Mon Jul 09, 2018 9:22 am
by shakotay2
I see; it's required to apply skeleton data (translation from the smd file) to the submeshes, for example
20 2925.000000 250.000000 5700.000000 0.000000 -0.000000 0.000000
(so x=2925.0 y=250.0 z=5700.0)
21 2925.000000 199.999939 5250.000000 0.000000 -0.000000 0.000000

to 20.3ds and 21.3ds (benches) after import into blender.

Too busy atm to check it but should work for all 115 submeshes.
(SM 3 is the only one with rotation != 0 degrees, btw.)

(Seems there is some unwanted rotation with the quickbms 3ds creation, though, -90° counterclockwise related to x axis.
You could try to swap above y and z to circumvent his.)

Re: Resident Evil Outbreak Noesis script

Posted: Mon Jul 09, 2018 7:30 pm
by Steve666
shakotay2 wrote:I see; it's required to apply skeleton data (translation from the smd file) to the submeshes, for example
20 2925.000000 250.000000 5700.000000 0.000000 -0.000000 0.000000
(so x=2925.0 y=250.0 z=5700.0)
21 2925.000000 199.999939 5250.000000 0.000000 -0.000000 0.000000
Thanks shakotay2, that works.

Re: Resident Evil Outbreak Noesis script

Posted: Mon Jul 09, 2018 9:26 pm
by shakotay2
Steve666 wrote:
shakotay2 wrote:I see; it's required to apply skeleton data (translation from the smd file) to the submeshes, for example
20 2925.000000 250.000000 5700.000000 0.000000 -0.000000 0.000000
(so x=2925.0 y=250.0 z=5700.0)
21 2925.000000 199.999939 5250.000000 0.000000 -0.000000 0.000000
Thanks shakotay2, that works.
well, in which way does it work?

I made a blender python script to apply all 115 offsets and the meshes are not clumped any more but is this what it should look like?
r0060100-moved.jpg
(I exchanged the applied offsets y and z but no improvement.)
About 12 parts were being "blasted away", i.e. sm 12 and sm 37 for example but dunno what the problem could be.

Re: Resident Evil Outbreak Noesis script

Posted: Tue Jul 10, 2018 1:41 am
by Steve666
shakotay2 wrote:I made a blender python script to apply all 115 offsets and the meshes are not clumped any more but is this what it should look like?
No its not supposed to look like that
shakotay2 wrote:in which way does it work?
I copied the skeleton translation data on to one of the room meshes but that doesn't seem to work for all the room files

Didn't work for this room file.
[img]http://www.mediafire.com/convkey/44c1/ynqns4t9tt63gzrzg.jpg[/img]

Re: Resident Evil Outbreak Noesis script

Posted: Tue Jul 10, 2018 2:48 pm
by shakotay2
After I realized that blender's script generated sorted filelist spoils the indices it looks a little bit better (maybe one index off or something like that?):
REO1.jpg
(I'd need an ingame screenshoot from that room to tell more.)

Re: Resident Evil Outbreak Noesis script

Posted: Tue Jul 10, 2018 11:15 pm
by Steve666
I'm not sure what level that room is on. Also can you upload your blender script so i can try it out?

Re: Resident Evil Outbreak Noesis script

Posted: Wed Jul 11, 2018 11:09 am
by shakotay2
Steve666 wrote:Also can you upload your blender script so i can try it out?
I need to find out the problem before (wouldn't like to release or pm scripts with stupid bugs :D ).

Maybe you can send me your "best looking" room (blender screenshoot, *.amo and *.ahi file ) so that I can test the script?

Re: Resident Evil Outbreak Noesis script

Posted: Wed Jul 11, 2018 7:24 pm
by Steve666
shakotay2 wrote:Maybe you can send me your "best looking" room (blender screenshoot, *.amo and *.ahi file ) so that I can test the script?
Okay, I uploaded the room file here https://www.mediafire.com/folder/jgti51 ... i7vmde4uc8
[img]https://www.mediafire.com/convkey/4bdf/oejtvjqcqtzqq3pzg.jpg?size_id=7[/img]

Re: Resident Evil Outbreak Noesis script

Posted: Wed Jul 11, 2018 8:51 pm
by shakotay2
well, seems you got it! :) All I get is a mess, more or less. This is my nearest "hit":
R0150100.jpg
I copied the skeleton translation data on to one of the room meshes
Can you exactly explain that process, please?