Hi everyone,
I am playing around with some MEL script and the dragger context, but I can consistently crash maya within seconds while running the script.
I tried to check my script back to its basics and I can reproduce the problem with the default dragger Context stock example if I specify the draggerContext with the -space “world” attribute.
Also, I changed the example so it actually creates a locator at the world coordinates returned with the context.
It seems that it’s actually the line that breaks maya, but I have no clue why.
here is the script (default mel example with the 2 changes I mentionned above)
// Procedure called on press
global proc sampleContextPress()
{
float $pressPosition =draggerContext -query -anchorPoint sampleContext
;
print ("Press: " + $pressPosition[0] + " " + $pressPosition[1] + " "
+ $pressPosition[2] + "
");
}// 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 + "
");
spaceLocator -p $dragPosition[0] $dragPosition[1] $dragPosition[2];
// string $message = ($dragPosition[0] + ", " + $dragPosition[1]);
// draggerContext -edit -drawString $message sampleContext;
}// Create the dragger context
draggerContext
-pressCommand “sampleContextPress”
-dragCommand “sampleContextDrag”
-cursor “hand”
-space “world”
sampleContext;// Set current tool to use the sample context created.
// Results can be seen by dragging mouse in main window
setToolTo sampleContext;
if I run this in the script editor and scrub a viewport some, it will crash maya within moment.
if I comment out -space “world” it will work fine. if I leave it be but comment the spaceLocator line instead it will work fine also.
(note: also, I am working with a windows 7 setup, could this have any effect?)
I would appreciate any help on this matter