Project Blender 2.63 + to Orbiter import/export addon

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
2.56.1 r34985. It seems the script doesn't work with the latest release (2.57a).
I've just tested the add-on with r36330 (the latest version for now). It works fine. So try the latest version from Graphicall.org.

You are using the pre-release Blender version which may have some bugs with normals (I experienced some bugs in my models: they rendered incorrect while the normals were fine). So continuing using this version is not a good idea.
Meteorit said:
Do you mean Object -> Apply -> Visual Transform? It doesn't change anything.
No. I mean that you should go to the modifier stack and apply all modifiers before exporting.

Meteorit said:
Unfortunately it's quite impossible to model anything complex reasonably without using mirror
I agree. But nobody prohibits using mirror and other modifiers in Blender :)
 
Last edited:

Meteorit

New member
Joined
Dec 13, 2009
Messages
9
Reaction score
0
Points
0
I've just tested the add-on with r36330 (the latest version for now). It works fine. So try the latest version from Graphicall.org.

Okay, I just hope we will get support for the "official" releases :)

No. I mean that you should go to the modifier stack and apply all modifiers before exporting.

Well, it seems Blender has the same issue as Gmax: it would seem you have to use mirror modifer, not mirror from the mesh menu or your normals get inverted! :eek:h:
Apparently it works OK with modifiers, I don't have time to test it properly right now. Looks like I'll have to scrap and rebuild my model quite a lot :(

Thank you for your help.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Okay, I just hope we will get support for the "official" releases :)

Just tested the script with 2.57a release. It works. Probably you are not using its latest version.

Meteorit said:
Well, it seems Blender has the same issue as Gmax: it would seem you have to use mirror modifer, not mirror from the mesh menu or your normals get inverted! Thank you for your help.

I didn't use Mirror operator from Mesh menu before. Yes, it inverts normals and it's a Blender bug.
But it's not an issue for me: I think that the mirror modifier is much better.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Another compatibility fix. Now the script works with Blender 2.58 and later.
 

PolliMatrix

New member
Joined
Jun 20, 2011
Messages
13
Reaction score
0
Points
1
Thanks for your useful Blender add-on, Vlad. I've used it for my own Orbiter add-on and think I found another bug that may be related to the mirroring one in some way:
When you rotate objects in Blender's object mode, the shading will be wrong in Orbiter. As a test I set the rotation to zero and disabled the coordinate transformation in your exporter, which fixed the shading in Orbiter. The version of Blender I used is 2.58.0 r37702, but this has already happened in a recent 2.57 version. I've attached a picture of this to this post.

Also, I get an error when trying to export with the option to apply modifiers on:
Code:
File "C:\...\Blender\2.58\scripts\addons\io_orbiter_msh.py", line 753, in excecute export_msh(self.filepath,self.convert_coords,self.applymodifiers)
File "C:\...\Blender\2.58\scripts\addons\io_orbiter_msh.py", line 578, in export_msh me = obj.create_mesh(bpy.context.scene, True, "Preview")
AttributeError: 'Object' object has no attribute 'create_mesh'
location:<unknown location>:-1
 

Attachments

  • shading errors.jpg
    shading errors.jpg
    67.3 KB · Views: 38
Last edited:

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
Blender uses a vector-math based editing but the mesh files are coordinate based.

To avoid the above issues make sure you "Apply Transformations" in the object menu before exporting.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Thanks for your useful Blender add-on, Vlad. I've used it for my own Orbiter add-on and think I found another bug that may be related to the mirroring one in some way:
When you rotate objects in Blender's object mode, the shading will be wrong in Orbiter. As a test I set the rotation to zero and disabled the coordinate transformation in your exporter, which fixed the shading in Orbiter. The version of Blender I used is 2.58.0 r37702, but this has already happened in a recent 2.57 version. I've attached a picture of this to this post.

Also, I get an error when trying to export with the option to apply modifiers on:
Code:
File "C:\...\Blender\2.58\scripts\addons\io_orbiter_msh.py", line 753, in excecute export_msh(self.filepath,self.convert_coords,self.applymodifiers)
File "C:\...\Blender\2.58\scripts\addons\io_orbiter_msh.py", line 578, in export_msh me = obj.create_mesh(bpy.context.scene, True, "Preview")
AttributeError: 'Object' object has no attribute 'create_mesh'
location:<unknown location>:-1
Thanks for the bug report.

Has your model been made in Blender from scratch?
As you can see in this thread, there were some problems with normals in some (probably imported) models. So can you give me your "buggy" model for debug? It wil be good if modifiers aren't applied.

As for "Apply modifiers" feature, it seems like another Blender API change. I'll check it out.
 

PolliMatrix

New member
Joined
Jun 20, 2011
Messages
13
Reaction score
0
Points
1
Has your model been made in Blender from scratch?
As you can see in this thread, there were some problems with normals in some (probably imported) models. So can you give me your "buggy" model for debug?

Yes, it's a model made from scratch. The problem is clearly with the rotations in object mode as things look correct if you rotate meshes in edit mode or apply the transformations before exporting.
I've attached a zip file containing a simple test model that shows the problem: the green cube isn't rotated and shows up correctly in Orbiter, while the shading on the rotated red one looks wrong, like the light is coming from another direction.
 

