Jump to content

hscript noise - python noise1d discrepancy / confusion


bytezen

Recommended Posts

1) According to the documentation in Python, hou.hmath.noise1d, is equivalent to the noise in Hscript. Give this I would expect calling noise1d with the same parameters would produce  similar images. However, I am unable to get the same plasma-blob look using the python noise function. I have adjusted the scaling factors for TX and TZ in the python version but no matter what I choose I can not get large black sections.

 

 

 

(above - python version below - hscript version)

 

in Primitives SOP I am adding color in the red channel as follows:

 

hou.hmath.noise1d((lvar('TX')*0.4,lvar('TY'),lvar('TZ')*0.6))

 

in the hscript version:

 

noise($TX*0.4,$TY,$TZ*0.6)

 

 

post-10960-0-39499600-1389651614_thumb.p

 

 

2) Also according to the documentation you should be able to provide the noise1d function with a sequence of 1 to 4 numbers for different types of noise fields. I get an error whenever with the following:

 

hou.hmath.noise1d((lvar('TX')*0.4)) or  hou.hmath.noise1d(lvar('TX')*0.4) 

 

 

Could someone educate me?

 

Cheers and thanks in advance!

 

noise testing.hipnc

 

Link to comment
Share on other sites

first of all the help says that hou.math.noise1d() matches noise() function from VEX not HScript, and it does, so for your case put AttribWrangle SOP in set class to Primitive and type:

@Cd = 0;
@Cd.x = noise(@P*{0.4,0,0.6});

and you will see the same result as your python script in Primitive SOP (however I recommend VEX approach from performance point of view)

 

secondly, for sequence of 1 number you need to type

hou.hmath.noise1d((lvar('TX')*0.4, ))

it's a python thing, since (x) is not the sequence, it's one value in parentheses (x, ) is sequence with the length of one

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