Skip to content

Conversation

robsgithub
Copy link

This updates the unzip logic in the installer to strip the leading "modules/"
prefix from extracted files, ensuring they're placed directly into
Documents/maya/modules/ as expected.

In some cases — possibly only when a 'modules/' folder already exists — the
installer was creating a nested path like modules/modules/simplex/, which Maya
does not scan by default.

A short video demonstrating the original issue:
https://www.youtube.com/watch?v=CIuHuzalAiE


Checklist

  • I have read the CONTRIBUTING.md document
  • I kept the change self-contained and avoided new dependencies
  • I formatted my changes with black
  • I linted my changes with flake8
  • I have added documentation where necessary
  • [x ] Existing behavior continues to work as expected
  • I manually tested the fix in Maya

Types of Changes

  • Bugfix (installation path fix)
  • New Feature
  • Documentation Update

Proposed Changes

This change adjusts the zip extraction behavior so that Simplex installs cleanly
into the expected Documents/maya/modules location without nesting module folders. I tested it in Maya 2024 in a scenario where no modules folder was present and where one was present.

…dy exists

This updates the unzip logic in the installer to strip the leading "modules/"
prefix from extracted files, ensuring they're placed directly into
Documents/maya/modules/ as expected.

The installer was creating a nested path like modules/modules/simplex/, which Maya does not scan by default.

Created a video to demonstrate the issue at:
https://www.youtube.com/watch?v=CIuHuzalAiE
@CLAassistant
Copy link

CLAassistant commented Jul 16, 2025

CLA assistant check
All committers have signed the CLA.

@tbttfox
Copy link
Member

tbttfox commented Aug 28, 2025

Hey, sorry it took so long to get to this. I don't check github as much as I should 😊
I really appreciate the PR! I don't use this installation method, so I'm not surprised that it got out of date.

Oh, I'll bet I know what happened. When I switched to meson, I probably started including a modules folder in the zip that I hadn't been before. Hmmm.

Just as rough test I changed zip_ref.extractall(mod_folder) to zip_ref.extractall(mod_folder.parent), and it seems to fix the issue you're having. Though technically that could put things into the parent maya folder... And by running this script you're already trusting that I won't do something evil. Though I could always end up accidentally doing something stupid instead 😁

Maybe this is a cleaner way? Unless I'm missing something your code is doing?

with zipfile.ZipFile(simplex_zip, "r") as zip_ref:
    members = [m for m in zip_ref.namelist() if m.startswith("modules/")]
    zip_ref.extractall(mod_folder.parent, members=members)

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

Successfully merging this pull request may close these issues.

3 participants