Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scanTextures()
- {
- integer inventoryCount = llGetInventoryNumber(INVENTORY_TEXTURE);
- integer parmCount;
- integer n;
- string texture;
- string textureFullName;
- vector scale;
- vector offset;
- float rot;
- list parms;
- gInsideTextures = [];
- gOutsideTextures = [];
- gGlassTextures = [];
- gOtherTextures = [];
- for (n=0; n < inventoryCount; n++) {
- textureFullName = llGetInventoryName(INVENTORY_TEXTURE, n);
- parms = (parms = []) + llParseString2List(textureFullName, [";"], []);
- parmCount = (parms != []); // Hack to get list length efficiently
- texture = llToLower(llStringTrim(llList2String(parms, 0), STRING_TRIM));
- if (parmCount > 1)
- scale = (vector)llList2String(parms, 1);
- else
- scale = <1.0, 1.0, 1.0>;
- if (parmCount > 2)
- offset = (vector)llList2String(parms, 2);
- else
- offset = ZERO_VECTOR;
- if (parmCount > 3)
- rot = llList2Float(parms, 3);
- else
- rot = 0.0;
- if (texture == "inside") {
- gInsideTextures += [textureFullName, scale, offset, rot];
- } else if (texture == "outside") {
- gOutsideTextures += [textureFullName, scale, offset, rot];
- } else if (texture == "glass") {
- gGlassTextures += [textureFullName, scale, offset, rot];
- } else {
- gOtherTextures += [textureFullName, scale, offset, rot];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement