How do I assign my HDA with multiple material elements for Unreal to see?

   28678   30   7
User Avatar
Member
3 posts
Joined: May 2017
Offline
I can't seem to find a way to apply multiple material elements for my HDA in Unreal. My goal is to create a group that will have one material while another group has another. In Maya this is easily done by applying a different material to the selection and Unreal will recognize this. I've tried all sorts of methods and can't seem to find a working solution. Thanks in advance for any help.
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
You can apply a material by primitive using the material sop node, which applies the shop_materialpath attribute. This will be picked up automatically by the plugin and translated into an unreal material. Make sure your material is inside your HDA.

Or you could use the primitive attribute unreal_material with an unreal asset path to your material uasset, for example Material'/Game/NewMaterial.NewMaterial'
User Avatar
Member
3 posts
Joined: May 2017
Offline
So how would I add multiple material elements using either methods? Because I'm only seeing the default material once I get the HDA into Unreal. Using the first method and it covers the entire mesh.
User Avatar
Member
3 posts
Joined: May 2017
Offline
I figured it out. I didn't realize you literally had to add that material into the asset itself. Thanks for the help, I've been pulling my hair out all day. Only week 2 of using Houdini…long time Maya user.
User Avatar
Member
38 posts
Joined: July 2017
Offline
I've been pulling my hair out too. Can somone clarify how you put the material ‘into the asset itself’, as MMurray says - it seems as if i've done this already - https://imgur.com/a/nIkE3 [imgur.com] but the material in Unreal still covers the whole mesh (its not divided into 2 parts in Unreal)
User Avatar
Member
67 posts
Joined: Jan. 2016
Offline
Snappy_Darko
I've been pulling my hair out too. Can somone clarify how you put the material ‘into the asset itself’, as MMurray says - it seems as if i've done this already - https://imgur.com/a/nIkE3 [imgur.com] but the material in Unreal still covers the whole mesh (its not divided into 2 parts in Unreal)

You do copy reference from unreal material (right click material in unreal engine and select copy reference) and paste it into the value field in the material node.
Edited by Aladin Sane - Feb. 19, 2018 13:50:51

Attachments:
unrealmaterialnode.PNG (43.2 KB)

User Avatar
Member
38 posts
Joined: July 2017
Offline
Hi Aladin Sane, thanks so much for responding, no one else has. I'm still not getting anywhere, although you're post seems very promising. I'm a bit of noob with both softwares, but here's what I've done (attached)

I'm basically still only getting the option of selecting one material for the whole mesh. Any chance you could run me through the process a bit more closely? And do I need to have materials applied to the asset in Houdini - I nevertheless have done this (you can see in Houdini it's red and blue), because I can't see how would Unreal know where the material divisions in the object are. is this right?

Attachments:
Screenshot (170).png (1.3 MB)
Screenshot (172).png (1.8 MB)

User Avatar
Member
67 posts
Joined: Jan. 2016
Offline
Snappy_Darko
Hi Aladin Sane, thanks so much for responding, no one else has. I'm still not getting anywhere, although you're post seems very promising. I'm a bit of noob with both softwares, but here's what I've done (attached)

I'm basically still only getting the option of selecting one material for the whole mesh. Any chance you could run me through the process a bit more closely? And do I need to have materials applied to the asset in Houdini - I nevertheless have done this (you can see in Houdini it's red and blue), because I can't see how would Unreal know where the material divisions in the object are. is this right?

To do what you want you need to assign the material attribute to the group you wish that material to have. So you need to make sure you are not assigning your attribute nodes to all your geometry in your asset.

Also the materials you put in each material node must be different or they will be combined.

So when you copy source from unreal use different material for each different material you want to have and then make sure your attributes actually have different geometry in them.

Hope this makes sense.

I am attaching image that shows two separate nodes that are merged in the asset. Each node has material assigned before they are merged so the material attribute is applied only to that specific set of geometry.

Then each material attribute references a different material in UE. If you use same material name they will be considered same material.

Looking at your material attributes your problem is you are applying both materials to the same group of geometry. You have to assign them to different set of polys for this to work. That is the power of grouping, that you can isolate a portion of your model and modify just the portion. There are two ways you can approach this and will usually depend on how you structured your asset. If you build the pieces separately and then merge them you can just apply a material attribute as I did in the image below. If you model is more complex you can use the create group node to isolate the different parts and then use that group in your material attribute node so it only applies the attribute to your grouped geometry.

Once you get this setup properly the materials will be assigned automatically by the digital asset.
Edited by Aladin Sane - Feb. 20, 2018 08:06:47

Attachments:
twomaterials.PNG (56.2 KB)

User Avatar
Member
38 posts
Joined: July 2017
Offline
Hey, thank so much for this, still can't get it to work though.

I am using a merged object from Zbrush (imported by GoZ) but I have retained the separate material groups, so was able to split them off using the group node as you suggested. I made an HDA without materials and one with with materials, but Unreal does not register either as having 2 channels. Here are the images of what I have
Edited by Snappy_Darko - Feb. 20, 2018 08:41:23

Attachments:
Screenshot (173).png (95.8 KB)
Screenshot (174).png (117.9 KB)

