• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

[SOLVED] Irregular lighting at Triangulated Edges. (Wrong Import of Vertex Normals from Sketchup?)

RicherSims

Resource contributor
Messages
566
Country
dominica
Hi all,

Geometry imported into Blender seems to have the following problem.
Irregular.JPG

Irregular lighting at the edges of triangulated geometry. (Imported from SketchUp into Blender and then exported and displayed in MCX)

I've tried a Limited Dissolve to reduce the number of triangles, but that just produces larger faces with the normals still facing the wrong direction.
Has anyone experienced this and found a solution?
 

dave hoeffgen

Resource contributor
Messages
1,439
Country
germany
I'd recommend to do the "remove doubles" step to remove duplicate vertices, then recalculate the normals (CTRL+N) and finally add an "edge split" modifier.
Please give feedback if it helps
 

RicherSims

Resource contributor
Messages
566
Country
dominica
Thanks for the suggestion.
I saw that posted on another Blender forum but nope, no luck with that.
 

dave hoeffgen

Resource contributor
Messages
1,439
Country
germany
Strange....
How does that model look in edit mode?
also did you try applying scale?
 

RicherSims

Resource contributor
Messages
566
Country
dominica
This was before the cleanup, normal recalculate and edge split modifier.
Irregular.JPG

This was after.
Irregular 2.JPG

The normals look like they were corrected, but still show up incorrectly in MCX.
I have checked and unchecked write normals on export and have seen no difference.


P.S: How does one "apply scale"? I have no scaling in my model from Sketchup, nor Blender.
 

RicherSims

Resource contributor
Messages
566
Country
dominica
Find attached a packed blend file if anyone would like to take a look.
Thanks in advance.
 

Attachments

  • TVSA_tower.zip
    2 MB · Views: 222

gfxpilot

Resource contributor
Messages
370
Country
unitedkingdom
In fighting a similar issue as speak on 3d airport vehicles customised for FMEE (St Denis Reunion). I'll try and bring down yours tomorrow and see if there is anything I can come up with. Just to ask a daft question. Have you up loaded the same straight out of SU in to MC X without migrating through blender first. I've noted very similar oddities on simply low poly DAE,s passed through SU to blender. Seems blender throws higher triangular edges in imports. I've tried the same process you mentioned but still hit the results. In the end I next removed the verts and rebuilt the section, aligned the texture and added in a simple prayer
 
Last edited:

RicherSims

Resource contributor
Messages
566
Country
dominica
When you press CTRL+A select "scale" from the list.
Thanks. No Difference.

Have you up loaded the same straight out of SU in to MC X without migrating through blender first.
That is my usual method and the issue does not occur this way. Which is why I'm positive it is something in blender. I usually use the OBJ format over DAE as I have experienced issues with retaining textures when importing and exporting, but I can confirm the same issue occurs.

Blender is a great tool despite having a steep learning curve. Its baking and lighting tools have allowed me to greatly improve my texture work while simultaneously improving performance using the Texture Atlas tool. I've already invested so much time in learning it that I'm almost unwilling to move on to something else despite this glaring issue.
 

Otavio Bonomi

Resource contributor
Messages
70
Country
brazil
Hello everyone
Can I give you an opinion?
Similar types of problems often happen to me in sketchup. It may come from the alignment of the object with respect to the Y and X axes. When they are misaligned, that can affect the object and centering of the texture.
Before texturizing I create a group or component of the whole object and realing.
Try to align your object in sketchup as best as you can respecting the red and green lines and leaving the blue line right in the middle of the object.
In your case, as it is already textured, try to align the center of the object with the blue line and export the DAE again, see if it changes.
In the last case realign and redo the problematic wall.

Cheers,
Otavio.
 

gfxpilot

Resource contributor
Messages
370
Country
unitedkingdom
Otavio - You might have a point here. - didnt think about the the actual location alignment - mmm have to put this to the test

Thank you
 

gfxpilot

Resource contributor
Messages
370
Country
unitedkingdom
Mousy
Id Dl'd your blender file
In blender it looks fine and I and see the added geometry that SU puts in (from the inside view) As is normal with the imports

I exported as a DAE from Blender for MCX and the textures just went all over the place as was expected - no change with that

I exported as an Obj file - in MCX the orientation of the model went 90 degrees and dropped through the grid - but texture appears fine with no anomalies

I exported again using 3ds out of blender and imported in to MCX - again all the textures showed and I couldn't see geometric deviation as you saw (in your posted shot)
TWR_MCX_1 shows what I saw and it was textually consistent all around - However, note that the wall light objects on tower exterior are missing from the shot - its the same in the blender file so I assume that you didnt use that version for the zip.
I then played about with the MCX lighting and produced a similar, but not exactly the effect to the one you have in the first shot (TWR_MCX_2)


My only issue was the orientation in the Obj export out of Blender > to MCX. (TWR_MCX_3) you'll see the buildings below the grid - this is the same on all imports and the shadow function turned on . else everything is set to default in MCX.

Based on my messing about with the MCX light functions - have you tried (1) altering them initiall to see if teh geometry still shows deviation.

(2) exporting from Blender in another file type that MCX will accept like 3ds just in case.

These are just suggestions to eliminate .

I have also exported out of MCX as a DAE in to blender .................... That was fine as well. Have you considered testing the TWR as an exported MDL file in fsx, place it using ADE as a building at an airport and "walking around" to see if it looks right?
 

Attachments

  • TWR_BLENDER.jpg
    TWR_BLENDER.jpg
    63 KB · Views: 240
  • TWR_MCX_1.jpg
    TWR_MCX_1.jpg
    83 KB · Views: 254
  • TWR_MCX_2.jpg
    TWR_MCX_2.jpg
    104.4 KB · Views: 222
  • TWR_MCX_3.jpg
    TWR_MCX_3.jpg
    387 KB · Views: 218
