Hi, I'm new to HE
trying to convert Calendar date to Jdate
but since the number is over 7 digits,
I can't get the correct results via VEX like coding in other language,
so How can I create a double value via scripting in Houdini?
or is there a node to handle double attribute in obj Network?
Thanks in advance :[
How to create a double precision parameter in VEX or by a node
1872 6 0- defreestijl
- Member
- 9 posts
- Joined: Aug. 2022
- Offline
- mestela
- Member
- 1746 posts
- Joined: May 2006
- Offline
I investigated something similar recently:
https://www.tokeru.com/cgwiki/HoudiniVex#itoa_and_64_bit_precision_limits [www.tokeru.com]
"The fix required to swap to 64 bits, which you can do on a wrangle by going to the bindings tab, and changing 'VEX Precision' to 64-bit."
https://www.tokeru.com/cgwiki/HoudiniVex#itoa_and_64_bit_precision_limits [www.tokeru.com]
"The fix required to swap to 64 bits, which you can do on a wrangle by going to the bindings tab, and changing 'VEX Precision' to 64-bit."
- tamte
- Member
- 8599 posts
- Joined: July 2007
- Offline
first thing you need to do is make sure your Spreadsheet is showing full precision (View/Full Precision)
and then you should see the correct answer (instead of rounded number) even with default 32bit single precision float
then if you still need your floats to be double precision, set Bindings/VEX Precision to 64 bit
and then you should see the correct answer (instead of rounded number) even with default 32bit single precision float
then if you still need your floats to be double precision, set Bindings/VEX Precision to 64 bit
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- defreestijl
- Member
- 9 posts
- Joined: Aug. 2022
- Offline
mestela
I investigated something similar recently:
https://www.tokeru.com/cgwiki/HoudiniVex#itoa_and_64_bit_precision_limits [www.tokeru.com]
"The fix required to swap to 64 bits, which you can do on a wrangle by going to the bindings tab, and changing 'VEX Precision' to 64-bit."
Hi, thanks for your help,
the website is a good learning source for a newbie like me
I changed the VEX Precision to 64-bit and now it works :]
- defreestijl
- Member
- 9 posts
- Joined: Aug. 2022
- Offline
tamte
first thing you need to do is make sure your Spreadsheet is showing full precision (View/Full Precision)
and then you should see the correct answer (instead of rounded number) even with default 32bit single precision float
then if you still need your floats to be double precision, set Bindings/VEX Precision to 64 bit
Hi, thank you for the reply
I haven't noticed I can tweak the settings in Spreadsheet views,
thanks it really help.
- animatrix_
- Member
- 4531 posts
- Joined: Feb. 2012
- Offline
helinavsar849
Hello! As a new Houdini user myself, I definitely understand the challenge of dealing with large numeric values.
For double precision parameters in VEX, you can use the double data type. For example:
double myValue = 1.234567e8;
This will store the number with full double precision rather than truncating it to a 32-bit float.
You can also create double attributes on nodes using hou.Node.parm() and specifying the parameter type as hou.parmTemplateType.Float.
There are a couple of nodes that can handle double precision attributes as well. The Attribute Create and Attribute Wrangle nodes have options for float and double parameter types.
I hope this helps provide some options for storing and manipulating large numeric values in Houdini! Don't hesitate to ask any other questions as you continue learning. The Houdini community is really helpful for troubleshooting. Good luck!
There is no double data type in VEX. It looks like this text is generated by Chat GPT.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- jparker
- Member
- 296 posts
- Joined:
- Online
-
- Quick Links