Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Maya: fix yeti settings path in extractor #1809

Merged
merged 2 commits into from
Jul 14, 2021

Conversation

antirotor
Copy link
Member

Invalid variable pointing to file was set in representation in Yeti rig extractor in Maya.

@antirotor antirotor added type: bug Something isn't working host: Maya labels Jul 9, 2021
@antirotor antirotor requested a review from iLLiCiTiT July 9, 2021 10:54
@antirotor antirotor self-assigned this Jul 9, 2021
@iLLiCiTiT
Copy link
Member

Side question: it seems like settings_path file may not exist if instance.data does not contain "rigsettings" (lines 135-140). Is it ok?

Copy link
Member

@iLLiCiTiT iLLiCiTiT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@antirotor
Copy link
Member Author

antirotor commented Jul 12, 2021

Side question: it seems like settings_path file may not exist if instance.data does not contain "rigsettings" (lines 135-140). Is it ok?

Actually I am not sure about that code. I think it will always has rigsettnings - collector will add it here:

https://github.com/pypeclub/OpenPype/blob/a050f92e443f7b5db051a19db8d715e3baf80a1e/openpype/hosts/maya/plugins/publish/collect_yeti_rig.py#L42

but then, the code shouldn't return None if this is not found and so it should fail on assertion.

@iLLiCiTiT
Copy link
Member

Actually I am not sure about that code. I think it will always has rigsettnings - collector will add it here:

Well yes. But in the extractor is this:

# Get settings path (the file does not exists yet as far as I can tell from the code)
settings_path = os.path.join(dirname, "yeti.rigsettings")

# Get rig settings from instance
settings = instance.data.get("rigsettings", None)

# Check `"rigsettings" value
# - only if "rigsettings" key is available and value is not empty dictionary is `settings_path` file created
if settings:
    settings["imageSearchPath"] = image_search_path
    with open(settings_path, "w") as fp:
        json.dump(settings, fp, ensure_ascii=False)

# Continue expecting the file `settings_path` exists and going to publish the file as representation :)

@antirotor antirotor merged commit 828f6e9 into develop Jul 14, 2021
@mkolar mkolar deleted the bugfix/yeti-extractor-settings-path branch August 10, 2021 15:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Maya type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants