Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MEL - Attach brush to curves?

1 REPLY 1
Reply
Message 1 of 2
Anonymous
586 Views, 1 Reply

MEL - Attach brush to curves?

Is there a MEL command equivalent to selecting Paint Effects>Curve Utilities>Attach Brush to Curves?? 

 

I'm working on a script to create animated routes based on real route data (location+time). The idea is to show the current location of an object, and draw the route behind it. My current workflow is to create a curve from locations in a text file, attach a brush stroke, then keyframe the stroke to reveal the stroke at the appropriate times. I can do this manually, but I'd like to create a script to handle the entire process (And several files at once). The problem is I can't find a MEL command to create the stroke based on a curve. Does any such command exist? 

 

Any ideas? 

Thanks! 

1 REPLY 1
Message 2 of 2
mweier
in reply to: Anonymous

I have the same problem.  I need a way to use MEL to perform the functions run when using Generate>Curve Utilities>Attach Brush to Curves. 

I've used this crossSections script (http://www.stepanjirka.com/maya-cross-sections/?unapproved=3081&moderation-hash=b453a99584b1c7c7b68d...) to generate a frame sequence of topological map curves based on a terrain mesh that is morphing over time via blend shapes.  This script will generate a crossSection for each frame:

 

 

 

 

int $startTime = 1;
int $endTime = 90;
currentTime $startTime;
select -clear;
for ($r = $startTime; $r <= $endTime; $r++){
    currentTime $r;
    string $newName = ("topo" + $r);
    string $newCurveName = ("curve" + $r);
    print($newName);
    select -clear;
    select -r morphMountains ;
    crossSections -n 100 -s 0.1 -r 0 0 90 -t 0 -1.5 0 $newName;
 }

 

 

 

 

 

and then this script will batch these crossSection objects to generate a NURBS curve for each frame: 

 

 

 

 

for ($r = $startTime; $r <= $endTime; $r++){
    currentTime $r;
    string $newName = ("topo" + $r);
    crossSections -q -crv 0 $newName;
 };

 

 

 

 



I am now looking to 1) make each curve renderable in its corresponding frame by attaching paint effect brush strokes to each curve in turn.   Since multiple brush strokes are generated when doing this manually using Generate>Curve Utilities>Attach Brush to Curves, I will also need to 2) group the output strokes for each curve, and 3) key the visibility of this group to be only for its designated frame (keying visiblity =0 for frame n-1 and n+1);

Help?

I'm stuck because I don't see a way to automate the stroke generation, grouping, and visibility keying.  

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report