Detail Attribute Returning 0

   3651   9   0
User Avatar
Member
128 posts
Joined: Sept. 2018
Offline
I have a detail attribute that is a number.... I need this to set my max frame range for a ROP.
`details("../attributepromote1//", "myAttrib")`

Returns a "0" instead of the number "2" and gives the error below.

Error: Unable to evaluate expression (Syntax error (/obj/Main_Object/rop_geometry1/f2)).

Vincent Griffith
Edited by VGriffith - Nov. 17, 2021 21:55:57
User Avatar
Member
273 posts
Joined: Nov. 2013
Offline
try detail() instead of details(). details is for getting string attributes while detail numeric attributes.
User Avatar
Member
7771 posts
Joined: Sept. 2011
Offline
The syntax error is from the backticks around the expression. These are only for evaluating expressions as literals in string parameters. Numeric parameters always evaluate expressions because the expression is always a keyframe.
User Avatar
Member
128 posts
Joined: Sept. 2018
Offline
This is not working, the detail is still showing up as zero with all these suggestions...
User Avatar
Member
273 posts
Joined: Nov. 2013
Offline
VGriffith
This is not working, the detail is still showing up as zero with all these suggestions...
Can you post a hip file or screen grab of the expression?
Edited by antc - Nov. 18, 2021 18:42:19
User Avatar
Member
128 posts
Joined: Sept. 2018
Offline
FOUND OUT WHAT WAS WRONG. I needed to promote the detail attribute with the value of "2" to a primitive value, use
s@string_attribute = itoa(i@int_attribute);
to convert it from an integer to a string... then I promoted it back to a detail and used
`details("../attributepromote1//", "myAttrib")`
and then it worked.
Edited by VGriffith - Nov. 18, 2021 19:31:36

Attachments:
Working Correctly.hiplc (140.2 KB)

User Avatar
Member
273 posts
Joined: Nov. 2013
Offline
Glad you found a solution but none of the promotion or casting is needed. Just a switch from details() to detail() does the trick (hip file attached).
Edited by antc - Nov. 18, 2021 20:28:22

Attachments:
WorkingCorrectly.hipnc (164.2 KB)

User Avatar
Member
45 posts
Joined: April 2016
Offline
I see that I cannot use the detail function in a field that expects an integer otherwise it sets a key.
At least this is true for frame range fields.

So I added an null (exactly like the example file above) and that null had a string attribute that I put the detail function.
then I copied a reference to this field and pasted it into the frame range field and it now works.
Edited by geordiemartinez - July 13, 2022 20:15:59

Attachments:
2022-07-13_16-57-00.png (71.9 KB)
2022-07-13_16-57-50.png (131.4 KB)

User Avatar
Member
7771 posts
Joined: Sept. 2011
Offline
geordiemartinez
I see that I cannot use the detail function in a field that expects an integer otherwise it sets a key.
At least this is true for frame range fields.

So I added an null (exactly like the example file above) and that null had a string attribute that I put the detail function.
then I copied a reference to this field and pasted it into the frame range field and it now works.

What's wrong with setting a key? no ` required. I use keyframes on string parameters too.
User Avatar
Member
45 posts
Joined: April 2016
Offline
I can't get it to work in a time range attribute on an Alembic ROP the same way it would in a string attribute. I don't want to set a key because I will use different length alembics and always want the end value to be relative to the alembic length.
  • Quick Links