pymel.utilΒΆ

General utilities which are pymel-independent.”

Functions

LazyLoadModule
param name:name of the module
abs abs(number) -> number
acos acos(x)
acosh acosh(x)
addLazyDocString helper for LazyDocString. Equivalent to :
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 asin(x)
asinh asinh(x)
atan atan(x)
atan2 atan2(y, x)
atanh atanh(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 ceil(x)
clamp Clamps the value x between min and max
clsname
conjugate the conjugate part of x
convertListArgs
copysign copysign(x,y)
cos cos(x)
cosh cosh(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 degrees(x) -> converts angle x from radians to degrees
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 exp(x)
expandArgs ‘Flattens’ the arguments list: recursively replaces any iterable argument in *args by a tuple of its
fabs fabs(x)
factorial factorial(x) -> Integral
floor floor(x)
fmod fmod(x,y)
frexp frexp(x)
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 hypot(x,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 isinf(x) -> bool
isnan isnan(x) -> bool
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 ldexp(x, i) -> x * (2**i)
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 log(x[, base]) -> the logarithm of x to the given base.
log10 log10(x) -> the base 10 logarithm of x.
log1p log1p(x)
makeMethod
max max(iterable[, key=func[, axis=(axis0, axis1, ...)]]) –> value
mergeCascadingDicts recursively update to_dict with values from from_dict. if allowDictToListMerging is
min min(iterable[, key=func[, axis=(axis0, axis1, ...)]]) –> value
modf modf(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 pow(x,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 radians(x) -> converts angle x from degrees to radians
readonly Marks a class member as protected, allowing metaProtected to prevent re-assignation on the classes it generates
real the real part of x
reorder Reorder a list based upon a list of positional indices and/or a dictionary of fromIndex:toIndex.
round round(number[, ndigits]) -> float
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 sin(x)
sinh sinh(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 sqrt(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 tan(x)
tanh tanh(x)
timer
toZip Sample for storing directory to a ZipFile
trunc trunc(x:Real) -> Integral
uncapitalize preserveAcronymns enabled ensures that ‘NTSC’ does not become ‘nTSC’
unescape
rtype:string

Classes

And
AndOrAbstract
Array A generic n-dimensional array class using nested lists for storage.
ArrayIter A general purpose iterator on Arrays.
Callable
Condition Used to chain together objects for conditional testing.
Container
Enum Enumerated type
EnumValue A specific value of an enumerated type
EquivalencePairs A mapping object similar to a TwoWayDict, with the addition that indexing
Hashable
Inverse
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
Or
ProxyUnicode
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.
universalmethod

Exceptions

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