検索 - User list
Full Version: How to assign multiple materials to the same object
Root » Houdini Engine for Unreal » How to assign multiple materials to the same object
DASD
How do I get multiple material slots on one object (via houdini engine in unreal engine)?

As far as I know, for unity you can create an attribute “unity_material” and set it to string with a path to a material. What's the equivalent for Unreal? I tried just assigning different materials via a Material Sop, but that didn't work. (I still only get one material slot per object).

- I'm asking, because I read somewhere that support for that was recently added.
ttvdsfx
Hello DASD,

We do have support for multiple materials per generated static mesh. Please have a look at the attached asset; points of interest are SHOP nodes Multi_Whole1/2/3 and obj Multi_Whole (look at material nodes). You can also import this asset into UE and see how it works.

Please let me know if this answers your question.
Thank you!
DASD
Your example file certainly works. I tried to apply this on my file and I did something very similar before, but I am still debugging.
I think - correct me if I'm wrong - that the different cop nodes being fed into the materials is actually essential for this to work. I did not have time to test it yet, but I think that if you only set colors on the shaders, Houdini Engine won't differentiate between dirrent shaders and give the object only one material slot.
- If that's not it, I must be missing something else.
ttvdsfx
Hello,

Setting colours on shaders should work. Are you using stylesheets by any chance? Can you attach your asset so we could have a look at what's going on?

Thanks!
DASD
I'm not using stylesheets, as far as I know. I'll try to find a solution next week and make an update in this post.
Andreas Strømberg
I have spent some time trying to figure out this myself, and I got it working after placing my shop network inside my digital asset.

I had it outside first, since I have more than one digital asset that uses the same materials.

That was on a simple sphere with 2 materials, I could not get it working in my proper digital asset.

But is that the case, that the shop network needs to be inside the digital asset?
DASD
I tested it (Houdini Indy version 15.0.287) and the only thing that worked was to feed cops into the shaders (like shown in your example).
- It's not bad but I guess that is not intended behavior.
Andreas Strømberg
I'm still having problems getting this to work, so I'm uploading a cleaned version of my project file.
With one digital asset that works and one that does not.
Andreas Strømberg
Could anyone test my file, to see if I have done something obviously wrong?
DASD
My guess is that it does not like that you feed objects into each other. Try putting it all into one object node.
MorganNilsson
You could also try to use a single material node to assign your materials, place it at the end before the output node.
ttvdsfx
There's also a way to specify Unreal materials, using unreal_face_material string primitive attribute (you can have different assignments for different primitives); it must be a valid UE4 material or material instance reference. If engine does not find such material during cooking, it will fallback to default Houdini UE4 material which we ship (which samples vertex colors, I believe).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB