1+ #####################################################################################################################
2+ # Copyright(C) 2011-2025 IT4Innovations National Supercomputing Center, VSB - Technical University of Ostrava
3+ #
4+ # This program is free software : you can redistribute it and/or modify
5+ # it under the terms of the GNU General Public License as published by
6+ # the Free Software Foundation, either version 3 of the License, or
7+ # (at your option) any later version.
8+ #
9+ # This program is distributed in the hope that it will be useful,
10+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
12+ # GNU General Public License for more details.
13+ #
14+ # You should have received a copy of the GNU General Public License
15+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16+ #
17+ #####################################################################################################################
18+
19+ import bpy
20+
21+ import ctypes
22+ import os
23+ import platform
24+ from ctypes import Array , cdll , c_void_p , c_char , c_char_p , c_int , c_int32 , c_uint32 , c_float , c_bool , c_ulong , POINTER
25+
26+ #####################################################################################################################
27+ # platform specific library loading
28+ if platform .system () == 'Windows' :
29+ _renderengine_dll_name = "braas_hpc_renderengine.dll"
30+ elif platform .system () == 'Linux' :
31+ _renderengine_dll_name = "libbraas_hpc_renderengine.so"
32+ elif platform .system () == 'Darwin' :
33+ _renderengine_dll_name = "libbraas_hpc_renderengine.dylib"
34+ else :
35+ raise ValueError (
36+ "Libraries not available for this platform: " + platform .system ())
37+
38+ #####################################################################################################################
39+ try :
40+ # Load library
41+ _renderengine_dll_name = os .path .join (
42+ os .path .dirname (__file__ ), _renderengine_dll_name )
43+ _renderengine_dll = cdll .LoadLibrary (_renderengine_dll_name )
44+
45+ #####################################################################################################################
46+
47+ _renderengine_dll .resize .argtypes = [c_int32 , c_int32 ]
48+ _renderengine_dll .set_resolution .argtypes = [c_int32 , c_int32 ]
49+ _renderengine_dll .set_frame .argtypes = [c_int32 ]
50+
51+ _renderengine_dll .recv_pixels_data .restype = c_int32
52+ _renderengine_dll .send_cam_data .restype = c_int32
53+ _renderengine_dll .set_timestep .argtypes = [c_int32 ]
54+ _renderengine_dll .client_init .argtypes = [c_char_p , c_int32 , c_int32 , c_int32 ]
55+
56+ _renderengine_dll .set_camera .argtypes = [c_void_p , c_float , c_float , c_float ,
57+ c_float , c_float , c_int , c_float , c_float , c_float , c_int , c_float , c_float , c_int ]
58+
59+
60+ _renderengine_dll .get_current_samples .restype = c_int32
61+ _renderengine_dll .get_remote_fps .restype = c_float
62+ _renderengine_dll .get_local_fps .restype = c_float
63+ #_renderengine_dll.send_braas_hpc_renderengine_data_render.argtypes = [c_void_p, c_int32, c_void_p, c_void_p]
64+ _renderengine_dll .send_braas_hpc_renderengine_data_render .argtypes = [c_char_p , c_int32 ]
65+
66+ _renderengine_dll .get_braas_hpc_renderengine_range .argtypes = [c_void_p , c_void_p , c_void_p ]
67+ _renderengine_dll .get_texture_id .restype = c_int32
68+ _renderengine_dll .com_error .restype = c_int32
69+
70+ except :
71+ print ("Missing: " , _renderengine_dll_name )
72+
73+ def register ():
74+ pass
75+
76+ def unregister ():
77+ pass
0 commit comments