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
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 ()
.
you can access current Sub-Object level with a max global variable SubObjectLevel
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 ()
.
you can use case of statement
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.
close to solving it thanks to you.
Thank you very much for your help in solving this problem.
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 ()