[Blender][スクリプト]シーン内の全グリースペンシルレイヤーのオニオンスキンをオフにする

グリースペンシルオブジェクトが増えていくとオニオンスキンが煩雑になっていくので

import bpy

# シーン内のすべてのオブジェクトを取得
all_objects = bpy.context.scene.objects

# シーン内のすべてのグリースペンシルオブジェクトをフィルタリング
gpencil_objects = [obj for obj in all_objects if obj.type == 'GPENCIL']

# すべてのグリースペンシルオブジェクトのレイヤーのオニオンスキンをオフにする
for gpencil in gpencil_objects:
    for layer in gpencil.data.layers:
        layer.use_onion_skinning = False

print("All onion skins have been turned off for all Grease Pencil objects in the scene.")



この記事が気に入ったらサポートをしてみませんか?