Page 38 of 74

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 30, 2012 7:06 am
by cougardod
Not much of a modeler, but does it matter if the item is centered on the 9 square boxes and if so, how do I center it? I'm kind of jumping in the deep end, so bear with me please.

Image

Also, does anyone have any example files of what the file structure and the .lua files should look like in order for the model/textures to appear in the Model Viewer and in game? Thanks in advance.

P.S. this is an imported .obj file.

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 30, 2012 7:21 am
by Isaac
cougardod wrote:...
What modeler are you (or can you) use to edit the mesh? The GMT itself is not an editor (AFAIK). It can do limited scaling, but I believe that you would have to load the model into an editor to make changes to it; including the assignment of UV mapped textures.

If this is an 'already mapped' model, then you just need to define a texture in the material.lua file, and use the name of it in the GMT to assign that material to the mesh; using 'Material Find / Replace' in the TOOLS menu.

Material definition is described here: http://www.grimrock.net/modding/creating-custom-assets/

It is possible that the game will print an warning that an object outside of the tile that it is supposed to be inside of; so you'd want the object fully inside the tile.

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 30, 2012 2:56 pm
by cougardod
Using 3ds Max. Got it repositioned this morning, easily. Guess I was just staring at it too long last night. Think I will be able to figure out the materials.lua file when I get home tonight though.

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 30, 2012 3:10 pm
by Deadlylama
Isaac wrote:
cougardod wrote:...
What modeler are you (or can you) use to edit the mesh? The GMT itself is not an editor (AFAIK). It can do limited scaling, but I believe that you would have to load the model into an editor to make changes to it; including the assignment of UV mapped textures.

If this is an 'already mapped' model, then you just need to define a texture in the material.lua file, and use the name of it in the GMT to assign that material to the mesh; using 'Material Find / Replace' in the TOOLS menu.

Material definition is described here: http://www.grimrock.net/modding/creating-custom-assets/

It is possible that the game will print an warning that an object outside of the tile that it is supposed to be inside of; so you'd want the object fully inside the tile.
using the node transform dialog, you can set some sort of offset into non-animated models and even rotate/strech them without needing to open any modeling program.

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 30, 2012 3:53 pm
by JohnWordsworth
@Isaac (and @Phitt): I'll take a look at the animations import (and DAE format) next, it appears that it's either not working correctly or is very fragile (I got a .x model animated in the game correctly - so it is possible!).

@Isaac: If you could send me any/all test data that's causing problems - I could take a look and then see if I can (a) figure out what's wrong or (b) find some settings that work properly. :) Also, if I can reproduce the "Object reference not set to an instance of an object" exception, then I might also be able to open up more avenues for animation import.

One thing to note is that different modelling software and file formats expect different 'handedness' as well as sometimes applying different meaning to 'X,Y and Z' (which is forward for instance). I expect this is where a lot of problems are coming from, so I intend to add some buttons to apply basic transforms to the model soon (rotate 90 degrees in a given direction, either by editing the vertices or updating the node transformations). I might also sneak in 'Node Editing' soon too, so you could select a node and 'replace mesh' and/or add/delete nodes.

@cougardod: You have 2 options, you can either open the model in 3DS Max and ensure that the model is centered (in X,Z) at the origin and then the bottom of the bed should rest on the floor. Alternatively, as @Deadlylama said, you could also open the model in the GMT, bring up the 'Node Transform Dialog' and type in some values in the last column of that matrix. Assuming you have a standard 3x3 identity matrix in the left, the top row on the last column is the 'X' translation, the second "Y" and the third "Z". That might not make much sense, but it basically means you can edit the matrix like so...

Code: Select all

1 | 0 | 0 | X
0 | 1 | 0 | Y
0 | 0 | 1 | Z
0 | 0 | 0 | 1
So an example to translate your model 0.5 units in X would be

Code: Select all

1 | 0 | 0 | 0.5
0 | 1 | 0 | 0
0 | 0 | 1 | 0
0 | 0 | 0 | 1

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 30, 2012 4:38 pm
by Skuggasveinn
@JohnWordsworth

If I may be so bold as to ask for a feature :)
Nothing major, but can really help with the workflow.

In the Node Transformation dialog, can you add constrain proportions (you can click it or unclick it)
so if you input something into the scaling field it will populate the other 2 fields also
just the ones with X and ofcourse nothing at the last column.
X00
0X0
00X

(as you can guess I have been scaling alot and was thinking this would be a nice to have)

Skuggasveinn.

Re: [WIP] Grimrock Model Tookit

Posted: Tue Oct 30, 2012 7:53 pm
by crisman
Small parenthesis: I've just installed win8 on my laptop and your program still works greatly! ;)

Re: [WIP] Grimrock Model Tookit

Posted: Wed Oct 31, 2012 12:00 am
by Neikun
Neikun wrote: Addition:
Is it possible to have the file load memory and the file save memory different?
This would help when I load constantly from the asset pack, but save constantly into my models folder.
Just an extra thought on this;
By doing this, while making wallsets and especially wallset related objects, it will become much faster.

Re: [WIP] Grimrock Model Tookit

Posted: Wed Oct 31, 2012 2:26 am
by cougardod
OK, still having trouble with the textures...it looks fine in 3DS Max, but I must be exporting it wrong. How do I export it so that the Model Viewer will open the textures correctly?

Re: [WIP] Grimrock Model Tookit

Posted: Wed Oct 31, 2012 2:38 am
by Neikun
In tools, settings, ensure that your asset pack is loaded in properly.
Ensure that your current dungeon is also loaded in the current dungeon field.

Any new texture will need to be defined using the defineMaterial{ script.
You need to make sure you're exporting your .dds images with compression: DXT5, format: RGBA8, and generate mipmaps ticked.
(Note: within the defineMaterial{ script, you will refer to them as.tga)
Then it's just a matter of going to tools, material find/replace, typing in the material of your choice, clicking Replace Material and reloading the Material Library