Skip to content

Commit 7bcc586

Browse files
committed
Updated for Blender 2.80
1 parent dd964a4 commit 7bcc586

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"www.github.com/p4vv37/blender_command_port",
55
"author": "Pawel Kowalski",
66
"version": (1, 0, 0),
7+
"blender": (2, 80, 0),
78
"location": "Properties > Data > Blender Command Port",
89
"support": "COMMUNITY",
910
"wiki_url": "www.github.com/p4vv37/blender_command_port",

command_port.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def execute(self, context):
189189
except Empty:
190190
pass
191191
if self.timer is None:
192-
self.timer = context.window_manager.event_timer_add(.01, context.window)
192+
self.timer = context.window_manager.event_timer_add(.01, window=context.window)
193193
return {'PASS_THROUGH'}
194194

195195
def modal(self, context, event):
@@ -240,32 +240,33 @@ def register(queue_size=0, timeout=.1, port=5000, buffersize=4096, max_connectio
240240
:param redirect_output: Indicates if output should be copied and sent
241241
:type redirect_output: bool
242242
"""
243-
Scene.bcp_queue_size = IntProperty(default=queue_size,
244-
name="Queue size",
245-
description="Size of commands queue: max number of commands that are qaiting "
246-
"to be executed. 0 == no limit", )
247-
Scene.bcp_timeout = FloatProperty(default=timeout,
248-
name="Timeout",
249-
description="Maximum connection timeout, in seconds")
250-
Scene.bcp_port = IntProperty(default=port,
251-
name="Port",
252-
description="Port for the socket")
253-
Scene.bcp_buffersize = IntProperty(default=buffersize,
254-
name="Buffersize",
255-
description="Buffersize, in bytes, for socket")
256-
Scene.bcp_max_connections = IntProperty(default=max_connections,
257-
name="Max connections",
258-
description="\"backlog\" parameter of socket \"listen\" method")
259-
Scene.bcp_return_result = BoolProperty(default=return_result,
260-
name="Return result",
261-
description="Indicates if result of command should be returned")
262-
Scene.bcp_result_as_json = BoolProperty(default=result_as_json,
263-
name="Result as json",
264-
description="Indicates if result of command should be returned as a "
265-
"json string")
266-
Scene.bcp_redirect_output = BoolProperty(default=redirect_output,
267-
name="Redirect output",
268-
description="Indicates if output should be copied and sent")
243+
Scene.bcp_queue_size: IntProperty() = IntProperty(default=queue_size,
244+
name="Queue size",
245+
description="Size of commands queue: max number of "
246+
"commands that are qaiting to be executed. "
247+
"0 == no limit", )
248+
Scene.bcp_timeout: FloatProperty() = FloatProperty(default=timeout,
249+
name="Timeout",
250+
description="Maximum connection timeout, in seconds")
251+
Scene.bcp_port: IntProperty = IntProperty(default=port,
252+
name="Port",
253+
description="Port for the socket")
254+
Scene.bcp_buffersize: IntProperty = IntProperty(default=buffersize,
255+
name="Buffersize",
256+
description="Buffersize, in bytes, for socket")
257+
Scene.bcp_max_connections: IntProperty = IntProperty(default=max_connections,
258+
name="Max connections",
259+
description="\"backlog\" parameter of socket \"listen\" method")
260+
Scene.bcp_return_result: BoolProperty = BoolProperty(default=return_result,
261+
name="Return result",
262+
description="Indicates if result of command should be returned")
263+
Scene.bcp_result_as_json: BoolProperty = BoolProperty(default=result_as_json,
264+
name="Result as json",
265+
description="Indicates if result of command should be "
266+
"returned as a json string")
267+
Scene.bcp_redirect_output: BoolProperty = BoolProperty(default=redirect_output,
268+
name="Redirect output",
269+
description="Indicates if output should be copied and sent")
269270
bpy.utils.register_class(CommandPortOperator)
270271

271272

execute_file_in_blender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ def send_command(command):
1313
print(res.decode())
1414
clientsocket.close()
1515

16-
send_command("""exec(compile(open("{}", "rb").read(), filename, 'exec'), globals, locals)""".format(sys.argv[1]))
16+
send_command("""exec(compile(open("{}", "rb").read(), filename, 'exec'), globals, locals)""".format(sys.argv[1]))

0 commit comments

Comments
 (0)