JoPmt commited on
Commit
ca405dd
1 Parent(s): 3b087f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -16
app.py CHANGED
@@ -99,21 +99,7 @@ def create_meteor_with_particle_system():
99
  output_node = nodes.get("Material Output")
100
  material_link = meteor.active_material.node_tree.links.new
101
  material_link(emission_node.outputs[0], output_node.inputs[0])
102
-
103
- bpy.ops.mesh.primitive_uv_sphere_add(radius=random.uniform(0.01, 0.04), location=(random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-10, 10)))
104
- partone = bpy.context.active_object
105
- partone.name = "ParticleOne"
106
-
107
- particle_settings = meteor.modifiers.new(name="EnergySpheres", type='PARTICLE_SYSTEM')
108
- particle_settings.particle_system.settings.count = 100
109
- particle_settings.particle_system.settings.lifetime = random.uniform(10, 20)
110
- particle_settings.particle_system.settings.frame_start = 1
111
- particle_settings.particle_system.settings.frame_end = 20
112
- particle_settings.particle_system.settings.use_emit_random = True
113
- particle_settings.particle_system.settings.render_type = 'OBJECT'
114
- particle_settings.particle_system.settings.instance_object = bpy.data.objects["ParticleOne"]
115
-
116
- meteor.keyframe_insert(data_path="location", index=-1, frame=1)
117
  meteor.location = (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-10, 10))
118
  meteor.keyframe_insert(data_path="location", index=-1, frame=20)
119
 
@@ -162,7 +148,7 @@ def create_scene():
162
  add_planet("mars", 1.75, 0.5, 1.5)
163
  for i in range(30):
164
  add_animated_space_rocks("spacerock")
165
- ##create_meteor_with_particle_system()
166
  ##create_particle_effects_animation()
167
  ##create_planet_flyby_animation(planet1, 4, 2)
168
  ##visualize_planets()
 
99
  output_node = nodes.get("Material Output")
100
  material_link = meteor.active_material.node_tree.links.new
101
  material_link(emission_node.outputs[0], output_node.inputs[0])
102
+ meteor.keyframe_insert(data_path="location", frame=1)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  meteor.location = (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-10, 10))
104
  meteor.keyframe_insert(data_path="location", index=-1, frame=20)
105
 
 
148
  add_planet("mars", 1.75, 0.5, 1.5)
149
  for i in range(30):
150
  add_animated_space_rocks("spacerock")
151
+ create_meteor_with_particle_system()
152
  ##create_particle_effects_animation()
153
  ##create_planet_flyby_animation(planet1, 4, 2)
154
  ##visualize_planets()