saca Posted March 24, 2021 Share Posted March 24, 2021 hi, simple python script sample 'a_b_c'.split('_')[0] >'a' samely, i want to execute python script as parameter value, example) hip filename is "s001_c001_myScene_v001.001.hip" $HIPNAME.split('_')[0] but it's retuen same strings, very confuse. i want get "s001" in this case. please tell me how to write them? thanks Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted March 24, 2021 Share Posted March 24, 2021 0. Switch expression language to Python (you've done that already) 1. Set a keyframe on the string parameter. This is required! 2. Set your expression like this: hou.expandString("$HIPNAME").split('_')[0] Quote Link to comment Share on other sites More sharing options...
saca Posted March 25, 2021 Author Share Posted March 25, 2021 that's great! "Set a keyframe", really need. thanks Quote Link to comment Share on other sites More sharing options...
saca Posted June 5, 2021 Author Share Posted June 5, 2021 RMB > Expand_String_Value it seems to get HScript value in keeping python setting. it's easy, but i do not recommend this way. because it shows the value but does not show what language using. Houdini shows color green for active language, and shows purple for other language. but this switching show black for normal-strings. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.