Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACES in Blender causes errors during .obj file import #117

Closed
MetalMantis opened this issue Jun 5, 2020 · 0 comments
Closed

ACES in Blender causes errors during .obj file import #117

MetalMantis opened this issue Jun 5, 2020 · 0 comments

Comments

@MetalMantis
Copy link

MetalMantis commented Jun 5, 2020

So far I have been using ACES in Blender for about 4 or 5 weeks. It has worked very well so far, aside from one problem (this has been a problem ever since I started using ACES, but hasn't really bothered me too much until now). Whenever I import a .obj file, it is usually accompanied by a .mtl file as well. If I delete the .mtl file, the model imports just fine. Interestingly, the only models this error occurs with are .obj models from Roblox Studio. When the model is accompanied by a .mtl file, it causes these errors:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_obj\__init__.py", line 146, in execute
    return import_obj.load(context, **keywords)
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_obj\import_obj.py", line 1244, in load
    use_image_search, float_func)
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_obj\import_obj.py", line 458, in create_materials
    context_material_name, img_data, line, 'D')
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_obj\import_obj.py", line 207, in load_material_image
    _generic_tex_set(mat_wrap.alpha_texture, image, 'UV', map_offset, map_scale)
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\addons\io_scene_obj\import_obj.py", line 178, in _generic_tex_set
    nodetex.image = image
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\modules\bpy_extras\node_shader_utils.py", line 36, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.83\scripts\modules\bpy_extras\node_shader_utils.py", line 702, in image_set
    image.colorspace_settings.name = self.colorspace_name
