What is the python command for Surface Editing Tool

What is the python command for Surface Editing Tool

royyan716
Observer Observer
744 Views
4 Replies
Message 1 of 5

What is the python command for Surface Editing Tool

royyan716
Observer
Observer

Hello,

 

I'm a Maya newbie. I'm trying to script my model in Maya, but I can't find the proper way for the corresponding command that does some of the manipulator tool things (in order to do precise manipulating).

 

For example, I can create a NURBS plane through scripting, but how do I script the action that distorts the plane by dragging the pivot via Surface Editing Tool (nothing pops out in the console when I do the dragging)?

 

 Many thanks for any hints.

 

0 Likes
745 Views
4 Replies
Replies (4)
Message 2 of 5

rajasekaransurjen
Collaborator
Collaborator

Hi,

Try This....

import maya.cmds as cmds
cmds.select ('nurbsPlane1.uv[0.1][0.1]', r=True)

 

0 Likes
Message 3 of 5

royyan716
Observer
Observer

Thanks for your quick response!

I suppose this is for gabbing the pivot, then need to perform manual distortion.

I also found that command (SurfaceEditingTool), but I couldn't find any documentation associated with it. Could you provide me with a sample usage?


@rajasekaransurjenwrote:

Hi,

Try This....

import maya.cmds as cmds
cmds.select ('nurbsPlane1.uv[0.1][0.1]', r=True)

 


 

0 Likes
Message 4 of 5

djonesuk
Advocate
Advocate

SurfaceEditingTool activates a curve editor context, which is a user interface tool for editing NURBS objects.  The tool converts user input into a series of move commands that translate the CVs of the underlying geometry.  You can activate the tool via scripting but as the tool requires interactive user input it won't do anything. 

 

If you enable Echo All Commands in the Script Editor whilst using the tool you will be able to see the move commands issued by the context, which you can copy into your script.

 

move -a -os 0.212721 0.336383 0.570186 nurbsPlaneShape1.cv[1][0]  

 

0 Likes
Message 5 of 5

royyan716
Observer
Observer

@djonesukwrote:

SurfaceEditingTool activates a curve editor context, which is a user interface tool for editing NURBS objects.  The tool converts user input into a series of move commands that translate the CVs of the underlying geometry.  You can activate the tool via scripting but as the tool requires interactive user input it won't do anything. 

 

If you enable Echo All Commands in the Script Editor whilst using the tool you will be able to see the move commands issued by the context, which you can copy into your script.

 

move -a -os 0.212721 0.336383 0.570186 nurbsPlaneShape1.cv[1][0]  

 


Thanks, @djonesuk!

 

I think when I drag the uv point of a NURBS plane and perform the deformation. The CommandEcho shows the actual commands are something like:


move -a -os -2.099801 -5.142008 5.672736 cavity_wall_1Shape.cv[1][0] ;
move -a -os -5 -5 5 cavity_wall_1Shape.cv[0][0] ;
move -a -os 1.233532 -5.142008 5.672736 cavity_wall_1Shape.cv[2][0] ;
move -a -os 5 -5 5 cavity_wall_1Shape.cv[3][0] ;
...

I think what happened is the software is explicitly moving many points on the plane to make a smooth deformation. However, when I'm programming it will be hard for me to code the diplacement of all the points in the plane. Is there a way work around this, i.e., I only need to program the diplacement of the uv point and the smooth deformation is automatically accomplished?

 

Thanks a lot!

0 Likes