Some of the new features in the next build:
Simplified returning data from script
Scripts for the next release will have to have a small change,
as previously scripts had to write the result themselves using
write_list_out(sys.stdout), now the data can simply be returned
instead.
In Python, this was how to create a new shape:
Now it will be:
And this was how to do a file import:
Now it has changed to:
In Scheme, a new shape was created with:
Now it has changed to:
And for a file import:
Has now changed to:
Scripts in the wings script pack repository will be updated to
the new style when I'll have the new build available.
Plugin Scripts
A script (.py or .scm) and .wscr file can be bundled with a
plugin script conf file and the three can be added to a folder in
the user folder called "plugin_scripts" and the script will now
show up with its own menu entry in the right click menus.
This makes it so a script can be packaged for distribution and
installed like an actual plugin.
Script Folders
Script folder conf files are added in a user folder called "script_folders"
and this makes it so a folder of scripts can be made into a submenu in
the wings program. It's similar to the plugin script conf file,
but more for power users to have separate script folders in
different menus in wings.
Better designed command script API
Until now the scripting plugin didn't provide a way to actually
change anything too complicated in the #we{} other than vertex
positions and colors. The next build command scripts can actually
make changes to #we{} directly using wings' various functions
in wings_we, wings_face, wings_edge, wings_vertex, etc.
This part is getting close to complete and I'll have a new build
available when I have a few test scripts working.
- Simplified returning data from script
- Plugin Scripts
- Script Folders
- Better designed command script API
Simplified returning data from script
Scripts for the next release will have to have a small change,
as previously scripts had to write the result themselves using
write_list_out(sys.stdout), now the data can simply be returned
instead.
In Python, this was how to create a new shape:
Code:
...
shape = w3d_newshape.NewShape()
shape.fs = Fs
shape.vs = Vs
o = shape.as_output_list()
print("")
o.write_list_out(sys.stdout)
Now it will be:
Code:
...
shape = w3d_newshape.NewShape()
shape.fs = Fs
shape.vs = Vs
return shape
And this was how to do a file import:
Code:
print("")
e3df = w3d_e3d.E3DFile()
e3df.objs = objs
e3df.mat = mats
o_ok = OutputList()
o_ok.add_symbol("ok")
o_ok.add_list(e3df.as_output_list())
o_ok.write_list_out(sys.stdout)
Now it has changed to:
Code:
e3df = w3d_e3d.E3DFile()
e3df.objs = objs
e3df.mat = mats
return Okay(e3df)
In Scheme, a new shape was created with:
Code:
...
(newline)
(write (list new_shape "Shape" Fs Vs)))
Now it has changed to:
Code:
...
(list 'new_shape "Shape" Fs Vs))
And for a file import:
Code:
...
(newline)
(write `(ok ,e3df)))
Has now changed to:
Code:
...
`(ok ,e3df))
Scripts in the wings script pack repository will be updated to
the new style when I'll have the new build available.
Plugin Scripts
A script (.py or .scm) and .wscr file can be bundled with a
plugin script conf file and the three can be added to a folder in
the user folder called "plugin_scripts" and the script will now
show up with its own menu entry in the right click menus.
This makes it so a script can be packaged for distribution and
installed like an actual plugin.
Script Folders
Script folder conf files are added in a user folder called "script_folders"
and this makes it so a folder of scripts can be made into a submenu in
the wings program. It's similar to the plugin script conf file,
but more for power users to have separate script folders in
different menus in wings.
Better designed command script API
Until now the scripting plugin didn't provide a way to actually
change anything too complicated in the #we{} other than vertex
positions and colors. The next build command scripts can actually
make changes to #we{} directly using wings' various functions
in wings_we, wings_face, wings_edge, wings_vertex, etc.
This part is getting close to complete and I'll have a new build
available when I have a few test scripts working.