[Bf-python] Re: Proposal for Blender Python test suite
Willian Padovani Germano
wgermano at ig.com.br
Sun Aug 8 21:31:17 CEST 2004
Hi,
----- Original Message -----
From: <ChrisKeith at aol.com>
To: <bf-python at blender.org>
Sent: Sunday, August 08, 2004 2:59 PM
Subject: [Bf-python] Re: Proposal for Blender Python test suite
> I already tried just rounding, and I'd still end up with values displaying
> like this:
>
> 1.000000000001
An easy way that works here (and for the tests output) is using str:
>>> a = 2./3
>>> a
0.66666666666666663
>>> print a
0.666666666667
>>> round(a,3)
0.66700000000000004
>>> print round(a,3)
0.667
>>> s = str(round(a,3))
>>> s
'0.667'
>>> print s
0.667
So we can use str(round(value, PRECISION)) for output to files.
> Do you want to start with the ones that are already there?
> I had to change a couple of them, but they are in that ZIP file.
No, it's not much different from what is there, but we can do better, keep
them smaller using 'exec' where possible. They serve as early reference,
though.
> >>With an extra script in the dir we can automate the loading (and
packing of
> >> all test files inside a .blend), by using Blender.Text.Load() commands
to
> >> load all tests at once. The script can link all the tests as scene
Redraw
> >> scriptlinks for example, then redraw to run the tests (that will write
the
> >> output files) and leave Blender.
>
> Is there an advantage to doing this over using the -P switch?
That script would be called with -P. And it should also be able to create a
.blend file with the tests loaded. The tests can work in many ways if we
take care: individually loaded as texts, with -P for each one, with -P for
one that loads the others, with a way to save them all in a single .blend.
--
Willian, wgermano at ig.com.br
More information about the Bf-python
mailing list