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

Maya: Look Manager Cross Project Compatibility #2481

Open
tokejepsen opened this issue Jan 4, 2022 · 3 comments
Open

Maya: Look Manager Cross Project Compatibility #2481

tokejepsen opened this issue Jan 4, 2022 · 3 comments
Labels
host: Maya type: feature Larger, user affecting changes and completely new things

Comments

@tokejepsen
Copy link
Member

tokejepsen commented Jan 4, 2022

Is your feature request related to a problem? Please describe.
You cannot load a look from a Library project.

Describe the solution you'd like
Enable the Look Manager to load looks from other projects than the current one.

[cuID:OP-2286]

@BigRoy
Copy link
Collaborator

BigRoy commented Jan 5, 2022

The main logic the Look Manager uses to "find" related looks are based soley on asset id to list the available looks.
In commands it triggers lib.list_looks with lib.list_looks() defined here.

The harder part is knowing whether solely an asset id is actually from within the current project or not. This would require more data to be passed around. Which might only be ever possible for geometry that is NOT imported from the library but remains loaded inside a container. So I wouldn't assume it would work automatically for all cases.

For the assignments themselves all that should be really necessary is assign_look_by_version to understand it should query inside the other project.

Be aware that the Look Assigner does also query the latest version based on solely the subset name in the list

I don't know much about the logic of the Library Loader so I'm keen to hearing about what would be logical code-wise.


The easiest fix might be to add a dropdown to the Maya Look Assigner - similar to the Library Loader. Which defaults to "" but allows you to look for looks inside of the Library (instead of guessing based on what geometry is selected).

This would require a self.dbcon to exist on the mayalookassigner UI similar to how the Library Loader does it.. Then all that would be needed is replacing the any calls to avalon.io.* to self.dbcon.*. And in the lib for list_looks and assign_look_by_version we could allow an extra argument to be passed along for dbcon like:

def list_looks(asset_id, dbcon=None):
    """Return all look subsets for the given asset
    This assumes all look subsets start with "look*" in their names.
    """

    if dbcon is None:
        dbcon = avalon.io

    # # get all subsets with look leading in
    # the name associated with the asset
    subset = dbcon.find({"parent": bson.ObjectId(asset_id),
                         "type": "subset",
                         "name": {"$regex": "look*"}})

    return list(subset)

Then if you'd want to automate slightly more for the user to find the right project to search in you could add an extra button next to the project dropdown that basically gets the containers from the selected nodes in your scene, and sets that particular project.

@antirotor antirotor added host: Maya type: feature Larger, user affecting changes and completely new things labels Jan 12, 2022
@mkolar
Copy link
Member

mkolar commented Jun 7, 2022

This is quite closely related to this discussion #1559

@BigRoy
Copy link
Collaborator

BigRoy commented Jun 8, 2022

There's relatively little activity on this issue. However, if there's anyone in dire need of this feature for an upcoming production I'd be happy to take a look at implementing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Maya type: feature Larger, user affecting changes and completely new things
Projects
None yet
Development

No branches or pull requests

4 participants