前言
01 Attribute Basics
f@val = 1.553; // float
i@val = 100; // interger
s@sval = "abc"; // string
v@vval = set(3.0,6.3,1.4); // vector
f[]@aval = array(3.5,2.5,1.0,6.0); // float array
通过 Vex wrangle 可以在模型上添加自定义属性
特殊属性
@P = rand(@P);
P 表示位置,通过上面的设置可以随机模型的顶点

@Cd = rand(@P);
Cd 表示颜色,可以实现顶点色

https://www.sidefx.com/docs/houdini/vex/snippets

可以使用
@ptnum
@primnum
获取数据
@Frame
可以获取 Frame 数据
Detail 属性每次只运行一次
02 Group Basics
属性的冒号表示分组

通过 group 节点可以打组
houdini 可以通过打组将合并的模型中找到相应的分类
注: 这里也可以用 None 对不连续的 部分 进行拆分

03 Parameters Basics
Parameter Interface

打开
Edit Parameter Interface..
可以编辑 Houdini 节点的界面

通过这个方式可以构建一些常用的 GUI。
下拉菜单可以在 menu 标签也添加相应的对象。

可以通过 expression 引用通道的数值。

vex wrangle 可以通过
ch
的方法去获取其他节点 channel 的数据。
这样就可以实现各种参数的传入控制。
reference 路径更新

如果将引入路径写到 vex 代码里面,如果参数路径发生改变,vex 代码不会更新
但是如果通过 channel 的copy reference
功能的话,路径改变可以自动更新。
ramp parameters

输入 ramp 和 float,通过 float 值可以在 ramp 上滑动改变颜色。
parameter expression

https://www.sidefx.com/docs/houdini/network/expressions.html#globals
这里有 很多 Expression 可用的变量

这里可以拿到很多 节点 内置的变量值

也可以在文档里面找到可用的 local variable
https://www.sidefx.com/docs/houdini/expressions/index.html
这里也有很多
HScript
提供的 function
04 Variables and operations

vex 的变量语法与 C 语言相似

Vex 可以隐式转换和显示转换类型。

字符串转数值 atof atoi
数值转字符串 itoa (没有ftoa
函数)
使用 sprintf 可以处理复杂的字符串替换
Houdini vector 类型获取值,可以用 数组方式获取 也可以用 xyz 属性获取。