TypeError while trying to import wrl file #85269

Open
opened 2021-02-01 10:07:39 +01:00 by Jungjin Park · 7 comments

System Information
Not Relevant

Blender Version
Broken: 2.90, 2.91.2, 2.83(LTS); haven't tried other versions

Short description of error
Receiving TypeError while importing a wrl file that was exported from an engineering software. The file loads fine when I try to open it on freeWRL Launcher 4.0. Other wrl files randomly found online load fine on Blender.

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\__init__.py", line 78, in execute
    return import_x3d.load(context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 3639, in load
    global_matrix=global_matrix,
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 3535, in load_web3d
    importShape(bpycollection, node, ancestry, global_matrix)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 3141, in importShape
    is_vcol)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2968, in importShape_LoadAppearance
    (bpymat, bpyima, tex_has_alpha) = appearance_Create(vrmlname, material, tex_node, ancestry, node, is_vcol)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2876, in appearance_Create
    bpyima = appearance_LoadTexture(tex_node, ancestry, node)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2821, in appearance_LoadTexture
    bpyima = appearance_LoadPixelTexture(tex_node, ancestry)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2991, in appearance_LoadPixelTexture
    bpyima = bpy.data.images.new("PixelTexture", w, h, has_alpha, True)
TypeError: BlendDataImages.new(): required parameter "alpha" to be a keyword argument!

location: <unknown location>:-1

Exact steps for others to reproduce the error
File>Import>X3D Extensible>attached_file

smallertest.wrl

Thanks!

**System Information** Not Relevant **Blender Version** Broken: 2.90, 2.91.2, 2.83(LTS); haven't tried other versions **Short description of error** Receiving TypeError while importing a wrl file that was exported from an engineering software. The file loads fine when I try to open it on *freeWRL Launcher 4.0*. Other wrl files randomly found online load fine on Blender. ``` Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\__init__.py", line 78, in execute return import_x3d.load(context, **keywords) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 3639, in load global_matrix=global_matrix, File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 3535, in load_web3d importShape(bpycollection, node, ancestry, global_matrix) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 3141, in importShape is_vcol) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2968, in importShape_LoadAppearance (bpymat, bpyima, tex_has_alpha) = appearance_Create(vrmlname, material, tex_node, ancestry, node, is_vcol) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2876, in appearance_Create bpyima = appearance_LoadTexture(tex_node, ancestry, node) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2821, in appearance_LoadTexture bpyima = appearance_LoadPixelTexture(tex_node, ancestry) File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_scene_x3d\import_x3d.py", line 2991, in appearance_LoadPixelTexture bpyima = bpy.data.images.new("PixelTexture", w, h, has_alpha, True) TypeError: BlendDataImages.new(): required parameter "alpha" to be a keyword argument! location: <unknown location>:-1 ``` **Exact steps for others to reproduce the error** File>Import>X3D Extensible>*attached_file* [smallertest.wrl](https://archive.blender.org/developer/F9607309/smallertest.wrl) Thanks!
Author

Added subscriber: @mimbojumbo

Added subscriber: @mimbojumbo

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

The add-on doesn't use the current Python API. It should use alpha=has_alpha and float_buffer=True, since these are optional arguments that require a keyword.

The add-on doesn't use the current Python API. It should use `alpha=has_alpha` and `float_buffer=True`, since these are optional arguments that require a keyword.
Author

Thanks Robert! How do I do that?

Thanks Robert! How do I do that?

@mimbojumbo It's a bug that one of our developers has to fix. You will have to wait until the patch is written, approved, committed and then the change will be included in the daily builds of the Blender version that is currently under development.

@mimbojumbo It's a bug that one of our developers has to fix. You will have to wait until the patch is written, approved, committed and then the change will be included in the daily builds of the Blender version that is currently under development.
Author

@rjg Thanks for the clarification Robert. It works on 2.79b so I'm using that for now.

@rjg Thanks for the clarification Robert. It works on 2.79b so I'm using that for now.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#85269
No description provided.