For now, each textureset goes to a folder specified by the json file, to group them by style, but it would be convenient to have each textureset in its subfolder in the category. It can be based upon its textureset name.
yannk (3e885528) at 14 Feb 23:04
Merge branch 'main' of ssh://git.khaganat.net:3543/yannk/textures-f...
... and 1 more commit
yannk (3dcb2651) at 14 Feb 21:18
Adding a subfolder based upon Textureset name for export destination
For now, each textureset goes to a folder specified by the json file, to group them by style, but it would be convenient to have each textureset in its subfolder in the category. It can be based upon its textureset name.
The script should be able to rely only in packed presets contained in each sbs file and no longer on external files
xmlstarlet
seems to be more easy to use for selecting outputs : http://xmlstar.sourceforge.net/
xmlstarlet sel -t -m '//graph' -i 'not(boolean(attributes/hideInLibrary))' -v 'sbspresets/sbspreset/label/@v' -n source/sbs/plant_bush_aa.sbs
gives us the name of presets for the graph to be rendered (the other ones should be unchecked to have XML hideInLibrary value defined to 1)
xmlstarlet sel -t -m '//graph' -i 'not(boolean(attributes/hideInLibrary))' -v 'identifier/@v' -n source/sbs/plant_bush_aa.sbs
gives us the name of the graph which has to be rendered (the other ones should be unchecked to have XML hideInLibrary value defined to 1)
Replacement with xml_grep : xml_grep comes with perl's module XML::Twig
In makefile
, the call to sbsmutator
is via GETPRESET
variable in line 62 :
$(GETPRESET) --input $< | grep PRESET | sed -r 's/PRESET "(.*)"/\1/g'
The same result can be done via xml_grep
:
xml_grep --root package/content/graph/sbspresets/sbspreset/label --nowrap --nodate $< | sed -r 's/<label v="//g' | sed -r 's/"\/>/ /g'
Another call to sbsmutator
is via GETOUTPUT
variable in line 66 :
$(GETOUTPUT) and the follwong lines
could be replaced with something like:
xml_grep --root package/content/graph/graphOutputs/graphoutput/identifier --nowrap --nodate $< | sed -r 's/<identifier v="//g' | sed -r 's/"\/>/ /g'
It should just output the content of the first graph with hideInLibrary
which is not at 1
If so, the variable can be deleted from config files
As sbsmutator
is no longer in Indie subs of Substance packages, it should be better to get rid of it.
yannk (3c804ef7) at 30 Dec 14:24
Correcting misleading variable for deleting obsolete files
yannk (ad6d86f8) at 30 Dec 10:36
Deleting useless echoing debug informations
yannk (868813e4) at 30 Dec 10:17
For now, the script manages only Square textures, it should be able to handle non-square too, ie : 512x1024
The Makefile line rendering the png is the following :
$(SBSRENDER) render $@ --use-preset $$preset --output-name {inputGraphUrl}\_$$preset\_{outputNodeName} --set-value \$$outputsize@10,10# --output-path $(PNG1024_DIR); \
It should be able to retrieve first the format (from material_list.json
?) and render properly.
The Makefile_subformats
should be checked to generate properly the lower resolutions.
Closes #5
yannk (e6046518) at 30 Dec 10:17
Merge branch '5-add-non-square-textures-handling' into 'main'
... and 3 more commits
Closes #5
yannk (868813e4) at 30 Dec 10:17
Adding information about format parameter in json file
yannk (2d2a8b61) at 30 Dec 10:14
Adding the size format to be specified by json file when rendering ...
yannk (35d964f3) at 30 Dec 10:13
Adding 2 more test files to help testing
yannk (910db356) at 30 Dec 09:35
For now, the export recipe copies all the png files from the origin folder to all of the target locations