FLUX prompt: import bpy # Очистка сцены bpy.ops.object.select_...
91views
0favorites
Model used
FLUXflux-1.1-proGeneration parameters
Image1024x1024272391
Prompt
import bpy
# Очистка сцены
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
# Добавление плоскости для флага
bpy.ops.mesh.primitive_plane_add(size=2, location=(0, 0, 0))
flag = bpy.context.object
flag.name = "Korean Flag"
# Применение текстуры флага Южной Кореи
material = bpy.data.materials.new(name="FlagMaterial")
material.use_nodes = True
nodes = material.node_tree.nodes
links = material.node_tree.links
# Удаляем стандартный узел BSDF
for node in nodes:
nodes.remove(node)
# Добавляем узел Image Texture
image_texture = nodes.new(type='ShaderNodeTexImage')
image_texture.image = bpy.data.images.load("//south_korea_flag.png") # Укажите путь к изображению флага
image_texture.location = (-300, 300)
# Узел Principled BSDF
bsdf = nodes.new(type='ShaderNodeBsdfPrincipled')
bsdf.location = (0, 300)
# Узел Output
output = nodes.new(type='ShaderNodeOutputMaterial')
output.location = (300, 300)
# Соединяем узлы
links.new(image_texture.outputs['Color'], bsdf.inputs['Base Color'])
links.new(bsdf.outputs['BSDF'], output.inputs['Surface'])
# Присваиваем материал объекту
flag.data.materials.append(material)
# Добавление текста "Привет, Южная Корея!"
bpy.ops.object.text_add(location=(0, -2, 0))
text = bpy.context.object
text.data.body = "Hello, South Korea!"
text.data.size = 0.5
text.data.extrude = 0.1
# Настройка камеры
bpy.ops.object.camera_add(location=(0, -6, 2))
camera = bpy.context.object
camera.rotation_euler = (1.2, 0, 0)
bpy.context.scene.camera = camera
# Настройка света
bpy.ops.object.light_add(type='SUN', location=(5, -5, 5))
light = bpy.context.object
# Рендеринг сцены
bpy.context.scene.render.engine = 'CYCLES'
bpy.context.scene.render.filepath = "//hello_south_korea.png"
bpy.ops.render.render(write_still=True)
More by @1cf4f6e4478
Comments (0)
Please sign in to comment