MSS: Modular Snap System Plugin

Hi Wallenstein,

Yes, there is a problem with that if you have “snap open only” enabled. The plugin considers that the socket is closed because it’s overlapped by the volume. It feels weird because the volume is invisible, but the plugin only sees collisions, so there is no difference. The runtime version (mssr) uses different logic, so there is no such problem. I did not figured yet how to fix it properly, i need to look into it. Your workaround is pretty clever, I didn’t think of that.

I probably should add a specific option to exclude collision volumes so that will fix the problem.

The reason why I didn’t want to simply remove collision volumes from consideration is that there are legitimate uses for them. Imagine for example you have a huge spline road made of many spline meshes. Enabling collision on those will make the editing very slow, so what I did instead is to add little collision primitives around the sockets and the plugin manages to find the spline from there.

OK, maybe you should add tags to volumes to be used or whatnot. One easy way to avoid confusion is to put a bold remark in the popup help for the “Open Socket Only” checkbox that explains this problem in more detail. I didn’t think of unchecking that because it’s checked by default and I thought there’s a reason for that. That way people would immediately see a workaround. It was frustrating because the same socket would snap to some sockets but not to others and I didn’t know what is the reason.
Right now I am making another snapping object where the socket is inside a wall and caused the same problems. So this option there is definitely something that should be made clear, how it works and why, and perhaps you can find a way around this

I have another idea for an update: I build up BPs from several meshes to drop in the scene, for instance a room made up of several walls etc. I have a special mesh that is an arrow with a socket that is supposed to mark the exits for the room to snap to other rooms. This works most of the time but sometimes the system snaps other sockets from meshes in the BPs together which I don’t want. it would be good if there was a way to disable sockets in a BP by name or at least have an edit field in the options where you can enter the prefix of the only sockets you want to snape

Hi Wallenstein,

I would like to better understand your issue. Can you show me an example of your setup, when it works and when it doesn’t? With socket names etc.

  1. Make a mesh A and a Mesh B with a snap point each
  2. Create a Blueprint X. Add Mesh A and Mesh be . Make it so that A extends on one side. Bascially the purpose of this BP is to make the A meshes snap to each other. However the B meshes are part of the visual as well and at some point we might want to place B in a scene alone and therefore we need it also to have a snap point
  3. Create a BP Y with the same setup but this time scale mesh B to 0.5
  4. Now place Y in a level
  5. Then place X and make it snap. Depending on where you release the mouse it might snap correctly the way we want A to A, but it might also snap to Bi Y at which point not only the position is wrong but the second BP will be scaled to 0.5 in it’s entirety.

Again we need snap points in all meshes because we might want to place the meshes in the level by themselves so having B without a snap point is not an option
​​​​​​​

Thank you, I see the problem. I will think about.
For the scale, could you just disable scale snap in parameters?

@Wallenstein I think maybe component tags can be used to solve this problem. There could be some tag, like “no_snap” for example, which will disable the snap for the component. The plugin could check those tags and, if the tag is here, ignore the component and all its sockets.

So in your case, your BPs X and Y will have static mesh component B with the component tag “no_snap”, therefore the plugin will ignore it. But if you use B alone, like a static mesh actor, or inside another BP, without tags, then it will snap.

Would that work for you? At first sight that should be easy to implement I think.

@Wallenstein

I made a prototype, take a look:

It works with component tags, so you can choose which component is snappable and which is not. You can even add/remove those dynamically, like in construction script. What do you think.

I would like also to solve the other problem with collisions in some cool way but I don’t know yet how. If you have some idea let me know.

@Wallenstein

I looked into the blocking volumes etc. problem a little bit more, and I think it can be solved same way as in the MSSR. Namely, the “check open only” option will only consider components which are in the “target component” list in the plugin settings. So, if you only have “static mesh component” in this list, it means only a static mesh can block a socket from snapping. Therefore, the plugin will ignore stuff like blocking volumes and such.

And if you need some kind of collision component to act as a socket blocker, then you just add it to the “target components” list. In the video below I use a sphere collision component placed around spline endpoints.

Maybe you should add a written documentation. Videos are great but they always cost time to watch and when you are looking for one specific tip how to do things you can’t scroll through them because you don’t know what you’re scrolling over and have to watch them all again.

