2023年4月8日土曜日

逆さ円錐 動く 再生でも 位置修正中




import bpy

from mathutils import Vector


# 設定可能な変数

zion_object_name = "逆さ円錐 600上昇"  # 円錐オブジェクトの名前

radius = 60  # 円錐の半径

height = 60  # 円錐の高さ

distance_per_frame = 0.1  # 円錐の移動距離

animation_frames = 1000  # アニメーションの再生時間(フレーム数)

wait_frames = 40  # アニメーション再生完了後の待機時間(フレーム数)

zion_stop =600 * 0.1

zion_saibyouga = 30


# 円錐を作成する

def create_cone():

    bpy.ops.mesh.primitive_cone_add(radius1=0, radius2=radius, depth=height)

    cone = bpy.context.object

    cone.name = zion_object_name

    cone.location = Vector((0, 0, 0))  # 初期位置を設定する


 


# アニメーションのキーフレームを設定する

for i in range(animation_frames):

    frame = i + 1


    # キーフレームごとの円錐の位置を設定する

    zion_pos = Vector((0, 0, (i+1)*distance_per_frame))

    cone.location = zion_pos


    # キーフレームを設定する

    cone.keyframe_insert(data_path="location", frame=frame)


# アニメーション再生後の待機時間を設定する

for i in range(wait_frames):

    frame = animation_frames + i + 1

    cone.keyframe_insert(data_path="location", frame=frame, index=-1)


改良中 y=-30 中心 円周への球体36個

できた y= -30 中心で z=0平面移動  import bpy import math zion_collection_name = "線路レール 観察者" # コレクションを作成する col = bpy.data.collections.new(zio...