Skip to content

Commit c29c758

Browse files
committed
init commit
0 parents  commit c29c758

10 files changed

+3286
-0
lines changed

braas_hpc_renderengine/__init__.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
bl_info = {
19+
"name": "braas_hpc_renderengine",
20+
"author": "Milan Jaros, Petr Strakos, Lubomir Riha",
21+
"description": "",
22+
"blender": (4, 0, 0),
23+
"version": (0, 0, 1),
24+
"location": "",
25+
"warning": "",
26+
"category": "Render"
27+
}
28+
#####################################################################################################################
29+
30+
def register():
31+
from . import braas_hpc_renderengine_pref
32+
from . import braas_hpc_renderengine_dll
33+
from . import braas_hpc_renderengine_render
34+
from . import braas_hpc_renderengine_scene
35+
36+
braas_hpc_renderengine_pref.register()
37+
braas_hpc_renderengine_dll.register()
38+
braas_hpc_renderengine_render.register()
39+
braas_hpc_renderengine_scene.register()
40+
41+
42+
def unregister():
43+
from . import braas_hpc_renderengine_pref
44+
from . import braas_hpc_renderengine_dll
45+
from . import braas_hpc_renderengine_render
46+
from . import braas_hpc_renderengine_scene
47+
48+
try:
49+
braas_hpc_renderengine_pref.unregister()
50+
braas_hpc_renderengine_dll.unregister()
51+
braas_hpc_renderengine_render.unregister()
52+
braas_hpc_renderengine_scene.unregister()
53+
54+
except RuntimeError:
55+
pass
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
ADDON_NAME = 'braas_hpc_renderengine'
22+
23+
#######################BRaaSHPCPreferences#########################################
24+
25+
class BRaaSHPCPreferences(bpy.types.AddonPreferences):
26+
bl_idname = ADDON_NAME
27+
28+
braas_hpc_renderengine_port: bpy.props.IntProperty(
29+
name="Port",
30+
min=0,
31+
max=65565,
32+
default=8000
33+
) # type: ignore
34+
35+
braas_hpc_renderengine_server_name: bpy.props.StringProperty(
36+
name="Server",
37+
default="localhost"
38+
) # type: ignore
39+
40+
def draw(self, context):
41+
layout = self.layout
42+
43+
box = layout.box()
44+
box.label(text='BRaaSHPC TCP Server:')
45+
col = box.column()
46+
col.prop(self, "braas_hpc_renderengine_server_name", text="Server")
47+
col.prop(self, "braas_hpc_renderengine_port", text="Port")
48+
49+
def ctx_preferences():
50+
try:
51+
return bpy.context.preferences
52+
except AttributeError:
53+
return bpy.context.user_preferences
54+
55+
def preferences() -> BRaaSHPCPreferences:
56+
return ctx_preferences().addons[ADDON_NAME].preferences
57+
58+
def register():
59+
bpy.utils.register_class(BRaaSHPCPreferences)
60+
61+
def unregister():
62+
bpy.utils.unregister_class(BRaaSHPCPreferences)

0 commit comments

Comments
 (0)