VEX compiler pragmas 编译器编译指示
The VEX compiler (vcc) supports pragmas for automatically building UI dialog scripts. These pragmas are typically ignored unless the -u option is specified on the vcc command line. The pragmas let you specify help, hints for how to represent the parameter, organization, and other information.
VEX编译器(vcc)支持用于自动构建UI对话脚本的pragmas。除非在vcc命令行上指定-u选项,否则通常会忽略这些pragmas。pragmas允许您指定帮助、提示如何表示参数、组织和其他信息。
Pragmas can be specified in one of two ways: As a #pragma
preprocessor directive, or as a _Pragma
VEX statement. The second form allows for bundling up multiple pragmas in a single macro.
Pragmas可以通过以下两种方式指定:#pragma预处理器指令,或者_Pragma VEX语句。第二种形式允许在一个宏中绑定多个pragmas。
The following preprocessor form: 以下预处理器表格:
#pragma label parm "Parameter Label"
is functionally equivalent to this VEX statement: 在功能上等价于VEX语句:
_Pragma("label parm \"Parameter Label\"");
Note that the pragma arguments are enclosed in quotes, with the original set of quotes escaped.
注意pragma参数被括在引号中,原始的一组引号被转义。
#pragma c++rawstring
#pragma c++rawstring 0|1
VEX supports C++ style raw strings. The c++rawstring
pragma can be used to disable or re-enable raw string support. For example:
VEX支持c++风格的原始字符串。c++rawstring pragma可用于禁用或重新启用原始字符串支持。例如:
string a = R"(Hello world\n)"; string b = "Hello world\\n"; #pragma c++rawstrings 0 // Disable C++ style raw string support string b = R"(This will generate an error!)"; #pragma c++rawstrings 1 // Re-enable C++ style raw string support
#pragma bindhandle 编译指示bindhandle
#pragma bindhandle channel_name h_name h_label h_index h_settings
Binds handles to specific parameters by default (users can override bindings).
默认情况下,将句柄绑定到特定的参数(用户可以覆盖绑定)。
channel_name
The name of the channel in the VEX operator to bind to the handle.
要绑定到句柄的VEX操作符中的通道的名称。
h_name
Handle name. This is one of the pre-defined Houdini handles (for example ladder
). You can use the omls HScript command for a full list of available handles.
omls 列出操作符类型的可用句柄。omls [-t obj|sop|pop|cop2] [handle]
处理的名字。这是一个预定义的Houdini handles(例如 ladder
)。您可以使用 omls HScript命令获得可用句柄的完整列表。
h_label
A brief description of the handle. handle的简单描述。
h_index
Many handles (for example xform) have multiple parameters associated with them. This allows you to choose which handle parameter gets bound to the VEX parameter.
许多句柄(例如xform)都有多个与之关联的参数。这允许您选择将哪个句柄参数绑定到VEX参数。
h_settings
An optional handle-specific string that can be used to set some default behavior for the handle.
一个可选的特定于句柄的字符串,可用于为句柄设置一些默认行为。
#pragma bindhandle offset1 xform "Translate" tx "invisible(1)" #pragma bindhandle offset2 xform "Translate" ty #pragma bindhandle offset3 xform "Translate" tz sop translate(vector offset=0) { P += offset; }
#pragma bindhandlereserved
#pragma bindhandlereserved reserved_channel_name h_name h_label h_index h_settings
Each scripted operator type has a number of parameters that are added to every operator of that type (regardless of the contents of the dialog script file). To bind a handle to one of these parameters, you must use the bindhandlereserved pragma. This pragma takes exactly the same arguments as the bindhandle pragma. The only exception is that the channel name argument must specify the name of a reserved parameter.
每个脚本操作符类型都有许多参数,这些参数被添加到该类型的每个操作符中(无论对话脚本文件的内容如何)。要将句柄绑定到这些参数之一,必须使用bindhandlereserved pragma。这个pragma接受与bindhandle pragma完全相同的参数。唯一的例外是通道名称参数必须指定保留参数的名称。
#pragma bindselector
#pragma bindselector [parm_name] sel_type sel_name sel_prompt sel_mask allow_dragginggroup_type_parm asterisk_sel_all [input_index input_required]
When an operator is created interactively in Houdini, the user can be prompted for the data to work on. These prompts are handled by selectors. Selectors can be defined on a per-OP basis, or a per-parameter basis.
当在Houdini中交互式地创建操作符时,可以提示用户输入要处理的数据。这些提示由选择器处理。可以根据每个操作或每个参数定义选择器。
For per-OP selectors, the bindselector pragma expects 7 arguments. For per-parameter selectors, it expects 10 arguments.
对于每个操作选择器,bindselector pragma需要7个参数。对于每个参数选择器,它需要10个参数。
parm_name
The VEX parameter to bind the selector to (for per-parameter selectors).
将选择器绑定到(对于每个参数选择器)的VEX参数。
sel_type
The entity to select. Use the omsls HScript command to print a list of possible values.
要选择的实体。使用omsls HScript命令打印可能的值列表。
sel_name
A brief description of the selector.
sel_prompt
the prompt presented to the user to select geometry.选择器的简要描述。
sel_mask
a pattern which allows selection of specific primitive types. The list of possible primitive types are:
允许选择特定原始类型的模式。可能的基本类型列表如下:
all
all primitive types 所有的原始类型
face
Polygons, NURBs or Bezier curves.
surface
Mesh, NURBs or Bezier surfaces Mesh,NURBs或Bezier曲线。
quadric
Primitive circles, spheres or tubes. 原始的圆、球或管。
poly
Polygons 多边形
nurbscurve
NURBS curves NURBS曲线
bezcurve
Bezier curves Bezier 曲线
mesh
Meshes
nurbs
NURBS surfaces NURBS曲面
bezier
Bezier surfaces 贝塞尔曲线的表面
circle
Primitive circles 原始的圈子
sphere
Primitive spheres 原始的球体
tube
Primitive tubes 原始的管
meta
Metaballs
particle
Particle systems 粒子系统
The primitive types can be combined in standard Houdini grouping mechanisms. For example:
基本类型可以在标准的Houdini分组机制中组合。例如:
-
all,^p*
: select all primitive types except polygons and particles. 选择除多边形和粒子外的所有基本类型。 -
face,surface
: select face and surface primitives. 选择face和surface的 primitives。 -
*,^quad*,^meta
: Select any primitive but quadrics or metaballs. 选择除quadrics或metaballs之外的任何 primitive 。
allow_dragging
If set to 1, the selection can be modified without forcing the user to click to complete the selection.
如果设置为1,则可以修改选择,而无需强制用户单击鼠标右键完成选择。
This lets the user select and modify in one step (dragging with the mouse finishes selection and passes the mouse movements to the operator handles).
这允许用户在一个步骤中进行选择和修改(用鼠标拖动完成选择并将鼠标移动传递给操作符句柄)。
group_type_parm
The name of a parameter which indicates the geometry type the selection group will have. Typically this value will name a parameter with a menu for choosing "Points", "Primitives", or "Guess from group". See the OMbindings file for the Blast SOP.
参数的名称,该参数指示选择组将具有的几何类型。通常,该值将使用菜单为参数命名,用于选择“Points”、“Primitives”或“Guess from group”。有关Blast SOP,请参阅OMbindings文件。
asterisk_sel_all
If set to 1, the selector needs to set the selection string to "*" to indicate all geometry was selected. If 0, the selector assumes an empty group parameter means all geometry was selected.
如果设置为1,选择器需要将选择字符串设置为“*”,以表示选中的所有几何图形。如果为0,则选择器假设一个空组参数表示选中了所有几何图形。
input_index
For per-parameter selectors. When the user selects geometry, the selector must connect the output from the selected operator to the input of this operator. This parameter specifies the index of the input number where the operator should be connected. Use -1 if the selector needs to connect multiple input operators into this operator.
per-parameter选择器。当用户选择几何体时,选择器必须将所选操作符的输出连接到该操作符的输入。此参数指定应连接操作符的输入号的索引。如果选择器需要将多个输入操作符连接到此操作符,则使用-1。
input_required
For per-parameter selectors. Set to 1 if the user must select geometry for this input.
per-parameter选择器。如果用户必须为此输入选择几何体,则将其设置为1。
#pragma bindselector prim