[Closed] get enabled state of actionMans
Under help for ActionMan it states here under .isChecked
http://help.autodesk.com/view/3DSMAX/2016/ENU/?guid=__files_GUID_D33B403 …
that:
.isChecked : boolean : Read
Contains the Checked state of the ActionItem as determined by its isChecked event handler.
Why does it not recognise any enabled button as .ischecked.
Say for instance you open up SME>Click a node>Hide unused node.
So that enables the button. When you run the code below it should now be listed as enabled.
Thanks for any help with this. Perhaps a bug lies here. I’m using max 2016. OR do I have to somehow get the .hwnd of the SME?
clearlistener()
sme.open()
for i = 1 to actionMan.numActionTables-1 where (actionMan.getActionTable i).name == "SME" do
(
atbl = actionMan.getActionTable i
format "% ID:% Name:'%' ContextID:% ContextName:'%' NumActionItems:%
" i atbl.id atbl.name atbl.contextID atbl.contextName atbl.numActionItems
for j = 1 to atbl.numActionItems do
(
aitm = atbl.getActionItem j
aitm.getDescription &desc
chkd = aitm.isChecked
aitm.getCategory &cat
aitm.getButtonText &btn
aitm.getMenuText &mnu
hasicon = aitm.hasIcon()
if hasicon then
(
aitm.getIconFileName &iconfile
iconfile = filenamefrompath iconfile
iconindex = aitm.getIconIndex()
format " % ID:% Desc:'%' IsChecked:'%' Cat:'%' BtnTxt:'%' MnuTxt:'%' Icon:[%,%]
" j aitm.id desc chkd cat btn mnu iconfile iconindex
)
else
format " % ID:% Desc:'%' IsChecked:'%' Cat:'%' BtnTxt:'%' MnuTxt:'%'
" j aitm.id desc chkd cat btn mnu
)
)
It outputs for e,g to the listener.
49 ID:369891408 Name:'SME' ContextID:369891440 ContextName:'SME' NumActionItems:37
1 ID:40500 Desc:'Assign Material to Selection' IsChecked:'false' Cat:'SME' BtnTxt:'Assign Material to Selection' MnuTxt:'Assign Material to Selection'
2 ID:40058 Desc:'Delete Selected' IsChecked:'false' Cat:'SME' BtnTxt:'Delete Selected' MnuTxt:'Delete Selected'
3 ID:40063 Desc:'Select All' IsChecked:'false' Cat:'SME' BtnTxt:'Select All' MnuTxt:'Select All'
4 ID:40064 Desc:'Select None' IsChecked:'false' Cat:'SME' BtnTxt:'Select None' MnuTxt:'Select None'
5 ID:40065 Desc:'Select Invert' IsChecked:'false' Cat:'SME' BtnTxt:'Select Invert' MnuTxt:'Select Invert'
6 ID:40066 Desc:'Select Children' IsChecked:'false' Cat:'SME' BtnTxt:'Select Children' MnuTxt:'Select Children'
7 ID:40067 Desc:'Deselect Children' IsChecked:'false' Cat:'SME' BtnTxt:'Deselect Children' MnuTxt:'Deselect Children'
8 ID:40060 Desc:'Lay Out All' IsChecked:'false' Cat:'SME' BtnTxt:'Lay Out All' MnuTxt:'Lay Out All'
9 ID:40076 Desc:'Lay Out Children' IsChecked:'false' Cat:'SME' BtnTxt:'Lay Out Children' MnuTxt:'Lay Out Children'
10 ID:40061 Desc:'Show Grid' IsChecked:'false' Cat:'SME' BtnTxt:'Show Grid' MnuTxt:'Show Grid'
11 ID:40070 Desc:'Zoom Extents' IsChecked:'false' Cat:'SME' BtnTxt:'Zoom Extents' MnuTxt:'Zoom Extents'
12 ID:40071 Desc:'Zoom Extents Selected' IsChecked:'false' Cat:'SME' BtnTxt:'Zoom Extents Selected' MnuTxt:'Zoom Extents Selected'
13 ID:40072 Desc:'Pan to Selected' IsChecked:'false' Cat:'SME' BtnTxt:'Pan to Selected' MnuTxt:'Pan to Selected'
14 ID:40075 Desc:'Hide Unused Nodeslots' IsChecked:'false' Cat:'SME' BtnTxt:'Hide Unused Nodeslots' MnuTxt:'Hide Unused Nodeslots'
15 ID:40077 Desc:'Move Children' IsChecked:'false' Cat:'SME' BtnTxt:'Move Children' MnuTxt:'Move Children'
16 ID:40068 Desc:'Material/Map Browser' IsChecked:'false' Cat:'SME' BtnTxt:'Material/Map Browser' MnuTxt:'Material/Map Browser'
17 ID:40069 Desc:'Parameter Editor' IsChecked:'false' Cat:'SME' BtnTxt:'Parameter Editor' MnuTxt:'Parameter Editor'
18 ID:55560 Desc:'Select Tool' IsChecked:'false' Cat:'SME' BtnTxt:'Select Tool' MnuTxt:'Select Tool'
19 ID:55561 Desc:'Pan Tool' IsChecked:'false' Cat:'SME' BtnTxt:'Pan Tool' MnuTxt:'Pan Tool'
20 ID:55562 Desc:'Zoom Tool' IsChecked:'false' Cat:'SME' BtnTxt:'Zoom Tool' MnuTxt:'Zoom Tool'
21 ID:55563 Desc:'Zoom Region Tool' IsChecked:'false' Cat:'SME' BtnTxt:'Zoom Region Tool' MnuTxt:'Zoom Region Tool'
22 ID:55564 Desc:'Select Tree' IsChecked:'false' Cat:'SME' BtnTxt:'Select Tree' MnuTxt:'Select Tree'
23 ID:55565 Desc:'Navigator' IsChecked:'false' Cat:'SME' BtnTxt:'Navigator' MnuTxt:'Navigator'
24 ID:55566 Desc:'Rename' IsChecked:'false' Cat:'SME' BtnTxt:'Rename' MnuTxt:'Rename'
25 ID:55567 Desc:'Clear View' IsChecked:'false' Cat:'SME' BtnTxt:'Clear View' MnuTxt:'Clear View'
26 ID:55570 Desc:'Update Selected Previews' IsChecked:'false' Cat:'SME' BtnTxt:'Update Selected Previews' MnuTxt:'Update Selected Previews'
27 ID:55571 Desc:'Auto Update Selected Previews' IsChecked:'false' Cat:'SME' BtnTxt:'Auto Update Selected Previews' MnuTxt:'Auto Update Selected Previews'
28 ID:55574 Desc:'Propagate Materials to Instances' IsChecked:'false' Cat:'SME' BtnTxt:'Propagate Materials to Instances' MnuTxt:'Propagate Materials to Instances'
29 ID:55572 Desc:'Enable Global Rendering' IsChecked:'false' Cat:'SME' BtnTxt:'Enable Global Rendering' MnuTxt:'Enable Global Rendering'
30 ID:55573 Desc:'Open / Close Selected Nodes' IsChecked:'false' Cat:'SME' BtnTxt:'Open / Close Selected Nodes' MnuTxt:'Open / Close Selected Nodes'
31 ID:55575 Desc:'Clean MultiMaterial' IsChecked:'false' Cat:'SME' BtnTxt:'Clean MultiMaterial' MnuTxt:'Clean MultiMaterial'
32 ID:55576 Desc:'Instance Duplicate Map' IsChecked:'false' Cat:'SME' BtnTxt:'Instance Duplicate Map' MnuTxt:'Instance Duplicate Map'
33 ID:55577 Desc:'Render Map' IsChecked:'false' Cat:'SME' BtnTxt:'Render Map' MnuTxt:'Render Map'
34 ID:55578 Desc:'Select Objects By Material' IsChecked:'false' Cat:'SME' BtnTxt:'Select Objects By Material' MnuTxt:'Select Objects By Material'
35 ID:55579 Desc:'Highlight Assets in ATS Dialog' IsChecked:'false' Cat:'SME' BtnTxt:'Highlight Assets in ATS Dialog' MnuTxt:'Highlight Assets in ATS Dialog'
36 ID:55580 Desc:'Put Material to Scene' IsChecked:'false' Cat:'SME' BtnTxt:'Put Material to Scene' MnuTxt:'Put Material to Scene'
37 ID:55581 Desc:'Get from Selected' IsChecked:'false' Cat:'SME' BtnTxt:'Get from Selected' MnuTxt:'Get from Selected'
OK
Is there any way to get current state of the ‘Hide unused node’ button?
That’s unlikely to be stored in INI because each node on its selection can update the state of the button, so it must be some sort of flag saved within node.
I’m out of ideas of how can this be achieved
i don’t work with SME… now i see how it works.
There is exposed property for “Hide Unused Nodeslots” as I can see (or as I can’t find :))
But there is way to get state of this button. So you can disable redraw of SME, select all (or any) nodes one by one, and check the state of the button. It’s a trick, but if you really need it…
hmm… can’t see such exposed property in my 2014 max. Only the action “40075” to toggle it on/off.
The only way I see is through slate editor View menu item state. Sad…