Press Select All in SME.

In the SME menu, is there a way to press.

Select>Select All

 

Using:

actionMan.executeAction 369891408 "40063" /* SME: Select All */

 

is not really what Im after as it requires the SME to be open.

Basically the fn I want overall is to, select the nodes and then hide unused nodes.

Thanks.

Comments

Comment viewing options

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

.

Thank you for your help.

3dwannab's picture

Thanks & one more thing.

I was unchecking General and leaving everything else. It's quite simple really, thanks.

One more thing. In your posts above you wrote.
windows.sendMessage SMEhwnd 0x111 40048 0 -- hide unused nodeslots

Whereas it can also be.
windows.sendMessage SMEhwnd 0x111 41008 0 -- hide unused nodeslots

Where did you get the 40048 handler?

jahman's picture

.

I think it's from the above dropdown menus (edit, view, select, etc), can't remember exactly.

jahman's picture

.

forum makes messages width lower and lower so I post it here
Open gif in new tab to view it in full resolution

3dwannab's picture

.

This seems to work much better by disabling the apply changes. BTW, what is apply changes?

Before I post the code, how do you get those vals from spy++. I've tried but can't seem to find the same values you have.

Which window do you open after I open Spy++? Windows, processes or threads?

fn getSlateHWND =
	(
		for m in (windows.getChildrenHWND 0) where m[4] == "NodeJoeMainWindow" and m[5] == "Slate Material Editor" do return m[1]
	)
 
SMEhwnd = getSlateHWND()
windows.sendMessage SMEhwnd 0x111 40023 0 -- select ALL
 
-- windows.sendMessage SMEhwnd 0xC752 0 0 -- apply changes
windows.sendMessage SMEhwnd 0x111 40048 0 -- hide unused nodeslots
-- windows.sendMessage SMEhwnd 0xC752 0 0
 
windows.sendMessage SMEhwnd 0x111 41004 0 -- press Layout All
windows.sendMessage SMEhwnd 0x111 40024 0 -- select NONE
jahman's picture

.

You need to press Log icon in Spy++ and then in Message Options window drag target icon on to SME window. In additional window I chose child windows only.
And the last one.. there will be lots and lots of messages, hundreds. You can right-click any message that you don't need to log (timer, mousemove, cursormove etc) and press Stop Logging Message.

"Decoded message parameters" is checked (in Output settings)

3dwannab's picture

Headache

That thing would make you go cross-eyed..

I'm not getting the same codes as you. I'm getting 00031720 for the hide unused nodeslots.

Also what is 0x111. When I click I get a WM_LBUTTONDOWN msg. Here (https://msdn.microsoft.com/en-us/library/windows/desktop/ms645607%28v=vs...) it has 0x0201 the code.

I've "Decoded message parameters" is checked (in Output settings)

jahman's picture

headache for sure

0x111 is WM_COMMAND
here's the list

3dwannab's picture

Thanks.

Still not working.

Can you tell me. Do them codes work for all versions of max or do they need to be changed for each version?

Tried:

sme_av = sme.activeView
nodeViewImp = sme.GetView sme_av
 
/* LAYOUT VIEW START */
SMEwin = (windows.getChildHWND 0 "Slate Material Editor")[1] -- Get the HWND of the Slate Material Editor
SMElayout = (windows.getChildrenHWND SMEwin)[19][1] -- Get the HWND of the current Layout All button, 16th item in the SMEWin children array
 
/* SelectAll() Doesn't work */
nodeViewImp.SetFocus()
nodeViewImp.SelectAll()
 
windows.sendMessage SMEwin 0x111 40048 0 -- toggle Hide Unused Nodeslots
windows.sendMessage SMEwin 0xC752 0 0 -- apply changes??
UIAccessor.PressButton SMElayout
 
nodeViewImp.SetFocus()
nodeViewImp.SelectNone()
 
/* LAYOUT VIEW END */

But individually evaluating each line works. Just not together. It will work though if I select the nodes myself with CTRL+A and then run the code.

jahman's picture

.

It works fine in 2014, but I didn't test in any other version. I doubt that codes are differ from version to version.

ps. I just run it again and it actually fails some times and looks like it has something to do with the position of cursor (mostly if it's over SME window). Hope it helps

fn getSlateHWND = (
 
	for m in (windows.getChildrenHWND 0) where m[4] == "NodeJoeMainWindow" and m[5] == "Slate Material Editor" do return m[1]
 
)
 
SMEhwnd = getSlateHWND()
windows.sendMessage SMEhwnd 0x111 40023 0 -- select ALL
 
windows.sendMessage SMEhwnd 0xC752 0 0 -- apply changes
windows.sendMessage SMEhwnd 0x111 40048 0 -- hide unused nodeslots
windows.sendMessage SMEhwnd 0xC752 0 0
 
windows.sendMessage SMEhwnd 0x111 41004 0 -- press Layout All
windows.sendMessage SMEhwnd 0x111 40024 0 -- select NONE

Comment viewing options

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