anicg Posted February 23, 2023 Share Posted February 23, 2023 (edited) Attached hip file. I need to remove the last point. I can't talk to the blast node, I could figure out the vex code in the attribute wrangle, but I want to be able to use the blast node as well. I prefer to avoid Hscript because I understood it's slowly being phased out. (How) do I use ptnum and numpt in the blast node? last_point.hiplc Edited February 23, 2023 by anicg Quote Link to comment Share on other sites More sharing options...
Atom Posted February 23, 2023 Share Posted February 23, 2023 Instead of removing the point in the wrangle, just create a group containing only that point. Supply that group name to the blast node. if(@ptnum==(@numpt-1)){i@group_last_point = 1;} Quote Link to comment Share on other sites More sharing options...
islamoos Posted February 23, 2023 Share Posted February 23, 2023 @anicg Seems to me the quickest and cleanest solution is to just go with expression functions and use npoints(). Where did you get the impression Hscript is being slowly phased out? In the documentation it just says you should probably use Python for complex scripting. I mean brand new labs nodes prominently feature expression functions + with the way Houdini works (a lot of support for legacy workflows) I don't see them completely removing Hscript in the next 10-20 years, not without completely rebuilding half of the program from the ground up.. Maybe you have some info I don't ? Quote Link to comment Share on other sites More sharing options...
anicg Posted February 24, 2023 Author Share Posted February 24, 2023 (edited) @islamoos If I need to use HScript, how do I use the npoints()? the documentation is very very short. I've tried: 0 npoints()-1 0 npoints(0)-1 nothing seems to work. About Hscript, someone said it in a course, but I think I've taken it a step too far, he said SideFX is moving more towards vex and less HScript, which I perhaps wrongly interpreted as slowly phasing out HScript. I don't know how accurate his statement is as he teaches vex, so it may be a bit biased. Edited February 24, 2023 by anicg Quote Link to comment Share on other sites More sharing options...
Ziyad Posted February 24, 2023 Share Posted February 24, 2023 Try this - make sure to choose points as the group type Quote Link to comment Share on other sites More sharing options...
islamoos Posted February 25, 2023 Share Posted February 25, 2023 (edited) @anicg What your instructor probably meant is that it isn't widely used for scripting anymore. And he is correct, if you want to write scripts that are longer than a line you should probably use Python where in the past Hscript was the only way to go. That being said for simple one line expressions Hscript is still the simplest solution most of the time. And like Ziyad said when using an expression function in a field that expects a string you need to use `backticks` so Houdini recognizes it needs to evaluate an expression not a string. Edited February 25, 2023 by islamoos 2 Quote Link to comment Share on other sites More sharing options...
mrCatfish Posted February 25, 2023 Share Posted February 25, 2023 11 hours ago, islamoos said: @anicg What your instructor probably meant is that it isn't widely used for scripting anymore. And he is correct, if you want to write scripts that are longer than a line you should probably use Python where in the past Hscript was the only way to go. That being said for simple one line expressions Hscript is still the simplest solution most of the time. And like Ziyad said when using an expression function in a field that expects a string you need to use `backticks` so Houdini recognizes it needs to evaluate an expression not a string. Yes, I'd say if you can do it with hscript, you should. Python is great, but it's slower than hscript and most of the time, longer. I've seen files with trillions of lines of python where most of it could be done with SOPs or simple hscript. I guess if all you have is a hammer everything looks like a nail. 3 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.