[Bf-python] Noise Module Proposal

Andrew Hale trumanblending at gmail.com
Fri Nov 25 07:20:51 CET 2011


On Fri, Nov 25, 2011 at 3:12 PM, Campbell Barton <ideasman42 at gmail.com>wrote:

> On Fri, Nov 25, 2011 at 2:56 PM, Campbell Barton <ideasman42 at gmail.com>
> wrote:
> > On Fri, Nov 25, 2011 at 2:42 PM, Andrew Hale <trumanblending at gmail.com>
> wrote:
> >> Hello,
> >>
> >> It seems that the current noise module has become rather outdated with
> >> respect to the current API. As such I propose to update it to bring it
> into
> >> line with rest of the API. The changes I propose are listed below;
> >>
> >> Move the module so it becomes a submodule of mathutils, i.e.
> >> mathutils.noise. This will make the module more visible and more useful
> as
> >> we can return mathutils types like Vectors.
> >> Change input arguments from (x, y, z) tuples to Vector objects.
> >> Change function outputs from (x, y, z) tuples to Vector objects.
> >> Fix noise.random_unit_vector(), current the y and z components are
> >> correlated (bad).
> >> Add noise.random_vector() to produce a random vector (non-unit length)
> >> Add other functions (Feel free to reply with ideas)
> >>
> >> I have discussed this with ideasman_42 on IRC and he seemed in
> agreement. If
> >> you have any thoughts please reply.
> >>
> >> Thanks,
> >>
> >> Andrew
> >
> > +1,
> >
> > - we could keep the 'noise' module available to be imported directly
> > for a release but deprecate it (even print some warning on importing).
> >
> > - probably nice to keep 'noise' being available from the driver
> > namespace even when its moved to mathutils.noise
> >
>
> Thinking about this further, noise is available from driver namespace,
> which makes doing things like...
>
> noise.somefunc(Vector((a,b,c)))
> ... cumbersome.
>
> So noise funcs could use the C utility function mathutils_array_parse(...)
>
> This way noise.somefunc(a, b, c) can be supported too.
>
> --
> - Campbell
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>

Ok, will now use mathutils_array_parse(...) so that tuples can be parsed
(as is currently the case), however, Vector objects will always be returned
from functions that produce vectors.

Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20111125/18e4a849/attachment.html>


More information about the Bf-python mailing list