Add a variable to recognize identifiers of outputs from graphs, letting people choose any preset and file name they want as long as they indicate there the existing identifiers

This commit is contained in:
yannk 2021-12-15 23:20:51 +01:00
parent 9d8598721f
commit b11e4557c5
3 changed files with 11 additions and 2 deletions

View file

@ -18,6 +18,9 @@ export SBSARFILES = $(SBSARDESTINATION:.sbs=.sbsar)
# texturesets files # texturesets files
export TEXTURESET_FOLDER := texturesets export TEXTURESET_FOLDER := texturesets
# texture names possible
export TEXTURES_NAMES := basecolor|normal|metallic|roughness|opacity|height
# png files folders # png files folders
export PNG1024_DIR := png_1024 export PNG1024_DIR := png_1024
export PNG512_DIR := png_512 export PNG512_DIR := png_512
@ -25,7 +28,7 @@ export PNG256_DIR := png_256
# Blender related # Blender related
export BLENDFILES_FOLDER := blenderfiles/master export BLENDFILES_FOLDER := blenderfiles/master
export BLENDEREXEC := /home/yann/Documents/3D/blender_builds/daily/blender-3.1.0-alpha+daily.c1f5d8d023c6/blender export BLENDEREXEC := /home/yann/Documents/3D/blender_builds/daily/blender-3.1.0-alpha+daily.644eb68524b9/blender
# Logo file # Logo file
export LOGO := logo/YKtextures.png export LOGO := logo/YKtextures.png

View file

@ -19,7 +19,7 @@ $(RENDERS): $(TEXTURESET_FOLDER)/%
echo "pngset :" $$pngset ;\ echo "pngset :" $$pngset ;\
for file in $$pngset ;\ for file in $$pngset ;\
do basename=$$(basename "$$file");\ do basename=$$(basename "$$file");\
newname=$$(echo $$basename | sed -r 's/.*_[0-9]{2}_(.*)/\\\1/' | sed -r 's/\\//');\ newname=$$(echo $$basename | sed -r 's/.*($(TEXTURES_NAMES))/\\\1/' | sed -r 's/\\//');\
mkdir --parents blenderfiles/textures;\ mkdir --parents blenderfiles/textures;\
echo "Copying "$$file ;\ echo "Copying "$$file ;\
cp $$file blenderfiles/textures/$$newname ; done ;\ cp $$file blenderfiles/textures/$$newname ; done ;\
@ -44,3 +44,5 @@ $(RENDERS): $(TEXTURESET_FOLDER)/%
done done
# Clean the subfolder with temp textures # Clean the subfolder with temp textures
@ rm -Rf blenderfiles/textures @ rm -Rf blenderfiles/textures
# Clean the temp render folder
@ rm -Rf render

View file

@ -26,6 +26,10 @@ You must write down also the place where the script will write the generated sbs
You can leave the folder indicated here, as it will be used only internally by the script to check the texturesets it handles. You can leave the folder indicated here, as it will be used only internally by the script to check the texturesets it handles.
# Texture names possible
This variable is needed to recognize the files created as bitmaps from the substance source, it must include all the identifiers used in all the graphs, separated by a pipe and no space. It is used as regexp rule in the script.
## Png files folders ## Png files folders
Theses are the places where the script will generate the final png files. It will be the main repository used as reference to fill hereafter all the targets needed in any package needed. Theses are the places where the script will generate the final png files. It will be the main repository used as reference to fill hereafter all the targets needed in any package needed.