PDA

View Full Version : Noob Problem detachSurface


SaBeRriDeR
01-18-2007, 08:01 PM
hey you guys,

i'm a total beginner with mel, but i was trying a few things now, and felt the power in this thing. but i always reached one point where i couldn't get any further.
i'm trying to script my workflow for a really huge surface model of an island for a game project. i modeled everything with nurbs, and now i just want to split this huge patch into same- sized smaller patches, for further processing.

so here is my problem:

i can easily calculate all the u and v values, where to detach, but i cannot figure out, how to feed this calculated float array to this detachSurface command. i simply want to use detachSurface with a variable number of parameters, but i don't know how to script this.

is there anything like:

detachSurface -ch off -d 1 -p *HERE_COMES_THE_ARRAY*;

??

thanks for any help...

greez

unsmoothed
01-20-2007, 11:32 AM
Hi. You could try looping though the array, detaching as you go, like....

float $nums[3] = { 0.2, 0.4, 0.6, 0.8 }; // v or u paramater array
float $numItem;

for ($numItem in $nums) {
detachSurface -ch 0 -d 1 -p $numItem -rpo 0 nurbsCylinder1;
}

SaBeRriDeR
01-20-2007, 02:18 PM
thanks very much... i finally figured it out, due to your hint... ;-)
its kind of a dirty programming, but it works for me...


float $nums[3] = { 0.0 ,0.2, 0.4, 0.6, 0.8, 1.0 };
int $i = 0;

do {

string $names[] = `detachSurface
-ch 1
-k off
-k on
-k off
-d 1
-p $nums[$i]
-p $nums[($i + 1)]
-rpo 0

nurbsPlane1`;

//deleting empty nodes

delete $names[0];
delete $names[2];

//renaming patch

rename $names[1] ("Part" + $i);

$i++;

} while ($i < (`size $nums` - 1))

CGTalk Moderation
01-20-2007, 02:18 PM
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.