2023年3月10日金曜日

anime test 002

aaa
import bpy
import math

# Set up scene and camera
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
scene = bpy.context.scene
camera = bpy.data.cameras.new("Camera")
camera_obj = bpy.data.objects.new("Camera", camera)
camera_obj.location = (0, -20, 0)
camera_obj.rotation_euler = (math.pi/2, 0, 0)
scene.camera = camera_obj

# Set up spheres
sphere1_loc = (-10, 0, 0)
sphere1 = bpy.ops.mesh.primitive_uv_sphere_add(radius=1, enter_editmode=False, location=sphere1_loc)
sphere1 = bpy.context.selected_objects[0]

# Set up animation
animation_frames = 100  # 1 second at 10 frames per second, so 10 seconds in total
animation_start = 0
animation_end = 2 * animation_frames

# Add keyframes for sphere1
for frame_num in range(animation_end + 1):
    if frame_num < animation_frames:
        sphere1.location[2] = -10 + (frame_num / animation_frames) * 20
    elif frame_num < 2 * animation_frames:
        sphere1.location[2] = 10 - ((frame_num - animation_frames) / animation_frames) * 20
    else:
        sphere1.location[2] = -10
    sphere1.keyframe_insert(data_path="location", frame=frame_num)

    # Add four smaller spheres when sphere1 is reversing
    if frame_num == animation_frames:
        sphere2_loc = (sphere1.location[0] - 1, sphere1.location[1], sphere1.location[2])
        sphere2 = bpy.ops.mesh.primitive_uv_sphere_add(radius=0.5, enter_editmode=False, location=sphere2_loc)
        sphere2 = bpy.context.selected_objects[0]
        sphere2.keyframe_insert(data_path="location", frame=frame_num)

        sphere3_loc = (sphere1.location[0], sphere1.location[1] - 1, sphere1.location[2])
        sphere3 = bpy.ops.mesh.primitive_uv_sphere_add(radius=0.5, enter_editmode=False, location=sphere3_loc)
        sphere3 = bpy.context.selected_objects[0]
        sphere3.keyframe_insert(data_path="location", frame=frame_num)

        sphere4_loc = (sphere1.location[0], sphere1.location[1] + 1, sphere1.location[2])
        sphere4 = bpy.ops.mesh.primitive_uv_sphere_add(radius=0.5, enter_editmode=False, location=sphere4_loc)
        sphere4 = bpy.context.selected_objects[0]
        sphere4.keyframe_insert(data_path="location", frame=frame_num)

        sphere5_loc = (sphere1.location[0] + 1, sphere1.location[1], sphere1.location[2])
        sphere5 = bpy.ops.mesh.primitive_uv_sphere_add(radius=0.5, enter_editmode=False, location=sphere5_loc)
        sphere5 = bpy.context.selected_objects[0]
        sphere5.keyframe_insert(data_path="location", frame=frame_num)

# Set up playback
bpy.context.scene.frame_start = animation_start
bpy.context.scene.frame_end = animation_end
bpy.context.scene.frame_current = animation_start












bbb
togetter.com/t/c2022meetzionad
togetter.com/t/b2022meetzionad




twitter 新着検索 Dürer & 測距儀


aaa









bbb
twitter zionadchat
twitter に追い出されたら 連絡先は Gettr https://gettr.com/user/zionadchat
twitter サブアカウント https://twitter.com/2022zionad

old page いいい
new page いいい

目次 2022の目次 単純トリック hatena zionadchat
いいいいいいいい

伊勢丹 建物広告 球体群 配置 20240323_001

aaa y軸に 球体半径0.1を等間隔に配置して 球体の名前は Sphere_x_y_z で 小数1桁で 座標位置で 名前を作る y=+1から ー1までで 21個の球体で 作る コレクションだけを作って "y軸の球体群" import bpy #...