Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, TedMar, dr_panther), 1,049 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 2 1 2
med python binding #26925
05/02/04 22:35
05/02/04 22:35
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
i started to do a python binding for med.

med_python.zip ~ 50kb

it's still very incomplete and a bit buggy (don't try to close med while the python window is open! ). currently only the vertex and triangle commands are wrapped but some things can already be done with it. ...

the latest python and wxpython release has to be installed on your pc.

-> http://www.python.org
-> http://wxpython.sourceforge.net

Re: med python binding [Re: ventilator] #26926
05/02/04 23:14
05/02/04 23:14
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
sorry to be such a n00b...
but what is python, and what does it do?


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: med python binding [Re: Helghast] #26927
05/02/04 23:16
05/02/04 23:16
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
python is a scripting language. writing med plugins with python is more fun than with c++.

Re: med python binding [Re: ventilator] #26928
05/02/04 23:28
05/02/04 23:28
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
ok thanks...
although i cant write plugins, seems good:D


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: med python binding [Re: Helghast] #26929
05/04/04 03:16
05/04/04 03:16
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
did anyone try it?

i fixed error redirecting and wrapped more functions. error messages get written into the file <error.txt> at the moment. you can look into it to find out what you did wrong in your scripts. ...in later versions it would be cool to have some kind of interactive script editing and message window...

Re: med python binding [Re: ventilator] #26930
05/04/04 05:16
05/04/04 05:16
Joined: Mar 2002
Posts: 1,123
California
Cellulaer Offline
Expert
Cellulaer  Offline
Expert

Joined: Mar 2002
Posts: 1,123
California

What version of MED started supporting plugins (I must really need to upgrade to A6)? As far as writing my own plugins in it, I know about as much Python as C++.


Buy, Sell, & Archive Realtime 3D Content @ RedRock7.com *BETA* A5.5+ Plugin DLLs: GSADO, GSHTTP, GSImgLst, FreeMod, GSFlash, GSPython http://cellulear.slashbang.com/
Re: med python binding [Re: Cellulaer] #26931
05/04/04 05:23
05/04/04 05:23
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
i think you will need the med which comes with 6.2!

python is very easy to learn:

http://www.ibiblio.org/obp/thinkCSpy/
http://www.python.org/doc/2.3.3/tut/tut.html

here is an example of the latest plugin i did for testing:

Code:

import __main__,math,string,med

def fatman_plugin(_p_):
dlg=__main__.wx.TextEntryDialog(__main__.frame,
"this plugin adds the scaled normal to each selected vertex.\n\nnormal scale factor:",
"fatman","10")
if dlg.ShowModal()==__main__.wx.ID_OK:
values=string.split(dlg.GetValue())
fatman(float(values[0]))
dlg.Destroy()
__main__.frame.Close()

def fatman(normalscale):

med.startmodelediting()

num_vertices=med.vertex_getvertexcount()
for i in range(0,num_vertices):
med.vertex_selectvertex(i)
if med.vertex_isselected():
pos1,pos2=med.vertex_getvertexpos()
normal=med.vertex_getnormal()
pos=(pos2[0]+(normal[0]*normalscale),
pos2[1]+(normal[1]*normalscale),
pos2[2]+(normal[2]*normalscale))
med.vertex_setvertexpos(pos)

med.donemodelediting()



__main__.register_plugin("fatman",fatman_plugin) #plugin_name,plugin_function



the problem is that i am a pretty poor c/c++ programmer and i am not sure if i did everything right with the binding.

Re: med python binding [Re: ventilator] #26932
06/18/05 00:21
06/18/05 00:21
Joined: Mar 2004
Posts: 31
S
sr124 Offline
Newbie
sr124  Offline
Newbie
S

Joined: Mar 2004
Posts: 31
I cannot download the above link now. Could you help? It's very interesting Thanks.

Re: med python binding [Re: sr124] #26933
06/18/05 01:04
06/18/05 01:04
Joined: Oct 2003
Posts: 2,628
IL,US
FeiHongJr Offline
Expert
FeiHongJr  Offline
Expert

Joined: Oct 2003
Posts: 2,628
IL,US
get a 404 error , sounds interesting tho


http://www.freewebs.com/otama_syndicate/index.htm - Each master to his own technique.

- Not me said the bee, Nor I said the fly.
Re: med python binding [Re: FeiHongJr] #26934
06/20/05 12:43
06/20/05 12:43
Joined: Jan 2004
Posts: 585
Alexandria, VA
Alkai Offline
Developer
Alkai  Offline
Developer

Joined: Jan 2004
Posts: 585
Alexandria, VA
What is possible with a python plugin? What can be done with it?


If you gaze long into an abyss, the abyss will gaze back into you. 3.0 GHz Pentium 4 w/HT 1 Gig 400mhz DDR SDRAM 128mb NVidia GeForce FX 5200
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1