26 #ifndef __GLTF_EXPORTROOT_h__
27 #define __GLTF_EXPORTROOT_h__
57 bool exportNames =
false;
69 bool HasCachedChannelImage(
167 template <
typename T>
173 GLTF_Handle bv_index = createScalarBufferView(arr, min, max);
187 template <
typename T>
193 GLTF_Handle bv_index = createScalarBufferViewInterleaved(arr, min, max);
199 accessor.
count = arr.entries() * arr[0]->entries();
207 template <
typename T>
216 void *
buffer = BufferAlloc(0, size,
sizeof(
T), offset);
219 auto min_max = std::minmax_element(arr.
begin(), arr.
end());
227 min = *min_max.first;
228 max = *min_max.second;
232 template <
typename T>
238 const exint count = arr.entries() * arr[0]->entries();
241 void*
buffer = BufferAlloc(0, size,
sizeof(
T), offset);
244 T local_min = (*arr[0])[0];
245 T local_max = (*arr[0])[0];
247 for (
exint i = 0; i < arr[0]->entries(); ++i)
249 for (
exint j = 0;
j < arr.entries(); ++
j)
251 buf_t[i * arr.entries() +
j] = (*arr[
j])[i];
253 if ((*arr[
j])[i] < local_min)
254 local_min = (*arr[j])[i];
255 if ((*arr[j])[i] > local_max)
256 local_max = (*arr[j])[i];
297 void ResolveBufferLengths();
298 void RemoveEmptyBuffers();
302 void ConvertAbsolutePaths(
const UT_String &base_path);
319 std::map<std::vector<GLTF_ChannelMapping>,
GLTF_Handle>
323 ExportSettings mySettings;
const T * getRawArray() const
GLTF_Handle addScalarArray(const UT_Array< T > &arr, GLTF_ComponentType type)
GLsizei const GLchar *const * path
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Class which writes ASCII or binary JSON streams.
GLTF_Handle createScalarBufferView(const UT_Array< T > &arr, T &min, T &max)
UT_StringHolder hero_channel
Portable replacement for std::ofstream.
exint entries() const
Alias of size(). size() is preferred.
GLTF_Handle createScalarBufferViewInterleaved(const UT_Array< UT_Array< T > * > &arr, T &min, T &max)
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLTF_ComponentType componentType
GLTF_Handle addScalarArraysInterleaved(const UT_Array< UT_Array< T > * > &arr, GLTF_ComponentType type)
constexpr const char * GENERATOR_STRING
constexpr const char * GLTF_VERSION
iterator end()
End iterator.