Beispiel #1
0
    def create_joints(self) -> List[object]:
        """Blender objects for joint - Speheres
        """
        joint_objs = []

        for x, y, z in self.joint_coordinates:
            obj = utils.create_smooth_sphere(location=(x, y, z),
                                             radius=self.joint_radius)
            joint_objs.append(obj)

        return joint_objs
def set_scene_objects():
    image_path = "./assets/matcaps/blue.png"

    mat = bpy.data.materials.new("MatCap")
    mat.use_nodes = True
    utils.clean_nodes(mat.node_tree.nodes)
    utils.build_matcap_nodes(mat.node_tree, image_path)

    current_object = utils.create_smooth_monkey(location=(1.2, 0.0, 0.0))
    current_object.data.materials.append(mat)

    current_object = utils.create_smooth_sphere(location=(-1.2, 0.0, 0.0), subdivision_level=2)
    current_object.data.materials.append(mat)

    bpy.ops.object.empty_add(location=(0.0, 0.0, 0.0))
    focus_target = bpy.context.object
    return focus_target
Beispiel #3
0
def set_scene_objects():
    image_path = os.path.join(working_dir_path, "assets/matcaps/blue.png")

    mat = utils.add_material("MatCap",
                             use_nodes=True,
                             make_node_tree_empty=True)
    utils.build_matcap_nodes(mat.node_tree, image_path)

    current_object = utils.create_smooth_monkey(location=(1.2, 0.0, 0.0))
    current_object.data.materials.append(mat)

    current_object = utils.create_smooth_sphere(location=(-1.2, 0.0, 0.0),
                                                subdivision_level=2)
    current_object.data.materials.append(mat)

    bpy.ops.object.empty_add(location=(0.0, 0.0, 0.0))
    focus_target = bpy.context.object
    return focus_target