[Sidefx-houdini-list] How work PipeIn

Никита Мусатов not.a.whale at gmail.com
Tue Apr 10 16:39:17 EDT 2012


Sorry if it message delivered in second time.
Hello. I `m trying to send channels in PipeIn node with Python. But it doesn`t work. Can you help me to find what is wrong. 
This my example code in python:

import socket
import struct

num_channels = 3
vals = [1.03,1.05,1.4]

def sendComands(conn,num_channels,vals):
	cmd_type = 1
	p = struct.pack('>ii', cmd_type, num_channels )
	conn.send(p)
	for i in range(num_channels):
		v = struct.pack('>f', vals[i])
		conn.send(v)

def sendReset(conn):
	conn.send(struct.pack('cccc', chr(170),chr(0),chr(170),chr(0)))

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('localhost',5000))
s.listen(1)
conn, addr = s.accept()
sendReset(conn)

sendComands(conn,num_channels,vals)

Thanks You!!!


More information about the Sidefx-houdini-list mailing list