Jump to content

[1.11.x] ModuleDepthMask "Portable Holes for your Parts!"


cineboxandrew
 Share

Recommended Posts

This plugin allows for parts to have hollow insets that dont clip into other parts, ideal for engine nozzles, landing gear, air intakes, solar panel bays, and more. It is a standalone version of the depth mask module included in the Restock dll, along with the addition of depth masks to several stock parts

ModuleDepthMask 1.1.2 requires KSP 1.11 or later. If you are using an older version of KSP, please use version 1.1.1.

Downloads   Source Code

Usage

  1. Add a depth mask mesh to your part model. It should cover up the hollow area you want to prevent clipping in, without sticking out.
  2. Mark the depth mask object with the Icon_Hidden tag to prevent it from showing in the VAB part picker
  3. Add a new ModuleDepthMask to your part config
  4. Add the name of your mask object in the maskTransform property
  5. (Optional) Add the name of the object you want to restrict the mask effect to in the bodyTransform property
An example config:
  MODULE
  {
    name = ModuleDepthMask
    maskTransform = mask
    bodyTransform = interior //Optional
  }
Creating the depth mask model

The depth mask will prevent any other parts from rendering behind it. Because of that, it should not be used on any kind of bay where other parts will be placed, or on any part you can look completely through. It also shouldn’t "bubble" out above the hole you want to cover, otherwise it would be possible to see through it from the side. Also double check your normal direction, since the depth shader only works one way.

Screenshots

mask meshes and configs for stock parts are included in Restock

depthmask-jets.png depthmask-intake.png

depthmask-panels.png depthmask-box.png

Licensing

This plugin is licensed Creative Commons Sharealike Attribution. This means that you can redistribute it and its source code however you like under the same license as long as you include attribution and indicate the changes you made, if any.

Redistribution

You are free to redistribute this plugin in your mods, or embed the code in your own plugins (with a different module name for compatability of course.) To prevent duplicates of the plugin, please add the dll to the root gamedata directory. In general, treat this mod the same as Modulemanager for redistribution

Edited by cineboxandrew
Link to comment
Share on other sites

Fabulous. :) It's what in-wing VTOL fan engines (and the Internal RCS mod) will surely need, and something I will use very quickly once I have the energy to make parts again.

In the spoiler is an example of how NOT to shape your depth mask mesh.

Spoiler

Rkiv9d4.png

R9FRAZU.png

 

Edited by JadeOfMaar
Link to comment
Share on other sites

Nice! What a neat little plugin. Those solar panel casings sitting flush with the craft look fantastic! I hope this gets wide adoption in the modding community, it opens up so many possibilities to enhance craft in an aesthetically pleasing way. 

Link to comment
Share on other sites

YAY FINALY now we just need someone to put this on procedurally sized 'surface attach' cargo bays or even just scalable ones to start with, it could even be balanced by giving every part a total sacrificial volume that would be displaced by clipping things into it i.e. a mk2 fuel tank would have a higher sacrificial volume then a 1.25m fuel tank of the same length.

THANK YOU SO MUCH i have wanted this for so long and now we've finally taken the first step

of course i suppose there would be problems with actually putting seperate parts in the bays, can we get around it with something like the welding mod, or maybe a grouping system or something? 

Edited by caddilacbob
Link to comment
Share on other sites

2 hours ago, caddilacbob said:

YAY FINALY now we just need someone to put this on procedurally sized 'surface attach' cargo bays or even just scalable ones to start with, it could even be balanced by giving every part a total sacrificial volume that would be displaced by clipping things into it i.e. a mk2 fuel tank would have a higher sacrificial volume then a 1.25m fuel tank of the same length.

THANK YOU SO MUCH i have wanted this for so long and now we've finally taken the first step

of course i suppose there would be problems with actually putting seperate parts in the bays, can we get around it with something like the welding mod, or maybe a grouping system or something? 

Yes there are problems. This just makes the surface of intersecting parts invisible. Think of the IVA overlay, because that is exactly the same thing, andrew has just applied to to regular parts. This only really works well for parts that have some internal volume that people can see yet not put things into. Things like solar panel containers and air intakes. It would take a ton more work to do the cargo bay thing, because it would have to essentially remodel the part it is attached to on the fly. (different sized parts and "cargo bays" along with the Offset and Rotate gizmos)

