mottosso / cmdx

Fast and persistent subset of maya.cmds
https://mottosso.com/cmdx
BSD 2-Clause "Simplified" License
193 stars 36 forks source link

DGContext uses Seconds by default, added UiUnits for each unit type #25

Closed monkeez closed 4 years ago

monkeez commented 4 years ago
mottosso commented 4 years ago

Neat, but why does the context need a unit? :O

monkeez commented 4 years ago

In case you want to evaluate in a time unit other than seconds. Should I rename the argument to timeUnit?

Or I could remove it and you'd just have to pass the time in the unit you want like in the second example:

with​ ​cmdx​.​DGContext​(​cmdx​.​Minutes​(​1​)):
    ​pass
mottosso commented 4 years ago

Ah, yes of course. That makes sense.

with cmdx.DGContext(1, cmdx.Minutes):
    pass

I think this reads the most clear.

Renamed UiUnit() to TimeUiUnit() for consistency

Better add an alias UiUnit = TimeUiUnit to not break existing code.

Other than that, I think this looks good!

mottosso commented 4 years ago

The other syntax, DGContext(cmdx.Minutes(1)) also works it looks like? I think that would be great as well, in case the value is being passed from some other function or is already an MTime.

monkeez commented 4 years ago

That's correct, DGContext(cmdx.Minutes(1)) should already work.

UiUnit alias added.

mottosso commented 4 years ago

Loving it.

Can I hand you permissions to merge and make releases for cmdx? It's a little tedious, but it'd help me out a lot. This time around, it would involve:

  1. Incrementing the version, based on https://semver.org/ so a patch version should do
  2. Drafting a release here, and more or less copy/paste what you've already summarised in this PR, good job. The goal is being able to flick through the releases and understand what's been added and changed, bearing in mind that we must never break backwards compatibility. Ever. Unless we increment the major version.
  3. Done

A release will be made to PyPI automatically from there.

mottosso commented 4 years ago

Gotta run, but you can go ahead when ready. If not, no worries and I'll return to this later today.

monkeez commented 4 years ago

Awesome, thanks. I'll take a look at this later today (Sydney time 😄). I might have some more questions about doing a release.

monkeez commented 4 years ago

@mottosso do you still want me to do a release or should we wait for #24?

mottosso commented 4 years ago

Let's make a release for every PR, keeps it bite-sized and without doubt about when to make releases. Please go ahead! :)

mottosso commented 4 years ago

https://github.com/mottosso/cmdx/releases/tag/0.4.7

Great job. :)