09-21-2019, 09:20 PM
Understood.
I did a test here and I got a code working using my dev environment (MSys), but not using the built version.
I use this command line:
werl +S1 -pa /F/unixlike/src/wings/ebin -run wings_start start -extra --script 'make_cube(x,y,z);scale(x,y,z);move_point(index,x,y,z);color_face(index,r,g,b);save_as(foo.wings);'
But, a Windows shortcut adjusted to use the werl.exe under Wings3D install dir didn't work. Only dgud can help with that because it's beyond my erlang knowledge.
If the any parameter would be catch by Wings3D, then you can just write a plugin to handle your script.
I added the code below to my w.i.p. plugin:
and the log got this printed out:
I did a test here and I got a code working using my dev environment (MSys), but not using the built version.
I use this command line:
werl +S1 -pa /F/unixlike/src/wings/ebin -run wings_start start -extra --script 'make_cube(x,y,z);scale(x,y,z);move_point(index,x,y,z);color_face(index,r,g,b);save_as(foo.wings);'
But, a Windows shortcut adjusted to use the werl.exe under Wings3D install dir didn't work. Only dgud can help with that because it's beyond my erlang knowledge.
If the any parameter would be catch by Wings3D, then you can just write a plugin to handle your script.
I added the code below to my w.i.p. plugin:
PHP Code:
init() ->
Script = pick_script(init:get_plain_arguments()),
io:format("\nScript: ~p\nCommands:\n",[Script]),
Commands = string:split(Script,";",all),
[io:format(" => ~s\n",[Cmd]) || Cmd <- Commands, string:trim(Cmd)=/=""],
...
true.
pick_script([]) -> [];
pick_script(["script"|Params]) ->
[Script|_] = Params,
Script;
pick_script([_|Params]) ->
pick_script(Params).
and the log got this printed out:
Code:
Script: "make_cube(x,y,z);scale(x,y,z);move_point(index,x,y,z);color_face(index,r,g,b);save_as(foo.wings);"
Commands:
=> make_cube(x,y,z)
=> scale(x,y,z)
=> move_point(index,x,y,z)
=> color_face(index,r,g,b)
=> save_as(foo.wings)