From: bones_was_here Date: Tue, 4 Feb 2025 13:33:43 +0000 (+1000) Subject: Update luminos `create` scripts for current tools X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fbones_was_here%2Fmenu_scriptupdate;p=xonotic%2Fmediasource.git Update luminos `create` scripts for current tools Tested with inkscape 1.2.2 gimp 2.10.34 blender 3.4.1 imagemagick 7.1.1 No bashisms so no need to depend on bash specifically. --- diff --git a/gfx/luminos/hud_icons/flags/create b/gfx/luminos/hud_icons/flags/create index 0ec61de..cd49967 100755 --- a/gfx/luminos/hud_icons/flags/create +++ b/gfx/luminos/hud_icons/flags/create @@ -1,25 +1,34 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory if not already existing if [ ! -d "$dir" ] then mkdir "$dir" fi +#Guess how `rename` program from `util-linux` package is named :face_palm: +if which rename.ul; then + RENAME=rename.ul # debian, ubuntu +else + RENAME=rename # arch, gentoo, fedora +fi + #Method to render single Blender scene render_blendscene() { - blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 - rename "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* + blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 + $RENAME "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* } #Method to create all icons of the specified color create_colorversion() { #Export flagcontent from svg - inkscape -f "flagcontent_${colorversion}.svg" -e "flagcontent.png" + inkscape "flagcontent_${colorversion}.svg" -o "flagcontent.png" #Render the Blender scenes blendfile="flags" @@ -46,7 +55,7 @@ create_colorversion() convert "notify_color_taken.tga" -filter Cubic -resize 192x96 "notify_temp.tga" #Add white border to all .tga images of this color - gimp -d -f -i \ + gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(addborder "flag_color*.tga" 255 255 255 24 3 9 1 3)' \ -b '(addborder "notify_color*.tga" 255 255 255 16 2 6 1 3)' \ -b '(gimp-quit 0)' @@ -61,20 +70,20 @@ create_colorversion() composite -gravity Center "notify_shield.png" "notify_color_shielded.tga" "notify_color_shielded.tga" #Rename to color version - rename "color" "$colorversion" *".tga" + $RENAME "color" "$colorversion" *".tga" cd .. } #Export all neutral png images from svg files -inkscape -f "flagcontent_carrying.svg" -e "flagcontent_carrying.png" -inkscape -f "flag_shield.svg" -e "${dir}/flag_shield.png" -inkscape -f "notify_shield.svg" -e "${dir}/notify_shield.png" +inkscape "flagcontent_carrying.svg" -o "flagcontent_carrying.png" +inkscape "flag_shield.svg" -o "${dir}/flag_shield.png" +inkscape "notify_shield.svg" -o "${dir}/notify_shield.png" #Create base images (colorize nyx.png) convert "nyx.png" -fill "#004fff" -tint 75 "${dir}/base_blue.png" convert "nyx.png" -fill "#ff0000" -tint 75 "${dir}/base_red.png" cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(addborder "base*.png" 255 255 255 0 1 3 1 2)' \ -b '(gimp-quit 0)' cd .. @@ -94,6 +103,6 @@ rm *".png" rm *"temp.tga" #RLE compress tga images -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(all2tga "*.tga" 1)' \ -b '(gimp-quit 0)' diff --git a/gfx/luminos/hud_icons/healtharmor/create b/gfx/luminos/hud_icons/healtharmor/create index 97a47e8..ac31503 100755 --- a/gfx/luminos/hud_icons/healtharmor/create +++ b/gfx/luminos/hud_icons/healtharmor/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory, if not already existing if [ ! -d "$dir" ] then @@ -11,7 +13,7 @@ fi #Copy images to subdirectory, add white border cp *".tga" "$dir" cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(addborder "*.tga" 255 255 255 24 3 9 1 3)' \ -b '(all2tga "*.tga" 1)' \ -b '(gimp-quit 0)' diff --git a/gfx/luminos/hud_icons/inventory/create b/gfx/luminos/hud_icons/inventory/create index 67e1c4a..a590df8 100755 --- a/gfx/luminos/hud_icons/inventory/create +++ b/gfx/luminos/hud_icons/inventory/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory, if not already existing if [ ! -d "$dir" ] then @@ -11,7 +13,7 @@ fi #Copy images to subdirectory, add white border cp *".tga" "$dir" cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(addborder "*.tga" 255 255 255 16 2 6 1 3)' \ -b '(all2tga "*.tga" 1)' \ -b '(gimp-quit 0)' diff --git a/gfx/luminos/hud_icons/keys/create b/gfx/luminos/hud_icons/keys/create index fae73fc..e3896b7 100755 --- a/gfx/luminos/hud_icons/keys/create +++ b/gfx/luminos/hud_icons/keys/create @@ -1,24 +1,33 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory if not already existing if [ ! -d "$dir" ] then mkdir "$dir" fi +#Guess how `rename` program from `util-linux` package is named :face_palm: +if which rename.ul; then + RENAME=rename.ul # debian, ubuntu +else + RENAME=rename # arch, gentoo, fedora +fi + #Export png from all svg files for f in *".svg" do - inkscape -f "$f" -e "`basename $f .svg`.png" + inkscape "$f" -o "`basename $f .svg`.png" done #Method to render single Blender scene render_blendscene() { - blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 - rename "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* + blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 + $RENAME "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* } #Render the Blender scenes @@ -56,6 +65,6 @@ done #RLE compress tga files cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(all2tga "*.tga" 1)' \ -b '(gimp-quit 0)' diff --git a/gfx/luminos/hud_icons/mods/create b/gfx/luminos/hud_icons/mods/create index 97a47e8..ac31503 100755 --- a/gfx/luminos/hud_icons/mods/create +++ b/gfx/luminos/hud_icons/mods/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory, if not already existing if [ ! -d "$dir" ] then @@ -11,7 +13,7 @@ fi #Copy images to subdirectory, add white border cp *".tga" "$dir" cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(addborder "*.tga" 255 255 255 24 3 9 1 3)' \ -b '(all2tga "*.tga" 1)' \ -b '(gimp-quit 0)' diff --git a/gfx/luminos/hud_icons/notify/create b/gfx/luminos/hud_icons/notify/create index 53d1da7..a0310f4 100755 --- a/gfx/luminos/hud_icons/notify/create +++ b/gfx/luminos/hud_icons/notify/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Uses this font: font="DejaVu-Sans-Bold" @@ -11,11 +13,18 @@ then mkdir "$dir" fi +#Guess how `rename` program from `util-linux` package is named :face_palm: +if which rename.ul; then + RENAME=rename.ul # debian, ubuntu +else + RENAME=rename # arch, gentoo, fedora +fi + #Method to render single Blender scene render_blendscene() { - blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 - rename "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* + blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 + $RENAME "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* } #Render the Blender scenes @@ -28,7 +37,7 @@ blendscene="notify_water" render_blendscene #Export png from svg, render notify_telefrag -inkscape -f "crosshair.svg" -e "crosshair.png" +inkscape "crosshair.svg" -o "crosshair.png" blendscene="notify_telefrag" render_blendscene rm "crosshair.png" @@ -43,7 +52,7 @@ cp "notify"*".tga" "$dir" #Add white border to all tga images cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(addborder "*.tga" 255 255 255 16 2 6 1 2)' \ -b '(gimp-quit 0)' @@ -78,6 +87,6 @@ render_blendscene #RLE compress tga files cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(all2tga "*.tga" 1)' \ -b '(gimp-quit 0)' diff --git a/gfx/luminos/hud_icons/race/create b/gfx/luminos/hud_icons/race/create index 5b33183..f6e7e30 100755 --- a/gfx/luminos/hud_icons/race/create +++ b/gfx/luminos/hud_icons/race/create @@ -1,18 +1,27 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory if not already existing if [ ! -d "$dir" ] then mkdir "$dir" fi +#Guess how `rename` program from `util-linux` package is named :face_palm: +if which rename.ul; then + RENAME=rename.ul # debian, ubuntu +else + RENAME=rename # arch, gentoo, fedora +fi + #Method to render single Blender scene render_blendscene() { - blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 - rename "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* + blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 + $RENAME "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* } #Render the Blender blendscenes @@ -28,7 +37,7 @@ render_blendscene #Add white border and RLE compress tga files cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(addborder "*.tga" 255 255 255 24 3 9 0 2)' \ -b '(all2tga "*.tga" 1)' \ -b '(gimp-quit 0)' @@ -36,4 +45,4 @@ gimp -d -f -i \ #For compatibility with current HUD: #Copy and rename newrank icons cp "race_newrank.tga" "race_newrankyellow.tga" -rename "newrank" "newrankgreen" "race_newrank.tga" +$RENAME "newrank" "newrankgreen" "race_newrank.tga" diff --git a/gfx/luminos/hud_icons/voteprogress/create b/gfx/luminos/hud_icons/voteprogress/create index 710d4c3..4b04df3 100755 --- a/gfx/luminos/hud_icons/voteprogress/create +++ b/gfx/luminos/hud_icons/voteprogress/create @@ -1,18 +1,27 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory if not already existing if [ ! -d "$dir" ] then mkdir "$dir" fi +#Guess how `rename` program from `util-linux` package is named :face_palm: +if which rename.ul; then + RENAME=rename.ul # debian, ubuntu +else + RENAME=rename # arch, gentoo, fedora +fi + #Method to render single Blender scene render_blendscene() { - blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 - rename "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* + blender -b "${PWD}/${blendfile}.blend" -S "$blendscene" -o "//${dir}/${blendscene}#" -f 1 + $RENAME "${blendscene}1" "$blendscene" "${dir}/${blendscene}1."* } #Render the Blender scenes @@ -26,7 +35,7 @@ render_blendscene #Edit voteprogress_back and RLE compress tga files cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(dbca "voteprogress_back.tga" 1 127 0 0.0)' \ -b '(dbca "voteprogress_back.tga" 0 127 0 0.0)' \ -b '(addborder "voteprogress_back.tga" 255 255 255 16 2 6 0 2)' \ diff --git a/gfx/luminos/hud_icons/weapos/create b/gfx/luminos/hud_icons/weapos/create index 4144aa4..6906fdd 100755 --- a/gfx/luminos/hud_icons/weapos/create +++ b/gfx/luminos/hud_icons/weapos/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory, if not already existing if [ ! -d "$dir" ] then @@ -11,7 +13,7 @@ fi #Copy images to subdirectory, add white border cp *".tga" "$dir" cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(dbca "*.tga" 0 15 7 0.0)' \ -b '(addborder "*.tga" 255 255 255 16 2 6 1 3)' \ -b '(all2tga "*.tga" 1)' \ diff --git a/gfx/luminos/hud_svg/create b/gfx/luminos/hud_svg/create index 451f4db..5b62b94 100755 --- a/gfx/luminos/hud_svg/create +++ b/gfx/luminos/hud_svg/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory if not already existing if [ ! -d "$dir" ] then @@ -11,10 +13,12 @@ fi #Export png from svg files (to subdirectory) for f in *".svg" do - inkscape -f "$f" -e "${dir}/`basename $f .svg`.png" + inkscape "$f" -o "${dir}/`basename $f .svg`.png" done #Convert from png to tga (RLE compressed), remove png cd "$dir" -gimp -d -f -i -b '(all2tga "*.png" 1)' -b '(gimp-quit 0)' +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ + -b '(all2tga "*.png" 1)' \ + -b '(gimp-quit 0)' rm *".png" diff --git a/gfx/luminos/menu_svg/create b/gfx/luminos/menu_svg/create index 233e32c..58cc451 100755 --- a/gfx/luminos/menu_svg/create +++ b/gfx/luminos/menu_svg/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory if not already existing if [ ! -d "$dir" ] then @@ -11,13 +13,13 @@ fi #Export png from svg files (to subdirectory) for f in *".svg" do - inkscape -f "$f" -d 90 -e "${dir}/`basename $f .svg`.png" + inkscape "$f" -d 90 -o "${dir}/`basename $f .svg`.png" done #Create bigbuttons for f in "bigbutton"*".svg" do - inkscape -f "$f" -d 180 -e "${dir}/`basename $f .svg`.png" + inkscape "$f" -d 180 -o "${dir}/`basename $f .svg`.png" done #Copy identical images @@ -45,7 +47,7 @@ cp crosshairbutton_c.png colorbutton_c.png cp crosshairbutton_f.png colorbutton_f.png #Edit and convert files -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(dbca "*gray*" 1 0 0 0.0)' \ -b '(dbca "*_d*" 0 0 0 50.0)' \ -b '(all2tga "*.png" 1)' \ diff --git a/gfx/luminos/readme.txt b/gfx/luminos/readme.txt index 52790d0..fc94290 100755 --- a/gfx/luminos/readme.txt +++ b/gfx/luminos/readme.txt @@ -16,7 +16,7 @@ The ./create shell scripts batch-export, render and convert the final images from various sourcefiles. They use Inkscape, Gimp, Blender and ImageMagick, and require the provided -Gimp scripts (gimp_files/*.scm) to be present in ~/.gimp*/scripts/. +Gimp scripts (gimp_files/*.scm) to be present in ~/.config/GIMP/*.*/scripts/ ========================== Foreign Sourcefiles diff --git a/gfx/luminos/scoreboard_svg/create b/gfx/luminos/scoreboard_svg/create index f4810b7..25a8314 100755 --- a/gfx/luminos/scoreboard_svg/create +++ b/gfx/luminos/scoreboard_svg/create @@ -1,7 +1,9 @@ -#!/bin/bash +#!/bin/sh #Save created files in this subdirectory: dir="created" +set -ex + #Create subdirectory if not already existing if [ ! -d "$dir" ] then @@ -11,12 +13,12 @@ fi #Export png from svg files (to subdirectory) for f in *".svg" do - inkscape -f "$f" -d 90 -e "${dir}/`basename $f .svg`.png" + inkscape "$f" -d 90 -o "${dir}/`basename $f .svg`.png" done #Cconvert files cd "$dir" -gimp -d -f -i \ +gimp -d -f -i --batch-interpreter plug-in-script-fu-eval \ -b '(all2tga "*.png" 1)' \ -b '(gimp-quit 0)'