在ZScript for ZBrush中,可以使用FileExecute调用DLL。
[FileExecute,"ZBRUSH_ZData\ZPlugs\WebZPlug.dll",HTTP_Browse,"http://www.zbrushcentral.com"]DLL的入口点(C/C++函数)从ZScript接收参数和数据的签名是什么?对于ZScript和C++之间的数据结构,是否有任何无文档的论据?
发布于 2016-10-15 14:15:05
在恢复了一些部分回答了这个问题的文档之后:以下是完整的FileExecute签名:
[FileExecute, Filename, Function to call, Optional text input, Option numeric input, Optional memory block input, Optional memory block output]您可以传递在MemBlock中创建的内存块“ZScript”:
[FileExecute, "DllName.dll", "FunctionName", "StringArgument", [MemGetSize, "MemBlock"], "MemBlock",]下面是DLL中的一个C++函数,用于接收来自ZScript的调用和内存块:
#define DLLEXPORT __declspec(dllexport)
extern "C" int DLLEXPORT FunctionName(unsigned char* message, double number, void* memblock, void* memblock2)
{
int mbSize = (int)number; // the second argument has to be a double
// Read from the memory block via a strstream
stdstrstream mbStream((char*)memblock, mbSize);
// Read the first integer written into the memory block by the ZScript
int val = 0;
mbStream.read((char*)&val, 4);
}extern "C"是使一个C++函数具有'C‘链接(编译器不会损坏名称),以便ZBrush C代码可以链接到它。
https://stackoverflow.com/questions/40059948
复制相似问题