Skip to content

Commit

Permalink
Fix #2063 export VC without material
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduroure committed Nov 22, 2023
1 parent 230985d commit 86c04fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def manage_material_info(self):
# We need to check if we need to add alpha
add_alpha = vc_alpha_name is not None
mat = get_material_from_idx(material_idx, self.materials, self.export_settings)
add_alpha = add_alpha and not (mat.blend_method is None or mat.blend_method == 'OPAQUE')
add_alpha = mat is not None and add_alpha and not (mat.blend_method is None or mat.blend_method == 'OPAQUE')
# Manage Vertex Color (RGB and Alpha if needed)
self.__manage_color_attribute(vc_color_name, vc_alpha_name if add_alpha else None)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ def get_base_material(material_idx, materials, export_settings):
mat,
export_settings
)

if material is None:
# If no material, the mesh can still have vertex color
# So, retrieving it
material_info["vc_info"] = {"color_type": "active", "alpha_type": "active"}

return material, material_info

def get_all_textures(idx=0):
Expand Down

0 comments on commit 86c04fa

Please sign in to comment.