Skip to content

Commit

Permalink
In blender, set gloss/roughness to non-color data.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtzxporter committed Sep 22, 2024
1 parent 74a1a4c commit e58f741
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/blender/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
bl_info = {
"name": "Cast Support",
"author": "DTZxPorter",
"version": (1, 6, 5),
"version": (1, 6, 6),
"blender": (3, 0, 0),
"location": "File > Import",
"description": "Import & Export Cast",
Expand Down
9 changes: 9 additions & 0 deletions plugins/blender/import_cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,20 @@ def utilityAssignBSDFMaterialSlots(material, slots, path):
material.node_tree.links.new(
shader.inputs[switcher[slot]], normalMap.outputs["Normal"])
elif slot == "gloss":
if texture.image is not None:
texture.image.colorspace_settings.name = "Non-Color"

invert = material.node_tree.nodes.new("ShaderNodeInvert")
material.node_tree.links.new(
invert.inputs["Color"], texture.outputs["Color"])
material.node_tree.links.new(
shader.inputs[switcher[slot]], invert.outputs["Color"])
elif slot == "roughness":
if texture.image is not None:
texture.image.colorspace_settings.name = "Non-Color"

material.node_tree.links.new(
shader.inputs[switcher[slot]], texture.outputs["Color"])
else:
material.node_tree.links.new(
shader.inputs[switcher[slot]], texture.outputs["Color"])
Expand Down
2 changes: 1 addition & 1 deletion plugins/maya/castplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

# Shared version number
version = "1.65"
version = "1.66"


def utilityAbout():
Expand Down

0 comments on commit e58f741

Please sign in to comment.