diff --git a/.gitmodules b/.gitmodules index 4d2c27e18..9f6af6baa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "pyffi/formats/nif/nifxml"] path = pyffi/formats/nif/nifxml - url = git://niftools.git.sourceforge.net/gitroot/niftools/nifxml + url = git://github.com/niftools/nifxml.git [submodule "pyffi/formats/kfm/kfmxml"] path = pyffi/formats/kfm/kfmxml - url = git://niftools.git.sourceforge.net/gitroot/niftools/kfmxml + url = git://github.com/niftools/kfmxml.git [submodule "external"] path = external url = git://github.com/amorilia/pyffi-external.git diff --git a/.project b/.project new file mode 100644 index 000000000..1e1faad8b --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + pyffi + + + + + + + + diff --git a/AUTHORS.rst b/AUTHORS.rst index f97d38b8d..847932b25 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -3,8 +3,8 @@ Main author * Amorilia (amorilia@users.sourceforge.net) -Contributors ------------- +Previous Developers +------------------- * wz (wz_@users.sourceforge.net) @@ -15,10 +15,6 @@ Contributors - extraction of DXT compressed embedded textures for the nif format -* seith (seith@users.sourceforge.net) - - - logo design for the Windows installer - * tazpn (tazpn@users.sourceforge.net) - mopp generator using the Havok SDK @@ -32,6 +28,9 @@ Contributors - EGM & TRI format xml +Contributors +------------ + * PacificMorrowind (pacmorrowind@sourceforge.net) - some nif/kf modifying spells @@ -39,3 +38,11 @@ Contributors * Ulrim/Arthmoor - optimization kit + +* seith (seith@users.sourceforge.net) + + - logo design for the Windows installer + +* MorCroft + + - Patch for BSSTextureSet texture path substitution \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index acede4330..02d794cbb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,11 @@ +Release 2.2.3 (Mar 17, 2014) +============================ + +* Update spell texture_path_substitution for BSTextureSet blocks (fix contributed by MorCroft) + +* Updated to latest nif.xml, submodules moved to github. + + Release 2.2.2 (Nov 17, 2012) ============================ diff --git a/pyffi/VERSION b/pyffi/VERSION index b1b25a5ff..585940699 100644 --- a/pyffi/VERSION +++ b/pyffi/VERSION @@ -1 +1 @@ -2.2.2 +2.2.3 diff --git a/pyffi/spells/nif/dump.py b/pyffi/spells/nif/dump.py index 29bd7cb7f..f24461318 100644 --- a/pyffi/spells/nif/dump.py +++ b/pyffi/spells/nif/dump.py @@ -157,7 +157,9 @@ def branchinspect(self, branch): # stick to main tree nodes, and material and texture properties return isinstance(branch, (NifFormat.NiAVObject, NifFormat.NiTexturingProperty, - NifFormat.NiMaterialProperty)) + NifFormat.NiMaterialProperty, + NifFormat.BSLightingShaderProperty, + NifFormat.BSShaderTextureSet)) def branchentry(self, branch): if isinstance(branch, NifFormat.NiTexturingProperty): @@ -189,6 +191,14 @@ def branchentry(self, branch): self.toaster.msg('alpha %f' % branch.alpha) # stop recursion return False + elif isinstance(branch, NifFormat.BSShaderTextureSet): + textures = [path.decode() for path in branch.textures if path.decode() != ''] + if len(textures) > 0: + for n, tex in enumerate (textures): + self.toaster.msg('%i: %s' % (n, tex)) + else: + self.toaster.msg('BSShaderTextureSet has no Textures') + return False else: # keep looking for blocks of interest return True diff --git a/pyffi/spells/nif/fix.py b/pyffi/spells/nif/fix.py index 5c38526ef..7e28c7be0 100644 --- a/pyffi/spells/nif/fix.py +++ b/pyffi/spells/nif/fix.py @@ -233,20 +233,34 @@ def substitute(self, old_path): return old_path def datainspect(self): - # only run the spell if there are NiSourceTexture blocks - return self.inspectblocktype(NifFormat.NiSourceTexture) + # only run the spell if contains + # NiSourceTexture or BSShaderTextureSet blocks + if self.inspectblocktype(NifFormat.BSShaderTextureSet): + return True + elif self.inspectblocktype(NifFormat.NiSourceTexture): + return True + else: + return False + def branchinspect(self, branch): # only inspect the NiAVObject branch, texturing properties and source # textures return isinstance(branch, (NifFormat.NiAVObject, NifFormat.NiTexturingProperty, - NifFormat.NiSourceTexture)) + NifFormat.NiSourceTexture, + NifFormat.BSLightingShaderProperty, + NifFormat.BSShaderTextureSet)) def branchentry(self, branch): if isinstance(branch, NifFormat.NiSourceTexture): branch.file_name = self.substitute(branch.file_name) return False + + elif isinstance(branch, NifFormat.BSShaderTextureSet): + for n, tex in enumerate (branch.textures): + branch.textures[n] = self.substitute(tex) + return False else: return True @@ -261,7 +275,7 @@ class SpellFixTexturePath(SpellParseTexturePath): """ SPELLNAME = "fix_texturepath" - + def substitute(self, old_path): new_path = old_path new_path = new_path.replace(b'\n', b'\\n')