set_keyframe
Set animation keyframes for object properties in 3ds Max, including position, rotation, scale, and custom attributes at specified frames.
Instructions
在 3ds Max 中为指定物体的属性设置关键帧。
该工具可以在指定帧为物体的变换属性(位置/旋转/缩放)或自定义属性设置关键帧。
Args: object_name: 目标物体名称。 frame: 关键帧所在的帧号,如 "0"、"30"、"60"。 position: 在该帧的位置值,格式 "x,y,z"。留空表示不设置位置关键帧。 rotation: 在该帧的旋转值(欧拉角度数),格式 "x,y,z"。留空表示不设置旋转关键帧。 scale: 在该帧的缩放值,格式 "x,y,z" 或单个值如 "2"。留空表示不设置缩放关键帧。 property_name: 自定义属性名(如 "radius"、"height" 等)。与 property_value 配合使用。 property_value: 自定义属性在该帧的值。
Returns: dict: 操作结果。 - success (bool): 是否成功。 - object_name (str): 物体名称。 - frame (int): 关键帧号。 - keys_set (list): 成功设置的关键帧类型列表。 - message (str): 操作描述信息。
示例调用 - 设置位置关键帧: set_keyframe(object_name="Box001", frame="0", position="0,0,0") set_keyframe(object_name="Box001", frame="30", position="100,0,0")
示例调用 - 设置位置和旋转关键帧: set_keyframe(object_name="Box001", frame="0", position="0,0,0", rotation="0,0,0") set_keyframe(object_name="Box001", frame="60", position="100,0,0", rotation="0,0,360")
示例调用 - 设置自定义属性关键帧(如半径动画): set_keyframe(object_name="Sphere001", frame="0", property_name="radius", property_value="10") set_keyframe(object_name="Sphere001", frame="30", property_name="radius", property_value="50")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_name | Yes | ||
| frame | Yes | ||
| position | No | ||
| rotation | No | ||
| scale | No | ||
| property_name | No | ||
| property_value | No |