-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "SZ_LayerInspector"

-- **************************************************
-- General information about this script
-- **************************************************

SZ_LayerInspector = {}

function SZ_LayerInspector:Name()
	return "Layer Inspector"
end

function SZ_LayerInspector:Version()
	return "1.0"
end

function SZ_LayerInspector:Description()
	return "Show the selected layer's info"
end

function SZ_LayerInspector:Creator()
	return "Stan from 2danimator.ru"
end

function SZ_LayerInspector:UILabel()
	return "Layer Inspector"
end

-- Recurring values:


-- **************************************************
-- The guts of this script
-- **************************************************

function SZ_LayerInspector:IsEnabled(moho)
	return true
end

function SZ_LayerInspector:IsRelevant(moho)
	return true
end

	

function SZ_LayerInspector:Run(moho)
	print("*********************")
	local layer = moho.layer
	print("Name: " .. layer:Name())
	local absoluteId = moho.document:LayerAbsoluteID(layer)
	print("Absolute ID: " .. absoluteId)
	local uuid = layer:UUID()
	print("UUID: " .. uuid)
	print("Rotation: " .. layer.fRotationZ.value)
	print("Position: " .. layer.fTranslation.value.x .. ", " .. layer.fTranslation.value.y)
	local bbox = layer:Bounds(moho.layerFrame)
	print("X size (Width): " .. bbox.fMax.x - bbox.fMin.x)
	print("Y size (Height): " .. bbox.fMax.y - bbox.fMin.y)
	print("Z size (Depth): " .. bbox.fMax.z - bbox.fMin.z)
	print("Layer type: " .. layer:LayerType())
	print("Layer offset: " .. layer:TimingOffset())
	print("Layer total offset: " .. layer:TotalTimingOffset())
	-- local mesh = moho:Mesh()
	-- print("Mesh: " .. tostring(mesh))
	-- local layerAsVector = moho:LayerAsVector(layer)
	-- print("Layer as vector: " .. tostring(layerAsVector))
	-- if(layerAsVector) then
		-- if layerAsVector then
			-- print("Noisy lines: " .. tostring(layerAsVector.fNoisyLines))
			-- print("Animated noise: " .. tostring(layerAsVector.fAnimatedNoise))
			-- print("Noise scale: " .. tostring(layerAsVector.fNoiseScale))
			-- print("Noise amp: " .. tostring(layerAsVector.fNoiseAmp))
			-- print("Extra lines: " .. tostring(layerAsVector.fExtraLines))
			-- print("Noise Interval: " .. tostring(layerAsVector.fNoiseInterval))
		-- end
	-- end
	print("_________________")
end

Icon
Layer Inspector
Listed

Author: Stan View Script
Script type: Button/Menu

Uploaded: Dec 27 2020, 10:28

Shows the selected layer's info. Useful for those who writes scripts for Moho.
Image

Installation Options:

This script, and all other scripts on this site are distributed as free software under the GNU General Public License 3.0 or later.
Downloads count: 116