question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Material mix with vertex color: "_COLOR0" is added everytime you import the model

See original GitHub issue

Describe the bug If you import the model which use vertex color, you’ll get that annoying “_COLOR0” - everytime you import it! So if you export/import it multiple times, you’ll end with something like

MyMaterialName_COLOR0_COLOR0

And don’t forget about material name limit in Blender…

MyMaterialName_COLOR0_COLOR0_<...>_COLO

And what if material name is very long initially?

Looooooooooooooooooooooooooo<...>oongName_CO

Is this a normal behavior? Why do we need that “_COLOR0” in material name?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
scurestcommented, Apr 25, 2020

Okay, cool. Patch is just

--- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_material.py
+++ b/addons/io_scene_gltf2/blender/imp/gltf2_blender_material.py
@@ -33,8 +33,6 @@ class BlenderMaterial():
         name = pymaterial.name
         if name is None:
             name = "Material_" + str(material_idx)
-        if vertex_color is not None:
-            name += "_" + vertex_color
 
         mat = bpy.data.materials.new(name)
         pymaterial.blender_material[vertex_color] = mat.name
1reaction
scurestcommented, Apr 24, 2020

Is that the only reason we have to duplicate materials in Blender import?

Yes. (It sounds like in Three.js a material corresponds to a unique shader/pipeline.)

Let’s ask @julienduroure’s opinion. This got added as part of the initial fix for materials not being duplicated in #30.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mixing materials w vertex color - Blender 2.x - YouTube
In this tutorial I show how to mix two materials in the Material Node Compositor using as factor a Vertex Color Map in ......
Read more >
Blender Vertex Color height blend material tutorial - YouTube
This tutorial gives you an introduction to the shader editor in Blender, Cycles & Evee as well as how to use Quixel Bridge...
Read more >
How can I import an OBJ with Vertex Colors into Blender 3.2?
Then go to Material Properties, create a new material, click the yellow dot next to "Base Color", and in the far left column...
Read more >
Make vertex colors visible | Maya 2020
Automatic vertex color display is enabled by default. The following conditions must be true for polygon colors to be visible in view panels....
Read more >
Instancing - LearnOpenGL
Say you have a scene where you're drawing a lot of models where most of these ... Compared to rendering the actual vertices,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found