Jump to content

Variable checking.


Symbolic

Recommended Posts

I think you get an 'h' in there.. but from 'MAPU' I think you're looking for a way to check if there's an attribute rather than a session variable.. have a look at

haspointattrib

hasvertexattrib

echo `haspointattrib("../OUT","uv")` returns 1 if uvs exist

Thanks!

But I could not get it working:

echo `ishvariable("MAPU")` will return 0 ?

Any ideas?

Edited by AdamJ
Link to comment
Share on other sites

I think you get an 'h' in there.. but from 'MAPU' I think you're looking for a way to check if there's an attribute rather than a session variable.. have a look at

haspointattrib

hasvertexattrib

echo `haspointattrib("../OUT","uv")` returns 1 if uvs exist

Hello AdamJ,

Sorry for the multiple posts. I need to explain this in a better way.

The problem is this:

I have two string inputs on my OTL

(1) Attribute to use:

(2) Component:

So if the user goes "foo" in section (1), then he may specify "FOO1" as the first component in section (2).

I can check both of those conditions, I check if the attribute "foo" exists, then I guarantee that it is mapped and "FOO1, FOO2, FOO3" are valid.

If "foo" does not exist, I flag and error.

* * *

However, lets have a look in a more complex situation as bellow, (Here I need an extra way of variable checking)

So if the user goes "uv" in section (1), then he may specify "MAPU" as the component or "UV1" for the first component

If he miss types MAPU as MAPG for example, the process will fail.

So as you see, I need to check the native Houdini variables towards this. The "h" in there was for that, "ishvariable", is supposed to check the native Houdini variables (I guess?).

Any ideas?

Thanks for the help.

Link to comment
Share on other sites

ishvariable will check only the variables that are declared in houdini (show up in Edit->Aliases and Variables window). isvariable is just a superset, it will check in houdini or os onse.

For checking/remapping strings have a look at 'strmatch'.. btw if if you add '-k' you can search for command/expressions that contain the keyword you're looking for. So if you want to find expressions that have something to do with strings you can do 'exhelp -k string'.

Link to comment
Share on other sites

ishvariable will check only the variables that are declared in houdini (show up in Edit->Aliases and Variables window). isvariable is just a superset, it will check in houdini or os onse.

For checking/remapping strings have a look at 'strmatch'.. btw if if you add '-k' you can search for command/expressions that contain the keyword you're looking for. So if you want to find expressions that have something to do with strings you can do 'exhelp -k string'.

Thanks AdamJ,

However I still do not know how to check if $MAPG is a wrong, well I can do that with some string by string checking. But it would have been nice to be able to check if a string is one of Houdini's own declared variables, like $CR, $PT, $MAPU etc.

Thanks.

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