Host (object)¶
バージョン 1.12.0 で追加.
Host object encapsulates data about the host DCC that the event originated from. It is also used to propagate data back to the DCC, such as undo/redo commands, and parameter changes.
参考
Members¶
String | hostName | The name of the host DCC. This could be ‘Maya’, ‘Softimage’, ‘3dsMax’ etc.. |
Boolean | redrawRequested | A boolean flag indicating that the Host application needs to redraw its viewport. |
UndoRedoCommand[] | commands | An array of commands generated during the event handling. These commands will be added as a single command on the Host undo/redo stack. Usually, this will be an array containing 0, or 1 items, but it is possible for a manipulator to generate multiple changes within the same event. |
String | dirtifyNode | A string indicating the name of the node in the Host graph that should be dirtied. |
String | customCommand | The name of a custom command that should be invoked in the host. |
String[] | customCommandArgs | A string containing any arguments for the custom command. |
ParamDict | customCommandParams | A param list containing any parameters for the custom command |
Methods¶
Host ( in Host other ) | |
Host () | |
addUndoRedoCommand ! ( in UndoRedoCommand command ) | |
callCustomCommand ! ( in String customCommand, in ParamDict params ) | |
callCustomCommand ! ( in String customCommand, in String args[] ) | |
Host | clone ? () |
dirtifyDCCNode ! ( in String dirtifyNode ) | |
String | getHostName ? () |
requestRedraw ! () |
Methods in detail¶
copy constructor
Host ()
Host.addUndoRedoCommand! ( in UndoRedoCommand command )
Adds a new command to the Host object to be propagated back and added to the undo stack of the host application.
command | the command to add to the host application stack. |
Host.callCustomCommand! ( in String customCommand, in ParamDict params )
バージョン 2.0 で追加.
Specify a custom command to invoke in the DCC along with a parameter list.
Host.callCustomCommand! ( in String customCommand, in String args[] )
バージョン 1.13.0 で追加.
Specify a custom command to invoke in the DCC along with an args string.
/*
** Example: callCustomCommand String args[]; args.push("Sphere.radius"); args.push("3.2"); if(this.hostName == 'Maya'){ event.getHost().callCustomCommand("setAttr", args); else if(this.hostName == 'Softimage'){ event.getHost().callCustomCommand("setValue", args);
*/
customCommand | The name of a custom command that should be invoked in the host. |
A | string containing any arguments for the custom command. |
clone method
Host.dirtifyDCCNode! ( in String dirtifyNode )
バージョン 1.13.0 で追加.
Specify a DCC node to dirtify.
注釈
the name of the node to dirty can often be determined by EvalContext provided with the evaluation of the Splice node.
/*
** Example: dirtifyDCCNode event.getHost().addUndoRedoCommand(MyCommand()); event.getHost().dirtifyDCCNode("MyNode");
*/
// Notify the system that data has changed, and that we should redraw
event.getHost().requestRedraw();
dirtifyNode | The name of the node in the DCC to be made dirty. |
Gets the name of the host application.
Host.requestRedraw! ()
Requests that the host application redraw its viewports.
注釈
This redraw could also cause the Splice drawing to be invoked.