You are on page 1of 2

vector.

component, vectorcomponent
custom_variable, parameter
vector, vectofloat
-Use data from a node instead of a file
in varius place some nodes have a parameters which excepts a file rather then no
de for example in vex pointcloud or volumesamplefile
in these kind of parameters we can usually use this:
op:/path/to/node
insted of a file path for grab data from live nodes in the scene hierachy insted
of from a file
For example, the volumesamplefile VOP gets the value at a certain position in a
volume. It has a Geometry file parameter for a volume file name, but you could s
ample a volume in a SOP network instead of a file on disk using something like i
n value of the Geometry file parameter:
op:/geo1/volume1
or
op:`opfullpath("../../volume1")`
op:`opinputpath("..", 1)` => reference to inputs of current node insted of file
This works for (at least) the following common file types:
Geometry file: surface node (SOP)
Image file: compositing node (COP)
Channel data file: channel node (CHOP)
Relative op: references
The path after op: must be an absolute path (that is, starting from the root of
the scene hierarchy with /). However, you can work around this by converting a r
elative path to an absolute path using the opfullpath expression function inside
backticks:
op:`opfullpath('../../volume1')`
-return the full path of the node cennected to a given input
for pointcloudopen we can give a path of a node to file parameter insted of file
path :
op:`opinputpath("relative or absoult path", index of input)`
it can use in some vop nodes like volumesamplefile or pointcloudopen
another example for opinputpath:
point(opinputpath(".", 0), $P, "P", 0)
-quary variables, attributes
isvariable
ishvariable
haspoint
hasprim
haspointattrib
-check if a variable is exists or not
echo `isvariable("EXISTS")` -> return 1
echo `isvariable("NONEXISTS") ->return 0
ishvariable will check only the variables that are declared in houdini (show up
in Edit->Aliases and Variables window). isvariable is just a superset, it will c
heck in houdini or os onse.
For checking/remapping strings have a look at 'strmatch'.
----math
double cross product
-create flow vector for normals or velocity
exmp1 = create inintal volocity by create flow normal for following a mountain v

db :
volumegradinet.samplepos = p
vector up = <0,1,0>
vector cross1 = normalize(volumegradinet.samplepos) * up
vector cross2 = normalize(volumegradinet.samplepos) * cross1
N = cross2

You might also like