Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Plugin: effect Inspector
- -- Description: Lists effect lines and their attributes with user input
- -- Author: Marvin Franssen
- -- Date: 2024-06-17
- function main()
- -- Prompt the user to enter the effect number
- local effectNumber = gma.textinput("Enter Effect Number", "1")
- if effectNumber == nil then
- gma.gui.confirm("Error", "No effect number entered. Exiting plugin.")
- return
- end
- -- Convert input to a number
- effectNumber = tonumber(effectNumber)
- if effectNumber == nil then
- gma.gui.confirm("Error", "Invalid effect number. Exiting plugin.")
- return
- end
- -- Get the effect handle
- local effectHandle = gma.show.getobj.handle("Effect " .. effectNumber)
- if effectHandle == nil then
- gma.gui.confirm("Error", "Effect " .. effectNumber .. " not found.")
- return
- end
- -- Get the effect name
- local effectName = gma.show.getobj.name(effectHandle)
- if effectName == nil then
- gma.gui.confirm("Error", "Unable to retrieve effect name.")
- return
- end
- -- Prepare the results message
- local message = "Effect Name: " .. effectName .. "\n\n"
- -- Iterate through the effect lines
- local lineIndex = 1
- local lineHandle = gma.show.getobj.child(effectHandle, lineIndex)
- while lineHandle do
- -- Read line attributes
- local form = gma.show.property.get(lineHandle, "form")
- local speed = gma.show.property.get(lineHandle, "speed")
- local speedgroup = gma.show.property.get(lineHandle, "speedgroup")
- local groups = gma.show.property.get(lineHandle, "groups")
- local blocks = gma.show.property.get(lineHandle, "blocks")
- local wings = gma.show.property.get(lineHandle, "wings")
- -- Append line details to message
- message = message .. "Line " .. lineIndex .. ":\n"
- message = message .. "Form: " .. (form or "N/A") .. "\n"
- message = message .. "Speed: " .. (speed or "N/A") .. "\n"
- message = message .. "Speed Group: " .. (speedgroup or "N/A") .. "\n"
- message = message .. "Groups: " .. (groups or "N/A") .. "\n"
- message = message .. "Blocks: " .. (blocks or "N/A") .. "\n"
- message = message .. "Wings: " .. (wings or "N/A") .. "\n\n"
- -- Move to next line
- lineIndex = lineIndex + 1
- lineHandle = gma.show.getobj.child(effectHandle, lineIndex)
- end
- -- Show the results in a dialog box
- gma.gui.confirm("Effect Parameters", message)
- end
- return main
Advertisement
Add Comment
Please, Sign In to add comment