TypeError: bpy_struct: item.attr = val: enum "Non-Color" not found in ('aces', 'ACES - ACES2065-1', 'ACES - ACEScc', 'ACES - ACEScct', 'ACES - ACEScg', 'ACES - ACESproxy', 'acescc', 'acescc_ap1', 'acescct', 'acescct_ap1', 'acescg', 'acesproxy', 'acesproxy_ap1', 'adx10', 'adx16', 'canonlog2_cgamutday', 'canonlog2_cgamuttung', 'canonlog2_rec2020day', 'canonlog2_rec2020tung', 'canonlog3_cgamutday', 'canonlog3_cgamuttung', 'canonlog3_rec2020day', 'canonlog3_rec2020tung', 'canonlog_cgamutday', 'canonlog_cgamuttung', 'canonlog_dcip3day', 'canonlog_dcip3tung', 'canonlog_rec2020day', 'canonlog_rec2020tung', 'canonlog_rec709day', 'canonlog_rec709tung', 'crv_canonlog', 'crv_canonlog2', 'crv_canonlog3', 'crv_dolbypq1000nitsshaper', 'crv_dolbypq108nitsshaper', 'crv_dolbypq2000nitsshaper', 'crv_dolbypq4000nitsshaper', 'crv_dolbypq48nitsshaper', 'crv_dolbypq_10000', 'crv_lmtshaper', 'crv_log21000nitsshaper', 'crv_log2108nitsshaper', 'crv_log22000nitsshaper', 'crv_log24000nitsshaper', 'crv_log248nitsshaper', 'crv_logc3ei800', 'crv_protuneflat', 'crv_rec1886', 'crv_rec2020', 'crv_rec709', 'crv_rl3g10', 'crv_rlf', 'crv_slog1', 'crv_slog2', 'crv_slog3', 'crv_srgb', 'crv_vlog', 'dolbypq1000nitsshaper_ap1', 'dolbypq108nitsshaper_ap1', 'dolbypq2000nitsshaper_ap1', 'dolbypq4000nitsshaper_ap1', 'dolbypq48nitsshaper_ap1', 'g18_rec709', 'g22_rec709', 'Input - ADX - ADX10', 'Input - ADX - ADX16', 'Input - ARRI - Curve - V3 LogC (EI800)', 'Input - ARRI - Linear - ALEXA Wide Gamut', 'Input - ARRI - V3 LogC (EI1000) - Wide Gamut', 'Input - ARRI - V3 LogC (EI1280) - Wide Gamut', 'Input - ARRI - V3 LogC (EI160) - Wide Gamut', 'Input - ARRI - V3 LogC (EI1600) - Wide Gamut', 'Input - ARRI - V3 LogC (EI200) - Wide Gamut', 'Input - ARRI - V3 LogC (EI2000) - Wide Gamut', 'Input - ARRI - V3 LogC (EI250) - Wide Gamut', 'Input - ARRI - V3 LogC (EI2560) - Wide Gamut', 'Input - ARRI - V3 LogC (EI320) - Wide Gamut', 'Input - ARRI - V3 LogC (EI3200) - Wide Gamut', 'Input - ARRI - V3 LogC (EI400) - Wide Gamut', 'Input - ARRI - V3 LogC (EI500) - Wide Gamut', 'Input - ARRI - V3 LogC (EI640) - Wide Gamut', 'Input - ARRI - V3 LogC (EI800) - Wide Gamut', 'Input - Canon - Canon-Log - Cinema Gamut Daylight', 'Input - Canon - Canon-Log - Cinema Gamut Tungsten', 'Input - Canon - Canon-Log - DCI-P3 Daylight', 'Input - Canon - Canon-Log - DCI-P3 Tungsten', 'Input - Canon - Canon-Log - Rec. 2020 Daylight', 'Input - Canon - Canon-Log - Rec. 2020 Tungsten', 'Input - Canon - Canon-Log - Rec. 709 Daylight', 'Input - Canon - Canon-Log - Rec. 709 Tungsten', 'Input - Canon - Canon-Log2 - Cinema Gamut Daylight', 'Input - Canon - Canon-Log2 - Cinema Gamut Tungsten', 'Input - Canon - Canon-Log2 - Rec. 2020 Daylight', 'Input - Canon - Canon-Log2 - Rec. 2020 Tungsten', 'Input - Canon - Canon-Log3 - Cinema Gamut Daylight', 'Input - Canon - Canon-Log3 - Cinema Gamut Tungsten', 'Input - Canon - Canon-Log3 - Rec. 2020 Daylight', 'Input - Canon - Canon-Log3 - Rec. 2020 Tungsten', 'Input - Canon - Curve - Canon-Log', 'Input - Canon - Curve - Canon-Log2', 'Input - Canon - Curve - Canon-Log3', 'Input - Canon - Linear - Canon Cinema Gamut Daylight', 'Input - Canon - Linear - Canon Cinema Gamut Tungsten', 'Input - Canon - Linear - Canon DCI-P3 Daylight', 'Input - Canon - Linear - Canon DCI-P3 Tungsten', 'Input - Canon - Linear - Canon Rec. 2020 Daylight', 'Input - Canon - Linear - Canon Rec. 2020 Tungsten', 'Input - Canon - Linear - Canon Rec. 709 Daylight', 'Input - Canon - Linear - Canon Rec. 709 Tungsten', 'Input - Generic - sRGB - Texture', 'Input - GoPro - Curve - Protune Flat', 'Input - GoPro - Linear - Protune Native - Experimental', 'Input - GoPro - Protune Flat - Protune Native - Experimental', 'Input - Panasonic - Curve - V-Log', 'Input - Panasonic - Linear - V-Gamut', 'Input - Panasonic - V-Log - V-Gamut', 'Input - RED - Curve - REDLog3G10', 'Input - RED - Curve - REDlogFilm', 'Input - RED - Linear - DRAGONcolor', 'Input - RED - Linear - DRAGONcolor2', 'Input - RED - Linear - REDcolor', 'Input - RED - Linear - REDcolor2', 'Input - RED - Linear - REDcolor3', 'Input - RED - Linear - REDcolor4', 'Input - RED - Linear - REDWideGamutRGB', 'Input - RED - REDLog3G10 - REDWideGamutRGB', 'Input - RED - REDlogFilm - DRAGONcolor', 'Input - RED - REDlogFilm - DRAGONcolor2', 'Input - RED - REDlogFilm - REDcolor', 'Input - RED - REDlogFilm - REDcolor2', 'Input - RED - REDlogFilm - REDcolor3', 'Input - RED - REDlogFilm - REDcolor4', 'Input - Sony - Curve - S-Log1', 'Input - Sony - Curve - S-Log2', 'Input - Sony - Curve - S-Log3', 'Input - Sony - Linear - S-Gamut', 'Input - Sony - Linear - S-Gamut Daylight', 'Input - Sony - Linear - S-Gamut Tungsten', 'Input - Sony - Linear - S-Gamut3', 'Input - Sony - Linear - S-Gamut3.Cine', 'Input - Sony - Linear - Venice S-Gamut3', 'Input - Sony - Linear - Venice S-Gamut3.Cine', 'Input - Sony - S-Log1 - S-Gamut', 'Input - Sony - S-Log2 - S-Gamut', 'Input - Sony - S-Log2 - S-Gamut Daylight', 'Input - Sony - S-Log2 - S-Gamut Tungsten', 'Input - Sony - S-Log3 - S-Gamut3', 'Input - Sony - S-Log3 - S-Gamut3.Cine', 'Input - Sony - S-Log3 - Venice S-Gamut3', 'Input - Sony - S-Log3 - Venice S-Gamut3.Cine', 'lin_adobergb', 'lin_adobewidegamutrgb', 'lin_alexawide', 'lin_ap0', 'lin_ap1', 'lin_canoncgamutday', 'lin_canoncgamuttung', 'lin_canondcip3day', 'lin_canondcip3tung', 'lin_canonrec2020day', 'lin_canonrec2020tung', 'lin_canonrec709day', 'lin_canonrec709tung', 'lin_dgn', 'lin_dgn2', 'lin_p3d60', 'lin_p3d65', 'lin_p3dci', 'lin_prophoto', 'lin_protunegamutexp', 'lin_rc', 'lin_rc2', 'lin_rc3', 'lin_rc4', 'lin_rec2020', 'lin_rec709', 'lin_rimm', 'lin_rwg', 'lin_sgamut', 'lin_sgamut3', 'lin_sgamut3cine', 'lin_sgamutday', 'lin_sgamuttung', 'lin_srgb', 'lin_venice_sgamut3', 'lin_venice_sgamut3cine', 'lin_vgamut', 'lin_xyz_d60', 'log21000nitsshaper_ap1', 'log2108nitsshaper_ap1', 'log22000nitsshaper_ap1', 'log24000nitsshaper_ap1', 'log248nitsshaper_ap1', 'logc3ei1000_alexawide', 'logc3ei1280_alexawide', 'logc3ei1600_alexawide', 'logc3ei160_alexawide', 'logc3ei2000_alexawide', 'logc3ei200_alexawide', 'logc3ei250_alexawide', 'logc3ei2560_alexawide', 'logc3ei3200_alexawide', 'logc3ei320_alexawide', 'logc3ei400_alexawide', 'logc3ei500_alexawide', 'logc3ei640_alexawide', 'logc3ei800_alexawide', 'look_aces10to01emulation', 'look_aces10to02emulation', 'look_aces10to07emulation', 'look_bluelightartifactfix', 'out_dcdm', 'out_dcdmp3d60limited', 'out_dcdmp3d65limited', 'out_p3d60', 'out_p3d65', 'out_p3d65d60simulation', 'out_p3d65rec709limited', 'out_p3d65st20841000nits', 'out_p3d65st2084108nits', 'out_p3d65st20842000nits', 'out_p3d65st20844000nits', 'out_p3dcid60simulation', 'out_p3dcid65simulation', 'out_rec2020', 'out_rec2020hlg1000nits', 'out_rec2020p3d65limited', 'out_rec2020rec709limited', 'out_rec2020st20841000nits', 'out_rec2020st20842000nits', 'out_rec2020st20844000nits', 'out_rec709', 'out_rec709d60sim', 'out_srgb', 'out_srgbd60sim', 'Output - DCDM', 'Output - DCDM (P3D60 Limited)', 'Output - DCDM (P3D65 Limited)', 'Output - P3-D60', 'Output - P3-D65 ST2084 (1000 nits)', 'Output - P3-D65 ST2084 (2000 nits)', 'Output - P3-D65 ST2084 (4000 nits)', 'Output - P3-DCI (D60 simulation)', 'Output - P3-DCI (D65 simulation)', 'Output - P3D65', 'Output - P3D65 (D60 simulation)', 'Output - P3D65 (Rec.709 Limited)', 'Output - P3D65 ST2084 (108 nits)', 'Output - Rec.2020', 'Output - Rec.2020 (P3D65 Limited)', 'Output - Rec.2020 (Rec.709 Limited)', 'Output - Rec.2020 HLG (1000 nits)', 'Output - Rec.2020 ST2084 (1000 nits)', 'Output - Rec.2020 ST2084 (2000 nits)', 'Output - Rec.2020 ST2084 (4000 nits)', 'Output - Rec.709', 'Output - Rec.709 (D60 sim.)', 'Output - sRGB', 'Output - sRGB (D60 sim.)', 'protuneflat_protunegamutexp', 'raw', 'rec2020_camera', 'rec2020_display', 'rec709_camera', 'rec709_display', 'rl3g10_rwg', 'rlf_dgn', 'rlf_dgn2', 'rlf_rc', 'rlf_rc2', 'rlf_rc3', 'rlf_rc4', 'Role - color_picking', 'Role - color_timing', 'Role - compositing_linear', 'Role - compositing_log', 'Role - data', 'Role - default', 'Role - matte_paint', 'Role - reference', 'Role - rendering', 'Role - scene_linear', 'Role - texture_paint', 'role_color_picking', 'role_color_timing', 'role_compositing_linear', 'role_compositing_log', 'role_data', 'role_default', 'role_matte_paint', 'role_reference', 'role_rendering', 'role_scene_linear', 'role_texture_paint', 'slog1_sgamut', 'slog2_sgamut', 'slog2_sgamutday', 'slog2_sgamuttung', 'slog3_sgamut3', 'slog3_sgamutcine', 'slog3_venice_sgamut3', 'slog3_venice_sgamutcine', 'srgb_texture', 'Utility - Curve - Rec.1886', 'Utility - Curve - Rec.2020', 'Utility - Curve - Rec.709', 'Utility - Curve - sRGB', 'Utility - Dolby PQ 1000 nits Shaper', 'Utility - Dolby PQ 1000 nits Shaper - AP1', 'Utility - Dolby PQ 10000', 'Utility - Dolby PQ 108 nits Shaper', 'Utility - Dolby PQ 108 nits Shaper - AP1', 'Utility - Dolby PQ 2000 nits Shaper', 'Utility - Dolby PQ 2000 nits Shaper - AP1', 'Utility - Dolby PQ 4000 nits Shaper', 'Utility - Dolby PQ 4000 nits Shaper - AP1', 'Utility - Dolby PQ 48 nits Shaper', 'Utility - Dolby PQ 48 nits Shaper - AP1', 'Utility - Gamma 1.8 - Rec.709 - Texture', 'Utility - Gamma 2.2 - Rec.709 - Texture', 'Utility - Linear - Adobe RGB', 'Utility - Linear - Adobe Wide Gamut RGB', 'Utility - Linear - P3-D60', 'Utility - Linear - P3-D65', 'Utility - Linear - P3-DCI', 'Utility - Linear - Rec.2020', 'Utility - Linear - Rec.709', 'Utility - Linear - RIMM ROMM (ProPhoto)', 'Utility - Linear - sRGB', 'Utility - LMT Shaper', 'Utility - Log2 1000 nits Shaper', 'Utility - Log2 1000 nits Shaper - AP1', 'Utility - Log2 108 nits Shaper', 'Utility - Log2 108 nits Shaper - AP1', 'Utility - Log2 2000 nits Shaper', 'Utility - Log2 2000 nits Shaper - AP1', 'Utility - Log2 4000 nits Shaper', 'Utility - Log2 4000 nits Shaper - AP1', 'Utility - Log2 48 nits Shaper', 'Utility - Log2 48 nits Shaper - AP1', 'Utility - Look - ACES 1.0 to 0.1 emulation', 'Utility - Look - ACES 1.0 to 0.2 emulation', 'Utility - Look - ACES 1.0 to 0.7 emulation', 'Utility - Look - Blue Light Artifact Fix', 'Utility - Raw', 'Utility - Rec.2020 - Camera', 'Utility - Rec.2020 - Display', 'Utility - Rec.709 - Camera', 'Utility - Rec.709 - Display', 'Utility - sRGB - Texture', 'Utility - XYZ - D60', 'vlog_vgamut')

