Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -55,9 +55,10 @@ def add_animated_space_rocks(name):
|
|
55 |
bpy.context.scene.render.fps = 10
|
56 |
duration = 2
|
57 |
radius=2
|
58 |
-
|
59 |
bpy.ops.mesh.primitive_uv_sphere_add(radius=random.uniform(0.03, 0.1), location=(random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-4, 9)))
|
60 |
space_rock = bpy.context.active_object
|
|
|
61 |
space_rock.keyframe_insert(data_path="location", frame=1)
|
62 |
space_rock.location = (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-10, 10))
|
63 |
space_rock.keyframe_insert(data_path="location", frame=20)
|
|
|
55 |
bpy.context.scene.render.fps = 10
|
56 |
duration = 2
|
57 |
radius=2
|
58 |
+
|
59 |
bpy.ops.mesh.primitive_uv_sphere_add(radius=random.uniform(0.03, 0.1), location=(random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-4, 9)))
|
60 |
space_rock = bpy.context.active_object
|
61 |
+
space_rock.name = ""+name+"_"+str(random.randint(1,100))+""
|
62 |
space_rock.keyframe_insert(data_path="location", frame=1)
|
63 |
space_rock.location = (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-10, 10))
|
64 |
space_rock.keyframe_insert(data_path="location", frame=20)
|