[Closed] Closing the BipWorkbench
Hi all,
i am experiencing a crash with max when using a custom exporter and having the biped workbench open.
while it is easy enough for me to manually close the window, i would like to update the exporter script to close the window automatically as this will be helpful for the whole team.
after searching i can only find the command to open the window:
BipWorkBench.open()
and before anyone asks, no .close () doesn`t work
if anyone has an answer to this i`d be grateful for any help.
many thanks
try
workBenchHwnd = windows.getChildHwnd 0 "animation workbench"
if workBenchHwnd != undefined do Windows.SendMessage workBenchHwnd[1] 0x0010 0 0
You sir, are the absolute man!!
thank you so much
what exactly does that piece of code do? (i mean, i know what it DOES obviously, but ive never used any windows functions in maxscript so it
d be nice to follow the code )
also, how on earth did you find that out and do you have any idea why it`s such a ballache?
thanks again!
open the maxscript ref , change to index tab … type windows
the third result is windows structure
basically , max can send messages to windows Os
windows itself is built around messages and events
when you close a dialog for example … you click the x button , the action of clicking here is handled by a windows message to kill “close” that dialog and /or the Program.
by using max windows structure , you can send these messages .
the “ballache” thing is the Hexadecimal number of the message , this is not a max thing
those are pure windows stuff
after you read the max help this link might by useful
http://wiki.winehq.org/List_Of_Windows_Messages
workBenchHwnd = windows.getChildHwnd 0 "Animation WorkBench"
if workBenchHwnd != undefined do Windows.SendMessage workBenchHwnd[1] 0x0007 0 0
this sets the focus on the workBench , you can change the string “animation workbench” to the title of whatever dialog is opened and operate on it.
now look at the link and find the WM_SETFOCUS and so on
the first line in code is getting the Hwnd “the window handler”
Windows Os identifies the dialog by this Hwnd , so you can translate that line in English as
“what is the number or ID of that dialog with the title “Animation WorkBench” “
excellent, thanks for taking the time to explain.
im more crayons than coding but i like to at least try and understand what i
m doing
thanks again for your help!