Why doesn't this work?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  12 December 2003
Why doesn't this work?

I'm brand new to MaxScript and I'm trying to create a simple little utility to advance or move back a certain number of frames in an animation. Here's the script...

utility vcrpanel "VCR Panel"
(
spinner frames "Frames" range:[0,100,1.0]
button forward "Advance Frames"
button rewind "Rewind Frames"
on forward pressed do
(
sliderTime += frames
)
on rewind pressed do
(
sliderTime -= frames
)
)


The way understand it, the variable "frames" should get the number from the spinner and then be used in the "sliderTime" command. If I put an actual number in the argument it works, but when I use the variable it gives me an error saying "Incompatible types: 40f, and SpinnerControl:frames".

What am I doing wrong?
__________________
"It's not the eyes, but the glance - not the lips, but the smile..."

. . . ~ Visit my world ~ . . .
 
  12 December 2003
You're almost there. You need to use frames.value to get the value property from the frames control and the moment you're trying to add/subtract a GUI control from the sliderTime (which, of course, doesn't make sense and gives you the error you're getting).

So you're script should read


utility vcrpanel "VCR Panel"
(
spinner frames "Frames" range:[0,100,1.0]
button forward "Advance Frames"
button rewind "Rewind Frames"
on forward pressed do
(
sliderTime += frames.value
)
on rewind pressed do
(
sliderTime -= frames.value
)
)
 
  12 December 2003
Thank a bunch. It works like a charm! So would I have to use the ".value" at the end of any numeric variable to get the number from it?

I still have a long way to go with this, but I appreciate the help.
__________________
"It's not the eyes, but the glance - not the lips, but the smile..."

. . . ~ Visit my world ~ . . .
 
  12 December 2003
Quote: Originally posted by FatAssasin
So would I have to use the ".value" at the end of any numeric variable to get the number from it?


No.. ".value" is a property of the spinner control. Lookup "spinner" in the online maxscript reference to see the other properties.. The ".value" property of the spinner (obviously) holds the current value of the spinner control, whereas eg. ".range" holds the value range of the spinner etc..

My explanation might sound a bit stange, but this is the best I can come up with right now . Hope it helps

Martijn
 
  12 December 2003
No, that makes sense. So "frames" isn't actually a variable as I understand it, but the internal name of the spinner. And it holds all the different types of data that a spinner can use, right? And if I want to extract a certain type of that data, in this case the spinner value, then I use the parameter for that type of data after the name of the variable, "frames".

I think I've got it. That helps, thanks.
__________________
"It's not the eyes, but the glance - not the lips, but the smile..."

. . . ~ Visit my world ~ . . .

Last edited by FatAssasin : 12 December 2003 at 09:05 PM.
 
  01 January 2006
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:01 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.