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 bpy.data.materials["new_mat"].texture_slots.texture = noiseref print(bpy.data.materials["new_mat"].texture_slots)
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.
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 = (sprv, sprv, sprv) ## rv = x
ob.drot = (srrv, srrv, sr*rv)
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.
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.