-
Notifications
You must be signed in to change notification settings - Fork 127
Maya: Refactor Maya API #1306
Comments
I would add to this that during that refactor, we should cleanup legacy code and switch to better handling of render setup. It seems we are hitting legacy api limits. |
To make it faster to collect render layers, maybe look at not relaying on switching layers and query the attributes instead; https://gist.github.com/davidlatwe/e33b942967f18f4b61f085e3effe86c7#file-rendersetup_util-py-L67 |
Has this been resolved since? :) Or are there still major pain points to be refactored? If so, it would be good to have a Task list here of bullet points to address. |
@iLLiCiTiT getting back to my previous comment
Should we close this? |
This is on @antirotor :) |
@antirotor please confirm what you'd like to do with this. |
My idea was to split it into more files to make it more managable even if they will at the end link back to the lib. The file is huge with mixed functions to work with attributes, alembic, transforms, menu, colorspaces, xgen, render layers and even though the functions there are mostly documented with docstrings, it is difficult to add/use something from there without spending time deciphering what's there. And it would be easier to add unit and functional tests. |
My main issue with the lib is that unless you know what is available, you end up writing duplicate code while developing, then trying to refactor to use the lib code. Not sure whether that is a valid way to work, but would assume being able to utilize the lib while developing would be faster than refactor afterwards. |
That is actually why I've created this issue. I think that splitting it into clearly defined pieces will help a bit - for example: you need to use function that will query something in render layers, first you look into |
I actually don't think we'll get benefit in that at all. For what it's worth I've maybe had a 5% success rate going into
I think if we end up separating to files we better start defining what ends up in which file. I can definitely see value in separating out clear pieces related to a specific functionality, for example this "lookdev" region in There's definitely worth in cleaning this up, but I don't expect it'll provide that much clarity on knowing what's there in the codebase without doing a small hunt yourself unless there's documentation for a dev to go through. |
That's because now it is all over the place. I think the clearest and most "pythonic" way would be to move things related to specific workflows to separate files - like what you've mentioned with looks. |
Let's give it a go. Anyone up for taking this on? Who eats refactors for breakfast? |
Problem
Maya integration is complex. Main problem with it is that right now most of the code is in one file
hosts/maya/api/lib.py
. This file is ~2700 lines of code long and including function from looks management to generic dialog popup functions. This should be split into modulelib/__init__.py
with different packages grouping specific functionality. This way it will be more maintainable and testable.[cuID:OP-1186]
The text was updated successfully, but these errors were encountered: