detail att wrangle / att create

   2826   10   0
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
Hello

I do not understand why in att wrangle on details @myend = detail(“op:../Area1/”,“end”); works
and on attr create I can't use as value detail(“op:../Area1/”,“end”) to create a new attribute with it.

If someone can explain, please.
thanks
Edited by innocent - 2020年6月22日 11:10:18
User Avatar
Member
8539 posts
Joined: 7月 2007
Online
cause Attribute Wrangle is VEX, whie in parameters of Attribute create you can use only expressions (like Hscript or Python)
and detail function in Hscript has different syntax so you can try
detail("../Area1", "end", 0)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
Ok thanks, Tamte.

so why they don't give the value on “default” channel parameter for a float
detail(“../Area1”, “end”, 0)
detail(“op:../Area1/”,“end”)

always the same result : 0 means fail I guess
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
if I follow this :
In the expression language, there are two named functions to get detail attributes, `detail` and `details`. The first returns a float and takes an index into the attribute (so you can get components of a vector). The second returns a string and has no index.
-> to get string
Thus, there are some changes needed
1) A terminating backtick.
2) Use details, not detail.
3) Remove the 0 parameter

`details(“../set_dissolve_string”, “edge_string”)`


so to have a float, should be :
`detail(“../Area1”, “end”,0)`
it's not working on channel parameter (hda)
User Avatar
Member
7758 posts
Joined: 9月 2011
Online
backticks are only needed if the expression has to be evaluated, such as when it's in a string parameter without keyframes. If the expression is the function for a keyframe, which will always be the case for float parameters, then no backticks are used.
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
Ok thanks, Jsmack.

I've made a very simple test case, all “expression” seems to be false for the default channel parameter.
What is the secret to use detail as value here?


Attachments:
att_wr_att_cr.hiplc (94.6 KB)

User Avatar
Member
7758 posts
Joined: 9月 2011
Online
I'm not sure what you've got in your parameter dialog, but it all works for me.

Attachments:
detail_expressions.hip (98.6 KB)

User Avatar
Member
8539 posts
Joined: 7月 2007
Online
“../area” is not the correct path, your area node is a child of your hda so “./area”
and in your first parameter with absolute path you are not using correct quotes ""but “”for some reason as if they were pasted from somewhere
then the third one will be the only one that is not supposed ot return the value
Edited by tamte - 2020年6月23日 00:24:28

Attachments:
att_wr_att_cr_fix.hiplc (93.6 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
it's scary, I open your scene Tamte, it works fine. To be sure to do not make mistakes, I create a new scene and copy/paste ur line and it's not working on my scene.

User Avatar
Member
8539 posts
Joined: 7月 2007
Online
not sure what you copied and pasted, I still see incorrect relative path “../area” on your screenshot
PS: I replaced just the expressions on the hda instance parameters, I didn't modify the defaults in the HDA definition, so those default values were still your old ones
Edited by tamte - 2020年6月23日 01:22:27
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
35 posts
Joined: 2月 2017
Offline
alright… Thanks guys to help new users, even if they have very basic issues.
  • Quick Links