CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 10-19-2005, 07:17 PM   #1
Grayth
New Member
Troy Nantais
Brantford, Canada
 
Join Date: Oct 2005
Posts: 10
Camera setup Script

Hi Everyone,

I'm trying to make a camera setup script that follows the same setup as the Gnomon Digital Sets1 DVD..Please note that I'm a complete noob in MEL.

I can see a couple problems so far...
1. I would like to be able to lock attributes based on the string name and not the actual name.
2. Since I named my group nodes...I can see another problem in that if I create another item these group nodes will change as I think they are in an array because of duplicate names
3. Is there a better way to name the camera?
4. Also in selecting the camera_group node...this won't be accurate...it would be nice to find a way to change it's name to match camera name

The idea being that with a simple UI have the user be able to give the camera a name select which transform nodes they would like that camera to have...and create the camera..

the script then creating the camera and locking out all the attributes for the various group nodes except for the ones the user wants editable...

here's what I got so far..hope you can help me and steer me in a direction.

string $cameraName = "bob";
string $grp = "XYZ_Trans";
string $group = "YRot_Pan";
string $groups = "XRot_Tilt";
string $groupss = "ZRot_Roll";
camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 1 -horizontalFilmAperture 1.41732 -horizontalFilmOffset 0 -verticalFilmAperture 0.94488 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.01 -farClipPlane 1000 -orthographic 0 -orthographicWidth 30; objectMoveCommand; cameraMakeNode 3 "";
rename $cameraName;
setAttr -lock true "bob.tx";
setAttr -lock true "bob.ty";
setAttr -lock true "bob.tz";
setAttr -lock true "bob.rx";
setAttr -lock true "bob.ry";
setAttr -lock true "bob.rz";
setAttr -lock true "bob.sx";
setAttr -lock true "bob.sy";
setAttr -lock true "bob.sz";
setAttr -lock true "bob.v";
select -r camera1_group ;
group -name $groupss; xform -os -piv 0 0 0;
setAttr -lock true "ZRot_Roll.tx";
setAttr -lock true "ZRot_Roll.ty";
setAttr -lock true "ZRot_Roll.tz";
setAttr -lock true "ZRot_Roll.rx";
setAttr -lock true "ZRot_Roll.ry";
setAttr -lock true "ZRot_Roll.sx";
setAttr -lock true "ZRot_Roll.sy";
setAttr -lock true "ZRot_Roll.sz";
setAttr -lock true "ZRot_Roll.v";
group -name $groups; xform -os -piv 0 0 0;
setAttr -lock true "XRot_Tilt.tx";
setAttr -lock true "XRot_Tilt.ty";
setAttr -lock true "XRot_Tilt.tz";
setAttr -lock true "XRot_Tilt.ry";
setAttr -lock true "XRot_Tilt.rz";
setAttr -lock true "XRot_Tilt.sx";
setAttr -lock true "XRot_Tilt.sy";
setAttr -lock true "XRot_Tilt.sz";
setAttr -lock true "XRot_Tilt.v";
group -name $group; xform -os -piv 0 0 0;
setAttr -lock true "YRot_Pan.tx";
setAttr -lock true "YRot_Pan.ty";
setAttr -lock true "YRot_Pan.tz";
setAttr -lock true "YRot_Pan.rx";
setAttr -lock true "YRot_Pan.rz";
setAttr -lock true "YRot_Pan.sx";
setAttr -lock true "YRot_Pan.sy";
setAttr -lock true "YRot_Pan.sz";
setAttr -lock true "YRot_Pan.v";
group -name $grp; xform -os -piv 0 0 0;
setAttr -lock true "XYZ_Trans.rx";
setAttr -lock true "XYZ_Trans.ry";
setAttr -lock true "XYZ_Trans.rz";
setAttr -lock true "XYZ_Trans.sx";
setAttr -lock true "XYZ_Trans.sy";
setAttr -lock true "XYZ_Trans.sz";
setAttr -lock true "XYZ_Trans.v";


Thanks,
Troy
 
Old 10-19-2005, 07:17 PM   #2
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:24 AM.


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