Page 22 of 74

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 4:35 pm
by Wolfrug
JohnWordsworth wrote: @Wolfrug: Have you checked that the material name assigned in the GMT is correct for the material you have made in the game? If you open your coin pouch model and click "Tools -> Material Find / Replace" then that will list the names of the materials you have on the model. For models exported from blender, this will often be something completely different, say '_coin_pouch_dif.dds' and it should read 'coin_pouch' to match the material you made in lua.
Yes! It worked. I don't know why it didn't before, but now it does. Horaaay! Now my monsters can drop their very own little coin pouches for our intrepid adventurers to collect, all thanks to you! :)
SpoilerShow
Image

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 10:39 pm
by kolt16
First of, thanks for making this toolkit, and extra thanks for the gui (I remember countless console nightmare converters from other games :D). I'm already using retexturing, works like a charm.

Now to the bad news, I started testing import-export, and run into a bit of trouble. Not sure if it's the toolkit, or my conifg, since others are using it with no prob.

I have win7 x64, have .NET 4.0 and SlimDX for 2.0 and 4.0 x64. I tested a couple of models (altar, stone wall, arrow), some straight form the assets pack (untouched), got the same results each time. Just opening a model, export to .obj, than re-import and done. Tried and got the same results with 0.2.1.0 and 0.2.1.1.

original arrow.model:

Code: Select all

Name: RootNode 
LocalToParent: [(1, 0, 0), (0, 1, 0), (0, 0, 1), (0, 0, 0)] 
Parent: -1 
Type: -1

Name: arrow 
LocalToParent: [(0.009998477, -0.0001745241, 0), (0.0001745241, 0.009998477, 0), (0, 0, 0.01), (0.00120467, 0.06501397, 0)] 
Parent: 0 
Type: 0

Mesh Entity
Bone Count: 0 
Emissive Color: (0, 0, 0) 
Cast Shadow: True 

Mesh Data
Vertex Count: 232 
Index Count: 390 
Segment Count: 1 
Bound Center: (-3.907148, -1.96804, 0.0646863) 
Bound Min: (-58.58979, -6.476527, -5.126561) 
Bound Max: (50.77549, 2.540447, 5.255933) 
Bound Radius: 55.11322
Vertex Arrays: 
 0: 3, 3, 12, 2784
 1: 3, 3, 12, 2784
 2: 3, 3, 12, 2784
 3: 3, 3, 12, 2784
 4: 0, 4, 4, 928
 5: 3, 2, 8, 1856
 6: 0, 0, 0, 0
 7: 0, 0, 0, 0
 8: 0, 0, 0, 0
 9: 0, 0, 0, 0
 10: 0, 0, 0, 0
 11: 0, 0, 0, 0
 12: 0, 0, 0, 0
 13: 0, 0, 0, 0
 14: 0, 0, 0, 0

0 Invalid Indices
export-import:

Code: Select all

Name: RootNode 
LocalToParent: [(1, 0, 0), (0, 1, 0), (0, 0, 1), (0, 0, 0)] 
Parent: -1 
Type: -1

Name: MainObject 
LocalToParent: [(1, 0, 0), (0, 1, 0), (0, 0, 1), (0, 0, 0)] 
Parent: 0 
Type: 0

Mesh Entity
Bone Count: 0 
Emissive Color: (0, 0, 0) 
Cast Shadow: True 

Mesh Data
Vertex Count: 232 
Index Count: 390 
Segment Count: 1 
Bound Center: (-3.90715, -1.96804, 0.06468582) 
Bound Min: (-58.58979, -6.476527, -5.126561) 
Bound Max: (50.77549, 2.540447, 5.255933) 
Bound Radius: 54.68264
Vertex Arrays: 
 0: 3, 3, 12, 2784
 1: 3, 3, 12, 2784
 2: 0, 0, 0, 0
 3: 0, 0, 0, 0
 4: 0, 0, 0, 0
 5: 3, 2, 8, 1856
 6: 0, 0, 0, 0
 7: 0, 0, 0, 0
 8: 0, 0, 0, 0
 9: 0, 0, 0, 0
 10: 0, 0, 0, 0
 11: 0, 0, 0, 0
 12: 0, 0, 0, 0
 13: 0, 0, 0, 0
 14: 0, 0, 0, 0

