元编程参考文档

绘制

8 个节点

本页内容 8

合并笔画

函数

Strokes painted one set after another: the second set's over the first's, and its erasing strokes rubbing out what the first painted.

签名
合并笔画 -> Paint Strokes
    先画的: Paint Strokes
    后画的: Paint Strokes
PaintStrokes CombineStrokes(
    PaintStrokes first,
    PaintStrokes second)

参数

名称类型默认值说明
先画的Paint Strokes—The strokes painted first.
后画的Paint Strokes—The strokes painted over them.

返回

结果Paint Strokes
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理

镜像笔画

函数

The strokes and their mirror image, painted both: symmetrical painting. Texture strokes mirror across the texture's middle; surface strokes across the model's middle, for a model that is symmetrical.

签名
镜像笔画 -> Paint Strokes
    笔画: Paint Strokes
    镜像方向: Facing Direction
    网格: MaterialMesh
PaintStrokes MirrorStrokes(
    PaintStrokes strokes,
    FacingDirection axis = FacingDirection.Right,
    MaterialMesh mesh)

参数

名称类型默认值说明
笔画Paint Strokes—The strokes.
镜像方向Facing Direction右Which way to mirror: Left or Right mirrors across, Up or Down top to bottom, Front or Back front to back (surface strokes only).
网格MaterialMesh—The model surface strokes lie on, whose middle they mirror across; not needed for texture strokes.

返回

结果Paint Strokes
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理

绘制遮罩

函数

Turns strokes into a mask - how much is painted at each pixel - and the colour painted there, ready for a layer's mask and a blend. Strokes on a model's surface are painted through the model's texture layout, past each island's edge so seams do not show.

签名
绘制遮罩 -> (结果: Texture, 颜色: Texture)
    笔画: Paint Strokes
    尺寸: 整数
    网格: MaterialMesh
    印章: Texture
    平铺环绕: 真否
Texture PaintMask(
    PaintStrokes strokes,
    out Texture color,
    int size = 1024,
    MaterialMesh mesh,
    Texture stamp,
    bool wrap = true)

参数

名称类型默认值说明
笔画Paint Strokes—The strokes, first painted first.
尺寸整数1024The textures' width and height in pixels.
网格MaterialMesh—The model surface strokes lie on; needed only for those.
印章Texture—The picture stamp strokes lay when they carry none of their own - a brush's alpha.
平铺环绕真否TrueWhether texture strokes wrap across the edges, for a texture that tiles; off for a model's layout.

返回

结果Texture
颜色Texture
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理

放置贴花

函数

A picture placed on the texture as a decal: a logo, a label, a number, a stencil. A colour picture with transparency paints in its own colours; a greyscale one is how much to paint.

签名
放置贴花 -> Paint Strokes
    图片: Texture
    横向位置: 数字
    纵向位置: 数字
    大小: 数字
    旋转: 数字
    不透明度: 数字
PaintStrokes PlaceDecal(
    Texture picture,
    double x = 0.5,
    double y = 0.5,
    double size = 0.3,
    double rotation = 0,
    double opacity = 1)

参数

名称类型默认值说明
图片Texture—The decal.
横向位置数字0.5Where its centre is across, 0 to 1.
纵向位置数字0.5Where its centre is down, 0 to 1.
大小数字0.3Its longer side, as a share of the texture's width.
旋转数字0Its turn, in degrees.
不透明度数字1How strongly it paints, 0 to 1.

返回

结果Paint Strokes
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理

投射贴花

函数

A picture projected onto a model from one side, as a decal is pressed onto it: it lands where the model's surface is seen from that side, lies across it there, and wraps round as the surface bends - whatever the model's texture layout.

签名
投射贴花 -> Paint Strokes
    图片: Texture
    网格: MaterialMesh
    投射方向: Facing Direction
    横向位置: 数字
    纵向位置: 数字
    大小: 数字
    旋转: 数字
    不透明度: 数字
PaintStrokes ProjectDecal(
    Texture picture,
    MaterialMesh mesh,
    FacingDirection from = FacingDirection.Front,
    double x = 0.5,
    double y = 0.5,
    double size = 0.3,
    double rotation = 0,
    double opacity = 1)

