Project Blender 2.63 + to Orbiter import/export addon

tomthenose

Addon Developer
Addon Developer
Joined
Jan 27, 2011
Messages
96
Reaction score
0
Points
0
Location
aberdeen, scotland
i know its 10 days on but i'm getting the same error as above, did anyone pinpoint the cause? i thought it was because i had a material with a texture assigned but no UV on some meshes. would it throw up an error?
sadly my solution was to give up on textures temporarily and export to mesh with materials only which worked fine. theres only so many hours in the day!
 

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 know its 10 days on but i'm getting the same error as above, did anyone pinpoint the cause? i thought it was because i had a material with a texture assigned but no UV on some meshes. would it throw up an error?
sadly my solution was to give up on textures temporarily and export to mesh with materials only which worked fine. theres only so many hours in the day!

That error is most often caused by Bmesh returning a value as undefined. This is most commonly caused by orphaned vertices, edges, or an invalid UV map. Go through your project and try to export each object individually until you isolate the specific object causing the error.

Once you've found the culprit make sure that there is no extraneous geometry and that all conversions/transformations have been applied.

Also make sure that material properties have been defined and that the object name contains no spaces.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
I've got this partly solved.

What helps:

- select the relevant objects before export (leave out cameras, lights, etc).
- open the saved orbiter mesh in notepad and see what object made it stop.
- see if you have grouped objects (green outline in Blender) and ungroup them.

This should be enough to export a mesh that loads in Blender.

Mine is still untextured (the exporter crashes when trying to save them) Perhaps it has to do with the fact that the exporter tries to find Orbiter install folder...

As for the inverted normals, I think it has to do with object negative scaling in Blender!
 

chpeller

New member
Joined
Mar 9, 2011
Messages
19
Reaction score
0
Points
0
I had the same problem, my solution is to move my textures directory out of my blender mesh directory.
For exemple if my .blend is in my "picture" directory i put my "msehtex" directory directly in Orbiter/textures/ and then i re-link all my textures in blender from this new position, and i don't have any more problem like this.

I hope it will be helpfull
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Just to say that finally I solved my Blender troubles. It was the scale all along. I needed to apply the scale, otherwise the normals would always get messed.

Since i did the model keeping objects as separate as possible, I'm getting inconsistent lighting in Orbiter, as you can see here:
lem2.png


I guess that if the exit hatch was part of the main body mesh, that would not happen.
Of course, turning down reflections to a more logical setting makes the problem less visible.
 

Izack

Non sequitur
Addon Developer
Joined
Feb 4, 2010
Messages
6,665
Reaction score
13
Points
113
Location
The Wilderness, N.B.
Thank you Vlad for this excellent script. :thumbup:

I'd like to point out, though, that Y+ in Blender becomes the Z- direction in Orbiter, so it's directly away from the main thrust direction. You could say it's in the direction of the main thruster's exhaust.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
I'd like to point out, though, that Y+ in Blender becomes the Z- direction in Orbiter, so it's directly away from the main thrust direction. You could say it's in the direction of the main thruster's exhaust.

You're right, that's my mistake, I should fix the description:)
 

Fast_toche

New member
Joined
Feb 26, 2009
Messages
8
Reaction score
0
Points
0
I found a solution not very academic but it works!
Export and re-import the mesh in blender to a "double remove" and new export ...
Test!
 
Last edited:

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
This advice might be useful for other having trouble with the exporter:


» After much experimentation, I realized that most of my problems came from the n00b use of the "edge-split" modifier. It creates non-manifold meshes that crash the exporter.

» Other thing I found out is that the best way to export multiple materials per mesh is simply to separate them by material in Blender. Then delete all non applied to materials to each mesh. It will export OK.
 

Depth08

New member
Joined
Nov 22, 2013
Messages
19
Reaction score
0
Points
1
I get the following error. Don't know what I'm doing wrong. Any chance to get a simple converter just for the UV's & coords translation to .msh?
 

Attachments

  • Error.jpg
    Error.jpg
    71.6 KB · Views: 40

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
That error seems to be path related.

Yes, the Blender + exporter + Orbiter mesh combination is not that user friendly.
I've suffered with meshes that look like they exported fine, but then crash Orbiter!

So you need to test your export procedure step by step.
Start by exporting some basic Blender geometry, then add some materials, then textures and see what happens.

Common problems are usually having more than one texture per material, using formats other than PNG or JPG, bad geometry, empty objects, etc, etc...
 

Hlynkacg

Aspiring rocket scientist
Addon Developer
Tutorial Publisher
Donator
Joined
Dec 27, 2010
Messages
1,870
Reaction score
3
Points
0
Location
San Diego
That error seems to be path related.

Yes, the Blender + exporter + Orbiter mesh combination is not that user friendly.
I've suffered with meshes that look like they exported fine, but then crash Orbiter!

The most common cause of this is orphaned vertices and non-mesh objects (curves, lights, etc...) getting included in the export. Either keep you blender export layer "clean", or use the mesh test, utility in the SDK.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Yes, forgot to mention that.

If a mesh crashes Orbiter, open it in Mesh Wizard and go through the list of groups.
See how many vertices are in each group. If it shown zero, then note the group name(s) and simply go back to Blender and delete it.
 

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
Hi,
I've been making for the few last days a little script that import all available D3D9 additional textures, such as the normal and specular maps. It works for Blender Internal but I found works better with Blender Game (for no apparent reason).

To Install:
Open the Text Editor, open a file and select the script. Check "Register" and click on "Run Script". You're done !

To use:
  1. Prepare your material: Change the specular, emit and mirror reflection intensity to your desires
  2. Head over the Textures tab, and select the diffuse texture
  3. Click the "Find additional maps" button.
  4. ???
  5. PROFIT !!!

While adding the textures, the specular, emit and reflection intensity will be used for the textures' intensity. If 0, the intensity used will be 1.

DOWNLOAD (Google Drive)
 

SolarLiner

It's necessary, TARS.
Addon Developer
Joined
Jun 14, 2010
Messages
1,847
Reaction score
2
Points
0
Location
404 ROAD NOT FOUND
Script was updated! You have now to install it through the User Preferences ("Install from file" button), and it registers once for all!
Also, I've added a button on the right panel of the 3D viewport to find and add all the additional textures of the selected objects. Time saver!
Download (Google Drive)


In other news, I've been having problems on exporting a mesh from Blender. Here is the blend: https://dl.dropboxusercontent.com/u/98670603/34M_17_send.blend

It either says list out of range, or operator "select_name" not found when I choose to remove orphan vertices.
Anyone can help me?
 

Gendo

New member
Joined
Jun 4, 2013
Messages
16
Reaction score
0
Points
0
^^ In Blender 2.70 that remove orphan vertices export option always seems to cause the errors box. If I select the apply modifiers it flat out crashes Blender. You may have to bite the bullet, and go hunt the orphaned vertices down. If you select all faces and hide them, then change to select vertices and select all the orphans will get selected. On a more simple model with no split edges, I'd just say hit remove doubles, and carefully move up the separation distance for merging until the bar up top indicated some vertices were removed, but parts of your complex model could get messed up without you even noticing. Not sure if it actually matters, but you have 'double sided' checked on all those mesh groups. Great model, btw.

Not sure if this addon semi-broke with 2.70, but it's almost impossible to create any animations. It's like it's reordering the parts on export, yet it hasn't according to the D3D9 debug menu within Orbiter. I got it right once yesterday Then decided to remap my UVs on some replicated parts (landing legs) which required deleting the duplicates, and cloning/rotating the one I remapped, so now the animation looks all wrong again. It's even moving a mesh group that isn't even designated to move at all in my Spacecraft3 script. I applied rotation and scale to the groups, so it can't be that.

---------- Post added at 06:53 PM ---------- Previous post was at 06:34 PM ----------

Just an off the wall guess I found the first group in the Spacecraft3 ini should be 0, not 1, so the last mesh group in the list that wasn't supposed to move was being forced to be the first mesh group in my Spacecraft3 script. Weird, but now it works correctly again. I think the way that Vlad's Blender addon imports and labels mesh groups starting with 1 instead of 0 threw me off, at least with Orbiter's included meshes. lol

Maybe Vladimir might help us out if he has spare time, and review the addon's export options in 2.70. They tend to break addon functionality with every few versions of Blender, but at least it's not completely broken. Those are export options for convenience, so I won't nag anymore than that. ;-) Thanks everyone.
 
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
I found the first group in the Spacecraft3 ini should be 0, not 1, so the last mesh group in the list that wasn't supposed to move was being forced to be the first mesh group in my Spacecraft3 script.

This is pretty much standard in all of computer science and any math beyond basic arithmetic. 0 is "the origin", 1 is "the identity", you always start at the origin and work outwards.
 

Gendo

New member
Joined
Jun 4, 2013
Messages
16
Reaction score
0
Points
0
This is pretty much standard in all of computer science and any math beyond basic arithmetic. 0 is "the origin", 1 is "the identity", you always start at the origin and work outwards.

True.

I don't know if it's some oddity with Blender that won't allow the naming to start at 0, but I think I understand now that Vladimir set up the addon so that if the imported Orbiter mesh file contains no label names for each mesh group, then the addon creates a name for each group in the Blender hierarchy, starting with ORBGroup1. If you import, say, the default Atlantis or ISS mesh, the mesh groups have no label names inside the mesh file, so the addon automatically creates names for the Blender hierarchy. That's what threw me off since I wasn't aware of that. I assumed those hierarchy names actually came from the imported Orbiter mesh. Oh well. A newbie mistake to making Blender work with Orbiter. No worries.
 
Top