Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Ninja Ripper

General game file tools that are useful for more than one game
Post Reply
Sanya
n00b
Posts: 15
Joined: Thu Mar 17, 2011 10:36 am
Been thanked: 1 time

Re: Ninja Ripper

Post by Sanya »

Sammie wrote:
Sanya wrote: ugh, not really what I had expected.
Thx for bug-reporting. Some meshes couldn't be loaded. They had another file-structure then the game-models I have tested.
I have updated my script now [download] Still not perfect, but it loads your sunglasses.
If you have more corrupt meshes, please uploading two or three .rip files
yeah, works pretty nice :up:

http://rghost.ru/43190242

another rip. There's no such mess, just inverted normals. Just havent lots of games ATM, tested on few. All rips from this game has this problem.


And about UVs. Anyway to change it like in max import plugin (maybe in python script, if there's no way to make popup menu)? Models itself are correct, but UVs are not.

Noesis script is way better, since it take no time at all to load + faster preview. I think every user of ninja ripper would appriciate your work :) .
RacingFreak
veteran
Posts: 136
Joined: Fri Feb 11, 2011 10:44 am
Location: Bulgaria
Has thanked: 50 times
Been thanked: 19 times

Re: Ninja Ripper

Post by RacingFreak »

Excelleenntt, waiting for UV mapping
Sammie
veteran
Posts: 106
Joined: Wed Apr 25, 2012 12:27 pm
Has thanked: 9 times
Been thanked: 34 times

Re: Ninja Ripper

Post by Sammie »

Sanya wrote:yeah, works pretty nice :up:

http://rghost.ru/43190242

another rip. There's no such mess, just inverted normals. Just havent lots of games ATM, tested on few. All rips from this game has this problem.


And about UVs. Anyway to change it like in max import plugin (maybe in python script, if there's no way to make popup menu)? Models itself are correct, but UVs are not.

Noesis script is way better, since it take no time at all to load + faster preview. I think every user of ninja ripper would appriciate your work :) .
As far as I know, neosis had no possibilities for popups per plugin.

I had no problems with the UVs or Face-Normals on my own game models. But every game produces other rip files with different data-structure. Its not really possible to make an automated version, which load every type of model. See the ninjaripper-instructions to understand the problem.

As far as I can see, your car .rip has no valid UV-data, or maybe I cannot figured out, how the data is stored.
The 3DSMax-Importer is not be able to load the correct UVs, too. I see 3 floats for the vertices and then a row of integers, but no UV-floats, maybe half-floats, I don't know.
(-56.753353118896484 | -24.916292190551758 | 37.73585510253906 | -1.0 | 255 | 255 | 255 | 255 | 129 | 48 | 195 | 55 | 214 | 131 | 34 | 63 | 38 | 164 | 45 | 63)

The car-.rip has TEXCOORD-Blocks, but they filled with these useless integer-vales (index 8-11 = 129 | 48 | 195 | 55 and index 16-19 = 38 | 164 | 45 | 63), but this should be floats between 0|1.
214 | 131 | 34 | 63 is declared to be Normals-Data, but should be floats, too. Dont know why - blackninja should take a look at this and tell us how the data is stored. ;)
index 4-7 (255 | 255 | 255 | 255) is a COLOR-block - pure white. If blackninja could make the correct changes for the 3DSMax-Importer, then I can update the plugin for this type of models.

For your sunglasses-rip its a similar problem. It has UVs but the 3DSMax-Importer is reading the false block (0|1), instead of 10|11. That is why you can change the parameters manually in the 3DSMax-Importer.
If you want to load the correct UVs in neosis for this game-models you have change this variables in the plugin:

Code: Select all

g_VertexFormatRecog = 1 # default 0
g_Tc0_U_Idx = 10 # default 6
g_Tc0_V_Idx = 11 # default 7
I rewrote the plugin to speed it up a little bit to prevent to many vertices-loops. [download]
Sanya
n00b
Posts: 15
Joined: Thu Mar 17, 2011 10:36 am
Been thanked: 1 time

Re: Ninja Ripper

Post by Sanya »

As far as I know, neosis had no possibilities for popups per plugin.
Sad.
I had no problems with the UVs or Face-Normals on my own game models. But every game produces other rip files with different data-structure. Its not really possible to make an automated version, which load every type of model. See the ninjaripper-instructions to understand the problem.
That's what I mean by "if there's a way to make popup menu for changing this thing". Now I see that it's not. Btw, does noesis has UV map preview? I dont think so, but can be wrong.
As far as I can see, your car .rip has no valid UV-data, or maybe I cannot figured out, how the data is stored.
I'd ask it on ninja ripper's forum.
g_VertexFormatRecog = 1 # default 0
g_Tc0_U_Idx = 10 # default 6
g_Tc0_V_Idx = 11 # default 7
what I was looking at. But what's the first cmd?
Sammie
veteran
Posts: 106
Joined: Wed Apr 25, 2012 12:27 pm
Has thanked: 9 times
Been thanked: 34 times

Re: Ninja Ripper

Post by Sammie »

Sanya wrote:That's what I mean by "if there's a way to make popup menu for changing this thing". Now I see that it's not. Btw, does noesis has UV map preview? I dont think so, but can be wrong.
No, neosis has no UV-preview, only UV-coords in the data-viewer
Sanya wrote:
g_VertexFormatRecog = 1 # default 0
g_Tc0_U_Idx = 10 # default 6
g_Tc0_V_Idx = 11 # default 7
what I was looking at. But what's the first cmd?
The first cmd disables the "offset auto-detection" for the blocks (vertices, normals, uvs), so you can specify the blocks manually. I saw meshes with only 8 blocks and meshes with up to 25 blocks. Anything is possible ;) The auto-detection works good on many older games, but on newer games, it doesnt work very well.
Sanya
n00b
Posts: 15
Joined: Thu Mar 17, 2011 10:36 am
Been thanked: 1 time

Re: Ninja Ripper

Post by Sanya »

Sammie wrote:No, neosis has no UV-preview, only UV-coords in the data-viewer
Just checked out Data Viewer. There's UV viewer. Data Viewer -> Model -> Meshes -> UV view.

But I cant affect UV by changing

Code: Select all

g_Tc0_U_Idx = 10
g_Tc0_V_Idx = 11
UVmap is same: looks like snapshot of the front model. Even I do any number (from 1 to 100), re-load/re-run noesis/re-export - UV doesnt change at all. Had export to Maya tho, but nothing happend. UVs like in noesis - same.

Image

Image
Sammie
veteran
Posts: 106
Joined: Wed Apr 25, 2012 12:27 pm
Has thanked: 9 times
Been thanked: 34 times

Re: Ninja Ripper

Post by Sammie »

Sanya wrote:Just checked out Data Viewer. There's UV viewer. Data Viewer -> Model -> Meshes -> UV view.
Good catch.. never clicked on the values, lol
Sanya wrote:But I cant affect UV
you have to set g_VertexFormatRecog to 1? In your screenshots I see 0.
Sanya
n00b
Posts: 15
Joined: Thu Mar 17, 2011 10:36 am
Been thanked: 1 time

Re: Ninja Ripper

Post by Sanya »

you have to set g_VertexFormatRecog to 1? In your screenshots I see 0.
yep, that's it. Now I can just open script, jump over UV values, change/save script and reload plugins from tools menu and look at what's going on. For some reasons I cant load UV at 10/11 as in max, but 11/12 works fine.
Sammie
veteran
Posts: 106
Joined: Wed Apr 25, 2012 12:27 pm
Has thanked: 9 times
Been thanked: 34 times

Re: Ninja Ripper

Post by Sammie »

Sanya wrote:For some reasons I cant load UV at 10/11 as in max, but 11/12 works fine.
Hmm 10/11 should work, 11/12 its 90° rotated, but technically its a wrong pair.. every vertex has 4 UV pairs on this model: 10/11, 12/13, 14/15, 16/17 - all the same. Don't know why it need the same UV-data four times..mayme separate UVs for diffuse, specular, normal, occlusion
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Ninja Ripper

Post by MrAdults »

Noesis has a number of ways you can do popups/user queries. Native plugins allow you to do any kind of custom interface you want (see the Binary Find in Files plugin), otherwise Python offers a variety of prompting functionality, and there is noesis.userPrompt. You can also register advanced command options to allow the user to specify options that way, which is preferable when you have workable defaults so that the user can batch-process files without getting a dialog shoved in their face for each one. (the user can also batch-process with non-default options this way, by specifying those options for their batch export)

Noesis can preview UV's, as mentioned, Tools->Data viewer->Model #->Meshes->Mesh #->UV view.

Noesis can also preview embedded textures, Tools->Data viewer->Model #->Textures->Texture #.

To modify UV's, you need to check View->Verts/tris in data view, then you will have Tools->Data viewer->Model #->Meshes->Mesh #->Vertices. You can expand that to modify any of the UV values.
Sammie
veteran
Posts: 106
Joined: Wed Apr 25, 2012 12:27 pm
Has thanked: 9 times
Been thanked: 34 times

Re: Ninja Ripper

Post by Sammie »

MrAdults wrote:Noesis has a number of ways you can do popups/user queries. Native plugins allow you to do any kind of custom interface you want (see the Binary Find in Files plugin), otherwise Python offers a variety of prompting functionality, and there is noesis.userPrompt. You can also register advanced command options to allow the user to specify options that way, which is preferable when you have workable defaults so that the user can batch-process files without getting a dialog shoved in their face for each one. (the user can also batch-process with non-default options this way, by specifying those options for their batch export)
Any example-scripts or tutorials about the neosis-phyton-advanced-command-register-options-stuff? I never saw such stuff in other python-plugins.

