Feature: Composite folders
(Thankies to Satomi for originally suggesting the feature and for putting up with me telling her that “I’m going to have to kill off composite folders because…” every other version :p… And while we’re on the subject: “I’m likely going to have to remove composites for 2.0 because they don’t play nice with item links” *ducks quickly*)
A few people keep nudging me to talk about the elusive “composite folders” that are part of RLVa-1.1.0… I’ve actually tried to write this blog post at least half a dozen times already but it always get so terribly convoluted and complicated by the third paragraph that I doubt it would still make sense to many people, so… brace yourself
.
—
If you’re wearing a pair of shoes in SL then they’ll likely consist of at least a shoe base and left/right foot attachments; or possibly left/right lower leg attachments as well; or even left/right upper leg attachments (thigh high boots for instance).
Similarly a dress is usually at least a shirt (and/or jacket), plus pants, plus a prim skirt. Or some extra frills on chest, and sleeves on left/right upper arm, etc.
Regardless of what individual items actually compose it we just refer to it as “shoes” (or “dress”) and that’s more or less the idea behind “composite folders”: grouping multiple inventory items together and treating them as “belong together”.
—
Practical example: a playboy bunny outfit
If you ignore the unusual “.[something]” naming scheme for a moment you’ll notice that I’ve divided the outfit into different parts:
- the leotard: comes on shirt and pants layer, plus the bunnie tail (which goes on pelvis)
- the tights: come on underpants and socks layer
- the shoes: shoes layer plus left/right foot attachments
- my prim nails: gloves layer plus left/right hand attachments
So what’s the big fuss?
Imagine that someone’s feeling playful and suddenly *yoinks* my bunny tail off (@remattach:pelvis=force): normally that would remove only the tail but instead the viewer will actually strip off the tail, the shirt layer and the pants layer because I told it to treat all three items as one whole (by grouping them under a “composite folder”) so if one of them gets removed then all the others should be removed as well.
(Including the tail as part of the leotard was a quirk on my part: if the tail was located where the ears and collar are then it wouldn’t belong to a “composite folder” and wouldn’t result in anything else being taken off)
Similarly if something now executes @remoutfit:shoes=force then that will strip the shoe base *and* the left foot attachment *and* the right foot attachment.
—
Q: what happens when another folder is force-attached and it replaces part – but not all – of a composite?
For instance imagine that the new folder contains stockings instead of tights: normally that would mean that you have to Take Off > Underpants on your own.
However since the tights are marked as a composite as soon as one piece of it is replaced the viewer will take off the rest as well so in this case replacing the socks layer means that the underpants layer will automatically come off as well.
As an another example: if the new folder contains actual gloves on the glove layer then that would cause the left/right hand prim nails to get detached since the gloves replaced their tinting layer.
—
Q: what happens if part of a composite is locked and another part is force-stripped?
A: nothing, the strip command fails
When a pair of shoes is marked as a “composite” for instance then a @remoutfit:shoes=n to lock the shoe base will automatically extend to the left/right foot attachment as well.
(Note that it doesn’t prevent *you* from still right-clicking and detaching them, all the “composite logic” applies to *scripts* only)
—
Q: what happens if a composite is force attached and parts of it specify layers or attachments that are currently locked?
That might not make much sense so consider the previous example of having the shoe base locked as part of @remoutfit=n but not having the left/right foot attachment locked.
Now imagine that someone is trying to force-attach a pair of boots on you: the previous paragraph tells you that since the shoe base is locked the left/right foot attachment are considered to be “locked” as well so that leaves only the left/right lower leg attachments.
Which as you might have guessed will not attach at all because if even one item of a composite can not be attached then none of it will get attached (or in other words composites are always an “all or nothing” deal).
—
Some closing comments:
Naming - in the example I used “.[something]” for the simple reason that I always want my shared outfit folders to be attachable through a simple @attach:<path>=force (do note that regular RLV will treat this kind of composite folder as a regular hidden folder so if you switch then you want to stay away from this one).
If you prefer you can just use “[Something]” as well in which case it would take an @attachall:<path>=force to attach the entire outfit (and of course the folder would be visible to @getinv).
I also realize this isn’t the best naming scheming in the world and will likely conflict with the way some people have already set their folders up and this will likely change at some point soon (ie the next version).
Additionally keep in mind that only shared folders (any folder somewhere under #RLV) can be composite folders. Every folder anywhere else in your inventory that happens to be named “[Something]” will just be a normal, plain folder.
Bugs – I have to honest and point out that I didn’t really bother testing composites all that much after implementing them since I wanted to spend more time making sure that they didn’t break “normal” force wearing.
That said the very few people (three in all I think) who knew what they were about and have used them to some extent haven’t reported any bugs so they should be fine to play with. Just don’t do any crazy things like nesting composites inside of another composite
.
Enabling - once turned on *any* folder under #RLV that’s named “[blah]” or “.[abc]” will be treated as a composite folder so please make sure you never named any folders like that or they’ll suddenly start acting peculiar
.
If the above didn’t scare you off then you just flip RLVaEnableCompositeFolders from the default FALSE to TRUE under “Advanced / Debug Settings” and you’re all set (applies to RLVa-1.1.0).
—
*breathes* I actually made it all the way to the end!