0 Invalid Indices
The model looks the same as far as I can tell vertex vise, but flipped, moved from its original position and scaled up. (this is also the way it appears in game)

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 10:48 pm
by Juppstein
and it probably looks ok if you open the obj in Blender, save it as .blen and export it back to obj, then import it back to .model?

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 10:56 pm
by crisman
Right now I'm having the same issue. Exported in .obj and re-imported models give problems. They are 100x bigger, so it was sufficient scale them down by 0,01, but in game I can't see them at all.
I think is the exporter that gives this little problem, instead the importer is working great (since I've just worked with that without any problems! But now I have to modify a pre-existant model)
Hope you can fix that soon! :D

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 10:59 pm
by JohnWordsworth
Grimrock Model Toolkit Release 0.2.1.3
GMT Homepage | Direct Download.

Feature: Added Model Menu with Recalculate Tangents option. This regenerates Tangent data for imported OBJ models to enable normal maps on imported models. MAY BE BUGGY as it's version 1 of this feature. Note that the preview window does not present normal textures, as I'm using the basic fixed function pipeline.

Feature: Added Recalculate Normals button. Be careful not to use this on a model with 'good normals' (will add a warning in the next version), as the generated ones will be worse.

Minor Features: Material Find/Replace Dialog is no longer resizable. Save / Export dialog is pre-populated with a sensible suggestion. Added file association with .model files.

Image

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 11:30 pm
by JohnWordsworth
@kolt16, @crisman: I have just done a complete 'roundtrip' of the Altar model and, even after OBJ export and import, have got it working in the game. There is an important (but not obvious step) in the process though...

0. Make sure you have the latest vision installed (0.2.1.3).
1. Open altar.model.
2. Open the Tools -> Edit Node Transform dialog.
3. Select the 'altar' mesh from the drop down.
4. Write down the Node Transform Matrix on paper / in notepad.
5. Save to altar.obj.
6. (Optional. For testing) Close & Re-Open GMT.
7. Import altar.obj.
8. Model is now 100x too big so...
9. Open Tools -> Edit Node Transform dialog.
10. Select 'MainObject'.
11. Enter the same transform matrix in step 4.
12. Hit Update / Save.
13. Go to Model menu and hit 'Recalculate Tangents' .
14. Save as altar2.model.

So, 2 things of note here. (A) Grimrock models are stored with a transform matrix in the model file. The altar is actually a massive model and is stored with a matrix that tells the game to scale it down to 0.01x the mesh size. There is no way to store this in OBJ format (without transforming the actual mesh), hence we need to write it down and re-insert it in the file. Optionally, you can downsize it in Blender as long as it's correctly placed in a 3x3 space in Blender. (B) Tangents for bump mapping are also lost in OBJ format, so GMT has to rebuild them in step 13 if you want normal maps to work.

I aim to think of some cunning way to make (A) easier, but haven't added it yet!

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 11:42 pm
by Isaac
JohnWordsworth wrote:...
That works wonders... This really makes a difference.
Image
SpoilerShow
My King Snail seems a bit dark... but only on the parts that I modeled, so it might be on my end.
Maybe my normal Map is wrong, and I just never noticed before (when they did not display.)
Image

**Actually... Its not only where I modeled, it's only where I made the normal Map; just the armor and crown.
I will re-do those when I can, and see what changes occur.
Image

Thanks very much for your time and effort with this fantastic modding tool. ImageImageImage

Re: [WIP] Grimrock Model Tookit

Posted: Mon Oct 08, 2012 11:58 pm
by Phitt
Fantastic work! Makes a huge difference and no more errors so far in game.

Image

After updating tangents the model often looks messed up in the toolkit, but in game everything looks fine. On some models I still have missing parts (rocks on the floor are missing for example), but this time only in the toolkit, not in the game. Only one model refused to import properly, I'll have to test a bit more to see why.

Anyway, great job!

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 09, 2012 12:05 am
by Neikun
IS DAT BE THE MINE WALLSET?!
I just got genuinely excited just now.
EDIT: I just got just genuinely just excited just now.

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 09, 2012 12:20 am
by Lmaoboat
Phitt and Wordsworth are credit to team. I only wish I could remember that website where you could enter someone's name and it would play epic music and talk about how awesome they are.