No matter what I try I only get one instanced material and it does not set the corresponding texture for it.
I tried using the split attr on the unreal_material_instance attribute but I guess it only works for instanced copy to points geometry? I added a copy to points to see if it would make a difference but sadly it does not.
My current setup;
I am using a TOP network to load in the geometry and textures. I process every workitem with this for the file import
`pdginput(0,"file/geo",0)`
I have this python script in my topnetwork to fill the texture paths;
# Executes a Python script, either in process or as a job # # The following variables and functions are available in both case: # work_item # graph # intData, floatData, strData, # intDataArray, floatDataArray, strDataArray # # In addition to the above, in-process scripts can also access: # self - the current PDG node # parent_item - the parent work item, if it exists import hou matnetRef = hou.node("../../matnet1") #children = matnetRef.children() #if(matnetRef.children()!=0): # for n in matnetRef.children(): # n.destroy(True) pdgInput = parent_item.inputFiles[1] wedgeindex = work_item.intAttribValue("wedgeindex") material = hou.node("../../matnet1/principledshader"+str(wedgeindex)) #material.parm("basecolor_useTexture").set(1) material.parm("basecolor_texture").set(str(pdgInput[0])) materialName = str(material) #work_item.setStringAttrib("materialNodeName",materialName) work_item.addEnvironmentVar("materialNodeName",materialName)
I get a material with textures for every processed mesh but I don't get more than one material instance
I also unsure if this is the right way to go. If anyone has any ideas or could take a look I would very much appreciate some help