location: <unknown location>:-1

The error prevents the obj (even the vertices) from being imported at all. However, if I delete the .obj's .mtl file, the model imports. (Albeit without textures) If I take a different model, one from somewhere else besides Roblox, the model imports just fine with the .mtl file, and textures are applied. I think what is happening is that the .mtl file (which I know for a fact from importing them before I used ACES contains an alpha texture) is attempting to apply a texture (presumably the alpha texture) with the "non-color" profile, which ACES does not contain. This prevents Blender from creating materials, which it apparently does before importing vertices. From this, I can infer that the other .obj files I have imported do not contain alpha textures. (The alpha textures in the Roblox models are extremely annoying, because (before I used ACES) I would have to remove the alpha texture every single time I imported avatar models, as the alpha textures made the entire avatar slightly transparent; I have no clue why Roblox even puts them into the file, as they aren't used in Roblox Studio). Hoping to remove the alpha texture from the .mtl file, I decided to open it up in Notepad. Thankfully, it was not a bunch of gibberish like I was afraid of, though it was much smaller than I thought it would be. These are the contents of the .mtl file:

newmtl Toshyyyy1Mtl
Material Color
Ka 1 1 1
Kd 1 1 1
Ks 0.0627451 0.0627451 0.0627451 

d 1

Ns 0

map_Ka Toshyyyy1Tex.png
map_Kd Toshyyyy1Tex.png
map_d Toshyyyy1Tex.png

Toshyyyy1Tex.png is an image file automatically generated whenever saving the avatar in Roblox Studio. At first, I could not figure which of the 'map' lines corresponded to the alpha texture, but after looking at the segment of the error report

    context_material_name, img_data, line, 'D')

I figured out that map_d Toshyyyy1Tex was the "alpha" line. I deleted the line, saved the .mtl file, and was then able to import the model with the modified .mtl file successfully with textures. I got the job done, but I realized that it would be a problem next time I imported a .obj file with an alpha texture. How can I prevent this from happening in the future so that I don't have to manually change the .mtl file every time I want to import a model that contains an alpha texture? Thank you for all of your hard work. ACES makes my renders look SO much better. Have a great day!

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

No branches or pull requests

1 participant