Skip to content

Commit

Permalink
Merge pull request #8 from neomonkeus/release/2.2.3
Browse files Browse the repository at this point in the history
Release/2.2.3
  • Loading branch information
neomonkeus committed Mar 6, 2014
2 parents 6feefde + 0a61e8b commit 74ed057
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>pyffi</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
19 changes: 13 additions & 6 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Main author

* Amorilia ([email protected])

Contributors
------------
Previous Developers
-------------------

* wz ([email protected])

Expand All @@ -15,10 +15,6 @@ Contributors

- extraction of DXT compressed embedded textures for the nif format

* seith ([email protected])

- logo design for the Windows installer

* tazpn ([email protected])

- mopp generator using the Havok SDK
Expand All @@ -32,10 +28,21 @@ Contributors

- EGM & TRI format xml

Contributors
------------

* PacificMorrowind ([email protected])

- some nif/kf modifying spells

* Ulrim/Arthmoor

- optimization kit

* seith ([email protected])

- logo design for the Windows installer

* MorCroft

- Patch for BSSTextureSet texture path substitution
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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)
============================

Expand Down
2 changes: 1 addition & 1 deletion pyffi/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.2
2.2.3
12 changes: 11 additions & 1 deletion pyffi/spells/nif/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
22 changes: 18 additions & 4 deletions pyffi/spells/nif/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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')
Expand Down

0 comments on commit 74ed057

Please sign in to comment.