Project Blender 2.63 + to Orbiter import/export addon

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
I made another small update due to API change in Blender 2.56.

As usual, the script now works in recent Blender 2.5 builds.
 

Meteorit

New member
Joined
Dec 13, 2009
Messages
9
Reaction score
0
Points
0
First, thank you for your Blender exporter.

However, there seems to be a problem in mesh export, probably with normals. The left main gear bay shows correctly whereas the right and nose gear bays seem to have their normals flipped (see attached images). There seem to be similar problems with some other objects in my model also. I've tried flipping normals in Blender but it didn't help. I guess this could have something to do with mirrored objects.

Also, it looks as if light is coming to the model "inverted". It is bright from below but dark from top when the sun is shining from above.

I'm using the latest script with BlenderYafaray32bit build 19.02.2011 from graphicall.org.
 

Attachments

  • 060.jpg
    060.jpg
    36.8 KB · Views: 22
  • 061.jpg
    061.jpg
    28.2 KB · Views: 15

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
However, there seems to be a problem in mesh export, probably with normals. The left main gear bay shows correctly whereas the right and nose gear bays seem to have their normals flipped (see attached images). There seem to be similar problems with some other objects in my model also. I've tried flipping normals in Blender but it didn't help. I guess this could have something to do with mirrored objects.

Also, it looks as if light is coming to the model "inverted". It is bright from below but dark from top when the sun is shining from above.
Can you give me your model for debugging? With complete list of export bugs?
 
Last edited:

webtek

Addon Developer
Addon Developer
Joined
Dec 11, 2010
Messages
55
Reaction score
0
Points
0
Location
In the Great White North
This is great! I've gotten into Blender lately and I really like the program. I've been waiting for something like this.:thumbup:
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
However, there seems to be a problem in mesh export, probably with normals. The left main gear bay shows correctly whereas the right and nose gear bays seem to have their normals flipped

The script is OK, and your mesh has errors. I have tested the script with different meshes, and they are exported fine.

Let's look at your mesh's normals from inside:
meshfrommeteorit.jpg

As you can see, almost all normals directed inside the mesh (this is incorrect), and normals of right gear bay are correct. Notice the outlined zero-area faces. There is a lot of bad geometry there and in bay doors, you should fix this.

So, I flipped normals direction outside and exported the model. The resulting .msh looked like its normals directed inside! This is a strange bug (Blender or your .blend file), I haven't seen something like this before. When I exported this model to .obj and re-imported it, all normals were directed inside! After that, when I flipped the normals outside again, the export result became look good:
meshfrommeteoritfixedor.jpg

And the gear bays from inside:
gearbaysmeteorit.jpg

A very strange bug, maybe you should report it to Blender developers.
I sent you the fixed mesh via e-mail, but you should clean up your mesh by yourself: there is a lot of bad geometry, non-manifold topology etc.
 

Meteorit

New member
Joined
Dec 13, 2009
Messages
9
Reaction score
0
Points
0
Thank you for taking the time to test it :)
I'll have a look into my model, Blender seems to render it OK. I have no idea why it has gone that way, I haven't used lots of exotic modifiers or anything like that. The fuselage was originally a NURBS surface made from cross sections.
 

Columbia42

Member
Joined
Dec 4, 2009
Messages
884
Reaction score
0
Points
16
Location
C:\ProgramFiles\Orbiter
I just have a quick question about the i/o module (more a general blender question I guess). I just installed blender and the Orbiter i/o patch but blender says I don't have Python installed so I can't run the script. The thing is I have both Python 24 and Python 27 installed so I don't know what the problem is.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
I just have a quick question about the i/o module (more a general blender question I guess). I just installed blender and the Orbiter i/o patch but blender says I don't have Python installed so I can't run the script. The thing is I have both Python 24 and Python 27 installed so I don't know what the problem is.
That's strange. Blender 2.5 uses built-in Python 3 (not 2!). All addons and other scripts are written in Python 3.
What about other addons? Do they work? What says Blender Python console?
Do you use the latest build from graphicall.org?
 
Last edited:

Columbia42

