Spaces:
Sleeping
Sleeping
updates
Browse files
app.py
CHANGED
@@ -1,25 +1,37 @@
|
|
1 |
-
import
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
st.write("This app uses Hugging Face's transformers to summarize any text you provide.")
|
14 |
|
15 |
-
#
|
16 |
-
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import bpy
|
|
|
2 |
|
3 |
+
# Set up a basic scene with a camera and light
|
4 |
+
def setup_scene():
|
5 |
+
# Clear existing objects
|
6 |
+
bpy.ops.object.select_all(action='SELECT')
|
7 |
+
bpy.ops.object.delete()
|
8 |
|
9 |
+
# Add a camera
|
10 |
+
bpy.ops.object.camera_add(location=(0, -5, 3))
|
11 |
+
camera = bpy.context.active_object
|
12 |
+
camera.rotation_euler = (1.109, 0, 0)
|
13 |
+
|
14 |
+
# Set the camera as active
|
15 |
+
bpy.context.scene.camera = camera
|
16 |
|
17 |
+
# Add a light source
|
18 |
+
bpy.ops.object.light_add(type='POINT', location=(0, 0, 5))
|
|
|
19 |
|
20 |
+
# Add a cube to animate
|
21 |
+
bpy.ops.mesh.primitive_cube_add(location=(0, 0, 0))
|
22 |
+
cube = bpy.context.active_object
|
23 |
+
cube.name = 'Cube'
|
24 |
|
25 |
+
# Keyframe animation (for example, move the cube)
|
26 |
+
cube.location = (0, 0, 0)
|
27 |
+
cube.keyframe_insert(data_path="location", frame=1)
|
28 |
+
|
29 |
+
cube.location = (5, 5, 0)
|
30 |
+
cube.keyframe_insert(data_path="location", frame=50)
|
31 |
+
|
32 |
+
# Set the frame range for the animation
|
33 |
+
bpy.context.scene.frame_start = 1
|
34 |
+
bpy.context.scene.frame_end = 50
|
35 |
+
|
36 |
+
# Execute the setup function
|
37 |
+
setup_scene()
|