Display Message on Viewport (toggle)
Hello, I have a small macro and would like to have some text displayed on the viewport when I activate it, I've tried the code from this page:
https://forums.cgsociety.org/t/draw-a-text-in-corner-of-the-viewport/163...
but I get an error Exception message: "registerRedrawViewsCallback() expected function, got: undefined."
My macro is the following:
macroScript LockSnapScale
category:"# sampei"
buttonText: "Lock,Snap,Scale"
toolTip:"Lock,Snap,Scale"
(
actionMan.executeAction 0 "59231" -- Selection: Selection Lock Toggle
actionMan.executeAction 0 "40072" -- Snaps: Snaps Toggle
actionMan.executeAction 0 "40223" -- Snaps: Percent Snap Toggle
macros.run "Tools" "Non_Uniform_Scale"
toolMode.selectionCenter()
)
Comments
.
......
Tools and Scripts for Autodesk 3dsMax
.
To hide the text execute only this:
Tools and Scripts for Autodesk 3dsMax
alright thanks, I take it
alright thanks, I take it it's quite complicated to incorporate a ON/OFF switch type thing in the same script then? perhaps the way to it would be with 2 different events in the script?
.
If your script has an UI then you can use a checkbutton. When it is ON - show the info in viewport, when it is Off - hide the info.
Tools and Scripts for Autodesk 3dsMax
no UI, just the macro I
no UI, just the macro I posted above as I'm rather hopeless with scripting unfortunately. My aim was to have a one click solution, even with the checkbutton I would still need 2 separate shortcut keys to activate and deactivate it. Thanks anyway, appreciate your help :)
.
Tools and Scripts for Autodesk 3dsMax
yes that's it! you are
yes that's it! you are amazing, thanks a million! :D
Since we're here, I always had an idea for a specific script and I'm sure you know if it's possible or not (but I imagine it would be very complicated).
Basically you would have the current number of selected sub elements (points, edges or polygons) placed above the mouse cursor, so when you moved the cursor this number would move with it, remaining above it at all times. This would work with all selection tools.
So for example, as you are selecting points with the Paint Selection Region tool, the number goes from 0 to N of selected points.
This would ensure you are immediately aware if you selected an unwanted element by accident, which happens to me quite frequently. Of course you can do this by looking at the statistics on the top left corner, but this breaks the modeling "flow".
Would such a thing possible in theory?
.
What you describe is possible.
I will post a script in the coming days, if someone else not do it meanwhile.
Tools and Scripts for Autodesk 3dsMax
outstanding! really looking
outstanding! really looking forward to seeing what you come up with ;)
.
Works with Edit Poly modifier and Editable Poly objects only.
Tools and Scripts for Autodesk 3dsMax