Jump to content

Is there a script that allows the rigged mesh clothing to swap between states on its own?


MatKerekes
 Share

You are about to reply to a thread that has been inactive for 71 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have made a piece of clothing with multiple models representing different states, all rigged into one piece of clothing, essentially it would be getting dirtier and more worn, and I want it to change from state 1 to 2 to 3 to 4 on its own, and stay in each state for a specific amount of time, then stay in state 4 until the avatar does something to clean it up and then it can switch back to state 1 (the clean state). is it possible to do that with a script? I have tried the mesh object switcher and the alpha sequencer script on mp and they did not do what i wanted at all. I want something that can control the alpha of the objects within the linkset since i have all the states rigged together as one piece of clothing, and it can show only one or two objects in the linkset at a time.

Link to comment
Share on other sites

It's certainly possible. Whether there's an off-the-shelf script that does exactly what you want may be hard to discover. (I, at least, have no idea, and don't know the scripts you mention which I gather are common scripts for doing something related.)

There are shirts and pants scripted to change which parts are visible based on touch or HUD control, so maybe they're using a relevant script you could discover by inspecting demos. Passage of time, hmm… probably that, too, like wet clothes that dry off or something.

If you were to ask someone to make this script for you (perhaps on the Inworld Employment forum) it may help to have a little more specificity on a few points.

  • The surfaces involved are separate links in the linkset? Or separate faces of one or more links?
  • These are discrete states, right? i.e., the surfaces are either visible or invisible, not transitioning through a continuous range of alpha levels?
  • The textures are old-school "Blinn-Phong" materials, right, not PBR? (This one is kind of a big deal right now because we expect script control of PBR transparency to get a lot simpler soon-ish.)
  • The state transitions trigger based on just the passage of time, right, until it gets to the final state? and then what should the wearing avatar do to restart the sequence? touch? (Ease of touch for the user can depend on attachment point and model geometry) a HUD? a chat command? And it's always only the wearer who can trigger the restart, right?
  • What should happen when the item is attached from inventory, as when an outfit is worn or the user logs in? just continue where it left off, or reset to the first (or last) state?

It's all possible regardless of those specifics, it's just a scripter would need to know. Also, this isn't a complex script in any case, but it could be really simple if the states were modeled either as the faces of a single link or all faces of a set of links; it's just ickier to have State One be several faces on several links, and State Two be several different faces on different links, etc.

  • Like 2
Link to comment
Share on other sites

3 hours ago, Qie Niangao said:

It's certainly possible. Whether there's an off-the-shelf script that does exactly what you want may be hard to discover. (I, at least, have no idea, and don't know the scripts you mention which I gather are common scripts for doing something related.)

There are shirts and pants scripted to change which parts are visible based on touch or HUD control, so maybe they're using a relevant script you could discover by inspecting demos. Passage of time, hmm… probably that, too, like wet clothes that dry off or something.

If you were to ask someone to make this script for you (perhaps on the Inworld Employment forum) it may help to have a little more specificity on a few points.

  • The surfaces involved are separate links in the linkset? Or separate faces of one or more links?
  • These are discrete states, right? i.e., the surfaces are either visible or invisible, not transitioning through a continuous range of alpha levels?
  • The textures are old-school "Blinn-Phong" materials, right, not PBR? (This one is kind of a big deal right now because we expect script control of PBR transparency to get a lot simpler soon-ish.)
  • The state transitions trigger based on just the passage of time, right, until it gets to the final state? and then what should the wearing avatar do to restart the sequence? touch? (Ease of touch for the user can depend on attachment point and model geometry) a HUD? a chat command? And it's always only the wearer who can trigger the restart, right?
  • What should happen when the item is attached from inventory, as when an outfit is worn or the user logs in? just continue where it left off, or reset to the first (or last) state?

It's all possible regardless of those specifics, it's just a scripter would need to know. Also, this isn't a complex script in any case, but it could be really simple if the states were modeled either as the faces of a single link or all faces of a set of links; it's just ickier to have State One be several faces on several links, and State Two be several different faces on different links, etc.

the surfaces are separate links in the linkset, essentially two mesh objects; they are discrete states, no transitioning needed; yes they are old-school texture materials; yes, only based on the passage of time, and it stays in the final state until an action is taken, i was thinking about incorporating a menu system so you can click on it and a menu would pop up showing options of what to do next, i was thinking maybe incorporating rlv as well so others can do it too but that might be complicated; i would love if it can continue from where it left off, as that would be more realistic.

I have made a hud to do all of that at the moment, but ultimately that is not what I am hoping to achieve. Thanks for your response, and I will look on the Inworld Employment forum to see if I could hire anyone to create this specific script for me :)

Link to comment
Share on other sites

On 3/22/2024 at 12:51 AM, MatKerekes said:

I have made a piece of clothing with multiple models representing different states, all rigged into one piece of clothing, essentially it would be getting dirtier and more worn, and I want it to change from state 1 to 2 to 3 to 4 on its own, and stay in each state for a specific amount of time, then stay in state 4 until the avatar does something to clean it up and then it can switch back to state 1 (the clean state). is it possible to do that with a script? I have tried the mesh object switcher and the alpha sequencer script on mp and they did not do what i wanted at all. I want something that can control the alpha of the objects within the linkset since i have all the states rigged together as one piece of clothing, and it can show only one or two objects in the linkset at a time.

We used to do this on sculpties with llSetPrimitiveParams.  It was like this:

llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "uuid", PRIM_TYPE_SCULPT_SPHERE]);

