X3D Import does not handle Materials #71232
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
12 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#71232
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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: Windows 10
Graphics card: GT 1070
Blender Version
Broken: 2.90, 0330d1af29c0
Short description of error
When an X3D file is imported and that file has a Material tag no corresponding material is added in blender. Materials are supported for other formats like OBJ.
Example:
Exact steps for others to reproduce the error
red-cube.x3d
red-cube.blend
Material import was more or less disabled in
e8da70ab73
Added subscriber: @jose.xavier
#81519 was marked as duplicate of this issue
blender/blender#81437 was marked as duplicate of this issue
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Needs User Info'
Hi there and thx for the report (sorry this has been lying around).
Possibly normals are inverted, but to really investigate, could you share one of those .wrl files so we can check?
Added subscriber: @easyw
@lichtwerk
you can test any of the KiCAD 3D model wrl files...
I used to import those files in Blender and it worked fine till 2.7.9
With Blender 2.8 the wrl just loses colors.
(tested with blender-2.81a-linux-glibc217-x86_64)
i.e. you can try this file
https://github.com/KiCad/kicad-packages3D/raw/master/Capacitor_SMD.3dshapes/CP_Elec_10x10.5.wrl
or
https://raw.githubusercontent.com/KiCad/kicad-packages3D/master/Capacitor_Tantalum_SMD.3dshapes/CP_EIA-7343-30_AVX-N.wrl
Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'
Added subscriber: @adammak
The cause of that is return in 2699th line of code in import_x3d.py which returns the method. Moreover, the color vectors need alpha value to be added.
I submitted bug, there is temporary fix you can use:
Added subscriber: @ankitm
Added subscriber: @mont29
Note that proper solution would be to add support for shader nodes, but that is a fairly big project...
Added subscriber: @khavin
Any update on this? It may be something else, but I'm still experiencing the lack of colors on 2.90.1 running on Windows 10 2004. The .wrl was generated by KiCAD 5.1.6.
Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Import WRL shows no colorto X3D Import does not handle MaterialsAdded subscriber: @the_magnet_girl
Added subscriber: @Justin.kedl
Added subscriber: @marioamb
Added subscriber: @jr-br
Thanks a lot for this workaround, @adammak!
I fixed two little issues for myself when I applied it, one is that your code assigened diff_color to bymat.specular_color instead of spec_color, and the second is that that field does not seem to like the alpha value:
... which makes it:
I am currently using Blender 2.90.1.
Added subscriber: @RigoLigo
I tried to port
appearance_CreateMaterial
andappearance_CreateDefaultMaterial
to shader nodes and seem to work fine. I'll see if I can submit the patch after taking some time refining it...Basically tuple size can be solved by expanding it with
(*diff_color, 1.0)
;By setting
bpymat.use_nodes
toTrue
enables node tree, then you can modify the nodes with something likebpymat.node_tree.nodes['Principled BSDF'].inputs['Base Color'].default_value = (*diff_color, 1.0)
.Haven't tried to port image textures yet, but should be pretty trivial to add, as linking node tree is also simple.
This issue was referenced by
0573bc7dae
Changed status from 'Confirmed' to: 'Resolved'