![]() |
Scripting with Scheme and Python - Printable Version +- Wings 3D Development Forum (https://www.wings3d.com/forum) +-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1) +--- Forum: Design & Development (https://www.wings3d.com/forum/forumdisplay.php?fid=6) +--- Thread: Scripting with Scheme and Python (/showthread.php?tid=3096) |
RE: Scripting with Scheme and Python - ivla - 03-14-2025 New version of thread generating script (python) Changed parameters dialog; Corrected "Round" profile; Added "Semi-round inside" profile. RE: Scripting with Scheme and Python - edb - 03-22-2025 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: Code: ... Now it will be: Code: ... And this was how to do a file import: Code: print("") Now it has changed to: Code: e3df = w3d_e3d.E3DFile() In Scheme, a new shape was created with: Code: ... Now it has changed to: Code: ... And for a file import: Code: ... Has now changed to: Code: ... 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. RE: Scripting with Scheme and Python - ivla - 03-24-2025 Good news, edb! (03-22-2025, 06:16 PM)edb Wrote: A script (.py or .scm) and .wscr file can be bundled with aYou mean it can be packed like other plugins in .tar file? Show an example, please. RE: Scripting with Scheme and Python - edb - 03-25-2025 Hello ivla (03-24-2025, 08:20 AM)ivla Wrote: You mean it can be packed like other plugins in .tar file? Yep that's exactly it, the script can be packaged in a tar file and will be installable the same way as plugins. The script and .wscr file won't need any changes to turn it into a plugin script, and the extra .conf file provides the menu location. For the .tar file, there might be a fourth file that is like a "manifest" so wings knows which plugin to ask about installing the .tar file. An example package might have: Code: manifest the file special_shape_bumpy.conf might look like: Code: {"unique-script-name.author-name.special-shape-bumpy.1", [ Some explanations: Code: {wscr, "special_shape_bumpy/special_shape_bumpy.wscr"}, Code: {menu, [ called "Special Shapes", inside the new shape menu. Code: {strings, [ string "unique-script-name.author-name.special-shape-bumpy.1" needs to match though. RE: Scripting with Scheme and Python - ivla - 03-26-2025 edb, thank you. RE: Scripting with Scheme and Python - edb - 05-05-2025 A new build of the scripting plugin: PLUGIN: wpc_scripting_shapes.tar PATCH: patch_scripting.tar Another change for this release. The syntax of .wscr has changed slightly but only if you were using parameter queries, now they have a different syntax to distinguish them from strings and atoms by enclosing the parameter query in %[...] instead of "...". Atoms used to be enclosed with "'atom'", now they are enclosed just with single quotes 'atom'. As an example, this .wscr file for the milkshape exporter used to look like this: Code: params_title ?__(3,"Milkshape3D Exporter Settings") Now the file will look like this: Code: params_title ?__(3,"Milkshape3D Exporter Settings") RE: Scripting with Scheme and Python - micheus - 05-06-2025 Thanks for the update RE: Scripting with Scheme and Python - ivla - 05-23-2025 New script for plugin, generates square slab with upper side divided as 2D Voronoi diagram (with irregular structure). Download here Written on Python, uses numpy and scipy modules. With large number of cells can be slow! Parameters: Number of upper side cells, 3..1024 (and 4 "corner" cells will be added) Square size, 0.1 min Slab thickness, 0 or more Sampling optimization: None ![]() Less ![]() or More ![]() Back (lower) side is one face: ![]() |