• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Programming v
1 2 3 4 Next »
how to make plugins from the command line

 
  • 0 Vote(s) - 0 Average
how to make plugins from the command line

micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,675
Threads: 183
Joined: Jun 2012
#6
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. 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);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)
[Image: tw.png] @MicheusVieira [Image: yt.png] @MicheusVieira [Image: da.png] Micheuss [Image: ig.png] micheus4wings3d
* Wings3D Team stands for: Björn and Dan
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
how to make plugins from the command line - by hartsantler - 09-08-2018, 10:00 PM
RE: how to make plugins from the command line - by micheus - 09-08-2018, 11:08 PM
RE: how to make plugins from the command line - by hartsantler - 09-20-2019, 03:59 AM
RE: how to make plugins from the command line - by micheus - 09-20-2019, 04:47 PM
RE: how to make plugins from the command line - by hartsantler - 09-21-2019, 04:47 PM
RE: how to make plugins from the command line - by micheus - 09-21-2019, 09:20 PM
RE: how to make plugins from the command line - by dgud - 09-23-2019, 06:46 AM
RE: how to make plugins from the command line - by hartsantler - 09-24-2019, 02:43 AM
RE: how to make plugins from the command line - by dgud - 12-09-2019, 07:43 AM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode