pymel.utilΒΆ

General utilities which are pymel-independent.”

Functions

LazyLoadModule
param name:name of the module
abs Return the absolute value of the argument.
acos Return the arc cosine (measured in radians) of x.
acosh Return the hyperbolic arc cosine (measured in radians) of x.
addLazyDocString helper for LazyDocString. Equivalent to :
alias Returns a property which is simply an alias for another property.
all all(a, [,axis=(axis0, axis1, ...)]) –> bool or Array of booleans
angle angle(u, v) –> float
any any(a [,axis=(axis0, axis1, ...)]) –> bool or Array of booleans
appendEnv append the value to the environment variable list ( separated by ‘:’ on osx and linux and ‘;’ on windows).
asin Return the arc sine (measured in radians) of x.
asinh Return the hyperbolic arc sine (measured in radians) of x.
atan Return the arc tangent (measured in radians) of x.
atan2 Return the arc tangent (measured in radians) of y/x.
atanh Return the hyperbolic arc tangent (measured in radians) of x.
axis axis(u, v[, normalize=False]) –> VectorN
blend blend(a, b[, weight=0.5]) :
breadth iterator doing a breadth first expansion of args
breadthArgs returns a list of a breadth first expansion of args
breadthIterArgs iterator doing a breadth first expansion of args
cacheProperty a property type for getattr functions that only need to be called once per instance.
capitalize Python’s string ‘capitalize’ method is NOT equiv. to mel’s capitalize, which preserves
ceil Return the ceiling of x as a float.
clamp Clamps the value x between min and max
clsname
compareCascadingDicts compares two cascading dicts
conjugate the conjugate part of x
convertListArgs
copysign Return x with the sign of y.
cos Return the cosine of x (measured in radians).
cosh Return the hyperbolic cosine of x.
cotan cotan(u, v) –> float :
cross cross(u, v) –> VectorN
decorated Copies the original function’s name/docs/signature to the new function, so that the docstrings contain relevant information again.
decorator Decorator for decorators.
degrees This function has been overriden from math.degrees to work element-wise on iterables
det det(m) –> float
dist dist(a, b[, axis=(axis0, axis1, ...)]) –> float or Array
dot dot(u, v) –> float
escape Escape all non-alphanumeric characters in pattern.
executableOutput Will return the text output of running the given executable with the given arguments.
exp Return e raised to the power of x.
expandArgs ‘Flattens’ the arguments list: recursively replaces any iterable argument in *args by a tuple of its
fabs Return the absolute value of the float x.
factorial Find x!.
floor Return the floor of x as a float.
fmod Return fmod(x, y), according to platform C. x % y may differ.
frexp Return the mantissa and exponent of x, as pair (m, e).
fsum sum(iterable)
gamma Gamma color correction of c with a single scalar gamma value g
getCascadingDictItem
getEnv get the value of an environment variable. returns default (None) if the variable has not been previously set.
getEnvs get the value of an environment variable split into a list. returns default ([]) if the variable has not been previously set.
hermite As the MEL command : This command returns x point along on x hermite curve from the five given control arguments.
hermiteInterp Hermite interpolation of x between points y0 and y1 of tangent slope s0 and s1
hypot Return the Euclidean distance, sqrt(x*x + y*y).
imag the imaginary part of x
interface_wrapper A wrapper which allows factories to programatically create functions with
interpreterBits Returns the number of bits of the architecture the interpreter was compiled on (ie, 32 or 64).
inv inv(m) –> MatrixN
isIterable Returns True if an object is iterable and not a string or ProxyUnicode type, otherwise returns False.
isMapping Returns True if an object is a mapping (dictionary) type, otherwise returns False.
isNumeric Returns True if an object is a number type, otherwise returns False.
isScalar Returns True if an object is a number or complex type, otherwise returns False.
isSequence same as operator.isSequenceType
isinf Checks if float x is infinite (positive or negative)
isnan Checks if float x is not a number (NaN)
iterateArgs Iterates through all arguments list: recursively replaces any iterable argument in *args by a tuple of its elements that will be inserted at its place in the returned arguments.
izip_longest
ldexp This function has been overriden from math.ldexp to work element-wise on iterables
length length(a[, axis=(axis0, axis1, ...)]) –> numeric or Array
linmap Returns the value of a linear remapping function.
linstep Returns the value of a linear step function.
listForNone returns an empty list when the result is None
log If the base not specified, returns the natural logarithm (base e) of x.
log10 This function has been overriden from math.log10 to work element-wise on iterables
log1p Return the natural logarithm of 1+x (base e).
makeMethod
max max(iterable[, key=func[, axis=(axis0, axis1, ...)]]) –> value
mergeCascadingDicts recursively update to_dict with values from from_dict.
min min(iterable[, key=func[, axis=(axis0, axis1, ...)]]) –> value
modf Return the fractional and integer parts of x.
namedtuple Returns a new subclass of tuple with named fields.
normal normal(a[, axis=(axis0, axis1, ...)]) –> Array
outer outer(u, v) –> MatrixN
pairIter Returns an iterator over every 2 items of sequence.
patchMath Overload various math functions to work element-wise on iterables
postorder iterator doing a postorder expansion of args
postorderArgs returns a list of a postorder expansion of args
postorderIterArgs iterator doing a postorder expansion of args
pow Return x**y (x to the power of y).
preorder iterator doing a preorder expansion of args
preorderArgs returns a list of a preorder expansion of args
preorderIterArgs iterator doing a preorder expansion of args
prependEnv prepend the value to the environment variable list (separated by ‘:’ on osx and linux and ‘;’ on windows).
prod prod(a[, start=1[, axis=(axis0, axis1, ...)]]) –> numeric or Array
proxyClass This function will generate a proxy class which keeps the internal data separate from the wrapped class.
putEnv set the value of an environment variable. overwrites any pre-existing value for this variable. If value is a non-string
radians This function has been overriden from math.radians to work element-wise on iterables
readonly Marks a class member as protected, allowing metaProtected to prevent re-assignation on the classes it generates
real the real part of x
refreshEnviron copy the shell environment into python’s environment, as stored in os.environ
reorder Reorder a list based upon a list of positional indices and/or a dictionary of fromIndex:toIndex.
round Round a number to a given precision in decimal digits (default 0 digits).
sequenceToSlices convert a sequence of integers into a tuple of slice objects
setCascadingDictItem
setRange Resets x range from x linear interpolation of oldmin to oldmax to x linear interpolation from newmin to newmax
shellOutput Will return the text output of running a given shell command.
sin Return the sine of x (measured in radians).
sinh Return the hyperbolic sine of x.
smoothmap Returns the value of a smooth remapping function.
smoothstep Returns the value of a smooth step function.
sqlength sqlength(a[, axis=(axis0, axis1, ...)]) –> numeric or Array
sqrt Return the square root of x.
subpackages Given a module object, returns an iterator which yields a tuple (modulename, moduleobject, ispkg)
sum sum(a[, start=0[, axis=(axis0, axis1, ...)]]) –> numeric or Array
tan Return the tangent of x (measured in radians).
tanh Return the hyperbolic tangent of x.
timer
toZip Sample for storing directory to a ZipFile
trunc Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.
uncapitalize preserveAcronymns enabled ensures that ‘NTSC’ does not become ‘nTSC’
unescape
rtype:string

