Skip to content

[HELP] library conflicts with official Python wheels in 3dsMax #4808

@rkoschmitzky

Description

@rkoschmitzky

@zachlewis This is the follow-up issue based on some initial request on the slack channel by @simonjokuschies.

Hi all, I am running into an issue importing the OpenImageIO python binding in 3DsMax. The python binding gets installed via UV directly from PyPi. Maybe someone can lead me into the right direction how to solve this.
3DsMax-2024 already ships with its own OpenImageIO.dll. When launching 3DsMax-2024 with a custom OpenImageIO (version 3.0.6.1 to be complete here, but the version itself should not matter I think...) and trying to import it I get the following error:

Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\Autodesk\3ds Max 2024\Python\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 148, in _import
return original_import(name, *args, **kwargs)
File "", line 8, in find
ImportError: DLL load failed while importing OpenImageIO: The specified procedure could not be found.

After some troubleshooting, it seems to me that the OpenImageIO.dll that ships with 3dsMax is the issue here, as it gets loaded first. I can confirm that when temporarily removing the OpenImageIO.dll that ships with 3dsMax, besides getting some warnings on launching 3dsMax, I can then actually import my custom OpenImageIO . However, altering the 3dsMax installation shouldn't be the way to move forward here, obviously. So to me, it seems pretty much when I am doing an import OpenImageIO it always loads the OpenImageIO.dll that has been loaded first, which is the one that ships with 3dsMax.
I have already tried os.add_dll_directory to point at the custom OpenImageIO installation and also all its sub folders, but that does not seem to do anything. Any thoughts how I could load 3DsMax with a custom OpenImageIO? (edited)

Based on the feedback in slack it feels like there is no easy workaround for us as we do not want to build OIIO ourselves. We also only have partial bootstrapping control over 3dsMax (We can not modify the environment upfront, but only after 3dsMax has been initialized).

The suggestion by @zachlewis was

Hmmm. Maybe we should start using a custom namespace for the official wheels... it certainly couldn't hurt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    build / testing / port / CIAffecting the build system, tests, platform support, porting, or continuous integration.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions