Skip to content

Commit 74ed057

Browse files
committed
Merge pull request #8 from neomonkeus/release/2.2.3
Release/2.2.3
2 parents 6feefde + 0a61e8b commit 74ed057

File tree

7 files changed

+64
-14
lines changed

7 files changed

+64
-14
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[submodule "pyffi/formats/nif/nifxml"]
22
path = pyffi/formats/nif/nifxml
3-
url = git://niftools.git.sourceforge.net/gitroot/niftools/nifxml
3+
url = git://github.com/niftools/nifxml.git
44
[submodule "pyffi/formats/kfm/kfmxml"]
55
path = pyffi/formats/kfm/kfmxml
6-
url = git://niftools.git.sourceforge.net/gitroot/niftools/kfmxml
6+
url = git://github.com/niftools/kfmxml.git
77
[submodule "external"]
88
path = external
99
url = git://github.com/amorilia/pyffi-external.git

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>pyffi</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>

AUTHORS.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Main author
33

44
* Amorilia (amorilia@users.sourceforge.net)
55

6-
Contributors
7-
------------
6+
Previous Developers
7+
-------------------
88

99
* wz (wz_@users.sourceforge.net)
1010

@@ -15,10 +15,6 @@ Contributors
1515

1616
- extraction of DXT compressed embedded textures for the nif format
1717

18-
* seith (seith@users.sourceforge.net)
19-
20-
- logo design for the Windows installer
21-
2218
* tazpn (tazpn@users.sourceforge.net)
2319

2420
- mopp generator using the Havok SDK
@@ -32,10 +28,21 @@ Contributors
3228

3329
- EGM & TRI format xml
3430

31+
Contributors
32+
------------
33+
3534
* PacificMorrowind (pacmorrowind@sourceforge.net)
3635

3736
- some nif/kf modifying spells
3837

3938
* Ulrim/Arthmoor
4039

4140
- optimization kit
41+
42+
* seith (seith@users.sourceforge.net)
43+
44+
- logo design for the Windows installer
45+
46+
* MorCroft
47+
48+
- Patch for BSSTextureSet texture path substitution

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Release 2.2.3 (Mar 17, 2014)
2+
============================
3+
4+
* Update spell texture_path_substitution for BSTextureSet blocks (fix contributed by MorCroft)
5+
6+
* Updated to latest nif.xml, submodules moved to github.
7+
8+
19
Release 2.2.2 (Nov 17, 2012)
210
============================
311

pyffi/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.2
1+
2.2.3

pyffi/spells/nif/dump.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ def branchinspect(self, branch):
157157
# stick to main tree nodes, and material and texture properties
158158
return isinstance(branch, (NifFormat.NiAVObject,
159159
NifFormat.NiTexturingProperty,
160-
NifFormat.NiMaterialProperty))
160+
NifFormat.NiMaterialProperty,
161+
NifFormat.BSLightingShaderProperty,
162+
NifFormat.BSShaderTextureSet))
161163

162164
def branchentry(self, branch):
163165
if isinstance(branch, NifFormat.NiTexturingProperty):
@@ -189,6 +191,14 @@ def branchentry(self, branch):
189191
self.toaster.msg('alpha %f' % branch.alpha)
190192
# stop recursion
191193
return False
194+
elif isinstance(branch, NifFormat.BSShaderTextureSet):
195+
textures = [path.decode() for path in branch.textures if path.decode() != '']
196+
if len(textures) > 0:
197+
for n, tex in enumerate (textures):
198+
self.toaster.msg('%i: %s' % (n, tex))
199+
else:
200+
self.toaster.msg('BSShaderTextureSet has no Textures')
201+
return False
192202
else:
193203
# keep looking for blocks of interest
194204
return True

pyffi/spells/nif/fix.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,20 +233,34 @@ def substitute(self, old_path):
233233
return old_path
234234

235235
def datainspect(self):
236-
# only run the spell if there are NiSourceTexture blocks
237-
return self.inspectblocktype(NifFormat.NiSourceTexture)
236+
# only run the spell if contains
237+
# NiSourceTexture or BSShaderTextureSet blocks
238+
if self.inspectblocktype(NifFormat.BSShaderTextureSet):
239+
return True
240+
elif self.inspectblocktype(NifFormat.NiSourceTexture):
241+
return True
242+
else:
243+
return False
244+
238245

239246
def branchinspect(self, branch):
240247
# only inspect the NiAVObject branch, texturing properties and source
241248
# textures
242249
return isinstance(branch, (NifFormat.NiAVObject,
243250
NifFormat.NiTexturingProperty,
244-
NifFormat.NiSourceTexture))
251+
NifFormat.NiSourceTexture,
252+
NifFormat.BSLightingShaderProperty,
253+
NifFormat.BSShaderTextureSet))
245254

246255
def branchentry(self, branch):
247256
if isinstance(branch, NifFormat.NiSourceTexture):
248257
branch.file_name = self.substitute(branch.file_name)
249258
return False
259+
260+
elif isinstance(branch, NifFormat.BSShaderTextureSet):
261+
for n, tex in enumerate (branch.textures):
262+
branch.textures[n] = self.substitute(tex)
263+
return False
250264
else:
251265
return True
252266

@@ -261,7 +275,7 @@ class SpellFixTexturePath(SpellParseTexturePath):
261275
"""
262276

263277
SPELLNAME = "fix_texturepath"
264-
278+
265279
def substitute(self, old_path):
266280
new_path = old_path
267281
new_path = new_path.replace(b'\n', b'\\n')

0 commit comments

Comments
 (0)