Access the Noise Generator

How do you access the noise generator in 2.5+ it was easy in 2.49. I cant seem to find it in the new api, any help would greatly appreciated! Thanks!


import bpy


bpy.data.materials.new(name="new_mat")
matref = bpy.data.materials["new_mat"]

bpy.data.textures.new(name="mynoise", type='NOISE')
noiseref = bpy.data.textures["mynoise"]

matref.texture_slots.add() 
bpy.data.materials["new_mat"].texture_slots[0]
bpy.data.materials["new_mat"].texture_slots[0].texture = noiseref 

print(bpy.data.materials["new_mat"].texture_slots[0])

Ok got it, but how do you access the data, return a list or a single value of (x,y,z) vTurbulance, i’m tring to script a per vertice noise value to an object.

Maybe i should script a dynamic vertex group, with a noise texture applied. Thanks!

how did you do it in 2.49? give some example code

This is an example from 2.49 api.
http://www.zoo-logique.org/3D.Blender/scripts_python/API/

time = Get(‘curtime’)
ob = Scene.GetCurrent().getCurrentCamera()
ps = (sltime, sltime, sl*time)

To add jitter only when the camera moves, use this next line instead

#ps = (slob.LocX, slob.LocY, slob.LocZ)
rv = Noise.vTurbulence(ps, 3, 0, Noise.NoiseTypes.NEWPERLIN) ## this is what i need
ob.dloc = (sp
rv[0], sprv[1], sprv[2]) ## rv[0] = x
ob.drot = (srrv[0], srrv[1], sr*rv[2])

That’s the data i’m looking for, then i can off set a vertice in the (x,y,z) axes with a scalar factor.

http://www.blender.org/documentation/blender_python_api_2_58_release/search.html?q=Noise

You could add an f-curve, then a noise modifier then you could just poll that f-curve at any time for a noise value.