QQ截图20210604013036.png

简介

【CopyStamp】一个节点集成了,【Copy and Transform】和 【Copy to Point】的功能 (但由于占资源,所有在Houdini18后不在常用,学它的目的是为了看老教程)

【CopyStamp】的的核心是Stamp选项 注:要使用【CopyStamp】的Stamp功能,必须**勾选Stamp Input**

Stamp

Stamp功能是【CopyStamp】最重要的特点,可以在上游节点制作一个模板节点传入Stamp

我用一个案例来演示一下工作原理 QQ截图20210605003226.png

用等效的思维方式 把【$CY】【rand( )】看成节点

【color】节点会变成类似专用模板传入进去【CopyStamp节点】 【CopyStamp节点】的CY属性传入【rand节点】生成范围在(0,1)之间的的随机数Variable

Variable值传入【Color节点】作为rab颜色的值, CY属性传入【Color节点】作为染色对象, 最后输出然后后的对象。 (从原本的节点上看,有点类似把节点的数据逆向传递了) QQ截图20210605013633.png

L stamp( )函数

函数原型:stamp(,,) 参数说明:


名称:路径 数据类型:string 说明:获得值的路径(copyStamp的路径)

: 名称:值 数据类型:string 说明:从路径中获得的值(Variable)

: 名称:默认值 数据类型:float 说明:当无法正常从路径获得值时,所使用的默认值 QQ截图20210605002319.png

本地变量【locals】

在【CopyStamp】中含有本地变量Locals 这些本地变量无法被传递出去,只能在【CopyStamp】自身内使用,相当于面向对象编程中的私有成员

如果【CopyStamp】想把这些本地变量传递出去, 就需要通过【CopyStamp】的Stamp选项将这些本地变量暴露出来,并在上游节点通过Stamp函数接收 QQ截图20210605003226.png

L- 本地变量

Copy-specific variables.

CY

The number of the copy currently being generated. Starts at 0.

NCY

The total number of copies that will be created (the value of the Number of copies parameter).

PT

The point number of the Template being copied onto. If there is a template group, this will be the index into the group, not the actual point number. Use TPT to always get the actual point number.

NPT

The total number of points in the template geometry.

TPT

The actual point number of the currently processed template point, independent of any template groups. See PT above.

Variables for point attributes on the template.

AGE

The seconds a particle in the template has been alive.

LIFE

The ratio of the age of a particle to its expected life This number is between 0 (when born) and 1 (when about to die).

ID

The ID of the particle in the input.

Variables for the input geometry/template geometry (if there is a template input).

CEX, CEY, CEZ

The centroid of the geometry.

XMIN, XMAX

The X extents of the bounding box of the geometry.

YMIN, YMAX

The Y extents of the bounding box of the geometry.

ZMIN, ZMAX

The Z extents of the bounding box of the geometry.

SIZEX, SIZEY, SIZEZ

The size of the bounding box.

BBX, BBY, BBZ

The point’s relative position in the bounding box.