STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
342
IN-GAME
1,953
ONLINE
Founded
8 November, 2013
All Discussions > Bug Reports > Topic Details
GoldSrc import smd WITH textures fix
Now is 22-09-2024
Blender Source Tools 3.3.1
Blender 4.1 (I use this vers)
All these years, since 2020, no one from the community has proposed this edit, and during this time I have already mastered programming.

The Problem; When you import qc or smd, the created materials do not load the image into textures.. it makes you waste a lot of time. I have added a couple of lines that assign files to texture nodes and remove gloss for correct display in the editor

The Solution:
1.download the addon and unzip it. open import_smd.py
2. find method "def getMeshMaterial(self,mat_name):"
3. find " mat = bpy.data.materials.new(mat_name) " strineline and paste after this line this text
mat.use_nodes = True base_node = mat.node_tree.nodes["Principled BSDF"] if base_node: base_node.inputs["Roughness"].default_value = 1.0 texture_node = mat.node_tree.nodes.new("ShaderNodeTexImage") texture_path = os.path.join(os.path.dirname(self.filepath), mat_name) try: texture_node.image = bpy.data.images.load(texture_path) except RuntimeError: print(f"Текстура не найдена: {texture_path}") mat.node_tree.links.new(texture_node.outputs["Color"], base_node.inputs["Base Color"])
4. after this text must be a stringline: "md.materials.append(mat)"
5. Save , Pack to ZIP , Install and test it .


Fixed-width font, preserves spaces
Last edited by America // Classic Fresh; 22 Sep, 2024 @ 11:27am
All Discussions > Bug Reports > Topic Details