+(define-public (ai-get-material-color mat color-type)
+ (let ((pmat (unwrap-ai-material mat))
+ (pkey (string->pointer (car color-type)))
+ (type (cadr color-type))
+ (index (caddr color-type))
+ (pout (parse-aiColor4D (make-list 4 0) #:reverse #t)))
+ (let ((res (aiGetMaterialColor pmat pkey type index pout)))
+ (if (< res 0)
+ res
+ (wrap-ai-color4d pout)))))
+
+(define-public (ai-get-material-float-array mat color-type max)
+ (let ((pmat (unwrap-ai-material mat))
+ (pkey (string->pointer (car color-type)))
+ (type (cadr color-type))
+ (index (caddr color-type))
+ (pout (bytevector->pointer (list->f32vector (make-list max 0))))
+ (pmax (bytevector->pointer (list->u32vector (list max)))))
+ (let ((res (aiGetMaterialFloatArray pmat pkey type index pout pmax)))
+ (if (< res 0)
+ res
+ (f32vector->list (pointer->bytevector pout max 0 'f32))))))
+
+(define-public (ai-get-material-integer-array mat color-type max)
+ (let ((pmat (unwrap-ai-material mat))
+ (pkey (string->pointer (car color-type)))
+ (type (cadr color-type))
+ (index (caddr color-type))
+ (pout (bytevector->pointer (list->s32vector (make-list max 0))))
+ (pmax (bytevector->pointer (list->u32vector (list max)))))
+ (let ((res (aiGetMaterialIntegerArray pmat pkey type index pout pmax)))
+ (if (< res 0)
+ res
+ (s32vector->list (pointer->bytevector pout max 0 's32))))))
+
+