Ejemplo n.º 1
0
        internal NiTexturingProperty getTexturingProperty(NIFFile nf)
        {
            List <int> propIDs = nodePropertyIDs;

            foreach (int propID in propIDs)
            {
                NIFObject obj = nf.getObject(propID);
                if (obj is NiTexturingProperty)
                {
                    NiTexturingProperty propObj = (NiTexturingProperty)obj;
                    return(propObj);
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
 public StreamAndElement getStreamAndElement(NIFFile file, String elementName, int preferredIndex)
 {
     foreach (NifMeshStream streamRef in streamRefs)
     {
         for (int i = 0; i < streamRef.elementDescs.Count(); i++)
         {
             Pair <String, int> pair          = streamRef.elementDescs[i];
             String             elemCheckName = pair.getKey();
             int elemCheckIndex = pair.getValue();
             if (preferredIndex == -1 || elemCheckIndex == preferredIndex)
             {
                 if (elemCheckName.StartsWith(elementName))
                 {
                     NiDataStream dataStream = (NiDataStream)file.getObject(streamRef.streamLinkID);
                     if (dataStream == null)
                     {
                         Debug.Log("null dataStream");
                     }
                     if (dataStream.streamElems == null)
                     {
                         Debug.Log("null dataStream.streamElems: " + dataStream);
                     }
                     if (i >= dataStream.streamElems.Count())
                     {
                         Debug.Log("WARNING: Data stream does not have enough elements.");
                     }
                     else
                     {
                         NifStreamElement elem = dataStream.streamElems[i];
                         return(new StreamAndElement(streamRef, elem, dataStream));
                     }
                 }
             }
         }
     }
     return(null);
 }