Jump to content

Ridge Racer series (model and maps included)


UndercoverBoy833

Recommended Posts

you can post the sample file related to any Ridge Racer games till Slipstream mobile, so I'm starting with my sample model file from Ridge Racer 7 PS3. Since I was importing it with this blender addon, it gave me different errors for wheel mdl and car mdl.

car error:

Python: Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Ridge-Racer-Blender-Addon-master\__init__.py", line 42, in execute
    return import_ridgeRacer.main(self.filepath, self.clear_scene)
  File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Ridge-Racer-Blender-Addon-master\import_ridgeRacer.py", line 283, in main
    r7c.read(bs)
  File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Ridge-Racer-Blender-Addon-master\Formats\RidgeRacer7\r7c.py", line 65, in read
    self.read_lod(binaryReader)
TypeError: R7C.read_lod() missing 1 required positional argument: 'lod_number'

wheel error:

Python: Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Ridge-Racer-Blender-Addon-master\__init__.py", line 42, in execute
    return import_ridgeRacer.main(self.filepath, self.clear_scene)
  File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Ridge-Racer-Blender-Addon-master\import_ridgeRacer.py", line 287, in main
    r7w.read(bs)
  File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Ridge-Racer-Blender-Addon-master\Formats\RidgeRacer7\r7w.py", line 23, in read
    self.read_lods(binaryReader)
  File "C:\Users\Admin\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\Ridge-Racer-Blender-Addon-master\Formats\RidgeRacer7\r7w.py", line 34, in read_lods
    R7W_part = R7W.R7W_PART(binaryReader, lod_offset)
TypeError: R7W.R7W_PART.__init__() takes 1 positional argument but 3 were given

whereas the car mdl import worked for Ridge Racer 6 format.

so yeah, I may be making the same topic but for the texture sides.

raggio.zip wheel.zip

Edited by UndercoverBoy833
updated my first post and added import error codes of mdl files
Link to comment
Share on other sites

just fast hach for get all meshes using MRP

edit: plugin for Noesis (with out uvs) fmt_RidgeRacer.py

image.thumb.png.3d9a408239976ce006e016d0754bba30.png

import mrp
import struct

def findall(p, s):
    i = s.find(p)
    while i != -1:
        yield i
        i = s.find(p, i+1)

bf = mrp.get_bfile('>')
data = bf.read()
result = [i for i in findall(b'R7O', data)]

all_mesh = []
for x in result:
    bf.seek(x)
    unk = [bf.readInt() for i in range(6)]
    bf.seek(x+unk[4])
    _unk = [bf.readInt() for i in range(5)]
    stride = (unk[5] - (unk[4]+20))//_unk[4]
    vpoints = []
    for i in range(_unk[4]):
        vpoints.append((bf.readHalfFloat(),bf.readHalfFloat(),bf.readHalfFloat()))
        bf.seek(stride-6,1)
    bf.seek(x+unk[5])
    _unk = [bf.readInt() for i in range(4)]
    ibuf = bf.read(_unk[3]*2)
    #fix_order
    ibuf = struct.unpack('>%iH'%_unk[3], ibuf)
    ibuf = struct.pack('<%iH'%_unk[3], *ibuf)
    #end_fix_order
    name = 'mesh_%i'%x
    all_mesh.append(name)
    Mesh = mrp.create_mesh(name)
    Mesh.set_vertices(vpoints)
    Mesh.set_faces(ibuf, fm="TStripFF", tp="Short")

mrp.render(all_mesh)

 

Edited by Durik256
  • Thanks 1
Link to comment
Share on other sites

11 hours ago, shak-otay said:

uvs

As far as I remember, you are right, UVs are similar to half floats, but each submesh has a different stride and offset for UVs, so I didn't bother parsing the attributes and skipped UVs. (I'm lazy xD)

Edited by Durik256
Link to comment
Share on other sites

1 hour ago, Durik256 said:

Насколько я помню, вы правы, UV похожи на полуфлоты, но каждая подсетка имеет разный шаг и смещение для UV, поэтому я не стал анализировать атрибуты и пропустил UV. (Мне лень xd)

Talk in english please, dont know where you quoted that russian from formerly tbh, dont see any here... But dont speak foreign languages here, thanks...

Majority of the users dont understand probably what you wrote without translator 😉

Link to comment
Share on other sites

1 hour ago, wssdude said:

But dont speak foreign languages here, thanks..

the original text was in English. This was done by the browser's auto-translator while editing the post. (the translator has public access, I think this would not be a problem even if I did it intentionally)

Edited by Durik256
Link to comment
Share on other sites

21 minutes ago, Durik256 said:

(the translator has public access, I think this would not be a problem even if I did it intentionally)

I didnt give you any formal warnings, dont worry 😉 Just wanted to point it out, didnt know what to make of it till I put it in the translator and would bet I was not the only one...

Anyone can use translators, true, but they are not perfect 🙂

We prefer to keep the forums in English ideally, as stated by rules. They do not explicitly forbid you from using other languages, but would be better to not break out of it for answers to posts, for better general understanding, is all. 🙂

Link to comment
Share on other sites

  • 2 months later...
On 11/4/2023 at 11:30 PM, Durik256 said:

just fast hach for get all meshes using MRP

edit: plugin for Noesis (with out uvs) fmt_RidgeRacer.py

image.thumb.png.3d9a408239976ce006e016d0754bba30.png

I can't see the line clearly "vpoints.append((bf.readHalfFloat(),bf.readHa.." so that i can try to copy them in Model researcher pro.image.png.9869e30a387f9df68ea411e9012848e2.png

 

Edited by UndercoverBoy833
existing screenshot I copied is blurry
Link to comment
Share on other sites

3 hours ago, UndercoverBoy833 said:

I can't see the line clearly "vpoints.append((bf.readHalfFloat(),bf.readHa.." so that i can try to copy them in Model researcher pro.

why do you need to rewrite this? I made a noesis plugin. your file "kaszni.scx" is a completely different format and it is compressed using zlib

*I edited the old post and added all the code for mrp

**structure [*.scx]

4bytes magic//[TEPK]
int numBlock

foreach numBlock:
	int offset
    int decomSize
    int comSize

 

several submesh:

-3.png.793c6de9959979a0088e27c32b6b727b.png

 

Edited by Durik256
Link to comment
Share on other sites

16 hours ago, Durik256 said:

why do you need to rewrite this? I made a noesis plugin.

well for the first place since your noesis plugin requires to open .brs, I have to convert them from my sample file to brs using mrp before using your noesis plugin you made, so that's where it stopped to replicate your code you wrote a while ago.

 

my english is not the best atm so

Edited by UndercoverBoy833
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...