Last edited:

RicherSims

Resource contributor
Messages
566
Country
dominica
Hi gfxpilot, thanks for taking a look. The initial geometry does not contain any deviations. Yes I removed the lights as they were part of another object. Yes the same lighting problems occur in sim as in MCX.

I have not tried exporting to another format but I will try now. In my experience the 3DS format has issues with long file names, but I will see how I can deal with that.
 

gfxpilot

Resource contributor
Messages
370
Country
unitedkingdom
Mousy, I love a good mystery.

I ve suggestion. Ive just tried to rename the file and a DAE, placed it on my Desktop and then launched it (forgive the pun in a flight sim forum) in MCX - Its coming up as expected without the taxures and all they "chequer points" look good, I used the MCX materials editor to add in the texture in the defused section. all came up fine this end . Do you want to pm me your email (only if your happy ) and Ill send you the dae and then the texture png. That way there's no issue of zipping causing any issues as well.

Try importing that into MCX - This end Ive done it multiple times with differing names and the file looks right no issues anywhere - have also pulled in the same dae into blender and added some more lighting and its there as well no geo issues showing at all. Im wondering is there an issue with the 3 way import across SU, Blender and MCX reading your file .
 

Pyscen

Resource contributor
Messages
2,993
Country
us-texas
Just wondering....

Has anyone tried using the Blender2FSX/P3D toolset within Blender - alleviating having to go from one application to another and then another (just from SketchUp -> Blender and the Toolset?)
 

gfxpilot

Resource contributor
Messages
370
Country
unitedkingdom
I gave it a go a while ago. Added it in to blender as per spec but it didnt work - haven't tried it again since - but when all else fails - Go to the Pub!
 

RicherSims

Resource contributor
Messages
566
Country
dominica
Are we using the same version of Blender? I am on 2.79b.

I exported as a DAE from Blender for MCX and the textures just went all over the place as was expected - no change with that
I can get textures out of Blender correctly using DAE by setting the export options to UV textures as opposed to Materials. However the normals are still incorrect.

I exported as an Obj file - in MCX the orientation of the model went 90 degrees and dropped through the grid - but texture appears fine with no anomalies
I used Blenders default OBJ export options, which causes the orientation change, but the normals are still incorrect, as expected. The orientation can be fixed by changed by the axes to X-Forward and Z-up.

I exported again using 3ds out of blender and imported in to MCX - again all the textures showed and I couldn't see geometric deviation as you saw (in your posted shot)
How did you get the correct filenames out of Blender using the 3DS format? The export gives no options for textures/materials and, as expected the file names are either too short or too long. (For example Terminal_Windows_Doors_Front.png becomes Terminal_Win.000 and RS_Clutter_1.png becomes RS_Clutter_1.000) This will result in me having to manually correct each texture in MCX which I have been trying to avoid.
However, the normals are now correct.


Has anyone tried using the Blender2FSX/P3D toolset within Blender - alleviating having to go from one application to another and then another (just from SketchUp -> Blender and the Toolset?)
The toolset gives the same results on export as the normals are set incorrectly on import.
 

RicherSims

Resource contributor
Messages
566
Country
dominica
I have found the culprit. Some research has lead me to believe that Sketchup's OBJ exporter gives custom normals which are incorrectly interpreted by Blender.
These have to be cleared from the mesh using the Properties Toolbar > Object Data > Geometry Data > Clear Custom Split Normals
Capture.JPG


I have also written a script which clears the custom split normals for all selected objects (just in case you hate repeating the same clicks over and over again).
Python:
import bpy

objects = bpy.context.selected_objects

for obj in objects:
    if obj.type == 'MESH':
        if obj is not None:
            bpy.context.scene.objects.active = obj
            if bpy.ops.object.mode_set.poll():
                bpy.ops.object.mode_set(mode='EDIT')
                if bpy.ops.mesh.customdata_custom_splitnormals_clear.poll():
                    bpy.ops.mesh.customdata_custom_splitnormals_clear()
                bpy.ops.object.mode_set(mode='OBJECT')

Thanks to all for your help.
 

gfxpilot

Resource contributor
Messages
370
Country
unitedkingdom
GOOD NEWS!

Glad youve got that sorted - its a learning curve for us all and one to remember

On the point of the exported Obj file. I had already exported the file as a dae, the textures came across on the consolidated sheet. When I imported the obj in to MCX I went to the materials editor, selected the checkered TVSA_Tower, scrolled down to the defuse texture, opted to select the texture file in the location I had it and it populated perfectly. Because all the texures are burned to the one sheet it brings over the coordinates
 

dave hoeffgen

Resource contributor
Messages
1,439
Country
germany
I have found the culprit. Some research has lead me to believe that Sketchup's OBJ exporter gives custom normals which are incorrectly interpreted by Blender.
These have to be cleared from the mesh using the Properties Toolbar > Object Data > Geometry Data > Clear Custom Split Normals
View attachment 43677


I have also written a script which clears the custom split normals for all selected objects (just in case you hate repeating the same clicks over and over again).
Python:
import bpy

objects = bpy.context.selected_objects

for obj in objects:
    if obj.type == 'MESH':
        if obj is not None:
            bpy.context.scene.objects.active = obj
            if bpy.ops.object.mode_set.poll():
                bpy.ops.object.mode_set(mode='EDIT')
                if bpy.ops.mesh.customdata_custom_splitnormals_clear.poll():
                    bpy.ops.mesh.customdata_custom_splitnormals_clear()
                bpy.ops.object.mode_set(mode='OBJECT')

Thanks to all for your help.

Pretty interesting. I wasn't aware of that one as I'm not used to import stuff into Blender.
Thanks for sharing :)
 
Top