Jump to content

Access Detail Attribute In An Expression [SOLVED]


Recommended Posts

Hello! I'm trying to animate the Carve SOP's 'Second U' channel by using the expression:

fit($FF,1,25,0,1)

This works fine to animate from frame 1 to 25, but as soon as I try to read previously set detail attributes as part of the expression, I get an error.

image.thumb.png.f91956b12cb73898dede6ee79ca70c9f.png

image.png.6130498df6424d61329689a802a14c06.png


So I've made sure to first create the detail attributes, then This is what I'm trying to use:

fit($FF,`detail(0,"start_frame",0)`,`detail(0,"end_frame",0)`,0,1)

What am I not understanding about accessing detail attributes in an expression?

File attached.
carve_read_detail_attribute.hiplc

Edited by GlennimusPrime
Link to comment
Share on other sites

Posted (edited)

Backticks are only needed when working with a string expression? OK got it thanks!

I removed the backticks and now it seems to work ok.

i@start_frame = chi("start_frame");
i@end_frame = chi("end_frame");

image.png.c5d323852812d619f2b18117add331d9.png

Then using this on the Carve SOP:

fit($FF,detail(0,"start_frame",0),detail(0,"end_frame",0),0,1)

Here's the updated .hip file if anyone needs it.

carve_read_detail_attribute_v3.hiplc

Edited by GlennimusPrime
Link to comment
Share on other sites

  • GlennimusPrime changed the title to Access Detail Attribute In An Expression [SOLVED]
7 hours ago, GlennimusPrime said:

Backticks are only needed when working with a string expression?

No, usually we are using expressions in parameters of nodes. Parameters such as file path, group, attributes name etc. are string parameters and in these parameters when result of an expression should be text you must use backticks with that expression.

For example in "Group" parameter to get last point number of the incoming geo use `npoints(0)-1`. If you want to create copies of the geo as much as incoming geo contains points with copy and transform sop use npoints(0) without backticks in "Total Number" parameter of the node because this is numeric parameter.

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...