From 53129897380c372917abe9847cfb91540a8eedb5 Mon Sep 17 00:00:00 2001 From: daniellumertz Date: Mon, 26 Aug 2024 01:02:08 -0300 Subject: [PATCH] untag action --- Generative/Clouds/Clouds Functions/Clouds GUI.lua | 8 ++++++++ Generative/Clouds/Clouds Functions/Clouds Items.lua | 12 ++++++++++++ .../Clouds/Clouds Functions/Clouds Tooltips.lua | 3 +++ Generative/Clouds/daniellumertz_Clouds.lua | 4 ++-- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Generative/Clouds/Clouds Functions/Clouds GUI.lua b/Generative/Clouds/Clouds Functions/Clouds GUI.lua index 86f1d06..e92ddfe 100644 --- a/Generative/Clouds/Clouds Functions/Clouds GUI.lua +++ b/Generative/Clouds/Clouds Functions/Clouds GUI.lua @@ -127,6 +127,14 @@ function Clouds.GUI.Main() ImGui.EndMenu(ctx) end + if ImGui.BeginMenu(ctx, "Actions") then + if ImGui.MenuItem(ctx, 'Untag Selected Items') then + Clouds.Item.UntagSelected(proj) + end + tooltip(ctx, Settings.tooltip, ToolTips.settings.untag) + ImGui.EndMenu(ctx) + end + if ImGui.BeginMenu(ctx, 'About') then if ImGui.MenuItem(ctx, 'Manual') then DL.url.OpenURL(URL.manual) diff --git a/Generative/Clouds/Clouds Functions/Clouds Items.lua b/Generative/Clouds/Clouds Functions/Clouds Items.lua index 531b663..8d607a2 100644 --- a/Generative/Clouds/Clouds Functions/Clouds Items.lua +++ b/Generative/Clouds/Clouds Functions/Clouds Items.lua @@ -290,4 +290,16 @@ function Clouds.Item.ShowHideAllEnvelopes() Clouds.Item.ShowHideEnvelope(CloudTable.grains.randomize_size.envelope,FXENVELOPES.grains.randomize_size) Clouds.Item.ShowHideEnvelope(CloudTable.grains.position.envelope,FXENVELOPES.grains.position) Clouds.Item.ShowHideEnvelope(CloudTable.grains.randomize_position.envelope,FXENVELOPES.grains.randomize_position) +end + +------ Generated Items: + +function Clouds.Item.UntagSelected(proj) + for item in DL.enum.SelectedMediaItem(proj) do + local retval, extstate = DL.item.GetExtState(item, EXT_NAME, 'is_item') + if extstate ~= '' then + DL.item.SetExtState(item, EXT_NAME, 'is_item', '') + end + -- body + end end \ No newline at end of file diff --git a/Generative/Clouds/Clouds Functions/Clouds Tooltips.lua b/Generative/Clouds/Clouds Functions/Clouds Tooltips.lua index 871f17e..3937951 100644 --- a/Generative/Clouds/Clouds Functions/Clouds Tooltips.lua +++ b/Generative/Clouds/Clouds Functions/Clouds Tooltips.lua @@ -1,6 +1,9 @@ --@noindex ToolTips = { create_item = 'This button will create a cloud Item.\nSelect a cloud item to set the parameters and generate clouds!', + settings = { + untag = 'Remove internal tags from selected items generated by the Clouds script.\nThese tags mark items for deletion during new generations.\nRemoving them preserves items across regenerations, treating them as standard items.' + }, items = { head = 'Set which items will be copied.', set = 'Set items list to current item selection.', diff --git a/Generative/Clouds/daniellumertz_Clouds.lua b/Generative/Clouds/daniellumertz_Clouds.lua index 333f1ba..0e71980 100644 --- a/Generative/Clouds/daniellumertz_Clouds.lua +++ b/Generative/Clouds/daniellumertz_Clouds.lua @@ -1,4 +1,4 @@ --- @version 0.2.2b +-- @version 0.2.3b -- @author Daniel Lumertz -- @provides -- [nomain] DL Functions/*.lua @@ -16,7 +16,7 @@ -- Constants: SCRIPT_NAME = 'Clouds' -SCRIPT_V = '0.2.2b' +SCRIPT_V = '0.2.3b' EXT_NAME = 'daniellumertz_Clouds' -- keys: settings (for clouds), is_item (for generated items) FX_NAME = 'daniellumertz_Clouds' Proj = 0