draggerContext [-anchorPoint float float float] [-button int] [-currentStep int] [-cursor string] [-dragCommand script] [-dragPoint float float float] [-drawString string] [-exists] [-finalize script] [-helpString string] [-history boolean] [-holdCommand script] [-image1 string] [-image2 string] [-image3 string] [-initialize script] [-modifier string] [-name string] [-plane float float float] [-prePressCommand script] [-pressCommand script] [-projection string] [-releaseCommand script] [-snapping boolean] [-space string] [-stepsCount int] [-undoMode string]
[name]
draggerContext は、取り消し可能、照会可能、および編集可能です。
draggerContext を使用すると、マウスかマウスと同等のドラッグ デバイスの動作を MEL でプログラミングできます。| string | コンテキストの名前 |
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-anchorPoint(-ap)
|
float float float
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-button(-bu)
|
int
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-currentStep(-cs)
|
int
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-cursor(-cur)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-dragCommand(-dc)
|
script
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-dragPoint(-dp)
|
float float float
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-drawString(-ds)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-exists(-ex)
|
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-finalize(-fnz)
|
script
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-helpString(-hs)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-history(-ch)
|
boolean
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-holdCommand(-hc)
|
script
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-image1(-i1)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-image2(-i2)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-image3(-i3)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-initialize(-inz)
|
script
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-modifier(-mo)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-name(-n)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-plane(-pl)
|
float float float
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-prePressCommand(-ppc)
|
script
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-pressCommand(-pc)
|
script
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-projection(-pr)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-releaseCommand(-rc)
|
script
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-snapping(-snp)
|
boolean
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-space(-sp)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-stepsCount(-sc)
|
int
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
-undoMode(-um)
|
string
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||||
// Procedure called on press
global proc sampleContextPress()
{
float $pressPosition[] = `draggerContext -query -anchorPoint sampleContext`;
print ("Press: " + $pressPosition[0] + " " + $pressPosition[1] + " "
+ $pressPosition[2] + "\n");
}
// Procedure called on drag
global proc sampleContextDrag()
{
float $dragPosition[] = `draggerContext -query -dragPoint sampleContext`;
int $button = `draggerContext -query -button sampleContext`;
string $modifier = `draggerContext -query -modifier sampleContext`;
print ("Drag: " + $dragPosition[0] + " " + $dragPosition[1] + " "
+ $dragPosition[2]
+ " Button is " + $button + " Modifier is " + $modifier + "\n");
string $message = ($dragPosition[0] + ", " + $dragPosition[1]);
draggerContext -edit -drawString $message sampleContext;
}
// Create the dragger context
draggerContext
-pressCommand "sampleContextPress"
-dragCommand "sampleContextDrag"
-cursor "hand"
sampleContext;
// Set current tool to use the sample context created.
// Results can be seen by dragging mouse in main window
setToolTo sampleContext;