My mistake, as the error said, the command "Return" needs to be inside a procedure, and to simplify, I took out the script from its procedure. That´s a non-programmer mistake. 🙂
This is the correct code to open the camera bookmark editor from your current view.
If this worked out for you, please accept it as a solution.
global proc string openBookmarkEditor() {
global string $gMainPane;
string $mainPaneCtls[];
string $visPanels[];
string $panelName;
string $panelCtl, $edCtl;
string $modelEd;
int $nArr;
int $i;
string $newViewFound;
string $newView;
//
// First try to find something in the main pane.
//
if ($gMainPane != "") {
$mainPaneCtls = `paneLayout -q -ca $gMainPane`;
$nArr = size($mainPaneCtls);
for ($i = 0; $i < $nArr; $i++) {
$panelName = `getPanel -containing $mainPaneCtls[$i]`;
if ("" != $panelName) {
if ("modelPanel" == `getPanel -to $panelName`) {
if (!`control -q -io $mainPaneCtls[$i]`) {
$modelEd = `modelPanel -q -modelEditor $panelName`;
if ("" != $modelEd) {
if (`modelEditor -q -activeView $modelEd`)
{
$newView = $modelEd;
string $camera = `modelPanel -q -camera $newView`;
cameraBookmarkEditor $camera;
print $camera;
break;
}
}
}
}
}
}
}
return $newView;
}
openBookmarkEditor();
"I would like to follow @dinofiguera 's example of how you were able to create an awesome MEL command even though you are not a programmer. I'm not a programmer either, but I want to do my best."
Not sure what you mean but I like to think there is no negative irony here,
Just because I am spending time of my life to solve your problem. 🙂
Cheers
Dino