General Question Hiding a certain mesh group within a mesh

jalexb88

Active member
Joined
Aug 11, 2008
Messages
125
Reaction score
72
Points
28
Location
Canada
Hey guys, quick question about mesh groups:
In NASSP we load the contact probes as a separate mesh that we delete at lunar contact. We are now working with a new lunar module mesh and would like to include the contact probes as part of the descent stage mesh itself (not a separate mesh) and what Id like to figure out is how to hide the mesh group of the probes at contact, a bit like what SetMeshVisibilityMode does, but instead of hiding the whole mesh, just the mesh group within it (contact probes). Is such a thing possible?

Thanks in advance!
 
Last edited:

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
4,560
Reaction score
784
Points
138
You can hide groups in a mesh with oapiEditMeshGroup().
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,646
Reaction score
55
Points
63
What GLS proposed is surely the best way. A quick and dirty thing could also be to animate the group with a scale animation and scale them to 0 when needed calling setanimation. As said this is a quick and dirty thing
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
4,560
Reaction score
784
Points
138
BTW: be sure to hide the shadow of the group as well, which is done putting the flag at 3.
 

jalexb88

Active member
Joined
Aug 11, 2008
Messages
125
Reaction score
72
Points
28
Location
Canada
Thanks for the help guys! The Delta Glider source code has excellent examples for the use of oapiEditMeshGroup(), so I was able to use that to help implement it in NASSP. Works great!
 

jalexb88

Active member
Joined
Aug 11, 2008
Messages
125
Reaction score
72
Points
28
Location
Canada
I thought the contact probes did rarely penetrate the soil, but rather break and rotate sideways...

https://images.nasa.gov/details-as11-40-5917.html

Yeah, ideally I guess we would animate the probes at contact so they bend sideways...one issue with this is it would be hard to make it look right I think, as the rate at which they bend would depend on the descent rate and what about the case where you only touch one footpad at a time? Or if one decides to liftoff again after touchdown? Of course I'm sure these would be possible with the right coding but I think the simpler method of just hiding the probes is a good one for now.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,789
Reaction score
1,009
Points
203
Location
Dallas, TX
Tiring to use that edit mesh group. but nothing happens. This is in the load state
GROUPEDITSPEC ges; //GROUPEDITSPEC grpSpec; //grpSpec.flags = GRPEDIT_SETUSERFLAG; //grpSpec.UsrFlag = 0x00000003;; // hide group and shadow ges.flags = GRPEDIT_SETUSERFLAG; ges.UsrFlag = 1; oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY11_LONGERON, &ges); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY12_LONGERON, &ges); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY13_LONGERON, &ges);

hOrbiterbridgerails = oapiLoadMeshGlobal("2016SPACESHUTTLE\\shuttlebridgerails"); mesh_bridgerail = AddMesh(hOrbiterbridgerails);//mesh 13 SetMeshVisibilityMode(mesh_bridgerail, MESHVIS_EXTERNAL | MESHVIS_VC | MESHVIS_EXTPASS);
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,789
Reaction score
1,009
Points
203
Location
Dallas, TX
Not sure why this isn't working.
GROUPEDITSPEC grpSpec; //GROUPEDITSPEC ges; //GROUPEDITSPEC grpSpec; //grpSpec.flags = GRPEDIT_SETUSERFLAG; //grpSpec.UsrFlag = 0x00000003;; // hide group and shadow //ges.flags = GRPEDIT_SETUSERFLAG; //ges.UsrFlag = 0x00000002; grpSpec.flags = GRPEDIT_SETUSERFLAG; grpSpec.UsrFlag = 0x00000002;; // hide group oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY11_LONGERON, &grpSpec); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY12_LONGERON, &grpSpec); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY13_LONGERON, &grpSpec);

The flag for do not use this mesh group is 0x00000002
Vessel 0x00000001 Do not use this group to render ground shadows Vessel 0x00000002 Do not render this group Vessel 0x00000004 Do not apply lighting when rendering this group Vessel 0x00000008 Texture blending directive: additive with background
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,789
Reaction score
1,009
Points
203
Location
Dallas, TX
Now a ctd.

hDevOrbiterMesh = GetDevMesh(vis, 0); //bridgerailmesh = GetDevMesh(vis, 12); GROUPEDITSPEC grpSpec; //GROUPEDITSPEC ges; //GROUPEDITSPEC grpSpec; //grpSpec.flags = GRPEDIT_SETUSERFLAG; //grpSpec.UsrFlag = 0x00000003;; // hide group and shadow //ges.flags = GRPEDIT_SETUSERFLAG; //ges.UsrFlag = 0x00000002; grpSpec.flags = GRPEDIT_SETUSERFLAG; grpSpec.UsrFlag = 0x00000002;; // hide group and shadow oapiEditMeshGroup(hDevOrbiterMesh, GRP_BAY11_LONGERON, &grpSpec);
 
Top