• 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 Programming v
« Previous 1 2 3 4 Next »
3rd party dll's

 
  • 0 Vote(s) - 0 Average
3rd party dll's

nigec
Offline

Member

Posts: 126
Threads: 24
Joined: Jun 2016
#3
06-02-2016, 12:37 PM
I'll show the Python Client to give you an idea
Code:
from ctypes import *
import traceback
import sys
import socket
import struct
from os import path

port=6300 #port
host='127.0.0.1'#ip address

def sendSocketMsg(host, port, message):  #client code
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((host, int(port)))
        
        msg = struct.pack('<l',len(message))+struct.pack('<l',0)+message

        s.sendall(msg)
        data = s.recv(1024)
        
        s.close()
        print (data.decode("utf-8"))
        return data.decode("utf-8")
    except:
        return 'ERROR'
    next
#get studio version
message = b'version'
sendSocketMsg(host, port, message)
#load a scene
message = b"message \"Load C:\\Temp\\scene.scn.thea\""
sendSocketMsg(host, port, message)
#get active camera
message =b"get \"./Scenes/Active/Cameras/Active\""
sendSocketMsg(host, port, message)
#get time limit
message = b'get \"./Scenes/Active/Render/Time Limit\"'
sendSocketMsg(host, port, message)
#get samples
message = b'get \"./Scenes/Active/Render/Sample Limit\"'
sendSocketMsg(host, port, message)
#render scene
message = b"message \"Render\""
sendSocketMsg(host, port, message)
############################################
#while loop would go here looping until data is Idle
##command in the loop
message = b'status'
sendSocketMsg(host, port, message)
##end loop
###########################################

##then save
#message = b"message 'SaveImage C:\\Temp\\scenex.png'"
sendSocketMsg(host, port, message)

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
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
3rd party dll's - by nigec - 06-01-2016, 06:57 PM
RE: 3rd party dll's - by dgud - 06-02-2016, 11:22 AM
RE: 3rd party dll's - by nigec - 06-02-2016, 12:37 PM
RE: 3rd party dll's - by dgud - 06-02-2016, 12:46 PM
RE: 3rd party dll's - by nigec - 06-02-2016, 01:49 PM
RE: 3rd party dll's - by nigec - 06-03-2016, 11:54 AM
RE: 3rd party dll's - by dgud - 06-03-2016, 01:13 PM
RE: 3rd party dll's - by micheus - 06-03-2016, 04:20 PM
RE: 3rd party dll's - by nigec - 06-03-2016, 04:53 PM
RE: 3rd party dll's - by nigec - 06-06-2016, 04:17 PM

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

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode