blender python で frame 毎に 進む距離を
x^2+y^2+z^2 = zion_distance
と定義して Pythonスクリプト
Blender Pythonで、
各フレームでオブジェクトを移動する距離を
zion_distanceで定義し、
その距離だけオブジェクトを移動するスクリプト
import bpy
from mathutils import Vector
# 初期位置を取得
start_pos = bpy.context.active_object.location
# 初期フレームを取得
start_frame = bpy.context.scene.frame_current
def move_object():
# 現在のフレームを取得
current_frame = bpy.context.scene.frame_current
# オブジェクトを移動する距離を計算
zion_distance = (current_frame - start_frame)**2
# 移動ベクトルを作成
move_vector = Vector((zion_distance, zion_distance, zion_distance))
# オブジェクトを移動
bpy.context.active_object.location = start_pos + move_vector
# フレームを進める
for frame in range(start_frame, bpy.context.scene.frame_end+1):
bpy.context.scene.frame_set(frame)
move_object()
Blender Pythonでx^2+y^2+z^2 = r^2の球体を、
フレーム0から600で拡大するスクリプト