ynput / OpenPype

OpenPype has been surpassed by AYON and is now read only.
https://ayon.ynput.io
MIT License
286 stars 129 forks source link

Maya: Extractor "Look" fails on maketx utility for image texture conversion (Png>tx) / or missing OCIO.config problem?! #3814

Closed LiborBatek closed 1 year ago

LiborBatek commented 2 years ago

Unable to publish asset look because of crash during image texture conversion from PNG to tx format using maketx utility.

image

Instance: 
lookMain
Message: 
Command 'D:\REPO\OpenPype\vendor\bin\oiio\windows\maketx.exe -v -u --unpremult --checknan --oiio --filter lanczos3 D:\PROJECTS\OP01_CG_demo\assets\props\airConditionerB\work\lookdev\textures\ac_DefaultMaterial_Roughness.1001.png --sattrib sourceHash ac_DefaultMaterial_Roughness,1001,png|1652796456,0|325183|maketx  --colorconfig D:\REPO\OpenPype\vendor\bin\ocioconfig\OpenColorIOConfigs\nuke-default\config.ocio -o C:\Users\Libor\AppData\Local\Temp\pyblish_tmp_w4v7_ip1\resources\ac_DefaultMaterial_Roughness.1001.tx' returned non-zero exit status 1.
Line: 
512
Traceback: 
Traceback (most recent call last):
  File "D:\REPO\OpenPype\.venv\lib\site-packages\pyblish\plugin.py", line 522, in __explicit_process
    runner(*args)
  File "D:\REPO\OpenPype\openpype\hosts\maya\plugins\publish\extract_look.py", line 252, in process
  File "D:\REPO\OpenPype\openpype\hosts\maya\plugins\publish\extract_look.py", line 389, in process_resources
  File "D:\REPO\OpenPype\openpype\hosts\maya\plugins\publish\extract_look.py", line 549, in _process_texture
  File "D:\REPO\OpenPype\openpype\hosts\maya\plugins\publish\extract_look.py", line 121, in maketx
  File "C:\Program Files\Autodesk\Maya2022\Python37\lib\subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "C:\Program Files\Autodesk\Maya2022\Python37\lib\subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'D:\REPO\OpenPype\vendor\bin\oiio\windows\maketx.exe -v -u --unpremult --checknan --oiio --filter lanczos3 D:\PROJECTS\OP01_CG_demo\assets\props\airConditionerB\work\lookdev\textures\ac_DefaultMaterial_Roughness.1001.png --sattrib sourceHash ac_DefaultMaterial_Roughness,1001,png|1652796456,0|325183|maketx  --colorconfig D:\REPO\OpenPype\vendor\bin\ocioconfig\OpenColorIOConfigs\nuke-default\config.ocio -o C:\Users\Libor\AppData\Local\Temp\pyblish_tmp_w4v7_ip1\resources\ac_DefaultMaterial_Roughness.1001.tx' returned non-zero exit status 1.

[cuID:OP-3944]

LiborBatek commented 2 years ago

also attaching image file which caused it... ac_DefaultMaterial_Roughness 1001

BigRoy commented 2 years ago

@LiborBatek This would be better to debug if the subprocess output would be logged as well.

Could you change this logic to something like this:

    except subprocess.CalledProcessError as exc:
        # Log subprocess output
        self.log.error(exc.output)

        # Log exception
        self.log.error(traceback.format_exc())
        raise

    return out

And then try again?

The subprocess.CalledProcessError.output should be the console output produced by the subprocess in the case of an exception. Likely maketx will have logged more useful information there and can help us pinpoint the issue.

LiborBatek commented 2 years ago

@BigRoy thx I invited guys to look on that ...I m just not able to do it myself being just poor cg artist :)

antirotor commented 2 years ago

This is caused by "missing OCIO config" error in maketx. Strange as it happens only to specific files in specific scenarios (and with OCIO config present). I'll add more details.

BigRoy commented 2 years ago

Could it be that the subprocess paths passed along don't get the backslashes or spaces in paths escaped correctly? So that only some OCIO paths might be invalid? We could try enforcing forward slashes?

@LiborBatek @antirotor Would this branch work?

Here's a diff without opening a PR directly.

BigRoy commented 2 years ago

Also that vendorized OCIO config being present would only be there if one would have correctly pulled the latest binaries and rebuild environment, etc. along with the recent refactoring instead of only checking out this branch. That could've also been the problem?

antirotor commented 1 year ago

@LiborBatek is this still happening?

LiborBatek commented 1 year ago

@antirotor did test it in latest develop and works normally without any glitch!

image

antirotor commented 1 year ago

@antirotor did test it in latest develop and works normally without any glit