- app/: app demo (Kivy/buildozer) da API do robo - software/: servidor RoboMovel (SLAM, profundidade, navegacao) e firmware da base movel (movido de firmware/) - simulacao/: projeto Godot do robo e script de lancamento servidor + simulacao - modelos/: planta do 5o andar do bloco D, cena Blender do corredor e modelo real do robo - partes/mdf/: chapas identificadas e nesting da base do robo (DXF/SVG/FCStd) - projeto/render, relatorio/imagens, slides: renders finais e apresentacoes de progresso - ferramentas/scripts: encaixe de chapas, planta do bloco D e render do corredor no Blender - .gitignore: ignora backups do Blender/FreeCAD e .godot/
393 lines
17 KiB
Python
393 lines
17 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""Cena do robô no corredor do 5º andar do Bloco D (UNICAP).
|
|
|
|
blender -b -P corredor_blender.py -- [amostras] [largura] [altura]
|
|
|
|
Importa modelos/planta/bloco_d_5andar.obj (gerado pelo FreeCAD com
|
|
ferramentas/scripts/planta/bloco_d_5andar.py), aplica materiais pelo prefixo do nome de cada peça,
|
|
coloca o robô (modelos/blender/robo_import.blend) no corredor, cria as placas das salas e renderiza
|
|
duas vistas. Salva a cena em modelos/blender/corredor_bloco_d.blend.
|
|
"""
|
|
import bpy, json, math, os, sys
|
|
from mathutils import Vector
|
|
|
|
RAIZ = os.path.expanduser("~/Documentos/Projeto/Robotica/RoboMovel")
|
|
OBJ = os.path.join(RAIZ, "modelos/planta/bloco_d_5andar.obj")
|
|
INFO = json.load(open(os.path.join(RAIZ, "modelos/planta/bloco_d_5andar.json")))
|
|
ROBO = os.path.join(RAIZ, "modelos/blender/robo_import.blend")
|
|
SAIDA = os.path.join(RAIZ, "projeto/render/final")
|
|
argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
|
|
AMOSTRAS = int(argv[0]) if argv else 256
|
|
LARG, ALT = (int(argv[1]), int(argv[2])) if len(argv) > 2 else (1920, 1080)
|
|
|
|
bpy.ops.wm.read_factory_settings(use_empty=True)
|
|
cena = bpy.context.scene
|
|
|
|
|
|
# ============================================================ utilidades de nós
|
|
def material(nome):
|
|
m = bpy.data.materials.new(nome)
|
|
m.use_nodes = True
|
|
return m, m.node_tree, m.node_tree.nodes["Principled BSDF"]
|
|
|
|
|
|
def no(nt, tipo, **props):
|
|
n = nt.nodes.new(tipo)
|
|
for k, v in props.items():
|
|
if k.startswith("in_"):
|
|
n.inputs[k[3:].replace("_", " ")].default_value = v
|
|
else:
|
|
setattr(n, k, v)
|
|
return n
|
|
|
|
|
|
def liga(nt, a, b):
|
|
nt.links.new(a, b)
|
|
|
|
|
|
def rampa(nt, pares):
|
|
r = nt.nodes.new("ShaderNodeValToRGB")
|
|
els = r.color_ramp.elements
|
|
for i, (pos, cor) in enumerate(pares):
|
|
e = els[i] if i < len(els) else els.new(pos)
|
|
e.position = pos
|
|
e.color = (*cor, 1) if len(cor) == 3 else cor
|
|
return r
|
|
|
|
|
|
def posicao(nt):
|
|
return no(nt, "ShaderNodeNewGeometry").outputs["Position"]
|
|
|
|
|
|
# ============================================================ materiais
|
|
def mat_granilite():
|
|
"""Granilite: cimento cinza polido (aspecto de cera), pedrinhas de quartzo e brilhinhos coloridos."""
|
|
m, nt, b = material("Granilite")
|
|
pos = posicao(nt)
|
|
# base cinza manchada
|
|
ruido = no(nt, "ShaderNodeTexNoise", in_Scale=2.5, in_Detail=6.0)
|
|
liga(nt, pos, ruido.inputs["Vector"])
|
|
base = rampa(nt, [(0.3, (0.075, 0.075, 0.08)), (0.75, (0.13, 0.13, 0.135))])
|
|
liga(nt, ruido.outputs["Fac"], base.inputs["Fac"])
|
|
# pedrinhas brancas pequenas e algumas maiores
|
|
cor = base.outputs["Color"]
|
|
for escala, limiar, tom in ((110.0, 0.17, (0.78, 0.78, 0.76)), (38.0, 0.10, (0.55, 0.53, 0.50)), (240.0, 0.16, (0.32, 0.32, 0.33))):
|
|
vor = no(nt, "ShaderNodeTexVoronoi", in_Scale=escala)
|
|
liga(nt, pos, vor.inputs["Vector"])
|
|
mascara = no(nt, "ShaderNodeMath", operation="LESS_THAN")
|
|
mascara.inputs[1].default_value = limiar
|
|
liga(nt, vor.outputs["Distance"], mascara.inputs[0])
|
|
mix = no(nt, "ShaderNodeMix", data_type="RGBA")
|
|
mix.inputs["B"].default_value = (*tom, 1)
|
|
liga(nt, mascara.outputs[0], mix.inputs["Factor"])
|
|
liga(nt, cor, mix.inputs["A"])
|
|
cor = mix.outputs["Result"]
|
|
# brilhinhos coloridos raros (cor aleatória por célula)
|
|
vc = no(nt, "ShaderNodeTexVoronoi", in_Scale=140.0)
|
|
liga(nt, pos, vc.inputs["Vector"])
|
|
raro = no(nt, "ShaderNodeTexWhiteNoise")
|
|
liga(nt, vc.outputs["Position"], raro.inputs["Vector"])
|
|
so_raros = no(nt, "ShaderNodeMath", operation="GREATER_THAN"); so_raros.inputs[1].default_value = 0.94
|
|
liga(nt, raro.outputs["Value"], so_raros.inputs[0])
|
|
perto = no(nt, "ShaderNodeMath", operation="LESS_THAN"); perto.inputs[1].default_value = 0.18
|
|
liga(nt, vc.outputs["Distance"], perto.inputs[0])
|
|
brilho = no(nt, "ShaderNodeMath", operation="MULTIPLY")
|
|
liga(nt, so_raros.outputs[0], brilho.inputs[0]); liga(nt, perto.outputs[0], brilho.inputs[1])
|
|
mixc = no(nt, "ShaderNodeMix", data_type="RGBA")
|
|
liga(nt, brilho.outputs[0], mixc.inputs["Factor"]); liga(nt, cor, mixc.inputs["A"]); liga(nt, vc.outputs["Color"], mixc.inputs["B"])
|
|
cor = mixc.outputs["Result"]
|
|
# juntas de dilatação a cada 1,2 m
|
|
tij = no(nt, "ShaderNodeTexBrick", offset=0.0, squash=1.0, in_Scale=1.0, in_Mortar_Size=0.004, in_Brick_Width=1.2, in_Row_Height=1.2,
|
|
in_Mortar_Smooth=0.0)
|
|
tij.inputs["Color1"].default_value = (1, 1, 1, 1); tij.inputs["Color2"].default_value = (1, 1, 1, 1)
|
|
tij.inputs["Mortar"].default_value = (0.05, 0.05, 0.05, 1)
|
|
liga(nt, pos, tij.inputs["Vector"])
|
|
junta = no(nt, "ShaderNodeMix", data_type="RGBA", blend_type="MULTIPLY"); junta.inputs["Factor"].default_value = 1.0
|
|
liga(nt, cor, junta.inputs["A"]); liga(nt, tij.outputs["Color"], junta.inputs["B"])
|
|
liga(nt, junta.outputs["Result"], b.inputs["Base Color"])
|
|
# acabamento encerado: pouca rugosidade, variando, e verniz
|
|
rug = rampa(nt, [(0.0, (0.10, 0.10, 0.10)), (1.0, (0.26, 0.26, 0.26))])
|
|
liga(nt, ruido.outputs["Fac"], rug.inputs["Fac"])
|
|
liga(nt, rug.outputs["Color"], b.inputs["Roughness"])
|
|
b.inputs["Coat Weight"].default_value = 0.45
|
|
b.inputs["Coat Roughness"].default_value = 0.08
|
|
return m
|
|
|
|
|
|
def mat_simples(nome, cor, rug=0.5, metal=0.0, coat=0.0):
|
|
m, nt, b = material(nome)
|
|
b.inputs["Base Color"].default_value = (*cor, 1)
|
|
b.inputs["Roughness"].default_value = rug
|
|
b.inputs["Metallic"].default_value = metal
|
|
b.inputs["Coat Weight"].default_value = coat
|
|
return m
|
|
|
|
|
|
def mat_grade(nome, cor, rejunte, passo, largura, rug):
|
|
"""Revestimento modular (cerâmica, forro): placas de `passo` m com rejunte."""
|
|
m, nt, b = material(nome)
|
|
tij = no(nt, "ShaderNodeTexBrick", offset=0.0, squash=1.0, in_Scale=1.0, in_Mortar_Size=largura, in_Brick_Width=passo, in_Row_Height=passo)
|
|
for k in ("Color1", "Color2"):
|
|
tij.inputs[k].default_value = (*cor, 1)
|
|
tij.inputs["Mortar"].default_value = (*rejunte, 1)
|
|
liga(nt, posicao(nt), tij.inputs["Vector"])
|
|
ruido = no(nt, "ShaderNodeTexNoise", in_Scale=8.0)
|
|
liga(nt, posicao(nt), ruido.inputs["Vector"])
|
|
var = no(nt, "ShaderNodeMix", data_type="RGBA", blend_type="OVERLAY"); var.inputs["Factor"].default_value = 0.06
|
|
liga(nt, tij.outputs["Color"], var.inputs["A"]); liga(nt, ruido.outputs["Color"], var.inputs["B"])
|
|
liga(nt, var.outputs["Result"], b.inputs["Base Color"])
|
|
b.inputs["Roughness"].default_value = rug
|
|
return m
|
|
|
|
|
|
def mat_madeira():
|
|
m, nt, b = material("Madeira_porta")
|
|
pos = posicao(nt)
|
|
onda = no(nt, "ShaderNodeTexWave", wave_type="BANDS", bands_direction="Z", in_Scale=6.0, in_Distortion=6.0, in_Detail=3.0)
|
|
liga(nt, pos, onda.inputs["Vector"])
|
|
cor = rampa(nt, [(0.2, (0.30, 0.15, 0.06)), (0.8, (0.45, 0.24, 0.11))])
|
|
liga(nt, onda.outputs["Fac"], cor.inputs["Fac"])
|
|
liga(nt, cor.outputs["Color"], b.inputs["Base Color"])
|
|
b.inputs["Roughness"].default_value = 0.45
|
|
b.inputs["Coat Weight"].default_value = 0.3
|
|
return m
|
|
|
|
|
|
def mat_inox():
|
|
m, nt, b = material("Inox_escovado")
|
|
b.inputs["Base Color"].default_value = (0.70, 0.71, 0.73, 1)
|
|
b.inputs["Metallic"].default_value = 1.0
|
|
b.inputs["Roughness"].default_value = 0.28
|
|
b.inputs["Anisotropic"].default_value = 0.7
|
|
return m
|
|
|
|
|
|
def mat_tela():
|
|
"""Tela de proteção: malha de nylon de 5 cm, o resto transparente."""
|
|
m, nt, b = material("Tela_protecao")
|
|
b.inputs["Base Color"].default_value = (0.03, 0.03, 0.03, 1)
|
|
b.inputs["Roughness"].default_value = 0.7
|
|
sep = no(nt, "ShaderNodeSeparateXYZ")
|
|
liga(nt, posicao(nt), sep.inputs[0])
|
|
soma = no(nt, "ShaderNodeMath", operation="ADD")
|
|
liga(nt, sep.outputs["X"], soma.inputs[0]); liga(nt, sep.outputs["Y"], soma.inputs[1])
|
|
linhas = []
|
|
for saida in (soma.outputs[0], sep.outputs["Z"]):
|
|
mul = no(nt, "ShaderNodeMath", operation="MULTIPLY"); mul.inputs[1].default_value = 10.0
|
|
liga(nt, saida, mul.inputs[0])
|
|
fr = no(nt, "ShaderNodeMath", operation="FRACT"); liga(nt, mul.outputs[0], fr.inputs[0])
|
|
lt = no(nt, "ShaderNodeMath", operation="LESS_THAN"); lt.inputs[1].default_value = 0.05
|
|
liga(nt, fr.outputs[0], lt.inputs[0]); linhas.append(lt.outputs[0])
|
|
mx = no(nt, "ShaderNodeMath", operation="MAXIMUM")
|
|
liga(nt, linhas[0], mx.inputs[0]); liga(nt, linhas[1], mx.inputs[1])
|
|
liga(nt, mx.outputs[0], b.inputs["Alpha"])
|
|
return m
|
|
|
|
|
|
def mat_emissao(nome, cor, forca):
|
|
m, nt, b = material(nome)
|
|
b.inputs["Base Color"].default_value = (*cor, 1)
|
|
b.inputs["Emission Color"].default_value = (*cor, 1)
|
|
b.inputs["Emission Strength"].default_value = forca
|
|
return m
|
|
|
|
|
|
def mat_vidro():
|
|
m, nt, b = material("Vidro")
|
|
b.inputs["Transmission Weight"].default_value = 1.0
|
|
b.inputs["Roughness"].default_value = 0.02
|
|
b.inputs["Base Color"].default_value = (0.85, 0.92, 0.95, 1)
|
|
return m
|
|
|
|
|
|
MATS = {
|
|
"Piso_granilite": mat_granilite(),
|
|
"Piso_salas": mat_grade("Ceramica_60", (0.62, 0.60, 0.56), (0.35, 0.34, 0.32), 0.6, 0.004, 0.35),
|
|
"Forro": mat_grade("Forro_mineral", (0.85, 0.85, 0.84), (0.55, 0.55, 0.55), 0.625, 0.006, 0.9),
|
|
"Parede": mat_simples("Parede_pintada", (0.66, 0.63, 0.56), 0.85),
|
|
"Batente": mat_simples("Batente", (0.82, 0.82, 0.80), 0.4),
|
|
"Porta": mat_madeira(),
|
|
"Macaneta": mat_simples("Cromado", (0.85, 0.85, 0.86), 0.12, 1.0),
|
|
"Vidro": mat_vidro(),
|
|
"Caixilho": mat_simples("Aluminio", (0.62, 0.63, 0.65), 0.35, 1.0),
|
|
"Elevador_porta": mat_inox(),
|
|
"Elevador_moldura": mat_inox(),
|
|
"Elevador_poco": mat_simples("Poco", (0.05, 0.05, 0.05), 0.9),
|
|
"Mostrador": mat_simples("Vidro_preto", (0.01, 0.01, 0.01), 0.05, coat=1.0),
|
|
"Botoeira": mat_inox(),
|
|
"Corrimao": mat_inox(),
|
|
"Montante": mat_inox(),
|
|
"Tela": mat_tela(),
|
|
"Luminaria": mat_emissao("LED", (1.0, 0.97, 0.92), 6.0),
|
|
"Placa": mat_simples("Placa_acrilico", (0.02, 0.10, 0.30), 0.2, coat=1.0),
|
|
"Laje": mat_simples("Concreto", (0.45, 0.45, 0.44), 0.9),
|
|
}
|
|
MATS["Degrau"] = MATS["Piso_granilite"]
|
|
MATS["Patamar"] = MATS["Piso_granilite"]
|
|
|
|
# ============================================================ importa o andar
|
|
bpy.ops.wm.obj_import(filepath=OBJ, forward_axis="Y", up_axis="Z", global_scale=0.001)
|
|
pecas = [o for o in cena.objects if o.type == "MESH"]
|
|
col_andar = bpy.data.collections.new("Andar_5_Bloco_D")
|
|
cena.collection.children.link(col_andar)
|
|
sem = set()
|
|
for o in pecas:
|
|
for c in list(o.users_collection):
|
|
c.objects.unlink(o)
|
|
col_andar.objects.link(o)
|
|
chave = next((k for k in sorted(MATS, key=len, reverse=True) if o.name.startswith(k)), None)
|
|
o.data.materials.clear()
|
|
if chave:
|
|
o.data.materials.append(MATS[chave])
|
|
else:
|
|
sem.add(o.name.split("_")[0])
|
|
for p in o.data.polygons:
|
|
p.use_smooth = o.name.startswith(("Corrimao", "Montante"))
|
|
print("peças:", len(pecas), "sem material:", sem)
|
|
|
|
# ============================================================ placas e mostradores
|
|
txt_branco = mat_emissao("Texto_placa", (0.95, 0.95, 0.95), 0.0)
|
|
txt_led = mat_emissao("Texto_LED", (1.0, 0.15, 0.05), 8.0)
|
|
for r in INFO["rotulos"]:
|
|
bpy.ops.object.text_add(location=(r["x"], r["y"], r["z"]))
|
|
t = bpy.context.object
|
|
t.data.body = r["texto"]
|
|
t.data.align_x = "CENTER"; t.data.align_y = "CENTER"
|
|
t.data.size = 0.075 if r["tipo"] == "placa" else 0.09
|
|
t.data.extrude = 0.001
|
|
sinal = r.get("sinal", 1) # para onde o texto olha: +1 (eixo positivo) ou -1
|
|
if r.get("eixo", "x") == "x": # placa em parede ao longo de X: olha para ±Y
|
|
t.rotation_euler = (math.radians(90), 0, 0 if sinal < 0 else math.radians(180))
|
|
else: # parede ao longo de Y: olha para ±X
|
|
t.rotation_euler = (math.radians(90), 0, math.radians(90) if sinal > 0 else math.radians(-90))
|
|
t.data.materials.append(txt_branco if r["tipo"] == "placa" else txt_led)
|
|
for c in list(t.users_collection):
|
|
c.objects.unlink(t)
|
|
col_andar.objects.link(t)
|
|
|
|
# ============================================================ robô
|
|
robo_x, robo_y = INFO["robo"]["x"], INFO["robo"]["y"]
|
|
with bpy.data.libraries.load(ROBO, link=False) as (src, dst):
|
|
dst.objects = src.objects
|
|
col_robo = bpy.data.collections.new("Robo")
|
|
cena.collection.children.link(col_robo)
|
|
raiz = bpy.data.objects.new("Robo_raiz", None)
|
|
col_robo.objects.link(raiz)
|
|
|
|
|
|
def srgb(c):
|
|
return tuple(((x + 0.055) / 1.055) ** 2.4 if x > 0.04045 else x / 12.92 for x in c)
|
|
|
|
|
|
MATS_ROBO = {
|
|
"mdf": mat_simples("R_mdf", srgb((0.74, 0.58, 0.40)), 0.72),
|
|
"preto": mat_simples("R_preto", (0.012, 0.012, 0.013), 0.42),
|
|
"grafite": mat_simples("R_grafite", (0.03, 0.03, 0.035), 0.5),
|
|
"borracha": mat_simples("R_borracha", (0.035, 0.035, 0.04), 0.85),
|
|
"aco": mat_simples("R_aco", (0.55, 0.56, 0.58), 0.28, 1.0),
|
|
"zincado": mat_simples("R_zincado", (0.40, 0.41, 0.43), 0.5, 1.0),
|
|
"aluminio": mat_simples("R_aluminio", (0.80, 0.81, 0.83), 0.22, 1.0),
|
|
"aco_preto": mat_simples("R_aco_preto", (0.035, 0.035, 0.04), 0.35, 0.85),
|
|
"latao": mat_simples("R_latao", (0.78, 0.60, 0.25), 0.3, 1.0),
|
|
"ouro": mat_simples("R_ouro", (0.90, 0.68, 0.25), 0.25, 1.0),
|
|
"cobre": mat_simples("R_cobre", (0.85, 0.45, 0.25), 0.3, 1.0),
|
|
}
|
|
for o in dst.objects:
|
|
if o is None:
|
|
continue
|
|
col_robo.objects.link(o)
|
|
if o.parent is None:
|
|
o.parent = raiz
|
|
for s in o.material_slots:
|
|
if s.material is None:
|
|
continue
|
|
base = s.material.name.split(".")[0].replace("_transp", "")
|
|
if base in MATS_ROBO:
|
|
s.material = MATS_ROBO[base]
|
|
elif not s.material.name.startswith("R_"):
|
|
s.material.use_nodes = True
|
|
raiz.location = (robo_x, robo_y, 0.0)
|
|
raiz.rotation_euler = (0, 0, math.radians(-28))
|
|
|
|
# ============================================================ luz
|
|
mundo = bpy.data.worlds.new("Mundo")
|
|
cena.world = mundo
|
|
mundo.use_nodes = True
|
|
fundo = mundo.node_tree.nodes["Background"]
|
|
ceu = mundo.node_tree.nodes.new("ShaderNodeTexSky")
|
|
try:
|
|
ceu.sky_type = "NISHITA"
|
|
except Exception:
|
|
pass
|
|
ceu.sun_elevation = math.radians(40)
|
|
mundo.node_tree.links.new(ceu.outputs["Color"], fundo.inputs["Color"])
|
|
fundo.inputs["Strength"].default_value = 0.35
|
|
# uma área de luz sob cada luminária do 5º andar (menos ruído que só a emissão)
|
|
for o in pecas:
|
|
if o.name.startswith("Luminaria_5_"):
|
|
c = sum((o.matrix_world @ Vector(v) for v in o.bound_box), Vector()) / 8
|
|
luz = bpy.data.lights.new("Luz_" + o.name, "AREA")
|
|
luz.size = 0.6
|
|
luz.energy = 55
|
|
luz.color = (1.0, 0.96, 0.9)
|
|
lo = bpy.data.objects.new("Luz_" + o.name, luz)
|
|
lo.location = (c.x, c.y, c.z - 0.03)
|
|
col_andar.objects.link(lo)
|
|
|
|
|
|
# ============================================================ câmeras
|
|
def camera(nome, de, para, lente):
|
|
cd = bpy.data.cameras.new(nome)
|
|
cd.lens = lente
|
|
cd.clip_start = 0.05
|
|
co = bpy.data.objects.new(nome, cd)
|
|
cena.collection.objects.link(co)
|
|
co.location = de
|
|
co.rotation_euler = (Vector(para) - Vector(de)).to_track_quat("-Z", "Y").to_euler()
|
|
return co
|
|
|
|
|
|
hall = INFO["hall"]
|
|
centro_esc_x = (hall["escada_x0"] + hall["escada_x1"]) / 2
|
|
centro_hall_x = (hall["x0"] + hall["x1"]) / 2
|
|
VISTAS = [
|
|
# (nome do arquivo, posição do robô (x, y, giro), câmera de, câmera para, lente)
|
|
("robo_corredor_bloco_d", (hall["x0"] - 3.2, 0.05, -25), (1.0, 0.55, 1.35), (hall["x0"] - 2.0, -0.35, 0.8), 26),
|
|
("robo_hall_elevadores_bloco_d", (centro_hall_x + 0.4, -1.3, 150), (hall["x0"] + 0.3, 0.75, 1.6), (centro_hall_x + 1.6, hall["y_elevadores"] + 0.5, 1.0), 18),
|
|
("hall_vao_escada_bloco_d", (centro_hall_x - 1.5, -2.3, 70), (centro_esc_x - 2.6, hall["y_elevadores"] + 0.7, 1.55), (centro_esc_x, hall["lance_y0"] + 1.6, 3.0), 16),
|
|
]
|
|
cams = [camera("Camera_" + v[0], v[2], v[3], v[4]) for v in VISTAS]
|
|
|
|
# ============================================================ render
|
|
cena.render.engine = "CYCLES"
|
|
prefs = bpy.context.preferences.addons["cycles"].preferences
|
|
for dev in ("OPTIX", "CUDA"):
|
|
try:
|
|
prefs.compute_device_type = dev
|
|
prefs.get_devices()
|
|
for d in prefs.devices:
|
|
d.use = True
|
|
cena.cycles.device = "GPU"
|
|
print("dispositivo", dev)
|
|
break
|
|
except Exception as ex:
|
|
print("sem", dev, ex)
|
|
cena.cycles.samples = AMOSTRAS
|
|
cena.cycles.use_denoising = True
|
|
cena.cycles.max_bounces = 8
|
|
cena.render.resolution_x, cena.render.resolution_y = LARG, ALT
|
|
cena.view_settings.view_transform = "AgX"
|
|
cena.view_settings.look = "AgX - Medium High Contrast"
|
|
cena.view_settings.exposure = -0.4
|
|
cena.render.image_settings.file_format = "PNG"
|
|
|
|
os.makedirs(SAIDA, exist_ok=True)
|
|
bpy.ops.wm.save_as_mainfile(filepath=os.path.join(RAIZ, "modelos/blender/corredor_bloco_d.blend"))
|
|
for cam, (nome, (rx, ry, rg), *_ ) in zip(cams, VISTAS):
|
|
raiz.location = (rx, ry, 0.0)
|
|
raiz.rotation_euler = (0, 0, math.radians(rg))
|
|
cena.camera = cam
|
|
cena.render.filepath = os.path.join(SAIDA, nome + ".png")
|
|
bpy.ops.render.render(write_still=True)
|
|
print("render:", cena.render.filepath)
|