def set_scene_objects(): mat = bpy.data.materials.new("Material") mat.use_nodes = True utils.clean_nodes(mat.node_tree.nodes) utils.build_pbr_nodes(mat.node_tree, base_color=(0.6, 0.6, 0.6, 1.0)) left_object, center_object, right_object = utils.create_three_smooth_monkeys( ) left_object.data.materials.append(mat) center_object.data.materials.append(mat) right_object.data.materials.append(mat) plane_size = 100.0 current_object = utils.create_plane(size=plane_size, name="Floor") floor_mat = bpy.data.materials.new("Material_Plane") floor_mat.use_nodes = True utils.clean_nodes(floor_mat.node_tree.nodes) utils.build_checker_board_nodes(floor_mat.node_tree, plane_size) current_object.data.materials.append(floor_mat) sun_object = utils.create_sun_light() sun_object.data.use_nodes = True sun_object.data.node_tree.nodes["Emission"].inputs[ "Strength"].default_value = 3.0 bpy.ops.object.empty_add(location=(0.0, -0.70, 1.0)) focus_target = bpy.context.object return focus_target
def set_floor_and_lights() -> None: size = 200.0 current_object = utils.create_plane(size=size, name="Floor") floor_mat = utils.add_material("Material_Plane", use_nodes=True, make_node_tree_empty=True) utils.build_checker_board_nodes(floor_mat.node_tree, size) current_object.data.materials.append(floor_mat) utils.create_area_light(location=(6.0, 0.0, 4.0), rotation=(0.0, math.pi * 60.0 / 180.0, 0.0), size=5.0, color=(1.00, 0.70, 0.60, 1.00), strength=1500.0, name="Main Light") utils.create_area_light(location=(-6.0, 0.0, 2.0), rotation=(0.0, -math.pi * 80.0 / 180.0, 0.0), size=5.0, color=(0.30, 0.42, 1.00, 1.00), strength=1000.0, name="Sub Light")