|
19 | 19 |
|
20 | 20 |
|
21 | 21 | def handle_client(client_socket, addr): |
22 | | - print('handle client') |
23 | | - |
24 | 22 | # global SERVER_SOCKET |
25 | 23 |
|
26 | 24 | be_paths = BESettings.START_PARAMS |
@@ -49,24 +47,31 @@ def handle_client(client_socket, addr): |
49 | 47 | print(traceback.format_exc()) |
50 | 48 |
|
51 | 49 | if be_base_stuff.run_type == BESettings.RunNodesType.RunNodes: |
| 50 | + js_output_data = {} |
52 | 51 |
|
53 | | - # Get Data |
54 | | - try: |
55 | | - js_inputs = js_base_stuff["BEngineInputs"] |
56 | | - js_output_data = BERunNodes.RunNodes(context, be_paths, js_inputs, node_tree, |
57 | | - process_gn_obj, geom_mod, be_base_stuff) |
| 52 | + if node_tree: |
| 53 | + # Get Data |
| 54 | + try: |
| 55 | + js_inputs = js_base_stuff["BEngineInputs"] |
| 56 | + js_output_data = BERunNodes.RunNodes(context, be_paths, js_inputs, node_tree, |
| 57 | + process_gn_obj, geom_mod, be_base_stuff) |
58 | 58 |
|
59 | | - except Exception as e: |
60 | | - print("There was a Problem During RunNodes.") |
61 | | - print(traceback.format_exc()) |
| 59 | + except Exception as e: |
| 60 | + print("There was a Problem During RunNodes.") |
| 61 | + print(traceback.format_exc()) |
62 | 62 |
|
63 | | - js_output_data = {} |
| 63 | + js_output_data = {} |
| 64 | + else: |
| 65 | + print("NodeTree is None. Probably the NodeTree is Wrong.") |
64 | 66 |
|
65 | 67 | # Send |
66 | 68 | client_socket.sendall(str.encode(json.dumps(js_output_data))) |
67 | 69 |
|
68 | 70 | elif be_base_stuff.run_type == BESettings.RunNodesType.UpdateNodes: |
69 | | - BERunNodes.SaveBlenderInputs(be_base_stuff, node_tree) |
| 71 | + if node_tree: |
| 72 | + BERunNodes.SaveBlenderInputs(be_base_stuff, node_tree) |
| 73 | + else: |
| 74 | + print("NodeTree is None. Probably the NodeTree is Wrong.") |
70 | 75 |
|
71 | 76 |
|
72 | 77 | AddBackServer(0.01) |
|
0 commit comments