Search - User list
Full Version: Group from materialpath
Root » Houdini Indie and Apprentice » Group from materialpath
Kronso
Hey, I'm trying to group primitives on an imported tree FBX using the material shop path. I've done this before in a previous version, and for some reason, I can't figure out what I'm doing wrong. No matter how I select them, and whether I try to group/blast/delete, use this selection to do anything, nothing seems to work.

I can select them using “Display group and attribute list” and my group sop recognizes it, then fills in the @shop_materialpath for me. However the group for all selected primitives is still 0? If I try to delete these faces, the same thing, I get no results.

Any help would be super appreciated, let me know if I can provide any more information.

EDIT: It seems this problem is related to the specific FBX's I'm trying to do this to. Is it the syntax of the material path that is causing an issue maybe?
tamte
hard to say without a file, but in your specific case try this in Prim Wrangle
string group = split(s@shop_materialpath, "_")[-1];
setprimgroup(0, group, @primnum, 1);
it should create all 5 groups for you
Kronso
Wow, perfect. Thanks so much Tomas, I have a feeling this'll save me a looottt of time in the future!
remiller91
tamte
hard to say without a file, but in your specific case try this in Prim Wrangle
string group = split(s@shop_materialpath, "_")[-1];
setprimgroup(0, group, @primnum, 1);
it should create all 5 groups for you

Sorry, can you explain this more? I'm trying to do the same thing and I don't get it.
tamte
remiller91
Sorry, can you explain this more? I'm trying to do the same thing and I don't get it.

let's consider a single primitive with shop_materialpath attibute value of "a_b_c_twigs" (jsut to use pervious example)

then
- split(s@shop_materialpath, "_") outtputs array of strings using "_" as a separator so: {"a", "b", "c", "twigs"}
- next. [-1]is a syntax to pick last element from this array so: "twigs"
and assigns it to string variable called group
- and last line, setprimgroup(), just assigns the current primitive to a group of that name, so in this case group called "twigs", it will create such group if it doesnt exist

if used in Prim Wrangle, this runs for all primitives and assigns each of them to a group based on it's value of shop_materialpath atribute
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