Project VesselBuilder for Orbiter

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
C++ itself isn't that hard to grasp.
Getting an environment to start with (compiler, linker, IDE, "project"/"solution"/makefile) is the part which is confusing (can even be frustrating).
To make this entry-hurdle less challenging, I created >> slngen << a while ago.
You might give it a try. It's neither perfect not feature-complete, but can be a starting point once you've installed Visual Studio.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,271
Reaction score
3,244
Points
203
Location
Toulouse
Unfortunately I don't know c ++

You don't have to "know it", really. You learn by looking at the samples that come with Orbiter SDK and from addons that include their source code. Then its a lot of experimentation and trial and error. ?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
Update: Now I'm getting an warning message.
Put VB in a fresh new clean installation and VB works now. I guess, something on my end had been corrupted and caused issues. Sorry for sending you on a potential wild goose-chase after a bug that may not exist.
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
611
Reaction score
449
Points
78
Location
FRANCE
Website
francophone.dansteph.com
Hello

I struggled a bit with the management of the attachment points: it's a little more complicated than with "Spacecraft3 / 4" but I arrived at something nice and fun. (it took me several hours of testing to find) ....

Fred18 you are awesome !!!

I'll let you watch the result:


I continue my delirium .... ? :cool:
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
MAybe I am doing something wrong. My mesh loads in d3d9 but when I select the groups for animation it CTDs
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Can you post the log and some screenshot?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
8,636
Reaction score
2,613
Points
203
Location
Dallas, TX
here is ther log:
**** Orbiter.log
000000.000: Build Aug 28 2016 [v.160828]
000000.000: Timer precision: 1e-007 sec
000000.000: Found 0 joystick(s)
000000.000: Module AtlantisConfig.dll .... [Build 190827, API 160828]
000000.000: Module AtmConfig.dll ......... [Build 160828, API 160828]
000000.000: Module DGConfigurator.dll .... [Build 160828, API 160828]
000000.000: Module ProjectApolloConfigurator.dll [Build 161227, API 100830]
000000.000: Module ScnEditor.dll ......... [Build 160828, API 160828]
000000.000: ---------------------------------------------------------------
BaseDir : D:\Orbiter2016\
ConfigDir : D:\Orbiter2016\Config\
MeshDir : D:\Orbiter2016\Meshes\
TextureDir : D:\Orbiter2016\Textures\
HightexDir : D:\Orbiter2016\Textures2\
ScenarioDir: D:\Orbiter2016\Scenarios\
000000.000: ---------------------------------------------------------------
D3D9 DLLs : C:\WINDOWS\SYSTEM32\d3d9.dll [v 10.0.19041.928]
: C:\WINDOWS\SYSTEM32\d3dx9_43.dll [v 9.29.952.3111]
000000.000: ---------------------------------------------------------------
000000.000: Module D3D9Client.dll ........ [Build 200907, API 160828]
000000.000: Module ParkingBrakeMFD.dll ... [Build 210307, API 160828]
000000.000: Module CamControl.dll ........ [Build ******, API 050206]
000000.000: Module CameraMFD.dll ......... [Build 201023, API 160828]
000000.000: Module ScnEditorTLE.dll ...... [Build ******, API 060425]
000000.000: Module GPCMFD.dll ............ [Build 111222, API 100830]
000000.000: ---------------------------------------------------------------
000000.000: >>> WARNING: Obsolete API function used: oapiRegisterMFDMode
000000.000: At least one active module is accessing an obsolete interface function.
000000.000: Addons which rely on obsolete functions may not be compatible with
000000.000: future versions of Orbiter.
000000.000: ---------------------------------------------------------------
000000.000:
000000.000: **** Creating simulation session
000000.000: D3D9: [DirectX 9 Initialized]
D3D9: 3D-Adapter.............. : NVIDIA GeForce GTX 1660 Ti
D3D9: MaxTextureWidth......... : 16384
D3D9: MaxTextureHeight........ : 16384
D3D9: MaxTextureRepeat........ : 8192
D3D9: VolTexAddressCaps....... : 0x3F
D3D9: NumSimultaneousRTs...... : 4
D3D9: VertexDeclCaps.......... : 0x30F
D3D9: MiscCaps................ : 0x2FCEF2
D3D9: XNA Math Support........ : Yes
D3D9: Vertex Texture.......... : Yes
D3D9: Separate AlphaBlend..... : Yes
D3D9: Shadow Mapping.......... : Yes
D3D9: D3DFMT_A16B16G16R16F.... : Yes
D3D9: D3DFMT_A32B32G32R32F.... : Yes
D3D9: D3DFMT_D32F_LOCKABLE.... : Yes
D3D9: D3DFMT_A2R10G10B10...... : Yes
D3D9: D3DFMT_L8............... : Yes
D3D9: D3DDTCAPS_DEC3N......... : No
D3D9: D3DDTCAPS_FLOAT16_2..... : Yes
D3D9: D3DDTCAPS_FLOAT16_4..... : Yes
D3D9: Runs under WINE......... : No
D3D9: D3D9Build Date.......... : 200906
D3D9: Available Texture Memory : 4073 MB
000000.000: D3D9: [3DDevice Initialized]
000000.000: D3D9: [Loading Constellations]
000000.000: D3D9: [D3D9Client Initialized]
000000.000: Module Sun.dll ............... [Build 160828, API 160828]
VSOP87(E) Sun: Precision 1e-006, Terms 554/6634
000000.000: Module Mercury.dll ........... [Build 160828, API 160828]
VSOP87(B) Mercury: Precision 1e-005, Terms 167/7123
000000.000: Module Venus.dll ............. [Build 160828, API 160828]
000000.000: Module VenusAtm2006.dll ...... [Build 160828, API 160828]
VSOP87(B) Venus: Precision 1e-005, Terms 79/1710
000000.000: Module Earth.dll ............. [Build 160828, API 160828]
000000.000: Module EarthAtmJ71G.dll ...... [Build 160828, API 160828]
VSOP87(B) Earth: Precision 1e-008, Terms 2564/2564
============================ ERROR: ===========================
Parse error from base definition file for Cape Canaveral: Block: TEXn: expected 3 values (*char, scalar, scalar)
[BaseObject::parseError | .\Baseobj.cpp | 184]
===============================================================
============================ ERROR: ===========================
Parse error from base definition file for Cape Canaveral: Block: TEXn: expected 3 values (*char, scalar, scalar)
[BaseObject::parseError | .\Baseobj.cpp | 184]
===============================================================
000000.000: BaseObject: Parse error 2
============================ ERROR: ===========================
Parse error from base definition file for ZZA - Zaragoza: Block: TEXn: expected 3 values (*char, scalar, scalar)
[BaseObject::parseError | .\Baseobj.cpp | 184]
===============================================================
============================ ERROR: ===========================
Parse error from base definition file for ZZA - Zaragoza: Block: TEXn: expected 3 values (*char, scalar, scalar)
[BaseObject::parseError | .\Baseobj.cpp | 184]
===============================================================
000000.000: BaseObject: Parse error 2
000000.000: Module Moon.dll .............. [Build 160828, API 160828]
ELP82: Precision 1e-005, Terms 116/829
000000.000: Module Mars.dll .............. [Build 160828, API 160828]
000000.000: Module MarsAtm2006.dll ....... [Build 160828, API 160828]
VSOP87(B) Mars: Precision 1e-005, Terms 405/6400
000000.000: Module Phobos.dll ............ [Build ******, API 060425]
000000.000: Module Deimos.dll ............ [Build ******, API 060425]
000000.000: Module Galsat.dll ............ [Build 160828, API 160828]
000000.000: Module Jupiter.dll ........... [Build 160828, API 160828]
VSOP87(B) Jupiter: Precision 1e-006, Terms 1624/3625
000000.000: Module Io.dll ................ [Build 160828, API 160828]
000000.000: Module Europa.dll ............ [Build 160828, API 160828]
000000.000: Module Ganymede.dll .......... [Build 160828, API 160828]
000000.000: Module Callisto.dll .......... [Build 160828, API 160828]
000000.000: Module Satsat.dll ............ [Build 160828, API 160828]
000000.000: Module Saturn.dll ............ [Build 160828, API 160828]
VSOP87(B) Saturn: Precision 1e-006, Terms 2904/6365
000000.000: Module Mimas.dll ............. [Build 160828, API 160828]
SATSAT Mimas: Terms 113
000000.000: Module Enceladus.dll ......... [Build 160828, API 160828]
SATSAT Enceladus: Terms 33
000000.000: Module Tethys.dll ............ [Build 160828, API 160828]
SATSAT Tethys: Terms 101
000000.000: Module Dione.dll ............. [Build 160828, API 160828]
SATSAT Dione: Terms 59
000000.000: Module Rhea.dll .............. [Build 160828, API 160828]
SATSAT Rhea: Terms 68
000000.000: Module Titan.dll ............. [Build 160828, API 160828]
SATSAT Titan: Terms 100
000000.000: Module Iapetus.dll ........... [Build 160828, API 160828]
SATSAT Iapetus: Terms 605
000000.000: Module Uranus.dll ............ [Build 160828, API 160828]
VSOP87(B) Uranus: Precision 1e-006, Terms 1827/5269
000000.000: Module Miranda.dll ........... [Build ******, API 060425]
000000.000: Module Ariel.dll ............. [Build ******, API 060425]
000000.000: Module Umbriel.dll ........... [Build ******, API 060425]
000000.000: Module Titania.dll ........... [Build ******, API 060425]
000000.000: Module Oberon.dll ............ [Build ******, API 060425]
000000.000: Module Neptune.dll ........... [Build 160828, API 160828]
VSOP87(B) Neptune: Precision 1e-006, Terms 391/2024
000000.000: Finished initialising world
000000.000: Module DeltaGlider.dll ....... [Build 160828, API 160828]
000000.000: Module LuaInline.dll ......... [Build 160828, API 160828]
000000.000: Module ShuttleA.dll .......... [Build 160828, API 160828]
000000.000: Module VesselBuilder1.dll .... [Build 190415, API 160828]
000000.000: Finished initialising status
000000.000: Finished initialising camera
000000.000: Finished setting up render state
D3D9: ERROR: Base Object 0x2498AE0 = 'Tranquility Base' not cataloged
D3D9: ERROR: Base Object 0x155F4D30 = 'MoonbaseAlpha1' not cataloged
D3D9: ERROR: Base Object 0x155F57C8 = 'Preary Base' not cataloged
D3D9: ERROR: Base Object 0x16804A70 = 'UCGO Base Europa' not cataloged
000000.000: D3D9: [Scene Initialized]
000000.000: Finished initialising panels

