how to create group by color in 19.5

   6389   11   3
User Avatar
Member
1 posts
Joined: April 2019
Offline
Hi,

Im trying to create groups from colors but in the tutorial that I'm watching they use partition which seems to be deprecated in the lastest Houdini 19.5, is there another way of doing this? In the docs it says to use groupsfrom name but I cant seem to figure out how to get it to work. Thanks for any help! (screenshot attachted)

Attachments:
houdiniScreenshot.PNG (21.0 KB)

User Avatar
Member
59 posts
Joined: April 2008
Offline
try coding with some vex array stuffs?hope it helps

Attachments:
get_grps_from_color.hip (184.3 KB)

User Avatar
Member
2 posts
Joined: Oct. 2019
Offline
Hi,

you can use the cluster node by setting the control attribute to Cd, and using the cluster slider to control how many groups to create. Made a quick setup to demonstrate.

Hope it helps!

Image Not Found

Attachments:
groups_using_Cd.hipnc (106.1 KB)

https://www.instagram.com/ziyad.abah/ [www.instagram.com]
User Avatar
Member
899 posts
Joined: Feb. 2016
Offline
I believe Labs Group by Attribute is also an option. Maybe less computational demanding than the cluster sop solution.

cheers
Edited by Andr - Sept. 9, 2022 11:52:23
User Avatar
Member
8772 posts
Joined: July 2007
Offline
gus1234
In the docs it says to use groupsfrom name but I cant seem to figure out how to get it to work.
1. create any string attribute from any values you want, in your case color
2. use Group From Name to create groups by any unique value of provided string attribute

for example for primitive Cd attrib:
1. Primitive Wrangle:
s@color_string = sprintf("rgb_%f_%f_%f", v@Cd.x, v@Cd.y, v@Cd.z);
2. Group From Name SOP, Name Attribute: color_string

Attachments:
ts_group_from_name_example.hipnc (102.4 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
35 posts
Joined: Oct. 2018
Offline
Hello, I am trying to create a group based on specific colors and I am trying your method @Tomas but with no luck... HOW do I specify which color I want to include in my group ?
Edited by tanguybc - May 6, 2023 20:28:32
User Avatar
Member
35 posts
Joined: Oct. 2018
Offline
I was hoping to get something in vex to get there like:

if(@Cd > 0.95){
i@outerring=1;
}
User Avatar
Member
35 posts
Joined: Oct. 2018
Offline
I was able to create my groups with VEX :

@group_outer2UV = @Cd.x > 0.15;
@group_inner2UV = @Cd.y > 0.15;
User Avatar
Member
8772 posts
Joined: July 2007
Offline
tanguybc
I was able to create my groups with VEX :

@group_outer2UV = @Cd.x > 0.15;
@group_inner2UV = @Cd.y > 0.15;
yes, this is definitely the easy way to do individual groups based on some expression, you can also use Group Expression SOP

additionally for simple comparisons, you can even use the same expression (without spaces) directly in group fields as ad-hoc group without having to create the group itself


the Group From Name SOP approach is more to procedurally create as many groups as there is unique values in an attribute, like mentioned Partition SOP used to do
Edited by tamte - May 6, 2023 21:56:13
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
35 posts
Joined: Oct. 2018
Offline
Oh that is even nicer in my case ! the group field one

Thank you Tomas!
User Avatar
Member
3 posts
Joined: Sept. 2021
Offline
Hello,
I'm in the same situation. I have a mask attribute i need to promote as group but i don't know what VEX expression to use. I basically wanna extrude an attribute paint but can't seem to be able. Any help?
Thanks!
User Avatar
Member
8772 posts
Joined: July 2007
Offline
crtqcrtq
Hello,
I'm in the same situation. I have a mask attribute i need to promote as group but i don't know what VEX expression to use. I basically wanna extrude an attribute paint but can't seem to be able. Any help?
Thanks!

mask attribute from Attribute Paint is usually float, so all you need to do is promote it to prim to be able to use in Poly Extrude

so append:
- Attribute Promote (Orig Name: mask, New Class: Primitive, Change New Name: On, New Name: zscale)
- Poly Extrude (Divide Into: Individual Elements, Distance: >0, Local Control/Distance Scale: On)
(and if you want optimize the polygons with 0 extrusion you can type this int the Group: @zscale>0)
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links