OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

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

Open LiborBatek opened this issue 3 years ago • 6 comments

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 avatar Sep 08 '22 13:09 LiborBatek

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

LiborBatek avatar Sep 08 '22 13:09 LiborBatek

@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.

BigRoy avatar Sep 08 '22 14:09 BigRoy

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

LiborBatek avatar Sep 09 '22 09:09 LiborBatek

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.

antirotor avatar Sep 12 '22 16:09 antirotor

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 avatar Sep 12 '22 17:09 BigRoy

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?

BigRoy avatar Sep 12 '22 17:09 BigRoy

@LiborBatek is this still happening?

antirotor avatar Jan 12 '23 12:01 antirotor

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

image

LiborBatek avatar Jan 12 '23 14:01 LiborBatek

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

antirotor avatar Jan 16 '23 10:01 antirotor