Another weird thing is the vessel axes are shown. I click the box to turn them off.
Here if I pick mesh group2 it is highlighted on ther window but then it CTD
 

Attachments

  • isvventvb1.jpg
    isvventvb1.jpg
    403.3 KB · Views: 19

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
611
Reaction score
449
Points
78
Location
FRANCE
Website
francophone.dansteph.com
Hello

I have an other question question, if anyone can tell me ... :unsure: again one more time ???

in the "meshes" section there is the "visibility" area with 4 options.

I can understand the "external", "virtual cockpit ", and "internal" options correctly.
But I do not understand "External Pass" ... What sort of view does it correspond to? :unsure:

question.jpg
Thanks again for your explanations. :hailprobe:
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
It's for (yet) another rendering option flag:
  • Visibility modifier: render mesh during external pass, even for internal views
found in OrbiterAPI.h
...and another mention at VesselAPI.h :
  • MESHVIS_EXTPASS can't be used on its own, but as a modifier to any of the other visibility modes. If specified, it forces the mesh to be rendered in Orbiter's external render pass, even if it is labelled as internal (e.g. MESHVIS_COCKPIT or MESHVIS_VC). The significance of the external render pass is that it allows the mesh to be obscured by other objects in front of it. However, objects in the external render pass are clipped at a camera distance of 2.5m. Meshes that are rendered during the internal pass always cover all other objects, and have a smaller clipping distance.
  • Use the MESHVIS_EXTPASS modifier for parts of the vessel that are visible from the cockpit, but are not close to the camera and may be obscured by other objects. An example is the Shuttle payload bay, which can be covered by payload objects.

