Kanzi Studio 命令参考¶
在这里,您可以找到 Kanzi Studio 命令的参考,这些命令可以通过从命令行界面运行脚本来执行。请参阅 自动化 Kanzi Studio 任务。
基本编辑¶
AddToResourceDictionary¶
添加到资源字典中
语法¶
AddToResourceDictionary resourceId resource resourceDictionaryHost
参数¶
|
资源 ID。 |
|
您添加到资源字典中的资源。 |
|
将资源添加到其资源字典的节点。 |
示例¶
# Add the My Mesh mesh to the resource dictionary of the Screen node
# and set the resource ID of My Mesh to My Mesh ID.
AddToResourceDictionary "My Mesh ID" "/Mesh Data/My Mesh" "/Screens/Screen/RootPage/Viewport 2D/Scene"
CreateBindingItem¶
创建绑定。
语法¶
CreateBindingItem parent bindingMode pushTarget targetPropertyTypeName attribute code
参数¶
|
您添加绑定的节点或渲染通道。 |
|
绑定模式。对于单向绑定,使用 ONE_WAY。对于到源绑定,使用 TO_SOURCE。 |
|
在到源绑定中的目标。对于单向绑定,使用 NULL。 |
|
您绑定的属性。 |
|
您绑定的属性字段。要绑定整个属性,请使用 WHOLE_PROPERTY。 |
|
绑定表达式。 |
示例¶
# Add to the My Button node a binding that sets the Layout Width of that node
# to 300 pixels less than the width of its parent node, but always between
# 400 and 1200 pixels.
# To improve readability, this example splits the binding expression into two lines.
# Enclose between triple backticks a binding expression that spans multiple lines.
CreateBindingItem "/Screens/Screen/RootPage/My Button" ONE_WAY NULL Node.Width WHOLE_PROPERTY ```parentWidth = {@../Node.ActualWidth}
clamp(400, 1200, parentWidth - 300)```
ExposePrefabProperty¶
将属性公开到预设的根。这使您能够在预设的每个实例中自定义该属性。
当您公开一个属性时,Kanzi Studio:
从该属性创建自定义属性。
将该自定义属性添加到预设件,并在该预设件的每个实例中,将该自定义属性按照常用属性显示。
在此项目中创建 ##Template 绑定到预设根中的自定义属性。
语法¶
ExposePrefabProperty source propertyType
参数¶
|
您公开其属性的预设项目。 |
|
您公开的属性。 |
示例¶
# In the Prefabs create a Button 2D prefab named My Button.
CreateButton2D "/Prefabs" "My Button" true
# In the My Button prefab create an Image node named Image.
CreateImage2D "/Prefabs/My Button/My Button" Image true
# In the Image node expose the Image2D.Image property to the root of the My Button prefab.
# Let Kanzi Studio automatically generate a name for the exposed custom property.
ExposePrefabProperty "/Prefabs/My Button/My Button/Image" Image2D.Image
语法¶
ExposePrefabProperty source propertyType propertyName
参数¶
|
您公开其属性的预设项目。 |
|
您公开的属性。 |
|
公开自定义属性的名称。 |
示例¶
# In the Prefabs create a Button 2D prefab named My Button.
CreateButton2D "/Prefabs" "My Button" true
# In the My Button prefab create an Image node named Image.
CreateImage2D "/Prefabs/My Button/My Button" Image true
# In the Image node expose the Image2D.Image property to the root of the My Button prefab
# and name the exposed custom property MyButton.Icon.
ExposePrefabProperty "/Prefabs/My Button/My Button/Image" Image2D.Image MyButton.Icon
高级编辑¶
AddProperty¶
向项目添加属性。
语法¶
AddProperty propertyCollection propertyName valueAsString
参数¶
|
您添加属性的节点或资源。 |
|
您添加的属性。 |
|
(可选)属性的值。 |
示例¶
# In the RootPage node add the Description property.
AddProperty "/Screens/Screen/RootPage" Description
# In the RootPage > Button 2D node add the Background Brush property and set it to the DefaultBackground brush.
AddProperty "/Screens/Screen/RootPage/Button 2D" Node2D.BackgroundBrush "/Brushes/DefaultBackground"
AddPropertyNamespaceToPropertyTypes¶
将所有属性类型移动到当前项目属性命名空间。
语法¶
AddPropertyNamespaceToPropertyTypes
示例¶
# Add the project property namespace to all property types in the project.
AddPropertyNamespaceToPropertyTypes
BakeTransformation¶
根据节点的当前变换转换模型顶点缓冲区中的顶点,并将变换设置为单位变换。
语法¶
BakeTransformation node
参数¶
|
您想将其变换烘焙到顶点数据的节点。 |
示例¶
# Bake the Layout Transformation of the RootPage > Viewport 2D > Scene > Model node
# into the vertex data of the mesh that the node uses.
BakeTransformation "/Screens/Screen/RootPage/Viewport 2D/Scene/Model"
CenterMesh¶
将网格的顶点居中,使边界框的中心移动到原点。
语法¶
CenterMesh meshes
参数¶
|
您想要居中其顶点的网格数据资源。 |
示例¶
# Center the vertices of the CarBody mesh so that the center of the bounding box moves to origo.
CenterMesh "/Mesh Data/My Mesh"
FlipMesh¶
反转网格数据中的多边形和法线的方向。
语法¶
FlipMesh meshes flipPolygons flipNormals flipTextureCoordinateU flipTextureCoordinateV
参数¶
|
在网格数据中,您可以反转多边形、法线和纹理坐标方向的网格。用分号分隔网格列表。 |
|
是否在不修改法线的情况下反转网格数据中多边形的方向。 |
|
是否反转网格数据中的法线方向。 |
|
是否反转纹理的 U 坐标方向。 |
|
是否反转纹理的 V 坐标方向。 |
示例¶
# In the MyMesh mesh invert the direction of polygons and normals.
FlipMesh "/Mesh Data/My Mesh" true true false false
# In the MyMesh mesh invert the direction of the U coordinates of textures.
FlipMesh "/Mesh Data/My Mesh" false false true false
GenerateNormals¶
生成法线到网格的顶点缓冲区。
语法¶
GenerateNormals meshes smoothingAngle
参数¶
|
将网格与其顶点缓冲区分开,您可以生成法线。用分号分隔网格列表。 |
|
平滑角度(以度为单位)。 |
示例¶
# Generate normals to the vertex buffer of the My Mesh mesh with a smoothing angle of 60 degrees.
GenerateNormals "/Mesh Data/My Mesh" 60
GenerateTangents¶
生成网格顶点缓冲区的切线。
语法¶
GenerateTangents meshes mode
参数¶
|
将网格与生成切线的顶点缓冲区分开。用分号分隔网格列表。 |
|
切线生成模式:AUTOMATIC、MIKKTSPACE 或 LEGACY。 |
示例¶
# Generate tangents to the vertex buffer of the My Mesh mesh using the MikkTSpace tangent space algorithm.
GenerateTangents "/Mesh Data/My Mesh" MIKKTSPACE
语法¶
GenerateTangents meshes
参数¶
|
将网格与生成切线的顶点缓冲区分开。用分号分隔网格列表。 |
示例¶
# Generate tangents to the vertex buffer of the My Mesh mesh. Let Kanzi choose the tangent generation method based on the material.
GenerateTangents "/Mesh Data/My Mesh"
OptimizeAnimations¶
删除所有没有数据的 Animations Data 资源,并优化现有的 Animation Data 项目。
语法¶
OptimizeAnimations animations threshold
参数¶
|
从中删除冗余关键帧的 Animation Data 资源。用分号分隔动画列表。 |
|
用于关键帧移除的阈值。当删除一个关键帧使动画值的变化小于您通过此参数设置的值时,Kanzi Studio 将移除该关键帧。 |
示例¶
# Remove from the Animation Data resources Animation1 and Animation2
# all keyframes with a delta value smaller than 0.1.
OptimizeAnimations "/Animation Data/Animation1; /Animation Data/Animation2" 0.1
PrintDiagnosticReport¶
将无效的项目项及其错误消息打印到日志中。
语法¶
PrintDiagnosticReport
示例¶
# Print a list of invalid project items in the main project and loaded referenced projects
# to the Log window and %USERPROFILE%\AppData\Local\Temp\KanziStudioLogs\KanziStudio.log file.
PrintDiagnosticReport
RemovePropertyAndBindingFromItem¶
从项目中移除一个属性及其关联的本地绑定。
语法¶
RemovePropertyAndBindingFromItem host propertyName
参数¶
|
从中删除属性的项目和使用该属性的本地绑定。 |
|
您移除的属性。 |
示例¶
# In the RootPage node add a To Source binding that targets the Viewport 2D node.
CreateBindingItem "/Screens/Screen/RootPage" TO_SOURCE "/Screens/Screen/RootPage/Viewport 2D" Node2D.BackgroundBrush WHOLE_PROPERTY ```{@./Node2D.BackgroundBrush}```
# Remove both the property and the To Source binding.
RemovePropertyAndBindingFromItem "/Screens/Screen/RootPage" Node2D.BackgroundBrush
RemovePropertyFromItem¶
从项目中移除属性。
语法¶
RemovePropertyFromItem host propertyName
参数¶
|
您要从中移除属性的项。 |
|
您移除的属性。 |
示例¶
# In the RootPage node remove the Background Brush property.
RemovePropertyFromItem "/Screens/Screen/RootPage" Node2D.BackgroundBrush
# In the Library > Rendering > Render Pass Prefabs > Render to Texture Pass prefab root remove the Composition Target property.
RemovePropertyFromItem "/Render Pass Prefabs/Render to Texture Pass/Render to Texture Pass" CompositionTargetRenderPass.CompositionTarget
重命名着色器文件¶
将所有着色器文件重命名为相应的材质类型名称。
语法¶
RenameShaderFiles materialTypes
参数¶
|
您重命名其着色器文件的材质类型。用分号分隔材质类型列表。 |
示例¶
# Rename the shader files of My Material Type to My Material Type.frag.glsl and My Material Type.vert.glsl.
RenameShaderFiles "/Material Types/My Material Type"
setProperty¶
设置属性值。
语法¶
SetProperty parent propertyName propertyValueAsString
参数¶
|
您要设置其属性的节点或资源。 |
|
属性的名称。 |
|
要设置属性的值。 |
示例¶
# In the Screen node set the Metrics Type property to Absolute.
SetProperty "/Screens/Screen" Window.MetricsType Absolute
# In the Screen node set the Width property to 1200.
SetProperty "/Screens/Screen" WindowAbsoluteWidth 1200
# In the Screen node set the Height property to 720.
SetProperty "/Screens/Screen" WindowAbsoluteHeight 720
# In the RootPage node set the Background Brush property to the Color Brush brush.
SetProperty "/Screens/Screen/RootPage" Node2D.BackgroundBrush "/Brushes/Color Brush"
# In the Prefabs > My Stack Layout prefab set the Direction property to Y.
SetProperty "/Prefabs/My Stack Layout/My Stack Layout" StackLayoutConcept.Direction 1
# In the RootPage > My Button node add the Double-Click Enabled property and set it to enabled.
AddProperty "/Screens/Screen/RootPage/My Button" ClickConcept.DoubleClickEnabled true
# In the RootPage node add the Description property and set it to "This is the main page of the application.".
AddProperty "/Screens/Screen/RootPage" Description "This is the main page of the application."
# In the My Text Block node, set the Text property to
# SERVICE
# VEHICLE
# SOON
#
# Enclose between triple backticks a property value that spans multiple lines.
SetProperty "/Screens/Screen/RootPage/My Text Block" TextConcept.Text ```SERVICE
VEHICLE
SOON```
# In the My Text Block node, add the Text Horizontal Alignment property and set it to Center.
AddProperty "/Screens/Screen/RootPage/My Text Block" TextConcept.TextHorizontalAlignment 2
Destroyer¶
DeleteAnimationsWithLessThanTwoEffectiveKeyframes¶
删除所有仅有一个或没有有效关键帧的 Animation Data 项。具有相同值的重复关键帧被视为无效。
语法¶
DeleteAnimationsWithLessThanTwoEffectiveKeyframes animations
参数¶
|
如果动画只有一个或没有有效关键帧,则要删除这些动画。用分号分隔动画列表。 |
示例¶
# Delete the Animation1, Animation2, and Animation3 Animation Data items if they have less than two effective keyframes.
DeleteAnimationsWithLessThanTwoEffectiveKeyframes "/Animation Data/Animation1; /Animation Data/Animation2; /Animation Data/Animation3"
DeleteProjectItem¶
删除所选项目项
语法¶
DeleteProjectItem items
参数¶
|
要删除的节点和资源。用分号分隔项目列表。 |
示例¶
# Delete the RootPage > Viewport 2D node.
DeleteProjectItem "/Screens/Screen/RootPage/Viewport 2D"
# Delete the RootPage > Button 2D node and Button 2D prefab.
DeleteProjectItem "/Screens/Screen/RootPage/Button 2D; /Prefabs/Button 2D"
# Delete the Library > Materials and Textures > Textures > Default Texture texture.
DeleteProjectItem "/Textures/Default Texture"
# Delete the ColorTextureMaterial material and ColorTexture material type.
DeleteProjectItem "/Materials/ColorTextureMaterial; /Material Types/ColorTexture"
Conversions¶
ConvertBindingsToTemplateBindings¶
将源自模板根的绑定转换为模板绑定。
语法¶
ConvertBindingsToTemplateBindings targets
参数¶
|
将绑定转换为模板绑定的节点。 |
示例¶
# In the Prefabs > Toggle Button 2D > Stack Layout 2D and its child nodes convert
# to template bindings those bindings whose source is the template root.
ConvertBindingsToTemplateBindings "/Prefabs/Toggle Button 2D/Toggle Button 2D/Stack Layout 2D"
ConvertNode2DPrefabPlaceholderToPrefabView2D¶
将此 Prefab Placeholder 2D 节点转换为 Prefab View 2D 节点。
当您使用 Prefab View 节点实例化一个预设时,Kanzi 监控 Prefab Template 属性的值,并将该属性指向的预设作为 Prefab View 节点的子节点添加。这使您能够更改 Prefab View 实例化的预设,并在加载资源时保持应用程序的响应性。
语法¶
ConvertNode2DPrefabPlaceholderToPrefabView2D prefabPlaceholder
参数¶
|
您转换为 Prefab View 2D 节点的 Prefab Placeholder 2D 节点。 |
示例¶
# Convert the RootPage > Toggle Button 2D Prefab Placeholder 2D node to a Prefab View 2D node.
ConvertNode2DPrefabPlaceholderToPrefabView2D "/Screens/Screen/RootPage/Toggle Button 2D"
ConvertNode3DPrefabPlaceholderToPrefabView3D¶
将此 Prefab Placeholder 3D 节点转换为 Prefab View 3D 节点。
当您使用 Prefab View 节点实例化一个预设时,Kanzi 监控 Prefab Template 属性的值,并将该属性指向的预设作为 Prefab View 节点的子节点添加。这使您能够更改 Prefab View 实例化的预设,并在加载资源时保持应用程序的响应性。
语法¶
ConvertNode3DPrefabPlaceholderToPrefabView3D prefabPlaceholder
参数¶
|
您转换为 Prefab View 3D 节点的 Prefab Placeholder 3D 节点。 |
示例¶
# Convert the RootPage > Viewport 2D > Scene > Toggle Button 3D Prefab Placeholder 3D node to a Prefab View 3D node.
ConvertNode3DPrefabPlaceholderToPrefabView3D "/Screens/Screen/RootPage/Viewport 2D/Scene/Toggle Button 3D"
ConvertNodesToPrefabs¶
为选定的节点创建预设模板,并将这些节点替换为指向所创建模板的占位符。
语法¶
ConvertNodesToPrefabs nodes
参数¶
|
您转换为预设的节点。用分号分隔节点列表。 |
示例¶
# Convert to prefabs the RootPage > Button 2D and RootPage > Toggle Button 2D nodes.
ConvertNodesToPrefabs "/Screens/Screen/RootPage/Button 2D; /Screens/Screen/RootPage/Toggle Button 2D"
ConvertPageHostToPage¶
将此 Page Host 节点转换为 Page 节点。
使用 Page 节点在您的应用程序中创建用户界面的结构,并使用 Page Host 节点管理导航请求以及 Page Host 节点下 Page 节点之间的过渡。
语法¶
ConvertPageHostToPage pageHost
参数¶
|
您转换为 Page 节点的 Page Host 节点。 |
示例¶
# Convert the Page Host node RootPage > Settings to a Page node.
ConvertPageHostToPage "/Screens/Screen/RootPage/Settings"
ConvertPageToPageHost¶
将此 Page 节点转换为 Page Host 节点。
使用 Page Host 节点来管理 Page Host 节点下的页面节点之间的导航请求和变换。
语法¶
ConvertPageToPageHost page
参数¶
|
您转换为 Page Host 节点的 Page 节点。 |
示例¶
# Convert the Page node RootPage > Car to a Page Host node.
ConvertPageToPageHost "/Screens/Screen/RootPage/Car"
ConvertProjectReferenceItemToKzbReferenceItem¶
将此 Project Reference 转换为 Kzb Reference。
语法¶
ConvertProjectReferenceItemToKzbReferenceItem projectReferenceItem
参数¶
|
您将项目引用转换为 kzb 文件引用。 |
示例¶
# Convert the Resources project reference to a kzb file reference.
ConvertProjectReferenceItemToKzbReferenceItem "/Project References/Resources/"
画笔创建¶
CreateBrush¶
创建画笔
语法¶
CreateBrush itemName brushTypeName
参数¶
|
画笔的名称。 |
|
画笔的类型。 |
示例¶
# Create a Color Brush named My Color Brush in the Library > Materials and Textures > Brushes.
CreateBrush "My Color Brush" Kanzi.ColorBrush
# Create a Content Brush named My Content Brush in the Library > Materials and Textures > Brushes.
CreateBrush "My Content Brush" Kanzi.ContentBrush
# Create a Material Brush named My Material Brush in the Library > Materials and Textures > Brushes.
CreateBrush "My Material Brush" Kanzi.MaterialBrush
# Create a Texture Brush named My Texture Brush in the Library > Materials and Textures > Brushes.
CreateBrush "My Texture Brush" Kanzi.TextureBrush
组件创建¶
CreateComponentNode2D¶
创建一个2D节点。
语法¶
CreateComponentNode2D parent itemName componentTypeName
参数¶
|
在您创建2D节点的节点中。 |
|
2D 节点的名称。 |
|
2D 节点的类型。 |
示例¶
# Create a Content Layout 2D node named My Content Layout in the RootPage node.
CreateComponentNode2D "/Screens/Screen/RootPage" "My Content Layout" Kanzi.ContentLayout2D
# Create a List Box Item Container 2D prefab named My List Box Item Container in the Prefabs.
CreateComponentNode2D "/Prefabs" "My List Box Item Container" Kanzi.ListBoxItemContainer2D
# Create a Prefab View 2D node named My Prefab View in the RootPage node.
CreateComponentNode2D "/Screens/Screen/RootPage" "My Prefab View" Kanzi.PrefabView2D
CreateComponentNode¶
创建一个3D节点。
语法¶
CreateComponentNode parent itemName componentTypeName
参数¶
|
您在其中创建 3D 节点的节点。 |
|
3D 节点的名称。 |
|
3D 节点的类型。 |
示例¶
# Create a Content Layout 3D node named My Content Layout in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Content Layout" Kanzi.ContentLayout3D
# Create a Dock Layout 3D node named My Dock Layout in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Dock Layout" Kanzi.DockLayout3D
# Create a Flow Layout 3D node named My Flow Layout in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Flow Layout" Kanzi.FlowLayout3D
# Create a Grid Layout 3D node named My Grid Layout in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Grid Layout" Kanzi.GridLayout3D
# Create a Stack Layout 3D node named My Stack Layout in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Stack Layout" Kanzi.StackLayout3D
# Create a Trajectory Layout 3D node named My Trajectory Layout in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Trajectory Layout" Kanzi.TrajectoryLayout3D
# Create a Grid List Box 3D node named My Grid List Box in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Grid List Box" Kanzi.GridListBox3D
# Create a List Box Item Container 3D prefab named My List Box Item Container in the Prefabs.
CreateComponentNode "/Prefabs" "My List Box Item Container" Kanzi.ListBoxItemContainer3D
# Create a Trajectory List Box 3D node named My Trajectory List Box in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Trajectory List Box" Kanzi.TrajectoryListBox3D
# Create a Text Block 3D node named My Text Block in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Text Block" Kanzi.TextBlock3D
# Create a Button 3D node named My Button in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Button" Kanzi.Button3D
# Create a Button 3D prefab named My Button in the Prefabs.
CreateComponentNode "/Prefabs" "My Button" Kanzi.Button3D
# Create a Scroll View 3D node named My Scroll View in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Scroll View" Kanzi.ScrollView3D
# Create a Slider 3D node named My Slider in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Slider 3D" Kanzi.Slider3D
# Create a Toggle Button 3D node named My Toggle Button in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Toggle Button" Kanzi.ToggleButton3D
# Create a Toggle Button Group 3D node named My Toggle Button Group in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Toggle Button Group" Kanzi.ToggleButtonGroup3D
# Create a Prefab View 3D node named My Prefab View in the Screen > RootPage > Viewport 2D > Scene node.
CreateComponentNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Prefab View" Kanzi.PrefabView3D
空节点 (Empty Node)¶
CreateEmptyNode2D¶
使用空节点 2D 来分组 2D 对象,并将属性更改应用于这些对象作为一个组。
语法¶
CreateEmptyNode2D parent name selectNewItems
参数¶
|
您创建 Empty Node 2D 节点或预设的节点或预设。 |
|
Empty Node 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Empty Node 2D 节点或预设。 |
示例¶
# Create an Empty Node 2D node named My Empty Node in the Screen > RootPage node
# and select the My Empty Node node.
CreateEmptyNode2D "/Screens/Screen/RootPage" "My Empty Node" true
# Create an Empty Node 2D prefab named My Empty Node in the Prefabs
# and select the My Empty Node prefab.
CreateEmptyNode2D "/Prefabs" "My Empty Node" true
CreateEmptyNode3D¶
使用空节点 3D 来对 3D 对象进行分组,并将属性更改应用于这些对象作为一个组。
语法¶
CreateEmptyNode3D parent itemName
参数¶
|
您在其中创建空节点 3D 节点或预设的节点或预设。 |
|
Empty Node 3D 节点或预设的名称。 |
示例¶
# Create an Empty Node 3D node named My Empty Node 3D in the Screen > RootPage > Viewport 2D > Scene node.
CreateEmptyNode3D "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Empty Node 3D"
# Create an Empty Node 3D prefab named My Empty Node 3D in the Prefabs.
CreateEmptyNode3D "/Prefabs" "My Empty Node 3D"
布局节点 (Layout Node)¶
CreateDockLayout2D¶
使用 Dock Layout 2D 在二维空间中相对划分对象。
语法¶
CreateDockLayout2D parent name selectNewItems
参数¶
|
您在其中创建 Dock Layout 2D 节点或预设的节点或预设。 |
|
Dock Layout 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Dock Layout 2D 节点或预设。 |
示例¶
# Create a Dock Layout 2D node named My Dock Layout in the Screen > RootPage node
# and select the My Dock Layout node.
CreateDockLayout2D "/Screens/Screen/RootPage" "My Dock Layout" true
# Create a Dock Layout 2D prefab named My Dock Layout in the Prefabs
# and select the My Dock Layout prefab.
CreateDockLayout2D "/Prefabs" "My Dock Layout" true
CreateFlowLayout2D¶
使用 Flow Layout 2D 在二维空间中按行放置二维对象。当一行满时,它会将对象放置在新行中。
语法¶
CreateFlowLayout2D parent name selectNewItems
参数¶
|
创建 Flow Layout 2D 节点或预设的节点或预设。 |
|
Flow Layout 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Flow Layout 2D 节点或预设。 |
示例¶
# Create a Flow Layout 2D node named My Flow Layout in the Screen > RootPage node
# and select the My Flow Layout node.
CreateFlowLayout2D "/Screens/Screen/RootPage" "My Flow Layout" true
# Create a Flow Layout 2D prefab named My Flow Layout in the Prefabs
# and select the My Flow Layout prefab.
CreateFlowLayout2D "/Prefabs" "My Flow Layout" true
CreateGridLayout2D¶
使用网格布局 2D 在二维空间中以网格形式排列二维内容。
语法¶
CreateGridLayout2D parent name selectNewItems
参数¶
|
您在其中创建网格布局 2D 节点或预设的节点或预设。 |
|
Grid Layout 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Grid Layout 2D 节点或预设。 |
示例¶
# Create a Grid Layout 2D node named My Grid Layout in the Screen > RootPage node
# and select the My Grid Layout node.
CreateGridLayout2D "/Screens/Screen/RootPage" "My Grid Layout" true
# Create a Grid Layout 2D prefab named My Grid Layout in the Prefabs
# and select the My Grid Layout prefab.
CreateGridLayout2D "/Prefabs" "My Grid Layout" true
CreateStackLayout2D¶
使用堆栈布局 2D 在二维空间中沿选定轴排列内容。
语法¶
CreateStackLayout2D parent name selectNewItems
参数¶
|
您在其中创建 Stack Layout 2D 节点或预设的节点或预设。 |
|
Stack Layout 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Stack Layout 2D 节点或预设。 |
示例¶
# Create a Stack Layout 2D node named My Stack Layout in the Screen > RootPage node
# and select the My Stack Layout node.
CreateStackLayout2D "/Screens/Screen/RootPage" "My Stack Layout" true
# Create a Stack Layout 2D prefab named My Stack Layout in the Prefabs
# and select the My Stack Layout prefab.
CreateStackLayout2D "/Prefabs" "My Stack Layout" true
CreateTrajectoryLayout2D¶
使用二维轨迹布局在二维空间中的轨迹路径上排列内容。
语法¶
CreateTrajectoryLayout2D parent name selectNewItems
参数¶
|
您在其中创建轨迹布局 2D 节点或预设的节点或预设。 |
|
Trajectory Layout 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Trajectory Layout 2D 节点或预设。 |
示例¶
# Create a Trajectory Layout 2D node named My Trajectory Layout in the Screen > RootPage node
# and select the My Trajectory Layout node.
CreateTrajectoryLayout2D "/Screens/Screen/RootPage" "My Trajectory Layout" true
# Create a Trajectory Layout 2D prefab named My Trajectory Layout in the Prefabs
# and select the My Trajectory Layout prefab.
CreateTrajectoryLayout2D "/Prefabs" "My Trajectory Layout" true
容器节点 (Container Node)¶
CreateGridListBox2D¶
使用 Grid List Box 2D 在二维空间中以网格形式排列二维内容。
语法¶
CreateGridListBox2D parent name selectNewItems
参数¶
|
您创建 Grid List Box 2D 节点或预设的节点或预设。 |
|
Grid List Box 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Grid List Box 2D 节点或预设。 |
示例¶
# Create a Grid List Box 2D node named My Grid List Box in the Screen > RootPage node
# and select the My Grid List Box node.
CreateGridListBox2D "/Screens/Screen/RootPage" "My Grid List Box" true
# Create a Grid List Box 2D prefab named My Grid List Box in the Prefabs
# and select the My Grid List Box prefab.
CreateGridListBox2D "/Prefabs" "My Grid List Box" true
内容节点 (Content Node)¶
CreateImage2D¶
使用图像显示单个或渲染目标纹理。
语法¶
CreateImage2D parent name selectNewItems
参数¶
|
创建 Image 节点或预设的节点或预设。 |
|
图像节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Image 节点或预设。 |
示例¶
# Create an Image node named My Image in the Screen > RootPage node
# and select the My Image node.
CreateImage2D "/Screens/Screen/RootPage" "My Image" true
# Create an Image prefab named My Image in the Prefabs
# and select the My Image prefab.
CreateImage2D "/Prefabs" "My Image" true
CreatePage¶
使用分页为您的 Kanzi 应用程序添加结构。
语法¶
CreatePage parent name selectNewItems
参数¶
|
在其中创建页面节点或预设的节点或预设。 |
|
页面节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Page 节点或预设。 |
示例¶
# Create a Page node named Media Page in the Screen > RootPage node
# and select the Media Page node.
CreatePage "/Screens/Screen/RootPage" "Media Page" true
# Create a Page prefab named My Page in the Prefabs and select the My Page prefab.
CreatePage "/Prefabs" "My Page" true
CreatePageHost¶
使用主页面节点来管理其子树内页面节点之间的导航。
语法¶
CreatePageHost parent name selectNewItems
参数¶
|
您创建页面主机节点或预设的节点或预设。 |
|
页面主机节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Page Host 节点或预设。 |
示例¶
# Create a Page Host node named Main Page Host in the Screen > RootPage node
# and select the Main Page Host node.
CreatePageHost "/Screens/Screen/RootPage" "Main Page Host" true
# Create a Page Host prefab named My Page Host in the Prefabs and select the My Page Host prefab.
CreatePageHost "/Prefabs" "My Page Host" true
CreateProgressiveRenderingNode2D¶
使用 Progressive Rendering Viewport 2D 通过相机显示 3D 场景中的视图。
语法¶
CreateProgressiveRenderingNode2D parent name selectNewItems
参数¶
|
您创建渐进式渲染视口 2D 节点或预设的节点或预设。 |
|
渐进渲染视口 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Progressive Rendering Viewport 2D 节点或预设。 |
示例¶
# Create a Progressive Rendering Viewport 2D node named My Progressive Rendering Viewport
# in the Screen > RootPage node and select the Progressive Rendering Viewport node.
CreateProgressiveRenderingNode2D "/Screens/Screen/RootPage" "My Progressive Rendering Viewport" true
# Create a Progressive Rendering Viewport 2D prefab named My Progressive Rendering Viewport
# in the Prefabs and select the My Progressive Rendering Viewport prefab.
CreateProgressiveRenderingNode2D "/Prefabs" "My Progressive Rendering Viewport" true
CreateTextBlock2D¶
使用 Text Block 2D 在二维空间中显示文本。它使用字体来渲染文本,并在二维空间中具有位置和方向。
语法¶
CreateTextBlock2D parent name selectNewItems
参数¶
|
您在其中创建 Text Block 2D 节点或预设的节点或预设。 |
|
Text Block 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Text Block 2D 节点或预设。 |
示例¶
# Create a Text Block 2D node named My Text Block in the Screen > RootPage node
# and select the My Text Block node.
CreateTextBlock2D "/Screens/Screen/RootPage" "My Text Block" true
# Create a Text Block 2D prefab named My Text Block in the Prefabs
# and select the My Text Block prefab.
CreateTextBlock2D "/Prefabs" "My Text Block" true
创建视口2D (CreateViewport2D)¶
使用 Viewport 2D 通过相机显示 3D 场景的视图。
语法¶
CreateViewport2D parent name selectNewItems
参数¶
|
您在其中创建 Viewport 2D 节点或预设的节点或预设。 |
|
Viewport 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Viewport 2D 节点或预设。 |
示例¶
# Create a Viewport 2D node named My Viewport in the Screen > RootPage node
# and select the My Viewport node.
CreateViewport2D "/Screens/Screen/RootPage" "My Viewport" true
# Create a Viewport 2D prefab named My Viewport in the Prefabs
# and select the My Viewport prefab.
CreateViewport2D "/Prefabs" "My Viewport" true
交互节点 (Interactivity Node)¶
CreateScrollView2D¶
使用 Scroll View 2D 从二维空间中的滚动手势获取用户输入。
语法¶
CreateScrollView2D parent name selectNewItems
参数¶
|
您在其中创建 Scroll View 2D 节点或预设的节点或预设。 |
|
Scroll View 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Scroll View 2D 节点或预设。 |
示例¶
# Create a Scroll View 2D node named My Scroll View in the Screen > RootPage node
# and select the My Scroll View node.
CreateScrollView2D "/Screens/Screen/RootPage" "My Scroll View" true
# Create a Scroll View 2D prefab named My Scroll View in the Prefabs
# and select the My Scroll View prefab.
CreateScrollView2D "/Prefabs" "My Scroll View" true
CreateSlider2D¶
使用 Slider 2D 允许用户在二维空间中设置一个在最小值和最大值之间的值。
语法¶
CreateSlider2D parent name selectNewItems
参数¶
|
您在其中创建 Slider 2D 节点或预设的节点或预设。 |
|
Slider 2D 节点或预设的名称。 |
|
Kanzi Studio 是否选择您创建的 Slider 2D 节点或预设。 |
示例¶
# Create a Slider 2D node named My Slider in the Screen > RootPage node
# and select the My Slider node.
CreateSlider2D "/Screens/Screen/RootPage" "My Slider" true
# Create a Slider 2D prefab named My Slider in the Prefabs
# and select the My Slider prefab.
CreateSlider2D "/Prefabs" "My Slider" true
材质创建¶
CreateMaterial¶
材质可用于设置 3D 节点和材质笔刷的外观。
语法¶
CreateMaterial materialName selectNewItem materialType
参数¶
|
材料的名称。 |
|
Kanzi Studio 是否选择该材料。 |
|
材料使用的材料类型。 |
示例¶
# Create a material named My Material in the Library > Materials and Textures > Materials,
# select the material, and set the material to use the My Material Type material type.
CreateMaterial "My Material" true "/Material Types/My Material Type"
CreateMaterialType¶
材质类型定义材质的属性类型。您可以通过调整材质类型定义的材质属性值,设置材质的外观。
语法¶
CreateMaterialType materialTypeName createMaterial
参数¶
|
材料类型的名称。 |
|
(可选)Kanzi Studio 是否还创建使用材质类型的材质。默认值为 false。 |
示例¶
# Create a material type named My Material Type in the Library > Materials and Textures > Material Types,
# and create a material named My Material Type Material which uses My Material Type.
CreateMaterialType "My Material Type" true
原始创建¶
CreateBoxNode¶
创建一个以其原点为中心的立方体网格。
语法¶
CreateBoxNode parent itemName
参数¶
|
您在其中创建 Box 节点或预设的节点或预设。 |
|
Box 节点或预设的名称。 |
示例¶
# Create a Box node named My Box in the Screen > RootPage > Viewport 2D > Scene node.
CreateBoxNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Box"
# Create a Box prefab named My Box in the Prefabs.
CreateBoxNode "/Prefabs" "My Box"
CreateMeshNode¶
使用模型将使用第三方工具创建的导入3D模型添加到您的Kanzi应用程序中。
语法¶
CreateMeshNode parent itemName mesh
参数¶
|
您在其中创建模型节点或预设的节点或预设。 |
|
模型节点或预设的名称。 |
|
(可选)Model 显示的 Mesh。 |
示例¶
# Create a Model node named My Model in the Screen > RootPage > Viewport 2D > Scene node
# and set the Mesh property of My Model to the My Mesh mesh.
CreateMeshNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Model" "/Mesh Data/My Mesh"
# Create a Model prefab named My Model in the Prefabs.
CreateMeshNode "/Prefabs" "My Model"
CreatePlaneNode¶
创建一个具有四个顶点的填充平面网格。
语法¶
CreatePlaneNode parent itemName
参数¶
|
您在其中创建平面节点或预设的节点或预设。 |
|
平面节点或预设的名称。 |
示例¶
# Create a Plane node named My Plane in the Screen > RootPage > Viewport 2D > Scene node.
CreatePlaneNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Plane"
# Create a Plane prefab named My Plane in the Prefabs.
CreatePlaneNode "/Prefabs" "My Plane"
CreateSphereNode¶
创建一个以其原点为中心的球体网格。
语法¶
CreateSphereNode parent itemName
参数¶
|
您在其中创建 Sphere 节点或预设的节点或预设。 |
|
Sphere 节点或预设的名称。 |
示例¶
# Create a Sphere node named My Sphere in the Screen > RootPage > Viewport 2D > Scene node.
CreateSphereNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Sphere"
# Create a Sphere prefab named My Sphere in the Prefabs.
CreateSphereNode "/Prefabs" "My Sphere"
节点 3D 创建¶
CreateScene¶
使用 Scene 节点在您的 Kanzi 应用程序中显示 3D 内容。Scene 节点可以包含光源节点、Camera 节点和任何其他 3D 节点。
语法¶
CreateScene parent itemName createCameraAndLight
参数¶
|
您在其中创建场景节点或预设的节点或预设。 |
|
Viewport 2D 节点或预设的名称。 |
|
(可选)是否在场景节点中创建一个相机节点和一个方向光。默认值为 true。 |
示例¶
# Create a Scene node named My Scene in the RootPage > My Viewport node,
# and in the My Scene node create a Camera node and a Directional Light node.
CreateScene "/Screens/Screen/RootPage/My Viewport" "My Scene"
# Create a Scene prefab named My Scene in the Prefabs.
# Do not create a Camera and a Directional Light node in My Scene prefab.
CreateScene "/Prefabs" "My Scene" false
Helper Node 3D Creation¶
CreateCameraNode¶
使用摄像机节点来显示 Kanzi Studio 项目和 Kanzi 应用程序中场景的内容。
语法¶
CreateCameraNode parent itemName
参数¶
|
在您创建 Camera 节点的节点中。 |
|
Camera 节点的名称。 |
示例¶
# Create a Camera node named Camera in the Screen > RootPage > Viewport 2D > Scene node.
CreateCameraNode "/Screens/Screen/RootPage/Viewport 2D/Scene" Camera
语法¶
CreateCameraNode parent itemName activateAsPreviewCamera setAsDefaultCamera3D setDefaultOrientation
参数¶
|
在您创建 Camera 节点的节点中。 |
|
Camera 节点的名称。 |
|
是否将相机激活为预览相机。 |
|
是否将相机设置为默认相机。 |
|
是否将布局变换设置为默认方向。 |
示例¶
# Create a Camera node named Camera in the Screen > RootPage > Viewport 2D > Scene node,
# activate the camera as the Preview camera, set the camera as the default camera,
# and set the Layout Transformation to the default orientation.
CreateCameraNode Camera "/Screens/Screen/RootPage/Viewport 2D/Scene" true true true
CreateDirectionalLightNode¶
定向光仅在一个方向上发光。您可以使用定向光来模拟阳光。默认情况下,每个场景节点都包含一个定向光。
语法¶
CreateDirectionalLightNode itemName parent
参数¶
|
光节点的名称。 |
|
在您创建光节点的节点中。 |
示例¶
# Create a Directional Light node named My Directional Light in the Screen > RootPage > Viewport 2D > Scene node.
CreateDirectionalLightNode "My Directional Light" "/Screens/Screen/RootPage/Viewport 2D/Scene"
CreateInstantiatorNode¶
使用 Instantiator 节点创建其目标对象的副本。实例化的节点不可交互。
语法¶
CreateInstantiatorNode parent itemName target
参数¶
|
在您创建 Instantiator 节点的节点中。 |
|
Instantiator 节点的名称。 |
|
(可选)Instantiator 节点实例化的节点。 |
示例¶
# Create an Instantiator node named My Instantiator in the Screen > RootPage > Viewport 2D > Scene node.
CreateInstantiatorNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Instantiator"
# Instantiate the Screen > RootPage > Viewport 2D > Scene > Directional Light node into
# an Instantiator node named Directional Light Instance in the Screen > RootPage > Viewport 2D > Scene node.
CreateInstantiatorNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "Directional Light Instance" "/Screens/Screen/RootPage/Viewport 2D/Scene/Directional Light"
创建细节层次节点 (CreateLevelOfDetailNode)¶
使用细节层次节点根据其与视图相机的关系显示一个对象。细节层次类似于一个空节点3D。
语法¶
CreateLevelOfDetailNode parent itemName
参数¶
|
您在其中创建细节层次节点或预设的节点或预设。 |
|
细节层次节点或预设的名称。 |
示例¶
# Create a Level of Detail node named My Level of Detail in the Screen > RootPage > Viewport 2D > Scene node.
CreateLevelOfDetailNode "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Level of Detail"
# Create a Level of Detail prefab named My Level of Detail in the Prefabs.
CreateLevelOfDetailNode "/Prefabs" "My Level of Detail"
CreatePointLightNode (创建点光源节点)¶
点光源从一个特定位置同时向所有方向(360 度)发光。
语法¶
CreatePointLightNode itemName parent
参数¶
|
光节点的名称。 |
|
在您创建光节点的节点中。 |
示例¶
# Create a Point Light node named My Point Light in the Screen > RootPage > Viewport 2D > Scene node.
CreatePointLightNode "My Point Light" "/Screens/Screen/RootPage/Viewport 2D/Scene"
CreateSpotLightNode (创建聚光灯节点)¶
聚光灯从特定位置朝指定方向发射圆锥形光。
语法¶
CreateSpotLightNode itemName parent
参数¶
|
光节点的名称。 |
|
在您创建光节点的节点中。 |
示例¶
# Create a Spot Light node named My Spot Light in the Screen > RootPage > Viewport 2D > Scene node.
CreateSpotLightNode "My Spot Light" "/Screens/Screen/RootPage/Viewport 2D/Scene"
渲染通道创建¶
CreateRenderPass¶
创建一个渲染通道。
语法¶
CreateRenderPass parent itemName renderPassTypeName
参数¶
|
(可选)您创建渲染通道的渲染通道或渲染通道预设根。要创建渲染通道预设,请省略此参数。 |
|
渲染通道的名称。 |
|
渲染通道类型的名称。 |
示例¶
# Create a Group Render Pass render pass prefab named Group in the Library > Rendering > Render Pass Prefabs.
CreateRenderPass "Group" Kanzi.RenderPass
# Create a Clear Render Pass named Clear in the Library > Rendering > Render Pass Prefabs > Group.
CreateRenderPass "/Render Pass Prefabs/Group/Group" "Clear" Kanzi.ClearRenderPass
# Create a Gather Lights Render Pass named Gather Lights in the Library > Rendering > Render Pass Prefabs > Group.
CreateRenderPass "/Render Pass Prefabs/Group/Group" "Gather Lights" Kanzi.GatherLightsRenderPass
# Create a Draw Objects Render Pass named Draw in the Library > Rendering > Render Pass Prefabs > Group > Gather Lights.
CreateRenderPass "/Render Pass Prefabs/Group/Group/Gather Lights" "Draw" Kanzi.DrawObjectsRenderPass
# This example creates the render passes that you need to render content to a composition target.
# Create a Group Render Pass prefab named Render Composition Target in the Library > Rendering > Render Pass Prefabs.
CreateRenderPass "Render Composition Target" Kanzi.RenderPass
# In the Render Composition Target create a Composition Target Render Pass named Composition Target Render Pass.
CreateRenderPass "/Render Pass Prefabs/Render Composition Target/Render Composition Target" "Composition Target Render Pass" Kanzi.CompositionTargetRenderPass
# In the Composition Target Render Pass create a Default Render Pass which contains a basic set of render passes that first render opaque nodes and then transparent nodes.
CreateDefaultRenderPassTree "/Render Pass Prefabs/Render Composition Target/Render Composition Target/Composition Target Render Pass" "Default Render Pass"
# In the Render Composition Target create a Blit Render Pass named Blit Render Pass.
CreateRenderPass "/Render Pass Prefabs/Render Composition Target/Render Composition Target" "Blit Render Pass" Kanzi.BlitRenderPass
# In the Blit Render Pass bind the Texture 0 property to the Result Texture 0 property of the Composition Target Render Pass.
CreateBindingItem "/Render Pass Prefabs/Render Composition Target/Render Composition Target/Blit Render Pass" ONE_WAY null BlitRenderPass.Texture0 WHOLE_PROPERTY "{../Composition Target Render Pass/CompositionTargetRenderPass.ResultTexture0}"
# Create a Pipeline State Render Pass named Pipeline State in the Library > Rendering > Render Pass Prefabs > Group Render Pass render pass prefab.
CreateRenderPass "/Render Pass Prefabs/Group Render Pass/Group Render Pass" "Pipeline State" Kanzi.PipelineStateRenderPass
# Create a Draw Objects With Material Render Pass named Draw Objects with Material in the Library > Rendering > Render Pass Prefabs > Group Render Pass render pass prefab.
CreateRenderPass "/Render Pass Prefabs/Group Render Pass/Group Render Pass" "Draw Objects with Material" Kanzi.DrawObjectsWithMaterialRenderPass
# Create a Material Setup Render Pass named Material Setup in the Library > Rendering > Render Pass Prefabs > Group Render Pass render pass prefab.
CreateRenderPass "/Render Pass Prefabs/Group Render Pass/Group Render Pass" "Material Setup" Kanzi.MaterialSetupRenderPass
渲染通道预设创建¶
CreateComposeAndBlitRenderPassTree¶
使用 Compose 和 Blit Pass 渲染通道预设来创建渲染通道,以便使用特定材质来 blit Composition Target Render Pass。
语法¶
CreateComposeAndBlitRenderPassTree parent itemName
参数¶
|
(可选)您在其中创建 Compose to Blit Pass 的渲染通道预设或渲染通道。要创建 Compose to Blit Pass 预设,请省略此参数。 |
|
Compose to Blit Pass 的名称。 |
示例¶
# Create a Compose and Blit Pass render pass prefab named Compose and Blit
# in the Library > Rendering > Render Pass Prefabs.
CreateComposeAndBlitRenderPassTree "Compose and Blit"
# Create a Group Render Pass render pass prefab named Group in the Library > Rendering > Render Pass Prefabs.
CreateRenderPass "Group" Kanzi.RenderPass
# Create a Compose and Blit Pass named Compose and Blit in the Group render pass prefab.
CreateComposeAndBlitRenderPassTree "/Render Pass Prefabs/Group/Group" "Compose and Blit"
CreateDefaultRenderPassTree¶
使用 Default Render Pass 渲染通道预设来创建一组基本的渲染通道,以便您开始使用。Default Render Pass 首先渲染不透明节点,然后渲染透明节点。
语法¶
CreateDefaultRenderPassTree parent itemName
参数¶
|
(可选)您创建默认渲染通道的渲染通道预设或渲染通道。要创建默认渲染通道预设,请省略此参数。 |
|
默认渲染通道的名称。 |
示例¶
# Create a Default Render Pass prefab named Default Rendering in the Library > Rendering > Render Pass Prefabs.
CreateDefaultRenderPassTree "Default Rendering"
# Create a Group Render Pass render pass prefab named Group in the Library > Rendering > Render Pass Prefabs.
CreateRenderPass "Group" Kanzi.RenderPass
# Create a Default Render Pass named Default Render Pass in the Group render pass prefab.
CreateDefaultRenderPassTree "/Render Pass Prefabs/Group/Group" "Default Render Pass"
CreateImageBasedLightingFilterPassTree¶
使用 Image-Based Lighting Filter Pass 预设创建渲染通道,将环境贴图纹理预过滤为 Environment Ambient Texture 和 Environment Reflection Texture。您可以将这些纹理用于基于物理的渲染材质的基于图像的照明。
语法¶
CreateImageBasedLightingFilterPassTree parent itemName
参数¶
|
(可选)您在其中创建 Image-Based Lighting Filter Pass 的渲染通道。要创建 Image-Based Lighting Filter Pass 预设,请省略此参数。 |
|
Image-Based Lighting Filter Pass 的名称。 |
示例¶
# Create an Image-Based Lighting Filter Pass render pass prefab named Image-Based Lighting Filter
# in the Library > Rendering > Render Pass Prefabs.
CreateImageBasedLightingFilterPassTree "Image-Based Lighting Filter"
# Create a Group Render Pass render pass prefab named Group in the Library > Rendering > Render Pass Prefabs.
CreateRenderPass "Group" Kanzi.RenderPass
# Create a Image-Based Lighting Filter Pass named Image-Based Lighting Filter in the Group render pass prefab.
CreateImageBasedLightingFilterPassTree "/Render Pass Prefabs/Group/Group" "Image-Based Lighting Filter"
CreateRenderToTexturePassTree¶
使用 Render to Texture Pass 渲染通道预设来创建渲染到纹理所需的渲染通道。
语法¶
CreateRenderToTexturePassTree parent itemName
参数¶
|
(可选)您在其中创建渲染到纹理通道的渲染通道。要创建渲染到纹理通道的预设,请省略此参数。 |
|
渲染到纹理通道的名称。 |
示例¶
# Create a Render to Texture Pass render pass prefab named Render to Texture
# in the Library > Rendering > Render Pass Prefabs.
CreateRenderToTexturePassTree "Render to Texture"
# Create a Group Render Pass render pass prefab named Group in the Library > Rendering > Render Pass Prefabs.
CreateRenderPass "Group" Kanzi.RenderPass
# Create a Render to Texture Pass named Render to Texture in the Group render pass prefab.
CreateRenderToTexturePassTree "/Render Pass Prefabs/Group/Group" "Render to Texture"
效果创建¶
CreateNodeEffect2D¶
使用效果将后期处理效果应用于2D节点。
语法¶
CreateNodeEffect2D itemName effectTypeName
参数¶
|
效果的名称。 |
|
效果的类型。 |
示例¶
# Create a Shadow Effect 2D in the Library > Effects > 2D Effects.
CreateNodeEffect2D "Shadow" Kanzi.ShadowEffect2D
效果预设创建¶
CreateDefaultEffectStack¶
使用 Default Effect Stack 2D 预设可以快速创建和应用常见的效果类型。
语法¶
CreateDefaultEffectStack itemName
参数¶
|
默认效果堆栈 2D 的名称。 |
示例¶
# Create a Default Effect Stack 2D prefab named Default Effect in the Library > Effects > 2D Effects.
CreateDefaultEffectStack "Default Effect"
杂项创建¶
CreateApplicationConfiguration¶
为您的工程创建一组构建参数。
语法¶
CreateApplicationConfiguration itemName configurationType
参数¶
|
构建配置的名称。 |
|
(可选)构建配置的类型:Android、QNX 或 Windows。默认情况下为 Common Build Configuration。 |
示例¶
# Create a common build configuration named My Build Configuration in the Library > Build Configurations.
CreateApplicationConfiguration "My Build Configuration"
# In My Build Configuration, set the Application Root Directory to ..\..\..\Application.
SetProperty "/Resource Files/Build Configurations/My Build Configuration" BuildConfigurationApplicationRootDirectory "..\..\..\Application"
# In My Build Configuration, set the Build Profile to Debug.
SetProperty "/Resource Files/Build Configurations/My Build Configuration" BuildConfiguration.BuildProfile Debug
# Create an Android build configuration named My Android Build Configuration in the Library > Build Configurations.
CreateApplicationConfiguration "My Android Build Configuration" Android
# In My Android Build Configuration, set the CPU Architecture to ARM.
SetProperty "/Resource Files/Build Configurations/My Android Build Configuration" BuildConfigurationTargetArchitecture ARM
# In My Android Build Configuration, set the Launch Application property to disabled.
SetProperty "/Resource Files/Build Configurations/My Android Build Configuration" BuildConfigurationRunApplication False
# In My Android Build Configuration, set the APK Path to output\my-directory.
SetProperty "/Resource Files/Build Configurations/My Android Build Configuration" BuildConfigurationAPKPath "output\my-directory"
CreateDataSource¶
创建数据源。
语法¶
CreateDataSource itemName dataSourceTypeName
参数¶
|
数据源的名称。 |
|
在 Kanzi Engine 数据源插件代码中声明的数据源类型的名称。 |
示例¶
# Create a data source named Cluster of the type CustomDataSourceType.
CreateDataSource Cluster CustomDataSourceType
# To create data objects from the Cluster data source, update the data source.
UpdateDataSourceContents "/Data Sources/Cluster/"
CreateFontFamily¶
创建一个空字体系列。
语法¶
CreateFontFamily fontFamilyName fontFile
参数¶
|
字体系列的名称。 |
|
(可选)您设置字体系列使用的字体文件资源。 |
示例¶
# Create a single font family named My Font Family in the Library > Font Families.
CreateFontFamily "My Font Family"
CreateLocale¶
创建一个区域设置。
语法¶
CreateLocale parent name
参数¶
|
在您创建语言环境的 Localization Table 中。 |
|
区域设置的名称。 |
示例¶
# Create a Locale named fi-FI in the Library > Localization > My Localization Table.
CreateLocale "/Localization/My Localization Table" fi-FI
CreateLocalizationTable¶
创建一个本地化表。
语法¶
CreateLocalizationTable name selectNewItems
参数¶
|
Localization Table 的名称。 |
|
(可选)Kanzi Studio 是否选择 Localization Table。默认值为 false。 |
示例¶
# Create a Localization Table named My Localization Table in the Library > Localization.
CreateLocalizationTable "My Localization Table"
CreateNode3DPrefabPlaceholder¶
使用 Prefab Placeholder 3D 节点实例化一个 3D 预设。
Kanzi 将预设占位符节点替换为其实例化的预设的根节点。
语法¶
CreateNode3DPrefabPlaceholder parent itemName prefabTemplate
参数¶
|
您在其中创建预设占位符3D节点的节点。 |
|
预设占位符 3D 节点的名称。 |
|
(可选)您设置为 Prefab Placeholder 3D 节点使用的预设模板。 |
示例¶
# Create a Prefab Placeholder 3D node named My Prefab Placeholder 3D in the Screen > RootPage > Viewport 2D > Scene node.
CreateNode3DPrefabPlaceholder "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Prefab Placeholder 3D"
# Create a Prefab Placeholder 3D node named My Prefab Placeholder 3D in the Screen > RootPage > Viewport 2D > Scene node
# and set the Prefab Template property of the My Prefab Placeholder 3D node to the Prefabs > Toggle Button 3D prefab.
CreateNode3DPrefabPlaceholder "/Screens/Screen/RootPage/Viewport 2D/Scene" "My Prefab Placeholder 3D" "/Prefabs/Toggle Button 3D"
CreateResourceDictionary¶
在已选定的节点中创建资源字典。资源字典是指向资源的资源 ID 的集合。
语法¶
CreateResourceDictionary parent
参数¶
|
您添加资源字典的节点。 |
示例¶
# Add a resource dictionary to the RootPage node.
CreateResourceDictionary "/Screens/Screen/RootPage"
CreateState¶
使用状态收集属性,这些属性定义将状态机分配到的节点的外观和行为。在一个状态组中,同一时间只能有一个状态处于活动状态。
语法¶
CreateState parent name selectNewItems
参数¶
|
创建状态的状态组。 |
|
状态的名称。 |
|
Kanzi Studio 是否选择该状态。 |
示例¶
# Create states named State1 and State 2 in the Library > State Managers > My State Manager > State Group.
# Do not select the states.
CreateState "/State Managers/My State Manager/State Group" "State 1" false
CreateState "/State Managers/My State Manager/State Group" "State 2" false
CreateStateGroup¶
状态组包含各种状态,并定义控制器属性和状态之间的迁移。
语法¶
CreateStateGroup parent name selectNewItems
参数¶
|
在您创建状态组的状态机中。 |
|
状态组的名称。 |
|
(可选)Kanzi Studio 是否选择状态组。默认值为 true。 |
示例¶
# Create a state group named State Group in the Library > State Managers > My State Manager.
# Do not select the state group.
CreateStateGroup "/State Managers/My State Manager" "State Group" false
CreateStateManager¶
使用状态机定义您的 Kanzi 应用程序在不同状态下的外观和行为。
语法¶
CreateStateManager itemName selectNewItems
参数¶
|
状态管理器的名称。 |
|
(可选)Kanzi Studio 是否选择状态管理器。默认值为 true。 |
示例¶
# Create a state manager named My State Manager in the Library > State Managers and select My State Manager.
CreateStateManager "My State Manager"
# Create a state manager named My State Manager in the Library > State Managers but do not select the state manager.
CreateStateManager "My State Manager" false
语法¶
CreateStateManager itemName selectNewItems createContent
参数¶
|
状态管理器的名称。 |
|
Kanzi Studio 是否选择状态管理器。 |
|
是否在状态管理器中创建一个具有两个状态的状态组。 |
示例¶
# Create a state manager named My State Manager in the Library > State Managers,
# select the state manager, and in the state manager create a state group with two states.
CreateStateManager "My State Manager" true true
CreateStateWithTarget¶
使用状态对象为某个状态定义节点的属性。
语法¶
CreateStateWithTarget parent name stateObjectPath selectNewItems
参数¶
|
您创建状态对象时的状态。 |
|
状态对象的名称。 |
|
状态对象的 Target Object Path 属性的值。 |
|
Kanzi Studio 是否选择状态对象。 |
示例¶
# Create a state object named Car Object in the Library > State Managers > My State Manager > State Group > State 1 state,
# and set the Target Object Path property to Car. Do not select the Car Object state object.
CreateStateWithTarget "/State Managers/My State Manager/State Group/State 1" "Car Object" "Car" false
语法¶
CreateStateWithTarget name parent selectNewItems
参数¶
|
状态对象的名称。 |
|
您创建状态对象时的状态。 |
|
Kanzi Studio 是否选择状态对象。 |
示例¶
# Create a state object named State Object in the Library > State Managers > My State Manager > State Group > State 1 state.
# Do not select the state object.
CreateStateWithTarget "State Object" "/State Managers/My State Manager/State Group/State 1" false
CreateTag¶
标签可用于分组、查找及过滤工程中的节点。您可以为单个节点分配多个标签。
语法¶
CreateTag itemName selectNewItems
参数¶
|
标签的名称。 |
|
Kanzi Studio 是否选择该标签。 |
示例¶
# Create a tag named My Tag in the Library > Tags and select the tag.
CreateTag "My Tag" true
创建CreateTheme¶
主题用于定义应用程序的外观及感觉。
语法¶
CreateTheme parent name
参数¶
|
您创建主题的 Theme Group。 |
|
主题的名称。 |
示例¶
# Create a Theme named Classic in the Cluster Themes theme group.
CreateTheme "/Themes/Cluster Themes" Classic
CreateThemeGroup¶
使用主题组定义一组主题,这些主题定义应用程序的外观及感觉。主题可让一个 Kanzi Studio 工程用于多个产品变体。
语法¶
CreateThemeGroup name selectNewItems
参数¶
|
主题组的名称。 |
|
(可选)Kanzi Studio 是否选择 Theme Group。默认值为 false。 |
示例¶
# Create a Theme Group named Cluster Theme in the Library > Themes.
CreateThemeGroup "Cluster Theme"
ExportLocalizationTable¶
将本地化表模板导出为 .pot 文件,并根据该本地化表中的语言环境数量导出相应数量的 .po 文件到 <ProjectName>/Localization/<LocalizationTableName>。
语法¶
ExportLocalizationTable localizationTable localizationDirectoryPath
参数¶
|
您导出的 localization table。 |
|
导出本地化表的目录。 |
示例¶
# Export the Library > Localization > Localization Table to the C:\Temp directory.
# Kanzi Studio creates the C:\Temp\Localization Table directory, and exports to the directory
# the localization table template to a .pot file, and as many .po files as you have locales
# in that localization table.
ExportLocalizationTable "/Localization/Localization Table" "C:\Temp"
ImportAllLocalizationTables¶
从项目的 Localization 目录中所有本地化表文件夹中导入所有 PO 文件。
语法¶
ImportAllLocalizationTables localizationDirectoryPath
参数¶
|
包含本地化表文件夹的目录路径。Kanzi Studio 在此目录中查找包含 PO 文件的文件夹,并为每个此类文件夹创建一个以该文件夹命名的本地化表。如果本地化表已存在,Kanzi Studio 会更新它。 |
示例¶
# Imports all PO files from all directories found in the
# C:\KanziWorkspace\Projects\MyProject\Tool_Project\Localization directory.
# Kanzi Studio imports the files for all localization tables in the Library > Localization.
ImportAllLocalizationTables "C:\KanziWorkspace\Projects\MyProject\Tool_Project\Localization"
ImportEnginePlugin¶
导入 Kanzi Engine 插件。在导入过程中,插件中包含的组件、属性类型、消息和触发器将可用于项目。
语法¶
ImportEnginePlugin loadPath existingPlugin
参数¶
|
要更新现有的 Kanzi Engine 插件,请将此参数留空。 |
|
您更新的 Kanzi Engine 插件。 |
示例¶
# Update the XML_data_source Kanzi Engine plugin in the project.
# You leave the first parameter empty because you do not import a new plugin to the project.
ImportEnginePlugin "" "/Kanzi Engine Plugins/XML_data_source"
语法¶
ImportEnginePlugin existingPluginFile
参数¶
|
Kanzi Engine 插件 DLL。 |
示例¶
# Import the Kanzi Engine plugin DLL MyPluginProject\Application\lib\Win64\GL_vs2019_Debug_DLL\MyPluginProject.dll.
# Kanzi Studio adds to the Library > Kanzi Engine Plugins a reference to the Kanzi Engine plugin DLL that you import.
ImportEnginePlugin "C:\KanziWorkspace\Projects\MyPluginProject\Application\lib\Win64\GL_vs2019_Debug_DLL\MyPluginProject.dll"
TagItems¶
将标签添加到一组项目中。
语法¶
TagItems tags itemsToTag
参数¶
|
您分配的标签。用分号分隔标签列表。 |
|
您分配标签的节点。用分号分隔节点列表。 |
示例¶
# Create a tag named Lights in the Library > Tags and select the tag.
CreateTag "Lights" true
# Create a Spot Light node named Spot Light in the Screen > RootPage > Viewport 2D > Scene node.
CreateSpotLightNode "Spot Light" "/Screens/Screen/RootPage/Viewport 2D/Scene"
# Tag the Directional Light and Spot Light nodes with the Lights tag.
TagItems "/Tags/Lights" "/Screens/Screen/RootPage/Viewport 2D/Scene/Directional Light; /Screens/Screen/RootPage/Viewport 2D/Scene/Spot Light"
UpdateDataSourceContents¶
从数据源读取并缓存数据,以在 UI 中创建数据绑定。
语法¶
UpdateDataSourceContents dataSource
参数¶
|
您更新的数据源。 |
示例¶
# Update the Cluster data source.
UpdateDataSourceContents "/Data Sources/Cluster/"
UpdateProjectDataSources¶
读取并缓存此项目中定义的数据源的数据,以在 UI 中创建数据绑定。
语法¶
UpdateProjectDataSources
示例¶
# Update all data sources in the project.
UpdateProjectDataSources
UpdateProjectEnginePlugins¶
要查看此项目中Kanzi Engine插件定义的自定义节点、属性类型、触发器和操作的更改,请加载插件的最新版本。
语法¶
UpdateProjectEnginePlugins
示例¶
# Update all Kanzi Engine plugins in the project.
UpdateProjectEnginePlugins
UpdateSolutionDataSources¶
读取并缓存在此解决方案中定义的数据源中的数据,以在 UI 中创建数据绑定。
语法¶
UpdateSolutionDataSources
示例¶
# Update all data sources in the project and all referenced projects.
UpdateSolutionDataSources
UpdateSolutionEnginePlugins¶
要查看此解决方案中 Kanzi Engine 插件定义的自定义节点、属性类型、触发器和操作的更改,请加载插件的最新版本。
语法¶
UpdateSolutionEnginePlugins
示例¶
# Update all Kanzi Engine plugins in the project and all referenced projects.
UpdateProjectEnginePlugins
对象源创建¶
CreateCombineObjectSource¶
使用组合对象源从一个或多个输入源(例如过滤器)中选取及合并节点。
语法¶
CreateCombineObjectSource itemName
参数¶
|
组合对象源的名称。 |
示例¶
# Create a Combine Object Source named My Combine Object Source in the Library > Rendering > Object Sources.
CreateCombineObjectSource "My Combine Object Source"
# In My Combine Object Source set the Inputs list to contain the Transparent and My Tag Filter filters.
SetProperty "/Object Sources/My Combine Object Source" CombineObjectSourceInputs "/Object Sources/Transparent#/Object Sources/My Tag Filter"
CreateContainsPropertyFilterObjectSource¶
包含属性过滤器可用于收集包含或不包含特定属性的节点。
语法¶
CreateContainsPropertyFilterObjectSource itemName
参数¶
|
过滤器的名称。 |
示例¶
# Create a Contains Property Filter named My Contains Property Filter
# in the Library > Rendering > Object Sources.
CreateContainsPropertyFilterObjectSource "My Contains Property Filter"
# In My Contains Property Filter set the Property Type property to Ambient Color (Ambient).
SetProperty "/Object Sources/My Contains Property Filter" ContainsPropertyFilterPropertyTypeName Ambient
# In My Contains Property Filter set the Operation property to EXCLUDE.
SetProperty "/Object Sources/My Contains Property Filter" ContainsPropertyFilterOperation EXCLUDE
CreateFixedSortFilterObjectSource¶
排序过滤器可按节点在 z 轴上的位置排序节点或按它们的材质类型分组。
语法¶
CreateFixedSortFilterObjectSource itemName
参数¶
|
过滤器的名称。 |
示例¶
# Create a Sorting Filter named My Sorting Filter in the Library > Rendering > Object Sources.
CreateFixedSortFilterObjectSource "My Sorting Filter"
# Set the Sorting Type property of My Sorting Filter to Material type.
SetProperty "/Object Sources/My Sorting Filter" FixedSortType MATERIAL_TYPE
# In My Sorting Filter set the Reverse Order property to enabled.
SetProperty "/Object Sources/My Sorting Filter" FixedSortReverse true
CreateObjectTypeFilterObjectSource¶
对象类型过滤器可用于按照节点类型收集节点。
语法¶
CreateObjectTypeFilterObjectSource itemName
参数¶
|
过滤器的名称。 |
示例¶
# Create an Object Type Filter named My Object Type Filter in the Library > Rendering > Object Sources.
CreateObjectTypeFilterObjectSource "My Object Type Filter"
# In My Object Type Filter set the Type property to Light.
SetProperty "/Object Sources/My Object Type Filter" ObjectTypeFilterObjectType LIGHT
# In My Object Type Filter set the Operation property to Exclude.
SetProperty "/Object Sources/My Object Type Filter" ObjectTypeFilterOperation EXCLUDE
CreatePropertyIsEqualObjectSource¶
属性匹配过滤器可用于收集包含或不包含某个属性值达到特定值的节点。
语法¶
CreatePropertyIsEqualObjectSource itemName
参数¶
|
过滤器的名称。 |
示例¶
# Create a Property Is Equal Filter named My Property Is Equal Filter in the Library > Rendering > Object Sources.
CreatePropertyIsEqualObjectSource "My Property Is Equal Filter"
CreateTagFilter¶
使用标签过滤器来收集被分配了特定标签的节点。
语法¶
CreateTagFilter itemName
参数¶
|
过滤器的名称。 |
示例¶
# Create a Tag Filter named My Tag Filter in the Library > Rendering > Object Sources.
CreateTagFilter "My Tag Filter"
# Create a tag named My Tag in the Library > Tags.
CreateTag "My Tag" false
# Create a tag named Lights in the Library > Tags.
CreateTag "Lights" false
# In My Tag Filter set the Included Tags list to contain the My Tag and Lights tags.
SetProperty "/Object Sources/My Tag Filter" TagFilterIncludeList "/Tags/My Tag#/Tags/Lights"
# In My Tag Filter set the Excluded Tags list to contain the Transparent tag.
SetProperty "/Object Sources/My Tag Filter" TagFilterExcludeList "/Tags/Transparent"
纹理创建 (Texture Creation)¶
CreateEnvironmentCubeMapTexture¶
使用环境立方体贴图纹理来表示环境,例如户外场景。环境立方体贴图纹理将六个正方形图像组合成一个纹理。
语法¶
CreateEnvironmentCubeMapTexture imageFile size name
参数¶
|
您要从中生成环境立方体贴图纹理的 HDR 图像。 |
|
立方体贴图侧面图像的宽度和高度。 |
|
(可选)环境立方体贴图纹理的名称。 |
示例¶
# Create an environment cubemap texture named My Environment Cubemap Texture
# from the Library > Resource Files > Images > my_skybox_image.exr image and
# set the size of the cubemap side images to 1024x1024 pixels.
CreateEnvironmentCubeMapTexture "/Resource Files/Images/my_skybox_image.exr" 1024 "My Environment Cubemap Texture"
# Create an environment cubemap texture from the Library > Resource Files >
# Images > my_skybox_image.exr image. Let Kanzi Studio name the texture
# my_skybox_image_environment and set the size of the cubemap side images to
# 1024x1024 pixels.
CreateEnvironmentCubeMapTexture "/Resource Files/Images/my_skybox_image.exr" 1024
语法¶
CreateEnvironmentCubeMapTexture imageFile
参数¶
|
您要从中生成环境立方体贴图纹理的 HDR 图像。 |
示例¶
# Create an environment cubemap texture from the Library > Resource Files >
# Images > my_skybox_image.exr image and let Kanzi Studio name the texture
# my_skybox_image_environment. Kanzi Studio creates cubemap side images whose
# dimensions are one quarter of the width of the input image.
CreateEnvironmentCubeMapTexture "/Resource Files/Images/my_skybox_image.exr"
CreateIrradianceCubeMapTexture¶
使用辐照度立方体贴图纹理进行基于图像的照明。辐照度立方体贴图纹理将六个正方形的图像合成为一个纹理来表示漫反射环境光照。
语法¶
CreateIrradianceCubeMapTexture sourceImage samples size name
参数¶
|
您要从中生成辐照度立方体贴图纹理的 HDR 图像。 |
|
用于生成立方体贴图的样本数量。较多的样本数量会生成更准确地逼近环境光照的立方体贴图。 |
|
立方体贴图侧面图像的宽度和高度。 |
|
(可选)辐照度立方图纹理的名称。 |
示例¶
# Create an irradiance cubemap texture named My Irradiance Cubemap Texture
# from the Library > Resource Files > Images > my_skybox_image.exr image.
# Use 256 samples and set the size of the cubemap side images to 1024x1024
# pixels.
CreateIrradianceCubeMapTexture "/Resource Files/Images/my_skybox_image.exr" 256 1024 "My Irradiance Cubemap Texture"
# Create an irradiance cubemap texture from the Library > Resource Files >
# Images > my_skybox_image.exr image and let Kanzi Studio name the texture
# my_skybox_image_irradiance. Use 1024 samples and set the size of the cubemap
# side images to 256x256 pixels.
CreateIrradianceCubeMapTexture "/Resource Files/Images/my_skybox_image.exr" 1024 256
语法¶
CreateIrradianceCubeMapTexture sourceImage
参数¶
|
您要从中生成辐照度立方体贴图纹理的 HDR 图像。 |
示例¶
# Create an irradiance cubemap texture from the Library > Resource Files >
# Images > my_skybox_image.exr image and let Kanzi Studio name the texture
# my_skybox_image_irradiance. Kanzi Studio uses 1024 samples to generate the
# cubemap and creates cubemap side images whose dimensions are one quarter
# of the width of the input image but at most 256 pixels.
CreateIrradianceCubeMapTexture "/Resource Files/Images/my_skybox_image.exr"
CreateRenderTargetTexture¶
使用渲染目标纹理将内容从2D布局动态渲染到纹理中。
语法¶
CreateRenderTargetTexture textureName
参数¶
|
纹理的名称。 |
示例¶
# Create a render target texture named My Render Target Texture in the Library > Materials and Textures > Textures.
CreateRenderTargetTexture "My Render Target Texture"
# In My Render Target Texture set the Width and Height properties to 256.
SetProperty "/Textures/My Render Target Texture" RenderTargetTextureWidth 256
SetProperty "/Textures/My Render Target Texture" RenderTargetTextureHeight 256
CreateSingleTexture¶
当您想使用单一图像作为纹理时,使用单一纹理。
语法¶
CreateSingleTexture textureName image
参数¶
|
纹理的名称。 |
|
(可选)您设置为使用的图像资源。 |
示例¶
# Create a single texture named My Single Texture in the Library > Materials and Textures > Textures.
CreateSingleTexture "My Single Texture"
# Create a single texture named Image01 Texture in the Library > Materials and Textures > Textures and
# set the texture to use the Library > Resource Files > Images > Image01.png image.
CreateSingleTexture "Image01 Texture" "/Resource Files/Images/Image01.png"
CreateSpecularCubeMapTexture¶
使用镜面反射立方体贴图纹理进行基于图像的照明。镜面反射立方体贴图纹理将六个正方形的图像合成为一个纹理来表示反射环境光照。
语法¶
CreateSpecularCubeMapTexture sourceImage samples size name
参数¶
|
您要从中生成镜面立方体贴图纹理的 HDR 图像。 |
|
用于生成立方体贴图的样本数量。较多的样本数量会生成更准确地逼近环境光照的立方体贴图。 |
|
立方体贴图侧面图像的宽度和高度。 |
|
(可选)镜面反射立方体贴图纹理的名称。 |
示例¶
# Create a specular cubemap texture named My Specular Cubemap Texture
# from the Library > Resource Files > Images > my_skybox_image.exr image.
# Use 256 samples and set the size of the cubemap side images to 1024x1024 pixels.
CreateSpecularCubeMapTexture "/Resource Files/Images/my_skybox_image.exr" 256 1024 "My Specular Cubemap Texture"
# Create a specular cubemap texture from the Library > Resource Files >
# Images > my_skybox_image.exr image and let Kanzi Studio name the texture
# my_skybox_image_specular. Use 1024 samples and set the size of the cubemap
# side images to 256x256 pixels.
CreateSpecularCubeMapTexture "/Resource Files/Images/my_skybox_image.exr" 1024 256
语法¶
CreateSpecularCubeMapTexture sourceImage
参数¶
|
您要从中生成镜面立方体贴图纹理的 HDR 图像。 |
示例¶
# Create a specular cubemap texture from the Library > Resource Files >
# Images > my_skybox_image.exr image and let Kanzi Studio name the texture
# my_skybox_image_specular. Kanzi Studio uses 1024 samples to generate the
# cubemap and creates cubemap side images whose dimensions are one quarter
# of the width of the input image but at most 256 pixels.
CreateSpecularCubeMapTexture "/Resource Files/Images/my_skybox_image.exr"
轨迹创建¶
CreateAngleTrajectory¶
角度轨迹可用于创建两条直线在 3D 空间形成一个角的路径。
语法¶
CreateAngleTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create an Angle Trajectory named My Angle Trajectory in the Library > Trajectories.
CreateAngleTrajectory "My Angle Trajectory"
语法¶
CreateAngleTrajectory itemName selectNewItems resourceDictionary
参数¶
|
轨迹的名称。 |
|
Kanzi Studio 是否选择了您创建的轨迹。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create an Angle Trajectory named My Angle Trajectory and add it to the resource dictionary of the Screen node.
CreateAngleTrajectory "My Angle Trajectory" false "/Screens/Screen/<ResourceDictionaryInNode>"
CreateArcTrajectory¶
弧形轨迹可用于在 3D 空间创建弧形路径。
语法¶
CreateArcTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create an Arc Trajectory named My Arc Trajectory in the Library > Trajectories.
CreateArcTrajectory "My Arc Trajectory"
语法¶
CreateArcTrajectory library itemName selectNewItems resourceDictionary
参数¶
|
(可选)您创建轨迹的 Trajectory Library。 |
|
轨迹的名称。 |
|
Kanzi Studio 是否选择了您创建的轨迹。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create an Arc Trajectory named My Arc Trajectory and add it to the resource dictionary of the Screen node.
CreateArcTrajectory "My Arc Trajectory" false "/Screens/Screen/<ResourceDictionaryInNode>"
CreateCircleTrajectory¶
使用圆形轨迹在 3D 空间创建圆形路径。
语法¶
CreateCircleTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create a Circle Trajectory named My Circle Trajectory in the Library > Trajectories.
CreateCircleTrajectory "My Circle Trajectory"
语法¶
CreateCircleTrajectory library itemName resourceDictionary
参数¶
|
(可选)您创建轨迹的 Trajectory Library。 |
|
轨迹的名称。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create a Circle Trajectory named My Circle Trajectory and add it to the resource dictionary of the Screen node.
CreateCircleTrajectory "My Circle Trajectory" "/Screens/Screen/<ResourceDictionaryInNode>"
CreateEllipseTrajectory¶
椭圆轨迹可用于在 3D 空间内创建椭圆形路径。
语法¶
CreateEllipseTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create an Ellipse Trajectory named My Ellipse Trajectory in the Library > Trajectories.
CreateEllipseTrajectory "My Ellipse Trajectory"
语法¶
CreateEllipseTrajectory library itemName selectNewItems resourceDictionary
参数¶
|
(可选)您创建轨迹的 Trajectory Library。 |
|
轨迹的名称。 |
|
Kanzi Studio 是否选择了您创建的轨迹。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create an Ellipse Trajectory named My Ellipse Trajectory and add it to the resource dictionary of the Screen node.
CreateEllipseTrajectory "My Ellipse Trajectory" false "/Screens/Screen/<ResourceDictionaryInNode>"
CreateLineTrajectory¶
直线轨迹可用于在 3D 空间创建一条直线路径。
语法¶
CreateLineTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create a Line Trajectory named My Line Trajectory in the Library > Trajectories.
CreateLineTrajectory "My Line Trajectory"
语法¶
CreateLineTrajectory library itemName selectNewItems resourceDictionary
参数¶
|
(可选)您创建轨迹的 Trajectory Library。 |
|
轨迹的名称。 |
|
Kanzi Studio 是否选择了您创建的轨迹。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create a Line Trajectory named My Line Trajectory and add it to the resource dictionary of the Screen node.
CreateLineTrajectory "My Line Trajectory" false "/Screens/Screen/<ResourceDictionaryInNode>"
CreateRectangleTrajectory¶
矩形轨迹可用于在 3D 空间的矩形中创建路径。
语法¶
CreateRectangleTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create a Rectangle Trajectory named My Rectangle Trajectory in the Library > Trajectories.
CreateRectangleTrajectory "My Rectangle Trajectory"
语法¶
CreateRectangleTrajectory library itemName selectNewItems resourceDictionary
参数¶
|
(可选)您创建轨迹的 Trajectory Library。 |
|
轨迹的名称。 |
|
Kanzi Studio 是否选择了您创建的轨迹。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create a Rectangle Trajectory named My Rectangle Trajectory and add it to the resource dictionary of the Screen node.
CreateRectangleTrajectory "My Rectangle Trajectory" false "/Screens/Screen/<ResourceDictionaryInNode>"
CreateSpiralTrajectory¶
螺旋轨迹可用于在 3D 空间中创建螺旋形路径。
语法¶
CreateSpiralTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create a Spiral Trajectory named My Spiral Trajectory in the Library > Trajectories.
CreateSpiralTrajectory "My Spiral Trajectory"
语法¶
CreateSpiralTrajectory library itemName selectNewItems resourceDictionary
参数¶
|
(可选)您创建轨迹的 Trajectory Library。 |
|
轨迹的名称。 |
|
Kanzi Studio 是否选择了您创建的轨迹。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create a Spiral Trajectory named My Spiral Trajectory and add it to the resource dictionary of the Screen node.
CreateSpiralTrajectory "My Spiral Trajectory" false "/Screens/Screen/<ResourceDictionaryInNode>"
CreateTrapezoidTrajectory¶
梯形轨迹可用于在 3D 空间中创建梯形路径。
语法¶
CreateTrapezoidTrajectory itemName
参数¶
|
轨迹的名称。 |
示例¶
# Create a Trapezoid Trajectory named My Trapezoid Trajectory in the Library > Trajectories.
CreateTrapezoidTrajectory "My Trapezoid Trajectory"
语法¶
CreateTrapezoidTrajectory library itemName selectNewItems resourceDictionary
参数¶
|
(可选)您创建轨迹的 Trajectory Library。 |
|
轨迹的名称。 |
|
Kanzi Studio 是否选择了您创建的轨迹。 |
|
您添加轨迹的资源字典。 |
示例¶
# Create a Trapezoid Trajectory named My Trapezoid Trajectory and add it to the resource dictionary of the Screen node.
CreateTrapezoidTrajectory "My Trapezoid Trajectory" false "/Screens/Screen/<ResourceDictionaryInNode>"
导入 (Import)¶
ImportImages¶
将图像导入到项目中。
语法¶
ImportImages filePath createTextures
参数¶
|
您导入的图像的路径。 |
|
是否创建图像的纹理。 |
示例¶
# Import the C:\Temp\Image.png image to the project and create a single texture of the image.
ImportImages "C:\Temp\Image.png" true
磁盘¶
CleanCachedFiles¶
删除在您打开项目或导出 kzb 文件时,Kanzi Studio 在项目目录中创建的缓存文件。
语法¶
CleanCachedFiles
示例¶
# Delete the cache files that Kanzi Studio created in the project directory when you opened the project or exported the kzb file.
CleanCachedFiles
关闭解决方案¶
关闭当前打开的主项目及其引用的项目。
语法¶
CloseSolution
示例¶
# Close all projects.
CloseSolution
CompressImage¶
预处理所选图像。预处理可以包括图像压缩和生成 mipmaps。
语法¶
CompressImage imageFiles
参数¶
|
您要预处理的图像文件。 |
示例¶
# Preprocess the images Car.png and Background.png.
CompressImage "/Resource Files/Images/Image01.png; /Resource Files/Images/Image02.png"
CreateKanziApplication¶
为所选的构建配置创建一个 Kanzi Engine 应用程序。
语法¶
CreateKanziApplication buildConfiguration
参数¶
|
要为其创建应用程序的构建配置的路径。 |
示例¶
# Create an Android build configuration named MyAndroidProject in the
# Library > Build Configurations.
CreateApplicationConfiguration MyAndroidProject Android
# Create a Kanzi application directory hierarchy for the MyAndroidProject
# build configuration.
CreateKanziApplication "/Resource Files/Build Configurations/MyAndroidProject"
# Create a common build configuration named MyProject in the
# Library > Build Configurations.
CreateApplicationConfiguration MyProject
# Create a Kanzi application directory hierarchy for the MyProject
# build configuration.
CreateKanziApplication "/Resource Files/Build Configurations/MyProject"
DeleteExportedBinaries¶
从在 Project > Properties 中的 Binary Export Directory 属性中设置的目录中删除所有导出的文件。此命令会删除所有导出的文件,包括来自其他项目的文件。
语法¶
DeleteExportedBinaries
示例¶
# Delete the kzb files from the location set in the main project properties in the Binary Export Directory property.
DeleteExportedBinaries
语法¶
DeleteExportedBinaries exportDirectory
参数¶
|
您要从中删除 kzb 文件的目录。 |
示例¶
# Delete all kzb files from the C:\Temp directory.
DeleteExportedBinaries "C:\Temp"
ExitApplication¶
关闭 Kanzi Studio。
语法¶
ExitApplication allowCancel silentExit
参数¶
|
用户是否可以取消该操作。 |
|
Kanzi Studio 是否在不显示任何对话框的情况下关闭。 |
示例¶
# Close Kanzi Studio but let the user cancel the closing. Show dialogs when closing Kanzi Studio.
ExitApplication true false
语法¶
ExitApplication
示例¶
# Close Kanzi Studio.
ExitApplication
ExportAllProjectBinaries¶
导出主项目和已加载引用项目的 kzb 文件。将导出的 kzb 文件复制到在主项目属性的 Binary Export Directory 属性中设置的目录。
语法¶
ExportAllProjectBinaries
示例¶
# Export the kzb files of the main project and loaded referenced projects to the location set
# in the main project properties in the Binary Export Directory property.
ExportAllProjectBinaries
语法¶
ExportAllProjectBinaries targetDirectory compressImages exportKzbPlayer
参数¶
|
要导出 kzb 文件的目录。 |
|
是否预处理项目中的图像。 |
|
是否使用 kzb Player 将项目导出为独立的 Windows 应用程序。 |
示例¶
# Export the kzb files of the main project and loaded referenced projects to the C:\Temp\MyProject\ directory,
# preprocess the images, and export the project as kzb Player for Windows.
ExportAllProjectBinaries "C:\Temp\MyProject\" true true
ExportBakedThemeBinaries¶
为每个启用了 Export Baked Usages 属性的主题组和主本地化表的组合导出一个 kzb 文件。
语法¶
ExportBakedThemeBinaries
示例¶
# Export baked themes.
ExportBakedThemeBinaries
ExportBinary¶
根据设置导出 kzb 文件以用于 Kanzi Engine API,以及用于本地化和主题的 kzb 资源包。
语法¶
ExportBinary exportThemesAndLocaleResourcesSeparately exportXml
参数¶
|
Kanzi Studio 是否将主题和语言环境资源导出到单独的 kzb 文件。 |
|
Kanzi Studio 是否导出 kza 文件,即 kzb 文件的 XML 版本。 |
示例¶
# Export the kzb file, theme and locale resources, and the kza file to the location set in the Project > Properties in the Binary Export Directory property.
ExportBinary true true
语法¶
ExportBinary fileName
参数¶
|
kzb 文件的名称。 |
示例¶
# Export the kzb file to the C:\Temp\project.kzb file.
ExportBinary C:\Temp\project.kzb
ExportBinaryWithApplication¶
使用 kzb Player 和 kzb 文件将项目导出为独立的 Windows 应用程序。
语法¶
ExportBinaryWithApplication
ExportDescriptions¶
将项目中所有 Description 属性的内容导出到一个纯文本文件中。
语法¶
ExportDescriptions root outputFile
参数¶
|
(可选)您导出其描述的节点树的根节点。如果您未设置此参数,Kanzi Studio 将导出项目中所有项目的描述。 |
|
导出描述的文件。 |
示例¶
# Export the project documentation to the plain text file C:\Temp\Descriptions.txt.
# The file includes the name, path, and description of items that have the Description property.
ExportDescriptions "C:\Temp\Descriptions.txt"
# Export the descriptions of the RootPage > Viewport 2D > Scene node and its descendants
# to the plain text file C:\Temp\Descriptions.txt.
ExportDescriptions "/Screens/Screen/RootPage/Viewport 2D/Scene" "C:\Temp\Descriptions.txt"
ImportProject¶
将另一个 Kanzi Studio 项目导入到活动项目中。
语法¶
ImportProject importProjectPath
参数¶
|
您导入的 Kanzi Studio 项目文件的完整路径名。 |
示例¶
# Import the Kanzi Studio project C:\KanziWorkspace\Projects\My Project\My Project.kzproj.
ImportProject "C:\KanziWorkspace\Projects\My Project\My Project.kzproj"
LoadMaterialType¶
从磁盘加载材质类型 (Load Material Type From Disk)
语法¶
LoadMaterialType loadPath
参数¶
|
您加载的 kzmat 文件的路径。 |
示例¶
# Load the C:\Program Files\Rightware\Kanzi\Studio\Asset Library\MaterialTypes\VertexPhong\Postprocessing\PostprocessingBoxBlur.kzmat file.
# Kanzi Studio adds to the Library > Materials and Textures > Material Types the PostprocessingBoxBlur material type and
# creates the PostprocessingBoxBlurMaterial material which uses the PostprocessingBoxBlur material type.
LoadMaterialType "C:\Program Files\Rightware\Kanzi\Studio\Asset Library\MaterialTypes\VertexPhong\Postprocessing\PostprocessingBoxBlur.kzmat"
LoadProject¶
从磁盘打开项目。
语法¶
LoadProject path
参数¶
|
您打开的项目。 |
示例¶
# Open the C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj project.
LoadProject "C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj"
NewProject¶
创建一个Kanzi Studio项目。
语法¶
NewProject newProjectFilePath
参数¶
|
您创建的项目的路径。 |
示例¶
# Create a new Kanzi Studio project C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj.
NewProject "C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj"
SaveMaterialType¶
保存材质类型至磁盘 (Save Material Type to Disk)
语法¶
SaveMaterialType savePath materialType
参数¶
|
保存材质类型的文件的完整路径。 |
|
您保存的材料类型。 |
示例¶
# Save the My Material Type material type to the C:\Temp\My Material Type.kzmat file.
SaveMaterialType "C:\Temp\My Material Type.kzmat" "/Material Types/My Material Type"
SaveProject¶
将项目保存到磁盘。
语法¶
SaveProject savePath continueWorkingInOldPath
参数¶
|
您保存项目的位置。 |
|
Kanzi Studio 是否继续在您打开项目的目录中工作。当您将项目保存到其他位置时,将此参数设置为 false。 |
示例¶
# Save the C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj project.
SaveProject "C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj" true
构建 (Building)¶
ExportApk¶
使用在 Project > Properties > Building > Default Build Configuration 中设置的构建配置来构建和部署 Android Package (APK)。
语法¶
ExportApk buildConfiguration compressImages
参数¶
|
构建 Android 包 (APK) 时要使用的构建配置。 |
|
是否预处理项目中的图像。 |
示例¶
# Build the APK file using the Library > Build Configurations > MyProject application configuration.
# If the project contains images that use texture compression, compress these images.
ExportApk "/Resource Files/Build Configurations/MyProject" true
预览 (Preview)¶
StartPreview¶
启动预览。
语法¶
StartPreview
示例¶
# Start the Preview.
StartPreview
常规 (General)¶
插件¶
执行在 Kanzi Studio 插件中定义的命令。
语法¶
Plugin pluginCommandName projectItem
参数¶
|
插件命令的内部名称。 |
|
(可选)您要从其上下文菜单中运行插件命令的项目项。 |
示例¶
# Execute the Kanzi Studio plugin command named MyPluginCommand.
Plugin "MyPluginCommand"
# Execute the Kanzi Studio plugin command named MyPluginCommand from the context menu of the RootPage node.
Plugin "MyPluginCommand" "/Screens/Screen/RootPage"