Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add special handling for "undo" arguments #419

Open
pmolodo opened this issue Jan 2, 2019 · 0 comments
Open

Add special handling for "undo" arguments #419

pmolodo opened this issue Jan 2, 2019 · 0 comments

Comments

@pmolodo
Copy link
Contributor

pmolodo commented Jan 2, 2019

Currently, api method arguments are classified as either "in" or "out"* (via "direction"). However, some arguments - ie, MAnimCurveChange / MDgModifier / MDagModifier args - aren't really either in or out, but are just used to record undo information. We currently have special handling for MAnimCurveChange, but we do it through a lot of special case checks. Would like to genericize this work, and use it to also handle MDgModifier and MDagModifier args.

One way to do this would be to mark these args' direction as "undo" (and not "in" or "out"), and this would trigger special handling. If we go this route, would like to not write this into the api cache itself, but automatically applied by by some sort of getter or processing function. (Eventually, would like a class to handle all cache queries, to provide a centralized place for this sort of processing. For instance, factories._getApiOverrideNameAndData would go there). This way, we'd have an untainted "record" of what the maya docs said the arg type was.

Would also like to be able to handle args of these three types that don't have a default value - right now, because they're not in factories.ApiTypeRegister, the wrapping mechanisms assume they don't know how to handle them, and so will only wrap these funcs if they provide a default. Would like to address this by adding them to ApiTypeRegister somehow, but may end up being easier to special-case "undo" arg types.

*Technically, there are some that are also in/out, but I think we currently ignore those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant