Jump to content

remove last point in blast node using ptnum / numpt?


anicg

Recommended Posts

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?

 

 

remove_last_point_v2.png

last_point.hiplc

Edited by anicg
Link to comment
Share on other sites

  • anicg changed the title to remove last point in blast node using ptnum / numpt?

@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 ?

Link to comment
Share on other sites

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

documentation npoints.png

Edited by anicg
Link to comment
Share on other sites

@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 by islamoos
  • Like 2
Link to comment
Share on other sites

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

 

  • Like 3
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...