参数

名称类型默认值说明
图片Texture—The decal.
网格MaterialMesh—The model, unwrapped.
投射方向Facing Direction前The side it is pressed on from.
横向位置数字0.5Where its centre is across the model as seen from that side, 0 (left) to 1 (right).
纵向位置数字0.5Where its centre is down the model as seen from that side, 0 (top) to 1 (bottom).
大小数字0.3Its longer side, as a share of the model's largest dimension.
旋转数字0Its turn, in degrees.
不透明度数字1How strongly it paints, 0 to 1.

返回

结果Paint Strokes
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理

随机笔画

函数

Strokes that wander across the texture: scratches, brush marks, cracks drawn in paint, chalk scribbles - each a random walk that curls as it goes and thins at its ends, wrapping across the edges so the texture still tiles.

签名
随机笔画 -> Paint Strokes
    数量: 整数
    长度: 数字
    半径: 数字
    半径变化: 数字
    弯曲: 数字
    方向: 数字
    方向变化: 数字
    硬度: 数字
    不透明度: 数字
    颜色: 可选颜色
    两端变细: 数字
    擦除: 真否
    种子: 整数
PaintStrokes RandomStrokes(
    int count = 24,
    double length = 0.25,
    double radius = 0.006,
    double radiusVariation = 0.5,
    double curl = 0.3,
    double direction = 0,
    double directionVariation = 1,
    double hardness = 0.7,
    double opacity = 1,
    ColorElement? color,
    double taper = 0.8,
    bool erase = false,
    int seed = 0)

参数

名称类型默认值说明
数量整数24How many strokes.
长度数字0.25How long each is, as a share of the texture's width.
半径数字0.006Half a stroke's width, as a share of the texture's width.
半径变化数字0.5How much strokes' widths differ, 0 to 1.
弯曲数字0.3How much a stroke turns as it goes: 0 is straight, 1 wanders.
方向数字0The way strokes run, in degrees: 0 is across, 90 is down.
方向变化数字1How far a stroke's way may differ from that, 0 (all alike) to 1 (any way).
硬度数字0.7How hard their edges are, 0 to 1.
不透明度数字1How strongly they paint, 0 to 1; each stroke varies under it.
颜色可选颜色—What they paint in the colour output; white when not given.
两端变细数字0.8How much strokes thin toward their ends, 0 to 1.
擦除真否FalseRub out what earlier strokes painted instead: scratches through paint.
种子整数0Which strokes.

返回

结果Paint Strokes
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理

笔画

函数

A brush stroke through points in texture coordinates, 0 to 1 across: a line where a mask should be, a scratch placed by hand, a path to follow.

签名
笔画 -> Paint Strokes
    点: 数字数组
    半径: 数字
    硬度: 数字
    不透明度: 数字
    颜色: 可选颜色
    擦除: 真否
    两端变细: 数字
PaintStrokes Stroke(
    double[] points,
    double radius = 0.03,
    double hardness = 0.6,
    double opacity = 1,
    ColorElement? color,
    bool erase = false,
    double taper = 0)

参数

名称类型默认值说明
点数字数组—The path as pairs of numbers, u then v: 0.1, 0.5, 0.9, 0.5 is a line across the middle.
半径数字0.03Half the brush's width, as a share of the texture's width.
硬度数字0.6How much of the brush is solid before it fades, 0 to 1.
不透明度数字1How strongly the stroke paints, 0 to 1.
颜色可选颜色—What the stroke paints in the colour output; white when not given.
擦除真否FalseRub out what earlier strokes painted instead.
两端变细数字0How much the stroke thins toward its ends, 0 to 1, as a pen lifted at both.

返回

结果Paint Strokes
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理

笔画数量

函数

How many strokes there are.

签名
笔画数量(笔画: Paint Strokes) -> 整数
int StrokeCount(PaintStrokes strokes)

参数

名称类型默认值说明
笔画Paint Strokes—The strokes.

返回

结果整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
绘制
所属包
图像处理