# Optional: add decimate modifier (reduces polygons) mod = obj.modifiers.new(name="Decimate", type='DECIMATE') mod.ratio = 0.8 # tweak for more/less polygon look # Texture filtering: point (nearest) if obj.active_material: for node in obj.active_material.node_tree.nodes: if node.type == 'TEX_IMAGE': node.interpolation = 'Closest' (add your own camera placement) bpy.ops.object.camera_add(location=(5, -5, 3)) bpy.context.scene.camera = bpy.context.object Simple sun lamp bpy.ops.object.light_add(type='SUN', location=(5, 5, 10)) --- RENDER SETTINGS --- scene = bpy.context.scene scene.render.engine = 'BLENDER_EEVEE' scene.render.fps = RENDER_FPS scene.frame_start = FRAME_START scene.frame_end = FRAME_END scene.render.image_settings.file_format = 'FFMPEG' scene.render.ffmpeg.format = 'MPEG4' scene.render.ffmpeg.codec = 'H264' scene.render.filepath = os.path.join(OUTPUT_DIR, "polygon_movie.mp4") --- POST EFFECT: QUANTIZATION (low color depth) --- Add a compositor node for posterization bpy.context.scene.use_nodes = True tree = bpy.context.scene.node_tree for node in tree.nodes: tree.nodes.remove(node) render_node = tree.nodes.new(type='CompositorNodeRLayers') posterize = tree.nodes.new(type='CompositorNodePosterize') posterize.steps = 8 # few colors = polygon movie feel output = tree.nodes.new(type='CompositorNodeComposite') tree.links.new(render_node.outputs['Image'], posterize.inputs['Image']) tree.links.new(posterize.outputs['Image'], output.inputs['Image']) --- RENDER --- bpy.ops.render.render(animation=True)
Notice of Updated Buyer Terms of Use
We have recently updated our Buyer Terms of Use. We encourage you to review the revised terms to ensure continued understanding and compliance. By continuing to use our platform, you acknowledge and agree to the updated terms. View the updated Terms of Use