浏览代码

Use UV for image texture with no tex coord input

Previously when no texture coordinate input for ImageTexture, always
defaults to Blender Generated Coordinates. However, it is not consistent
with Blender's behaviour, which defaults use UV.
Jason0214 6 年之前
父节点
当前提交
48a4920bb3
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      io_scene_godot/converters/material/script_shader/node_converters.py

+ 1 - 3
io_scene_godot/converters/material/script_shader/node_converters.py

@@ -760,9 +760,7 @@ class ImageTextureNodeConverter(NodeConverterBase):
         tex_coord_socket = self.bl_node.inputs[0]
         tex_coord = self.in_sockets_map[tex_coord_socket]
         if not tex_coord_socket.is_linked:
-            # default to use generated texture coordinates
-            self.flags.aabb_tex_coord_used = True
-            self.local_code.append("%s = %s" % (tex_coord, self.AABB_UVW))
+            self.local_code.append("%s = vec3(UV, 0.0)" % tex_coord)
 
         tex_var = self.generate_tmp_texture_id(self.bl_node.name)
         if self.bl_node.image is not None: