Listing unique textures in a build

Mesh Studio is a fairly big part of how I make things these days and one of its features is the simple way that you specify mesh faces with it. Simply put, for anyone who hasn't used it before, you create a mesh face by having one or more prim faces be the same texture and tint. If two prim faces have the same texture UUID and the same colour then in the final mesh they'll be part of the same face. Nice and easy.

Only... recently I've been having some oddness happening. MS tells you, via hover text, how many mesh faces the build will result in. On occasion I've been finding that it's reporting too high. This caused me to pull out and polish up a script I first wrote about a year ago when I ran into a possibly related problem where I found that a prim that had been dimpled, and then the dimple was closed again, would confuse MS because the non-existent dimple would be reported at the LSL-level as a visible face (not MS' fault, of course, and the issue might have been fixed by now -- I should test again).

The recent situation I've run into is with very prim-heavy builds (well over 100 prims in the source linkset) where faces that don't really exist appear to have the plywood texture on them. Setting the whole prim 100% transparent (the way you tell MS to not generate a surface) and then unhiding the faces I want fixes it every time (which has me suspecting that it's possibly related to cuts and dimples). Finding the offending prim(s) is something not easily done by hand, hence the updating of the original script.

In case it's useful to anyone else, here it is. Drop it in the root of your object and touch it and it'll report every unique texture and tint combination it finds:

It's coded to ignore transparent faces, and to ease knowing what texture is what the texture is reported as a URL that shows you the texture (eg, plywood texture URL). For what I'd hope are obvious reasons all output is done with llOwnerSay.

No comments:

Post a Comment