Page MenuHome

Python: Cleanup Noise Module
ClosedPublic

Authored by Andrew Hale (trumanblending) on Aug 9 2018, 2:39 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Updated noise module revision

  • Noise: add back random vector
Campbell Barton (campbellbarton) requested changes to this revision.EditedAug 22 2018, 9:09 AM

Generally LGTM, besides move to PyC_FlagSet to avoid large conditional blocks for each string/int lookup.

source/blender/python/mathutils/mathutils_noise.c
213–242

This can use PyC_FlagSet for simple string/int mappings.

258–278

See above.

This revision now requires changes to proceed.Aug 22 2018, 9:09 AM
  • Add back random_vector
  • Correct random_vector docs
  • Correct random_vector args parsing string
  • Use PyC_FlagSets instead of custom functions
  • Add default value macros and checks
  • Fix keyword naming for voronoi
  • Fix docs: enumerator default value

Generally fine, minor change noted inline.

source/blender/python/mathutils/mathutils_noise.c
465

Would initialize to DEFAULT_NOISE_TYPE, then you dont need to do this later on.

555

Again here.

This revision is now accepted and ready to land.Aug 22 2018, 2:44 PM
source/blender/python/mathutils/mathutils_noise.c
208–234

These can be static

This revision was automatically updated to reflect the committed changes.