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

28 lines
450 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]
public partial class SaveViewportTexture:RJAction
{
[Export]
public SubViewport viewport;
[Export]
public string path = "";
[Export]
public float quality = 1;
public override void _OnTrigger()
{
Textures.Save( viewport.GetTexture(), path, quality );
}
}
}