- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I have a question regarding basics of how statements' syntax works in MEL.
I have a working script which cycles through Move, Rotate and Scale tools.
I would like to upgrade the code by adding more commands to be executed under each IF statement.
Working Code:
string $currentTool = `currentCtx`;
if ($currentTool == "moveSuperContext")
setToolTo $gScale;
else if ($currentTool == "scaleSuperContext")
setToolTo $gRotate;
else
setToolTo $gMove; tumbleCtx -e -autoSetPivot true tumbleContext; manipMoveContext -e -mode 2 Move; manipRotateContext -e -mode 2 Rotate; manipScaleContext -e -mode 2 Scale;
What I tried to do, but doesn't work:
string $currentTool = `currentCtx`;
if ($currentTool == "moveSuperContext")
setToolTo $gScale; manipScaleContext -e -mode 2 Scale;
else if ($currentTool == "scaleSuperContext")
setToolTo $gRotate; manipRotateContext -e -mode 2 Rotate;
else
setToolTo $gMove; tumbleCtx -e -autoSetPivot true tumbleContext; manipMoveContext -e -mode 2 Move;
Thanks for advising what would be a good way around it.
Solved! Go to Solution.