PDA

View Full Version : string declaration in 4.5 and 5.0


h0tice
02-07-2004, 12:37 PM
hi there again,

i made a script that goes like this:

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

for ( $lights in $light)
{
setAttr ( $lights + ".useDepthMapShadows" ) 1;
setAttr ( $lights + ".dmapResolution" ) 1080;
setAttr ( $lights + ".useDmapAutoFocus" ) 0;
setAttr ( $lights + ".dmapFocus" ) 180;
setAttr ( $lights + ".dmapFilterSize" ) 8;
setAttr ( $lights + ".useDmapAutoClipping" ) 0;
setAttr ( $lights + ".dmapFarClipPlane" ) 10000;
setAttr ( $lights + ".dmapNearClipPlane" ) 0.001;
}

this thing works fine in maya4.5, but when i execute this in maya5.0 i got errors:

// Error: setAttr ( $lights + ".useDepthMapShadows" ) 1; //
// Error: Illegal operation "+" on data of type string[]. //
// Error: setAttr ( $lights + ".dmapResolution" ) 1080; //
// Error: Illegal operation "+" on data of type string[]. //
// Error: setAttr ( $lights + ".useDmapAutoFocus" ) 0; //
// Error: Illegal operation "+" on data of type string[]. //
// Error: setAttr ( $lights + ".dmapFocus" ) 180; //
// Error: Illegal operation "+" on data of type string[]. //
// Error: setAttr ( $lights + ".dmapFilterSize" ) 8; //
// Error: Illegal operation "+" on data of type string[]. //
// Error: setAttr ( $lights + ".useDmapAutoClipping" ) 0; //
// Error: Illegal operation "+" on data of type string[]. //
// Error: setAttr ( $lights + ".dmapFarClipPlane" ) 10000; //
// Error: Illegal operation "+" on data of type string[]. //
// Error: setAttr ( $lights + ".dmapNearClipPlane" ) 0.001; //
// Error: Illegal operation "+" on data of type string[]. //

what's going on here, is there a difference in declaring a string in 4.5 and 5.0?

thanx a lot.

safakoner
02-07-2004, 12:45 PM
Hi h0tice

I am using Maya 5.0.1 and your code is working fine for me. Where is the problem I don't know.

h0tice
02-07-2004, 01:26 PM
yeah after i reboot my computer my code did well, thanx equinox.

CGTalk Moderation
01-17-2006, 10:00 AM
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.