转:Houdini的一些常用变量

本文详细介绍了Houdini中各种表达式变量的作用及用法,包括播放条变量、全局变量、通道变量等,为用户提供了丰富的参数控制手段。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文地址:http://blog.sina.com.cn/s/blog_6856498b0100m55n.html

= Global expression variables =

== Playbar variables ==

$FPS:
Playback speed in frames per second (as set with the Playbar controls).

$FSTART:
Frame number of the first frame of animation (as set with the Playbar controls). NFRAMES(thenumberofframesintheanimation)= FEND - FSTART+1.Seealso RFSTART below.

$FEND:
Frame number of the last frame of animation (as set with the Playbar controls).
See also $RFEND below.

$F:
The current frame, (as set with the Playbar controls). This is a very useful variable, especially for rendered picture filename numbering.

$FF:
Floating point frame number.

$NFRAMES:
Number of frames in the animation. NFRAMES= FEND (the last frame of animation) - $FSTART (the first frame of animation) + 1.

$RFSTART:
Frame number of the first frame shown in the playbar. The playbar can show a subset of the total number of frames, allowing you to focus on a particular section of a long animation. RFSTARTand RFEND control the subset of frames shown in the playbar.

$RFEND:
Frame number of the last frame shown in the playbar.

$T:
Current time in seconds. Equals ( F1)/ FPS

$TLENGTH:
Total length of animation in seconds.

$TSTART:
Start time of animation in seconds.

$TEND:
End time of animation in seconds.

== Global Variables ==

$ACTIVETAKE:
Contains the name of the current take.

$E:
The mathematical constant e (2.71828…).

$HFS:
The directory where Houdini is installed.

$HH:
$HFS/houdini.

$HIP:
Job directory. This defaults to the directory where you started Houdini. You can set it through the Textport.

$HIPNAME:
The name of the current .hip file.

$HOME:
Your home directory.

$JOB:
A custom variable that determines where your jobs are located.

$PI:
The mathematical constant pi (3.1415926…). You can use it to calculate the lengths of arcs. 2*$PI*r (radius of circle) equals the circumference. Also, pi = 180藲 expressed in radians.

$WEDGE:
Contains the wedge name when using the Wedge ROP.

== Channel Variables ==

$OS:
Operator String. Contains the current OP’s name.

$CH:
Current channel name.

$IV:
In value (value at start of segment).

$OV:
Out value.

$IM:
In slope

$OM:
Out slope

$IA:
In acceleration

$OA:
Out acceleration

$LT:
Local time - not including stretch or offset

$IT:
Start time of segment

$OT:
End time of segment

$LIT:
Local start time of segment

$LOT:
Local end time of segment

$PREV_IT:
Previous segment start time

$NEXT_OT:
Next segment end time

== COP-specific variables ==

$CSTART:
Start frame of the current COP.

$CEND:
End frame of the current COP.

$CFRAMES:
Number of frames for the current COP.

$CFRAMES_IN:
Number of frames available from the first input COP.

$CINC:
Gets the global frame increment value.

$W:
Current image width.

$H:
Current image height

== Output Driver Specific Variables ==

$N:
Current frame being rendered.

$NRENDER:
Number of frames being rendered.

= Standard Variables =

NOTE:
Variable names ending with 2 refer to the geometry from the second input, if applicable. For example, PT2 is the current point number from the second input.

TX, TY, TZ:
Point position.

TW:
See WEIGHT.

CEX, CEY, CEZ:
The centroid of the geometry.

XMIN, XMAX:
The X extents of the bounding box of the geometry.

YMIN, YMAX:
The Y extents of the bounding box of the geometry.

ZMIN, ZMAX:
The Z extents of the bounding box of the geometry

SIZEX, SIZEY, SIZEZ:
The size of the bounding box.

BBX, BBY, BBZ:
The point鈥檚 relative position in the bounding box.

WEIGHT:
Point spline weight.

PT:
The point number of the currently processed point.

PR, NPR:
Primitive number & total number of primitives.

VTX, NVTX:
Vertex number & total number of vertices.

NPT:
The total number of points in the template geometry.

LIFE:
Percent of total life used (from 0 to 1).

NX, NY, NZ:
Normal vector.

MAPU, MAPV, MAPW:
Point or vertex texture coordinates.

VX, VY, VZ:
Velocity direction.

MAT:
Material name specification.

CR, CG, CB:
Diffuse point or vertex color.

CA:
Point or vertex alpha value.

COMX, COMY, COMZ:
Center of mass.

