This is a continuation of this
Wrangle x Python book I tried it [1] http://qiita.com/it_ks/items/baba553ca587ed52a316
Last time it was on p.10. This time, I will work on Python example sentences from p.11 to p.15.
** Houdini Practical Handbook Wrangle x Python ** This is a book produced by the circle "Magic Distilled Water". http://majou.jp/archives/667/
I was wondering if you are interested here. https://www.toranoana.jp/mailorder/article/04/0030/38/99/040030389986.html If you look at it now, it's gone! If you have circle stock, you may be able to buy it at an event.
hmath.buildRotate
p.11 Rotation.
for point in geo.points():
pos = point.position()
mtx = hou.hmath.buildRotate(0,45,0)
pos = pos*mtx
point.setPosition(pos)
It will be like this It's rotated, oh oh oh
By the way, Make another Grid and use it as a template The original state is compared with the one after rotation.
find/add/set attribute
The attributes on p.14 are also
This doesn't happen in the screenshot
Suddenly the opening line
hou.pwd().geometry()
It was a taste that became.
evalParm
Get the value from the parameter using p.15, evalParm.
First you have to create the parameters.
From the action menu at the top right of the parameter panel 「Edit Parameter Interface...」
Such a UI will appear ↓
Select the data type in the left column and go to the right column. (Drag and drop is fine, or the arrow on the column partition is OK)
Change the parameter names as instructed in the book.
A slider will appear below the Python Code field.
If you move the slider, it will move up and down.
It's getting interesting, isn't it?
(Even if it is attached to it, there are abundant data types when adding parameters. It is reliable.)
Edit Parameter Interface window http://sidefx.jp/doc/ref/windows/edit_parameter_interface.html
Geometry > findPointAttrib http://sidefx.jp/doc/hom/hou/Geometry.html#findPointAttrib Geometry > addAttrib http://sidefx.jp/doc/hom/hou/Geometry.html#addAttrib
Point > setAttribValue http://sidefx.jp/doc/hom/hou/Point.html#setAttribValue
Recommended Posts