JoPmt commited on
Commit
87000fc
1 Parent(s): 88c6411

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -15
app.py CHANGED
@@ -60,21 +60,8 @@ def add_animated_space_rocks():
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=duration * bpy.context.scene.render.fps)
64
- bpy.context.view_layer.objects.active = space_rock
65
- space_rock.select_set(True)
66
- space_rock.animation_data_create()
67
- space_rock.animation_data.action = bpy.data.actions.new(name="OrbitAction")
68
- start_frame = 1
69
- end_frame = int(duration * 10)
70
- for frame in range(start_frame, end_frame + 1):
71
- angle = (frame / end_frame) * 2 * math.pi
72
- x = radius * math.cos(angle)
73
- y = space_rock.location.y
74
- z = radius * math.sin(angle)
75
- space_rock.location = (x, y, z)
76
- space_rock.keyframe_insert(data_path="location", index=-1, frame=frame)
77
-
78
 
79
  def create_particle_effects_animation():
80
  bpy.context.scene.render.fps = 10
 
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", index=-1, frame=duration * bpy.context.scene.render.fps)
64
+
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  def create_particle_effects_animation():
67
  bpy.context.scene.render.fps = 10