Jump to content

hou.hmath.rand() doesn't work with object seed


Yorkst

Recommended Posts

This works as a code for a python geometry operator:

node = hou.pwd()
print hou.hmath.rand(42.3);

 

This fails:

node = hou.pwd()
print hou.hmath.rand(node);

It prints TypeError: in hmath_rand argument 2 of type double

 

Is there a python RNG, which accepts houdini objects like seed?

Link to comment
Share on other sites

Python built-ins id(object) and hash(object). All inconsistent between Python (and Houdini) sessions. There is also hashlib module. Maybe Python or hom have something even better. I'm not into scripting a lot. There is hou.Node.sessionId() for Node's instances, but it works in similar way as aforenamed functions.

Link to comment
Share on other sites

Is there any HScript/HScript Expression doing a better job? One I can find is similar to what hou.Node.sessionId() does. What's your situation, more precisely? Talking about limited-unlimited, there is bunch of this-still-not-implemented HScript equivalents I personally missed in HOM. Actually, found that they available, because I've never used "non-expression" HScript. You can invoke both from each other. hou.hscript() and bunch of other functions exists.

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