diff --git a/CMakeLists.txt b/CMakeLists.txt index fcd579b..2b96d3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,16 @@ -cmake_minimum_required( VERSION 3.0 ) +function( pack_model model_name ) + file( GLOB archive_files ${PROJECT_SOURCE_DIR}/models/${model_name}/* ) + add_custom_command( + COMMAND + ${CMAKE_COMMAND} -E tar "cf" "${PROJECT_BINARY_DIR}/models/${model_name}.fma" --format=zip ${archive_files} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/models/${model_name} + OUTPUT ${PROJECT_BINARY_DIR}/models/${model_name}.fma + DEPENDS ${archive_files} + ) + add_custom_target( fc2d_model_${model_name} ALL DEPENDS ${PROJECT_BINARY_DIR}/models/${model_name}.fma ) +endfunction() + +cmake_minimum_required( VERSION 3.2 ) project( Facecam2D VERSION 0.1.0 ) set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ) add_subdirectory( "libs/Boxer" ) @@ -24,11 +36,13 @@ include_directories( ${PROJECT_SOURCE_DIR}/src ) configure_file( ${PROJECT_SOURCE_DIR}/src/config.hpp.in ${PROJECT_SOURCE_DIR}/src/config.hpp @ONLY ) file( COPY - ${PROJECT_SOURCE_DIR}/models ${PROJECT_SOURCE_DIR}/cvdata DESTINATION ${PROJECT_BINARY_DIR} ) +file( MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/models ) +pack_model( "test" ) +pack_model( "rms" ) if (APPLE) file ( COPY diff --git a/models/rms.fma b/models/rms.fma deleted file mode 100644 index bb7aa5a..0000000 Binary files a/models/rms.fma and /dev/null differ diff --git a/models/rms/bg.webp b/models/rms/bg.webp new file mode 100644 index 0000000..4fb53b4 Binary files /dev/null and b/models/rms/bg.webp differ diff --git a/models/rms/chest.webp b/models/rms/chest.webp new file mode 100644 index 0000000..74b3e1c Binary files /dev/null and b/models/rms/chest.webp differ diff --git a/models/rms/face-mouth-closed.webp b/models/rms/face-mouth-closed.webp new file mode 100644 index 0000000..7007606 Binary files /dev/null and b/models/rms/face-mouth-closed.webp differ diff --git a/models/rms/face-mouth-open.webp b/models/rms/face-mouth-open.webp new file mode 100644 index 0000000..ef80ff8 Binary files /dev/null and b/models/rms/face-mouth-open.webp differ diff --git a/models/rms/hair.webp b/models/rms/hair.webp new file mode 100644 index 0000000..605e287 Binary files /dev/null and b/models/rms/hair.webp differ diff --git a/models/rms/head.webp b/models/rms/head.webp new file mode 100644 index 0000000..563dbbb Binary files /dev/null and b/models/rms/head.webp differ diff --git a/models/rms/model.toml b/models/rms/model.toml new file mode 100644 index 0000000..00f13d4 --- /dev/null +++ b/models/rms/model.toml @@ -0,0 +1,52 @@ +[format] +version_major = 0 +version_minor = 2 + +[model_info] +name = "Richard Stallman" +version = "1.0" + +[[part]] +texture = "bg.webp" +bind = "null" +rot_factor = 0.0 +scale_factor = 0.0 + +[[part]] +texture = "chest.webp" +bind = "head" +rot_factor = 0.4 + +[[part]] +texture = "hair.webp" +bind = "head" +follow = "face" +factor = -0.5 + +[[part]] +texture = "head.webp" +bind = "head" + +[[part]] +bind = "head" +follow = "face" +factor = 0.5 + + [[part.textures]] + file = "face-mouth-closed.webp" + + [[part.textures]] + file = "face-mouth-open.webp" + trigger = "mouth-open" + +[[part]] +texture = "nose.webp" +bind = "head" +follow = "face" +factor = 0.8 + +[[part]] +texture = "tripod.webp" +bind = "null" +rot_factor = 0.0 +scale_factor = 0.0 diff --git a/models/rms/nose.webp b/models/rms/nose.webp new file mode 100644 index 0000000..d95c0a5 Binary files /dev/null and b/models/rms/nose.webp differ diff --git a/models/rms/tripod.webp b/models/rms/tripod.webp new file mode 100644 index 0000000..f44d578 Binary files /dev/null and b/models/rms/tripod.webp differ diff --git a/models/test.fma b/models/test.fma deleted file mode 100644 index a8c698a..0000000 Binary files a/models/test.fma and /dev/null differ diff --git a/models/test/face-eyes-iris.png b/models/test/face-eyes-iris.png new file mode 100644 index 0000000..6dc76b9 Binary files /dev/null and b/models/test/face-eyes-iris.png differ diff --git a/models/test/face-eyes.png b/models/test/face-eyes.png new file mode 100644 index 0000000..218153c Binary files /dev/null and b/models/test/face-eyes.png differ diff --git a/models/test/face-mouth-closed.png b/models/test/face-mouth-closed.png new file mode 100644 index 0000000..175940a Binary files /dev/null and b/models/test/face-mouth-closed.png differ diff --git a/models/test/face-mouth-open.png b/models/test/face-mouth-open.png new file mode 100644 index 0000000..d256bdb Binary files /dev/null and b/models/test/face-mouth-open.png differ diff --git a/models/test/head-base.png b/models/test/head-base.png new file mode 100644 index 0000000..442f3fd Binary files /dev/null and b/models/test/head-base.png differ diff --git a/models/test/model.toml b/models/test/model.toml new file mode 100644 index 0000000..1557b8f --- /dev/null +++ b/models/test/model.toml @@ -0,0 +1,30 @@ +[format] +version_major = 0 +version_minor = 1 + +[model_info] +name = "Test Model" +version = "1.0" + + +[[part]] +texture = "head-base.png" +bind = "head" + +[[part]] +texture = "face-eyes.png" +bind = "head" +follow = "face" +factor = 0.85 + +[[part]] +bind = "head" +follow = "face" +factor = 1.0 + + [[part.textures]] + file = "face-mouth-closed.png" + + [[part.textures]] + file = "face-mouth-open.png" + trigger = "mouth-open"