• 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 Design & Development v
1 2 3 4 5 … 11 Next »
Scripting with Scheme and Python

 
  • 0 Vote(s) - 0 Average
Scripting with Scheme and Python

edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#42
03-22-2025, 06:16 PM (This post was last modified: 03-22-2025, 06:32 PM by edb.)
Some of the new features in the next build:
  • 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.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
Scripting with Scheme and Python - by edb - 04-05-2023, 08:26 PM
RE: Scripting with Scheme and Python - by micheus - 04-05-2023, 09:40 PM
RE: Scripting with Scheme and Python - by edb - 04-06-2023, 03:32 AM
RE: Scripting with Scheme and Python - by micheus - 04-06-2023, 05:59 PM
RE: Scripting with Scheme and Python - by edb - 04-07-2023, 12:10 AM
RE: Scripting with Scheme and Python - by edb - 04-07-2023, 06:13 AM
RE: Scripting with Scheme and Python - by edb - 04-10-2023, 12:49 PM
RE: Scripting with Scheme and Python - by sciroccorics - 04-10-2023, 04:45 PM
RE: Scripting with Scheme and Python - by edb - 04-11-2023, 02:02 AM
RE: Scripting with Scheme and Python - by tkbd - 04-13-2023, 10:34 PM
RE: Scripting with Scheme and Python - by edb - 04-15-2023, 12:04 PM
RE: Scripting with Scheme and Python - by tkbd - 04-16-2023, 06:38 AM
RE: Scripting with Scheme and Python - by edb - 09-04-2023, 03:11 PM
RE: Scripting with Scheme and Python - by edb - 09-25-2023, 10:59 PM
RE: Scripting with Scheme and Python - by micheus - 09-26-2023, 10:54 AM
RE: Scripting with Scheme and Python - by ivla - 09-29-2023, 05:52 AM
RE: Scripting with Scheme and Python - by edb - 09-30-2023, 06:11 PM
RE: Scripting with Scheme and Python - by micheus - 09-30-2023, 08:26 PM
RE: Scripting with Scheme and Python - by ivla - 10-02-2023, 03:23 AM
RE: Scripting with Scheme and Python - by edb - 10-02-2023, 07:39 AM
RE: Scripting with Scheme and Python - by ivla - 10-02-2023, 07:59 AM
RE: Scripting with Scheme and Python - by ivla - 10-03-2023, 08:46 AM
RE: Scripting with Scheme and Python - by edb - 10-03-2023, 04:11 PM
RE: Scripting with Scheme and Python - by ivla - 10-04-2023, 03:55 AM
RE: Scripting with Scheme and Python - by ivla - 10-11-2023, 10:30 AM
RE: Scripting with Scheme and Python - by ivla - 10-11-2023, 10:42 AM
RE: Scripting with Scheme and Python - by micheus - 10-13-2023, 07:33 AM
RE: Scripting with Scheme and Python - by ivla - 10-13-2023, 09:18 AM
RE: Scripting with Scheme and Python - by edb - 10-12-2023, 10:58 PM
RE: Scripting with Scheme and Python - by ivla - 10-13-2023, 09:12 AM
RE: Scripting with Scheme and Python - by ivla - 10-17-2023, 01:48 PM
RE: Scripting with Scheme and Python - by micheus - 11-09-2023, 02:36 PM
RE: Scripting with Scheme and Python - by ivla - 11-13-2023, 01:54 PM
RE: Scripting with Scheme and Python - by ivla - 11-29-2023, 11:57 AM
RE: Scripting with Scheme and Python - by edb - 05-13-2024, 08:33 PM
RE: Scripting with Scheme and Python - by ivla - 11-06-2024, 12:38 PM
RE: Scripting with Scheme and Python - by edb - 12-23-2024, 03:10 AM
RE: Scripting with Scheme and Python - by edb - 01-08-2025, 12:29 AM
RE: Scripting with Scheme and Python - by edb - 03-07-2025, 11:16 PM
RE: Scripting with Scheme and Python - by ivla - 03-09-2025, 03:18 AM
RE: Scripting with Scheme and Python - by ivla - 03-14-2025, 12:32 PM
RE: Scripting with Scheme and Python - by edb - 03-22-2025, 06:16 PM
RE: Scripting with Scheme and Python - by ivla - 03-24-2025, 08:20 AM
RE: Scripting with Scheme and Python - by edb - 03-25-2025, 06:01 PM
RE: Scripting with Scheme and Python - by ivla - 03-26-2025, 03:37 AM
RE: Scripting with Scheme and Python - by edb - 05-05-2025, 02:41 AM
RE: Scripting with Scheme and Python - by micheus - 05-06-2025, 04:25 PM
RE: Scripting with Scheme and Python - by ivla - 05-23-2025, 10:04 AM

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

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode