rj-action-library/Runtime/Procedural/Baking/SaveViewportTexture.cs

28 lines
451 B
C#
Raw Normal View History

2024-12-01 17:07:41 +00:00
using System.Collections;
using System.Collections.Generic;
using Godot;
using System;
namespace Rokojori
{
[Tool]
[GlobalClass]
2025-01-08 18:46:17 +00:00
public partial class SaveViewportTexture:Action
2024-12-01 17:07:41 +00:00
{
[Export]
public SubViewport viewport;
[Export]
public string path = "";
[Export]
public float quality = 1;
2025-01-08 18:46:17 +00:00
protected override void _OnTrigger()
2024-12-01 17:07:41 +00:00
{
Textures.Save( viewport.GetTexture(), path, quality );
}
}
}