Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 03/21/08 22:03

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

OBJ viewer update + mini-ripper for TRBS and TRMA

Hello? anyone here?

http://geyser.oni2.net/edition/tools/obj_view.zip
http://geyser.oni2.net/edition/tools/mini_rip.zip

I finally got around to polishing the viewer (it's still using the lousy C routines to load the OBJ and MTL, but I fixed all known memory leaks and added lotsa features).
Basically the help is built-in. You can launch the viewer without any object then press H and it will display an overview of the command-line syntax and of the controls.
You get much more complete control over the viewport now, including but not limited to: a redefinition of the vertical axis, FOV, near/far clip range and sensitivity...
You can switch from textured to wireframe. Last but not least, you can load several OBJ at once and cycle between them while keeping the viewport parameters.
Also, you can explicitly specify a MTL file that will override the MTL specified in the OBJ (if any). Doing that for several OBJ will override every object's materials.
That last feature is especially useful when viewing the different LODs of an Oni character: there's a TRCM (OBJ) for every LOD, and a single TRMA (MTL) for all.

That's where the mini-ripper comes in. It converts Oni's TRBS to OBJ (one OBJ for every LOD) and TRMA to MTL (using the same .tga names as OniSplit does).
You can aply the ripper to TRBS*.oni and TRMA*.oni files, but it works best with a level#_Final.dat (and best of all with a reimported level0_Final.dat of course).
You can't specify the destination folder of the extracted files, though, so just copy level0_Final.dat (no need of the .raw and .sep) to a temporary folder.
The command line (on PC) is then just: mini_rip.exe level0_Final.dat   This will produce a lot of .obj and .mtl files in the current folder.
Which you can copy to yet another working folder, along with the .tga textures as extracted by OniSplit, e.g., with: onisplit -extract:obj bla ONCC*.oni

Then you can use the viewer to view these .obj either way you like: one at a time, several different characters at once, several LODs of same char at once...
However, if you want a character .obj to specify a certain texture set, you'll have to edit the .obj and replace "default.mtl" with the name of an existing MTL.
What works right out of the box, though (provided that the required OBJ, MTL and TGA are there) is, e.g.: obj_view.exe comguy_b*.obj comguy_h*.mtl

And now "the cherry on the cake": the .obj files are laid out in a modular way, which means you can swap body parts very easily. Have fun experimenting.
I'm sure there are many recombinations to try there, apart from the obvious "head grafts" (civilian Konoko, Konoko the scientist, Fury Konoko, yada yada)

OK, now that this is done, I'll probably take some sort of break from the forums here. Expect Edition activity and updates on the wiki if any.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#2 03/22/08 00:03

coool
Member
From: China Haikou
Registered: 02/12/08

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

I am here...but so many words that I can't understand...

Offline

#3 03/22/08 00:03

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

Hey geyser,

Its been quiet here, well I tried your new viewer, but it didn't work for me.
This is what I get:

objview.jpg

Also, I assume the mini-rip is PC only, I gave it a try on the Mac, but the make command did not work.

Offline

#4 03/22/08 04:03

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

Ed, what is the OBJ you're trying the viewer with?
As for the mini-ripper, ask Myrd or something smile
(although maybe I should do a Makefile myself)

EDIT: Oh, wait, that's supposed to be Konoko, right?
Apparently the one extracted by OniSplit. Is that so?
(ONCCkonoko_generic extracted by OniSplit? right?)

EDIT: OK, I see a weird effect when the materials are not found.
(no mesh glitches, but the text fails to show for some reason...)
This means that there might be memory corruption somewhere.
(your screwed-up screenshot is typical of memory corruption...)
I'll see if I can figure it out without rewriting the whole thing... smile

EDIT: As for the mini_rip makefile, try this:

# Project: mini_rip
# Compiler: Default GCC compiler
# Compiler Type: MingW 3
# Makefile created by wxDev-C++ 6.10.2 on 08/02/08 02:04

CPP       = g++
CC        = gcc
OBJ       = ./main.o
LINKOBJ   = ./main.o
LIBS      = 
INCS      = -I"include"
CXXINCS   = 
BIN       = mini_rip
DEFINES   = 
CXXFLAGS  = $(CXXINCS) $(DEFINES)  
CFLAGS    = $(INCS) $(DEFINES) 
RM        = rm -f
LINK      = g++

.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after

clean: clean-custom
    $(RM) $(OBJ) $(BIN)

$(BIN): $(OBJ)
    $(LINK) $(LINKOBJ) -o $(BIN) $(LIBS)

./main.o: $(GLOBALDEPS) ./main.cpp
    $(CPP) -c ./main.cpp -o ./main.o $(CXXFLAGS)

Place in the same folder as main.cpp and enter "make all".

Last edited by geyser (03/22/08 05:03)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#5 03/22/08 11:03

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

geyser: Actually, that was copfemA1, but same difference smile

I can open a simple obj, but it does not load the texture, even if I specifically add it to the command.

AEGRifle.jpg

Note, I get this message in the terminal:
GLUT Warning: glutCurrentModifiers: do not call outside core input callback.
As I move the object around or rotate it


Regarding mini_rip, the make file worked, but the command mini_rip.exe level0_Final.dat, ended with the message:
Writing thug_wh5_high_tx.mtl ...
sh: PAUSE: command not found

konokoLOD.jpg

But at least it works, on Intel Macs.

Offline

#6 03/22/08 18:03

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

Ed, why do you say that mini_rip "works on Intel Macs"? Haven't you tried it on a Power PC yet? It should definitely work on both.
As for the complaint about "PAUSE", my bad (it's a Windows-only system command), but it shouldn't affect the result of the rip...

As for the warning about "glutCurrentModifiers", it looks like a (hopefully minor) difference between your GLUT and my freeGLUT.
Have you successfully tried using the left-mouse drag with SHIFT and ALT modifiers instead of right and left+right mouse drags?

Maybe upload the copfemA1 you tried to load the first time around (complete with its resources), and provide the command line.

Last edited by geyser (03/22/08 20:03)


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#7 03/22/08 21:03

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

On my PPC I get the following:

./mini_rip level0_Final.dat
Reading TRBS  ...
Bus error

Regarding the obj_viewer
Using either the SHIFT or ALT with the left mouse button causes the object to rotate.
right mouse drag zooms in and out, left+right mouse pans left & right, up & down.

This is the command I used for the copfemale:
./obj_view cop/ONCCCopfemA1.obj and ./obj_view cop/ONCCCopfemA1.obj cop/ONCCCopfemA1.mtl

The file can be found here:
http://edt.oni2.net/3D/cop.zip

Last edited by EdT (03/22/08 21:03)

Offline

#8 03/23/08 08:03

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

Huh. Bus error. Shift and Alt not working. F##ked up Karen. Missing materials.
That's very bad. All the worse since I can't really spend much time debugging.
Oh well. Let's put this on ice. For now try to enjoy the latest videos, at least...
BTW, I really have to move aside for a while. Posting another vid and leaving.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#9 03/23/08 10:03

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

geyser: Take care, don't stay away too long.  Have a pleasant break from the forums, but we'll be expecting a lot from you when you come back! smile

Offline

#10 03/23/08 17:03

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

Great expectations can lead to big disappointments. Beware.
The break won't be a pleasant one, but I hope for the better.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#11 03/24/08 08:03

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

See you around!


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#12 03/24/08 08:03

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: OBJ viewer update + mini-ripper for TRBS and TRMA

Iritscen: Both OBJ viewer and Mini-ripper includes the source code.  I think they are written in C++, with your programming experience, perhaps, you can get them to work on the Mac!

Offline

Board footer

Powered by FluxBB