@@ -283,28 +283,62 @@ def save_viewable_file():
283283def create_point ():
284284 utils_functions .validate_request (flask .request , create_point_json )
285285 DATA_FOLDER_PATH = flask .current_app .config ["DATA_FOLDER_PATH" ]
286+ title = flask .request .json ["title" ]
286287 x = flask .request .json ["x" ]
287288 y = flask .request .json ["y" ]
288289 z = flask .request .json ["z" ]
289290 class_ = geode_functions .geode_object_class ("PointSet3D" )
290291 PointSet3D = class_ .create ()
291292 builder = geode_functions .create_builder ("PointSet3D" , PointSet3D )
292293 builder .create_point (opengeode .Point3D ([x , y , z ]))
293-
294+ builder .set_name (title )
295+ name = PointSet3D .name ()
294296 generated_id = str (uuid .uuid4 ()).replace ("-" , "" )
297+ object_type = geode_functions .get_object_type ("PointSet3D" )
298+ saved_native_file_path = geode_functions .save (
299+ "PointSet3D" , PointSet3D , DATA_FOLDER_PATH , generated_id + ".og_pts3d"
300+ )
295301 saved_viewable_file_path = geode_functions .save_viewable (
296302 "PointSet3D" , PointSet3D , DATA_FOLDER_PATH , generated_id
297303 )
298304
305+ native_file_name = os .path .basename (saved_native_file_path [0 ])
306+ viewable_file_name = os .path .basename (saved_viewable_file_path )
307+
299308 return flask .make_response (
300309 {
301310 "viewable_file_name" : os .path .basename (saved_viewable_file_path ),
302311 "id" : generated_id ,
312+ "name" : name ,
313+ "native_file_name" : native_file_name ,
314+ "viewable_file_name" : viewable_file_name ,
315+ "object_type" : object_type ,
316+ "geode_object" : "PointSet3D" ,
303317 },
304318 200 ,
305319 )
306320
307321
322+ with open (os .path .join (schemas , "texture_coordinates.json" ), "r" ) as file :
323+ texture_coordinates_json = json .load (file )
324+
325+
326+ @routes .route (
327+ texture_coordinates_json ["route" ],
328+ methods = texture_coordinates_json ["methods" ],
329+ )
330+ def texture_coordinates ():
331+ DATA_FOLDER_PATH = flask .current_app .config ["DATA_FOLDER_PATH" ]
332+ utils_functions .validate_request (flask .request , texture_coordinates_json )
333+ data = geode_functions .load (
334+ flask .request .json ["input_geode_object" ],
335+ os .path .join (DATA_FOLDER_PATH , flask .request .json ["filename" ]),
336+ )
337+ texture_coordinates = data .texture_manager ().texture_names ()
338+
339+ return flask .make_response ({"texture_coordinates" : texture_coordinates }, 200 )
340+
341+
308342with open (
309343 os .path .join (schemas , "vertex_attribute_names.json" ),
310344 "r" ,
0 commit comments