SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / about global variables
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 30-10-2006, 04:17 PM   #1
laiamulet
Registered User
 
Join Date: Oct 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Question about global variables

I would like to ask if the global variable that I have defined in one of the scripts of the folder :my files>maya>scripts are loaded automatically, like happens with the procedures that I have defined in that folder, or if I have to define it each time that I'm using it,...
laiamulet is offline   Reply With Quote
Old 03-11-2006, 09:06 PM   #2
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

global variables will be defined when the script that defines them is called.

e.g.

myfile.mel:
<<

global float $a;

global proc myProc()
{
//$a will now be available to use in this function
global float $a;
//assign a value to $a
$a = 1.0;
}

>>
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.