|
Thanks Steve, I have poped the function inside and all works great, see above.
Thanks for the other tips, all work-in-progress.
My only questions now is, is this function visible to other scirpts, or should a create a seperate script to contain all the functions required for my master sorting script.
Should I declare the fn as Global?
Something like
----------START FUNCTIONS SCRIPT------------------------ macroScript speedsortFunctions ( fn speedsortByVertexFunction theNodes vertexCount =
(
tempObjectArray = #()
for i=1 to theNodes.count do
(
theNode = theNodes[i]
if theNode.numverts == vertexCount then append tempObjectArray theNode
)
tempObjectArray )--end fn )
----------END------------------------------------------
----------START MAIN SCRIPT----------------------------------------- macroScript speedsortByVertex
category: "Troys Tools Speed Sort" buttontext: "Sort by Vertex" tooltip: "Sort by Vertex" (
on isEnabled return selection.count == 1
on execute do
(
theVertexCount = $.numverts
max select all
ss = getCurrentSelection()
select (speedsortByVertexFunction ss theVertexCount)
)
)
----------END------------------------------------------
Author: bobcat
|