Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def add_planet(name, radius, mass, distance_from_sun):
|
|
37 |
bpy.context.view_layer.objects.active = planet
|
38 |
planet.select_set(True)
|
39 |
planet.animation_data_create()
|
40 |
-
planet.animation_data.action = bpy.data.actions.new(name="
|
41 |
start_frame = 1
|
42 |
duration=2
|
43 |
end_frame = int(duration * 10)
|
@@ -51,7 +51,7 @@ def add_planet(name, radius, mass, distance_from_sun):
|
|
51 |
##z = radius * math.sin(angle)
|
52 |
##planet.location = (x, y, z)
|
53 |
##planet.keyframe_insert(data_path="location", index=-1, frame=frame)
|
54 |
-
angle = math.radians(frame *
|
55 |
planet.rotation_euler = (0, 0, angle)
|
56 |
planet.keyframe_insert(data_path="rotation_euler", index=-1, frame=frame)
|
57 |
##return planet
|
|
|
37 |
bpy.context.view_layer.objects.active = planet
|
38 |
planet.select_set(True)
|
39 |
planet.animation_data_create()
|
40 |
+
planet.animation_data.action = bpy.data.actions.new(name="RotationAction_"+planet.name)
|
41 |
start_frame = 1
|
42 |
duration=2
|
43 |
end_frame = int(duration * 10)
|
|
|
51 |
##z = radius * math.sin(angle)
|
52 |
##planet.location = (x, y, z)
|
53 |
##planet.keyframe_insert(data_path="location", index=-1, frame=frame)
|
54 |
+
angle = math.radians(frame * 19)
|
55 |
planet.rotation_euler = (0, 0, angle)
|
56 |
planet.keyframe_insert(data_path="rotation_euler", index=-1, frame=frame)
|
57 |
##return planet
|