30 """This is the equivalent of SOP_HOMWave.py but uses numpy to speed it up.
33 1) In Houdini, choose File -> New Operator Type
34 2) Choose "Python Type"
35 3) Choose the network type as "Geometry Operator"
36 4) Paste this code in the "Code" tab of the type properties.
38 @see @ref HOM/SOP_HOMWave.py, @ref HOM/SOP_HOMWaveInlinecpp.py, @ref HOM/SOP_HOMWave.C, @ref SOP/SOP_CPPWave.C, @ref SOP/SOP_VEXWave.vfl
44 geo = hou.pwd().geometry()
45 positions = numpy.frombuffer(
46 geo.pointFloatAttribValuesAsString(
"P"), dtype=
"f4,f4,f4").
copy()
47 positions.dtype.names = (
"x",
"y",
"z")
49 positions[
"y"] = numpy.sin(
50 positions[
"x"] * 0.2 + positions[
"z"] * 0.3 + hou.frame() * 0.03)
51 geo.setPointFloatAttribValuesFromString(
"P", positions)