Project Blender 2.63 + to Orbiter import/export addon

Traveller

Donator
Donator
Joined
Apr 25, 2012
Messages
27
Reaction score
0
Points
1
If you have IDLE installed, load the script in it and then Run/ Check Module. That will show any errors-- basic errors will cause the script not to show in Blender.

Or, just download again. Is the size of your .py file 33682 bytes?
 

MachJok

Member
Joined
Dec 27, 2009
Messages
46
Reaction score
0
Points
6
oh wow. No my .py is only 172032 bytes. Thanks for the heads up.

---------- Post added at 00:34 ---------- Previous post was at 00:08 ----------

I have never used git before I thought I could just download the file from the link. I found a .py at https://gitorious.org/blender-orbiter-io/blender-orbiter-io/trees/master but that is way too small to be it. I tried using GIT BASH from shawn pierce...I am lost. I tried a clone command but it couldn't find the repository and a :) was returned as the error. Bizarre stuff.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
I have never used git before I thought I could just download the file from the link. I found a .py at https://gitorious.org/blender-orbiter-io/blender-orbiter-io/trees/master but that is way too small to be it. I tried using GIT BASH from shawn pierce...I am lost. I tried a clone command but it couldn't find the repository and a :) was returned as the error. Bizarre stuff.

You don't have to use git. The link to .tar.gz file in the first post of this thread should work well.

However, if you use Git, try this:
git clone git://gitorious.org/blender-orbiter-io/blender-orbiter-io.git
 

SpaceNut

New member
Joined
Jun 15, 2008
Messages
316
Reaction score
0
Points
0
Location
Lorain
Yeah vlad, but that tar.gz file contains a file called "master". WinZip asks for the exact file name (io_orbiter_msh.py)???

Anyway, if you extract it, it extracts the python script, but there's garbage in the begining of the file. I deleted the garbage in notepad up to where it says "Notes on .msh...", and then that file worked... but I'd really like to know the proper way to extract the file, would be helpful... thanks.
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Update

Update: Import creates an Empty object which becomes a parent of the imported objects.
As Traveller suggested.

---------- Post added at 09:35 PM ---------- Previous post was at 09:42 AM ----------

Yeah vlad, but that tar.gz file contains a file called "master". WinZip asks for the exact file name (io_orbiter_msh.py)???

Anyway, if you extract it, it extracts the python script, but there's garbage in the begining of the file. I deleted the garbage in notepad up to where it says "Notes on .msh...", and then that file worked... but I'd really like to know the proper way to extract the file, would be helpful... thanks.

OK. I downloaded the archive, extracted the .py file and made a screenshot.
What did I do?
-- I clicked at the link and downloaded the file. You can see a part of Firefox Downloads window with .tar.gz file.
-- I opened the file with 7-zip. You can see its window and file io_orbiter_msh.py. There is no "master" file.
-- I opened the .py file with Wordpad. As you see, there isn't any garbage in the beginning of the file.


picture.php
 

SpaceNut

New member
Joined
Jun 15, 2008
Messages
316
Reaction score
0
Points
0
Location
Lorain
Ok, I follow the link on page 1, it sends me a file called master.gz... size: 10,044 bytes.

I open it with 7zip as you stated you use and I get this:
http://www.orbiter-forum.com/gallery/showfull.php?photo=4397

There you see that the file name within the archive is 'master' with no extension, and you can also see the unpacked and packed sizes of the file....

I then click Extract and I get this:
http://www.orbiter-forum.com/gallery/showfull.php?photo=4398

As you can see.. it's extracting a file called 'master' from the archive.....then, when I edit the extracted file, I get this:
http://www.orbiter-forum.com/gallery/showfull.php?photo=4399

So, if I delete the header info highlighted there... (Some sort of git header I'm assuming?)
I can save the file out as io_orbiter_mesh.py, and it works like a charm.

So, if I implied you had done something wrong, that wasn't my intention. All I'm saying is, I'm following your instructions, which, to me, make perfect sense, and I expect to download an archive and extract io_orbiter_msh.py from it, but... as you can clearly see, that's not what I'm getting. So I'm not saying you're doing anything wrong, what I'm saying is, what I'm I doing wrong.

Thanks :)


