Blender - C# C++ 中的命令

Blender - commands in C# C++

我接到一个任务,建立 GMS2 -> Blender 单向通信。扩展 GMS2 的 DLL 需要用 C# 或 C++ 编写。 Blender 的问题在于它没有像 Maya 那样的端口。所以我想通过套接字解决方案,但不确定这是否是正确的方法。

不求代码,特此求指点(双关)。

Blender 使用 python 创建插件,可以创建 python 插件来打开套接字并更改内部数据。一个例子是 network render addon that is included with blender. You can also use the subprocess module to pipe data from an external program, see this question.

如果您需要在插件中使用 C/C++,您有多种选择。 Blender 的插件是一个标准 python 模块 - 具有一些必需的方法和属性。 python 模块可以是 dynamic library compiled from C/C++. You can also use ctypes to access standard libraries from python code. Another option is to create a basic addon and use cython to turn it into C code which you can then add your code to, cube surfer and animation nodes 是使用 cython 编译共享库的示例插件。