Link to comment
Share on other sites

18 hours ago, DeltaDizzy said:

Yes there are problems. This just makes the surface of intersecting parts invisible. Think of the IVA overlay, because that is exactly the same thing, andrew has just applied to to regular parts. This only really works well for parts that have some internal volume that people can see yet not put things into. Things like solar panel containers and air intakes. It would take a ton more work to do the cargo bay thing, because it would have to essentially remodel the part it is attached to on the fly. (different sized parts and "cargo bays" along with the Offset and Rotate gizmos)

yeah thats excactly my point, conceptually i know how a depth mask works and so i know that one could, conceptually, layer other parts in front of it with their own masked depth. What i dont know is how doable this is in unity, in ksp, in this case. I also know that this is still amazingly useful even if we can only use it for solar panels, and landing gear, and engine bells, and other single parts.  Thats why i suggested something like that welding mod, im not expecting to put probes in what would be essentially a virtual cargo bay, but it could be a nice place for a gravioli detector.

:)

EDIT: 

and i just re-read the original post and noticed the body mask property, so doesn't that make this alot more possible?

 

Edited by caddilacbob
Link to comment
Share on other sites

12 hours ago, caddilacbob said:

yeah thats excactly my point, conceptually i know how a depth mask works and so i know that one could, conceptually, layer other parts in front of it with their own masked depth. What i dont know is how doable this is in unity, in ksp, in this case. I also know that this is still amazingly useful even if we can only use it for solar panels, and landing gear, and engine bells, and other single parts.  Thats why i suggested something like that welding mod, im not expecting to put probes in what would be essentially a virtual cargo bay, but it could be a nice place for a gravioli detector.

:)

EDIT: 

and i just re-read the original post and noticed the body mask property, so doesn't that make this alot more possible?

 

In general, any other parts do not render behind the mask. This makes it not useful for cargo bays. The body property just lets you treat other transforms in your part exactly as you would any other part

Link to comment
Share on other sites

8 hours ago, cineboxandrew said:

In general, any other parts do not render behind the mask. This makes it not useful for cargo bays. The body property just lets you treat other transforms in your part exactly as you would any other part

what about specific parts, could they be tagged to render in front of the mask and behind the exterior of the mesh?

Edited by caddilacbob
Link to comment
Share on other sites

How would this behave if an intake (similar to the second photo) is intentionally set further back on a wing to create an 'upper' and 'lower' intake. Would this create a giant gap in the wing ahead of it? If so, I suppose creating a duplicate "non-masked" version of the part would work for those cases. :D

Link to comment
Share on other sites

16 minutes ago, Beetlecat said:

How would this behave if an intake (similar to the second photo) is intentionally set further back on a wing to create an 'upper' and 'lower' intake. Would this create a giant gap in the wing ahead of it? If so, I suppose creating a duplicate "non-masked" version of the part would work for those cases. :D

It would only clip out the parts of the wing behind the mask. 

Link to comment
Share on other sites

5 hours ago, Beetlecat said:

How would this behave if an intake (similar to the second photo) is intentionally set further back on a wing to create an 'upper' and 'lower' intake. Would this create a giant gap in the wing ahead of it? If so, I suppose creating a duplicate "non-masked" version of the part would work for those cases. :D

Heres a screenshot

:Screen_Shot_2019-06-13_at_11.05.50_PM.pn

Link to comment
Share on other sites

11 hours ago, cineboxandrew said:

Heres a screenshot

Oh, splendid. So the mask would just be as intricate/specific as is defined. The lower intake in this shot could have just the area defined by the edge of the opening as a mask as well, yeah? This is fantastic :)

Link to comment
Share on other sites

  • 2 months later...

Is it at all possible to see a backport to 1.6.1, or does it rely on new features in release 1.7? I'm sure lots of people playing Realism Overhaul would love to use this.

Also, is it within the capabilities of plugins to append the Icon_Hidden tag to the whole part model itself? This way, with the module applied to something like Procedural Parts for example, you can make arbitrary cavities in your ships.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...