peliosis Posted May 28, 2006 Share Posted May 28, 2006 I'm making a curve width visualize otl, it's easy and almost done, but there is one flaw I can't omit. Instead of going into the otl and typing an expression into attribute value of attribcreate sop I'd like to write it into my otl parameter window. I created a string parameter in my otl and connected attrib create from inside this otl via ch("../../blah/my_string_parameter") or chs. It works with numbers and expressions (in backticks) as long as the expression doesn't make use of local variables like $PT. I'd like to create a link which would not read this expression in otl level but inside it. To put the same expression as is into inside attribcreate and evaluate it there. Hope I made myself clear, are there any clues? Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 29, 2006 Share Posted May 29, 2006 Try chsraw I think that delays the evaluation of the string until the sop gets hold of it Quote Link to comment Share on other sites More sharing options...
peliosis Posted May 29, 2006 Author Share Posted May 29, 2006 Try chsrawI think that delays the evaluation of the string until the sop gets hold of it 28117[/snapback] It works half way...It produces a plain string when I put echo`exp` in textport but not the effect wanted. k_showidth_02.hipnc Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 29, 2006 Share Posted May 29, 2006 It works half way...It produces a plain string when I put echo`exp` in textport but not the effect wanted. 28120[/snapback] Sorry, try this evals(chsraw("../width_value")) Quote Link to comment Share on other sites More sharing options...
peliosis Posted May 29, 2006 Author Share Posted May 29, 2006 Sorry, try thisevals(chsraw("../width_value")) 28122[/snapback] I'd never figure it out, thanks a lot it works great now! I'll post my otl after finishing, now I'm working on getting width from custom channel, curve or just chops. Quote Link to comment Share on other sites More sharing options...
peliosis Posted May 29, 2006 Author Share Posted May 29, 2006 I ended some phase and post a result, If anybody could tell me why $F expression doesn't work in the expression field I'd be grateful. I thought of something like this from the beginning of my houdini experience, after using 3ds max loft with similiar functions. I'm going to improve it to a series of tiny otls. If you have any ideas for improvement or any critics please share. This is mostly for training. Thanks k_showidth_02.hipnc Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted May 29, 2006 Share Posted May 29, 2006 I ended some phase and post a result, If anybody could tell me why $F expression doesn't work in the expression field I'd be grateful.I thought of something like this from the beginning of my houdini experience, after using 3ds max loft with similiar functions. I'm going to improve it to a series of tiny otls. If you have any ideas for improvement or any critics please share. This is mostly for training. Thanks 28133[/snapback] Hello, in your fetch_widthcurve, change the Channel Range to "use Start/End", and then in your Start field, type $RFSTART and End field, type $RFEND. Hope that's what you're looking for. Take care, Alex Quote Link to comment Share on other sites More sharing options...
peliosis Posted May 30, 2006 Author Share Posted May 30, 2006 Thanks but no , it does constrain channel length to animation length but this is not the case. If you try putting an expression using $F or $FF into "width_val" of the otl, you'll notice that it doesn't work, so it's impossible to make automatic animation of eg. sinus or anything using current frame. I don't know why id doesn't work, Ithought $F is a global variable. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 30, 2006 Share Posted May 30, 2006 I ended some phase and post a result, If anybody could tell me why $F expression doesn't work in the expression field I'd be grateful. 28133[/snapback] Not sure I follow what you mean here, if I put $F in your expression field and press play the width changes for each frame as I'd expect. Could you post an example with it not working? If you mean how to make it read an animation curve that has an expression in it based on $F take a look at the attached. You need evals not just eval k_showidth_si.hipnc Quote Link to comment Share on other sites More sharing options...
peliosis Posted June 1, 2006 Author Share Posted June 1, 2006 Thanks for the example. I meant that when I put "clamp(sin($PT*$F+8)*20,5,20)" (the same expression only $F instead of a number) it doesn't work but gives blank viewport and red triangle. When I put $F alone or sin($F)*100 it works ok. When I combine $F with $PT there is a problem. Quote Link to comment Share on other sites More sharing options...
stevenong Posted June 1, 2006 Share Posted June 1, 2006 Please try eval(chsraw("../width_value")) instead of evals(). eval() will constantly evaluate the expression while evals() seems to evaluate it just once. Hope the above helps! Cheers! steven Quote Link to comment Share on other sites More sharing options...
edward Posted June 1, 2006 Share Posted June 1, 2006 You shouldn't use evals(). The difference between eval() without an s and evals() with an s is the fact that the former returns a float while the later returns a string. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted June 1, 2006 Share Posted June 1, 2006 Interesting, how come my example doesn't work if you eval but does if you use evals like I did? I thought that by using evals it returns a string that is then parsed correctly by the parameter as a written expression, however if you use eval it fails because eval can't evaluate the $PT and $F parts correctly. 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.