Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
# embed_files(<output.cpp> <namespace> <symbol> <file> [<symbol> <file> ...])
# Generates a C++ source with each file as `const unsigned char <symbol>[]` and
# `const unsigned long long <symbol>_size`, so assets ship inside the binary.
function(embed_files output ns)
set(content "// Generated by cmake/EmbedFile.cmake - do not edit.\nnamespace ${ns} {\n")
set(args ${ARGN})
list(LENGTH args count)
math(EXPR last "${count} - 1")
foreach(i RANGE 0 ${last} 2)
math(EXPR j "${i} + 1")
list(GET args ${i} symbol)
list(GET args ${j} file)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${file})
file(READ ${file} hex HEX)
file(SIZE ${file} size)
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," bytes "${hex}")
string(REGEX REPLACE "(0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,)" "\\1\n" bytes "${bytes}")
string(APPEND content "extern const unsigned char ${symbol}[] = {\n${bytes}};\nextern const unsigned long long ${symbol}_size = ${size};\n")
endforeach()
string(APPEND content "} // namespace ${ns}\n")
file(WRITE ${output}.tmp "${content}")
file(COPY_FILE ${output}.tmp ${output} ONLY_IF_DIFFERENT)
endfunction()