diff options
author | bartus | 2017-07-28 13:50:32 +0200 |
---|---|---|
committer | bartus | 2017-07-28 13:50:32 +0200 |
commit | f7ea460e73920974c68ce0e214109198167832e1 (patch) | |
tree | 5f6c41dc435d8c3406184c382b0842182cb0d7e3 | |
parent | 5f525ed3703d6a2eee3dfa207d64e1a7a7fe8943 (diff) | |
download | aur-f7ea460e73920974c68ce0e214109198167832e1.tar.gz |
add customizable color of rendered object to PKGBUILD
-rw-r--r-- | .SRCINFO | 3 | ||||
-rw-r--r-- | PKGBUILD | 16 | ||||
-rwxr-xr-x | stl.thumbnailer.py | 2 |
3 files changed, 17 insertions, 4 deletions
@@ -5,12 +5,13 @@ pkgbase = stl-thumbnailer url = https://www.thingiverse.com/thing:258653 arch = any license = GPL + makedepends = sed depends = openscad depends = python2 source = stl.thumbnailer source = stl.thumbnailer.py md5sums = 2e86d05c56f013b5030caf6e5b03a856 - md5sums = 7e1cfa75271e806ef339f1bb3f62b8dc + md5sums = 8ab41a0aa264ecdeff07d427d35a21e1 pkgname = stl-thumbnailer @@ -1,4 +1,11 @@ # Maintainer: bartus <aur@bartus.33mail.com> + +# you can change color of rendered object here +# format: RGB +# scale: [0,1] + +__color__="1,1,1" + pkgname=stl-thumbnailer pkgver=1 pkgrel=1 @@ -8,11 +15,16 @@ url="https://www.thingiverse.com/thing:258653" license=('GPL') groups=() depends=(openscad python2) -makedepends=() +makedepends=(sed) source=("stl.thumbnailer" "stl.thumbnailer.py") md5sums=('2e86d05c56f013b5030caf6e5b03a856' - '7e1cfa75271e806ef339f1bb3f62b8dc') + '8ab41a0aa264ecdeff07d427d35a21e1') + +prepare() { + cd ${srcdir} + sed -i "s/__color__/$__color__/" stl.thumbnailer.py +} package() { cd ${srcdir} diff --git a/stl.thumbnailer.py b/stl.thumbnailer.py index e0c01bb15378..4ba23f3a5450 100755 --- a/stl.thumbnailer.py +++ b/stl.thumbnailer.py @@ -21,7 +21,7 @@ def main( ): ff = "/tmp/stl_to_png_%s.scad" % m.hexdigest() f = open(ff,"w") - f.write("import(\"%s\");"%fin) + f.write("color([__color__]) import(\"%s\");"%fin) f.close() |