09-Origami中文帮助-Workflow-Patch Organization

Dosen原创

这是我学习quartz composer,Origami,看官方文档翻译下来的,每天一篇,有不准确的地方希望能指出,一起交流进步。转载请与我联系,擅自转载视作侵权。


Patch Organization      模块组织


It's easy to get lost in all the crossing cables. Here are some tips to help you organize your document.

在交错的连线中很容易找不到头绪,这里是一些小技巧,可以帮你组织你的文件。



Name patches       重命名模块


You can give any patch a custom name by double clicking the title or selecting the patch and pressing⏎. It's often helpful to give patches names that describe what they're doing in the context of your prototype. For example, if you had a Switch patch responsible for switching a photo between a thumbnail (off) and full screen state (on), you could name the Switch "Photo is Fullscreen". It would be clear immediately what that chain of patches is responsible for and what the on state of the Switch represents.

你可以对任何模块通过双击标题或选择模块并按下⏎来自定义名字,给模块一个名字来形容它在你原型中的作用往往是很有用的。例如,如果你有一个开关模块负责切换一个图片的缩略图和全屏状态,你可以给Switch一个名字“图片全屏”,它会清晰直接地表示模块负责什么,开关代表的什么状态。



Create notes      创建注释


Notes can be useful to describe what sections of patches are responsible for in your prototype. Add a node by right-clicking on the document and selectingAdd Note....

注释对于描述模块在原型中的作用很有用。在文件上点击右键,选择添加注释。



Organize patches left to right      从左到右组织模块


Since patches take inputs from the left and output to the right, it makes sense to arrange them from left to right. Generally blue patches always on the right, since they don't have outputs.

因为模块从左端输入并且在右端输出,所以有理由把它们从左至右的排列。一般蓝色模块往往在右边,因为它们没有输出。

Organizing all Layers so they are vertically stacked in their Layer order will help make the document more readable. Use⌘◀or⌘▶to align patches arranged in a column.

组织所有层按照它们的顺序垂直的堆叠会让文件更有可读性。使用 ⌘◀ 或 ⌘▶ 使模块成一列。



Group related Layers to reduce cable clutter  将有关联的层成组减少混乱的线


UseLayer Groupsto hold multiple Layers that animate together. For example, if you're sliding up a window with multiple layers inside of it, putting those layers in a layer group will let you just animate up that one group up instead of needing to have cables connected to several different layers.

将一起动画的一些层使用Layer Groups(层组)成组。例如:如果你一个有很多层在里面的窗口,把那些层放在一个Layer Groups里,你只要给这一个组动画就可以了,而不必用线连接很多不同的层。



Use wireless patches to broadcast common values  使用无线模块播送通用值


Wireless BroadcasterandWireless Receivercan send values across your composition without the use of cables. A Broadcaster will make a value available anywhere in the same document. A Receiver can receive a value from any Broadcaster.

无线播送器和无线接收器可以不通过连线发送一个值越过你的组合。一个播送可以让一个值在同一个文件中的任何地方都有效。一个接收器可以接收来自任何播送器的值。

There are a couple types of values that are particularly useful to broadcast:

这里是一些特别适用播送功能的类型的值:

~Static values used in different places across your prototype. For example, say you had a padding value that you used to lay out a bunch of different parts of your UI. You'd just need to change one broadcaster and the different elements of your prototype would adjust accordingly.

~静态值穿过你的原型用在不同的地方。例如:如果你有一个填充值用于展示你UI的一堆不同的部分,你只需要改变一个播送器,这些你原型的不同的组成部分就会相应的调整。

~State values from patches like Switch, Index Switch, Counter, Conditional, etc. It's common to use the same state value in several different places in your composition - so it's often helpful to name it through the wireless system and have access to it anywhere on the graph.

~例如开关模块的状态值,计数,条件,等。它常用于在你的组合中几个不同的地方使用了相同的状态值-所以它经常在通过无线系统进行命名时很有用并且在图表上任何地方都能进入。

Create a Broadcaster by pressingWwhile hovering on an output, or on a blank space in the document. A Broadcaster made from an output will automatically inherit the type, whereas a Broadcaster on a blank space will default to Virtual (which means you need to manually change it to a different type with Patch Settings⌘2if you want to assign it a value directly).

当悬停在一个输出上或者在文档空白的地方时按下‘w’来创建一个播送器。由输出创建的播送器自动地继承类型,而在空白地方创建的播送器默认是虚拟的(也就意味着,如果你想要直接给它赋值就需要手动地通过模块设置⌘2改变它的类型)。

Create a Receiver by pressingWwhile hovering on an input. It will automatically be connected to the last-placed Wireless Broadcaster (however the name may not be reflected until you deselect the Receiver). You can change the Broadcaster in thePatch Settings⌘2in the dropdown.

当悬停在输入时按‘w’创建一个接收器,它会自动地连接最后放置的播送器(然而直到你取消选中的接收器前名字并不能反射)。你可以在模块设置⌘2的下拉菜单里改变播送器。



Macros to hide complex logic      用宏隐藏复杂的逻辑


Similarly to grouping Layers, you can useCreate Macroto create bundles of logic. Generally you should group logic that when combined has an easily described purpose, for example "Scroll Speed Detector". You can make Macros within Macros as well.

类似于给层打组,你可以使用Create Macro创建逻辑的包。通常给有共同目的的逻辑打组,比如"滚动速度监测器"。你也可以在一个宏内创建宏。

“宏”的概念大概类似于,由几个模块组成可以实现一个功能或作用,那么组合以来,以后用这个功能时,直接调用这个宏,而不需要重新组合一遍模块。

Often when you group, the labels of the ports are unhelpful and generic. Rename the ports by selecting the Macro and pressing⌘3to accessInput & Output Settings. Double-click on a port to rename.

经常当你打组时,接口的标签是没用的,选住这个宏并按下⌘3进入Input & Output Settings里重命名接口。在接口上双击重命名。

Sometimes you may have a Macro that you keep using over and over again. In these cases it may make sense to add it to yourPatch Library. Once you've made a Macro, go into the Macro, select all the patches and hitAdd to Library. Fill in the information (the patch preview will show incorrect names for the inputs/outputs at first). Once you've added it, you can re-use it anywhere — even share it with teammates.

有时候,如果你一遍又一遍地使用一个宏,把它添加进你的模块库也许更有意义。进入你制作的这个宏力,选择所有模块然后点击Add to Library,填上信息。如果你添加到了库,你可以在任何地方使用它,甚至把它分享给你的团队成员。



Publishing inputs and outputs      发布输入和输出


With Layer Groups and Macros, it maybe confusing at first how to send values in or out of the group. You can publish inputs/outputs up a level by right-clicking on a patch and selecting the port you want to publish, or by hovering on a port and pressingP.

Layer Groups和Macros,可能一开始会困惑如何让一个值从一个组输入或输出,你可以在一个模块上右键点击发布输入/输出来使这个属性在上一层级也能看到,选择你想要发布的接口,或者悬停在一个接口上按下‘P’。

这个功能在使用层组和宏时,非常有用,比如:你有一个可以自定义位移距离的特定动画的宏,那么这个宏需要一个接口输入一个值,一个接口输出结果,但是这两个接口在宏内部,这时,你需要把这两个接口上升一个层级,在宏上显示,就需要用到这个功能了。

However, right-clicking does not work to send inputsfrom the outsideinto a Layer Group/Macro. Instead, you can drag any cable onto a Layer Group/Macro, and it will automatically create a splitter within that is published with the name you enter.

然后,右键点击无法让外面的输入进入到一个层组/宏中。可替代的是,你可以拖拽任何线到一个层组/宏上,然后它会让你输入一个名字并自动的创建一个分流器来完成发布。

You can reorder and rename the ports on a Layer Group/Macro by accessingInput & Output Settings(select the patch,⌘3). Drag the port names to reorder.

你可以通过Input & Output Settings对层组/宏上的接口重新排序或命名(选中模块,⌘3),拖动接口的名字重新排列。

你可能感兴趣的:(09-Origami中文帮助-Workflow-Patch Organization)