LOD:
Level of detail.

RESTX, RESTY, RESTZ:
The rest position.

DIST:
Distance from particle to last collision.

MASS:
Point mass.

DRAG:
Point drag.

TENSION:
Spring tension of an edge.

SPRINGK:
Elasticity of a point.

PSCALE:
Particle Scale.

AGE:
The seconds a particle in the template has been alive.

CREASE:
Point or vertex crease weight value.

AREA:
The surface area of the primitive (created by the [Measure SOP|Node:sop/measure]).

PERIMETER:
The perimeter of the primitive (created by the [Measure SOP|Node:sop/measure]).

ID:
The ID of the particle in the input.

UPX, UPY, UPZ:
The vector pointed in the up direction.

WIDTH:
The width of the curve. Used by [mantra|Node:out/ifd] for rendering curves & polywire for generating trees.

SEGS:
Number of segments to divide a curve up into in Polywire (created by [L-systems|Node:sop/lsystem]).

DIV:
Number of divisions to build the circle swept with Polywire (created by [L-systems|Node:sop/lsystem]).

LAGE:
The age of the point in the [L-system|Node:sop/lsystem] computation.

ARC:
Arc length distance from root in the [L-systems|Node:sop/lsystem].

GEN:
Generation in the [L-systems|Node:sop/lsystem].

CURLAYER:
Stores the currently processed layer for texture/materials (set by the [Layer SOP|Node:sop/layer]).

MAXLAYER:
The number of layers that are considered active for display.

Houdini 是一款强大的三维动画和特效制作软件,它以其高度灵活的节点式工作流和强大的程序化建模能力而著称。对于初学者来说,Houdini 的界面和操作逻辑与其他三维软件(如 Maya 或 Cinema 4D)有较大差异,因此入门时可能会感到不适应。建议从官方帮助文档开始学习,该文档详细介绍了 Houdini 的基本操作、界面布局和常用工具,是系统化学习的重要资源[^1]。 ### 基础学习路径 1. **熟悉界面与操作逻辑** Houdini 的界面分为多个视图窗口,包括网络编辑器(Network Editor)、参数面板(Parameters)、视图窗口(Viewport)等。理解节点连接机制是掌握 Houdini 的关键,每个操作都通过节点链来实现,这种非破坏性的流程允许随时修改和调整。 2. **学习基础建模与动画** 初学者可以从基础几何体的创建、变形器的使用、材质分配和简单动画入手。Houdini 提供了 SOP(Surface Operator)层级用于处理几何体,掌握如 `Box`、`Sphere`、`Transform`、`Noise` 等常见节点是必要的[^1]。 3. **理解环境变量与插件配置** 在实际项目中,常常需要使用第三方插件或自定义库。例如,将 `FeELib` 添加到 Houdini 的 `$HOUDINI_PATH` 环境变量中,可以让 Houdini 在启动时自动加载这些库文件,从而扩展其功能[^2]。 4. **掌握基础粒子与动力学系统** Houdini 的动力学系统(DOP)是其核心优势之一。学习如何创建刚体、柔体、流体等物理模拟,是进入特效制作领域的基础。DOP 网络通过节点连接实现复杂的物理交互,理解其工作原理对后续进阶学习至关重要。 5. **地形生成与环境设计** 对于需要创建自然地形的用户,Houdini 提供了比 World Machine 更为灵活和可定制的解决方案。虽然初学者可能更适合从 World Machine 入手,但一旦掌握了 Houdini 的程序化建模技巧,就可以实现高度复杂的地形效果[^3]。 ### 推荐学习资源 - **官方帮助文档**:作为最权威的学习资料,涵盖了从基础到高级的各类操作。 - **在线教程与社区**:如 SideFX 官方教程、YouTube 上的 Houdini 教学频道、以及各类技术博客。 - **开源项目**:例如 `FeELib-for-Houdini` 提供了实用的节点库,适合在实际项目中练习和应用[^2]。 --- ```python # 示例:在 Houdini 中创建一个简单的立方体并移动它 import hou # 创建一个新的几何体节点 geo = hou.node("/obj").createNode("geo", "my_cube") # 添加一个立方体 box = geo.createNode("box", "my_box") # 设置立方体大小 box.parm("sizex").set(2) box.parm("sizey").set(2) box.parm("sizez").set(2) # 添加一个变换节点 transform = geo.createNode("xform", "move_cube") transform.parm("tx").set(5) # 连接节点 transform.setInput(0, box) # 布局节点 geo.layoutChildren() ``` ---
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值