From 156037b2b7d21e24dd0e5d930cb53982089cbea0 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 22:40:57 +0100 Subject: [PATCH 01/10] Sending Blender logs to /dev/null - Typo corrected --- Makefile_previews | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile_previews b/Makefile_previews index 47090c9..66432f3 100644 --- a/Makefile_previews +++ b/Makefile_previews @@ -3,11 +3,11 @@ BLENDFILES := $(foreach file, $(BLENDFILES_FOLDER), $(basename $(notdir $(wildca BLENDFILES_SUFFIX := $(foreach file, $(BLENDFILES), $(addsuffix $(file), _)) TARGET := $(foreach file, $(TEXTURESETS), $(addprefix $(file), $(BLENDFILES_SUFFIX))) TARGET := $(foreach file, $(TARGET), $(addsuffix .png, $(file))) -TARGET := $(foreach file, $(TARGET), $(addprefix $(BUILD_FOLDER)/, $(file))) +TARGET := $(foreach file, $(TARGET), $(addprefix $(PREVIEW_FOLDER)/, $(file))) RENDERS := $(foreach file, $(BLENDFILES_SUFFIX), $(addprefix %, $(file))) RENDERS := $(foreach file, $(RENDERS), $(addsuffix .png, $(file))) -RENDERS := $(foreach file, $(RENDERS), $(addprefix $(BUILD_FOLDER)/, $(file))) +RENDERS := $(foreach file, $(RENDERS), $(addprefix $(PREVIEW_FOLDER)/, $(file))) all: $(TARGET) @@ -33,14 +33,14 @@ $(RENDERS): $(TEXTURESET_FOLDER)/% for blendname in $$blender_render_files;\ do echo "blendname :" $$blendname;\ destination=$$(echo $$presetname"_"$$blendname.png);\ - echo "destination :"$(BUILD_FOLDER)"/"$$destination;\ + echo "destination :"$(PREVIEW_FOLDER)"/"$$destination;\ blendfile=$$(echo "blenderfiles/"$$rendertype"/"$$blendname".blend");\ echo "blendfile :" $$blendfile;\ mkdir --parents render;\ - echo "Rendering "$(BUILD_FOLDER)/$$destination;\ - $(BLENDEREXEC) -b $$blendfile --render-output //../../render/render##.png -f 1 --addons > nul 2>&1;\ - mkdir --parents $(BUILD_FOLDER);\ - composite -compose atop -gravity southeast -dissolve 90% $(LOGO) render/render01.png $(BUILD_FOLDER)/$$destination;\ + echo "Rendering "$(PREVIEW_FOLDER)/$$destination;\ + $(BLENDEREXEC) -b $$blendfile --render-output //../../render/render##.png -f 1 --addons > /dev/null 2>&1;\ + mkdir --parents $(PREVIEW_FOLDER);\ + composite -compose atop -gravity southeast -dissolve 90% $(LOGO) render/render01.png $(PREVIEW_FOLDER)/$$destination;\ done # Clean the subfolder with temp textures @ rm -Rf blenderfiles/textures From ba18a2c09d23d14e0752ae58c7eb661f3345b833 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 22:42:24 +0100 Subject: [PATCH 02/10] Adding basic informations needed : paths to executables and sources, to build destinations --- global-config.mk | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 global-config.mk diff --git a/global-config.mk b/global-config.mk new file mode 100644 index 0000000..4779eff --- /dev/null +++ b/global-config.mk @@ -0,0 +1,33 @@ +# executables used +export MAKESBSAR=sbscooker --quiet --output-name {inputName} --includes "/opt/Allegorithmic/Substance_Automation_Toolkit/resources/packages/" --includes "sbs/utilities/" +export GETPRESET=sbsmutator info --print-presets +export GETOUTPUT=sbsmutator info --print-outputs +export SBSRENDER=sbsrender + +# sbsar files generation part +export SBS_DIR=sbs +export SBSAR_DIR=build/sbsar + +# texturesets files +export TEXTURESET_FOLDER := build/texturesets + +# texture names possible +export TEXTURES_NAMES := basecolor|normal|metallic|roughness|opacity|height + +# png files folders +export PNG1024_DIR := build/png_1024 +export PNG512_DIR := build/png_512 +export PNG256_DIR := build/png_256 + +# Blender related +export BLENDFILES_FOLDER := blenderfiles/master +export BLENDEREXEC := /home/yann/Documents/3D/blender_builds/daily/blender-3.1.0-alpha+daily.644eb68524b9/blender + +# Logo file +export LOGO := logo/YKtextures.png + +# Destination preview folder +export PREVIEW_FOLDER := build + +# Material list +export MATERIALLIST := material_list.json From 987b10faa61281788f7f78b65d99ec60335856c7 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 22:43:14 +0100 Subject: [PATCH 03/10] Adding a local config information for a path as example --- local-config.mk | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 local-config.mk diff --git a/local-config.mk b/local-config.mk new file mode 100644 index 0000000..20ca6ad --- /dev/null +++ b/local-config.mk @@ -0,0 +1,2 @@ +# Destination preview folder +export PREVIEW_FOLDER := build/preview From 373a23a8eaa693dad9384322ada5be0861509c59 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 22:44:29 +0100 Subject: [PATCH 04/10] Adding local configuration file to ignore if it is modified afterwards --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e8b8bda..0077d7f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ render/ *copyrighted*/ blenderfiles/textures/* *.blend[0-9]* + +# Ignore local configuration file +local-config.mk From 37f4c78f3b7cb59fae7939a698003d40ca6a4799 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 22:45:16 +0100 Subject: [PATCH 05/10] Removing configuration informations for Makefile and adding reading of them --- Makefile | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index d4bf6ac..2a0b8d0 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,16 @@ # Variables definitions SHELL=/bin/bash -# executables used -export MAKESBSAR=sbscooker --quiet --output-name {inputName} --includes "/opt/Allegorithmic/Substance_Automation_Toolkit/resources/packages/" --includes "sbs/utilities/" -export GETPRESET=sbsmutator info --print-presets -export GETOUTPUT=sbsmutator info --print-outputs -export SBSRENDER=sbsrender +# Get Configuration informations from global or local config file +CONFIG_FILES=global-config.mk local-config.mk +include $(CONFIG_FILES) # sbsar files generation part -export SBS_DIR=sbs -export SBSAR_DIR=sbsar -## Auto definitions - do not change + export SBSFILES = $(wildcard $(SBS_DIR)/*.sbs) export SBSARDESTINATION = $(subst $(SBS_DIR)/, $(SBSAR_DIR)/, $(SBSFILES)) export SBSARFILES = $(SBSARDESTINATION:.sbs=.sbsar) -# texturesets files -export TEXTURESET_FOLDER := texturesets - -# texture names possible -export TEXTURES_NAMES := basecolor|normal|metallic|roughness|opacity|height - -# png files folders -export PNG1024_DIR := png_1024 -export PNG512_DIR := png_512 -export PNG256_DIR := png_256 - -# Blender related -export BLENDFILES_FOLDER := blenderfiles/master -export BLENDEREXEC := /home/yann/Documents/3D/blender_builds/daily/blender-3.1.0-alpha+daily.644eb68524b9/blender - -# Logo file -export LOGO := logo/YKtextures.png - -# Destination preview folder -export BUILD_FOLDER := build - -# Material list -export MATERIALLIST := material_list.json - - ### RECIPE PART ### all : previews subformats From 1035416935ac40ec22c0e6b847341fabe2814e05 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 22:52:29 +0100 Subject: [PATCH 06/10] Adding informations about config files --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 152cdd0..0879ffe 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,9 @@ This repository use [Git LFS](https://git-lfs.github.com/). ### Configuration of the Makefile -The beginning of the Makefile contains all the variables and configuration needed. +The files `global-config.mk` and `local-config.mk` contain configuration informations about paths to sources, executables and to the building destinations. The `global-config.mk` one contains all the variables which can be set, and shouldn’t be modified, as it can receive new variables in the future needed for the script to work, and is handled by git for new versions. If you want to specify a dedicated value to any variable, you should copy its line definition to the `local-config.mk` file, as it has been done for the preview build folder as example. Like this, you will keep your local configuration files in the future with new versions of the script. -# Variables definitions - -The very first one shouldn’t be changed, as it will check the proper shell is used to execute the script. +Simply write either the absolute or the relative path from your Makefile script situation for any information needed. ## Executables used @@ -18,13 +16,13 @@ These are the adress of the substance automation toolkit binaries. ## Sbsar files generation part -You need to define a sbs source folder where the script will check for new content. It must be indicated in the corresponding place there. Simply write either the absolute or the relative path from your Makefile script situation for the `SBS_DIR` variables content. +You need to define a sbs source folder where the script will check for new content in the `SBS_DIR` variables content. You must write down also the place where the script will write the generated sbsar. ## Texturesets files -You can leave the folder indicated here, as it will be used only internally by the script to check the texturesets it handles. +This files will be used only internally by the script to check the texturesets it handles. # Texture names possible From 8596022ec9d23d03c07f6565172d3df05db81e93 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 23:06:40 +0100 Subject: [PATCH 07/10] Better explanations about config files --- README.md | 2 +- local-config.mk | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 local-config.mk diff --git a/README.md b/README.md index 0879ffe..0ea48df 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository use [Git LFS](https://git-lfs.github.com/). ### Configuration of the Makefile -The files `global-config.mk` and `local-config.mk` contain configuration informations about paths to sources, executables and to the building destinations. The `global-config.mk` one contains all the variables which can be set, and shouldn’t be modified, as it can receive new variables in the future needed for the script to work, and is handled by git for new versions. If you want to specify a dedicated value to any variable, you should copy its line definition to the `local-config.mk` file, as it has been done for the preview build folder as example. Like this, you will keep your local configuration files in the future with new versions of the script. +The files `global-config.mk` and `local-config.mk` contain configuration informations about paths to sources, executables and to the building destinations. The `global-config.mk` one contains all the variables which can be set and shouldn’t be modified, as it can receive new variables in the future needed for the script to work. Moreover is handled by git for new versions and any changes you make would be erased by new pull of the script. If you want to specify a dedicated value to any variable, you should copy its line definition to the `local-config.mk` file, as it has been done for the preview build folder as example. Like this, you will keep your local configuration files in the future with new versions of the script. Simply write either the absolute or the relative path from your Makefile script situation for any information needed. diff --git a/local-config.mk b/local-config.mk deleted file mode 100644 index 20ca6ad..0000000 --- a/local-config.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Destination preview folder -export PREVIEW_FOLDER := build/preview From 3ab1a821a3d5bb6ca52db3f4b2ab9a499d59c64d Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 23:10:44 +0100 Subject: [PATCH 08/10] Typo on folder name --- global-config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global-config.mk b/global-config.mk index 4779eff..6838f2c 100644 --- a/global-config.mk +++ b/global-config.mk @@ -21,13 +21,13 @@ export PNG256_DIR := build/png_256 # Blender related export BLENDFILES_FOLDER := blenderfiles/master -export BLENDEREXEC := /home/yann/Documents/3D/blender_builds/daily/blender-3.1.0-alpha+daily.644eb68524b9/blender +export BLENDEREXEC := blender # Logo file export LOGO := logo/YKtextures.png # Destination preview folder -export PREVIEW_FOLDER := build +export PREVIEW_FOLDER := build/previews # Material list export MATERIALLIST := material_list.json From e1bb559daa4afca5223a7ad5da4f07043273e07e Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 23:11:53 +0100 Subject: [PATCH 09/10] Instructions how to define local configuration variables for the script --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ea48df..428b814 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository use [Git LFS](https://git-lfs.github.com/). ### Configuration of the Makefile -The files `global-config.mk` and `local-config.mk` contain configuration informations about paths to sources, executables and to the building destinations. The `global-config.mk` one contains all the variables which can be set and shouldn’t be modified, as it can receive new variables in the future needed for the script to work. Moreover is handled by git for new versions and any changes you make would be erased by new pull of the script. If you want to specify a dedicated value to any variable, you should copy its line definition to the `local-config.mk` file, as it has been done for the preview build folder as example. Like this, you will keep your local configuration files in the future with new versions of the script. +The files `global-config.mk` contain configuration informations about paths to sources, executables and to the building destinations. It details all the variables which can be set but shouldn’t be modified, as it can receive new variables in the future needed for the script to work. Moreover is handled by git for new versions and any changes you make would be erased by new pull of the script. If you want to specify a dedicated value to any variable, you should copy its line definition to a new file inf the same folder, called `local-config.mk`. Like this, you will keep your local configuration files in the future with new versions of the script. Simply write either the absolute or the relative path from your Makefile script situation for any information needed. From 2fbc42f1015da09a2521c83620221c22b5e4aff9 Mon Sep 17 00:00:00 2001 From: yannk Date: Fri, 17 Dec 2021 23:14:16 +0100 Subject: [PATCH 10/10] Fixing typo - Close #2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 428b814..fdf7f10 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository use [Git LFS](https://git-lfs.github.com/). ### Configuration of the Makefile -The files `global-config.mk` contain configuration informations about paths to sources, executables and to the building destinations. It details all the variables which can be set but shouldn’t be modified, as it can receive new variables in the future needed for the script to work. Moreover is handled by git for new versions and any changes you make would be erased by new pull of the script. If you want to specify a dedicated value to any variable, you should copy its line definition to a new file inf the same folder, called `local-config.mk`. Like this, you will keep your local configuration files in the future with new versions of the script. +The file `global-config.mk` contain configuration informations about paths to sources, executables and to the building destinations. It details all the variables which can be set but shouldn’t be modified, as it can receive new variables in the future needed for the script to work. Moreover is handled by git for new versions and any changes you make would be erased by new pull of the script. If you want to specify a dedicated value to any variable, you should copy its line definition to a new file inf the same folder, called `local-config.mk`. Like this, you will keep your local configuration files in the future with new versions of the script. Simply write either the absolute or the relative path from your Makefile script situation for any information needed.