0
$\begingroup$

How to make blender listen to a commandport so other apps can send code to it?

I wanted to ask if there's a simple script or code to tell blender to listen to any code sent by a other app by listening to a commandport simmlar to maya's method.

In maya the only code I need is

import maya.cmds as cmds

cmds.commandPort(name=":7002", sourceType="python")

cmds.commandPort(name=":7001", sourceType="mel")

At this point In maya I can send any code with what ever app I want in python by sending it through port 7002, simple and easy.

I want to know if I can do something similar with blender I tried SublimeBlender but it only worked with sublime when I tried using other apps to send code to port 8006 nothing happens, I need a less complex way to make blender listen to a port to take incoming code from any app not just Sublime.

$\endgroup$

1 Answer 1

1
$\begingroup$

In short: AFAIK Blender doesn't come with such a feature built-in.

You could start an HTTP server and listen to incoming requests. You'll have to use multithreading (can get hairy) if you don't want to block Blender's UI, though. Another approach could be an asyncio socket server. Also see this SE question: send instructions to blender from external application.

Be sure that you only run this on trusted networks, though, and/or use proper encryption & authentication to protect your Blender.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .