Esempio n. 1
0
 public static List<int> GetArray_INT(string sNameBlenderModule, string sBlenderAccessString)
 {
     CByteArray oByteArray = new CByteArray(sNameBlenderModule, sBlenderAccessString);
     int nArrayElements = oByteArray.GetLengthPayload() / sizeof(int);
     List<int> aBlenderArray = new List<int>(nArrayElements);
     if (nArrayElements > 0) {
         for (int nArrayElement = 0; nArrayElement  < nArrayElements; nArrayElement++)
             aBlenderArray.Add(oByteArray.ReadInt());
     } else {
         Debug.LogWarningFormat("###WARNING: CByteArray.GetArray() gets zero-sided array on '{0}'", oByteArray._sBlenderAccessString);
     }
     return aBlenderArray;
 }
Esempio n. 2
0
 //---------------------------------------------------------------------------	STATIC HOMOGENOUS ARRAY RETRIEVAL
 public static List<ushort> GetArray_USHORT(string sNameBlenderModule, string sBlenderAccessString)
 {
     // Deserialize a Blender mesh's previously-created array
     CByteArray oByteArray = new CByteArray(sNameBlenderModule, sBlenderAccessString);
     int nArrayElements = oByteArray.GetLengthPayload() / sizeof(ushort);
     List<ushort> aBlenderArray = new List<ushort>(nArrayElements);
     if (nArrayElements > 0) {
         for (int nArrayElement = 0; nArrayElement  < nArrayElements; nArrayElement++)
             aBlenderArray.Add(oByteArray.ReadUShort());
     } else {
         Debug.LogWarningFormat("###WARNING: CByteArray.GetArray() gets zero-sided array on '{0}'", oByteArray._sBlenderAccessString);
     }
     return aBlenderArray;
 }