/
stupin
/
AutoDriver
Обзор
Документация
Войти
/
stupin
/
AutoDriver
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
DatasetMaker/camera_mover.py
25 строк
1 KB
Stupin
init
25 июн 2025, 19:30
25 июн 2025, 19:30
a4828f6
Код
Авторство
О чём код?
import random import math import bpy landscape = bpy.data.objects['location.001'] camera = bpy.data.objects['camera'] wof = bpy.context.scene.world.node_tree.nodes['World Output'] wos = bpy.context.scene.world.node_tree.nodes['World Output.001'] bpy.context.scene.camera = camera for i in range(1, 100000): verc = len(landscape.data.vertices) camera.location = landscape.data.vertices[random.randint(0, verc)].co camera.location.z += 206 camera.rotation_euler.z = random.random() * 2 * math.pi bpy.context.scene.render.filepath = f'J:\\(5) Files\\Storage\\Data\\datasets\\archeage\\driver\\v2\\{i}.png' bpy.ops.render.render(write_still=True) bpy.data.node_groups['Segmentator'].nodes['Value'].outputs["Value"].default_value = 1 wos.is_active_output = True bpy.context.scene.render.filepath = f'J:\\(5) Files\\Storage\\Data\\datasets\\archeage\\driver\\v2\\{i}_map.png' bpy.ops.render.render(write_still=True) bpy.data.node_groups['Segmentator'].nodes['Value'].outputs["Value"].default_value = 0 wof.is_active_output = True