how to select a primitive from detail class with VEXpression ? please help

   1236   2   2
User Avatar
Member
40 posts
Joined: Oct. 2018
Offline
Hi huys,

thanks for reading in advance, and maybe have an answer
first of all, i'm a complete newb to houdini and this is my first post.


i want to select a identified primitive with VEXpression in the group expression node.


setup:

i have a skin node with 4 walls, 1 of them is bigger then the rest.

i use the messure node to measure the walls on area size.

then i use the attrib promote node with following setup:

original name: area
original class: primitive
new class: detail
promotion method: maximum
new name: maxArea
keep original

in the geo spreadsheet i see the detail called maxArea with the correct info. so until this point it works fine (i think)

add group expression node and set it up like this:

group type: primitive
group name: biggestside
VEXpression: @Area == detail(“../attribpromote1”, “maxArea”, 0)

now whatever i do, it doesn't select the biggest side given by maxArea that i can find under detail tab, it just selects everything whatever i do, click, change or try

after more then 2 days searching i hope someone here can help me out. must be something small and stupid i guess.

i guess there is something very wrong in the VEXpression but i can't get it working.

someone knows what im doing wrong or knows another way to select the wall by detail on biggest area?

thanks in advance.

Attachments:
measure.jpg (398.2 KB)
attribpromote.jpg (393.8 KB)
groupexpression.jpg (414.8 KB)

User Avatar
Member
1743 posts
Joined: March 2012
Offline
pande
original name: area
pande
VEXpression: @Area == detail(“../attribpromote1”, “maxArea”, 0)
Attribute names are case sensitive. Also, a couple useful tips are that the detail VEX function [www.sidefx.com] doesn't need the 3rd parameter, since it's just ignored anyway, and most geometry reading functions will accept integers to refer to input geometry, so you could do:

@area == detail(0, "maxArea")

Hopefully that works for you!

Edit: Oh, also, the other big thing to note is that if multiple primitives have the same area and they have the maximum area, it might select multiple, but that might be fine for the case you need it for.
Edited by neil_math_comp - Oct. 12, 2018 12:01:04
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
40 posts
Joined: Oct. 2018
Offline
wow,

sir, i want to thank u so much after finally seeing that one wall change color… felt like i won a F1 race!

now i will examine it 10 times again to totally understand it.

thanks allot, ur the best!
  • Quick Links