Source(s):

OrbiterAPI.h
C++:
// ===========================================================================
/// \ingroup defines
/// \defgroup meshvis Vessel mesh visibility flags
/// These constants determine the visibility of vessel meshes in specific
/// camera modes.
/// \sa VESSEL::SetMeshVisibilityMode, VESSEL::GetMeshVisibilityMode
//@{ =========================================================================
#define MESHVIS_NEVER          0x00  ///< Mesh is never visible
#define MESHVIS_EXTERNAL       0x01  ///< Mesh is visible in external views
#define MESHVIS_COCKPIT        0x02  ///< Mesh is visible in all internal (cockpit) views
#define MESHVIS_ALWAYS         (MESHVIS_EXTERNAL|MESHVIS_COCKPIT) ///< Mesh is always visible
#define MESHVIS_VC             0x04  ///< Mesh is only visible in virtual cockpit internal views
#define MESHVIS_EXTPASS        0x10  ///< Visibility modifier: render mesh during external pass, even for internal views
//@}

VesselAPI.h
C++:
    /**
     * \brief Set the visibility flags for a vessel mesh.
     * \param idx mesh index (>= 0)
     * \param mode visibility mode flags (see \ref meshvis)
     * \note This method can be used to specify if a mesh is visible
     *   in particular camera modes. Some meshes may only be visible
     *   in external views, while others should only be visible in
     *   cockpit views.
     * \note Turning off the unnecessary rendering of meshes can
     *   improve the performance of the simulator.
     * \note \a mode can be a combination of the \ref meshvis.
     * \note The default mode after adding a mesh is MESHVIS_EXTERNAL.
     * \note MESHVIS_EXTPASS can't be used on its own, but as a modifier to any of the
     *   other visibility modes. If specified, it forces the mesh to be rendered in
     *   Orbiter's external render pass, even if it is labelled as internal (e.g.
     *   MESHVIS_COCKPIT or MESHVIS_VC). The significance of the external render pass
     *   is that it allows the mesh to be obscured by other objects in front of it.
     *   However, objects in the external render pass are clipped at a camera distance
     *   of 2.5m. Meshes that are rendered during the internal pass always cover all
     *   other objects, and have a smaller clipping distance.
     * \note Use the MESHVIS_EXTPASS modifier for parts of the vessel that are visible
     *   from the cockpit, but are not close to the camera and may be obscured by other
     *   objects. An example is the Shuttle payload bay, which can be covered by payload
     *   objects.
     * \sa GetMeshVisibilityMode, meshvis
     */
    void SetMeshVisibilityMode (UINT idx, WORD mode) const;
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
Found a rather annoying bug: The angle/scale/translate parameters get reset to default the moment you leave the editor, preventing animations from working.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Found a rather annoying bug: The angle/scale/translate parameters get reset to default the moment you leave the editor, preventing animations from working.
Does this happen in any case? I have done quite a lot of animations without noticing this, and as far as i know/remember also others have developed modules with animations without this issue.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
Does this happen in any case? I have done quite a lot of animations without noticing this, and as far as i know/remember also others have developed modules with animations without this issue.
Not sure as I have been working with a scratch-built vessel.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Not sure as I have been working with a scratch-built vessel.
Could you please post a couple of screenshots or something that might be able to help me understand what is going on?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
Here's three screenshots. 1, shows as initially loaded state. 2 shows the altered state. 3 shows the state reset to what it was in 1 without me touching anything other than selecting the animation sequence in the editor.
 

