need help with a simple mel script

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
  03 March 2003
need help with a simple mel script

a friend of mine asked me, to help him with a problem, regarding nurbs geometry. what he wants is a script, that queries the u and v divisions of a surface and doubles the values

udivisions:4, vdivisions: 6, script rebuilds surface with 8 divisions in u and 12 in v direction

i`m not a mel programmer, so i`m asking you for you mel-gods for help. i tried something like this:

setAttr nurbsPlaneShape7.uDivisionsFactor = (`getAttr nurbsPlaneShape7.uDivisionsFactor`)*2;

doesn`t work
Manuel Macha

  03 March 2003
The following will do what you want:

int $spansU = `rebuildSurface -query -spansU myPlane`;
int $spansV = `rebuildSurface -query -spansV myPlane`;
$spansU *= 2;
$spansV *= 2;
rebuildSurface -edit -spansU $spansU -spansV $spansV myPlane;
Hugh Macdonald
  03 March 2003

I ve done an alternate mel.
It double all the UV spans for the selected nurbs.

string $srfList[] = `filterExpand -sm 10`;
int $U,$V,$i;
int $len=size($srfList);

for($i=0; $i<$len; $i++) {
pickWalk -d down;
$U=eval("getAttr "+$srfList[$i]+".spansUV.spansU")*2;
$V=eval("getAttr "+$srfList[$i]+".spansUV.spansV")*2;
rebuildSurface -rt 0 -su $U -sv $V $srfList[$i];

hope this
  01 January 2006
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 03:08 PM.

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