Skip to content

Commit c30ac6b

Browse files
committed
fix: missing change in function name
1 parent cb195ef commit c30ac6b

File tree

10 files changed

+42
-42
lines changed

10 files changed

+42
-42
lines changed

API/oursin/atlas/ontology.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, atlas_name, atlas_dimensions, atlas_resolution):
1616
resolution= utils.formatted_vector3(atlas_resolution)
1717
)
1818

19-
client.sio.emit('CustomAtlas', data.to_string())
19+
client.sio.emit('CustomAtlas', data.to_json_string())
2020

2121
class Atlas:
2222
def __init__(self, atlas_name):
@@ -56,7 +56,7 @@ def __init__(self, atlas_name):
5656
def _update(self):
5757
"""Internal helper function, push data to Unity and update all values
5858
"""
59-
client.sio.emit('urchin-atlas-update', self.data.to_string())
59+
client.sio.emit('urchin-atlas-update', self.data.to_json_string())
6060

6161
def load(self):
6262
"""Load this atlas
@@ -65,7 +65,7 @@ def load(self):
6565
print("(Warning) Atlas was already loaded, the renderer can have issues if you try to load an atlas twice.")
6666

6767
self.loaded = True
68-
client.sio.emit('urchin-atlas-load', self.data.to_string())
68+
client.sio.emit('urchin-atlas-load', self.data.to_json_string())
6969

7070
def clear(self):
7171
"""Clear all visible areas

API/oursin/camera.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(self, main = False):
8989
cameras.append(self)
9090

9191
def _update(self):
92-
client.sio.emit('urchin-camera-update', self.data.to_string())
92+
client.sio.emit('urchin-camera-update', self.data.to_json_string())
9393

9494
def reset(self):
9595
self.data = CameraModel(id = self.data.id, controllable=self.data.controllable)
@@ -105,7 +105,7 @@ def delete(self):
105105
if self.in_unity == False:
106106
raise Exception("Camera is not created. Please create camera before calling method.")
107107

108-
client.sio.emit('urchin-camera-delete', IDData(id = self.data.id).to_string())
108+
client.sio.emit('urchin-camera-delete', IDData(id = self.data.id).to_json_string())
109109
self.in_unity = False
110110

111111
def set_target_coordinate(self,camera_target_coordinate):
@@ -298,7 +298,7 @@ async def screenshot(self, size=[1024,768], filename = 'return'):
298298
value= utils.formatted_vector2(size)
299299
)
300300

301-
client.sio.emit('urchin-camera-screenshot-request', data.to_string())
301+
client.sio.emit('urchin-camera-screenshot-request', data.to_json_string())
302302

303303
while not self.image_received:
304304
await asyncio.sleep(0.1)
@@ -361,7 +361,7 @@ async def capture_video(self, file_name, callback = None,
361361
client.sio.emit('urchin-camera-lerp-set', CameraRotationModel(
362362
start_rotation=utils.formatted_vector3(start_rotation),
363363
end_rotation=utils.formatted_vector3(end_rotation)
364-
).to_string())
364+
).to_json_string())
365365

366366
for frame in range(n_frames):
367367

@@ -374,7 +374,7 @@ async def capture_video(self, file_name, callback = None,
374374
client.sio.emit('urchin-camera-lerp', FloatData(
375375
id=self.data.id,
376376
value=perc
377-
).to_string())
377+
).to_json_string())
378378

379379
if not test:
380380
img = await self.screenshot([size[0], size[1]])
@@ -423,7 +423,7 @@ def set_brain_rotation(yaw):
423423
Yaw angle for the brain, independent of the camera
424424
"""
425425

426-
client.sio.emit('urchin-brain-yaw', FloatData(id='', value=yaw).to_string())
426+
client.sio.emit('urchin-brain-yaw', FloatData(id='', value=yaw).to_json_string())
427427

428428
def clear():
429429
global cameras

API/oursin/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, vertices, triangles, normals = None):
4444
customs.append(self)
4545

4646
def _update(self):
47-
client.sio.emit('urchin-custommesh-update', self.data.to_string())
47+
client.sio.emit('urchin-custommesh-update', self.data.to_json_string())
4848

4949
def delete(self):
5050
"""Destroy this object in the renderer scene
@@ -54,7 +54,7 @@ def delete(self):
5454
id = self.data.id
5555
)
5656

