![]() |
3rd party dll's - Printable Version +- Wings 3D Development Forum (https://www.wings3d.com/forum) +-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1) +--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7) +--- Thread: 3rd party dll's (/showthread.php?tid=1982) |
3rd party dll's - nigec - 06-01-2016 I've been looking at the Kerkythea plugin with the view of modifying it for Thea, it actually works "as is" to some degree, engine choice and materials would need work but its all do able for an Erlang novice like me. My question is will Erlang handle 3rd party dll's?.. on the basic leave I could use a C# server dll which sends and receives messages to Thea, this is basically how the Thea4Blender plugin works or there's the Thea SDK way which has various Swig wrappers, I know C#, Python and Java work and obviously the C++ original I'm just thinking out loud really, I've done the Wings environment working and building, I've started work on the Thea plugin The server idea is probably the easiest as it doesn't need the sdk at all, if it was python its only about 10 lines of code to make the client, C# was a lot more RE: 3rd party dll's - dgud - 06-02-2016 What is server and what is client here, and what messages are we taking about here, tcp/ip? Writing socket comunication is easy in erlang, thought there are no examples in wings. But it is what most use erlang for so it should be easy to find example code. RE: 3rd party dll's - nigec - 06-02-2016 I'll show the Python Client to give you an idea Code: from ctypes import * Thea has a built in remote server which you can start from the command line ie thea -noshow -remoteserver then basically you just past commands and wait for a reply, like in the example you can get scene information and change it. Its only really any good for loading a scene getting information, engine cores, rendering settings, display (iso, fnumber) It can't do a lists of commands so you couldn't get the materials or change them, the only way I found was to write and xml material file and use merge to replace the original RE: 3rd party dll's - dgud - 06-02-2016 Ok that should be easy in erlang as well, so that is what I would do. http://erlang.org/doc/man/gen_tcp.html RE: 3rd party dll's - nigec - 06-02-2016 Thank you, I'll give it a try ![]() RE: 3rd party dll's - nigec - 06-03-2016 Well it kinda works, its connecting but the data format wrong, Code: msg = struct.pack('<l',len(message))+struct.pack('<l',0)+message Out of interest is erlport worth looking into? RE: 3rd party dll's - dgud - 06-03-2016 I don't know python so you will have to be more specific. i.e. struct.pack? Maybe Data = io_lib:format("<1~w<10~s", [length(Message), Message]), Have no idea what erlport is, but no you should not need anything else. RE: 3rd party dll's - micheus - 06-03-2016 (06-03-2016, 01:13 PM)dgud Wrote: Have no idea what erlport isIt's a library that intend to allow us to connect Erlang to other languages. http://erlport.org/ I read about it some time ago when I though we could use something like this to reuse Python code made for Blender plugins and make some of them available to Wings3d. RE: 3rd party dll's - nigec - 06-03-2016 I had a quick try with erlport and it does work to run the python code I posted earlier, Thea is doing stuff apart from the return messages. It does seem like it could be useful, even if its just a way to show people what I'm trying to do, in theory I could use Thea's sdk Python wrappers with erlport but I can see it going badly wrong lol Thanks for the example, I'll give it a try now RE: 3rd party dll's - nigec - 06-06-2016 Quick test with ErlPort, this is actually using the Thea SDK Swig Python not the server I haven't managed to get an Erlang one working yet.. Its a shame that most of the links are dead for various help topics ![]() |