Anti-Distinctlyminty Posted November 12, 2016 Share Posted November 12, 2016 Hi all, I find myself in a situation where I need to use a 64bit integer in order to create an unique id (and there is no other way around it). However, wrangle nodes and VOPs seem to be limited to 32 bit, so the question is - how do you perform calculations on 64 bit integer attributes? I've attached a simple scene that demonstrates the problem, in which you can see that the attribute 'a' becomes screwed up because it exceeds a 32 bit int, even though teh variable is 64 bit. Bit_id.hipnc Quote Link to comment Share on other sites More sharing options...
l0op1ng Posted November 12, 2016 Share Posted November 12, 2016 Hi, Python seems to support 64 bits but vex will automaticaly discard extra bits and convert your attribute to 32 bits. If you have a small point cloud it can be helpfull to do it with python, but if you need to manipulate a big number of points you will be in trouble (performances). One way to reduce 64 bits manipulation can be to try to define an array of ids in 64bits at the detail level and use a basic index at point level referencing the detail array attribute. At the end of your process and depending of your number of points you may want to create the final 64 bit attribute using python with the correct id using the index and the array of ids. If you are using houdini engine, you may be able to do that operation on your engine instead of houdini. Or you can pray that there is another solution or sidefx will one day fix that Hope it helps... From the documentation : https://www.sidefx.com/docs/houdini/vex/lang Data types Warning VEX uses 32 bit integers. If you use the AttribCast SOP to cast a geometry attribute to 64 bits, VEX will silently discard the extra bits if you manipulate the attribute in VEX code. You can use underscores to break up long numbers. Quote Link to comment Share on other sites More sharing options...
ttvd Posted November 14, 2016 Share Posted November 14, 2016 Engine does not support 64 bit attributes, as far as I know. You'd probably have to pack into 32 bit integers and then do unpacking on your host side if you went that route. Quote Link to comment Share on other sites More sharing options...
davpe Posted November 14, 2016 Share Posted November 14, 2016 (edited) can't you do whatever you need with attribcreate SOP which supports 64-bit numbers? I mean, for just creating point id that should do, right? (didn't have a time to check the sample file though) Edited November 14, 2016 by davpe Quote Link to comment Share on other sites More sharing options...
l0op1ng Posted November 14, 2016 Share Posted November 14, 2016 64 bits support seems to work in HAPI since : Houdini 15.5.439 Houdini 15.5.439 HAPI: Added 64-bit int and float attribute data getters and setters: HAPI_GetAttributeInt64Data() HAPI_GetAttributeFloat64Data() HAPI_SetAttributeInt64Data() HAPI_SetAttributeFloat64Data() HAPI_Int64 typedef HAPI_STORAGETYPE_INT64 enum HAPI_STORAGETYPE_FLOAT64 enum https://www.sidefx.com/changelog/Main/?journal=&categories=&body=64&version=&build_0=&build_1=656&show_versions=on&show_compatibility=on&items_per_page= 1 Quote Link to comment Share on other sites More sharing options...
Anti-Distinctlyminty Posted November 14, 2016 Author Share Posted November 14, 2016 I circumvented my need for it this time, but I was trying to create an ID for points scattered onto many sphere. Each sphere had an ID, and points had a uv coordinate supplied by the Scatter SOP. So my idea was to construct a unique ID for each point by essentially making a number of the form: [SphereID] [int(1000*uvcoord[0])] [int(1000*uvcoord[1])] I've yet to delve into the wonders of Houdini's API Quote Link to comment Share on other sites More sharing options...
Anti-Distinctlyminty Posted November 14, 2016 Author Share Posted November 14, 2016 40 minutes ago, davpe said: can't you do whatever you need with attribcreate SOP which supports 64-bit numbers? I mean, for just creating point id that should do, right? (didn't have a time to check the sample file though) Maybe, however that would require expressions, which I try my best to avoid due to their slow speed. Also, I've had issues determining what the actual value is, as the parameter spreadsheet and viewport display slightly different numbers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.