Attachments

  • VB_anim_angle_1.jpg
    VB_anim_angle_1.jpg
    56.1 KB · Views: 14
  • VB_anim_angle_2.jpg
    VB_anim_angle_2.jpg
    56.6 KB · Views: 14
  • VB_anim_angle_3.jpg
    VB_anim_angle_3.jpg
    48.7 KB · Views: 14

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Here's three screenshots. 1, shows as initially loaded state. 2 shows the altered state. 3 shows the state reset to what it was in 1 without me touching anything other than selecting the animation sequence in the editor.
Ok i ll try to investigate deeper. Just to be sure: did you press "set" after modifying the angle?
If so: does it get saved to the cfg and it is only a visualization issue (if you close and reopen the editor or the sim you should notice it) or the parameter doesn t get updated at all?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
Ok i ll try to investigate deeper. Just to be sure: did you press "set" after modifying the angle?
If so: does it get saved to the cfg and it is only a visualization issue (if you close and reopen the editor or the sim you should notice it) or the parameter doesn t get updated at all?
Oh yes, multiple times. Testing the animation shows that the animation has not been updated, it still rotates the original amount. And no, the cfg is not updated after I press the SET button.
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,666
Reaction score
100
Points
78
Oh yes, multiple times. Testing the animation shows that the animation has not been updated, it still rotates the original amount.
So you are able to set it the first time, but not to change it once it is loaded from the cfg file. I ll give it a look when morning comes here
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
611
Reaction score
449
Points
78
Location
FRANCE
Website
francophone.dansteph.com
Hello

I didn't quite understand the problem...

On my side, I made many tests and animations (with my Cessna for example there are many many animations) and I never had issues with the definition of angles...

When you quit orbiter (which saves the cfg file) the angle you set doesn't stay, right?
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
611
Reaction score
449
Points
78
Location
FRANCE
Website
francophone.dansteph.com
Hello Fred...

While I'm at it... I just found something.

This is the "event" part to command an action with a key.

I created a reconfiguration (the mesh change to an other one (crash-mesh) if the speed exceeds 140 m/s) but for my tests I created a second command, with a key.
(easier for testing than going over the speed limit
I wanted the command to be "complicated" in order to not to trigger it by mistake.

bug.jpg

so I wanted this command to be J+Shift+Crtl+Alt (all at once)

if I test before closing orbiter, it works fine.

But after closing orbiter, the recording is not done.

Here is what we have:

Alt+Ctrl => Alt only
Alt+Shift => Shift alone
Shift+Ctrl => Shift only

Always after closing orbiter, so the recording is bad : only one option out of the 3 is recorded.

That said, it's not a big deal, I manage to do extraordinary things with your module!!

Thanks again :salute:
 
Top