![]() |
how to make plugins from the command line - Printable Version +- Wings 3D Development Forum (https://www.wings3d.com/forum) +-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1) +--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7) +--- Thread: how to make plugins from the command line (/showthread.php?tid=2681) |
how to make plugins from the command line - hartsantler - 09-08-2018 I am trying to figure out how to create simple shapes from the command line (using expressions and not compiling it as a plugin), here is what i have so far that is not working yet. Code: BuildShape = fun(Prefix, Fs, Vs, PostFix) -> The error i get is: Code: ** exception error: no function clause matching RE: how to make plugins from the command line - micheus - 09-08-2018 I think it can be related to the same problem you have been experiencing in the other topic. Anyway, did you already took a look at this article: http://scorpius.github.io/tut-wings-shell.htm If not, maybe it can help you. RE: how to make plugins from the command line - hartsantler - 09-20-2019 Im still interested in automating Wings from the command line, but didn't have any luck hacking the source code directly. It would be great to have support for a simple macro language that could be used to generate models from the command line. Something like: wings.exe --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');" RE: how to make plugins from the command line - micheus - 09-20-2019 Hi hartsantler Did you already checked the erlang script that dgud included in the sources? It's called wings_convert.erl and there is some conversation about it in this feature request post. I think that may help you, but please let we know if not. RE: how to make plugins from the command line - hartsantler - 09-21-2019 i saw that post, and have read wings_convert.erl. And that solution would work fine for me locally on my machine, but what about windows users? Its too much to ask them to install an erlang environment. RE: how to make plugins from the command line - micheus - 09-21-2019 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: PHP Code: init() -> 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);" RE: how to make plugins from the command line - dgud - 09-23-2019 I have added the needed things to the wings installer so (after next release) you should be able to run, the wings_convert script from command line without installing erlang, if I have done it correct :-) Some hacks are involved, so to run other scripts you will have to run: wings/bin/escript.exe <your_escript> RE: how to make plugins from the command line - hartsantler - 09-24-2019 @micheus and @dgud, you guys are awesome! RE: how to make plugins from the command line - dgud - 12-09-2019 Please test, 2.2.5 :-) |