57-
client.sio.emit('urchin-custommesh-delete', data.to_string())
57+
client.sio.emit('urchin-custommesh-delete', data.to_json_string())
5858
self.in_unity = False
5959

6060
def set_position(self, position = [0,0,0], use_reference = True):

API/oursin/dock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def create_bucket(bucket_name, password, api_url = api_url, token = test_token):
5757
dock_url=api_url
5858
)
5959

60-
client.sio.emit('urchin-dock-data', api_data.to_string())
60+
client.sio.emit('urchin-dock-data', api_data.to_json_string())
6161

6262
# Request new bucket
6363
create_url = f'{api_url}/create/{bucket_name}'
@@ -107,7 +107,7 @@ def save(filename = None, bucket_name = None, password = None):
107107
password= "" if password_hash is None else password_hash
108108
)
109109

110-
client.sio.emit('urchin-save', data.to_string())
110+
client.sio.emit('urchin-save', data.to_json_string())
111111

112112
def load(filename = None, bucket_name = None, password= None):
113113
"""Load all data from a bucket
@@ -138,7 +138,7 @@ def load(filename = None, bucket_name = None, password= None):
138138
password= "" if password_hash is None else password_hash
139139
)
140140

141-
client.sio.emit('urchin-load', data.to_string())
141+
client.sio.emit('urchin-load', data.to_json_string())
142142

143143
def check_and_store(bucket_name, password):
144144
global active_bucket

API/oursin/lines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ def __init__(self, positions= [[0.0,0.0,0.0]], color= [1, 1, 1]):
3232
lines.append(line)
3333

3434
def _update(self):
35-
client.sio.emit('urchin-line-update', self.data.to_string())
35+
client.sio.emit('urchin-line-update', self.data.to_json_string())
3636

3737
def delete(self):
3838
"""Deletes lines
3939
4040
Examples
4141
>>>l1.delete()
4242
"""
43-
client.sio.emit('urchin-line-delete', IDData(id=self.data.id).to_string())
43+
client.sio.emit('urchin-line-delete', IDData(id=self.data.id).to_json_string())
4444
self.in_unity = False
4545

4646
def set_positions(self, positions):

API/oursin/meshes.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self, position= [0.0,0.0,0.0], scale= [1,1,1], color=[1,1,1],
6060
def _update(self):
6161
"""Serialize and update the data in the Urchin Renderer
6262
"""
63-
client.sio.emit('urchin-meshes-update', self.data.to_string())
63+
client.sio.emit('urchin-meshes-update', self.data.to_json_string())
6464

6565
def delete(self):
6666
"""Deletes meshes
@@ -77,7 +77,7 @@ def delete(self):
7777
data = IDData
7878
data.id = self.data.id
7979

80-
client.sio.emit('urchin-meshes-delete', data.to_string())
80+
client.sio.emit('urchin-meshes-delete', data.to_json_string())
8181
self.in_unity = False
8282

8383
def set_position(self, position):
@@ -220,7 +220,7 @@ def delete(meshes_list):
220220
ids = [x.data.id for x in meshes_list]
221221
)
222222

223-
client.sio.emit('urchin-meshes-deletes', data.to_string())
223+
client.sio.emit('urchin-meshes-deletes', data.to_json_string())
224224

225225
def set_positions(meshes_list, positions_list):
226226
"""Set the positions of mesh renderers
@@ -244,7 +244,7 @@ def set_positions(meshes_list, positions_list):
244244
values = [utils.formatted_vector3(utils.sanitize_vector3([x[0]/1000, x[1]/1000, x[2]/1000])) for x in positions_list]
245245
)
246246

247-
client.sio.emit('urchin-meshes-positions', data.to_string())
247+
client.sio.emit('urchin-meshes-positions', data.to_json_string())
248248

249249
def set_scales(meshes_list, scales_list):
250250
"""Set scale of mesh renderers
@@ -268,7 +268,7 @@ def set_scales(meshes_list, scales_list):
268268
values = [utils.formatted_vector3(utils.sanitize_vector3(x)) for x in scales_list]
269269
)
270270

