User Tools

Site Tools


action

Actions are an integral part of DAZ Studio. They are available to users as buttons in a Toolbar, items in a Menu and/or bound to keyboard shortcuts.

The Interactive Lesson Manager will guide a user to any action that exists within the interface when you define an instruction of the action type. It will first attempt to locate the specified action, using its class name, in any visible toolbar. If the action cannot be located in a toolbar, the Main Menu Bar will be checked. If the action cannot be located in the main menu bar, each Pane (Tab) Option Menu will be checked. If the action is not located within the interface, the action instruction will silently fail.

When the specified action exists in a toolbar, the action will be highlighted within that toolbar. If an action does not exist within a toolbar, but does exist in a menu, Interactive Lesson Manager will guide the user to that menu and ultimately to the action. When guiding a user to an action in a menu, all menu items for actions other than the one specified will be disabled - leaving only the relevant items along the path to the action enabled.

Many actions cause a dialog to be displayed, requiring some level of user interaction. In most cases, providing the user with simple instructions prior to that dialog being displayed, using the info_member member, is usually sufficient. Support for guiding the user through complex dialogs is planned, but is currently not supported.

For actions that can be toggled, an optional value member can be included to check if that action is on or off (true or false). If the action is currently toggled to that value, the instruction is considered complete and will be skipped. Use this to ensure a specific state. Caution should be used when dealing with actions that are in an exclusive radio group. For example, guiding the user to deselect a specific Viewport Tool would be problematic, but guiding the user to the desired Viewport Tool works very well.

When defining an action instruction, an optional result member can be included to cause the instruction to repeat until the user causes the intended result to be produced. For instance, adding a node to the scene:

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

Interactive_Lesson_Action_Example.dsa
var oLessonMgr = MainWindow.getInteractiveLessonMgr();
oLessonMgr.begin([
	{
	"action": "DzNewAction",
	"info": [
		"<html><body><table width=350><tr><td>",
		"<h3 align='center'>New Scene</h3>",
		"<hr>",
		"Lets start by clearing the <em>Scene</em>.  We can ",
		"do that by locating and clicking on the <b>New</b> action.",
		"<br/><br/>",
		"<small><em><b>Note:</b> This action also clears the Undo Stack.  This ",
		"means that once you click the action you will not be able to go ",
		"back in time, to the state before the action was clicked.</em></small>",
		"</td></tr></table></body></html>"
		].join("")
	},
	{
	"action": "DzPrimitiveAction",
	"result": "node",
	"info": [
		"<html><body><table width=350><tr><td>",
		"<h3 align='center'>Create a Primitive</h3>",
		"<hr>",
		"Now, let's create a new primitive.  We suggest creating a ",
		"sphere using the default options.",
		"<br/><br/>",
		"<small><em><b>Note:</b> You can cancel the dialog that pops up as ",
		"a result of clicking the action, but this guide will not advance ",
		"until you actually create a new node.</em></small>",
		"</td></tr></table></body></html>"
		].join("")
	}
]);