From 1137b56c2535021a5f72d9a9410530ac256cba07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 20 Sep 2022 01:11:19 +0200 Subject: [PATCH] sceneconverter: add .gitattributes and conversion script for test files. Because no way I'm doing that conversion and diffing by hand every time. --- .../Test/SceneConverterTestFiles/.gitattributes | 11 +++++++++++ .../Test/SceneConverterTestFiles/convert.sh | 8 ++++++++ .../two-triangles-transformed.bin.in | 4 +--- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src/Magnum/SceneTools/Test/SceneConverterTestFiles/.gitattributes create mode 100755 src/Magnum/SceneTools/Test/SceneConverterTestFiles/convert.sh diff --git a/src/Magnum/SceneTools/Test/SceneConverterTestFiles/.gitattributes b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/.gitattributes new file mode 100644 index 000000000..fc4f43f9d --- /dev/null +++ b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/.gitattributes @@ -0,0 +1,11 @@ +# You have to add the following to your .git/config or global +# ~/.gitconfig to make the binary diffs work (without the comment +# character, of course): +# +# [diff "hex"] +# textconv = hexdump -v -C +# binary = true +# + +*.bin binary diff=hex +*.ply binary diff=hex diff --git a/src/Magnum/SceneTools/Test/SceneConverterTestFiles/convert.sh b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/convert.sh new file mode 100755 index 000000000..8dd5a376f --- /dev/null +++ b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/convert.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +# in -> bin +for i in *.bin.in; do + ../../../../../../magnum-plugins/src/MagnumPlugins/GltfImporter/Test/in2bin.py ${i} +done diff --git a/src/Magnum/SceneTools/Test/SceneConverterTestFiles/two-triangles-transformed.bin.in b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/two-triangles-transformed.bin.in index 5a64016f2..9845ee6e9 100644 --- a/src/Magnum/SceneTools/Test/SceneConverterTestFiles/two-triangles-transformed.bin.in +++ b/src/Magnum/SceneTools/Test/SceneConverterTestFiles/two-triangles-transformed.bin.in @@ -1,6 +1,4 @@ -# Like two-triangles.obj, but the second triangle moved 10 units on Y. Convert -# with magnum-plugins/src/MagnumPlugins/GltfImporter/Test/in2bin.py. - +# Like two-triangles.obj, but the second triangle moved 10 units on Y type = "3f3f3f 3f3f3f" input = [ -1, 1, 0,