Maxscript access to free Glue utility plugin.

Hello all,

I am attempting to script access to iToosoft's free Glue utility plugin.

https://www.itoosoft.com/freeplugins/glue.php

I've managed to gain access to child objects of the utility via the following commands and assign them as variables, but cannot seem to populate the Base Object field, or have maxscript assign an object as the Base Object without user interaction. Anyone have ideas on how to do this? I followed an example here (http://forums.cgsociety.org/archive/index.php?t-735390.html), but it only required a push of the button on the utility and not selection of an object.

UtilityPanel.OpenUtility glue
children = windows.getChildrenHWND (windows.getDesktopHWND())
pickBaseButton = (for c in children where ( c[5] == "Pick" ) collect ( c ))[1]
pickBase = (for c in children where ( c[4] == "Edit" and c[5] == "" ) collect ( c ))[1]
glueSelButton = (for c in children where ( c[5] == "Glue Selected" ) collect ( c ))[1]
UIAccessor.pressButton pickBaseButton[1]
pickBase[5] = "_Surface_Main"

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Despondo's picture

Thanks...I'll give that a

Thanks...I'll give that a try.

pixamoon's picture

`

Hi,

Try to use "pick by name" and DialogMonitorOPS to press Default Button:

UtilityPanel.OpenUtility glue
children = windows.getChildrenHWND (windows.getDesktopHWND())
pickBaseButton = (for c in children where ( c[5] == "Pick" ) collect ( c ))[1]
pickBase = (for c in children where ( c[4] == "Edit" and c[5] == "" ) collect ( c ))[1]
glueSelButton = (for c in children where ( c[5] == "Glue Selected" ) collect ( c ))[1]
UIAccessor.pressButton pickBaseButton[1]
 
----------------------------------------------------------------------
 
obj = $plane001
 
tmpSelection = deepcopy (selection as array)
select obj
 
fn PressDefault = (UIAccessor.PressDefaultButton(); true)
 
DialogMonitorOPS.unRegisterNotification id: #PressDefaultID
DialogMonitorOPS.RegisterNotification PressDefault id: #PressDefaultID
DialogMonitorOPS.Enabled = true
 
-- Simulate: Open dialog "Select by Name"
-- When picked button pressed it will work as Pick by Name
actionMan.executeAction 0 "50029"
 
select tmpSelection
 
DialogMonitorOPS.unRegisterNotification id:#PressDefaultID
DialogMonitorOPS.Enabled = false

Hope it helps,

Best,
Pixamoon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.