Classes

Array A generic n-dimensional array class using nested lists for storage.
ArrayIter A general purpose iterator on Arrays.
Callable
Container
Enum Enumerated type
EnumDict This class provides a dictionary type for storing enumerations.
EnumValue A specific value of an enumerated type
EquivalencePairs A mapping object similar to a TwoWayDict, with the addition that indexing
Hashable
ItemsView
Iterable
Iterator
KeysView
LazyDocString Set the __doc__ of an object to an object of this class in order to have a docstring that is dynamically generated when used.
Mapping
MappingView
MatrixN A generic size MatrixN class, basically a 2 dimensional Array.
ModuleInterceptor This class is used to intercept an unset attribute of a module to perfrom a callback.
MutableMapping
MutableSequence
MutableSet
ProxyUnicode
RemovedKey
Sequence All the operations on a read-only sequence.
Set A set is a finite, iterable container.
Singleton Metaclass for Singleton classes.
Sized
TwoWayDict A dictionary that can also map in reverse: value to key.
ValuesView
VectorN A generic size VectorN class derived from Array, basically a 1 dimensional Array.
defaultdict defaultdict(default_factory) –> dict with default factory
defaultlist
deque deque(iterable[, maxlen]) –> deque object
metaReadOnlyAttr A metaclass to allow to define read-only class attributes, accessible either on the class or it’s instances and protected against re-write or re-definition.
metaStatic A static (immutable) Singleton metaclass to quickly build classes
path Represents a filesystem path.

Exceptions

EnumBadDefaultKeyError(val, key) Raised when a supplied default key for a value was not present
EnumBadKeyError(key) Raised when creating an Enum with non-string keys
EnumEmptyError Raised when attempting to create an empty enumeration
EnumException() Base class for all exceptions in this module
EnumImmutableError(*args) Raised when attempting to modify an Enum
LazyDocStringError

Previous topic

pymel.core.uitypes.Window

Next topic

pymel.util.LazyLoadModule

Core

Core Modules

Other Modules

This Page