Showing posts with label strip. Show all posts
Showing posts with label strip. Show all posts

Friday, 31 January 2020

Getting the name of the parent node

Sometimes you'll need the name of the parent/container node that you're working in. It might be a "car_01" or something like that.

What you need to do is trick a wrangle into using houdiniscript. We do this by creating a parameter/channel and then typing in the script we wish to run, enclosed with backticks ` `

opname is the function we want to run and .. will get us up a level.
so in the wrangle use

s@string_name=chs("whatever");

hit the create-channel-box button, then type this in it

`opname("..")`

you now have a string value of the parent node that you could strip/atoi, whatever.

Tuesday, 16 May 2017

Getting data from strings

for example, once you've shattered something you end up with a lot of "pieces". Piece1, piece2, piece56000.
You might want to use the number as a seed value.
Usually the piece number is stored in the @name attribute.
In a wrangle, you can strip out the word piece, as follows... (and use atoi, to convert the string number to a number number)


s@testval=s@name;

@testval=strip(@name,"piece");
f@randval=rand(atoi(@testval));