• 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

Pages (5): « Previous 1 2 3 4 5 Next »
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#11
04-15-2023, 12:04 PM (This post was last modified: 04-15-2023, 12:21 PM by edb.)
Hello tkbd,
Thank you very much for trying the plugin and also making the how to for mac os, it will be very useful reference.

tkbd Wrote:Distorted scaling script plugin
It doesn't work,it returned error a following.
Oh there was a bug, I just fixed in a new update.

tkbd Wrote:but Some issue happend,so I report it to you.
Crash When interpreter pathes are wrong
This mean is Wings3d crash without error dialog.
I'll need to improve it for these scenarios.

tkbd Wrote: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.
It might need improvement on bigger mesh making. I've turned off some debug messages in the latest update (which can be re-enabled in settings) so the whole content of big meshes aren't output to log. There is also a 1 minute timeout in the message receive loop that might need to be adjustable.

New update to plugin:
wpc_scripting_shapes.tar

Updates to pack (two new color effects):
https://github.com/elblake/wings-scripts-pack
tkbd
Offline

Senior Member

Posts: 451
Threads: 115
Joined: Nov 2012
#12
04-16-2023, 06:38 AM
Thank you very much for update!!
I tried your new version,then now Distorted Scaling works fine Smile

About new append plugins.
Color test command applied vertex color to 3D object surface by simple color projection.
Wavey Color command applied vertex gradation colors to 3D object surface by Color solid projection.
I enjoyed the gradation by changing to the material colors.

I'm looking forward to the future of Wings3D scripting plugins.
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#13
09-04-2023, 03:11 PM (This post was last modified: 09-04-2023, 03:13 PM by edb.)
I've added some functions to help with script timeouts so the scripts can run for as long as they need by sending occasional messages, as well the scripts can now provide updates on what it is doing in the progress bar.

New update to plugin:
wpc_scripting_shapes.tar

Updates to pack (added long running process function to heightmap_exporter.scm):
https://github.com/elblake/wings-scripts-pack

Also, not in this update yet, but I'm making an installation helper as an escript to help the user download and install python and gauche.
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#14
09-25-2023, 10:59 PM
Hello,

I've made some big updates to the scripting plugin. If you have made any scripts you will need to make a change to your script for it to work with this new plugin.

Scheme
For scheme you will need to wrap your code into an entry function and use (main-function entryfunction)

example:
Code:
...
...

(define (importer *params* *extra-params*)
    (define Filename (list-ref (assoc "filename" *extra-params*) 1))
    (import_fun '() Filename)
    )

(main-function importer)


Python
For python you will need to wrap your code into an entry function and use w3d_main_function = entryfunction

example:
Code:
...
...

def exporter(params, params_by_key, extra_params):
    filename = extra_params["filename"]
    content = w3d_e3d.E3DFile()
    content.load_from(extra_params["content"])
    export_fun({}, filename, content)

w3d_main_function = exporter


With this new update scripts can now show a preview:
[Image: YBlKz96t_o.gif]

There's also some other new updates:
  • Internationalization strings inside Scheme and Python source
  • Some adjustments to progress message functionality

New update to plugin:
wpc_scripting_shapes.tar

Updates to pack
https://github.com/elblake/wings-scripts-pack
micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,676
Threads: 183
Joined: Jun 2012
#15
09-26-2023, 10:54 AM
Really a nice addition.
Be able to preview the result is very important when we are exploring changes to the shape.
[Image: tw.png] @MicheusVieira [Image: yt.png] @MicheusVieira [Image: da.png] Micheuss [Image: ig.png] micheus4wings3d
* Wings3D Team stands for: Björn and Dan
ivla
Offline

Member

Posts: 62
Threads: 7
Joined: May 2023
#16
09-29-2023, 05:52 AM (This post was last modified: 09-29-2023, 07:32 AM by ivla.)
Hi.

Windows 10 Pro 64-bit 22H2
User without administrative privileges.
Python 3.11.5 64-bit (added to PATH)
Gauche 0.9.12 64-bit (added to PATH)
Wings3d 2.2.9 with latest patches from here: http://www.wings3d.com/forum/showthread....4#pid14154
Plugin & scripts from your recent post (2023-09-26)
All script paths defined in plugin preferences and directory with scripts is writable for my user.

Any export script asks about parameters and w3d shows small window about "unknown POSIX error". No files created.
New shape script asks about parameters and nothing happens - no new objects on outliner, no error windows or messages in wings console.

What can be wrong?
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#17
09-30-2023, 06:11 PM
ivla Wrote:What can be wrong?
When a "unknown POSIX error" shows up usually it means it tried to run the interpreter but it couldn't be found.
What does your settings look like in Plug-in Preferences > Scripts Preference > Interpreters tab

Usually if the text boxes are empty it will try to figure it out automatically.


micheus Wrote:Be able to preview the result is very important when we are exploring changes to the shape.
Yup the preview helps a lot.
micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,676
Threads: 183
Joined: Jun 2012
#18
09-30-2023, 08:26 PM
(09-30-2023, 06:11 PM)edb Wrote: Usually if the text boxes are empty it will try to figure it out automatically.
I think it try do that by checking some environment variable. If so, and the var was not set on Python install process then the error will persist. (just a side note for ivla).
[Image: tw.png] @MicheusVieira [Image: yt.png] @MicheusVieira [Image: da.png] Micheuss [Image: ig.png] micheus4wings3d
* Wings3D Team stands for: Björn and Dan
ivla
Offline

Member

Posts: 62
Threads: 7
Joined: May 2023
#19
10-02-2023, 03:23 AM (This post was last modified: 10-02-2023, 03:25 AM by ivla.)
Thanks for replies.

Both interpreters is in PATH - I can run it by typing "python" or "gosh" in command line.
I've got a try with its path in plugin preferences and without it.
Maybe I should do something else?
[Image: 001.png]
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#20
10-02-2023, 07:39 AM (This post was last modified: 10-02-2023, 07:44 AM by edb.)
ivla Wrote:Both interpreters is in PATH - I can run it by typing "python" or "gosh" in command line.
I've got a try with its path in plugin preferences and without it.
Maybe I should do something else?

Try the paths in the text boxes without double quotes.

So for example:

"C:\Program Files\...\python.exe"
changes to
C:\Program Files\...\python.exe

There shouldn't be any problems with spaces in the interpreter path.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): « Previous 1 2 3 4 5 Next »


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

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode