Jump to content
Sign in to follow this  
The Batchman

Graphing bitcoin in Houdini with python

Recommended Posts

Hey guys,

I'm very interested in anything with crypto currencies like Bitcoin. I've coded something together that grabs the current Bitcoin price from the web and throws it into Houdini as a 3d text.

qSDPtAY.png

I've also managed to get the Bitcoin price history and graph it inside Houdini.

Don't know tho whom it may be useful but look around or maybe even improve it. Maybe it might create new ideas.

Python code and example available in the attachment or at github.

The Batchman

Bitcoin.hipnc

  • Like 1

Share this post


Link to post
Share on other sites

just downloaded it out of curiosity. getting an error on the python sop with line 1 "import requests"
it cant find that module. using H16
cheers

Share this post


Link to post
Share on other sites
On 3/30/2017 at 4:06 PM, 3dome said:

just downloaded it out of curiosity. getting an error on the python sop with line 1 "import requests"
it cant find that module. using H16
cheers

Oh dear! I thought python came with the requests library by default.

If you are on a Linux machine you can open up a terminal and enter the command:

pip install requests

If you are on a Mac or Windows machine I don't know how to get it to be honest. However I think this is a good start if you need this to work.

Hope you get it working!

Share this post


Link to post
Share on other sites

Thanks. I'm using Windows but I think I'll find a way to get that library ;)

 

Share this post


Link to post
Share on other sites

pip also works on windows if you have it installed, a very useful tool. I can't recall if it actually came with the python installer or was separate, to be honest.

Share this post


Link to post
Share on other sites

You can use Anaconda (https://www.continuum.io/downloads) to get a more robust Python, with more libraries including requests, this is a data science package, so if you feel adventurous, you can play around and get more data into Houdini.

Cheers,

P.D. Anaconda also includes a terminal that supports pip command.

  • Like 2

Share this post


Link to post
Share on other sites

Note sure if totally related, but did you know that you can use http:// and ftp:// URI's directly in file fields in Houdini?  For example, you can refer to an image fetched by an http request directly in COPs, textures, backgrounds or wherever you encounter image paths.

 

PS. You can add your own -- see the FS_ReaderHelper/etc docs

Share this post


Link to post
Share on other sites
On 4/7/2017 at 0:54 AM, Jason said:

Note sure if totally related, but did you know that you can use http:// and ftp:// URI's directly in file fields in Houdini?  For example, you can refer to an image fetched by an http request directly in COPs, textures, backgrounds or wherever you encounter image paths.

 

PS. You can add your own -- see the FS_ReaderHelper/etc docs

That is really cool! Didn't know that was possible with files too. Might be helpful one day.

I've noticed though that HTTPS is not supported, while HTTP is. I've tested this in my python script and also just checked this with a COP File node. Doesn't want to import anything HTTPS, the error generated from the python shell is the following.

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:334: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html
#ssl-warnings

SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:132: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning

 

Share this post


Link to post
Share on other sites

Interesting, I didn't know that. Perhaps SideFX would have some insight if you wanted to solve this puzzle.

FWIW, we have implemented our own URI handlers pointed at our asset system using that class. It can be very intuitive if done right.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×