P.S. I get the same results with winRAR, WinZip and 7Zip. Also, I'm noticing you seem to be receiving a file called blender-orbiter-io-blender-orbiter-io-master.tar.gz whereas I seem to receive a file called master.gz.
 
Last edited:

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Strange, I'm getting a file called "blender-orbiter-io-blender-orbiter-io-master.tar.gz" instead of the master.gz file you get.

Did you try to enter into "master" file while still in 7-zip, or just extracted it and opened with notepad? Either try double clicking on it, or try renaming the downloaded file to master.tar.gz. The 7-zip should recognize then that it's a tarball and you'll be able to enter inside the tar archive.
 

Traveller

Donator
Donator
Joined
Apr 25, 2012
Messages
27
Reaction score
0
Points
1
Instead of "Extract", click (or double-click) the master file. When I do that, it opens up into a file, "Pax Global Header" or similar, and a folder. Click (or double-click) the folder, and it will reveal the .py file. Select the .py file and copy or save-as or extract-to. This is with 7-Zip.
 
Last edited:

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Ok, I follow the link on page 1, it sends me a file called master.gz... size: 10,044 bytes.
......
P.S. I get the same results with winRAR, WinZip and 7Zip. Also, I'm noticing you seem to be receiving a file called blender-orbiter-io-blender-orbiter-io-master.tar.gz whereas I seem to receive a file called master.gz.

That's very strange.
So, I created a mirror at GitHub (which produces .zip files) and added a new link to .zip file in the first post. I'm sure it will solve all problems.
 

SpaceNut

New member
Joined
Jun 15, 2008
Messages
316
Reaction score
0
Points
0
Location
Lorain
Thanks Orb, Traveller and Vlad...

You hit it Orb, renaming it to .tar.gz was the trick, I could click my way down to the python script no problem.

@Everyone.. I still think it was pretty cool how I sucked the script out of that tarball... leaves a nasty taste though.... ;)
 

astrogull

New member
Joined
Apr 26, 2009
Messages
29
Reaction score
1
Points
3
Hi vlad32768,

I downloaded your addon some weeks ago and I must say it's great, it's fast and it works in blender 2.63, which gave me the push to migrate to the new blender. I feared the trouble of converting the old orbiter-mesh import/export addon, but then stumbled upon this one. You have done all the hard work. Thanks.

I've done some modifications and resolved some issues, but first one question. Why don't you publish your addon in Orbit Hangar Mods under Utilities, Dev tools? It's a must have for everyone using Blender to model for Orbiter.

In this mail are 2 zip files, one for the io_orbiter_msh.py and one for exporting images as DDS. Try them out. The last one is adapted by me to export texture images of selected objects which solves the problem of saving images as .png files, which is not very satisfactory for people who don't want to bother. And it's convenient for making a publishable addon fast. Though I prefer to work with a photo editor like the Gimp or Photoshop (no advertising, sorry) making textures and export from there as .dds. But as this dds plugin uses nvidia_dds.exe whith lots of options, I gave up my restraints.

The changes, lot's of them, not ment as criticism, some important, some nice to have, some just a matter of taste. Just tested it with blender 2.63a, rel.46487M in Windows 7 64 bit.

1. Images in import: in your addon I had to link them by hand to the objects, edit mode, in the UV editor. I don't know if this is just some weird windows behaviour. Anyway I linked the image in the py script to the objects. It means first loading all the textures in .msh file before creating the mesh. Major change, separated the create_texture from create_material. Images are save in tximg list, then create_mesh with image linked for all groups, then create_materials.

2. Orphans, i.e. loose vertices in export: solved, but it is not necessary to delete them, because,

3. Generating the vertices from the faces there are no orphans in the export. This approach is used for using face normals in case of exporting objects as flatshaded. Once in a while, very rarely, f.i. exporting bolts and screws, used, but Orbiter is capable of showing flat shading.
So I made an option Smooth all, default True, your solution, using vertex normals for exporting all objects set smooth and False for only set smooth selected faces or objects. It creates more double vertices, (vertex, normal pairs for every face an vertex belongs to). See commentary in script. Major change.

4.Labels in import: some old orbiter .msh files have the names as commentary in GEOM section after emicolon. for compatibility reasons changed.

5. Texture names in import, changed to image filenames without extension. Mini change.

6. Missing textures at end of .msh file in import trying to read past end of file. Solution break in for, stop appending textures.

