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

I've noticed an error with

I've noticed an error with this code. Well not an error but it doesn't press the hide unused slots. I think the issue is with the nodeViewImp.SelectAll() part which is the built in SME MXS way of doing it. But can figure out why.

PS.
Pixamoon, your code for selecting works but this doesn't.

Perhaps someone could shed some light on this issue?

/* 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
nodeViewImp.SetFocus()
 
/* SelectAll() Doesn't work */
nodeViewImp.SelectAll()
 
windows.sendMessage SMEwin 0x111 40048 0 -- toggle Hide Unused Nodeslots
UIAccessor.PressButton SMElayout
nodeViewImp.SelectNone()
 
/* LAYOUT VIEW END */
jahman's picture

.

Can you test if it works for you?

windows.sendMessage SMEwin 0x111 40048 0 -- toggle Hide Unused Nodeslots
windows.sendMessage SMEwin 0xC752 0 0 -- apply changes??
3dwannab's picture

Cheers all

I have spy but never really used it.

I'll test these 2 out tomorrow. Hopefully they work when SME isin't open. Both look good.

I'll report back then.

jahman's picture

.

select the nodes and then hide unused nodes.
do you mean hide unused nodeslots of selected nodes?

3dwannab's picture

Yes,

I can already press the layout all button on the toolbar through maxscript but not the menu where select all is.

jahman's picture

.

You can use Spy++ to check what messages are used to toggle various SME commands.

windows.sendMessage <smeHWND> 0x111 40048 0 -- toggle Hide Unused Nodeslots
windows.sendMessage <smeHWND> 0x111 40023 0 -- select ALL

otherwise you need to set view in focus before calling actionMan.executeAction

<viewNode>.SetFocus()
3dwannab's picture

Cool. This works. Never

Cool.

This works. Never thought it could be a focus issue. Makes sense, thanks.

local sme_av = sme.activeView
local viewNode = sme.GetView sme_av
viewNode.SetFocus()
actionMan.executeAction 369891408 "40063" /* SME: Select All */
actionMan.executeAction 369891408 "40075" /* SME: Hide Unused Nodeslots */
actionMan.executeAction 369891408 "40064" /* SME: Select None */
actionMan.executeAction 369891408 "40060" /* arrange the view */
pixamoon's picture

`

Hi there,

try this:

function SMESelectAll = (    
	local sme_av = sme.activeView
	local viewNode = sme.GetView sme_av
 
	for n = 1 to trackViewNodes[#sme][sme_av].numSubs do (
		m = trackViewNodes[#sme][sme_av][n].reference
		b = viewNode.GetNodeByRef m
		b.selected = true
	)
)
 
SMESelectAll()

Best,
Pixamoon

3dwannab's picture

Ah man! I should of thought

Ah man! I should of thought of that method and me already knew it! You're still a lifesaver! Thanks.

EDIT OR, which doesn't seem to work as well as your method.

nodeViewImp = sme.GetView sme.activeView
nodeViewImp.SelectAll()
nodeViewImp.ZoomExtents() #all

Comment viewing options

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