Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 07-05-2011, 07:56 PM   #76
Hlynkacg
Aspiring rocket scientist
 
Hlynkacg's Avatar


Default

Quote:
Originally Posted by vlad32768 View Post
 Do you use meshc.exe? I think it should solve such problems.
Use what???

Quote:
Originally Posted by vlad32768 View Post
 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.
Hlynkacg is offline   Reply With Quote
Old 07-06-2011, 03:06 AM   #77
Hielor
Defender of Truth

Default

Quote:
Originally Posted by vlad32768 View Post
 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.
Hielor is offline   Reply With Quote
Old 07-06-2011, 11:13 AM   #78
vlad32768
Orbinaut
Default

Quote:
Originally Posted by Hlynkacg View Post
 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.
Quote:
Originally Posted by Hielor View Post
 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!
vlad32768 is offline   Reply With Quote
Thanked by:
Old 07-30-2011, 03:27 AM   #79
XSSA
Orbinaut
Default

Where do I put this addon for Blender version 2.57? If there are different versions of this then post them all.
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 by XSSA; 08-09-2011 at 10:37 PM.
XSSA is offline   Reply With Quote
Old 08-02-2011, 07:46 PM   #80
Hlynkacg
Aspiring rocket scientist
 
Hlynkacg's Avatar


Default

Quote:
Originally Posted by XSSA View Post
 Where do I put this addon for Blender version 2.57? If there are different versions of this then post them all.
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.
Hlynkacg is offline   Reply With Quote
Old 08-10-2011, 09:14 PM   #81
derludl
Orbinaut
Default Export troubles when adding UV maps

Hello vlad32768,

first of all many thx for endowing us with your Blender 2.5 export addon, really appreciate your efforts!

Note number 7 in your python script
Code:
# 7. Some meshes (XR5 for example) have groups with missing UVs in some vertices. Usually this issue is fixed automatically,
#  but in some cases script could crash with "List index out of range" error. Please report if it happens!
encouraged me to bother you with some troubles I have exporting my models after having added UV maps to them.

I verified my troubles with the most simple setup - by UV unwrapping the cube that is shown when Blender starts. As soon as I add a UV map, exporting the mesh will throw the following error message:

Code:
line 627 in export_msh
  uvs=me.uv_textures[0].data[n].uv_raw[(2*i):(2*i+2)]
IndexError: byp_prop_collection[index]: index 0 out of range, size 0
(unfortunately I could not find out how to attach a screenshot via making a new album ... maybe because this is my first post, and I am not allowed to open a new album before I got approved to post?)

I'm currently using Blender 2.68.1 r38019, 64bit version on Windows7, and your latest export script from http://gitorious.org/blender-orbiter...tarball/master

It should be easy to reproduce the issue by
- starting Blender
- going to edit mode, Unwrap the cube
- try to export the mesh ==> error thrown

Is there something wrong on my end, or some incompatibility between my Version of Blender and your script? Any idea how I could support debugging this issue?

Regards, Ludl

PS: btw, do you know this Blender 2.49->Orbiter.msh export script?: http://sourceforge.net/projects/blorbiter/
That script is nicely written, with plenty of comments, and has some nice features you might want to include in your export module as well, e.g. automatically generating *.dds files by writing and converting a *.bmp directly from python. Neat ;-)
derludl is offline   Reply With Quote
Old 08-15-2011, 09:16 PM   #82
derludl
Orbinaut
Default Export troubles when adding UV maps - Update

Started to debug my problems, installed Winpdb to have a closer look what's going on - many things to learn about internal blender data structures ...

What I realized today is that the simple test case I described in my previous post is indeed throwing an error - but actually an other one than what I get when trying to export my own model.

Looks like the export script dislikes being in "Edit Mode" (instead of "Object Mode") when trying to export the UV unwrapped blender cube. Means:

- starting Blender
- going to "Edit Mode", Unwrap the cube
- remain in "Edit Mode" and try to export the mesh ==> will throw an error

while on the other hand:

- starting Blender
- going to "Edit Mode", Unwrap the cube
- switch back to "Object Mode" and try to export the mesh ==> no error!

As soon as I have learned more about Blender's API, I might better understand what's going wrong here. Meanwhile I just can recommend that whoever stumbles across above error should check if he's trying to export while being in "Edit Mode".

Me, for now, will try to look more into the details of the error thrown when trying to export my own model - which happens around line 679

Code:
if has_uv:
file.write(" {} {}".format(v[2][0],1-v[2][1]))
More to come, I hope ...
derludl is offline   Reply With Quote
Old 08-19-2011, 07:34 PM   #83
vlad32768
Orbinaut
Default

Ludl, thanks for your posts! Sorry for late answer, I was on vacation.

Quote:
PS: btw, do you know this Blender 2.49->Orbiter.msh export script?:
I know that this script exists, but I didn't look at its code. Blender 2.4 has different API, and I decided not to learn Blender 2.4 API and to write my addon from scratch.
Also, I wanted to learn something about Python and Blender 2.5 API; that's why I wrote the addon.

