houdini表达式

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

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.

‘’单引号文本中的单引号不是大写的。可能有必要在有的时候字符串内使用这些字符,以防止一个变量被承认为一个变量。

TYPES OF DATA(数据类型)

There are four main types of data that exist within Houdini(在Houdini中存在有四个主要的数据类型):

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。很可能打破这种进一步下降为整数,不包含小数。一个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 strings 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.

字符串:字符串的数据不是数字,而是文字。一个数字并不表示为一个字符串中的数值,而是一个文本符号。你可以在双引号(“)或单引号(')中放入字符串。内双引号内的变量会被展开。单引号内的字符串是不会展开的。它可以利用字符串创建自定义的变量。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 o

f representin

g large numbers wit

h a minimal amount of digits, for example 3.2e-5 (equivalent to 0.000032).

指数符号是一个代表了最少量的数字的简洁方式,例如3.2e - 5(相当于0.000032)。

() 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.(环境变量:用于设定你的Houdini环境。)

$HIP This defaults to the directory containing the current Houdini file.(这个默认值的目录包含了当前的Houdini文件。)

$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(自定义变量取决于您工作的位置)

$HOME Your Home environment variable - specify in OS environment variables (你的home环境变量 - 指定运算符字符串的环境变量)

$ACTIVETAKE Contains the name of the current take(包含当前的名称)

$CH Current channel name(当前通道的名称)

$TEMP Where temporary (crash) files are saved - specify in OS environment

相关文档
最新文档