Urho3D编辑器是一个脚本应用程序,可以与Urho3D播放器应用程序一起运行。要开始,请执行以下任意命令:(在bin目录中)Editor.bat、Editor.sh或Urho3DPlayer Scripts/Editor.as
Urho3D播放器应用程序支持的所有命令行选项也可用于Editor。此外,编辑器还支持以下命令行选项:
-scene </path/to/scene.xml> Load a scene after starting up
提示:要查看更多内容,请运行Physics示例应用程序(bin/Data/Scripts/11_Physics.as),然后按F5。这会将名为Physics.xml的场景文件保存到Data/Scenes子目录中,该子目录可以在编辑器中加载。NinjaSnowWar和SceneAndUILoad示例所使用的场景也存在于Data/Scenes子目录中,NinjaSnow War对象“预置”位于Data/Objects子目录中。
控件(标准样式热键)
Left mouse - Select nodes or drag the node transform gizmo. Hold Shift to
select components instead. Hold Ctrl to multiselect.
Right mouse - Hold down and move mouse to look around
Middle mouse - Hold down orbits the camera
Shift+Middle mouse - Hold down pans the camera
Mouse wheel - Camera zoom in/out
WSAD or arrows - Move
Shift+WSAD - Move faster
E - Ascend
Q - Descend
Shift+E,Q - Ascend or descend faster
F/Home - Center view on currently selected
Numpad5 - Toggle orthographic/perspective camera
Numpad1 - Front view
Numpad3 - Right hand view
Numpad7/9 - Top view
Ctrl+Numpad1 - Back view
Ctrl+Numpad3 - Left view
Ctrl+Numpad7/9 - Bottom view
Ctrl+1,2,3 - Object manipulation mode: move/rotate/scale
Ctrl+4 - Object selection mode, no manipulation
Ctrl+5 - Toggle between world and local axes manipulation
Ctrl+6,7 - Cycle through components to pick: geometries, lights, zones,
collision shapes; and ui-elements
Ctrl+arrows - Manipulate node in X & Z directions
Ctrl+pgup/pgdn - Manipulate node in Y direction
Ctrl+plus/minus - Scale node uniformly (scale mode only)
Ctrl+Shift+N - New scene
Ctrl+O - Open scene
Ctrl+S - Save scene
Ctrl+Shift+S - Save scene as
Ctrl+A - Select all root level nodes
Ctrl+Shift+A - Deselect all nodes
Ctrl+X,C,V - Cut/copy/paste node or component
Ctrl+D - Duplicate node or component
Ctrl+E - Enable/disable node hierarchy or component
Ctrl+U - Unparent scene node
Ctrl+H - Open the scene hierarchy window
Ctrl+I - Open the attribute inspector window
Ctrl+P - Toggle scene update on/off
Ctrl+W - Cycle through solid, wireframe and point rendering
Ctrl+Z - Undo
Ctrl+Y - Redo
Ctrl+Space - Open quick menu
Alt+I - Toggle component debug icons
Alt+W - Open color wheel menu
ESC - Close the file selector or editor settings window
DEL - Delete node or component
F1 - Toggle console
F2 - Toggle rendering debug geometry
F3 - Toggle physics debug geometry
F4 - Toggle octree debug geometry
F5 - Toggle navigation debug geometry
F11 - Captures a screenshot
F12 - Toggle UI
编辑器设置“使用鼠标中键平移”将控件切换到以下位置:
Middle mouse - Hold down pans the camera
Shift+Middle mouse - Hold down orbits the camera
编辑器设置“围绕选择旋转”控制相机是否围绕选择或视图中心旋转
PaintSelect工具的用法:
按键C-启用/禁用PaintSelection工具(圆)以在视口中选择原点,在使用圆绘制时按住Ctrl键以启用取消选择操作
按键空格-在工具栏中启用ShowOrigins时,在视口中显示/隐藏几乎放置的原点的名称
控件(混合器样式热键)
热键列表仅显示与标准样式的差异
Left mouse - Drag the node manipulator gizmo
Middle mouse - Hold down orbits the camera
Shift+middle mouse - Hold down pans the camera
Right mouse - Select objects
Shift+F - Enter/Exit camera's flying mode
G,R,S - Object manipulation mode: move/rotate/scale ( note: camera flying mode must be off to do this manipulation)
Cycle press G,R,S - Toggle between world and local axes manipulation
Shift+D - Duplicate node or component
H - Enable/disable node hierarchy or component
Alt+H - Enable all nodes hierarchy or component in scene
Alt+P - Unparent scene node
Ctrl+P - Parent all selected scene nodes to last selected node
Z - Cycle through solid, wireframe and point rendering
M - Show/Hide LayerEditor
X - Delete node or component
Alt+D - Smart Duplicate (note: select one of axises on gizmo to show direction for next instance)
Key "." or Del - Center view on currently selected
如果要在不更改对象选择的情况下散焦活动窗口,请在三维视图中按鼠标右键。
“使用鼠标中键平移”选项在混合器热键模式下无效。
工作流
从空场景开始时,首先设置资源路径(文件->设置资源路径)。这是基本目录,导入资源时将在该目录下创建子目录Models、Materials和Textures。
场景应保存到此基本目录或其直接子目录中,例如场景或级别。
检查“编辑器设置”窗口,使相机参数与所使用对象的大小匹配。
设置窗口中的“记住资源路径”选项控制下次运行时是否记住您设置的资源路径。
编辑器设置将在退出时保存到My Documents目录中的Urho3D\editor\Config.xml文件中。如果要将设置还原为默认值,请删除此文件。
编辑
从顶部的“创建”菜单中创建新的场景节点和组件。然后可以在属性检查器窗口中编辑它们的属性。请注意,所示的节点变换是局部变换(从父节点偏移)
作为使用变换gizmo的替代方法,可以通过Ctrl+箭头键和Page Up/Page Down移动/旋转/缩放场景节点。按Ctrl+1,2,3可更改操纵模式,按Ctrl+4可在世界相对移动和场景节点相对移动之间切换。
若要重新分配场景节点或UI元素,请将它们拖放到场景层次窗口中的新父节点上。重新绘制应该保留有效的世界变换,因此之后从组件窗口检查本地变换是否符合您的期望。不能在节点之间拖动组件,但可以通过剪切/复制/粘贴操作复制组件。
要对同一父级中的节点或UI元素重新排序而不是重新排列,请在拖放时按住Ctrl键。
要从场景中定位场景节点,请在层次窗口中双击该节点。
要在当前节点中创建或删除用户变量,请在节点属性下面的编辑字段中键入变量名称,然后按旁边的新建或删除按钮。新建按钮将提示选择变量类型。
编辑时,可以使用“文件”菜单中的“运行脚本”项执行脚本文件。这些是在即时模式下执行的AngelScript文件,即不需要定义函数。编辑器的场景将作为全局属性“场景”可供脚本访问
相同类型的组件可以进行多重编辑。如果属性值不同,则属性字段将留空,但编辑属性会将更改应用于所有组件。
除了整个场景之外,还可以加载和保存单个场景节点(包括其所有组件和子节点)(文件->加载节点,文件->将节点另存为。)这些节点可以作为“预制件”来加快场景构建。要保存节点,首先需要在层次结构窗口中选择该节点。
可以从“创建”菜单实例化图元几何体(长方体、球体、圆柱体)。注意,这些只是bin/Data/Models目录中的普通模型文件;它们的Blender格式源文件位于SourceAssets目录中。
此外,资源浏览器可用于访问资源目录的内容。无论何时打开编辑器或加载场景,资源浏览器都会扫描资源。如果资源在任何时候发生更改,可以按下资源浏览器右上角的重新加载按钮,资源浏览器将重新扫描。提供了两种查找资源的方法。文件夹的树视图和搜索栏。搜索框使用文件名的简单字符串子字符串。还可以通过打开过滤器面板(由小过滤器图标切换)按类型过滤资源。每种资源类型都有很多上下文选项,例如将资源拖动到层次视图、LineEdit或视口中。浏览器中资源上的右键单击上下文菜单将为每个资源类型提供附加选项。
导入
编辑器可以从“开放资源导入库”支持的所有格式导入模型或场景,请参见http://assimp.sourceforge.net/main_features_formats.html
模型和场景导入的工作方式不同:模型导入将获取源文件中的所有内容(例如Collada场景),并将其组合到一个模型中,可能包含许多子几何体。另一方面,场景导入将分别导出每个源场景节点,根据需要创建多个模型。
导入模型时,它也将作为带有StaticModel组件的新场景节点实例化到场景中。
要进行实际导入,编辑器将从运行Urho3DPlayer应用程序的同一目录中调用AssetImport,因此请确保两者都已构建。
如果导入的场景没有灯光,将创建一个平行光,这样您至少可以看到一些东西。