About .dds converting. AFAIK Blorbiter uses an external utility to convert textures to .dds. I write my addon on a Linux workstation, and I don't know any cross-platform utility that can convert files to .dds. So this feature is not implemented, but it's easy to add it.

Quote:
Originally Posted by derludl View Post
 Looks like the export script dislikes being in "Edit Mode" (instead of "Object Mode") when trying to export the UV unwrapped blender cube. Means:

- starting Blender
- going to "Edit Mode", Unwrap the cube
- remain in "Edit Mode" and try to export the mesh ==> will throw an error

while on the other hand:

- starting Blender
- going to "Edit Mode", Unwrap the cube
- switch back to "Object Mode" and try to export the mesh ==> no error!
That's interesting! Didn't try to export while in Edit mode yet. Maybe some internal Blender structures are out of sync with Python API wrappers while Blender is in Edit mode.
When I have time I'll test the script with the latest Blender revision (already 2.59), reproduce this bug and try to fix it. I think the easiest way is to force Blender to go to the Object mode when necessary.
vlad32768 is offline   Reply With Quote
Thanked by:
Old 08-19-2011, 08:11 PM   #84
derludl
Orbinaut
Default Export troubles when adding UV maps - Update2

Hello Vlad, thx for your reply, hope you had nice vacations ... ^^

Meanwhile I found out what was the problem when trying to export my model. As one could have expected, there were some issues in the model. There existed several orphaned vertices, some of them easily removed by Blenders "Remove Double" function (forget to do that after spin-duplicating), but after that done, still several hard-to-find vertices remained. Finally I found out that one can find and get them easily selected by commanding

Code:
bpy.ops.mesh.select_by_number_vertices(type='OTHER')
in Blenders Python console (one needs to be in Edit mode for this, I assume). After that done, no more error from your script!

Looking into the details of your script, I understand that the orphaned vertices are added to the vertex list, but as they are not enlisted in any face, your script fails when trying to add an UV index vector to them. Maybe one could just skip such orphaned vertices? For sure one could improve the error message, I assume ;-)

Regarding *.dds export: you are correct, blorbiter script utilizes "DxTex.exe", a Windows executable. If I should come across a linux *.dds converter I'll let you know ^^ (though chances should be small, especially if targeting for an all-platform solution).

Thx again for your export script! Ludl

PS: Blender2.59 - I need to upgrade ^^
derludl is offline   Reply With Quote
Old 08-24-2011, 06:09 PM   #85
vlad32768
Orbinaut
Default

Some changes:
-- Another fix due to API change. Addon now works with Blender 2.59.
-- Fixed that bug with exporting in Edit mode.
--Added "Delete orphan vertices" feature that helps to avoid "List index out of range" error when there are such vertices in selected meshes. Thanks Ludl for bug investigation!

Last edited by vlad32768; 08-24-2011 at 07:52 PM.
vlad32768 is offline   Reply With Quote
Thanked by:
Old 08-27-2011, 10:11 PM   #86
derludl
Orbinaut
Default

Hi Vlad,

many thanks for continuing your work on exporting mesh files from Blender.

I've tested your latest version with Blender 2.59 on two of my old models (with orphaned vertices in), and your new option to remove those works like a charm!

Best regards, Ludl
derludl is offline   Reply With Quote
Old 05-01-2012, 10:20 PM   #87
vlad32768
Orbinaut
Default

Blender 2.63 is released! The long-anticipated Bmesh is finally here!

I updated the script, it should work with blender 2.63 and later. Now you can use NGons in your models. Download and enjoy!

I tested the script with a very little model with some NGons. Try it with your advanced models and report bugs.

Last edited by vlad32768; 05-01-2012 at 10:26 PM.
vlad32768 is offline   Reply With Quote
Old 05-01-2012, 11:36 PM   #88
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

How did I miss that thread ?

Now that's a really good reason to use Blender instead of Anim8tor...

Excellent work there !
N_Molson is offline   Reply With Quote
Old 05-02-2012, 12:11 AM   #89
Hlynkacg
Aspiring rocket scientist
 
Hlynkacg's Avatar


Default

Havn't found any issues yet.

Thanks again Vlad. Congrats on a job well done.
Hlynkacg is offline   Reply With Quote
Old 05-02-2012, 01:09 AM   #90
Hielor
Defender of Truth

Default

Quote:
Originally Posted by vlad32768 View Post
 Blender 2.63 is released! The long-anticipated Bmesh is finally here!

I updated the script, it should work with blender 2.63 and later. Now you can use NGons in your models. Download and enjoy!

I tested the script with a very little model with some NGons. Try it with your advanced models and report bugs.
I assume you just triangulate the NGons when exporting to .msh?
Hielor is offline   Reply With Quote
Thanked by:
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 09:47 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.