Exception raised and failure in importing an X3D file with no Material node #95455
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#95455
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: MacOS 10.15.7
Graphics card: Intel Iris
Blender Version
Broken: 3.0.1
Addon Information
Name: Web3D X3D/VRML2 format (2, 3, 0)
Author: Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev
Short description of error
Importing an X3D file with a shape that does not have a defined material, import fails and exception trace is printed to console, the exception assertion is:
Exact steps for others to reproduce the error
Exception trace will appear in console
basic_cube_no_material.x3d
Proposed diagnosis and solution
The exception is occurring in the import_x3d module, https://developer.blender.org/diffusion/BA/browse/master/io_scene_x3d/import_x3d.py
the appearance_CreateDefaultMaterial function; at line 2764 the base color is being set to (0.8,0.8,0.8,1.0), that is, an RGBA color.
In further processing, this value gets passed to utilty rgb_to_rgba in node_shader_utils.py ( https://developer.blender.org/diffusion/BS/browse/master/release/scripts/modules/bpy_extras/node_shader_utils.py )
Another value 1.0 is added t the color - tuple, leading to a invalid value of 5 numeric elements.
Proposed fixes:
In appearance_CreateDefaultMaterial function, initialize base_color to an RGB value (0.8,0.8,0.8)
OR
Modify the rgb_to_rgba utility so that it only appends an default ALPHA value to a tuple of 3 elements.
#95860 was marked as duplicate of this issue
Added subscriber: @vmarchetti
Added subscriber: @mano-wii
Changed status from 'Needs Triage' to: 'Needs User Info'
Where do I find this
basic_cube_no_material.x3d
? Did you forget to upload the file?You can add it to the bug report by clicking on the upload button as shown in the screenshot below or via drag and drop.
basic_cube_no_material.x3d
My apologies for my mistake. I have uploaded the file.
Thank You
Vince Marchetti
Changed status from 'Needs User Info' to: 'Confirmed'
Added subscribers: @dscharstein, @PratikPB2123
Hi, can you submit a patch for your proposed fix?
Hmm, not sure how. Both Germano and I pointed out how to fix the code, isnt' that sufficient for someone to make the change?
Change line 2764 in
addons/io_scene_x3d/import_x3d.py
to provide only 3 values, not 4:Added subscriber: @Mark-Blair
I have confirmed that this change fixes the issue for the bug I submitted as well. https://developer.blender.org/T102384
Submitted: https://developer.blender.org/D16453
This issue was referenced by
57aafe573a
This issue was referenced by
93f61d1ef7
Changed status from 'Confirmed' to: 'Resolved'