2016-04-25

A little adventure in live-editing a mesh body glitch layer

The other weekend the Raven Park dance was prison-themed. It was decided that I should go as Toni and that it would be fun to find a Toni-appropriate prison uniform. That, of course, meant something fairly revealing because.... why the hell else would you buy a Maitreya Lara mesh body? ;)

Sadly though, after a lot of searching, including looking for a specific size of gacha item at various gacha resale markets, nothing could be found. So Mistress decided to custom-make a uniform for me. We ended up with a full-perm mesh template that said it was Maitreya compatible and Mistress made just the perfect texture for it. The final result looked like this:


The problem with it, however, was that it didn't really fit that well. Despite saying it was Maitreya compatible my body was clipping out of it all over the place; with all possible alpha cuts turned alpha it still wasn't right and no amount of shape-changing really solved the problem. We were still seeing the problem even with the "standard" Maitreya shapes. It was going to be no good for dancing.

So Mistress then suggested that she make a glitch applier for it. Normally if an item of mesh clothing doesn't fit I'll bin the demo and not bother; with this however it was a case of wanting to make the right look for a two hour dance so a compromise using a glitch layer made sense.

The plan seemed sound, but how could Mistress get it made without too much faff? To start with I quickly made an applier version (using the dev kit that Maitreya provide in their main store) of the famous "Robin (Sojourner) Wood UV Suit" and put that on so Mistress stood a chance of working out where to place textures.


That was a start, but it was still going to mean a bit of faff uploading textures and trying them out. What she really needed was to be able to live-edit the texture; but to make that happen she'd need to be able to use a local texture as an applied texture on the mesh body and there's no direct way to do that.

I did realise, however, that there was an indirect way.

So, first thing I did for her was write this simple script and pass it to her:

She then dropped that in a cube she rezzed in-world and then textured the cube with a local texture version of the glitch layer. After that she touched the cube and it gave her the UUID of the local texture.

So far so good.

Next I got her to rez another cube and drop the "Maitreya Applier Script - V2 0.10" script from the Maitreya dev kit inside it. This was now the applier prim.

Now for the final step. I had Mistress make a copy of the "Maitreya Texture Loader - Body Overlay V2" notecard and edit it to apply the UUID of the local texture to the top of the mesh body:

All she had to do then was drop the notecard inside the applier prim, let it read it, touch it, apply the texture to the relevant layer and.... done! At that point she had the local texture applied to her body and any change she made was reflected almost instantly on her Maitreya Lara body.

A bit of image editing later and Mistress had the glitch layer sorted; she passed me the texture, I made an applier for it and I was sorted:


At this point I could wear the dress and not worry (too much) about bits of my body clipping through because they were the same colour.

It is, of course, kind of amusing that we had to make glitch pants of old for a nice new mesh body and mesh dress, but it got the outfit sorted and worked a treat. Mistress had fun making a thing and I had fun cobbling together a method that let her live-edit an applier layer.

While nothing I came up with is especially clever or new -- I'm sure others have figured this out before -- I thought it might be handy writing it up here in case anyone else went looking for a way to do this.

No comments:

Post a Comment