Btw, is it possible the toggle the culling flag by default via python? Or a global function in neosis to set this by default? I hate it, when it turned off every time I load a new model from the list. The program should remember my current setting until I close it. :evil:
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Ninja Ripper

Post by MrAdults »

noesis.addOption, noesis.optWasInvoked, and/or noesis.optGetArg are the methods you want. It isn't used in any of the included scripts, but it's documented in the Python readme. Here's example usage:

Code: Select all

import noesis
import rapi

def registerNoesisTypes():
	handle = noesis.register("Your model format", ".yourfmt")
	noesis.setHandlerTypeCheck(handle, yourFormatCheck)
	noesis.setHandlerLoadModel(handle, yourModelLoad)
	noesis.addOption(handle, "youroption", "you can use this option to do something", noesis.OPTFLAG_WANTARG) #use 0 instead of OPTFLAG_WANTARG if your option doesn't need parameters

def yourFormatCheck(data):
	return 1

def yourModelLoad(data, mdlList):
	if noesis.optWasInvoked("youroption"):
		optArg = noesis.optGetArg("youroption")
		#parse optArg or otherwise do something with it here
	return 1
If it's appropriate to never backface-cull something, I recommend setting noesis.NMATFLAG_TWOSIDED on the material flag(s). Otherwise, there is rapi.setPreviewOption, but it doesn't have backface culling exposed currently. I can give you an option for that if you really want it. In most cases, per-material twosidedness is more appropriate.
Sammie
veteran
Posts: 106
Joined: Wed Apr 25, 2012 12:27 pm
Has thanked: 9 times
Been thanked: 34 times

Re: Ninja Ripper

Post by Sammie »

MrAdults wrote:noesis.addOption, noesis.optWasInvoked, and/or noesis.optGetArg are the methods you want. It isn't used in any of the included scripts, but it's documented in the Python readme.
If I copy your source, neosis is crashing on startup. (newest version)
Whats wrong?
MrAdults wrote:Otherwise, there is rapi.setPreviewOption, but it doesn't have backface culling exposed currently. I can give you an option for that if you really want it.
Would be nice, if you can implement this. Its useful for model-previews with no materials/textures.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Ninja Ripper

Post by MrAdults »

Oh, I forgot you need a "-" before the option name or it fails. And the Python code wasn't checking for a NULL pointer on return. I made it fail with a proper error for the next build. Here is the fixed code:

Code: Select all

import noesis
import rapi

def registerNoesisTypes():
   handle = noesis.register("Your model format", ".yourfmt")
   noesis.setHandlerTypeCheck(handle, yourFormatCheck)
   noesis.setHandlerLoadModel(handle, yourModelLoad)
   noesis.addOption(handle, "-youroption", "you can use this option to do something", noesis.OPTFLAG_WANTARG) #use 0 instead of OPTFLAG_WANTARG if your option doesn't need parameters

def yourFormatCheck(data):
   return 1

def yourModelLoad(data, mdlList):
   if noesis.optWasInvoked("-youroption"):
      optArg = noesis.optGetArg("-youroption")
      #parse optArg or otherwise do something with it here
   return 1
Also, I forgot, it is demonstrated in an existing script. The Quake 2 WAL script included in Noesis.
Sammie
veteran
Posts: 106
Joined: Wed Apr 25, 2012 12:27 pm
Has thanked: 9 times
Been thanked: 34 times

Re: Ninja Ripper

Post by Sammie »

Ah, okay, now it works, thx MrAdults.

@Sanya
I have uploaded a new plugin-version, which is trying to detect the correct UV-Block.. works for your sunglasses-.rip, so you don't have to modify the source at the moment.

But Ninjaripper is still buggy with UVs. I have tried 20 (older) games now. 70% of all .rips just contain no UV-data - only 12byte-blocks with vertex-positions (3x4 floats for x/y/z).
Other rips (from newer games) have other additional data (NORMAL, COLOR, TANGENT, BLENDINDCIES, BLENDWEIGHT), but still no UVs.
Some .rips have corrupt UVs for some vertices and some data just make no sense (like in your car-.rip). And unfortunately there are no materials-groups for multiple textures.
I hope, blackninja is updating the tool in the near future.

I would be glad, if some people could upload 2-3 .rips of miscellaneous games and tell me the name of the game, so I can analyse more models and implement a better automatic process to detect the correct data structure for upcoming plugin-updates. Doesn't matter, if the .rip or UVs load correctly with the current plugin. Just upload 2-3 model-rips of every game you have. ;)
Post Reply