271-
client.sio.emit('urchin-meshes-scales', data.to_string())
271+
client.sio.emit('urchin-meshes-scales', data.to_json_string())
272272

273273
def set_colors(meshes_list, colors_list):
274274
"""Sets colors of mesh renderers
@@ -293,7 +293,7 @@ def set_colors(meshes_list, colors_list):
293293
values = [utils.formatted_color(x) for x in colors_list]
294294
)
295295

296-
client.sio.emit('urchin-meshes-colors', data.to_string())
296+
client.sio.emit('urchin-meshes-colors', data.to_json_string())
297297

298298
def set_materials(meshes_list, materials_list):
299299
"""Sets materials of mesh renderers
@@ -318,4 +318,4 @@ def set_materials(meshes_list, materials_list):
318318
values = [utils.sanitize_material(x) for x in materials_list]
319319
)
320320

321-
client.sio.emit('urchin-meshes-materials', data.to_string())
321+
client.sio.emit('urchin-meshes-materials', data.to_json_string())

API/oursin/particles.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ def __init__(self, n, material = 'circle', positions = None, sizes = None, color
5050
def _update(self):
5151
"""Push data to Urchin renderer
5252
"""
53-
client.sio.emit('urchin-particles-update', self.data.to_string())
53+
client.sio.emit('urchin-particles-update', self.data.to_json_string())
5454

5555
def delete(self):
5656
"""Delete this particle system and all its particles
5757
"""
58-
client.sio.emit('urchin-particles-delete', IDData(id= self.data.id).to_string())
58+
client.sio.emit('urchin-particles-delete', IDData(id= self.data.id).to_json_string())
5959
self.in_unity = False
6060

6161
def set_material(self, material):
@@ -120,7 +120,7 @@ def _set_positions(self, positions):
120120
if self.in_unity == False:
121121
raise Exception("Particle system was deleted")
122122

123-
client.sio.emit('urchin-particles-positions', positions.to_string())
123+
client.sio.emit('urchin-particles-positions', positions.to_json_string())
124124

125125
def set_sizes(self, sizes):
126126
"""Set the sizes of particles in um
@@ -164,7 +164,7 @@ def _set_sizes(self, sizes):
164164
if self.in_unity == False:
165165
raise Exception("Particle system was deleted")
166166

167-
client.sio.emit('urchin-particles-sizes', sizes.to_string())
167+
client.sio.emit('urchin-particles-sizes', sizes.to_json_string())
168168

169169
def set_colors(self, colors):
170170
"""Set the colors of particles
@@ -210,7 +210,7 @@ def _set_colors(self, colors):
210210
if self.in_unity == False:
211211
raise Exception("Particle system was deleted")
212212

213-
client.sio.emit('urchin-particles-colors', colors.to_string())
213+
client.sio.emit('urchin-particles-colors', colors.to_json_string())
214214

215215
def clear():
216216
"""Clear all particle systems

API/oursin/probes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, color = 'FFFFFF', position = [0,0,0], angle = [0,0,0], style
3838
probes.append(self)
3939

4040
def _update(self):
41-
client.sio.emit('urchin-probe-update', self.data.to_string())
41+
client.sio.emit('urchin-probe-update', self.data.to_json_string())
4242

4343
def delete(self):
4444
"""Delete probe objects
@@ -51,7 +51,7 @@ def delete(self):
5151
--------
5252
>>> p1.delete()
5353
"""
54-
client.sio.emit('urchin-probe-delete', IDData(id=self.data.id).to_string())
54+
client.sio.emit('urchin-probe-delete', IDData(id=self.data.id).to_json_string())
5555
self.in_unity = False
5656

5757
def set_color(self,color):
@@ -205,7 +205,7 @@ def set_colors(probes_list, colors_list):
205205
values= [utils.formatted_color(x) for x in colors_list]
206206
)
207207

208-
client.sio.emit('urchin-probe-colors', data.to_string())
208+
client.sio.emit('urchin-probe-colors', data.to_json_string())
209209

210210
def set_positions(probes_list, positions_list):
211211
"""Set probe tip positions in AP/ML/DV coordinates in um relative to the zero point (front, left, top)
@@ -227,7 +227,7 @@ def set_positions(probes_list, positions_list):
227227
values= [utils.formatted_vector3([pos[0]/1000, pos[1]/1000, pos[2]/1000]) for pos in positions_list]
228228
)
229229

