Skip to content

OBJ/MTL importing #432

Answered by pragma37
VelocityRa asked this question in Q&A
Oct 27, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Is there a way when importing an obj/mtl to add an NPR Diffuse node with the diffuse texture defined in the mtl as the Base texture?

At import time, I don't think so, but you could setup Malt materials after the import.

You need a manually created Malt node tree with an Image parameter node.
Then in a script, you can assign that node tree to the auto-generated materials and set the images to match the auto-generated nodes in the native (ie. EEVEE/Cycles) material node trees.

import bpy
malt_node_tree = bpy.data.node_trees["Your Node Tree"]
image_key = malt_node_tree.nodes["Your Image Node"].inputs["image"].get_source_global_reference()

for material in imported_materials:
    imported_i…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@VelocityRa
Comment options

@VelocityRa
Comment options

Answer selected by VelocityRa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants