MCG Dialogs

0 votes

Ever wanted a pop-up dialog for your MCG graph? Now you can have it and work with scene objects just by connecting nodes. The sample file randomizes the position of selected objects given custom limits. As this is a MCG utility, you don't get viewport redraw and undo support by default, so bear that in mind.

Additional Info: 

To create a dialog for your own graph, ensure that the output of the graph is connected to the Output: utility node:

Then, copy this text and paste it into Edit > Graph Properties > Custom UI tab:

local __countdown = dotNetObject "Timer"
local __interval = __countdown.Interval = 350
local __tick = fn __tick s a dialog:(::execute (getFilenameFile pluginDefinitionFile)) =
    if isKindOf dialog RolloutClass do (__countdown.Stop(); createDialog dialog)
local __event = dotNet.addEventHandler __countdown "Tick" __tick
local __start = __countdown.Start()

It should now look similar to this:

Save the graph, Evaluate it (CTRL+E) and a dialog pop-up should appear - and that's it.

If you want to bind the dialog pop-up to a keyboard shortcut, put it to a button in a toolbar, menu or quadmenu, use the Macroscript Creator - you can copy the script path from the MCG Message Log after first Evaluating the graph , it is the file that ends with .ms

3ds Max Version Requirement: 
RandomizeSelectedObjsPositions.zip2.73 KB