Remote Access of Blender Through Command Line For Render Farming

Hello,

I’ve been searching around for a way to remotely access Blender over the internet to run a render farm. The set up is that there’s one very powerful computer, (a Mac) that I wish to use for the renders. Me and a friend want to be able to access it over the internet from our laptops, (my PC and her Mac), to upload files to it and start renders, possibly through Blender’s command line. The reason for this is because my friend, me, and the powerful Mac we want to use will all be at different locations outside the support of a local network.

I understand that a typical render farm in Blender uses a local network. Might a VPN allow for this, (faking a local network)?

Secondly, is it possible to remotely control Blender through the command line it launches and have it be across different platforms?

Much appreciation for any help and suggestions.

Any update? I want to try the same thing, but I don’t if it’s possible/worthy.

I’m not aware of any functionality like that built directly into Blender. But OSX itself has a number of tools that can help you out.

On your powerful Mac under “Settings->Sharing” you should have options for “Remote Login” as well as “Screen Sharing”.

“Remote Login” would give you the ability to get a command line on your PC (or your friend’s Mac) that runs commands on the render Mac. It also has a tool that would let you copy files from your local machines up to the render Mac. SSH (“Secure Shell”) is the tool that lets you get a command line on the render Mac. SFTP (“Secure File Transfer Protocol”) is the tool that would let you copy files to and from the render Mac.

The main issue is that if you wanted to access it over the Internet, then you would have to configure your home router to “forward” traffic on the correct port numbers to the render Mac.

The other option is to enable the “Screen Sharing” on the render Mac. This would let you use a program called “VNC Viewer” to connect to the render Mac. With this tool you see the graphical desktop of the render Mac on your local machine and you can control it just like you were physically at the render Mac. i.e. You can launch Blender with the icon, open files, etc.

I cannot remember if VNC has a built-in file transfer ability. You might need to enable the “Remote Login” so you can use SFTP to move files.

Another option for the files is to sign up for a free account with Dropbox and put all the computers on that account. Then you can drop files from your PC into Dropbox and Dropbox will copy them over to the render Mac.

No matter what you do, you will have to configure your router to pass the correct network traffic to your render Mac. One of the main purposes of your router is to prevent random traffic on the internet from getting to your computers behind the firewall.

Their is a simple multithreaded way I utilize which is starting a script with blender from the commandline, it will halt all gil functions until it exits so basically it will allow you to spawn a thread of the python’s code.interpreter class with threading and then if you allow the main thread to continue will start the gui, but you don’t even need the gui for rendering because the context object is easily created from the bpy.context module, allowing you to utlize any and all functions from the thread spawned to say loop and execute from nc -u 192.168.0.1 4555 | blender -c

It really depends on what you want to achieve. If you want to control blender completely through command line, there are options to run blender on a blend file and render the scene. Or you can run it with a --python myscript.py option to run a custom external script at startup.

Another alternative to Python threading is using the AsyncIO in Python’s standard library. That way you can start a webserver on a network or file socket and interact programmatically with that.