User Tools

Site Tools


Selecting Nodes

Node selection within the scene can be very important in guiding the user. Use the select instruction type to guide the user to select a specific node in the Scene (WIP) pane. The query for the instruction can be a reference to the name of a node, or a reference to the order of creation.

Click the name of the example below to save it as a file.

Interactive_Lesson_Node_Selection_Example_1.dsa
var oLessonMgr = MainWindow.getInteractiveLessonMgr();
oLessonMgr.begin([
	{
	"select": "Genesis",
	"info": "You need to select something in the scene named Genesis"
	}
]);

When using a named reference to a node, the query allows the use of a dot operator to indicate a node child.

Click the name of the example below to save it as a file.

Interactive_Lesson_Node_Selection_Example_2.dsa
var oLessonMgr = MainWindow.getInteractiveLessonMgr();
oLessonMgr.begin([
	{
	"select": "Genesis.rHand",
	"info": "Select Genesis' Right Hand"
	}
]);

Sometimes you need to select the last node created, or a node created a number of steps in the creation sequence prior. The select instruction supports a node back notation. The element in the query can be one of “node”, “figure”, “light”, or “camera”. The position is a number that represents a count of elements to go, in the reverse direction. The query “figure@0” would target the most recent figure created in the scene.

Here is a full example:

Click the name of the example below to save it as a file.

Interactive_Lesson_Selection_Example_3.dsa
var oLessonMgr = MainWindow.getInteractiveLessonMgr();
oLessonMgr.begin([
	{
	"action": "DzNewAction",
	"info": "Start with a new scene."
	},
	{
	"action": "DzPrimitiveAction",
	"result": "node",
	"info": "Please create a sphere."
	},
	{
	"action": "DzPrimitiveAction",
	"result": "node",
	"info": "Please create a cube."
	},
	{
	"select": "node@0",
	"info": "Select the last node you created (the most recent one).",
	},
	{
	"select": "node@1",
	"info": "Select the first thing you created (the 2nd most recent one).",
	}
]);