Simplifying FBX geometry group names

   89   3   0
User Avatar
Member
3 posts
Joined: 12月 2017
Offline
Hi everyone.
I have an Fbx file that comes from Revit with a few layers, and Houdini translates them into groups. Unfortunately it also creates a group per each object that goes like “@Layername<Objectname>”

Now i need to get rid of all the “<Objectname>” and instead leave only “@Layername” possibly deleting the “@” at the beginning.

I need to keep the groups as simple as “Walls” “Doors” etc.
What would be the best way to go?

Example in the image
Edited by Flatland - 2019年5月17日 19:50:26

Attachments:
60362223_2448558151850391_2370295581970006016_o.jpg (250.0 KB)

User Avatar
Member
3 posts
Joined: 12月 2017
Offline
So apparently i was wrong and those were not groups but piece names.

I may need then to rename all those pieces, keeping only the first part until “<” and getting rid of the remaining characters.
Would this have to be done using a loop for each geometry with some vex? or is there a node that does that in a simpler way?
Edited by Flatland - 2019年5月17日 19:50:47

Attachments:
975ac9a9-d861-4208-afb8-d672eb08bdfc.jpg (306.8 KB)

User Avatar
Member
2173 posts
Joined: 9月 2011
Online
There are a few string processing operations available in VEX such as splitting and substitution and regex. Looping is implied by the run-over type, in this case primitives.

Something like my example below may work for you.

string splits[] = split(@name, "<");
if (len(splits)>1)
    @name = strip(splits[0], " ");
User Avatar
Member
3 posts
Joined: 12月 2017
Offline
Thanks Jsmack! this is perfect
Also makes everything i did total garbage lol.
You can really make the difference when you know a bit of vex.
Edited by Flatland - 昨日 03:02:54
  • Quick Links