No baseColorFactor in glTF with new Mix node #103220

Closed
opened 2022-12-14 17:55:27 +01:00 by Adrian · 9 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.29

Blender Version
Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: blender/blender@a95bf1ac01
Worked: (newest version of Blender that worked as expected)

Short description of error
When you multiply a new Mix node with an image texture and connect it to the baseColor of the BSDF and export it as a glTF, the glTF does not have a baseColorFactor.
When you multiply a old MixRGB node with an image texture and connect it to the baseColor of the BSDF and export it as a glTF, the glTF doeshave a baseColorFactor.

Exact steps for others to reproduce the error
For new Mix node:

  1. Create a sphere with a material
  2. Create an image texture node
  3. Create a Mix node, set the data type to color and the blending mode to multiply
  4. Connect the image texture to the first socket of the Mix and the Mix into the baseColor of the BSDF(see screenshot)
  5. Export as glTF embedded and open it in a text editor and look for baseColorFactor, you will not find any
    Screenshot_2.png

For old MixRGB node:

  1. Create a sphere with a material
  2. Create an image texture node
  3. Create a mixRGB node, by using the following script, since you cannot create the old mixRGB node otherwise:
import bpy
selection = bpy.context.selected_objects
selection = selection[0]
currentMaterial = selection.active_material
currentMaterial.use_nodes = True
nodes = currentMaterial.node_tree.nodes
mixNode = nodes.new(type = 'ShaderNodeMixRGB')
  1. Connect the image texture to the first socket of the mixRGB and the mixRGB into the baseColor of the BSDF(see screenshot)
  2. Export as glTF embedded and open it in a text editor and look for baseColorFactor, you will find it
    Screenshot_7.png

So the old mixRGB node is a legacy node and is replaced by the new Mix node, but this breaks the function to export the baseColorFactor in a glTF.

**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 497.29 **Blender Version** Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: `blender/blender@a95bf1ac01` Worked: (newest version of Blender that worked as expected) **Short description of error** When you multiply a **new Mix node** with an image texture and connect it to the baseColor of the BSDF and export it as a glTF, the glTF **does not** have a baseColorFactor. When you multiply a **old MixRGB node** with an image texture and connect it to the baseColor of the BSDF and export it as a glTF, the glTF **does**have a baseColorFactor. **Exact steps for others to reproduce the error** For new Mix node: 1. Create a sphere with a material 2. Create an image texture node 3. Create a Mix node, set the data type to color and the blending mode to multiply 4. Connect the image texture to the first socket of the Mix and the Mix into the baseColor of the BSDF(see screenshot) 5. Export as glTF embedded and open it in a text editor and look for **baseColorFactor**, you will not find any ![Screenshot_2.png](https://archive.blender.org/developer/F14057566/Screenshot_2.png) For old MixRGB node: 1. Create a sphere with a material 2. Create an image texture node 3. Create a mixRGB node, by using the following script, since you cannot create the old mixRGB node otherwise: ``` import bpy selection = bpy.context.selected_objects selection = selection[0] currentMaterial = selection.active_material currentMaterial.use_nodes = True nodes = currentMaterial.node_tree.nodes mixNode = nodes.new(type = 'ShaderNodeMixRGB') ``` 4. Connect the image texture to the first socket of the mixRGB and the mixRGB into the baseColor of the BSDF(see screenshot) 5. Export as glTF embedded and open it in a text editor and look for **baseColorFactor**, you will find it ![Screenshot_7.png](https://archive.blender.org/developer/F14057582/Screenshot_7.png) So the old mixRGB node is a legacy node and is replaced by the new Mix node, but this breaks the function to export the baseColorFactor in a glTF.
Author

Added subscriber: @LalaGhost

Added subscriber: @LalaGhost

Added subscriber: @scurest

Added subscriber: @scurest

Fixed by 3fbcd35feb. You can try 3.5 that you can download here: https://builder.blender.org/download/daily/

Fixed by 3fbcd35feb2a. You can try 3.5 that you can download here: https://builder.blender.org/download/daily/
Member

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Added subscriber: @JulienDuroure

Added subscriber: @JulienDuroure
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

This bug is already fixed in master, and is backported 3.4.1 (that will be released soon)
Closing this ticket

This bug is already fixed in master, and is backported 3.4.1 (that will be released soon) Closing this ticket
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 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#103220
No description provided.