PDA

View Full Version : switch to Havok3 by script?


loran
10-14-2009, 09:51 AM
Is it possible to switch to Havok3 with a script line?
thank you

PiXeL_MoNKeY
10-14-2009, 05:00 PM
You would probably have to use the UIAccessor or the .Net Windows Structure as there is no direct access.

-Eric

denisT
10-14-2009, 11:25 PM
Is it possible to switch to Havok3 with a script line?
thank you

it's possible...


fn setHavok id:1 =
(
UtilityPanel.OpenUtility reactor

utip = for w in (windows.getChildrenHWND #max) where w[5] == "Command Panel" do exit with w[1]
if utip != OK do
(
cbox = for w in (windows.getChildrenHWND utip) where w[4] == "ComboBox" and matchpattern w[5] pattern:"Havok*" do exit with w[1]
if cbox != OK do
(
CB_GETCURSEL = 0x0147
CB_SETCURSEL = 0x014E
WM_COMMAND = 0x0111
CBN_SELCHANGE = 0x0001

if (windows.sendMessage cbox CB_GETCURSEL 0 0) != id do
(
windows.sendMessage cbox CB_SETCURSEL id 0

wparent = UIAccessor.GetParentWindow cbox
cbox_id = UIAccessor.getWindowResourceID cbox --0x04ac
windows.sendMessage wparent WM_COMMAND (bit.or (CBN_SELCHANGE*0x010000) cbox_id) cbox
id
)
)
)
)


setHavok id:0 -- Havok 1
setHavok id:1 -- Havok 3

it looks a little crazy but it should work...

loran
10-15-2009, 07:33 AM
thank you! that works!

loran
10-21-2009, 08:10 AM
It works fine but I have to close the popup Analyse window. I don't really understand how the UI AAccessor works. I just want to uncheck the "Analyse on Solver Switch button" in the Reactor Utils or to close the window when popup.

denisT
10-21-2009, 05:32 PM
It works fine but I have to close the popup Analyse window. I don't really understand how the UI AAccessor works. I just want to uncheck the "Analyse on Solver Switch button" in the Reactor Utils or to close the window when popup.


fn havokAnalyzeSwitchToggle =
(
UtilityPanel.OpenUtility reactor
utip = for w in (windows.getChildrenHWND #max) where w[5] == "Command Panel" do exit with w[1]

if utip != OK do
(
cbox = for w in (windows.getChildrenHWND utip) where matchpattern w[5] pattern:"Analyze On Solver Switch" do exit with w[1]
if cbox != OK do
(
-- WM_LBUTTON_DOWN = 0x0201
-- WM_LBUTTON_UP = 0x0202
windows.sendMessage cbox 0x0201 0 0
windows.sendMessage cbox 0x0202 0 0
)
)
)

its toggles the check box state, but i don't know how to get state of the checkbox

CGTalk Moderation
10-21-2009, 05:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.