PDA

View Full Version : On Screen Message Display Tool


PEN
01-29-2008, 09:10 PM
I was poking around today with stuff and ended up writting this. It is a tool for displaying message to users on screen. Read the usage at the top of the script. You can diaplay message any where on screen and there are 9 default positions that you can use. Colors of text and background box can be changed as well as an option to turn off the box. The text is displayed for a set number of milliseconds or until the sceen is refreshed which ever is longer. The time can also be changed.

Enjoy.
Download: (http://paulneale.com/scripts/screenMessage/PEN_screenMessage.ms)

http://paulneale.com/scripts/screenMessage/PEN_screenMessage.jpg

Jon-Huhn
01-29-2008, 09:46 PM
I haven't checked out your script yet, but it looks like a really good idea.

For a while now I've wanted to write (or acquire) a script that allows you to document a complex rig setup the same way a programmer documents code... can this be used for that effectively?

Thanks for sharing this.

EDIT:

Ah, after looking through the code I see this really is a nice, simple messaging system that can easily be used by other scripts. Very useful!

JHN
01-29-2008, 10:23 PM
I really like it... easy when guiding a user through the steps of a script or workflow.
Maybe an feature to add is a way to delay a message? So you can build playback text message.

Thanks for sharing!

-Johan

RustyKnight
01-29-2008, 10:29 PM
Way cool!

Shane

Ruramuq
01-29-2008, 11:41 PM
gw gives me a lot of ideas, but The flickering is an Autodesk flaw right ?

inspiring.., I might use it with rigs, thanks

focomoso
01-30-2008, 07:28 AM
Very cool. Another practical implementation might be to use it to freak out your coworkers by popping up random insults and regular intervals. Or make them think their version of max has a crush on them.

PEN
01-30-2008, 01:29 PM
Very cool. Another practical implementation might be to use it to freak out your coworkers by popping up random insults and regular intervals. Or make them think their version of max has a crush on them.

That is the best use for it yet! I knew every one would find something to do with it.

I have used gw a fair bit in feed back of information to the user. Once place that I used it was a tool for setting soft selections in editablepoly. You hit a hot key and scrub to set the value and incase you want to know what the value is it is display at your mouse point. It displays all the settings at the same time so you know what is going on.

I built it because a friend, Dimitry, asked about something and in talking about it this idea popped into my head. I'm thinking that I should add the ability to set the position by an object or selected object. It would be neat to have a help mode for rig so that when a user selects something it pops up a message about what that object is for. Currently it only handles one line messages as line breaks are not respected. I would have to read in the string as a string stream and display each line one at a time. If enough people find cools ways to use it I might just do that.

EverZen
01-30-2008, 02:38 PM
Firstly this is a slick idea, and thanks so muh for sharing.

Unfortunately I am getting an error on the line:


if showBoxDisp then (gw.wrect rect boxColorDisp)


which is in the BoxMessage Function.

when I look at gw, wrect does not appear as a method. I am in 3DSMax 9, is this something new to 2008? Or am I being an idiot?

If this line is commented out then it works perfectly, and is definitely going to be featuring is my future projects!

Thanks :)

Rich

PEN
01-30-2008, 03:12 PM
Ah yes, I should mention and didn't even think of putting it in the header that this is a Max2008 only script. If you want to use it for Max 9 then just comment out the box or just send the showBox:false property and it should work. Maybe I will find another way to draw the box and do a check to see if it is Max 9 or earlier and use that.

PEN
01-31-2008, 04:55 PM
I just did an update. Four new things added.


#node can be passed as the position now. If it is is passed into either the vertical or horizontal parameters the position of an object will be used for that value.

To pass in an object use obj:$theObject

Since the user can be paning a viewport as the label is displayed and the object will be moving there is parameter called updatePos:true. This is set to false by default but if passed as true the labels position will constantly updated to stay with the object.

I have also added offset:[0,0], this can be passed to move the label as an offset from the position that was set.

