User Tools

Site Tools


script_reset_tool

====== About the script ====== * Purpose : This script will reset the selected values of all the items in the container. * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/iiR35UXJGoV * Now included in [[script_multitool|Lukas's multitool]] ====== How to use the script ====== Just a little script-tool when you are playing with items...and things go wrong. Just run it from the lightning or the item menu. ====== Script code ====== <sxh javascript> var cont = LL.getEvent().getContainer(); var items = cont.getItems(); var bools = []; bools[0] = confirm("Reset cell? (only grid items) [0,0]"); bools[1] = confirm("Reset position? (only free items) [0,0] "); bools[2] = confirm("Reset rotation? (only free items) [0]"); bools[3] = confirm("Reset scale? (only free items) [1,1]"); bools[4] = confirm("Reset skew? (only free items) [0,0]"); bools[5] = confirm("Reset size? (only free items) [cell size]"); bools[6] = confirm("Reset visibility? [true]"); for(var i=0;i<items.getLength();++i){ var t=items.getAt(i); if(bools[0])t.setCell(0,0,1,1); if(bools[1]) t.setPosition(0,0); if(bools[2]) t.setRotation(0); if(bools[3]) t.setScale(1,1); if(bools[4]) t.setSkew(0,0); if(bools[5]) t.setSize(cont.getCellWidth(),cont.getCellHeight() ); if(bools[6]) t.setVisibility(true); } </sxh>

script_reset_tool.txt · Last modified: 2014/07/22 14:48 by trianguloy