Adam Ferestad Posted August 17, 2011 Share Posted August 17, 2011 I am trying to make a field where I can enter an expression and just have that expression referenced into a node. What I am trying to do with it is really just for fun, but I am trying to make an implicit surface generator that uses 2 functions and 4 lines setup in a six pointed star formation with a skin node to make the surface. I have most of it working, but I am trying to figure out how to make a parameter interface and actually have it work. So far, I am trying to just use a float expression, but it doesn't seem to be working all that well (well, at all really). Is this something that needs a stamp reference? To apply the functions to the geometry, I am using Point SOPS after I position and resample my lines. Also, I don't seem to be able to use an average of the 2 functions for my 45 degree lines, which is frustrating and odd. I should be able to just reference the two functions in an (F(tx)+G(tz))/2 to get the average of the two functions, which should give the values for the two other lines. It works if I simply enter individual functions, but I can't seem to get any references working for it. Also, I am having some trouble closing the surface easily, does anyone have any suggestions? Quote Link to comment Share on other sites More sharing options...
edward Posted August 18, 2011 Share Posted August 18, 2011 I am trying to make a field where I can enter an expression and just have that expression referenced into a node. Can you use eval(chsraw("../my_expression_parameter")) ? Quote Link to comment Share on other sites More sharing options...
ikarus Posted August 18, 2011 Share Posted August 18, 2011 (edited) why do you need the actual expressions in the other parameter? ch("function1")+ch("function2")/2 ?? Edited August 18, 2011 by ikarus Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted August 18, 2011 Author Share Posted August 18, 2011 Trying to figure out how to do it for future projects where I might want access to it in a digital asset. I haven't gotten around to trying the suggestion above, some new quandary's have taken my attention, but this is definitely something I will want for reference. I am thinking of doing a digital asset tutorial for this month using the ability to input a math function to build a procedural space ship. One other quick use the Multiparam Block options in the folders on an interface? The project I want to do involves cross sections, so this would be ideal to use for creating each cross section and a nice thing to know anyways. How do I access the stuff in SOPS to create new geometry like I am describing. Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted August 18, 2011 Author Share Posted August 18, 2011 why do you need the actual expressions in the other parameter? ch("function1")+ch("function2")/2 ?? Oh, and i forgot to mention why you can't use (ch(1)+ch(2))/2 It doesn't work on point sops. Try it. Just use 3 lines with vectors pointing along the x axis and offset their centers offset along the z axis. Then resample them with a Max segs of something like 9 and append a point sop to them. In the first line point sop for ty, put in $TX^2. For the third, put in $TX^3. In the second, put in (ch("../point1/ty)+ch(point2/ty))/2 and see what happens. At least when i did this, the middle line did nothing. Quote Link to comment Share on other sites More sharing options...
anim Posted August 18, 2011 Share Posted August 18, 2011 (edited) of course it doesn't work if you use local variables like $TX on the parameter you are inputting your function into $TX means nothing (it evaluates to 0), even if it can work on that node it will return 0 if referenced. So your whole function is evaluated with zeros instead of local variables and therefore you get incorrect numbers the solution Edward provided eval(chsraw()) works ok, I've used it several times for similar reasons your referenced parameter should be string and you can write complete function including $TX and other local variables which Point SOP can use, It will be evaluated as expression directly written into Point SOP parameter and therefore it will behave correctly Edited August 18, 2011 by anim Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted August 18, 2011 Author Share Posted August 18, 2011 Good, that is really good news. Now I can get to figuring how I want this tutorial project to behave. Any idea on my second question, or should I just make a new thread for it. Using the multiparam things is something I would really like to know how to do. Quote Link to comment Share on other sites More sharing options...
anim Posted August 18, 2011 Share Posted August 18, 2011 here is a little example of multiparm usage in SOPs multiparm_usage.hip Quote Link to comment Share on other sites More sharing options...
Adam Ferestad Posted August 19, 2011 Author Share Posted August 19, 2011 Thank you so much Tomas. That did exactly what I was hoping it would. Now I am well on my way to developing a nice, robust surface modeling system based around math functions and their associated graphs. I am so glad to have this stuff in my bag of tricks now, and hopefully after I write the tutorial tomorrow, other people can add them too. Thanks. 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.