Member
Joined
Dec 4, 2009
Messages
884
Reaction score
0
Points
16
Location
C:\ProgramFiles\Orbiter
I figured out what the problem was. I was using blender 2.49 not 2.5. I just downloaded 2.5 and that solved the Python problem but now it says the directory that I'm trying to import from doesn't exist.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
I figured out what the problem was. I was using blender 2.49 not 2.5. I just downloaded 2.5 and that solved the Python problem but now it says the directory that I'm trying to import from doesn't exist.
Everything should work fine. Read the first post with attention, install Blender and add-on and try to import a mesh. If you fail, write here a detailed description of what you have done, error messages etc.
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,150
Reaction score
13
Points
53
I've got latest version of blender, I've copied it into the right place, but it isn't appearing in my addons list which means I cant enable it which means I cant import or export. :shrug:
 

diogom

Well-known member
Joined
Aug 2, 2010
Messages
1,370
Reaction score
413
Points
98
Where is Blender's addon directory?

---------- Post added 04-01-11 at 07:03 PM ---------- Previous post was 03-31-11 at 10:48 PM ----------

Forget my post, I found it.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
I've got latest version of blender, I've copied it into the right place, but it isn't appearing in my addons list which means I cant enable it which means I cant import or export. :shrug:
What is your Blender revision number? The add-on works with Blender r35964. Try the latest Blender build from Graphicall.org.
 
Last edited:

diogom

Well-known member
Joined
Aug 2, 2010
Messages
1,370
Reaction score
413
Points
98
Hi, I have the latest Blender version, 2.56.5 r35943, and the script works, it imports/exports meshes well, but Blender doesn't load the textures. When I select "Textured" in the Viewport Shading menu, the model apears all white, and in some meshes, some parts are black.
 

Meteorit

New member
Joined
Dec 13, 2009
Messages
9
Reaction score
0
Points
0
Despite my attempts I couldn't get all parts of my model showing up correctly in Orbiter. Thus I made a test: I created a linked duplicate of the standard cube, then mirrored the duplicate. I exported both to Orbiter mesh, and the results can be seen in the attached screenshot: the duplicate cube has its normals inverted, even though they show up correctly in Blender.
It seems there is something wrong in the way the exporter handles mirrored objects.
 

Attachments

  • mirrored_cube.jpg
    mirrored_cube.jpg
    17.1 KB · Views: 12

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Hi, I have the latest Blender version, 2.56.5 r35943, and the script works, it imports/exports meshes well, but Blender doesn't load the textures. When I select "Textured" in the Viewport Shading menu, the model apears all white, and in some meshes, some parts are black.

You should use GLSL shading mode as well.

Please check the log in the output window if the textures are loaded or not. You can also check textures in Properties tab

But I suppose that turning on GLSL will solve your problem.

---------- Post added at 09:31 AM ---------- Previous post was at 08:37 AM ----------

Despite my attempts I couldn't get all parts of my model showing up correctly in Orbiter.
............................................................
the duplicate cube has its normals inverted, even though they show up correctly in Blender.
It seems there is something wrong in the way the exporter handles mirrored objects.

What is your Blender revision? It's always important.

The script does nothing with mirrored objects; it just calls API function that creates a mesh with applied modifiers (3 strings of code). So this can be a Blender bug.

What happens if you apply modifiers by yourself before exporting the mesh?
What happens if you export your scene to .obj and re-import it?
Your first problem was a Blender bug, this problem could be a Blender bug too.

I'll check the script and Blender API when I have free time.
 
Last edited:

Meteorit

New member
Joined
Dec 13, 2009
Messages
9
Reaction score
0
Points
0
What is your Blender revision? It's always important.

2.56.1 r34985. It seems the script doesn't work with the latest release (2.57a).

What happens if you apply modifiers by yourself before exporting the mesh?

Do you mean Object -> Apply -> Visual Transform? It doesn't change anything.

What happens if you export your scene to .obj and re-import it?

I tried that and it didn't help.

Your first problem was a Blender bug, this problem could be a Blender bug too.

Actually this is the same problem. If you use "mirror" at any stage when making your model it blows up the part containg mirroring in Orbiter. Either it appears inside out (ie. inverted normals) or the shading is wrong (ie. object appears bright in shadow and dark in sunlight).

I remember the Microsoft exporter from Gmax to MS Flight Simulator having a similar bug. Gmax had two ways of mirroring an object and you had two use only the other one, otherwise the part appeared inside out in the game. But Blender only seems to have one way of mirroring things.

Unfortunately it's quite impossible to model anything complex reasonably without using mirror :(
 
Top