Doctests for the opt_delzeroscale spell
=======================================

NifToaster check
----------------

>>> from pyffi.formats.nif import NifFormat
>>> import pyffi.spells.nif.optimize
>>> from pyffi.spells import Toaster
>>> data = NifFormat.Data()
>>> stream = open("tests/nif/test_opt_zeroscale.nif", "rb")
>>> data.read(stream)
>>> # check zero scale
>>> for child in data.roots[0].children[0].children:
...     print(child.name, child.scale)
b'Tri Cone 0' 1.0
b'Tri Cone 1' 0.0
b'Tri Cone 2' 0.0
b'Tri Cone 3' 1.0
>>> # run the spell that fixes this
>>> spell = pyffi.spells.nif.optimize.SpellDelZeroScale(data=data)
>>> spell.recurse()
pyffi.toaster:INFO:--- opt_delzeroscale ---
pyffi.toaster:INFO:  ~~~ NiNode [Scene Root] ~~~
pyffi.toaster:INFO:    ~~~ NiNode [Cone] ~~~
pyffi.toaster:INFO:      ~~~ NiTriShape [Tri Cone 0] ~~~
pyffi.toaster:INFO:      ~~~ NiTriShape [Tri Cone 1] ~~~
pyffi.toaster:INFO:        removing zero scaled branch
pyffi.toaster:INFO:      ~~~ NiTriShape [Tri Cone 2] ~~~
pyffi.toaster:INFO:        removing zero scaled branch
pyffi.toaster:INFO:      ~~~ NiTriShape [Tri Cone 3] ~~~
>>> # check that zero scale nodes are gone
>>> for child in data.roots[0].children[0].children:
...     if child:
...         print(child.name, child.scale)
b'Tri Cone 0' 1.0
b'Tri Cone 3' 1.0