Attachments

  • test.zip
    61.1 KB · Views: 6

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,150
Reaction score
13
Points
53
Blender messes up normals when you pretty much do anything to anything. there's a button on the left pane somewhere that says 'recalculate normals' or something like tha
--ADDITION--
Select the object <TAB> into vertex edit mode, and on the left under normals, press the button marked recalculate.
 

Silmarillion

New member
Joined
Jun 30, 2011
Messages
5
Reaction score
0
Points
0
vlad and everyone,

Hi. I'm new to Orbiter and just getting a handle on Blender. Vlad, thank you for the i/o addon. I've got .msh files open in Blender 2.58 and that's a big start. I'm not very experienced with documenting bugs etc. so are there still issues with modifiers needing to be applied before export? Are there other things I should look for? I'm really looking forward to working on this.

I used Blender 1.58 to model most of the ISS before I found Orbiter and I'm just stunned. I downloaded the sound module after I got started with the Atlantis to ISS demo and I still have goose bumps.

Thanks again vlad and let me know if there's anything I can do to help.

Mike
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
vlad and everyone,

Hi. I'm new to Orbiter and just getting a handle on Blender. Vlad, thank you for the i/o addon. I've got .msh files open in Blender 2.58 and that's a big start. I'm not very experienced with documenting bugs etc. so are there still issues with modifiers needing to be applied before export? Are there other things I should look for? I'm really looking forward to working on this.
.......................
Thanks again vlad and let me know if there's anything I can do to help.

Mike

Thanks, Mike.

There should be no issues with modifiers, just check "Apply Modifiers" checkbox in Export dialog. There is no need to apply modifiers by yourself before exporting.

However, I don't do time consuming comprehensive tests (for example, exporting various advanced models). So, use the script in your addon development tasks and report bugs if you discover any. Feature requests are welcome too.
 

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
I can honestly say that I would not be nearly as proficient at Orbiter as I now am without being able to import/export my projects so easily. Thank you for producing a first-rate utility.

:tiphat:

However, I don't do time consuming comprehensive tests (for example, exporting various advanced models). So, use the script in your addon development tasks and report bugs if you discover any. Feature requests are welcome too.

One thing that I have found problematic is the order in which meshes/groups are written into the *.Msh file. There doesn't seem to be much of a rhyme or reason to it. This causes trouble sometimes as groups transperant materials need to rendered last and animations often call out groups by thier order in the msh file vice thier lable.

It's really annoying when you compile a fresh version of a mesh only to find that now the wings rotate in place of the wheels.

As simple solution would to have the script write the groups in alphabetical order as they appear in the scene menu on the right side of the screen.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
It's really annoying when you compile a fresh version of a mesh only to find that now the wings rotate in place of the wheels.
Do you use meshc.exe? I think it should solve such problems.
One thing that I have found problematic is the order in which meshes/groups are written into the *.Msh file. There doesn't seem to be much of a rhyme or reason to it. This causes trouble sometimes as groups transperant materials need to rendered last and animations often call out groups by thier order in the msh file vice thier lable.
.....
As simple solution would to have the script write the groups in alphabetical order as they appear in the scene menu on the right side of the screen.

Yes, selected objects list isn't sorted by name by default.

I fixed this. You can download the new version.
Please write if it works good or not.
 

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
Do you use meshc.exe? I think it should solve such problems.

Use what???

Selected objects list isn't sorted by name by default.

I fixed this. You can download the new version.
Please write if it works good or not.

Download link is on the first page correct?

I'll give it a shot when I get home this evening and get back to you.

Thanks again.
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
Do you use meshc.exe? I think it should solve such problems.
Would it be possible for you to have the export script also spit out a header file with the necessary #defines? That's what I have the Wings exporter doing.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Use what???
Meshc is a tool that creates a header file that maps the names of the meshes to their indices. You can include that header into your .dll.
Would it be possible for you to have the export script also spit out a header file with the necessary #defines? That's what I have the Wings exporter doing.
That's a great idea, thanks!
 

XSSA

New member
Joined
Apr 9, 2011
Messages
67
Reaction score
0
Points
0
Where do I put this addon for Blender version 2.57? If there are different versions of this then post them all. :sos::sos:
I meant were do the files (io_orbiter_msh.py and pax_global_header) go in the blender files.
I have a plugins file but it has no .py files in it
I can go in here C:\Program Files\Blender Foundation\Blender\2.57\python\lib
or
here
C:\Program Files\Blender Foundation\Blender\blender-2.57-windows32\2.57\plugins
or
here
C:\Program Files\Blender Foundation\Blender\blender-2.57-windows32\2.57\python\lib
 
Last edited:

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
Where do I put this addon for Blender version 2.57? If there are different versions of this then post them all. :sos::sos:

Open Blender and then go to "Plugins" in the file menu (It might also be under "preferances" depending on which build you have)

Click on "Install Plugin" and select the file.

From here on there should you should be able to edit Orbiter *.MSHs using Blender's Import/Export function.
 
Top