Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Share Thread:
Reddit Facebook Twitter
how to make plugins from the command line
09-21-2019, 09:20 PM
Post: #6
RE: how to make plugins from the command line
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);s​ave_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. Smile

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);sa​ve_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)

@MicheusVieira MicheusVieira Micheuss micheus4wings3d
* Wings3D Team stands for: Björn and Dan
Reply


Messages In This Thread
RE: how to make plugins from the command line - micheus - 09-21-2019 09:20 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)