I will write a documentation about this. Those videos are just to show an example how it will work.
Anyway, I submitted an update and it seems it’s already published so you can test it.

For the “nosnap” feature, you just need to edit your blueprints X and Y and add a component tag “nosnap” to B.
The problem with blocking volumes should go away too.

Let me know if it works.

I realized that the documentation was pretty outdated, so I rewrote it, now we should be up to date. Check here: Modular Snap System Documentation – Inu Games (also linked in the top post)

Thanks, that’s helpful. Reading is simply faster than watching a whole video.

Submitted new version 1.4.5 with a new feature: socket bulk export/import tool. Should be published soon. Is published.

The tool can be used to export/import sockets for many meshes at once. For example, if you made sockets for some third party asset pack you can share them with other people without sharing the meshes. Also useful for backup. The export file is a simple text file with pretty straightforward format, see below. This way the socket definition can be easily shared, even simply pasted into a web page or a forum.

Anyway, if you feel like sharing, you can export some and post them here :slight_smile:

There is a video of importing sockets for a whole asset pack :

The free pack from the video can be found here here and you find the socket file attached below.

Documentationis updated too:

The export/import tool allows to export and import socket definitions from multiple Static Meshes to a text file. To use the tool select some Static Meshes in the Content Browser, then right click and choose “Snap System” sub-menu in the Asset Actions section. You can select meshes from many folders by using Content Browser filters.

**Export **option will write sockets from the selected assets to a text file. **Import **will read the text file then add or modify sockets in the selected assets which match the entries of the file. **Delete **will remove all sockets from selected assets.

The export file is a simple text file that can be edited with a text editor or pasted in a web page. The file is composed of asset names followed by one or more socket definitions. Example:


StaticMesh /Game/Meshes/SomeMesh
S SomeSocket 0.0,-25.0,0.0|0.0,-90.0,0.0|1.0,1.0,1.0
S OtherSocket 0.0,25.0,0.0|0.0, 90.0,0.0|1.0,1.0,1.0


The import tool can manage the case when the assets were moved to another folder. In this case it will try to find an asset with the same name and the most similar path, then ask the user for confirmation.

Hey I’m willing to share my settings here, There’s one thing you might want to consider though. I changed the pivot in some meshes to be more in the mesh’es center when they were off. I know it must be relatively simple to do that somehow. I used the pivot tool from the marketplace to do that. Maybe you can build in a function to read out the pivot and also set it automatically from these files.

Here is my first socket pack. It is for this pack: https://unrealengine.com/marketplace…ctorian-street
I have altered the pivot point of the street tunnels so you may have to redo the sockets for those models yourself but it’s only 3 meshes.
Many wall meshes come without collision so don’t forget to set up collision or snapping won’t work

Here’s another socket pack for Luo’s caves (Luos's Modular Rocks & Caves in Environments - UE Marketplace) but I only added sockets for the caves not the decorative stones etc which are mostly placed free-handed anyway, but with this you can edit a huge cave system in no time

2 Likes

@Wallenstein That’s awesome, thank you!

I wish I could test it, but I don’t have any of those packs. I tried with luos caves free demo, but the meshes are not the same it seems.

For the pivot, I will try to understand how it works. I suppose the sockets will not transfer correctly from a mesh with changed pivot to the original mesh? Can you test it?

I have the impression that UE doesn’t store a pivot and the plugin modifies the mesh itself by moving the vertices and the sockets.

Btw, there is no need to zip the files, they are already small and the forum accepts txt files too.

I tested it, the altered pivot point makes a difference and the sockets have an offset. There aren’t many cases where one changes the pivot, so it’s up to you, I suppose it must be easy when you work in C++ somehow. but I wouldn’t spend a lot of time on it

I thought too that there is some variable called “pivot” or something, but I checked the Static Mesh C++ class yesterday, I couldn’t find anything looking like a pivot. There is a pivot offset variable in the actor but not in the static mesh. I think the pivot plugin will just move every vertex and every socket. That’s why they said the new pivot will be “baked”. Btw, you assume you used this plugin? Probably I can ask the author if there is some way to know where the original pivot was.

Is there something like undo or reset pivot in the plugin, so you can restore it back and then export the socket?

edit: btw, just got an idea! You can copy sockets from the modified mesh to the original one using MSS! You just need to have two meshes in the editor perfectly aligned then copy-paste sockets in world space!