Jump to content

what expression to get total number of attributes?


Recommended Posts

Hi

 

 

How to get total number of attributes coming from "connectivity" node?

 

i wish to put a color ramp parameter and i need last value of range be the total number of "connected pieces" of connectivity found on geometry.

 

so, in my color ramp will be:

 

    range:  0 to <number of connected pieces found>

 

thanks in advance.

Edited by Malcolm Zaloon
Link to comment
Share on other sites

If you promote your attribute (let's call it "number") as a detail with maximum as Promotion Method, you'll have the total of connection found minus 1 (since it starts counting at 0). You can then call this attribute via the detail expression :

detail(opinputpath(".",0),"number",0)+1

 

 

edit : magneto had been quicker :)

Edited by iamyog
  • Like 1
Link to comment
Share on other sites

You can but you have to do it manually. Unfortunately this is one of the things in Houdini that are not done automatically by every SOP that creates attributes. I think it's simple overlooks though as I can't imagine any noticeable overhead from adding a handful items to the varmap dictionary.

 

So now you either have to use AttribCreate to create the exact same attribute but turning off Write Values, or you can use addvariablename function in PointWrangle SOP.

 

I think there was something for this on Orbolt that's supposed to make it easier.

Link to comment
Share on other sites

wow.. to fast ... i´m newbie! heheheh ;)

 

 

so my intuition is correct, the obvious is have a local variable accessible, on all nodes, right? so, developers need complete this task updating all nodes that not have this.. for a easier workflow...

i remember this lack on carve node, what is a big issue, so i need stamp every time i need a variation by id,prim,etc... why some nodes have this others no SESI?

 

 

and.. what is varmap dictionary? :)

Link to comment
Share on other sites

I am not sure why they are overlooked because the variables are clearly part of the workflow. But if it was me, I would just remove all variable functionality and replace them with VEXpression style access. So you would just say @total inside any parameter and Houdini would know it.

 

Otherwise it feels too convoluted and micro-managed IMO, and creates another layer of indirection.

 

As for varmap, I might be wrong, but I think it's a dictionary that basically maps any string to any other string you want, so in your case, "total" to "TOTAL", but it could be anything.

 

The underlying data structure might be different, so SESI guys might need to comment on this :)

Edited by magneto
Link to comment
Share on other sites

I really think that diferent approach for diferent nodes and parts is really breaking workflow, and direct acess to variables need be enable in all nodes and places on Houdini to unify and standardize methods.

 

Houdini is fantastic, but this convoluted things are very annoying. its a MUST fix this thing for soon. say.. Houdini 13.1?

 

Thanks Magneto!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...