Exemplo n.º 1
0
 public static bool SetLimit(MFnTransform mfnTrans, float rxMin, float ryMin, float rzMin, float rxMax, float ryMax, float rzMax, bool inRadian)
 {
     if (!inRadian)
     {
         rxMin /= ConstantValue.DPR;
         ryMin /= ConstantValue.DPR;
         rzMin /= ConstantValue.DPR;
         rxMax /= ConstantValue.DPR;
         ryMax /= ConstantValue.DPR;
         rzMax /= ConstantValue.DPR;
     }
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMinX, rxMin);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMinY, ryMin);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMinZ, rzMin);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMaxX, rxMax);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMaxY, ryMax);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMaxZ, rzMax);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMinX, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMinY, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMinZ, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMaxX, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMaxY, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMaxZ, true);
     return(true);
 }
Exemplo n.º 2
0
 public static void SetRotationLimit(MFnTransform mfnTrans, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
 {
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMinX, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMinY, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMinZ, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMaxX, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMaxY, true);
     mfnTrans.enableLimit(MFnTransform.LimitType.kRotateMaxZ, true);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMinX, minX);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMinY, minY);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMinZ, minZ);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMaxX, maxX);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMaxY, maxY);
     mfnTrans.setLimit(MFnTransform.LimitType.kRotateMaxZ, maxZ);
 }
Exemplo n.º 3
0
 public static void SetTransformLimit(MFnTransform mfnTrans, float value, MFnTransform.LimitType type)
 {
     mfnTrans.enableLimit(type, true);
     mfnTrans.setLimit(type, value);
 }