Logo Vse Python

Vse Python

Cộng đồng
TMHSDigital
vse-python

Build and inspect Video Sequence Editor timelines from Python: SequenceEditor.strips vs the removed .sequences, new_effect length vs frame_end, strip transforms, and the 5.2 COLOR strip width/height bake from scene resolution. Use when the user scripts the sequencer, hits AttributeError on sequence_editor.sequences in 5.x or a TypeError on new_effect keyword arguments, or renders COLOR strips that ignore transform scale after a resolution change. Targets 5.2 LTS with 4.5 LTS fallback.

Tổng quan

Nhà phát hànhTMHSDigital
Kho mãBlender-Developer-Tools
Tên kỹ năngvse-python
Sao
20
Bản fork
5
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được TMHSDigital công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Vse Python trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/vse-python
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TMHSDigital/Blender-Developer-Tools.git /tmp/Blender-Developer-Tools
mkdir -p .claude/skills
cp -r /tmp/Blender-Developer-Tools/skills/vse-python .claude/skills/vse-python
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Vse Python trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Vse Python ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Vse Python không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Video Sequence Editor in Python

Trigger

Use this skill when the user:

  • Builds or inspects a VSE / sequencer timeline from a script
  • Mentions sequence_editor, strips, sequences, new_effect, COLOR strips, or StripTransform
  • Hits AttributeError: 'SequenceEditor' object has no attribute 'sequences' on 5.x
  • Hits TypeError on new_effect kwargs (frame_end vs length)
  • Renders a sequencer composite whose COLOR cells ignore transform.scale_* after a resolution change

High-level shape

python
import bpy

scene = bpy.context.scene
se = scene.sequence_editor or scene.sequence_editor_create()
coll = se.strips if hasattr(se, "strips") else se.sequences

if bpy.app.version >= (5, 0, 0):
    strip = coll.new_effect(
        name="A", type="COLOR", channel=1,
        frame_start=1, length=10,
    )
else:
    strip = coll.new_effect(
        name="A", type="COLOR", channel=1,
        frame_start=1, frame_end=11,
    )
strip.color = (0.85, 0.10, 0.22)

Branch on the bpy.app.version tuple for known API boundaries (such as the 5.2 COLOR strip width/height bake), never on bpy.app.version_string. Pick the .strips vs .sequences accessor with hasattr, not version: an empty bpy_prop_collection is falsy, so se.strips or se.sequences silently falls through to the legacy accessor on an empty timeline.

Accessor: .strips vs .sequences

4.5 LTS5.1 / 5.2+
Canonical collection.strips (.sequences is a bridge to the same strips).strips only
.sequencesPresent, same contents as .stripsAttributeError
python
def strips_coll(se):
    return se.strips if hasattr(se, "strips") else se.sequences

Do not write se.sequences in new code. On 5.x it is gone; on 4.5 .strips already exists. The same split applies to .sequences_all / .strips_all (measured on 4.5.14 and 5.2.1). The no-legacy-vse-sequences rule flags both.

new_effect end kwarg

strips.new_effect(...) ends a strip with one accepted end argument. The other raises TypeError.

python
span = (1, 33)  # end-exclusive [start, end)

if bpy.app.version >= (5, 0, 0):
    strip = coll.new_effect(
        name="A", type="COLOR", channel=1,
        frame_start=span[0], length=span[1] - span[0],
    )
else:
    strip = coll.new_effect(
        name="A", type="COLOR", channel=1,
        frame_start=span[0], frame_end=span[1],
    )

Timeline bounds: frame_final_start / frame_final_end / frame_final_duration on 4.5. On 5.x those names are deprecated aliases (removal announced for 6.0); canonical accessors are left_handle / right_handle / duration. Scene strips take four args — new_scene(name, scene, channel, frame_start) — with no length / frame_end kwarg on either version.

The TRANSFORM effect type is removed on 5.x. Place strips with per-strip strip.transform (StripTransform) on both versions. Effect inputs are input_1 / input_2 (creation kwargs input1 / input2).

COLOR strip intrinsic size (5.2)

4.5 LTS and 5.1 COLOR strips have no intrinsic size. transform.scale_* is a fraction of the output frame. Creating at factory resolution then rendering a tiny buffer is fine.

5.2 and later bake readonly width / height from scene render resolution at new_effect time. Scale and offset are then in that media space, not a later output size. Set scene resolution before building strips.

This split is not in the 5.2 python_api release notes. Witnessed by examples/vse-cut-list/ --check-pixels.

python
width, height = 96, 54
scene.render.resolution_x = width
scene.render.resolution_y = height

se = scene.sequence_editor or scene.sequence_editor_create()
coll = se.strips if hasattr(se, "strips") else se.sequences

if bpy.app.version >= (5, 0, 0):
    strip = coll.new_effect(
        name="A", type="COLOR", channel=1,
        frame_start=1, length=10,
    )
else:
    strip = coll.new_effect(
        name="A", type="COLOR", channel=1,
        frame_start=1, frame_end=11,
    )

if bpy.app.version >= (5, 2, 0):
    # 5.2+: readonly width/height baked at new_effect from scene.render
    assert (strip.width, strip.height) == (width, height)
    # strip.width = 64  # TypeError — readonly
else:
    # 4.5 / 5.1: no intrinsic size; hasattr(strip, "width") is False
    pass

strip.transform.scale_x = 0.36
strip.transform.scale_y = 0.36

Creating at factory 1920×1080 then dropping the scene to 96×54 for a check render makes a 0.36-scaled COLOR cell larger than the output. On 5.2 the long-runner covers the frame; pixel samples read the wrong strip.

A lone COLOR strip does honor transform.scale_* on 5.2. The break is media size vs a later output size, not "transform is ignored."

Common AI mistakes

  1. sequence_editor.sequences on 5.x. AttributeError. Use .strips (with hasattr only as a 4.5 bridge).

  2. Wrong new_effect end kwarg. frame_end= on 5.x and length= on 4.5 both raise TypeError.

  3. Creating COLOR strips, then changing render size (the 5.2 trap):

    python
    a = coll.new_effect(...)          # bakes 1920×1080 on 5.2
    scene.render.resolution_x = 96    # output changed; media size did not

    Set scene.render.resolution_* before new_effect.

  4. se.strips or se.sequences. An empty collection is falsy, so this falls through to .sequences on a fresh editor.

  5. TRANSFORM effect type on 5.x. Gone. Use strip.transform.

  6. Scene strip pointing at its own scene. Feedback loop; renders transparent. Source a separate scene.

  7. Effect strips consume their inputs only when stacked on a channel above those inputs. Below, the inputs keep compositing independently. A GAMMA_CROSS asked to outlast its inputs' overlap is silently clamped to the overlap.

See also

Runnable examples

Each example runs headless, asserts the contract, and exits non-zero when it breaks. Run one with blender --background --python <script> --; pass a falsifier flag to watch the check fail.

  • vse-cut-list: The sequencer API rename from 4.5 LTS to 5.x — strips (never .sequences), new_effect ending in length= vs frame_end=, and left_handle/right_handle/duration replacing the deprecated frame_final_*. Falsify: --swap-inputs (exit 7).
  • vse-gamma-cross: The GAMMA_CROSS fade is not the naive linear mix: it blends in a gamma-0.5 space, so the mid-cross dips below the sRGB lerp. Falsify: --swap-inputs (exit 4).
  • vse-linear-modifiers: Pathology witness for the 5.2 removal of Strip.use_linear_modifiers. Falsify: --assume-present (exit 4).

References

Câu hỏi thường gặp

Kỹ năng AI Vse Python làm được gì?

Build and inspect Video Sequence Editor timelines from Python: SequenceEditor.strips vs the removed .sequences, new_effect length vs frame_end, strip transforms, and the 5.2 COLOR strip width/height bake from scene resolution. Use when the user scripts the sequencer, hits AttributeError on sequence_editor.sequences in 5.x or a TypeError on new_effect keyword arguments, or renders COLOR strips that ignore transform scale after a resolution change. Targets 5.2 LTS with 4.5 LTS fallback.

Vì sao nên dùng Vse Python trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Vse Python là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Vse Python trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/TMHSDigital/Blender-Developer-Tools/tree/main/skills/vse-python. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Vse Python?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Vse Python với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Vse Python với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Vse Python có miễn phí không?

Kỹ năng này được TMHSDigital phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