Jump to content

Scripting sculpted hands.....?


JackRipper666
 Share

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

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

Recommended Posts

Hello, I have an idea to script a hand where it appears as if it's animating. My idea is making two states of a hand turn off an on like a light switch using textures.

So the way it would work is state one is at first visable then when the script runs say after first 10 seconds of being worn it will play through. The code would start out hiding state 1 mesh hand for 1-2 seconds then quickly show state two some how like alpha channeling out the first state to pull this off. Second state would then be visable coming out of a alpha channel/transparent texture state to now be the visble state. Both these states would be linked together and mesh pieces both really there but only one visable at a time thanks to the script. I just want it to be like an illusion again as if it's animating. Just moving quickly enough going forward messing with the textures on visiable off alpha jumping to state two on then off and backwards to the original state. So again two mesh hands I am thinking one scuplted hand that is simply adjusted to a different position to pull off the animation illusion. 

 

Sorry to ramble hard to make myself clear lol. Anyway I'm not sure how hard that is if someone could point me in the right trach I suppose to getting control over textures using mesh sculpts with code? If that makes sense lol. Anyway thanks for reading I appreciate it!

Link to comment
Share on other sites

You could do it by switching sculpt maps, but I'd advise against using that method in this case, for a couple of reasons.

The first is that sculpties take time to rez.   There's certainly ways to mitigate it, but no matter what I've tried I can never be completely sure, when I'm using this method, that sculpties won't spend a few seconds as balls before gaining their correct shape, and -- for reasons I don't really understand -- they tend to revert to being balls for a moment or two later on, even though you'd have thought they wouldn't after they'd been loaded for the first time in the viewer.

The second is that LL don't really like people doing this, since repeatedly switching sculptmaps places quite a strain on the sim.   That doesn't mean I avoid doing it completely, but it certainly means I think twice before using this particular method.

In an instance like this, where LI isn't going to be such an issue (because you're wearing the items) I just don't see any real advantage to switching sculptmaps rather than switching the alpha, and I see several disadvantages (not least that it's more complicated, and I always try to look for the simple way when I can),

If you really wanted -- and this isn't the simple way, but i'd use it in preference to changing the sculptmaps, partly  because it would look far better -- you could, if your object is suitably constructed, record the various prim positions and rotations using llSetLinkPPFast.     But I'm not sure, in practice, it would work so much better than changing the alpha, whether with llSetLinkPPFast or llSetLinkApha, that it would be worth it.

There's a helpful discussion of the pros and cons of the various methods in a new wiki article, https://wiki.secondlife.com/wiki/Animation_Streamlined

Link to comment
Share on other sites

Sometimes this says "sculpt" and sometimes "mesh".  If this is planned to be a commercial product, you probably want to use rigged mesh. The built-in hand gestures aren't actually skeletal, so the rigging doesn't make those happen, but it seems the objective is to script around those gestures anyway.

One could use separate meshes for the different hand positions, and then just do alpha cycling on the meshes, as described for the linked sculpties, or (cleaner, I think) one could have a single mesh with different materials for the different hand positions, and alpha-cycle the "sides" that correspond to the materials.

(Oh, I forgot to mention the first time I hit "Post"... just to be sure: There are built-in hand gestures. If you upload a high priority looped .bvh that locks nothing but the wrists, and specify one of those built-ins, then script to activate that animation, you should be able to get it to play, regardless of any other animations playing on the avatar. That would be for system "human" avatar hands only, of course, so may not be relevant to whatever the objective is here.)

Link to comment
Share on other sites

Hey thanks guys! What I meant to be more clear since yea I sometimes forget when I say sculpt I sound like I am saying sculpty lol. Anyway though I meant to say If I sculpted some different states of hands with mesh, example one open and one closed. I am looking to do just that Qie maybe alpha channel out the mesh pieces or texture as it plays through giving off that illusion it's using an animation. One state only being visible at a time though but if you were to right click it you'd see there are two pieces linked together. So I suppose alphaing out the mesh would be the right idea. Cause I'd want the texture to show along with the mesh object when it gets turned on from the script.  

 

But if I am trying to do that what would be some of the ll fucntions to look into? An I guess how hard would this be? I'm still one who kinda looks at code and pieces together my idea's modifying it to do different functions lol. I can understand it if use it in world watch what it visuallly does and pick it apart tha way. I am kinda thinking on the lines of non human hands right now. Just all linked together the different states, example say 5 states to make it look as if it's animated. I think that will do using gradual changes. An I am assuming I would attach the parent/primary state to the wrist on a mesh avatar. But I think last time I tried that I knew I would have to tell it with code as it moves where these other states are suppose to be. Hard for me to explain lol. I think I might be able to get away with not having to do that though using the alpha channel idea if they are just attached in one spot when worn.

 

I'll review the comments more and also look into llSetLinkAlpha innula mentioned. I think that might be how to start it out. Thanks again!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4296 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...