Blender 2.71 - Importer / Exporter (1.4.4)

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
bitcpy
Posts: 39
Joined: Tue Apr 24, 2012 7:43 pm

Re: Blender 2.71 - Importer / Exporter (1.4.3)

Post by bitcpy »

Glad you got it sorted out. :)
sajon
Posts: 38
Joined: Fri Nov 08, 2013 7:17 am

Re: Blender 2.71 - Importer / Exporter (1.4.3)

Post by sajon »

Batty wrote:You need to triangulate all the faces. You will notice after that error that bitcpy's script selects/highlights the n-gons that need to be triangulated.

In edit mode with those faces selected (or all faces), do Mesh -> Faces -> Triangulate Faces.
Thank you that did work sorry for the late reply.
I triangulated a cylinder then added a texture and was not right. Does that mean i need to apply texture / UV maps first then triangulate last?
bitcpy
Posts: 39
Joined: Tue Apr 24, 2012 7:43 pm

Re: Blender 2.71 - Importer / Exporter (1.4.3)

Post by bitcpy »

Latest 1.4.4
https://sites.google.com/site/bitcpy/do ... sion-1.4.4

Sorry, it has been a hectic week, but I managed to sit down yesterday and look at the problem.
It appears some of the vertices are missing skinning weights straight out of the model file.

I wrote a tool and scanned through the entire dat container, and could only find three models that had the same kind of issue.
Funny thing was that when loaded into GMT they look fine, so I guess John already compensate for zero weighted vertices and simply spreads some weighting onto it.

The incorrect models was,
assets/models/monsters/lindworm
assets/models/monsters/viper_root
assets/models/monsters/hash_e5e1535f

Anyways, I did a quick (ugly) fix today in the script to correct this, so version 1.4.4 should work fine.

Let me know if you're having problems with it.
User avatar
germanny
Posts: 530
Joined: Sat Apr 07, 2012 10:52 pm
Location: Kiel, Germany

Re: Blender 2.71 - Importer / Exporter (1.4.4)

Post by germanny »

Hi bitcpy, do you working on this or have you stopped?

Maybe i´m doing something wrong (i guess not).
If i make a render from an imported grimrock 2 model, the surface shows only in shaded black. No matter if i used an image texture or a standard material.
The same if i attached an animation to the model or not.
All normals (face, vertex..) are faced in correct outside direction, so this is not the error source.
If i set the 'translucency' setting of the material from 0 (standard) to 1 the mesh seems rendered as expected.
But is not because with translucency=1 the material colour will 'shine' through from the (inner)backside of the faces.

Image
Image

Guess there must be something wrong with face orientation outside the normal orientation space?
The material is mapped to the opposite face direction?

Tested with Blender 2.71 and the newest 2.73-8.
In 2.73-8 there must be an internal script engine change - because imported models are distorted now:
Image

Those internal changes in Blender are disturbing.. how would someone come to a stable importer then!?
Thanks for your outstanding effort, bitcpy!
Dungeon Master Resource Pack worker and passionated Beer drinker
bitcpy
Posts: 39
Joined: Tue Apr 24, 2012 7:43 pm

Re: Blender 2.71 - Importer / Exporter (1.4.4)

Post by bitcpy »

Hi germanny,

I'm not actively working on this because of work taking up more and more of my time lately, but I'll definately find some time and try and resolve your issues and possibly help out with potential requests.

I should really try and get some more work done on it now when the asset pack has been released.

So, I'll try and have a closer look on your problems this weekend and get back to you.
Thanks for letting me know about your problems with it so I get a chance on improving it.
bitcpy
Posts: 39
Joined: Tue Apr 24, 2012 7:43 pm

Re: Blender 2.71 - Importer / Exporter (1.4.4)

Post by bitcpy »

Hi,

Just wanted to drop you a quick update before I leave for work.

I don't get completely black models, what happens is that they seems to be lit as if they didn't have scales applied.
So for me the lighting is completely inverted as in the 'back' receiving the incomming light rather than the quads actually facing the light, Is this the problem you're having?
I'll do some simple tests with cubes / spheres when I get back home this afternoon and post a bug to Blender if it is missbehaving for even the simple case.

I couldn't find the 2.73-8, only found a 2.74 testbuild (called 2.73-alpha in Blender).
This one had exactly the problem you mentioned.

After I switched the armature to rest pose it was pretty clear that it was not rotated correctly.
Other objects had slight odd transforms as well, after I rotated the armature to align up with the model and went back to pose mode it looked just fine.
Although now everything was rotated incorrectly, so fine might be a bit exaggerating.

Anyways, I'll look into the armature stuff closer when I get back home, might just be me that doesn't supply the transforms properly to Blender, or it's simply a Alpha unstable issue.

I'll also as I mentioned take a closer look at the rendering and see if I need to post a bug report or fix the script somehow.
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Blender 2.71 - Importer / Exporter (1.4.4)

Post by minmay »

When I try to import dm_spikes_floortrap.model or dm_spikes_floortrap_we.model from Germanny's Dungeon Master Resource I get the following error:

Code: Select all

  line 3647, in execute
    load_model(self.filepath,file_offset, context)
  line 3528, in load_model
    load_binary_model(file_object, context)
  line 2318, in load_binary_model
    build_model(model)
  line 2728, in build_model
    parent_ob = bpy.data.objects[parent_name]
KeyError: 'bpy_prop_collection[key]: key "pressure plate" not found'

location: <unknown location>:-1
It looks like Grimrock is fine with the parent node not existing (the model works ingame), but your importer is not. I changed the line to

Code: Select all

            parent_ob = bpy.data.objects.get(parent_name, game_matrix_ob)
and the models import fine then. Not a big deal by any means, just thought I'd mention it. Thanks again for all the awesome work on this.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Blender 2.71 - Importer / Exporter (1.4.4)

Post by Isaac »

Now that I have Blender working again, I really have to try out this import script. 8-)
DrVooDoo
Posts: 17
Joined: Fri Dec 21, 2012 10:49 pm

Re: Blender 2.71 - Importer / Exporter (1.4.4)

Post by DrVooDoo »

How fix invert shadows?
SpoilerShow
Image
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Blender 2.71 - Importer / Exporter (1.4.4)

Post by minmay »

Try inverting the model by scaling all axes by -1, then rotate back to its original orientation and flip normals. It will look the same in Blender but this will most likely fix that specific lighting issue.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply