[英]Blender object does not have any modifiers in Python script
我正在為 Blender 3.1 編寫一個 Python 腳本,以將“藝術線條”修改器攝像機設置為場景中的下一個攝像機以進行渲染。
問題是我的腳本找不到我的 Stroke object 的任何修飾符:
import bpy
import os
path_dir = bpy.context.scene.render.filepath
stroke = bpy.context.scene.objects.get('Stroke')
if not stroke:
raise ValueError("Object with name Stroke not found")
if len(stroke.modifiers) == 0:
raise ValueError("Stroke has no modifiers")
錯誤:
"render multiple cameras with line art.py", line 14, in <module>
ValueError: Stroke has no modifiers
它肯定在那里:
我努力了
怎么了?
我發現 Strokes(油性鉛筆)實際上以自己的方式存儲修飾符,無論出於何種原因。
使用stroke.grease_pencil_modifiers
訪問它們
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.