Skip to content

Releases: Muream/maya-stubs

v0.4.2a

15 Sep 15:50
Compare
Choose a tag to compare
v0.4.2a Pre-release
Pre-release

This release splits the cmds functions into individual file to make it easier on text editors and LSPs

v0.4.0

01 Oct 22:48
Compare
Choose a tag to compare

This release includes a lot of improvements to the stubs quality, courtesy of @arvidfm

Python command stubs

  • Positional arguments of commands now have default values of ...
  • query and/or edit flags are now included for commands detected as queryable and/or editable based on the description
    • In query mode, any queryable argument takes a bool unless explicitly specified to only take a value in query mode as well, so these flags are now type hinted as X | bool
    • The return type of queryable commands is now a union of the original return type as well as all queryable types
  • Commands whose synopsys defines multiple return types are expressed as type unions
  • Flags marked as multiuse are now type hinted as X | List[X]
  • Improved MEL to Python type conversion
  • The maya.cmds stub now includes various type aliases to make the function signatures a bit easier to read, e.g. Queryable[str] for str | bool and Range[float] for Tuple[float] | Tuple[float, float]

Python API stubs

  • Literals are now only printed to the stub files if they are simple literals that can actually be represented in Python, e.g. numbers, strings and empty lists/dicts, avoiding syntax errors from sequences like <property object at 0x7fc18a818400> in the stubs
  • The parser now keeps track of the fully qualified path of symbols imported from other modules, so e.g. MFnBase will be referenced as maya.OpenMaya.MFnBase when used in OpenMayaUI
  • The parser now attempt to guess the types of descriptor class members (property and getset_descriptor attributes) by instantiating the class and retrieving the member via the instance
  • The parser also tries to guess the type of parameters using the default value imported by inspect.signature
  • Members imported from other modules are no longer included
  • @staticmethod and @classmethod decorators are now detected and included in the stubs
  • Module-level global variables are now included in the stubs
  • Add special cases for init and cls so that the former always returns None, and the latter always has a cls argument

Other various changes

  • Stubs are now also generated for the top-level maya package in maya.__init__.pyi
  • __init__.pyi files are now included in all directories so that type checkers correctly detect them as Python packages
  • Any use of Callable is now type hinted as Callable[..., Any] to prevent type checkers for complaining about missing type parameters

v0.3.1

01 Feb 00:41
Compare
Choose a tag to compare

Switch to Docspec + Jinja to generate the stubs

  • maya.cmds stubs are substantially better than before though still contain some inaccuracies
  • stubs for the plugins invertShape.mll and poseInterpolator.mll are included (though they are bare bones)
  • Stubs for Open Maya 1.0 and 2.0 are likely worse than before

v0.3.0-alpha.1

06 Nov 21:16
Compare
Choose a tag to compare
v0.3.0-alpha.1 Pre-release
Pre-release

Pre release of the docspec / jinja2 refactor

The stubs for maya.cmds should be substantially more accurate with return types parsed from the HTML docs and the flags being (for now) all optional

However, the stubs for Open Maya 1.0 and 2.0 are most likely worse and still a work in progress.

v0.2.0

01 Jun 18:23
Compare
Choose a tag to compare

Added degraded stubs for all OpenMaya 1 and 2 members
Open Maya 2 also has docstrings included.

v0.1.2

31 May 21:33
Compare
Choose a tag to compare

Support python 2 and 3.

The stubs haven't change, this is a version bump to match pypi's release

v0.1.1

31 May 21:16
Compare
Choose a tag to compare
  • Added support for implicit first arguments of all commands documented with cmds.help

v0.1.0

31 May 10:12
Compare
Choose a tag to compare

This first release contains incomplete stubs for all maya.cmds commands

  • ✅ All commands are included.
  • ✅ Most commands have accurate argument signatures.
  • ❌ The implicit first argument is missing for all commands that use it.
  • ❌ All functions return Any