link perspective camera to projection via MEL

246 views
Skip to first unread message

Ryan O'Phelan

unread,
Jul 18, 2011, 2:25:45 PM7/18/11
to maya...@googlegroups.com
Hey guys,
Anyone know how to link a persp cam to a texture projection via MEL?
I have lots of textures that I will need to project through a camera, and I can't count on the camera name being the same later. 

linkProjToCamera seems to be the command, but it's not listed in the help docs. 


Thanks,
Ryan



Tim Leydecker

unread,
Jul 19, 2011, 3:50:22 AM7/19/11
to maya...@googlegroups.com
Hi guys,


is Maya officially supported by backburner and if yes,
how many mR renderlicenses does one get with a SLM license?

Is it worth setting up backburner for Maya?

It would be cool to at least have one back-up rendermanager
for the 3 3D Autodesk packages (Softimage, Maya, 3DS Max),
even if not with the utmost, advanced pooling features.


Cheers


tim

ryan harrington

unread,
Jul 19, 2011, 8:25:48 AM7/19/11
to maya_he3d
Recently I had a similar confusion over procedures and
commands...Procedures call up scripts and don't give verbose feedback.
Michiel Duvekot showed me the "whatIs" query. It's a handy one:

whatIs linkProjToCamera;
// Result: Mel procedure found in: C:/Program Files/Autodesk/Maya2009/
scripts/AETemplates/AEprojectionTemplate.mel //

If your projection is set up before the names start changing your
connections should stay hooked up.

Cheers,
R

Ryan O'Phelan

unread,
Jul 19, 2011, 9:03:49 AM7/19/11
to maya...@googlegroups.com

Thanks for that. I forgot all about whatIs.
Problem is I can't pre-populate that field, and have to connect it on the fly. I'll look into the procedure though.

Ryan

David Johnson

unread,
Jul 19, 2011, 10:42:53 AM7/19/11
to maya...@googlegroups.com
I would do it by having a look at the connections in the hypershade, then with that knowlege do a little mel loop.

So, if you select all your projections and the cameraShape (which must come last) you could run this

{

string $sel[] = `ls -sl`;

int $n = size($sel);

for($i=0; $i<$n-1; $i++) connectAttr -f ($sel[$n] + ".message") ($sel[$i] + ".linkedCamera");

}


David

Ryan O'Phelan

unread,
Jul 19, 2011, 2:06:31 PM7/19/11
to maya...@googlegroups.com
I feel like I tried that, but I'll try it again.
R

Ryan O'Phelan

unread,
Jul 19, 2011, 6:09:43 PM7/19/11
to maya...@googlegroups.com
Oh, it does work! Thanks man! I guess I made an error in my script before. 

Ryan
Reply all
Reply to author
Forward
0 new messages