230-
client.sio.emit('urchin-probe-positions', data.to_string())
230+
client.sio.emit('urchin-probe-positions', data.to_json_string())
231231

232232
def set_angles(probes_list, angles_list):
233233
"""Set probe azimuth/elevation/spin angles in degrees
@@ -253,7 +253,7 @@ def set_angles(probes_list, angles_list):
253253
values= [utils.formatted_vector3(angle) for angle in angles_list]
254254
)
255255

256-
client.sio.emit('urchin-probe-angles', data.to_string())
256+
client.sio.emit('urchin-probe-angles', data.to_json_string())
257257

258258
# def set_probe_styles(probes_list,styles_list):
259259
# """Set probe rendering style
@@ -308,4 +308,4 @@ def set_scales(probes_list, scales_list):
308308
values= [utils.formatted_vector3(scale) for scale in scales_list]
309309
)
310310

311-
client.sio.emit('urchin-probe-scales', data.to_string())
311+
client.sio.emit('urchin-probe-scales', data.to_json_string())

API/oursin/text.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, text = "", color = [1, 1, 1], font_size = 12, position = [0,0
4040
def _update(self):
4141
"""Send serialized data to update this text object in Urchin
4242
"""
43-
client.sio.emit('urchin-text-update', self.data.to_string())
43+
client.sio.emit('urchin-text-update', self.data.to_json_string())
4444

4545
def delete(self):
4646
"""Delete a text object
@@ -49,7 +49,7 @@ def delete(self):
4949
--------
5050
>>> t1.delete()
5151
"""
52-
client.sio.emit('urchin-text-delete', IDData(id=self.data.id).to_string())
52+
client.sio.emit('urchin-text-delete', IDData(id=self.data.id).to_json_string())
5353
self.in_unity = False
5454

5555
def set_text(self, text):
@@ -161,7 +161,7 @@ def set_texts(text_list, str_list):
161161
values= [string for string in str_list]
162162
)
163163

164-
client.sio.emit('urchin-text-texts', data.to_string())
164+
client.sio.emit('urchin-text-texts', data.to_json_string())
165165

166166
def set_positions(text_list, pos_list):
167167
"""Set the positions of multiple text objects
@@ -185,7 +185,7 @@ def set_positions(text_list, pos_list):
185185
values = [text.data.position for text in text_list]
186186
)
187187

188-
client.sio.emit('urchin-text-positions', data.to_string())
188+
client.sio.emit('urchin-text-positions', data.to_json_string())
189189

190190
def set_font_sizes(text_list, font_size_list):
191191
"""_summary_
@@ -208,7 +208,7 @@ def set_font_sizes(text_list, font_size_list):
208208
values= [text.data.font_size for text in text_list]
209209
)
210210

211-
client.sio.emit('urchin-text-sizes', data.to_string())
211+
client.sio.emit('urchin-text-sizes', data.to_json_string())
212212

213213
def set_colors(text_list, color_list):
214214
"""_summary_
@@ -230,4 +230,4 @@ def set_colors(text_list, color_list):
230230
values= [text.data.color for text in text_list]
231231
)
232232

233-
client.sio.emit('urchin-text-colors', data.to_string())
233+
client.sio.emit('urchin-text-colors', data.to_json_string())

API/oursin/volumes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ def __init__(self, volume_data, colormap = None):
120120
bytes = compressed_data[offset : offset + chunk_size]
121121

122122
)
123-
client.sio.emit('SetVolumeData', chunk_data.to_string())
123+
client.sio.emit('SetVolumeData', chunk_data.to_json_string())
124124

125125
offset += chunk_size
126126

127127
volumes.append(self)
128128

129129
def update(self):
130-
client.sio.emit('UpdateVolume', self.data.to_string())
130+
client.sio.emit('UpdateVolume', self.data.to_json_string())
131131

132132
def delete(self):
133133
client.sio.emit('DeleteVolume', self.id)

0 commit comments

Comments
 (0)