目录
查看
使用
PackedGeometry
Intrinsic attribute 内在属性是已经被计算的值(从几何体派生出来的),可像属性一样访问;
查看
- ginfo -I,打印所有内在属性;
- geometry spreadsheet,查看内在属性,默认不显示;
- inspect tool,监视工具
注,不同类型的几何体,显示的内在属性也不同;
使用
- 在Hscript内,属性名前需添加前缀 intrinsic: ;
- 在VEX内,属性名前无需添加前缀;
- 在Python内,可使用 hou.Geometry.intrinsicNames/.intrinsicValue()/.intrinsicValueDict() ;
- 在组内,可使用如 @intrinsic:indexorder<100 ;
//Hscript prim('.', 0, intrinsic:bounds, 1)
//VEX,不可使用@attribute读取内在属性 f[]@bounds = primintrinsic(0, 'bounds', 0); i@pointcount = detailintrinsic(0, 'pointcount');
typeid、typename
PackedGeometry
- primintrinsic()、setprimintrinsic();
- getpackedtransform()/setpackedtransform(),packedtransform();
注,setpackedtransform与packedtransform,相差pivot;
//prim层级,以packed自身的pivot旋转和缩放 matrix3 m = ident(); rotate(m, ch('ang'), chv('axis')); scale(m, ch('scale')); setprimintrinsic(0, 'transform', @primnum, m);
//prim层级,packed对象 vector pivot = primintrinsic(0, 'pivot', @primnum); matrix m = ident(); rotate(m, @Frame*0.1, normalize(sample_sphere_uniform(rand(@P)))); translate(m, pivot); translate(m, normalize(pivot)*ch('dist')); setpackedtransform(0, @primnum, m);
vector pivot = primintrinsic(0, 'pivot', @primnum); matrix m = ident(); translate(m, -pivot); rotate(m, @Frame*0.1, normalize(sample_sphere_uniform(rand(@P)))); translate(m, pivot); translate(m, normalize(pivot)*ch('dist')); packedtransform(0, @primnum, m);