Project Blender Mesh Tools add-on

llarian

Well-known member
Joined
Apr 1, 2009
Messages
575
Reaction score
159
Points
58
Location
Ottawa
When you uv unwrap your mesh, does it convert to Obiter uv coordinates or does it keep the Blender ones?
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
When you uv unwrap your mesh, does it convert to Obiter uv coordinates or does it keep the Blender ones?

It flips the 'v' coordinate:

u = u
v = 1 - v

This should flip it to what Orbiter expects.
 

llarian

Well-known member
Joined
Apr 1, 2009
Messages
575
Reaction score
159
Points
58
Location
Ottawa
Sorry about that. I should have Googled first. I forgot about the rotate and flip. An older thread enlightened me.
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
I have updated the tutorial document included with this plugin. (the github link in the OP) The tutorial PDF is also attached here.

It is a bit verbose, but if you are interested in building a simple Orbiter vessel using Blender 2.81 you may find it useful.

 

Attachments

  • Orbiter Tools Tutorial.pdf
    888.2 KB · Views: 36

Jordan

Active member
Joined
May 13, 2010
Messages
136
Reaction score
80
Points
43
Location
Germany
When I try to import the mesh ISSR/STSpad39A.msh from
[ame="https://www.orbithangar.com/searchid.php?ID=7036"]LC39A+B for ShuttleFLeet HD[/ame]
I get this error

Traceback (most recent call last):
File "C:\Users\Jordan\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\orbiter-blender-master\__init__.py", line 164, in execute
import_tools.import_mesh(config, path)
File "C:\Users\Jordan\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\orbiter-blender-master\import_tools.py", line 428, in import_mesh
mat = bpy.data.materials[grp_mat_name]
KeyError: 'bpy_prop_collection[key]: key "STSpad39A_Main hardstand material_Main_Concrete_Hardstand_texture_1" not found'

location: <unknown location>:-1

if i rename the texture to a shorter name for example "Main_Concrete_Hardstand_texture_1.dds" to "mcht1.dds" both in the mesh file and the texture file itself, then it works.
 
Last edited:

llarian

Well-known member
Joined
Apr 1, 2009
Messages
575
Reaction score
159
Points
58
Location
Ottawa
Blake, is it possible to import an Orbiter .msh file into Blender that was not originally composed in Blender with your addon?

I can import test model meshes that I previously created in Blender under your addon, but if I try to import, for example, ShuttlePB.msh, the import fails.

Here is the pertinent Blender log output:

bpy.context.space_data.system_folders_active = 0
bpy.context.space_data.system_folders_active = 0
Traceback (most recent call last):
File "C:\Users\imstarlost\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\orbiter-blender-master\__init__.py", line 164, in execute
import_tools.import_mesh(config, path)
File "C:\Users\imstarlost\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\orbiter-blender-master\import_tools.py", line 420, in import_mesh
uvl.data[i_loop].uv = (uvs[i_vert][0], 1-uvs[i_vert][1])
IndexError: list index out of range

location: <unknown location>:-1

For testing I am using a clean Orbiter install. No other addons. C:/Orbiter and C:/Orbiter/Meshes.

I presume I missed something. Problem seems similar to what Jordan experienced but I can't find my way out of it.

Thanks in advance
 
Last edited:

Jordan

Active member
Joined
May 13, 2010
Messages
136
Reaction score
80
Points
43
Location
Germany
I can import test model meshes that I previously created in Blender under your addon, but if I try to import, for example, ShuttlePB.msh, the import fails.

I can Import other meshes but this one fails.

Traceback (most recent call last):
File "C:\Users\Jordan\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\orbiter-blender-master\__init__.py", line 164, in execute
import_tools.import_mesh(config, path)
File "C:\Users\Jordan\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\orbiter-blender-master\import_tools.py", line 420, in import_mesh
uvl.data[i_loop].uv = (uvs[i_vert][0], 1-uvs[i_vert][1])
IndexError: list index out of range

location: <unknown location>:-1


---------- Post added at 07:49 PM ---------- Previous post was at 07:46 PM ----------

I presume I missed something. Problem seems similar to what Jordan experienced but I can't find my way out of it.


my above mentioned error could result from filenames being too long
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
You should be able to import any Orbiter mesh file. I'll check the ShuttlePB again. For testing import I went through all of the stock meshes. Something may have broke, but they should work.

Is your Orbiter folder very deep into a hierarchy? I'll try that as well.

...
Update...
I am seeing the same error on ShuttlePB, I'll take a look.
 
Last edited:

Jordan

Active member
Joined
May 13, 2010
Messages
136
Reaction score
80
Points
43
Location
Germany
Is your Orbiter folder very deep into a hierarchy? I'll try that as well.


If you mean me, no. My orbiter is in the Root of Partition D:\


Same error occurs when i try to Import ProjectApollo/Saturn5ML.msh
 

llarian

Well-known member
Joined
Apr 1, 2009
Messages
575
Reaction score
159
Points
58
Location
Ottawa
And if you mean me, no. For test purposes I have been following your pdf to the letter (I think).
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
When I try to import the mesh ISSR/STSpad39A.msh from
LC39A+B for ShuttleFLeet HD
I get this error