Enjoy.
Download: (http://paulneale.com/scripts/screenMessage/PEN_screenMessage.ms)

doctorx256
01-31-2008, 06:39 PM
thanks. nice tool paul.

martinB
02-05-2008, 02:41 PM
Nice one, thanks Paul.
Here's an idea if you want to extend this: How about a tool that will take all selected objects and display their names in the viewport if they are not on the current list. If they are on the list, remove their viewport labels.

Right now, your struct does not work for more than one object at a time, so that would need to be added.

Cheers
-- MartinB

PEN
02-05-2008, 03:16 PM
It does work for more then one at a time. Look at the usage at the top and you can see that you need to make an instance of the struct for each label. So just loop through all the selected objects and pass in the name and how you would like to display the label. I would assume that you would want to have the labels aligned to the objects that are selected so you can pass in #node to both the x and y and then al so the object need to be passed as well.

PEN
02-05-2008, 03:18 PM
I guess I could add the ability to loop through an array of labels and display them all. I will see if I can find the time to add that.

martinB
02-05-2008, 03:25 PM
It does work for more then one at a time. Look at the usage at the top and you can see that you need to make an instance of the struct for each label. So just loop through all the selected objects and pass in the name and how you would like to display the label. I would assume that you would want to have the labels aligned to the objects that are selected so you can pass in #node to both the x and y and then al so the object need to be passed as well.

Oh, OK! Excellent. Sorry, I was too sloppy to read it thoroughly.

-- MartinB

RappyBMX
02-11-2008, 01:29 PM
sweet i was looking for something like this :D

PEN
02-11-2008, 01:46 PM
Your welcome.

fferro2
04-02-2008, 06:53 PM
Hi,

download link broken?

fferro2
04-02-2008, 06:57 PM
sorry, double post

PEN
04-03-2008, 12:24 AM
Works here. Try again.

Insanto
01-17-2009, 07:22 AM
uh i can think of a few ways to implement that...

if there just wern't about this 404 error. yeah the links are not workin, but it's a great idea.

maybe you can post up the part about the text displaying?

djlane
01-17-2009, 11:23 PM
I'm getting a broken link.

Insanto
01-18-2009, 02:35 PM
i found my own resourcewasting way of doin it ;)

fn ViewPortText text pos: count: interval: = (

rollout test "" (
local text=""

local timeToDisplay=7

local textPos = [10,((getMAXWindowpos())+((getMAXWindowSize())/2+100))[2],0]

local interval = 1000
local ticks = 0
timer clock interval:0001


fn drawtext = (
completeRedraw() ;

if test.ticks <= (timeToDisplay) then (
gw.wtext (test.textPos-[0,75,0]+[0,(10*test.ticks),0]) test.text color:((color 250 150 50)/test.ticks)
gw.enlargeUpdateRect #whole ; gw.updateScreen()
)else(
test.clock.active=false
destroydialog test
)
)

on test open do (
drawtext()

)
on test close do (
completeRedraw() ;
)

on clock tick do (
if ticks == 0 do clock.interval=interval
ticks += 1
drawtext()
)

)
createdialog test 50 0 -999999999 -999999999

test.text=text as string

if pos != unsupplied do (
test.textPos=[(pos[1]),(pos[2]),0]
)
if count != unsupplied do (
test.timeToDisplay=count as integer
)
if interval != unsupplied do (
test.interval=interval as Integer
)
OK
)

ViewPortText <String> [count:Integer] [Interval:Integer (msec.)] [pos:Point2 ]

Dimich
01-19-2009, 10:36 AM
Ah, the tool to smack animators on a distance:D I do recall the talk we had about that:P Good stuff, but I do get a broken link atm. Deffinately want to have a look at it. Please let us know when you can fix it:)

PEN
01-26-2009, 04:16 PM
If you want this script it is back up now.

PEN
01-26-2009, 05:21 PM
Interestingly enough it isn't working in 2008, draws the box and doesn't throw and error but I don't see any text. I believe that I wrote it in 2008. Does it work for any one else?

PEN
01-26-2009, 05:33 PM
Disregard, I'm an idiot, I must have been messing with it some before saving it last and had the text commented out:shrug:

CGTalk Moderation
01-26-2009, 05:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.