All intrinsic Attributes houdini v20


Detail intrinsic attributes:
bounds
detailattributes
edgegroups
globalattributes
globaltokens
memoryusage
metaexpr_code
metaexpr_string
pointattributes
pointcount
pointgroups
precision
primitiveattributes
primitivecount
primitivegroups
primitivetokens
vertexattributes
vertexcount
vertexgroups
All primitive intrinsic attributes:
abcanimation
abcdetail
abcfaceset
abcfilename
abcfilenames
abcframe
abcfullvisibility
abcobjectpath
abcpoint
abcpointcount
abcprimitive
abcsourcepath
abctypename
abcusetransform
abcusevisibility
abcvertex
abcvisibility
activevoxelcount
activevoxeldimensions
agentchannelnames
agentchannelvalues
agentclipcatalog
agentclipcatalogfilenames
agentcliplayerids
agentcliplayermodes
agentcliplayerparents
agentcliplayerweights
agentclipnames
agentcliptimes
agentcliptransformgroups
agentclipweights
agentcollisionlayer
agentcollisionlayers
agentcurrentlayer
agentcurrentlayers
agenthascustomchannelvalues
agenthascustomtransforms
agentlayers
agentlocaltransforms
agentmetadata
agentrigparents
agentshapelibrary
agenttransformgroups
agenttransformnames
agentworldtransforms
arclength
background
basis
bounds
closed
connectivity
dataid
expandedvertexmap
expandfilename
expandframe
facecounts
filename
filenames
fragmentattribute
fragmentname
geometryid
index
indexorder
knots
measuredarea
measuredperimeter
measuredvolume
memoryusage
metakernel
metaweight
nu
nv
order
packedbounds
packedfulltransform
packedlocaltransform
packedprimitivename
packedrenderbounds
packedtypelabel
packedtypename
part_blurtime
part_motionblur
part_size
part_type
part_virtual
pivot
pointinstancetransform
primitivetokens
rational
rowcol
sequencelen
squad_xyexp
squad_zexp
taper
taperx
tapery
transform
treatasfolder
tubetaper
typeid
typename
uknots
unexpandedfilename
uorder
usdAltFileName
usdFileName
usdFrame
usdIndex
usdLocalToWorldTransform
usdPrimPath
usdSrcPrimPath
usdType
usdViewportPurpose
uwrap
vdb_class
vdb_creator
vdb_is_local_space
vdb_is_saved_as_half_float
vdb_value_type
vdb_vector_type
vertexcount
viewportlod
vknots
volumeavgvalue
volumebordertype
volumebordervalue
volumecompressiontol
volumemaxvalue
volumeminvalue
volumetypeid
volumevisualdensity
volumevisualiso
volumevisuallod
volumevisualmode
vorder
voxeldata
voxelresolution
voxelsize
vwrap
wrap

Houdini VEX インデックス変数 グローバル変数

@elemnum
現行エレメントの番号。

@numelem
現行ジオメトリ/リスト内のエレメントの総数。

@ptnum
現行ポイントのポイント番号。

@primnum
現行プリミティブのプリミティブ番号。
@vtxnum
現行頂点の頂点番号。スニペットで頂点をループさせる時に使用します。 ポイントでループさせた場合、これは、そのポイントに接続されている頂点です。頂点が存在しなかった場合は-1です。 そのポイントが2つ以上の頂点に接続されている場合、どちらかの頂点が任意で返されます。 プリミティブでループさせた場合、これは、そのプリミティブの0番目の頂点です。

@numpt
現行ジオメトリ内のポイントの総数。

@numprim
現行ジオメトリ内のプリミティブの総数。
現行プリミティブ以外ならnprimitives()

@vtxnum
線形頂点番号

この頂点が属するプリミティブのプリミティブ番号は@primnumです。 任意の線形頂点番号が属するプリミティブ番号を取得するには、vertexprimを使用します。 線形頂点番号をその頂点が属するプリミティブ内の頂点インデックスに変換するには、vertexprimindexを使用します。 頂点をループさせる時、現行プリミティブ内の頂点の総数は@numvtxです。 任意のプリミティブ上の頂点の総数を取得するには、そのプリミティブ番号を使ってprimvertexcountをコールします。

例えば、ポリカーブの頂点のVertexアトリビュートにカーブ沿いに比例した値を設定したいのであれば、以下のコードを書きます:

# 線形頂点番号を取得して、それをプリミティブインデックスに変換します。
int vtx = vertexprimindex(0, @vtxnum)

# 頂点番号を最後のインデックスで除算することで、
# ポリカーブ長に沿った0.0から1.0までの範囲の値をアトリビュートに設定します。
f@prop = vtx / (float(@numvtx) - 1)

@numvtx
現行プリミティブ内の頂点の数。

グローバル変数へのアクセス

@Time
Floatの時間($T)

@Frame
Floatのフレーム($FF)

@SimTime
Floatのシミュレーション時間($ST)で、DOPコンテキストにのみ存在します。

@SimFrame
Floatのシミュレーションフレーム($SF)で、DOPコンテキストにのみ存在します。

@TimeInc
Floatのタイムステップ(1/$FPS)

ヘルプページ
https://www.sidefx.com/ja/docs/houdini/vex/snippets



Houdini 一番近い場所を探してラインでつなぐ


attribwrangle1内コード

vector targ_pos = minpos(1,@P);
v@minpos_v = targ_pos-@P;

int pid = addpoint(0, targ_pos);
addprim(0,”polyline”, @ptnum, pid);

addprimについて
int addprim(int geohandle, string type, int pt0, int pt1)
int addprim(int geohandle, string type, int pt0, int pt1, int pt2, int pt3)
int addprim(int geohandle, string type, int points[])

types:: “poly”, “polyline”,……

minposを使ったSample