for each file save with @class in file naming

   1320   3   0
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Hi!

I'm making around 10 individual grass blades that I merged together so I could do non-overlaping UVs. Now, I'd like to save each grass blades separately with a different number in the file name.

I was thinking of doing: 1. use connectivity sop to split each grass blades by @class 2. use for-each loop to somehow export each with its @class in the naming.

I tried promoting the @class to detail and save with: folder/grass_blade.@class.bgeo That doesn't work and I'm just trying anything…

Any help is appreciated!

-Olivier

Attachments:
individual_grass_blades.JPG (52.7 KB)

User Avatar
Member
1004 posts
Joined: April 2017
Offline
Solved!

Here's my solution. I took the @class and subtracted the @Frame from it. Then, I grouped it if the result was zero. Then, I just blasted what wasn't in that group. That way, I had a different grass blade at each frame:

i@group_visibleGrass = 0;
i@class -= int(@Frame)-1;

if(i@class == 0){
@group_visibleGrass = 1;
}



-Olivier

Attachments:
change_group_by_frame.JPG (57.8 KB)

User Avatar
Staff
3455 posts
Joined: July 2005
Offline
there is also this kind of hacky thing

Attachments:
write_single_from_multiple.hip (61.6 KB)

Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Forgot about this post!

Nice trick, I'll keep that in mind.

Thanks.

-Olivier
  • Quick Links