in-viewport status display

I would like to know if it is possible to see in the viewport what sub-object in mesh objects is selected or active

"I'm not a programmer and I don't have any scripting skills.
Please help me to make it works.

Moving on to the topic you can display more information in the viewport

fn CoordStatistics =
(
try (MaterialName = getRefCoordSys() ) catch(MaterialName = "")
gw.wText [10,40,0] MaterialName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback CoordStatistics
registerRedrawViewsCallback CoordStatistics
CoordStatistics ()

-------------------------------------------------------------------------------------------

fn TransformationsStatistics =
(
try (MaterialName = toolMode.commandmode) catch(MaterialName = "")
gw.wText [10,55,0] MaterialName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback TransformationsStatistics
registerRedrawViewsCallback TransformationsStatistics
TransformationsStatistics ()

-------------------------------------------------------------------------------------------

fn SubselectionStatistics =
(
try (MaterialName = $.GetEPolySelLevel()) catch(MaterialName = "")
gw.wText [10,70,0] MaterialName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback SubselectionStatistics
registerRedrawViewsCallback SubselectionStatistics
SubselectionStatistics ()

-------------------------------------------------------------------------------------------

fn NameselectionStatistics =
(
try (MaterialName = objName = selection[1].name) catch(MaterialName = "")
gw.wText [10,85,0] MaterialName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback NameselectionStatistics
registerRedrawViewsCallback NameselectionStatistics
NameselectionStatistics ()

-------------------------------------------------------------------------------------------

fn FPSStatistics =
(
frameNumber = ((slidertime as string) as integer)
try (MaterialName = "Frame: " + frameNumber as string) catch(MaterialName = "")
gw.wText [10,100,0] MaterialName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback FPSStatistics
registerRedrawViewsCallback FPSStatistics
FPSStatistics ()

-------------------------------------------------------------------------------------------

Comments

Comment viewing options

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

here the solution thanks to the help of jahman

fn meshStatistics =
if(classof (modPanel.getCurrentObject()) == Editable_Mesh) Then
(
SOLevelName = case SubObjectLevel of
(
0: #Object
1: #Vertex
2: #Edge
3: #face
4: #Polygon
5: #Element
)
try (SOLevelName = SubObjectLevel() ) catch(MaterialName = "")
gw.wText [10,100,0] SOLevelName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback meshStatistics
registerRedrawViewsCallback meshStatistics
meshStatistics ()

jahman's picture

.

you can access current Sub-Object level with a max global variable SubObjectLevel

darwin's picture

It's correct what you say, but...

It's correct what you say, but I can't make it work so that it shows the info on the screen, if it's achieved with editable poly like this

fn SubselectionStatistics =
(
try (MaterialName = $.GetEPolySelLevel()) catch(MaterialName = "")
gw.wText [10,70,0] MaterialName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback SubselectionStatistics
registerRedrawViewsCallback SubselectionStatistics
SubselectionStatistics ()

jahman's picture

.

you can use case of statement

SOLevelName = case SubObjectLevel of
(
    0: #Object
    1: #Vert
    2: #Edge
    3: ... and so on
)

Check mxs reference for modPanel.getCurrentObject() if you need to know what type of modifier you're working with since the above list of SOLevel names is only suitable for EditableMesh/Editablepoly and editpoly/editmesh modifiers.

darwin's picture

close to solving it thanks to you.

Thank you very much for your help in solving this problem.

darwin's picture

here the solution thanks to the help of jahman

here the solution thanks to the help of jahman

fn meshStatistics =
if(classof (modPanel.getCurrentObject()) == Editable_Mesh) Then
(
SOLevelName = case SubObjectLevel of
(
0: #Object
1: #Vertex
2: #Edge
3: #face
4: #Polygon
5: #Element
)
try (SOLevelName = SubObjectLevel() ) catch(MaterialName = "")
gw.wText [10,100,0] SOLevelName color:green
gw.updateScreen()
forceCompleteRedraw()
)
unRegisterRedrawViewsCallback meshStatistics
registerRedrawViewsCallback meshStatistics
meshStatistics ()

Comment viewing options

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