"uuid" was the name of the sculpt map you want to change it to, and you can change PRIM_TYPE_SCULPT_SPHERE to PLANE or CYLANDER, or TORUS.  You can use this to animate sculpties.

I don't see a similar function for mesh, though.  That's really weird.  I always assumed something like this would be there, but I hever had occasion to change a mesh model with a script like that, since mesh can animate.

There must be a way to do it!  I've seen it done!

If you look at PrimPossible's products, they are all mesh, and they change shape, based on a menu.  They do it with their 1 Prim Unlimited Decor product, for example, but a lot of their products change shape like this (off the top of my head, see:  their bed, and kitchen, and mesh genie).  I know from an interview I read a few years back with the owner of PrimPossible, that it basically works like this:  You click the thing, it gives you a menu, you select the options to change, say... a hat rack into a book shelf.  The script asks some kind of web server for the book shelf shape and texture, and loads that onto the object, which morphs into a book shelf when it's done loading.  At least, that's how I remember the inverview going.  It's been a few years.  Maybe it is rezzing a new object with a new shape, then deleting itself?  I'll say that's probably not the case, because when you change object shape, sometimes if you are lagging, the new shape doesn't load, so you end up with an invisible object, with no shape, waiting for the shape to load.

Looking around the LSL wiki, though, and I"m completely stumped.  I don't see any functions to do this, or anything in the library for it.

Qie is probably right.  You probably can't do it.

If you can, use sculpties, instead of mesh, and animate them like I described above.

Link to comment
Share on other sites

On 3/26/2024 at 3:02 AM, Bubblesort Triskaidekaphobia said:

I don't see a similar function for mesh, though.  That's really weird.  I always assumed something like this would be there, but I hever had occasion to change a mesh model with a script like that, since mesh can animate.

There must be a way to do it!  I've seen it done!

To the best of my knowledge, no, there isn't one.

Swapping sculpties with a script is simply a matter of replacing the texture map in the sculptie with another, and that's just like changing the texture on it's surface, by image UUID.

 

Swapping meshes basically means de--linking & de-rezzing a link, and rezzing & linking another link, and doing so by UUID.

Scripts cannot create objects by UUID.

 

What you've "seen" is almost certainly "alpha blitting", where you have several DIFFERENT linked meshes, and you make the currently visible obne invisible, and make an invisible alternative visible by llSetPrimPaamsFast.

 

On 3/26/2024 at 3:02 AM, Bubblesort Triskaidekaphobia said:

They do it with their 1 Prim Unlimited Decor product

That's basically rezzing and de-rezzing items from the objects inventory, no script can rez an object by UUID.

 

On 3/26/2024 at 3:02 AM, Bubblesort Triskaidekaphobia said:

If you can, use sculpties, instead of mesh, and animate them like I described above

The OP originally asked this question in another thread, there, it was made clear this is for FITTED MESH CLOTHING, so no, obsolete sculpty tech is NOT an option.

This idea they have is basically a timed variant of the script for "strippable clothing".

 

 

Link to comment
Share on other sites

Yeah, this is one of SL's older self-inflicted wounds, confusing instance with class: mesh models are not first class assets to be manipulated in the world, where only individual instances of those models survive the upload process. This is unlike every other object primitive that can be morphed into any other by script.

This decision to neuter mesh was intentional, as I understood it, in service of mesh modelers who feared IP infringement (which was a problem with sculpties and prims).

Now it all looks pretty anachronistic. Soon enough human-crafted, artisanal mesh will be quaint, the hand-carded wool or hand-thrown pottery of virtual worlds, but SL will still prevent AI from morphing its mesh content.

  • Like 1
Link to comment
Share on other sites

On 3/26/2024 at 5:02 AM, Bubblesort Triskaidekaphobia said:

If you look at PrimPossible's products, they are all mesh, and they change shape, based on a menu.  They do it with their 1 Prim Unlimited Decor product, for example, but a lot of their products change shape like this (off the top of my head, see:  their bed, and kitchen, and mesh genie).

PrimPossible is an ANCIENT brand that specializes in sculpties, and it's exactly how the "unlimited decor" works. It's been on Marketplace since 2013.

image.png.fdc355c74f5062961f53a6e2042d840e.png

Mesh used to be swappable by UUID too, but that was disabled. The reasons are documented on the wiki: https://wiki.secondlife.com/wiki/Why_UUID_Flipping_is_Bad

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 71 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...