grantimus
12-19-2005, 11:16 PM
I was running a quick test to see if a setup for a tool I wanted to write was possible. It looks like it is possible, if I can get around one litte quirk. I'm having a problem with the scriptCtx command. The problem is happening in the following code:
{
if (`contextInfo -exists testContext1`)
deleteUI testContext1;
if (`contextInfo -exists testContext2`)
deleteUI testContext2;
scriptCtx
-title "Just A Test 1"
-setNoSelectionPrompt "Select Some Faces For This Test"
-totalSelectionSets 1
-setSelectionCount 0
-toolStart "print\"starting test tool 1\";SelectFacetMask"
-finalCommandScript "testContext1Command($Selection1)"
-setAutoComplete false
-facet true
-baseClassName "testTool"
testContext1;
scriptCtx
-title "Just A Test"
-setNoSelectionPrompt "Select Some Vertices For This Test"
-totalSelectionSets 1
-setSelectionCount 0
-toolStart "print\"starting test tool 2\";SelectVertexMask"
-finalCommandScript "testContext2Commond($Selection1)"
-setAutoComplete false
-vertex true
-baseClassName "testTool"
testContext2;
global proc testContext1Command(string $test[]){
print "this is just a test\n";
print ($test);
print ("\n");
setToolTo testContext2;
}
global proc testContext2Commond(string $test[]){
print "this is just a test\n";
print ($test);
print ("\n");
print ("done\n");
}
setToolTo testContext1;
}
Basically the setup I want to use can be broken up like this:
1. The code builds two tools with the scriptCtx command
2. The script launches the first tool.
3. With the first tool the user selects some geometry.
4. When the user is done using the first tool, that tool launches a command that will modify some geometry (well for this test it just prints out a list of the geometry that was selected with the tool).
5. After the geometry is modified a second tool is launched.
6. The user selects some more geometry.
7. The tools modifies the geometry some more (but with this test, all that happens is a list of geometry that was selected with the second tool gets printed out).
The problem happens with step number 5. The second tool gets launched, I know this because the command in the tool's -toolStart option gets executed. But after that nothing happens. The tool just kind of quits without letting the user select anything.
Am I missing something? Is there a problem with the way I've defined the second tool? I'm hoping someone out there is more familiar with the scriptCtx command than I am.
{
if (`contextInfo -exists testContext1`)
deleteUI testContext1;
if (`contextInfo -exists testContext2`)
deleteUI testContext2;
scriptCtx
-title "Just A Test 1"
-setNoSelectionPrompt "Select Some Faces For This Test"
-totalSelectionSets 1
-setSelectionCount 0
-toolStart "print\"starting test tool 1\";SelectFacetMask"
-finalCommandScript "testContext1Command($Selection1)"
-setAutoComplete false
-facet true
-baseClassName "testTool"
testContext1;
scriptCtx
-title "Just A Test"
-setNoSelectionPrompt "Select Some Vertices For This Test"
-totalSelectionSets 1
-setSelectionCount 0
-toolStart "print\"starting test tool 2\";SelectVertexMask"
-finalCommandScript "testContext2Commond($Selection1)"
-setAutoComplete false
-vertex true
-baseClassName "testTool"
testContext2;
global proc testContext1Command(string $test[]){
print "this is just a test\n";
print ($test);
print ("\n");
setToolTo testContext2;
}
global proc testContext2Commond(string $test[]){
print "this is just a test\n";
print ($test);
print ("\n");
print ("done\n");
}
setToolTo testContext1;
}
Basically the setup I want to use can be broken up like this:
1. The code builds two tools with the scriptCtx command
2. The script launches the first tool.
3. With the first tool the user selects some geometry.
4. When the user is done using the first tool, that tool launches a command that will modify some geometry (well for this test it just prints out a list of the geometry that was selected with the tool).
5. After the geometry is modified a second tool is launched.
6. The user selects some more geometry.
7. The tools modifies the geometry some more (but with this test, all that happens is a list of geometry that was selected with the second tool gets printed out).
The problem happens with step number 5. The second tool gets launched, I know this because the command in the tool's -toolStart option gets executed. But after that nothing happens. The tool just kind of quits without letting the user select anything.
Am I missing something? Is there a problem with the way I've defined the second tool? I'm hoping someone out there is more familiar with the scriptCtx command than I am.
