Project Blender Mesh Tools add-on

Buck Rogers

Major Spacecadet
Joined
Feb 26, 2013
Messages
396
Reaction score
316
Points
63
still using 3.1.2, any advantages in upgrading (for Orbiter devs)?
 
Last edited:

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
242
Reaction score
126
Points
58
Location
Lehi, Utah
Probably not, if that is working for you. A lot of the work in Blender is in areas we don't much care about for Orbiter work. Still, I usually work with the latest that will work with the plugin. For now that is 4.0. I do notice that 4.0 is slower to open on my machine, so there is that.
 

Buck Rogers

Major Spacecadet
Joined
Feb 26, 2013
Messages
396
Reaction score
316
Points
63
Thanks, good to know. I'll take another look when 4.1.2 comes out (hopefully no compatibility issues)
(I'm a little worried that updating will change the layout, I have an older version installed for 3ds support but except for import/export I can't use it!)
 

Buck Rogers

Major Spacecadet
Joined
Feb 26, 2013
Messages
396
Reaction score
316
Points
63
How can I get Blender to export vertex normals texture uv coordinates for a mesh group without texture?

I'm trying to get HUD, MFDs working and figured out the problem is that the display panel is only a material and blender exports it without uv coord., (only 6 and not 8 entries in the vertex list) which is correct, but HUDs etc. need them. I've tried adding a uv map, use nodes image, but it either exports without or an error due to missing tex. file?
I've done this in 3dsmax and not had this issue. Does anyone have any experience making HUDs, MFDs in Blender?
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
242
Reaction score
126
Points
58
Location
Lehi, Utah
How can I get Blender to export vertex normals texture uv coordinates for a mesh group without texture?

I'm trying to get HUD, MFDs working and figured out the problem is that the display panel is only a material and blender exports it without uv coord., (only 6 and not 8 entries in the vertex list) which is correct, but HUDs etc. need them. I've tried adding a uv map, use nodes image, but it either exports without or an error due to missing tex. file?
I've done this in 3dsmax and not had this issue. Does anyone have any experience making HUDs, MFDs in Blender?

For a VC?

In Blender you will have a plane that represents the HUD or MFD surface, unwrap that and assign it a texture. SR-71R does this, and uses the same texture where the VC controls are laid out. In Blender you will see that texture on that plane, but you don't see it at runtime--just whatever is drawn to that surface.

The code to load the HUD looks like this:

Code:
bool HUD::handle_load_vc(bco::vessel& vessel, int vcid)
{
    // Register HUD
    static VCHUDSPEC huds =
    {
        1,                        // Mesh number (VC)
        bm::vc::HUD_id,            // mesh group
        { 0.0, 0.8, 15.25 },    // hud center (location)
        0.12                    // hud size
    };

    oapiVCRegisterHUD(&huds);    // HUD parameters
    return true;
}

The mesh file entry:

Code:
LABEL HUD
MATERIAL 4
TEXTURE 4
FLAG 7
GEOM 4 2
-0.0634 0.8619 15.2558 0.0000 0.0000 -1.0000 0.0001 0.0004
0.0633 0.8619 15.2558 0.0000 0.0000 -1.0000 0.9996 0.0001
-0.0634 0.7352 15.2558 0.0000 0.0000 -1.0000 0.0004 0.9999
0.0633 0.7352 15.2558 0.0000 0.0000 -1.0000 0.9999 0.9996
...
... <MATERIAL 4>
MATERIAL VC_100_Cockpit_MAT
0.800 0.800 0.800 1.000
0.000 0.000 0.000 1.000
0.000 0.000 0.000 1.000 49.030
0.600 0.600 0.600 1.000
 

Buck Rogers

Major Spacecadet
Joined
Feb 26, 2013
Messages
396
Reaction score
316
Points
63
Thanks for the clarification. So I can link it to any texture to get it to export the UVs, and then I can set tex, to 0 manually in the .msh file or just leave it.
Works, thanks again :)
 

Boxx

