Lorenz Ostwald

Maschinenfabrik

About Me

Connect

LOCATION
Not Specified
ウェブサイト

Houdini Skills

Availability

Not Specified

Recent Forum Posts

material instance creation 2023年6月5日15:04

However, the system does not automatically create new instances when it encounters new values for the material instance parameters.

Yes that seems to be the problem! I gave up trying to get it working solely using houdini engine. At the moment I am creating the material instances with a python in editor script in unreal after my static meshes have cooked...it's not the "one click solution" I was hoping for but it does work for now

material instance creation 2023年5月17日4:30

I'm having difficulties creating multiple material instances and overriding the textures with the one my HDA creates for every mesh I generate.

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)`
and assign a different material on each iteration which works although I have the feeling I am doing some really hacky things to get the hda to create a different material with textures for each mesh which was also a pain to get working.



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

PDG material textures problem 2023年5月11日6:07

Hi I am currently working on an HDA to process multiple incoming 3d scan files and I'm having trouble assigning the right texture to each workitem. Ultimately I want to import the hda to unreal to automatically process hundreds of scans and assign the right texture to each one inside of unreal.

my current approach looks like this;



I am creating an attribute "extension2" for the texture files in jpg format
and then I feed that attribute with the rest of the filepath into the hda which is connected to my basecolor inside the shader of the HDA



What I don't understand is why the HDA processor seems to load the geo correctly with the expression but cannot do the the same for the texture files

Since I am a total beginner with tops and pdg I would greatly appreciate if anyone could take a look and help.