if i rename the texture to a shorter name for example "Main_Concrete_Hardstand_texture_1.dds" to "mcht1.dds" both in the mesh file and the texture file itself, then it works.


Now that I've had a bit more time to look at this I see what is going on. It appears there is a limit on the size of a Blender material name so we end up looking for a name that has been truncated, so no match. I'll need to think on this a bit. I probably need to take the first 'n' chars of each name.

That's why shortening the name worked, but you should not have to do that.

---------- Post added at 06:11 PM ---------- Previous post was at 06:06 PM ----------

And if you mean me, no. For test purposes I have been following your pdf to the letter (I think).

I hope you find that useful. It is a bit rough and could use some polish.

Also, I'm starting to port my SR71R project to Blender 2.81 so that ought to shake out some issues with the plug in and Blender in general.

I'm really liking 2.81, there are some great tools I want to take advantage of.

---------- Post added at 06:17 PM ---------- Previous post was at 06:11 PM ----------

v2.0.4 is now available on github. Fixes the ShuttlePB import issue.
Does not fix the material name is too long issue
 

llarian

Well-known member
Joined
Apr 1, 2009
Messages
575
Reaction score
159
Points
58
Location
Ottawa
At least we have a work around and know the issue. I had been testing the import function and bumped into the ShuttlePB by accident, not that I wanted to work on it.

Even as it stands I find the addon quite useful and a little documentation goes a long way even if you think it's rough.

Looking forward to seeing your development with it.

Thanks a bunch.

Now that I've had a bit more time to look at this I see what is going on. It appears there is a limit on the size of a Blender material name so we end up looking for a name that has been truncated, so no match. I'll need to think on this a bit. I probably need to take the first 'n' chars of each name.

That's why shortening the name worked, but you should not have to do that.

---------- Post added at 06:11 PM ---------- Previous post was at 06:06 PM ----------



I hope you find that useful. It is a bit rough and could use some polish.

Also, I'm starting to port my SR71R project to Blender 2.81 so that ought to shake out some issues with the plug in and Blender in general.

I'm really liking 2.81, there are some great tools I want to take advantage of.

---------- Post added at 06:17 PM ---------- Previous post was at 06:11 PM ----------

v2.0.4 is now available on github. Fixes the ShuttlePB import issue.
Does not fix the material name is too long issue
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
Can it be that the python .split method doesn't work as it should?

I added a debug statement to compare the name of what I give Blender when creating material, compared to the name of the new material and can see it is truncating at 64.

I plan on changing that naming algorithm so that the names are still somewhat meaningful and don't overrun Blender's name limit.
 

Jordan

Active member
Joined
May 13, 2010
Messages
136
Reaction score
80
Points
43
Location
Germany
When I delete the texture, the following error occurs.

RuntimeError: Error: Cannot read 'd:\orbiter\Textures\Main_Concrete_Hardstand_texture_1.dds': No such file or directory

It seems that the path to the texture is ok.

The 'd:\orbiter\Textures\Main_Concrete_Hardstand_texture_1.dds' is without spaces, i dont know why Orbiter forum adds a space.
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
2.0.5 now available.

Fixes the issue with texture / material naming. The imported material name is now material_texture_scene which seems to make more sense then listing the scene name first.

Import will now check Textures2 for a texture file and then look at Textures if not found.
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,060
Reaction score
864
Points
128
Website
francisdrakex.deviantart.com
picture.php


Blake, thank you for creating this Blender export tool!

Blender 2.8x has a much improved user interface compared to older versions, but I would not use it if there was no proper export tool to Orbiter.
Your tool worked right away after installation, following the procedure in the Readme-file and the tutorial.

Learning Blender is a major chore by itself. In the screenshot I tried a Grape-ship from the book 'Delta-V'. It looks so rough like my first models 15 years ago! ;)
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
A heads up...

As I begin porting my SR71R project to Blender 2.81 I'm running into other subtle changes to how Blender 2.8x does things. One of those things is how mesh modifiers are applied with respect to the current context. In short, only the objects in the current scene (the 'context') will have modifiers applied when exported. If you have a single scene, everything is fine. I have not found a good way around that that does not involve switching context as the script is running. I'd rather avoid that.

This is all related to how scenes, groups, layers etc. have changed. It should be much easier to organize meshes and assets, but I have not figured all of that out just yet.

Edit:
This is now fixed in 2.0.6.
 
Last edited:

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,060
Reaction score
864
Points
128
Website
francisdrakex.deviantart.com
I have a question regarding faces shown in Blender vs Orbiter:
In Blender surfaces are shown on both sides of a face, e.g. on the inside and outside of a hollow cylinder. But in Orbiter only the side with the +normal is rendered.

Is there a method to render the surfaces in Blender the same way?

After duplicating the objects in Blender and inverting the normals it is hard to tell which is the inner surface and which is the outer. The tiny blue normal lines are only shown in Edit Mode and difficult to interpret.
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,150
Reaction score
13
Points
53
In the top right corner of the viewport is a row of 4 circles and a down-arrow. Click the down arrow and check "Backface Culling" under "Options"
 
Top