Pamela Galli Posted December 13, 2015 Share Posted December 13, 2015 I have this simple texture rotation script, and I do know how to put the face # where the words " All Sides" are. But I would like two faces to have texture rotation. How would I do that? default{state_entry(){llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, (2*TWO_PI)/50.0);}} Link to comment Share on other sites More sharing options...
Sassy Romano Posted December 13, 2015 Share Posted December 13, 2015 I think you're just going to have to call the function twice, once for each face. The ALL_SIDES is a convenience thing. Link to comment Share on other sites More sharing options...
Qie Niangao Posted December 13, 2015 Share Posted December 13, 2015 Unfortunately, texture animation is all faces, one face, or none at all. If you set one face in one call to the function, a subsequent call overrides that earlier setting. So it becomes an object (and maybe texture) design question. Depending what kind of texture animation that's desired, it may be possible to design a mesh's material assignments (and associated UV maps) such that a single face appears multiple places on the mesh. Or, with prims, you'll likely end up using multiple prims, each with a different face animated (or one with ALL_SIDES animated but the unaminated ones set transparent, overlaying another prim with just the unanimates sides opaque). Link to comment Share on other sites More sharing options...
Bent Luik Posted December 13, 2015 Share Posted December 13, 2015 This rotate two faces BUT not smooth.And I admit it is not a good script, maybe one of the real scripters can make a better cript for you. integer f=0;default{ state_entry() { llSetTimerEvent(0.01); } timer() { f=f+1; if (f ==1 ) {llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, 1,1,1,0, TWO_PI, 0.1*TWO_PI);} if( f== 2) {llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, 0,1,1,0, TWO_PI, 0.1*TWO_PI); f=0; }}} Link to comment Share on other sites More sharing options...
Rolig Loon Posted December 13, 2015 Share Posted December 13, 2015 Unfortunately, Qie is right. You either animate one face or all faces. You can't animate "some" faces. See the LSL wiki, distilled from the experience of scripters who have tried: You can only have one texture animation on a prim Calling llSetTextureAnim more than once on a prim will reset the existing animation.Using a fast timer to switch between calls to llSetTextureAnim gets around that limitation, but at a cost. The result, indeed, will not be smooth. More importantly, it can generate a significant lag for viewers. Personally, I'd follow Qie's advice to put multiple animations on separate prims instead. Link to comment Share on other sites More sharing options...
Pamela Galli Posted December 13, 2015 Author Share Posted December 13, 2015 Thanks everyone! I actually have a model already split into separate meshes but was trying to save a prim, so all is good :-) Link to comment Share on other sites More sharing options...
Bent Luik Posted December 14, 2015 Share Posted December 14, 2015 I didn't say Qie was wrong, because he is right.:matte-motes-big-grin: I said the script rotate two faces, and it does one face at the time. About the lag, that is what i meant by "not a good script". I just tested it in a place with about 2800 scripts running. I had 10 objects with this script running and there was no change in any of the statistics numbers other than the usual, I did not try with more than 10 because I figured that no one would use more. Link to comment Share on other sites More sharing options...
Qie Niangao Posted December 14, 2015 Share Posted December 14, 2015 Just to be clear about the "lag" at stake here: It's not sim lag, not really. It's very difficult for even the tightest timer to do much worse than slow down other scripts a little. True, one of the glories of texture animation is that it doesn't even need a script once it gets going, so no script lag at all, but another great virtue is that it sends no object updates over the network to the viewer. I haven't actually run the double-sided texture anim script, but what the sim must be doing is pushing object updates down the wire just as fast as possible (presumably much slower than this timer's nominal 100 Hz), so that's gonna keep the viewer busy and load the network (which might even be a cost consideration for some users with super limited data plans). (With the Develop menu showing, Control-Alt-Shift-U will toggle view of object updates, which can sometimes reveal unexpected performance effects of a script.) Link to comment Share on other sites More sharing options...
steph Arnott Posted December 14, 2015 Share Posted December 14, 2015 The only acceptable and low lag solution is to use two prims. Link to comment Share on other sites More sharing options...
steph Arnott Posted December 14, 2015 Share Posted December 14, 2015 Switching back and forth may look ok on your comp but to another it could be horrendous. I would not even contemplate useing a method like that. Useing two or more prims is far easier to manipulate, your timer is way off, the updated info would get slower and slower until the veiwer slowed to the point of being more than irritating. Link to comment Share on other sites More sharing options...
Nova Convair Posted December 17, 2015 Share Posted December 17, 2015 @Bent Luik: The script seems to flip the animated faces 100 times per second - but that does not happen. The server works in frames of 0.0222 seconds and so it will change prim properties max 45 times per second - every 3rd timer - and only if there is free time for that. But the server will not update every viewer in range 45 times per second. That rate can be significantly lower. That's the reason why the script does not cause lag and runs choppy. The more busy the server is the fewer face flips and viewer updates will happen. Link to comment Share on other sites More sharing options...
Recommended Posts
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