7. Added timer in import, export. Nice to have. Fast, fast fast. If not, maybe forgotten to delete mesh before importing a new one and exporting all of them at once.

8. Formatted the output, Blender rounds off after 4 decimals, material colors 3. Imperceptible. Smaller .msh files, easier to check. Taste, I think.

9. In export: extension must be .msh. Users do the most crazy things, or when you are in a hurry. Could even say, no dots except before the extension, but let it be, this is adequate enough.

10. In export: now that the dds problem is solved changed the save_images as .png to: copy them from source to filetex directory, except the one's not on disk, save those as .png's'.

11. Last one, definitely of taste and maybe inconvenient for those accustomed to work with your addon.

Coordinate sytems. Lot's of confusion on the internet. Even Martin is not clear about it: Quote from OrbiterConfig.pdf, pg 29, 4 Mesh files:

"Orbiter meshes are defined in a left-handed coordinate system. Vessel meshes should be oriented such that the vessel’s nose (or more precisely, its main thrust direction) points in the positive z-direction, the positive x-axis points right, and the positive y-axis points up."

And the pos. z-direction?. In lhc-system it points away from the user. Ok.
For your addon it means only swapping the y, z axes. Rotating 180 degr's the new x, y round the new z-axis is not necessary. In blender (rhc-system) the rocket stands up in the xy plane. Simply use numpad 7 and what you see in Blender is what you see in Orbiter (using convert_coords).

I could say something more about the qoute and coordinate systems in general but it has nothing to do with your addon. maybe in another thread.

So, this is it. A long story, but I liked working on this addon, and in the meantime learned python 3.2 and found my way in blender python api.
I hope you can use some of thes suggestions.
 

Attachments

  • io_dds_263sel.zip
    392.8 KB · Views: 29
  • io_orbiter_msh263.zip
    11.5 KB · Views: 19
Last edited:

SpaceNut

New member
Joined
Jun 15, 2008
Messages
316
Reaction score
0
Points
0
Location
Lorain
Wow... cool stuff man... great job, downloading it now, going to check it out. I can't speak for Vlad, but I sure think what you did was very contributory, and I imagine he'll feel the same since Orbiter is all abut everyone just pitching in to do what they can. Glad to see you made the jump to Blender, both Orbiter and the Blender community benefit from you coming on board.

Thanks for your hard work!
 

vlad32768

Member
Joined
Oct 11, 2010
Messages
78
Reaction score
0
Points
6
Hi vlad32768,

I downloaded your addon some weeks ago and I must say it's great, it's fast and it works in blender 2.63, which gave me the push to migrate to the new blender. I feared the trouble of converting the old orbiter-mesh import/export addon, but then stumbled upon this one. You have done all the hard work. Thanks.

I've done some modifications and resolved some issues, but first one question. Why don't you publish your addon in Orbit Hangar Mods under Utilities, Dev tools? It's a must have for everyone using Blender to model for Orbiter.

Hi ansrogull,

Thanks for your suggestions and fixes! I'll look at them when I have free time.

I didn't publish the add-on in Orbit Hangar, because it's much easier to publish projects like this in Gitorious or Github. A new archive generates automatically when I push the changes to the repository. This is very comfortable: I don't need to upload a new archive after any bugfix. As for addon developers, I think that any developer will search forum for answers about development (and about exporting meshes, of course).

A question for you: Why don't you use Gitorious or Github? It's much easier to look at your changes and merge them, if you commit changes to a git repository.
 
Last edited:

SpaceNut

New member
Joined
Jun 15, 2008
Messages
316
Reaction score
0
Points
0
Location
Lorain
Vlad, I've seen some add on's in Orbithanger that point to external downloads. You could "advertise" the download there, where alot of people do searches for stuff, and simply point to the repository link in the Orbithanger submission.... just a thought. Either way, thanks again for contributing a (Blender) add on that (IMHO) is a real boost to making life easier for the Orbiter community looking to create add ons.
 

astrogull

New member
Joined
Apr 26, 2009
Messages
29
Reaction score
1
Points
3
Hi ansrogull,

I didn't publish the add-on in Orbit Hangar, because it's much easier to publish projects like this in Gitorious or Github. A new archive generates automatically when I push the changes to the repository. This is very comfortable: I don't need to upload a new archive after any bugfix. As for addon developers, I think that any developer will search forum for answers about development (and about exporting meshes, of course).

