Notifications
Clear all

[Closed] Hook into SME UI position and move rollout

Here’s a snippet of code from the help file but I was hoping to get the UI to become a child of the SME UI moving along with it based on an offset from SME’s top left corner.

Is this possible to do?


(
sme.Open() --Open the SME
theParent = windows.getChildHWND 0 "Slate Material Editor" --get the HWND of the SME
rollout sme_toolbox_rollout "SME Toolbox"
(
	button btn_nextMap "UP One Level" width:150
	on btn_nextMap pressed do
	(
		theObj = sme.GetMtlInParamEditor() --get the node from the parameter panel
		if theObj != undefined do --if there is a valid node, get its dependents
		(
			local theDeps = for m in refs.dependents theObj where isKindOf m TextureMap or isKindOf m Material collect m
			if theDeps.count > 0 do sme.SetMtlInParamEditor theDeps[1]	--if there were any, select the first one	
		)
	)
)
createDialog sme_toolbox_rollout parent:theParent[1] --create a dialog as child of the SME
)