Frage

Using python in maya how do I create a linear spline that is not curved or smooth? I tried a few different options and I'm unclear how to do this.

This is the first step in a script I'm trying to create. I'm trying to just create something similar to the image below.

import maya.cmds as cmds
cmds.curve(bezier=True, p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9)] )

enter image description here

War es hilfreich?

Lösung

If you want a linear curve you don't want bezier; you just want a degree 1 curve:

cmds.curve(d=1, p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9)] )

If you really need that to be a bezier, the mel procedure nurbsCurveToBezier will convert it:

import maya.mel as mel
cmds.curve(d=1, p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9)] )
maya.mel.eval("nurbsCurveToBezier");
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top