--Lukas Lepicovsky
--Execute Object Properties


scriptCA = attributes scriptData
(
	parameters main rollout:params
	(
		--usage text
		usage type:#string ui:usageText
	)
	rollout params "Custom Script"
	(
			
		button launchBtn "Execute the Script" pos:[6,7] width:103 height:21
		edittext usageText "" pos:[4,47] width:150 height:225
		groupBox grp1 "Usage" pos:[5,29] width:154 height:253
		
		fn getOwnerNode =
		(
			theClass=(custAttributes.getOwner this)
			theNode=(refs.dependents theClass)
			theNode=theNode[3]
			return theNode
		)
		
		on launchBtn pressed do
		(
			theObject=getOwnerNode()
			theCode=getUserPropBuffer theObject
			execute theCode
		
		)
	)
)
modPanel.addModToSelection (EmptyModifier ()) ui:on
custAttributes.add $.modifiers[1] scriptCA
