MoI discussion forum
MoI discussion forum

Full Version: Error with unwrap curve

From: gunter511
20 Oct 2019   [#1]
Hi all,

In trying to unwrap a curve (Cmd + U) I get this error: ReferenceError: Can't find variable: UnwrapCurve

Could someone please help?

Thanks,
Gunter
From: Frenchy Pilou (PILOU)
20 Oct 2019   [#2] In reply to [#1]
You have not probably UnwrapCurve inside your folder commands!

http://moi3d.com/forum/index.php?webtag=MOI&msg=5136.1

PS
Curriously for the Beta v4 i have only UnwrapCurve.js and not UnwrapCurve.htm and that works fine also! ??
From: bemfarmer
20 Oct 2019   [#3] In reply to [#1]
Hi Gunter,

IMHO:
The UnwrapCurve is a superb "non-stock" script which Michael created.

When installing a new Beta, or upgrading, the "non-stock" scripts are not added to the new regular MoI command folder.
So I would suggest placing the UnwrapCurve script in your %AppData%\commands directory, so the script is preserved for a new Beta.

- Brian

For Mac, for the %AppData% location, see: http://moi3d.com/forum/index.php?webtag=MOI&msg=6507.404

("non-stock" is not official MoI terminology:-)
Burrman made a list of Commands, and a list of Scripts...
From: Michael Gibson
20 Oct 2019   [#4] In reply to [#2]
Hi Pilou,

re:
> Curriously for the Beta v4 i have only UnwrapCurve.js and not UnwrapCurve.htm and that works fine also! ??

The .htm files contain the UI for a command. If a command just does some immediate action and does not display any UI then the .htm file is not needed. So that is normal that some commands may have only a .js file and not a companion .htm file.

- Michael
From: Michael Gibson
20 Oct 2019   [#5] In reply to [#1]
Hi Gunter, and yes as mentioned above that error will happen if MoI is not able to find the command script file. When no file is found it attempts to run the text of the shortcut key as direct script code which yields that error.

To solve it copy the UnwrapCurve.js file that you installed on a previous version into your %appdata%\moi\commands folder so the new beta can find it.

- Michael
From: Frenchy Pilou (PILOU)
20 Oct 2019   [#6] In reply to [#4]
Ok but as the same function has the htm companion in the V3 I was perplex! :)
From: Michael Gibson
20 Oct 2019   [#7] In reply to [#6]
Hi Pilou,

> Ok but as the same function has the htm companion in the V3 I was perplex! :)

I see - so for this command if you preselect the curve then when you trigger the command it will find that curve and be able to immediately do its action. It does not need to show any UI in that case so the missing UI doesn't matter.

If it can't find the curve then it will prompt you to select curves. That second one with the selection prompt won't work properly without the .htm file.

- Michael
From: gunter511
31 Oct 2019   [#8]
Apologies for the delay in replying, i think I got caught up in having copied the script in a recently expired beta version and then didn't copy it in the newly downloaded version.

Many thanks all - support on this forum is absolutely top notch and always has been :)

Gunter