Mars Addict
Addon Developer
Donator
Joined
Nov 15, 2009
Messages
200
Reaction score
132
Points
58
Location
Paris Area
hi, small bug + easy fix: you export the objects with their exact same names in the .h (+prefix/suffix possibly). Hence, if an object name contains a dot ".", it turns into a syntax error. It happens whenever I duplicated an object multiple times, e.g.:

Code:
    const UINT Ceiling.000_id = 0;
    const UINT Ceiling.001_id = 1;
...

Easy fix on user's side is to replace all ".0" by "_0" in the .h
But a clean fix would be to do the same in the addon itself.

(excellent addon, by the way, it saved my life! congrats)
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
242
Reaction score
126
Points
58
Location
Lehi, Utah
hi, small bug + easy fix: you export the objects with their exact same names in the .h (+prefix/suffix possibly). Hence, if an object name contains a dot ".", it turns into a syntax error. It happens whenever I duplicated an object multiple times, e.g.:

Code:
    const UINT Ceiling.000_id = 0;
    const UINT Ceiling.001_id = 1;
...

Easy fix on user's side is to replace all ".0" by "_0" in the .h
But a clean fix would be to do the same in the addon itself.

(excellent addon, by the way, it saved my life! congrats)

This is an issue I'm aware of, and have run into often. Blender, when you duplicate an object, will append the .001 to the object name. the '.' is invalid in C++ as an identifier, so you end up with a compiler error. I thought I at one point had added (or intended to add) code to just convert any '.' with '_'. The other side of that coin is that I do like when the compiler complains because I forgot to give an object in Blender a proper name. I then go back and give those objects more meaningful names, removing the .00x. The down side of automatically converting the . is that the C++ identifier, and the Blender object names don't match, but that is minor, so I'll probably take a look at that.

Regardless, I've found that giving my Blender objects meaningful names sure does help understanding the C++ code that ends up using those objects.
 

Boxx

Mars Addict
Addon Developer
Donator
Joined
Nov 15, 2009
Messages
200
Reaction score
132
Points
58
Location
Paris Area
Golden rule is to keep meaningful names. In my case, I duplicate with a Blender python script several objects 36 times, so that I end up with a lot of .0xx indices, they all "mean" something and I can't change them manually in Blender... Nevertheless, I can fix in C++ easily but it needs to be redone after every update of the genuine model.
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
242
Reaction score
126
Points
58
Location
Lehi, Utah
Yea, there are times you cannot avoid the .0xx issue easily. I'll take a closer look at this and maybe at least provide a way to turn off the automatic conversion of . to _ if needed.

Thanks for the input.
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
242
Reaction score
126
Points
58
Location
Lehi, Utah
Latest

This should clean up the naming issue for the C++ include files. I've done some cursory testing, so if you find issues let me know.
 

Boxx

Mars Addict
Addon Developer
Donator
Joined
Nov 15, 2009
Messages
200
Reaction score
132
Points
58
Location
Paris Area
Sorry to report an error while exporting from Blender 4.0 with your 2.1.7 version. I can PM you my file if it helps (I've got a somewhat-large collection hierarchy).

orbiter-blender-2_error.pngContext => orbiter-blender-2_context.png

Now I want to re-install v2.1.4 in Blender (after removing Addon v2.1.7 from User Preferences panel) and I can't anymore => do I have to clean anything before re-installing?

:eek:
 
Last edited:

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
242
Reaction score
126
Points
58
Location
Lehi, Utah
Yes, PM me your file, I'll take a look. Does not appear to be related to these changes, but you never know.

As for rolling back, you should be able to just remove the current version (the Remove button in preferences/add on/Orbiter Mesh Tools). Then select the Install... button at the top of that dialog and select the .zip file for the version you want.
 

Boxx

Mars Addict
Addon Developer
Donator
Joined
Nov 15, 2009
Messages
200
Reaction score
132
Points
58
Location
Paris Area
Thank you for the quick fix. Version 2.1.8 works also for me now! Again, excellent Blender addon.
 
Top