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) |
Scripting with Scheme and Python - edb - 04-05-2023 Many months ago I started experimenting with running scheme scripts to generate mesh data as a way for me to get more familiar with how wings plugins worked. A while later I added python interpreter support so now this is a plugin that makes it possible to run scheme and python scripts as if they were simple plugins. Some of the uses at the moment for it there is some scripts for generating shapes. There are also exporters to export wings3d meshes to some game formats: Godot (.tres) and Panda3d (.egg). A python script based exporter has some advantages for game developers for exporting to game engine formats. Game engines change at a fairly fast pace and their formats might not be set in stone as much like formats like .obj. Game developers will also likely need to have easy access to the script to make changes and customizations to the mesh output for their day-to-day use. Installing this plugin has a few steps:
NOTE: Be careful when searching for open source software in Google. Links are added to find the real python and scheme. Documentation: Scripting_Plugin_Wings3D_en.pdf When writing scripts:
The plugin code can be found in the branch: eb/scripting-shapes RE: Scripting with Scheme and Python - micheus - 04-05-2023 This sounds like a useful addition for some users. I'm getting antivirus warning about the Python installer been infected by Win32: PWSX-gen [Trj]. I didn't find any reference about this issue to be false on the net. (I don't like that). It's a pity that Guache runs at Windows via MingW. Could you include in the pack's readme a short explanation about meaning and use of the files with the extensions .wscr, .inclr, .scm? RE: Scripting with Scheme and Python - edb - 04-06-2023 Hi micheus, I added an explanation of the file extensions into the pack README. I'm not sure about the warning, I think the python.org installers are signed. RE: Scripting with Scheme and Python - micheus - 04-06-2023 Thanks for the description. It should help users interested to try the plugin to understand what and where to implement/change on their code. I went back to download Python and today got the installer correctly. And I used Google search again. So, by verifying the page history from yesterday I noticed that for some reason I was "redirected" to a page in https://www.pythonstudy.live/ - which is a clone of the original Python's download page, but the installer to be downloaded is "FileSetupApplication18.1.0.zip" from https://github.com/zetrocode/server/releases/download (instead of python-3.11.3-amd64.exe). Very strange. So, pay attention. RE: Scripting with Scheme and Python - edb - 04-07-2023 Hi micheus, I've updated my post with the missing links. I'll have a bit more documentation available soon as well. RE: Scripting with Scheme and Python - edb - 04-07-2023 I've put together a more comprehensive documentation: Scripting_Plugin_Wings3D_en.pdf Update: a few small corrections. RE: Scripting with Scheme and Python - edb - 04-10-2023 Updated with changes made for command scripts for changing vertex color and uv attributes: wpc_scripting_shapes.tar The scripts pack is updated with improvements to some of the scripts. https://github.com/elblake/wings-scripts-pack RE: Scripting with Scheme and Python - sciroccorics - 04-10-2023 Hi, I downloaded your plugin and your script pack today. I've been using Python for years, so this sounds like a very interesting extension to me, as I could never find some time to learn Erlang :-( I am used to generating 3D shapes with Python (using 'numpy' and/or 'pyvista' to get heavy speedup by vectorization) and usually export them as OBJ files, to rework on them with Wings3D. Performing such shape imports directly in Wings, using a Python script is very appetizing ! I quickly skimmed the code of some scripts (e.g. pixel_art_shape.py) and everything seems very clean and very clear. I'm going to make some experiments with you code in a "near" future (lot of ideas for the 'new shape' plugin) and will certainly come back here for some questions ;-) Thanks a lot for your work... RE: Scripting with Scheme and Python - edb - 04-11-2023 Hi sciroccorics, Thank you for the feedback. I'm glad that the scripting plugin might find some use. Let me know if you have any questions. RE: Scripting with Scheme and Python - tkbd - 04-13-2023 Hello,edb!! I tried to your plugin whether work on MacOS. It successfuly,so I create an instruction of the setting. This is a great plugin. I feel the possibilities. [MacOS] How to get ready Wings3D Scripting Plug-ins http://wings3d.com/forum/showthread.php?tid=3099 It works on mojave(OSX10.14) and big sur(MacOS11) but Some issue happend,so I report it to you. Crash When interpreter pathes are wrong This mean is Wings3d crash without error dialog. new_shape_pixel_art script plugin Read to large size pgm(ppm)file(e.g. 256px*256px), it slow down Wings3D and freeze at last. Distorted scaling script plugin It doesn't work,it returned error a following. Code: DEBUG: *** ERROR: ScmSmallInt required, but got 2.0 Thank you very much and cheers! ----- tkbd |