 @_exported import ModelIO
 import simd
 
+extension Array {
+    fileprivate init(
+        unsafeUninitializedCount count: Int,
+        initializedWith initializer: (UnsafeMutablePointer<Element>) -> Void
+    ) {
+        self.init(unsafeUninitializedCapacity: count) { buffer, initializedCount in
+            initializer(buffer.baseAddress!)
+            initializedCount = count
+        }
+    }
+}
+
 @available(macOS, introduced: 10.13)
 @available(iOS, introduced: 11.0)
 @available(tvOS, introduced: 11.0)

    }
    
    @nonobjc public func float3Array(atTime time: TimeInterval) -> [SIMD3<Float>] {
        var values = [SIMD3<Float>](repeating: SIMD3<Float>(), count: Int(elementCount))
        __getFloat3Array(&values[0], maxCount: elementCount, atTime: time)
        return values
    }
    
    @nonobjc public func double3Array(atTime time: TimeInterval) -> [SIMD3<Double>] {
        var values = [SIMD3<Double>](repeating: SIMD3<Double>(), count: Int(elementCount))
        __getDouble3Array(&values[0], maxCount: elementCount, atTime: time)
        return values
    }
    
    @nonobjc public func reset(float3Array array:[SIMD3<Float>], atTimes times: [TimeInterval]){

extension MDLAnimatedValue {
    @nonobjc public var times: [TimeInterval] {
        get {
            return [TimeInterval](unsafeUninitializedCount: timeSampleCount) { ptr in
                __getTimes(ptr, maxCount: timeSampleCount)
            }
        }
    }
}
