Node Copied to Clipboard!

Editor Documentation - Template

Practice Of Templates

Activating Templates Tab.

  • Click the triangle of any tab.
  • Choose Add Tab group then click Templates.
  • A Templates tab should show.
  • In Templates tab you can manage your templates.

Extracting Template

  • Identify the nodes or process you want to transform to a template.
  • Click on empty space in Storyboarder and move the cursor to cover the nodes you want to form a template just like we select multiple files in Windows.
  • If you expect the template can apply to different items in the future, you do not need to select the object(s) that your nodes manipulate.
  • As the picture shows, we use two Animate nodes to control the cone. We only need to select these two Animate nodes and all the lines involved and leave the cone not selected. All the selected items will be highlighted by yellow lines.
  • Right click on any selected item and click Extract Template in the right click menu
  • An Extract Template dialogue will pop up and you can name the template.
  • Meanwhile the editor identifies that this template is trying to manipulate an object(Cone) and treats it as a reference to the template, and you can rename the reference as well. After renaming click OK.
  • Now we get a one pice node with the reference object(Cone) in it.
  • We should find a newly created template in the Templates tab as well.

Using A Template

  • Click and drag the template from Templates tab to Storyboarder.
  • A new corresponding template node should show in the Storyboarder.
  • As we can see, the template node named UpDown is expecting a reference that it can manipulate.
  • Drag an object from the Edit View or Scene tab and put it into the template node's slot which is named 'Item' in this case.
  • Link the new template node next to the former one and click Play button, we will see the Box jumps up and down just likes the cone does.
  • You can get a demonstration lesson below.

Editing A Template

  • We can also edit a template by double click the template node or the template in Templates tab.
  • After double clicking, we will step into the template and we can edit it properly.

Adding Variables To A Template

Now we can modify the template to be able to control two items. Let's do it step by step:

  • Double click the template in Templates tab to step into the node for further editting.
  • We can add variables via Begin node. There is a small + sign at its bottom left of the node. Click the + sign.
  • We can see the Begin node adds an empty slot.
  • Before we perform the following operations please ensure that you are in Expert mode. If you are not in Expert mode, you can switch to it in Editor Options tab by clicking 'Settings' button on the left of Editor.
  • Right click on empty space of Storyboarder and follow the selection: Type>>Scene>>Model.
  • We should get a dark blue node called SceneModel. This node declares what type the new variable is.
  • Right click on empty space of Storyboarder and follow the selection: Variables>>New.
  • We should get an unnamed light blue node. Let's rename it to Item2 in Properties tab. Then drag this node and attache it to the dark blue one. This operation builds the relationship between the variable and the type.
  • Now drag the combined node to the slot in Begin node.
  • The Item2 is ready to use. Right click on empty space of Storyboarder and follow the selection: Variables>>Item2.
  • We should get a green node called Item2. And we can add animations based on it, just like the first item. Now we create two new animations to control the Item2 move up and down.
  • Step back to the main Storyboarder. As we can see, the old template node still has only one parameter. Right click on the template node and choose Update Parameters.
  • The template node should be updated and has two parameter slots with one filled with Cone and the second one waiting for us to assign an object to it.
  • Drag the cube from Edit View to the empty slot.
  • Run the lesson by clicking Player button and we will find that the cube jumps up and down after the movement of the cone.

Shared Templates

Shared templates allow users apply them in different lessons under the same project.
Moving an existing lesson template to a shared template group

  • Given that we already have an existing template called 'UpAndDown' in the Lesson group.
  • Create a new template group by right clicking on empty area of Templates tab and choose 'Add Template Group'.
  • Name the template group and click OK. A template group should be added to the Templates tab.
  • Drag the 'UpAndDown' template from the original group to the newly created group 'ShareTemplates'.
  • As the group of the template has changed, Editor expects a specific path to identify where the template comes from. Right click on the Storyboarder and type the new template group name 'SareTemplates' in this case. Choose the corresponding selection of the right click menu and a new node named after the new template group will be added to the Storyboarder.
  • Link the group node 'ShareTemplates' to the original template node 'UpAndDown' and simulate. The template will be working well as before and you will be able to use this template in any other lessons under the project.
  • Note that after moving the template to the new group, if you drag the template to Storyboarder again, Editor will automatically attach the group node to the template node.
  • Right click on the template node and choose Update Parameters, so that the template's parameters can work correctly.

Creating A New Shared Template

  • Create a template group by right clicking on empty area of Templates tab and choose 'Add Template Group'.
  • Name the template group and click OK.
  • Right click on the newly added template group and choose 'Add New Template'. Name the template and click OK.
  • A new template should be added to the template group.
  • Double click on the new template and you will step into the template node for further edit.