User Avatar
Member
67 posts
Joined: Jan. 2016
Offline
Snappy_Darko
Hey, thank so much for this, still can't get it to work though.

I am using a merged object from Zbrush (imported by GoZ) but I have retained the separate material groups, so was able to split them off using the group node as you suggested. I made an HDA without materials and one with with materials, but Unreal does not register either as having 2 channels. Here are the images of what I have

for each of your material groups rename them both to just

unreal_material

unreal_face_material is deprecated.

yours currently have a 2 at the end.

I am not sure about the actual material node you have on there. I have never used it with material from houdini.
I use the copy reference to reference a material that already exists in UE (someone else might comment on the material node)

Try fixing the group names. If that does not I am not sure I cannot determine if those are valid groups or not.

A good way to test this out is to create a very simple asset with two sets of geo (two boxes), put each box in a group at the material attribute node for each and merge together. Then use this to test until you get it. Once you have that working you can use it as reference for work on your zbrush import.
User Avatar
Member
67 posts
Joined: Jan. 2016
Offline
Snappy_Darko
Hey, thank so much for this, still can't get it to work though.

I am using a merged object from Zbrush (imported by GoZ) but I have retained the separate material groups, so was able to split them off using the group node as you suggested. I made an HDA without materials and one with with materials, but Unreal does not register either as having 2 channels. Here are the images of what I have

for each of your material groups rename them both to just

unreal_material

unreal_face_material is deprecated.

yours currently have a 2 at the end.

I am not sure about the actual material node you have on there. I have never used it with material from houdini.
I use the copy reference to reference a material that already exists in UE (someone else might comment on the material node)

Try fixing the group names. If that does not I am not sure I cannot determine if those are valid groups or not.

A good way to test this out is to create a very simple asset with two sets of geo (two boxes), put each box in a group at the material attribute node for each and merge together. Then use this to test until you get it. Once you have that working you can use it as reference for work on your zbrush import.
User Avatar
Member
38 posts
Joined: July 2017
Offline
Cheers mate, really appreciated your help with this, will give those things a try.
User Avatar
Staff
550 posts
Joined: Sept. 2016
Offline
Hi,

There's two different ways to assign materials with the plug-in:

- You can assign unreals material (Material asset in UE4) via the way Aladin describe to you.
Add an “unreal_material” string attribute to the faces/primitives, and set its value to the reference to the material in UE4 (right click on the material uasset, copy reference).
This material won't show up in Houdini, but will be assigned upon cook in Unreal by the plug-in.

- You can use a houdini material, and have the plug-in create an Unreal Material from it.
This time, don't use the unreal_material attribute (this one is for assign material that exist in UE4, not in Houdini)
Use the material sop, with its material parameter set to the path to the principled shader in a material network in your asset.

The plugin will then create an unreal material corresponding to that principled shader when cooking the asset.
The shader wont be fully reproduced though, only some part of it (diffuse, normal, specular, roughness…)

Don't mix both for the same faces/groups, either use unreal_material or a material node.

Here's a simple example of creating Houdini Material via the plugin:



the matnet contains two principled shader, each used by the material nodes.
The two shaders are very simple, one has a diffuse texture + metallic value, the other a simple diffuse color + emissive color.

and the result in UE4:

Edited by dpernuit - Feb. 23, 2018 11:14:17

Attachments:
HoudiniMat.PNG (1.3 MB)
InUnreal.PNG (86.7 KB)
damienp_torussphere.hda (39.2 KB)

User Avatar
Member
38 posts
Joined: July 2017
Offline
Thank you so much dpernuit.

Can I ask, once you add the matnet node, how do you add the principle shaders? I've gone inside it and there is nothing there are no parameters visible.
User Avatar
Staff
550 posts
Joined: Sept. 2016
Offline
Hi,

The principled shader is a node, so you have to create it
( Tab > Principled Shader )
User Avatar
Member
453 posts
Joined: Feb. 2013
Offline
I was wondering if we could maybe have a hybrid thing in the future, where we specify the material to use in Houdini and Houdini Engine at the same time.
I would imagine a method where you assign a type of shader (probably a version of the principled shader) in Houdini that has special parameters for specifying what should be used in Unreal, Maya and Unity (etc.) respectively. (With default behavior, that if no Houdini Engine override is specified, or if it cannot be found a new material is created.)
User Avatar
Staff
550 posts
Joined: Sept. 2016
Offline
That's actually the way it currently work:
Set a “Houdini Material” the way I've described via a material node, and add the unreal_material attribute.

The unreal material will override the Houdini one, but if that override cant be found, the houdini one will be used instead.
User Avatar
Member
38 posts
Joined: July 2017
Offline
Thanks so much to all here, I finally got it working! It came down to being consistent the naming conventions, as well as following all the steps suggested above :-)
Edited by Snappy_Darko - March 1, 2018 10:51:34
User Avatar
Member
1 posts
Joined: Sept. 2018
Offline
I was banging my head against my desk for so long until I found this awesome thread. Thank you all!
User Avatar
Member
1 posts
Joined: Nov. 2018
Offline
I was banging my head against my desk for so long until I found this awesome thread. Thank you all!
– me too, thanks again!
  • Quick Links