Page 20 of 74

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 12:25 pm
by tomimt
Hi

I've got this weird issue going on with a model I did in Blender. On the smaller editor view the model looks okay, but if I switch to the fullscreen mode the model tears apart. Any ideas what might be causing this?

Here's a link to a pic

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 12:48 pm
by Phitt
tomimt wrote:Hi

I've got this weird issue going on with a model I did in Blender. On the smaller editor view the model looks okay, but if I switch to the fullscreen mode the model tears apart. Any ideas what might be causing this?

Here's a link to a pic
Most likely the same problem described by me and Leki. There seems to be a problem when exporting to model format, you'll have to wait until John finds out what causes it and how to fix it.

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 1:28 pm
by JohnWordsworth
*Does a little happy dance* I think I've found it :). Fix incoming!

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 1:48 pm
by Komag
that sounds good!

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 2:13 pm
by JohnWordsworth
Ok, there's some good news and some bad news I'm afraid. First of all - I'm pretty confident that I've fixed the .model save issues. After a couple of hours with a hex-editor, I realised that I had mis-read the .model format specification, a MeshSegment has an 'FirstIndex' and a 'Count', but that Count isn't the number of indices, but the number of triangles.

The bad news is that any/all models that have been imported using an earlier version will have this problem. Any re-skinned models should be fine (as I just use the values from the original file), but all meshes imported using GMT to date will have this problem.

Please check and feedback - there is always the possibility that there are other problems in saving .model files, but I've imported @Phitt's OBJ files, and while there is still a problem with the normals - the dungeon always renders fine now (no garbage triangles being rendered) :). I've deleted all previous versions of the GMT from my site and upgraded the version number to reflect that this version should be used from now onwards.

Oh, I've also added group export to OBJ files, so mesh entities with multiple segments should now export as multiple 'OBJ Groups' so that they can be edited separately in Blender. This also means that when you round-trip a model, they retain their material name.

GMT Home Page Direct Download

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 2:31 pm
by tomimt
I gave it a quick spin and it seems to work correctly now.

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 3:06 pm
by Isaac
This is great news. 8-)

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 3:38 pm
by Leki
John,
bad news - I opened some models and got 3 results:
SpoilerShow
Image

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 3:45 pm
by Wolfrug
Hum. I just tried this today to see if I could manage to resize the sack_full model in Blender and turn it into my very own coin_pouch. So far so good:
SpoilerShow
Image
Except that's exactly what it looks like in-game too :(

I've got the item defined:

Code: Select all

defineObject{
	name = "coin_pouch",
	class = "Item",
	uiName = "Coin Pouch",
	model = "mod_assets/models/coinsack.fbx",
	gfxIndex = 81,
	weight = 0.1,
	container = false,
	stackable = true,
}
and custom materials for it (just using the original sack textures):

Code: Select all

defineMaterial{
	name = "coin_pouch",
	diffuseMap = "mod_assets/textures/sack_full_dif.tga",
	specularMap = "assets/textures/common/black.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = false,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 20,
	depthBias = 0,
}
I know it's not the material entry that's wrong - I tried changing the "name" field to "flask" and got myself a nicely leather-coloured flask model. The item.lua entry is also correct since, well, it shows up in-game:
SpoilerShow
Image
Not sure what exactly I'm doing wrong here. :-/ I'm a bit of a noob when it comes to 3D-modelling, so I suppose I might have screwed something up somewhere, but...well. I don't know?

Re: [WIP] Grimrock Model Tookit

Posted: Sun Oct 07, 2012 3:53 pm
by JohnWordsworth
Oh bugger, there appears to be a problem with exporting meshes that have multiple mesh segments. Imports should still be ok from Blender models, but I think the OBJ outputs for meshes with >1 segments is not quite right. Build this morning was a bit of a rush - got a Pathfinder RPG game to run in 10 minutes and had to write the story! Will upload a fix after the game this evening!