use foreach to get textures

master
Christopher 2020-06-28 15:23:10 +02:00
parent 3cae461bbf
commit 4f96158ac3
1 changed files with 7 additions and 10 deletions

View File

@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using static OpenMetaverse.Primitive;
[assembly: Addin("TextureFetcher", "0.1")]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
@ -128,22 +129,18 @@ namespace OpenSim.Modules.TextureFetcher
Primitive.TextureEntry textures = part.Shape.Textures;
int allSides = part.GetNumberOfSides();
for (uint i = 0; i <= allSides; i++)
foreach(TextureEntryFace face in textures.FaceTextures)
{
m_log.Info("[" + Name + "] Get face " + i);
if (textures.FaceTextures[i] != null)
if(face != null)
{
if (textures.FaceTextures[i].TextureID != null)
allTextures.Add(textures.FaceTextures[i].TextureID);
if (face.TextureID != null)
allTextures.Add(face.TextureID);
if (textures.FaceTextures[i].MaterialID != null)
allTextures.Add(textures.FaceTextures[i].MaterialID);
if (face.MaterialID != null)
allTextures.Add(face.MaterialID);
}
}
if (part.Shape.SculptTexture != UUID.Zero)
allTextures.Add(part.Shape.SculptTexture);
//Convert texture uuid list to inventar items.
foreach (UUID texture in allTextures)
{