Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2022-03-13 13:17:33 +0300
committerJulien Duroure <julien.duroure@gmail.com>2022-03-13 13:17:33 +0300
commit5838e260366aebd1a1b014bcd84ad05728739005 (patch)
tree8f70b8115bb9fd8c6ef43cb57443b9c077b7d811 /io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
parent7cdde96d329d6221090d1f23ea70a7b90c2b9739 (diff)
glTF exporter: Add glTF settings node in shader menu
This menu (in Add > Output) will be displayed only if activated in addon preferences. The node is sed for AO export. This is a shortcut, avoiding user to create it him/herself
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py')
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
index 1780998c..a5d10a7a 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py
@@ -3,7 +3,7 @@
import bpy
from ...io.com.gltf2_io import TextureInfo, MaterialPBRMetallicRoughness
-from ..com.gltf2_blender_material_helpers import get_gltf_node_name
+from ..com.gltf2_blender_material_helpers import get_gltf_node_name, create_settings_group
from .gltf2_blender_texture import texture
from .gltf2_blender_KHR_materials_clearcoat import \
clearcoat, clearcoat_roughness, clearcoat_normal
@@ -552,16 +552,11 @@ def make_settings_node(mh):
node.node_tree = get_settings_group()
return node
-
def get_settings_group():
gltf_node_group_name = get_gltf_node_name()
if gltf_node_group_name in bpy.data.node_groups:
gltf_node_group = bpy.data.node_groups[gltf_node_group_name]
else:
# Create a new node group
- gltf_node_group = bpy.data.node_groups.new(gltf_node_group_name, 'ShaderNodeTree')
- gltf_node_group.inputs.new("NodeSocketFloat", "Occlusion")
- gltf_node_group.nodes.new('NodeGroupOutput')
- gltf_node_group_input = gltf_node_group.nodes.new('NodeGroupInput')
- gltf_node_group_input.location = -200, 0
+ gltf_node_group = create_settings_group(gltf_node_group_name)
return gltf_node_group