Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -94,6 +94,7 @@ def create_particle_effects_animation():
|
|
94 |
emitter.keyframe_insert(data_path="location", index=-1, frame=duration * bpy.context.scene.render.fps)
|
95 |
|
96 |
def create_meteor_with_particle_system():
|
|
|
97 |
bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4, radius=0.25, location=(random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-10, 10)))
|
98 |
meteor = bpy.context.active_object
|
99 |
meteor.name = "Meteor"
|
@@ -130,31 +131,26 @@ def create_scene():
|
|
130 |
render.resolution_x = 1920
|
131 |
render.resolution_y = 1080
|
132 |
render.engine = 'BLENDER_EEVEE'
|
133 |
-
|
|
|
|
|
134 |
##world = bpy.context.scene.world
|
135 |
##bg_node = world.node_tree.nodes['Background']
|
136 |
##bg_node.image = img
|
137 |
|
138 |
##env_data = bpy.data.worlds['World'].node_tree.nodes['Background'].input
|
139 |
##env_data.default_value = img
|
140 |
-
|
141 |
-
##tex_environment = bpy.data.worlds['World'].node_tree.nodes.new('ShaderNodeTexEnvironment')
|
142 |
-
##tex_environment.image = img
|
143 |
-
##world = bpy.context.scene.world
|
144 |
-
##bg_node = world.node_tree.nodes['Background']
|
145 |
-
##world.node_tree.links.new(tex_environment.outputs[0], bg_node.inputs[0])
|
146 |
-
|
147 |
-
##img = bpy.data.images.load(image_path)
|
148 |
-
world = bpy.context.scene.world
|
149 |
-
if not world.use_nodes:
|
150 |
-
world.use_nodes = True
|
151 |
-
##tree = world.node_tree
|
152 |
-
##bg_node = tree.nodes.new(type='ShaderNodeTexEnvironment')
|
153 |
-
##bg_node.image = img
|
154 |
-
##tree.links.new(bg_node.outputs[0], tree.nodes['Background'].inputs[0])
|
155 |
bg_node = world.node_tree.nodes.get('Background')
|
156 |
bg_node.inputs['Color'].default_value = (0, 0, 0, 1)
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
bpy.data.objects['Cube'].select_set(True)
|
159 |
bpy.ops.object.delete()
|
160 |
bpy.data.objects['Camera'].select_set(True)
|
@@ -182,6 +178,11 @@ def create_scene():
|
|
182 |
create_particle_effects_animation()
|
183 |
##create_planet_flyby_animation(planet1, 4, 2)
|
184 |
##visualize_planets()
|
|
|
|
|
|
|
|
|
|
|
185 |
create_scene()
|
186 |
|
187 |
def export_blend():
|
|
|
94 |
emitter.keyframe_insert(data_path="location", index=-1, frame=duration * bpy.context.scene.render.fps)
|
95 |
|
96 |
def create_meteor_with_particle_system():
|
97 |
+
##wip
|
98 |
bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4, radius=0.25, location=(random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(-10, 10)))
|
99 |
meteor = bpy.context.active_object
|
100 |
meteor.name = "Meteor"
|
|
|
131 |
render.resolution_x = 1920
|
132 |
render.resolution_y = 1080
|
133 |
render.engine = 'BLENDER_EEVEE'
|
134 |
+
world = bpy.context.scene.world
|
135 |
+
if not world.use_nodes:
|
136 |
+
world.use_nodes = True
|
137 |
##world = bpy.context.scene.world
|
138 |
##bg_node = world.node_tree.nodes['Background']
|
139 |
##bg_node.image = img
|
140 |
|
141 |
##env_data = bpy.data.worlds['World'].node_tree.nodes['Background'].input
|
142 |
##env_data.default_value = img
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
bg_node = world.node_tree.nodes.get('Background')
|
144 |
bg_node.inputs['Color'].default_value = (0, 0, 0, 1)
|
145 |
|
146 |
+
tex_environment = world.node_tree.nodes.new('ShaderNodeTexEnvironment')
|
147 |
+
tex_environment.image = img
|
148 |
+
##world = bpy.context.scene.world
|
149 |
+
tx_node = world.node_tree.nodes['Background']
|
150 |
+
world.node_tree.links.new(tex_environment.outputs[0], tx_node.inputs[0])
|
151 |
+
|
152 |
+
##img = bpy.data.images.load(image_path)
|
153 |
+
|
154 |
bpy.data.objects['Cube'].select_set(True)
|
155 |
bpy.ops.object.delete()
|
156 |
bpy.data.objects['Camera'].select_set(True)
|
|
|
178 |
create_particle_effects_animation()
|
179 |
##create_planet_flyby_animation(planet1, 4, 2)
|
180 |
##visualize_planets()
|
181 |
+
scene = bpy.context.scene
|
182 |
+
render = scene.render
|
183 |
+
render.resolution_x = 1920
|
184 |
+
render.resolution_y = 1080
|
185 |
+
render.engine = 'BLENDER_EEVEE'
|
186 |
create_scene()
|
187 |
|
188 |
def export_blend():
|