Orbit hangar is the first place where I would search for an Orbiter addon, when it's ready to be released. The benefits are: all in one place, less chance on broken links (even on this forum there are some), more accessible to a larger audience, which leads to more downloads (with a track record). At the same time a release message, including a link) is placed in the addon section of this forum.

Though the search capacities in Orbiter Hangar are limited it has Orbiter releated categories like devtools, scenery, planets, spacecraft, futuristic and so on.
At this moment there are some 4000 addons in this repository and I think I know evereone which is of special interest to me, or amazing, brilliant, odd, useful. Even when you visit this site once a month, or a year, then within 5 minutes you are up to date. So it gives a quick answer to a question of people who just want a quick fix for their problem, in this case: how can I export an orbiter mesh from blender.

Second place would be using a search machine like google which gives more results and often leads to this forum. A good starting point when you want to know more.

I agree with you than as long as you are in a development stage it's more advantageous to use suitable environment.

A question for you: Why don't you use Gitorious or Github? It's much easier to look at your changes and merge them, if you commit changes to a git repository.
Very useful, I think, when you're working with several people on 1 project and for larger projects. Up to this moment I did'nt feel the need (didn't even know of the existence) to use git, but I checked the sites now. I simply use notepad++, plugin, compare to check the changes and eclipse as python IDE.

Spacenut said:
You could "advertise" the download there, where alot of people do searches for stuff, and simply point to the repository link in the Orbithanger submission...
That's possible, I used it in some cases where I refered to addons used in my addon, though I had a complaint of the site no longer being accessible, luckily not true.
 

Traunmark5

New member
Joined
Jul 21, 2010
Messages
8
Reaction score
0
Points
0
Giving it a go!!!

Blender 2.63 is an awesome 3d modle program to work in. extreamly powerfull and i love it. 2 bugs possibly though. the first is with transparancies. when viewing through a transparent face in orbiter the meshes behind it are invisible. not all but most. after setting a material to transparent it also causes some intersecting meshes to bug out. a little hard to explain but it seems to take some intersecting meshes and perform a boolean difference on them. other than that this program is sooooo awesome. cant wait to unleash some addons to a much deserving community:thumbup:
 

SpaceNut

New member
Joined
Jun 15, 2008
Messages
316
Reaction score
0
Points
0
Location
Lorain
all meshes only have 1 face, so when you're looking into the window, you're not going to see the "inside" of the craft unless you've either solidified the object with the (go figure) Solidify modifier, or manually made faces for the "inside". the easiest way to do it is generally to use solidify.

As for the intersecting mesh/bug issue, I've not had any issues.
 

astrogull

New member
Joined
Apr 26, 2009
Messages
29
Reaction score
1
Points
3
See for a clever use of transparency delta_missions_v1_100930.zip from BrianJ [ame="http://www.orbithangar.com/searchid.php?ID=3451"]Delta II Missions Vol.1[/ame] , KSC LC-17 Pads A & B.
Transparency works like a one way screen, so sorting the objects in the mesh is necessary. The last group in the .msh file gets the highest priority. Also use an inside face and an outside face with transparent textures and still you have to be careful where to place the objects in the scene.

Now the orbiter mesh import comes in handy, to study how BrianJ did the trick. I used it in LC40, not published, there is already one from Kev33, however not with transparency. It's a pity that shadows of mesh on mesh is not solved in Orbiter, but I hope that it will be in D3D9 or D3D11 client.
 

jimblah

New member
Joined
Jan 11, 2011
Messages
212
Reaction score
0
Points
0
Location
Midtown Sacramento
I'm new to graphics, this script will help.

picture.php


Thanks Vlad and everyone helping hime to improve it. Blender is extremely well documented. I believe this script will have a vast impact on how long it will be before I submit an addon at the Hangar for approval.

:hailprobe:
 

Columbia42

Member
Joined
Dec 4, 2009
Messages
884
Reaction score
0
Points
16
Location
C:\ProgramFiles\Orbiter
I found this script a little while ago and it looks really cool however I'm having a problem importing meshes. I'm relatively new to blender here so I could be missing something really obvious but for some reason I can't get this script to import textures. I am importing the mesh from the Orbiter meshes folder and all of the textures I need are in the textures folder. Has anyone else had a similar problem?
 
Top