Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -42,10 +42,10 @@ def visualize_planets():
|
|
42 |
if obj.type == 'MESH' and "mass" in obj:
|
43 |
obj.select_set(True)
|
44 |
for area in bpy.context.screen.areas:
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
##bpy.ops.view3d.snap_cursor_to_selected()
|
50 |
##bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
|
51 |
##bpy.context.scene.cursor.location = (0, 0, 0)
|
|
|
42 |
if obj.type == 'MESH' and "mass" in obj:
|
43 |
obj.select_set(True)
|
44 |
for area in bpy.context.screen.areas:
|
45 |
+
if area.type == 'VIEW_3D':
|
46 |
+
override = bpy.context.copy()
|
47 |
+
override['area'] = area
|
48 |
+
bpy.ops.view3d.snap_cursor_to_selected(override)
|
49 |
##bpy.ops.view3d.snap_cursor_to_selected()
|
50 |
##bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
|
51 |
##bpy.context.scene.cursor.location = (0, 0, 0)
|