Sung Ho Kim

sungho1114

About Me

Expertise
Student
Location
United States

Connect

Recent Forum Posts

Adding material slots in UE4 June 26, 2019, 3:39 p.m.

Hello guys,


Node


Result

I am trying to add material parameters on the tool and it works well, but it doesn't create the material slots if there is no material file inside of the file path. I tried to find other ways to solve the problem like adding material string path and adding multiparm folder, but string doesn't get populated like material slots and the multiparm folder materials doesn't attach on the mesh properly. Is there a way to make populate-able material string path or add material slots without placement (string is better option for me)?

Add Parameter based on attributes June 12, 2019, 7:47 p.m.

mkps
You can use regular expressions to build it. So if you have an integer parameter called “userVersion”, you can put this expression in a string parameter and then middle mouse the parameter to see it evaluated. (You might have to fix the drive colon thing if it shows up as a smiley face… )

`"Z:/assets/buildings/building" + padzero(3, ch("userVersion")) + "/building" + padzero(3, ch("userVersion")) + "_roof.bgeo.sc"`

That can be made more modular as well if you want to break parts of the expression up and reference multiple parameters. ie: have one parameter where it specifies the base folder path. Then ideally you can on different file nodes just append the model name like “roof” or “roofTrim” or whatever.

Thank you so much for your help and the example. I will try use this expressions to build the hda.

Add Parameter based on attributes June 12, 2019, 6:54 p.m.

mkps
How about having a folder structure that's consistent for multiple building meshes, then you can have either a slider for the user to pick which building number they want, or assign a random building mesh per box?

ie: you would have a folder like this:
Zassets/buildings/building001/building001_roof.bgeo.sc
Zassets/buildings/building001/building001_roofTrim.bgeo.sc
Zassets/buildings/building001/building001_roofTrimCap.bgeo.sc
etc…

Zassets/buildings/building002/building002_roof.bgeo.sc
Zassets/buildings/building002/building002_roofTrim.bgeo.sc
Zassets/buildings/building002/building002_roofTrimCap.bgeo.sc
etc…

And in your hda you would construct the file path filling in which building number is to be used. Then you don't need the user to input any explicit paths.

Ohhh I see. Thank you for teaching me an alternative way to change the meshes. I didn't think about changing a file number to change meshes. but I never done this before. how do I set this up in houdini? Do I need to use vex code or is it possible to just use file node to generate it?