-
EXPRESSION
SYNTAX(
表达式语法
)
Here are some of the main syntax
elements which you will encounter again and again
when
using
expression
functions:
(
以下是主要的语法元素,你会一次又一次地遇到一些
使用表达式函数:
)
()
Brackets Brackets are used in order to list all
of the arguments that will
be contained
within a function. Whenever a function is used,
there
must be an open bracket and a
closed bracket. One of the easiest
mistakes to make when creating
expressions is to accidentally have
the
incorrect number of brackets.
()
括号
括号的使用是为了列举出所有的将要包含在函数中的参数。每当使用一个
函数,
必须有一个开放的括号和一个封闭的括号。
最简单的错误
之一就是当
你创建表达式时,意外的有多个数目不正确的括号。
“”
Quotation When a string
must be used as an argument inside a function, it
must
be
contained
within
quotation
marks.
This
can
include
parameter names, and
file paths.
“”引号
当一个字符串必须被用作在一个函数的参数,它必须包含在引号内。这
可以包括参数名,和文件路径。
`` Back Ticks
When an HScript expression has been entered into a
string type
parameter,
it
must
be
enclosed
in
backticks
in
order
to
be
evaluated
as
an
expression.
For
example,
if
you
are
attempting to
use an expression function inside a
file path, you will need to
include the
backticks on either end of your function.
``
返回标记
当
HScript
表达式中已经输入了一个字
符串类型的参数,
它必须包含在
返回标记内,以便作为一个表达
式的计算。例如,如果您正试图使用在
一个文件路径表达式功能,您需要在您的函数结束
包含一个返回标记。
‘’
Apostrophe Text
inside
apostrophes
are
not
expanded.
It
may
be
necessary
at
times
to
use
these
characters
inside
strings
to
prevent
a
variable
from being
recognized as a variable.
‘’单引号
文本中的
单引号不是大写的。
可能有必要在
有的时候字符串内使用这些<
/p>
字符,以防止一个变量被承认为一个变量。
TYPES OF
DATA(
数据类型
)
There
are four main types of data that exist within Houd
ini
(在
Houdini
中存在有<
/p>
四个主要的数据类型)
:
Float:
Floating point numbers are single
numerical values which may
contain
decimals
i.e.: 15.5. It is possible to
break this down
further
into
integers,
which
do
not
contain
decimals.
An
Alpha
attribute/channel
would be a good example of a float value.
浮点
浮点数单一
数值可能包含小数,
即:
15.5
。<
/p>
很可能打破这种进一步下降为整
数,不包含小数。一个
Alpha
属性
/
通道是
一个很好的
float
值的例子。
Vectors:
Three
floating
point
values.
These
values
can
be
used
to
represent
positions,
directions,
normals or colors (RGB or HSV).
矢量
(向量)
:
三浮点
值。
这些值可以用来代表的位置,
方向,
法线或颜色
(
RGB
或
HSV
)
。
Strings:
Strings
are
data
which
are
not
numbers,
but
text.
A
number
is
not
represented
as
numerical
in
a
string
but
as
a
text
symbol.
You
can
enclose
stri
ngs
in
double
quotes
(“)
or
apostrophes
(‘).
Variables
inside
double-quotes
are
expanded.
Strings
inside
apostrophes
are
not
expanded.
It
is
possible
to
create
custom
variables which make use of strings.
字符串:
字符串的数
据不是数字,
而是文字。
一个数字并不表示为一个字符串中的<
/p>
数值,而是一个文本符号。你可以在双引号(“)或单引号(
'<
/p>
)中放入
字符串。内双引号内的变量会被展开。单引号内的字符串
是不会展开的。
它可以利用字符串创建自定义的变量。
Matrix:
Sixteen
floating
point
values
representing
a
3D
transformation
matrix.
矩阵:
16
个浮点值描述了一个三维变化矩阵。
SIMPLE MATH
+ -
Add, subtract
(加,减)
* / % Multiply,
Divide
(乘,除)
%
Modulo returns the remainder after division has
occured i.e. 4%3=1,
4%20=4
百分号返回除法发生之后的剩余,即
i.e. 4%3=1,
4%20=4
^ Raise to exponent
i.e. 3^3=9
(提高指数,例如
3^3=9
)
e
Exponential notation is a concise way of
representing large numbers
with a
minimal amount of digits, for example 3.2e-5
(equivalent to
0.000032).
指数符号是一个代表了最少量的数字的简洁方式,例如
3.2e
- 5
(相当于
0.000032
)<
/p>
。
()
Grouping
(群集)
COMPARISONS
< > Less
than, greater than
(小于,大于)
== inquire as to whether it is
equal
(
询问它是否等于
)
!= not equal
to
(不等于)
||
or
(或)
&&
and
(和)
GLOBAL
VARIABLES
(全局变量)
Data
that
is
accessible
in
all
contexts.
There
are
different
types
of
global
variables, which have various purposes.
在任何情况下可访问的数据。不同的全局变量用于不同的目的。
Environment Variables: Useful for
setting up your Houdini environment.
(
p>
环境变
量:用于设定你的
Houdini<
/p>
环境。
)
$$HIP This defaults to the
directory containing the current Houdini file.
(
这个默认值的目录包含了当前的
Houdin
i
文件。
)
$$HIPNAME The name of the current .hip
file
(当前
.hip
文件的名称)
$$WEDGE The current
wedge information
(当前的
wedge
信息)
$$OS
Operator String -
contains the current
OP’s name(
运算符字符串
-
包
含运算符字符串的名称
)
$$JOB A custom variable that
determines where your jobs are located
(
自定
义变量取决于您工作的位置
)
p>
-
-
-
-
-
-
-
-
-
上一篇:HTML Latin-1 字符实体
下一篇:英国文学选读知识总结