static public List <bool> ListFromVtArray(VtBoolArray input) { bool[] tmp = UsdIo.ArrayAllocator.Malloc <bool>(input.size()); unsafe { fixed(bool *p = tmp) { input.CopyToArray(new IntPtr(p)); } } return(tmp.ToList()); }
static public void FromVtArray(VtBoolArray input, ref List <bool> output) { bool[] tmp = UsdIo.ArrayAllocator.Malloc <bool>(input.size()); unsafe { fixed(bool *p = tmp) { input.CopyToArray((IntPtr)p); } } output.Clear(); output.InsertRange(0, tmp); }
static public void FromVtArray(VtBoolArray input, ref bool[] output) { if (output.Length != input.size()) { output = UsdIo.ArrayAllocator.Malloc <bool>(input.size()); } unsafe { fixed(bool *p = output) { input.CopyToArray((IntPtr)p); } } }