Fix model texture dependency
This commit is contained in:
parent
6a51609b4f
commit
a3efb07742
3 changed files with 19 additions and 31 deletions
10
Makefile
10
Makefile
|
@ -36,13 +36,15 @@ plugin/Data/Scripts/%.pex: Source/Scripts/%.psc
|
||||||
"$^" \
|
"$^" \
|
||||||
"-f=$(SKYRIM_BASE)/Data/Source/Scripts/TESV_Papyrus_Flags.flg" \
|
"-f=$(SKYRIM_BASE)/Data/Source/Scripts/TESV_Papyrus_Flags.flg" \
|
||||||
"-i=$(SKYRIM_BASE)/Data/Source/Scripts;Source/Scripts" \
|
"-i=$(SKYRIM_BASE)/Data/Source/Scripts;Source/Scripts" \
|
||||||
"-o=$@" \
|
"-o=$@"
|
||||||
|
|
||||||
textures: $(textureFiles)
|
textures: $(textureFiles)
|
||||||
GIMP=$$(powershell -Command '(Get-Item "$(ProgramW6432)/GIMP*/bin/gimp-console*.exe").FullName')
|
|
||||||
"$$GIMP" -n -i --batch-interpreter python-fu-eval -b "import export_gimp_textures"
|
|
||||||
|
|
||||||
models: $(modelFiles)
|
plugin/Data/Textures/_EQ_ItemRoulette/%.dds: Source/Textures/_EQ_ItemRoulette/%.xcf
|
||||||
|
GIMP=$$(powershell -Command '(Get-Item "$(ProgramW6432)/GIMP*/bin/gimp-console*.exe").FullName')
|
||||||
|
"$$GIMP" -n -i --batch-interpreter python-fu-eval -b 'import export_gimp_textures ; export_gimp_textures.main("$<", "$@")'
|
||||||
|
|
||||||
|
models: $(modelFiles) textures
|
||||||
|
|
||||||
build/ChunkMerge/ChunkMerge.exe: build/chunkmerge.7z
|
build/ChunkMerge/ChunkMerge.exe: build/chunkmerge.7z
|
||||||
7z x -y "-obuild" "$<"
|
7z x -y "-obuild" "$<"
|
||||||
|
|
|
@ -1,30 +1,16 @@
|
||||||
from gimpfu import pdb
|
def main(xcf_path, dds_path):
|
||||||
import platform
|
from gimpfu import pdb
|
||||||
import sys
|
import platform
|
||||||
|
import sys
|
||||||
|
|
||||||
pdb.gimp_message("Started exporting textures.")
|
pdb.gimp_message("Started exporting textures.")
|
||||||
pdb.gimp_message(platform.python_version())
|
pdb.gimp_message(platform.python_version())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import glob
|
|
||||||
import os
|
import os
|
||||||
import pydoc
|
import pydoc
|
||||||
|
|
||||||
curdir = os.path.dirname(os.path.abspath(__file__))
|
dds_parent = os.path.dirname(dds_path)
|
||||||
pdb.gimp_message("Current directory: " + curdir)
|
|
||||||
plugin_data_dir = os.path.join(curdir, "plugin/Data")
|
|
||||||
pdb.gimp_message("Plugin directory: " + plugin_data_dir)
|
|
||||||
texture_src_dir = os.path.join(curdir, "Source/Textures/_EQ_ItemRoulette")
|
|
||||||
pdb.gimp_message("Texture Source directory: " + texture_src_dir)
|
|
||||||
texture_dest_dir = os.path.join(plugin_data_dir, "Textures/_EQ_ItemRoulette")
|
|
||||||
pdb.gimp_message("Texture Dest directory: " + texture_dest_dir)
|
|
||||||
|
|
||||||
# FIXME This won't recurse
|
|
||||||
xcf_paths = glob.glob(texture_src_dir + "/*.xcf")
|
|
||||||
for xcf_path in xcf_paths:
|
|
||||||
dest_xcf_path = os.path.join(texture_dest_dir, os.path.relpath(path=xcf_path, start=texture_src_dir))
|
|
||||||
dds_parent = os.path.dirname(dest_xcf_path)
|
|
||||||
dds_path = os.path.join(os.path.splitext(dest_xcf_path)[0] + '.dds')
|
|
||||||
pdb.gimp_message(xcf_path + " -> " + dds_path)
|
pdb.gimp_message(xcf_path + " -> " + dds_path)
|
||||||
try:
|
try:
|
||||||
os.makedirs(dds_parent)
|
os.makedirs(dds_parent)
|
||||||
|
@ -69,7 +55,7 @@ try:
|
||||||
# (3, 'alpha-test-threshold', 'Alpha test threshold value for which alpha test converage should be preserved')
|
# (3, 'alpha-test-threshold', 'Alpha test threshold value for which alpha test converage should be preserved')
|
||||||
)
|
)
|
||||||
pdb.gimp_image_delete(image)
|
pdb.gimp_image_delete(image)
|
||||||
except:
|
except:
|
||||||
pdb.gimp_message("An unhandled error occurred: " + str(sys.exc_info()[0]) + ": " + str(sys.exc_info()[1]))
|
pdb.gimp_message("An unhandled error occurred: " + str(sys.exc_info()[0]) + ": " + str(sys.exc_info()[1]))
|
||||||
|
|
||||||
pdb.gimp_quit(0)
|
pdb.gimp_quit(0)
|
Binary file not shown.
Loading…
Add table
Reference in a new issue