Can't get the correct syntax

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  11 November 2007
Can't get the correct syntax


I have this command from the script editor:

connectAttr -f physical_light1.message areaLightShape2.miLightShader;

I need to replace areaLightShape2 with my array variable $LightSetup[ ] but I just can't get the correct syntax.

Can any of you guys help out?

EDIT: Looking at this more closely I have other problems! What I am trying to do is put up a window that lists all arealights in a scene and gives the user a check box to tick for each light, which will connect a Mental Ray physical light node.

These 3 lines of MEL do just that;

mrCreateCustomNode -asUtility "" physical_light;
defaultNavigation -ce -source physical_light -destination areaLightShape1.miLightShader;
connectAttr -f physical_light1.message areaLightShape1.miLightShader;

But I need to have my $LightSetup instead of areaLightShape1. Also if there were 2 or more area lights in the scene then the 3rd line would be incorrect as it would always attach physical_light1. Damn this is to complicated for my basic MEL knowledge!



Last edited by foggyball : 11 November 2007 at 02:28 PM.
  11 November 2007
Thumbs up

current line snippet:
-destination areaLightShape1.miLightShader;

if $LightSetup is an array and you wish to use the first element:
-destination ($LightSetup[0]+".miLightShader");

if $LightSetup is only a string:
-destination ($LightSetup+".miLightShader");
  11 November 2007
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
Society of Digital Artists

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

All times are GMT. The time now is 07:25 AM.

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